Skip to content

Commit

Permalink
Update vars
Browse files Browse the repository at this point in the history
  • Loading branch information
aryzing committed Oct 7, 2024
1 parent 4f99b8c commit 18113de
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions src/request/types/ordinalsMethods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof getInscriptionsParamsSchema>;

export const getInscriptionsResultSchema = v.object({
total: v.number(),
limit: v.number(),
Expand All @@ -26,21 +29,24 @@ export const getInscriptionsResultSchema = v.object({
})
),
});
export const getInscriptionsSchema = v.object({
export type GetInscriptionsResult = v.InferOutput<typeof getInscriptionsResultSchema>;

export const getInscriptionsRequestMessageSchema = v.object({
...rpcRequestMessageSchema.entries,
...v.object({
method: v.literal(getInscriptionsMethodName),
params: getInscriptionsParamsSchema,
id: v.string(),
}).entries,
});

export type GetInscriptions = MethodParamsAndResult<
v.InferOutput<typeof getInscriptionsParamsSchema>,
v.InferOutput<typeof getInscriptionsResultSchema>
export type GetInscriptionsRequestMessage = v.InferOutput<
typeof getInscriptionsRequestMessageSchema
>;

export type GetInscriptions = MethodParamsAndResult<GetInscriptionsParams, GetInscriptionsResult>;

export const sendInscriptionsMethodName = 'ord_sendInscriptions';

export const sendInscriptionsParamsSchema = v.object({
transfers: v.array(
v.object({
Expand All @@ -49,9 +55,13 @@ export const sendInscriptionsParamsSchema = v.object({
})
),
});
export type SendInscriptionsParams = v.InferOutput<typeof sendInscriptionsParamsSchema>;

export const sendInscriptionsResultSchema = v.object({
txid: v.string(),
});
export type SendInscriptionsResult = v.InferOutput<typeof sendInscriptionsResultSchema>;

export const sendInscriptionsSchema = v.object({
...rpcRequestMessageSchema.entries,
...v.object({
Expand All @@ -60,8 +70,9 @@ export const sendInscriptionsSchema = v.object({
id: v.string(),
}).entries,
});
export type SendInscriptionsRequestMessage = v.InferOutput<typeof sendInscriptionsSchema>;

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

0 comments on commit 18113de

Please sign in to comment.