@kuest/bindings 0.0.0-stage → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +4 -2
- package/dist/chunk-2KNK5TP7.js +2 -0
- package/dist/chunk-2KNK5TP7.js.map +1 -0
- package/dist/chunk-53SZ2ZWR.js +2 -0
- package/dist/chunk-53SZ2ZWR.js.map +1 -0
- package/dist/chunk-HOD4LKZU.js +2 -0
- package/dist/chunk-HOD4LKZU.js.map +1 -0
- package/dist/chunk-XSRN2HAT.js +2 -0
- package/dist/chunk-XSRN2HAT.js.map +1 -0
- package/dist/clob/index.d.ts +5390 -0
- package/dist/clob/index.js +2 -0
- package/dist/clob/index.js.map +1 -0
- package/dist/combos/index.d.ts +1126 -0
- package/dist/combos/index.js +2 -0
- package/dist/combos/index.js.map +1 -0
- package/dist/comment-CSYM3bRy.d.ts +945 -0
- package/dist/data/index.d.ts +4863 -0
- package/dist/data/index.js +2 -0
- package/dist/data/index.js.map +1 -0
- package/dist/gamma/index.d.ts +10129 -0
- package/dist/gamma/index.js +2 -0
- package/dist/gamma/index.js.map +1 -0
- package/dist/index.d.ts +112 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/orders-MU1eB8o-.d.ts +2929 -0
- package/dist/perps/index.d.ts +2884 -0
- package/dist/perps/index.js +2 -0
- package/dist/perps/index.js.map +1 -0
- package/dist/relayer/index.d.ts +227 -0
- package/dist/relayer/index.js +2 -0
- package/dist/relayer/index.js.map +1 -0
- package/dist/shared-Dm807IWG.d.ts +223 -0
- package/dist/signature-type-CrLAA9AN.d.ts +23 -0
- package/dist/subscriptions/index.d.ts +7963 -0
- package/dist/subscriptions/index.js +2 -0
- package/dist/subscriptions/index.js.map +1 -0
- package/package.json +92 -3
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {o,a,b as b$1,c}from'../chunk-XSRN2HAT.js';export{za as CreatePerpsChaseResponseSchema,ca as FetchPerpsAccountConfigResponseSchema,V as FetchPerpsAccountStatsResponseSchema,T as FetchPerpsBalancesResponseSchema,oa as FetchPerpsBuilderApprovalsResponseSchema,hb as FetchPerpsCandlesResponseSchema,ya as FetchPerpsChasesResponseSchema,gb as FetchPerpsFeesResponseSchema,cb as FetchPerpsFundingHistoryResponseSchema,Na as FetchPerpsInstrumentsResponseSchema,Ob as FetchPerpsOpenOrdersResponseSchema,Nb as FetchPerpsOrdersResponseSchema,Z as FetchPerpsPortfolioResponseSchema,Ta as FetchPerpsStatisticsResponseSchema,Pa as FetchPerpsTickersResponseSchema,ab as FetchPerpsTradesResponseSchema,xb as FetchPerpsUnreadNotificationsCountResponseSchema,sa as ListPerpsBuilderEarningsResponseSchema,Ba as ListPerpsDepositsResponseSchema,ea as ListPerpsEquityHistoryResponseSchema,Tb as ListPerpsFillsResponseSchema,$ as ListPerpsFundingPaymentsResponseSchema,Ia as ListPerpsInternalTransfersResponseSchema,wb as ListPerpsNotificationsResponseSchema,ga as ListPerpsPnlHistoryResponseSchema,Ea as ListPerpsWithdrawalsResponseSchema,yb as MarkPerpsNotificationsReadResponseSchema,ba as PerpsAccountConfigSchema,Sb as PerpsAccountFillSchema,Ub as PerpsAccountFillUpdateSchema,aa as PerpsAccountFundingPaymentEntrySchema,_ as PerpsAccountFundingPaymentSchema,U as PerpsAccountStatsSchema,M as PerpsAssetSchema,S as PerpsBalanceSchema,Ya as PerpsBboSchema,Za as PerpsBboUpdateSchema,Va as PerpsBookLevelSchema,Wa as PerpsBookSchema,Xa as PerpsBookUpdateSchema,na as PerpsBuilderApprovalSchema,e as PerpsBuilderEarningIdSchema,qa as PerpsBuilderEarningSchema,ta as PerpsBuilderEarningsAssetSchema,ra as PerpsBuilderEarningsSnapshotSchema,ua as PerpsBuilderEarningsSummarySchema,ma as PerpsBuilderStatusSchema,la as PerpsBuilderTermsSchema,Ib as PerpsCancelAllOrdersResponseSchema,Eb as PerpsCancelOrderErrorCodeSchema,Hb as PerpsCancelOrderResultSchema,Ra as PerpsCandleSchema,xa as PerpsChaseAcceptedSchema,va as PerpsChaseIdSchema,wa as PerpsChaseSchema,c as PerpsClientOrderIdSchema,Fb as PerpsCommandAckSchema,Cb as PerpsCommandStatusSchema,ja as PerpsCreateProxyResponseSchema,ia as PerpsCredentialsResponseSchema,O as PerpsDataResponseSchema,l as PerpsDecimalInputSchema,ka as PerpsDeleteProxyResponseSchema,Aa as PerpsDepositSchema,s as PerpsDepositStatus,F as PerpsDepositStatusSchema,Ca as PerpsDepositUpdateSchema,j as PerpsEntityIdSchema,da as PerpsEquityPointSchema,eb as PerpsFeeScheduleEntrySchema,db as PerpsFeeTierSchema,fb as PerpsFeesInfoSchema,k as PerpsFundingIntervalSchema,g as PerpsFundingPaymentIdSchema,bb as PerpsFundingRateSchema,n as PerpsInstrumentCategory,A as PerpsInstrumentCategorySchema,a as PerpsInstrumentIdSchema,Ma as PerpsInstrumentSchema,La as PerpsInstrumentSettlementSchema,m as PerpsInstrumentType,z as PerpsInstrumentTypeSchema,v as PerpsInternalTransferDirection,I as PerpsInternalTransferDirectionSchema,i as PerpsInternalTransferIdSchema,Ja as PerpsInternalTransferResponseSchema,Ha as PerpsInternalTransferSchema,H as PerpsInternalTransferTypeSchema,w as PerpsKlineInterval,J as PerpsKlineIntervalSchema,Db as PerpsKnownCancelOrderErrorCode,u as PerpsKnownInternalTransferType,t as PerpsKnownWithdrawalStatus,qb as PerpsLimitOrderCanceledNotificationSchema,Rb as PerpsLiquidationDetailsSchema,Qb as PerpsLiquidationMethod,rb as PerpsLiquidationWarningNotificationSchema,pa as PerpsLiquidityRole,X as PerpsMarginSummarySchema,mb as PerpsMarginType,nb as PerpsMarginTypeSchema,vb as PerpsNotificationEntrySchema,d as PerpsNotificationIdSchema,kb as PerpsNotificationOrderType,lb as PerpsNotificationOrderTypeSchema,ub as PerpsNotificationSchema,ib as PerpsNotificationType,jb as PerpsNotificationTypeSchema,b as PerpsOrderIdSchema,Mb as PerpsOrderSchema,zb as PerpsOrderStatus,Bb as PerpsOrderStatusSchema,Pb as PerpsOrderUpdateSchema,x as PerpsPnlInterval,K as PerpsPnlIntervalSchema,fa as PerpsPnlPointSchema,W as PerpsPortfolioPositionSchema,Y as PerpsPortfolioSchema,ob as PerpsPositionChangeNotificationSchema,pb as PerpsPositionClosedNotificationSchema,tb as PerpsPositionDeleveragedNotificationSchema,sb as PerpsPositionLiquidatedNotificationSchema,Gb as PerpsPostOrderAckSchema,ha as PerpsProxyKeySchema,_a as PerpsPublicTradeSchema,$a as PerpsPublicTradeUpdateSchema,Ka as PerpsRiskTierSchema,o as PerpsSide,B as PerpsSideSchema,y as PerpsSortDirection,L as PerpsSortDirectionSchema,Sa as PerpsStatisticSchema,Ua as PerpsStatisticUpdateSchema,Qa as PerpsTickerEntrySchema,Oa as PerpsTickerSchema,p as PerpsTimeInForce,C as PerpsTimeInForceSchema,q as PerpsTpSlKind,D as PerpsTpSlKindSchema,Ab as PerpsTpSlOrderFieldsSchema,r as PerpsTpSlScope,E as PerpsTpSlScopeSchema,f as PerpsTradeIdSchema,N as PerpsTxHashSchema,Lb as PerpsUpdateLeverageBatchResultSchema,Kb as PerpsUpdateLeverageRejectionSchema,Jb as PerpsUpdateLeverageResultSchema,Fa as PerpsWithdrawResponseSchema,h as PerpsWithdrawalIdSchema,Da as PerpsWithdrawalSchema,G as PerpsWithdrawalStatusSchema,Ga as PerpsWithdrawalUpdateSchema,R as decimalString,Q as perpsBaseUnits,P as perpsDecimal}from'../chunk-XSRN2HAT.js';import {v as v$1,ea,Pa}from'../chunk-2KNK5TP7.js';import {z as z$1}from'zod';var h=z$1.number().int().transform(e=>e===0?null:v$1(e)),Ir=z$1.object({status:z$1.literal("ok"),deadline:h}),I=z$1.object({deadline:h,triggered:z$1.number().int().nonnegative(),daily_limit:z$1.number().int().nonnegative(),next_reset:ea}).transform(e=>({deadline:e.deadline,triggered:e.triggered,dailyLimit:e.daily_limit,nextReset:e.next_reset})),vr=I;var P=(i=>(i.Ok="ok",i.NotFound="not_found",i.HistoryPending="history_pending",i.HistoryLimit="history_limit",i.ResourceLimit="resource_limit",i.TemporarilyUnavailable="temporarily_unavailable",i.Unavailable="unavailable",i))(P||{}),y=(a=>(a.Increase="increase",a.Decrease="decrease",a))(y||{}),v=z$1.object({position:z$1.number(),open:z$1.number(),high:z$1.number(),low:z$1.number(),close:z$1.number()}),A=z$1.object({position:z$1.number(),kind:z$1.enum(y)}),C=z$1.object({candles:z$1.array(v).max(22),markers:z$1.array(A).max(256)}),R=z$1.object({position_cycle_id:z$1.string(),side:z$1.enum(o),started_at:ea,as_of_at:ea,is_closed:z$1.boolean(),size_after:Pa,entry_price:Pa,as_of_price:Pa,pnl:Pa,pnl_percent:Pa.nullable(),leverage:z$1.number().int().nonnegative().nullable(),chart:C}).transform(e=>({positionCycleId:e.position_cycle_id,side:e.side,startedAt:e.started_at,asOfAt:e.as_of_at,isClosed:e.is_closed,sizeAfter:e.size_after,entryPrice:e.entry_price,asOfPrice:e.as_of_price,pnl:e.pnl,pnlPercent:e.pnl_percent,leverage:e.leverage,chart:e.chart})),z=z$1.string().regex(/^(0|[1-9][0-9]{0,19})$/).refine(e=>/^[0-9]{1,20}$/.test(e)&&BigInt(e)<=18446744073709551615n),x=z$1.object({instrument_id:a,trade_id:z.optional()}),S=z$1.discriminatedUnion("status",[x.extend({status:z$1.literal("ok"),snapshot:R}),x.extend({status:z$1.enum(P).exclude(["Ok"]),snapshot:z$1.never().optional()})]).transform(e=>{let c={instrumentId:e.instrument_id,...e.trade_id===void 0?{}:{tradeId:e.trade_id}};return e.status==="ok"?{...c,status:e.status,snapshot:e.snapshot}:{...c,status:e.status}}),w=S.transform((e,c)=>e.tradeId===void 0?(c.addIssue({code:"custom",message:"Historical snapshot requires trade_id"}),z$1.NEVER):{...e,tradeId:e.tradeId}),wr=z$1.object({history_as_of_at:ea,active:z$1.array(S),history:z$1.array(w)}).transform(e=>({historyAsOfAt:e.history_as_of_at,active:e.active,history:e.history}));var jr=z$1.object({registered:z$1.boolean()}).transform(e=>e.registered);var b=z$1.number().int().positive().max(Number.MAX_SAFE_INTEGER).transform(e=>e),g=(a=>(a.Running="running",a.Paused="paused",a))(g||{}),p=z$1.string().regex(/^\d+(?:\.\d+)?$/).pipe(Pa),O=z$1.object({twid:b,iid:a,buy:z$1.boolean(),qty:p,fill:p,dur:z$1.number().int().positive(),ivl:z$1.number().int().positive(),rnd:z$1.boolean(),slip_bps:z$1.number().int().min(0).max(1e4),min_px:p,max_px:p,ro:z$1.boolean(),st:z$1.enum(g),slices:z$1.number().int().nonnegative(),slice_count:z$1.number().int().positive(),sts:ea,ets:ea,cts:ea,avg_px:p.optional(),coid:c.optional(),oid:b$1.optional()}).transform(e=>({twapId:e.twid,instrumentId:e.iid,side:e.buy?"BUY":"SELL",quantity:e.qty,filledQuantity:e.fill,durationMs:e.dur,intervalMs:e.ivl,randomize:e.rnd,slippageBps:e.slip_bps,minPrice:e.min_px,maxPrice:e.max_px,reduceOnly:e.ro,status:e.st,slices:e.slices,sliceCount:e.slice_count,startedAt:e.sts,endsAt:e.ets,createdAt:e.cts,...e.avg_px===void 0?{}:{averagePrice:e.avg_px},...e.coid===void 0?{}:{clientOrderId:e.coid},...e.oid===void 0?{}:{orderId:e.oid}})),T=z$1.object({status:z$1.literal("ok"),twid:b,ts:ea}).transform(e=>({twapId:e.twid,timestamp:e.ts})),Lr=z$1.array(O),qr=z$1.union([T,z$1.object({status:z$1.literal("err"),error:z$1.string().min(1)})]);export{qr as CreatePerpsTwapResponseSchema,vr as FetchPerpsAutoCancelStatusResponseSchema,Lr as FetchPerpsTwapsResponseSchema,Ir as PerpsAutoCancelResponseSchema,I as PerpsAutoCancelStatusSchema,v as PerpsPositionSnapshotCandleSchema,C as PerpsPositionSnapshotChartSchema,y as PerpsPositionSnapshotMarkerKind,A as PerpsPositionSnapshotMarkerSchema,R as PerpsPositionSnapshotSchema,P as PerpsPositionSnapshotStatus,wr as PerpsPositionSnapshotsSchema,jr as PerpsRegistrationResponseSchema,T as PerpsTwapAcceptedSchema,b as PerpsTwapIdSchema,O as PerpsTwapSchema,g as PerpsTwapStatus};//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/perps/auto-cancel.ts","../../src/perps/position-snapshots.ts","../../src/perps/registration.ts","../../src/perps/twaps.ts"],"names":["AutoCancelDeadlineSchema","z","value","toEpochMilliseconds","PerpsAutoCancelResponseSchema","PerpsAutoCancelStatusSchema","EpochMillisecondsSchema","status","FetchPerpsAutoCancelStatusResponseSchema","PerpsPositionSnapshotStatus","PerpsPositionSnapshotMarkerKind","PerpsPositionSnapshotCandleSchema","PerpsPositionSnapshotMarkerSchema","PerpsPositionSnapshotChartSchema","PerpsPositionSnapshotSchema","PerpsSide","DecimalStringSchema","snapshot","TradeIdSchema","IdentitySchema","PerpsInstrumentIdSchema","ResultSchema","item","identity","HistoryResultSchema","ctx","PerpsPositionSnapshotsSchema","response","PerpsRegistrationResponseSchema","PerpsTwapIdSchema","PerpsTwapStatus","DecimalSchema","PerpsTwapSchema","PerpsClientOrderIdSchema","PerpsOrderIdSchema","run","PerpsTwapAcceptedSchema","accepted","FetchPerpsTwapsResponseSchema","CreatePerpsTwapResponseSchema"],"mappings":"qlKAIMA,CAAAA,CAA2BC,GAAAA,CAC9B,QAAO,CACP,GAAA,GACA,SAAA,CAAWC,CAAAA,EAAWA,IAAU,CAAA,CAAI,IAAA,CAAOC,IAAoBD,CAAK,CAAE,EAS5DE,EAAAA,CAAgCH,GAAAA,CAAE,MAAA,CAAO,CACpD,OAAQA,GAAAA,CAAE,OAAA,CAAQ,IAAI,CAAA,CACtB,QAAA,CAAUD,CACZ,CAAC,CAAA,CAeYK,EAA8BJ,GAAAA,CACxC,MAAA,CAAO,CACN,QAAA,CAAUD,CAAAA,CACV,UAAWC,GAAAA,CAAE,MAAA,GAAS,GAAA,EAAI,CAAE,WA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AAI,GAAI,CACtD,CAAA,CAAE,EAISC,CAAAA,CAA0BnC,GAAAA,CACpC,OAAO,CACN,MAAA,CAAQA,IAAE,OAAA,CAAQ,IAAI,CAAA,CACtB,IAAA,CAAM4B,EACN,EAAA,CAAIvB,EACN,CAAC,CAAA,CACA,SAAA,CAAW+B,IAAc,CAAE,MAAA,CAAQA,EAAS,IAAA,CAAM,SAAA,CAAWA,EAAS,EAAG,CAAA,CAAE,EAMjEC,EAAAA,CAAgCrC,GAAAA,CAAE,MAAM+B,CAAe,CAAA,CAEvDO,GAAgCtC,GAAAA,CAAE,KAAA,CAAM,CACnDmC,CAAAA,CACAnC,GAAAA,CAAE,OAAO,CAAE,MAAA,CAAQA,IAAE,OAAA,CAAQ,KAAK,EAAG,KAAA,CAAOA,GAAAA,CAAE,QAAO,CAAE,GAAA,CAAI,CAAC,CAAE,CAAC,CACjE,CAAC","file":"index.js","sourcesContent":["import { z } from 'zod';\nimport { EpochMillisecondsSchema, toEpochMilliseconds } from '../shared';\n\n// The API reports an unarmed schedule as `deadline: 0`.\nconst AutoCancelDeadlineSchema = z\n .number()\n .int()\n .transform((value) => (value === 0 ? null : toEpochMilliseconds(value)));\n\n/**\n * Acknowledgement for a Perps auto-cancel update. `deadline` echoes the armed\n * cancellation time in Unix milliseconds, or `null` when the schedule was\n * disarmed.\n *\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsAutoCancelResponseSchema = z.object({\n status: z.literal('ok'),\n deadline: AutoCancelDeadlineSchema,\n});\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsAutoCancelResponse = z.infer<\n typeof PerpsAutoCancelResponseSchema\n>;\n\n/**\n * Current auto-cancel state for an account. `deadline` is `null` when no\n * schedule is armed.\n *\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsAutoCancelStatusSchema = z\n .object({\n deadline: AutoCancelDeadlineSchema,\n triggered: z.number().int().nonnegative(),\n daily_limit: z.number().int().nonnegative(),\n next_reset: EpochMillisecondsSchema,\n })\n .transform((status) => ({\n deadline: status.deadline,\n triggered: status.triggered,\n dailyLimit: status.daily_limit,\n nextReset: status.next_reset,\n }));\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsAutoCancelStatus = z.infer<typeof PerpsAutoCancelStatusSchema>;\n\n/**\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const FetchPerpsAutoCancelStatusResponseSchema =\n PerpsAutoCancelStatusSchema;\n","import { z } from 'zod';\nimport { DecimalStringSchema, EpochMillisecondsSchema } from '../shared';\nimport {\n type PerpsInstrumentId,\n PerpsInstrumentIdSchema,\n PerpsSide,\n} from './common';\n\n/** @experimental This API may change in a breaking way in any release, including patch releases. */\nexport enum PerpsPositionSnapshotStatus {\n Ok = 'ok',\n NotFound = 'not_found',\n HistoryPending = 'history_pending',\n HistoryLimit = 'history_limit',\n ResourceLimit = 'resource_limit',\n TemporarilyUnavailable = 'temporarily_unavailable',\n Unavailable = 'unavailable',\n}\n\n/** @experimental This API may change in a breaking way in any release, including patch releases. */\nexport enum PerpsPositionSnapshotMarkerKind {\n Increase = 'increase',\n Decrease = 'decrease',\n}\n\n/** @experimental This API may change in a breaking way in any release, including patch releases. */\nexport const PerpsPositionSnapshotCandleSchema = z.object({\n position: z.number(),\n open: z.number(),\n high: z.number(),\n low: z.number(),\n close: z.number(),\n});\n/** @experimental This API may change in a breaking way in any release, including patch releases. */\nexport type PerpsPositionSnapshotCandle = z.infer<\n typeof PerpsPositionSnapshotCandleSchema\n>;\n/** @experimental This API may change in a breaking way in any release, including patch releases. */\nexport const PerpsPositionSnapshotMarkerSchema = z.object({\n position: z.number(),\n kind: z.enum(PerpsPositionSnapshotMarkerKind),\n});\n/** @experimental This API may change in a breaking way in any release, including patch releases. */\nexport type PerpsPositionSnapshotMarker = z.infer<\n typeof PerpsPositionSnapshotMarkerSchema\n>;\n/** @experimental This API may change in a breaking way in any release, including patch releases. */\nexport const PerpsPositionSnapshotChartSchema = z.object({\n candles: z.array(PerpsPositionSnapshotCandleSchema).max(22),\n markers: z.array(PerpsPositionSnapshotMarkerSchema).max(256),\n});\n/** @experimental This API may change in a breaking way in any release, including patch releases. */\nexport type PerpsPositionSnapshotChart = z.infer<\n typeof PerpsPositionSnapshotChartSchema\n>;\n\n/** @experimental This API may change in a breaking way in any release, including patch releases. */\nexport const PerpsPositionSnapshotSchema = z\n .object({\n position_cycle_id: z.string(),\n side: z.enum(PerpsSide),\n started_at: EpochMillisecondsSchema,\n as_of_at: EpochMillisecondsSchema,\n is_closed: z.boolean(),\n size_after: DecimalStringSchema,\n entry_price: DecimalStringSchema,\n as_of_price: DecimalStringSchema,\n pnl: DecimalStringSchema,\n pnl_percent: DecimalStringSchema.nullable(),\n leverage: z.number().int().nonnegative().nullable(),\n chart: PerpsPositionSnapshotChartSchema,\n })\n .transform((snapshot) => ({\n positionCycleId: snapshot.position_cycle_id,\n side: snapshot.side,\n startedAt: snapshot.started_at,\n asOfAt: snapshot.as_of_at,\n isClosed: snapshot.is_closed,\n sizeAfter: snapshot.size_after,\n entryPrice: snapshot.entry_price,\n asOfPrice: snapshot.as_of_price,\n pnl: snapshot.pnl,\n pnlPercent: snapshot.pnl_percent,\n leverage: snapshot.leverage,\n chart: snapshot.chart,\n }));\n/** A position cycle valued at captured state or immediately after a selected fill.\n * @experimental This API may change in a breaking way in any release, including patch releases. */\nexport type PerpsPositionSnapshot = z.infer<typeof PerpsPositionSnapshotSchema>;\n\nconst TradeIdSchema = z\n .string()\n .regex(/^(0|[1-9][0-9]{0,19})$/)\n .refine(\n (value) =>\n /^[0-9]{1,20}$/.test(value) && BigInt(value) <= 18446744073709551615n,\n );\nconst IdentitySchema = z.object({\n instrument_id: PerpsInstrumentIdSchema,\n trade_id: TradeIdSchema.optional(),\n});\nconst ResultSchema = z\n .discriminatedUnion('status', [\n IdentitySchema.extend({\n status: z.literal(PerpsPositionSnapshotStatus.Ok),\n snapshot: PerpsPositionSnapshotSchema,\n }),\n IdentitySchema.extend({\n status: z.enum(PerpsPositionSnapshotStatus).exclude(['Ok']),\n snapshot: z.never().optional(),\n }),\n ])\n .transform((item): PerpsPositionSnapshotResult => {\n const identity = {\n instrumentId: item.instrument_id,\n ...(item.trade_id === undefined ? {} : { tradeId: item.trade_id }),\n };\n return item.status === PerpsPositionSnapshotStatus.Ok\n ? { ...identity, status: item.status, snapshot: item.snapshot }\n : { ...identity, status: item.status };\n });\n\n/** @experimental This API may change in a breaking way in any release, including patch releases. */\nexport type PerpsPositionSnapshotResult =\n | {\n instrumentId: PerpsInstrumentId;\n tradeId?: string;\n status: PerpsPositionSnapshotStatus.Ok;\n snapshot: PerpsPositionSnapshot;\n }\n | {\n instrumentId: PerpsInstrumentId;\n tradeId?: string;\n status: Exclude<\n PerpsPositionSnapshotStatus,\n PerpsPositionSnapshotStatus.Ok\n >;\n };\nconst HistoryResultSchema = ResultSchema.transform((item, ctx) => {\n if (item.tradeId === undefined) {\n ctx.addIssue({\n code: 'custom',\n message: 'Historical snapshot requires trade_id',\n });\n return z.NEVER;\n }\n return { ...item, tradeId: item.tradeId };\n});\n/** @experimental This API may change in a breaking way in any release, including patch releases. */\nexport type PerpsHistoricalPositionSnapshotResult = z.infer<\n typeof HistoryResultSchema\n>;\n\n/** @experimental This API may change in a breaking way in any release, including patch releases. */\nexport const PerpsPositionSnapshotsSchema = z\n .object({\n history_as_of_at: EpochMillisecondsSchema,\n active: z.array(ResultSchema),\n history: z.array(HistoryResultSchema),\n })\n .transform((response) => ({\n historyAsOfAt: response.history_as_of_at,\n active: response.active,\n history: response.history,\n }));\n/** Ordered selections and the completed-history horizon. No pagination.\n * @experimental This API may change in a breaking way in any release, including patch releases. */\nexport type PerpsPositionSnapshots = z.infer<\n typeof PerpsPositionSnapshotsSchema\n>;\n","import { z } from 'zod';\n\n/**\n * Parses whether an address has a Perps account.\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport const PerpsRegistrationResponseSchema = z\n .object({ registered: z.boolean() })\n .transform((response) => response.registered);\n","import { z } from 'zod';\nimport {\n DecimalStringSchema,\n EpochMillisecondsSchema,\n OrderSide,\n} from '../shared';\nimport {\n PerpsClientOrderIdSchema,\n PerpsInstrumentIdSchema,\n PerpsOrderIdSchema,\n} from './common';\n\n/** Opaque run identity.\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsTwapId = number & { readonly __tag: 'PerpsTwapId' };\n/** @experimental This API may change in a breaking way in any release, including patch releases. */\nexport const PerpsTwapIdSchema = z\n .number()\n .int()\n .positive()\n .max(Number.MAX_SAFE_INTEGER)\n .transform((value) => value as PerpsTwapId);\n/** Active runs only; ended runs are absent from the active collection.\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport enum PerpsTwapStatus {\n Running = 'running',\n Paused = 'paused',\n}\nconst DecimalSchema = z\n .string()\n .regex(/^\\d+(?:\\.\\d+)?$/)\n .pipe(DecimalStringSchema);\n/** @experimental This API may change in a breaking way in any release, including patch releases. */\nexport const PerpsTwapSchema = z\n .object({\n twid: PerpsTwapIdSchema,\n iid: PerpsInstrumentIdSchema,\n buy: z.boolean(),\n qty: DecimalSchema,\n fill: DecimalSchema,\n dur: z.number().int().positive(),\n ivl: z.number().int().positive(),\n rnd: z.boolean(),\n slip_bps: z.number().int().min(0).max(10000),\n min_px: DecimalSchema,\n max_px: DecimalSchema,\n ro: z.boolean(),\n st: z.enum(PerpsTwapStatus),\n slices: z.number().int().nonnegative(),\n slice_count: z.number().int().positive(),\n sts: EpochMillisecondsSchema,\n ets: EpochMillisecondsSchema,\n cts: EpochMillisecondsSchema,\n avg_px: DecimalSchema.optional(),\n coid: PerpsClientOrderIdSchema.optional(),\n oid: PerpsOrderIdSchema.optional(),\n })\n .transform((run) => ({\n twapId: run.twid,\n instrumentId: run.iid,\n side: run.buy ? OrderSide.BUY : OrderSide.SELL,\n quantity: run.qty,\n filledQuantity: run.fill,\n durationMs: run.dur,\n intervalMs: run.ivl,\n randomize: run.rnd,\n slippageBps: run.slip_bps,\n minPrice: run.min_px,\n maxPrice: run.max_px,\n reduceOnly: run.ro,\n status: run.st,\n slices: run.slices,\n sliceCount: run.slice_count,\n startedAt: run.sts,\n endsAt: run.ets,\n createdAt: run.cts,\n ...(run.avg_px === undefined ? {} : { averagePrice: run.avg_px }),\n ...(run.coid === undefined ? {} : { clientOrderId: run.coid }),\n ...(run.oid === undefined ? {} : { orderId: run.oid }),\n }));\n/** @experimental This API may change in a breaking way in any release, including patch releases. */\nexport type PerpsTwap = z.infer<typeof PerpsTwapSchema>;\n/** @experimental This API may change in a breaking way in any release, including patch releases. */\nexport const PerpsTwapAcceptedSchema = z\n .object({\n status: z.literal('ok'),\n twid: PerpsTwapIdSchema,\n ts: EpochMillisecondsSchema,\n })\n .transform((accepted) => ({ twapId: accepted.twid, timestamp: accepted.ts }));\n/** Acceptance does not guarantee all scheduled quantity will fill.\n * @experimental This API may change in a breaking way in any release, including patch releases.\n */\nexport type PerpsTwapAccepted = z.infer<typeof PerpsTwapAcceptedSchema>;\n/** @experimental This API may change in a breaking way in any release, including patch releases. */\nexport const FetchPerpsTwapsResponseSchema = z.array(PerpsTwapSchema);\n/** @experimental This API may change in a breaking way in any release, including patch releases. */\nexport const CreatePerpsTwapResponseSchema = z.union([\n PerpsTwapAcceptedSchema,\n z.object({ status: z.literal('err'), error: z.string().min(1) }),\n]);\n"]}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { aO as TransactionId } from '../shared-Dm807IWG.js';
|
|
3
|
+
import * as _kuest_types from '@kuest/types';
|
|
4
|
+
import { TxHash } from '@kuest/types';
|
|
5
|
+
|
|
6
|
+
declare enum RelayerAuthorizeSessionSignerStatus {
|
|
7
|
+
SUBMITTED = "SUBMITTED",
|
|
8
|
+
REGISTRY_PENDING = "REGISTRY_PENDING",
|
|
9
|
+
REGISTERED = "REGISTERED",
|
|
10
|
+
FAILED = "FAILED",
|
|
11
|
+
SUPERSEDED = "SUPERSEDED",
|
|
12
|
+
REPAIR_REQUIRED = "REPAIR_REQUIRED"
|
|
13
|
+
}
|
|
14
|
+
type RelayerAuthorizeSessionSignerResponse = {
|
|
15
|
+
/** Lifecycle status of the authorization operation. */
|
|
16
|
+
status: RelayerAuthorizeSessionSignerStatus;
|
|
17
|
+
/** Submitted transaction hash when it is already available. */
|
|
18
|
+
transactionHash: TxHash | null;
|
|
19
|
+
/** Identifier used to poll the submitted transaction. */
|
|
20
|
+
transactionId: TransactionId;
|
|
21
|
+
};
|
|
22
|
+
declare const RelayerAuthorizeSessionSignerResponseSchema: z.ZodObject<{
|
|
23
|
+
status: z.ZodEnum<typeof RelayerAuthorizeSessionSignerStatus>;
|
|
24
|
+
transactionHash: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<TxHash, string>>>>, z.ZodTransform<TxHash | null, TxHash | null | undefined>>;
|
|
25
|
+
transactionId: z.ZodPipe<z.ZodString, z.ZodTransform<TransactionId, string>>;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
declare enum RelayerRevokeSessionSignerStatus {
|
|
28
|
+
PENDING = "PENDING",
|
|
29
|
+
FENCED = "FENCED",
|
|
30
|
+
SWEPT = "SWEPT",
|
|
31
|
+
CHAIN_SUBMITTED = "CHAIN_SUBMITTED",
|
|
32
|
+
CONFIRMED = "CONFIRMED",
|
|
33
|
+
FAILED = "FAILED"
|
|
34
|
+
}
|
|
35
|
+
type RelayerRevokeSessionSignerResponse = {
|
|
36
|
+
/** Lifecycle status of the revocation operation. */
|
|
37
|
+
status: RelayerRevokeSessionSignerStatus;
|
|
38
|
+
/** Identifier used to poll the submitted transaction. */
|
|
39
|
+
transactionId: TransactionId;
|
|
40
|
+
};
|
|
41
|
+
declare const RelayerRevokeSessionSignerResponseSchema: z.ZodObject<{
|
|
42
|
+
status: z.ZodEnum<typeof RelayerRevokeSessionSignerStatus>;
|
|
43
|
+
transactionId: z.ZodPipe<z.ZodString, z.ZodTransform<TransactionId, string>>;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
|
|
46
|
+
declare enum RelayerTransactionType {
|
|
47
|
+
SAFE = "SAFE",
|
|
48
|
+
PROXY = "PROXY",
|
|
49
|
+
SAFE_CREATE = "SAFE-CREATE",
|
|
50
|
+
WALLET = "WALLET",
|
|
51
|
+
WALLET_CREATE = "WALLET-CREATE"
|
|
52
|
+
}
|
|
53
|
+
declare const RelayerTransactionTypeSchema: z.ZodEnum<typeof RelayerTransactionType>;
|
|
54
|
+
declare enum RelayerTransactionState {
|
|
55
|
+
STATE_NEW = "STATE_NEW",
|
|
56
|
+
STATE_EXECUTED = "STATE_EXECUTED",
|
|
57
|
+
STATE_MINED = "STATE_MINED",
|
|
58
|
+
STATE_CONFIRMED = "STATE_CONFIRMED",
|
|
59
|
+
STATE_INVALID = "STATE_INVALID",
|
|
60
|
+
STATE_FAILED = "STATE_FAILED"
|
|
61
|
+
}
|
|
62
|
+
declare const RelayerExecuteParamsSchema: z.ZodObject<{
|
|
63
|
+
address: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
64
|
+
nonce: z.ZodString;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
type RelayerExecuteParams = z.output<typeof RelayerExecuteParamsSchema>;
|
|
67
|
+
declare const RelayerLegacyExecuteRequestSchema: z.ZodObject<{
|
|
68
|
+
data: z.ZodString;
|
|
69
|
+
from: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
70
|
+
metadata: z.ZodOptional<z.ZodString>;
|
|
71
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
72
|
+
proxyWallet: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
73
|
+
signature: z.ZodString;
|
|
74
|
+
signatureParams: z.ZodObject<{
|
|
75
|
+
baseGas: z.ZodOptional<z.ZodString>;
|
|
76
|
+
gasLimit: z.ZodOptional<z.ZodString>;
|
|
77
|
+
gasPrice: z.ZodOptional<z.ZodString>;
|
|
78
|
+
gasToken: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>>;
|
|
79
|
+
operation: z.ZodOptional<z.ZodString>;
|
|
80
|
+
payment: z.ZodOptional<z.ZodString>;
|
|
81
|
+
paymentReceiver: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>>;
|
|
82
|
+
paymentToken: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>>;
|
|
83
|
+
refundReceiver: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>>;
|
|
84
|
+
relay: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>>;
|
|
85
|
+
relayHub: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>>;
|
|
86
|
+
relayerFee: z.ZodOptional<z.ZodString>;
|
|
87
|
+
safeTxnGas: z.ZodOptional<z.ZodString>;
|
|
88
|
+
}, z.core.$strip>;
|
|
89
|
+
to: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
90
|
+
type: z.ZodEnum<{
|
|
91
|
+
SAFE: RelayerTransactionType.SAFE;
|
|
92
|
+
PROXY: RelayerTransactionType.PROXY;
|
|
93
|
+
"SAFE-CREATE": RelayerTransactionType.SAFE_CREATE;
|
|
94
|
+
}>;
|
|
95
|
+
value: z.ZodOptional<z.ZodString>;
|
|
96
|
+
}, z.core.$strip>;
|
|
97
|
+
type RelayerLegacyExecuteRequest = z.input<typeof RelayerLegacyExecuteRequestSchema>;
|
|
98
|
+
declare const DepositWalletCallSchema: z.ZodObject<{
|
|
99
|
+
data: z.ZodString;
|
|
100
|
+
target: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
101
|
+
value: z.ZodString;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
type DepositWalletCall = z.input<typeof DepositWalletCallSchema>;
|
|
104
|
+
declare const DepositWalletParamsSchema: z.ZodObject<{
|
|
105
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
106
|
+
data: z.ZodString;
|
|
107
|
+
target: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
108
|
+
value: z.ZodString;
|
|
109
|
+
}, z.core.$strip>>;
|
|
110
|
+
deadline: z.ZodString;
|
|
111
|
+
depositWallet: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
112
|
+
}, z.core.$strip>;
|
|
113
|
+
type DepositWalletParams = z.input<typeof DepositWalletParamsSchema>;
|
|
114
|
+
declare const RelayerDepositWalletExecuteRequestSchema: z.ZodObject<{
|
|
115
|
+
depositWalletParams: z.ZodObject<{
|
|
116
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
117
|
+
data: z.ZodString;
|
|
118
|
+
target: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
119
|
+
value: z.ZodString;
|
|
120
|
+
}, z.core.$strip>>;
|
|
121
|
+
deadline: z.ZodString;
|
|
122
|
+
depositWallet: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
from: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
125
|
+
metadata: z.ZodOptional<z.ZodString>;
|
|
126
|
+
nonce: z.ZodString;
|
|
127
|
+
signature: z.ZodString;
|
|
128
|
+
to: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
129
|
+
type: z.ZodLiteral<RelayerTransactionType.WALLET>;
|
|
130
|
+
}, z.core.$strip>;
|
|
131
|
+
type RelayerDepositWalletExecuteRequest = z.input<typeof RelayerDepositWalletExecuteRequestSchema>;
|
|
132
|
+
declare const RelayerDepositWalletCreateRequestSchema: z.ZodObject<{
|
|
133
|
+
from: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
134
|
+
metadata: z.ZodOptional<z.ZodString>;
|
|
135
|
+
to: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
136
|
+
type: z.ZodLiteral<RelayerTransactionType.WALLET_CREATE>;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
type RelayerDepositWalletCreateRequest = z.input<typeof RelayerDepositWalletCreateRequestSchema>;
|
|
139
|
+
declare const RelayerExecuteRequestSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
140
|
+
data: z.ZodString;
|
|
141
|
+
from: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
142
|
+
metadata: z.ZodOptional<z.ZodString>;
|
|
143
|
+
nonce: z.ZodOptional<z.ZodString>;
|
|
144
|
+
proxyWallet: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
145
|
+
signature: z.ZodString;
|
|
146
|
+
signatureParams: z.ZodObject<{
|
|
147
|
+
baseGas: z.ZodOptional<z.ZodString>;
|
|
148
|
+
gasLimit: z.ZodOptional<z.ZodString>;
|
|
149
|
+
gasPrice: z.ZodOptional<z.ZodString>;
|
|
150
|
+
gasToken: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>>;
|
|
151
|
+
operation: z.ZodOptional<z.ZodString>;
|
|
152
|
+
payment: z.ZodOptional<z.ZodString>;
|
|
153
|
+
paymentReceiver: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>>;
|
|
154
|
+
paymentToken: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>>;
|
|
155
|
+
refundReceiver: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>>;
|
|
156
|
+
relay: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>>;
|
|
157
|
+
relayHub: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>>;
|
|
158
|
+
relayerFee: z.ZodOptional<z.ZodString>;
|
|
159
|
+
safeTxnGas: z.ZodOptional<z.ZodString>;
|
|
160
|
+
}, z.core.$strip>;
|
|
161
|
+
to: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
162
|
+
type: z.ZodEnum<{
|
|
163
|
+
SAFE: RelayerTransactionType.SAFE;
|
|
164
|
+
PROXY: RelayerTransactionType.PROXY;
|
|
165
|
+
"SAFE-CREATE": RelayerTransactionType.SAFE_CREATE;
|
|
166
|
+
}>;
|
|
167
|
+
value: z.ZodOptional<z.ZodString>;
|
|
168
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
169
|
+
depositWalletParams: z.ZodObject<{
|
|
170
|
+
calls: z.ZodArray<z.ZodObject<{
|
|
171
|
+
data: z.ZodString;
|
|
172
|
+
target: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
173
|
+
value: z.ZodString;
|
|
174
|
+
}, z.core.$strip>>;
|
|
175
|
+
deadline: z.ZodString;
|
|
176
|
+
depositWallet: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
177
|
+
}, z.core.$strip>;
|
|
178
|
+
from: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
179
|
+
metadata: z.ZodOptional<z.ZodString>;
|
|
180
|
+
nonce: z.ZodString;
|
|
181
|
+
signature: z.ZodString;
|
|
182
|
+
to: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
183
|
+
type: z.ZodLiteral<RelayerTransactionType.WALLET>;
|
|
184
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
185
|
+
from: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
186
|
+
metadata: z.ZodOptional<z.ZodString>;
|
|
187
|
+
to: z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.EvmAddress, string>>;
|
|
188
|
+
type: z.ZodLiteral<RelayerTransactionType.WALLET_CREATE>;
|
|
189
|
+
}, z.core.$strip>]>;
|
|
190
|
+
type RelayerExecuteRequest = z.input<typeof RelayerExecuteRequestSchema>;
|
|
191
|
+
declare const RelayerExecuteResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
192
|
+
state: z.ZodEnum<typeof RelayerTransactionState>;
|
|
193
|
+
transactionHash: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.TxHash, string>>>>, z.ZodTransform<_kuest_types.TxHash | null, _kuest_types.TxHash | null | undefined>>;
|
|
194
|
+
transactionID: z.ZodPipe<z.ZodString, z.ZodTransform<TransactionId, string>>;
|
|
195
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
196
|
+
transactionHash: _kuest_types.TxHash | null;
|
|
197
|
+
transactionId: TransactionId;
|
|
198
|
+
state: RelayerTransactionState;
|
|
199
|
+
}, {
|
|
200
|
+
state: RelayerTransactionState;
|
|
201
|
+
transactionHash: _kuest_types.TxHash | null;
|
|
202
|
+
transactionID: TransactionId;
|
|
203
|
+
}>>;
|
|
204
|
+
type RelayerExecuteResponse = z.output<typeof RelayerExecuteResponseSchema>;
|
|
205
|
+
declare const RelayerDeployedResponseSchema: z.ZodObject<{
|
|
206
|
+
deployed: z.ZodBoolean;
|
|
207
|
+
}, z.core.$strip>;
|
|
208
|
+
type RelayerDeployedResponse = z.output<typeof RelayerDeployedResponseSchema>;
|
|
209
|
+
declare const GaslessTransactionSchema: z.ZodPipe<z.ZodObject<{
|
|
210
|
+
error_msg: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
211
|
+
state: z.ZodEnum<typeof RelayerTransactionState>;
|
|
212
|
+
transaction_hash: z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"">, z.ZodPipe<z.ZodString, z.ZodTransform<_kuest_types.TxHash, string>>]>, z.ZodTransform<_kuest_types.TxHash | null, "" | _kuest_types.TxHash>>;
|
|
213
|
+
transaction_id: z.ZodPipe<z.ZodString, z.ZodTransform<TransactionId, string>>;
|
|
214
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
215
|
+
errorMsg: string | null;
|
|
216
|
+
transactionHash: _kuest_types.TxHash | null;
|
|
217
|
+
transactionId: TransactionId;
|
|
218
|
+
state: RelayerTransactionState;
|
|
219
|
+
}, {
|
|
220
|
+
state: RelayerTransactionState;
|
|
221
|
+
transaction_hash: _kuest_types.TxHash | null;
|
|
222
|
+
transaction_id: TransactionId;
|
|
223
|
+
error_msg?: string | null | undefined;
|
|
224
|
+
}>>;
|
|
225
|
+
type GaslessTransaction = z.output<typeof GaslessTransactionSchema>;
|
|
226
|
+
|
|
227
|
+
export { type DepositWalletCall, DepositWalletCallSchema, type DepositWalletParams, DepositWalletParamsSchema, type GaslessTransaction, GaslessTransactionSchema, type RelayerAuthorizeSessionSignerResponse, RelayerAuthorizeSessionSignerResponseSchema, RelayerAuthorizeSessionSignerStatus, type RelayerDeployedResponse, RelayerDeployedResponseSchema, type RelayerDepositWalletCreateRequest, RelayerDepositWalletCreateRequestSchema, type RelayerDepositWalletExecuteRequest, RelayerDepositWalletExecuteRequestSchema, type RelayerExecuteParams, RelayerExecuteParamsSchema, type RelayerExecuteRequest, RelayerExecuteRequestSchema, type RelayerExecuteResponse, RelayerExecuteResponseSchema, type RelayerLegacyExecuteRequest, RelayerLegacyExecuteRequestSchema, type RelayerRevokeSessionSignerResponse, RelayerRevokeSessionSignerResponseSchema, RelayerRevokeSessionSignerStatus, RelayerTransactionState, RelayerTransactionType, RelayerTransactionTypeSchema };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {Na,Oa,da}from'../chunk-2KNK5TP7.js';import {z}from'zod';var E=(t=>(t.SUBMITTED="SUBMITTED",t.REGISTRY_PENDING="REGISTRY_PENDING",t.REGISTERED="REGISTERED",t.FAILED="FAILED",t.SUPERSEDED="SUPERSEDED",t.REPAIR_REQUIRED="REPAIR_REQUIRED",t))(E||{}),f=z.object({status:z.enum(E),transactionHash:Oa.nullish().transform(o=>o??null),transactionId:Na}),c=(t=>(t.PENDING="PENDING",t.FENCED="FENCED",t.SWEPT="SWEPT",t.CHAIN_SUBMITTED="CHAIN_SUBMITTED",t.CONFIRMED="CONFIRMED",t.FAILED="FAILED",t))(c||{}),L=z.object({status:z.enum(c),transactionId:Na});var m=(s=>(s.SAFE="SAFE",s.PROXY="PROXY",s.SAFE_CREATE="SAFE-CREATE",s.WALLET="WALLET",s.WALLET_CREATE="WALLET-CREATE",s))(m||{}),C=z.enum(m),u=z.enum(["PROXY","SAFE","SAFE-CREATE"]),R=(t=>(t.STATE_NEW="STATE_NEW",t.STATE_EXECUTED="STATE_EXECUTED",t.STATE_MINED="STATE_MINED",t.STATE_CONFIRMED="STATE_CONFIRMED",t.STATE_INVALID="STATE_INVALID",t.STATE_FAILED="STATE_FAILED",t))(R||{}),T=z.enum(R),x=z.object({baseGas:z.string().optional(),gasLimit:z.string().optional(),gasPrice:z.string().optional(),gasToken:da.optional(),operation:z.string().optional(),payment:z.string().optional(),paymentReceiver:da.optional(),paymentToken:da.optional(),refundReceiver:da.optional(),relay:da.optional(),relayHub:da.optional(),relayerFee:z.string().optional(),safeTxnGas:z.string().optional()}),N=z.object({address:da,nonce:z.string().min(1)}),D=z.object({data:z.string().min(1),from:da,metadata:z.string().optional(),nonce:z.string().min(1).optional(),proxyWallet:da,signature:z.string().min(1),signatureParams:x,to:da,type:u,value:z.string().optional()}),I=z.object({data:z.string().min(1),target:da,value:z.string().min(1)}),h=z.object({calls:z.array(I).min(1),deadline:z.string().min(1),depositWallet:da}),A=z.object({depositWalletParams:h,from:da,metadata:z.string().optional(),nonce:z.string().min(1),signature:z.string().min(1),to:da,type:z.literal("WALLET")}),S=z.object({from:da,metadata:z.string().optional(),to:da,type:z.literal("WALLET-CREATE")}),F=z.union([D,A,S]),b=z.object({state:T,transactionHash:Oa.nullish().transform(o=>o??null),transactionID:Na}).transform(({transactionHash:o,transactionID:l,...i})=>({...i,transactionHash:o??null,transactionId:l})),G=z.object({deployed:z.boolean()}),j=z.object({error_msg:z.string().nullish(),state:T,transaction_hash:z.union([z.literal(""),Oa]).transform(o=>o===""?null:o),transaction_id:Na}).transform(({error_msg:o,transaction_hash:l,transaction_id:i,...y})=>({...y,errorMsg:o??null,transactionHash:l??null,transactionId:i}));export{I as DepositWalletCallSchema,h as DepositWalletParamsSchema,j as GaslessTransactionSchema,f as RelayerAuthorizeSessionSignerResponseSchema,E as RelayerAuthorizeSessionSignerStatus,G as RelayerDeployedResponseSchema,S as RelayerDepositWalletCreateRequestSchema,A as RelayerDepositWalletExecuteRequestSchema,N as RelayerExecuteParamsSchema,F as RelayerExecuteRequestSchema,b as RelayerExecuteResponseSchema,D as RelayerLegacyExecuteRequestSchema,L as RelayerRevokeSessionSignerResponseSchema,c as RelayerRevokeSessionSignerStatus,R as RelayerTransactionState,m as RelayerTransactionType,C as RelayerTransactionTypeSchema};//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/relayer/session-signer.ts","../../src/relayer/transaction.ts"],"names":["RelayerAuthorizeSessionSignerStatus","RelayerAuthorizeSessionSignerResponseSchema","z","TxHashSchema","value","TransactionIdSchema","RelayerRevokeSessionSignerStatus","RelayerRevokeSessionSignerResponseSchema","RelayerTransactionType","RelayerTransactionTypeSchema","RelayerLegacyTransactionTypeSchema","RelayerTransactionState","RelayerTransactionStateSchema","RelayerSignatureParamsSchema","EvmAddressSchema","RelayerExecuteParamsSchema","RelayerLegacyExecuteRequestSchema","DepositWalletCallSchema","DepositWalletParamsSchema","RelayerDepositWalletExecuteRequestSchema","RelayerDepositWalletCreateRequestSchema","RelayerExecuteRequestSchema","RelayerExecuteResponseSchema","transactionHash","transactionID","rest","RelayerDeployedResponseSchema","GaslessTransactionSchema","error_msg","transaction_hash","transaction_id"],"mappings":"gEAQO,IAAKA,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,SAAA,CAAY,WAAA,CACZA,CAAAA,CAAA,gBAAA,CAAmB,kBAAA,CACnBA,CAAAA,CAAA,UAAA,CAAa,YAAA,CACbA,CAAAA,CAAA,MAAA,CAAS,QAAA,CACTA,CAAAA,CAAA,UAAA,CAAa,YAAA,CACbA,CAAAA,CAAA,eAAA,CAAkB,iBAAA,CANRA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,CAAA,CAoBCC,CAAAA,CAA8CC,CAAAA,CAAE,MAAA,CAAO,CAClE,MAAA,CAAQA,CAAAA,CAAE,IAAA,CAAKF,CAAmC,CAAA,CAClD,eAAA,CAAiBG,EAAAA,CAAa,OAAA,EAAQ,CAAE,SAAA,CAAWC,CAAAA,EAAUA,CAAAA,EAAS,IAAI,CAAA,CAC1E,aAAA,CAAeC,EACjB,CAAC,CAAA,CAEWC,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,OAAA,CAAU,SAAA,CACVA,CAAAA,CAAA,MAAA,CAAS,QAAA,CACTA,CAAAA,CAAA,KAAA,CAAQ,OAAA,CACRA,CAAAA,CAAA,eAAA,CAAkB,iBAAA,CAClBA,CAAAA,CAAA,UAAY,WAAA,CACZA,CAAAA,CAAA,MAAA,CAAS,QAAA,CANCA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,CAAA,CAoBCC,CAAAA,CAA2CL,CAAAA,CAAE,MAAA,CAAO,CAC/D,MAAA,CAAQA,CAAAA,CAAE,IAAA,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A,CAAiBT,EAAAA,CAAa,OAAA,EAAQ,CAAE,SAAA,CAAWC,CAAAA,EAAUA,CAAAA,EAAS,IAAI,CAAA,CAC1E,aAAA,CAAeC,EACjB,CAAC,CAAA,CACA,SAAA,CAAU,CAAC,CAAE,eAAA,CAAAkB,CAAAA,CAAiB,aAAA,CAAAC,CAAAA,CAAe,GAAGC,CAAK,CAAA,IAAO,CAC3D,GAAGA,CAAAA,CACH,eAAA,CAAiBF,CAAAA,EAAmB,IAAA,CACpC,aAAA,CAAeC,CACjB,CAAA,CAAE,CAAA,CAMSE,CAAAA,CAAgCxB,CAAAA,CAAE,MAAA,CAAO,CACpD,QAAA,CAAUA,CAAAA,CAAE,SACd,CAAC,CAAA,CAMYyB,CAAAA,CAA2BzB,CAAAA,CACrC,MAAA,CAAO,CACN,SAAA,CAAWA,CAAAA,CAAE,MAAA,EAAO,CAAE,OAAA,EAAQ,CAC9B,KAAA,CAAOU,CAAAA,CACP,gBAAA,CAAkBV,CAAAA,CACf,KAAA,CAAM,CAACA,CAAAA,CAAE,OAAA,CAAQ,EAAE,CAAA,CAAGC,EAAY,CAAC,CAAA,CACnC,SAAA,CAAWC,CAAAA,EAAWA,CAAAA,GAAU,EAAA,CAAK,IAAA,CAAOA,CAAM,CAAA,CACrD,cAAA,CAAgBC,EAClB,CAAC,CAAA,CACA,SAAA,CAAU,CAAC,CAAE,SAAA,CAAAuB,CAAAA,CAAW,gBAAA,CAAAC,CAAAA,CAAkB,cAAA,CAAAC,CAAAA,CAAgB,GAAGL,CAAK,CAAA,IAAO,CACxE,GAAGA,CAAAA,CACH,QAAA,CAAUG,CAAAA,EAAa,IAAA,CACvB,eAAA,CAAiBC,CAAAA,EAAoB,IAAA,CACrC,aAAA,CAAeC,CACjB,CAAA,CAAE","file":"index.js","sourcesContent":["import { z } from 'zod';\nimport {\n type TransactionId,\n TransactionIdSchema,\n type TxHash,\n TxHashSchema,\n} from '../shared';\n\nexport enum RelayerAuthorizeSessionSignerStatus {\n SUBMITTED = 'SUBMITTED',\n REGISTRY_PENDING = 'REGISTRY_PENDING',\n REGISTERED = 'REGISTERED',\n FAILED = 'FAILED',\n SUPERSEDED = 'SUPERSEDED',\n REPAIR_REQUIRED = 'REPAIR_REQUIRED',\n}\n\nexport type RelayerAuthorizeSessionSignerResponse = {\n /** Lifecycle status of the authorization operation. */\n status: RelayerAuthorizeSessionSignerStatus;\n /** Submitted transaction hash when it is already available. */\n transactionHash: TxHash | null;\n /** Identifier used to poll the submitted transaction. */\n transactionId: TransactionId;\n};\n\n// The upstream `operationId` is omitted from the normalized response because\n// it is an opaque identifier with no SDK consumer.\nexport const RelayerAuthorizeSessionSignerResponseSchema = z.object({\n status: z.enum(RelayerAuthorizeSessionSignerStatus),\n transactionHash: TxHashSchema.nullish().transform((value) => value ?? null),\n transactionId: TransactionIdSchema,\n}) satisfies z.ZodType<RelayerAuthorizeSessionSignerResponse>;\n\nexport enum RelayerRevokeSessionSignerStatus {\n PENDING = 'PENDING',\n FENCED = 'FENCED',\n SWEPT = 'SWEPT',\n CHAIN_SUBMITTED = 'CHAIN_SUBMITTED',\n CONFIRMED = 'CONFIRMED',\n FAILED = 'FAILED',\n}\n\nexport type RelayerRevokeSessionSignerResponse = {\n /** Lifecycle status of the revocation operation. */\n status: RelayerRevokeSessionSignerStatus;\n /** Identifier used to poll the submitted transaction. */\n transactionId: TransactionId;\n};\n\n// The upstream response includes `operationId` and `fenced`. They are omitted\n// from the normalized response because the operation ID has no SDK consumer,\n// while `fenced` is only a submission-time snapshot rather than the eventual\n// revocation outcome.\nexport const RelayerRevokeSessionSignerResponseSchema = z.object({\n status: z.enum(RelayerRevokeSessionSignerStatus),\n transactionId: TransactionIdSchema,\n}) satisfies z.ZodType<RelayerRevokeSessionSignerResponse>;\n","import { z } from 'zod';\nimport { EvmAddressSchema, TransactionIdSchema, TxHashSchema } from '../shared';\n\nexport enum RelayerTransactionType {\n SAFE = 'SAFE',\n PROXY = 'PROXY',\n SAFE_CREATE = 'SAFE-CREATE',\n WALLET = 'WALLET',\n WALLET_CREATE = 'WALLET-CREATE',\n}\n\nexport const RelayerTransactionTypeSchema = z.enum(RelayerTransactionType);\n\nconst RelayerLegacyTransactionTypeSchema = z.enum([\n RelayerTransactionType.PROXY,\n RelayerTransactionType.SAFE,\n RelayerTransactionType.SAFE_CREATE,\n]);\n\nexport enum RelayerTransactionState {\n STATE_NEW = 'STATE_NEW',\n STATE_EXECUTED = 'STATE_EXECUTED',\n STATE_MINED = 'STATE_MINED',\n STATE_CONFIRMED = 'STATE_CONFIRMED',\n STATE_INVALID = 'STATE_INVALID',\n STATE_FAILED = 'STATE_FAILED',\n}\n\nconst RelayerTransactionStateSchema = z.enum(RelayerTransactionState);\n\nconst RelayerSignatureParamsSchema = z.object({\n baseGas: z.string().optional(),\n gasLimit: z.string().optional(),\n gasPrice: z.string().optional(),\n gasToken: EvmAddressSchema.optional(),\n operation: z.string().optional(),\n payment: z.string().optional(),\n paymentReceiver: EvmAddressSchema.optional(),\n paymentToken: EvmAddressSchema.optional(),\n refundReceiver: EvmAddressSchema.optional(),\n relay: EvmAddressSchema.optional(),\n relayHub: EvmAddressSchema.optional(),\n relayerFee: z.string().optional(),\n safeTxnGas: z.string().optional(),\n});\n\nexport const RelayerExecuteParamsSchema = z.object({\n address: EvmAddressSchema,\n nonce: z.string().min(1),\n});\n\nexport type RelayerExecuteParams = z.output<typeof RelayerExecuteParamsSchema>;\n\nexport const RelayerLegacyExecuteRequestSchema = z.object({\n data: z.string().min(1),\n from: EvmAddressSchema,\n metadata: z.string().optional(),\n nonce: z.string().min(1).optional(),\n proxyWallet: EvmAddressSchema,\n signature: z.string().min(1),\n signatureParams: RelayerSignatureParamsSchema,\n to: EvmAddressSchema,\n type: RelayerLegacyTransactionTypeSchema,\n value: z.string().optional(),\n});\n\nexport type RelayerLegacyExecuteRequest = z.input<\n typeof RelayerLegacyExecuteRequestSchema\n>;\n\nexport const DepositWalletCallSchema = z.object({\n data: z.string().min(1),\n target: EvmAddressSchema,\n value: z.string().min(1),\n});\n\nexport type DepositWalletCall = z.input<typeof DepositWalletCallSchema>;\n\nexport const DepositWalletParamsSchema = z.object({\n calls: z.array(DepositWalletCallSchema).min(1),\n deadline: z.string().min(1),\n depositWallet: EvmAddressSchema,\n});\n\nexport type DepositWalletParams = z.input<typeof DepositWalletParamsSchema>;\n\nexport const RelayerDepositWalletExecuteRequestSchema = z.object({\n depositWalletParams: DepositWalletParamsSchema,\n from: EvmAddressSchema,\n metadata: z.string().optional(),\n nonce: z.string().min(1),\n signature: z.string().min(1),\n to: EvmAddressSchema,\n type: z.literal(RelayerTransactionType.WALLET),\n});\n\nexport type RelayerDepositWalletExecuteRequest = z.input<\n typeof RelayerDepositWalletExecuteRequestSchema\n>;\n\nexport const RelayerDepositWalletCreateRequestSchema = z.object({\n from: EvmAddressSchema,\n metadata: z.string().optional(),\n to: EvmAddressSchema,\n type: z.literal(RelayerTransactionType.WALLET_CREATE),\n});\n\nexport type RelayerDepositWalletCreateRequest = z.input<\n typeof RelayerDepositWalletCreateRequestSchema\n>;\n\nexport const RelayerExecuteRequestSchema = z.union([\n RelayerLegacyExecuteRequestSchema,\n RelayerDepositWalletExecuteRequestSchema,\n RelayerDepositWalletCreateRequestSchema,\n]);\n\nexport type RelayerExecuteRequest = z.input<typeof RelayerExecuteRequestSchema>;\n\nexport const RelayerExecuteResponseSchema = z\n .object({\n state: RelayerTransactionStateSchema,\n transactionHash: TxHashSchema.nullish().transform((value) => value ?? null),\n transactionID: TransactionIdSchema,\n })\n .transform(({ transactionHash, transactionID, ...rest }) => ({\n ...rest,\n transactionHash: transactionHash ?? null,\n transactionId: transactionID,\n }));\n\nexport type RelayerExecuteResponse = z.output<\n typeof RelayerExecuteResponseSchema\n>;\n\nexport const RelayerDeployedResponseSchema = z.object({\n deployed: z.boolean(),\n});\n\nexport type RelayerDeployedResponse = z.output<\n typeof RelayerDeployedResponseSchema\n>;\n\nexport const GaslessTransactionSchema = z\n .object({\n error_msg: z.string().nullish(),\n state: RelayerTransactionStateSchema,\n transaction_hash: z\n .union([z.literal(''), TxHashSchema])\n .transform((value) => (value === '' ? null : value)),\n transaction_id: TransactionIdSchema,\n })\n .transform(({ error_msg, transaction_hash, transaction_id, ...rest }) => ({\n ...rest,\n errorMsg: error_msg ?? null,\n transactionHash: transaction_hash ?? null,\n transactionId: transaction_id,\n }));\n\nexport type GaslessTransaction = z.output<typeof GaslessTransactionSchema>;\n"]}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { HexString, EvmAddress, TxHash } from '@kuest/types';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
type Tagged<T, Tag extends string> = T & {
|
|
5
|
+
readonly __tag: Tag;
|
|
6
|
+
};
|
|
7
|
+
declare enum CommentParentEntityType {
|
|
8
|
+
Event = "Event",
|
|
9
|
+
Series = "Series"
|
|
10
|
+
}
|
|
11
|
+
declare enum OrderSide {
|
|
12
|
+
BUY = "BUY",
|
|
13
|
+
SELL = "SELL"
|
|
14
|
+
}
|
|
15
|
+
declare enum OrderType {
|
|
16
|
+
GTC = "GTC",
|
|
17
|
+
FOK = "FOK",
|
|
18
|
+
GTD = "GTD",
|
|
19
|
+
FAK = "FAK"
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Lifecycle status of a trade, from creation through on-chain settlement.
|
|
23
|
+
* `Confirmed` and `Failed` are the terminal states.
|
|
24
|
+
* `MatchedNotBroadcasted` currently appears only on trades read via REST,
|
|
25
|
+
* not on user stream trade events.
|
|
26
|
+
*/
|
|
27
|
+
declare enum TradeStatus {
|
|
28
|
+
Matched = "TRADE_STATUS_MATCHED",
|
|
29
|
+
MatchedNotBroadcasted = "TRADE_STATUS_MATCHED_NOT_BROADCASTED",
|
|
30
|
+
Mined = "TRADE_STATUS_MINED",
|
|
31
|
+
Confirmed = "TRADE_STATUS_CONFIRMED",
|
|
32
|
+
Retrying = "TRADE_STATUS_RETRYING",
|
|
33
|
+
Failed = "TRADE_STATUS_FAILED"
|
|
34
|
+
}
|
|
35
|
+
/** Known venue scopes accepted by session-signer APIs. */
|
|
36
|
+
declare enum SessionSignerKnownScope {
|
|
37
|
+
/** All current and future venues. Cannot be combined with other scopes. */
|
|
38
|
+
ALL = "ALL",
|
|
39
|
+
/** Central limit order book trading. */
|
|
40
|
+
CLOB = "CLOB",
|
|
41
|
+
/** Combos request-for-quote trading. */
|
|
42
|
+
COMBOSRFQ = "COMBOSRFQ"
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A session-signer scope. Known scopes are enumerated in
|
|
46
|
+
* {@link SessionSignerKnownScope}; newly introduced scopes flow through as
|
|
47
|
+
* plain strings before a bindings release enumerates them.
|
|
48
|
+
*/
|
|
49
|
+
type SessionSignerScope = SessionSignerKnownScope | (string & {});
|
|
50
|
+
declare const SessionSignerScopeSchema: z.ZodPipe<z.ZodString, z.ZodTransform<(string & {}) | SessionSignerKnownScope, string>>;
|
|
51
|
+
type BestLineId = Tagged<string, 'BestLineId'>;
|
|
52
|
+
type BuilderCode = Tagged<HexString, 'BuilderCode'>;
|
|
53
|
+
type Uuid = Tagged<string, 'Uuid'>;
|
|
54
|
+
type ApiKey = Tagged<string, 'ApiKey'>;
|
|
55
|
+
type CategoryId = Tagged<string, 'CategoryId'>;
|
|
56
|
+
type ChatId = Tagged<string, 'ChatId'>;
|
|
57
|
+
type ClobRewardId = Tagged<string, 'ClobRewardId'>;
|
|
58
|
+
type CommentId = Tagged<string, 'CommentId'>;
|
|
59
|
+
type ComboActivityId = Tagged<string, 'ComboActivityId'>;
|
|
60
|
+
type ComboConditionId = Tagged<HexString, 'ComboConditionId'>;
|
|
61
|
+
type ConditionId = Tagged<HexString, 'ConditionId'>;
|
|
62
|
+
/** @deprecated Use {@link ConditionId}. */
|
|
63
|
+
type CtfConditionId = ConditionId;
|
|
64
|
+
type CollectionId = Tagged<string, 'CollectionId'>;
|
|
65
|
+
type EventCreatorId = Tagged<string, 'EventCreatorId'>;
|
|
66
|
+
type EventExternalPartnerMappingId = Tagged<number, 'EventExternalPartnerMappingId'>;
|
|
67
|
+
type EpochMilliseconds = Tagged<number, 'EpochMilliseconds'>;
|
|
68
|
+
type EventId = Tagged<string, 'EventId'>;
|
|
69
|
+
/** Protocol V2 neg-risk event identity (`bytes29`), distinct from an API event ID. */
|
|
70
|
+
type NegRiskEventId = Tagged<HexString, 'NegRiskEventId'>;
|
|
71
|
+
/**
|
|
72
|
+
* Parses a neg-risk event ID, accepting its native bytes29 or zero-padded bytes32 form.
|
|
73
|
+
* Requires module 2, at least two real conditions, and zero reserved bits.
|
|
74
|
+
*/
|
|
75
|
+
declare const NegRiskEventIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<NegRiskEventId, string>>;
|
|
76
|
+
type ImageOptimizationId = Tagged<string, 'ImageOptimizationId'>;
|
|
77
|
+
type InternalUserId = Tagged<string, 'InternalUserId'>;
|
|
78
|
+
type IsoCalendarDateString = Tagged<string, 'IsoCalendarDateString'>;
|
|
79
|
+
type IsoDateTimeString = Tagged<string, 'IsoDateTimeString'>;
|
|
80
|
+
type MarketId = Tagged<string, 'MarketId'>;
|
|
81
|
+
type MixedDateTimeString = Tagged<string, 'MixedDateTimeString'>;
|
|
82
|
+
type NotificationId = Tagged<number, 'NotificationId'>;
|
|
83
|
+
type OrderId = Tagged<string, 'OrderId'>;
|
|
84
|
+
type PartnerId = Tagged<number, 'PartnerId'>;
|
|
85
|
+
type PaginationCursor = Tagged<string, 'PaginationCursor'>;
|
|
86
|
+
type PositionId = Tagged<string, 'PositionId'>;
|
|
87
|
+
type QuestionId = Tagged<HexString, 'QuestionId'>;
|
|
88
|
+
type ResolutionRequestId = Tagged<HexString, 'ResolutionRequestId'>;
|
|
89
|
+
type RfqId = Tagged<string, 'RfqId'>;
|
|
90
|
+
type RfqQuoteId = Tagged<string, 'RfqQuoteId'>;
|
|
91
|
+
type RfqRequestorPublicId = Tagged<string, 'RfqRequestorPublicId'>;
|
|
92
|
+
type SeriesId = Tagged<string, 'SeriesId'>;
|
|
93
|
+
type SportId = Tagged<number, 'SportId'>;
|
|
94
|
+
type TagId = Tagged<string, 'TagId'>;
|
|
95
|
+
type TeamId = Tagged<number, 'TeamId'>;
|
|
96
|
+
type TemplateId = Tagged<string, 'TemplateId'>;
|
|
97
|
+
type TransactionId = Tagged<string, 'TransactionId'>;
|
|
98
|
+
type TokenId = Tagged<string, 'TokenId'>;
|
|
99
|
+
/** Identifier accepted by CLOB asset fields. */
|
|
100
|
+
type ClobAssetId = PositionId | TokenId;
|
|
101
|
+
type DecimalString = Tagged<string, 'DecimalString'>;
|
|
102
|
+
type BaseUnits = Tagged<string, 'BaseUnits'>;
|
|
103
|
+
declare function toBestLineId(value: string): BestLineId;
|
|
104
|
+
declare function toBuilderCode(value: string): BuilderCode;
|
|
105
|
+
declare function toUuid(value: string): Uuid;
|
|
106
|
+
declare function toApiKey(value: string): ApiKey;
|
|
107
|
+
declare function toCategoryId(value: string): CategoryId;
|
|
108
|
+
declare function toChatId(value: string): ChatId;
|
|
109
|
+
declare function toClobRewardId(value: string): ClobRewardId;
|
|
110
|
+
declare function toCommentId(value: string): CommentId;
|
|
111
|
+
declare function toComboActivityId(value: string): ComboActivityId;
|
|
112
|
+
declare function toConditionId(value: string): ConditionId;
|
|
113
|
+
declare function toComboConditionId(value: string): ComboConditionId;
|
|
114
|
+
declare function toCollectionId(value: string): CollectionId;
|
|
115
|
+
declare function toEventCreatorId(value: string): EventCreatorId;
|
|
116
|
+
declare function toEventExternalPartnerMappingId(value: number): EventExternalPartnerMappingId;
|
|
117
|
+
declare function toEpochMilliseconds(value: number): EpochMilliseconds;
|
|
118
|
+
declare function toEventId(value: string): EventId;
|
|
119
|
+
declare function toImageOptimizationId(value: string): ImageOptimizationId;
|
|
120
|
+
declare function toInternalUserId(value: string): InternalUserId;
|
|
121
|
+
declare function toIsoCalendarDateString(value: string): IsoCalendarDateString;
|
|
122
|
+
declare function toIsoDateTimeString(value: string): IsoDateTimeString;
|
|
123
|
+
declare function toMixedDateTimeString(value: string): MixedDateTimeString;
|
|
124
|
+
declare function toMarketId(value: string): MarketId;
|
|
125
|
+
declare function toNotificationId(value: number): NotificationId;
|
|
126
|
+
declare function toOrderId(value: string): OrderId;
|
|
127
|
+
declare function toPartnerId(value: number): PartnerId;
|
|
128
|
+
declare function toPaginationCursor(value: string): PaginationCursor;
|
|
129
|
+
declare function toPositionId(value: string): PositionId;
|
|
130
|
+
declare function toQuestionId(value: string): QuestionId;
|
|
131
|
+
declare function toResolutionRequestId(value: string): ResolutionRequestId;
|
|
132
|
+
declare function toRfqId(value: string): RfqId;
|
|
133
|
+
declare function toRfqQuoteId(value: string): RfqQuoteId;
|
|
134
|
+
declare function toRfqRequestorPublicId(value: string): RfqRequestorPublicId;
|
|
135
|
+
declare function toSeriesId(value: string): SeriesId;
|
|
136
|
+
declare function toSportId(value: number): SportId;
|
|
137
|
+
declare function toTagId(value: string): TagId;
|
|
138
|
+
declare function toTeamId(value: number): TeamId;
|
|
139
|
+
declare function toTemplateId(value: string): TemplateId;
|
|
140
|
+
declare function toTransactionId(value: string): TransactionId;
|
|
141
|
+
declare function toTokenId(value: string): TokenId;
|
|
142
|
+
declare function toDecimalString(value: string): DecimalString;
|
|
143
|
+
declare function toBaseUnits(value: string): BaseUnits;
|
|
144
|
+
declare const CategoryIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<CategoryId, string>>;
|
|
145
|
+
declare const ApiKeySchema: z.ZodPipe<z.ZodString, z.ZodTransform<ApiKey, string>>;
|
|
146
|
+
declare const BuilderCodeSchema: z.ZodPipe<z.ZodString, z.ZodTransform<BuilderCode, string>>;
|
|
147
|
+
declare const ClobRewardIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<ClobRewardId, string>>;
|
|
148
|
+
declare const CommentIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<CommentId, string>>;
|
|
149
|
+
declare const ComboActivityIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<ComboActivityId, string>>;
|
|
150
|
+
declare const ComboConditionIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<ComboConditionId, string>>;
|
|
151
|
+
declare const ConditionIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<ConditionId, string>>;
|
|
152
|
+
declare const ConditionIdResponseSchema: z.ZodCustom<ConditionId, ConditionId>;
|
|
153
|
+
declare const EvmAddressSchema: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress, string>>;
|
|
154
|
+
declare const EpochMillisecondsSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
155
|
+
declare const EpochSecondsToMillisecondsSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
156
|
+
declare const EpochMillisecondsStringSchema: z.ZodPipe<z.ZodString, z.ZodTransform<EpochMilliseconds, string>>;
|
|
157
|
+
declare const DateLikeToIsoDateTimeStringSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>;
|
|
158
|
+
declare const EpochLikeToIsoDateTimeStringSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>;
|
|
159
|
+
declare const OptionalDateLikeToIsoDateTimeStringSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString | undefined, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>;
|
|
160
|
+
declare const OptionalEpochLikeToIsoDateTimeStringSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString | undefined, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>;
|
|
161
|
+
declare const EpochMillisecondsToIsoDateTimeStringSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>;
|
|
162
|
+
declare const OptionalEpochMillisecondsToIsoDateTimeStringSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodTransform<IsoDateTimeString | undefined, number>>, z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>]>;
|
|
163
|
+
declare const EventIdSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodPipe<z.ZodNumber, z.ZodTransform<string, number>>]>, z.ZodTransform<EventId, string>>;
|
|
164
|
+
declare const TickSizeValueSchema: z.ZodUnion<readonly [z.ZodLiteral<0.1>, z.ZodLiteral<0.01>, z.ZodLiteral<0.005>, z.ZodLiteral<0.0025>, z.ZodLiteral<0.001>, z.ZodLiteral<0.0001>]>;
|
|
165
|
+
declare const IsoDateTimeStringSchema: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>, z.ZodPipe<z.ZodDate, z.ZodTransform<IsoDateTimeString, Date>>]>;
|
|
166
|
+
declare const IsoCalendarDateStringSchema: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<IsoCalendarDateString, string>>, z.ZodPipe<z.ZodDate, z.ZodTransform<IsoCalendarDateString, Date>>]>;
|
|
167
|
+
declare const MixedDateTimeStringSchema: z.ZodPipe<z.ZodString, z.ZodTransform<MixedDateTimeString, string>>;
|
|
168
|
+
declare const ISODateStringSchema: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<IsoDateTimeString, string>>, z.ZodPipe<z.ZodDate, z.ZodTransform<IsoDateTimeString, Date>>]>;
|
|
169
|
+
declare const ISOCalendarDateSchema: z.ZodUnion<[z.ZodPipe<z.ZodString, z.ZodTransform<IsoCalendarDateString, string>>, z.ZodPipe<z.ZodDate, z.ZodTransform<IsoCalendarDateString, Date>>]>;
|
|
170
|
+
declare const ImageOptimizationIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<ImageOptimizationId, string>>;
|
|
171
|
+
declare const InternalUserIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<InternalUserId, string>>;
|
|
172
|
+
declare const MarketIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<MarketId, string>>;
|
|
173
|
+
declare const NotificationIdSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<NotificationId, number>>;
|
|
174
|
+
declare const CommentParentEntityTypeSchema: z.ZodEnum<typeof CommentParentEntityType>;
|
|
175
|
+
declare const OrderIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<OrderId, string>>;
|
|
176
|
+
declare const OrderSideSchema: z.ZodEnum<typeof OrderSide>;
|
|
177
|
+
declare const OrderTypeSchema: z.ZodEnum<typeof OrderType>;
|
|
178
|
+
declare const TradeStatusSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodEnum<typeof TradeStatus>>;
|
|
179
|
+
declare const PaginationCursorSchema: z.ZodCustom<PaginationCursor, PaginationCursor>;
|
|
180
|
+
declare const PositionIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>;
|
|
181
|
+
/**
|
|
182
|
+
* CLOB payloads do not distinguish CTF token IDs from Polymarket V2 position
|
|
183
|
+
* IDs, so preserve both possible branded types when parsing an asset ID.
|
|
184
|
+
*/
|
|
185
|
+
declare const ClobAssetIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<PositionId | TokenId, string>>;
|
|
186
|
+
declare const QuestionIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<QuestionId, string>>;
|
|
187
|
+
declare const ResolutionRequestIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<ResolutionRequestId, string>>;
|
|
188
|
+
declare const RfqIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<RfqId, string>>;
|
|
189
|
+
declare const RfqQuoteIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<RfqQuoteId, string>>;
|
|
190
|
+
declare const RfqRequestorPublicIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<RfqRequestorPublicId, string>>;
|
|
191
|
+
declare const TagIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<TagId, string>>;
|
|
192
|
+
declare const TokenIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<TokenId, string>>;
|
|
193
|
+
declare const TransactionIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<TransactionId, string>>;
|
|
194
|
+
declare const TxHashSchema: z.ZodPipe<z.ZodString, z.ZodTransform<TxHash, string>>;
|
|
195
|
+
declare const DecimalStringSchema: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
196
|
+
declare const E6BigIntStringToDecimalStringSchema: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
197
|
+
declare const DecimalishSchema: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>, z.ZodPipe<z.ZodNumber, z.ZodTransform<DecimalString, number>>]>;
|
|
198
|
+
declare const PositiveDecimalNumberSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>]>, z.ZodNumber>;
|
|
199
|
+
declare const BaseUnitsSchema: z.ZodPipe<z.ZodString, z.ZodTransform<BaseUnits, string>>;
|
|
200
|
+
type ISODateString = IsoDateTimeString;
|
|
201
|
+
type ISOCalendarDateString = IsoCalendarDateString;
|
|
202
|
+
type TickSizeValue = z.output<typeof TickSizeValueSchema>;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Preprocess helper for upstream fields that serialize missing values as empty
|
|
206
|
+
* strings. Use as `z.preprocess(emptyStringToNull, Schema.nullable())`, or
|
|
207
|
+
* with `.nullish()` when the field can also be absent.
|
|
208
|
+
*/
|
|
209
|
+
declare function emptyStringToNull(value: unknown): unknown;
|
|
210
|
+
/**
|
|
211
|
+
* Preprocess helper for upstream fields that omit missing values or serialize
|
|
212
|
+
* them as empty strings. Normalizes `''` to `undefined` so the field can parse
|
|
213
|
+
* as `Schema.optional()`.
|
|
214
|
+
*/
|
|
215
|
+
declare function emptyStringToUndefined(value: unknown): unknown;
|
|
216
|
+
/**
|
|
217
|
+
* Optional decimal field whose upstream serialization uses an empty string
|
|
218
|
+
* for missing values. Normalizes `''` to `null` so consumers never receive
|
|
219
|
+
* an empty `DecimalString`; populated values parse as `DecimalStringSchema`.
|
|
220
|
+
*/
|
|
221
|
+
declare const OptionalDecimalStringSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>>>;
|
|
222
|
+
|
|
223
|
+
export { type IsoDateTimeString as $, type ApiKey as A, type BaseUnits as B, type CategoryId as C, DateLikeToIsoDateTimeStringSchema as D, DecimalishSchema as E, E6BigIntStringToDecimalStringSchema as F, EpochLikeToIsoDateTimeStringSchema as G, type EpochMilliseconds as H, EpochMillisecondsSchema as I, EpochMillisecondsStringSchema as J, EpochMillisecondsToIsoDateTimeStringSchema as K, EpochSecondsToMillisecondsSchema as L, type EventCreatorId as M, type EventExternalPartnerMappingId as N, type EventId as O, EventIdSchema as P, EvmAddressSchema as Q, ISOCalendarDateSchema as R, type ISOCalendarDateString as S, type ISODateString as T, ISODateStringSchema as U, type ImageOptimizationId as V, ImageOptimizationIdSchema as W, type InternalUserId as X, InternalUserIdSchema as Y, type IsoCalendarDateString as Z, IsoCalendarDateStringSchema as _, ApiKeySchema as a, toCollectionId as a$, IsoDateTimeStringSchema as a0, type MarketId as a1, MarketIdSchema as a2, type MixedDateTimeString as a3, MixedDateTimeStringSchema as a4, type NegRiskEventId as a5, NegRiskEventIdSchema as a6, type NotificationId as a7, NotificationIdSchema as a8, OptionalDateLikeToIsoDateTimeStringSchema as a9, SessionSignerKnownScope as aA, type SessionSignerScope as aB, SessionSignerScopeSchema as aC, type SportId as aD, type TagId as aE, TagIdSchema as aF, type TeamId as aG, type TemplateId as aH, type TickSizeValue as aI, TickSizeValueSchema as aJ, type TokenId as aK, TokenIdSchema as aL, TradeStatus as aM, TradeStatusSchema as aN, type TransactionId as aO, TransactionIdSchema as aP, TxHashSchema as aQ, type Uuid as aR, emptyStringToNull as aS, emptyStringToUndefined as aT, toApiKey as aU, toBaseUnits as aV, toBestLineId as aW, toBuilderCode as aX, toCategoryId as aY, toChatId as aZ, toClobRewardId as a_, OptionalDecimalStringSchema as aa, OptionalEpochLikeToIsoDateTimeStringSchema as ab, OptionalEpochMillisecondsToIsoDateTimeStringSchema as ac, type OrderId as ad, OrderIdSchema as ae, OrderSide as af, OrderSideSchema as ag, OrderType as ah, OrderTypeSchema as ai, type PaginationCursor as aj, PaginationCursorSchema as ak, type PartnerId as al, type PositionId as am, PositionIdSchema as an, PositiveDecimalNumberSchema as ao, type QuestionId as ap, QuestionIdSchema as aq, type ResolutionRequestId as ar, ResolutionRequestIdSchema as as, type RfqId as at, RfqIdSchema as au, type RfqQuoteId as av, RfqQuoteIdSchema as aw, type RfqRequestorPublicId as ax, RfqRequestorPublicIdSchema as ay, type SeriesId as az, BaseUnitsSchema as b, toComboActivityId as b0, toComboConditionId as b1, toCommentId as b2, toConditionId as b3, toDecimalString as b4, toEpochMilliseconds as b5, toEventCreatorId as b6, toEventExternalPartnerMappingId as b7, toEventId as b8, toImageOptimizationId as b9, toInternalUserId as ba, toIsoCalendarDateString as bb, toIsoDateTimeString as bc, toMarketId as bd, toMixedDateTimeString as be, toNotificationId as bf, toOrderId as bg, toPaginationCursor as bh, toPartnerId as bi, toPositionId as bj, toQuestionId as bk, toResolutionRequestId as bl, toRfqId as bm, toRfqQuoteId as bn, toRfqRequestorPublicId as bo, toSeriesId as bp, toSportId as bq, toTagId as br, toTeamId as bs, toTemplateId as bt, toTokenId as bu, toTransactionId as bv, toUuid as bw, type BestLineId as c, type BuilderCode as d, BuilderCodeSchema as e, CategoryIdSchema as f, type ChatId as g, type ClobAssetId as h, ClobAssetIdSchema as i, type ClobRewardId as j, ClobRewardIdSchema as k, type CollectionId as l, type ComboActivityId as m, ComboActivityIdSchema as n, type ComboConditionId as o, ComboConditionIdSchema as p, type CommentId as q, CommentIdSchema as r, CommentParentEntityType as s, CommentParentEntityTypeSchema as t, type ConditionId as u, ConditionIdResponseSchema as v, ConditionIdSchema as w, type CtfConditionId as x, type DecimalString as y, DecimalStringSchema as z };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare enum SignatureType {
|
|
4
|
+
/**
|
|
5
|
+
* ECDSA EIP712 signatures signed by EOAs
|
|
6
|
+
*/
|
|
7
|
+
EOA = 0,
|
|
8
|
+
/**
|
|
9
|
+
* EIP712 signatures signed by EOAs that own Polymarket Proxy wallets
|
|
10
|
+
*/
|
|
11
|
+
POLY_PROXY = 1,
|
|
12
|
+
/**
|
|
13
|
+
* EIP712 signatures signed by EOAs that own Polymarket Gnosis safes
|
|
14
|
+
*/
|
|
15
|
+
POLY_GNOSIS_SAFE = 2,
|
|
16
|
+
/**
|
|
17
|
+
* EIP1271 signatures signed by smart contracts
|
|
18
|
+
*/
|
|
19
|
+
POLY_1271 = 3
|
|
20
|
+
}
|
|
21
|
+
declare const SignatureTypeSchema: z.ZodEnum<typeof SignatureType>;
|
|
22
|
+
|
|
23
|
+
export { SignatureType as S, SignatureTypeSchema as a };
|