From 18113de2c187289ff4a2c73dccc0c3adccaac76d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduard=20Bardaj=C3=AD=20Puig?= Date: Mon, 7 Oct 2024 15:32:26 +0100 Subject: [PATCH] Update vars --- src/request/types/ordinalsMethods.ts | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/request/types/ordinalsMethods.ts b/src/request/types/ordinalsMethods.ts index 089c105..08a55c1 100644 --- a/src/request/types/ordinalsMethods.ts +++ b/src/request/types/ordinalsMethods.ts @@ -2,10 +2,13 @@ import { MethodParamsAndResult, rpcRequestMessageSchema } from '../../types'; import * as v from 'valibot'; export const getInscriptionsMethodName = 'ord_getInscriptions'; + export const getInscriptionsParamsSchema = v.object({ offset: v.number(), limit: v.number(), }); +export type GetInscriptionsParams = v.InferOutput; + export const getInscriptionsResultSchema = v.object({ total: v.number(), limit: v.number(), @@ -26,7 +29,9 @@ export const getInscriptionsResultSchema = v.object({ }) ), }); -export const getInscriptionsSchema = v.object({ +export type GetInscriptionsResult = v.InferOutput; + +export const getInscriptionsRequestMessageSchema = v.object({ ...rpcRequestMessageSchema.entries, ...v.object({ method: v.literal(getInscriptionsMethodName), @@ -34,13 +39,14 @@ export const getInscriptionsSchema = v.object({ id: v.string(), }).entries, }); - -export type GetInscriptions = MethodParamsAndResult< - v.InferOutput, - v.InferOutput +export type GetInscriptionsRequestMessage = v.InferOutput< + typeof getInscriptionsRequestMessageSchema >; +export type GetInscriptions = MethodParamsAndResult; + export const sendInscriptionsMethodName = 'ord_sendInscriptions'; + export const sendInscriptionsParamsSchema = v.object({ transfers: v.array( v.object({ @@ -49,9 +55,13 @@ export const sendInscriptionsParamsSchema = v.object({ }) ), }); +export type SendInscriptionsParams = v.InferOutput; + export const sendInscriptionsResultSchema = v.object({ txid: v.string(), }); +export type SendInscriptionsResult = v.InferOutput; + export const sendInscriptionsSchema = v.object({ ...rpcRequestMessageSchema.entries, ...v.object({ @@ -60,8 +70,9 @@ export const sendInscriptionsSchema = v.object({ id: v.string(), }).entries, }); +export type SendInscriptionsRequestMessage = v.InferOutput; export type SendInscriptions = MethodParamsAndResult< - v.InferOutput, - v.InferOutput + SendInscriptionsParams, + SendInscriptionsResult >;