From 9601023e6d009d2e39cdadce35ed8a15d5c9590e Mon Sep 17 00:00:00 2001 From: Mahmoud Aboelenein Date: Fri, 12 Jul 2024 03:04:28 +0300 Subject: [PATCH 1/5] added sendInscriptions schema --- src/request/types/ordinalsMethods.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/request/types/ordinalsMethods.ts b/src/request/types/ordinalsMethods.ts index 8e20250..f2386ce 100644 --- a/src/request/types/ordinalsMethods.ts +++ b/src/request/types/ordinalsMethods.ts @@ -39,3 +39,29 @@ export type GetInscriptions = MethodParamsAndResult< v.InferOutput, v.InferOutput >; + +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(getInscriptionsMethodName), + params: sendInscriptionsParamsSchema, + id: v.string(), + }).entries, +}); + +export type SendInscriptions = MethodParamsAndResult< + v.InferOutput, + v.InferOutput +>; From 4ce10f2fe9cec44438646668c7322d1fa53d0b90 Mon Sep 17 00:00:00 2001 From: Mahmoud Aboelenein Date: Wed, 17 Jul 2024 01:15:45 +0300 Subject: [PATCH 2/5] import schema --- src/request/types/index.ts | 3 ++- src/request/types/ordinalsMethods.ts | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/request/types/index.ts b/src/request/types/index.ts index 8b212fa..081e108 100644 --- a/src/request/types/index.ts +++ b/src/request/types/index.ts @@ -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'; @@ -44,6 +44,7 @@ export type RunesRequestMethod = keyof RunesRequests; export interface OrdinalsRequests { ord_getInscriptions: GetInscriptions; + ord_sendInscriptions: SendInscriptions; } export type OrdinalsRequestMethod = keyof OrdinalsRequests; diff --git a/src/request/types/ordinalsMethods.ts b/src/request/types/ordinalsMethods.ts index f2386ce..b2dab72 100644 --- a/src/request/types/ordinalsMethods.ts +++ b/src/request/types/ordinalsMethods.ts @@ -40,8 +40,8 @@ export type GetInscriptions = MethodParamsAndResult< v.InferOutput >; -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(), @@ -49,19 +49,19 @@ export const sendInscriptionsParamsSchema = v.object({ }) ), }); -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, - v.InferOutput + v.InferOutput, + v.InferOutput >; From bff2d1ed7c88a6b1e9941aa2d7391208953d33e4 Mon Sep 17 00:00:00 2001 From: Mahmoud Aboelenein Date: Wed, 17 Jul 2024 01:18:23 +0300 Subject: [PATCH 3/5] fix typo --- src/request/types/ordinalsMethods.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/request/types/ordinalsMethods.ts b/src/request/types/ordinalsMethods.ts index b2dab72..fff6b42 100644 --- a/src/request/types/ordinalsMethods.ts +++ b/src/request/types/ordinalsMethods.ts @@ -55,7 +55,7 @@ export const SendInscriptionsResultSchema = v.object({ export const SendInscriptionsSchema = v.object({ ...rpcRequestMessageSchema.entries, ...v.object({ - method: v.literal(getInscriptionsMethodName), + method: v.literal(SendInscriptionsMethodName), params: SendInscriptionsParamsSchema, id: v.string(), }).entries, From 4c8f1ee19e4098347415a9de293f835d2aff1d74 Mon Sep 17 00:00:00 2001 From: Mahmoud Aboelenein Date: Mon, 22 Jul 2024 10:58:51 +0300 Subject: [PATCH 4/5] code style fix --- src/request/types/ordinalsMethods.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/request/types/ordinalsMethods.ts b/src/request/types/ordinalsMethods.ts index fff6b42..089c105 100644 --- a/src/request/types/ordinalsMethods.ts +++ b/src/request/types/ordinalsMethods.ts @@ -40,8 +40,8 @@ export type GetInscriptions = MethodParamsAndResult< v.InferOutput >; -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(), @@ -49,19 +49,19 @@ export const SendInscriptionsParamsSchema = v.object({ }) ), }); -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(SendInscriptionsMethodName), - params: SendInscriptionsParamsSchema, + method: v.literal(sendInscriptionsMethodName), + params: sendInscriptionsParamsSchema, id: v.string(), }).entries, }); export type SendInscriptions = MethodParamsAndResult< - v.InferOutput, - v.InferOutput + v.InferOutput, + v.InferOutput >; From 0d3abe8406051a7941c3952b2c69e5ffd2e9c8ff Mon Sep 17 00:00:00 2001 From: Mahmoud Aboelenein Date: Mon, 22 Jul 2024 11:00:06 +0300 Subject: [PATCH 5/5] version bump --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index c1f943c..f04e265 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@sats-connect/core", - "version": "0.1.1", + "version": "0.1.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@sats-connect/core", - "version": "0.1.1", + "version": "0.1.2", "license": "ISC", "dependencies": { "axios": "1.6.8", diff --git a/package.json b/package.json index 7b60173..7d38a14 100644 --- a/package.json +++ b/package.json @@ -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",