@polyester/sdk 0.35.0-devnet-20261108030630 → 0.35.0-devnet-20261108182734
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -1
- package/dist/gen/auth/v1/auth_pb.d.ts +23 -3
- package/dist/gen/auth/v1/auth_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/auth_pb.js +23 -3
- package/dist/gen/auth/v1/auth_pb.js.map +1 -1
- package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.d.ts +64 -5
- package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.d.ts.map +1 -1
- package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.js +42 -5
- package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.js.map +1 -1
- package/dist/gen/orders/v1/orders_pb.d.ts +11 -1
- package/dist/gen/orders/v1/orders_pb.d.ts.map +1 -1
- package/dist/gen/orders/v1/orders_pb.js +11 -1
- package/dist/gen/orders/v1/orders_pb.js.map +1 -1
- package/dist/gen/tradews/v1/trade_ws_pb.d.ts +50 -1
- package/dist/gen/tradews/v1/trade_ws_pb.d.ts.map +1 -1
- package/dist/gen/tradews/v1/trade_ws_pb.js +1 -1
- package/dist/gen/tradews/v1/trade_ws_pb.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/services/address-book/address-book.schemas.d.ts +2 -2
- package/dist/services/checkpoints/checkpoints.schemas.d.ts +2 -2
- package/dist/services/heatmap/heatmap.schemas.d.ts +4 -4
- package/dist/services/lifecycle/lifecycle.codecs.d.ts.map +1 -1
- package/dist/services/lifecycle/lifecycle.codecs.js +13 -1
- package/dist/services/lifecycle/lifecycle.codecs.js.map +1 -1
- package/dist/services/lifecycle/lifecycle.d.ts +5 -0
- package/dist/services/lifecycle/lifecycle.d.ts.map +1 -1
- package/dist/services/lifecycle/lifecycle.js +5 -0
- package/dist/services/lifecycle/lifecycle.js.map +1 -1
- package/dist/services/lifecycle/lifecycle.schemas.d.ts +141 -81
- package/dist/services/lifecycle/lifecycle.schemas.d.ts.map +1 -1
- package/dist/services/lifecycle/lifecycle.schemas.js +18 -3
- package/dist/services/lifecycle/lifecycle.schemas.js.map +1 -1
- package/dist/services/orderbook/orderbook.schemas.d.ts +1 -1
- package/dist/services/orders/order-errors.schemas.d.ts +2 -2
- package/dist/services/orders/orders-batch.schemas.d.ts +52 -52
- package/dist/services/orders/orders-input.schemas.d.ts +6 -6
- package/dist/services/orders/orders-output.schemas.d.ts +11 -11
- package/dist/services/rewards/rewards.schemas.d.ts +3 -3
- package/dist/services/subaccounts/subaccounts.schemas.d.ts +12 -12
- package/dist/services/trades/trades.schemas.d.ts +2 -2
- package/dist/services/triggers/trigger-input.schemas.d.ts +1 -1
- package/dist/services/triggers/triggers-output.schemas.d.ts +15 -15
- package/dist/shared/connect-error-mapping.d.ts.map +1 -1
- package/dist/shared/connect-error-mapping.js +3 -1
- package/dist/shared/connect-error-mapping.js.map +1 -1
- package/dist/shared/errors.d.ts +13 -2
- package/dist/shared/errors.d.ts.map +1 -1
- package/dist/shared/errors.js +14 -1
- package/dist/shared/errors.js.map +1 -1
- package/dist/shared/rate-limit.schemas.d.ts +1 -1
- package/dist/shared/transports.d.ts +10 -2
- package/dist/shared/transports.d.ts.map +1 -1
- package/dist/shared/transports.js +6 -1
- package/dist/shared/transports.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BatchCancelOrdersRequest, BatchCancelOrdersResponse, BatchCreateOrdersRequest, BatchCreateOrdersResponse, BatchReplaceOrdersRequest, BatchReplaceOrdersResponse, CancelAllOrdersRequest, CancelAllOrdersResponse, CancelOrderRequest, CancelOrderResponse, CreateOrderRequest, CreateOrderResponse, ErrorDetail, ModifyOrderRequest, ModifyOrderResponse } from "../../orders/v1/orders_pb.js";
|
|
1
|
+
import { BatchCancelOrdersRequest, BatchCancelOrdersResponse, BatchCreateOrdersRequest, BatchCreateOrdersResponse, BatchReplaceOrdersRequest, BatchReplaceOrdersResponse, CancelAllAfterRequest, CancelAllAfterResponse, CancelAllOrdersRequest, CancelAllOrdersResponse, CancelOrderRequest, CancelOrderResponse, CreateOrderRequest, CreateOrderResponse, ErrorDetail, ModifyOrderRequest, ModifyOrderResponse } from "../../orders/v1/orders_pb.js";
|
|
2
2
|
import { Message } from "@bufbuild/protobuf";
|
|
3
3
|
import { GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
|
|
4
4
|
declare namespace trade_ws_pb_d_exports {
|
|
@@ -27,6 +27,27 @@ type ClientFrame = Message<"tradews.v1.ClientFrame"> & {
|
|
|
27
27
|
* @generated from field: string correlation_id = 2;
|
|
28
28
|
*/
|
|
29
29
|
correlationId: string;
|
|
30
|
+
/**
|
|
31
|
+
* Optional client time the command was sent, in milliseconds since the Unix
|
|
32
|
+
* epoch. When set, the command is processed only until timestamp_ms plus
|
|
33
|
+
* recv_window_ms: a command that arrives, or waits to be sent on for
|
|
34
|
+
* admission, past then is rejected with REQUEST_DEADLINE_EXCEEDED and
|
|
35
|
+
* changes nothing, but it has taken its seq, so the next command uses the
|
|
36
|
+
* next seq. A timestamp more than 10 seconds ahead of the server clock is
|
|
37
|
+
* rejected with BAD_REQUEST, without taking the seq. Zero sets no
|
|
38
|
+
* deadline. Ping ignores it.
|
|
39
|
+
*
|
|
40
|
+
* @generated from field: int64 timestamp_ms = 3;
|
|
41
|
+
*/
|
|
42
|
+
timestampMs: bigint;
|
|
43
|
+
/**
|
|
44
|
+
* Optional receive window in milliseconds, from 1 to 60000, applied to
|
|
45
|
+
* timestamp_ms. Zero uses 10000. Setting it without timestamp_ms is
|
|
46
|
+
* rejected with BAD_REQUEST.
|
|
47
|
+
*
|
|
48
|
+
* @generated from field: uint32 recv_window_ms = 4;
|
|
49
|
+
*/
|
|
50
|
+
recvWindowMs: number;
|
|
30
51
|
/**
|
|
31
52
|
* @generated from oneof tradews.v1.ClientFrame.payload
|
|
32
53
|
*/
|
|
@@ -104,6 +125,25 @@ type ClientFrame = Message<"tradews.v1.ClientFrame"> & {
|
|
|
104
125
|
*/
|
|
105
126
|
value: BatchCancelOrdersRequest;
|
|
106
127
|
case: "batchCancelOrders";
|
|
128
|
+
} | {
|
|
129
|
+
/**
|
|
130
|
+
* Cancel-all-after command using the public Orders API request
|
|
131
|
+
* contract: arms, refreshes or disarms the account's dead-man switch,
|
|
132
|
+
* the same switch as the Orders API's CancelAllAfter, with the same
|
|
133
|
+
* symbol and side scope and the same timeout rule (0 disarms; 10 to 120
|
|
134
|
+
* seconds arms or refreshes). On expiry it cancels the account's open
|
|
135
|
+
* orders in scope, including orders that triggers placed, and no
|
|
136
|
+
* trigger. The switch belongs to the account, not to this connection:
|
|
137
|
+
* closing the connection neither disarms nor fires it. Refresh it well
|
|
138
|
+
* within the timeout, for example every 15 to 30 seconds with a
|
|
139
|
+
* 60-second timeout. Resending a request is safe: an arm restarts the
|
|
140
|
+
* timer from when it applies, and a disarm is idempotent. request_id is
|
|
141
|
+
* required, as on the Orders API; subaccount_id must be omitted.
|
|
142
|
+
*
|
|
143
|
+
* @generated from field: orders.v1.CancelAllAfterRequest cancel_all_after = 18;
|
|
144
|
+
*/
|
|
145
|
+
value: CancelAllAfterRequest;
|
|
146
|
+
case: "cancelAllAfter";
|
|
107
147
|
} | {
|
|
108
148
|
case: undefined;
|
|
109
149
|
value?: undefined;
|
|
@@ -294,6 +334,15 @@ type AckResponse = Message<"tradews.v1.AckResponse"> & {
|
|
|
294
334
|
*/
|
|
295
335
|
value: BatchCancelOrdersResponse;
|
|
296
336
|
case: "batchCancelOrders";
|
|
337
|
+
} | {
|
|
338
|
+
/**
|
|
339
|
+
* Cancel-all-after response: the account's dead-man switch after the
|
|
340
|
+
* request applied, its deadline and its recorded scope.
|
|
341
|
+
*
|
|
342
|
+
* @generated from field: orders.v1.CancelAllAfterResponse cancel_all_after = 8;
|
|
343
|
+
*/
|
|
344
|
+
value: CancelAllAfterResponse;
|
|
345
|
+
case: "cancelAllAfter";
|
|
297
346
|
} | {
|
|
298
347
|
case: undefined;
|
|
299
348
|
value?: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trade_ws_pb.d.ts","names":[],"sources":["../../../../src/gen/tradews/v1/trade_ws_pb.ts"],"mappings":";;;;;;;;;cAaa,0BAA0B;;;;;;;KAS3B,cAAc;;;;;;EAMxB;;;;;;EAOA;;;;EAKA;;;;;;IAME,OAAO;IACP;;;;;;;;IAQA,OAAO;IACP;;;;;;;IAOA,OAAO;IACP;;;;;;;IAOA,OAAO;IACP;;;;;;;IAOA,OAAO;IACP;;;;;;;;;;;IAWA,OAAO;IACP;;;;;;;;;;IAUA,OAAO;IACP;;;;;;;;;IASA,OAAO;IACP;;IACI;IAAiB;;;;;;;cAOZ,mBAAmB,WAAW;;;;;;KAQ/B,cAAc;;;;;;EAMxB,SAAS;;;;;;cAOE,mBAAmB,WAAW;;;;;;KAQ/B,cAAc;;;;;;EAMxB;;;;;;EAOA;;;;EAKA;;;;;;IAME,OAAO;IACP;;;;;;;;IAQA,OAAO;IACP;;;;;;;;;;;IAWA,OAAO;IACP;;;;;;;IAOA,OAAO;IACP;;;;;;;IAOA,OAAO;IACP;;IACI;IAAiB;;;;;;;cAOZ,mBAAmB,WAAW;;;;;;KAQ/B,eAAe;;;;;;EAMzB,SAAS;;;;;;cAOE,oBAAoB,WAAW;;;;;;KAQhC,cAAc;;;;EAIxB;;;;;;IAME,OAAO;IACP;;;;;;;IAOA,OAAO;IACP;;;;;;;IAOA,OAAO;IACP;;;;;;;IAOA,OAAO;IACP;;;;;;;;IAQA,OAAO;IACP;;;;;;;;IAQA,OAAO;IACP;;;;;;;;IAQA,OAAO;IACP;;IACI;IAAiB;;;;;;;cAOZ,mBAAmB,WAAW;;;;;;KAQ/B,gBAAgB;;;;;;EAM1B;;;;;;EAOA;;;;;;EAOA,QAAQ;;;;;;cAOG,qBAAqB,WAAW;;;;;;KAQjC,mBAAmB;;;;;;EAM7B;;;;;;EAOA;;;;;;cAOW,wBAAwB,WAAW;;;;;;KAQpC,uBAAuB;;;;;;EAMjC;;;;;;EAOA;;;;;;cAOW,4BAA4B,WAAW"}
|
|
1
|
+
{"version":3,"file":"trade_ws_pb.d.ts","names":[],"sources":["../../../../src/gen/tradews/v1/trade_ws_pb.ts"],"mappings":";;;;;;;;;cAaa,0BAA0B;;;;;;;KAS3B,cAAc;;;;;;EAMxB;;;;;;EAOA;;;;;;;;;;;;;EAcA;;;;;;;;EASA;;;;EAKA;;;;;;IAME,OAAO;IACP;;;;;;;;IAQA,OAAO;IACP;;;;;;;IAOA,OAAO;IACP;;;;;;;IAOA,OAAO;IACP;;;;;;;IAOA,OAAO;IACP;;;;;;;;;;;IAWA,OAAO;IACP;;;;;;;;;;IAUA,OAAO;IACP;;;;;;;;;IASA,OAAO;IACP;;;;;;;;;;;;;;;;;;IAkBA,OAAO;IACP;;IACI;IAAiB;;;;;;;cAOZ,mBAAmB,WAAW;;;;;;KAQ/B,cAAc;;;;;;EAMxB,SAAS;;;;;;cAOE,mBAAmB,WAAW;;;;;;KAQ/B,cAAc;;;;;;EAMxB;;;;;;EAOA;;;;EAKA;;;;;;IAME,OAAO;IACP;;;;;;;;IAQA,OAAO;IACP;;;;;;;;;;;IAWA,OAAO;IACP;;;;;;;IAOA,OAAO;IACP;;;;;;;IAOA,OAAO;IACP;;IACI;IAAiB;;;;;;;cAOZ,mBAAmB,WAAW;;;;;;KAQ/B,eAAe;;;;;;EAMzB,SAAS;;;;;;cAOE,oBAAoB,WAAW;;;;;;KAQhC,cAAc;;;;EAIxB;;;;;;IAME,OAAO;IACP;;;;;;;IAOA,OAAO;IACP;;;;;;;IAOA,OAAO;IACP;;;;;;;IAOA,OAAO;IACP;;;;;;;;IAQA,OAAO;IACP;;;;;;;;IAQA,OAAO;IACP;;;;;;;;IAQA,OAAO;IACP;;;;;;;;IAQA,OAAO;IACP;;IACI;IAAiB;;;;;;;cAOZ,mBAAmB,WAAW;;;;;;KAQ/B,gBAAgB;;;;;;EAM1B;;;;;;EAOA;;;;;;EAOA,QAAQ;;;;;;cAOG,qBAAqB,WAAW;;;;;;KAQjC,mBAAmB;;;;;;EAM7B;;;;;;EAOA;;;;;;cAOW,wBAAwB,WAAW;;;;;;KAQpC,uBAAuB;;;;;;EAMjC;;;;;;EAOA;;;;;;cAOW,4BAA4B,WAAW"}
|
|
@@ -16,7 +16,7 @@ var trade_ws_pb_exports = /* @__PURE__ */ __exportAll({
|
|
|
16
16
|
/**
|
|
17
17
|
* Describes the file tradews/v1/trade_ws.proto.
|
|
18
18
|
*/
|
|
19
|
-
const file_tradews_v1_trade_ws = /*@__PURE__*/ fileDesc("
|
|
19
|
+
const file_tradews_v1_trade_ws = /*@__PURE__*/ fileDesc("Chl0cmFkZXdzL3YxL3RyYWRlX3dzLnByb3RvEgp0cmFkZXdzLnYxIoUFCgtDbGllbnRGcmFtZRILCgNzZXEYASABKAQSFgoOY29ycmVsYXRpb25faWQYAiABKAkSFAoMdGltZXN0YW1wX21zGAMgASgDEhYKDnJlY3Zfd2luZG93X21zGAQgASgNEicKBHBpbmcYCiABKAsyFy50cmFkZXdzLnYxLlBpbmdSZXF1ZXN0SAASNQoMY3JlYXRlX29yZGVyGAsgASgLMh0ub3JkZXJzLnYxLkNyZWF0ZU9yZGVyUmVxdWVzdEgAEjUKDGNhbmNlbF9vcmRlchgMIAEoCzIdLm9yZGVycy52MS5DYW5jZWxPcmRlclJlcXVlc3RIABI1Cgxtb2RpZnlfb3JkZXIYDSABKAsyHS5vcmRlcnMudjEuTW9kaWZ5T3JkZXJSZXF1ZXN0SAASPgoRY2FuY2VsX2FsbF9vcmRlcnMYDiABKAsyIS5vcmRlcnMudjEuQ2FuY2VsQWxsT3JkZXJzUmVxdWVzdEgAEkIKE2JhdGNoX2NyZWF0ZV9vcmRlcnMYDyABKAsyIy5vcmRlcnMudjEuQmF0Y2hDcmVhdGVPcmRlcnNSZXF1ZXN0SAASRAoUYmF0Y2hfcmVwbGFjZV9vcmRlcnMYECABKAsyJC5vcmRlcnMudjEuQmF0Y2hSZXBsYWNlT3JkZXJzUmVxdWVzdEgAEkIKE2JhdGNoX2NhbmNlbF9vcmRlcnMYESABKAsyIy5vcmRlcnMudjEuQmF0Y2hDYW5jZWxPcmRlcnNSZXF1ZXN0SAASPAoQY2FuY2VsX2FsbF9hZnRlchgSIAEoCzIgLm9yZGVycy52MS5DYW5jZWxBbGxBZnRlclJlcXVlc3RIAEIJCgdwYXlsb2FkIh4KC1BpbmdSZXF1ZXN0Eg8KB3BheWxvYWQYASABKAwipAIKC1NlcnZlckZyYW1lEgsKA3NlcRgBIAEoBBIWCg5jb3JyZWxhdGlvbl9pZBgCIAEoCRIoCgRwb25nGAogASgLMhgudHJhZGV3cy52MS5Qb25nUmVzcG9uc2VIABImCgNhY2sYCyABKAsyFy50cmFkZXdzLnYxLkFja1Jlc3BvbnNlSAASKwoGcmVqZWN0GAwgASgLMhkudHJhZGV3cy52MS5Db21tYW5kUmVqZWN0SAASMAoIb3ZlcmxvYWQYDSABKAsyHC50cmFkZXdzLnYxLk92ZXJsb2FkUmVzcG9uc2VIABI0Cgh0ZXJtaW5hbBgOIAEoCzIgLnRyYWRld3MudjEuVGVybWluYWxTZXNzaW9uRXZlbnRIAEIJCgdwYXlsb2FkIh8KDFBvbmdSZXNwb25zZRIPCgdwYXlsb2FkGAEgASgMIpAECgtBY2tSZXNwb25zZRI2CgxjcmVhdGVfb3JkZXIYASABKAsyHi5vcmRlcnMudjEuQ3JlYXRlT3JkZXJSZXNwb25zZUgAEjYKDGNhbmNlbF9vcmRlchgCIAEoCzIeLm9yZGVycy52MS5DYW5jZWxPcmRlclJlc3BvbnNlSAASNgoMbW9kaWZ5X29yZGVyGAMgASgLMh4ub3JkZXJzLnYxLk1vZGlmeU9yZGVyUmVzcG9uc2VIABI/ChFjYW5jZWxfYWxsX29yZGVycxgEIAEoCzIiLm9yZGVycy52MS5DYW5jZWxBbGxPcmRlcnNSZXNwb25zZUgAEkMKE2JhdGNoX2NyZWF0ZV9vcmRlcnMYBSABKAsyJC5vcmRlcnMudjEuQmF0Y2hDcmVhdGVPcmRlcnNSZXNwb25zZUgAEkUKFGJhdGNoX3JlcGxhY2Vfb3JkZXJzGAYgASgLMiUub3JkZXJzLnYxLkJhdGNoUmVwbGFjZU9yZGVyc1Jlc3BvbnNlSAASQwoTYmF0Y2hfY2FuY2VsX29yZGVycxgHIAEoCzIkLm9yZGVycy52MS5CYXRjaENhbmNlbE9yZGVyc1Jlc3BvbnNlSAASPQoQY2FuY2VsX2FsbF9hZnRlchgIIAEoCzIhLm9yZGVycy52MS5DYW5jZWxBbGxBZnRlclJlc3BvbnNlSABCCAoGcmVzdWx0IlQKDUNvbW1hbmRSZWplY3QSDAoEY29kZRgBIAEoCRIOCgZkZXRhaWwYAiABKAkSJQoFZXJyb3IYAyABKAsyFi5vcmRlcnMudjEuRXJyb3JEZXRhaWwiMAoQT3ZlcmxvYWRSZXNwb25zZRIMCgRjb2RlGAEgASgJEg4KBmRldGFpbBgCIAEoCSI0ChRUZXJtaW5hbFNlc3Npb25FdmVudBIMCgRjb2RlGAEgASgJEg4KBmRldGFpbBgCIAEoCUJCWkBnaXRodWIuY29tL0ZhYnJpYy1MYWJzL3BvbHllc3Rlci1zZGstZ28vZ2VuL3RyYWRld3MvdjE7dHJhZGV3c3YxYgZwcm90bzM=", [file_orders_v1_orders]);
|
|
20
20
|
/**
|
|
21
21
|
* Describes the message tradews.v1.ClientFrame.
|
|
22
22
|
* Use `create(ClientFrameSchema)` to create a new message.
|
|
@@ -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, 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(\"Chl0cmFkZXdzL3YxL3RyYWRlX3dzLnByb3RvEgp0cmFkZXdzLnYxIpkECgtDbGllbnRGcmFtZRILCgNzZXEYASABKAQSFgoOY29ycmVsYXRpb25faWQYAiABKAkSJwoEcGluZxgKIAEoCzIXLnRyYWRld3MudjEuUGluZ1JlcXVlc3RIABI1CgxjcmVhdGVfb3JkZXIYCyABKAsyHS5vcmRlcnMudjEuQ3JlYXRlT3JkZXJSZXF1ZXN0SAASNQoMY2FuY2VsX29yZGVyGAwgASgLMh0ub3JkZXJzLnYxLkNhbmNlbE9yZGVyUmVxdWVzdEgAEjUKDG1vZGlmeV9vcmRlchgNIAEoCzIdLm9yZGVycy52MS5Nb2RpZnlPcmRlclJlcXVlc3RIABI+ChFjYW5jZWxfYWxsX29yZGVycxgOIAEoCzIhLm9yZGVycy52MS5DYW5jZWxBbGxPcmRlcnNSZXF1ZXN0SAASQgoTYmF0Y2hfY3JlYXRlX29yZGVycxgPIAEoCzIjLm9yZGVycy52MS5CYXRjaENyZWF0ZU9yZGVyc1JlcXVlc3RIABJEChRiYXRjaF9yZXBsYWNlX29yZGVycxgQIAEoCzIkLm9yZGVycy52MS5CYXRjaFJlcGxhY2VPcmRlcnNSZXF1ZXN0SAASQgoTYmF0Y2hfY2FuY2VsX29yZGVycxgRIAEoCzIjLm9yZGVycy52MS5CYXRjaENhbmNlbE9yZGVyc1JlcXVlc3RIAEIJCgdwYXlsb2FkIh4KC1BpbmdSZXF1ZXN0Eg8KB3BheWxvYWQYASABKAwipAIKC1NlcnZlckZyYW1lEgsKA3NlcRgBIAEoBBIWCg5jb3JyZWxhdGlvbl9pZBgCIAEoCRIoCgRwb25nGAogASgLMhgudHJhZGV3cy52MS5Qb25nUmVzcG9uc2VIABImCgNhY2sYCyABKAsyFy50cmFkZXdzLnYxLkFja1Jlc3BvbnNlSAASKwoGcmVqZWN0GAwgASgLMhkudHJhZGV3cy52MS5Db21tYW5kUmVqZWN0SAASMAoIb3ZlcmxvYWQYDSABKAsyHC50cmFkZXdzLnYxLk92ZXJsb2FkUmVzcG9uc2VIABI0Cgh0ZXJtaW5hbBgOIAEoCzIgLnRyYWRld3MudjEuVGVybWluYWxTZXNzaW9uRXZlbnRIAEIJCgdwYXlsb2FkIh8KDFBvbmdSZXNwb25zZRIPCgdwYXlsb2FkGAEgASgMItEDCgtBY2tSZXNwb25zZRI2CgxjcmVhdGVfb3JkZXIYASABKAsyHi5vcmRlcnMudjEuQ3JlYXRlT3JkZXJSZXNwb25zZUgAEjYKDGNhbmNlbF9vcmRlchgCIAEoCzIeLm9yZGVycy52MS5DYW5jZWxPcmRlclJlc3BvbnNlSAASNgoMbW9kaWZ5X29yZGVyGAMgASgLMh4ub3JkZXJzLnYxLk1vZGlmeU9yZGVyUmVzcG9uc2VIABI/ChFjYW5jZWxfYWxsX29yZGVycxgEIAEoCzIiLm9yZGVycy52MS5DYW5jZWxBbGxPcmRlcnNSZXNwb25zZUgAEkMKE2JhdGNoX2NyZWF0ZV9vcmRlcnMYBSABKAsyJC5vcmRlcnMudjEuQmF0Y2hDcmVhdGVPcmRlcnNSZXNwb25zZUgAEkUKFGJhdGNoX3JlcGxhY2Vfb3JkZXJzGAYgASgLMiUub3JkZXJzLnYxLkJhdGNoUmVwbGFjZU9yZGVyc1Jlc3BvbnNlSAASQwoTYmF0Y2hfY2FuY2VsX29yZGVycxgHIAEoCzIkLm9yZGVycy52MS5CYXRjaENhbmNlbE9yZGVyc1Jlc3BvbnNlSABCCAoGcmVzdWx0IlQKDUNvbW1hbmRSZWplY3QSDAoEY29kZRgBIAEoCRIOCgZkZXRhaWwYAiABKAkSJQoFZXJyb3IYAyABKAsyFi5vcmRlcnMudjEuRXJyb3JEZXRhaWwiMAoQT3ZlcmxvYWRSZXNwb25zZRIMCgRjb2RlGAEgASgJEg4KBmRldGFpbBgCIAEoCSI0ChRUZXJtaW5hbFNlc3Npb25FdmVudBIMCgRjb2RlGAEgASgJEg4KBmRldGFpbBgCIAEoCUJCWkBnaXRodWIuY29tL0ZhYnJpYy1MYWJzL3BvbHllc3Rlci1zZGstZ28vZ2VuL3RyYWRld3MvdjE7dHJhZGV3c3YxYgZwcm90bzM=\", [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 * @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 } | { 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 } | { 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,4rEAA4rE,CAAC,qBAAqB,CAAC;;;;;AA2G9tE,MAAa,oBACX,0BAAY,0BAA0B,CAAC;;;;;AAoBzC,MAAa,oBACX,0BAAY,0BAA0B,CAAC;;;;;AA6EzC,MAAa,oBACX,0BAAY,0BAA0B,CAAC;;;;;AAoBzC,MAAa,qBACX,0BAAY,0BAA0B,CAAC;;;;;AA6EzC,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(\"Chl0cmFkZXdzL3YxL3RyYWRlX3dzLnByb3RvEgp0cmFkZXdzLnYxIoUFCgtDbGllbnRGcmFtZRILCgNzZXEYASABKAQSFgoOY29ycmVsYXRpb25faWQYAiABKAkSFAoMdGltZXN0YW1wX21zGAMgASgDEhYKDnJlY3Zfd2luZG93X21zGAQgASgNEicKBHBpbmcYCiABKAsyFy50cmFkZXdzLnYxLlBpbmdSZXF1ZXN0SAASNQoMY3JlYXRlX29yZGVyGAsgASgLMh0ub3JkZXJzLnYxLkNyZWF0ZU9yZGVyUmVxdWVzdEgAEjUKDGNhbmNlbF9vcmRlchgMIAEoCzIdLm9yZGVycy52MS5DYW5jZWxPcmRlclJlcXVlc3RIABI1Cgxtb2RpZnlfb3JkZXIYDSABKAsyHS5vcmRlcnMudjEuTW9kaWZ5T3JkZXJSZXF1ZXN0SAASPgoRY2FuY2VsX2FsbF9vcmRlcnMYDiABKAsyIS5vcmRlcnMudjEuQ2FuY2VsQWxsT3JkZXJzUmVxdWVzdEgAEkIKE2JhdGNoX2NyZWF0ZV9vcmRlcnMYDyABKAsyIy5vcmRlcnMudjEuQmF0Y2hDcmVhdGVPcmRlcnNSZXF1ZXN0SAASRAoUYmF0Y2hfcmVwbGFjZV9vcmRlcnMYECABKAsyJC5vcmRlcnMudjEuQmF0Y2hSZXBsYWNlT3JkZXJzUmVxdWVzdEgAEkIKE2JhdGNoX2NhbmNlbF9vcmRlcnMYESABKAsyIy5vcmRlcnMudjEuQmF0Y2hDYW5jZWxPcmRlcnNSZXF1ZXN0SAASPAoQY2FuY2VsX2FsbF9hZnRlchgSIAEoCzIgLm9yZGVycy52MS5DYW5jZWxBbGxBZnRlclJlcXVlc3RIAEIJCgdwYXlsb2FkIh4KC1BpbmdSZXF1ZXN0Eg8KB3BheWxvYWQYASABKAwipAIKC1NlcnZlckZyYW1lEgsKA3NlcRgBIAEoBBIWCg5jb3JyZWxhdGlvbl9pZBgCIAEoCRIoCgRwb25nGAogASgLMhgudHJhZGV3cy52MS5Qb25nUmVzcG9uc2VIABImCgNhY2sYCyABKAsyFy50cmFkZXdzLnYxLkFja1Jlc3BvbnNlSAASKwoGcmVqZWN0GAwgASgLMhkudHJhZGV3cy52MS5Db21tYW5kUmVqZWN0SAASMAoIb3ZlcmxvYWQYDSABKAsyHC50cmFkZXdzLnYxLk92ZXJsb2FkUmVzcG9uc2VIABI0Cgh0ZXJtaW5hbBgOIAEoCzIgLnRyYWRld3MudjEuVGVybWluYWxTZXNzaW9uRXZlbnRIAEIJCgdwYXlsb2FkIh8KDFBvbmdSZXNwb25zZRIPCgdwYXlsb2FkGAEgASgMIpAECgtBY2tSZXNwb25zZRI2CgxjcmVhdGVfb3JkZXIYASABKAsyHi5vcmRlcnMudjEuQ3JlYXRlT3JkZXJSZXNwb25zZUgAEjYKDGNhbmNlbF9vcmRlchgCIAEoCzIeLm9yZGVycy52MS5DYW5jZWxPcmRlclJlc3BvbnNlSAASNgoMbW9kaWZ5X29yZGVyGAMgASgLMh4ub3JkZXJzLnYxLk1vZGlmeU9yZGVyUmVzcG9uc2VIABI/ChFjYW5jZWxfYWxsX29yZGVycxgEIAEoCzIiLm9yZGVycy52MS5DYW5jZWxBbGxPcmRlcnNSZXNwb25zZUgAEkMKE2JhdGNoX2NyZWF0ZV9vcmRlcnMYBSABKAsyJC5vcmRlcnMudjEuQmF0Y2hDcmVhdGVPcmRlcnNSZXNwb25zZUgAEkUKFGJhdGNoX3JlcGxhY2Vfb3JkZXJzGAYgASgLMiUub3JkZXJzLnYxLkJhdGNoUmVwbGFjZU9yZGVyc1Jlc3BvbnNlSAASQwoTYmF0Y2hfY2FuY2VsX29yZGVycxgHIAEoCzIkLm9yZGVycy52MS5CYXRjaENhbmNlbE9yZGVyc1Jlc3BvbnNlSAASPQoQY2FuY2VsX2FsbF9hZnRlchgIIAEoCzIhLm9yZGVycy52MS5DYW5jZWxBbGxBZnRlclJlc3BvbnNlSABCCAoGcmVzdWx0IlQKDUNvbW1hbmRSZWplY3QSDAoEY29kZRgBIAEoCRIOCgZkZXRhaWwYAiABKAkSJQoFZXJyb3IYAyABKAsyFi5vcmRlcnMudjEuRXJyb3JEZXRhaWwiMAoQT3ZlcmxvYWRSZXNwb25zZRIMCgRjb2RlGAEgASgJEg4KBmRldGFpbBgCIAEoCSI0ChRUZXJtaW5hbFNlc3Npb25FdmVudBIMCgRjb2RlGAEgASgJEg4KBmRldGFpbBgCIAEoCUJCWkBnaXRodWIuY29tL0ZhYnJpYy1MYWJzL3BvbHllc3Rlci1zZGstZ28vZ2VuL3RyYWRld3MvdjE7dHJhZGV3c3YxYgZwcm90bzM=\", [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"}
|
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { AssetConfig, DepositWithdrawConfig, PairConfig, PairStatus, SpotConfig,
|
|
|
6
6
|
import { OrderErrorCode, OrderErrorDetail } from "./services/orders/order-errors.schemas.js";
|
|
7
7
|
import { RateLimitDetail, RateLimitFailureReason, RateLimitPolicyClass, RateLimitRefillModel, RateLimitScope } from "./shared/rate-limit.schemas.js";
|
|
8
8
|
import { PolyesterErrorDetail, loadErrorDetailDecoders } from "./shared/error-detail.js";
|
|
9
|
-
import { AlreadyExistsError, AuthenticationError, ConfigurationError, InternalServerError, MfaEnrollmentRequiredError, MfaLastFactorRequiredError, MfaRequiredError, MfaVerificationError, MfaVerificationFailureReason, NetworkError, NotImplementedError, OutcomeUnknownError, PermissionError, PolicyInUseError, PolicyLockedError, PolicyScopeMismatchError, PolyesterError, PolyesterErrorCode, PolyesterErrorOptions, PreconditionFailedError, RateLimitError, RateLimitErrorOptions, RealtimeError, RealtimeErrorOptions, RequestError, RequestTooLargeError, ResourceNotFoundError, RevisionConflictError, ServiceUnavailableError, SessionElevationRequiredError, StaleQuoteError, StepUpRequiredError, SubaccountChallengeInvalidError, TimeoutError, TimestampSkewError, TransientError, UserOperationAlreadyKnownError, UserOperationNotExecutedError, UserOperationSendTimeoutError, ValidationError, WithdrawDeadlineExpiredError, errorFromHttpStatus, isAbortError, isTimeoutAbortError, normalizeErrorMessage } from "./shared/errors.js";
|
|
9
|
+
import { AlreadyExistsError, AuthenticationError, ConfigurationError, InternalServerError, MfaEnrollmentRequiredError, MfaLastFactorRequiredError, MfaRequiredError, MfaVerificationError, MfaVerificationFailureReason, NetworkError, NotImplementedError, OutcomeUnknownError, PermissionError, PolicyInUseError, PolicyLockedError, PolicyScopeMismatchError, PolyesterError, PolyesterErrorCode, PolyesterErrorOptions, PreconditionFailedError, RateLimitError, RateLimitErrorOptions, RealtimeError, RealtimeErrorOptions, RequestDeadlineExceededError, RequestError, RequestTooLargeError, ResourceNotFoundError, RevisionConflictError, ServiceUnavailableError, SessionElevationRequiredError, StaleQuoteError, StepUpRequiredError, SubaccountChallengeInvalidError, TimeoutError, TimestampSkewError, TransientError, UserOperationAlreadyKnownError, UserOperationNotExecutedError, UserOperationSendTimeoutError, ValidationError, WithdrawDeadlineExpiredError, errorFromHttpStatus, isAbortError, isTimeoutAbortError, normalizeErrorMessage } from "./shared/errors.js";
|
|
10
10
|
import { ApiKeyEd25519AuthProvider, JwtAuthProvider, Transports } from "./shared/transports.js";
|
|
11
11
|
import { PolyesterMutationOptions, PolyesterRequestOptions } from "./shared/request-options.js";
|
|
12
12
|
import { ResolveAccountInput, ResolvedAccount } from "./services/accounts/accounts.schemas.js";
|
|
@@ -124,4 +124,4 @@ import "./services/transfers/transfers.types.js";
|
|
|
124
124
|
import "./services/triggers/triggers.types.js";
|
|
125
125
|
import "./services/vip/vip.types.js";
|
|
126
126
|
import "./services/zipper/zipper.types.js";
|
|
127
|
-
export { type AccountCodeValue, type AccountIdentity, type AccountScope, type AccountScopedInput, type AccountSigner, type AccountSignerAuthEvents, type AccountSignerConfig, type CreateSubaccountResult as AccountSignerCreateSubaccountResult, type AccountSignerFactory, 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, 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 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 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, 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, checksumEvmAddress, columnarTimestampSecAt, compareUnsignedIntegerStrings, connectErrorToPolyesterError, createCookieAuthTokenStorage, createErrorMappingInterceptor, createMemoryAuthTokenStorage, createPolyesterEnvironment, createPolyesterServerClientFromCookies, createPolyesterServerClientFromRequest, createPolyesterServerCoreFromCookies, createPolyesterServerCoreFromRequest, errorFromHttpStatus, evmHexToBytes, evmUtf8ToBytes, evmUtf8ToHex, expandColumnarTimestampsSec, formatConnectError, 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 };
|
|
127
|
+
export { type AccountCodeValue, type AccountIdentity, type AccountScope, type AccountScopedInput, type AccountSigner, type AccountSignerAuthEvents, type AccountSignerConfig, type CreateSubaccountResult as AccountSignerCreateSubaccountResult, type AccountSignerFactory, 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, 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 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 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, checksumEvmAddress, columnarTimestampSecAt, compareUnsignedIntegerStrings, connectErrorToPolyesterError, createCookieAuthTokenStorage, createErrorMappingInterceptor, createMemoryAuthTokenStorage, createPolyesterEnvironment, createPolyesterServerClientFromCookies, createPolyesterServerClientFromRequest, createPolyesterServerCoreFromCookies, createPolyesterServerCoreFromRequest, errorFromHttpStatus, evmHexToBytes, evmUtf8ToBytes, evmUtf8ToHex, expandColumnarTimestampsSec, formatConnectError, 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 };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AlreadyExistsError, AuthenticationError, ConfigurationError, InternalServerError, MfaEnrollmentRequiredError, MfaLastFactorRequiredError, MfaRequiredError, MfaVerificationError, NetworkError, NotImplementedError, OutcomeUnknownError, PermissionError, PolicyInUseError, PolicyLockedError, PolicyScopeMismatchError, PolyesterError, PreconditionFailedError, RateLimitError, RealtimeError, RequestError, RequestTooLargeError, ResourceNotFoundError, RevisionConflictError, ServiceUnavailableError, SessionElevationRequiredError, StaleQuoteError, StepUpRequiredError, SubaccountChallengeInvalidError, TimeoutError, TimestampSkewError, TransientError, UserOperationAlreadyKnownError, UserOperationNotExecutedError, UserOperationSendTimeoutError, ValidationError, WithdrawDeadlineExpiredError, errorFromHttpStatus, isAbortError, isTimeoutAbortError, normalizeErrorMessage } from "./shared/errors.js";
|
|
1
|
+
import { AlreadyExistsError, AuthenticationError, ConfigurationError, InternalServerError, MfaEnrollmentRequiredError, MfaLastFactorRequiredError, MfaRequiredError, MfaVerificationError, NetworkError, NotImplementedError, OutcomeUnknownError, PermissionError, PolicyInUseError, PolicyLockedError, PolicyScopeMismatchError, PolyesterError, PreconditionFailedError, RateLimitError, RealtimeError, RequestDeadlineExceededError, RequestError, RequestTooLargeError, ResourceNotFoundError, RevisionConflictError, ServiceUnavailableError, SessionElevationRequiredError, StaleQuoteError, StepUpRequiredError, SubaccountChallengeInvalidError, TimeoutError, TimestampSkewError, TransientError, UserOperationAlreadyKnownError, UserOperationNotExecutedError, UserOperationSendTimeoutError, ValidationError, WithdrawDeadlineExpiredError, errorFromHttpStatus, isAbortError, isTimeoutAbortError, normalizeErrorMessage } from "./shared/errors.js";
|
|
2
2
|
import { loadErrorDetailDecoders } from "./shared/error-detail.js";
|
|
3
3
|
import { connectErrorToPolyesterError, createErrorMappingInterceptor, toPolyesterError } from "./shared/connect-error-mapping.js";
|
|
4
4
|
import { checksumEvmAddress, evmHexToBytes, evmUtf8ToBytes, evmUtf8ToHex, isEvmAddress, isEvmAddressStrict, keccak256Hex } from "./utils/evm.js";
|
|
@@ -18,4 +18,4 @@ import { isFreshStepUpRequiredError, isMfaEnrollmentRequiredError, isMfaLastFact
|
|
|
18
18
|
import { columnarTimestampSecAt, expandColumnarTimestampsSec } from "./utils/columnar-time.js";
|
|
19
19
|
import { compareUnsignedIntegerStrings, shouldApplyReconciliationUpdate } from "./shared/reconciliation.js";
|
|
20
20
|
import { mergeLedgerBalances } from "./services/balances/balances.merge.js";
|
|
21
|
-
export { AlreadyExistsError, AuthenticationError, ConfigurationError, InternalServerError, MfaEnrollmentRequiredError, MfaLastFactorRequiredError, MfaRequiredError, MfaVerificationError, NetworkError, NotImplementedError, OutcomeUnknownError, POLYESTER_AUTH_TOKEN_COOKIE_NAME, POLYESTER_DEVNET_ENVIRONMENT, POLYESTER_SESSION_COOKIE_NAME, POLYESTER_TESTNET_ENVIRONMENT, PermissionError, PolicyInUseError, PolicyLockedError, PolicyScopeMismatchError, PolyesterBrowserClient, PolyesterBrowserCore, PolyesterClient, PolyesterCore, PolyesterError, PolyesterServerClient, PolyesterServerCore, PreconditionFailedError, RateLimitError, RealtimeError, RequestError, RequestTooLargeError, ResourceNotFoundError, RevisionConflictError, ServiceUnavailableError, SessionElevationRequiredError, StaleQuoteError, StepUpRequiredError, SubaccountChallengeInvalidError, TimeoutError, TimestampSkewError, TransientError, UserOperationAlreadyKnownError, UserOperationNotExecutedError, UserOperationSendTimeoutError, ValidationError, WithdrawDeadlineExpiredError, checksumEvmAddress, columnarTimestampSecAt, compareUnsignedIntegerStrings, connectErrorToPolyesterError, createCookieAuthTokenStorage, createErrorMappingInterceptor, createMemoryAuthTokenStorage, createPolyesterEnvironment, createPolyesterServerClientFromCookies, createPolyesterServerClientFromRequest, createPolyesterServerCoreFromCookies, createPolyesterServerCoreFromRequest, errorFromHttpStatus, evmHexToBytes, evmUtf8ToBytes, evmUtf8ToHex, expandColumnarTimestampsSec, formatConnectError, 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 };
|
|
21
|
+
export { AlreadyExistsError, AuthenticationError, ConfigurationError, InternalServerError, MfaEnrollmentRequiredError, MfaLastFactorRequiredError, MfaRequiredError, MfaVerificationError, NetworkError, NotImplementedError, OutcomeUnknownError, POLYESTER_AUTH_TOKEN_COOKIE_NAME, POLYESTER_DEVNET_ENVIRONMENT, POLYESTER_SESSION_COOKIE_NAME, POLYESTER_TESTNET_ENVIRONMENT, PermissionError, PolicyInUseError, PolicyLockedError, PolicyScopeMismatchError, PolyesterBrowserClient, PolyesterBrowserCore, PolyesterClient, PolyesterCore, PolyesterError, PolyesterServerClient, PolyesterServerCore, PreconditionFailedError, RateLimitError, RealtimeError, RequestDeadlineExceededError, RequestError, RequestTooLargeError, ResourceNotFoundError, RevisionConflictError, ServiceUnavailableError, SessionElevationRequiredError, StaleQuoteError, StepUpRequiredError, SubaccountChallengeInvalidError, TimeoutError, TimestampSkewError, TransientError, UserOperationAlreadyKnownError, UserOperationNotExecutedError, UserOperationSendTimeoutError, ValidationError, WithdrawDeadlineExpiredError, checksumEvmAddress, columnarTimestampSecAt, compareUnsignedIntegerStrings, connectErrorToPolyesterError, createCookieAuthTokenStorage, createErrorMappingInterceptor, createMemoryAuthTokenStorage, createPolyesterEnvironment, createPolyesterServerClientFromCookies, createPolyesterServerClientFromRequest, createPolyesterServerCoreFromCookies, createPolyesterServerCoreFromRequest, errorFromHttpStatus, evmHexToBytes, evmUtf8ToBytes, evmUtf8ToHex, expandColumnarTimestampsSec, formatConnectError, 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 };
|
|
@@ -297,7 +297,7 @@ declare const AddressBookSchema: v.ObjectSchema<{
|
|
|
297
297
|
rootAccountId: string;
|
|
298
298
|
subaccountId: bigint;
|
|
299
299
|
}, AddressBookAccountScope>]>, undefined>;
|
|
300
|
-
readonly callerRole: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer"
|
|
300
|
+
readonly callerRole: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer">]>;
|
|
301
301
|
readonly label: v.StringSchema<undefined>;
|
|
302
302
|
readonly ownerUsername: v.StringSchema<undefined>;
|
|
303
303
|
readonly smartAccountAddress: v.StringSchema<undefined>;
|
|
@@ -1102,7 +1102,7 @@ declare const AddressBookViewSchema: v.ObjectSchema<{
|
|
|
1102
1102
|
rootAccountId: string;
|
|
1103
1103
|
subaccountId: bigint;
|
|
1104
1104
|
}, AddressBookAccountScope>]>, undefined>;
|
|
1105
|
-
readonly callerRole: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer"
|
|
1105
|
+
readonly callerRole: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer">]>;
|
|
1106
1106
|
readonly label: v.StringSchema<undefined>;
|
|
1107
1107
|
readonly ownerUsername: v.StringSchema<undefined>;
|
|
1108
1108
|
readonly smartAccountAddress: v.StringSchema<undefined>;
|
|
@@ -49,7 +49,7 @@ declare const CheckpointBiggestTradeSchema: v.SchemaWithPipe<readonly [v.ObjectS
|
|
|
49
49
|
side: number;
|
|
50
50
|
at: number;
|
|
51
51
|
}, {
|
|
52
|
-
side: "
|
|
52
|
+
side: "buy" | "sell" | "unspecified";
|
|
53
53
|
symbolId: number;
|
|
54
54
|
symbol: string;
|
|
55
55
|
at: number;
|
|
@@ -229,7 +229,7 @@ declare const CheckpointSchema: v.ObjectSchema<{
|
|
|
229
229
|
side: number;
|
|
230
230
|
at: number;
|
|
231
231
|
}, {
|
|
232
|
-
side: "
|
|
232
|
+
side: "buy" | "sell" | "unspecified";
|
|
233
233
|
symbolId: number;
|
|
234
234
|
symbol: string;
|
|
235
235
|
at: number;
|
|
@@ -14,7 +14,7 @@ type TimestampInit = {
|
|
|
14
14
|
declare const GetOrderbookHeatmapInputSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
15
15
|
readonly symbolId: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>;
|
|
16
16
|
readonly interval: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["1s", "1m", "5m", "1h"], undefined>, "1s">, v.TransformAction<"1s" | "1m" | "5m" | "1h", HeatmapInterval>]>;
|
|
17
|
-
readonly depth: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly [1, 5, 10, 20, 50, 100, 200, 500, 1000], undefined>, 50>, v.TransformAction<1 | 5 | 10 | 20 | 100 | 500 |
|
|
17
|
+
readonly depth: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly [1, 5, 10, 20, 50, 100, 200, 500, 1000], undefined>, 50>, v.TransformAction<1 | 5 | 10 | 20 | 100 | 500 | 200 | 50 | 1000, HeatmapDepth>]>;
|
|
18
18
|
readonly quantityMode: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["close", "peak"], undefined>, "close">, v.TransformAction<"close" | "peak", HeatmapQuantityMode>]>;
|
|
19
19
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 20000, undefined>]>;
|
|
20
20
|
readonly startTsSec: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>, v.TransformAction<number, bigint>]>, undefined>;
|
|
@@ -227,7 +227,7 @@ type OrderbookHeatmapDeltaChain = ReturnType<typeof convertHeatmapDeltaChain>;
|
|
|
227
227
|
declare function createOrderbookHeatmapResponseSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
228
228
|
readonly symbolId: v.NumberSchema<undefined>;
|
|
229
229
|
readonly interval: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1s" | "1m" | "5m" | "1h">>]>;
|
|
230
|
-
readonly depth: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, 1 |
|
|
230
|
+
readonly depth: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, 1 | 5 | 10 | 20 | "unspecified" | 100 | 500 | 200 | 50 | 1000>]>;
|
|
231
231
|
readonly chain: v.OptionalSchema<v.ObjectSchema<{
|
|
232
232
|
readonly baseKeyframe: v.OptionalSchema<v.ObjectSchema<{
|
|
233
233
|
readonly tsSec: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, number>]>;
|
|
@@ -287,7 +287,7 @@ declare function createOrderbookHeatmapResponseSchema(scales: SdkScales): v.Sche
|
|
|
287
287
|
}, undefined>, v.TransformAction<{
|
|
288
288
|
symbolId: number;
|
|
289
289
|
interval: DecodedEnum<"1s" | "1m" | "5m" | "1h">;
|
|
290
|
-
depth: 1 |
|
|
290
|
+
depth: 1 | 5 | 10 | 20 | "unspecified" | 100 | 500 | 200 | 50 | 1000;
|
|
291
291
|
chain?: {
|
|
292
292
|
baseKeyframe?: {
|
|
293
293
|
tsSec: number;
|
|
@@ -347,7 +347,7 @@ declare function createOrderbookHeatmapResponseSchema(scales: SdkScales): v.Sche
|
|
|
347
347
|
}, {
|
|
348
348
|
symbolId: number;
|
|
349
349
|
interval: DecodedEnum<"1s" | "1m" | "5m" | "1h">;
|
|
350
|
-
depth: 1 |
|
|
350
|
+
depth: 1 | 5 | 10 | 20 | "unspecified" | 100 | 500 | 200 | 50 | 1000;
|
|
351
351
|
chain: {
|
|
352
352
|
baseKeyframe: {
|
|
353
353
|
tsSec: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.codecs.d.ts","names":[],"sources":["../../../src/services/lifecycle/lifecycle.codecs.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"lifecycle.codecs.d.ts","names":[],"sources":["../../../src/services/lifecycle/lifecycle.codecs.ts"],"mappings":";;;cAkCa;KACD,kCAAkC;cAKjC;KACD,qCAAqC;cAEpC;KACD,6BAA6B;cAE5B;KACD,oCAAoC;cAEnC;;;;;;KAqBD,+BACE;cAyCD;KACD,yCAAyC"}
|
|
@@ -20,6 +20,7 @@ const LIFECYCLE_LIST_SCOPE_VALUES = [
|
|
|
20
20
|
"open",
|
|
21
21
|
"terminal"
|
|
22
22
|
];
|
|
23
|
+
const LIFECYCLE_FLOW_PARTICIPATION_VALUES = ["owner", "recipient"];
|
|
23
24
|
const LIFECYCLE_TX_LOOKUP_KIND_VALUES = ["source", "any"];
|
|
24
25
|
const LIFECYCLE_SORT_VALUES = ["newest", "oldest"];
|
|
25
26
|
const LIFECYCLE_LIST_ORDER_BY_VALUES = ["last_activity", "started_at"];
|
|
@@ -78,6 +79,17 @@ const LifecycleListScopeCodec = {
|
|
|
78
79
|
[3]: "terminal"
|
|
79
80
|
}
|
|
80
81
|
};
|
|
82
|
+
const LifecycleFlowParticipationCodec = {
|
|
83
|
+
inputToProto: {
|
|
84
|
+
owner: 1,
|
|
85
|
+
recipient: 2
|
|
86
|
+
},
|
|
87
|
+
protoToOutput: {
|
|
88
|
+
[0]: "unspecified",
|
|
89
|
+
[1]: "owner",
|
|
90
|
+
[2]: "recipient"
|
|
91
|
+
}
|
|
92
|
+
};
|
|
81
93
|
const LifecycleSortCodec = { inputToProto: {
|
|
82
94
|
newest: 1,
|
|
83
95
|
oldest: 2
|
|
@@ -171,6 +183,6 @@ const LifecycleRequestFeeStatusCodec = { protoToOutput: {
|
|
|
171
183
|
[2]: "settled"
|
|
172
184
|
} };
|
|
173
185
|
//#endregion
|
|
174
|
-
export { LIFECYCLE_FLOW_KIND_VALUES, LIFECYCLE_FLOW_STATE_VALUES, LIFECYCLE_LIST_ORDER_BY_VALUES, LIFECYCLE_LIST_SCOPE_VALUES, LIFECYCLE_SORT_VALUES, LIFECYCLE_TX_LOOKUP_KIND_VALUES, LifecycleFlowDomainCodec, LifecycleFlowKindCodec, LifecycleFlowStateCodec, LifecycleFlowStepActivityKindCodec, LifecycleFlowStepCodec, LifecycleFlowTimelineStatusCodec, LifecycleListOrderByCodec, LifecycleListScopeCodec, LifecycleReasonCodec, LifecycleRequestFeeStatusCodec, LifecycleSortCodec, LifecycleSourceCodec, LifecycleTxLookupKindCodec, lifecycleReasonFromCode };
|
|
186
|
+
export { LIFECYCLE_FLOW_KIND_VALUES, LIFECYCLE_FLOW_PARTICIPATION_VALUES, LIFECYCLE_FLOW_STATE_VALUES, LIFECYCLE_LIST_ORDER_BY_VALUES, LIFECYCLE_LIST_SCOPE_VALUES, LIFECYCLE_SORT_VALUES, LIFECYCLE_TX_LOOKUP_KIND_VALUES, LifecycleFlowDomainCodec, LifecycleFlowKindCodec, LifecycleFlowParticipationCodec, LifecycleFlowStateCodec, LifecycleFlowStepActivityKindCodec, LifecycleFlowStepCodec, LifecycleFlowTimelineStatusCodec, LifecycleListOrderByCodec, LifecycleListScopeCodec, LifecycleReasonCodec, LifecycleRequestFeeStatusCodec, LifecycleSortCodec, LifecycleSourceCodec, LifecycleTxLookupKindCodec, lifecycleReasonFromCode };
|
|
175
187
|
|
|
176
188
|
//# sourceMappingURL=lifecycle.codecs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.codecs.js","names":[],"sources":["../../../src/services/lifecycle/lifecycle.codecs.ts"],"sourcesContent":["import {\n FlowDomain,\n FlowKind,\n FlowState,\n LifecycleReason,\n LifecycleSource,\n RequestFeeStatus,\n} from \"../../gen/chain/lifecycle/v1/types_pb.js\";\nimport {\n FlowStep,\n FlowStepActivityKind,\n FlowTimelineStatus,\n ListOrderBy,\n ListScope,\n Sort,\n TxLookupKind,\n} from \"../../gen/chain/lifecycle/v1/lifecycle_read_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const LIFECYCLE_FLOW_KIND_VALUES = [\"deposit\", \"withdraw\", \"transfer\"] as const;\nexport type LifecycleFlowKindValue = (typeof LIFECYCLE_FLOW_KIND_VALUES)[number];\n\nexport const LIFECYCLE_FLOW_STATE_VALUES = [\n \"pending_source\",\n \"pending_polyester_chain\",\n \"pending_ledger\",\n \"completed\",\n \"failed\",\n \"dropped\",\n \"refunded\",\n] as const;\nexport type LifecycleFlowStateValue = (typeof LIFECYCLE_FLOW_STATE_VALUES)[number];\n\nexport const LIFECYCLE_LIST_SCOPE_VALUES = [\"all\", \"open\", \"terminal\"] as const;\nexport type LifecycleListScopeValue = (typeof LIFECYCLE_LIST_SCOPE_VALUES)[number];\n\nexport const LIFECYCLE_TX_LOOKUP_KIND_VALUES = [\"source\", \"any\"] as const;\nexport type LifecycleTxLookupKindValue = (typeof LIFECYCLE_TX_LOOKUP_KIND_VALUES)[number];\n\nexport const LIFECYCLE_SORT_VALUES = [\"newest\", \"oldest\"] as const;\nexport type LifecycleSortValue = (typeof LIFECYCLE_SORT_VALUES)[number];\n\nexport const LIFECYCLE_LIST_ORDER_BY_VALUES = [\"last_activity\", \"started_at\"] as const;\nexport type LifecycleListOrderByValue = (typeof LIFECYCLE_LIST_ORDER_BY_VALUES)[number];\n\nexport const LIFECYCLE_REASON_VALUES = [\n \"unspecified\",\n \"zipper_validation_rejected\",\n \"zipper_execution_rejected\",\n \"zipper_withdraw_execution_failed\",\n \"zipper_deposit_refund_failed\",\n \"ledger_mirror_rejected\",\n \"ledger_mirror_transfer_exceeds_credits\",\n \"ledger_mirror_transfer_exists\",\n \"ledger_mirror_pending_transfer_not_found\",\n \"ledger_mirror_transfer_id_already_failed\",\n \"trading_withdraw_policy_denied\",\n \"trading_withdraw_contract_reverted\",\n \"trading_withdraw_execution_failed\",\n \"deposit_source_not_confirmed\",\n] as const;\n/**\n * Catalog labels plus a code-preserving fallback for wire values the generated\n * enum does not know. Proto3 enums are open — the backend can emit codes ahead\n * of a contract update — and rejecting them froze flows out of the UI.\n */\nexport type LifecycleReasonValue =\n | (typeof LIFECYCLE_REASON_VALUES)[number]\n | `unknown_reason_${number}`;\n\nexport const LIFECYCLE_FLOW_STEP_VALUES = [\n \"source\",\n \"transfer\",\n \"request\",\n \"validation\",\n \"execution\",\n \"bridge_fulfillment\",\n \"dropped\",\n \"failed\",\n \"refunded\",\n \"fulfilling\",\n \"settlement\",\n] as const;\nexport type LifecycleFlowStepValue = (typeof LIFECYCLE_FLOW_STEP_VALUES)[number];\n\nexport const LIFECYCLE_SOURCE_VALUES = [\n \"unspecified\",\n \"relayer\",\n \"polyester_chain\",\n \"executor\",\n \"ledger\",\n \"lifecycle\",\n] as const;\nexport type LifecycleSourceValue = (typeof LIFECYCLE_SOURCE_VALUES)[number];\n\nexport const LIFECYCLE_FLOW_STEP_ACTIVITY_KIND_VALUES = [\n \"minted\",\n \"funding\",\n \"trading\",\n \"unspecified\",\n] as const;\nexport type LifecycleFlowStepActivityKindValue =\n (typeof LIFECYCLE_FLOW_STEP_ACTIVITY_KIND_VALUES)[number];\n\nexport const LIFECYCLE_FLOW_TIMELINE_STATUS_VALUES = [\"completed\", \"current\", \"planned\"] as const;\nexport type LifecycleFlowTimelineStatusValue =\n (typeof LIFECYCLE_FLOW_TIMELINE_STATUS_VALUES)[number];\n\nexport const LIFECYCLE_REQUEST_FEE_STATUS_VALUES = [\"locked\", \"settled\"] as const;\nexport type LifecycleRequestFeeStatusValue = (typeof LIFECYCLE_REQUEST_FEE_STATUS_VALUES)[number];\n\nexport const LIFECYCLE_FLOW_DOMAIN_VALUES = [\n \"external_chain\",\n \"zipper\",\n \"funding\",\n \"trading\",\n \"lending\",\n] as const;\nexport type LifecycleFlowDomainValue = (typeof LIFECYCLE_FLOW_DOMAIN_VALUES)[number];\n\nexport const LifecycleFlowDomainCodec = {\n protoToOutput: {\n [FlowDomain.DOMAIN_UNSPECIFIED]: \"unspecified\",\n [FlowDomain.DOMAIN_EXTERNAL_CHAIN]: \"external_chain\",\n [FlowDomain.DOMAIN_ZIPPER]: \"zipper\",\n [FlowDomain.DOMAIN_FUNDING]: \"funding\",\n [FlowDomain.DOMAIN_TRADING]: \"trading\",\n [FlowDomain.DOMAIN_LENDING]: \"lending\",\n } satisfies ProtoToOutput<FlowDomain, LifecycleFlowDomainValue>,\n} as const;\n\nexport const LifecycleFlowKindCodec = {\n inputToProto: {\n deposit: FlowKind.KIND_DEPOSIT,\n withdraw: FlowKind.KIND_WITHDRAW,\n transfer: FlowKind.KIND_TRANSFER,\n } satisfies InputToProto<LifecycleFlowKindValue, FlowKind>,\n protoToOutput: {\n [FlowKind.KIND_UNSPECIFIED]: \"unspecified\",\n [FlowKind.KIND_DEPOSIT]: \"deposit\",\n [FlowKind.KIND_WITHDRAW]: \"withdraw\",\n [FlowKind.KIND_TRANSFER]: \"transfer\",\n } satisfies ProtoToOutput<FlowKind, LifecycleFlowKindValue>,\n} as const;\n\nexport const LifecycleFlowStateCodec = {\n inputToProto: {\n pending_source: FlowState.STATE_PENDING_SOURCE,\n pending_polyester_chain: FlowState.STATE_PENDING_POLYESTER_CHAIN,\n pending_ledger: FlowState.STATE_PENDING_LEDGER,\n completed: FlowState.STATE_COMPLETED,\n failed: FlowState.STATE_FAILED,\n dropped: FlowState.STATE_DROPPED,\n refunded: FlowState.STATE_REFUNDED,\n } satisfies InputToProto<LifecycleFlowStateValue, FlowState>,\n protoToOutput: {\n [FlowState.STATE_UNSPECIFIED]: \"unspecified\",\n [FlowState.STATE_PENDING_SOURCE]: \"pending_source\",\n [FlowState.STATE_PENDING_POLYESTER_CHAIN]: \"pending_polyester_chain\",\n [FlowState.STATE_PENDING_LEDGER]: \"pending_ledger\",\n [FlowState.STATE_COMPLETED]: \"completed\",\n [FlowState.STATE_FAILED]: \"failed\",\n [FlowState.STATE_DROPPED]: \"dropped\",\n [FlowState.STATE_REFUNDED]: \"refunded\",\n } satisfies ProtoToOutput<FlowState, LifecycleFlowStateValue>,\n} as const;\n\nexport const LifecycleListScopeCodec = {\n inputToProto: {\n all: ListScope.LIST_ALL,\n open: ListScope.LIST_OPEN_ONLY,\n terminal: ListScope.LIST_TERMINAL_ONLY,\n } satisfies InputToProto<LifecycleListScopeValue, ListScope>,\n protoToOutput: {\n [ListScope.LIST_UNSPECIFIED]: \"unspecified\",\n [ListScope.LIST_ALL]: \"all\",\n [ListScope.LIST_OPEN_ONLY]: \"open\",\n [ListScope.LIST_TERMINAL_ONLY]: \"terminal\",\n } satisfies ProtoToOutput<ListScope, LifecycleListScopeValue>,\n} as const;\n\nexport const LifecycleSortCodec = {\n inputToProto: {\n newest: Sort.NEWEST,\n oldest: Sort.OLDEST,\n } satisfies InputToProto<LifecycleSortValue, Sort>,\n} as const;\n\nexport const LifecycleListOrderByCodec = {\n inputToProto: {\n last_activity: ListOrderBy.ORDER_BY_LAST_ACTIVITY,\n started_at: ListOrderBy.ORDER_BY_STARTED_AT,\n } satisfies InputToProto<LifecycleListOrderByValue, ListOrderBy>,\n} as const;\n\n/**\n * LifecycleReason is a stable product-facing reason catalog. Unlike the other\n * lifecycle enums, `REASON_UNSPECIFIED` (0) is a valid wire value — it is\n * the normal state for flows without a notable reason — so the codec maps the\n * full enum including zero.\n */\nexport const LifecycleReasonCodec = {\n protoToOutput: {\n [LifecycleReason.REASON_UNSPECIFIED]: \"unspecified\",\n [LifecycleReason.ZIPPER_VALIDATION_REJECTED]: \"zipper_validation_rejected\",\n [LifecycleReason.ZIPPER_EXECUTION_REJECTED]: \"zipper_execution_rejected\",\n [LifecycleReason.ZIPPER_WITHDRAW_EXECUTION_FAILED]: \"zipper_withdraw_execution_failed\",\n [LifecycleReason.ZIPPER_DEPOSIT_REFUND_FAILED]: \"zipper_deposit_refund_failed\",\n [LifecycleReason.LEDGER_MIRROR_REJECTED]: \"ledger_mirror_rejected\",\n [LifecycleReason.LEDGER_MIRROR_TRANSFER_EXCEEDS_CREDITS]:\n \"ledger_mirror_transfer_exceeds_credits\",\n [LifecycleReason.LEDGER_MIRROR_TRANSFER_EXISTS]: \"ledger_mirror_transfer_exists\",\n [LifecycleReason.LEDGER_MIRROR_PENDING_TRANSFER_NOT_FOUND]:\n \"ledger_mirror_pending_transfer_not_found\",\n [LifecycleReason.LEDGER_MIRROR_TRANSFER_ID_ALREADY_FAILED]:\n \"ledger_mirror_transfer_id_already_failed\",\n [LifecycleReason.TRADING_WITHDRAW_POLICY_DENIED]: \"trading_withdraw_policy_denied\",\n [LifecycleReason.TRADING_WITHDRAW_CONTRACT_REVERTED]: \"trading_withdraw_contract_reverted\",\n [LifecycleReason.TRADING_WITHDRAW_EXECUTION_FAILED]: \"trading_withdraw_execution_failed\",\n [LifecycleReason.DEPOSIT_SOURCE_NOT_CONFIRMED]: \"deposit_source_not_confirmed\",\n } satisfies Record<LifecycleReason, LifecycleReasonValue>,\n} as const;\n\n/**\n * Maps a wire reason code to its catalog label, preserving uncataloged codes\n * as `unknown_reason_${code}` instead of failing the whole flow payload.\n */\nexport function lifecycleReasonFromCode(code: number): LifecycleReasonValue {\n const known = LifecycleReasonCodec.protoToOutput as Partial<\n Record<number, LifecycleReasonValue>\n >;\n return known[code] ?? `unknown_reason_${code}`;\n}\n\nexport const LifecycleTxLookupKindCodec = {\n inputToProto: {\n source: TxLookupKind.TX_SOURCE,\n any: TxLookupKind.TX_ANY,\n } satisfies InputToProto<LifecycleTxLookupKindValue, TxLookupKind>,\n protoToOutput: {\n [TxLookupKind.TX_UNSPECIFIED]: \"unspecified\",\n [TxLookupKind.TX_SOURCE]: \"source\",\n [TxLookupKind.TX_ANY]: \"any\",\n } satisfies ProtoToOutput<TxLookupKind, LifecycleTxLookupKindValue>,\n} as const;\n\nexport const LifecycleFlowStepCodec = {\n protoToOutput: {\n [FlowStep.UNSPECIFIED]: \"unspecified\",\n [FlowStep.SOURCE]: \"source\",\n [FlowStep.TRANSFER]: \"transfer\",\n [FlowStep.REQUEST]: \"request\",\n [FlowStep.VALIDATION]: \"validation\",\n [FlowStep.EXECUTION]: \"execution\",\n [FlowStep.BRIDGE_FULFILLMENT]: \"bridge_fulfillment\",\n [FlowStep.DROPPED]: \"dropped\",\n [FlowStep.FAILED]: \"failed\",\n [FlowStep.REFUNDED]: \"refunded\",\n [FlowStep.FULFILLING]: \"fulfilling\",\n [FlowStep.SETTLEMENT]: \"settlement\",\n } satisfies ProtoToOutput<FlowStep, LifecycleFlowStepValue>,\n} as const;\n\nexport const LifecycleSourceCodec = {\n /**\n * In-progress flows may emit SOURCE_UNSPECIFIED (0) before a subsystem is\n * attributed, so zero must decode like other lifecycle \"unspecified\" enums.\n */\n protoToOutput: {\n [LifecycleSource.SOURCE_UNSPECIFIED]: \"unspecified\",\n [LifecycleSource.SOURCE_RELAYER]: \"relayer\",\n [LifecycleSource.SOURCE_POLYESTER_CHAIN]: \"polyester_chain\",\n [LifecycleSource.SOURCE_EXECUTOR]: \"executor\",\n [LifecycleSource.SOURCE_LEDGER]: \"ledger\",\n [LifecycleSource.SOURCE_LIFECYCLE]: \"lifecycle\",\n } satisfies Record<LifecycleSource, LifecycleSourceValue>,\n} as const;\n\nexport const LifecycleFlowStepActivityKindCodec = {\n protoToOutput: {\n [FlowStepActivityKind.ACTIVITY_MINTED]: \"minted\",\n [FlowStepActivityKind.ACTIVITY_FUNDING]: \"funding\",\n [FlowStepActivityKind.ACTIVITY_TRADING]: \"trading\",\n [FlowStepActivityKind.ACTIVITY_UNSPECIFIED]: \"unspecified\",\n } satisfies Record<FlowStepActivityKind, LifecycleFlowStepActivityKindValue>,\n} as const;\n\nexport const LifecycleFlowTimelineStatusCodec = {\n protoToOutput: {\n [FlowTimelineStatus.TIMELINE_STATUS_UNSPECIFIED]: \"unspecified\",\n [FlowTimelineStatus.TIMELINE_STATUS_COMPLETED]: \"completed\",\n [FlowTimelineStatus.TIMELINE_STATUS_CURRENT]: \"current\",\n [FlowTimelineStatus.TIMELINE_STATUS_PLANNED]: \"planned\",\n } satisfies ProtoToOutput<FlowTimelineStatus, LifecycleFlowTimelineStatusValue>,\n} as const;\n\nexport const LifecycleRequestFeeStatusCodec = {\n protoToOutput: {\n [RequestFeeStatus.UNSPECIFIED]: \"unspecified\",\n [RequestFeeStatus.LOCKED]: \"locked\",\n [RequestFeeStatus.SETTLED]: \"settled\",\n } satisfies ProtoToOutput<RequestFeeStatus, LifecycleRequestFeeStatusValue>,\n} as const;\n"],"mappings":";;;AAmBA,MAAa,6BAA6B;CAAC;CAAW;CAAY;AAAU;AAG5E,MAAa,8BAA8B;CACvC;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;AAGA,MAAa,8BAA8B;CAAC;CAAO;CAAQ;AAAU;AAGrE,MAAa,kCAAkC,CAAC,UAAU,KAAK;AAG/D,MAAa,wBAAwB,CAAC,UAAU,QAAQ;AAGxD,MAAa,iCAAiC,CAAC,iBAAiB,YAAY;AA8E5E,MAAa,2BAA2B,EACpC,eAAe;EACsB,IAAA;EACG,IAAA;EACR,IAAA;EACC,IAAA;EACA,IAAA;EACA,IAAA;AACjC,EACJ;AAEA,MAAa,yBAAyB;CAClC,cAAc;EACV,SAAA;EACA,UAAA;EACA,UAAA;CACJ;CACA,eAAe;GACkB,IAAA;GACJ,IAAA;GACC,IAAA;GACA,IAAA;CAC9B;AACJ;AAEA,MAAa,0BAA0B;CACnC,cAAc;EACV,gBAAA;EACA,yBAAA;EACA,gBAAA;EACA,WAAA;EACA,QAAA;EACA,SAAA;EACA,UAAA;CACJ;CACA,eAAe;GACoB,IAAA;GACG,IAAA;GACS,IAAA;GACT,IAAA;GACL,IAAA;GACH,IAAA;GACC,IAAA;GACC,IAAA;CAChC;AACJ;AAEA,MAAa,0BAA0B;CACnC,cAAc;EACV,KAAA;EACA,MAAA;EACA,UAAA;CACJ;CACA,eAAe;GACmB,IAAA;GACR,IAAA;GACM,IAAA;GACI,IAAA;CACpC;AACJ;AAEA,MAAa,qBAAqB,EAC9B,cAAc;CACV,QAAA;CACA,QAAA;AACJ,EACJ;AAEA,MAAa,4BAA4B,EACrC,cAAc;CACV,eAAA;CACA,YAAA;AACJ,EACJ;;;;;;;AAQA,MAAa,uBAAuB,EAChC,eAAe;EAC2B,IAAA;EACQ,MAAA;EACD,MAAA;EACO,MAAA;EACJ,MAAA;EACN,MAAA;EAEtC,MAAA;EAC6C,MAAA;EAE7C,MAAA;EAEA,MAAA;EAC8C,MAAA;EACI,MAAA;EACD,MAAA;EACL,MAAA;AACpD,EACJ;;;;;AAMA,SAAgB,wBAAwB,MAAoC;CAIxE,OAHc,qBAAqB,cAGtB,SAAS,kBAAkB;AAC5C;AAEA,MAAa,6BAA6B;CACtC,cAAc;EACV,QAAA;EACA,KAAA;CACJ;CACA,eAAe;GACoB,IAAA;GACL,IAAA;GACH,IAAA;CAC3B;AACJ;AAEA,MAAa,yBAAyB,EAClC,eAAe;EACa,IAAA;EACL,IAAA;EACE,IAAA;EACD,IAAA;EACG,IAAA;EACD,IAAA;EACS,IAAA;EACX,IAAA;EACD,IAAA;EACE,IAAA;EACE,KAAA;EACA,KAAA;AAC3B,EACJ;AAEA,MAAa,uBAAuB;;;;;AAKhC,eAAe;EAC2B,IAAA;EACJ,IAAA;EACQ,IAAA;EACP,IAAA;EACF,IAAA;EACG,IAAA;AACxC,EACJ;AAEA,MAAa,qCAAqC,EAC9C,eAAe;EAC6B,IAAA;EACC,IAAA;EACA,IAAA;EACI,IAAA;AACjD,EACJ;AAEA,MAAa,mCAAmC,EAC5C,eAAe;EACuC,IAAA;EACF,IAAA;EACF,IAAA;EACA,IAAA;AAClD,EACJ;AAEA,MAAa,iCAAiC,EAC1C,eAAe;EACqB,IAAA;EACL,IAAA;EACC,IAAA;AAChC,EACJ"}
|
|
1
|
+
{"version":3,"file":"lifecycle.codecs.js","names":[],"sources":["../../../src/services/lifecycle/lifecycle.codecs.ts"],"sourcesContent":["import {\n FlowDomain,\n FlowKind,\n FlowState,\n LifecycleReason,\n LifecycleSource,\n RequestFeeStatus,\n} from \"../../gen/chain/lifecycle/v1/types_pb.js\";\nimport {\n FlowParticipation,\n FlowStep,\n FlowStepActivityKind,\n FlowTimelineStatus,\n ListOrderBy,\n ListScope,\n Sort,\n TxLookupKind,\n} from \"../../gen/chain/lifecycle/v1/lifecycle_read_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const LIFECYCLE_FLOW_KIND_VALUES = [\"deposit\", \"withdraw\", \"transfer\"] as const;\nexport type LifecycleFlowKindValue = (typeof LIFECYCLE_FLOW_KIND_VALUES)[number];\n\nexport const LIFECYCLE_FLOW_STATE_VALUES = [\n \"pending_source\",\n \"pending_polyester_chain\",\n \"pending_ledger\",\n \"completed\",\n \"failed\",\n \"dropped\",\n \"refunded\",\n] as const;\nexport type LifecycleFlowStateValue = (typeof LIFECYCLE_FLOW_STATE_VALUES)[number];\n\nexport const LIFECYCLE_LIST_SCOPE_VALUES = [\"all\", \"open\", \"terminal\"] as const;\nexport type LifecycleListScopeValue = (typeof LIFECYCLE_LIST_SCOPE_VALUES)[number];\n\nexport const LIFECYCLE_FLOW_PARTICIPATION_VALUES = [\"owner\", \"recipient\"] as const;\nexport type LifecycleFlowParticipationValue = (typeof LIFECYCLE_FLOW_PARTICIPATION_VALUES)[number];\n\nexport const LIFECYCLE_TX_LOOKUP_KIND_VALUES = [\"source\", \"any\"] as const;\nexport type LifecycleTxLookupKindValue = (typeof LIFECYCLE_TX_LOOKUP_KIND_VALUES)[number];\n\nexport const LIFECYCLE_SORT_VALUES = [\"newest\", \"oldest\"] as const;\nexport type LifecycleSortValue = (typeof LIFECYCLE_SORT_VALUES)[number];\n\nexport const LIFECYCLE_LIST_ORDER_BY_VALUES = [\"last_activity\", \"started_at\"] as const;\nexport type LifecycleListOrderByValue = (typeof LIFECYCLE_LIST_ORDER_BY_VALUES)[number];\n\nexport const LIFECYCLE_REASON_VALUES = [\n \"unspecified\",\n \"zipper_validation_rejected\",\n \"zipper_execution_rejected\",\n \"zipper_withdraw_execution_failed\",\n \"zipper_deposit_refund_failed\",\n \"ledger_mirror_rejected\",\n \"ledger_mirror_transfer_exceeds_credits\",\n \"ledger_mirror_transfer_exists\",\n \"ledger_mirror_pending_transfer_not_found\",\n \"ledger_mirror_transfer_id_already_failed\",\n \"trading_withdraw_policy_denied\",\n \"trading_withdraw_contract_reverted\",\n \"trading_withdraw_execution_failed\",\n \"deposit_source_not_confirmed\",\n] as const;\n/**\n * Catalog labels plus a code-preserving fallback for wire values the generated\n * enum does not know. Proto3 enums are open — the backend can emit codes ahead\n * of a contract update — and rejecting them froze flows out of the UI.\n */\nexport type LifecycleReasonValue =\n | (typeof LIFECYCLE_REASON_VALUES)[number]\n | `unknown_reason_${number}`;\n\nexport const LIFECYCLE_FLOW_STEP_VALUES = [\n \"source\",\n \"transfer\",\n \"request\",\n \"validation\",\n \"execution\",\n \"bridge_fulfillment\",\n \"dropped\",\n \"failed\",\n \"refunded\",\n \"fulfilling\",\n \"settlement\",\n] as const;\nexport type LifecycleFlowStepValue = (typeof LIFECYCLE_FLOW_STEP_VALUES)[number];\n\nexport const LIFECYCLE_SOURCE_VALUES = [\n \"unspecified\",\n \"relayer\",\n \"polyester_chain\",\n \"executor\",\n \"ledger\",\n \"lifecycle\",\n] as const;\nexport type LifecycleSourceValue = (typeof LIFECYCLE_SOURCE_VALUES)[number];\n\nexport const LIFECYCLE_FLOW_STEP_ACTIVITY_KIND_VALUES = [\n \"minted\",\n \"funding\",\n \"trading\",\n \"unspecified\",\n] as const;\nexport type LifecycleFlowStepActivityKindValue =\n (typeof LIFECYCLE_FLOW_STEP_ACTIVITY_KIND_VALUES)[number];\n\nexport const LIFECYCLE_FLOW_TIMELINE_STATUS_VALUES = [\"completed\", \"current\", \"planned\"] as const;\nexport type LifecycleFlowTimelineStatusValue =\n (typeof LIFECYCLE_FLOW_TIMELINE_STATUS_VALUES)[number];\n\nexport const LIFECYCLE_REQUEST_FEE_STATUS_VALUES = [\"locked\", \"settled\"] as const;\nexport type LifecycleRequestFeeStatusValue = (typeof LIFECYCLE_REQUEST_FEE_STATUS_VALUES)[number];\n\nexport const LIFECYCLE_FLOW_DOMAIN_VALUES = [\n \"external_chain\",\n \"zipper\",\n \"funding\",\n \"trading\",\n \"lending\",\n] as const;\nexport type LifecycleFlowDomainValue = (typeof LIFECYCLE_FLOW_DOMAIN_VALUES)[number];\n\nexport const LifecycleFlowDomainCodec = {\n protoToOutput: {\n [FlowDomain.DOMAIN_UNSPECIFIED]: \"unspecified\",\n [FlowDomain.DOMAIN_EXTERNAL_CHAIN]: \"external_chain\",\n [FlowDomain.DOMAIN_ZIPPER]: \"zipper\",\n [FlowDomain.DOMAIN_FUNDING]: \"funding\",\n [FlowDomain.DOMAIN_TRADING]: \"trading\",\n [FlowDomain.DOMAIN_LENDING]: \"lending\",\n } satisfies ProtoToOutput<FlowDomain, LifecycleFlowDomainValue>,\n} as const;\n\nexport const LifecycleFlowKindCodec = {\n inputToProto: {\n deposit: FlowKind.KIND_DEPOSIT,\n withdraw: FlowKind.KIND_WITHDRAW,\n transfer: FlowKind.KIND_TRANSFER,\n } satisfies InputToProto<LifecycleFlowKindValue, FlowKind>,\n protoToOutput: {\n [FlowKind.KIND_UNSPECIFIED]: \"unspecified\",\n [FlowKind.KIND_DEPOSIT]: \"deposit\",\n [FlowKind.KIND_WITHDRAW]: \"withdraw\",\n [FlowKind.KIND_TRANSFER]: \"transfer\",\n } satisfies ProtoToOutput<FlowKind, LifecycleFlowKindValue>,\n} as const;\n\nexport const LifecycleFlowStateCodec = {\n inputToProto: {\n pending_source: FlowState.STATE_PENDING_SOURCE,\n pending_polyester_chain: FlowState.STATE_PENDING_POLYESTER_CHAIN,\n pending_ledger: FlowState.STATE_PENDING_LEDGER,\n completed: FlowState.STATE_COMPLETED,\n failed: FlowState.STATE_FAILED,\n dropped: FlowState.STATE_DROPPED,\n refunded: FlowState.STATE_REFUNDED,\n } satisfies InputToProto<LifecycleFlowStateValue, FlowState>,\n protoToOutput: {\n [FlowState.STATE_UNSPECIFIED]: \"unspecified\",\n [FlowState.STATE_PENDING_SOURCE]: \"pending_source\",\n [FlowState.STATE_PENDING_POLYESTER_CHAIN]: \"pending_polyester_chain\",\n [FlowState.STATE_PENDING_LEDGER]: \"pending_ledger\",\n [FlowState.STATE_COMPLETED]: \"completed\",\n [FlowState.STATE_FAILED]: \"failed\",\n [FlowState.STATE_DROPPED]: \"dropped\",\n [FlowState.STATE_REFUNDED]: \"refunded\",\n } satisfies ProtoToOutput<FlowState, LifecycleFlowStateValue>,\n} as const;\n\nexport const LifecycleListScopeCodec = {\n inputToProto: {\n all: ListScope.LIST_ALL,\n open: ListScope.LIST_OPEN_ONLY,\n terminal: ListScope.LIST_TERMINAL_ONLY,\n } satisfies InputToProto<LifecycleListScopeValue, ListScope>,\n protoToOutput: {\n [ListScope.LIST_UNSPECIFIED]: \"unspecified\",\n [ListScope.LIST_ALL]: \"all\",\n [ListScope.LIST_OPEN_ONLY]: \"open\",\n [ListScope.LIST_TERMINAL_ONLY]: \"terminal\",\n } satisfies ProtoToOutput<ListScope, LifecycleListScopeValue>,\n} as const;\n\nexport const LifecycleFlowParticipationCodec = {\n inputToProto: {\n owner: FlowParticipation.PARTICIPATION_OWNER,\n recipient: FlowParticipation.PARTICIPATION_RECIPIENT,\n } satisfies InputToProto<LifecycleFlowParticipationValue, FlowParticipation>,\n protoToOutput: {\n [FlowParticipation.PARTICIPATION_UNSPECIFIED]: \"unspecified\",\n [FlowParticipation.PARTICIPATION_OWNER]: \"owner\",\n [FlowParticipation.PARTICIPATION_RECIPIENT]: \"recipient\",\n } satisfies ProtoToOutput<FlowParticipation, LifecycleFlowParticipationValue>,\n} as const;\n\nexport const LifecycleSortCodec = {\n inputToProto: {\n newest: Sort.NEWEST,\n oldest: Sort.OLDEST,\n } satisfies InputToProto<LifecycleSortValue, Sort>,\n} as const;\n\nexport const LifecycleListOrderByCodec = {\n inputToProto: {\n last_activity: ListOrderBy.ORDER_BY_LAST_ACTIVITY,\n started_at: ListOrderBy.ORDER_BY_STARTED_AT,\n } satisfies InputToProto<LifecycleListOrderByValue, ListOrderBy>,\n} as const;\n\n/**\n * LifecycleReason is a stable product-facing reason catalog. Unlike the other\n * lifecycle enums, `REASON_UNSPECIFIED` (0) is a valid wire value — it is\n * the normal state for flows without a notable reason — so the codec maps the\n * full enum including zero.\n */\nexport const LifecycleReasonCodec = {\n protoToOutput: {\n [LifecycleReason.REASON_UNSPECIFIED]: \"unspecified\",\n [LifecycleReason.ZIPPER_VALIDATION_REJECTED]: \"zipper_validation_rejected\",\n [LifecycleReason.ZIPPER_EXECUTION_REJECTED]: \"zipper_execution_rejected\",\n [LifecycleReason.ZIPPER_WITHDRAW_EXECUTION_FAILED]: \"zipper_withdraw_execution_failed\",\n [LifecycleReason.ZIPPER_DEPOSIT_REFUND_FAILED]: \"zipper_deposit_refund_failed\",\n [LifecycleReason.LEDGER_MIRROR_REJECTED]: \"ledger_mirror_rejected\",\n [LifecycleReason.LEDGER_MIRROR_TRANSFER_EXCEEDS_CREDITS]:\n \"ledger_mirror_transfer_exceeds_credits\",\n [LifecycleReason.LEDGER_MIRROR_TRANSFER_EXISTS]: \"ledger_mirror_transfer_exists\",\n [LifecycleReason.LEDGER_MIRROR_PENDING_TRANSFER_NOT_FOUND]:\n \"ledger_mirror_pending_transfer_not_found\",\n [LifecycleReason.LEDGER_MIRROR_TRANSFER_ID_ALREADY_FAILED]:\n \"ledger_mirror_transfer_id_already_failed\",\n [LifecycleReason.TRADING_WITHDRAW_POLICY_DENIED]: \"trading_withdraw_policy_denied\",\n [LifecycleReason.TRADING_WITHDRAW_CONTRACT_REVERTED]: \"trading_withdraw_contract_reverted\",\n [LifecycleReason.TRADING_WITHDRAW_EXECUTION_FAILED]: \"trading_withdraw_execution_failed\",\n [LifecycleReason.DEPOSIT_SOURCE_NOT_CONFIRMED]: \"deposit_source_not_confirmed\",\n } satisfies Record<LifecycleReason, LifecycleReasonValue>,\n} as const;\n\n/**\n * Maps a wire reason code to its catalog label, preserving uncataloged codes\n * as `unknown_reason_${code}` instead of failing the whole flow payload.\n */\nexport function lifecycleReasonFromCode(code: number): LifecycleReasonValue {\n const known = LifecycleReasonCodec.protoToOutput as Partial<\n Record<number, LifecycleReasonValue>\n >;\n return known[code] ?? `unknown_reason_${code}`;\n}\n\nexport const LifecycleTxLookupKindCodec = {\n inputToProto: {\n source: TxLookupKind.TX_SOURCE,\n any: TxLookupKind.TX_ANY,\n } satisfies InputToProto<LifecycleTxLookupKindValue, TxLookupKind>,\n protoToOutput: {\n [TxLookupKind.TX_UNSPECIFIED]: \"unspecified\",\n [TxLookupKind.TX_SOURCE]: \"source\",\n [TxLookupKind.TX_ANY]: \"any\",\n } satisfies ProtoToOutput<TxLookupKind, LifecycleTxLookupKindValue>,\n} as const;\n\nexport const LifecycleFlowStepCodec = {\n protoToOutput: {\n [FlowStep.UNSPECIFIED]: \"unspecified\",\n [FlowStep.SOURCE]: \"source\",\n [FlowStep.TRANSFER]: \"transfer\",\n [FlowStep.REQUEST]: \"request\",\n [FlowStep.VALIDATION]: \"validation\",\n [FlowStep.EXECUTION]: \"execution\",\n [FlowStep.BRIDGE_FULFILLMENT]: \"bridge_fulfillment\",\n [FlowStep.DROPPED]: \"dropped\",\n [FlowStep.FAILED]: \"failed\",\n [FlowStep.REFUNDED]: \"refunded\",\n [FlowStep.FULFILLING]: \"fulfilling\",\n [FlowStep.SETTLEMENT]: \"settlement\",\n } satisfies ProtoToOutput<FlowStep, LifecycleFlowStepValue>,\n} as const;\n\nexport const LifecycleSourceCodec = {\n /**\n * In-progress flows may emit SOURCE_UNSPECIFIED (0) before a subsystem is\n * attributed, so zero must decode like other lifecycle \"unspecified\" enums.\n */\n protoToOutput: {\n [LifecycleSource.SOURCE_UNSPECIFIED]: \"unspecified\",\n [LifecycleSource.SOURCE_RELAYER]: \"relayer\",\n [LifecycleSource.SOURCE_POLYESTER_CHAIN]: \"polyester_chain\",\n [LifecycleSource.SOURCE_EXECUTOR]: \"executor\",\n [LifecycleSource.SOURCE_LEDGER]: \"ledger\",\n [LifecycleSource.SOURCE_LIFECYCLE]: \"lifecycle\",\n } satisfies Record<LifecycleSource, LifecycleSourceValue>,\n} as const;\n\nexport const LifecycleFlowStepActivityKindCodec = {\n protoToOutput: {\n [FlowStepActivityKind.ACTIVITY_MINTED]: \"minted\",\n [FlowStepActivityKind.ACTIVITY_FUNDING]: \"funding\",\n [FlowStepActivityKind.ACTIVITY_TRADING]: \"trading\",\n [FlowStepActivityKind.ACTIVITY_UNSPECIFIED]: \"unspecified\",\n } satisfies Record<FlowStepActivityKind, LifecycleFlowStepActivityKindValue>,\n} as const;\n\nexport const LifecycleFlowTimelineStatusCodec = {\n protoToOutput: {\n [FlowTimelineStatus.TIMELINE_STATUS_UNSPECIFIED]: \"unspecified\",\n [FlowTimelineStatus.TIMELINE_STATUS_COMPLETED]: \"completed\",\n [FlowTimelineStatus.TIMELINE_STATUS_CURRENT]: \"current\",\n [FlowTimelineStatus.TIMELINE_STATUS_PLANNED]: \"planned\",\n } satisfies ProtoToOutput<FlowTimelineStatus, LifecycleFlowTimelineStatusValue>,\n} as const;\n\nexport const LifecycleRequestFeeStatusCodec = {\n protoToOutput: {\n [RequestFeeStatus.UNSPECIFIED]: \"unspecified\",\n [RequestFeeStatus.LOCKED]: \"locked\",\n [RequestFeeStatus.SETTLED]: \"settled\",\n } satisfies ProtoToOutput<RequestFeeStatus, LifecycleRequestFeeStatusValue>,\n} as const;\n"],"mappings":";;;AAoBA,MAAa,6BAA6B;CAAC;CAAW;CAAY;AAAU;AAG5E,MAAa,8BAA8B;CACvC;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;AAGA,MAAa,8BAA8B;CAAC;CAAO;CAAQ;AAAU;AAGrE,MAAa,sCAAsC,CAAC,SAAS,WAAW;AAGxE,MAAa,kCAAkC,CAAC,UAAU,KAAK;AAG/D,MAAa,wBAAwB,CAAC,UAAU,QAAQ;AAGxD,MAAa,iCAAiC,CAAC,iBAAiB,YAAY;AA8E5E,MAAa,2BAA2B,EACpC,eAAe;EACsB,IAAA;EACG,IAAA;EACR,IAAA;EACC,IAAA;EACA,IAAA;EACA,IAAA;AACjC,EACJ;AAEA,MAAa,yBAAyB;CAClC,cAAc;EACV,SAAA;EACA,UAAA;EACA,UAAA;CACJ;CACA,eAAe;GACkB,IAAA;GACJ,IAAA;GACC,IAAA;GACA,IAAA;CAC9B;AACJ;AAEA,MAAa,0BAA0B;CACnC,cAAc;EACV,gBAAA;EACA,yBAAA;EACA,gBAAA;EACA,WAAA;EACA,QAAA;EACA,SAAA;EACA,UAAA;CACJ;CACA,eAAe;GACoB,IAAA;GACG,IAAA;GACS,IAAA;GACT,IAAA;GACL,IAAA;GACH,IAAA;GACC,IAAA;GACC,IAAA;CAChC;AACJ;AAEA,MAAa,0BAA0B;CACnC,cAAc;EACV,KAAA;EACA,MAAA;EACA,UAAA;CACJ;CACA,eAAe;GACmB,IAAA;GACR,IAAA;GACM,IAAA;GACI,IAAA;CACpC;AACJ;AAEA,MAAa,kCAAkC;CAC3C,cAAc;EACV,OAAA;EACA,WAAA;CACJ;CACA,eAAe;GACoC,IAAA;GACN,IAAA;GACI,IAAA;CACjD;AACJ;AAEA,MAAa,qBAAqB,EAC9B,cAAc;CACV,QAAA;CACA,QAAA;AACJ,EACJ;AAEA,MAAa,4BAA4B,EACrC,cAAc;CACV,eAAA;CACA,YAAA;AACJ,EACJ;;;;;;;AAQA,MAAa,uBAAuB,EAChC,eAAe;EAC2B,IAAA;EACQ,MAAA;EACD,MAAA;EACO,MAAA;EACJ,MAAA;EACN,MAAA;EAEtC,MAAA;EAC6C,MAAA;EAE7C,MAAA;EAEA,MAAA;EAC8C,MAAA;EACI,MAAA;EACD,MAAA;EACL,MAAA;AACpD,EACJ;;;;;AAMA,SAAgB,wBAAwB,MAAoC;CAIxE,OAHc,qBAAqB,cAGtB,SAAS,kBAAkB;AAC5C;AAEA,MAAa,6BAA6B;CACtC,cAAc;EACV,QAAA;EACA,KAAA;CACJ;CACA,eAAe;GACoB,IAAA;GACL,IAAA;GACH,IAAA;CAC3B;AACJ;AAEA,MAAa,yBAAyB,EAClC,eAAe;EACa,IAAA;EACL,IAAA;EACE,IAAA;EACD,IAAA;EACG,IAAA;EACD,IAAA;EACS,IAAA;EACX,IAAA;EACD,IAAA;EACE,IAAA;EACE,KAAA;EACA,KAAA;AAC3B,EACJ;AAEA,MAAa,uBAAuB;;;;;AAKhC,eAAe;EAC2B,IAAA;EACJ,IAAA;EACQ,IAAA;EACP,IAAA;EACF,IAAA;EACG,IAAA;AACxC,EACJ;AAEA,MAAa,qCAAqC,EAC9C,eAAe;EAC6B,IAAA;EACC,IAAA;EACA,IAAA;EACI,IAAA;AACjD,EACJ;AAEA,MAAa,mCAAmC,EAC5C,eAAe;EACuC,IAAA;EACF,IAAA;EACF,IAAA;EACA,IAAA;AAClD,EACJ;AAEA,MAAa,iCAAiC,EAC1C,eAAe;EACqB,IAAA;EACL,IAAA;EACC,IAAA;AAChC,EACJ"}
|
|
@@ -18,6 +18,11 @@ declare class LifecycleService {
|
|
|
18
18
|
constructor(transports: PublicApiTransports, realtime: PolyesterRealtime);
|
|
19
19
|
/**
|
|
20
20
|
* Returns paginated lifecycle flow summaries filtered by kind, state, scope, account selector, transaction reference, chain ids, and asset ids. The response is ordered by the selected timestamp and includes an opaque next page token.
|
|
21
|
+
*
|
|
22
|
+
* With an `accountSelector`, the list holds the flows the account owns and the
|
|
23
|
+
* transfers it receives from other accounts; each row's `participation` says which.
|
|
24
|
+
* Pass `participation: "owner"` for the owned flows only. A `pageToken` only resumes
|
|
25
|
+
* the request it came from: change nothing but `limit` between pages.
|
|
21
26
|
*/
|
|
22
27
|
listFlows(input: ListLifecycleFlowsInput, options?: PolyesterRequestOptions): Promise<ListLifecycleFlowsOutput>;
|
|
23
28
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.d.ts","names":[],"sources":["../../../src/services/lifecycle/lifecycle.ts"],"mappings":";;;;;;UAqCU,yCAAyC,mBAAmB;EAClE;;UAGM,0CAA0C,mBAAmB;EACnE;;;;;cAMS;;EAIG,YAAA,YAAY,qBAAqB,UAAU
|
|
1
|
+
{"version":3,"file":"lifecycle.d.ts","names":[],"sources":["../../../src/services/lifecycle/lifecycle.ts"],"mappings":";;;;;;UAqCU,yCAAyC,mBAAmB;EAClE;;UAGM,0CAA0C,mBAAmB;EACnE;;;;;cAMS;;EAIG,YAAA,YAAY,qBAAqB,UAAU;;;;;;;;;EAajD,UACF,OAAO,yBACP,UAAU,0BACX,QAAQ;;;;EAUL,QACF,OAAO,uBACP,UAAU,0BACX,QAAQ;;;;EAYL,cACF,OAAO,6BACP,UAAU,0BACX,QAAQ;;;;EAYX,mBAAmB,OAAO;;;;EAqB1B,oBAAoB,OAAO"}
|
|
@@ -19,6 +19,11 @@ var LifecycleService = class {
|
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Returns paginated lifecycle flow summaries filtered by kind, state, scope, account selector, transaction reference, chain ids, and asset ids. The response is ordered by the selected timestamp and includes an opaque next page token.
|
|
22
|
+
*
|
|
23
|
+
* With an `accountSelector`, the list holds the flows the account owns and the
|
|
24
|
+
* transfers it receives from other accounts; each row's `participation` says which.
|
|
25
|
+
* Pass `participation: "owner"` for the owned flows only. A `pageToken` only resumes
|
|
26
|
+
* the request it came from: change nothing but `limit` between pages.
|
|
22
27
|
*/
|
|
23
28
|
async listFlows(input, options) {
|
|
24
29
|
const parsedInput = parse(ListLifecycleFlowsInputSchema, input);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.js","names":["#client","#realtime"],"sources":["../../../src/services/lifecycle/lifecycle.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport { create } from \"@bufbuild/protobuf\";\nimport {\n FlowDetailViewSchema,\n FlowSummaryViewSchema,\n GetFlowByIdRequestSchema,\n LifecycleReadService,\n} from \"../../gen/chain/lifecycle/v1/lifecycle_read_pb.js\";\nimport type { PolyesterRealtime } from \"../../realtime/types.js\";\nimport type { PublicApiTransports } from \"../../shared/transports.js\";\nimport type { BaseSubscribeInput } from \"../../shared/types.js\";\nimport {\n toConnectCallOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport { isDev } from \"../../utils/is-dev.js\";\nimport * as v from \"valibot\";\nimport { parse } from \"../../shared/validation.js\";\nimport {\n GetLifecycleFlowInputSchema,\n GetLifecycleFlowOutputSchema,\n LifecycleFlowDetailSchema,\n LifecycleFlowSummarySchema,\n ListLifecycleFlowsByTxOutputSchema,\n ListLifecycleFlowsByTxInputSchema,\n ListLifecycleFlowsOutputSchema,\n ListLifecycleFlowsInputSchema,\n type GetLifecycleFlowInput,\n type GetLifecycleFlowOutput,\n type LifecycleFlowDetail,\n type LifecycleFlowSummary,\n type ListLifecycleFlowsByTxInput,\n type ListLifecycleFlowsByTxOutput,\n type ListLifecycleFlowsInput,\n type ListLifecycleFlowsOutput,\n} from \"./lifecycle.schemas.js\";\n\ninterface SubscribeOpenLifecycleFlowsInput extends BaseSubscribeInput<LifecycleFlowSummary> {\n accountId?: string;\n}\n\ninterface SubscribeLifecycleFlowDetailInput extends BaseSubscribeInput<LifecycleFlowDetail> {\n flowId: string;\n}\n\n/**\n * Reads and streams chain lifecycle flow state, history, progress, and transaction matches.\n */\nexport class LifecycleService {\n #client: Client<typeof LifecycleReadService>;\n #realtime: PolyesterRealtime;\n\n constructor(transports: PublicApiTransports, realtime: PolyesterRealtime) {\n this.#client = createClient(LifecycleReadService, transports.publicApi);\n this.#realtime = realtime;\n }\n\n /**\n * Returns paginated lifecycle flow summaries filtered by kind, state, scope, account selector, transaction reference, chain ids, and asset ids. The response is ordered by the selected timestamp and includes an opaque next page token.\n */\n async listFlows(\n input: ListLifecycleFlowsInput,\n options?: PolyesterRequestOptions,\n ): Promise<ListLifecycleFlowsOutput> {\n const parsedInput = parse(ListLifecycleFlowsInputSchema, input);\n const response = await this.#client.listFlows(parsedInput, toConnectCallOptions(options));\n const res = parse(ListLifecycleFlowsOutputSchema, response);\n return res;\n }\n\n /**\n * Fetches one lifecycle flow by its public flow id and returns summary, factual steps, timeline, and live-state detail when available.\n */\n async getFlow(\n input: GetLifecycleFlowInput,\n options?: PolyesterRequestOptions,\n ): Promise<GetLifecycleFlowOutput> {\n const parsedInput = parse(GetLifecycleFlowInputSchema, input);\n const response = await this.#client.getFlowById(\n create(GetFlowByIdRequestSchema, parsedInput),\n toConnectCallOptions(options),\n );\n return parse(GetLifecycleFlowOutputSchema, response);\n }\n\n /**\n * Searches lifecycle flows that reference a 0x-prefixed transaction hash, using source-only or any-reference lookup mode. A single transaction may match zero, one, or many flows.\n */\n async listFlowsByTx(\n input: ListLifecycleFlowsByTxInput,\n options?: PolyesterRequestOptions,\n ): Promise<ListLifecycleFlowsByTxOutput> {\n const parsedInput = parse(ListLifecycleFlowsByTxInputSchema, input);\n const response = await this.#client.listFlowsByTx(\n parsedInput,\n toConnectCallOptions(options),\n );\n return parse(ListLifecycleFlowsByTxOutputSchema, response);\n }\n\n /**\n * Subscribes to open lifecycle flow summary updates, using private:chain:lifecycle:flows:{accountId}:proto when an account id is provided and the public flow channel otherwise.\n */\n subscribeOpenFlows(input: SubscribeOpenLifecycleFlowsInput): () => void {\n const accountId = input.accountId?.trim();\n const channel = accountId\n ? `private:chain:lifecycle:flows:${accountId}:proto`\n : \"public:chain:lifecycle:flows:proto\";\n return this.#realtime.connectProtoChannel({\n channel,\n schema: FlowSummaryViewSchema,\n onPublication: (data) => {\n const flow = parse(LifecycleFlowSummarySchema, data);\n input.onEvent(flow);\n },\n onConnected: input.onOpen,\n onDisconnected: input.onClose,\n onError: input.onError,\n });\n }\n\n /**\n * Subscribes to detail updates for one lifecycle flow on public:chain:lifecycle:flow:{flowId}:proto. Invalid flow ids are rejected locally with a no-op unsubscribe function.\n */\n subscribeFlowDetail(input: SubscribeLifecycleFlowDetailInput): () => void {\n const parsedFlowId = v.safeParse(GetLifecycleFlowInputSchema, { flowId: input.flowId });\n if (!parsedFlowId.success) {\n if (isDev()) {\n console.error(\n \"[LifecycleService] flowId is required for flow detail subscription.\",\n );\n }\n return () => {};\n }\n\n const channel = `public:chain:lifecycle:flow:${parsedFlowId.output.flowId}:proto`;\n return this.#realtime.connectProtoChannel({\n channel,\n schema: FlowDetailViewSchema,\n onPublication: (data) => {\n const flow = parse(LifecycleFlowDetailSchema, data);\n input.onEvent(flow);\n },\n onConnected: input.onOpen,\n onDisconnected: input.onClose,\n onError: input.onError,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;AAgDA,IAAa,mBAAb,MAA8B;CAC1B;CACA;CAEA,YAAY,YAAiC,UAA6B;EACtE,KAAKA,UAAU,aAAa,sBAAsB,WAAW,SAAS;EACtE,KAAKC,YAAY;CACrB
|
|
1
|
+
{"version":3,"file":"lifecycle.js","names":["#client","#realtime"],"sources":["../../../src/services/lifecycle/lifecycle.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport { create } from \"@bufbuild/protobuf\";\nimport {\n FlowDetailViewSchema,\n FlowSummaryViewSchema,\n GetFlowByIdRequestSchema,\n LifecycleReadService,\n} from \"../../gen/chain/lifecycle/v1/lifecycle_read_pb.js\";\nimport type { PolyesterRealtime } from \"../../realtime/types.js\";\nimport type { PublicApiTransports } from \"../../shared/transports.js\";\nimport type { BaseSubscribeInput } from \"../../shared/types.js\";\nimport {\n toConnectCallOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport { isDev } from \"../../utils/is-dev.js\";\nimport * as v from \"valibot\";\nimport { parse } from \"../../shared/validation.js\";\nimport {\n GetLifecycleFlowInputSchema,\n GetLifecycleFlowOutputSchema,\n LifecycleFlowDetailSchema,\n LifecycleFlowSummarySchema,\n ListLifecycleFlowsByTxOutputSchema,\n ListLifecycleFlowsByTxInputSchema,\n ListLifecycleFlowsOutputSchema,\n ListLifecycleFlowsInputSchema,\n type GetLifecycleFlowInput,\n type GetLifecycleFlowOutput,\n type LifecycleFlowDetail,\n type LifecycleFlowSummary,\n type ListLifecycleFlowsByTxInput,\n type ListLifecycleFlowsByTxOutput,\n type ListLifecycleFlowsInput,\n type ListLifecycleFlowsOutput,\n} from \"./lifecycle.schemas.js\";\n\ninterface SubscribeOpenLifecycleFlowsInput extends BaseSubscribeInput<LifecycleFlowSummary> {\n accountId?: string;\n}\n\ninterface SubscribeLifecycleFlowDetailInput extends BaseSubscribeInput<LifecycleFlowDetail> {\n flowId: string;\n}\n\n/**\n * Reads and streams chain lifecycle flow state, history, progress, and transaction matches.\n */\nexport class LifecycleService {\n #client: Client<typeof LifecycleReadService>;\n #realtime: PolyesterRealtime;\n\n constructor(transports: PublicApiTransports, realtime: PolyesterRealtime) {\n this.#client = createClient(LifecycleReadService, transports.publicApi);\n this.#realtime = realtime;\n }\n\n /**\n * Returns paginated lifecycle flow summaries filtered by kind, state, scope, account selector, transaction reference, chain ids, and asset ids. The response is ordered by the selected timestamp and includes an opaque next page token.\n *\n * With an `accountSelector`, the list holds the flows the account owns and the\n * transfers it receives from other accounts; each row's `participation` says which.\n * Pass `participation: \"owner\"` for the owned flows only. A `pageToken` only resumes\n * the request it came from: change nothing but `limit` between pages.\n */\n async listFlows(\n input: ListLifecycleFlowsInput,\n options?: PolyesterRequestOptions,\n ): Promise<ListLifecycleFlowsOutput> {\n const parsedInput = parse(ListLifecycleFlowsInputSchema, input);\n const response = await this.#client.listFlows(parsedInput, toConnectCallOptions(options));\n const res = parse(ListLifecycleFlowsOutputSchema, response);\n return res;\n }\n\n /**\n * Fetches one lifecycle flow by its public flow id and returns summary, factual steps, timeline, and live-state detail when available.\n */\n async getFlow(\n input: GetLifecycleFlowInput,\n options?: PolyesterRequestOptions,\n ): Promise<GetLifecycleFlowOutput> {\n const parsedInput = parse(GetLifecycleFlowInputSchema, input);\n const response = await this.#client.getFlowById(\n create(GetFlowByIdRequestSchema, parsedInput),\n toConnectCallOptions(options),\n );\n return parse(GetLifecycleFlowOutputSchema, response);\n }\n\n /**\n * Searches lifecycle flows that reference a 0x-prefixed transaction hash, using source-only or any-reference lookup mode. A single transaction may match zero, one, or many flows.\n */\n async listFlowsByTx(\n input: ListLifecycleFlowsByTxInput,\n options?: PolyesterRequestOptions,\n ): Promise<ListLifecycleFlowsByTxOutput> {\n const parsedInput = parse(ListLifecycleFlowsByTxInputSchema, input);\n const response = await this.#client.listFlowsByTx(\n parsedInput,\n toConnectCallOptions(options),\n );\n return parse(ListLifecycleFlowsByTxOutputSchema, response);\n }\n\n /**\n * Subscribes to open lifecycle flow summary updates, using private:chain:lifecycle:flows:{accountId}:proto when an account id is provided and the public flow channel otherwise.\n */\n subscribeOpenFlows(input: SubscribeOpenLifecycleFlowsInput): () => void {\n const accountId = input.accountId?.trim();\n const channel = accountId\n ? `private:chain:lifecycle:flows:${accountId}:proto`\n : \"public:chain:lifecycle:flows:proto\";\n return this.#realtime.connectProtoChannel({\n channel,\n schema: FlowSummaryViewSchema,\n onPublication: (data) => {\n const flow = parse(LifecycleFlowSummarySchema, data);\n input.onEvent(flow);\n },\n onConnected: input.onOpen,\n onDisconnected: input.onClose,\n onError: input.onError,\n });\n }\n\n /**\n * Subscribes to detail updates for one lifecycle flow on public:chain:lifecycle:flow:{flowId}:proto. Invalid flow ids are rejected locally with a no-op unsubscribe function.\n */\n subscribeFlowDetail(input: SubscribeLifecycleFlowDetailInput): () => void {\n const parsedFlowId = v.safeParse(GetLifecycleFlowInputSchema, { flowId: input.flowId });\n if (!parsedFlowId.success) {\n if (isDev()) {\n console.error(\n \"[LifecycleService] flowId is required for flow detail subscription.\",\n );\n }\n return () => {};\n }\n\n const channel = `public:chain:lifecycle:flow:${parsedFlowId.output.flowId}:proto`;\n return this.#realtime.connectProtoChannel({\n channel,\n schema: FlowDetailViewSchema,\n onPublication: (data) => {\n const flow = parse(LifecycleFlowDetailSchema, data);\n input.onEvent(flow);\n },\n onConnected: input.onOpen,\n onDisconnected: input.onClose,\n onError: input.onError,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;AAgDA,IAAa,mBAAb,MAA8B;CAC1B;CACA;CAEA,YAAY,YAAiC,UAA6B;EACtE,KAAKA,UAAU,aAAa,sBAAsB,WAAW,SAAS;EACtE,KAAKC,YAAY;CACrB;;;;;;;;;CAUA,MAAM,UACF,OACA,SACiC;EACjC,MAAM,cAAc,MAAM,+BAA+B,KAAK;EAC9D,MAAM,WAAW,MAAM,KAAKD,QAAQ,UAAU,aAAa,qBAAqB,OAAO,CAAC;EAExF,OADY,MAAM,gCAAgC,QACzC;CACb;;;;CAKA,MAAM,QACF,OACA,SAC+B;EAC/B,MAAM,cAAc,MAAM,6BAA6B,KAAK;EAC5D,MAAM,WAAW,MAAM,KAAKA,QAAQ,YAChC,OAAO,0BAA0B,WAAW,GAC5C,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,8BAA8B,QAAQ;CACvD;;;;CAKA,MAAM,cACF,OACA,SACqC;EACrC,MAAM,cAAc,MAAM,mCAAmC,KAAK;EAClE,MAAM,WAAW,MAAM,KAAKA,QAAQ,cAChC,aACA,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,oCAAoC,QAAQ;CAC7D;;;;CAKA,mBAAmB,OAAqD;EACpE,MAAM,YAAY,MAAM,WAAW,KAAK;EACxC,MAAM,UAAU,YACV,iCAAiC,UAAU,UAC3C;EACN,OAAO,KAAKC,UAAU,oBAAoB;GACtC;GACA,QAAQ;GACR,gBAAgB,SAAS;IACrB,MAAM,OAAO,MAAM,4BAA4B,IAAI;IACnD,MAAM,QAAQ,IAAI;GACtB;GACA,aAAa,MAAM;GACnB,gBAAgB,MAAM;GACtB,SAAS,MAAM;EACnB,CAAC;CACL;;;;CAKA,oBAAoB,OAAsD;EACtE,MAAM,eAAe,EAAE,UAAU,6BAA6B,EAAE,QAAQ,MAAM,OAAO,CAAC;EACtF,IAAI,CAAC,aAAa,SAAS;GACvB,IAAI,MAAM,GACN,QAAQ,MACJ,qEACJ;GAEJ,aAAa,CAAC;EAClB;EAEA,MAAM,UAAU,+BAA+B,aAAa,OAAO,OAAO;EAC1E,OAAO,KAAKA,UAAU,oBAAoB;GACtC;GACA,QAAQ;GACR,gBAAgB,SAAS;IACrB,MAAM,OAAO,MAAM,2BAA2B,IAAI;IAClD,MAAM,QAAQ,IAAI;GACtB;GACA,aAAa,MAAM;GACnB,gBAAgB,MAAM;GACtB,SAAS,MAAM;EACnB,CAAC;CACL;AACJ"}
|