@polyester/sdk 0.36.0-devnet-20261119195411 → 0.36.0-devnet-20261120015159

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 (197) hide show
  1. package/CHANGELOG.md +16 -2
  2. package/dist/client.d.ts +2 -0
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +2 -0
  5. package/dist/client.js.map +1 -1
  6. package/dist/gen/ai/v1/assistant_pb.d.ts +55 -3
  7. package/dist/gen/ai/v1/assistant_pb.d.ts.map +1 -1
  8. package/dist/gen/ai/v1/assistant_pb.js +8 -1
  9. package/dist/gen/ai/v1/assistant_pb.js.map +1 -1
  10. package/dist/gen/auth/v1/account_scope_pb.d.ts +40 -0
  11. package/dist/gen/auth/v1/account_scope_pb.d.ts.map +1 -0
  12. package/dist/gen/auth/v1/account_scope_pb.js +46 -0
  13. package/dist/gen/auth/v1/account_scope_pb.js.map +1 -0
  14. package/dist/gen/auth/v1/address_book_pb.d.ts +3 -31
  15. package/dist/gen/auth/v1/address_book_pb.d.ts.map +1 -1
  16. package/dist/gen/auth/v1/address_book_pb.js +8 -38
  17. package/dist/gen/auth/v1/address_book_pb.js.map +1 -1
  18. package/dist/gen/auth/v1/auth_pb.d.ts +15 -14
  19. package/dist/gen/auth/v1/auth_pb.d.ts.map +1 -1
  20. package/dist/gen/auth/v1/auth_pb.js +16 -15
  21. package/dist/gen/auth/v1/auth_pb.js.map +1 -1
  22. package/dist/gen/auth/v1/connected_apps_pb.d.ts +59 -58
  23. package/dist/gen/auth/v1/connected_apps_pb.d.ts.map +1 -1
  24. package/dist/gen/auth/v1/connected_apps_pb.js +38 -37
  25. package/dist/gen/auth/v1/connected_apps_pb.js.map +1 -1
  26. package/dist/gen/auth/v1/policies_pb.d.ts +27 -1
  27. package/dist/gen/auth/v1/policies_pb.d.ts.map +1 -1
  28. package/dist/gen/auth/v1/policies_pb.js +27 -1
  29. package/dist/gen/auth/v1/policies_pb.js.map +1 -1
  30. package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts +228 -2
  31. package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts.map +1 -1
  32. package/dist/gen/chain/withdraw/v1/withdraw_pb.js +32 -8
  33. package/dist/gen/chain/withdraw/v1/withdraw_pb.js.map +1 -1
  34. package/dist/gen/changelog/v1/changelog_pb.d.ts +16 -4
  35. package/dist/gen/changelog/v1/changelog_pb.d.ts.map +1 -1
  36. package/dist/gen/changelog/v1/changelog_pb.js.map +1 -1
  37. package/dist/gen/index.d.ts +7 -5
  38. package/dist/gen/index.js +7 -5
  39. package/dist/gen/marketdata/v1/marketdata_pb.d.ts +288 -2
  40. package/dist/gen/marketdata/v1/marketdata_pb.d.ts.map +1 -1
  41. package/dist/gen/marketdata/v1/marketdata_pb.js +115 -2
  42. package/dist/gen/marketdata/v1/marketdata_pb.js.map +1 -1
  43. package/dist/gen/orders/v1/orders_pb.d.ts +78 -25
  44. package/dist/gen/orders/v1/orders_pb.d.ts.map +1 -1
  45. package/dist/gen/orders/v1/orders_pb.js +36 -7
  46. package/dist/gen/orders/v1/orders_pb.js.map +1 -1
  47. package/dist/gen/orders/v1/orders_read_pb.d.ts +35 -1
  48. package/dist/gen/orders/v1/orders_read_pb.d.ts.map +1 -1
  49. package/dist/gen/orders/v1/orders_read_pb.js.map +1 -1
  50. package/dist/gen/strategies/v1/strategies_pb.d.ts +2928 -0
  51. package/dist/gen/strategies/v1/strategies_pb.d.ts.map +1 -0
  52. package/dist/gen/strategies/v1/strategies_pb.js +818 -0
  53. package/dist/gen/strategies/v1/strategies_pb.js.map +1 -0
  54. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts +38 -17
  55. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts.map +1 -1
  56. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js +4 -1
  57. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js.map +1 -1
  58. package/dist/gen/swap/quickswap/v1/quickswap_explorer_pb.d.ts +312 -132
  59. package/dist/gen/swap/quickswap/v1/quickswap_explorer_pb.d.ts.map +1 -1
  60. package/dist/gen/swap/quickswap/v1/quickswap_explorer_pb.js +31 -26
  61. package/dist/gen/swap/quickswap/v1/quickswap_explorer_pb.js.map +1 -1
  62. package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts +28 -13
  63. package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts.map +1 -1
  64. package/dist/gen/swap/quickswap/v1/quickswap_pb.js +2 -2
  65. package/dist/gen/swap/quickswap/v1/quickswap_pb.js.map +1 -1
  66. package/dist/gen/swap/quickswap/v1/quickswap_referral_pb.d.ts +109 -2
  67. package/dist/gen/swap/quickswap/v1/quickswap_referral_pb.d.ts.map +1 -1
  68. package/dist/gen/swap/quickswap/v1/quickswap_referral_pb.js +23 -3
  69. package/dist/gen/swap/quickswap/v1/quickswap_referral_pb.js.map +1 -1
  70. package/dist/gen/transfer/v1/internal_transfer_pb.d.ts +3 -2
  71. package/dist/gen/transfer/v1/internal_transfer_pb.d.ts.map +1 -1
  72. package/dist/gen/transfer/v1/internal_transfer_pb.js.map +1 -1
  73. package/dist/gen/triggers/v1/triggers_pb.d.ts +61 -11
  74. package/dist/gen/triggers/v1/triggers_pb.d.ts.map +1 -1
  75. package/dist/gen/triggers/v1/triggers_pb.js +4 -2
  76. package/dist/gen/triggers/v1/triggers_pb.js.map +1 -1
  77. package/dist/index.d.ts +9 -6
  78. package/dist/services/account-activity/account-activity.schemas.d.ts +6 -6
  79. package/dist/services/address-book/address-book.codecs.js +1 -0
  80. package/dist/services/address-book/address-book.codecs.js.map +1 -1
  81. package/dist/services/address-book/address-book.js +1 -1
  82. package/dist/services/address-book/address-book.schemas.d.ts +2 -2
  83. package/dist/services/api-keys/api-keys.js +1 -1
  84. package/dist/services/api-keys/api-keys.schemas.d.ts +6 -6
  85. package/dist/services/assistant/assistant-events.schemas.d.ts +138 -40
  86. package/dist/services/assistant/assistant-events.schemas.d.ts.map +1 -1
  87. package/dist/services/assistant/assistant-events.schemas.js +15 -5
  88. package/dist/services/assistant/assistant-events.schemas.js.map +1 -1
  89. package/dist/services/assistant/assistant.codecs.d.ts +5 -2
  90. package/dist/services/assistant/assistant.codecs.d.ts.map +1 -1
  91. package/dist/services/assistant/assistant.codecs.js +10 -2
  92. package/dist/services/assistant/assistant.codecs.js.map +1 -1
  93. package/dist/services/assistant/assistant.schemas.d.ts +2 -2
  94. package/dist/services/auth/auth.js +1 -1
  95. package/dist/services/auth/auth.js.map +1 -1
  96. package/dist/services/auto-withdraw/auto-withdraw.schemas.d.ts +9 -9
  97. package/dist/services/balances/balances.js +1 -1
  98. package/dist/services/balances/balances.schemas.d.ts +3 -3
  99. package/dist/services/changelog/changelog.schemas.d.ts +38 -38
  100. package/dist/services/checkpoints/checkpoints.schemas.d.ts +1 -1
  101. package/dist/services/claims/claims.schemas.d.ts +2 -2
  102. package/dist/services/connected-apps/connected-apps.d.ts +4 -4
  103. package/dist/services/connected-apps/connected-apps.d.ts.map +1 -1
  104. package/dist/services/connected-apps/connected-apps.js +13 -13
  105. package/dist/services/connected-apps/connected-apps.js.map +1 -1
  106. package/dist/services/connected-apps/connected-apps.schemas.d.ts +7 -7
  107. package/dist/services/connected-apps/connected-apps.schemas.d.ts.map +1 -1
  108. package/dist/services/connected-apps/connected-apps.schemas.js +10 -10
  109. package/dist/services/connected-apps/connected-apps.schemas.js.map +1 -1
  110. package/dist/services/connected-apps/connected-apps.types.d.ts +2 -2
  111. package/dist/services/dust-conversion/dust-conversion.schemas.d.ts +6 -6
  112. package/dist/services/heatmap/heatmap.schemas.d.ts +4 -4
  113. package/dist/services/internal-transfers/internal-transfers.schemas.d.ts +1 -1
  114. package/dist/services/lifecycle/lifecycle.schemas.d.ts +79 -79
  115. package/dist/services/market-data/market-data.codecs.d.ts +9 -1
  116. package/dist/services/market-data/market-data.codecs.d.ts.map +1 -1
  117. package/dist/services/market-data/market-data.codecs.js +14 -1
  118. package/dist/services/market-data/market-data.codecs.js.map +1 -1
  119. package/dist/services/market-data/market-data.d.ts +9 -1
  120. package/dist/services/market-data/market-data.d.ts.map +1 -1
  121. package/dist/services/market-data/market-data.js +14 -1
  122. package/dist/services/market-data/market-data.js.map +1 -1
  123. package/dist/services/market-data/market-data.schemas.d.ts +40 -2
  124. package/dist/services/market-data/market-data.schemas.d.ts.map +1 -1
  125. package/dist/services/market-data/market-data.schemas.js +43 -8
  126. package/dist/services/market-data/market-data.schemas.js.map +1 -1
  127. package/dist/services/market-data/market-data.types.d.ts +3 -3
  128. package/dist/services/notifications/notifications.schemas.d.ts +4 -4
  129. package/dist/services/orders/order-errors.schemas.d.ts +6 -6
  130. package/dist/services/orders/orders-batch.schemas.d.ts +67 -67
  131. package/dist/services/orders/orders-input.schemas.d.ts +10 -10
  132. package/dist/services/orders/orders-output.schemas.d.ts +16 -16
  133. package/dist/services/orders/orders-output.schemas.d.ts.map +1 -1
  134. package/dist/services/orders/orders-output.schemas.js +1 -1
  135. package/dist/services/orders/orders-output.schemas.js.map +1 -1
  136. package/dist/services/orders/orders.d.ts +5 -0
  137. package/dist/services/orders/orders.d.ts.map +1 -1
  138. package/dist/services/orders/orders.js +5 -0
  139. package/dist/services/orders/orders.js.map +1 -1
  140. package/dist/services/policies/api-key-policies/api-key-policies.js +1 -1
  141. package/dist/services/policies/api-key-policies/api-key-policies.schemas.d.ts +15 -15
  142. package/dist/services/policies/shared.codecs.js +13 -4
  143. package/dist/services/policies/shared.codecs.js.map +1 -1
  144. package/dist/services/policies/shared.d.ts +1 -1
  145. package/dist/services/policies/subaccount-policies/subaccount-policies.js +1 -1
  146. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.d.ts +3 -3
  147. package/dist/services/rewards/rewards.schemas.d.ts +4 -4
  148. package/dist/services/statement-exports/statement-exports.schemas.d.ts +6 -6
  149. package/dist/services/strategies/service.d.ts +8 -0
  150. package/dist/services/strategies/service.d.ts.map +1 -0
  151. package/dist/services/strategies/service.js +9 -0
  152. package/dist/services/strategies/service.js.map +1 -0
  153. package/dist/services/strategies/strategies.codecs.d.ts +15 -0
  154. package/dist/services/strategies/strategies.codecs.d.ts.map +1 -0
  155. package/dist/services/strategies/strategies.codecs.js +50 -0
  156. package/dist/services/strategies/strategies.codecs.js.map +1 -0
  157. package/dist/services/strategies/strategies.d.ts +75 -0
  158. package/dist/services/strategies/strategies.d.ts.map +1 -0
  159. package/dist/services/strategies/strategies.js +135 -0
  160. package/dist/services/strategies/strategies.js.map +1 -0
  161. package/dist/services/strategies/strategies.schemas.d.ts +568 -0
  162. package/dist/services/strategies/strategies.schemas.d.ts.map +1 -0
  163. package/dist/services/strategies/strategies.schemas.js +408 -0
  164. package/dist/services/strategies/strategies.schemas.js.map +1 -0
  165. package/dist/services/strategies/strategies.types.d.ts +3 -0
  166. package/dist/services/subaccounts/subaccounts.js +2 -2
  167. package/dist/services/subaccounts/subaccounts.schemas.d.ts +20 -20
  168. package/dist/services/system/system.schemas.d.ts +13 -13
  169. package/dist/services/trades/trades.schemas.d.ts +1 -1
  170. package/dist/services/trading-withdraws/trading-withdraws.d.ts +29 -2
  171. package/dist/services/trading-withdraws/trading-withdraws.d.ts.map +1 -1
  172. package/dist/services/trading-withdraws/trading-withdraws.js +74 -11
  173. package/dist/services/trading-withdraws/trading-withdraws.js.map +1 -1
  174. package/dist/services/trading-withdraws/trading-withdraws.schemas.d.ts +85 -1
  175. package/dist/services/trading-withdraws/trading-withdraws.schemas.d.ts.map +1 -1
  176. package/dist/services/trading-withdraws/trading-withdraws.schemas.js +56 -1
  177. package/dist/services/trading-withdraws/trading-withdraws.schemas.js.map +1 -1
  178. package/dist/services/trading-withdraws/trading-withdraws.types.d.ts +3 -3
  179. package/dist/services/trading-withdraws/wallet-message.js +29 -1
  180. package/dist/services/trading-withdraws/wallet-message.js.map +1 -1
  181. package/dist/services/transfers/transfers.js +1 -1
  182. package/dist/services/transfers/transfers.schemas.d.ts +1 -1
  183. package/dist/services/triggers/trigger-input.schemas.d.ts +2 -2
  184. package/dist/services/triggers/triggers-output.schemas.d.ts +39 -39
  185. package/dist/shared/connect-error-mapping.d.ts.map +1 -1
  186. package/dist/shared/connect-error-mapping.js +5 -0
  187. package/dist/shared/connect-error-mapping.js.map +1 -1
  188. package/dist/shared/error-detail.d.ts +25 -2
  189. package/dist/shared/error-detail.d.ts.map +1 -1
  190. package/dist/shared/error-detail.js +1 -0
  191. package/dist/shared/error-detail.js.map +1 -1
  192. package/dist/shared/error-details/strategies.js +36 -0
  193. package/dist/shared/error-details/strategies.js.map +1 -0
  194. package/dist/wired-services.d.ts.map +1 -1
  195. package/dist/wired-services.js +6 -4
  196. package/dist/wired-services.js.map +1 -1
  197. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strategies.codecs.js","names":[],"sources":["../../../src/services/strategies/strategies.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/strategies/v1/strategies_pb.js\";\nimport type { ProtoToOutput } from \"../../utils/types.js\";\n\nexport const STRATEGY_BACKTEST_STATUS_VALUES = [\"queued\", \"running\", \"done\", \"failed\"] as const;\nexport type StrategyBacktestStatus = (typeof STRATEGY_BACKTEST_STATUS_VALUES)[number];\n\nexport const BacktestStatusCodec = {\n protoToOutput: {\n [Proto.Backtest_Status.STATUS_UNSPECIFIED]: \"unspecified\",\n [Proto.Backtest_Status.QUEUED]: \"queued\",\n [Proto.Backtest_Status.RUNNING]: \"running\",\n [Proto.Backtest_Status.DONE]: \"done\",\n [Proto.Backtest_Status.FAILED]: \"failed\",\n } satisfies ProtoToOutput<Proto.Backtest_Status, StrategyBacktestStatus>,\n} as const;\n\nexport const STRATEGY_SCENARIO_OUTCOME_VALUES = [\"not_run\", \"passed\", \"failed\"] as const;\nexport type StrategyScenarioOutcome = (typeof STRATEGY_SCENARIO_OUTCOME_VALUES)[number];\n\nexport const ScenarioOutcomeCodec = {\n protoToOutput: {\n [Proto.ScenarioSummary_Outcome.OUTCOME_UNSPECIFIED]: \"unspecified\",\n [Proto.ScenarioSummary_Outcome.NOT_RUN]: \"not_run\",\n [Proto.ScenarioSummary_Outcome.PASSED]: \"passed\",\n [Proto.ScenarioSummary_Outcome.FAILED]: \"failed\",\n } satisfies ProtoToOutput<Proto.ScenarioSummary_Outcome, StrategyScenarioOutcome>,\n} as const;\n\nexport const STRATEGY_DEPLOY_STATE_VALUES = [\n \"proposed\",\n \"validating\",\n \"creating_subaccount\",\n \"funding\",\n \"deploying\",\n \"live\",\n \"failed\",\n \"expired\",\n] as const;\n/** `live`, `failed` and `expired` are final. */\nexport type StrategyDeployState = (typeof STRATEGY_DEPLOY_STATE_VALUES)[number];\n\nexport const DeployStateCodec = {\n protoToOutput: {\n [Proto.DeployStatus_State.STATE_UNSPECIFIED]: \"unspecified\",\n [Proto.DeployStatus_State.PROPOSED]: \"proposed\",\n [Proto.DeployStatus_State.VALIDATING]: \"validating\",\n [Proto.DeployStatus_State.CREATING_SUBACCOUNT]: \"creating_subaccount\",\n [Proto.DeployStatus_State.FUNDING]: \"funding\",\n [Proto.DeployStatus_State.DEPLOYING]: \"deploying\",\n [Proto.DeployStatus_State.LIVE]: \"live\",\n [Proto.DeployStatus_State.FAILED]: \"failed\",\n [Proto.DeployStatus_State.EXPIRED]: \"expired\",\n } satisfies ProtoToOutput<Proto.DeployStatus_State, StrategyDeployState>,\n} as const;\n\nexport const STRATEGY_BOT_STATUS_VALUES = [\n \"deploying\",\n \"running\",\n \"stopping\",\n \"stopped\",\n \"paused\",\n \"quarantined\",\n] as const;\nexport type StrategyBotStatus = (typeof STRATEGY_BOT_STATUS_VALUES)[number];\n\nexport const BotStatusCodec = {\n protoToOutput: {\n [Proto.Bot_Status.STATUS_UNSPECIFIED]: \"unspecified\",\n [Proto.Bot_Status.DEPLOYING]: \"deploying\",\n [Proto.Bot_Status.RUNNING]: \"running\",\n [Proto.Bot_Status.STOPPING]: \"stopping\",\n [Proto.Bot_Status.STOPPED]: \"stopped\",\n [Proto.Bot_Status.PAUSED]: \"paused\",\n [Proto.Bot_Status.QUARANTINED]: \"quarantined\",\n } satisfies ProtoToOutput<Proto.Bot_Status, StrategyBotStatus>,\n} as const;\n\nexport const STRATEGY_BOT_LOG_KIND_VALUES = [\"log\", \"decision\", \"error\"] as const;\nexport type StrategyBotLogKind = (typeof STRATEGY_BOT_LOG_KIND_VALUES)[number];\n\nexport const BotLogKindCodec = {\n protoToOutput: {\n [Proto.BotLogEntry_Kind.KIND_UNSPECIFIED]: \"unspecified\",\n [Proto.BotLogEntry_Kind.LOG]: \"log\",\n [Proto.BotLogEntry_Kind.DECISION]: \"decision\",\n [Proto.BotLogEntry_Kind.ERROR]: \"error\",\n } satisfies ProtoToOutput<Proto.BotLogEntry_Kind, StrategyBotLogKind>,\n} as const;\n\nexport const StrategyOrderSideCodec = {\n protoToOutput: {\n [Proto.OrderSide.SIDE_UNSPECIFIED]: \"unspecified\",\n [Proto.OrderSide.BUY]: \"buy\",\n [Proto.OrderSide.SELL]: \"sell\",\n } satisfies ProtoToOutput<Proto.OrderSide, \"buy\" | \"sell\">,\n} as const;\n"],"mappings":";;AAMA,MAAa,sBAAsB,EAC/B,eAAe;EACiC,IAAA;EACZ,IAAA;EACC,IAAA;EACH,IAAA;EACE,IAAA;AACpC,EACJ;AAKA,MAAa,uBAAuB,EAChC,eAAe;EAC0C,IAAA;EACZ,IAAA;EACD,IAAA;EACA,IAAA;AAC5C,EACJ;AAeA,MAAa,mBAAmB,EAC5B,eAAe;EACmC,IAAA;EACT,IAAA;EACE,IAAA;EACS,IAAA;EACZ,IAAA;EACE,IAAA;EACL,IAAA;EACE,IAAA;EACC,IAAA;AACxC,EACJ;AAYA,MAAa,iBAAiB,EAC1B,eAAe;EAC4B,IAAA;EACT,IAAA;EACF,IAAA;EACC,IAAA;EACD,IAAA;EACD,IAAA;EACK,IAAA;AACpC,EACJ;AAKA,MAAa,kBAAkB,EAC3B,eAAe;EACgC,IAAA;EACb,IAAA;EACK,IAAA;EACH,IAAA;AACpC,EACJ;AAEA,MAAa,yBAAyB,EAClC,eAAe;EACyB,IAAA;EACb,IAAA;EACC,IAAA;AAC5B,EACJ"}
@@ -0,0 +1,75 @@
1
+ import { AuthApiTransports } from "../../shared/transports.js";
2
+ import { PolyesterRequestOptions } from "../../shared/request-options.js";
3
+ import { ExplainStrategyResult, GetStrategyReferenceInput, ListBotLogsInput, ListBotsInput, ListStrategyBotLogsResult, ListStrategyBotsResult, ProposeDeployInput, ProposeStrategyDeployResult, RunStrategyScenariosResult, StartBacktestInput, StartStrategyBacktestResult, StrategyBacktest, StrategyBacktestInput, StrategyBotDetails, StrategyBotInput, StrategyDeployProposalInput, StrategyDeployStatus, StrategyReference, StrategyTemplate, StrategyVersionInput, ValidateStrategyInput, ValidateStrategyResult } from "./strategies.schemas.js";
4
+ //#region src/services/strategies/strategies.d.ts
5
+ /**
6
+ * Writes, tests and proposes trading bots of the caller's main account: validate a strategy into
7
+ * an immutable version, run its behaviour examples, backtest it, then record a deploy proposal
8
+ * the user deploys on the website with MFA and a wallet signature. Nothing here deploys a bot,
9
+ * creates a subaccount or moves funds. API keys need `read-strategies`, `draft-strategies` or
10
+ * `propose-strategy-deploy`, and a key scoped to a subaccount is refused (`PermissionError`).
11
+ * Errors carry a `strategies` detail; a `ServiceUnavailableError` is safe to retry unchanged.
12
+ */
13
+ declare class StrategiesService {
14
+ #private;
15
+ constructor(transports: AuthApiTransports);
16
+ /**
17
+ * What bot code is written against for one runtime version: the bot API reference and skill
18
+ * pack, then the manifest's JSON Schema, the allowed indicators and the limits once the runtime
19
+ * catalog is available. An unknown runtime version throws `ValidationError`
20
+ * (`RUNTIME_VERSION_UNSUPPORTED`).
21
+ */
22
+ getReference(input?: GetStrategyReferenceInput, options?: PolyesterRequestOptions): Promise<StrategyReference>;
23
+ /** Lists the bot templates: starting points with a manifest and code. */
24
+ listTemplates(options?: PolyesterRequestOptions): Promise<StrategyTemplate[]>;
25
+ /**
26
+ * Checks a bot and stores it as an immutable version. A bot with mistakes is no error: it
27
+ * returns `valid: false` with its `errors`. Needs `draft-strategies`.
28
+ */
29
+ validate(input: ValidateStrategyInput, options?: PolyesterRequestOptions): Promise<ValidateStrategyResult>;
30
+ /**
31
+ * Runs a version's behaviour examples against its code; a version always gets the same
32
+ * result. Too many runs throw `RateLimitError` (`SCENARIO_RUN_LIMIT_REACHED`). Needs
33
+ * `draft-strategies`.
34
+ */
35
+ runScenarios(input: StrategyVersionInput, options?: PolyesterRequestOptions): Promise<RunStrategyScenariosResult>;
36
+ /**
37
+ * Starts a backtest of a version; poll `getBacktest` until it is `done` or `failed`. The same
38
+ * version, window, settings and balances return the existing backtest. The daily limit throws
39
+ * `RateLimitError` (`BACKTEST_LIMIT_REACHED`); reusing `idempotencyKey` for another request
40
+ * throws `AlreadyExistsError` (`IDEMPOTENCY_CONFLICT`). Needs `draft-strategies`.
41
+ */
42
+ startBacktest(input: StartBacktestInput, options?: PolyesterRequestOptions): Promise<StartStrategyBacktestResult>;
43
+ /** Reads one backtest, with its report once `done`. Needs `read-strategies`. */
44
+ getBacktest(input: StrategyBacktestInput, options?: PolyesterRequestOptions): Promise<StrategyBacktest>;
45
+ /**
46
+ * The review summary of a version: what a user approves when deploying it. Needs
47
+ * `read-strategies`.
48
+ */
49
+ explain(input: StrategyVersionInput, options?: PolyesterRequestOptions): Promise<ExplainStrategyResult>;
50
+ /**
51
+ * Records an immutable deploy proposal and returns the `deployUrl` where the user deploys it
52
+ * with MFA and a wallet signature; it never deploys or moves funds. Refusals throw
53
+ * `PreconditionFailedError` with the reason in the detail, for example `SCENARIOS_FAILING`,
54
+ * `BACKTEST_MISSING`, `INSUFFICIENT_FUNDS` (with `shortfall`) or `BOT_CAP_REACHED` (with
55
+ * `botCap`). Needs `propose-strategy-deploy`.
56
+ */
57
+ proposeDeploy(input: ProposeDeployInput, options?: PolyesterRequestOptions): Promise<ProposeStrategyDeployResult>;
58
+ /**
59
+ * Reads where a deploy proposal is; poll it until `live`, `failed` or `expired`. Needs
60
+ * `read-strategies`.
61
+ */
62
+ getDeployStatus(input: StrategyDeployProposalInput, options?: PolyesterRequestOptions): Promise<StrategyDeployStatus>;
63
+ /** Lists the caller's bots, newest first. Needs `read-strategies`. */
64
+ listBots(input?: ListBotsInput, options?: PolyesterRequestOptions): Promise<ListStrategyBotsResult>;
65
+ /**
66
+ * Reads one bot: its money rules and settings, its subaccount's balances and open orders, and
67
+ * its recent decisions and errors. Needs `read-strategies`.
68
+ */
69
+ getBot(input: StrategyBotInput, options?: PolyesterRequestOptions): Promise<StrategyBotDetails>;
70
+ /** Reads a bot's log lines, decisions and errors, oldest first. Needs `read-strategies`. */
71
+ listBotLogs(input: ListBotLogsInput, options?: PolyesterRequestOptions): Promise<ListStrategyBotLogsResult>;
72
+ }
73
+ //#endregion
74
+ export { StrategiesService };
75
+ //# sourceMappingURL=strategies.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strategies.d.ts","names":[],"sources":["../../../src/services/strategies/strategies.ts"],"mappings":";;;;;;;;;;;;cAgEa;;EAGG,YAAA,YAAY;;;;;;;EAUlB,aACF,QAAO,2BACP,UAAU,0BACX,QAAQ;;EAOL,cAAc,UAAU,0BAA0B,QAAQ;;;;;EAS1D,SACF,OAAO,uBACP,UAAU,0BACX,QAAQ;;;;;;EAWL,aACF,OAAO,sBACP,UAAU,0BACX,QAAQ;;;;;;;EAYL,cACF,OAAO,oBACP,UAAU,0BACX,QAAQ;;EAUL,YACF,OAAO,uBACP,UAAU,0BACX,QAAQ;;;;;EAWL,QACF,OAAO,sBACP,UAAU,0BACX,QAAQ;;;;;;;;EAaL,cACF,OAAO,oBACP,UAAU,0BACX,QAAQ;;;;;EAUL,gBACF,OAAO,6BACP,UAAU,0BACX,QAAQ;;EAQL,SACF,QAAO,eACP,UAAU,0BACX,QAAQ;;;;;EAaL,OACF,OAAO,kBACP,UAAU,0BACX,QAAQ;;EAOL,YACF,OAAO,kBACP,UAAU,0BACX,QAAQ"}
@@ -0,0 +1,135 @@
1
+ import { parse } from "../../shared/validation.js";
2
+ import { removeUndefined } from "../../utils/remove-undefined.js";
3
+ import { toConnectCallOptions } from "../../shared/request-options.js";
4
+ import { StrategiesService as StrategiesService$1 } from "../../gen/strategies/v1/strategies_pb.js";
5
+ import { BacktestIdInputSchema, BotIdInputSchema, DeployProposalInputSchema, GetStrategyReferenceInputSchema, ListBotLogsInputSchema, ListBotsInputSchema, ProposeDeployInputSchema, StartBacktestInputSchema, StrategyVersionInputSchema, ValidateStrategyInputSchema, formatBacktest, formatBot, formatBotDetails, formatBotLogEntry, formatDeployStatus, formatExplainStrategyResult, formatProposeDeployResult, formatRunScenariosResult, formatStartBacktestResult, formatStrategyReference, formatStrategyTemplate, formatValidateStrategyResult } from "./strategies.schemas.js";
6
+ import { createClient } from "@connectrpc/connect";
7
+ //#region src/services/strategies/strategies.ts
8
+ /**
9
+ * Writes, tests and proposes trading bots of the caller's main account: validate a strategy into
10
+ * an immutable version, run its behaviour examples, backtest it, then record a deploy proposal
11
+ * the user deploys on the website with MFA and a wallet signature. Nothing here deploys a bot,
12
+ * creates a subaccount or moves funds. API keys need `read-strategies`, `draft-strategies` or
13
+ * `propose-strategy-deploy`, and a key scoped to a subaccount is refused (`PermissionError`).
14
+ * Errors carry a `strategies` detail; a `ServiceUnavailableError` is safe to retry unchanged.
15
+ */
16
+ var StrategiesService = class {
17
+ #client;
18
+ constructor(transports) {
19
+ this.#client = createClient(StrategiesService$1, transports.authApi);
20
+ }
21
+ /**
22
+ * What bot code is written against for one runtime version: the bot API reference and skill
23
+ * pack, then the manifest's JSON Schema, the allowed indicators and the limits once the runtime
24
+ * catalog is available. An unknown runtime version throws `ValidationError`
25
+ * (`RUNTIME_VERSION_UNSUPPORTED`).
26
+ */
27
+ async getReference(input = {}, options) {
28
+ const request = parse(GetStrategyReferenceInputSchema, input);
29
+ const res = await this.#client.getStrategyReference(request, toConnectCallOptions(options));
30
+ return formatStrategyReference(res);
31
+ }
32
+ /** Lists the bot templates: starting points with a manifest and code. */
33
+ async listTemplates(options) {
34
+ return (await this.#client.listStrategyTemplates({}, toConnectCallOptions(options))).templates.map(formatStrategyTemplate);
35
+ }
36
+ /**
37
+ * Checks a bot and stores it as an immutable version. A bot with mistakes is no error: it
38
+ * returns `valid: false` with its `errors`. Needs `draft-strategies`.
39
+ */
40
+ async validate(input, options) {
41
+ const request = parse(ValidateStrategyInputSchema, input);
42
+ const res = await this.#client.validateStrategy(request, toConnectCallOptions(options));
43
+ return formatValidateStrategyResult(res);
44
+ }
45
+ /**
46
+ * Runs a version's behaviour examples against its code; a version always gets the same
47
+ * result. Too many runs throw `RateLimitError` (`SCENARIO_RUN_LIMIT_REACHED`). Needs
48
+ * `draft-strategies`.
49
+ */
50
+ async runScenarios(input, options) {
51
+ const request = parse(StrategyVersionInputSchema, input);
52
+ const res = await this.#client.runScenarios(request, toConnectCallOptions(options));
53
+ return formatRunScenariosResult(res);
54
+ }
55
+ /**
56
+ * Starts a backtest of a version; poll `getBacktest` until it is `done` or `failed`. The same
57
+ * version, window, settings and balances return the existing backtest. The daily limit throws
58
+ * `RateLimitError` (`BACKTEST_LIMIT_REACHED`); reusing `idempotencyKey` for another request
59
+ * throws `AlreadyExistsError` (`IDEMPOTENCY_CONFLICT`). Needs `draft-strategies`.
60
+ */
61
+ async startBacktest(input, options) {
62
+ const request = parse(StartBacktestInputSchema, input);
63
+ const res = await this.#client.startBacktest(removeUndefined(request), toConnectCallOptions(options));
64
+ return formatStartBacktestResult(res);
65
+ }
66
+ /** Reads one backtest, with its report once `done`. Needs `read-strategies`. */
67
+ async getBacktest(input, options) {
68
+ const request = parse(BacktestIdInputSchema, input);
69
+ const res = await this.#client.getBacktest(request, toConnectCallOptions(options));
70
+ if (!res.backtest) throw new Error("GetBacktest response is missing its backtest");
71
+ return formatBacktest(res.backtest);
72
+ }
73
+ /**
74
+ * The review summary of a version: what a user approves when deploying it. Needs
75
+ * `read-strategies`.
76
+ */
77
+ async explain(input, options) {
78
+ const request = parse(StrategyVersionInputSchema, input);
79
+ const res = await this.#client.explainStrategy(request, toConnectCallOptions(options));
80
+ return formatExplainStrategyResult(res);
81
+ }
82
+ /**
83
+ * Records an immutable deploy proposal and returns the `deployUrl` where the user deploys it
84
+ * with MFA and a wallet signature; it never deploys or moves funds. Refusals throw
85
+ * `PreconditionFailedError` with the reason in the detail, for example `SCENARIOS_FAILING`,
86
+ * `BACKTEST_MISSING`, `INSUFFICIENT_FUNDS` (with `shortfall`) or `BOT_CAP_REACHED` (with
87
+ * `botCap`). Needs `propose-strategy-deploy`.
88
+ */
89
+ async proposeDeploy(input, options) {
90
+ const request = parse(ProposeDeployInputSchema, input);
91
+ const res = await this.#client.proposeDeploy(request, toConnectCallOptions(options));
92
+ return formatProposeDeployResult(res);
93
+ }
94
+ /**
95
+ * Reads where a deploy proposal is; poll it until `live`, `failed` or `expired`. Needs
96
+ * `read-strategies`.
97
+ */
98
+ async getDeployStatus(input, options) {
99
+ const request = parse(DeployProposalInputSchema, input);
100
+ const res = await this.#client.getDeployStatus(request, toConnectCallOptions(options));
101
+ if (!res.status) throw new Error("GetDeployStatus response is missing its status");
102
+ return formatDeployStatus(res.status);
103
+ }
104
+ /** Lists the caller's bots, newest first. Needs `read-strategies`. */
105
+ async listBots(input = {}, options) {
106
+ const request = parse(ListBotsInputSchema, input);
107
+ const res = await this.#client.listBots(removeUndefined(request), toConnectCallOptions(options));
108
+ return {
109
+ bots: res.bots.map(formatBot),
110
+ nextPageToken: res.nextPageToken
111
+ };
112
+ }
113
+ /**
114
+ * Reads one bot: its money rules and settings, its subaccount's balances and open orders, and
115
+ * its recent decisions and errors. Needs `read-strategies`.
116
+ */
117
+ async getBot(input, options) {
118
+ const request = parse(BotIdInputSchema, input);
119
+ const res = await this.#client.getBot(request, toConnectCallOptions(options));
120
+ return formatBotDetails(res);
121
+ }
122
+ /** Reads a bot's log lines, decisions and errors, oldest first. Needs `read-strategies`. */
123
+ async listBotLogs(input, options) {
124
+ const request = parse(ListBotLogsInputSchema, input);
125
+ const res = await this.#client.listBotLogs(removeUndefined(request), toConnectCallOptions(options));
126
+ return {
127
+ entries: res.entries.map(formatBotLogEntry),
128
+ nextPageToken: res.nextPageToken
129
+ };
130
+ }
131
+ };
132
+ //#endregion
133
+ export { StrategiesService };
134
+
135
+ //# sourceMappingURL=strategies.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"strategies.js","names":["#client","Proto.StrategiesService"],"sources":["../../../src/services/strategies/strategies.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/strategies/v1/strategies_pb.js\";\nimport {\n toConnectCallOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport type { AuthApiTransports } from \"../../shared/transports.js\";\nimport { parse } from \"../../shared/validation.js\";\nimport { removeUndefined } from \"../../utils/remove-undefined.js\";\nimport {\n BacktestIdInputSchema,\n BotIdInputSchema,\n DeployProposalInputSchema,\n GetStrategyReferenceInputSchema,\n ListBotLogsInputSchema,\n ListBotsInputSchema,\n ProposeDeployInputSchema,\n StartBacktestInputSchema,\n StrategyVersionInputSchema,\n ValidateStrategyInputSchema,\n formatBacktest,\n formatBot,\n formatBotDetails,\n formatBotLogEntry,\n formatDeployStatus,\n formatExplainStrategyResult,\n formatProposeDeployResult,\n formatRunScenariosResult,\n formatStartBacktestResult,\n formatStrategyReference,\n formatStrategyTemplate,\n formatValidateStrategyResult,\n type ExplainStrategyResult,\n type GetStrategyReferenceInput,\n type ListBotLogsInput,\n type ListBotsInput,\n type ListStrategyBotLogsResult,\n type ListStrategyBotsResult,\n type ProposeDeployInput,\n type ProposeStrategyDeployResult,\n type RunStrategyScenariosResult,\n type StartBacktestInput,\n type StartStrategyBacktestResult,\n type StrategyBacktest,\n type StrategyBacktestInput,\n type StrategyBotDetails,\n type StrategyBotInput,\n type StrategyDeployProposalInput,\n type StrategyDeployStatus,\n type StrategyReference,\n type StrategyTemplate,\n type StrategyVersionInput,\n type ValidateStrategyInput,\n type ValidateStrategyResult,\n} from \"./strategies.schemas.js\";\n\n/**\n * Writes, tests and proposes trading bots of the caller's main account: validate a strategy into\n * an immutable version, run its behaviour examples, backtest it, then record a deploy proposal\n * the user deploys on the website with MFA and a wallet signature. Nothing here deploys a bot,\n * creates a subaccount or moves funds. API keys need `read-strategies`, `draft-strategies` or\n * `propose-strategy-deploy`, and a key scoped to a subaccount is refused (`PermissionError`).\n * Errors carry a `strategies` detail; a `ServiceUnavailableError` is safe to retry unchanged.\n */\nexport class StrategiesService {\n #client: Client<typeof Proto.StrategiesService>;\n\n constructor(transports: AuthApiTransports) {\n this.#client = createClient(Proto.StrategiesService, transports.authApi);\n }\n\n /**\n * What bot code is written against for one runtime version: the bot API reference and skill\n * pack, then the manifest's JSON Schema, the allowed indicators and the limits once the runtime\n * catalog is available. An unknown runtime version throws `ValidationError`\n * (`RUNTIME_VERSION_UNSUPPORTED`).\n */\n async getReference(\n input: GetStrategyReferenceInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<StrategyReference> {\n const request = parse(GetStrategyReferenceInputSchema, input);\n const res = await this.#client.getStrategyReference(request, toConnectCallOptions(options));\n return formatStrategyReference(res);\n }\n\n /** Lists the bot templates: starting points with a manifest and code. */\n async listTemplates(options?: PolyesterRequestOptions): Promise<StrategyTemplate[]> {\n const res = await this.#client.listStrategyTemplates({}, toConnectCallOptions(options));\n return res.templates.map(formatStrategyTemplate);\n }\n\n /**\n * Checks a bot and stores it as an immutable version. A bot with mistakes is no error: it\n * returns `valid: false` with its `errors`. Needs `draft-strategies`.\n */\n async validate(\n input: ValidateStrategyInput,\n options?: PolyesterRequestOptions,\n ): Promise<ValidateStrategyResult> {\n const request = parse(ValidateStrategyInputSchema, input);\n const res = await this.#client.validateStrategy(request, toConnectCallOptions(options));\n return formatValidateStrategyResult(res);\n }\n\n /**\n * Runs a version's behaviour examples against its code; a version always gets the same\n * result. Too many runs throw `RateLimitError` (`SCENARIO_RUN_LIMIT_REACHED`). Needs\n * `draft-strategies`.\n */\n async runScenarios(\n input: StrategyVersionInput,\n options?: PolyesterRequestOptions,\n ): Promise<RunStrategyScenariosResult> {\n const request = parse(StrategyVersionInputSchema, input);\n const res = await this.#client.runScenarios(request, toConnectCallOptions(options));\n return formatRunScenariosResult(res);\n }\n\n /**\n * Starts a backtest of a version; poll `getBacktest` until it is `done` or `failed`. The same\n * version, window, settings and balances return the existing backtest. The daily limit throws\n * `RateLimitError` (`BACKTEST_LIMIT_REACHED`); reusing `idempotencyKey` for another request\n * throws `AlreadyExistsError` (`IDEMPOTENCY_CONFLICT`). Needs `draft-strategies`.\n */\n async startBacktest(\n input: StartBacktestInput,\n options?: PolyesterRequestOptions,\n ): Promise<StartStrategyBacktestResult> {\n const request = parse(StartBacktestInputSchema, input);\n const res = await this.#client.startBacktest(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return formatStartBacktestResult(res);\n }\n\n /** Reads one backtest, with its report once `done`. Needs `read-strategies`. */\n async getBacktest(\n input: StrategyBacktestInput,\n options?: PolyesterRequestOptions,\n ): Promise<StrategyBacktest> {\n const request = parse(BacktestIdInputSchema, input);\n const res = await this.#client.getBacktest(request, toConnectCallOptions(options));\n if (!res.backtest) throw new Error(\"GetBacktest response is missing its backtest\");\n return formatBacktest(res.backtest);\n }\n\n /**\n * The review summary of a version: what a user approves when deploying it. Needs\n * `read-strategies`.\n */\n async explain(\n input: StrategyVersionInput,\n options?: PolyesterRequestOptions,\n ): Promise<ExplainStrategyResult> {\n const request = parse(StrategyVersionInputSchema, input);\n const res = await this.#client.explainStrategy(request, toConnectCallOptions(options));\n return formatExplainStrategyResult(res);\n }\n\n /**\n * Records an immutable deploy proposal and returns the `deployUrl` where the user deploys it\n * with MFA and a wallet signature; it never deploys or moves funds. Refusals throw\n * `PreconditionFailedError` with the reason in the detail, for example `SCENARIOS_FAILING`,\n * `BACKTEST_MISSING`, `INSUFFICIENT_FUNDS` (with `shortfall`) or `BOT_CAP_REACHED` (with\n * `botCap`). Needs `propose-strategy-deploy`.\n */\n async proposeDeploy(\n input: ProposeDeployInput,\n options?: PolyesterRequestOptions,\n ): Promise<ProposeStrategyDeployResult> {\n const request = parse(ProposeDeployInputSchema, input);\n const res = await this.#client.proposeDeploy(request, toConnectCallOptions(options));\n return formatProposeDeployResult(res);\n }\n\n /**\n * Reads where a deploy proposal is; poll it until `live`, `failed` or `expired`. Needs\n * `read-strategies`.\n */\n async getDeployStatus(\n input: StrategyDeployProposalInput,\n options?: PolyesterRequestOptions,\n ): Promise<StrategyDeployStatus> {\n const request = parse(DeployProposalInputSchema, input);\n const res = await this.#client.getDeployStatus(request, toConnectCallOptions(options));\n if (!res.status) throw new Error(\"GetDeployStatus response is missing its status\");\n return formatDeployStatus(res.status);\n }\n\n /** Lists the caller's bots, newest first. Needs `read-strategies`. */\n async listBots(\n input: ListBotsInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<ListStrategyBotsResult> {\n const request = parse(ListBotsInputSchema, input);\n const res = await this.#client.listBots(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return { bots: res.bots.map(formatBot), nextPageToken: res.nextPageToken };\n }\n\n /**\n * Reads one bot: its money rules and settings, its subaccount's balances and open orders, and\n * its recent decisions and errors. Needs `read-strategies`.\n */\n async getBot(\n input: StrategyBotInput,\n options?: PolyesterRequestOptions,\n ): Promise<StrategyBotDetails> {\n const request = parse(BotIdInputSchema, input);\n const res = await this.#client.getBot(request, toConnectCallOptions(options));\n return formatBotDetails(res);\n }\n\n /** Reads a bot's log lines, decisions and errors, oldest first. Needs `read-strategies`. */\n async listBotLogs(\n input: ListBotLogsInput,\n options?: PolyesterRequestOptions,\n ): Promise<ListStrategyBotLogsResult> {\n const request = parse(ListBotLogsInputSchema, input);\n const res = await this.#client.listBotLogs(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return { entries: res.entries.map(formatBotLogEntry), nextPageToken: res.nextPageToken };\n }\n}\n"],"mappings":"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"}