Skip to content

Commit

Permalink
Merge pull request #32 from secretkeylabs/mahmoud/eng-4371-ord_sendin…
Browse files Browse the repository at this point in the history
…scription

mahmoud/eng-4371-ord_sendinscription
  • Loading branch information
m-aboelenein authored Jul 22, 2024
2 parents c8d4614 + 0d3abe8 commit 16297eb
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sats-connect/core",
"version": "0.1.1",
"version": "0.1.2",
"main": "dist/index.mjs",
"module": "dist/index.mjs",
"types": "dist/index.d.mts",
Expand Down
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({
transfers: v.array(
v.object({
address: v.string(),
inscriptionId: v.string(),
})
),
});
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,
});

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

0 comments on commit 16297eb

Please sign in to comment.