@polyester/sdk 0.35.0-devnet-20261111031027 → 0.35.0-devnet-20261111140253

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.
Files changed (184) hide show
  1. package/CHANGELOG.md +27 -1
  2. package/dist/catalogs/snapshot-validation.js +2 -1
  3. package/dist/catalogs/snapshot-validation.js.map +1 -1
  4. package/dist/gen/ai/v1/assistant_pb.d.ts +4164 -0
  5. package/dist/gen/ai/v1/assistant_pb.d.ts.map +1 -0
  6. package/dist/gen/ai/v1/assistant_pb.js +1174 -0
  7. package/dist/gen/ai/v1/assistant_pb.js.map +1 -0
  8. package/dist/gen/alerts/v1/price_alerts_pb.d.ts +776 -0
  9. package/dist/gen/alerts/v1/price_alerts_pb.d.ts.map +1 -0
  10. package/dist/gen/alerts/v1/price_alerts_pb.js +378 -0
  11. package/dist/gen/alerts/v1/price_alerts_pb.js.map +1 -0
  12. package/dist/gen/auth/v1/address_book_pb.d.ts +6 -0
  13. package/dist/gen/auth/v1/address_book_pb.d.ts.map +1 -1
  14. package/dist/gen/auth/v1/address_book_pb.js +6 -0
  15. package/dist/gen/auth/v1/address_book_pb.js.map +1 -1
  16. package/dist/gen/auth/v1/api_keys_pb.d.ts +242 -2
  17. package/dist/gen/auth/v1/api_keys_pb.d.ts.map +1 -1
  18. package/dist/gen/auth/v1/api_keys_pb.js +81 -2
  19. package/dist/gen/auth/v1/api_keys_pb.js.map +1 -1
  20. package/dist/gen/auth/v1/auth_pb.d.ts +48 -6
  21. package/dist/gen/auth/v1/auth_pb.d.ts.map +1 -1
  22. package/dist/gen/auth/v1/auth_pb.js +48 -6
  23. package/dist/gen/auth/v1/auth_pb.js.map +1 -1
  24. package/dist/gen/auth/v1/policies_pb.d.ts +83 -19
  25. package/dist/gen/auth/v1/policies_pb.d.ts.map +1 -1
  26. package/dist/gen/auth/v1/policies_pb.js +74 -16
  27. package/dist/gen/auth/v1/policies_pb.js.map +1 -1
  28. package/dist/gen/auth/v1/social_verification_pb.d.ts +167 -11
  29. package/dist/gen/auth/v1/social_verification_pb.d.ts.map +1 -1
  30. package/dist/gen/auth/v1/social_verification_pb.js +41 -3
  31. package/dist/gen/auth/v1/social_verification_pb.js.map +1 -1
  32. package/dist/gen/auth/v1/subaccounts_pb.d.ts +17 -6
  33. package/dist/gen/auth/v1/subaccounts_pb.d.ts.map +1 -1
  34. package/dist/gen/auth/v1/subaccounts_pb.js.map +1 -1
  35. package/dist/gen/chain/deposit/v1/deposit_pb.d.ts +4 -2
  36. package/dist/gen/chain/deposit/v1/deposit_pb.d.ts.map +1 -1
  37. package/dist/gen/chain/deposit/v1/deposit_pb.js.map +1 -1
  38. package/dist/gen/chain/guard/v1/guard_signer_pb.d.ts +5 -0
  39. package/dist/gen/chain/guard/v1/guard_signer_pb.d.ts.map +1 -1
  40. package/dist/gen/chain/guard/v1/guard_signer_pb.js.map +1 -1
  41. package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.d.ts +10 -0
  42. package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.d.ts.map +1 -1
  43. package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.js +1 -1
  44. package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.js.map +1 -1
  45. package/dist/gen/chain/lifecycle/v1/types_pb.d.ts +32 -4
  46. package/dist/gen/chain/lifecycle/v1/types_pb.d.ts.map +1 -1
  47. package/dist/gen/chain/lifecycle/v1/types_pb.js +32 -4
  48. package/dist/gen/chain/lifecycle/v1/types_pb.js.map +1 -1
  49. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts +391 -42
  50. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts.map +1 -1
  51. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.js +103 -17
  52. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.js.map +1 -1
  53. package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts +170 -3
  54. package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts.map +1 -1
  55. package/dist/gen/chain/withdraw/v1/withdraw_pb.js +63 -2
  56. package/dist/gen/chain/withdraw/v1/withdraw_pb.js.map +1 -1
  57. package/dist/gen/claims/v1/claims_pb.d.ts +1 -1
  58. package/dist/gen/claims/v1/claims_pb.js +1 -1
  59. package/dist/gen/claims/v1/claims_pb.js.map +1 -1
  60. package/dist/gen/index.d.ts +9 -5
  61. package/dist/gen/index.js +5 -1
  62. package/dist/gen/ledger/v1/catalog_pb.d.ts +9 -1
  63. package/dist/gen/ledger/v1/catalog_pb.d.ts.map +1 -1
  64. package/dist/gen/ledger/v1/catalog_pb.js +9 -1
  65. package/dist/gen/ledger/v1/catalog_pb.js.map +1 -1
  66. package/dist/gen/marketdata/v1/marketdata_pb.d.ts +8 -0
  67. package/dist/gen/marketdata/v1/marketdata_pb.d.ts.map +1 -1
  68. package/dist/gen/marketdata/v1/marketdata_pb.js +1 -1
  69. package/dist/gen/marketdata/v1/marketdata_pb.js.map +1 -1
  70. package/dist/gen/orders/v1/orders_pb.d.ts +4 -4
  71. package/dist/gen/orders/v1/orders_pb.js.map +1 -1
  72. package/dist/gen/polyester/ratelimit/v1/types_pb.d.ts +20 -1
  73. package/dist/gen/polyester/ratelimit/v1/types_pb.d.ts.map +1 -1
  74. package/dist/gen/polyester/ratelimit/v1/types_pb.js +20 -1
  75. package/dist/gen/polyester/ratelimit/v1/types_pb.js.map +1 -1
  76. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts +1186 -127
  77. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts.map +1 -1
  78. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js +282 -5
  79. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js.map +1 -1
  80. package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts +253 -38
  81. package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts.map +1 -1
  82. package/dist/gen/swap/quickswap/v1/quickswap_pb.js +180 -36
  83. package/dist/gen/swap/quickswap/v1/quickswap_pb.js.map +1 -1
  84. package/dist/gen/swap/quickswap/v1/quickswap_referral_pb.d.ts +933 -0
  85. package/dist/gen/swap/quickswap/v1/quickswap_referral_pb.d.ts.map +1 -0
  86. package/dist/gen/swap/quickswap/v1/quickswap_referral_pb.js +292 -0
  87. package/dist/gen/swap/quickswap/v1/quickswap_referral_pb.js.map +1 -0
  88. package/dist/gen/system/v1/system_pb.d.ts +77 -0
  89. package/dist/gen/system/v1/system_pb.d.ts.map +1 -0
  90. package/dist/gen/system/v1/system_pb.js +34 -0
  91. package/dist/gen/system/v1/system_pb.js.map +1 -0
  92. package/dist/gen/tradews/v1/trade_ws_pb.d.ts +2 -2
  93. package/dist/gen/tradews/v1/trade_ws_pb.js.map +1 -1
  94. package/dist/index.d.ts +5 -5
  95. package/dist/services/api-keys/api-keys.codecs.js +10 -1
  96. package/dist/services/api-keys/api-keys.codecs.js.map +1 -1
  97. package/dist/services/api-keys/api-keys.schemas.d.ts +4 -0
  98. package/dist/services/api-keys/api-keys.schemas.d.ts.map +1 -1
  99. package/dist/services/api-keys/api-keys.schemas.js +3 -1
  100. package/dist/services/api-keys/api-keys.schemas.js.map +1 -1
  101. package/dist/services/auto-withdraw/auto-withdraw.codecs.d.ts +9 -2
  102. package/dist/services/auto-withdraw/auto-withdraw.codecs.d.ts.map +1 -1
  103. package/dist/services/auto-withdraw/auto-withdraw.codecs.js +9 -1
  104. package/dist/services/auto-withdraw/auto-withdraw.codecs.js.map +1 -1
  105. package/dist/services/auto-withdraw/auto-withdraw.d.ts +15 -4
  106. package/dist/services/auto-withdraw/auto-withdraw.d.ts.map +1 -1
  107. package/dist/services/auto-withdraw/auto-withdraw.js +24 -8
  108. package/dist/services/auto-withdraw/auto-withdraw.js.map +1 -1
  109. package/dist/services/auto-withdraw/auto-withdraw.schemas.d.ts +394 -26
  110. package/dist/services/auto-withdraw/auto-withdraw.schemas.d.ts.map +1 -1
  111. package/dist/services/auto-withdraw/auto-withdraw.schemas.js +66 -11
  112. package/dist/services/auto-withdraw/auto-withdraw.schemas.js.map +1 -1
  113. package/dist/services/auto-withdraw/auto-withdraw.types.d.ts +3 -3
  114. package/dist/services/candles/candles.schemas.d.ts +10 -10
  115. package/dist/services/changelog/changelog.schemas.d.ts +17 -17
  116. package/dist/services/checkpoints/checkpoints.schemas.d.ts +2 -2
  117. package/dist/services/heatmap/heatmap.schemas.d.ts +13 -13
  118. package/dist/services/internal-transfers/internal-transfers.schemas.d.ts +3 -3
  119. package/dist/services/lifecycle/lifecycle.codecs.d.ts +2 -2
  120. package/dist/services/lifecycle/lifecycle.codecs.d.ts.map +1 -1
  121. package/dist/services/lifecycle/lifecycle.codecs.js +3 -1
  122. package/dist/services/lifecycle/lifecycle.codecs.js.map +1 -1
  123. package/dist/services/lifecycle/lifecycle.schemas.d.ts +64 -40
  124. package/dist/services/lifecycle/lifecycle.schemas.d.ts.map +1 -1
  125. package/dist/services/lifecycle/lifecycle.schemas.js +7 -1
  126. package/dist/services/lifecycle/lifecycle.schemas.js.map +1 -1
  127. package/dist/services/market-data/market-data.schemas.js +7 -2
  128. package/dist/services/market-data/market-data.schemas.js.map +1 -1
  129. package/dist/services/market-overview/market-overview.schemas.d.ts +3 -3
  130. package/dist/services/orderbook/orderbook.schemas.d.ts +1 -1
  131. package/dist/services/orders/order-errors.schemas.d.ts +1 -1
  132. package/dist/services/orders/orders-batch.schemas.d.ts +27 -27
  133. package/dist/services/orders/orders-input.schemas.d.ts +3 -3
  134. package/dist/services/orders/orders-output.schemas.d.ts +17 -17
  135. package/dist/services/policies/api-key-policies/api-key-policies.schemas.d.ts +15 -15
  136. package/dist/services/policies/shared.codecs.js +24 -3
  137. package/dist/services/policies/shared.codecs.js.map +1 -1
  138. package/dist/services/policies/shared.d.ts +1 -1
  139. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.d.ts +3 -3
  140. package/dist/services/social-verification/social-verification.codecs.js +13 -5
  141. package/dist/services/social-verification/social-verification.codecs.js.map +1 -1
  142. package/dist/services/social-verification/social-verification.d.ts +18 -3
  143. package/dist/services/social-verification/social-verification.d.ts.map +1 -1
  144. package/dist/services/social-verification/social-verification.js +26 -3
  145. package/dist/services/social-verification/social-verification.js.map +1 -1
  146. package/dist/services/social-verification/social-verification.schemas.d.ts +33 -7
  147. package/dist/services/social-verification/social-verification.schemas.d.ts.map +1 -1
  148. package/dist/services/social-verification/social-verification.schemas.js +35 -10
  149. package/dist/services/social-verification/social-verification.schemas.js.map +1 -1
  150. package/dist/services/social-verification/social-verification.types.d.ts +2 -2
  151. package/dist/services/subaccounts/subaccounts.schemas.d.ts +7 -7
  152. package/dist/services/trades/trades.schemas.d.ts +2 -2
  153. package/dist/services/trading-withdraws/trading-withdraws.d.ts +7 -1
  154. package/dist/services/trading-withdraws/trading-withdraws.d.ts.map +1 -1
  155. package/dist/services/trading-withdraws/trading-withdraws.js +11 -1
  156. package/dist/services/trading-withdraws/trading-withdraws.js.map +1 -1
  157. package/dist/services/trading-withdraws/trading-withdraws.schemas.d.ts +42 -1
  158. package/dist/services/trading-withdraws/trading-withdraws.schemas.d.ts.map +1 -1
  159. package/dist/services/trading-withdraws/trading-withdraws.schemas.js +19 -3
  160. package/dist/services/trading-withdraws/trading-withdraws.schemas.js.map +1 -1
  161. package/dist/services/trading-withdraws/trading-withdraws.types.d.ts +2 -2
  162. package/dist/services/transfers/transfers.schemas.d.ts +4 -4
  163. package/dist/services/triggers/trigger-input.schemas.d.ts +2 -2
  164. package/dist/services/triggers/triggers-output.schemas.d.ts +30 -30
  165. package/dist/shared/catalog-config.d.ts +5 -0
  166. package/dist/shared/catalog-config.d.ts.map +1 -1
  167. package/dist/shared/catalog-config.js.map +1 -1
  168. package/dist/shared/error-detail.d.ts +6 -0
  169. package/dist/shared/error-detail.d.ts.map +1 -1
  170. package/dist/shared/error-detail.js.map +1 -1
  171. package/dist/shared/error-details/withdraw.js +11 -2
  172. package/dist/shared/error-details/withdraw.js.map +1 -1
  173. package/dist/shared/ledger-codes.d.ts +4 -2
  174. package/dist/shared/ledger-codes.d.ts.map +1 -1
  175. package/dist/shared/ledger-codes.js +6 -3
  176. package/dist/shared/ledger-codes.js.map +1 -1
  177. package/dist/shared/rate-limit.schemas.d.ts +2 -2
  178. package/dist/shared/rate-limit.schemas.d.ts.map +1 -1
  179. package/dist/shared/rate-limit.schemas.js +4 -1
  180. package/dist/shared/rate-limit.schemas.js.map +1 -1
  181. package/dist/shared/transports.d.ts +2 -1
  182. package/dist/shared/transports.d.ts.map +1 -1
  183. package/dist/shared/transports.js.map +1 -1
  184. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"trade_ws_pb.js","names":[],"sources":["../../../../src/gen/tradews/v1/trade_ws_pb.ts"],"sourcesContent":["// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts,import_extension=js\"\n// @generated from file tradews/v1/trade_ws.proto (package tradews.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenFile, GenMessage } from \"@bufbuild/protobuf/codegenv2\";\nimport { fileDesc, messageDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { BatchCancelOrdersRequest, BatchCancelOrdersResponse, BatchCreateOrdersRequest, BatchCreateOrdersResponse, BatchReplaceOrdersRequest, BatchReplaceOrdersResponse, CancelAllAfterRequest, CancelAllAfterResponse, CancelAllOrdersRequest, CancelAllOrdersResponse, CancelOrderRequest, CancelOrderResponse, CreateOrderRequest, CreateOrderResponse, ErrorDetail, ModifyOrderRequest, ModifyOrderResponse } from \"../../orders/v1/orders_pb.js\";\nimport { file_orders_v1_orders } from \"../../orders/v1/orders_pb.js\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file tradews/v1/trade_ws.proto.\n */\nexport const file_tradews_v1_trade_ws: GenFile = /*@__PURE__*/\n fileDesc(\"Chl0cmFkZXdzL3YxL3RyYWRlX3dzLnByb3RvEgp0cmFkZXdzLnYxIoUFCgtDbGllbnRGcmFtZRILCgNzZXEYASABK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AoQT3ZlcmxvYWRSZXNwb25zZRIMCgRjb2RlGAEgASgJEg4KBmRldGFpbBgCIAEoCSI0ChRUZXJtaW5hbFNlc3Npb25FdmVudBIMCgRjb2RlGAEgASgJEg4KBmRldGFpbBgCIAEoCUJCWkBnaXRodWIuY29tL0ZhYnJpYy1MYWJzL3BvbHllc3Rlci1zZGstZ28vZ2VuL3RyYWRld3MvdjE7dHJhZGV3c3YxYgZwcm90bzM=\", [file_orders_v1_orders]);\n\n/**\n * ClientFrame is the protobuf write-websocket envelope. Its payloads reuse the\n * public Orders API request contracts so every transport shares one order model.\n *\n * @generated from message tradews.v1.ClientFrame\n */\nexport type ClientFrame = Message<\"tradews.v1.ClientFrame\"> & {\n /**\n * Monotonic per-connection client sequence number, starting at 1.\n *\n * @generated from field: uint64 seq = 1;\n */\n seq: bigint;\n\n /**\n * Client correlation token echoed in every server response.\n *\n * @generated from field: string correlation_id = 2;\n */\n correlationId: string;\n\n /**\n * Optional client time the command was sent, in milliseconds since the Unix\n * epoch. When set, the command is processed only until timestamp_ms plus\n * recv_window_ms: a command that arrives, or waits to be sent on for\n * admission, past then is rejected with REQUEST_DEADLINE_EXCEEDED and\n * changes nothing, but it has taken its seq, so the next command uses the\n * next seq. A timestamp more than 10 seconds ahead of the server clock is\n * rejected with BAD_REQUEST, without taking the seq. Zero sets no\n * deadline. Ping ignores it.\n *\n * @generated from field: int64 timestamp_ms = 3;\n */\n timestampMs: bigint;\n\n /**\n * Optional receive window in milliseconds, from 1 to 60000, applied to\n * timestamp_ms. Zero uses 10000. Setting it without timestamp_ms is\n * rejected with BAD_REQUEST.\n *\n * @generated from field: uint32 recv_window_ms = 4;\n */\n recvWindowMs: number;\n\n /**\n * @generated from oneof tradews.v1.ClientFrame.payload\n */\n payload: {\n /**\n * Liveness request that does not submit an order command.\n *\n * @generated from field: tradews.v1.PingRequest ping = 10;\n */\n value: PingRequest;\n case: \"ping\";\n } | {\n /**\n * Create-order command using the public Orders API request contract,\n * including its required base-quantity or maximum-quote-debit sizing choice.\n *\n * @generated from field: orders.v1.CreateOrderRequest create_order = 11;\n */\n value: CreateOrderRequest;\n case: \"createOrder\";\n } | {\n /**\n * Cancel-order command using the public Orders API request contract.\n *\n * @generated from field: orders.v1.CancelOrderRequest cancel_order = 12;\n */\n value: CancelOrderRequest;\n case: \"cancelOrder\";\n } | {\n /**\n * Modify-order command using the public Orders API request contract.\n *\n * @generated from field: orders.v1.ModifyOrderRequest modify_order = 13;\n */\n value: ModifyOrderRequest;\n case: \"modifyOrder\";\n } | {\n /**\n * Cancel-all command using the public Orders API request contract.\n *\n * @generated from field: orders.v1.CancelAllOrdersRequest cancel_all_orders = 14;\n */\n value: CancelAllOrdersRequest;\n case: \"cancelAllOrders\";\n } | {\n /**\n * Batch create command using the public Orders API request contract: up\n * to 20 orders, each admitted or rejected on its own. request_id is the\n * same account-scoped idempotency key as the Orders API's: resending the\n * same request_id and items, over this WebSocket or the Orders API,\n * replays the original per-item results instead of creating orders again.\n *\n * @generated from field: orders.v1.BatchCreateOrdersRequest batch_create_orders = 15;\n */\n value: BatchCreateOrdersRequest;\n case: \"batchCreateOrders\";\n } | {\n /**\n * Batch replace command using the public Orders API request contract: up\n * to 50 orders on one trading pair, each amended in place or replaced as\n * the Orders API decides, under the same request_id idempotency as the\n * Orders API.\n *\n * @generated from field: orders.v1.BatchReplaceOrdersRequest batch_replace_orders = 16;\n */\n value: BatchReplaceOrdersRequest;\n case: \"batchReplaceOrders\";\n } | {\n /**\n * Batch cancel command using the public Orders API request contract: up\n * to 50 cancellations, each accepted or rejected on its own, under the\n * same request_id idempotency as the Orders API.\n *\n * @generated from field: orders.v1.BatchCancelOrdersRequest batch_cancel_orders = 17;\n */\n value: BatchCancelOrdersRequest;\n case: \"batchCancelOrders\";\n } | {\n /**\n * Cancel-all-after command using the public Orders API request\n * contract: arms, refreshes or disarms the account's dead-man switch,\n * the same switch as the Orders API's CancelAllAfter, with the same\n * symbol and side scope and the same timeout rule (0 disarms; 10 to 120\n * seconds arms or refreshes). On expiry it cancels the account's open\n * orders in scope, including orders that triggers placed, and no\n * trigger. The switch belongs to the account, not to this connection:\n * closing the connection neither disarms nor fires it. Refresh it well\n * within the timeout, for example every 15 to 30 seconds with a\n * 60-second timeout. Resending a request is safe: an arm restarts the\n * timer from when it applies, and a disarm is idempotent. request_id is\n * required, as on the Orders API; subaccount_id must be omitted.\n *\n * @generated from field: orders.v1.CancelAllAfterRequest cancel_all_after = 18;\n */\n value: CancelAllAfterRequest;\n case: \"cancelAllAfter\";\n } | { case: undefined; value?: undefined };\n};\n\n/**\n * Describes the message tradews.v1.ClientFrame.\n * Use `create(ClientFrameSchema)` to create a new message.\n */\nexport const ClientFrameSchema: GenMessage<ClientFrame> = /*@__PURE__*/\n messageDesc(file_tradews_v1_trade_ws, 0);\n\n/**\n * PingRequest carries an opaque payload that is echoed by PongResponse.\n *\n * @generated from message tradews.v1.PingRequest\n */\nexport type PingRequest = Message<\"tradews.v1.PingRequest\"> & {\n /**\n * Opaque client payload echoed by the server.\n *\n * @generated from field: bytes payload = 1;\n */\n payload: Uint8Array;\n};\n\n/**\n * Describes the message tradews.v1.PingRequest.\n * Use `create(PingRequestSchema)` to create a new message.\n */\nexport const PingRequestSchema: GenMessage<PingRequest> = /*@__PURE__*/\n messageDesc(file_tradews_v1_trade_ws, 1);\n\n/**\n * ServerFrame is the protobuf write-websocket response envelope.\n *\n * @generated from message tradews.v1.ServerFrame\n */\nexport type ServerFrame = Message<\"tradews.v1.ServerFrame\"> & {\n /**\n * Client sequence number copied from the accepted or rejected frame.\n *\n * @generated from field: uint64 seq = 1;\n */\n seq: bigint;\n\n /**\n * Client correlation token copied from the accepted or rejected frame.\n *\n * @generated from field: string correlation_id = 2;\n */\n correlationId: string;\n\n /**\n * @generated from oneof tradews.v1.ServerFrame.payload\n */\n payload: {\n /**\n * Liveness response for PingRequest.\n *\n * @generated from field: tradews.v1.PongResponse pong = 10;\n */\n value: PongResponse;\n case: \"pong\";\n } | {\n /**\n * Successful command acknowledgement. A batch acknowledgement carries\n * each item's own result, accepted or rejected.\n *\n * @generated from field: tradews.v1.AckResponse ack = 11;\n */\n value: AckResponse;\n case: \"ack\";\n } | {\n /**\n * Command-level reject with a stable machine-readable code. A batch\n * rejected as busy (ENGINE_BUSY or UNAVAILABLE), or one whose\n * acknowledgement never arrived, may have taken effect for some items:\n * resend it with the same request_id and items to resolve or replay it,\n * and do not assume it placed or canceled no orders.\n *\n * @generated from field: tradews.v1.CommandReject reject = 12;\n */\n value: CommandReject;\n case: \"reject\";\n } | {\n /**\n * Server overload response when the session cannot admit more work.\n *\n * @generated from field: tradews.v1.OverloadResponse overload = 13;\n */\n value: OverloadResponse;\n case: \"overload\";\n } | {\n /**\n * Terminal session-level response after which the server closes the stream.\n *\n * @generated from field: tradews.v1.TerminalSessionEvent terminal = 14;\n */\n value: TerminalSessionEvent;\n case: \"terminal\";\n } | { case: undefined; value?: undefined };\n};\n\n/**\n * Describes the message tradews.v1.ServerFrame.\n * Use `create(ServerFrameSchema)` to create a new message.\n */\nexport const ServerFrameSchema: GenMessage<ServerFrame> = /*@__PURE__*/\n messageDesc(file_tradews_v1_trade_ws, 2);\n\n/**\n * PongResponse echoes a PingRequest payload.\n *\n * @generated from message tradews.v1.PongResponse\n */\nexport type PongResponse = Message<\"tradews.v1.PongResponse\"> & {\n /**\n * Opaque payload copied from PingRequest.\n *\n * @generated from field: bytes payload = 1;\n */\n payload: Uint8Array;\n};\n\n/**\n * Describes the message tradews.v1.PongResponse.\n * Use `create(PongResponseSchema)` to create a new message.\n */\nexport const PongResponseSchema: GenMessage<PongResponse> = /*@__PURE__*/\n messageDesc(file_tradews_v1_trade_ws, 3);\n\n/**\n * AckResponse carries the command-specific public Orders API acknowledgement.\n *\n * @generated from message tradews.v1.AckResponse\n */\nexport type AckResponse = Message<\"tradews.v1.AckResponse\"> & {\n /**\n * @generated from oneof tradews.v1.AckResponse.result\n */\n result: {\n /**\n * Accepted create-order response.\n *\n * @generated from field: orders.v1.CreateOrderResponse create_order = 1;\n */\n value: CreateOrderResponse;\n case: \"createOrder\";\n } | {\n /**\n * Accepted cancel-order response.\n *\n * @generated from field: orders.v1.CancelOrderResponse cancel_order = 2;\n */\n value: CancelOrderResponse;\n case: \"cancelOrder\";\n } | {\n /**\n * Accepted modify-order response.\n *\n * @generated from field: orders.v1.ModifyOrderResponse modify_order = 3;\n */\n value: ModifyOrderResponse;\n case: \"modifyOrder\";\n } | {\n /**\n * Accepted cancel-all response.\n *\n * @generated from field: orders.v1.CancelAllOrdersResponse cancel_all_orders = 4;\n */\n value: CancelAllOrdersResponse;\n case: \"cancelAllOrders\";\n } | {\n /**\n * Batch create response with one result per requested order, in request\n * order. A rejected item carries its typed error; the others still count.\n *\n * @generated from field: orders.v1.BatchCreateOrdersResponse batch_create_orders = 5;\n */\n value: BatchCreateOrdersResponse;\n case: \"batchCreateOrders\";\n } | {\n /**\n * Batch replace admission receipt with one result per requested\n * replacement, in request order.\n *\n * @generated from field: orders.v1.BatchReplaceOrdersResponse batch_replace_orders = 6;\n */\n value: BatchReplaceOrdersResponse;\n case: \"batchReplaceOrders\";\n } | {\n /**\n * Batch cancel response with one result per requested cancellation, in\n * request order.\n *\n * @generated from field: orders.v1.BatchCancelOrdersResponse batch_cancel_orders = 7;\n */\n value: BatchCancelOrdersResponse;\n case: \"batchCancelOrders\";\n } | {\n /**\n * Cancel-all-after response: the account's dead-man switch after the\n * request applied, its deadline and its recorded scope.\n *\n * @generated from field: orders.v1.CancelAllAfterResponse cancel_all_after = 8;\n */\n value: CancelAllAfterResponse;\n case: \"cancelAllAfter\";\n } | { case: undefined; value?: undefined };\n};\n\n/**\n * Describes the message tradews.v1.AckResponse.\n * Use `create(AckResponseSchema)` to create a new message.\n */\nexport const AckResponseSchema: GenMessage<AckResponse> = /*@__PURE__*/\n messageDesc(file_tradews_v1_trade_ws, 4);\n\n/**\n * CommandReject reports a command-level failure without closing the session.\n *\n * @generated from message tradews.v1.CommandReject\n */\nexport type CommandReject = Message<\"tradews.v1.CommandReject\"> & {\n /**\n * Stable machine-readable reject code.\n *\n * @generated from field: string code = 1;\n */\n code: string;\n\n /**\n * Client-safe diagnostic detail.\n *\n * @generated from field: string detail = 2;\n */\n detail: string;\n\n /**\n * Structured error details, including retry guidance for rate-limit rejections.\n *\n * @generated from field: orders.v1.ErrorDetail error = 3;\n */\n error?: ErrorDetail | undefined;\n};\n\n/**\n * Describes the message tradews.v1.CommandReject.\n * Use `create(CommandRejectSchema)` to create a new message.\n */\nexport const CommandRejectSchema: GenMessage<CommandReject> = /*@__PURE__*/\n messageDesc(file_tradews_v1_trade_ws, 5);\n\n/**\n * OverloadResponse reports that the session exceeded server admission limits.\n *\n * @generated from message tradews.v1.OverloadResponse\n */\nexport type OverloadResponse = Message<\"tradews.v1.OverloadResponse\"> & {\n /**\n * Stable machine-readable overload code.\n *\n * @generated from field: string code = 1;\n */\n code: string;\n\n /**\n * Client-safe diagnostic detail.\n *\n * @generated from field: string detail = 2;\n */\n detail: string;\n};\n\n/**\n * Describes the message tradews.v1.OverloadResponse.\n * Use `create(OverloadResponseSchema)` to create a new message.\n */\nexport const OverloadResponseSchema: GenMessage<OverloadResponse> = /*@__PURE__*/\n messageDesc(file_tradews_v1_trade_ws, 6);\n\n/**\n * TerminalSessionEvent reports a terminal session condition.\n *\n * @generated from message tradews.v1.TerminalSessionEvent\n */\nexport type TerminalSessionEvent = Message<\"tradews.v1.TerminalSessionEvent\"> & {\n /**\n * Stable machine-readable terminal code.\n *\n * @generated from field: string code = 1;\n */\n code: string;\n\n /**\n * Client-safe diagnostic detail.\n *\n * @generated from field: string detail = 2;\n */\n detail: string;\n};\n\n/**\n * Describes the message tradews.v1.TerminalSessionEvent.\n * Use `create(TerminalSessionEventSchema)` to create a new message.\n */\nexport const TerminalSessionEventSchema: GenMessage<TerminalSessionEvent> = /*@__PURE__*/\n messageDesc(file_tradews_v1_trade_ws, 7);\n\n"],"mappings":";;;;;;;;;;;;;;;;;;AAaA,MAAa,2BACX,uBAAS,g6EAAg6E,CAAC,qBAAqB,CAAC;;;;;AAqJl8E,MAAa,oBACX,0BAAY,0BAA0B,CAAC;;;;;AAoBzC,MAAa,oBACX,0BAAY,0BAA0B,CAAC;;;;;AA6EzC,MAAa,oBACX,0BAAY,0BAA0B,CAAC;;;;;AAoBzC,MAAa,qBACX,0BAAY,0BAA0B,CAAC;;;;;AAsFzC,MAAa,oBACX,0BAAY,0BAA0B,CAAC;;;;;AAkCzC,MAAa,sBACX,0BAAY,0BAA0B,CAAC;;;;;AA2BzC,MAAa,yBACX,0BAAY,0BAA0B,CAAC;;;;;AA2BzC,MAAa,6BACX,0BAAY,0BAA0B,CAAC"}
1
+ {"version":3,"file":"trade_ws_pb.js","names":[],"sources":["../../../../src/gen/tradews/v1/trade_ws_pb.ts"],"sourcesContent":["// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts,import_extension=js\"\n// @generated from file tradews/v1/trade_ws.proto (package tradews.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenFile, GenMessage } from \"@bufbuild/protobuf/codegenv2\";\nimport { fileDesc, messageDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { BatchCancelOrdersRequest, BatchCancelOrdersResponse, BatchCreateOrdersRequest, BatchCreateOrdersResponse, BatchReplaceOrdersRequest, BatchReplaceOrdersResponse, CancelAllAfterRequest, CancelAllAfterResponse, CancelAllOrdersRequest, CancelAllOrdersResponse, CancelOrderRequest, CancelOrderResponse, CreateOrderRequest, CreateOrderResponse, ErrorDetail, ModifyOrderRequest, ModifyOrderResponse } from \"../../orders/v1/orders_pb.js\";\nimport { file_orders_v1_orders } from \"../../orders/v1/orders_pb.js\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file tradews/v1/trade_ws.proto.\n */\nexport const file_tradews_v1_trade_ws: GenFile = /*@__PURE__*/\n fileDesc(\"Chl0cmFkZXdzL3YxL3RyYWRlX3dzLnByb3RvEgp0cmFkZXdzLnYxIoUFCgtDb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cnMudjEuRXJyb3JEZXRhaWwiMAoQT3ZlcmxvYWRSZXNwb25zZRIMCgRjb2RlGAEgASgJEg4KBmRldGFpbBgCIAEoCSI0ChRUZXJtaW5hbFNlc3Npb25FdmVudBIMCgRjb2RlGAEgASgJEg4KBmRldGFpbBgCIAEoCUJCWkBnaXRodWIuY29tL0ZhYnJpYy1MYWJzL3BvbHllc3Rlci1zZGstZ28vZ2VuL3RyYWRld3MvdjE7dHJhZGV3c3YxYgZwcm90bzM=\", [file_orders_v1_orders]);\n\n/**\n * ClientFrame is the protobuf write-websocket envelope. Its payloads reuse the\n * public Orders API request contracts so every transport shares one order model.\n *\n * @generated from message tradews.v1.ClientFrame\n */\nexport type ClientFrame = Message<\"tradews.v1.ClientFrame\"> & {\n /**\n * Monotonic per-connection client sequence number, starting at 1.\n *\n * @generated from field: uint64 seq = 1;\n */\n seq: bigint;\n\n /**\n * Client correlation token echoed in every server response.\n *\n * @generated from field: string correlation_id = 2;\n */\n correlationId: string;\n\n /**\n * Optional client time the command was sent, in milliseconds since the Unix\n * epoch. When set, the command is processed only until timestamp_ms plus\n * recv_window_ms: a command that arrives, or waits to be sent on for\n * admission, past then is rejected with REQUEST_DEADLINE_EXCEEDED and\n * changes nothing, but it has taken its seq, so the next command uses the\n * next seq. A timestamp more than 1 second ahead of the server clock is\n * rejected with BAD_REQUEST, without taking the seq. Zero sets no\n * deadline. Ping ignores it.\n *\n * @generated from field: int64 timestamp_ms = 3;\n */\n timestampMs: bigint;\n\n /**\n * Optional receive window in milliseconds, from 1 to 60000, applied to\n * timestamp_ms. Zero uses 5000. Setting it without timestamp_ms is\n * rejected with BAD_REQUEST.\n *\n * @generated from field: uint32 recv_window_ms = 4;\n */\n recvWindowMs: number;\n\n /**\n * @generated from oneof tradews.v1.ClientFrame.payload\n */\n payload: {\n /**\n * Liveness request that does not submit an order command.\n *\n * @generated from field: tradews.v1.PingRequest ping = 10;\n */\n value: PingRequest;\n case: \"ping\";\n } | {\n /**\n * Create-order command using the public Orders API request contract,\n * including its required base-quantity or maximum-quote-debit sizing choice.\n *\n * @generated from field: orders.v1.CreateOrderRequest create_order = 11;\n */\n value: CreateOrderRequest;\n case: \"createOrder\";\n } | {\n /**\n * Cancel-order command using the public Orders API request contract.\n *\n * @generated from field: orders.v1.CancelOrderRequest cancel_order = 12;\n */\n value: CancelOrderRequest;\n case: \"cancelOrder\";\n } | {\n /**\n * Modify-order command using the public Orders API request contract.\n *\n * @generated from field: orders.v1.ModifyOrderRequest modify_order = 13;\n */\n value: ModifyOrderRequest;\n case: \"modifyOrder\";\n } | {\n /**\n * Cancel-all command using the public Orders API request contract.\n *\n * @generated from field: orders.v1.CancelAllOrdersRequest cancel_all_orders = 14;\n */\n value: CancelAllOrdersRequest;\n case: \"cancelAllOrders\";\n } | {\n /**\n * Batch create command using the public Orders API request contract: up\n * to 20 orders, each admitted or rejected on its own. request_id is the\n * same account-scoped idempotency key as the Orders API's: resending the\n * same request_id and items, over this WebSocket or the Orders API,\n * replays the original per-item results instead of creating orders again.\n *\n * @generated from field: orders.v1.BatchCreateOrdersRequest batch_create_orders = 15;\n */\n value: BatchCreateOrdersRequest;\n case: \"batchCreateOrders\";\n } | {\n /**\n * Batch replace command using the public Orders API request contract: up\n * to 50 orders on one trading pair, each amended in place or replaced as\n * the Orders API decides, under the same request_id idempotency as the\n * Orders API.\n *\n * @generated from field: orders.v1.BatchReplaceOrdersRequest batch_replace_orders = 16;\n */\n value: BatchReplaceOrdersRequest;\n case: \"batchReplaceOrders\";\n } | {\n /**\n * Batch cancel command using the public Orders API request contract: up\n * to 50 cancellations, each accepted or rejected on its own, under the\n * same request_id idempotency as the Orders API.\n *\n * @generated from field: orders.v1.BatchCancelOrdersRequest batch_cancel_orders = 17;\n */\n value: BatchCancelOrdersRequest;\n case: \"batchCancelOrders\";\n } | {\n /**\n * Cancel-all-after command using the public Orders API request\n * contract: arms, refreshes or disarms the account's dead-man switch,\n * the same switch as the Orders API's CancelAllAfter, with the same\n * symbol and side scope and the same timeout rule (0 disarms; 10 to 120\n * seconds arms or refreshes). On expiry it cancels the account's open\n * orders in scope, including orders that triggers placed, and no\n * trigger. The switch belongs to the account, not to this connection:\n * closing the connection neither disarms nor fires it. Refresh it well\n * within the timeout, for example every 15 to 30 seconds with a\n * 60-second timeout. Resending a request is safe: an arm restarts the\n * timer from when it applies, and a disarm is idempotent. request_id is\n * required, as on the Orders API; subaccount_id must be omitted.\n *\n * @generated from field: orders.v1.CancelAllAfterRequest cancel_all_after = 18;\n */\n value: CancelAllAfterRequest;\n case: \"cancelAllAfter\";\n } | { case: undefined; value?: undefined };\n};\n\n/**\n * Describes the message tradews.v1.ClientFrame.\n * Use `create(ClientFrameSchema)` to create a new message.\n */\nexport const ClientFrameSchema: GenMessage<ClientFrame> = /*@__PURE__*/\n messageDesc(file_tradews_v1_trade_ws, 0);\n\n/**\n * PingRequest carries an opaque payload that is echoed by PongResponse.\n *\n * @generated from message tradews.v1.PingRequest\n */\nexport type PingRequest = Message<\"tradews.v1.PingRequest\"> & {\n /**\n * Opaque client payload echoed by the server.\n *\n * @generated from field: bytes payload = 1;\n */\n payload: Uint8Array;\n};\n\n/**\n * Describes the message tradews.v1.PingRequest.\n * Use `create(PingRequestSchema)` to create a new message.\n */\nexport const PingRequestSchema: GenMessage<PingRequest> = /*@__PURE__*/\n messageDesc(file_tradews_v1_trade_ws, 1);\n\n/**\n * ServerFrame is the protobuf write-websocket response envelope.\n *\n * @generated from message tradews.v1.ServerFrame\n */\nexport type ServerFrame = Message<\"tradews.v1.ServerFrame\"> & {\n /**\n * Client sequence number copied from the accepted or rejected frame.\n *\n * @generated from field: uint64 seq = 1;\n */\n seq: bigint;\n\n /**\n * Client correlation token copied from the accepted or rejected frame.\n *\n * @generated from field: string correlation_id = 2;\n */\n correlationId: string;\n\n /**\n * @generated from oneof tradews.v1.ServerFrame.payload\n */\n payload: {\n /**\n * Liveness response for PingRequest.\n *\n * @generated from field: tradews.v1.PongResponse pong = 10;\n */\n value: PongResponse;\n case: \"pong\";\n } | {\n /**\n * Successful command acknowledgement. A batch acknowledgement carries\n * each item's own result, accepted or rejected.\n *\n * @generated from field: tradews.v1.AckResponse ack = 11;\n */\n value: AckResponse;\n case: \"ack\";\n } | {\n /**\n * Command-level reject with a stable machine-readable code. A batch\n * rejected as busy (ENGINE_BUSY or UNAVAILABLE), or one whose\n * acknowledgement never arrived, may have taken effect for some items:\n * resend it with the same request_id and items to resolve or replay it,\n * and do not assume it placed or canceled no orders.\n *\n * @generated from field: tradews.v1.CommandReject reject = 12;\n */\n value: CommandReject;\n case: \"reject\";\n } | {\n /**\n * Server overload response when the session cannot admit more work.\n *\n * @generated from field: tradews.v1.OverloadResponse overload = 13;\n */\n value: OverloadResponse;\n case: \"overload\";\n } | {\n /**\n * Terminal session-level response after which the server closes the stream.\n *\n * @generated from field: tradews.v1.TerminalSessionEvent terminal = 14;\n */\n value: TerminalSessionEvent;\n case: \"terminal\";\n } | { case: undefined; value?: undefined };\n};\n\n/**\n * Describes the message tradews.v1.ServerFrame.\n * Use `create(ServerFrameSchema)` to create a new message.\n */\nexport const ServerFrameSchema: GenMessage<ServerFrame> = /*@__PURE__*/\n messageDesc(file_tradews_v1_trade_ws, 2);\n\n/**\n * PongResponse echoes a PingRequest payload.\n *\n * @generated from message tradews.v1.PongResponse\n */\nexport type PongResponse = Message<\"tradews.v1.PongResponse\"> & {\n /**\n * Opaque payload copied from PingRequest.\n *\n * @generated from field: bytes payload = 1;\n */\n payload: Uint8Array;\n};\n\n/**\n * Describes the message tradews.v1.PongResponse.\n * Use `create(PongResponseSchema)` to create a new message.\n */\nexport const PongResponseSchema: GenMessage<PongResponse> = /*@__PURE__*/\n messageDesc(file_tradews_v1_trade_ws, 3);\n\n/**\n * AckResponse carries the command-specific public Orders API acknowledgement.\n *\n * @generated from message tradews.v1.AckResponse\n */\nexport type AckResponse = Message<\"tradews.v1.AckResponse\"> & {\n /**\n * @generated from oneof tradews.v1.AckResponse.result\n */\n result: {\n /**\n * Accepted create-order response.\n *\n * @generated from field: orders.v1.CreateOrderResponse create_order = 1;\n */\n value: CreateOrderResponse;\n case: \"createOrder\";\n } | {\n /**\n * Accepted cancel-order response.\n *\n * @generated from field: orders.v1.CancelOrderResponse cancel_order = 2;\n */\n value: CancelOrderResponse;\n case: \"cancelOrder\";\n } | {\n /**\n * Accepted modify-order response.\n *\n * @generated from field: orders.v1.ModifyOrderResponse modify_order = 3;\n */\n value: ModifyOrderResponse;\n case: \"modifyOrder\";\n } | {\n /**\n * Accepted cancel-all response.\n *\n * @generated from field: orders.v1.CancelAllOrdersResponse cancel_all_orders = 4;\n */\n value: CancelAllOrdersResponse;\n case: \"cancelAllOrders\";\n } | {\n /**\n * Batch create response with one result per requested order, in request\n * order. A rejected item carries its typed error; the others still count.\n *\n * @generated from field: orders.v1.BatchCreateOrdersResponse batch_create_orders = 5;\n */\n value: BatchCreateOrdersResponse;\n case: \"batchCreateOrders\";\n } | {\n /**\n * Batch replace admission receipt with one result per requested\n * replacement, in request order.\n *\n * @generated from field: orders.v1.BatchReplaceOrdersResponse batch_replace_orders = 6;\n */\n value: BatchReplaceOrdersResponse;\n case: \"batchReplaceOrders\";\n } | {\n /**\n * Batch cancel response with one result per requested cancellation, in\n * request order.\n *\n * @generated from field: orders.v1.BatchCancelOrdersResponse batch_cancel_orders = 7;\n */\n value: BatchCancelOrdersResponse;\n case: \"batchCancelOrders\";\n } | {\n /**\n * Cancel-all-after response: the account's dead-man switch after the\n * request applied, its deadline and its recorded scope.\n *\n * @generated from field: orders.v1.CancelAllAfterResponse cancel_all_after = 8;\n */\n value: CancelAllAfterResponse;\n case: \"cancelAllAfter\";\n } | { case: undefined; value?: undefined };\n};\n\n/**\n * Describes the message tradews.v1.AckResponse.\n * Use `create(AckResponseSchema)` to create a new message.\n */\nexport const AckResponseSchema: GenMessage<AckResponse> = /*@__PURE__*/\n messageDesc(file_tradews_v1_trade_ws, 4);\n\n/**\n * CommandReject reports a command-level failure without closing the session.\n *\n * @generated from message tradews.v1.CommandReject\n */\nexport type CommandReject = Message<\"tradews.v1.CommandReject\"> & {\n /**\n * Stable machine-readable reject code.\n *\n * @generated from field: string code = 1;\n */\n code: string;\n\n /**\n * Client-safe diagnostic detail.\n *\n * @generated from field: string detail = 2;\n */\n detail: string;\n\n /**\n * Structured error details, including retry guidance for rate-limit rejections.\n *\n * @generated from field: orders.v1.ErrorDetail error = 3;\n */\n error?: ErrorDetail | undefined;\n};\n\n/**\n * Describes the message tradews.v1.CommandReject.\n * Use `create(CommandRejectSchema)` to create a new message.\n */\nexport const CommandRejectSchema: GenMessage<CommandReject> = /*@__PURE__*/\n messageDesc(file_tradews_v1_trade_ws, 5);\n\n/**\n * OverloadResponse reports that the session exceeded server admission limits.\n *\n * @generated from message tradews.v1.OverloadResponse\n */\nexport type OverloadResponse = Message<\"tradews.v1.OverloadResponse\"> & {\n /**\n * Stable machine-readable overload code.\n *\n * @generated from field: string code = 1;\n */\n code: string;\n\n /**\n * Client-safe diagnostic detail.\n *\n * @generated from field: string detail = 2;\n */\n detail: string;\n};\n\n/**\n * Describes the message tradews.v1.OverloadResponse.\n * Use `create(OverloadResponseSchema)` to create a new message.\n */\nexport const OverloadResponseSchema: GenMessage<OverloadResponse> = /*@__PURE__*/\n messageDesc(file_tradews_v1_trade_ws, 6);\n\n/**\n * TerminalSessionEvent reports a terminal session condition.\n *\n * @generated from message tradews.v1.TerminalSessionEvent\n */\nexport type TerminalSessionEvent = Message<\"tradews.v1.TerminalSessionEvent\"> & {\n /**\n * Stable machine-readable terminal code.\n *\n * @generated from field: string code = 1;\n */\n code: string;\n\n /**\n * Client-safe diagnostic detail.\n *\n * @generated from field: string detail = 2;\n */\n detail: string;\n};\n\n/**\n * Describes the message tradews.v1.TerminalSessionEvent.\n * Use `create(TerminalSessionEventSchema)` to create a new message.\n */\nexport const TerminalSessionEventSchema: GenMessage<TerminalSessionEvent> = /*@__PURE__*/\n messageDesc(file_tradews_v1_trade_ws, 7);\n\n"],"mappings":";;;;;;;;;;;;;;;;;;AAaA,MAAa,2BACX,uBAAS,g6EAAg6E,CAAC,qBAAqB,CAAC;;;;;AAqJl8E,MAAa,oBACX,0BAAY,0BAA0B,CAAC;;;;;AAoBzC,MAAa,oBACX,0BAAY,0BAA0B,CAAC;;;;;AA6EzC,MAAa,oBACX,0BAAY,0BAA0B,CAAC;;;;;AAoBzC,MAAa,qBACX,0BAAY,0BAA0B,CAAC;;;;;AAsFzC,MAAa,oBACX,0BAAY,0BAA0B,CAAC;;;;;AAkCzC,MAAa,sBACX,0BAAY,0BAA0B,CAAC;;;;;AA2BzC,MAAa,yBACX,0BAAY,0BAA0B,CAAC;;;;;AA2BzC,MAAa,6BACX,0BAAY,0BAA0B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -42,14 +42,14 @@ import { CancelTriggerResult, CreateTriggerResult, LadderDetailsOutput, ListTrig
42
42
  import { ListTriggersResult } from "./services/triggers/triggers.js";
43
43
  import { LedgerTransfer, LedgerTransferSide, ListTransfersInput } from "./services/transfers/transfers.schemas.js";
44
44
  import { CreateInternalTransferInput, CreateInternalTransferResult, GetInternalTransferInput, GetInternalTransferResult, InternalTransferDestination, ResolvedInternalTransferDestination } from "./services/internal-transfers/internal-transfers.schemas.js";
45
- import { CreateTradingWithdrawResult, CreateTradingWithdrawToExternalChainInput, CreateTradingWithdrawToFundingInput, ValidateWithdrawDestinationInput, ValidateWithdrawDestinationResult } from "./services/trading-withdraws/trading-withdraws.schemas.js";
45
+ import { CreateTradingWithdrawResult, CreateTradingWithdrawToExternalChainInput, CreateTradingWithdrawToFundingInput, GetWalletBalancesInput, GetWalletBalancesResult, ValidateWithdrawDestinationInput, ValidateWithdrawDestinationResult } from "./services/trading-withdraws/trading-withdraws.schemas.js";
46
46
  import { CreateTradingWithdrawToExternalChainServiceInput, CreateTradingWithdrawToFundingServiceInput, PreparedTradingWithdraw, TradingWithdrawSigningConfig, TradingWithdrawWalletSigner } from "./services/trading-withdraws/trading-withdraws.js";
47
- import { AutoWithdrawCadence, AutoWithdrawPauseReason, AutoWithdrawRunReason, AutoWithdrawRunState, AutoWithdrawStepReason, AutoWithdrawStepState, AutoWithdrawWeekday } from "./services/auto-withdraw/auto-withdraw.codecs.js";
48
- import { AutoWithdrawDestination, AutoWithdrawDestinationInput, AutoWithdrawPause, AutoWithdrawRule, AutoWithdrawRun, AutoWithdrawSchedule, AutoWithdrawScheduleInput, AutoWithdrawScopedInput, AutoWithdrawStep, DisableAutoWithdrawRuleInput, ListAutoWithdrawRunsInput, ListAutoWithdrawRunsResult, SetAutoWithdrawRuleInput } from "./services/auto-withdraw/auto-withdraw.schemas.js";
47
+ import { AutoWithdrawCadence, AutoWithdrawHoldReason, AutoWithdrawPauseReason, AutoWithdrawPreviewStatus, AutoWithdrawRunReason, AutoWithdrawRunState, AutoWithdrawStepReason, AutoWithdrawStepState, AutoWithdrawWeekday } from "./services/auto-withdraw/auto-withdraw.codecs.js";
48
+ import { AutoWithdrawDestination, AutoWithdrawDestinationInput, AutoWithdrawPause, AutoWithdrawPreview, AutoWithdrawPreviewAsset, AutoWithdrawRule, AutoWithdrawRun, AutoWithdrawSchedule, AutoWithdrawScheduleInput, AutoWithdrawScopedInput, AutoWithdrawStep, ListAutoWithdrawRunsInput, ListAutoWithdrawRunsResult, SetAutoWithdrawRuleEnabledInput, SetAutoWithdrawRuleInput } from "./services/auto-withdraw/auto-withdraw.schemas.js";
49
49
  import { CreateDepositAddressInput, DepositAddress, ListDepositAddressesInput } from "./services/deposit/deposit.schemas.js";
50
50
  import { AddressBook, AddressBookAccountScope, AddressBookEntries, AddressBookEntriesView, AddressBookEntry, AddressBookRecentDestinationsView, AddressBookTag, AddressBookTagSummary, AddressBookView, AddressBookViewInvalidated, CopyAddressBookEntryInput, CreateAddressBookEntryInput, CreateAddressBookTagInput, DeleteAddressBookEntryInput, DeleteAddressBookTagInput, GetAddressBookViewInput, InternalTransferWhitelistEntries, InternalTransferWhitelistEntry, ListAddressBookEntriesInput, ListInternalTransferWhitelistEntriesInput, ListTransferCounterpartiesInput, ListTransferDestinationsInput, MirroredWithdrawWhitelistEntry, SubaccountScopedInput, TransferCounterparties, TransferCounterparty, TransferDestination, TransferDestinations, UpdateAddressBookEntryInput, UpdateAddressBookTagInput, WithdrawWhitelistView, validateCreateAddressBookEntryInput } from "./services/address-book/address-book.schemas.js";
51
51
  import { BatchGuardApprovals, BatchSignProtectedActionInput, CreateGuardSignerWalletResult, ExportGuardSignerWalletResult, GuardApproval, GuardSignerScopedInput, GuardSignerStatus, RotateGuardSignerWalletResult, SignProtectedActionInput } from "./services/guard-signer/guard-signer.schemas.js";
52
- import { GetVerificationResponse, SocialProvider, SocialProviderInput, SocialVerification, SocialVerificationErrorCode, SocialVerificationMethod, SocialVerificationStatus, StartVerificationInput, StartVerificationResponse, VerificationReadyResponse } from "./services/social-verification/social-verification.schemas.js";
52
+ import { ConfirmVerificationInput, GetVerificationResponse, SocialProvider, SocialProviderInput, SocialVerification, SocialVerificationErrorCode, SocialVerificationMethod, SocialVerificationStatus, StartVerificationInput, StartVerificationResponse, UnlinkSocialAccountInput, VerificationReadyResponse } from "./services/social-verification/social-verification.schemas.js";
53
53
  import { ZippedAssetSupplyBatch, ZippedAssetSupplyUpdate } from "./services/zipper/zipper.schemas.js";
54
54
  import { SubscribeZippedAssetSupplyInput } from "./services/zipper/zipper.js";
55
55
  import { BeginMfaChallengeInput, BeginMfaChallengeResult, BeginPasskeyEnrollmentInput, BeginPasskeyEnrollmentResult, BeginTotpEnrollmentInput, BeginTotpEnrollmentResult, ClaimFreshStepUpInput, ClaimFreshStepUpResult, CompleteMfaChallengeResult, ConsumeFreshStepUpInput, DeleteMfaFactorInput, FinishPasskeyChallengeInput, FinishPasskeyEnrollmentInput, FinishPasskeyEnrollmentResult, FinishTotpEnrollmentInput, FinishTotpEnrollmentResult, ListMfaFactorsResult, MfaFactor, MfaSessionInfo, RegenerateRecoveryCodesInput, RegenerateRecoveryCodesResult, ReleaseFreshStepUpInput, UpdateMfaFactorInput, UpdateMfaFactorResult, VerifyRecoveryCodeChallengeInput, VerifyTotpChallengeInput } from "./services/mfa/mfa.schemas.js";
@@ -125,4 +125,4 @@ import "./services/transfers/transfers.types.js";
125
125
  import "./services/triggers/triggers.types.js";
126
126
  import "./services/vip/vip.types.js";
127
127
  import "./services/zipper/zipper.types.js";
128
- export { type AccountCodeValue, type AccountIdentity, type AccountScope, type AccountScopedInput, type AccountSigner, type AccountSignerAuthEvents, type AccountSignerConfig, type CreateSubaccountResult as AccountSignerCreateSubaccountResult, type AccountSignerFactory, type AcknowledgeRewardAwardInput, type AcknowledgeRewardAwardResult, type ActiveAccountInfo, type AddressBook, type AddressBookAccountScope, type AddressBookEntries, type AddressBookEntriesView, type AddressBookEntry, type AddressBookRecentDestinationsView, type AddressBookTag, type AddressBookTagSummary, type AddressBookView, type AddressBookViewInvalidated, AlreadyExistsError, type ApiKey, type ApiKeyEd25519AuthProvider, type ApiKeyIdInput, type ApiKeyPolicy, type ApiKeyPolicyApplyInput, type ApiKeyPolicyCreateInput, type ApiKeyPolicyUpdateInput, type ApiKeyStatus, type ApiKeysCreateInput, type ApiKeysListInput, type ApiKeysUpdateInput, type AssetConfig, type AuthCookieLocation, type AuthHydrationData, type AuthLoginMethod, type AuthState, type AuthTokenStorage, type AuthTokenStorageSetOptions, AuthenticationError, type AutoWithdrawCadence, type AutoWithdrawDestination, type AutoWithdrawDestinationInput, type AutoWithdrawPause, type AutoWithdrawPauseReason, type AutoWithdrawRule, type AutoWithdrawRun, type AutoWithdrawRunReason, type AutoWithdrawRunState, type AutoWithdrawSchedule, type AutoWithdrawScheduleInput, type AutoWithdrawScopedInput, type AutoWithdrawStep, type AutoWithdrawStepReason, type AutoWithdrawStepState, type AutoWithdrawWeekday, type BalanceHistoryInput, type BalanceHistoryResponse, type BalanceRange, type BatchCancelOrderInput, type BatchCancelOrderResult, type BatchCancelOrdersInput, type BatchCancelOrdersResult, type BatchCreateOrderResult, type BatchCreateOrdersInput, type BatchCreateOrdersResult, type BatchGuardApprovals, type BatchReplaceAdmissionItem, type BatchReplaceOrdersInput, type BatchReplaceOrdersResult, type BatchSignProtectedActionInput, type BeginMfaChallengeInput, type BeginMfaChallengeResult, type BeginPasskeyEnrollmentInput, type BeginPasskeyEnrollmentResult, type BeginTotpEnrollmentInput, type BeginTotpEnrollmentResult, type CancelAllAfterInput, type CancelAllAfterResult, type CancelAllOrdersInput, type CancelAllOrdersResponse, type CancelOrderInput, type CancelOrderResult, type CancelTriggerInput, type CancelTriggerResult, type Candle, type CandleColumnar, type CandleColumnarInt, type CandleInt, type ChainAnalyticsRange, type ChangelogAudience, type ChangelogChange, type ChangelogChangeCategory, type ChangelogChangeEntry, type ChangelogPost, type ChangelogPostSummary, type ChangelogSection, type ChangelogSort, type ChangelogSurface, type Checkpoint, type CheckpointAssetAmount, type CheckpointBadge, type CheckpointBiggestTrade, type CheckpointChainFlow, type CheckpointEarnedBadge, type CheckpointField, type CheckpointFlowTotal, type CheckpointFundingDay, type CheckpointFundingFlowSummary, type CheckpointOrderToolCounts, type CheckpointOrderTypeCounts, type CheckpointPairActivity, type CheckpointPortfolioValuePoint, type CheckpointTimeInForceCounts, type CheckpointVipTierChange, type CheckpointVolumePoint, type ClaimCampaign, type ClaimDailyRewardInput, type ClaimDailyRewardResult, type ClaimFreshStepUpInput, type ClaimFreshStepUpResult, type ClaimGeneratedUsernameInput, ClaimOutcomeUnknownError, type ClaimOutcomeUnknownErrorOptions, type ClaimPayoutDelayReason, type ClaimPolicy, type ColumnarTimeWindow, type CompleteMfaChallengeResult, ConfigurationError, type ConnectChannelParams, type ConnectPrivateOrdersParams, type ConsumeFreshStepUpInput, type CookieAuthTokenStorageOptions, type CopyAddressBookEntryInput, type CreateAddressBookEntryInput, type CreateAddressBookTagInput, type CreateDepositAddressInput, type CreateGuardSignerWalletResult, type CreateInternalTransferInput, type CreateInternalTransferResult, type CreateOrderResult, type CreateOrderbookSubscriptionInput, type CreatePolyesterAccountSignerParams, type CreatePolyesterEnvironmentParams, type CreateServerClientFromCookiesParams, type CreateServerClientFromRequestParams, type CreateSubaccountChallengeInput, type CreateSubaccountInput, type CreateSubaccountParams, type CreateSubaccountResult$1 as CreateSubaccountResult, type CreateSubaccountResult$1 as CreateSubaccountServiceResult, type CreateTradingWithdrawResult, type CreateTradingWithdrawToExternalChainInput, type CreateTradingWithdrawToExternalChainServiceInput, type CreateTradingWithdrawToFundingInput, type CreateTradingWithdrawToFundingServiceInput, type CreateTriggerInput, type CreateTriggerResult, type CreateWalletChallengeInput, type CurrencyConversionConfig, type CurrencyConversionRates, type CurrencyMetadata, type DailyClaimReward, type DailyClaimState, type DailyClaimStatus, type DailyClaimTransfer, type DeleteAddressBookEntryInput, type DeleteAddressBookTagInput, type DeleteMfaFactorInput, type DepositAddress, type DepositWithdrawConfig, type DisableAutoWithdrawRuleInput, type EffectiveSubaccountPermissions, type EquityGroupBy, type EquityHistoryInput, type EquityHistoryResponse, type EquitySeries, type EquitySeriesGrouping, type EvmHex, type ExportGuardSignerWalletResult, type FiatConversionRate, type FiatConversionSnapshot, type FinishPasskeyChallengeInput, type FinishPasskeyEnrollmentInput, type FinishPasskeyEnrollmentResult, type FinishTotpEnrollmentInput, type FinishTotpEnrollmentResult, type GeneratedUsernameOffer, type GetAddressBookViewInput, type GetBatchReplaceStatusInput, type GetBatchReplaceStatusResult, type GetCandlesColumnsInput, type GetCandlesInput, type GetChangelogPostInput, type GetInternalTransferInput, type GetInternalTransferResult, type GetLifecycleFlowInput, type GetLifecycleFlowOutput, type GetMarketTradesInput, type GetOrderDetailsInput, type GetOrderbookHeatmapInput, type GetOrderbookInput, type GetSpotFeeRatesInput, type GetSubaccountInput, type GetTriggerInput, type GetUnifiedAssetBalancesInput, type GetUserTradesInput, type GetVerificationResponse, type GetZippedAssetSupplyGroupInput, type GetZippedAssetSupplyInput, type GuardApproval, type GuardSignerScopedInput, type GuardSignerStatus, type HeatmapDepthValue, type HeatmapIntervalValue, type HeatmapQuantityModeValue, type HexAddress, InternalServerError, type InternalTransferDestination, type InternalTransferStatus, type InternalTransferWhitelistEntries, type InternalTransferWhitelistEntry, type InviteSubaccountMemberInput, type JwtAuthProvider, type LadderDetailsOutput, type LedgerBalance, type LedgerTransfer, type LedgerTransferSide, type LifecycleAssetIds, type LifecycleFlowDetail, type LifecycleFlowState, type LifecycleFlowStep, type LifecycleFlowStepActivity, type LifecycleFlowSummary, type LifecycleFlowSummaryProgress, type LifecycleFlowTimelineItem, type LifecycleFlowTxMatch, type LifecycleListOrderBy, type LifecycleListScope, type LifecycleReason, type LifecycleRequestFee, type LifecycleRequestFeeStatus, type LifecycleSort, type LifecycleTxLookupKind, type LifecycleZipperReason, type ListAddressBookEntriesInput, type ListApiKeyPoliciesResponse, type ListAutoWithdrawRunsInput, type ListAutoWithdrawRunsResult, type ListChangelogChangesInput, type ListChangelogChangesResult, type ListChangelogPostsInput, type ListChangelogPostsResult, type ListCheckpointsInput, type ListDepositAddressesInput, type ListInternalTransferWhitelistEntriesInput, type ListLifecycleFlowsByTxInput, type ListLifecycleFlowsByTxOutput, type ListLifecycleFlowsInput, type ListLifecycleFlowsOutput, type ListMarketOverviewInput, type ListMfaFactorsResult, type ListRewardAwardsInput, type ListRewardAwardsResult, type ListSubaccountInvitesInput, type ListTransferCounterpartiesInput, type ListTransferDestinationsInput, type ListTransfersInput, type ListTriggerEventsInput, type ListTriggerEventsResult, type ListTriggersInput, type ListTriggersResult, type LoginOptions, type LoginResult, type LoginWithWalletInput, type LoginWithWalletResponse, type MarketOverview, type MarketOverviewOrderBy, type MarketOverviewSort, type MarketOverviewSparkline, type MarketTrade, type Me, MfaEnrollmentRequiredError, type MfaFactor, MfaLastFactorRequiredError, MfaRequiredError, type MfaSessionInfo, MfaVerificationError, type MfaVerificationFailureReason, type MirroredWithdrawWhitelistEntry, type ModifyOrderInput, type ModifyOrderResult, type ModifyTriggerInput, type ModifyTriggerResult, NetworkError, type NewOrderInput, type NextVipTierThresholds, NotImplementedError, type OpenOrdersInput, type Order, type OrderDetails, type OrderErrorCode, type OrderErrorDetail, type OrderHistoryInput, type OrderIntentInput, type OrderLineage, type OrderTransfer, type OrderbookData, type OrderbookHeatmapDeltaBucket, type OrderbookHeatmapDeltaChain, type OrderbookHeatmapDeltaLevels, type OrderbookHeatmapKeyframe, type OrderbookHeatmapLevels, type OrderbookHeatmapLiveBucket, type OrderbookHeatmapResponse, type OrderbookLevel, type OrderbookStreamHandlers, type OrderbookSubscription, OutcomeUnknownError, POLYESTER_AUTH_TOKEN_COOKIE_NAME, POLYESTER_DEVNET_ENVIRONMENT, POLYESTER_SESSION_COOKIE_NAME, POLYESTER_TESTNET_ENVIRONMENT, type PairConfig, type PairStatus, type PauseTriggerInput, type PauseTriggerResult, PermissionError, type PolicyAction, PolicyInUseError, PolicyLockedError, type PolicyMarketScope, PolicyScopeMismatchError, type PolyesterAccountAbstractionEnvironment, PolyesterBrowserClient, type PolyesterBrowserClientConfig, PolyesterBrowserCore, PolyesterClient, type PolyesterClientBaseConfig, type PolyesterClientConfig, type PolyesterContractsEnvironment, PolyesterCore, type PolyesterEntryPointConfig, type PolyesterEnvironment, PolyesterError, type PolyesterErrorCode, type PolyesterErrorDetail, type PolyesterErrorOptions, type PolyesterMutationOptions, type PolyesterRealtime, type PolyesterRealtimeAuthConfig, type PolyesterRequestOptions, type PolyesterSafeDeploymentConfig, PolyesterServerClient, type PolyesterServerClientConfig, PolyesterServerCore, type PolyesterServices, type PortfolioEquityHistoryInput, type PortfolioEquityHistoryResponse, type PortfolioEquitySeries, type PortfolioEquitySeriesGrouping, type PortfolioEquitySnapshotResponse, PreconditionFailedError, type PreparedTradingWithdraw, type PreviewOrderResult, type PrivateOrdersEvent, type Profile, type RateLimitConfig, type RateLimitDetail, RateLimitError, type RateLimitErrorOptions, type RateLimitFailureReason, type RateLimitPolicyClass, type RateLimitRefillModel, type RateLimitScope, type RealtimeConnection, type RealtimeConnectionState, type RealtimeConnectionStatus, RealtimeError, type RealtimeErrorOptions, type RegenerateRecoveryCodesInput, type RegenerateRecoveryCodesResult, type ReleaseFreshStepUpInput, type RemoveSubaccountMemberInput, RequestDeadlineExceededError, RequestError, RequestTooLargeError, type ResolveAccountInput, type ResolvedAccount, type ResolvedInternalTransferDestination, ResourceNotFoundError, type RespondSubaccountInviteInput, type ResumeTriggerInput, type ResumeTriggerResult, RevisionConflictError, type RewardAward, type RewardFulfillmentMethod, type RewardFulfillmentState, type RiskPolicyInput, type RotateGuardSignerWalletResult, type SdkSubscriptionErrorContext, type ServerSessionCookieOptions, type ServerSessionSnapshot, ServiceUnavailableError, type SessionData, SessionElevationRequiredError, type SetAutoWithdrawRuleInput, type SetRewardDestinationInput, type SetRewardDestinationResult, type SetSubaccountMemberMfaRequirementInput, type SignProtectedActionInput, type SocialProvider, type SocialProviderInput, type SocialVerification, type SocialVerificationErrorCode, type SocialVerificationMethod, type SocialVerificationStatus, type SparklineIntervalName, type SpotConfig, type SpotFeeDiscount, type SpotFeeRate, type SpotFeeRateBreakdown, type SpotPairVolumeSeries, type SpotVolumeHistoryInput, type SpotVolumeHistoryResponse, type StablecoinConversionRate, StaleQuoteError, type StartVerificationInput, type StartVerificationResponse, StepUpRequiredError, type StopDetailsOutput, type StopLossInput, type Subaccount, type SubaccountActivityInput, type SubaccountChallenge, SubaccountChallengeInvalidError, type SubaccountEvent, type SubaccountIdInput, type SubaccountInvite, type SubaccountInviteStatus, type SubaccountMember, type SubaccountPermission, type SubaccountPermissionDefinition, type SubaccountPolicy, type SubaccountPolicyApplyInput, type SubaccountPolicyCreateInput, type SubaccountPolicyUpdateInput, type SubaccountRole, type SubaccountRoleCatalog, type SubaccountRoleDefinition, type SubaccountScopedInput, type SubaccountStatus, type SubscribeHandlers, type SubscribeZippedAssetSupplyInput, type TakeProfitInput, type Timeframe, TimeoutError, TimestampSkewError, type Trade, type TradeBackfill, type TradingRateLimitClass, type TradingRateLimitRule, type TradingRateLimits, type TradingWithdrawSigningConfig, type TradingWithdrawWalletSigner, type TrailingDetailsOutput, type TrailingStopInput, type TransferCodeValue, type TransferCounterparties, type TransferCounterparty, type TransferDestination, type TransferDestinations, type TransferSideKind, TransientError, type Transports, type Trigger, type TriggerDetailsOutput, type TriggerEvent, type TwapDetailsOutput, type UnifiedAssetBalancesResponse, type UpdateAddressBookEntryInput, type UpdateAddressBookTagInput, type UpdateMfaFactorInput, type UpdateMfaFactorResult, type UpdateProfileInput, type UpdateSubaccountInput, type UpdateSubaccountMemberRoleInput, UserOperationAlreadyKnownError, UserOperationNotExecutedError, UserOperationSendTimeoutError, type UsernameHistoryEntry, type ValidateWithdrawDestinationInput, type ValidateWithdrawDestinationResult, ValidationError, type VerificationReadyResponse, type VerifyRecoveryCodeChallengeInput, type VerifyTotpChallengeInput, type VipMetricQuality, type VipMetricStatus, type VipStatus, type VipTier, type VipTierCatalog, type WalletChallenge, WithdrawDeadlineExpiredError, type WithdrawWhitelistView, type ZippedAssetSupplyBatch, type ZippedAssetSupplyGroupResponse, type ZippedAssetSupplyResponse, type ZippedAssetSupplySeries, type ZippedAssetSupplyUpdate, type ZipperAssetChainVariant, type ZipperAssetConfig, type ZipperChainConfig, type ZipperChainContractConfig, type ZipperMemoRequirement, checksumEvmAddress, columnarTimestampSecAt, compareUnsignedIntegerStrings, connectErrorToPolyesterError, createCookieAuthTokenStorage, createErrorMappingInterceptor, createMemoryAuthTokenStorage, createPolyesterEnvironment, createPolyesterServerClientFromCookies, createPolyesterServerClientFromRequest, createPolyesterServerCoreFromCookies, createPolyesterServerCoreFromRequest, errorFromHttpStatus, evmHexToBytes, evmUtf8ToBytes, evmUtf8ToHex, expandColumnarTimestampsSec, formatConnectError, formatLedgerBalance, formatUserFacingError, isAbortError, isEvmAddress, isEvmAddressStrict, isFreshStepUpRequiredError, isMfaEnrollmentRequiredError, isMfaLastFactorRequiredError, isPolicyInUseError, isPolicyLockedError, isPolicyScopeMismatchError, isResourceNotFoundError, isRetryableError, isRevisionConflictError, isSessionElevationRequiredError, isTimeoutAbortError, keccak256Hex, loadErrorDetailDecoders, mergeLedgerBalances, normalizeErrorMessage, resolveAuthCookieName, shouldApplyReconciliationUpdate, tsObjToNsString as timestampToNanoseconds, toPolyesterError, validateCreateAddressBookEntryInput };
128
+ export { type AccountCodeValue, type AccountIdentity, type AccountScope, type AccountScopedInput, type AccountSigner, type AccountSignerAuthEvents, type AccountSignerConfig, type CreateSubaccountResult as AccountSignerCreateSubaccountResult, type AccountSignerFactory, type AcknowledgeRewardAwardInput, type AcknowledgeRewardAwardResult, type ActiveAccountInfo, type AddressBook, type AddressBookAccountScope, type AddressBookEntries, type AddressBookEntriesView, type AddressBookEntry, type AddressBookRecentDestinationsView, type AddressBookTag, type AddressBookTagSummary, type AddressBookView, type AddressBookViewInvalidated, AlreadyExistsError, type ApiKey, type ApiKeyEd25519AuthProvider, type ApiKeyIdInput, type ApiKeyPolicy, type ApiKeyPolicyApplyInput, type ApiKeyPolicyCreateInput, type ApiKeyPolicyUpdateInput, type ApiKeyStatus, type ApiKeysCreateInput, type ApiKeysListInput, type ApiKeysUpdateInput, type AssetConfig, type AuthCookieLocation, type AuthHydrationData, type AuthLoginMethod, type AuthState, type AuthTokenStorage, type AuthTokenStorageSetOptions, AuthenticationError, type AutoWithdrawCadence, type AutoWithdrawDestination, type AutoWithdrawDestinationInput, type AutoWithdrawHoldReason, type AutoWithdrawPause, type AutoWithdrawPauseReason, type AutoWithdrawPreview, type AutoWithdrawPreviewAsset, type AutoWithdrawPreviewStatus, type AutoWithdrawRule, type AutoWithdrawRun, type AutoWithdrawRunReason, type AutoWithdrawRunState, type AutoWithdrawSchedule, type AutoWithdrawScheduleInput, type AutoWithdrawScopedInput, type AutoWithdrawStep, type AutoWithdrawStepReason, type AutoWithdrawStepState, type AutoWithdrawWeekday, type BalanceHistoryInput, type BalanceHistoryResponse, type BalanceRange, type BatchCancelOrderInput, type BatchCancelOrderResult, type BatchCancelOrdersInput, type BatchCancelOrdersResult, type BatchCreateOrderResult, type BatchCreateOrdersInput, type BatchCreateOrdersResult, type BatchGuardApprovals, type BatchReplaceAdmissionItem, type BatchReplaceOrdersInput, type BatchReplaceOrdersResult, type BatchSignProtectedActionInput, type BeginMfaChallengeInput, type BeginMfaChallengeResult, type BeginPasskeyEnrollmentInput, type BeginPasskeyEnrollmentResult, type BeginTotpEnrollmentInput, type BeginTotpEnrollmentResult, type CancelAllAfterInput, type CancelAllAfterResult, type CancelAllOrdersInput, type CancelAllOrdersResponse, type CancelOrderInput, type CancelOrderResult, type CancelTriggerInput, type CancelTriggerResult, type Candle, type CandleColumnar, type CandleColumnarInt, type CandleInt, type ChainAnalyticsRange, type ChangelogAudience, type ChangelogChange, type ChangelogChangeCategory, type ChangelogChangeEntry, type ChangelogPost, type ChangelogPostSummary, type ChangelogSection, type ChangelogSort, type ChangelogSurface, type Checkpoint, type CheckpointAssetAmount, type CheckpointBadge, type CheckpointBiggestTrade, type CheckpointChainFlow, type CheckpointEarnedBadge, type CheckpointField, type CheckpointFlowTotal, type CheckpointFundingDay, type CheckpointFundingFlowSummary, type CheckpointOrderToolCounts, type CheckpointOrderTypeCounts, type CheckpointPairActivity, type CheckpointPortfolioValuePoint, type CheckpointTimeInForceCounts, type CheckpointVipTierChange, type CheckpointVolumePoint, type ClaimCampaign, type ClaimDailyRewardInput, type ClaimDailyRewardResult, type ClaimFreshStepUpInput, type ClaimFreshStepUpResult, type ClaimGeneratedUsernameInput, ClaimOutcomeUnknownError, type ClaimOutcomeUnknownErrorOptions, type ClaimPayoutDelayReason, type ClaimPolicy, type ColumnarTimeWindow, type CompleteMfaChallengeResult, ConfigurationError, type ConfirmVerificationInput, type ConnectChannelParams, type ConnectPrivateOrdersParams, type ConsumeFreshStepUpInput, type CookieAuthTokenStorageOptions, type CopyAddressBookEntryInput, type CreateAddressBookEntryInput, type CreateAddressBookTagInput, type CreateDepositAddressInput, type CreateGuardSignerWalletResult, type CreateInternalTransferInput, type CreateInternalTransferResult, type CreateOrderResult, type CreateOrderbookSubscriptionInput, type CreatePolyesterAccountSignerParams, type CreatePolyesterEnvironmentParams, type CreateServerClientFromCookiesParams, type CreateServerClientFromRequestParams, type CreateSubaccountChallengeInput, type CreateSubaccountInput, type CreateSubaccountParams, type CreateSubaccountResult$1 as CreateSubaccountResult, type CreateSubaccountResult$1 as CreateSubaccountServiceResult, type CreateTradingWithdrawResult, type CreateTradingWithdrawToExternalChainInput, type CreateTradingWithdrawToExternalChainServiceInput, type CreateTradingWithdrawToFundingInput, type CreateTradingWithdrawToFundingServiceInput, type CreateTriggerInput, type CreateTriggerResult, type CreateWalletChallengeInput, type CurrencyConversionConfig, type CurrencyConversionRates, type CurrencyMetadata, type DailyClaimReward, type DailyClaimState, type DailyClaimStatus, type DailyClaimTransfer, type DeleteAddressBookEntryInput, type DeleteAddressBookTagInput, type DeleteMfaFactorInput, type DepositAddress, type DepositWithdrawConfig, type EffectiveSubaccountPermissions, type EquityGroupBy, type EquityHistoryInput, type EquityHistoryResponse, type EquitySeries, type EquitySeriesGrouping, type EvmHex, type ExportGuardSignerWalletResult, type FiatConversionRate, type FiatConversionSnapshot, type FinishPasskeyChallengeInput, type FinishPasskeyEnrollmentInput, type FinishPasskeyEnrollmentResult, type FinishTotpEnrollmentInput, type FinishTotpEnrollmentResult, type GeneratedUsernameOffer, type GetAddressBookViewInput, type GetBatchReplaceStatusInput, type GetBatchReplaceStatusResult, type GetCandlesColumnsInput, type GetCandlesInput, type GetChangelogPostInput, type GetInternalTransferInput, type GetInternalTransferResult, type GetLifecycleFlowInput, type GetLifecycleFlowOutput, type GetMarketTradesInput, type GetOrderDetailsInput, type GetOrderbookHeatmapInput, type GetOrderbookInput, type GetSpotFeeRatesInput, type GetSubaccountInput, type GetTriggerInput, type GetUnifiedAssetBalancesInput, type GetUserTradesInput, type GetVerificationResponse, type GetWalletBalancesInput, type GetWalletBalancesResult, type GetZippedAssetSupplyGroupInput, type GetZippedAssetSupplyInput, type GuardApproval, type GuardSignerScopedInput, type GuardSignerStatus, type HeatmapDepthValue, type HeatmapIntervalValue, type HeatmapQuantityModeValue, type HexAddress, InternalServerError, type InternalTransferDestination, type InternalTransferStatus, type InternalTransferWhitelistEntries, type InternalTransferWhitelistEntry, type InviteSubaccountMemberInput, type JwtAuthProvider, type LadderDetailsOutput, type LedgerBalance, type LedgerTransfer, type LedgerTransferSide, type LifecycleAssetIds, type LifecycleFlowDetail, type LifecycleFlowState, type LifecycleFlowStep, type LifecycleFlowStepActivity, type LifecycleFlowSummary, type LifecycleFlowSummaryProgress, type LifecycleFlowTimelineItem, type LifecycleFlowTxMatch, type LifecycleListOrderBy, type LifecycleListScope, type LifecycleReason, type LifecycleRequestFee, type LifecycleRequestFeeStatus, type LifecycleSort, type LifecycleTxLookupKind, type LifecycleZipperReason, type ListAddressBookEntriesInput, type ListApiKeyPoliciesResponse, type ListAutoWithdrawRunsInput, type ListAutoWithdrawRunsResult, type ListChangelogChangesInput, type ListChangelogChangesResult, type ListChangelogPostsInput, type ListChangelogPostsResult, type ListCheckpointsInput, type ListDepositAddressesInput, type ListInternalTransferWhitelistEntriesInput, type ListLifecycleFlowsByTxInput, type ListLifecycleFlowsByTxOutput, type ListLifecycleFlowsInput, type ListLifecycleFlowsOutput, type ListMarketOverviewInput, type ListMfaFactorsResult, type ListRewardAwardsInput, type ListRewardAwardsResult, type ListSubaccountInvitesInput, type ListTransferCounterpartiesInput, type ListTransferDestinationsInput, type ListTransfersInput, type ListTriggerEventsInput, type ListTriggerEventsResult, type ListTriggersInput, type ListTriggersResult, type LoginOptions, type LoginResult, type LoginWithWalletInput, type LoginWithWalletResponse, type MarketOverview, type MarketOverviewOrderBy, type MarketOverviewSort, type MarketOverviewSparkline, type MarketTrade, type Me, MfaEnrollmentRequiredError, type MfaFactor, MfaLastFactorRequiredError, MfaRequiredError, type MfaSessionInfo, MfaVerificationError, type MfaVerificationFailureReason, type MirroredWithdrawWhitelistEntry, type ModifyOrderInput, type ModifyOrderResult, type ModifyTriggerInput, type ModifyTriggerResult, NetworkError, type NewOrderInput, type NextVipTierThresholds, NotImplementedError, type OpenOrdersInput, type Order, type OrderDetails, type OrderErrorCode, type OrderErrorDetail, type OrderHistoryInput, type OrderIntentInput, type OrderLineage, type OrderTransfer, type OrderbookData, type OrderbookHeatmapDeltaBucket, type OrderbookHeatmapDeltaChain, type OrderbookHeatmapDeltaLevels, type OrderbookHeatmapKeyframe, type OrderbookHeatmapLevels, type OrderbookHeatmapLiveBucket, type OrderbookHeatmapResponse, type OrderbookLevel, type OrderbookStreamHandlers, type OrderbookSubscription, OutcomeUnknownError, POLYESTER_AUTH_TOKEN_COOKIE_NAME, POLYESTER_DEVNET_ENVIRONMENT, POLYESTER_SESSION_COOKIE_NAME, POLYESTER_TESTNET_ENVIRONMENT, type PairConfig, type PairStatus, type PauseTriggerInput, type PauseTriggerResult, PermissionError, type PolicyAction, PolicyInUseError, PolicyLockedError, type PolicyMarketScope, PolicyScopeMismatchError, type PolyesterAccountAbstractionEnvironment, PolyesterBrowserClient, type PolyesterBrowserClientConfig, PolyesterBrowserCore, PolyesterClient, type PolyesterClientBaseConfig, type PolyesterClientConfig, type PolyesterContractsEnvironment, PolyesterCore, type PolyesterEntryPointConfig, type PolyesterEnvironment, PolyesterError, type PolyesterErrorCode, type PolyesterErrorDetail, type PolyesterErrorOptions, type PolyesterMutationOptions, type PolyesterRealtime, type PolyesterRealtimeAuthConfig, type PolyesterRequestOptions, type PolyesterSafeDeploymentConfig, PolyesterServerClient, type PolyesterServerClientConfig, PolyesterServerCore, type PolyesterServices, type PortfolioEquityHistoryInput, type PortfolioEquityHistoryResponse, type PortfolioEquitySeries, type PortfolioEquitySeriesGrouping, type PortfolioEquitySnapshotResponse, PreconditionFailedError, type PreparedTradingWithdraw, type PreviewOrderResult, type PrivateOrdersEvent, type Profile, type RateLimitConfig, type RateLimitDetail, RateLimitError, type RateLimitErrorOptions, type RateLimitFailureReason, type RateLimitPolicyClass, type RateLimitRefillModel, type RateLimitScope, type RealtimeConnection, type RealtimeConnectionState, type RealtimeConnectionStatus, RealtimeError, type RealtimeErrorOptions, type RegenerateRecoveryCodesInput, type RegenerateRecoveryCodesResult, type ReleaseFreshStepUpInput, type RemoveSubaccountMemberInput, RequestDeadlineExceededError, RequestError, RequestTooLargeError, type ResolveAccountInput, type ResolvedAccount, type ResolvedInternalTransferDestination, ResourceNotFoundError, type RespondSubaccountInviteInput, type ResumeTriggerInput, type ResumeTriggerResult, RevisionConflictError, type RewardAward, type RewardFulfillmentMethod, type RewardFulfillmentState, type RiskPolicyInput, type RotateGuardSignerWalletResult, type SdkSubscriptionErrorContext, type ServerSessionCookieOptions, type ServerSessionSnapshot, ServiceUnavailableError, type SessionData, SessionElevationRequiredError, type SetAutoWithdrawRuleEnabledInput, type SetAutoWithdrawRuleInput, type SetRewardDestinationInput, type SetRewardDestinationResult, type SetSubaccountMemberMfaRequirementInput, type SignProtectedActionInput, type SocialProvider, type SocialProviderInput, type SocialVerification, type SocialVerificationErrorCode, type SocialVerificationMethod, type SocialVerificationStatus, type SparklineIntervalName, type SpotConfig, type SpotFeeDiscount, type SpotFeeRate, type SpotFeeRateBreakdown, type SpotPairVolumeSeries, type SpotVolumeHistoryInput, type SpotVolumeHistoryResponse, type StablecoinConversionRate, StaleQuoteError, type StartVerificationInput, type StartVerificationResponse, StepUpRequiredError, type StopDetailsOutput, type StopLossInput, type Subaccount, type SubaccountActivityInput, type SubaccountChallenge, SubaccountChallengeInvalidError, type SubaccountEvent, type SubaccountIdInput, type SubaccountInvite, type SubaccountInviteStatus, type SubaccountMember, type SubaccountPermission, type SubaccountPermissionDefinition, type SubaccountPolicy, type SubaccountPolicyApplyInput, type SubaccountPolicyCreateInput, type SubaccountPolicyUpdateInput, type SubaccountRole, type SubaccountRoleCatalog, type SubaccountRoleDefinition, type SubaccountScopedInput, type SubaccountStatus, type SubscribeHandlers, type SubscribeZippedAssetSupplyInput, type TakeProfitInput, type Timeframe, TimeoutError, TimestampSkewError, type Trade, type TradeBackfill, type TradingRateLimitClass, type TradingRateLimitRule, type TradingRateLimits, type TradingWithdrawSigningConfig, type TradingWithdrawWalletSigner, type TrailingDetailsOutput, type TrailingStopInput, type TransferCodeValue, type TransferCounterparties, type TransferCounterparty, type TransferDestination, type TransferDestinations, type TransferSideKind, TransientError, type Transports, type Trigger, type TriggerDetailsOutput, type TriggerEvent, type TwapDetailsOutput, type UnifiedAssetBalancesResponse, type UnlinkSocialAccountInput, type UpdateAddressBookEntryInput, type UpdateAddressBookTagInput, type UpdateMfaFactorInput, type UpdateMfaFactorResult, type UpdateProfileInput, type UpdateSubaccountInput, type UpdateSubaccountMemberRoleInput, UserOperationAlreadyKnownError, UserOperationNotExecutedError, UserOperationSendTimeoutError, type UsernameHistoryEntry, type ValidateWithdrawDestinationInput, type ValidateWithdrawDestinationResult, ValidationError, type VerificationReadyResponse, type VerifyRecoveryCodeChallengeInput, type VerifyTotpChallengeInput, type VipMetricQuality, type VipMetricStatus, type VipStatus, type VipTier, type VipTierCatalog, type WalletChallenge, WithdrawDeadlineExpiredError, type WithdrawWhitelistView, type ZippedAssetSupplyBatch, type ZippedAssetSupplyGroupResponse, type ZippedAssetSupplyResponse, type ZippedAssetSupplySeries, type ZippedAssetSupplyUpdate, type ZipperAssetChainVariant, type ZipperAssetConfig, type ZipperChainConfig, type ZipperChainContractConfig, type ZipperMemoRequirement, checksumEvmAddress, columnarTimestampSecAt, compareUnsignedIntegerStrings, connectErrorToPolyesterError, createCookieAuthTokenStorage, createErrorMappingInterceptor, createMemoryAuthTokenStorage, createPolyesterEnvironment, createPolyesterServerClientFromCookies, createPolyesterServerClientFromRequest, createPolyesterServerCoreFromCookies, createPolyesterServerCoreFromRequest, errorFromHttpStatus, evmHexToBytes, evmUtf8ToBytes, evmUtf8ToHex, expandColumnarTimestampsSec, formatConnectError, formatLedgerBalance, formatUserFacingError, isAbortError, isEvmAddress, isEvmAddressStrict, isFreshStepUpRequiredError, isMfaEnrollmentRequiredError, isMfaLastFactorRequiredError, isPolicyInUseError, isPolicyLockedError, isPolicyScopeMismatchError, isResourceNotFoundError, isRetryableError, isRevisionConflictError, isSessionElevationRequiredError, isTimeoutAbortError, keccak256Hex, loadErrorDetailDecoders, mergeLedgerBalances, normalizeErrorMessage, resolveAuthCookieName, shouldApplyReconciliationUpdate, tsObjToNsString as timestampToNanoseconds, toPolyesterError, validateCreateAddressBookEntryInput };
@@ -6,6 +6,15 @@ const API_KEY_STATUS_VALUES = [
6
6
  "disabled"
7
7
  ];
8
8
  const API_KEY_UPDATE_STATUS_VALUES = ["active", "disabled"];
9
+ /**
10
+ * `assistant` keys belong to the Polyester AI assistant: their policy can never move value out
11
+ * of the account. They are listed, updated and revoked like any key.
12
+ */
13
+ const ApiKeyPurposeCodec = { protoToOutput: {
14
+ [0]: "unspecified",
15
+ [1]: "standard",
16
+ [2]: "assistant"
17
+ } };
9
18
  const ApiKeyStatusCodec = {
10
19
  inputToProto: {
11
20
  active: 1,
@@ -19,6 +28,6 @@ const ApiKeyStatusCodec = {
19
28
  }
20
29
  };
21
30
  //#endregion
22
- export { API_KEY_STATUS_VALUES, API_KEY_UPDATE_STATUS_VALUES, ApiKeyStatusCodec };
31
+ export { API_KEY_STATUS_VALUES, API_KEY_UPDATE_STATUS_VALUES, ApiKeyPurposeCodec, ApiKeyStatusCodec };
23
32
 
24
33
  //# sourceMappingURL=api-keys.codecs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-keys.codecs.js","names":[],"sources":["../../../src/services/api-keys/api-keys.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/auth/v1/api_keys_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const API_KEY_STATUS_VALUES = [\"active\", \"revoked\", \"disabled\"] as const;\nexport type ApiKeyStatusLabel = (typeof API_KEY_STATUS_VALUES)[number];\nexport const API_KEY_UPDATE_STATUS_VALUES = [\"active\", \"disabled\"] as const;\nexport type ApiKeyUpdateStatusLabel = (typeof API_KEY_UPDATE_STATUS_VALUES)[number];\n\nexport const ApiKeyStatusCodec = {\n inputToProto: {\n active: Proto.ApiKeyStatus.ACTIVE,\n disabled: Proto.ApiKeyStatus.DISABLED,\n } satisfies InputToProto<ApiKeyUpdateStatusLabel, Proto.ApiKeyStatus>,\n protoToOutput: {\n [Proto.ApiKeyStatus.API_KEY_STATUS_UNSPECIFIED]: \"unspecified\",\n [Proto.ApiKeyStatus.ACTIVE]: \"active\",\n [Proto.ApiKeyStatus.REVOKED]: \"revoked\",\n [Proto.ApiKeyStatus.DISABLED]: \"disabled\",\n } satisfies ProtoToOutput<Proto.ApiKeyStatus, ApiKeyStatusLabel>,\n} as const;\n"],"mappings":";;AAGA,MAAa,wBAAwB;CAAC;CAAU;CAAW;AAAU;AAErE,MAAa,+BAA+B,CAAC,UAAU,UAAU;AAGjE,MAAa,oBAAoB;CAC7B,cAAc;EACV,QAAA;EACA,UAAA;CACJ;CACA,eAAe;GACsC,IAAA;GACpB,IAAA;GACC,IAAA;GACC,IAAA;CACnC;AACJ"}
1
+ {"version":3,"file":"api-keys.codecs.js","names":[],"sources":["../../../src/services/api-keys/api-keys.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/auth/v1/api_keys_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const API_KEY_STATUS_VALUES = [\"active\", \"revoked\", \"disabled\"] as const;\nexport type ApiKeyStatusLabel = (typeof API_KEY_STATUS_VALUES)[number];\nexport const API_KEY_UPDATE_STATUS_VALUES = [\"active\", \"disabled\"] as const;\nexport type ApiKeyUpdateStatusLabel = (typeof API_KEY_UPDATE_STATUS_VALUES)[number];\nexport const API_KEY_PURPOSE_VALUES = [\"standard\", \"assistant\"] as const;\nexport type ApiKeyPurposeLabel = (typeof API_KEY_PURPOSE_VALUES)[number];\n\n/**\n * `assistant` keys belong to the Polyester AI assistant: their policy can never move value out\n * of the account. They are listed, updated and revoked like any key.\n */\nexport const ApiKeyPurposeCodec = {\n protoToOutput: {\n [Proto.ApiKeyPurpose.PURPOSE_UNSPECIFIED]: \"unspecified\",\n [Proto.ApiKeyPurpose.STANDARD]: \"standard\",\n [Proto.ApiKeyPurpose.ASSISTANT]: \"assistant\",\n } satisfies ProtoToOutput<Proto.ApiKeyPurpose, ApiKeyPurposeLabel>,\n} as const;\n\nexport const ApiKeyStatusCodec = {\n inputToProto: {\n active: Proto.ApiKeyStatus.ACTIVE,\n disabled: Proto.ApiKeyStatus.DISABLED,\n } satisfies InputToProto<ApiKeyUpdateStatusLabel, Proto.ApiKeyStatus>,\n protoToOutput: {\n [Proto.ApiKeyStatus.API_KEY_STATUS_UNSPECIFIED]: \"unspecified\",\n [Proto.ApiKeyStatus.ACTIVE]: \"active\",\n [Proto.ApiKeyStatus.REVOKED]: \"revoked\",\n [Proto.ApiKeyStatus.DISABLED]: \"disabled\",\n } satisfies ProtoToOutput<Proto.ApiKeyStatus, ApiKeyStatusLabel>,\n} as const;\n"],"mappings":";;AAGA,MAAa,wBAAwB;CAAC;CAAU;CAAW;AAAU;AAErE,MAAa,+BAA+B,CAAC,UAAU,UAAU;;;;;AASjE,MAAa,qBAAqB,EAC9B,eAAe;EACgC,IAAA;EACX,IAAA;EACC,IAAA;AACrC,EACJ;AAEA,MAAa,oBAAoB;CAC7B,cAAc;EACV,QAAA;EACA,UAAA;CACJ;CACA,eAAe;GACsC,IAAA;GACpB,IAAA;GACC,IAAA;GACC,IAAA;CACnC;AACJ"}
@@ -134,6 +134,8 @@ declare const ApiKeySchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
134
134
  nanos: number;
135
135
  } | undefined, string | undefined>]>;
136
136
  readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "active" | "disabled" | "revoked">]>;
137
+ /** `"standard"`, `"assistant"`, or `"unspecified"` from older servers. */
138
+ readonly purpose: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "standard" | "assistant">]>, 0>;
137
139
  readonly createdByActor: v.StringSchema<undefined>;
138
140
  readonly revision: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
139
141
  }, undefined>, v.TransformAction<{
@@ -153,6 +155,7 @@ declare const ApiKeySchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
153
155
  publicKeyEd25519: Uint8Array<ArrayBufferLike>;
154
156
  expiresAt?: string | undefined;
155
157
  status: "unspecified" | "active" | "disabled" | "revoked";
158
+ purpose: "unspecified" | "standard" | "assistant";
156
159
  createdByActor: string;
157
160
  revision: string;
158
161
  }, {
@@ -171,6 +174,7 @@ declare const ApiKeySchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
171
174
  publicKeyEd25519: Uint8Array<ArrayBufferLike>;
172
175
  expiresAt?: string | undefined;
173
176
  status: "unspecified" | "active" | "disabled" | "revoked";
177
+ purpose: "unspecified" | "standard" | "assistant";
174
178
  createdByActor: string;
175
179
  revision: string;
176
180
  }>]>;
@@ -1 +1 @@
1
- {"version":3,"file":"api-keys.schemas.d.ts","names":[],"sources":["../../../src/services/api-keys/api-keys.schemas.ts"],"mappings":";;cAyBM,oBAAkB,EAAA;KAGZ,eAAe,EAAE,mBAAmB;cAEnC,wBAAsB,EAAA,yBAAA,EAAA;;;;;;;;;;;KASvB,mBAAmB,EAAE,kBAAkB;cAEtC,qBAAmB,EAAA;;;KAIpB,gBAAgB,EAAE,kBAAkB;cAEnC,0BAAwB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAezB,qBAAqB,EAAE,kBAAkB;cAgCxC,0BAAwB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqCzB,qBAAqB,EAAE,kBAAkB;cAExC,cAAY,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqCb,SAAS,EAAE,mBAAmB"}
1
+ {"version":3,"file":"api-keys.schemas.d.ts","names":[],"sources":["../../../src/services/api-keys/api-keys.schemas.ts"],"mappings":";;cA0BM,oBAAkB,EAAA;KAGZ,eAAe,EAAE,mBAAmB;cAEnC,wBAAsB,EAAA,yBAAA,EAAA;;;;;;;;;;;KASvB,mBAAmB,EAAE,kBAAkB;cAEtC,qBAAmB,EAAA;;;KAIpB,gBAAgB,EAAE,kBAAkB;cAEnC,0BAAwB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAezB,qBAAqB,EAAE,kBAAkB;cAgCxC,0BAAwB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqCzB,qBAAqB,EAAE,kBAAkB;cAExC,cAAY,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAuCb,SAAS,EAAE,mBAAmB"}
@@ -4,7 +4,7 @@ import { enumLabelSchema } from "../../shared/proto-enum-codec.js";
4
4
  import { AccountScopeInputEntries, accountScopeToSubaccountId } from "../../shared/account-scope.js";
5
5
  import { buildProtoPatch, defineProtoPatchFields } from "../../utils/proto-patch.js";
6
6
  import { msToTimestamp } from "../../utils/timestamp.js";
7
- import { API_KEY_STATUS_VALUES, API_KEY_UPDATE_STATUS_VALUES, ApiKeyStatusCodec } from "./api-keys.codecs.js";
7
+ import { API_KEY_STATUS_VALUES, API_KEY_UPDATE_STATUS_VALUES, ApiKeyPurposeCodec, ApiKeyStatusCodec } from "./api-keys.codecs.js";
8
8
  import { bytesToHex } from "@noble/hashes/utils.js";
9
9
  import * as v from "valibot";
10
10
  //#region src/services/api-keys/api-keys.schemas.ts
@@ -87,6 +87,8 @@ const ApiKeySchema = v.pipe(v.object({
87
87
  return ms ? new Date(ms).toISOString() : void 0;
88
88
  })),
89
89
  status: enumLabelSchema(ApiKeyStatusCodec.protoToOutput),
90
+ /** `"standard"`, `"assistant"`, or `"unspecified"` from older servers. */
91
+ purpose: v.optional(enumLabelSchema(ApiKeyPurposeCodec.protoToOutput), 0),
90
92
  createdByActor: v.string(),
91
93
  revision: BigIntStringSchema
92
94
  }), v.transform(({ subaccountId, updatedAt, ...rest }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"api-keys.schemas.js","names":[],"sources":["../../../src/services/api-keys/api-keys.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport { msToTimestamp } from \"../../utils/timestamp.js\";\nimport { tsObjToMs, tsObjToNsString } from \"../../utils/time.js\";\nimport {\n OptionalPublicIdSchema,\n PublicIdOrEmptySchema,\n OptionalTimestampMsSchema,\n BigIntStringSchema,\n TimestampMsSchema,\n TimestampSchema,\n positiveBigintStringInputSchema,\n} from \"../../shared/schemas.js\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n} from \"../../shared/account-scope.js\";\nimport { enumLabelSchema } from \"../../shared/proto-enum-codec.js\";\nimport { bytesToHex } from \"@noble/hashes/utils.js\";\nimport {\n API_KEY_STATUS_VALUES,\n API_KEY_UPDATE_STATUS_VALUES,\n ApiKeyStatusCodec,\n} from \"./api-keys.codecs.js\";\nimport { buildProtoPatch, defineProtoPatchFields } from \"../../utils/proto-patch.js\";\n\nconst ApiKeyStatusSchema = v.picklist(API_KEY_STATUS_VALUES);\nconst ApiKeyUpdateStatusSchema = v.picklist(API_KEY_UPDATE_STATUS_VALUES);\n\nexport type ApiKeyStatus = v.InferOutput<typeof ApiKeyStatusSchema>;\n\nexport const ApiKeysListInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n }),\n v.transform(({ account }) => ({\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type ApiKeysListInput = v.InferInput<typeof ApiKeysListInputSchema>;\n\nexport const ApiKeyIdInputSchema = v.strictObject({\n keyId: v.pipe(v.string(), v.trim(), v.minLength(1, \"keyId is required\")),\n});\n\nexport type ApiKeyIdInput = v.InferInput<typeof ApiKeyIdInputSchema>;\n\nexport const ApiKeysCreateInputSchema = v.pipe(\n v.strictObject({\n label: v.string(),\n icon: v.optional(v.string(), \"\"),\n color: v.optional(v.string(), \"\"),\n ...AccountScopeInputEntries,\n ipWhitelist: v.optional(v.array(v.string()), []),\n publicKeyEd25519: v.instance(Uint8Array<ArrayBufferLike>),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type ApiKeysCreateInput = v.InferInput<typeof ApiKeysCreateInputSchema>;\n\ntype ApiKeyPatch = {\n label?: string;\n icon?: string;\n color?: string;\n status?: v.InferOutput<typeof ApiKeyUpdateStatusSchema>;\n ipWhitelist?: string[];\n expiresAtIso?: string | null;\n};\n\nconst API_KEY_PATCH_FIELDS = defineProtoPatchFields<ApiKeyPatch>()({\n label: { path: \"label\", encode: (label) => ({ label }) },\n icon: { path: \"icon\", encode: (icon) => ({ icon }) },\n color: { path: \"color\", encode: (color) => ({ color }) },\n status: {\n path: \"status\",\n encode: (status) => ({ status: ApiKeyStatusCodec.inputToProto[status] }),\n },\n ipWhitelist: {\n path: \"ip_whitelist\",\n encode: (ipWhitelist) => ({ ipWhitelist }),\n },\n expiresAtIso: {\n path: \"expires_at\",\n encode: (expiresAtIso) => {\n if (expiresAtIso === null) return {};\n return { expiresAt: msToTimestamp(new Date(expiresAtIso).getTime()) };\n },\n },\n});\n\nexport const ApiKeysUpdateInputSchema = v.pipe(\n v.strictObject({\n keyId: v.pipe(v.string(), v.trim(), v.minLength(1, \"keyId is required\")),\n expectedRevision: positiveBigintStringInputSchema(\"expectedRevision\"),\n label: v.optional(v.string()),\n icon: v.optional(v.string()),\n color: v.optional(v.string()),\n status: v.optional(ApiKeyUpdateStatusSchema),\n ipWhitelist: v.optional(v.array(v.string())),\n expiresAtIso: v.optional(\n v.nullable(\n v.pipe(\n v.string(),\n v.check(\n (value) => Number.isFinite(Date.parse(value)),\n \"expiresAtIso must be a valid timestamp\",\n ),\n ),\n ),\n ),\n }),\n v.check(\n ({ label, icon, color, status, ipWhitelist, expiresAtIso }) =>\n label !== undefined ||\n icon !== undefined ||\n color !== undefined ||\n status !== undefined ||\n ipWhitelist !== undefined ||\n expiresAtIso !== undefined,\n \"At least one API key field must be provided\",\n ),\n v.transform(({ keyId, expectedRevision, ...input }) => {\n const { patch: apiKey, updateMask } = buildProtoPatch(input, API_KEY_PATCH_FIELDS);\n return { keyId, apiKey, updateMask, expectedRevision };\n }),\n);\n\nexport type ApiKeysUpdateInput = v.InferInput<typeof ApiKeysUpdateInputSchema>;\n\nexport const ApiKeySchema = v.pipe(\n v.object({\n keyId: v.string(),\n label: v.optional(v.string(), \"\"),\n icon: v.optional(v.string(), \"\"),\n color: v.optional(v.string(), \"\"),\n ipWhitelist: v.optional(v.array(v.string()), []),\n subaccountId: OptionalPublicIdSchema,\n // Unset decodes to \"\", matching DEFAULT_API_KEY_POLICY.id.\n policyId: v.optional(PublicIdOrEmptySchema, 0n),\n createdAt: TimestampMsSchema,\n updatedAt: v.optional(TimestampSchema),\n lastUsedAt: OptionalTimestampMsSchema,\n publicKeyEd25519: v.instance(Uint8Array<ArrayBufferLike>),\n expiresAt: v.pipe(\n v.optional(TimestampSchema),\n v.transform((v) => {\n const ms = tsObjToMs(v);\n return ms ? new Date(ms).toISOString() : undefined;\n }),\n ),\n status: enumLabelSchema(ApiKeyStatusCodec.protoToOutput),\n createdByActor: v.string(),\n revision: BigIntStringSchema,\n }),\n v.transform(({ subaccountId, updatedAt, ...rest }) => {\n const hex = bytesToHex(rest.publicKeyEd25519);\n return {\n ...rest,\n subaccountId,\n updatedAt: tsObjToMs(updatedAt),\n updatedAtNs: tsObjToNsString(updatedAt),\n publicKeyHex: hex,\n };\n }),\n);\n\nexport type ApiKey = v.InferOutput<typeof ApiKeySchema>;\n\nexport const ApiKeysSchema = v.array(ApiKeySchema);\n"],"mappings":";;;;;;;;;;AAyB2B,EAAE,SAAS,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AAc;CAEd,UAAU,EAAE,SAAS,uBAAuB,EAAE;CAC9C,WAAW;CACX,WAAW,EAAE,SAAS,eAAe;CACrC,YAAY;CACZ,kBAAkB,EAAE,SAAS,UAA2B;CACxD,WAAW,EAAE,KACT,EAAE,SAAS,eAAe,GAC1B,EAAE,WAAW,MAAM;EACf,MAAM,KAAK,UAAU,CAAC;EACtB,OAAO,KAAK,IAAI,KAAK,EAAE,CAAC,CAAC,YAAY,IAAI,KAAA;CAC7C,CAAC,CACL;CACA,QAAQ,gBAAgB,kBAAkB,aAAa;CACvD,gBAAgB,EAAE,OAAO;CACzB,UAAU;AACd,CAAC,GACD,EAAE,WAAW,EAAE,cAAc,WAAW,GAAG,WAAW;CAClD,MAAM,MAAM,WAAW,KAAK,gBAAgB;CAC5C,OAAO;EACH,GAAG;EACH;EACA,WAAW,UAAU,SAAS;EAC9B,aAAa,gBAAgB,SAAS;EACtC,cAAc;CAClB;AACJ,CAAC,CACL;AAIA,MAAa,gBAAgB,EAAE,MAAM,YAAY"}
1
+ {"version":3,"file":"api-keys.schemas.js","names":[],"sources":["../../../src/services/api-keys/api-keys.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport { msToTimestamp } from \"../../utils/timestamp.js\";\nimport { tsObjToMs, tsObjToNsString } from \"../../utils/time.js\";\nimport {\n OptionalPublicIdSchema,\n PublicIdOrEmptySchema,\n OptionalTimestampMsSchema,\n BigIntStringSchema,\n TimestampMsSchema,\n TimestampSchema,\n positiveBigintStringInputSchema,\n} from \"../../shared/schemas.js\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n} from \"../../shared/account-scope.js\";\nimport { enumLabelSchema } from \"../../shared/proto-enum-codec.js\";\nimport { bytesToHex } from \"@noble/hashes/utils.js\";\nimport {\n API_KEY_STATUS_VALUES,\n API_KEY_UPDATE_STATUS_VALUES,\n ApiKeyPurposeCodec,\n ApiKeyStatusCodec,\n} from \"./api-keys.codecs.js\";\nimport { buildProtoPatch, defineProtoPatchFields } from \"../../utils/proto-patch.js\";\n\nconst ApiKeyStatusSchema = v.picklist(API_KEY_STATUS_VALUES);\nconst ApiKeyUpdateStatusSchema = v.picklist(API_KEY_UPDATE_STATUS_VALUES);\n\nexport type ApiKeyStatus = v.InferOutput<typeof ApiKeyStatusSchema>;\n\nexport const ApiKeysListInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n }),\n v.transform(({ account }) => ({\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type ApiKeysListInput = v.InferInput<typeof ApiKeysListInputSchema>;\n\nexport const ApiKeyIdInputSchema = v.strictObject({\n keyId: v.pipe(v.string(), v.trim(), v.minLength(1, \"keyId is required\")),\n});\n\nexport type ApiKeyIdInput = v.InferInput<typeof ApiKeyIdInputSchema>;\n\nexport const ApiKeysCreateInputSchema = v.pipe(\n v.strictObject({\n label: v.string(),\n icon: v.optional(v.string(), \"\"),\n color: v.optional(v.string(), \"\"),\n ...AccountScopeInputEntries,\n ipWhitelist: v.optional(v.array(v.string()), []),\n publicKeyEd25519: v.instance(Uint8Array<ArrayBufferLike>),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type ApiKeysCreateInput = v.InferInput<typeof ApiKeysCreateInputSchema>;\n\ntype ApiKeyPatch = {\n label?: string;\n icon?: string;\n color?: string;\n status?: v.InferOutput<typeof ApiKeyUpdateStatusSchema>;\n ipWhitelist?: string[];\n expiresAtIso?: string | null;\n};\n\nconst API_KEY_PATCH_FIELDS = defineProtoPatchFields<ApiKeyPatch>()({\n label: { path: \"label\", encode: (label) => ({ label }) },\n icon: { path: \"icon\", encode: (icon) => ({ icon }) },\n color: { path: \"color\", encode: (color) => ({ color }) },\n status: {\n path: \"status\",\n encode: (status) => ({ status: ApiKeyStatusCodec.inputToProto[status] }),\n },\n ipWhitelist: {\n path: \"ip_whitelist\",\n encode: (ipWhitelist) => ({ ipWhitelist }),\n },\n expiresAtIso: {\n path: \"expires_at\",\n encode: (expiresAtIso) => {\n if (expiresAtIso === null) return {};\n return { expiresAt: msToTimestamp(new Date(expiresAtIso).getTime()) };\n },\n },\n});\n\nexport const ApiKeysUpdateInputSchema = v.pipe(\n v.strictObject({\n keyId: v.pipe(v.string(), v.trim(), v.minLength(1, \"keyId is required\")),\n expectedRevision: positiveBigintStringInputSchema(\"expectedRevision\"),\n label: v.optional(v.string()),\n icon: v.optional(v.string()),\n color: v.optional(v.string()),\n status: v.optional(ApiKeyUpdateStatusSchema),\n ipWhitelist: v.optional(v.array(v.string())),\n expiresAtIso: v.optional(\n v.nullable(\n v.pipe(\n v.string(),\n v.check(\n (value) => Number.isFinite(Date.parse(value)),\n \"expiresAtIso must be a valid timestamp\",\n ),\n ),\n ),\n ),\n }),\n v.check(\n ({ label, icon, color, status, ipWhitelist, expiresAtIso }) =>\n label !== undefined ||\n icon !== undefined ||\n color !== undefined ||\n status !== undefined ||\n ipWhitelist !== undefined ||\n expiresAtIso !== undefined,\n \"At least one API key field must be provided\",\n ),\n v.transform(({ keyId, expectedRevision, ...input }) => {\n const { patch: apiKey, updateMask } = buildProtoPatch(input, API_KEY_PATCH_FIELDS);\n return { keyId, apiKey, updateMask, expectedRevision };\n }),\n);\n\nexport type ApiKeysUpdateInput = v.InferInput<typeof ApiKeysUpdateInputSchema>;\n\nexport const ApiKeySchema = v.pipe(\n v.object({\n keyId: v.string(),\n label: v.optional(v.string(), \"\"),\n icon: v.optional(v.string(), \"\"),\n color: v.optional(v.string(), \"\"),\n ipWhitelist: v.optional(v.array(v.string()), []),\n subaccountId: OptionalPublicIdSchema,\n // Unset decodes to \"\", matching DEFAULT_API_KEY_POLICY.id.\n policyId: v.optional(PublicIdOrEmptySchema, 0n),\n createdAt: TimestampMsSchema,\n updatedAt: v.optional(TimestampSchema),\n lastUsedAt: OptionalTimestampMsSchema,\n publicKeyEd25519: v.instance(Uint8Array<ArrayBufferLike>),\n expiresAt: v.pipe(\n v.optional(TimestampSchema),\n v.transform((v) => {\n const ms = tsObjToMs(v);\n return ms ? new Date(ms).toISOString() : undefined;\n }),\n ),\n status: enumLabelSchema(ApiKeyStatusCodec.protoToOutput),\n /** `\"standard\"`, `\"assistant\"`, or `\"unspecified\"` from older servers. */\n purpose: v.optional(enumLabelSchema(ApiKeyPurposeCodec.protoToOutput), 0),\n createdByActor: v.string(),\n revision: BigIntStringSchema,\n }),\n v.transform(({ subaccountId, updatedAt, ...rest }) => {\n const hex = bytesToHex(rest.publicKeyEd25519);\n return {\n ...rest,\n subaccountId,\n updatedAt: tsObjToMs(updatedAt),\n updatedAtNs: tsObjToNsString(updatedAt),\n publicKeyHex: hex,\n };\n }),\n);\n\nexport type ApiKey = v.InferOutput<typeof ApiKeySchema>;\n\nexport const ApiKeysSchema = v.array(ApiKeySchema);\n"],"mappings":";;;;;;;;;;AA0B2B,EAAE,SAAS,qBAAqB;AAC3D,MAAM,2BAA2B,EAAE,SAAS,4BAA4B;AAIxE,MAAa,yBAAyB,EAAE,KACpC,EAAE,aAAa,EACX,GAAG,yBACP,CAAC,GACD,EAAE,WAAW,EAAE,eAAe,EAC1B,cAAc,2BAA2B,OAAO,EACpD,EAAE,CACN;AAIA,MAAa,sBAAsB,EAAE,aAAa,EAC9C,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,GAAG,EAAE,UAAU,GAAG,mBAAmB,CAAC,EAC3E,CAAC;AAID,MAAa,2BAA2B,EAAE,KACtC,EAAE,aAAa;CACX,OAAO,EAAE,OAAO;CAChB,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,EAAE;CAC/B,OAAO,EAAE,SAAS,EAAE,OAAO,GAAG,EAAE;CAChC,GAAG;CACH,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;CAC/C,kBAAkB,EAAE,SAAS,UAA2B;AAC5D,CAAC,GACD,EAAE,WAAW,EAAE,SAAS,GAAG,aAAa;CACpC,GAAG;C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,MAAM,YAAY"}
@@ -8,12 +8,19 @@ declare const AUTO_WITHDRAW_RUN_STATE_VALUES: readonly ["planned", "paying", "co
8
8
  type AutoWithdrawRunState = (typeof AUTO_WITHDRAW_RUN_STATE_VALUES)[number];
9
9
  declare const AUTO_WITHDRAW_STEP_STATE_VALUES: readonly ["pending", "submitting", "submitted", "completed", "failed", "skipped"];
10
10
  type AutoWithdrawStepState = (typeof AUTO_WITHDRAW_STEP_STATE_VALUES)[number];
11
+ declare const AUTO_WITHDRAW_PREVIEW_STATUS_VALUES: readonly ["will_pay", "rolls_over", "no_destination", "paused", "no_rule"];
12
+ type AutoWithdrawPreviewStatus = (typeof AUTO_WITHDRAW_PREVIEW_STATUS_VALUES)[number];
11
13
  /** Why a rule paused itself. Unknown future reasons pass through as strings. */
12
14
  type AutoWithdrawPauseReason = "destination_not_whitelisted" | "destination_invalid" | "authority_revoked" | (string & {});
13
15
  /** Why a run was skipped. Unknown future reasons pass through as strings. */
14
16
  type AutoWithdrawRunReason = "nothing_to_pay" | "price_unavailable" | "rule_superseded" | (string & {});
15
17
  /** Why a step was skipped or failed. Unknown future reasons pass through as strings. */
16
- type AutoWithdrawStepReason = "below_minimum" | "price_unavailable" | "rule_superseded" | "destination_not_whitelisted" | "authority_revoked" | "gateway_capacity_insufficient" | "withdrawal_released" | "withdrawal_failed" | (string & {});
18
+ type AutoWithdrawStepReason = "below_minimum" | "price_unavailable" | "rule_superseded" | "destination_not_whitelisted" | "destination_cooling_down" | "authority_revoked" | "gateway_capacity_insufficient" | "withdrawal_released" | "withdrawal_failed" | (string & {});
19
+ /**
20
+ * Why part or all of an asset's balance would stay on the account in a previewed run. Unknown
21
+ * future reasons pass through as strings.
22
+ */
23
+ type AutoWithdrawHoldReason = "below_minimum" | "price_unavailable" | "no_destination" | "destination_cooling_down" | "above_max" | "dust" | (string & {});
17
24
  //#endregion
18
- export { AUTO_WITHDRAW_CADENCE_VALUES, AUTO_WITHDRAW_RUN_STATE_VALUES, AUTO_WITHDRAW_STEP_STATE_VALUES, AUTO_WITHDRAW_WEEKDAY_VALUES, AutoWithdrawCadence, AutoWithdrawPauseReason, AutoWithdrawRunReason, AutoWithdrawRunState, AutoWithdrawStepReason, AutoWithdrawStepState, AutoWithdrawWeekday };
25
+ export { AUTO_WITHDRAW_CADENCE_VALUES, AUTO_WITHDRAW_PREVIEW_STATUS_VALUES, AUTO_WITHDRAW_RUN_STATE_VALUES, AUTO_WITHDRAW_STEP_STATE_VALUES, AUTO_WITHDRAW_WEEKDAY_VALUES, AutoWithdrawCadence, AutoWithdrawHoldReason, AutoWithdrawPauseReason, AutoWithdrawPreviewStatus, AutoWithdrawRunReason, AutoWithdrawRunState, AutoWithdrawStepReason, AutoWithdrawStepState, AutoWithdrawWeekday };
19
26
  //# sourceMappingURL=auto-withdraw.codecs.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"auto-withdraw.codecs.d.ts","names":[],"sources":["../../../src/services/auto-withdraw/auto-withdraw.codecs.ts"],"mappings":";;cAGa;KAOD,8BAA8B;cAE7B;KASD,8BAA8B;cAE7B;KAQD,+BAA+B;cAE9B;KAQD,gCAAgC;;KA2DhC;;KAOA;;KAOA"}
1
+ {"version":3,"file":"auto-withdraw.codecs.d.ts","names":[],"sources":["../../../src/services/auto-withdraw/auto-withdraw.codecs.ts"],"mappings":";;cAGa;KAOD,8BAA8B;cAE7B;KASD,8BAA8B;cAE7B;KAQD,+BAA+B;cAE9B;KAQD,gCAAgC;cAE/B;KAOD,oCAAoC;;KAsEpC;;KAOA;;KAOA;;;;;KAgBA"}
@@ -55,7 +55,15 @@ const AutoWithdrawStepStateCodec = { protoToOutput: {
55
55
  [5]: "failed",
56
56
  [6]: "skipped"
57
57
  } };
58
+ const AutoWithdrawPreviewStatusCodec = { protoToOutput: {
59
+ [0]: "unspecified",
60
+ [1]: "will_pay",
61
+ [2]: "rolls_over",
62
+ [3]: "no_destination",
63
+ [4]: "paused",
64
+ [5]: "no_rule"
65
+ } };
58
66
  //#endregion
59
- export { AUTO_WITHDRAW_WEEKDAY_VALUES, AutoWithdrawCadenceCodec, AutoWithdrawRunStateCodec, AutoWithdrawStepStateCodec, AutoWithdrawWeekdayCodec };
67
+ export { AUTO_WITHDRAW_WEEKDAY_VALUES, AutoWithdrawCadenceCodec, AutoWithdrawPreviewStatusCodec, AutoWithdrawRunStateCodec, AutoWithdrawStepStateCodec, AutoWithdrawWeekdayCodec };
60
68
 
61
69
  //# sourceMappingURL=auto-withdraw.codecs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"auto-withdraw.codecs.js","names":[],"sources":["../../../src/services/auto-withdraw/auto-withdraw.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/chain/withdraw/v1/auto_withdraw_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const AUTO_WITHDRAW_CADENCE_VALUES = [\n \"hourly\",\n \"daily\",\n \"weekly\",\n \"biweekly\",\n \"monthly\",\n] as const;\nexport type AutoWithdrawCadence = (typeof AUTO_WITHDRAW_CADENCE_VALUES)[number];\n\nexport const AUTO_WITHDRAW_WEEKDAY_VALUES = [\n \"monday\",\n \"tuesday\",\n \"wednesday\",\n \"thursday\",\n \"friday\",\n \"saturday\",\n \"sunday\",\n] as const;\nexport type AutoWithdrawWeekday = (typeof AUTO_WITHDRAW_WEEKDAY_VALUES)[number];\n\nexport const AUTO_WITHDRAW_RUN_STATE_VALUES = [\n \"planned\",\n \"paying\",\n \"completed\",\n \"partially_failed\",\n \"failed\",\n \"skipped\",\n] as const;\nexport type AutoWithdrawRunState = (typeof AUTO_WITHDRAW_RUN_STATE_VALUES)[number];\n\nexport const AUTO_WITHDRAW_STEP_STATE_VALUES = [\n \"pending\",\n \"submitting\",\n \"submitted\",\n \"completed\",\n \"failed\",\n \"skipped\",\n] as const;\nexport type AutoWithdrawStepState = (typeof AUTO_WITHDRAW_STEP_STATE_VALUES)[number];\n\nexport const AutoWithdrawCadenceCodec = {\n inputToProto: {\n hourly: Proto.AutoWithdrawCadence.HOURLY,\n daily: Proto.AutoWithdrawCadence.DAILY,\n weekly: Proto.AutoWithdrawCadence.WEEKLY,\n biweekly: Proto.AutoWithdrawCadence.BIWEEKLY,\n monthly: Proto.AutoWithdrawCadence.MONTHLY,\n } satisfies InputToProto<AutoWithdrawCadence, Proto.AutoWithdrawCadence>,\n} as const;\n\nexport const AutoWithdrawWeekdayCodec = {\n inputToProto: {\n monday: Proto.AutoWithdrawWeekday.MONDAY,\n tuesday: Proto.AutoWithdrawWeekday.TUESDAY,\n wednesday: Proto.AutoWithdrawWeekday.WEDNESDAY,\n thursday: Proto.AutoWithdrawWeekday.THURSDAY,\n friday: Proto.AutoWithdrawWeekday.FRIDAY,\n saturday: Proto.AutoWithdrawWeekday.SATURDAY,\n sunday: Proto.AutoWithdrawWeekday.SUNDAY,\n } satisfies InputToProto<AutoWithdrawWeekday, Proto.AutoWithdrawWeekday>,\n protoToOutput: {\n [Proto.AutoWithdrawWeekday.WEEKDAY_UNSPECIFIED]: \"unspecified\",\n [Proto.AutoWithdrawWeekday.MONDAY]: \"monday\",\n [Proto.AutoWithdrawWeekday.TUESDAY]: \"tuesday\",\n [Proto.AutoWithdrawWeekday.WEDNESDAY]: \"wednesday\",\n [Proto.AutoWithdrawWeekday.THURSDAY]: \"thursday\",\n [Proto.AutoWithdrawWeekday.FRIDAY]: \"friday\",\n [Proto.AutoWithdrawWeekday.SATURDAY]: \"saturday\",\n [Proto.AutoWithdrawWeekday.SUNDAY]: \"sunday\",\n } satisfies ProtoToOutput<Proto.AutoWithdrawWeekday, AutoWithdrawWeekday>,\n} as const;\n\nexport const AutoWithdrawRunStateCodec = {\n protoToOutput: {\n [Proto.AutoWithdrawRunState.RUN_STATE_UNSPECIFIED]: \"unspecified\",\n [Proto.AutoWithdrawRunState.RUN_PLANNED]: \"planned\",\n [Proto.AutoWithdrawRunState.RUN_PAYING]: \"paying\",\n [Proto.AutoWithdrawRunState.RUN_COMPLETED]: \"completed\",\n [Proto.AutoWithdrawRunState.RUN_PARTIALLY_FAILED]: \"partially_failed\",\n [Proto.AutoWithdrawRunState.RUN_FAILED]: \"failed\",\n [Proto.AutoWithdrawRunState.RUN_SKIPPED]: \"skipped\",\n } satisfies ProtoToOutput<Proto.AutoWithdrawRunState, AutoWithdrawRunState>,\n} as const;\n\nexport const AutoWithdrawStepStateCodec = {\n protoToOutput: {\n [Proto.AutoWithdrawStepState.STEP_STATE_UNSPECIFIED]: \"unspecified\",\n [Proto.AutoWithdrawStepState.STEP_PENDING]: \"pending\",\n [Proto.AutoWithdrawStepState.STEP_SUBMITTING]: \"submitting\",\n [Proto.AutoWithdrawStepState.STEP_SUBMITTED]: \"submitted\",\n [Proto.AutoWithdrawStepState.STEP_COMPLETED]: \"completed\",\n [Proto.AutoWithdrawStepState.STEP_FAILED]: \"failed\",\n [Proto.AutoWithdrawStepState.STEP_SKIPPED]: \"skipped\",\n } satisfies ProtoToOutput<Proto.AutoWithdrawStepState, AutoWithdrawStepState>,\n} as const;\n\n/** Why a rule paused itself. Unknown future reasons pass through as strings. */\nexport type AutoWithdrawPauseReason =\n | \"destination_not_whitelisted\"\n | \"destination_invalid\"\n | \"authority_revoked\"\n | (string & {});\n\n/** Why a run was skipped. Unknown future reasons pass through as strings. */\nexport type AutoWithdrawRunReason =\n | \"nothing_to_pay\"\n | \"price_unavailable\"\n | \"rule_superseded\"\n | (string & {});\n\n/** Why a step was skipped or failed. Unknown future reasons pass through as strings. */\nexport type AutoWithdrawStepReason =\n | \"below_minimum\"\n | \"price_unavailable\"\n | \"rule_superseded\"\n | \"destination_not_whitelisted\"\n | \"authority_revoked\"\n | \"gateway_capacity_insufficient\"\n | \"withdrawal_released\"\n | \"withdrawal_failed\"\n | (string & {});\n"],"mappings":";;AAYA,MAAa,+BAA+B;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;AAuBA,MAAa,2BAA2B,EACpC,cAAc;CACV,QAAA;CACA,OAAA;CACA,QAAA;CACA,UAAA;CACA,SAAA;AACJ,EACJ;AAEA,MAAa,2BAA2B;CACpC,cAAc;EACV,QAAA;EACA,SAAA;EACA,WAAA;EACA,UAAA;EACA,QAAA;EACA,UAAA;EACA,QAAA;CACJ;CACA,eAAe;GACsC,IAAA;GACb,IAAA;GACC,IAAA;GACE,IAAA;GACD,IAAA;GACF,IAAA;GACE,IAAA;GACF,IAAA;CACxC;AACJ;AAEA,MAAa,4BAA4B,EACrC,eAAe;EACyC,IAAA;EACV,IAAA;EACD,IAAA;EACG,IAAA;EACO,IAAA;EACV,IAAA;EACC,IAAA;AAC9C,EACJ;AAEA,MAAa,6BAA6B,EACtC,eAAe;EAC2C,IAAA;EACV,IAAA;EACG,IAAA;EACD,IAAA;EACA,IAAA;EACH,IAAA;EACC,IAAA;AAChD,EACJ"}
1
+ {"version":3,"file":"auto-withdraw.codecs.js","names":[],"sources":["../../../src/services/auto-withdraw/auto-withdraw.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/chain/withdraw/v1/auto_withdraw_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const AUTO_WITHDRAW_CADENCE_VALUES = [\n \"hourly\",\n \"daily\",\n \"weekly\",\n \"biweekly\",\n \"monthly\",\n] as const;\nexport type AutoWithdrawCadence = (typeof AUTO_WITHDRAW_CADENCE_VALUES)[number];\n\nexport const AUTO_WITHDRAW_WEEKDAY_VALUES = [\n \"monday\",\n \"tuesday\",\n \"wednesday\",\n \"thursday\",\n \"friday\",\n \"saturday\",\n \"sunday\",\n] as const;\nexport type AutoWithdrawWeekday = (typeof AUTO_WITHDRAW_WEEKDAY_VALUES)[number];\n\nexport const AUTO_WITHDRAW_RUN_STATE_VALUES = [\n \"planned\",\n \"paying\",\n \"completed\",\n \"partially_failed\",\n \"failed\",\n \"skipped\",\n] as const;\nexport type AutoWithdrawRunState = (typeof AUTO_WITHDRAW_RUN_STATE_VALUES)[number];\n\nexport const AUTO_WITHDRAW_STEP_STATE_VALUES = [\n \"pending\",\n \"submitting\",\n \"submitted\",\n \"completed\",\n \"failed\",\n \"skipped\",\n] as const;\nexport type AutoWithdrawStepState = (typeof AUTO_WITHDRAW_STEP_STATE_VALUES)[number];\n\nexport const AUTO_WITHDRAW_PREVIEW_STATUS_VALUES = [\n \"will_pay\",\n \"rolls_over\",\n \"no_destination\",\n \"paused\",\n \"no_rule\",\n] as const;\nexport type AutoWithdrawPreviewStatus = (typeof AUTO_WITHDRAW_PREVIEW_STATUS_VALUES)[number];\n\nexport const AutoWithdrawCadenceCodec = {\n inputToProto: {\n hourly: Proto.AutoWithdrawCadence.HOURLY,\n daily: Proto.AutoWithdrawCadence.DAILY,\n weekly: Proto.AutoWithdrawCadence.WEEKLY,\n biweekly: Proto.AutoWithdrawCadence.BIWEEKLY,\n monthly: Proto.AutoWithdrawCadence.MONTHLY,\n } satisfies InputToProto<AutoWithdrawCadence, Proto.AutoWithdrawCadence>,\n} as const;\n\nexport const AutoWithdrawWeekdayCodec = {\n inputToProto: {\n monday: Proto.AutoWithdrawWeekday.MONDAY,\n tuesday: Proto.AutoWithdrawWeekday.TUESDAY,\n wednesday: Proto.AutoWithdrawWeekday.WEDNESDAY,\n thursday: Proto.AutoWithdrawWeekday.THURSDAY,\n friday: Proto.AutoWithdrawWeekday.FRIDAY,\n saturday: Proto.AutoWithdrawWeekday.SATURDAY,\n sunday: Proto.AutoWithdrawWeekday.SUNDAY,\n } satisfies InputToProto<AutoWithdrawWeekday, Proto.AutoWithdrawWeekday>,\n protoToOutput: {\n [Proto.AutoWithdrawWeekday.WEEKDAY_UNSPECIFIED]: \"unspecified\",\n [Proto.AutoWithdrawWeekday.MONDAY]: \"monday\",\n [Proto.AutoWithdrawWeekday.TUESDAY]: \"tuesday\",\n [Proto.AutoWithdrawWeekday.WEDNESDAY]: \"wednesday\",\n [Proto.AutoWithdrawWeekday.THURSDAY]: \"thursday\",\n [Proto.AutoWithdrawWeekday.FRIDAY]: \"friday\",\n [Proto.AutoWithdrawWeekday.SATURDAY]: \"saturday\",\n [Proto.AutoWithdrawWeekday.SUNDAY]: \"sunday\",\n } satisfies ProtoToOutput<Proto.AutoWithdrawWeekday, AutoWithdrawWeekday>,\n} as const;\n\nexport const AutoWithdrawRunStateCodec = {\n protoToOutput: {\n [Proto.AutoWithdrawRunState.RUN_STATE_UNSPECIFIED]: \"unspecified\",\n [Proto.AutoWithdrawRunState.RUN_PLANNED]: \"planned\",\n [Proto.AutoWithdrawRunState.RUN_PAYING]: \"paying\",\n [Proto.AutoWithdrawRunState.RUN_COMPLETED]: \"completed\",\n [Proto.AutoWithdrawRunState.RUN_PARTIALLY_FAILED]: \"partially_failed\",\n [Proto.AutoWithdrawRunState.RUN_FAILED]: \"failed\",\n [Proto.AutoWithdrawRunState.RUN_SKIPPED]: \"skipped\",\n } satisfies ProtoToOutput<Proto.AutoWithdrawRunState, AutoWithdrawRunState>,\n} as const;\n\nexport const AutoWithdrawStepStateCodec = {\n protoToOutput: {\n [Proto.AutoWithdrawStepState.STEP_STATE_UNSPECIFIED]: \"unspecified\",\n [Proto.AutoWithdrawStepState.STEP_PENDING]: \"pending\",\n [Proto.AutoWithdrawStepState.STEP_SUBMITTING]: \"submitting\",\n [Proto.AutoWithdrawStepState.STEP_SUBMITTED]: \"submitted\",\n [Proto.AutoWithdrawStepState.STEP_COMPLETED]: \"completed\",\n [Proto.AutoWithdrawStepState.STEP_FAILED]: \"failed\",\n [Proto.AutoWithdrawStepState.STEP_SKIPPED]: \"skipped\",\n } satisfies ProtoToOutput<Proto.AutoWithdrawStepState, AutoWithdrawStepState>,\n} as const;\n\nexport const AutoWithdrawPreviewStatusCodec = {\n protoToOutput: {\n [Proto.AutoWithdrawPreviewStatus.PREVIEW_STATUS_UNSPECIFIED]: \"unspecified\",\n [Proto.AutoWithdrawPreviewStatus.WILL_PAY]: \"will_pay\",\n [Proto.AutoWithdrawPreviewStatus.ROLLS_OVER]: \"rolls_over\",\n [Proto.AutoWithdrawPreviewStatus.NO_DESTINATION]: \"no_destination\",\n [Proto.AutoWithdrawPreviewStatus.PAUSED]: \"paused\",\n [Proto.AutoWithdrawPreviewStatus.NO_RULE]: \"no_rule\",\n } satisfies ProtoToOutput<Proto.AutoWithdrawPreviewStatus, AutoWithdrawPreviewStatus>,\n} as const;\n\n/** Why a rule paused itself. Unknown future reasons pass through as strings. */\nexport type AutoWithdrawPauseReason =\n | \"destination_not_whitelisted\"\n | \"destination_invalid\"\n | \"authority_revoked\"\n | (string & {});\n\n/** Why a run was skipped. Unknown future reasons pass through as strings. */\nexport type AutoWithdrawRunReason =\n | \"nothing_to_pay\"\n | \"price_unavailable\"\n | \"rule_superseded\"\n | (string & {});\n\n/** Why a step was skipped or failed. Unknown future reasons pass through as strings. */\nexport type AutoWithdrawStepReason =\n | \"below_minimum\"\n | \"price_unavailable\"\n | \"rule_superseded\"\n | \"destination_not_whitelisted\"\n | \"destination_cooling_down\"\n | \"authority_revoked\"\n | \"gateway_capacity_insufficient\"\n | \"withdrawal_released\"\n | \"withdrawal_failed\"\n | (string & {});\n\n/**\n * Why part or all of an asset's balance would stay on the account in a previewed run. Unknown\n * future reasons pass through as strings.\n */\nexport type AutoWithdrawHoldReason =\n | \"below_minimum\"\n | \"price_unavailable\"\n | \"no_destination\"\n | \"destination_cooling_down\"\n | \"above_max\"\n | \"dust\"\n | (string & {});\n"],"mappings":";;AAYA,MAAa,+BAA+B;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;AAgCA,MAAa,2BAA2B,EACpC,cAAc;CACV,QAAA;CACA,OAAA;CACA,QAAA;CACA,UAAA;CACA,SAAA;AACJ,EACJ;AAEA,MAAa,2BAA2B;CACpC,cAAc;EACV,QAAA;EACA,SAAA;EACA,WAAA;EACA,UAAA;EACA,QAAA;EACA,UAAA;EACA,QAAA;CACJ;CACA,eAAe;GACsC,IAAA;GACb,IAAA;GACC,IAAA;GACE,IAAA;GACD,IAAA;GACF,IAAA;GACE,IAAA;GACF,IAAA;CACxC;AACJ;AAEA,MAAa,4BAA4B,EACrC,eAAe;EACyC,IAAA;EACV,IAAA;EACD,IAAA;EACG,IAAA;EACO,IAAA;EACV,IAAA;EACC,IAAA;AAC9C,EACJ;AAEA,MAAa,6BAA6B,EACtC,eAAe;EAC2C,IAAA;EACV,IAAA;EACG,IAAA;EACD,IAAA;EACA,IAAA;EACH,IAAA;EACC,IAAA;AAChD,EACJ;AAEA,MAAa,iCAAiC,EAC1C,eAAe;EACmD,IAAA;EAClB,IAAA;EACE,IAAA;EACI,IAAA;EACR,IAAA;EACC,IAAA;AAC/C,EACJ"}
@@ -1,7 +1,7 @@
1
1
  import { AuthApiTransports } from "../../shared/transports.js";
2
2
  import { PolyesterMutationOptions, PolyesterRequestOptions } from "../../shared/request-options.js";
3
3
  import { SubaccountResolver } from "../subaccount-resolver.js";
4
- import { AutoWithdrawRule, AutoWithdrawScopedInput, DisableAutoWithdrawRuleInput, ListAutoWithdrawRunsInput, ListAutoWithdrawRunsResult, SetAutoWithdrawRuleInput } from "./auto-withdraw.schemas.js";
4
+ import { AutoWithdrawPreview, AutoWithdrawRule, AutoWithdrawScopedInput, ListAutoWithdrawRunsInput, ListAutoWithdrawRunsResult, SetAutoWithdrawRuleEnabledInput, SetAutoWithdrawRuleInput } from "./auto-withdraw.schemas.js";
5
5
  //#region src/services/auto-withdraw/auto-withdraw.d.ts
6
6
  /**
7
7
  * Manages the scheduled auto-withdraw rule of the root account or a subaccount: each asset's
@@ -24,10 +24,21 @@ declare class AutoWithdrawService {
24
24
  */
25
25
  setRule(input: SetAutoWithdrawRuleInput, options?: PolyesterMutationOptions): Promise<AutoWithdrawRule>;
26
26
  /**
27
- * Disables the account's rule and returns the disabled version, which has no destinations.
28
- * A stale `expectedVersion` throws `RevisionConflictError`. Requires a fresh `stepUpToken`.
27
+ * Pauses (`enabled: false`) or resumes (`enabled: true`) the account's rule, keeping its
28
+ * schedule and destinations, and returns the latest version: a new one, or the current one
29
+ * unchanged when the rule is already in that state. Each change creates a version, so pass
30
+ * the latest `version` as `expectedVersion`; a stale one throws `RevisionConflictError`.
31
+ * Pausing needs no step-up. Resuming needs a fresh `stepUpToken`, checks every destination
32
+ * again like `setRule`, and clears a pause the rule set itself; a refused destination
33
+ * leaves the rule paused.
29
34
  */
30
- disableRule(input: DisableAutoWithdrawRuleInput, options?: PolyesterMutationOptions): Promise<AutoWithdrawRule>;
35
+ setRuleEnabled(input: SetAutoWithdrawRuleEnabledInput, options?: PolyesterMutationOptions): Promise<AutoWithdrawRule>;
36
+ /**
37
+ * Previews what the account's next run would pay, using the same planning as the run and
38
+ * the balances, prices and fees now. Readable by API keys with `read-auto-withdraw`. With a
39
+ * USD minimum, a failed price read throws a retryable error.
40
+ */
41
+ previewRun(input?: AutoWithdrawScopedInput, options?: PolyesterRequestOptions): Promise<AutoWithdrawPreview>;
31
42
  /**
32
43
  * Lists the account's runs with their payouts, newest first. Pass the previous
33
44
  * `nextPageToken` as `pageToken` to continue; an empty `nextPageToken` means no more runs.
@@ -1 +1 @@
1
- {"version":3,"file":"auto-withdraw.d.ts","names":[],"sources":["../../../src/services/auto-withdraw/auto-withdraw.ts"],"mappings":";;;;;;;;;;;;;;cA6Da;;EAIG,YAAA,YAAY,mBAAmB,WAAW;;EAMhD,QACF,QAAO,yBACP,UAAU,0BACX,QAAQ;;;;;;EAcL,QACF,OAAO,0BACP,UAAU,2BACX,QAAQ;;;;;EAYL,YACF,OAAO,8BACP,UAAU,2BACX,QAAQ;;;;;EAYL,SACF,QAAO,2BACP,UAAU,0BACX,QAAQ;UASH"}
1
+ {"version":3,"file":"auto-withdraw.d.ts","names":[],"sources":["../../../src/services/auto-withdraw/auto-withdraw.ts"],"mappings":";;;;;;;;;;;;;;cAiEa;;EAIG,YAAA,YAAY,mBAAmB,WAAW;;EAMhD,QACF,QAAO,yBACP,UAAU,0BACX,QAAQ;;;;;;EAcL,QACF,OAAO,0BACP,UAAU,2BACX,QAAQ;;;;;;;;;;EAiBL,eACF,OAAO,iCACP,UAAU,2BACX,QAAQ;;;;;;EAaL,WACF,QAAO,yBACP,UAAU,0BACX,QAAQ;;;;;EAaL,SACF,QAAO,2BACP,UAAU,0BACX,QAAQ;UASH"}
@@ -5,17 +5,18 @@ import { removeUndefined } from "../../utils/remove-undefined.js";
5
5
  import { toConnectCallOptions } from "../../shared/request-options.js";
6
6
  import { resolveAccountScopedInput } from "../subaccount-resolver.js";
7
7
  import { AutoWithdrawService as AutoWithdrawService$1 } from "../../gen/chain/withdraw/v1/auto_withdraw_pb.js";
8
- import { AutoWithdrawRuleSchema, AutoWithdrawScopedInputSchema, DisableAutoWithdrawRuleInputSchema, ListAutoWithdrawRunsInputSchema, ListAutoWithdrawRunsResultSchema, SetAutoWithdrawRuleInputSchema } from "./auto-withdraw.schemas.js";
8
+ import { AutoWithdrawPreviewSchema, AutoWithdrawRuleSchema, AutoWithdrawScopedInputSchema, ListAutoWithdrawRunsInputSchema, ListAutoWithdrawRunsResultSchema, SetAutoWithdrawRuleEnabledInputSchema, SetAutoWithdrawRuleInputSchema } from "./auto-withdraw.schemas.js";
9
9
  import { Code, ConnectError, createClient } from "@connectrpc/connect";
10
10
  //#region src/services/auto-withdraw/auto-withdraw.ts
11
11
  /**
12
- * A stale `expectedVersion` comes back as the withdraw `CONFLICT` detail, or as a bare
12
+ * A stale `expectedVersion` comes back as the withdraw `VERSION_CONFLICT` detail (older
13
+ * servers send `CONFLICT`), or as a bare
13
14
  * `Aborted`, which the transport would otherwise surface as a retryable `TransientError`.
14
15
  * Either one becomes a `RevisionConflictError`: refetch the rule, don't retry blindly.
15
16
  */
16
17
  function rethrowVersionConflict(err) {
17
18
  const mapped = toPolyesterError(err);
18
- if (mapped instanceof PolyesterError && !(mapped instanceof RevisionConflictError) && (mapped.detail?.service === "withdraw" && mapped.detail.code === "CONFLICT" || mapped.cause instanceof ConnectError && mapped.cause.code === Code.Aborted && mapped.cause.details.length === 0)) throw new RevisionConflictError(mapped.message || "Auto-withdraw rule changed since it was last read.", {
19
+ if (mapped instanceof PolyesterError && !(mapped instanceof RevisionConflictError) && (mapped.detail?.service === "withdraw" && (mapped.detail.code === "VERSION_CONFLICT" || mapped.detail.code === "CONFLICT") || mapped.cause instanceof ConnectError && mapped.cause.code === Code.Aborted && mapped.cause.details.length === 0)) throw new RevisionConflictError(mapped.message || "Auto-withdraw rule changed since it was last read.", {
19
20
  cause: mapped.cause,
20
21
  detail: mapped.detail,
21
22
  status: mapped.status
@@ -55,15 +56,30 @@ var AutoWithdrawService = class {
55
56
  return parse(AutoWithdrawRuleSchema, response.rule);
56
57
  }
57
58
  /**
58
- * Disables the account's rule and returns the disabled version, which has no destinations.
59
- * A stale `expectedVersion` throws `RevisionConflictError`. Requires a fresh `stepUpToken`.
59
+ * Pauses (`enabled: false`) or resumes (`enabled: true`) the account's rule, keeping its
60
+ * schedule and destinations, and returns the latest version: a new one, or the current one
61
+ * unchanged when the rule is already in that state. Each change creates a version, so pass
62
+ * the latest `version` as `expectedVersion`; a stale one throws `RevisionConflictError`.
63
+ * Pausing needs no step-up. Resuming needs a fresh `stepUpToken`, checks every destination
64
+ * again like `setRule`, and clears a pause the rule set itself; a refused destination
65
+ * leaves the rule paused.
60
66
  */
61
- async disableRule(input, options) {
62
- const request = parse(DisableAutoWithdrawRuleInputSchema, this.resolveInput(input));
63
- const response = await this.#client.disableAutoWithdrawRule(removeUndefined(request), toConnectCallOptions(options)).catch(rethrowVersionConflict);
67
+ async setRuleEnabled(input, options) {
68
+ const request = parse(SetAutoWithdrawRuleEnabledInputSchema, this.resolveInput(input));
69
+ const response = await this.#client.setAutoWithdrawRuleEnabled(removeUndefined(request), toConnectCallOptions(options)).catch(rethrowVersionConflict);
64
70
  return parse(AutoWithdrawRuleSchema, response.rule);
65
71
  }
66
72
  /**
73
+ * Previews what the account's next run would pay, using the same planning as the run and
74
+ * the balances, prices and fees now. Readable by API keys with `read-auto-withdraw`. With a
75
+ * USD minimum, a failed price read throws a retryable error.
76
+ */
77
+ async previewRun(input = {}, options) {
78
+ const request = parse(AutoWithdrawScopedInputSchema, this.resolveInput(input));
79
+ const response = await this.#client.previewAutoWithdrawRun(removeUndefined(request), toConnectCallOptions(options));
80
+ return parse(AutoWithdrawPreviewSchema, response);
81
+ }
82
+ /**
67
83
  * Lists the account's runs with their payouts, newest first. Pass the previous
68
84
  * `nextPageToken` as `pageToken` to continue; an empty `nextPageToken` means no more runs.
69
85
  */
@@ -1 +1 @@
1
- {"version":3,"file":"auto-withdraw.js","names":["#client","Proto.AutoWithdrawService","#resolver"],"sources":["../../../src/services/auto-withdraw/auto-withdraw.ts"],"sourcesContent":["import { Code, ConnectError, createClient, type Client } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/chain/withdraw/v1/auto_withdraw_pb.js\";\nimport type { AccountScopedInput } from \"../../shared/account-scope.js\";\nimport { toPolyesterError } from \"../../shared/connect-error-mapping.js\";\nimport { PolyesterError, RevisionConflictError } from \"../../shared/errors.js\";\nimport {\n toConnectCallOptions,\n type PolyesterMutationOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport type { AuthApiTransports } from \"../../shared/transports.js\";\nimport { parse } from \"../../shared/validation.js\";\nimport { removeUndefined } from \"../../utils/remove-undefined.js\";\nimport { type SubaccountResolver, resolveAccountScopedInput } from \"../subaccount-resolver.js\";\nimport {\n AutoWithdrawRuleSchema,\n AutoWithdrawScopedInputSchema,\n DisableAutoWithdrawRuleInputSchema,\n ListAutoWithdrawRunsInputSchema,\n ListAutoWithdrawRunsResultSchema,\n SetAutoWithdrawRuleInputSchema,\n type AutoWithdrawRule,\n type AutoWithdrawScopedInput,\n type DisableAutoWithdrawRuleInput,\n type ListAutoWithdrawRunsInput,\n type ListAutoWithdrawRunsResult,\n type SetAutoWithdrawRuleInput,\n} from \"./auto-withdraw.schemas.js\";\n\n/**\n * A stale `expectedVersion` comes back as the withdraw `CONFLICT` detail, or as a bare\n * `Aborted`, which the transport would otherwise surface as a retryable `TransientError`.\n * Either one becomes a `RevisionConflictError`: refetch the rule, don't retry blindly.\n */\nfunction rethrowVersionConflict(err: unknown): never {\n const mapped = toPolyesterError(err);\n if (\n mapped instanceof PolyesterError &&\n !(mapped instanceof RevisionConflictError) &&\n ((mapped.detail?.service === \"withdraw\" && mapped.detail.code === \"CONFLICT\") ||\n (mapped.cause instanceof ConnectError &&\n mapped.cause.code === Code.Aborted &&\n mapped.cause.details.length === 0))\n ) {\n throw new RevisionConflictError(\n mapped.message || \"Auto-withdraw rule changed since it was last read.\",\n { cause: mapped.cause, detail: mapped.detail, status: mapped.status },\n );\n }\n throw mapped;\n}\n\n/**\n * Manages the scheduled auto-withdraw rule of the root account or a subaccount: each asset's\n * balance is paid in kind on an hourly, daily, weekly, biweekly or monthly UTC slot to\n * destinations on the account's external withdraw whitelist. API keys can read rules and runs;\n * changing a rule needs a session login with withdraw rights and a fresh single-use step-up\n * token (`stepUpToken`). A missing step-up throws `StepUpRequiredError` or\n * `SessionElevationRequiredError`; check `isFreshStepUpRequiredError` before retrying with a new\n * token.\n */\nexport class AutoWithdrawService {\n #client: Client<typeof Proto.AutoWithdrawService>;\n #resolver?: SubaccountResolver;\n\n constructor(transports: AuthApiTransports, resolver?: SubaccountResolver) {\n this.#client = createClient(Proto.AutoWithdrawService, transports.authApi);\n this.#resolver = resolver;\n }\n\n /** Returns the account's latest rule version, or null when the account never had a rule. */\n async getRule(\n input: AutoWithdrawScopedInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<AutoWithdrawRule | null> {\n const request = parse(AutoWithdrawScopedInputSchema, this.resolveInput(input));\n const response = await this.#client.getAutoWithdrawRule(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return response.rule ? parse(AutoWithdrawRuleSchema, response.rule) : null;\n }\n\n /**\n * Creates the account's rule, or replaces its latest version, and returns the new version.\n * `expectedVersion` is 0 when the account has no rule yet, otherwise its latest version; a\n * stale version throws `RevisionConflictError`. Requires a fresh `stepUpToken`.\n */\n async setRule(\n input: SetAutoWithdrawRuleInput,\n options?: PolyesterMutationOptions,\n ): Promise<AutoWithdrawRule> {\n const request = parse(SetAutoWithdrawRuleInputSchema, this.resolveInput(input));\n const response = await this.#client\n .setAutoWithdrawRule(removeUndefined(request), toConnectCallOptions(options))\n .catch(rethrowVersionConflict);\n return parse(AutoWithdrawRuleSchema, response.rule);\n }\n\n /**\n * Disables the account's rule and returns the disabled version, which has no destinations.\n * A stale `expectedVersion` throws `RevisionConflictError`. Requires a fresh `stepUpToken`.\n */\n async disableRule(\n input: DisableAutoWithdrawRuleInput,\n options?: PolyesterMutationOptions,\n ): Promise<AutoWithdrawRule> {\n const request = parse(DisableAutoWithdrawRuleInputSchema, this.resolveInput(input));\n const response = await this.#client\n .disableAutoWithdrawRule(removeUndefined(request), toConnectCallOptions(options))\n .catch(rethrowVersionConflict);\n return parse(AutoWithdrawRuleSchema, response.rule);\n }\n\n /**\n * Lists the account's runs with their payouts, newest first. Pass the previous\n * `nextPageToken` as `pageToken` to continue; an empty `nextPageToken` means no more runs.\n */\n async listRuns(\n input: ListAutoWithdrawRunsInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<ListAutoWithdrawRunsResult> {\n const request = parse(ListAutoWithdrawRunsInputSchema, this.resolveInput(input));\n const response = await this.#client.listAutoWithdrawRuns(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(ListAutoWithdrawRunsResultSchema, response);\n }\n\n private resolveInput<TInput extends AccountScopedInput>(input: TInput): TInput {\n return resolveAccountScopedInput(input, this.#resolver);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkCA,SAAS,uBAAuB,KAAqB;CACjD,MAAM,SAAS,iBAAiB,GAAG;CACnC,IACI,kBAAkB,kBAClB,EAAE,kBAAkB,2BAClB,OAAO,QAAQ,YAAY,cAAc,OAAO,OAAO,SAAS,cAC7D,OAAO,iBAAiB,gBACrB,OAAO,MAAM,SAAS,KAAK,WAC3B,OAAO,MAAM,QAAQ,WAAW,IAExC,MAAM,IAAI,sBACN,OAAO,WAAW,sDAClB;EAAE,OAAO,OAA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0BAA0B,OAAO,KAAKE,SAAS;CAC1D;AACJ"}
1
+ {"version":3,"file":"auto-withdraw.js","names":["#client","Proto.AutoWithdrawService","#resolver"],"sources":["../../../src/services/auto-withdraw/auto-withdraw.ts"],"sourcesContent":["import { Code, ConnectError, createClient, type Client } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/chain/withdraw/v1/auto_withdraw_pb.js\";\nimport type { AccountScopedInput } from \"../../shared/account-scope.js\";\nimport { toPolyesterError } from \"../../shared/connect-error-mapping.js\";\nimport { PolyesterError, RevisionConflictError } from \"../../shared/errors.js\";\nimport {\n toConnectCallOptions,\n type PolyesterMutationOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport type { AuthApiTransports } from \"../../shared/transports.js\";\nimport { parse } from \"../../shared/validation.js\";\nimport { removeUndefined } from \"../../utils/remove-undefined.js\";\nimport { type SubaccountResolver, resolveAccountScopedInput } from \"../subaccount-resolver.js\";\nimport {\n AutoWithdrawPreviewSchema,\n AutoWithdrawRuleSchema,\n AutoWithdrawScopedInputSchema,\n ListAutoWithdrawRunsInputSchema,\n ListAutoWithdrawRunsResultSchema,\n SetAutoWithdrawRuleEnabledInputSchema,\n SetAutoWithdrawRuleInputSchema,\n type AutoWithdrawPreview,\n type AutoWithdrawRule,\n type AutoWithdrawScopedInput,\n type ListAutoWithdrawRunsInput,\n type ListAutoWithdrawRunsResult,\n type SetAutoWithdrawRuleEnabledInput,\n type SetAutoWithdrawRuleInput,\n} from \"./auto-withdraw.schemas.js\";\n\n/**\n * A stale `expectedVersion` comes back as the withdraw `VERSION_CONFLICT` detail (older\n * servers send `CONFLICT`), or as a bare\n * `Aborted`, which the transport would otherwise surface as a retryable `TransientError`.\n * Either one becomes a `RevisionConflictError`: refetch the rule, don't retry blindly.\n */\nfunction rethrowVersionConflict(err: unknown): never {\n const mapped = toPolyesterError(err);\n if (\n mapped instanceof PolyesterError &&\n !(mapped instanceof RevisionConflictError) &&\n ((mapped.detail?.service === \"withdraw\" &&\n (mapped.detail.code === \"VERSION_CONFLICT\" || mapped.detail.code === \"CONFLICT\")) ||\n (mapped.cause instanceof ConnectError &&\n mapped.cause.code === Code.Aborted &&\n mapped.cause.details.length === 0))\n ) {\n throw new RevisionConflictError(\n mapped.message || \"Auto-withdraw rule changed since it was last read.\",\n { cause: mapped.cause, detail: mapped.detail, status: mapped.status },\n );\n }\n throw mapped;\n}\n\n/**\n * Manages the scheduled auto-withdraw rule of the root account or a subaccount: each asset's\n * balance is paid in kind on an hourly, daily, weekly, biweekly or monthly UTC slot to\n * destinations on the account's external withdraw whitelist. API keys can read rules and runs;\n * changing a rule needs a session login with withdraw rights and a fresh single-use step-up\n * token (`stepUpToken`). A missing step-up throws `StepUpRequiredError` or\n * `SessionElevationRequiredError`; check `isFreshStepUpRequiredError` before retrying with a new\n * token.\n */\nexport class AutoWithdrawService {\n #client: Client<typeof Proto.AutoWithdrawService>;\n #resolver?: SubaccountResolver;\n\n constructor(transports: AuthApiTransports, resolver?: SubaccountResolver) {\n this.#client = createClient(Proto.AutoWithdrawService, transports.authApi);\n this.#resolver = resolver;\n }\n\n /** Returns the account's latest rule version, or null when the account never had a rule. */\n async getRule(\n input: AutoWithdrawScopedInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<AutoWithdrawRule | null> {\n const request = parse(AutoWithdrawScopedInputSchema, this.resolveInput(input));\n const response = await this.#client.getAutoWithdrawRule(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return response.rule ? parse(AutoWithdrawRuleSchema, response.rule) : null;\n }\n\n /**\n * Creates the account's rule, or replaces its latest version, and returns the new version.\n * `expectedVersion` is 0 when the account has no rule yet, otherwise its latest version; a\n * stale version throws `RevisionConflictError`. Requires a fresh `stepUpToken`.\n */\n async setRule(\n input: SetAutoWithdrawRuleInput,\n options?: PolyesterMutationOptions,\n ): Promise<AutoWithdrawRule> {\n const request = parse(SetAutoWithdrawRuleInputSchema, this.resolveInput(input));\n const response = await this.#client\n .setAutoWithdrawRule(removeUndefined(request), toConnectCallOptions(options))\n .catch(rethrowVersionConflict);\n return parse(AutoWithdrawRuleSchema, response.rule);\n }\n\n /**\n * Pauses (`enabled: false`) or resumes (`enabled: true`) the account's rule, keeping its\n * schedule and destinations, and returns the latest version: a new one, or the current one\n * unchanged when the rule is already in that state. Each change creates a version, so pass\n * the latest `version` as `expectedVersion`; a stale one throws `RevisionConflictError`.\n * Pausing needs no step-up. Resuming needs a fresh `stepUpToken`, checks every destination\n * again like `setRule`, and clears a pause the rule set itself; a refused destination\n * leaves the rule paused.\n */\n async setRuleEnabled(\n input: SetAutoWithdrawRuleEnabledInput,\n options?: PolyesterMutationOptions,\n ): Promise<AutoWithdrawRule> {\n const request = parse(SetAutoWithdrawRuleEnabledInputSchema, this.resolveInput(input));\n const response = await this.#client\n .setAutoWithdrawRuleEnabled(removeUndefined(request), toConnectCallOptions(options))\n .catch(rethrowVersionConflict);\n return parse(AutoWithdrawRuleSchema, response.rule);\n }\n\n /**\n * Previews what the account's next run would pay, using the same planning as the run and\n * the balances, prices and fees now. Readable by API keys with `read-auto-withdraw`. With a\n * USD minimum, a failed price read throws a retryable error.\n */\n async previewRun(\n input: AutoWithdrawScopedInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<AutoWithdrawPreview> {\n const request = parse(AutoWithdrawScopedInputSchema, this.resolveInput(input));\n const response = await this.#client.previewAutoWithdrawRun(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(AutoWithdrawPreviewSchema, response);\n }\n\n /**\n * Lists the account's runs with their payouts, newest first. Pass the previous\n * `nextPageToken` as `pageToken` to continue; an empty `nextPageToken` means no more runs.\n */\n async listRuns(\n input: ListAutoWithdrawRunsInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<ListAutoWithdrawRunsResult> {\n const request = parse(ListAutoWithdrawRunsInputSchema, this.resolveInput(input));\n const response = await this.#client.listAutoWithdrawRuns(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(ListAutoWithdrawRunsResultSchema, response);\n }\n\n private resolveInput<TInput extends AccountScopedInput>(input: TInput): TInput {\n return resolveAccountScopedInput(input, this.#resolver);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAqCA,SAAS,uBAAuB,KAAqB;CACjD,MAAM,SAAS,iBAAiB,GAAG;CACnC,IACI,kBAAkB,kBAClB,EAAE,kBAAkB,2BAClB,OAAO,QAAQ,YAAY,eACxB,OAAO,OAAO,SAAS,sBAAsB,OAAO,OAAO,SAAS,eACpE,OAAO,iBAAiB,gBACrB,OAAO,MAAM,SAAS,KAAK,WAC3B,OAAO,MAAM,QAAQ,WAAW,IAExC,MAAM,IAAI,sBACN,OAAO,WAAW,sDAClB;EAAE,OAAO,OAAO;EAAO,QAAQ,OAAO;EAAQ,QAAQ,OAAO;CAAO,CACxE;CAEJ,MAAM;AACV;;;;;;;;;;AAWA,IAAa,sBAAb,MAAiC;CAC7B;CACA;CAEA,YAAY,YAA+B,UAA+B;EACtE,KAAKA,UAAU,aAAaC,uBAA2B,WAAW,OAAO;EACzE,KAAKC,YAAY;CACrB;;CAGA,MAAM,QACF,QAAiC,CAAC,GAClC,SACgC;EAChC,MAAM,UAAU,MAAM,+BAA+B,KAAK,aAAa,KAAK,CAAC;EAC7E,MAAM,WAAW,MAAM,KAAKF,QAAQ,oBAChC,gBAAgB,OAAO,GACvB,qBAAqB,OAAO,CAChC;EACA,OAAO,SAAS,OAAO,MAAM,wBAAwB,SAAS,IAAI,IAAI;CAC1E;;;;;;CAOA,MAAM,QACF,OACA,SACyB;EACzB,MAAM,UAAU,MAAM,gCAAgC,KAAK,aAAa,KAAK,CAAC;EAC9E,MAAM,WAAW,MAAM,KAAKA,QACvB,oBAAoB,gBAAgB,OAAO,GAAG,qBAAqB,OAAO,CAAC,CAAC,CAC5E,MAAM,sBAAsB;EACjC,OAAO,MAAM,wBAAwB,SAAS,IAAI;CACtD;;;;;;;;;;CAWA,MAAM,eACF,OACA,SACyB;EACzB,MAAM,UAAU,MAAM,u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