Skip to content

Commit

Permalink
import schema
Browse files Browse the repository at this point in the history
  • Loading branch information
m-aboelenein committed Jul 16, 2024
1 parent c44bb2a commit 4ce10f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/request/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type * as BtcMethods from './btcMethods';
import { GetInscriptions } from './ordinalsMethods';
import { GetInscriptions, SendInscriptions } from './ordinalsMethods';
import type * as RunesMethods from './runesMethods';
import type * as StxMethods from './stxMethods';
import type * as WalletMethods from './walletMethods';
Expand Down Expand Up @@ -44,6 +44,7 @@ export type RunesRequestMethod = keyof RunesRequests;

export interface OrdinalsRequests {
ord_getInscriptions: GetInscriptions;
ord_sendInscriptions: SendInscriptions;
}

export type OrdinalsRequestMethod = keyof OrdinalsRequests;
Expand Down
14 changes: 7 additions & 7 deletions src/request/types/ordinalsMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,28 @@ export type GetInscriptions = MethodParamsAndResult<
v.InferOutput<typeof getInscriptionsResultSchema>
>;

export const sendInscriptionsMethodName = 'ord_sendInscriptions';
export const sendInscriptionsParamsSchema = v.object({
export const SendInscriptionsMethodName = 'ord_sendInscriptions';
export const SendInscriptionsParamsSchema = v.object({
transfers: v.array(
v.object({
address: v.string(),
inscriptionId: v.string(),
})
),
});
export const sendInscriptionsResultSchema = v.object({
export const SendInscriptionsResultSchema = v.object({
txid: v.string(),
});
export const sendInscriptionsSchema = v.object({
export const SendInscriptionsSchema = v.object({
...rpcRequestMessageSchema.entries,
...v.object({
method: v.literal(getInscriptionsMethodName),
params: sendInscriptionsParamsSchema,
params: SendInscriptionsParamsSchema,
id: v.string(),
}).entries,
});

export type SendInscriptions = MethodParamsAndResult<
v.InferOutput<typeof sendInscriptionsParamsSchema>,
v.InferOutput<typeof sendInscriptionsResultSchema>
v.InferOutput<typeof SendInscriptionsParamsSchema>,
v.InferOutput<typeof SendInscriptionsResultSchema>
>;

0 comments on commit 4ce10f2

Please sign in to comment.