@polyester/sdk 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/core-client.d.ts +3 -3
  3. package/dist/core-client.d.ts.map +1 -1
  4. package/dist/core-client.js +35 -50
  5. package/dist/core-client.js.map +1 -1
  6. package/dist/services/accounts/accounts.d.ts +2 -2
  7. package/dist/services/accounts/accounts.d.ts.map +1 -1
  8. package/dist/services/accounts/accounts.js +2 -2
  9. package/dist/services/accounts/accounts.js.map +1 -1
  10. package/dist/services/address-book/address-book.d.ts +2 -2
  11. package/dist/services/address-book/address-book.d.ts.map +1 -1
  12. package/dist/services/address-book/address-book.js +2 -2
  13. package/dist/services/address-book/address-book.js.map +1 -1
  14. package/dist/services/api-keys/api-keys.d.ts +2 -2
  15. package/dist/services/api-keys/api-keys.d.ts.map +1 -1
  16. package/dist/services/api-keys/api-keys.js +3 -3
  17. package/dist/services/api-keys/api-keys.js.map +1 -1
  18. package/dist/services/auth/account-signer-auth.d.ts +3 -2
  19. package/dist/services/auth/account-signer-auth.d.ts.map +1 -1
  20. package/dist/services/auth/account-signer-auth.js.map +1 -1
  21. package/dist/services/auth/auth.d.ts +3 -7
  22. package/dist/services/auth/auth.d.ts.map +1 -1
  23. package/dist/services/auth/auth.js +1 -1
  24. package/dist/services/auth/auth.js.map +1 -1
  25. package/dist/services/auth/profile/profile.d.ts +2 -2
  26. package/dist/services/auth/profile/profile.d.ts.map +1 -1
  27. package/dist/services/auth/profile/profile.js +2 -2
  28. package/dist/services/auth/profile/profile.js.map +1 -1
  29. package/dist/services/balances/balances.d.ts +2 -2
  30. package/dist/services/balances/balances.d.ts.map +1 -1
  31. package/dist/services/balances/balances.js +2 -2
  32. package/dist/services/balances/balances.js.map +1 -1
  33. package/dist/services/candles/candles.d.ts +2 -2
  34. package/dist/services/candles/candles.d.ts.map +1 -1
  35. package/dist/services/candles/candles.js +2 -2
  36. package/dist/services/candles/candles.js.map +1 -1
  37. package/dist/services/chain-analytics/chain-analytics.d.ts +2 -2
  38. package/dist/services/chain-analytics/chain-analytics.d.ts.map +1 -1
  39. package/dist/services/chain-analytics/chain-analytics.js +2 -2
  40. package/dist/services/chain-analytics/chain-analytics.js.map +1 -1
  41. package/dist/services/deposit/deposit.d.ts +2 -2
  42. package/dist/services/deposit/deposit.d.ts.map +1 -1
  43. package/dist/services/deposit/deposit.js +2 -2
  44. package/dist/services/deposit/deposit.js.map +1 -1
  45. package/dist/services/fees/fees.d.ts +2 -2
  46. package/dist/services/fees/fees.d.ts.map +1 -1
  47. package/dist/services/fees/fees.js +2 -2
  48. package/dist/services/fees/fees.js.map +1 -1
  49. package/dist/services/guard-signer/guard-signer.d.ts +2 -2
  50. package/dist/services/guard-signer/guard-signer.d.ts.map +1 -1
  51. package/dist/services/guard-signer/guard-signer.js +2 -2
  52. package/dist/services/guard-signer/guard-signer.js.map +1 -1
  53. package/dist/services/heatmap/heatmap.d.ts +2 -2
  54. package/dist/services/heatmap/heatmap.d.ts.map +1 -1
  55. package/dist/services/heatmap/heatmap.js +2 -2
  56. package/dist/services/heatmap/heatmap.js.map +1 -1
  57. package/dist/services/internal-transfers/internal-transfers.d.ts +2 -2
  58. package/dist/services/internal-transfers/internal-transfers.d.ts.map +1 -1
  59. package/dist/services/internal-transfers/internal-transfers.js +2 -2
  60. package/dist/services/internal-transfers/internal-transfers.js.map +1 -1
  61. package/dist/services/lifecycle/lifecycle.d.ts +2 -2
  62. package/dist/services/lifecycle/lifecycle.d.ts.map +1 -1
  63. package/dist/services/lifecycle/lifecycle.js +2 -2
  64. package/dist/services/lifecycle/lifecycle.js.map +1 -1
  65. package/dist/services/lifecycle/lifecycle.schemas.d.ts +42 -42
  66. package/dist/services/market-data/market-data.d.ts +2 -2
  67. package/dist/services/market-data/market-data.d.ts.map +1 -1
  68. package/dist/services/market-data/market-data.js +2 -2
  69. package/dist/services/market-data/market-data.js.map +1 -1
  70. package/dist/services/market-overview/market-overview.d.ts +2 -2
  71. package/dist/services/market-overview/market-overview.d.ts.map +1 -1
  72. package/dist/services/market-overview/market-overview.js +2 -2
  73. package/dist/services/market-overview/market-overview.js.map +1 -1
  74. package/dist/services/mfa/mfa.d.ts +2 -2
  75. package/dist/services/mfa/mfa.d.ts.map +1 -1
  76. package/dist/services/mfa/mfa.js +2 -2
  77. package/dist/services/mfa/mfa.js.map +1 -1
  78. package/dist/services/orderbook/orderbook.d.ts +2 -2
  79. package/dist/services/orderbook/orderbook.d.ts.map +1 -1
  80. package/dist/services/orderbook/orderbook.js +2 -2
  81. package/dist/services/orderbook/orderbook.js.map +1 -1
  82. package/dist/services/orders/orders-input.schemas.d.ts +1 -1
  83. package/dist/services/orders/orders-output.schemas.d.ts +6 -6
  84. package/dist/services/orders/orders.d.ts +2 -2
  85. package/dist/services/orders/orders.d.ts.map +1 -1
  86. package/dist/services/orders/orders.js +3 -3
  87. package/dist/services/orders/orders.js.map +1 -1
  88. package/dist/services/policies/api-key-policies/api-key-policies.d.ts +2 -2
  89. package/dist/services/policies/api-key-policies/api-key-policies.d.ts.map +1 -1
  90. package/dist/services/policies/api-key-policies/api-key-policies.js +2 -2
  91. package/dist/services/policies/api-key-policies/api-key-policies.js.map +1 -1
  92. package/dist/services/policies/subaccount-policies/subaccount-policies.d.ts +2 -2
  93. package/dist/services/policies/subaccount-policies/subaccount-policies.d.ts.map +1 -1
  94. package/dist/services/policies/subaccount-policies/subaccount-policies.js +2 -2
  95. package/dist/services/policies/subaccount-policies/subaccount-policies.js.map +1 -1
  96. package/dist/services/rate-limits/rate-limits.d.ts +2 -2
  97. package/dist/services/rate-limits/rate-limits.d.ts.map +1 -1
  98. package/dist/services/rate-limits/rate-limits.js.map +1 -1
  99. package/dist/services/social-verification/social-verification.d.ts +2 -2
  100. package/dist/services/social-verification/social-verification.d.ts.map +1 -1
  101. package/dist/services/social-verification/social-verification.js +2 -2
  102. package/dist/services/social-verification/social-verification.js.map +1 -1
  103. package/dist/services/subaccounts/subaccounts.d.ts +3 -3
  104. package/dist/services/subaccounts/subaccounts.d.ts.map +1 -1
  105. package/dist/services/subaccounts/subaccounts.js +11 -9
  106. package/dist/services/subaccounts/subaccounts.js.map +1 -1
  107. package/dist/services/subaccounts/subaccounts.schemas.d.ts +4 -4
  108. package/dist/services/trades/trades.d.ts +2 -2
  109. package/dist/services/trades/trades.d.ts.map +1 -1
  110. package/dist/services/trades/trades.js +2 -2
  111. package/dist/services/trades/trades.js.map +1 -1
  112. package/dist/services/trading-withdraws/trading-withdraws.d.ts +2 -2
  113. package/dist/services/trading-withdraws/trading-withdraws.d.ts.map +1 -1
  114. package/dist/services/trading-withdraws/trading-withdraws.js +2 -2
  115. package/dist/services/trading-withdraws/trading-withdraws.js.map +1 -1
  116. package/dist/services/transfers/transfers.d.ts +2 -2
  117. package/dist/services/transfers/transfers.d.ts.map +1 -1
  118. package/dist/services/transfers/transfers.js +2 -2
  119. package/dist/services/transfers/transfers.js.map +1 -1
  120. package/dist/services/triggers/trigger-input.schemas.d.ts +1 -1
  121. package/dist/services/triggers/triggers-output.schemas.d.ts +15 -15
  122. package/dist/services/triggers/triggers.d.ts +2 -2
  123. package/dist/services/triggers/triggers.d.ts.map +1 -1
  124. package/dist/services/triggers/triggers.js +2 -2
  125. package/dist/services/triggers/triggers.js.map +1 -1
  126. package/dist/services/vip/vip.d.ts +2 -2
  127. package/dist/services/vip/vip.js.map +1 -1
  128. package/dist/services/whiteboard/whiteboard.d.ts +2 -2
  129. package/dist/services/whiteboard/whiteboard.d.ts.map +1 -1
  130. package/dist/services/whiteboard/whiteboard.js +2 -2
  131. package/dist/services/whiteboard/whiteboard.js.map +1 -1
  132. package/dist/services/zipper/zipper.d.ts +2 -2
  133. package/dist/services/zipper/zipper.d.ts.map +1 -1
  134. package/dist/services/zipper/zipper.js +2 -2
  135. package/dist/services/zipper/zipper.js.map +1 -1
  136. package/dist/shared/transports.d.ts +7 -1
  137. package/dist/shared/transports.d.ts.map +1 -1
  138. package/dist/shared/transports.js.map +1 -1
  139. package/package.json +1 -1
@@ -1,14 +1,14 @@
1
+ import { AuthApiTransports } from "../../shared/transports.js";
1
2
  import { PolyesterMutationOptions, PolyesterRequestOptions } from "../../shared/request-options.js";
2
3
  import { SubaccountResolver } from "../subaccount-resolver.js";
3
4
  import { CreateDepositAddressInput, DepositAddress, ListDepositAddressesInput } from "./deposit.schemas.js";
4
- import { Transport } from "@connectrpc/connect";
5
5
  //#region src/services/deposit/deposit.d.ts
6
6
  /**
7
7
  * Manages chain deposit addresses for root accounts and subaccounts.
8
8
  */
9
9
  declare class DepositService {
10
10
  #private;
11
- constructor(transport: Transport, resolver?: SubaccountResolver);
11
+ constructor(transports: AuthApiTransports, resolver?: SubaccountResolver);
12
12
  /**
13
13
  * Creates or returns the deposit address assigned to the resolved account target for a selected chain. Returns null if the backend response does not include an address.
14
14
  */
@@ -1 +1 @@
1
- {"version":3,"file":"deposit.d.ts","names":[],"sources":["../../../src/services/deposit/deposit.ts"],"mappings":";;;;;;;;cAuBa;;EAIG,YAAA,WAAW,WAAW,WAAW;;;;EAQvC,cACF,OAAO,2BACP,UAAU,2BACX,QAAQ;;;;EAcL,cACF,QAAO,2BACP,UAAU,0BACX,QAAQ"}
1
+ {"version":3,"file":"deposit.d.ts","names":[],"sources":["../../../src/services/deposit/deposit.ts"],"mappings":";;;;;;;;cAwBa;;EAIG,YAAA,YAAY,mBAAmB,WAAW;;;;EAQhD,cACF,OAAO,2BACP,UAAU,2BACX,QAAQ;;;;EAcL,cACF,QAAO,2BACP,UAAU,0BACX,QAAQ"}
@@ -12,8 +12,8 @@ import { createClient } from "@connectrpc/connect";
12
12
  var DepositService = class {
13
13
  #client;
14
14
  #resolver;
15
- constructor(transport, resolver) {
16
- this.#client = createClient(DepositAddressService, transport);
15
+ constructor(transports, resolver) {
16
+ this.#client = createClient(DepositAddressService, transports.authApi);
17
17
  this.#resolver = resolver;
18
18
  }
19
19
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"deposit.js","names":["#client","Proto.DepositAddressService","#resolver"],"sources":["../../../src/services/deposit/deposit.ts"],"sourcesContent":["import { createClient, type Client, type Transport } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/chain/deposit/v1/deposit_pb.js\";\nimport { removeUndefined } from \"../../utils/remove-undefined.js\";\nimport { type SubaccountResolver, resolveAccountScopedInput } from \"../subaccount-resolver.js\";\nimport {\n toConnectCallOptions,\n type PolyesterMutationOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport { parse } from \"../../shared/validation.js\";\nimport {\n CreateDepositAddressInputSchema,\n DepositAddressSchema,\n DepositAddressesSchema,\n ListDepositAddressesInputSchema,\n type CreateDepositAddressInput,\n type ListDepositAddressesInput,\n type DepositAddress,\n} from \"./deposit.schemas.js\";\n\n/**\n * Manages chain deposit addresses for root accounts and subaccounts.\n */\nexport class DepositService {\n #client: Client<typeof Proto.DepositAddressService>;\n #resolver?: SubaccountResolver;\n\n constructor(transport: Transport, resolver?: SubaccountResolver) {\n this.#client = createClient(Proto.DepositAddressService, transport);\n this.#resolver = resolver;\n }\n\n /**\n * Creates or returns the deposit address assigned to the resolved account target for a selected chain. Returns null if the backend response does not include an address.\n */\n async createAddress(\n input: CreateDepositAddressInput,\n options?: PolyesterMutationOptions,\n ): Promise<DepositAddress | null> {\n const resolvedInput = resolveAccountScopedInput(input, this.#resolver);\n const validatedInput = parse(CreateDepositAddressInputSchema, resolvedInput);\n const res = await this.#client.createDepositAddress(\n removeUndefined(validatedInput),\n toConnectCallOptions(options),\n );\n if (!res.depositAddress) return null;\n return parse(DepositAddressSchema, res.depositAddress);\n }\n\n /**\n * Lists known deposit addresses for the resolved account target, optionally filtered by chain. Results are ordered by ascending chain id in the generated proto contract.\n */\n async listAddresses(\n input: ListDepositAddressesInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<DepositAddress[]> {\n const resolvedInput = resolveAccountScopedInput(input, this.#resolver);\n const validatedInput = parse(ListDepositAddressesInputSchema, resolvedInput);\n const res = await this.#client.listDepositAddresses(\n removeUndefined(validatedInput),\n toConnectCallOptions(options),\n );\n return parse(DepositAddressesSchema, res.depositAddresses);\n }\n}\n"],"mappings":";;;;;;;;;;;AAuBA,IAAa,iBAAb,MAA4B;CACxB;CACA;CAEA,YAAY,WAAsB,UAA+B;EAC7D,KAAKA,UAAU,aAAaC,uBAA6B,SAAS;EAClE,KAAKC,YAAY;CACrB;;;;CAKA,MAAM,cACF,OACA,SAC8B;EAC9B,MAAM,gBAAgB,0BAA0B,OAAO,KAAKA,SAAS;EACrE,MAAM,iBAAiB,MAAM,iCAAiC,aAAa;EAC3E,MAAM,MAAM,MAAM,KAAKF,QAAQ,qBAC3B,gBAAgB,cAAc,GAC9B,qBAAqB,OAAO,CAChC;EACA,IAAI,CAAC,IAAI,gBAAgB,OAAO;EAChC,OAAO,MAAM,sBAAsB,IAAI,cAAc;CACzD;;;;CAKA,MAAM,cACF,QAAmC,CAAC,GACpC,SACyB;EACzB,MAAM,gBAAgB,0BAA0B,OAAO,KAAKE,SAAS;EACrE,MAAM,iBAAiB,MAAM,iCAAiC,aAAa;EAC3E,MAAM,MAAM,MAAM,KAAKF,QAAQ,qBAC3B,gBAAgB,cAAc,GAC9B,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,wBAAwB,IAAI,gBAAgB;CAC7D;AACJ"}
1
+ {"version":3,"file":"deposit.js","names":["#client","Proto.DepositAddressService","#resolver"],"sources":["../../../src/services/deposit/deposit.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/chain/deposit/v1/deposit_pb.js\";\nimport type { AuthApiTransports } from \"../../shared/transports.js\";\nimport { removeUndefined } from \"../../utils/remove-undefined.js\";\nimport { type SubaccountResolver, resolveAccountScopedInput } from \"../subaccount-resolver.js\";\nimport {\n toConnectCallOptions,\n type PolyesterMutationOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport { parse } from \"../../shared/validation.js\";\nimport {\n CreateDepositAddressInputSchema,\n DepositAddressSchema,\n DepositAddressesSchema,\n ListDepositAddressesInputSchema,\n type CreateDepositAddressInput,\n type ListDepositAddressesInput,\n type DepositAddress,\n} from \"./deposit.schemas.js\";\n\n/**\n * Manages chain deposit addresses for root accounts and subaccounts.\n */\nexport class DepositService {\n #client: Client<typeof Proto.DepositAddressService>;\n #resolver?: SubaccountResolver;\n\n constructor(transports: AuthApiTransports, resolver?: SubaccountResolver) {\n this.#client = createClient(Proto.DepositAddressService, transports.authApi);\n this.#resolver = resolver;\n }\n\n /**\n * Creates or returns the deposit address assigned to the resolved account target for a selected chain. Returns null if the backend response does not include an address.\n */\n async createAddress(\n input: CreateDepositAddressInput,\n options?: PolyesterMutationOptions,\n ): Promise<DepositAddress | null> {\n const resolvedInput = resolveAccountScopedInput(input, this.#resolver);\n const validatedInput = parse(CreateDepositAddressInputSchema, resolvedInput);\n const res = await this.#client.createDepositAddress(\n removeUndefined(validatedInput),\n toConnectCallOptions(options),\n );\n if (!res.depositAddress) return null;\n return parse(DepositAddressSchema, res.depositAddress);\n }\n\n /**\n * Lists known deposit addresses for the resolved account target, optionally filtered by chain. Results are ordered by ascending chain id in the generated proto contract.\n */\n async listAddresses(\n input: ListDepositAddressesInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<DepositAddress[]> {\n const resolvedInput = resolveAccountScopedInput(input, this.#resolver);\n const validatedInput = parse(ListDepositAddressesInputSchema, resolvedInput);\n const res = await this.#client.listDepositAddresses(\n removeUndefined(validatedInput),\n toConnectCallOptions(options),\n );\n return parse(DepositAddressesSchema, res.depositAddresses);\n }\n}\n"],"mappings":";;;;;;;;;;;AAwBA,IAAa,iBAAb,MAA4B;CACxB;CACA;CAEA,YAAY,YAA+B,UAA+B;EACtE,KAAKA,UAAU,aAAaC,uBAA6B,WAAW,OAAO;EAC3E,KAAKC,YAAY;CACrB;;;;CAKA,MAAM,cACF,OACA,SAC8B;EAC9B,MAAM,gBAAgB,0BAA0B,OAAO,KAAKA,SAAS;EACrE,MAAM,iBAAiB,MAAM,iCAAiC,aAAa;EAC3E,MAAM,MAAM,MAAM,KAAKF,QAAQ,qBAC3B,gBAAgB,cAAc,GAC9B,qBAAqB,OAAO,CAChC;EACA,IAAI,CAAC,IAAI,gBAAgB,OAAO;EAChC,OAAO,MAAM,sBAAsB,IAAI,cAAc;CACzD;;;;CAKA,MAAM,cACF,QAAmC,CAAC,GACpC,SACyB;EACzB,MAAM,gBAAgB,0BAA0B,OAAO,KAAKE,SAAS;EACrE,MAAM,iBAAiB,MAAM,iCAAiC,aAAa;EAC3E,MAAM,MAAM,MAAM,KAAKF,QAAQ,qBAC3B,gBAAgB,cAAc,GAC9B,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,wBAAwB,IAAI,gBAAgB;CAC7D;AACJ"}
@@ -1,14 +1,14 @@
1
+ import { AuthApiTransports } from "../../shared/transports.js";
1
2
  import { PolyesterRequestOptions } from "../../shared/request-options.js";
2
3
  import { SubaccountResolver } from "../subaccount-resolver.js";
3
4
  import { GetSpotFeeRatesInput, SpotFeeRate } from "./fees.schemas.js";
4
- import { Transport } from "@connectrpc/connect";
5
5
  //#region src/services/fees/fees.d.ts
6
6
  /**
7
7
  * Reads authenticated effective spot trading fee rates.
8
8
  */
9
9
  declare class FeesService {
10
10
  #private;
11
- constructor(transport: Transport, resolver?: SubaccountResolver);
11
+ constructor(transports: AuthApiTransports, resolver?: SubaccountResolver);
12
12
  /**
13
13
  * Returns effective maker and taker spot fee rates for the resolved account target, optionally filtered by market identifier.
14
14
  */
@@ -1 +1 @@
1
- {"version":3,"file":"fees.d.ts","names":[],"sources":["../../../src/services/fees/fees.ts"],"mappings":";;;;;;;;cAmBa;;EAIG,YAAA,WAAW,WAAW,WAAW;;;;EAQvC,aACF,QAAO,sBACP,UAAU,0BACX,QAAQ"}
1
+ {"version":3,"file":"fees.d.ts","names":[],"sources":["../../../src/services/fees/fees.ts"],"mappings":";;;;;;;;cAoBa;;EAIG,YAAA,YAAY,mBAAmB,WAAW;;;;EAQhD,aACF,QAAO,sBACP,UAAU,0BACX,QAAQ"}
@@ -12,8 +12,8 @@ import { createClient } from "@connectrpc/connect";
12
12
  var FeesService = class {
13
13
  #client;
14
14
  #resolver;
15
- constructor(transport, resolver) {
16
- this.#client = createClient(FeeService, transport);
15
+ constructor(transports, resolver) {
16
+ this.#client = createClient(FeeService, transports.authApi);
17
17
  this.#resolver = resolver;
18
18
  }
19
19
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"fees.js","names":["#client","Proto.FeeService","#resolver"],"sources":["../../../src/services/fees/fees.ts"],"sourcesContent":["import { createClient, type Client, type Transport } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/fees/v1/fees_pb.js\";\nimport { removeUndefined } from \"../../utils/remove-undefined.js\";\nimport { type SubaccountResolver, resolveAccountScopedInput } from \"../subaccount-resolver.js\";\nimport {\n toConnectCallOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport { parse } from \"../../shared/validation.js\";\nimport {\n GetSpotFeeRatesInputSchema,\n SpotFeeRatesSchema,\n type GetSpotFeeRatesInput,\n type SpotFeeRate,\n} from \"./fees.schemas.js\";\n\n/**\n * Reads authenticated effective spot trading fee rates.\n */\nexport class FeesService {\n #client: Client<typeof Proto.FeeService>;\n #resolver?: SubaccountResolver;\n\n constructor(transport: Transport, resolver?: SubaccountResolver) {\n this.#client = createClient(Proto.FeeService, transport);\n this.#resolver = resolver;\n }\n\n /**\n * Returns effective maker and taker spot fee rates for the resolved account target, optionally filtered by market identifier.\n */\n async getSpotRates(\n input: GetSpotFeeRatesInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<SpotFeeRate[]> {\n const resolvedInput = resolveAccountScopedInput(input, this.#resolver);\n const validatedInput = parse(GetSpotFeeRatesInputSchema, resolvedInput);\n const res = await this.#client.getSpotFeeRates(\n removeUndefined(validatedInput),\n toConnectCallOptions(options),\n );\n return parse(SpotFeeRatesSchema, res.feeRates);\n }\n}\n"],"mappings":";;;;;;;;;;;AAmBA,IAAa,cAAb,MAAyB;CACrB;CACA;CAEA,YAAY,WAAsB,UAA+B;EAC7D,KAAKA,UAAU,aAAaC,YAAkB,SAAS;EACvD,KAAKC,YAAY;CACrB;;;;CAKA,MAAM,aACF,QAA8B,CAAC,GAC/B,SACsB;EACtB,MAAM,gBAAgB,0BAA0B,OAAO,KAAKA,SAAS;EACrE,MAAM,iBAAiB,MAAM,4BAA4B,aAAa;EACtE,MAAM,MAAM,MAAM,KAAKF,QAAQ,gBAC3B,gBAAgB,cAAc,GAC9B,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,oBAAoB,IAAI,QAAQ;CACjD;AACJ"}
1
+ {"version":3,"file":"fees.js","names":["#client","Proto.FeeService","#resolver"],"sources":["../../../src/services/fees/fees.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/fees/v1/fees_pb.js\";\nimport type { AuthApiTransports } from \"../../shared/transports.js\";\nimport { removeUndefined } from \"../../utils/remove-undefined.js\";\nimport { type SubaccountResolver, resolveAccountScopedInput } from \"../subaccount-resolver.js\";\nimport {\n toConnectCallOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport { parse } from \"../../shared/validation.js\";\nimport {\n GetSpotFeeRatesInputSchema,\n SpotFeeRatesSchema,\n type GetSpotFeeRatesInput,\n type SpotFeeRate,\n} from \"./fees.schemas.js\";\n\n/**\n * Reads authenticated effective spot trading fee rates.\n */\nexport class FeesService {\n #client: Client<typeof Proto.FeeService>;\n #resolver?: SubaccountResolver;\n\n constructor(transports: AuthApiTransports, resolver?: SubaccountResolver) {\n this.#client = createClient(Proto.FeeService, transports.authApi);\n this.#resolver = resolver;\n }\n\n /**\n * Returns effective maker and taker spot fee rates for the resolved account target, optionally filtered by market identifier.\n */\n async getSpotRates(\n input: GetSpotFeeRatesInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<SpotFeeRate[]> {\n const resolvedInput = resolveAccountScopedInput(input, this.#resolver);\n const validatedInput = parse(GetSpotFeeRatesInputSchema, resolvedInput);\n const res = await this.#client.getSpotFeeRates(\n removeUndefined(validatedInput),\n toConnectCallOptions(options),\n );\n return parse(SpotFeeRatesSchema, res.feeRates);\n }\n}\n"],"mappings":";;;;;;;;;;;AAoBA,IAAa,cAAb,MAAyB;CACrB;CACA;CAEA,YAAY,YAA+B,UAA+B;EACtE,KAAKA,UAAU,aAAaC,YAAkB,WAAW,OAAO;EAChE,KAAKC,YAAY;CACrB;;;;CAKA,MAAM,aACF,QAA8B,CAAC,GAC/B,SACsB;EACtB,MAAM,gBAAgB,0BAA0B,OAAO,KAAKA,SAAS;EACrE,MAAM,iBAAiB,MAAM,4BAA4B,aAAa;EACtE,MAAM,MAAM,MAAM,KAAKF,QAAQ,gBAC3B,gBAAgB,cAAc,GAC9B,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,oBAAoB,IAAI,QAAQ;CACjD;AACJ"}
@@ -1,14 +1,14 @@
1
+ import { AuthApiTransports } from "../../shared/transports.js";
1
2
  import { PolyesterMutationOptions, PolyesterRequestOptions } from "../../shared/request-options.js";
2
3
  import { SubaccountResolver } from "../subaccount-resolver.js";
3
4
  import { BatchGuardApprovals, BatchSignProtectedActionInput, CreateGuardSignerWalletResult, ExportGuardSignerWalletResult, GuardApproval, GuardSignerScopedInput, GuardSignerStatus, RotateGuardSignerWalletResult, SignProtectedActionInput } from "./guard-signer.schemas.js";
4
- import { Transport } from "@connectrpc/connect";
5
5
  //#region src/services/guard-signer/guard-signer.d.ts
6
6
  /**
7
7
  * Manages backend guard signer wallets and approval signatures for protected Polyester account actions.
8
8
  */
9
9
  declare class GuardSignerService {
10
10
  #private;
11
- constructor(transport: Transport, resolver?: SubaccountResolver);
11
+ constructor(transports: AuthApiTransports, resolver?: SubaccountResolver);
12
12
  /**
13
13
  * Creates a guard signer wallet for the resolved account target and returns the generated signer EVM address.
14
14
  */
@@ -1 +1 @@
1
- {"version":3,"file":"guard-signer.d.ts","names":[],"sources":["../../../src/services/guard-signer/guard-signer.ts"],"mappings":";;;;;;;;cA4Ca;;EAIG,YAAA,WAAW,WAAW,WAAW;;;;EAQvC,aACF,QAAO,wBACP,UAAU,2BACX,QAAQ;;;;EAYL,UACF,QAAO,wBACP,UAAU,0BACX,QAAQ;;;;EAiBL,oBACF,OAAO,0BACP,UAAU,2BACX,QAAQ;;;;EAYL,0BACF,OAAO,+BACP,UAAU,2BACX,QAAQ;;;;EAiBL,aACF,QAAO,wBACP,UAAU,2BACX,QAAQ;;;;EAYL,aACF,QAAO,wBACP,UAAU,2BACX,QAAQ;UASH"}
1
+ {"version":3,"file":"guard-signer.d.ts","names":[],"sources":["../../../src/services/guard-signer/guard-signer.ts"],"mappings":";;;;;;;;cA6Ca;;EAIG,YAAA,YAAY,mBAAmB,WAAW;;;;EAQhD,aACF,QAAO,wBACP,UAAU,2BACX,QAAQ;;;;EAYL,UACF,QAAO,wBACP,UAAU,0BACX,QAAQ;;;;EAiBL,oBACF,OAAO,0BACP,UAAU,2BACX,QAAQ;;;;EAYL,0BACF,OAAO,+BACP,UAAU,2BACX,QAAQ;;;;EAiBL,aACF,QAAO,wBACP,UAAU,2BACX,QAAQ;;;;EAYL,aACF,QAAO,wBACP,UAAU,2BACX,QAAQ;UASH"}
@@ -17,8 +17,8 @@ function isGuardSignerWalletNotFoundError(err) {
17
17
  var GuardSignerService = class {
18
18
  #client;
19
19
  #resolver;
20
- constructor(transport, resolver) {
21
- this.#client = createClient(GuardSignerService$1, transport);
20
+ constructor(transports, resolver) {
21
+ this.#client = createClient(GuardSignerService$1, transports.authApi);
22
22
  this.#resolver = resolver;
23
23
  }
24
24
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"guard-signer.js","names":["#client","Proto.GuardSignerService","#resolver"],"sources":["../../../src/services/guard-signer/guard-signer.ts"],"sourcesContent":["import { createClient, type Client, type Transport } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/chain/guard/v1/guard_signer_pb.js\";\nimport { removeUndefined } from \"../../utils/remove-undefined.js\";\nimport {\n toConnectCallOptions,\n type PolyesterMutationOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport { type SubaccountResolver, resolveAccountScopedInput } from \"../subaccount-resolver.js\";\nimport type { AccountScopedInput } from \"../../shared/account-scope.js\";\nimport {\n BatchGuardApprovalsSchema,\n BatchSignProtectedActionInputSchema,\n CreateGuardSignerWalletResultSchema,\n ExportGuardSignerWalletResultSchema,\n GuardApprovalSchema,\n GuardSignerScopedInputSchema,\n GuardSignerStatusSchema,\n RotateGuardSignerWalletResultSchema,\n SignProtectedActionInputSchema,\n type BatchGuardApprovals,\n type BatchSignProtectedActionInput,\n type CreateGuardSignerWalletResult,\n type ExportGuardSignerWalletResult,\n type GuardApproval,\n type GuardSignerScopedInput,\n type GuardSignerStatus,\n type RotateGuardSignerWalletResult,\n type SignProtectedActionInput,\n} from \"./guard-signer.schemas.js\";\nimport { formatConnectError, isResourceNotFoundError } from \"../../utils/errors.js\";\nimport { parse } from \"../../shared/validation.js\";\n\nconst GUARD_SIGNER_WALLET_NOT_FOUND_MESSAGE = \"guard signer wallet not found\";\n\nfunction isGuardSignerWalletNotFoundError(err: unknown): boolean {\n return formatConnectError(err, \"\")\n .toLowerCase()\n .includes(GUARD_SIGNER_WALLET_NOT_FOUND_MESSAGE);\n}\n\n/**\n * Manages backend guard signer wallets and approval signatures for protected Polyester account actions.\n */\nexport class GuardSignerService {\n #client: Client<typeof Proto.GuardSignerService>;\n #resolver?: SubaccountResolver;\n\n constructor(transport: Transport, resolver?: SubaccountResolver) {\n this.#client = createClient(Proto.GuardSignerService, transport);\n this.#resolver = resolver;\n }\n\n /**\n * Creates a guard signer wallet for the resolved account target and returns the generated signer EVM address.\n */\n async createWallet(\n input: GuardSignerScopedInput = {},\n options?: PolyesterMutationOptions,\n ): Promise<CreateGuardSignerWalletResult> {\n const request = parse(GuardSignerScopedInputSchema, this.resolveInput(input));\n const response = await this.#client.createGuardSignerWallet(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(CreateGuardSignerWalletResultSchema, response);\n }\n\n /**\n * Returns stored and live guard signer status for the resolved account target, including signer address, on-chain signer, initialization state, nonce, and nonce space. Returns null when the backend reports the wallet is not found.\n */\n async getStatus(\n input: GuardSignerScopedInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<GuardSignerStatus | null> {\n const request = parse(GuardSignerScopedInputSchema, this.resolveInput(input));\n try {\n const response = await this.#client.getGuardSignerStatus(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return response.status ? parse(GuardSignerStatusSchema, response.status) : null;\n } catch (err) {\n if (isResourceNotFoundError(err) || isGuardSignerWalletNotFoundError(err)) return null;\n throw err;\n }\n }\n\n /**\n * Creates one guard approval signature for a supported protected action, such as whitelist updates or whitelist requirement changes. Returns null if the backend response has no approval payload.\n */\n async signProtectedAction(\n input: SignProtectedActionInput,\n options?: PolyesterMutationOptions,\n ): Promise<GuardApproval | null> {\n const request = parse(SignProtectedActionInputSchema, this.resolveInput(input));\n const response = await this.#client.signProtectedAction(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return response.approval ? parse(GuardApprovalSchema, response.approval) : null;\n }\n\n /**\n * Creates ordered guard approval signatures for a batch of protected actions and verifies the backend returned one approval per requested action.\n */\n async batchSignProtectedActions(\n input: BatchSignProtectedActionInput,\n options?: PolyesterMutationOptions,\n ): Promise<BatchGuardApprovals> {\n const request = parse(BatchSignProtectedActionInputSchema, this.resolveInput(input));\n const response = await this.#client.batchSignProtectedActions(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n\n if (response.approvals.length !== input.actions.length) {\n throw new Error(\"Backend returned a mismatched number of GuardSigner approvals.\");\n }\n\n return parse(BatchGuardApprovalsSchema, response);\n }\n\n /**\n * Generates a backend-managed replacement guard signer for the resolved account target and returns the new signer address plus the rotation approval payload.\n */\n async rotateWallet(\n input: GuardSignerScopedInput = {},\n options?: PolyesterMutationOptions,\n ): Promise<RotateGuardSignerWalletResult> {\n const request = parse(GuardSignerScopedInputSchema, this.resolveInput(input));\n const response = await this.#client.rotateGuardSignerWallet(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(RotateGuardSignerWalletResultSchema, response);\n }\n\n /**\n * Exports guard signer private key material for the resolved account target after owner authorization and fresh step-up, returning the backend export response.\n */\n async exportWallet(\n input: GuardSignerScopedInput = {},\n options?: PolyesterMutationOptions,\n ): Promise<ExportGuardSignerWalletResult> {\n const request = parse(GuardSignerScopedInputSchema, this.resolveInput(input));\n const response = await this.#client.exportGuardSignerWallet(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(ExportGuardSignerWalletResultSchema, response);\n }\n\n private resolveInput<TInput extends AccountScopedInput>(input: TInput): TInput {\n return resolveAccountScopedInput(input, this.#resolver);\n }\n}\n"],"mappings":";;;;;;;;;AAiCA,MAAM,wCAAwC;AAE9C,SAAS,iCAAiC,KAAuB;CAC7D,OAAO,mBAAmB,KAAK,EAAE,CAAC,CAC7B,YAAY,CAAC,CACb,SAAS,qCAAqC;AACvD;;;;AAKA,IAAa,qBAAb,MAAgC;CAC5B;CACA;CAEA,YAAY,WAAsB,UAA+B;EAC7D,KAAKA,UAAU,aAAaC,sBAA0B,SAAS;EAC/D,KAAKC,YAAY;CACrB;;;;CAKA,MAAM,aACF,QAAgC,CAAC,GACjC,SACsC;EACtC,MAAM,UAAU,MAAM,8BAA8B,KAAK,aAAa,KAAK,CAAC;EAC5E,MAAM,WAAW,MAAM,KAAKF,QAAQ,wBAChC,gBAAgB,OAAO,GACvB,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,qCAAqC,QAAQ;CAC9D;;;;CAKA,MAAM,UACF,QAAgC,CAAC,GACjC,SACiC;EACjC,MAAM,UAAU,MAAM,8BAA8B,KAAK,aAAa,KAAK,CAAC;EAC5E,IAAI;GACA,MAAM,WAAW,MAAM,KAA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;EAC3E,OAAO,0BAA0B,OAAO,KAAKE,SAAS;CAC1D;AACJ"}
1
+ {"version":3,"file":"guard-signer.js","names":["#client","Proto.GuardSignerService","#resolver"],"sources":["../../../src/services/guard-signer/guard-signer.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/chain/guard/v1/guard_signer_pb.js\";\nimport type { AuthApiTransports } from \"../../shared/transports.js\";\nimport { removeUndefined } from \"../../utils/remove-undefined.js\";\nimport {\n toConnectCallOptions,\n type PolyesterMutationOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport { type SubaccountResolver, resolveAccountScopedInput } from \"../subaccount-resolver.js\";\nimport type { AccountScopedInput } from \"../../shared/account-scope.js\";\nimport {\n BatchGuardApprovalsSchema,\n BatchSignProtectedActionInputSchema,\n CreateGuardSignerWalletResultSchema,\n ExportGuardSignerWalletResultSchema,\n GuardApprovalSchema,\n GuardSignerScopedInputSchema,\n GuardSignerStatusSchema,\n RotateGuardSignerWalletResultSchema,\n SignProtectedActionInputSchema,\n type BatchGuardApprovals,\n type BatchSignProtectedActionInput,\n type CreateGuardSignerWalletResult,\n type ExportGuardSignerWalletResult,\n type GuardApproval,\n type GuardSignerScopedInput,\n type GuardSignerStatus,\n type RotateGuardSignerWalletResult,\n type SignProtectedActionInput,\n} from \"./guard-signer.schemas.js\";\nimport { formatConnectError, isResourceNotFoundError } from \"../../utils/errors.js\";\nimport { parse } from \"../../shared/validation.js\";\n\nconst GUARD_SIGNER_WALLET_NOT_FOUND_MESSAGE = \"guard signer wallet not found\";\n\nfunction isGuardSignerWalletNotFoundError(err: unknown): boolean {\n return formatConnectError(err, \"\")\n .toLowerCase()\n .includes(GUARD_SIGNER_WALLET_NOT_FOUND_MESSAGE);\n}\n\n/**\n * Manages backend guard signer wallets and approval signatures for protected Polyester account actions.\n */\nexport class GuardSignerService {\n #client: Client<typeof Proto.GuardSignerService>;\n #resolver?: SubaccountResolver;\n\n constructor(transports: AuthApiTransports, resolver?: SubaccountResolver) {\n this.#client = createClient(Proto.GuardSignerService, transports.authApi);\n this.#resolver = resolver;\n }\n\n /**\n * Creates a guard signer wallet for the resolved account target and returns the generated signer EVM address.\n */\n async createWallet(\n input: GuardSignerScopedInput = {},\n options?: PolyesterMutationOptions,\n ): Promise<CreateGuardSignerWalletResult> {\n const request = parse(GuardSignerScopedInputSchema, this.resolveInput(input));\n const response = await this.#client.createGuardSignerWallet(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(CreateGuardSignerWalletResultSchema, response);\n }\n\n /**\n * Returns stored and live guard signer status for the resolved account target, including signer address, on-chain signer, initialization state, nonce, and nonce space. Returns null when the backend reports the wallet is not found.\n */\n async getStatus(\n input: GuardSignerScopedInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<GuardSignerStatus | null> {\n const request = parse(GuardSignerScopedInputSchema, this.resolveInput(input));\n try {\n const response = await this.#client.getGuardSignerStatus(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return response.status ? parse(GuardSignerStatusSchema, response.status) : null;\n } catch (err) {\n if (isResourceNotFoundError(err) || isGuardSignerWalletNotFoundError(err)) return null;\n throw err;\n }\n }\n\n /**\n * Creates one guard approval signature for a supported protected action, such as whitelist updates or whitelist requirement changes. Returns null if the backend response has no approval payload.\n */\n async signProtectedAction(\n input: SignProtectedActionInput,\n options?: PolyesterMutationOptions,\n ): Promise<GuardApproval | null> {\n const request = parse(SignProtectedActionInputSchema, this.resolveInput(input));\n const response = await this.#client.signProtectedAction(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return response.approval ? parse(GuardApprovalSchema, response.approval) : null;\n }\n\n /**\n * Creates ordered guard approval signatures for a batch of protected actions and verifies the backend returned one approval per requested action.\n */\n async batchSignProtectedActions(\n input: BatchSignProtectedActionInput,\n options?: PolyesterMutationOptions,\n ): Promise<BatchGuardApprovals> {\n const request = parse(BatchSignProtectedActionInputSchema, this.resolveInput(input));\n const response = await this.#client.batchSignProtectedActions(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n\n if (response.approvals.length !== input.actions.length) {\n throw new Error(\"Backend returned a mismatched number of GuardSigner approvals.\");\n }\n\n return parse(BatchGuardApprovalsSchema, response);\n }\n\n /**\n * Generates a backend-managed replacement guard signer for the resolved account target and returns the new signer address plus the rotation approval payload.\n */\n async rotateWallet(\n input: GuardSignerScopedInput = {},\n options?: PolyesterMutationOptions,\n ): Promise<RotateGuardSignerWalletResult> {\n const request = parse(GuardSignerScopedInputSchema, this.resolveInput(input));\n const response = await this.#client.rotateGuardSignerWallet(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(RotateGuardSignerWalletResultSchema, response);\n }\n\n /**\n * Exports guard signer private key material for the resolved account target after owner authorization and fresh step-up, returning the backend export response.\n */\n async exportWallet(\n input: GuardSignerScopedInput = {},\n options?: PolyesterMutationOptions,\n ): Promise<ExportGuardSignerWalletResult> {\n const request = parse(GuardSignerScopedInputSchema, this.resolveInput(input));\n const response = await this.#client.exportGuardSignerWallet(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(ExportGuardSignerWalletResultSchema, response);\n }\n\n private resolveInput<TInput extends AccountScopedInput>(input: TInput): TInput {\n return resolveAccountScopedInput(input, this.#resolver);\n }\n}\n"],"mappings":";;;;;;;;;AAkCA,MAAM,wCAAwC;AAE9C,SAAS,iCAAiC,KAAuB;CAC7D,OAAO,mBAAmB,KAAK,EAAE,CAAC,CAC7B,YAAY,CAAC,CACb,SAAS,qCAAqC;AACvD;;;;AAKA,IAAa,qBAAb,MAAgC;CAC5B;CACA;CAEA,YAAY,YAA+B,UAA+B;EACtE,KAAKA,UAAU,aAAaC,sBAA0B,WAAW,OAAO;EACxE,KAAKC,YAAY;CACrB;;;;CAKA,MAAM,aACF,QAAgC,CAAC,GACjC,SACsC;EACtC,MAAM,UAAU,MAAM,8BAA8B,KAAK,aAAa,KAAK,CAAC;EAC5E,MAAM,WAAW,MAAM,KAAKF,QAAQ,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,QAAgC,CAAC,GACjC,SACsC;EACtC,MAAM,UAAU,MAAM,8BAA8B,KAAK,aAAa,KAAK,CAAC;EAC5E,MAAM,WAAW,MAAM,KAAKA,QAAQ,wBAChC,gBAAgB,OAAO,GACvB,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,qCAAqC,QAAQ;CAC9D;CAEA,aAAwD,OAAuB;EAC3E,OAAO,0BAA0B,OAAO,KAAKE,SAAS;CAC1D;AACJ"}
@@ -1,10 +1,10 @@
1
+ import { PublicApiTransports } from "../../shared/transports.js";
1
2
  import { PolyesterRequestOptions } from "../../shared/request-options.js";
2
3
  import { PolyesterRealtime } from "../../realtime/types.js";
3
4
  import { BaseSubscribeInput } from "../../shared/types.js";
4
5
  import { SdkScales } from "../../shared/decimal-surface.js";
5
6
  import { HeatmapIntervalValue } from "./heatmap.codecs.js";
6
7
  import { GetOrderbookHeatmapInput, OrderbookHeatmapLiveBucket, OrderbookHeatmapResponse } from "./heatmap.schemas.js";
7
- import { Transport } from "@connectrpc/connect";
8
8
  //#region src/services/heatmap/heatmap.d.ts
9
9
  interface OrderbookHeatmapProvider {
10
10
  getOrderbookHeatmap(input: GetOrderbookHeatmapInput, options?: PolyesterRequestOptions): Promise<OrderbookHeatmapResponse>;
@@ -18,7 +18,7 @@ interface SubscribeHeatmapLiveInput extends BaseSubscribeInput<OrderbookHeatmapL
18
18
  */
19
19
  declare class HeatmapService implements OrderbookHeatmapProvider {
20
20
  #private;
21
- constructor(transport: Transport, realtime: PolyesterRealtime, scales: SdkScales);
21
+ constructor(transports: PublicApiTransports, realtime: PolyesterRealtime, scales: SdkScales);
22
22
  /**
23
23
  * Fetches order book heatmap data for a symbol, interval, depth, and quantity mode using either an absolute time range or cursor pagination. The response includes a keyframe anchor, delta buckets, pagination metadata, and live-anchor fields when available.
24
24
  */
@@ -1 +1 @@
1
- {"version":3,"file":"heatmap.d.ts","names":[],"sources":["../../../src/services/heatmap/heatmap.ts"],"mappings":";;;;;;;;UA2BiB;EACb,oBACI,OAAO,0BACP,UAAU,0BACX,QAAQ;;UAGL,kCAAkC,mBAAmB;EAC3D;EACA,UAAU;;;;;cAWD,0BAA0B;;EAOvB,YAAA,WAAW,WAAW,UAAU,mBAAmB,QAAQ;;;;EAWjE,oBACF,OAAO,0BACP,UAAU,0BACX,QAAQ;;;;EA4BX,cAAc,OAAO"}
1
+ {"version":3,"file":"heatmap.d.ts","names":[],"sources":["../../../src/services/heatmap/heatmap.ts"],"mappings":";;;;;;;;UA4BiB;EACb,oBACI,OAAO,0BACP,UAAU,0BACX,QAAQ;;UAGL,kCAAkC,mBAAmB;EAC3D;EACA,UAAU;;;;;cAWD,0BAA0B;;EAOvB,YAAA,YAAY,qBAAqB,UAAU,mBAAmB,QAAQ;;;;EAW5E,oBACF,OAAO,0BACP,UAAU,0BACX,QAAQ;;;;EA4BX,cAAc,OAAO"}
@@ -21,8 +21,8 @@ var HeatmapService = class {
21
21
  #scales;
22
22
  #responseSchema;
23
23
  #liveBucketSchema;
24
- constructor(transport, realtime, scales) {
25
- this.#client = createClient(HeatmapService$1, transport);
24
+ constructor(transports, realtime, scales) {
25
+ this.#client = createClient(HeatmapService$1, transports.publicApi);
26
26
  this.#realtime = realtime;
27
27
  this.#scales = scales;
28
28
  this.#responseSchema = createOrderbookHeatmapResponseSchema(scales);
@@ -1 +1 @@
1
- {"version":3,"file":"heatmap.js","names":["#client","HeatmapRpc","#realtime","#scales","#responseSchema","#liveBucketSchema","ProtoHeatmapLiveBucketSchema"],"sources":["../../../src/services/heatmap/heatmap.ts"],"sourcesContent":["import { createClient, type Client, type Transport } from \"@connectrpc/connect\";\nimport { create } from \"@bufbuild/protobuf\";\nimport {\n HeatmapService as HeatmapRpc,\n HeatmapLiveBucketSchema as ProtoHeatmapLiveBucketSchema,\n HeatmapTimeRangeSchema,\n} from \"../../gen/marketdata/v1/heatmap_pb.js\";\nimport type { PolyesterRealtime } from \"../../realtime/types.js\";\nimport { connectReadyGatedProtoChannel } from \"../../realtime/ready-gated-subscription.js\";\nimport type { BaseSubscribeInput } from \"../../shared/types.js\";\nimport {\n toConnectCallOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport type { SdkScales } from \"../../shared/decimal-surface.js\";\nimport { HEATMAP_INTERVAL_VALUES, type HeatmapIntervalValue } from \"./heatmap.codecs.js\";\nimport * as v from \"valibot\";\nimport { parse } from \"../../shared/validation.js\";\nimport {\n GetOrderbookHeatmapInputSchema,\n createOrderbookHeatmapLiveBucketSchema,\n createOrderbookHeatmapResponseSchema,\n type GetOrderbookHeatmapInput,\n type OrderbookHeatmapLiveBucket,\n type OrderbookHeatmapResponse,\n} from \"./heatmap.schemas.js\";\n\nexport interface OrderbookHeatmapProvider {\n getOrderbookHeatmap(\n input: GetOrderbookHeatmapInput,\n options?: PolyesterRequestOptions,\n ): Promise<OrderbookHeatmapResponse>;\n}\n\ninterface SubscribeHeatmapLiveInput extends BaseSubscribeInput<OrderbookHeatmapLiveBucket> {\n symbolId: number;\n interval: HeatmapIntervalValue;\n}\n\nconst SubscribeHeatmapLiveParamsSchema = v.object({\n symbolId: v.pipe(v.number(), v.integer(), v.gtValue(0)),\n interval: v.picklist(HEATMAP_INTERVAL_VALUES),\n});\n\n/**\n * Reads historical order book heatmap chains and streams live heatmap buckets.\n */\nexport class HeatmapService implements OrderbookHeatmapProvider {\n #client: Client<typeof HeatmapRpc>;\n #realtime: PolyesterRealtime;\n #scales: SdkScales;\n #responseSchema: ReturnType<typeof createOrderbookHeatmapResponseSchema>;\n #liveBucketSchema: ReturnType<typeof createOrderbookHeatmapLiveBucketSchema>;\n\n constructor(transport: Transport, realtime: PolyesterRealtime, scales: SdkScales) {\n this.#client = createClient(HeatmapRpc, transport);\n this.#realtime = realtime;\n this.#scales = scales;\n this.#responseSchema = createOrderbookHeatmapResponseSchema(scales);\n this.#liveBucketSchema = createOrderbookHeatmapLiveBucketSchema(scales);\n }\n\n /**\n * Fetches order book heatmap data for a symbol, interval, depth, and quantity mode using either an absolute time range or cursor pagination. The response includes a keyframe anchor, delta buckets, pagination metadata, and live-anchor fields when available.\n */\n async getOrderbookHeatmap(\n input: GetOrderbookHeatmapInput,\n options?: PolyesterRequestOptions,\n ): Promise<OrderbookHeatmapResponse> {\n const parsed = parse(GetOrderbookHeatmapInputSchema, input);\n await this.#scales.ready();\n\n const res = await this.#client.getOrderbookHeatmap(\n {\n symbolId: parsed.symbolId,\n interval: parsed.interval,\n depth: parsed.depth,\n quantityMode: parsed.quantityMode,\n limit: parsed.limit,\n pageToken: parsed.pageToken,\n timeRange:\n parsed.timeRange != null\n ? create(HeatmapTimeRangeSchema, {\n startTime: parsed.timeRange.startTime,\n endTime: parsed.timeRange.endTime,\n })\n : undefined,\n },\n toConnectCallOptions(options),\n );\n return parse(this.#responseSchema, res);\n }\n\n /**\n * Subscribes to live heatmap buckets on public:spot:market:heatmap:{interval}:{symbolId}:proto and emits parsed bid/ask delta buckets for the selected interval.\n */\n subscribeLive(input: SubscribeHeatmapLiveInput): () => void {\n const params = parse(SubscribeHeatmapLiveParamsSchema, {\n symbolId: input.symbolId,\n interval: input.interval,\n });\n const channel = `public:spot:market:heatmap:${params.interval}:${params.symbolId}:proto`;\n return connectReadyGatedProtoChannel(this.#realtime, {\n channel,\n schema: ProtoHeatmapLiveBucketSchema,\n ready: () => this.#scales.ready(),\n onPublication: (data) => {\n const bucket = parse(this.#liveBucketSchema, data);\n input.onEvent(bucket);\n },\n onConnected: input.onOpen,\n onDisconnected: input.onClose,\n onError: input.onError,\n });\n }\n}\n"],"mappings":";;;;;;;;;;AAuCA,MAAM,mCAAmC,EAAE,OAAO;CAC9C,UAAU,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,QAAQ,CAAC,CAAC;CACtD,UAAU,EAAE,SAAS,uBAAuB;AAChD,CAAC;;;;AAKD,IAAa,iBAAb,MAAgE;CAC5D;CACA;CACA;CACA;CACA;CAEA,YAAY,WAAsB,UAA6B,QAAmB;EAC9E,KAAKA,UAAU,aAAaC,kBAAY,SAAS;EACjD,KAAKC,YAAY;EACjB,KAAKC,UAAU;EACf,KAAKC,kBAAkB,qCAAqC,MAAM;EAClE,KAAKC,oBAAoB,uCAAuC,MAAM;CAC1E;;;;CAKA,MAAM,oBACF,OACA,SACiC;EACjC,MAAM,SAAS,MAAM,gCAAgC,KAAK;EAC1D,MAAM,KAAKF,QAAQ,MAAM;EAEzB,MAAM,MAAM,MAAM,KAAKH,QAAQ,oBAC3B;GACI,UAAU,OAAO;GACjB,UAAU,OAAO;GACjB,OAAO,OAAO;GACd,cAAc,OAAO;GACrB,OAAO,OAAO;GACd,WAAW,OAAO;GAClB,WACI,OAAO,aAAa,OACd,OAAO,wBAAwB;IAC3B,WAAW,OAAO,UAAU;IAC5B,SAAS,OAAO,UAAU;GAC9B,CAAC,IACD,KAAA;EACd,GACA,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,KAAKI,iBAAiB,GAAG;CAC1C;;;;CAKA,cAAc,OAA8C;EACxD,MAAM,SAAS,MAAM,kCAAkC;GACnD,UAAU,MAAM;GAChB,UAAU,MAAM;EACpB,CAAC;EACD,MAAM,UAAU,8BAA8B,OAAO,SAAS,GAAG,OAAO,SAAS;EACjF,OAAO,8BAA8B,KAAKF,WAAW;GACjD;GACA,QAAQI;GACR,aAAa,KAAKH,QAAQ,MAAM;GAChC,gBAAgB,SAAS;IACrB,MAAM,SAAS,MAAM,KAAKE,mBAAmB,IAAI;IACjD,MAAM,QAAQ,MAAM;GACxB;GACA,aAAa,MAAM;GACnB,gBAAgB,MAAM;GACtB,SAAS,MAAM;EACnB,CAAC;CACL;AACJ"}
1
+ {"version":3,"file":"heatmap.js","names":["#client","HeatmapRpc","#realtime","#scales","#responseSchema","#liveBucketSchema","ProtoHeatmapLiveBucketSchema"],"sources":["../../../src/services/heatmap/heatmap.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport { create } from \"@bufbuild/protobuf\";\nimport {\n HeatmapService as HeatmapRpc,\n HeatmapLiveBucketSchema as ProtoHeatmapLiveBucketSchema,\n HeatmapTimeRangeSchema,\n} from \"../../gen/marketdata/v1/heatmap_pb.js\";\nimport type { PolyesterRealtime } from \"../../realtime/types.js\";\nimport { connectReadyGatedProtoChannel } from \"../../realtime/ready-gated-subscription.js\";\nimport type { BaseSubscribeInput } from \"../../shared/types.js\";\nimport {\n toConnectCallOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport type { SdkScales } from \"../../shared/decimal-surface.js\";\nimport type { PublicApiTransports } from \"../../shared/transports.js\";\nimport { HEATMAP_INTERVAL_VALUES, type HeatmapIntervalValue } from \"./heatmap.codecs.js\";\nimport * as v from \"valibot\";\nimport { parse } from \"../../shared/validation.js\";\nimport {\n GetOrderbookHeatmapInputSchema,\n createOrderbookHeatmapLiveBucketSchema,\n createOrderbookHeatmapResponseSchema,\n type GetOrderbookHeatmapInput,\n type OrderbookHeatmapLiveBucket,\n type OrderbookHeatmapResponse,\n} from \"./heatmap.schemas.js\";\n\nexport interface OrderbookHeatmapProvider {\n getOrderbookHeatmap(\n input: GetOrderbookHeatmapInput,\n options?: PolyesterRequestOptions,\n ): Promise<OrderbookHeatmapResponse>;\n}\n\ninterface SubscribeHeatmapLiveInput extends BaseSubscribeInput<OrderbookHeatmapLiveBucket> {\n symbolId: number;\n interval: HeatmapIntervalValue;\n}\n\nconst SubscribeHeatmapLiveParamsSchema = v.object({\n symbolId: v.pipe(v.number(), v.integer(), v.gtValue(0)),\n interval: v.picklist(HEATMAP_INTERVAL_VALUES),\n});\n\n/**\n * Reads historical order book heatmap chains and streams live heatmap buckets.\n */\nexport class HeatmapService implements OrderbookHeatmapProvider {\n #client: Client<typeof HeatmapRpc>;\n #realtime: PolyesterRealtime;\n #scales: SdkScales;\n #responseSchema: ReturnType<typeof createOrderbookHeatmapResponseSchema>;\n #liveBucketSchema: ReturnType<typeof createOrderbookHeatmapLiveBucketSchema>;\n\n constructor(transports: PublicApiTransports, realtime: PolyesterRealtime, scales: SdkScales) {\n this.#client = createClient(HeatmapRpc, transports.publicApi);\n this.#realtime = realtime;\n this.#scales = scales;\n this.#responseSchema = createOrderbookHeatmapResponseSchema(scales);\n this.#liveBucketSchema = createOrderbookHeatmapLiveBucketSchema(scales);\n }\n\n /**\n * Fetches order book heatmap data for a symbol, interval, depth, and quantity mode using either an absolute time range or cursor pagination. The response includes a keyframe anchor, delta buckets, pagination metadata, and live-anchor fields when available.\n */\n async getOrderbookHeatmap(\n input: GetOrderbookHeatmapInput,\n options?: PolyesterRequestOptions,\n ): Promise<OrderbookHeatmapResponse> {\n const parsed = parse(GetOrderbookHeatmapInputSchema, input);\n await this.#scales.ready();\n\n const res = await this.#client.getOrderbookHeatmap(\n {\n symbolId: parsed.symbolId,\n interval: parsed.interval,\n depth: parsed.depth,\n quantityMode: parsed.quantityMode,\n limit: parsed.limit,\n pageToken: parsed.pageToken,\n timeRange:\n parsed.timeRange != null\n ? create(HeatmapTimeRangeSchema, {\n startTime: parsed.timeRange.startTime,\n endTime: parsed.timeRange.endTime,\n })\n : undefined,\n },\n toConnectCallOptions(options),\n );\n return parse(this.#responseSchema, res);\n }\n\n /**\n * Subscribes to live heatmap buckets on public:spot:market:heatmap:{interval}:{symbolId}:proto and emits parsed bid/ask delta buckets for the selected interval.\n */\n subscribeLive(input: SubscribeHeatmapLiveInput): () => void {\n const params = parse(SubscribeHeatmapLiveParamsSchema, {\n symbolId: input.symbolId,\n interval: input.interval,\n });\n const channel = `public:spot:market:heatmap:${params.interval}:${params.symbolId}:proto`;\n return connectReadyGatedProtoChannel(this.#realtime, {\n channel,\n schema: ProtoHeatmapLiveBucketSchema,\n ready: () => this.#scales.ready(),\n onPublication: (data) => {\n const bucket = parse(this.#liveBucketSchema, data);\n input.onEvent(bucket);\n },\n onConnected: input.onOpen,\n onDisconnected: input.onClose,\n onError: input.onError,\n });\n }\n}\n"],"mappings":";;;;;;;;;;AAwCA,MAAM,mCAAmC,EAAE,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AAM;EACnB,CAAC;CACL;AACJ"}
@@ -1,15 +1,15 @@
1
+ import { AuthApiTransports } from "../../shared/transports.js";
1
2
  import { PolyesterMutationOptions } from "../../shared/request-options.js";
2
3
  import { SubaccountResolver } from "../subaccount-resolver.js";
3
4
  import { SdkScales } from "../../shared/decimal-surface.js";
4
5
  import { CreateInternalTransferInput, CreateInternalTransferResult } from "./internal-transfers.schemas.js";
5
- import { Transport } from "@connectrpc/connect";
6
6
  //#region src/services/internal-transfers/internal-transfers.d.ts
7
7
  /**
8
8
  * Creates authenticated Trading-to-Trading internal transfer requests.
9
9
  */
10
10
  declare class InternalTransfersService {
11
11
  #private;
12
- constructor(transport: Transport, resolver: SubaccountResolver | undefined, scales: SdkScales);
12
+ constructor(transports: AuthApiTransports, resolver: SubaccountResolver | undefined, scales: SdkScales);
13
13
  /**
14
14
  * Creates or returns an idempotent internal transfer from the resolved source account to a destination root account, subaccount, or smart-account address. The request carries asset id, a decimal quantity, and a stable idempotency key; the response includes request/transfer ids, resolved destination, and status.
15
15
  */
@@ -1 +1 @@
1
- {"version":3,"file":"internal-transfers.d.ts","names":[],"sources":["../../../src/services/internal-transfers/internal-transfers.ts"],"mappings":";;;;;;;;;cAoBa;;EAOG,YAAA,WAAW,WAAW,UAAU,gCAAgC,QAAQ;;;;EAW9E,OACF,OAAO,6BACP,UAAU,2BACX,QAAQ"}
1
+ {"version":3,"file":"internal-transfers.d.ts","names":[],"sources":["../../../src/services/internal-transfers/internal-transfers.ts"],"mappings":";;;;;;;;;cAqBa;;EAQL,YAAA,YAAY,mBACZ,UAAU,gCACV,QAAQ;;;;EAYN,OACF,OAAO,6BACP,UAAU,2BACX,QAAQ"}
@@ -15,8 +15,8 @@ var InternalTransfersService = class {
15
15
  #scales;
16
16
  #inputSchema;
17
17
  #resultSchema;
18
- constructor(transport, resolver, scales) {
19
- this.#client = createClient(InternalTransferService, transport);
18
+ constructor(transports, resolver, scales) {
19
+ this.#client = createClient(InternalTransferService, transports.authApi);
20
20
  this.#resolver = resolver;
21
21
  this.#scales = scales;
22
22
  this.#inputSchema = createCreateInternalTransferInputSchema(scales);
@@ -1 +1 @@
1
- {"version":3,"file":"internal-transfers.js","names":["#client","Proto.InternalTransferService","#resolver","#scales","#inputSchema","#resultSchema"],"sources":["../../../src/services/internal-transfers/internal-transfers.ts"],"sourcesContent":["import { createClient, type Client, type Transport } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/transfer/v1/internal_transfer_pb.js\";\nimport { removeUndefined } from \"../../utils/remove-undefined.js\";\nimport {\n toConnectCallOptions,\n type PolyesterMutationOptions,\n} from \"../../shared/request-options.js\";\nimport { type SubaccountResolver, resolveAccountScopedInput } from \"../subaccount-resolver.js\";\nimport type { SdkScales } from \"../../shared/decimal-surface.js\";\nimport { parse } from \"../../shared/validation.js\";\nimport {\n createCreateInternalTransferInputSchema,\n createCreateInternalTransferResultSchema,\n type CreateInternalTransferInput,\n type CreateInternalTransferResult,\n} from \"./internal-transfers.schemas.js\";\n\n/**\n * Creates authenticated Trading-to-Trading internal transfer requests.\n */\nexport class InternalTransfersService {\n #client: Client<typeof Proto.InternalTransferService>;\n #resolver?: SubaccountResolver;\n #scales: SdkScales;\n #inputSchema: ReturnType<typeof createCreateInternalTransferInputSchema>;\n #resultSchema: ReturnType<typeof createCreateInternalTransferResultSchema>;\n\n constructor(transport: Transport, resolver: SubaccountResolver | undefined, scales: SdkScales) {\n this.#client = createClient(Proto.InternalTransferService, transport);\n this.#resolver = resolver;\n this.#scales = scales;\n this.#inputSchema = createCreateInternalTransferInputSchema(scales);\n this.#resultSchema = createCreateInternalTransferResultSchema();\n }\n\n /**\n * Creates or returns an idempotent internal transfer from the resolved source account to a destination root account, subaccount, or smart-account address. The request carries asset id, a decimal quantity, and a stable idempotency key; the response includes request/transfer ids, resolved destination, and status.\n */\n async create(\n input: CreateInternalTransferInput,\n options?: PolyesterMutationOptions,\n ): Promise<CreateInternalTransferResult> {\n await this.#scales.ready();\n const resolvedInput = resolveAccountScopedInput(input, this.#resolver);\n const validatedInput = parse(this.#inputSchema, resolvedInput);\n const res = await this.#client.createInternalTransfer(\n removeUndefined(validatedInput),\n toConnectCallOptions(options),\n );\n return parse(this.#resultSchema, res);\n }\n}\n"],"mappings":";;;;;;;;;;;AAoBA,IAAa,2BAAb,MAAsC;CAClC;CACA;CACA;CACA;CACA;CAEA,YAAY,WAAsB,UAA0C,QAAmB;EAC3F,KAAKA,UAAU,aAAaC,yBAA+B,SAAS;EACpE,KAAKC,YAAY;EACjB,KAAKC,UAAU;EACf,KAAKC,eAAe,wCAAwC,MAAM;EAClE,KAAKC,gBAAgB,yCAAyC;CAClE;;;;CAKA,MAAM,OACF,OACA,SACqC;EACrC,MAAM,KAAKF,QAAQ,MAAM;EACzB,MAAM,gBAAgB,0BAA0B,OAAO,KAAKD,SAAS;EACrE,MAAM,iBAAiB,MAAM,KAAKE,cAAc,aAAa;EAC7D,MAAM,MAAM,MAAM,KAAKJ,QAAQ,uBAC3B,gBAAgB,cAAc,GAC9B,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,KAAKK,eAAe,GAAG;CACxC;AACJ"}
1
+ {"version":3,"file":"internal-transfers.js","names":["#client","Proto.InternalTransferService","#resolver","#scales","#inputSchema","#resultSchema"],"sources":["../../../src/services/internal-transfers/internal-transfers.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/transfer/v1/internal_transfer_pb.js\";\nimport type { AuthApiTransports } from \"../../shared/transports.js\";\nimport { removeUndefined } from \"../../utils/remove-undefined.js\";\nimport {\n toConnectCallOptions,\n type PolyesterMutationOptions,\n} from \"../../shared/request-options.js\";\nimport { type SubaccountResolver, resolveAccountScopedInput } from \"../subaccount-resolver.js\";\nimport type { SdkScales } from \"../../shared/decimal-surface.js\";\nimport { parse } from \"../../shared/validation.js\";\nimport {\n createCreateInternalTransferInputSchema,\n createCreateInternalTransferResultSchema,\n type CreateInternalTransferInput,\n type CreateInternalTransferResult,\n} from \"./internal-transfers.schemas.js\";\n\n/**\n * Creates authenticated Trading-to-Trading internal transfer requests.\n */\nexport class InternalTransfersService {\n #client: Client<typeof Proto.InternalTransferService>;\n #resolver?: SubaccountResolver;\n #scales: SdkScales;\n #inputSchema: ReturnType<typeof createCreateInternalTransferInputSchema>;\n #resultSchema: ReturnType<typeof createCreateInternalTransferResultSchema>;\n\n constructor(\n transports: AuthApiTransports,\n resolver: SubaccountResolver | undefined,\n scales: SdkScales,\n ) {\n this.#client = createClient(Proto.InternalTransferService, transports.authApi);\n this.#resolver = resolver;\n this.#scales = scales;\n this.#inputSchema = createCreateInternalTransferInputSchema(scales);\n this.#resultSchema = createCreateInternalTransferResultSchema();\n }\n\n /**\n * Creates or returns an idempotent internal transfer from the resolved source account to a destination root account, subaccount, or smart-account address. The request carries asset id, a decimal quantity, and a stable idempotency key; the response includes request/transfer ids, resolved destination, and status.\n */\n async create(\n input: CreateInternalTransferInput,\n options?: PolyesterMutationOptions,\n ): Promise<CreateInternalTransferResult> {\n await this.#scales.ready();\n const resolvedInput = resolveAccountScopedInput(input, this.#resolver);\n const validatedInput = parse(this.#inputSchema, resolvedInput);\n const res = await this.#client.createInternalTransfer(\n removeUndefined(validatedInput),\n toConnectCallOptions(options),\n );\n return parse(this.#resultSchema, res);\n }\n}\n"],"mappings":";;;;;;;;;;;AAqBA,IAAa,2BAAb,MAAsC;CAClC;CACA;CACA;CACA;CACA;CAEA,YACI,YACA,UACA,QACF;EACE,KAAKA,UAAU,aAAaC,yBAA+B,WAAW,OAAO;EAC7E,KAAKC,YAAY;EACjB,KAAKC,UAAU;EACf,KAAKC,eAAe,wCAAwC,MAAM;EAClE,KAAKC,gBAAgB,yCAAyC;CAClE;;;;CAKA,MAAM,OACF,OACA,SACqC;EACrC,MAAM,KAAKF,QAAQ,MAAM;EACzB,MAAM,gBAAgB,0BAA0B,OAAO,KAAKD,SAAS;EACrE,MAAM,iBAAiB,MAAM,KAAKE,cAAc,aAAa;EAC7D,MAAM,MAAM,MAAM,KAAKJ,QAAQ,uBAC3B,gBAAgB,cAAc,GAC9B,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,KAAKK,eAAe,GAAG;CACxC;AACJ"}
@@ -1,8 +1,8 @@
1
+ import { PublicApiTransports } from "../../shared/transports.js";
1
2
  import { PolyesterRequestOptions } from "../../shared/request-options.js";
2
3
  import { PolyesterRealtime } from "../../realtime/types.js";
3
4
  import { BaseSubscribeInput } from "../../shared/types.js";
4
5
  import { GetLifecycleFlowInput, GetLifecycleFlowOutput, LifecycleFlowDetail, LifecycleFlowSummary, ListLifecycleFlowsByTxInput, ListLifecycleFlowsByTxOutput, ListLifecycleFlowsInput, ListLifecycleFlowsOutput } from "./lifecycle.schemas.js";
5
- import { Transport } from "@connectrpc/connect";
6
6
  //#region src/services/lifecycle/lifecycle.d.ts
7
7
  interface SubscribeOpenLifecycleFlowsInput extends BaseSubscribeInput<LifecycleFlowSummary> {
8
8
  accountId?: string;
@@ -15,7 +15,7 @@ interface SubscribeLifecycleFlowDetailInput extends BaseSubscribeInput<Lifecycle
15
15
  */
16
16
  declare class LifecycleService {
17
17
  #private;
18
- constructor(transport: Transport, realtime: PolyesterRealtime);
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
21
  */
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.d.ts","names":[],"sources":["../../../src/services/lifecycle/lifecycle.ts"],"mappings":";;;;;;UAoCU,yCAAyC,mBAAmB;EAClE;;UAGM,0CAA0C,mBAAmB;EACnE;;;;;cAMS;;EAIG,YAAA,WAAW,WAAW,UAAU;;;;EAQtC,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"}
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;;;;EAQjD,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"}
@@ -13,8 +13,8 @@ import * as v from "valibot";
13
13
  var LifecycleService = class {
14
14
  #client;
15
15
  #realtime;
16
- constructor(transport, realtime) {
17
- this.#client = createClient(LifecycleReadService, transport);
16
+ constructor(transports, realtime) {
17
+ this.#client = createClient(LifecycleReadService, transports.publicApi);
18
18
  this.#realtime = realtime;
19
19
  }
20
20
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.js","names":["#client","#realtime"],"sources":["../../../src/services/lifecycle/lifecycle.ts"],"sourcesContent":["import { createClient, type Client, type Transport } 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 { 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(transport: Transport, realtime: PolyesterRealtime) {\n this.#client = createClient(LifecycleReadService, transport);\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":";;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AAU,+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"}
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;;;;CAKA,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,cA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