Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mahmoud/eng-4371-ord_sendinscription #32

Merged
merged 6 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
26 changes: 26 additions & 0 deletions src/request/types/ordinalsMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,29 @@ export type GetInscriptions = MethodParamsAndResult<
v.InferOutput<typeof getInscriptionsParamsSchema>,
v.InferOutput<typeof getInscriptionsResultSchema>
>;

export const SendInscriptionsMethodName = 'ord_sendInscriptions';
export const SendInscriptionsParamsSchema = v.object({
teebszet marked this conversation as resolved.
Show resolved Hide resolved
transfers: v.array(
v.object({
address: v.string(),
inscriptionId: v.string(),
})
),
});
teebszet marked this conversation as resolved.
Show resolved Hide resolved
export const SendInscriptionsResultSchema = v.object({
txid: v.string(),
});
export const SendInscriptionsSchema = v.object({
...rpcRequestMessageSchema.entries,
...v.object({
method: v.literal(SendInscriptionsMethodName),
params: SendInscriptionsParamsSchema,
id: v.string(),
}).entries,
});
teebszet marked this conversation as resolved.
Show resolved Hide resolved

export type SendInscriptions = MethodParamsAndResult<
v.InferOutput<typeof SendInscriptionsParamsSchema>,
v.InferOutput<typeof SendInscriptionsResultSchema>
teebszet marked this conversation as resolved.
Show resolved Hide resolved
>;