@polymarket/bindings 0.1.0-beta.3 → 0.1.0-beta.5
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/dist/chunk-IHJYHHWK.js +2 -0
- package/dist/chunk-IHJYHHWK.js.map +1 -0
- package/dist/chunk-YJ7M6UHS.js +2 -0
- package/dist/chunk-YJ7M6UHS.js.map +1 -0
- package/dist/clob/index.d.ts +50 -50
- package/dist/clob/index.js +1 -1
- package/dist/clob/index.js.map +1 -1
- package/dist/data/index.d.ts +56 -56
- package/dist/data/index.js +1 -1
- package/dist/data/index.js.map +1 -1
- package/dist/gamma/index.d.ts +67 -67
- package/dist/gamma/index.js +1 -1
- package/dist/index.d.ts +16 -5
- package/dist/index.js +1 -1
- package/dist/relayer/index.js +1 -1
- package/dist/relayer/index.js.map +1 -1
- package/dist/rfq.d.ts +92 -17
- package/dist/rfq.js +1 -1
- package/dist/rfq.js.map +1 -1
- package/dist/subscriptions/index.d.ts +10 -10
- package/dist/subscriptions/index.js +1 -1
- package/dist/subscriptions/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-HLGLT7ER.js +0 -2
- package/dist/chunk-HLGLT7ER.js.map +0 -1
- package/dist/chunk-KZQH7LDK.js +0 -2
- package/dist/chunk-KZQH7LDK.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -27,7 +27,10 @@ type CategoryId = Tagged<string, 'CategoryId'>;
|
|
|
27
27
|
type ChatId = Tagged<string, 'ChatId'>;
|
|
28
28
|
type ClobRewardId = Tagged<string, 'ClobRewardId'>;
|
|
29
29
|
type CommentId = Tagged<string, 'CommentId'>;
|
|
30
|
-
type
|
|
30
|
+
type ComboConditionId = Tagged<HexString, 'ComboConditionId'>;
|
|
31
|
+
type CtfConditionId = Tagged<HexString, 'CtfConditionId'>;
|
|
32
|
+
/** @deprecated Use {@link CtfConditionId}. */
|
|
33
|
+
type ConditionId = CtfConditionId;
|
|
31
34
|
type CollectionId = Tagged<string, 'CollectionId'>;
|
|
32
35
|
type EventCreatorId = Tagged<string, 'EventCreatorId'>;
|
|
33
36
|
type EventExternalPartnerMappingId = Tagged<number, 'EventExternalPartnerMappingId'>;
|
|
@@ -65,7 +68,10 @@ declare function toCategoryId(value: string): CategoryId;
|
|
|
65
68
|
declare function toChatId(value: string): ChatId;
|
|
66
69
|
declare function toClobRewardId(value: string): ClobRewardId;
|
|
67
70
|
declare function toCommentId(value: string): CommentId;
|
|
68
|
-
declare function
|
|
71
|
+
declare function toCtfConditionId(value: string): CtfConditionId;
|
|
72
|
+
/** @deprecated Use {@link toCtfConditionId}. */
|
|
73
|
+
declare const toConditionId: typeof toCtfConditionId;
|
|
74
|
+
declare function toComboConditionId(value: string): ComboConditionId;
|
|
69
75
|
declare function toCollectionId(value: string): CollectionId;
|
|
70
76
|
declare function toEventCreatorId(value: string): EventCreatorId;
|
|
71
77
|
declare function toEventExternalPartnerMappingId(value: number): EventExternalPartnerMappingId;
|
|
@@ -100,8 +106,13 @@ declare const ApiKeySchema: z.ZodPipe<z.ZodString, z.ZodTransform<ApiKey, string
|
|
|
100
106
|
declare const BuilderCodeSchema: z.ZodPipe<z.ZodString, z.ZodTransform<BuilderCode, string>>;
|
|
101
107
|
declare const ClobRewardIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<ClobRewardId, string>>;
|
|
102
108
|
declare const CommentIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<CommentId, string>>;
|
|
103
|
-
declare const
|
|
104
|
-
declare const
|
|
109
|
+
declare const ComboConditionIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<ComboConditionId, string>>;
|
|
110
|
+
declare const CtfConditionIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
111
|
+
declare const OptionalCtfConditionIdSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>>>;
|
|
112
|
+
/** @deprecated Use {@link CtfConditionIdSchema}. */
|
|
113
|
+
declare const ConditionIdSchema: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
114
|
+
/** @deprecated Use {@link OptionalCtfConditionIdSchema}. */
|
|
115
|
+
declare const OptionalConditionIdSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>>>;
|
|
105
116
|
declare const EvmAddressSchema: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress, string>>;
|
|
106
117
|
declare const EpochMillisecondsSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
107
118
|
declare const EpochSecondsToMillisecondsSchema: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
@@ -144,4 +155,4 @@ type ISODateString = IsoDateTimeString;
|
|
|
144
155
|
type ISOCalendarDateString = IsoCalendarDateString;
|
|
145
156
|
type TickSizeValue = z.output<typeof TickSizeValueSchema>;
|
|
146
157
|
|
|
147
|
-
export { type ApiKey, ApiKeySchema, type BaseUnits, BaseUnitsSchema, type BestLineId, type BuilderCode, BuilderCodeSchema, type CategoryId, CategoryIdSchema, type ChatId, type ClobRewardId, ClobRewardIdSchema, type CollectionId, type CommentId, CommentIdSchema, CommentParentEntityType, CommentParentEntityTypeSchema, type ConditionId, ConditionIdSchema, DateLikeToIsoDateTimeStringSchema, type DecimalString, DecimalStringSchema, DecimalishSchema, EpochLikeToIsoDateTimeStringSchema, type EpochMilliseconds, EpochMillisecondsSchema, EpochMillisecondsStringSchema, EpochMillisecondsToIsoDateTimeStringSchema, EpochSecondsToMillisecondsSchema, type EventCreatorId, type EventExternalPartnerMappingId, type EventId, EventIdSchema, EvmAddressSchema, ISOCalendarDateSchema, type ISOCalendarDateString, type ISODateString, ISODateStringSchema, type ImageOptimizationId, ImageOptimizationIdSchema, type InternalUserId, InternalUserIdSchema, type IsoCalendarDateString, IsoCalendarDateStringSchema, type IsoDateTimeString, IsoDateTimeStringSchema, type MarketId, MarketIdSchema, type MixedDateTimeString, MixedDateTimeStringSchema, type NotificationId, NotificationIdSchema, OptionalConditionIdSchema, OptionalDateLikeToIsoDateTimeStringSchema, OptionalEpochMillisecondsToIsoDateTimeStringSchema, OrderSide, OrderSideSchema, OrderType, OrderTypeSchema, type PaginationCursor, PaginationCursorSchema, type PartnerId, type PositionId, PositionIdSchema, PositiveDecimalNumberSchema, type QuestionId, QuestionIdSchema, type ResolutionRequestId, ResolutionRequestIdSchema, type RfqId, RfqIdSchema, type RfqQuoteId, RfqQuoteIdSchema, type RfqRequestorPublicId, RfqRequestorPublicIdSchema, type SeriesId, type SportId, type TagId, TagIdSchema, type TeamId, type TemplateId, type TickSizeValue, TickSizeValueSchema, type TokenId, TokenIdSchema, type TransactionId, TransactionIdSchema, TxHashSchema, type Uuid, toApiKey, toBaseUnits, toBestLineId, toBuilderCode, toCategoryId, toChatId, toClobRewardId, toCollectionId, toCommentId, toConditionId, toDecimalString, toEpochMilliseconds, toEventCreatorId, toEventExternalPartnerMappingId, toEventId, toImageOptimizationId, toInternalUserId, toIsoCalendarDateString, toIsoDateTimeString, toMarketId, toMixedDateTimeString, toNotificationId, toPaginationCursor, toPartnerId, toPositionId, toQuestionId, toResolutionRequestId, toRfqId, toRfqQuoteId, toRfqRequestorPublicId, toSeriesId, toSportId, toTagId, toTeamId, toTemplateId, toTokenId, toTransactionId, toUuid };
|
|
158
|
+
export { type ApiKey, ApiKeySchema, type BaseUnits, BaseUnitsSchema, type BestLineId, type BuilderCode, BuilderCodeSchema, type CategoryId, CategoryIdSchema, type ChatId, type ClobRewardId, ClobRewardIdSchema, type CollectionId, type ComboConditionId, ComboConditionIdSchema, type CommentId, CommentIdSchema, CommentParentEntityType, CommentParentEntityTypeSchema, type ConditionId, ConditionIdSchema, type CtfConditionId, CtfConditionIdSchema, DateLikeToIsoDateTimeStringSchema, type DecimalString, DecimalStringSchema, DecimalishSchema, EpochLikeToIsoDateTimeStringSchema, type EpochMilliseconds, EpochMillisecondsSchema, EpochMillisecondsStringSchema, EpochMillisecondsToIsoDateTimeStringSchema, EpochSecondsToMillisecondsSchema, type EventCreatorId, type EventExternalPartnerMappingId, type EventId, EventIdSchema, EvmAddressSchema, ISOCalendarDateSchema, type ISOCalendarDateString, type ISODateString, ISODateStringSchema, type ImageOptimizationId, ImageOptimizationIdSchema, type InternalUserId, InternalUserIdSchema, type IsoCalendarDateString, IsoCalendarDateStringSchema, type IsoDateTimeString, IsoDateTimeStringSchema, type MarketId, MarketIdSchema, type MixedDateTimeString, MixedDateTimeStringSchema, type NotificationId, NotificationIdSchema, OptionalConditionIdSchema, OptionalCtfConditionIdSchema, OptionalDateLikeToIsoDateTimeStringSchema, OptionalEpochMillisecondsToIsoDateTimeStringSchema, OrderSide, OrderSideSchema, OrderType, OrderTypeSchema, type PaginationCursor, PaginationCursorSchema, type PartnerId, type PositionId, PositionIdSchema, PositiveDecimalNumberSchema, type QuestionId, QuestionIdSchema, type ResolutionRequestId, ResolutionRequestIdSchema, type RfqId, RfqIdSchema, type RfqQuoteId, RfqQuoteIdSchema, type RfqRequestorPublicId, RfqRequestorPublicIdSchema, type SeriesId, type SportId, type TagId, TagIdSchema, type TeamId, type TemplateId, type TickSizeValue, TickSizeValueSchema, type TokenId, TokenIdSchema, type TransactionId, TransactionIdSchema, TxHashSchema, type Uuid, toApiKey, toBaseUnits, toBestLineId, toBuilderCode, toCategoryId, toChatId, toClobRewardId, toCollectionId, toComboConditionId, toCommentId, toConditionId, toCtfConditionId, toDecimalString, toEpochMilliseconds, toEventCreatorId, toEventExternalPartnerMappingId, toEventId, toImageOptimizationId, toInternalUserId, toIsoCalendarDateString, toIsoDateTimeString, toMarketId, toMixedDateTimeString, toNotificationId, toPaginationCursor, toPartnerId, toPositionId, toQuestionId, toResolutionRequestId, toRfqId, toRfqQuoteId, toRfqRequestorPublicId, toSeriesId, toSportId, toTagId, toTeamId, toTemplateId, toTokenId, toTransactionId, toUuid };
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{S as ApiKeySchema,Ka as BaseUnitsSchema,T as BuilderCodeSchema,R as CategoryIdSchema,U as ClobRewardIdSchema,W as ComboConditionIdSchema,V as CommentIdSchema,a as CommentParentEntityType,ta as CommentParentEntityTypeSchema,Z as ConditionIdSchema,X as CtfConditionIdSchema,da as DateLikeToIsoDateTimeStringSchema,Ha as DecimalStringSchema,Ia as DecimalishSchema,ea as EpochLikeToIsoDateTimeStringSchema,aa as EpochMillisecondsSchema,ca as EpochMillisecondsStringSchema,ga as EpochMillisecondsToIsoDateTimeStringSchema,ba as EpochSecondsToMillisecondsSchema,ia as EventIdSchema,$ as EvmAddressSchema,oa as ISOCalendarDateSchema,na as ISODateStringSchema,pa as ImageOptimizationIdSchema,qa as InternalUserIdSchema,la as IsoCalendarDateStringSchema,ka as IsoDateTimeStringSchema,ra as MarketIdSchema,ma as MixedDateTimeStringSchema,sa as NotificationIdSchema,_ as OptionalConditionIdSchema,Y as OptionalCtfConditionIdSchema,fa as OptionalDateLikeToIsoDateTimeStringSchema,ha as OptionalEpochMillisecondsToIsoDateTimeStringSchema,b as OrderSide,ua as OrderSideSchema,c as OrderType,va as OrderTypeSchema,wa as PaginationCursorSchema,xa as PositionIdSchema,Ja as PositiveDecimalNumberSchema,ya as QuestionIdSchema,za as ResolutionRequestIdSchema,Aa as RfqIdSchema,Ba as RfqQuoteIdSchema,Ca as RfqRequestorPublicIdSchema,Da as TagIdSchema,ja as TickSizeValueSchema,Ea as TokenIdSchema,Fa as TransactionIdSchema,Ga as TxHashSchema,g as toApiKey,Q as toBaseUnits,d as toBestLineId,e as toBuilderCode,h as toCategoryId,i as toChatId,j as toClobRewardId,o as toCollectionId,n as toComboConditionId,k as toCommentId,m as toConditionId,l as toCtfConditionId,P as toDecimalString,r as toEpochMilliseconds,p as toEventCreatorId,q as toEventExternalPartnerMappingId,s as toEventId,t as toImageOptimizationId,u as toInternalUserId,v as toIsoCalendarDateString,w as toIsoDateTimeString,y as toMarketId,x as toMixedDateTimeString,z as toNotificationId,B as toPaginationCursor,A as toPartnerId,C as toPositionId,D as toQuestionId,E as toResolutionRequestId,F as toRfqId,G as toRfqQuoteId,H as toRfqRequestorPublicId,I as toSeriesId,J as toSportId,K as toTagId,L as toTeamId,M as toTemplateId,O as toTokenId,N as toTransactionId,f as toUuid}from'./chunk-IHJYHHWK.js';//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/relayer/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {$,Fa,Ga}from'../chunk-IHJYHHWK.js';import {z}from'zod';var i=(n=>(n.SAFE="SAFE",n.PROXY="PROXY",n.SAFE_CREATE="SAFE-CREATE",n.WALLET="WALLET",n.WALLET_CREATE="WALLET-CREATE",n))(i||{}),D=z.enum(i),u=z.enum(["PROXY","SAFE","SAFE-CREATE"]),c=(o=>(o.STATE_NEW="STATE_NEW",o.STATE_EXECUTED="STATE_EXECUTED",o.STATE_MINED="STATE_MINED",o.STATE_CONFIRMED="STATE_CONFIRMED",o.STATE_INVALID="STATE_INVALID",o.STATE_FAILED="STATE_FAILED",o))(c||{}),m=z.enum(c),y=z.object({baseGas:z.string().optional(),gasLimit:z.string().optional(),gasPrice:z.string().optional(),gasToken:$.optional(),operation:z.string().optional(),payment:z.string().optional(),paymentReceiver:$.optional(),paymentToken:$.optional(),refundReceiver:$.optional(),relay:$.optional(),relayHub:$.optional(),relayerFee:z.string().optional(),safeTxnGas:z.string().optional()}),d=z.object({address:$,nonce:z.string().min(1)}),R=z.object({data:z.string().min(1),from:$,metadata:z.string().optional(),nonce:z.string().min(1).optional(),proxyWallet:$,signature:z.string().min(1),signatureParams:y,to:$,type:u,value:z.string().optional()}),T=z.object({data:z.string().min(1),target:$,value:z.string().min(1)}),x=z.object({calls:z.array(T).min(1),deadline:z.string().min(1),depositWallet:$}),S=z.object({depositWalletParams:x,from:$,metadata:z.string().optional(),nonce:z.string().min(1),signature:z.string().min(1),to:$,type:z.literal("WALLET")}),g=z.object({from:$,metadata:z.string().optional(),to:$,type:z.literal("WALLET-CREATE")}),W=z.union([R,S,g]),f=z.object({state:m,transactionHash:Ga.nullish().transform(a=>a??null),transactionID:Fa}).transform(({transactionHash:a,transactionID:s,...r})=>({...r,transactionHash:a??null,transactionId:s})),L=z.object({deployed:z.boolean()}),_=z.object({error_msg:z.string().nullish(),state:m,transaction_hash:z.union([z.literal(""),Ga]).transform(a=>a===""?null:a),transaction_id:Fa}).transform(({error_msg:a,transaction_hash:s,transaction_id:r,...E})=>({...E,errorMsg:a??null,transactionHash:s??null,transactionId:r}));export{T as DepositWalletCallSchema,x as DepositWalletParamsSchema,_ as GaslessTransactionSchema,L as RelayerDeployedResponseSchema,g as RelayerDepositWalletCreateRequestSchema,S as RelayerDepositWalletExecuteRequestSchema,d as RelayerExecuteParamsSchema,W as RelayerExecuteRequestSchema,f as RelayerExecuteResponseSchema,R as RelayerLegacyExecuteRequestSchema,c as RelayerTransactionState,i as RelayerTransactionType,D as RelayerTransactionTypeSchema};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/relayer/transaction.ts"],"names":["RelayerTransactionType","RelayerTransactionTypeSchema","z","RelayerLegacyTransactionTypeSchema","RelayerTransactionState","RelayerTransactionStateSchema","RelayerSignatureParamsSchema","EvmAddressSchema","RelayerExecuteParamsSchema","RelayerLegacyExecuteRequestSchema","DepositWalletCallSchema","DepositWalletParamsSchema","RelayerDepositWalletExecuteRequestSchema","RelayerDepositWalletCreateRequestSchema","RelayerExecuteRequestSchema","RelayerExecuteResponseSchema","TxHashSchema","value","TransactionIdSchema","transactionHash","transactionID","rest","RelayerDeployedResponseSchema","GaslessTransactionSchema","error_msg","transaction_hash","transaction_id"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/relayer/transaction.ts"],"names":["RelayerTransactionType","RelayerTransactionTypeSchema","z","RelayerLegacyTransactionTypeSchema","RelayerTransactionState","RelayerTransactionStateSchema","RelayerSignatureParamsSchema","EvmAddressSchema","RelayerExecuteParamsSchema","RelayerLegacyExecuteRequestSchema","DepositWalletCallSchema","DepositWalletParamsSchema","RelayerDepositWalletExecuteRequestSchema","RelayerDepositWalletCreateRequestSchema","RelayerExecuteRequestSchema","RelayerExecuteResponseSchema","TxHashSchema","value","TransactionIdSchema","transactionHash","transactionID","rest","RelayerDeployedResponseSchema","GaslessTransactionSchema","error_msg","transaction_hash","transaction_id"],"mappings":"+DAGO,IAAKA,OACVA,CAAAA,CAAA,IAAA,CAAO,MAAA,CACPA,CAAAA,CAAA,KAAA,CAAQ,OAAA,CACRA,EAAA,WAAA,CAAc,aAAA,CACdA,EAAA,MAAA,CAAS,QAAA,CACTA,EAAA,aAAA,CAAgB,eAAA,CALNA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,CAAA,CAQCC,CAAAA,CAA+BC,CAAAA,CAAE,KAAKF,CAAsB,CAAA,CAEnEG,EAAqCD,CAAAA,CAAE,IAAA,CAAK,CAChD,OAAA,CACA,MAAA,CACA,aACF,CAAC,CAAA,CAEWE,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,EAAA,SAAA,CAAY,WAAA,CACZA,EAAA,cAAA,CAAiB,gBAAA,CACjBA,EAAA,WAAA,CAAc,aAAA,CACdA,CAAAA,CAAA,eAAA,CAAkB,iBAAA,CAClBA,CAAAA,CAAA,cAAgB,eAAA,CAChBA,CAAAA,CAAA,aAAe,cAAA,CANLA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,IASNC,CAAAA,CAAgCH,CAAAA,CAAE,IAAA,CAAKE,CAAuB,CAAA,CAE9DE,CAAAA,CAA+BJ,EAAE,MAAA,CAAO,CAC5C,QAASA,CAAAA,CAAE,MAAA,GAAS,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Q,CAAE,SAAA,CAAWC,CAAAA,EAAUA,CAAAA,EAAS,IAAI,CAAA,CAC1E,cAAeC,EACjB,CAAC,EACA,SAAA,CAAU,CAAC,CAAE,eAAA,CAAAC,CAAAA,CAAiB,aAAA,CAAAC,CAAAA,CAAe,GAAGC,CAAK,KAAO,CAC3D,GAAGA,EACH,eAAA,CAAiBF,CAAAA,EAAmB,KACpC,aAAA,CAAeC,CACjB,CAAA,CAAE,CAAA,CAMSE,CAAAA,CAAgCpB,CAAAA,CAAE,OAAO,CACpD,QAAA,CAAUA,CAAAA,CAAE,OAAA,EACd,CAAC,EAMYqB,CAAAA,CAA2BrB,CAAAA,CACrC,MAAA,CAAO,CACN,SAAA,CAAWA,CAAAA,CAAE,QAAO,CAAE,OAAA,GACtB,KAAA,CAAOG,CAAAA,CACP,iBAAkBH,CAAAA,CACf,KAAA,CAAM,CAACA,CAAAA,CAAE,OAAA,CAAQ,EAAE,EAAGc,EAAY,CAAC,EACnC,SAAA,CAAWC,CAAAA,EAAWA,IAAU,EAAA,CAAK,IAAA,CAAOA,CAAM,CAAA,CACrD,cAAA,CAAgBC,EAClB,CAAC,CAAA,CACA,SAAA,CAAU,CAAC,CAAE,SAAA,CAAAM,EAAW,gBAAA,CAAAC,CAAAA,CAAkB,cAAA,CAAAC,CAAAA,CAAgB,GAAGL,CAAK,KAAO,CACxE,GAAGA,CAAAA,CACH,QAAA,CAAUG,CAAAA,EAAa,IAAA,CACvB,gBAAiBC,CAAAA,EAAoB,IAAA,CACrC,aAAA,CAAeC,CACjB,CAAA,CAAE","file":"index.js","sourcesContent":["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"]}
|
package/dist/rfq.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _polymarket_types from '@polymarket/types';
|
|
2
2
|
import { EvmAddress, HexString, EvmSignature, Erc1271Signature } from '@polymarket/types';
|
|
3
|
-
import {
|
|
3
|
+
import { MarketId, CtfConditionId, PositionId, DecimalString, PaginationCursor, RfqId, RfqQuoteId, ComboConditionId, EpochMilliseconds, OrderSide, TokenId, BaseUnits, RfqRequestorPublicId } from './index.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { S as SignatureType } from './signature-type-CrLAA9AN.js';
|
|
6
6
|
|
|
@@ -29,7 +29,6 @@ declare enum RfqRequestedSizeUnit {
|
|
|
29
29
|
}
|
|
30
30
|
declare enum RfqErrorCode {
|
|
31
31
|
AddressMismatch = "ADDRESS_MISMATCH",
|
|
32
|
-
CompetitionWindowClosed = "COMPETITION_WINDOW_CLOSED",
|
|
33
32
|
ContradictoryLegs = "CONTRADICTORY_LEGS",
|
|
34
33
|
ExpiredRfq = "EXPIRED_RFQ",
|
|
35
34
|
InvalidAcceptance = "INVALID_ACCEPTANCE",
|
|
@@ -49,6 +48,7 @@ declare enum RfqErrorCode {
|
|
|
49
48
|
RateLimited = "RATE_LIMITED",
|
|
50
49
|
RequestFailed = "REQUEST_FAILED",
|
|
51
50
|
ServiceUnavailable = "SERVICE_UNAVAILABLE",
|
|
51
|
+
SubmissionWindowClosed = "SUBMISSION_WINDOW_CLOSED",
|
|
52
52
|
TradeSubmissionFailed = "TRADE_SUBMISSION_FAILED",
|
|
53
53
|
Unauthenticated = "UNAUTHENTICATED",
|
|
54
54
|
UnauthorizedRole = "UNAUTHORIZED_ROLE",
|
|
@@ -60,6 +60,81 @@ declare const RfqConfirmationDecisionSchema: z.ZodEnum<typeof RfqConfirmationDec
|
|
|
60
60
|
declare const RfqExecutionStatusSchema: z.ZodEnum<typeof RfqExecutionStatus>;
|
|
61
61
|
declare const RfqRequestedSizeUnitSchema: z.ZodEnum<typeof RfqRequestedSizeUnit>;
|
|
62
62
|
declare const RfqErrorCodeSchema: z.ZodEnum<typeof RfqErrorCode>;
|
|
63
|
+
type ComboMarket = {
|
|
64
|
+
id: MarketId;
|
|
65
|
+
conditionId: CtfConditionId;
|
|
66
|
+
slug: string;
|
|
67
|
+
title: string;
|
|
68
|
+
outcomes: ComboMarketOutcomes;
|
|
69
|
+
image: string;
|
|
70
|
+
volume: number;
|
|
71
|
+
tags: string[];
|
|
72
|
+
};
|
|
73
|
+
type ComboMarketOutcome = {
|
|
74
|
+
label: string;
|
|
75
|
+
positionId: PositionId;
|
|
76
|
+
price: DecimalString;
|
|
77
|
+
};
|
|
78
|
+
type ComboMarketOutcomes = {
|
|
79
|
+
yes: ComboMarketOutcome;
|
|
80
|
+
no: ComboMarketOutcome;
|
|
81
|
+
};
|
|
82
|
+
declare const ComboMarketSchema: z.ZodPipe<z.ZodObject<{
|
|
83
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<MarketId, string>>;
|
|
84
|
+
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
85
|
+
position_ids: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>>;
|
|
86
|
+
slug: z.ZodString;
|
|
87
|
+
title: z.ZodString;
|
|
88
|
+
outcomes: z.ZodArray<z.ZodString>;
|
|
89
|
+
outcome_prices: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
90
|
+
image: z.ZodString;
|
|
91
|
+
volume: z.ZodNumber;
|
|
92
|
+
tags: z.ZodArray<z.ZodString>;
|
|
93
|
+
}, z.core.$strip>, z.ZodTransform<ComboMarket, {
|
|
94
|
+
id: MarketId;
|
|
95
|
+
condition_id: CtfConditionId;
|
|
96
|
+
position_ids: PositionId[];
|
|
97
|
+
slug: string;
|
|
98
|
+
title: string;
|
|
99
|
+
outcomes: string[];
|
|
100
|
+
outcome_prices: DecimalString[];
|
|
101
|
+
image: string;
|
|
102
|
+
volume: number;
|
|
103
|
+
tags: string[];
|
|
104
|
+
}>>;
|
|
105
|
+
declare const ListComboMarketsResponseSchema: z.ZodPipe<z.ZodObject<{
|
|
106
|
+
markets: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
107
|
+
id: z.ZodPipe<z.ZodString, z.ZodTransform<MarketId, string>>;
|
|
108
|
+
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>;
|
|
109
|
+
position_ids: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>>;
|
|
110
|
+
slug: z.ZodString;
|
|
111
|
+
title: z.ZodString;
|
|
112
|
+
outcomes: z.ZodArray<z.ZodString>;
|
|
113
|
+
outcome_prices: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>>;
|
|
114
|
+
image: z.ZodString;
|
|
115
|
+
volume: z.ZodNumber;
|
|
116
|
+
tags: z.ZodArray<z.ZodString>;
|
|
117
|
+
}, z.core.$strip>, z.ZodTransform<ComboMarket, {
|
|
118
|
+
id: MarketId;
|
|
119
|
+
condition_id: CtfConditionId;
|
|
120
|
+
position_ids: PositionId[];
|
|
121
|
+
slug: string;
|
|
122
|
+
title: string;
|
|
123
|
+
outcomes: string[];
|
|
124
|
+
outcome_prices: DecimalString[];
|
|
125
|
+
image: string;
|
|
126
|
+
volume: number;
|
|
127
|
+
tags: string[];
|
|
128
|
+
}>>>;
|
|
129
|
+
next_cursor: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<PaginationCursor, string>>>>;
|
|
130
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
131
|
+
markets: ComboMarket[];
|
|
132
|
+
nextCursor: PaginationCursor | undefined;
|
|
133
|
+
}, {
|
|
134
|
+
markets: ComboMarket[];
|
|
135
|
+
next_cursor?: PaginationCursor | null | undefined;
|
|
136
|
+
}>>;
|
|
137
|
+
type ListComboMarketsResponse = z.infer<typeof ListComboMarketsResponseSchema>;
|
|
63
138
|
type RfqRequestedSize = {
|
|
64
139
|
unit: RfqRequestedSizeUnit.Notional;
|
|
65
140
|
value: DecimalString;
|
|
@@ -122,7 +197,7 @@ declare const RfqQuoteRequestSchema: z.ZodPipe<z.ZodObject<{
|
|
|
122
197
|
rfq_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqId, string>>;
|
|
123
198
|
requestor_public_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqRequestorPublicId, string>>;
|
|
124
199
|
leg_position_ids: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>>;
|
|
125
|
-
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
200
|
+
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<ComboConditionId, string>>;
|
|
126
201
|
yes_position_id: z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>;
|
|
127
202
|
no_position_id: z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>;
|
|
128
203
|
direction: z.ZodEnum<typeof RfqDirection>;
|
|
@@ -148,7 +223,7 @@ declare const RfqQuoteRequestSchema: z.ZodPipe<z.ZodObject<{
|
|
|
148
223
|
}>>;
|
|
149
224
|
submission_deadline: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
150
225
|
}, z.core.$strip>, z.ZodTransform<{
|
|
151
|
-
conditionId:
|
|
226
|
+
conditionId: ComboConditionId;
|
|
152
227
|
direction: RfqDirection;
|
|
153
228
|
legPositionIds: PositionId[];
|
|
154
229
|
noPositionId: PositionId;
|
|
@@ -170,7 +245,7 @@ declare const RfqQuoteRequestSchema: z.ZodPipe<z.ZodObject<{
|
|
|
170
245
|
rfq_id: RfqId;
|
|
171
246
|
requestor_public_id: RfqRequestorPublicId;
|
|
172
247
|
leg_position_ids: PositionId[];
|
|
173
|
-
condition_id:
|
|
248
|
+
condition_id: ComboConditionId;
|
|
174
249
|
yes_position_id: PositionId;
|
|
175
250
|
no_position_id: PositionId;
|
|
176
251
|
direction: RfqDirection;
|
|
@@ -235,7 +310,7 @@ declare const RfqConfirmationRequestSchema: z.ZodPipe<z.ZodObject<{
|
|
|
235
310
|
maker_address: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress, string>>;
|
|
236
311
|
signature_type: z.ZodEnum<typeof SignatureType>;
|
|
237
312
|
leg_position_ids: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>>;
|
|
238
|
-
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
313
|
+
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<ComboConditionId, string>>;
|
|
239
314
|
yes_position_id: z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>;
|
|
240
315
|
no_position_id: z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>;
|
|
241
316
|
direction: z.ZodEnum<typeof RfqDirection>;
|
|
@@ -244,7 +319,7 @@ declare const RfqConfirmationRequestSchema: z.ZodPipe<z.ZodObject<{
|
|
|
244
319
|
price_e6: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
245
320
|
confirm_by: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
246
321
|
}, z.core.$strip>, z.ZodTransform<{
|
|
247
|
-
conditionId:
|
|
322
|
+
conditionId: ComboConditionId;
|
|
248
323
|
confirmBy: EpochMilliseconds;
|
|
249
324
|
direction: RfqDirection;
|
|
250
325
|
fillSize: DecimalString;
|
|
@@ -267,7 +342,7 @@ declare const RfqConfirmationRequestSchema: z.ZodPipe<z.ZodObject<{
|
|
|
267
342
|
maker_address: EvmAddress;
|
|
268
343
|
signature_type: SignatureType;
|
|
269
344
|
leg_position_ids: PositionId[];
|
|
270
|
-
condition_id:
|
|
345
|
+
condition_id: ComboConditionId;
|
|
271
346
|
yes_position_id: PositionId;
|
|
272
347
|
no_position_id: PositionId;
|
|
273
348
|
direction: RfqDirection;
|
|
@@ -342,7 +417,7 @@ declare const RfqErrorMessageSchema: z.ZodPipe<z.ZodObject<{
|
|
|
342
417
|
request?: unknown;
|
|
343
418
|
}>>;
|
|
344
419
|
type RfqErrorMessage = z.infer<typeof RfqErrorMessageSchema>;
|
|
345
|
-
declare const RfqQuoterInboundMessageSchema: z.
|
|
420
|
+
declare const RfqQuoterInboundMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
346
421
|
type: z.ZodLiteral<RfqKnownInboundType.Auth>;
|
|
347
422
|
success: z.ZodBoolean;
|
|
348
423
|
address: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress, string>>>;
|
|
@@ -353,7 +428,7 @@ declare const RfqQuoterInboundMessageSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
353
428
|
rfq_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqId, string>>;
|
|
354
429
|
requestor_public_id: z.ZodPipe<z.ZodString, z.ZodTransform<RfqRequestorPublicId, string>>;
|
|
355
430
|
leg_position_ids: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>>;
|
|
356
|
-
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
431
|
+
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<ComboConditionId, string>>;
|
|
357
432
|
yes_position_id: z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>;
|
|
358
433
|
no_position_id: z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>;
|
|
359
434
|
direction: z.ZodEnum<typeof RfqDirection>;
|
|
@@ -379,7 +454,7 @@ declare const RfqQuoterInboundMessageSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
379
454
|
}>>;
|
|
380
455
|
submission_deadline: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
381
456
|
}, z.core.$strip>, z.ZodTransform<{
|
|
382
|
-
conditionId:
|
|
457
|
+
conditionId: ComboConditionId;
|
|
383
458
|
direction: RfqDirection;
|
|
384
459
|
legPositionIds: PositionId[];
|
|
385
460
|
noPositionId: PositionId;
|
|
@@ -401,7 +476,7 @@ declare const RfqQuoterInboundMessageSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
401
476
|
rfq_id: RfqId;
|
|
402
477
|
requestor_public_id: RfqRequestorPublicId;
|
|
403
478
|
leg_position_ids: PositionId[];
|
|
404
|
-
condition_id:
|
|
479
|
+
condition_id: ComboConditionId;
|
|
405
480
|
yes_position_id: PositionId;
|
|
406
481
|
no_position_id: PositionId;
|
|
407
482
|
direction: RfqDirection;
|
|
@@ -446,7 +521,7 @@ declare const RfqQuoterInboundMessageSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
446
521
|
maker_address: z.ZodPipe<z.ZodString, z.ZodTransform<EvmAddress, string>>;
|
|
447
522
|
signature_type: z.ZodEnum<typeof SignatureType>;
|
|
448
523
|
leg_position_ids: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>>;
|
|
449
|
-
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
524
|
+
condition_id: z.ZodPipe<z.ZodString, z.ZodTransform<ComboConditionId, string>>;
|
|
450
525
|
yes_position_id: z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>;
|
|
451
526
|
no_position_id: z.ZodPipe<z.ZodString, z.ZodTransform<PositionId, string>>;
|
|
452
527
|
direction: z.ZodEnum<typeof RfqDirection>;
|
|
@@ -455,7 +530,7 @@ declare const RfqQuoterInboundMessageSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
455
530
|
price_e6: z.ZodPipe<z.ZodString, z.ZodTransform<DecimalString, string>>;
|
|
456
531
|
confirm_by: z.ZodPipe<z.ZodNumber, z.ZodTransform<EpochMilliseconds, number>>;
|
|
457
532
|
}, z.core.$strip>, z.ZodTransform<{
|
|
458
|
-
conditionId:
|
|
533
|
+
conditionId: ComboConditionId;
|
|
459
534
|
confirmBy: EpochMilliseconds;
|
|
460
535
|
direction: RfqDirection;
|
|
461
536
|
fillSize: DecimalString;
|
|
@@ -478,7 +553,7 @@ declare const RfqQuoterInboundMessageSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
478
553
|
maker_address: EvmAddress;
|
|
479
554
|
signature_type: SignatureType;
|
|
480
555
|
leg_position_ids: PositionId[];
|
|
481
|
-
condition_id:
|
|
556
|
+
condition_id: ComboConditionId;
|
|
482
557
|
yes_position_id: PositionId;
|
|
483
558
|
no_position_id: PositionId;
|
|
484
559
|
direction: RfqDirection;
|
|
@@ -539,8 +614,8 @@ declare const RfqQuoterInboundMessageSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
539
614
|
rfq_id?: RfqId | undefined;
|
|
540
615
|
quote_id?: RfqQuoteId | undefined;
|
|
541
616
|
request?: unknown;
|
|
542
|
-
}>>]>;
|
|
617
|
+
}>>], "type">;
|
|
543
618
|
type RfqQuoterInboundMessage = z.infer<typeof RfqQuoterInboundMessageSchema>;
|
|
544
619
|
type RfqQuoterOutboundMessage = RfqQuoteMessage | RfqQuoteCancelMessage | RfqConfirmationResponseMessage;
|
|
545
620
|
|
|
546
|
-
export { type RfqAuthMessage, type RfqAuthResponseMessage, RfqAuthResponseMessageSchema, type RfqConfirmationAck, RfqConfirmationAckSchema, RfqConfirmationDecision, RfqConfirmationDecisionSchema, type RfqConfirmationRequest, RfqConfirmationRequestSchema, type RfqConfirmationResponseMessage, RfqDirection, RfqDirectionSchema, RfqErrorCode, RfqErrorCodeSchema, type RfqErrorMessage, RfqErrorMessageSchema, RfqExecutionStatus, RfqExecutionStatusSchema, type RfqExecutionUpdate, RfqExecutionUpdateSchema, RfqId, RfqKnownInboundMessageSchema, RfqKnownInboundType, type RfqOrderSide, type RfqQuoteAck, RfqQuoteAckSchema, type RfqQuoteCancelAck, RfqQuoteCancelAckSchema, type RfqQuoteCancelMessage, RfqQuoteId, type RfqQuoteMessage, type RfqQuoteRequest, RfqQuoteRequestSchema, type RfqQuoterInboundMessage, RfqQuoterInboundMessageSchema, type RfqQuoterOutboundMessage, type RfqRequestedSize, RfqRequestedSizeUnit, RfqRequestedSizeUnitSchema, RfqRequestorPublicId, RfqSide, RfqSideSchema, type RfqSignedOrder };
|
|
621
|
+
export { type ComboMarket, type ComboMarketOutcome, type ComboMarketOutcomes, ComboMarketSchema, type ListComboMarketsResponse, ListComboMarketsResponseSchema, type RfqAuthMessage, type RfqAuthResponseMessage, RfqAuthResponseMessageSchema, type RfqConfirmationAck, RfqConfirmationAckSchema, RfqConfirmationDecision, RfqConfirmationDecisionSchema, type RfqConfirmationRequest, RfqConfirmationRequestSchema, type RfqConfirmationResponseMessage, RfqDirection, RfqDirectionSchema, RfqErrorCode, RfqErrorCodeSchema, type RfqErrorMessage, RfqErrorMessageSchema, RfqExecutionStatus, RfqExecutionStatusSchema, type RfqExecutionUpdate, RfqExecutionUpdateSchema, RfqId, RfqKnownInboundMessageSchema, RfqKnownInboundType, type RfqOrderSide, type RfqQuoteAck, RfqQuoteAckSchema, type RfqQuoteCancelAck, RfqQuoteCancelAckSchema, type RfqQuoteCancelMessage, RfqQuoteId, type RfqQuoteMessage, type RfqQuoteRequest, RfqQuoteRequestSchema, type RfqQuoterInboundMessage, RfqQuoterInboundMessageSchema, type RfqQuoterOutboundMessage, type RfqRequestedSize, RfqRequestedSizeUnit, RfqRequestedSizeUnitSchema, RfqRequestorPublicId, RfqSide, RfqSideSchema, type RfqSignedOrder };
|
package/dist/rfq.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {b as b$1}from'./chunk-HOD4LKZU.js';import {
|
|
1
|
+
import {b as b$1}from'./chunk-HOD4LKZU.js';import {X as X$1,ra,Ha,xa,wa,P as P$1,$,aa,W as W$1,Ca,Aa,Ba,Ga}from'./chunk-IHJYHHWK.js';import {z as z$1}from'zod';var x=(o=>(o.Buy="BUY",o.Sell="SELL",o))(x||{}),b=(o=>(o.Yes="YES",o.No="NO",o))(b||{}),E=(o=>(o.Confirm="CONFIRM",o.Decline="DECLINE",o))(E||{}),M=(u=>(u.Matched="MATCHED",u.Mined="MINED",u.Confirmed="CONFIRMED",u.Retrying="RETRYING",u.Failed="FAILED",u))(M||{}),Q=(o=>(o.Notional="notional",o.Shares="shares",o))(Q||{}),T=(i=>(i.AddressMismatch="ADDRESS_MISMATCH",i.ContradictoryLegs="CONTRADICTORY_LEGS",i.ExpiredRfq="EXPIRED_RFQ",i.InvalidAcceptance="INVALID_ACCEPTANCE",i.InvalidConfirmation="INVALID_CONFIRMATION",i.InvalidExecutionResult="INVALID_EXECUTION_RESULT",i.InvalidIdentity="INVALID_IDENTITY",i.InvalidMessage="INVALID_MESSAGE",i.InvalidQuote="INVALID_QUOTE",i.InvalidRfq="INVALID_RFQ",i.InvalidRfqState="INVALID_RFQ_STATE",i.InvalidRole="INVALID_ROLE",i.LegMetadataUnavailable="LEG_METADATA_UNAVAILABLE",i.MakerAlreadyResponded="MAKER_ALREADY_RESPONDED",i.MakerNotRequired="MAKER_NOT_REQUIRED",i.QuoteMismatch="QUOTE_MISMATCH",i.QuoteUnavailable="QUOTE_UNAVAILABLE",i.RateLimited="RATE_LIMITED",i.RequestFailed="REQUEST_FAILED",i.ServiceUnavailable="SERVICE_UNAVAILABLE",i.SubmissionWindowClosed="SUBMISSION_WINDOW_CLOSED",i.TradeSubmissionFailed="TRADE_SUBMISSION_FAILED",i.Unauthenticated="UNAUTHENTICATED",i.UnauthorizedRole="UNAUTHORIZED_ROLE",i.UnknownRfq="UNKNOWN_RFQ",i))(T||{}),N=z$1.enum(x),C=z$1.literal("YES"),U=z$1.enum(E),D=z$1.enum(M),G=z$1.enum(Q),L=z$1.enum(T),v=z$1.object({id:ra,condition_id:X$1,position_ids:z$1.array(xa),slug:z$1.string(),title:z$1.string(),outcomes:z$1.array(z$1.string()),outcome_prices:z$1.array(Ha),image:z$1.string(),volume:z$1.number(),tags:z$1.array(z$1.string())}).superRefine((e,d)=>{e.outcomes.length!==2&&d.addIssue({code:"custom",message:`Expected binary combo market outcomes, received ${e.outcomes.length}.`,path:["outcomes"]}),e.position_ids.length!==e.outcomes.length&&d.addIssue({code:"custom",message:"Expected position_ids and outcomes to have matching lengths.",path:["position_ids"]}),e.outcome_prices.length!==e.outcomes.length&&d.addIssue({code:"custom",message:"Expected outcome_prices and outcomes to have matching lengths.",path:["outcome_prices"]});}).transform(e=>({conditionId:e.condition_id,id:e.id,image:e.image,outcomes:{yes:{label:e.outcomes[0],positionId:e.position_ids[0],price:e.outcome_prices[0]},no:{label:e.outcomes[1],positionId:e.position_ids[1],price:e.outcome_prices[1]}},slug:e.slug,tags:e.tags,title:e.title,volume:e.volume})),W=z$1.object({markets:z$1.array(v),next_cursor:wa.nullish()}).transform(e=>({markets:e.markets,nextCursor:e.next_cursor??void 0})),_=z$1.string().regex(/^\d+$/).transform(e=>{let d=BigInt(e),o=d/1000000n,f=(d%1000000n).toString().padStart(6,"0").replace(/0+$/,"");return P$1(`${o}${f===""?"":`.${f}`}`)}),k=z$1.discriminatedUnion("unit",[z$1.object({unit:z$1.literal("notional"),value_e6:_}),z$1.object({unit:z$1.literal("shares"),value_e6:_})]).transform(e=>({unit:e.unit,value:e.value_e6})),O=(n=>(n.Auth="auth",n.QuoteRequest="RFQ_REQUEST",n.QuoteAck="ACK_RFQ_QUOTE",n.QuoteCancelAck="ACK_RFQ_QUOTE_CANCEL",n.ConfirmationRequest="RFQ_CONFIRMATION_REQUEST",n.ConfirmationAck="ACK_RFQ_CONFIRMATION_RESPONSE",n.ExecutionUpdate="RFQ_EXECUTION_UPDATE",n.Error="RFQ_ERROR",n))(O||{}),a=z$1.object({type:z$1.enum(O)}),z=a.extend({type:z$1.literal("auth"),success:z$1.boolean(),address:$.optional(),role:z$1.string().optional(),error:z$1.string().optional()}),F=a.extend({type:z$1.literal("RFQ_REQUEST"),rfq_id:Aa,requestor_public_id:Ca,leg_position_ids:z$1.array(xa),condition_id:W$1,yes_position_id:xa,no_position_id:xa,direction:N,side:C,requested_size:k,submission_deadline:aa}).transform(e=>({conditionId:e.condition_id,direction:e.direction,legPositionIds:e.leg_position_ids,noPositionId:e.no_position_id,requestorPublicId:e.requestor_public_id,requestedSize:e.requested_size,rfqId:e.rfq_id,side:e.side,submissionDeadline:e.submission_deadline,type:"quote_request",yesPositionId:e.yes_position_id})),P=a.extend({type:z$1.literal("ACK_RFQ_QUOTE"),rfq_id:Aa,quote_id:Ba}).transform(e=>({quoteId:e.quote_id,rfqId:e.rfq_id,type:"quote_ack"})),V=a.extend({type:z$1.literal("ACK_RFQ_QUOTE_CANCEL"),rfq_id:Aa,quote_id:Ba}).transform(e=>({quoteId:e.quote_id,rfqId:e.rfq_id,type:"quote_cancel_ack"})),B=a.extend({type:z$1.literal("RFQ_CONFIRMATION_REQUEST"),rfq_id:Aa,quote_id:Ba,signer_address:$,maker_address:$,signature_type:b$1,leg_position_ids:z$1.array(xa),condition_id:W$1,yes_position_id:xa,no_position_id:xa,direction:N,side:C,fill_size_e6:_,price_e6:_,confirm_by:aa}).transform(e=>({conditionId:e.condition_id,confirmBy:e.confirm_by,direction:e.direction,fillSize:e.fill_size_e6,legPositionIds:e.leg_position_ids,makerAddress:e.maker_address,noPositionId:e.no_position_id,price:e.price_e6,quoteId:e.quote_id,rfqId:e.rfq_id,side:e.side,signatureType:e.signature_type,signerAddress:e.signer_address,type:"confirmation_request",yesPositionId:e.yes_position_id})),H=a.extend({type:z$1.literal("ACK_RFQ_CONFIRMATION_RESPONSE"),rfq_id:Aa,quote_id:Ba,decision:U}).transform(e=>({decision:e.decision,quoteId:e.quote_id,rfqId:e.rfq_id,type:"confirmation_ack"})),K=a.extend({type:z$1.literal("RFQ_EXECUTION_UPDATE"),rfq_id:Aa,status:D,tx_hash:Ga.optional()}).transform(e=>({rfqId:e.rfq_id,status:e.status,...e.tx_hash===void 0?{}:{txHash:e.tx_hash},type:"execution_update"})),Y=a.extend({type:z$1.literal("RFQ_ERROR"),request_type:z$1.string().optional(),rfq_id:Aa.optional(),quote_id:Ba.optional(),code:L,error:z$1.string(),request:z$1.unknown().optional()}).transform(e=>({code:e.code,message:e.error,quoteId:e.quote_id,requestType:e.request_type,rfqId:e.rfq_id,type:"rfq_error"})),X=z$1.discriminatedUnion("type",[z,F,P,V,B,H,K,Y]);export{v as ComboMarketSchema,W as ListComboMarketsResponseSchema,z as RfqAuthResponseMessageSchema,H as RfqConfirmationAckSchema,E as RfqConfirmationDecision,U as RfqConfirmationDecisionSchema,B as RfqConfirmationRequestSchema,x as RfqDirection,N as RfqDirectionSchema,T as RfqErrorCode,L as RfqErrorCodeSchema,Y as RfqErrorMessageSchema,M as RfqExecutionStatus,D as RfqExecutionStatusSchema,K as RfqExecutionUpdateSchema,a as RfqKnownInboundMessageSchema,O as RfqKnownInboundType,P as RfqQuoteAckSchema,V as RfqQuoteCancelAckSchema,F as RfqQuoteRequestSchema,X as RfqQuoterInboundMessageSchema,Q as RfqRequestedSizeUnit,G as RfqRequestedSizeUnitSchema,b as RfqSide,C as RfqSideSchema};//# sourceMappingURL=rfq.js.map
|
|
2
2
|
//# sourceMappingURL=rfq.js.map
|
package/dist/rfq.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/rfq.ts"],"names":["RfqDirection","RfqSide","RfqConfirmationDecision","RfqExecutionStatus","RfqRequestedSizeUnit","RfqErrorCode","RfqDirectionSchema","z","RfqSideSchema","RfqConfirmationDecisionSchema","RfqExecutionStatusSchema","RfqRequestedSizeUnitSchema","RfqErrorCodeSchema","BigIntStringToDecimalStringSchema","value","scaledValue","whole","fraction","toDecimalString","RfqRequestedSizeSchema","size","RfqKnownInboundType","RfqKnownInboundMessageSchema","RfqAuthResponseMessageSchema","EvmAddressSchema","RfqQuoteRequestSchema","RfqIdSchema","RfqRequestorPublicIdSchema","PositionIdSchema","ConditionIdSchema","EpochMillisecondsSchema","message","RfqQuoteAckSchema","RfqQuoteIdSchema","RfqQuoteCancelAckSchema","RfqConfirmationRequestSchema","SignatureTypeSchema","RfqConfirmationAckSchema","RfqExecutionUpdateSchema","TxHashSchema","RfqErrorMessageSchema","RfqQuoterInboundMessageSchema"],"mappings":"6IA8BO,IAAKA,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,EAAA,GAAA,CAAM,KAAA,CACNA,CAAAA,CAAA,IAAA,CAAO,OAFGA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,CAAA,CAKAC,OACVA,CAAAA,CAAA,GAAA,CAAM,MACNA,CAAAA,CAAA,EAAA,CAAK,IAAA,CAFKA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,IAKAC,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,QAAU,SAAA,CACVA,CAAAA,CAAA,QAAU,SAAA,CAFAA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,CAAA,CAKAC,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,EAAA,OAAA,CAAU,SAAA,CACVA,EAAA,KAAA,CAAQ,OAAA,CACRA,EAAA,SAAA,CAAY,WAAA,CACZA,CAAAA,CAAA,QAAA,CAAW,WACXA,CAAAA,CAAA,MAAA,CAAS,QAAA,CALCA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,IAQAC,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,QAAA,CAAW,UAAA,CACXA,EAAA,MAAA,CAAS,QAAA,CAFCA,OAAA,EAAA,CAAA,CAKAC,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,EAAA,eAAA,CAAkB,kBAAA,CAClBA,CAAAA,CAAA,uBAAA,CAA0B,4BAC1BA,CAAAA,CAAA,iBAAA,CAAoB,qBACpBA,CAAAA,CAAA,UAAA,CAA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CAAE,SAAQ,CAAE,QAAA,EACvB,CAAC,CAAA,CAAE,UAAWwB,CAAAA,GAAa,CACzB,IAAA,CAAMA,CAAAA,CAAQ,KACd,OAAA,CAASA,CAAAA,CAAQ,MACjB,OAAA,CAASA,CAAAA,CAAQ,SACjB,WAAA,CAAaA,CAAAA,CAAQ,YAAA,CACrB,KAAA,CAAOA,EAAQ,MAAA,CACf,IAAA,CAAM,WACR,CAAA,CAAE,CAAA,CAIWU,EAAgClC,GAAAA,CAAE,KAAA,CAAM,CACnDgB,CAAAA,CACAE,EACAO,CAAAA,CACAE,CAAAA,CACAC,EACAE,CAAAA,CACAC,CAAAA,CACAE,CACF,CAAC","file":"rfq.js","sourcesContent":["import type {\n Erc1271Signature,\n EvmSignature,\n HexString,\n} from '@polymarket/types';\nimport { z } from 'zod';\nimport { type SignatureType, SignatureTypeSchema } from './clob/signature-type';\nimport type { BaseUnits, DecimalString, EvmAddress, TokenId } from './shared';\nimport {\n ConditionIdSchema,\n EpochMillisecondsSchema,\n EvmAddressSchema,\n type OrderSide,\n type PositionId,\n PositionIdSchema,\n type RfqId,\n RfqIdSchema,\n type RfqQuoteId,\n RfqQuoteIdSchema,\n RfqRequestorPublicIdSchema,\n TxHashSchema,\n toDecimalString,\n} from './shared';\n\nexport type {\n RfqId,\n RfqQuoteId,\n RfqRequestorPublicId,\n} from './shared';\n\nexport enum RfqDirection {\n Buy = 'BUY',\n Sell = 'SELL',\n}\n\nexport enum RfqSide {\n Yes = 'YES',\n No = 'NO',\n}\n\nexport enum RfqConfirmationDecision {\n Confirm = 'CONFIRM',\n Decline = 'DECLINE',\n}\n\nexport enum RfqExecutionStatus {\n Matched = 'MATCHED',\n Mined = 'MINED',\n Confirmed = 'CONFIRMED',\n Retrying = 'RETRYING',\n Failed = 'FAILED',\n}\n\nexport enum RfqRequestedSizeUnit {\n Notional = 'notional',\n Shares = 'shares',\n}\n\nexport enum RfqErrorCode {\n AddressMismatch = 'ADDRESS_MISMATCH',\n CompetitionWindowClosed = 'COMPETITION_WINDOW_CLOSED',\n ContradictoryLegs = 'CONTRADICTORY_LEGS',\n ExpiredRfq = 'EXPIRED_RFQ',\n InvalidAcceptance = 'INVALID_ACCEPTANCE',\n InvalidConfirmation = 'INVALID_CONFIRMATION',\n InvalidExecutionResult = 'INVALID_EXECUTION_RESULT',\n InvalidIdentity = 'INVALID_IDENTITY',\n InvalidMessage = 'INVALID_MESSAGE',\n InvalidQuote = 'INVALID_QUOTE',\n InvalidRfq = 'INVALID_RFQ',\n InvalidRfqState = 'INVALID_RFQ_STATE',\n InvalidRole = 'INVALID_ROLE',\n LegMetadataUnavailable = 'LEG_METADATA_UNAVAILABLE',\n MakerAlreadyResponded = 'MAKER_ALREADY_RESPONDED',\n MakerNotRequired = 'MAKER_NOT_REQUIRED',\n QuoteMismatch = 'QUOTE_MISMATCH',\n QuoteUnavailable = 'QUOTE_UNAVAILABLE',\n RateLimited = 'RATE_LIMITED',\n RequestFailed = 'REQUEST_FAILED',\n ServiceUnavailable = 'SERVICE_UNAVAILABLE',\n TradeSubmissionFailed = 'TRADE_SUBMISSION_FAILED',\n Unauthenticated = 'UNAUTHENTICATED',\n UnauthorizedRole = 'UNAUTHORIZED_ROLE',\n UnknownRfq = 'UNKNOWN_RFQ',\n}\n\nexport const RfqDirectionSchema = z.enum(RfqDirection);\nexport const RfqSideSchema = z.literal(RfqSide.Yes);\nexport const RfqConfirmationDecisionSchema = z.enum(RfqConfirmationDecision);\nexport const RfqExecutionStatusSchema = z.enum(RfqExecutionStatus);\nexport const RfqRequestedSizeUnitSchema = z.enum(RfqRequestedSizeUnit);\nexport const RfqErrorCodeSchema = z.enum(RfqErrorCode);\n\nconst BigIntStringToDecimalStringSchema = z\n .string()\n .regex(/^\\d+$/)\n .transform((value) => {\n const scaledValue = BigInt(value);\n const whole = scaledValue / 1_000_000n;\n const fraction = (scaledValue % 1_000_000n)\n .toString()\n .padStart(6, '0')\n .replace(/0+$/, '');\n\n return toDecimalString(`${whole}${fraction === '' ? '' : `.${fraction}`}`);\n });\n\nexport type RfqRequestedSize =\n | {\n unit: RfqRequestedSizeUnit.Notional;\n value: DecimalString;\n }\n | {\n unit: RfqRequestedSizeUnit.Shares;\n value: DecimalString;\n };\n\nconst RfqRequestedSizeSchema = z\n .discriminatedUnion('unit', [\n z.object({\n unit: z.literal(RfqRequestedSizeUnit.Notional),\n value_e6: BigIntStringToDecimalStringSchema,\n }),\n z.object({\n unit: z.literal(RfqRequestedSizeUnit.Shares),\n value_e6: BigIntStringToDecimalStringSchema,\n }),\n ])\n .transform(\n (size): RfqRequestedSize => ({\n unit: size.unit,\n value: size.value_e6,\n }),\n ) satisfies z.ZodType<RfqRequestedSize>;\n\nexport type RfqSignedOrder = {\n salt: string;\n maker: EvmAddress;\n signer: EvmAddress;\n tokenId: PositionId | TokenId;\n makerAmount: BaseUnits;\n takerAmount: BaseUnits;\n side: RfqOrderSide;\n signatureType: SignatureType;\n timestamp: string;\n builder?: HexString;\n expiration?: string;\n metadata?: HexString;\n signature: EvmSignature | Erc1271Signature;\n};\n\nexport type RfqOrderSide = OrderSide | 0 | 1;\n\nexport type RfqAuthMessage = {\n type: 'auth';\n auth: {\n apiKey: string;\n passphrase: string;\n secret: string;\n };\n identity: {\n signer_address: EvmAddress;\n maker_address: EvmAddress;\n signature_type: SignatureType;\n };\n};\n\nexport enum RfqKnownInboundType {\n Auth = 'auth',\n QuoteRequest = 'RFQ_REQUEST',\n QuoteAck = 'ACK_RFQ_QUOTE',\n QuoteCancelAck = 'ACK_RFQ_QUOTE_CANCEL',\n ConfirmationRequest = 'RFQ_CONFIRMATION_REQUEST',\n ConfirmationAck = 'ACK_RFQ_CONFIRMATION_RESPONSE',\n ExecutionUpdate = 'RFQ_EXECUTION_UPDATE',\n Error = 'RFQ_ERROR',\n}\n\nexport const RfqKnownInboundMessageSchema = z.object({\n type: z.enum(RfqKnownInboundType),\n});\n\nexport const RfqAuthResponseMessageSchema = RfqKnownInboundMessageSchema.extend(\n {\n type: z.literal(RfqKnownInboundType.Auth),\n success: z.boolean(),\n address: EvmAddressSchema.optional(),\n role: z.string().optional(),\n error: z.string().optional(),\n },\n);\n\nexport type RfqAuthResponseMessage = z.infer<\n typeof RfqAuthResponseMessageSchema\n>;\n\nexport const RfqQuoteRequestSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.QuoteRequest),\n rfq_id: RfqIdSchema,\n requestor_public_id: RfqRequestorPublicIdSchema,\n leg_position_ids: z.array(PositionIdSchema),\n condition_id: ConditionIdSchema,\n yes_position_id: PositionIdSchema,\n no_position_id: PositionIdSchema,\n direction: RfqDirectionSchema,\n side: RfqSideSchema,\n requested_size: RfqRequestedSizeSchema,\n submission_deadline: EpochMillisecondsSchema,\n}).transform((message) => ({\n conditionId: message.condition_id,\n direction: message.direction,\n legPositionIds: message.leg_position_ids,\n noPositionId: message.no_position_id,\n requestorPublicId: message.requestor_public_id,\n requestedSize: message.requested_size,\n rfqId: message.rfq_id,\n side: message.side,\n submissionDeadline: message.submission_deadline,\n type: 'quote_request' as const,\n yesPositionId: message.yes_position_id,\n}));\n\nexport type RfqQuoteRequest = z.infer<typeof RfqQuoteRequestSchema>;\n\nexport type RfqQuoteMessage = {\n type: 'RFQ_QUOTE';\n rfq_id: RfqId;\n price_e6: string;\n size_e6: string;\n signed_order: RfqSignedOrder;\n};\n\nexport type RfqQuoteCancelMessage = {\n type: 'RFQ_QUOTE_CANCEL';\n rfq_id: RfqId;\n quote_id: RfqQuoteId;\n signer_address: EvmAddress;\n maker_address: EvmAddress;\n};\n\nexport const RfqQuoteAckSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.QuoteAck),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n}).transform((message) => ({\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n type: 'quote_ack' as const,\n}));\n\nexport type RfqQuoteAck = z.infer<typeof RfqQuoteAckSchema>;\n\nexport const RfqQuoteCancelAckSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.QuoteCancelAck),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n}).transform((message) => ({\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n type: 'quote_cancel_ack' as const,\n}));\n\nexport type RfqQuoteCancelAck = z.infer<typeof RfqQuoteCancelAckSchema>;\n\nexport const RfqConfirmationRequestSchema = RfqKnownInboundMessageSchema.extend(\n {\n type: z.literal(RfqKnownInboundType.ConfirmationRequest),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n signer_address: EvmAddressSchema,\n maker_address: EvmAddressSchema,\n signature_type: SignatureTypeSchema,\n leg_position_ids: z.array(PositionIdSchema),\n condition_id: ConditionIdSchema,\n yes_position_id: PositionIdSchema,\n no_position_id: PositionIdSchema,\n direction: RfqDirectionSchema,\n side: RfqSideSchema,\n fill_size_e6: BigIntStringToDecimalStringSchema,\n price_e6: BigIntStringToDecimalStringSchema,\n confirm_by: EpochMillisecondsSchema,\n },\n).transform((message) => ({\n conditionId: message.condition_id,\n confirmBy: message.confirm_by,\n direction: message.direction,\n fillSize: message.fill_size_e6,\n legPositionIds: message.leg_position_ids,\n makerAddress: message.maker_address,\n noPositionId: message.no_position_id,\n price: message.price_e6,\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n side: message.side,\n signatureType: message.signature_type,\n signerAddress: message.signer_address,\n type: 'confirmation_request' as const,\n yesPositionId: message.yes_position_id,\n}));\n\nexport type RfqConfirmationRequest = z.infer<\n typeof RfqConfirmationRequestSchema\n>;\n\nexport type RfqConfirmationResponseMessage = {\n type: 'RFQ_CONFIRMATION_RESPONSE';\n rfq_id: RfqId;\n quote_id: RfqQuoteId;\n decision: RfqConfirmationDecision;\n};\n\nexport const RfqConfirmationAckSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.ConfirmationAck),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n decision: RfqConfirmationDecisionSchema,\n}).transform((message) => ({\n decision: message.decision,\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n type: 'confirmation_ack' as const,\n}));\n\nexport type RfqConfirmationAck = z.infer<typeof RfqConfirmationAckSchema>;\n\nexport const RfqExecutionUpdateSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.ExecutionUpdate),\n rfq_id: RfqIdSchema,\n status: RfqExecutionStatusSchema,\n tx_hash: TxHashSchema.optional(),\n}).transform((message) => ({\n rfqId: message.rfq_id,\n status: message.status,\n ...(message.tx_hash === undefined ? {} : { txHash: message.tx_hash }),\n type: 'execution_update' as const,\n}));\n\nexport type RfqExecutionUpdate = z.infer<typeof RfqExecutionUpdateSchema>;\n\nexport const RfqErrorMessageSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.Error),\n request_type: z.string().optional(),\n rfq_id: RfqIdSchema.optional(),\n quote_id: RfqQuoteIdSchema.optional(),\n code: RfqErrorCodeSchema,\n error: z.string(),\n request: z.unknown().optional(),\n}).transform((message) => ({\n code: message.code,\n message: message.error,\n quoteId: message.quote_id,\n requestType: message.request_type,\n rfqId: message.rfq_id,\n type: 'rfq_error' as const,\n}));\n\nexport type RfqErrorMessage = z.infer<typeof RfqErrorMessageSchema>;\n\nexport const RfqQuoterInboundMessageSchema = z.union([\n RfqAuthResponseMessageSchema,\n RfqQuoteRequestSchema,\n RfqQuoteAckSchema,\n RfqQuoteCancelAckSchema,\n RfqConfirmationRequestSchema,\n RfqConfirmationAckSchema,\n RfqExecutionUpdateSchema,\n RfqErrorMessageSchema,\n]);\n\nexport type RfqQuoterInboundMessage = z.infer<\n typeof RfqQuoterInboundMessageSchema\n>;\n\nexport type RfqQuoterOutboundMessage =\n | RfqQuoteMessage\n | RfqQuoteCancelMessage\n | RfqConfirmationResponseMessage;\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/rfq.ts"],"names":["RfqDirection","RfqSide","RfqConfirmationDecision","RfqExecutionStatus","RfqRequestedSizeUnit","RfqErrorCode","RfqDirectionSchema","z","RfqSideSchema","RfqConfirmationDecisionSchema","RfqExecutionStatusSchema","RfqRequestedSizeUnitSchema","RfqErrorCodeSchema","ComboMarketSchema","MarketIdSchema","CtfConditionIdSchema","PositionIdSchema","DecimalStringSchema","market","context","ListComboMarketsResponseSchema","PaginationCursorSchema","response","BigIntStringToDecimalStringSchema","value","scaledValue","whole","fraction","toDecimalString","RfqRequestedSizeSchema","size","RfqKnownInboundType","RfqKnownInboundMessageSchema","RfqAuthResponseMessageSchema","EvmAddressSchema","RfqQuoteRequestSchema","RfqIdSchema","RfqRequestorPublicIdSchema","ComboConditionIdSchema","EpochMillisecondsSchema","message","RfqQuoteAckSchema","RfqQuoteIdSchema","RfqQuoteCancelAckSchema","RfqConfirmationRequestSchema","SignatureTypeSchema","RfqConfirmationAckSchema","RfqExecutionUpdateSchema","TxHashSchema","RfqErrorMessageSchema","RfqQuoterInboundMessageSchema"],"mappings":"gKAyCO,IAAKA,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,EAAA,GAAA,CAAM,KAAA,CACNA,CAAAA,CAAA,IAAA,CAAO,MAAA,CAFGA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,IAKAC,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,GAAA,CAAM,KAAA,CACNA,CAAAA,CAAA,EAAA,CAAK,KAFKA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,CAAA,CAKAC,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,OAAA,CAAU,SAAA,CACVA,EAAA,OAAA,CAAU,SAAA,CAFAA,CAAAA,CAAAA,EAAAA,CAAAA,EAAA,EAAA,CAAA,CAKAC,CAAAA,CAAAA,CAAAA,CAAAA,GACVA,CAAAA,CAAA,QAAU,SAAA,CACVA,CAAAA,CAAA,KAAA,CAAQ,OAAA,CACRA,CAAAA,CAAA,SAAA,CAA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C,EAAAA,CAAa,QAAA,EACxB,CAAC,EAAE,SAAA,CAAWR,CAAAA,GAAa,CACzB,KAAA,CAAOA,CAAAA,CAAQ,MAAA,CACf,OAAQA,CAAAA,CAAQ,MAAA,CAChB,GAAIA,CAAAA,CAAQ,OAAA,GAAY,MAAA,CAAY,EAAC,CAAI,CAAE,MAAA,CAAQA,CAAAA,CAAQ,OAAQ,CAAA,CACnE,KAAM,kBACR,CAAA,CAAE,CAAA,CAIWS,CAAAA,CAAwBjB,CAAAA,CAA6B,MAAA,CAAO,CACvE,IAAA,CAAMzB,GAAAA,CAAE,OAAA,CAAQ,WAAyB,CAAA,CACzC,YAAA,CAAcA,IAAE,MAAA,EAAO,CAAE,QAAA,EAAS,CAClC,MAAA,CAAQ6B,EAAAA,CAAY,UAAS,CAC7B,QAAA,CAAUM,EAAAA,CAAiB,QAAA,EAAS,CACpC,IAAA,CAAM9B,EACN,KAAA,CAAOL,GAAAA,CAAE,MAAA,EAAO,CAChB,OAAA,CAASA,GAAAA,CAAE,SAAQ,CAAE,QAAA,EACvB,CAAC,CAAA,CAAE,SAAA,CAAWiC,IAAa,CACzB,IAAA,CAAMA,CAAAA,CAAQ,IAAA,CACd,OAAA,CAASA,CAAAA,CAAQ,MACjB,OAAA,CAASA,CAAAA,CAAQ,QAAA,CACjB,WAAA,CAAaA,CAAAA,CAAQ,YAAA,CACrB,MAAOA,CAAAA,CAAQ,MAAA,CACf,IAAA,CAAM,WACR,CAAA,CAAE,CAAA,CAIWU,EAAgC3C,GAAAA,CAAE,kBAAA,CAAmB,MAAA,CAAQ,CACxE0B,CAAAA,CACAE,CAAAA,CACAM,CAAAA,CACAE,CAAAA,CACAC,CAAAA,CACAE,CAAAA,CACAC,CAAAA,CACAE,CACF,CAAC","file":"rfq.js","sourcesContent":["import type {\n Erc1271Signature,\n EvmSignature,\n HexString,\n} from '@polymarket/types';\nimport { z } from 'zod';\nimport { type SignatureType, SignatureTypeSchema } from './clob/signature-type';\nimport type {\n BaseUnits,\n CtfConditionId,\n DecimalString,\n EvmAddress,\n MarketId,\n TokenId,\n} from './shared';\nimport {\n ComboConditionIdSchema,\n CtfConditionIdSchema,\n DecimalStringSchema,\n EpochMillisecondsSchema,\n EvmAddressSchema,\n MarketIdSchema,\n type OrderSide,\n PaginationCursorSchema,\n type PositionId,\n PositionIdSchema,\n type RfqId,\n RfqIdSchema,\n type RfqQuoteId,\n RfqQuoteIdSchema,\n RfqRequestorPublicIdSchema,\n TxHashSchema,\n toDecimalString,\n} from './shared';\n\nexport type {\n RfqId,\n RfqQuoteId,\n RfqRequestorPublicId,\n} from './shared';\n\nexport enum RfqDirection {\n Buy = 'BUY',\n Sell = 'SELL',\n}\n\nexport enum RfqSide {\n Yes = 'YES',\n No = 'NO',\n}\n\nexport enum RfqConfirmationDecision {\n Confirm = 'CONFIRM',\n Decline = 'DECLINE',\n}\n\nexport enum RfqExecutionStatus {\n Matched = 'MATCHED',\n Mined = 'MINED',\n Confirmed = 'CONFIRMED',\n Retrying = 'RETRYING',\n Failed = 'FAILED',\n}\n\nexport enum RfqRequestedSizeUnit {\n Notional = 'notional',\n Shares = 'shares',\n}\n\nexport enum RfqErrorCode {\n AddressMismatch = 'ADDRESS_MISMATCH',\n ContradictoryLegs = 'CONTRADICTORY_LEGS',\n ExpiredRfq = 'EXPIRED_RFQ',\n InvalidAcceptance = 'INVALID_ACCEPTANCE',\n InvalidConfirmation = 'INVALID_CONFIRMATION',\n InvalidExecutionResult = 'INVALID_EXECUTION_RESULT',\n InvalidIdentity = 'INVALID_IDENTITY',\n InvalidMessage = 'INVALID_MESSAGE',\n InvalidQuote = 'INVALID_QUOTE',\n InvalidRfq = 'INVALID_RFQ',\n InvalidRfqState = 'INVALID_RFQ_STATE',\n InvalidRole = 'INVALID_ROLE',\n LegMetadataUnavailable = 'LEG_METADATA_UNAVAILABLE',\n MakerAlreadyResponded = 'MAKER_ALREADY_RESPONDED',\n MakerNotRequired = 'MAKER_NOT_REQUIRED',\n QuoteMismatch = 'QUOTE_MISMATCH',\n QuoteUnavailable = 'QUOTE_UNAVAILABLE',\n RateLimited = 'RATE_LIMITED',\n RequestFailed = 'REQUEST_FAILED',\n ServiceUnavailable = 'SERVICE_UNAVAILABLE',\n SubmissionWindowClosed = 'SUBMISSION_WINDOW_CLOSED',\n TradeSubmissionFailed = 'TRADE_SUBMISSION_FAILED',\n Unauthenticated = 'UNAUTHENTICATED',\n UnauthorizedRole = 'UNAUTHORIZED_ROLE',\n UnknownRfq = 'UNKNOWN_RFQ',\n}\n\nexport const RfqDirectionSchema = z.enum(RfqDirection);\nexport const RfqSideSchema = z.literal(RfqSide.Yes);\nexport const RfqConfirmationDecisionSchema = z.enum(RfqConfirmationDecision);\nexport const RfqExecutionStatusSchema = z.enum(RfqExecutionStatus);\nexport const RfqRequestedSizeUnitSchema = z.enum(RfqRequestedSizeUnit);\nexport const RfqErrorCodeSchema = z.enum(RfqErrorCode);\n\nexport type ComboMarket = {\n id: MarketId;\n conditionId: CtfConditionId;\n slug: string;\n title: string;\n outcomes: ComboMarketOutcomes;\n image: string;\n volume: number;\n tags: string[];\n};\n\nexport type ComboMarketOutcome = {\n label: string;\n positionId: PositionId;\n price: DecimalString;\n};\n\nexport type ComboMarketOutcomes = {\n yes: ComboMarketOutcome;\n no: ComboMarketOutcome;\n};\n\nexport const ComboMarketSchema = z\n .object({\n id: MarketIdSchema,\n condition_id: CtfConditionIdSchema,\n position_ids: z.array(PositionIdSchema),\n slug: z.string(),\n title: z.string(),\n outcomes: z.array(z.string()),\n outcome_prices: z.array(DecimalStringSchema),\n image: z.string(),\n volume: z.number(),\n tags: z.array(z.string()),\n })\n .superRefine((market, context) => {\n if (market.outcomes.length !== 2) {\n context.addIssue({\n code: 'custom',\n message: `Expected binary combo market outcomes, received ${market.outcomes.length}.`,\n path: ['outcomes'],\n });\n }\n\n if (market.position_ids.length !== market.outcomes.length) {\n context.addIssue({\n code: 'custom',\n message: 'Expected position_ids and outcomes to have matching lengths.',\n path: ['position_ids'],\n });\n }\n\n if (market.outcome_prices.length !== market.outcomes.length) {\n context.addIssue({\n code: 'custom',\n message:\n 'Expected outcome_prices and outcomes to have matching lengths.',\n path: ['outcome_prices'],\n });\n }\n })\n .transform(\n (market): ComboMarket => ({\n conditionId: market.condition_id,\n id: market.id,\n image: market.image,\n outcomes: {\n yes: {\n label: market.outcomes[0] as string,\n positionId: market.position_ids[0] as PositionId,\n price: market.outcome_prices[0] as DecimalString,\n },\n no: {\n label: market.outcomes[1] as string,\n positionId: market.position_ids[1] as PositionId,\n price: market.outcome_prices[1] as DecimalString,\n },\n },\n slug: market.slug,\n tags: market.tags,\n title: market.title,\n volume: market.volume,\n }),\n );\n\nexport const ListComboMarketsResponseSchema = z\n .object({\n markets: z.array(ComboMarketSchema),\n next_cursor: PaginationCursorSchema.nullish(),\n })\n .transform((response) => ({\n markets: response.markets,\n nextCursor: response.next_cursor ?? undefined,\n }));\n\nexport type ListComboMarketsResponse = z.infer<\n typeof ListComboMarketsResponseSchema\n>;\n\nconst BigIntStringToDecimalStringSchema = z\n .string()\n .regex(/^\\d+$/)\n .transform((value) => {\n const scaledValue = BigInt(value);\n const whole = scaledValue / 1_000_000n;\n const fraction = (scaledValue % 1_000_000n)\n .toString()\n .padStart(6, '0')\n .replace(/0+$/, '');\n\n return toDecimalString(`${whole}${fraction === '' ? '' : `.${fraction}`}`);\n });\n\nexport type RfqRequestedSize =\n | {\n unit: RfqRequestedSizeUnit.Notional;\n value: DecimalString;\n }\n | {\n unit: RfqRequestedSizeUnit.Shares;\n value: DecimalString;\n };\n\nconst RfqRequestedSizeSchema = z\n .discriminatedUnion('unit', [\n z.object({\n unit: z.literal(RfqRequestedSizeUnit.Notional),\n value_e6: BigIntStringToDecimalStringSchema,\n }),\n z.object({\n unit: z.literal(RfqRequestedSizeUnit.Shares),\n value_e6: BigIntStringToDecimalStringSchema,\n }),\n ])\n .transform(\n (size): RfqRequestedSize => ({\n unit: size.unit,\n value: size.value_e6,\n }),\n ) satisfies z.ZodType<RfqRequestedSize>;\n\nexport type RfqSignedOrder = {\n salt: string;\n maker: EvmAddress;\n signer: EvmAddress;\n tokenId: PositionId | TokenId;\n makerAmount: BaseUnits;\n takerAmount: BaseUnits;\n side: RfqOrderSide;\n signatureType: SignatureType;\n timestamp: string;\n builder?: HexString;\n expiration?: string;\n metadata?: HexString;\n signature: EvmSignature | Erc1271Signature;\n};\n\nexport type RfqOrderSide = OrderSide | 0 | 1;\n\nexport type RfqAuthMessage = {\n type: 'auth';\n auth: {\n apiKey: string;\n passphrase: string;\n secret: string;\n };\n identity: {\n signer_address: EvmAddress;\n maker_address: EvmAddress;\n signature_type: SignatureType;\n };\n};\n\nexport enum RfqKnownInboundType {\n Auth = 'auth',\n QuoteRequest = 'RFQ_REQUEST',\n QuoteAck = 'ACK_RFQ_QUOTE',\n QuoteCancelAck = 'ACK_RFQ_QUOTE_CANCEL',\n ConfirmationRequest = 'RFQ_CONFIRMATION_REQUEST',\n ConfirmationAck = 'ACK_RFQ_CONFIRMATION_RESPONSE',\n ExecutionUpdate = 'RFQ_EXECUTION_UPDATE',\n Error = 'RFQ_ERROR',\n}\n\nexport const RfqKnownInboundMessageSchema = z.object({\n type: z.enum(RfqKnownInboundType),\n});\n\nexport const RfqAuthResponseMessageSchema = RfqKnownInboundMessageSchema.extend(\n {\n type: z.literal(RfqKnownInboundType.Auth),\n success: z.boolean(),\n address: EvmAddressSchema.optional(),\n role: z.string().optional(),\n error: z.string().optional(),\n },\n);\n\nexport type RfqAuthResponseMessage = z.infer<\n typeof RfqAuthResponseMessageSchema\n>;\n\nexport const RfqQuoteRequestSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.QuoteRequest),\n rfq_id: RfqIdSchema,\n requestor_public_id: RfqRequestorPublicIdSchema,\n leg_position_ids: z.array(PositionIdSchema),\n condition_id: ComboConditionIdSchema,\n yes_position_id: PositionIdSchema,\n no_position_id: PositionIdSchema,\n direction: RfqDirectionSchema,\n side: RfqSideSchema,\n requested_size: RfqRequestedSizeSchema,\n submission_deadline: EpochMillisecondsSchema,\n}).transform((message) => ({\n conditionId: message.condition_id,\n direction: message.direction,\n legPositionIds: message.leg_position_ids,\n noPositionId: message.no_position_id,\n requestorPublicId: message.requestor_public_id,\n requestedSize: message.requested_size,\n rfqId: message.rfq_id,\n side: message.side,\n submissionDeadline: message.submission_deadline,\n type: 'quote_request' as const,\n yesPositionId: message.yes_position_id,\n}));\n\nexport type RfqQuoteRequest = z.infer<typeof RfqQuoteRequestSchema>;\n\nexport type RfqQuoteMessage = {\n type: 'RFQ_QUOTE';\n rfq_id: RfqId;\n price_e6: string;\n size_e6: string;\n signed_order: RfqSignedOrder;\n};\n\nexport type RfqQuoteCancelMessage = {\n type: 'RFQ_QUOTE_CANCEL';\n rfq_id: RfqId;\n quote_id: RfqQuoteId;\n signer_address: EvmAddress;\n maker_address: EvmAddress;\n};\n\nexport const RfqQuoteAckSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.QuoteAck),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n}).transform((message) => ({\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n type: 'quote_ack' as const,\n}));\n\nexport type RfqQuoteAck = z.infer<typeof RfqQuoteAckSchema>;\n\nexport const RfqQuoteCancelAckSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.QuoteCancelAck),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n}).transform((message) => ({\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n type: 'quote_cancel_ack' as const,\n}));\n\nexport type RfqQuoteCancelAck = z.infer<typeof RfqQuoteCancelAckSchema>;\n\nexport const RfqConfirmationRequestSchema = RfqKnownInboundMessageSchema.extend(\n {\n type: z.literal(RfqKnownInboundType.ConfirmationRequest),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n signer_address: EvmAddressSchema,\n maker_address: EvmAddressSchema,\n signature_type: SignatureTypeSchema,\n leg_position_ids: z.array(PositionIdSchema),\n condition_id: ComboConditionIdSchema,\n yes_position_id: PositionIdSchema,\n no_position_id: PositionIdSchema,\n direction: RfqDirectionSchema,\n side: RfqSideSchema,\n fill_size_e6: BigIntStringToDecimalStringSchema,\n price_e6: BigIntStringToDecimalStringSchema,\n confirm_by: EpochMillisecondsSchema,\n },\n).transform((message) => ({\n conditionId: message.condition_id,\n confirmBy: message.confirm_by,\n direction: message.direction,\n fillSize: message.fill_size_e6,\n legPositionIds: message.leg_position_ids,\n makerAddress: message.maker_address,\n noPositionId: message.no_position_id,\n price: message.price_e6,\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n side: message.side,\n signatureType: message.signature_type,\n signerAddress: message.signer_address,\n type: 'confirmation_request' as const,\n yesPositionId: message.yes_position_id,\n}));\n\nexport type RfqConfirmationRequest = z.infer<\n typeof RfqConfirmationRequestSchema\n>;\n\nexport type RfqConfirmationResponseMessage = {\n type: 'RFQ_CONFIRMATION_RESPONSE';\n rfq_id: RfqId;\n quote_id: RfqQuoteId;\n decision: RfqConfirmationDecision;\n};\n\nexport const RfqConfirmationAckSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.ConfirmationAck),\n rfq_id: RfqIdSchema,\n quote_id: RfqQuoteIdSchema,\n decision: RfqConfirmationDecisionSchema,\n}).transform((message) => ({\n decision: message.decision,\n quoteId: message.quote_id,\n rfqId: message.rfq_id,\n type: 'confirmation_ack' as const,\n}));\n\nexport type RfqConfirmationAck = z.infer<typeof RfqConfirmationAckSchema>;\n\nexport const RfqExecutionUpdateSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.ExecutionUpdate),\n rfq_id: RfqIdSchema,\n status: RfqExecutionStatusSchema,\n tx_hash: TxHashSchema.optional(),\n}).transform((message) => ({\n rfqId: message.rfq_id,\n status: message.status,\n ...(message.tx_hash === undefined ? {} : { txHash: message.tx_hash }),\n type: 'execution_update' as const,\n}));\n\nexport type RfqExecutionUpdate = z.infer<typeof RfqExecutionUpdateSchema>;\n\nexport const RfqErrorMessageSchema = RfqKnownInboundMessageSchema.extend({\n type: z.literal(RfqKnownInboundType.Error),\n request_type: z.string().optional(),\n rfq_id: RfqIdSchema.optional(),\n quote_id: RfqQuoteIdSchema.optional(),\n code: RfqErrorCodeSchema,\n error: z.string(),\n request: z.unknown().optional(),\n}).transform((message) => ({\n code: message.code,\n message: message.error,\n quoteId: message.quote_id,\n requestType: message.request_type,\n rfqId: message.rfq_id,\n type: 'rfq_error' as const,\n}));\n\nexport type RfqErrorMessage = z.infer<typeof RfqErrorMessageSchema>;\n\nexport const RfqQuoterInboundMessageSchema = z.discriminatedUnion('type', [\n RfqAuthResponseMessageSchema,\n RfqQuoteRequestSchema,\n RfqQuoteAckSchema,\n RfqQuoteCancelAckSchema,\n RfqConfirmationRequestSchema,\n RfqConfirmationAckSchema,\n RfqExecutionUpdateSchema,\n RfqErrorMessageSchema,\n]);\n\nexport type RfqQuoterInboundMessage = z.infer<\n typeof RfqQuoterInboundMessageSchema\n>;\n\nexport type RfqQuoterOutboundMessage =\n | RfqQuoteMessage\n | RfqQuoteCancelMessage\n | RfqConfirmationResponseMessage;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TokenId, DecimalString, EpochMilliseconds,
|
|
1
|
+
import { TokenId, DecimalString, EpochMilliseconds, CtfConditionId, IsoDateTimeString, OrderSide, OrderType, CommentId, CommentParentEntityType, EventId, SeriesId, ImageOptimizationId, BaseUnits } from '../index.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { R as ReactionType } from '../comment-C-jBbhp7.js';
|
|
4
4
|
import '@polymarket/types';
|
|
@@ -284,7 +284,7 @@ declare const NewMarketEventSchema: z.ZodPipe<z.ZodObject<{
|
|
|
284
284
|
}, z.core.$strip>>>;
|
|
285
285
|
timestamp: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<EpochMilliseconds, string>>>>;
|
|
286
286
|
tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
287
|
-
condition_id: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
287
|
+
condition_id: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>>>;
|
|
288
288
|
active: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
289
289
|
clob_token_ids: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
290
290
|
sports_market_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -307,7 +307,7 @@ declare const NewMarketEventSchema: z.ZodPipe<z.ZodObject<{
|
|
|
307
307
|
title?: string | null | undefined;
|
|
308
308
|
description?: string | null | undefined;
|
|
309
309
|
} | null | undefined;
|
|
310
|
-
conditionId:
|
|
310
|
+
conditionId: CtfConditionId | null | undefined;
|
|
311
311
|
clobTokenIds: string[] | null | undefined;
|
|
312
312
|
sportsMarketType: string | null | undefined;
|
|
313
313
|
gameStartTime: IsoDateTimeString | null | undefined;
|
|
@@ -345,7 +345,7 @@ declare const NewMarketEventSchema: z.ZodPipe<z.ZodObject<{
|
|
|
345
345
|
} | null | undefined;
|
|
346
346
|
timestamp?: EpochMilliseconds | null | undefined;
|
|
347
347
|
tags?: string[] | null | undefined;
|
|
348
|
-
condition_id?:
|
|
348
|
+
condition_id?: CtfConditionId | null | undefined;
|
|
349
349
|
active?: boolean | null | undefined;
|
|
350
350
|
clob_token_ids?: string[] | null | undefined;
|
|
351
351
|
sports_market_type?: string | null | undefined;
|
|
@@ -865,7 +865,7 @@ declare const CustomMarketEventSchema: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodO
|
|
|
865
865
|
}, z.core.$strip>>>;
|
|
866
866
|
timestamp: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<EpochMilliseconds, string>>>>;
|
|
867
867
|
tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
868
|
-
condition_id: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
868
|
+
condition_id: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>>>;
|
|
869
869
|
active: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
870
870
|
clob_token_ids: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
871
871
|
sports_market_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -888,7 +888,7 @@ declare const CustomMarketEventSchema: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodO
|
|
|
888
888
|
title?: string | null | undefined;
|
|
889
889
|
description?: string | null | undefined;
|
|
890
890
|
} | null | undefined;
|
|
891
|
-
conditionId:
|
|
891
|
+
conditionId: CtfConditionId | null | undefined;
|
|
892
892
|
clobTokenIds: string[] | null | undefined;
|
|
893
893
|
sportsMarketType: string | null | undefined;
|
|
894
894
|
gameStartTime: IsoDateTimeString | null | undefined;
|
|
@@ -926,7 +926,7 @@ declare const CustomMarketEventSchema: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodO
|
|
|
926
926
|
} | null | undefined;
|
|
927
927
|
timestamp?: EpochMilliseconds | null | undefined;
|
|
928
928
|
tags?: string[] | null | undefined;
|
|
929
|
-
condition_id?:
|
|
929
|
+
condition_id?: CtfConditionId | null | undefined;
|
|
930
930
|
active?: boolean | null | undefined;
|
|
931
931
|
clob_token_ids?: string[] | null | undefined;
|
|
932
932
|
sports_market_type?: string | null | undefined;
|
|
@@ -1207,7 +1207,7 @@ declare const MarketEventSchema: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodObject<
|
|
|
1207
1207
|
}, z.core.$strip>>>;
|
|
1208
1208
|
timestamp: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<EpochMilliseconds, string>>>>;
|
|
1209
1209
|
tags: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
1210
|
-
condition_id: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<
|
|
1210
|
+
condition_id: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<CtfConditionId, string>>>>;
|
|
1211
1211
|
active: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
1212
1212
|
clob_token_ids: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
1213
1213
|
sports_market_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
@@ -1230,7 +1230,7 @@ declare const MarketEventSchema: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodObject<
|
|
|
1230
1230
|
title?: string | null | undefined;
|
|
1231
1231
|
description?: string | null | undefined;
|
|
1232
1232
|
} | null | undefined;
|
|
1233
|
-
conditionId:
|
|
1233
|
+
conditionId: CtfConditionId | null | undefined;
|
|
1234
1234
|
clobTokenIds: string[] | null | undefined;
|
|
1235
1235
|
sportsMarketType: string | null | undefined;
|
|
1236
1236
|
gameStartTime: IsoDateTimeString | null | undefined;
|
|
@@ -1268,7 +1268,7 @@ declare const MarketEventSchema: z.ZodDiscriminatedUnion<[z.ZodPipe<z.ZodObject<
|
|
|
1268
1268
|
} | null | undefined;
|
|
1269
1269
|
timestamp?: EpochMilliseconds | null | undefined;
|
|
1270
1270
|
tags?: string[] | null | undefined;
|
|
1271
|
-
condition_id?:
|
|
1271
|
+
condition_id?: CtfConditionId | null | undefined;
|
|
1272
1272
|
active?: boolean | null | undefined;
|
|
1273
1273
|
clob_token_ids?: string[] | null | undefined;
|
|
1274
1274
|
sports_market_type?: string | null | undefined;
|