@polyester/sdk 0.35.0 → 0.36.0-devnet-20261112144059

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 (174) hide show
  1. package/CHANGELOG.md +48 -0
  2. package/dist/catalogs/snapshot-validation.js +5 -0
  3. package/dist/catalogs/snapshot-validation.js.map +1 -1
  4. package/dist/client.d.ts +2 -0
  5. package/dist/client.d.ts.map +1 -1
  6. package/dist/client.js +2 -0
  7. package/dist/client.js.map +1 -1
  8. package/dist/gen/ai/v1/assistant_pb.d.ts +144 -2
  9. package/dist/gen/ai/v1/assistant_pb.d.ts.map +1 -1
  10. package/dist/gen/ai/v1/assistant_pb.js +32 -2
  11. package/dist/gen/ai/v1/assistant_pb.js.map +1 -1
  12. package/dist/gen/alerts/v1/price_alerts_pb.d.ts +11 -5
  13. package/dist/gen/alerts/v1/price_alerts_pb.d.ts.map +1 -1
  14. package/dist/gen/alerts/v1/price_alerts_pb.js +3 -1
  15. package/dist/gen/alerts/v1/price_alerts_pb.js.map +1 -1
  16. package/dist/gen/auth/v1/policies_pb.d.ts +14 -1
  17. package/dist/gen/auth/v1/policies_pb.d.ts.map +1 -1
  18. package/dist/gen/auth/v1/policies_pb.js +14 -1
  19. package/dist/gen/auth/v1/policies_pb.js.map +1 -1
  20. package/dist/gen/auth/v1/subaccounts_pb.d.ts +14 -1
  21. package/dist/gen/auth/v1/subaccounts_pb.d.ts.map +1 -1
  22. package/dist/gen/auth/v1/subaccounts_pb.js +14 -1
  23. package/dist/gen/auth/v1/subaccounts_pb.js.map +1 -1
  24. package/dist/gen/changelog/v1/changelog_pb.d.ts +7 -1
  25. package/dist/gen/changelog/v1/changelog_pb.d.ts.map +1 -1
  26. package/dist/gen/changelog/v1/changelog_pb.js +7 -1
  27. package/dist/gen/changelog/v1/changelog_pb.js.map +1 -1
  28. package/dist/gen/index.d.ts +2 -1
  29. package/dist/gen/index.js +2 -1
  30. package/dist/gen/marketdata/v1/marketdata_pb.d.ts +57 -5
  31. package/dist/gen/marketdata/v1/marketdata_pb.d.ts.map +1 -1
  32. package/dist/gen/marketdata/v1/marketdata_pb.js +10 -4
  33. package/dist/gen/marketdata/v1/marketdata_pb.js.map +1 -1
  34. package/dist/gen/notifications/v1/notifications_pb.d.ts +827 -0
  35. package/dist/gen/notifications/v1/notifications_pb.d.ts.map +1 -0
  36. package/dist/gen/notifications/v1/notifications_pb.js +346 -0
  37. package/dist/gen/notifications/v1/notifications_pb.js.map +1 -0
  38. package/dist/gen/orders/v1/orders_pb.d.ts +247 -19
  39. package/dist/gen/orders/v1/orders_pb.d.ts.map +1 -1
  40. package/dist/gen/orders/v1/orders_pb.js +188 -66
  41. package/dist/gen/orders/v1/orders_pb.js.map +1 -1
  42. package/dist/gen/orders/v1/orders_read_pb.d.ts +73 -5
  43. package/dist/gen/orders/v1/orders_read_pb.d.ts.map +1 -1
  44. package/dist/gen/orders/v1/orders_read_pb.js +40 -5
  45. package/dist/gen/orders/v1/orders_read_pb.js.map +1 -1
  46. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts +1195 -190
  47. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts.map +1 -1
  48. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js +317 -7
  49. package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js.map +1 -1
  50. package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts +369 -6
  51. package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts.map +1 -1
  52. package/dist/gen/swap/quickswap/v1/quickswap_pb.js +237 -14
  53. package/dist/gen/swap/quickswap/v1/quickswap_pb.js.map +1 -1
  54. package/dist/gen/tradews/v1/trade_ws_pb.d.ts +39 -1
  55. package/dist/gen/tradews/v1/trade_ws_pb.d.ts.map +1 -1
  56. package/dist/gen/tradews/v1/trade_ws_pb.js +2 -1
  57. package/dist/gen/tradews/v1/trade_ws_pb.js.map +1 -1
  58. package/dist/gen/triggers/v1/triggers_pb.d.ts +526 -13
  59. package/dist/gen/triggers/v1/triggers_pb.d.ts.map +1 -1
  60. package/dist/gen/triggers/v1/triggers_pb.js +126 -26
  61. package/dist/gen/triggers/v1/triggers_pb.js.map +1 -1
  62. package/dist/index.d.ts +7 -4
  63. package/dist/services/assistant/assistant-events.schemas.d.ts +57 -39
  64. package/dist/services/assistant/assistant-events.schemas.d.ts.map +1 -1
  65. package/dist/services/assistant/assistant.d.ts +16 -1
  66. package/dist/services/assistant/assistant.d.ts.map +1 -1
  67. package/dist/services/assistant/assistant.js +24 -1
  68. package/dist/services/assistant/assistant.js.map +1 -1
  69. package/dist/services/assistant/assistant.schemas.d.ts +13 -1
  70. package/dist/services/assistant/assistant.schemas.d.ts.map +1 -1
  71. package/dist/services/assistant/assistant.schemas.js +15 -1
  72. package/dist/services/assistant/assistant.schemas.js.map +1 -1
  73. package/dist/services/assistant/assistant.types.d.ts +2 -2
  74. package/dist/services/auto-withdraw/auto-withdraw.schemas.d.ts +22 -22
  75. package/dist/services/changelog/changelog.codecs.d.ts +1 -1
  76. package/dist/services/changelog/changelog.codecs.d.ts.map +1 -1
  77. package/dist/services/changelog/changelog.codecs.js +6 -3
  78. package/dist/services/changelog/changelog.codecs.js.map +1 -1
  79. package/dist/services/changelog/changelog.schemas.d.ts +19 -19
  80. package/dist/services/checkpoints/checkpoints.schemas.d.ts +1 -1
  81. package/dist/services/internal-transfers/internal-transfers.schemas.d.ts +3 -3
  82. package/dist/services/lifecycle/lifecycle.schemas.d.ts +13 -13
  83. package/dist/services/market-data/market-data.schemas.js +16 -1
  84. package/dist/services/market-data/market-data.schemas.js.map +1 -1
  85. package/dist/services/notifications/notifications.codecs.d.ts +16 -0
  86. package/dist/services/notifications/notifications.codecs.d.ts.map +1 -0
  87. package/dist/services/notifications/notifications.codecs.js +40 -0
  88. package/dist/services/notifications/notifications.codecs.js.map +1 -0
  89. package/dist/services/notifications/notifications.d.ts +41 -0
  90. package/dist/services/notifications/notifications.d.ts.map +1 -0
  91. package/dist/services/notifications/notifications.js +67 -0
  92. package/dist/services/notifications/notifications.js.map +1 -0
  93. package/dist/services/notifications/notifications.schemas.d.ts +154 -0
  94. package/dist/services/notifications/notifications.schemas.d.ts.map +1 -0
  95. package/dist/services/notifications/notifications.schemas.js +116 -0
  96. package/dist/services/notifications/notifications.schemas.js.map +1 -0
  97. package/dist/services/notifications/notifications.types.d.ts +3 -0
  98. package/dist/services/notifications/service.d.ts +8 -0
  99. package/dist/services/notifications/service.d.ts.map +1 -0
  100. package/dist/services/notifications/service.js +9 -0
  101. package/dist/services/notifications/service.js.map +1 -0
  102. package/dist/services/orders/order-enums.codecs.js +12 -4
  103. package/dist/services/orders/order-enums.codecs.js.map +1 -1
  104. package/dist/services/orders/order-errors.schemas.d.ts +1 -1
  105. package/dist/services/orders/orders-batch.schemas.d.ts +2688 -417
  106. package/dist/services/orders/orders-batch.schemas.d.ts.map +1 -1
  107. package/dist/services/orders/orders-batch.schemas.js +5 -3
  108. package/dist/services/orders/orders-batch.schemas.js.map +1 -1
  109. package/dist/services/orders/orders-input.schemas.d.ts +4828 -1265
  110. package/dist/services/orders/orders-input.schemas.d.ts.map +1 -1
  111. package/dist/services/orders/orders-input.schemas.js +104 -32
  112. package/dist/services/orders/orders-input.schemas.js.map +1 -1
  113. package/dist/services/orders/orders-output.schemas.d.ts +40 -22
  114. package/dist/services/orders/orders-output.schemas.d.ts.map +1 -1
  115. package/dist/services/orders/orders-output.schemas.js +8 -0
  116. package/dist/services/orders/orders-output.schemas.js.map +1 -1
  117. package/dist/services/orders/orders-risk.schemas.d.ts +1 -1
  118. package/dist/services/orders/orders-risk.schemas.d.ts.map +1 -1
  119. package/dist/services/orders/orders-risk.schemas.js +1 -1
  120. package/dist/services/orders/orders-risk.schemas.js.map +1 -1
  121. package/dist/services/orders/orders.codecs.js +3 -0
  122. package/dist/services/orders/orders.codecs.js.map +1 -1
  123. package/dist/services/orders/orders.d.ts +3 -1
  124. package/dist/services/orders/orders.d.ts.map +1 -1
  125. package/dist/services/orders/orders.js +5 -12
  126. package/dist/services/orders/orders.js.map +1 -1
  127. package/dist/services/policies/api-key-policies/api-key-policies.schemas.d.ts +15 -15
  128. package/dist/services/policies/shared.codecs.js +9 -3
  129. package/dist/services/policies/shared.codecs.js.map +1 -1
  130. package/dist/services/policies/shared.d.ts +1 -1
  131. package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.d.ts +3 -3
  132. package/dist/services/price-alerts/price-alerts.d.ts +10 -5
  133. package/dist/services/price-alerts/price-alerts.d.ts.map +1 -1
  134. package/dist/services/price-alerts/price-alerts.js +10 -5
  135. package/dist/services/price-alerts/price-alerts.js.map +1 -1
  136. package/dist/services/rewards/rewards.schemas.d.ts +4 -4
  137. package/dist/services/subaccounts/subaccounts.codecs.js +3 -1
  138. package/dist/services/subaccounts/subaccounts.codecs.js.map +1 -1
  139. package/dist/services/subaccounts/subaccounts.schemas.d.ts +7 -7
  140. package/dist/services/trades/trades.schemas.d.ts +1 -1
  141. package/dist/services/triggers/trigger-input.schemas.d.ts +271 -41
  142. package/dist/services/triggers/trigger-input.schemas.d.ts.map +1 -1
  143. package/dist/services/triggers/trigger-input.schemas.js +51 -3
  144. package/dist/services/triggers/trigger-input.schemas.js.map +1 -1
  145. package/dist/services/triggers/triggers-output.schemas.d.ts +235 -24
  146. package/dist/services/triggers/triggers-output.schemas.d.ts.map +1 -1
  147. package/dist/services/triggers/triggers-output.schemas.js +49 -2
  148. package/dist/services/triggers/triggers-output.schemas.js.map +1 -1
  149. package/dist/services/triggers/triggers.codecs.js +7 -2
  150. package/dist/services/triggers/triggers.codecs.js.map +1 -1
  151. package/dist/services/triggers/triggers.d.ts +25 -3
  152. package/dist/services/triggers/triggers.d.ts.map +1 -1
  153. package/dist/services/triggers/triggers.js +49 -3
  154. package/dist/services/triggers/triggers.js.map +1 -1
  155. package/dist/services/triggers/triggers.schemas.d.ts +3 -3
  156. package/dist/services/triggers/triggers.types.d.ts +3 -3
  157. package/dist/services/vip/vip.schemas.d.ts +3 -3
  158. package/dist/shared/catalog-config.d.ts +6 -0
  159. package/dist/shared/catalog-config.d.ts.map +1 -1
  160. package/dist/shared/catalog-config.js.map +1 -1
  161. package/dist/shared/error-detail.d.ts +6 -2
  162. package/dist/shared/error-detail.d.ts.map +1 -1
  163. package/dist/shared/error-detail.js +1 -0
  164. package/dist/shared/error-detail.js.map +1 -1
  165. package/dist/shared/error-details/notifications.js +15 -0
  166. package/dist/shared/error-details/notifications.js.map +1 -0
  167. package/dist/shared/request-id.d.ts +6 -0
  168. package/dist/shared/request-id.d.ts.map +1 -0
  169. package/dist/shared/request-id.js +17 -0
  170. package/dist/shared/request-id.js.map +1 -0
  171. package/dist/wired-services.d.ts.map +1 -1
  172. package/dist/wired-services.js +2 -0
  173. package/dist/wired-services.js.map +1 -1
  174. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"shared.codecs.js","names":[],"sources":["../../../src/services/policies/shared.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/auth/v1/policies_pb.js\";\nimport { enumLabel } from \"../../shared/proto-enum-codec.js\";\nimport type { DecodedEnum, ProtoToOutput } from \"../../utils/types.js\";\n\n/** Product actions, accepted by sub-account and API-key policies. */\nexport const PRODUCT_POLICY_ACTION_LABELS = [\n \"trade-spot\",\n \"internal-transfer\",\n \"external-withdraw\",\n \"read-balances\",\n \"read-spot\",\n \"read-internal-transfers\",\n \"read-address-book\",\n \"manage-address-book\",\n \"read-auto-withdraw\",\n \"manage-auto-withdraw\",\n \"swap\",\n] as const;\n\n/**\n * Account permissions, accepted by API-key policies only: a sub-account policy refuses them.\n * Each grants exactly the calls it names, and main-account permissions apply only to keys\n * scoped to the main account.\n */\nexport const ACCOUNT_PERMISSION_POLICY_ACTION_LABELS = [\n \"read-api-keys\",\n \"read-api-policies\",\n \"read-subaccount-policies\",\n \"read-subaccount-permissions\",\n \"read-vip-status\",\n \"read-social-verification\",\n \"read-profile\",\n \"read-account-directory\",\n \"read-withdraw-validation\",\n \"read-daily-claims\",\n \"claim-daily-reward\",\n \"read-checkpoints\",\n \"read-rewards\",\n \"create-deposit-address\",\n \"read-deposit-addresses\",\n \"read-subaccounts\",\n \"read-subaccount-activity\",\n \"read-subaccount-members\",\n \"read-subaccount-invites\",\n \"read-guard-signer-status\",\n] as const;\n\nexport const POLICY_ACTION_LABELS = [\n ...PRODUCT_POLICY_ACTION_LABELS,\n ...ACCOUNT_PERMISSION_POLICY_ACTION_LABELS,\n] as const;\nexport type PolicyActionLabel = (typeof POLICY_ACTION_LABELS)[number];\n\nexport const POLICY_MARKET_SCOPE_LABELS = [\"all\", \"allowlist\"] as const;\nexport type PolicyMarketScopeLabel = (typeof POLICY_MARKET_SCOPE_LABELS)[number];\n\nexport const PolicyMarketScopeCodec = {\n inputToProto: {\n all: Proto.MarketScope_Value.ALL,\n allowlist: Proto.MarketScope_Value.ALLOWLIST,\n } satisfies Record<PolicyMarketScopeLabel, Proto.MarketScope_Value>,\n protoToOutput: {\n [Proto.MarketScope_Value.UNSPECIFIED]: \"unspecified\",\n [Proto.MarketScope_Value.ALL]: \"all\",\n [Proto.MarketScope_Value.ALLOWLIST]: \"allowlist\",\n } satisfies ProtoToOutput<Proto.MarketScope_Value, PolicyMarketScopeLabel>,\n} as const;\n\nexport const PolicyActionCodec = {\n protoToOutput: {\n [Proto.PolicyAction.UNSPECIFIED]: \"unspecified\",\n [Proto.PolicyAction.TRADE_SPOT]: \"trade-spot\",\n [Proto.PolicyAction.INTERNAL_TRANSFER]: \"internal-transfer\",\n [Proto.PolicyAction.EXTERNAL_WITHDRAW]: \"external-withdraw\",\n [Proto.PolicyAction.READ_BALANCES]: \"read-balances\",\n [Proto.PolicyAction.READ_SPOT]: \"read-spot\",\n [Proto.PolicyAction.READ_INTERNAL_TRANSFERS]: \"read-internal-transfers\",\n [Proto.PolicyAction.READ_ADDRESS_BOOK]: \"read-address-book\",\n [Proto.PolicyAction.MANAGE_ADDRESS_BOOK]: \"manage-address-book\",\n [Proto.PolicyAction.READ_AUTO_WITHDRAW]: \"read-auto-withdraw\",\n [Proto.PolicyAction.MANAGE_AUTO_WITHDRAW]: \"manage-auto-withdraw\",\n [Proto.PolicyAction.SWAP]: \"swap\",\n [Proto.PolicyAction.READ_API_KEYS]: \"read-api-keys\",\n [Proto.PolicyAction.READ_API_POLICIES]: \"read-api-policies\",\n [Proto.PolicyAction.READ_SUBACCOUNT_POLICIES]: \"read-subaccount-policies\",\n [Proto.PolicyAction.READ_SUBACCOUNT_PERMISSIONS]: \"read-subaccount-permissions\",\n [Proto.PolicyAction.READ_VIP_STATUS]: \"read-vip-status\",\n [Proto.PolicyAction.READ_SOCIAL_VERIFICATION]: \"read-social-verification\",\n [Proto.PolicyAction.READ_PROFILE]: \"read-profile\",\n [Proto.PolicyAction.READ_ACCOUNT_DIRECTORY]: \"read-account-directory\",\n [Proto.PolicyAction.READ_WITHDRAW_VALIDATION]: \"read-withdraw-validation\",\n [Proto.PolicyAction.READ_DAILY_CLAIMS]: \"read-daily-claims\",\n [Proto.PolicyAction.CLAIM_DAILY_REWARD]: \"claim-daily-reward\",\n [Proto.PolicyAction.READ_CHECKPOINTS]: \"read-checkpoints\",\n [Proto.PolicyAction.READ_REWARDS]: \"read-rewards\",\n [Proto.PolicyAction.CREATE_DEPOSIT_ADDRESS]: \"create-deposit-address\",\n [Proto.PolicyAction.READ_DEPOSIT_ADDRESSES]: \"read-deposit-addresses\",\n [Proto.PolicyAction.READ_SUBACCOUNTS]: \"read-subaccounts\",\n [Proto.PolicyAction.READ_SUBACCOUNT_ACTIVITY]: \"read-subaccount-activity\",\n [Proto.PolicyAction.READ_SUBACCOUNT_MEMBERS]: \"read-subaccount-members\",\n [Proto.PolicyAction.READ_SUBACCOUNT_INVITES]: \"read-subaccount-invites\",\n [Proto.PolicyAction.READ_GUARD_SIGNER_STATUS]: \"read-guard-signer-status\",\n } satisfies ProtoToOutput<Proto.PolicyAction, PolicyActionLabel>,\n inputToProto: {\n \"trade-spot\": Proto.PolicyAction.TRADE_SPOT,\n \"internal-transfer\": Proto.PolicyAction.INTERNAL_TRANSFER,\n \"external-withdraw\": Proto.PolicyAction.EXTERNAL_WITHDRAW,\n \"read-balances\": Proto.PolicyAction.READ_BALANCES,\n \"read-spot\": Proto.PolicyAction.READ_SPOT,\n \"read-internal-transfers\": Proto.PolicyAction.READ_INTERNAL_TRANSFERS,\n \"read-address-book\": Proto.PolicyAction.READ_ADDRESS_BOOK,\n \"manage-address-book\": Proto.PolicyAction.MANAGE_ADDRESS_BOOK,\n \"read-auto-withdraw\": Proto.PolicyAction.READ_AUTO_WITHDRAW,\n \"manage-auto-withdraw\": Proto.PolicyAction.MANAGE_AUTO_WITHDRAW,\n swap: Proto.PolicyAction.SWAP,\n \"read-api-keys\": Proto.PolicyAction.READ_API_KEYS,\n \"read-api-policies\": Proto.PolicyAction.READ_API_POLICIES,\n \"read-subaccount-policies\": Proto.PolicyAction.READ_SUBACCOUNT_POLICIES,\n \"read-subaccount-permissions\": Proto.PolicyAction.READ_SUBACCOUNT_PERMISSIONS,\n \"read-vip-status\": Proto.PolicyAction.READ_VIP_STATUS,\n \"read-social-verification\": Proto.PolicyAction.READ_SOCIAL_VERIFICATION,\n \"read-profile\": Proto.PolicyAction.READ_PROFILE,\n \"read-account-directory\": Proto.PolicyAction.READ_ACCOUNT_DIRECTORY,\n \"read-withdraw-validation\": Proto.PolicyAction.READ_WITHDRAW_VALIDATION,\n \"read-daily-claims\": Proto.PolicyAction.READ_DAILY_CLAIMS,\n \"claim-daily-reward\": Proto.PolicyAction.CLAIM_DAILY_REWARD,\n \"read-checkpoints\": Proto.PolicyAction.READ_CHECKPOINTS,\n \"read-rewards\": Proto.PolicyAction.READ_REWARDS,\n \"create-deposit-address\": Proto.PolicyAction.CREATE_DEPOSIT_ADDRESS,\n \"read-deposit-addresses\": Proto.PolicyAction.READ_DEPOSIT_ADDRESSES,\n \"read-subaccounts\": Proto.PolicyAction.READ_SUBACCOUNTS,\n \"read-subaccount-activity\": Proto.PolicyAction.READ_SUBACCOUNT_ACTIVITY,\n \"read-subaccount-members\": Proto.PolicyAction.READ_SUBACCOUNT_MEMBERS,\n \"read-subaccount-invites\": Proto.PolicyAction.READ_SUBACCOUNT_INVITES,\n \"read-guard-signer-status\": Proto.PolicyAction.READ_GUARD_SIGNER_STATUS,\n } satisfies Record<PolicyActionLabel, Proto.PolicyAction>,\n} as const;\n\n/**\n * Returns the display label for a policy market scope.\n */\nexport function policyMarketScopeLabelFor(value: number): DecodedEnum<PolicyMarketScopeLabel> {\n return enumLabel(PolicyMarketScopeCodec.protoToOutput, value);\n}\n\n/**\n * Returns the display label for a policy action.\n */\nexport function policyActionLabelFor(value: number): DecodedEnum<PolicyActionLabel> {\n return enumLabel(PolicyActionCodec.protoToOutput, value);\n}\n"],"mappings":";;;;AAKA,MAAa,+BAA+B;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;;;;;;AAOA,MAAa,0CAA0C;CACnD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;AAEA,MAAa,uBAAuB,CAChC,GAAG,8BACH,GAAG,uCACP;AAMA,MAAa,yBAAyB;CAClC,cAAc;EACV,KAAA;EACA,WAAA;CACJ;CACA,eAAe;GAC4B,IAAA;GACR,IAAA;GACM,IAAA;CACzC;AACJ;AAEA,MAAa,oBAAoB;CAC7B,eAAe;GACuB,IAAA;GACD,IAAA;GACO,IAAA;GACA,IAAA;GACJ,IAAA;GACJ,IAAA;GACc,IAAA;GACN,KAAA;GACE,KAAA;GACD,KAAA;GACE,KAAA;GAChB,KAAA;GACS,KAAA;GACI,KAAA;GACO,KAAA;GACG,KAAA;GACZ,KAAA;GACS,KAAA;GACZ,KAAA;GACU,KAAA;GACE,KAAA;GACP,KAAA;GACC,KAAA;GACF,KAAA;GACJ,KAAA;GACU,KAAA;GACA,KAAA;GACN,KAAA;GACQ,KAAA;GACD,KAAA;GACA,KAAA;GACC,KAAA;CACnD;CACA,cAAc;EACV,cAAA;EACA,qBAAA;EACA,qBAAA;EACA,iBAAA;EACA,aAAA;EACA,2BAAA;EACA,qBAAA;EACA,uBAAA;EACA,sBAAA;EACA,wBAAA;EACA,MAAA;EACA,iBAAA;EACA,qBAAA;EACA,4BAAA;EACA,+BAAA;EACA,mBAAA;EACA,4BAAA;EACA,gBAAA;EACA,0BAAA;EACA,4BAAA;EACA,qBAAA;EACA,sBAAA;EACA,oBAAA;EACA,gBAAA;EACA,0BAAA;EACA,0BAAA;EACA,oBAAA;EACA,4BAAA;EACA,2BAAA;EACA,2BAAA;EACA,4BAAA;CACJ;AACJ;;;;AAKA,SAAgB,0BAA0B,OAAoD;CAC1F,OAAO,UAAU,uBAAuB,eAAe,KAAK;AAChE;;;;AAKA,SAAgB,qBAAqB,OAA+C;CAChF,OAAO,UAAU,kBAAkB,eAAe,KAAK;AAC3D"}
1
+ {"version":3,"file":"shared.codecs.js","names":[],"sources":["../../../src/services/policies/shared.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/auth/v1/policies_pb.js\";\nimport { enumLabel } from \"../../shared/proto-enum-codec.js\";\nimport type { DecodedEnum, ProtoToOutput } from \"../../utils/types.js\";\n\n/** Product actions, accepted by sub-account and API-key policies. */\nexport const PRODUCT_POLICY_ACTION_LABELS = [\n \"trade-spot\",\n \"internal-transfer\",\n \"external-withdraw\",\n \"read-balances\",\n \"read-spot\",\n \"read-internal-transfers\",\n \"read-address-book\",\n \"manage-address-book\",\n \"read-auto-withdraw\",\n \"manage-auto-withdraw\",\n \"swap\",\n] as const;\n\n/**\n * Account permissions, accepted by API-key policies only: a sub-account policy refuses them.\n * Each grants exactly the calls it names, and main-account permissions apply only to keys\n * scoped to the main account.\n */\nexport const ACCOUNT_PERMISSION_POLICY_ACTION_LABELS = [\n \"read-api-keys\",\n \"read-api-policies\",\n \"read-subaccount-policies\",\n \"read-subaccount-permissions\",\n \"read-vip-status\",\n \"read-social-verification\",\n \"read-profile\",\n \"read-account-directory\",\n \"read-withdraw-validation\",\n \"read-daily-claims\",\n \"claim-daily-reward\",\n \"read-checkpoints\",\n \"read-rewards\",\n \"create-deposit-address\",\n \"read-deposit-addresses\",\n \"read-subaccounts\",\n \"read-subaccount-activity\",\n \"read-subaccount-members\",\n \"read-subaccount-invites\",\n \"read-guard-signer-status\",\n \"read-price-alerts\",\n \"manage-price-alerts\",\n] as const;\n\nexport const POLICY_ACTION_LABELS = [\n ...PRODUCT_POLICY_ACTION_LABELS,\n ...ACCOUNT_PERMISSION_POLICY_ACTION_LABELS,\n] as const;\nexport type PolicyActionLabel = (typeof POLICY_ACTION_LABELS)[number];\n\nexport const POLICY_MARKET_SCOPE_LABELS = [\"all\", \"allowlist\"] as const;\nexport type PolicyMarketScopeLabel = (typeof POLICY_MARKET_SCOPE_LABELS)[number];\n\nexport const PolicyMarketScopeCodec = {\n inputToProto: {\n all: Proto.MarketScope_Value.ALL,\n allowlist: Proto.MarketScope_Value.ALLOWLIST,\n } satisfies Record<PolicyMarketScopeLabel, Proto.MarketScope_Value>,\n protoToOutput: {\n [Proto.MarketScope_Value.UNSPECIFIED]: \"unspecified\",\n [Proto.MarketScope_Value.ALL]: \"all\",\n [Proto.MarketScope_Value.ALLOWLIST]: \"allowlist\",\n } satisfies ProtoToOutput<Proto.MarketScope_Value, PolicyMarketScopeLabel>,\n} as const;\n\nexport const PolicyActionCodec = {\n protoToOutput: {\n [Proto.PolicyAction.UNSPECIFIED]: \"unspecified\",\n [Proto.PolicyAction.TRADE_SPOT]: \"trade-spot\",\n [Proto.PolicyAction.INTERNAL_TRANSFER]: \"internal-transfer\",\n [Proto.PolicyAction.EXTERNAL_WITHDRAW]: \"external-withdraw\",\n [Proto.PolicyAction.READ_BALANCES]: \"read-balances\",\n [Proto.PolicyAction.READ_SPOT]: \"read-spot\",\n [Proto.PolicyAction.READ_INTERNAL_TRANSFERS]: \"read-internal-transfers\",\n [Proto.PolicyAction.READ_ADDRESS_BOOK]: \"read-address-book\",\n [Proto.PolicyAction.MANAGE_ADDRESS_BOOK]: \"manage-address-book\",\n [Proto.PolicyAction.READ_AUTO_WITHDRAW]: \"read-auto-withdraw\",\n [Proto.PolicyAction.MANAGE_AUTO_WITHDRAW]: \"manage-auto-withdraw\",\n [Proto.PolicyAction.SWAP]: \"swap\",\n [Proto.PolicyAction.READ_API_KEYS]: \"read-api-keys\",\n [Proto.PolicyAction.READ_API_POLICIES]: \"read-api-policies\",\n [Proto.PolicyAction.READ_SUBACCOUNT_POLICIES]: \"read-subaccount-policies\",\n [Proto.PolicyAction.READ_SUBACCOUNT_PERMISSIONS]: \"read-subaccount-permissions\",\n [Proto.PolicyAction.READ_VIP_STATUS]: \"read-vip-status\",\n [Proto.PolicyAction.READ_SOCIAL_VERIFICATION]: \"read-social-verification\",\n [Proto.PolicyAction.READ_PROFILE]: \"read-profile\",\n [Proto.PolicyAction.READ_ACCOUNT_DIRECTORY]: \"read-account-directory\",\n [Proto.PolicyAction.READ_WITHDRAW_VALIDATION]: \"read-withdraw-validation\",\n [Proto.PolicyAction.READ_DAILY_CLAIMS]: \"read-daily-claims\",\n [Proto.PolicyAction.CLAIM_DAILY_REWARD]: \"claim-daily-reward\",\n [Proto.PolicyAction.READ_CHECKPOINTS]: \"read-checkpoints\",\n [Proto.PolicyAction.READ_REWARDS]: \"read-rewards\",\n [Proto.PolicyAction.CREATE_DEPOSIT_ADDRESS]: \"create-deposit-address\",\n [Proto.PolicyAction.READ_DEPOSIT_ADDRESSES]: \"read-deposit-addresses\",\n [Proto.PolicyAction.READ_SUBACCOUNTS]: \"read-subaccounts\",\n [Proto.PolicyAction.READ_SUBACCOUNT_ACTIVITY]: \"read-subaccount-activity\",\n [Proto.PolicyAction.READ_SUBACCOUNT_MEMBERS]: \"read-subaccount-members\",\n [Proto.PolicyAction.READ_SUBACCOUNT_INVITES]: \"read-subaccount-invites\",\n [Proto.PolicyAction.READ_GUARD_SIGNER_STATUS]: \"read-guard-signer-status\",\n [Proto.PolicyAction.READ_PRICE_ALERTS]: \"read-price-alerts\",\n [Proto.PolicyAction.MANAGE_PRICE_ALERTS]: \"manage-price-alerts\",\n } satisfies ProtoToOutput<Proto.PolicyAction, PolicyActionLabel>,\n inputToProto: {\n \"trade-spot\": Proto.PolicyAction.TRADE_SPOT,\n \"internal-transfer\": Proto.PolicyAction.INTERNAL_TRANSFER,\n \"external-withdraw\": Proto.PolicyAction.EXTERNAL_WITHDRAW,\n \"read-balances\": Proto.PolicyAction.READ_BALANCES,\n \"read-spot\": Proto.PolicyAction.READ_SPOT,\n \"read-internal-transfers\": Proto.PolicyAction.READ_INTERNAL_TRANSFERS,\n \"read-address-book\": Proto.PolicyAction.READ_ADDRESS_BOOK,\n \"manage-address-book\": Proto.PolicyAction.MANAGE_ADDRESS_BOOK,\n \"read-auto-withdraw\": Proto.PolicyAction.READ_AUTO_WITHDRAW,\n \"manage-auto-withdraw\": Proto.PolicyAction.MANAGE_AUTO_WITHDRAW,\n swap: Proto.PolicyAction.SWAP,\n \"read-api-keys\": Proto.PolicyAction.READ_API_KEYS,\n \"read-api-policies\": Proto.PolicyAction.READ_API_POLICIES,\n \"read-subaccount-policies\": Proto.PolicyAction.READ_SUBACCOUNT_POLICIES,\n \"read-subaccount-permissions\": Proto.PolicyAction.READ_SUBACCOUNT_PERMISSIONS,\n \"read-vip-status\": Proto.PolicyAction.READ_VIP_STATUS,\n \"read-social-verification\": Proto.PolicyAction.READ_SOCIAL_VERIFICATION,\n \"read-profile\": Proto.PolicyAction.READ_PROFILE,\n \"read-account-directory\": Proto.PolicyAction.READ_ACCOUNT_DIRECTORY,\n \"read-withdraw-validation\": Proto.PolicyAction.READ_WITHDRAW_VALIDATION,\n \"read-daily-claims\": Proto.PolicyAction.READ_DAILY_CLAIMS,\n \"claim-daily-reward\": Proto.PolicyAction.CLAIM_DAILY_REWARD,\n \"read-checkpoints\": Proto.PolicyAction.READ_CHECKPOINTS,\n \"read-rewards\": Proto.PolicyAction.READ_REWARDS,\n \"create-deposit-address\": Proto.PolicyAction.CREATE_DEPOSIT_ADDRESS,\n \"read-deposit-addresses\": Proto.PolicyAction.READ_DEPOSIT_ADDRESSES,\n \"read-subaccounts\": Proto.PolicyAction.READ_SUBACCOUNTS,\n \"read-subaccount-activity\": Proto.PolicyAction.READ_SUBACCOUNT_ACTIVITY,\n \"read-subaccount-members\": Proto.PolicyAction.READ_SUBACCOUNT_MEMBERS,\n \"read-subaccount-invites\": Proto.PolicyAction.READ_SUBACCOUNT_INVITES,\n \"read-guard-signer-status\": Proto.PolicyAction.READ_GUARD_SIGNER_STATUS,\n \"read-price-alerts\": Proto.PolicyAction.READ_PRICE_ALERTS,\n \"manage-price-alerts\": Proto.PolicyAction.MANAGE_PRICE_ALERTS,\n } satisfies Record<PolicyActionLabel, Proto.PolicyAction>,\n} as const;\n\n/**\n * Returns the display label for a policy market scope.\n */\nexport function policyMarketScopeLabelFor(value: number): DecodedEnum<PolicyMarketScopeLabel> {\n return enumLabel(PolicyMarketScopeCodec.protoToOutput, value);\n}\n\n/**\n * Returns the display label for a policy action.\n */\nexport function policyActionLabelFor(value: number): DecodedEnum<PolicyActionLabel> {\n return enumLabel(PolicyActionCodec.protoToOutput, value);\n}\n"],"mappings":";;;;AAKA,MAAa,+BAA+B;CACxC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;;;;;;AAOA,MAAa,0CAA0C;CACnD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;AAEA,MAAa,uBAAuB,CAChC,GAAG,8BACH,GAAG,uCACP;AAMA,MAAa,yBAAyB;CAClC,cAAc;EACV,KAAA;EACA,WAAA;CACJ;CACA,eAAe;GAC4B,IAAA;GACR,IAAA;GACM,IAAA;CACzC;AACJ;AAEA,MAAa,oBAAoB;CAC7B,eAAe;GACuB,IAAA;GACD,IAAA;GACO,IAAA;GACA,IAAA;GACJ,IAAA;GACJ,IAAA;GACc,IAAA;GACN,KAAA;GACE,KAAA;GACD,KAAA;GACE,KAAA;GAChB,KAAA;GACS,KAAA;GACI,KAAA;GACO,KAAA;GACG,KAAA;GACZ,KAAA;GACS,KAAA;GACZ,KAAA;GACU,KAAA;GACE,KAAA;GACP,KAAA;GACC,KAAA;GACF,KAAA;GACJ,KAAA;GACU,KAAA;GACA,KAAA;GACN,KAAA;GACQ,KAAA;GACD,KAAA;GACA,KAAA;GACC,KAAA;GACP,KAAA;GACE,KAAA;CAC9C;CACA,cAAc;EACV,cAAA;EACA,qBAAA;EACA,qBAAA;EACA,iBAAA;EACA,aAAA;EACA,2BAAA;EACA,qBAAA;EACA,uBAAA;EACA,sBAAA;EACA,wBAAA;EACA,MAAA;EACA,iBAAA;EACA,qBAAA;EACA,4BAAA;EACA,+BAAA;EACA,mBAAA;EACA,4BAAA;EACA,gBAAA;EACA,0BAAA;EACA,4BAAA;EACA,qBAAA;EACA,sBAAA;EACA,oBAAA;EACA,gBAAA;EACA,0BAAA;EACA,0BAAA;EACA,oBAAA;EACA,4BAAA;EACA,2BAAA;EACA,2BAAA;EACA,4BAAA;EACA,qBAAA;EACA,uBAAA;CACJ;AACJ;;;;AAKA,SAAgB,0BAA0B,OAAoD;CAC1F,OAAO,UAAU,uBAAuB,eAAe,KAAK;AAChE;;;;AAKA,SAAgB,qBAAqB,OAA+C;CAChF,OAAO,UAAU,kBAAkB,eAAe,KAAK;AAC3D"}
@@ -1,6 +1,6 @@
1
1
  import * as v from "valibot";
2
2
  //#region src/services/policies/shared.d.ts
3
- declare const PolicyActionEnumSchema: v.PicklistSchema<readonly ["trade-spot", "internal-transfer", "external-withdraw", "read-balances", "read-spot", "read-internal-transfers", "read-address-book", "manage-address-book", "read-auto-withdraw", "manage-auto-withdraw", "swap", "read-api-keys", "read-api-policies", "read-subaccount-policies", "read-subaccount-permissions", "read-vip-status", "read-social-verification", "read-profile", "read-account-directory", "read-withdraw-validation", "read-daily-claims", "claim-daily-reward", "read-checkpoints", "read-rewards", "create-deposit-address", "read-deposit-addresses", "read-subaccounts", "read-subaccount-activity", "read-subaccount-members", "read-subaccount-invites", "read-guard-signer-status"], undefined>;
3
+ declare const PolicyActionEnumSchema: v.PicklistSchema<readonly ["trade-spot", "internal-transfer", "external-withdraw", "read-balances", "read-spot", "read-internal-transfers", "read-address-book", "manage-address-book", "read-auto-withdraw", "manage-auto-withdraw", "swap", "read-api-keys", "read-api-policies", "read-subaccount-policies", "read-subaccount-permissions", "read-vip-status", "read-social-verification", "read-profile", "read-account-directory", "read-withdraw-validation", "read-daily-claims", "claim-daily-reward", "read-checkpoints", "read-rewards", "create-deposit-address", "read-deposit-addresses", "read-subaccounts", "read-subaccount-activity", "read-subaccount-members", "read-subaccount-invites", "read-guard-signer-status", "read-price-alerts", "manage-price-alerts"], undefined>;
4
4
  declare const PolicyMarketScopeEnumSchema: v.PicklistSchema<readonly ["all", "allowlist"], undefined>;
5
5
  type PolicyMarketScope = v.InferOutput<typeof PolicyMarketScopeEnumSchema>;
6
6
  type PolicyAction = v.InferOutput<typeof PolicyActionEnumSchema>;
@@ -38,7 +38,7 @@ declare const SubaccountPolicySchema: v.SchemaWithPipe<readonly [v.ObjectSchema<
38
38
  readonly symbolId: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>;
39
39
  }, undefined>, undefined>, readonly []>;
40
40
  readonly spotMarketScope: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"all" | "allowlist">>]>;
41
- readonly actions: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ArraySchema<v.NumberSchema<undefined>, undefined>, readonly []>, v.TransformAction<number[], DecodedEnum<"swap" | "trade-spot" | "internal-transfer" | "external-withdraw" | "read-balances" | "read-spot" | "read-internal-transfers" | "read-address-book" | "manage-address-book" | "read-auto-withdraw" | "manage-auto-withdraw" | "read-api-keys" | "read-api-policies" | "read-subaccount-policies" | "read-subaccount-permissions" | "read-vip-status" | "read-social-verification" | "read-profile" | "read-account-directory" | "read-withdraw-validation" | "read-daily-claims" | "claim-daily-reward" | "read-checkpoints" | "read-rewards" | "create-deposit-address" | "read-deposit-addresses" | "read-subaccounts" | "read-subaccount-activity" | "read-subaccount-members" | "read-subaccount-invites" | "read-guard-signer-status">[]>]>;
41
+ readonly actions: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ArraySchema<v.NumberSchema<undefined>, undefined>, readonly []>, v.TransformAction<number[], DecodedEnum<"swap" | "trade-spot" | "internal-transfer" | "external-withdraw" | "read-balances" | "read-spot" | "read-internal-transfers" | "read-address-book" | "manage-address-book" | "read-auto-withdraw" | "manage-auto-withdraw" | "read-api-keys" | "read-api-policies" | "read-subaccount-policies" | "read-subaccount-permissions" | "read-vip-status" | "read-social-verification" | "read-profile" | "read-account-directory" | "read-withdraw-validation" | "read-daily-claims" | "claim-daily-reward" | "read-checkpoints" | "read-rewards" | "create-deposit-address" | "read-deposit-addresses" | "read-subaccounts" | "read-subaccount-activity" | "read-subaccount-members" | "read-subaccount-invites" | "read-guard-signer-status" | "read-price-alerts" | "manage-price-alerts">[]>]>;
42
42
  readonly isTemplate: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
43
43
  readonly sourceTemplateId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BigintSchema<undefined>, undefined>, v.TransformAction<bigint | undefined, string | undefined>]>;
44
44
  readonly maxOrderNotional: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
@@ -79,7 +79,7 @@ declare const SubaccountPolicySchema: v.SchemaWithPipe<readonly [v.ObjectSchema<
79
79
  symbolId: number;
80
80
  }[];
81
81
  spotMarketScope: DecodedEnum<"all" | "allowlist">;
82
- actions: DecodedEnum<"swap" | "trade-spot" | "internal-transfer" | "external-withdraw" | "read-balances" | "read-spot" | "read-internal-transfers" | "read-address-book" | "manage-address-book" | "read-auto-withdraw" | "manage-auto-withdraw" | "read-api-keys" | "read-api-policies" | "read-subaccount-policies" | "read-subaccount-permissions" | "read-vip-status" | "read-social-verification" | "read-profile" | "read-account-directory" | "read-withdraw-validation" | "read-daily-claims" | "claim-daily-reward" | "read-checkpoints" | "read-rewards" | "create-deposit-address" | "read-deposit-addresses" | "read-subaccounts" | "read-subaccount-activity" | "read-subaccount-members" | "read-subaccount-invites" | "read-guard-signer-status">[];
82
+ actions: DecodedEnum<"swap" | "trade-spot" | "internal-transfer" | "external-withdraw" | "read-balances" | "read-spot" | "read-internal-transfers" | "read-address-book" | "manage-address-book" | "read-auto-withdraw" | "manage-auto-withdraw" | "read-api-keys" | "read-api-policies" | "read-subaccount-policies" | "read-subaccount-permissions" | "read-vip-status" | "read-social-verification" | "read-profile" | "read-account-directory" | "read-withdraw-validation" | "read-daily-claims" | "claim-daily-reward" | "read-checkpoints" | "read-rewards" | "create-deposit-address" | "read-deposit-addresses" | "read-subaccounts" | "read-subaccount-activity" | "read-subaccount-members" | "read-subaccount-invites" | "read-guard-signer-status" | "read-price-alerts" | "manage-price-alerts">[];
83
83
  isTemplate: boolean;
84
84
  sourceTemplateId?: string | undefined;
85
85
  maxOrderNotional: string;
@@ -104,7 +104,7 @@ declare const SubaccountPolicySchema: v.SchemaWithPipe<readonly [v.ObjectSchema<
104
104
  symbolId: number;
105
105
  }[];
106
106
  spotMarketScope: DecodedEnum<"all" | "allowlist">;
107
- actions: DecodedEnum<"swap" | "trade-spot" | "internal-transfer" | "external-withdraw" | "read-balances" | "read-spot" | "read-internal-transfers" | "read-address-book" | "manage-address-book" | "read-auto-withdraw" | "manage-auto-withdraw" | "read-api-keys" | "read-api-policies" | "read-subaccount-policies" | "read-subaccount-permissions" | "read-vip-status" | "read-social-verification" | "read-profile" | "read-account-directory" | "read-withdraw-validation" | "read-daily-claims" | "claim-daily-reward" | "read-checkpoints" | "read-rewards" | "create-deposit-address" | "read-deposit-addresses" | "read-subaccounts" | "read-subaccount-activity" | "read-subaccount-members" | "read-subaccount-invites" | "read-guard-signer-status">[];
107
+ actions: DecodedEnum<"swap" | "trade-spot" | "internal-transfer" | "external-withdraw" | "read-balances" | "read-spot" | "read-internal-transfers" | "read-address-book" | "manage-address-book" | "read-auto-withdraw" | "manage-auto-withdraw" | "read-api-keys" | "read-api-policies" | "read-subaccount-policies" | "read-subaccount-permissions" | "read-vip-status" | "read-social-verification" | "read-profile" | "read-account-directory" | "read-withdraw-validation" | "read-daily-claims" | "claim-daily-reward" | "read-checkpoints" | "read-rewards" | "create-deposit-address" | "read-deposit-addresses" | "read-subaccounts" | "read-subaccount-activity" | "read-subaccount-members" | "read-subaccount-invites" | "read-guard-signer-status" | "read-price-alerts" | "manage-price-alerts">[];
108
108
  isTemplate: boolean;
109
109
  sourceTemplateId?: string | undefined;
110
110
  maxOpenOrders: number;
@@ -5,7 +5,9 @@ import { CancelPriceAlertInput, CreatePriceAlertInput, ListPriceAlertsInput, Lis
5
5
  /**
6
6
  * Manages the caller's price alerts. Alerts belong to the root account, not a trading account:
7
7
  * a session and the root account's API keys see the same alerts, and an API key scoped to a
8
- * subaccount is refused (`PermissionError`, detail `SUBACCOUNT_KEY_REFUSED`). An alert fires at
8
+ * subaccount is refused (`PermissionError`, detail `SUBACCOUNT_KEY_REFUSED`). An API key whose
9
+ * policy lacks the method's permission is refused too (`PermissionError`, detail
10
+ * `AUTH_API_KEY_ACCESS_DENIED`). An alert fires at
9
11
  * most once, only on a crossing it observes from its `referencePrice`; `update` sets a fired
10
12
  * alert again. No call changes balances, orders or account settings.
11
13
  */
@@ -15,21 +17,24 @@ declare class PriceAlertsService {
15
17
  /**
16
18
  * Creates an active alert. Throws `PreconditionFailedError` when the market has no index
17
19
  * price (`PRICE_SOURCE_UNSUPPORTED`) or the active-alert limit is reached, and a retryable
18
- * `ServiceUnavailableError` when the market has no current price yet.
20
+ * `ServiceUnavailableError` when the market has no current price yet. API keys need
21
+ * `manage-price-alerts`.
19
22
  */
20
23
  create(input: CreatePriceAlertInput, options?: PolyesterRequestOptions): Promise<PriceAlert>;
21
- /** Lists the caller's alerts, newest first. */
24
+ /** Lists the caller's alerts, newest first. API keys need `read-price-alerts`. */
22
25
  list(input?: ListPriceAlertsInput, options?: PolyesterRequestOptions): Promise<ListPriceAlertsResult>;
23
26
  /**
24
27
  * Changes an alert's direction, price or channels; omitted fields stay as they are. A new
25
28
  * direction or price records a new reference price. Updating a triggered alert sets it
26
29
  * again, even with no field given. A stale `expectedRevision` throws
27
- * `RevisionConflictError`; a cancelled alert throws `PreconditionFailedError`.
30
+ * `RevisionConflictError`; a cancelled alert throws `PreconditionFailedError`. API keys need
31
+ * `manage-price-alerts`.
28
32
  */
29
33
  update(input: UpdatePriceAlertInput, options?: PolyesterRequestOptions): Promise<UpdatePriceAlertResult>;
30
34
  /**
31
35
  * Cancels an active alert; cancelling a cancelled alert returns it unchanged. A triggered
32
- * alert throws `PreconditionFailedError` (`ALERT_TRIGGERED`).
36
+ * alert throws `PreconditionFailedError` (`ALERT_TRIGGERED`). API keys need
37
+ * `manage-price-alerts`.
33
38
  */
34
39
  cancel(input: CancelPriceAlertInput, options?: PolyesterRequestOptions): Promise<PriceAlert>;
35
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"price-alerts.d.ts","names":[],"sources":["../../../src/services/price-alerts/price-alerts.ts"],"mappings":";;;;;;;;;;;cAiCa;;EAGG,YAAA,YAAY;;;;;;EASlB,OACF,OAAO,uBACP,UAAU,0BACX,QAAQ;;EAUL,KACF,QAAO,sBACP,UAAU,0BACX,QAAQ;;;;;;;EAeL,OACF,OAAO,uBACP,UAAU,0BACX,QAAQ;;;;;EAaL,OACF,OAAO,uBACP,UAAU,0BACX,QAAQ"}
1
+ {"version":3,"file":"price-alerts.d.ts","names":[],"sources":["../../../src/services/price-alerts/price-alerts.ts"],"mappings":";;;;;;;;;;;;;cAmCa;;EAGG,YAAA,YAAY;;;;;;;EAUlB,OACF,OAAO,uBACP,UAAU,0BACX,QAAQ;;EAUL,KACF,QAAO,sBACP,UAAU,0BACX,QAAQ;;;;;;;;EAgBL,OACF,OAAO,uBACP,UAAU,0BACX,QAAQ;;;;;;EAcL,OACF,OAAO,uBACP,UAAU,0BACX,QAAQ"}
@@ -8,7 +8,9 @@ import { createClient } from "@connectrpc/connect";
8
8
  /**
9
9
  * Manages the caller's price alerts. Alerts belong to the root account, not a trading account:
10
10
  * a session and the root account's API keys see the same alerts, and an API key scoped to a
11
- * subaccount is refused (`PermissionError`, detail `SUBACCOUNT_KEY_REFUSED`). An alert fires at
11
+ * subaccount is refused (`PermissionError`, detail `SUBACCOUNT_KEY_REFUSED`). An API key whose
12
+ * policy lacks the method's permission is refused too (`PermissionError`, detail
13
+ * `AUTH_API_KEY_ACCESS_DENIED`). An alert fires at
12
14
  * most once, only on a crossing it observes from its `referencePrice`; `update` sets a fired
13
15
  * alert again. No call changes balances, orders or account settings.
14
16
  */
@@ -20,14 +22,15 @@ var PriceAlertsService = class {
20
22
  /**
21
23
  * Creates an active alert. Throws `PreconditionFailedError` when the market has no index
22
24
  * price (`PRICE_SOURCE_UNSUPPORTED`) or the active-alert limit is reached, and a retryable
23
- * `ServiceUnavailableError` when the market has no current price yet.
25
+ * `ServiceUnavailableError` when the market has no current price yet. API keys need
26
+ * `manage-price-alerts`.
24
27
  */
25
28
  async create(input, options) {
26
29
  const request = parse(CreatePriceAlertInputSchema, input);
27
30
  const response = await this.#client.createAlert(removeUndefined(request), toConnectCallOptions(options));
28
31
  return parse(PriceAlertSchema, response.alert);
29
32
  }
30
- /** Lists the caller's alerts, newest first. */
33
+ /** Lists the caller's alerts, newest first. API keys need `read-price-alerts`. */
31
34
  async list(input = {}, options) {
32
35
  const request = parse(ListPriceAlertsInputSchema, input);
33
36
  const response = await this.#client.listAlerts(removeUndefined(request), toConnectCallOptions(options));
@@ -37,7 +40,8 @@ var PriceAlertsService = class {
37
40
  * Changes an alert's direction, price or channels; omitted fields stay as they are. A new
38
41
  * direction or price records a new reference price. Updating a triggered alert sets it
39
42
  * again, even with no field given. A stale `expectedRevision` throws
40
- * `RevisionConflictError`; a cancelled alert throws `PreconditionFailedError`.
43
+ * `RevisionConflictError`; a cancelled alert throws `PreconditionFailedError`. API keys need
44
+ * `manage-price-alerts`.
41
45
  */
42
46
  async update(input, options) {
43
47
  const request = parse(UpdatePriceAlertInputSchema, input);
@@ -46,7 +50,8 @@ var PriceAlertsService = class {
46
50
  }
47
51
  /**
48
52
  * Cancels an active alert; cancelling a cancelled alert returns it unchanged. A triggered
49
- * alert throws `PreconditionFailedError` (`ALERT_TRIGGERED`).
53
+ * alert throws `PreconditionFailedError` (`ALERT_TRIGGERED`). API keys need
54
+ * `manage-price-alerts`.
50
55
  */
51
56
  async cancel(input, options) {
52
57
  const request = parse(CancelPriceAlertInputSchema, input);
@@ -1 +1 @@
1
- {"version":3,"file":"price-alerts.js","names":["#client","Proto.PriceAlertService"],"sources":["../../../src/services/price-alerts/price-alerts.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/alerts/v1/price_alerts_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 CancelPriceAlertInputSchema,\n CreatePriceAlertInputSchema,\n ListPriceAlertsInputSchema,\n ListPriceAlertsResultSchema,\n PriceAlertSchema,\n UpdatePriceAlertInputSchema,\n UpdatePriceAlertResultSchema,\n type CancelPriceAlertInput,\n type CreatePriceAlertInput,\n type ListPriceAlertsInput,\n type ListPriceAlertsResult,\n type PriceAlert,\n type UpdatePriceAlertInput,\n type UpdatePriceAlertResult,\n} from \"./price-alerts.schemas.js\";\n\n/**\n * Manages the caller's price alerts. Alerts belong to the root account, not a trading account:\n * a session and the root account's API keys see the same alerts, and an API key scoped to a\n * subaccount is refused (`PermissionError`, detail `SUBACCOUNT_KEY_REFUSED`). An alert fires at\n * most once, only on a crossing it observes from its `referencePrice`; `update` sets a fired\n * alert again. No call changes balances, orders or account settings.\n */\nexport class PriceAlertsService {\n #client: Client<typeof Proto.PriceAlertService>;\n\n constructor(transports: AuthApiTransports) {\n this.#client = createClient(Proto.PriceAlertService, transports.authApi);\n }\n\n /**\n * Creates an active alert. Throws `PreconditionFailedError` when the market has no index\n * price (`PRICE_SOURCE_UNSUPPORTED`) or the active-alert limit is reached, and a retryable\n * `ServiceUnavailableError` when the market has no current price yet.\n */\n async create(\n input: CreatePriceAlertInput,\n options?: PolyesterRequestOptions,\n ): Promise<PriceAlert> {\n const request = parse(CreatePriceAlertInputSchema, input);\n const response = await this.#client.createAlert(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(PriceAlertSchema, response.alert);\n }\n\n /** Lists the caller's alerts, newest first. */\n async list(\n input: ListPriceAlertsInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<ListPriceAlertsResult> {\n const request = parse(ListPriceAlertsInputSchema, input);\n const response = await this.#client.listAlerts(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(ListPriceAlertsResultSchema, response);\n }\n\n /**\n * Changes an alert's direction, price or channels; omitted fields stay as they are. A new\n * direction or price records a new reference price. Updating a triggered alert sets it\n * again, even with no field given. A stale `expectedRevision` throws\n * `RevisionConflictError`; a cancelled alert throws `PreconditionFailedError`.\n */\n async update(\n input: UpdatePriceAlertInput,\n options?: PolyesterRequestOptions,\n ): Promise<UpdatePriceAlertResult> {\n const request = parse(UpdatePriceAlertInputSchema, input);\n const response = await this.#client.updateAlert(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(UpdatePriceAlertResultSchema, response);\n }\n\n /**\n * Cancels an active alert; cancelling a cancelled alert returns it unchanged. A triggered\n * alert throws `PreconditionFailedError` (`ALERT_TRIGGERED`).\n */\n async cancel(\n input: CancelPriceAlertInput,\n options?: PolyesterRequestOptions,\n ): Promise<PriceAlert> {\n const request = parse(CancelPriceAlertInputSchema, input);\n const response = await this.#client.cancelAlert(request, toConnectCallOptions(options));\n return parse(PriceAlertSchema, response.alert);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAiCA,IAAa,qBAAb,MAAgC;CAC5B;CAEA,YAAY,YAA+B;EACvC,KAAKA,UAAU,aAAaC,mBAAyB,WAAW,OAAO;CAC3E;;;;;;CAOA,MAAM,OACF,OACA,SACmB;EACnB,MAAM,UAAU,MAAM,6BAA6B,KAAK;EACxD,MAAM,WAAW,MAAM,KAAKD,QAAQ,YAChC,gBAAgB,OAAO,GACvB,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,kBAAkB,SAAS,KAAK;CACjD;;CAGA,MAAM,KACF,QAA8B,CAAC,GAC/B,SAC8B;EAC9B,MAAM,UAAU,MAAM,4BAA4B,KAAK;EACvD,MAAM,WAAW,MAAM,KAAKA,QAAQ,WAChC,gBAAgB,OAAO,GACvB,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,6BAA6B,QAAQ;CACtD;;;;;;;CAQA,MAAM,OACF,OACA,SAC+B;EAC/B,MAAM,UAAU,MAAM,6BAA6B,KAAK;EACxD,MAAM,WAAW,MAAM,KAAKA,QAAQ,YAChC,gBAAgB,OAAO,GACvB,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,8BAA8B,QAAQ;CACvD;;;;;CAMA,MAAM,OACF,OACA,SACmB;EACnB,MAAM,UAAU,MAAM,6BAA6B,KAAK;EACxD,MAAM,WAAW,MAAM,KAAKA,QAAQ,YAAY,SAAS,qBAAqB,OAAO,CAAC;EACtF,OAAO,MAAM,kBAAkB,SAAS,KAAK;CACjD;AACJ"}
1
+ {"version":3,"file":"price-alerts.js","names":["#client","Proto.PriceAlertService"],"sources":["../../../src/services/price-alerts/price-alerts.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/alerts/v1/price_alerts_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 CancelPriceAlertInputSchema,\n CreatePriceAlertInputSchema,\n ListPriceAlertsInputSchema,\n ListPriceAlertsResultSchema,\n PriceAlertSchema,\n UpdatePriceAlertInputSchema,\n UpdatePriceAlertResultSchema,\n type CancelPriceAlertInput,\n type CreatePriceAlertInput,\n type ListPriceAlertsInput,\n type ListPriceAlertsResult,\n type PriceAlert,\n type UpdatePriceAlertInput,\n type UpdatePriceAlertResult,\n} from \"./price-alerts.schemas.js\";\n\n/**\n * Manages the caller's price alerts. Alerts belong to the root account, not a trading account:\n * a session and the root account's API keys see the same alerts, and an API key scoped to a\n * subaccount is refused (`PermissionError`, detail `SUBACCOUNT_KEY_REFUSED`). An API key whose\n * policy lacks the method's permission is refused too (`PermissionError`, detail\n * `AUTH_API_KEY_ACCESS_DENIED`). An alert fires at\n * most once, only on a crossing it observes from its `referencePrice`; `update` sets a fired\n * alert again. No call changes balances, orders or account settings.\n */\nexport class PriceAlertsService {\n #client: Client<typeof Proto.PriceAlertService>;\n\n constructor(transports: AuthApiTransports) {\n this.#client = createClient(Proto.PriceAlertService, transports.authApi);\n }\n\n /**\n * Creates an active alert. Throws `PreconditionFailedError` when the market has no index\n * price (`PRICE_SOURCE_UNSUPPORTED`) or the active-alert limit is reached, and a retryable\n * `ServiceUnavailableError` when the market has no current price yet. API keys need\n * `manage-price-alerts`.\n */\n async create(\n input: CreatePriceAlertInput,\n options?: PolyesterRequestOptions,\n ): Promise<PriceAlert> {\n const request = parse(CreatePriceAlertInputSchema, input);\n const response = await this.#client.createAlert(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(PriceAlertSchema, response.alert);\n }\n\n /** Lists the caller's alerts, newest first. API keys need `read-price-alerts`. */\n async list(\n input: ListPriceAlertsInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<ListPriceAlertsResult> {\n const request = parse(ListPriceAlertsInputSchema, input);\n const response = await this.#client.listAlerts(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(ListPriceAlertsResultSchema, response);\n }\n\n /**\n * Changes an alert's direction, price or channels; omitted fields stay as they are. A new\n * direction or price records a new reference price. Updating a triggered alert sets it\n * again, even with no field given. A stale `expectedRevision` throws\n * `RevisionConflictError`; a cancelled alert throws `PreconditionFailedError`. API keys need\n * `manage-price-alerts`.\n */\n async update(\n input: UpdatePriceAlertInput,\n options?: PolyesterRequestOptions,\n ): Promise<UpdatePriceAlertResult> {\n const request = parse(UpdatePriceAlertInputSchema, input);\n const response = await this.#client.updateAlert(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(UpdatePriceAlertResultSchema, response);\n }\n\n /**\n * Cancels an active alert; cancelling a cancelled alert returns it unchanged. A triggered\n * alert throws `PreconditionFailedError` (`ALERT_TRIGGERED`). API keys need\n * `manage-price-alerts`.\n */\n async cancel(\n input: CancelPriceAlertInput,\n options?: PolyesterRequestOptions,\n ): Promise<PriceAlert> {\n const request = parse(CancelPriceAlertInputSchema, input);\n const response = await this.#client.cancelAlert(request, toConnectCallOptions(options));\n return parse(PriceAlertSchema, response.alert);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAmCA,IAAa,qBAAb,MAAgC;CAC5B;CAEA,YAAY,YAA+B;EACvC,KAAKA,UAAU,aAAaC,mBAAyB,WAAW,OAAO;CAC3E;;;;;;;CAQA,MAAM,OACF,OACA,SACmB;EACnB,MAAM,UAAU,MAAM,6BAA6B,KAAK;EACxD,MAAM,WAAW,MAAM,KAAKD,QAAQ,YAChC,gBAAgB,OAAO,GACvB,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,kBAAkB,SAAS,KAAK;CACjD;;CAGA,MAAM,KACF,QAA8B,CAAC,GAC/B,SAC8B;EAC9B,MAAM,UAAU,MAAM,4BAA4B,KAAK;EACvD,MAAM,WAAW,MAAM,KAAKA,QAAQ,WAChC,gBAAgB,OAAO,GACvB,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,6BAA6B,QAAQ;CACtD;;;;;;;;CASA,MAAM,OACF,OACA,SAC+B;EAC/B,MAAM,UAAU,MAAM,6BAA6B,KAAK;EACxD,MAAM,WAAW,MAAM,KAAKA,QAAQ,YAChC,gBAAgB,OAAO,GACvB,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,8BAA8B,QAAQ;CACvD;;;;;;CAOA,MAAM,OACF,OACA,SACmB;EACnB,MAAM,UAAU,MAAM,6BAA6B,KAAK;EACxD,MAAM,WAAW,MAAM,KAAKA,QAAQ,YAAY,SAAS,qBAAqB,OAAO,CAAC;EACtF,OAAO,MAAM,kBAAkB,SAAS,KAAK;CACjD;AACJ"}
@@ -29,7 +29,7 @@ declare const RewardAwardSchema: v.ObjectSchema<{
29
29
  readonly assetId: v.NumberSchema<undefined>;
30
30
  readonly amountBaseUnits: v.StringSchema<undefined>;
31
31
  readonly fulfillmentMethod: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "external_testnet" | "internal_trading">]>;
32
- readonly fulfillmentState: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "awaiting_destination" | "ready_for_payout" | "paid" | "failed" | "canceled">]>;
32
+ readonly fulfillmentState: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "failed" | "awaiting_destination" | "ready_for_payout" | "paid" | "canceled">]>;
33
33
  readonly publishedAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
34
34
  readonly seconds: v.BigintSchema<undefined>;
35
35
  readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
@@ -67,7 +67,7 @@ declare const ListRewardAwardsResultSchema: v.ObjectSchema<{
67
67
  readonly assetId: v.NumberSchema<undefined>;
68
68
  readonly amountBaseUnits: v.StringSchema<undefined>;
69
69
  readonly fulfillmentMethod: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "external_testnet" | "internal_trading">]>;
70
- readonly fulfillmentState: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "awaiting_destination" | "ready_for_payout" | "paid" | "failed" | "canceled">]>;
70
+ readonly fulfillmentState: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "failed" | "awaiting_destination" | "ready_for_payout" | "paid" | "canceled">]>;
71
71
  readonly publishedAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
72
72
  readonly seconds: v.BigintSchema<undefined>;
73
73
  readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
@@ -114,7 +114,7 @@ declare const SetRewardDestinationResultSchema: v.ObjectSchema<{
114
114
  readonly assetId: v.NumberSchema<undefined>;
115
115
  readonly amountBaseUnits: v.StringSchema<undefined>;
116
116
  readonly fulfillmentMethod: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "external_testnet" | "internal_trading">]>;
117
- readonly fulfillmentState: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "awaiting_destination" | "ready_for_payout" | "paid" | "failed" | "canceled">]>;
117
+ readonly fulfillmentState: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "failed" | "awaiting_destination" | "ready_for_payout" | "paid" | "canceled">]>;
118
118
  readonly publishedAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
119
119
  readonly seconds: v.BigintSchema<undefined>;
120
120
  readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
@@ -153,7 +153,7 @@ declare const AcknowledgeRewardAwardResultSchema: v.ObjectSchema<{
153
153
  readonly assetId: v.NumberSchema<undefined>;
154
154
  readonly amountBaseUnits: v.StringSchema<undefined>;
155
155
  readonly fulfillmentMethod: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "external_testnet" | "internal_trading">]>;
156
- readonly fulfillmentState: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "awaiting_destination" | "ready_for_payout" | "paid" | "failed" | "canceled">]>;
156
+ readonly fulfillmentState: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "failed" | "awaiting_destination" | "ready_for_payout" | "paid" | "canceled">]>;
157
157
  readonly publishedAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
158
158
  readonly seconds: v.BigintSchema<undefined>;
159
159
  readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
@@ -111,7 +111,9 @@ const ActivityEventActionCodec = { protoToOutput: {
111
111
  [11]: "revoked",
112
112
  [12]: "blocked",
113
113
  [13]: "hold_placed",
114
- [14]: "hold_released"
114
+ [14]: "hold_released",
115
+ [15]: "requested",
116
+ [16]: "applied"
115
117
  } };
116
118
  const ActivityEventSourceCodec = { protoToOutput: {
117
119
  [0]: "unspecified",
@@ -1 +1 @@
1
- {"version":3,"file":"subaccounts.codecs.js","names":[],"sources":["../../../src/services/subaccounts/subaccounts.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/auth/v1/subaccounts_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const SUBACCOUNT_ROLE_VALUES = [\n \"owner\",\n \"admin\",\n \"treasury\",\n \"leveraged_trader\",\n \"trader\",\n \"viewer\",\n] as const;\nexport type SubaccountRoleValue = (typeof SUBACCOUNT_ROLE_VALUES)[number];\n\nexport const SUBACCOUNT_PERMISSION_VALUES = [\n \"read_subaccount\",\n \"update_subaccount\",\n \"read_balances\",\n \"read_spot\",\n \"trade_spot\",\n \"read_internal_transfers\",\n \"internal_transfer\",\n \"external_withdraw\",\n \"read_address_book\",\n \"manage_address_book\",\n \"read_members\",\n \"manage_members\",\n \"read_invites\",\n \"manage_invites\",\n \"read_api_keys\",\n \"manage_api_keys\",\n \"read_subaccount_policy\",\n \"manage_subaccount_policy\",\n \"read_activity\",\n \"read_activity_security_details\",\n \"manage_member_mfa_requirement\",\n \"create_deposit_address\",\n \"read_deposit_addresses\",\n \"read_guard_signer_status\",\n \"manage_guard_signer\",\n \"read_auto_withdraw\",\n \"manage_auto_withdraw\",\n \"swap\",\n] as const;\nexport type SubaccountPermissionValue = (typeof SUBACCOUNT_PERMISSION_VALUES)[number];\n\nexport const SUBACCOUNT_INVITE_ACTION_VALUES = [\"accept\", \"decline\", \"cancel\"] as const;\nexport type SubaccountInviteActionValue = (typeof SUBACCOUNT_INVITE_ACTION_VALUES)[number];\n\nexport const SUBACCOUNT_INVITE_STATUS_VALUES = [\n \"pending\",\n \"accepted\",\n \"declined\",\n \"canceled\",\n] as const;\nexport type SubaccountInviteStatusValue = (typeof SUBACCOUNT_INVITE_STATUS_VALUES)[number];\n\nexport const SUBACCOUNT_INVITE_DIRECTION_VALUES = [\"\", \"incoming\", \"outgoing\"] as const;\nexport type SubaccountInviteDirectionValue = (typeof SUBACCOUNT_INVITE_DIRECTION_VALUES)[number];\n\nexport const SUBACCOUNT_STATUS_VALUES = [\"active\", \"disabled\"] as const;\nexport type SubaccountStatusValue = (typeof SUBACCOUNT_STATUS_VALUES)[number];\n\nexport const ACTIVITY_ENTITY_KIND_VALUES = [\n \"account\",\n \"session\",\n \"api_key\",\n \"subaccount\",\n \"member\",\n \"policy\",\n \"invite\",\n \"security\",\n \"destination\",\n] as const;\nexport type ActivityEntityKindValue = (typeof ACTIVITY_ENTITY_KIND_VALUES)[number];\n\nexport const ACTIVITY_EVENT_ACTION_VALUES = [\n \"created\",\n \"updated\",\n \"deleted\",\n \"enabled\",\n \"disabled\",\n \"removed\",\n \"role_set\",\n \"received\",\n \"replied\",\n \"failed\",\n \"revoked\",\n \"blocked\",\n \"hold_placed\",\n \"hold_released\",\n] as const;\nexport type ActivityEventActionValue = (typeof ACTIVITY_EVENT_ACTION_VALUES)[number];\n\nexport const ACTIVITY_EVENT_SOURCE_VALUES = [\"web\", \"mobile\", \"api\"] as const;\nexport type ActivityEventSourceValue = (typeof ACTIVITY_EVENT_SOURCE_VALUES)[number];\n\nexport const SubaccountRoleCodec = {\n inputToProto: {\n owner: Proto.SubaccountRole.OWNER,\n admin: Proto.SubaccountRole.ADMIN,\n treasury: Proto.SubaccountRole.TREASURY,\n leveraged_trader: Proto.SubaccountRole.LEVERAGED_TRADER,\n trader: Proto.SubaccountRole.TRADER,\n viewer: Proto.SubaccountRole.VIEWER,\n } satisfies InputToProto<SubaccountRoleValue, Proto.SubaccountRole>,\n protoToOutput: {\n [Proto.SubaccountRole.SUBACCOUNT_ROLE_UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountRole.OWNER]: \"owner\",\n [Proto.SubaccountRole.ADMIN]: \"admin\",\n [Proto.SubaccountRole.TREASURY]: \"treasury\",\n [Proto.SubaccountRole.LEVERAGED_TRADER]: \"leveraged_trader\",\n [Proto.SubaccountRole.TRADER]: \"trader\",\n [Proto.SubaccountRole.VIEWER]: \"viewer\",\n } satisfies ProtoToOutput<Proto.SubaccountRole, SubaccountRoleValue>,\n} as const;\n\nexport const SubaccountPermissionCodec = {\n protoToOutput: {\n [Proto.SubaccountPermission.UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountPermission.READ_SUBACCOUNT]: \"read_subaccount\",\n [Proto.SubaccountPermission.UPDATE_SUBACCOUNT]: \"update_subaccount\",\n [Proto.SubaccountPermission.READ_BALANCES]: \"read_balances\",\n [Proto.SubaccountPermission.READ_SPOT]: \"read_spot\",\n [Proto.SubaccountPermission.TRADE_SPOT]: \"trade_spot\",\n [Proto.SubaccountPermission.READ_INTERNAL_TRANSFERS]: \"read_internal_transfers\",\n [Proto.SubaccountPermission.INTERNAL_TRANSFER]: \"internal_transfer\",\n [Proto.SubaccountPermission.EXTERNAL_WITHDRAW]: \"external_withdraw\",\n [Proto.SubaccountPermission.READ_ADDRESS_BOOK]: \"read_address_book\",\n [Proto.SubaccountPermission.MANAGE_ADDRESS_BOOK]: \"manage_address_book\",\n [Proto.SubaccountPermission.READ_MEMBERS]: \"read_members\",\n [Proto.SubaccountPermission.MANAGE_MEMBERS]: \"manage_members\",\n [Proto.SubaccountPermission.READ_INVITES]: \"read_invites\",\n [Proto.SubaccountPermission.MANAGE_INVITES]: \"manage_invites\",\n [Proto.SubaccountPermission.READ_API_KEYS]: \"read_api_keys\",\n [Proto.SubaccountPermission.MANAGE_API_KEYS]: \"manage_api_keys\",\n [Proto.SubaccountPermission.READ_SUBACCOUNT_POLICY]: \"read_subaccount_policy\",\n [Proto.SubaccountPermission.MANAGE_SUBACCOUNT_POLICY]: \"manage_subaccount_policy\",\n [Proto.SubaccountPermission.READ_ACTIVITY]: \"read_activity\",\n [Proto.SubaccountPermission.READ_ACTIVITY_SECURITY_DETAILS]:\n \"read_activity_security_details\",\n [Proto.SubaccountPermission.MANAGE_MEMBER_MFA_REQUIREMENT]: \"manage_member_mfa_requirement\",\n [Proto.SubaccountPermission.CREATE_DEPOSIT_ADDRESS]: \"create_deposit_address\",\n [Proto.SubaccountPermission.READ_DEPOSIT_ADDRESSES]: \"read_deposit_addresses\",\n [Proto.SubaccountPermission.READ_GUARD_SIGNER_STATUS]: \"read_guard_signer_status\",\n [Proto.SubaccountPermission.MANAGE_GUARD_SIGNER]: \"manage_guard_signer\",\n [Proto.SubaccountPermission.READ_AUTO_WITHDRAW]: \"read_auto_withdraw\",\n [Proto.SubaccountPermission.MANAGE_AUTO_WITHDRAW]: \"manage_auto_withdraw\",\n [Proto.SubaccountPermission.SWAP]: \"swap\",\n } satisfies ProtoToOutput<Proto.SubaccountPermission, SubaccountPermissionValue>,\n} as const;\n\nexport const InviteActionCodec = {\n inputToProto: {\n accept: Proto.SubaccountInviteAction.ACCEPT,\n decline: Proto.SubaccountInviteAction.DECLINE,\n cancel: Proto.SubaccountInviteAction.CANCEL,\n } satisfies InputToProto<SubaccountInviteActionValue, Proto.SubaccountInviteAction>,\n} as const;\n\nexport const InviteStatusCodec = {\n protoToOutput: {\n [Proto.SubaccountInviteStatus.UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountInviteStatus.PENDING]: \"pending\",\n [Proto.SubaccountInviteStatus.ACCEPTED]: \"accepted\",\n [Proto.SubaccountInviteStatus.DECLINED]: \"declined\",\n [Proto.SubaccountInviteStatus.CANCELLED]: \"canceled\",\n } satisfies ProtoToOutput<Proto.SubaccountInviteStatus, SubaccountInviteStatusValue>,\n} as const;\n\nexport const SubaccountInviteDirectionCodec = {\n inputToProto: {\n \"\": Proto.SubaccountInviteDirection.DIRECTION_UNSPECIFIED,\n incoming: Proto.SubaccountInviteDirection.INCOMING,\n outgoing: Proto.SubaccountInviteDirection.OUTGOING,\n } satisfies InputToProto<SubaccountInviteDirectionValue, Proto.SubaccountInviteDirection>,\n} as const;\n\nexport const SubaccountStatusCodec = {\n inputToProto: {\n active: Proto.SubaccountStatus.ACTIVE,\n disabled: Proto.SubaccountStatus.DISABLED,\n } satisfies InputToProto<SubaccountStatusValue, Proto.SubaccountStatus>,\n protoToOutput: {\n [Proto.SubaccountStatus.UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountStatus.ACTIVE]: \"active\",\n [Proto.SubaccountStatus.DISABLED]: \"disabled\",\n } satisfies ProtoToOutput<Proto.SubaccountStatus, SubaccountStatusValue>,\n} as const;\n\nexport const ActivityEntityKindCodec = {\n protoToOutput: {\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_UNSPECIFIED]: \"unspecified\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_ACCOUNT]: \"account\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_SESSION]: \"session\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_API_KEY]: \"api_key\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_SUBACCOUNT]: \"subaccount\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_MEMBER]: \"member\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_POLICY]: \"policy\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_INVITE]: \"invite\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_SECURITY]: \"security\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_DESTINATION]: \"destination\",\n } satisfies ProtoToOutput<Proto.ActivityEntityKind, ActivityEntityKindValue>,\n} as const;\n\nexport const ActivityEventActionCodec = {\n protoToOutput: {\n [Proto.ActivityEventAction.ACTIVITY_ACTION_UNSPECIFIED]: \"unspecified\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_CREATED]: \"created\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_UPDATED]: \"updated\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_DELETED]: \"deleted\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_ENABLED]: \"enabled\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_DISABLED]: \"disabled\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REMOVED]: \"removed\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_ROLE_SET]: \"role_set\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_RECEIVED]: \"received\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REPLIED]: \"replied\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_FAILED]: \"failed\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REVOKED]: \"revoked\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_BLOCKED]: \"blocked\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_HOLD_PLACED]: \"hold_placed\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_HOLD_RELEASED]: \"hold_released\",\n } satisfies ProtoToOutput<Proto.ActivityEventAction, ActivityEventActionValue>,\n} as const;\n\nexport const ActivityEventSourceCodec = {\n protoToOutput: {\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_UNSPECIFIED]: \"unspecified\",\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_WEB]: \"web\",\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_MOBILE]: \"mobile\",\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_API]: \"api\",\n } satisfies ProtoToOutput<Proto.ActivityEventSource, ActivityEventSourceValue>,\n} as const;\n"],"mappings":";;AAwDA,MAAa,qCAAqC;CAAC;CAAI;CAAY;AAAU;AAG7E,MAAa,2BAA2B,CAAC,UAAU,UAAU;AAqC7D,MAAa,sBAAsB;CAC/B,cAAc;EACV,OAAA;EACA,OAAA;EACA,UAAA;EACA,kBAAA;EACA,QAAA;EACA,QAAA;CACJ;CACA,eAAe;GACyC,IAAA;GACtB,IAAA;GACA,IAAA;GACG,IAAA;GACQ,IAAA;GACV,IAAA;GACA,IAAA;CACnC;AACJ;AAEA,MAAa,4BAA4B,EACrC,eAAe;EAC+B,IAAA;EACI,IAAA;EACE,IAAA;EACJ,IAAA;EACJ,IAAA;EACC,IAAA;EACa,IAAA;EACN,IAAA;EACA,IAAA;EACA,IAAA;EACE,KAAA;EACP,KAAA;EACE,KAAA;EACF,KAAA;EACE,KAAA;EACD,KAAA;EACE,KAAA;EACO,KAAA;EACE,KAAA;EACX,KAAA;EAExC,KAAA;EACwD,KAAA;EACP,KAAA;EACA,KAAA;EACE,KAAA;EACL,KAAA;EACD,KAAA;EACE,KAAA;EAChB,KAAA;AACvC,EACJ;AAEA,MAAa,oBAAoB,EAC7B,cAAc;CACV,QAAA;CACA,SAAA;CACA,QAAA;AACJ,EACJ;AAEA,MAAa,oBAAoB,EAC7B,eAAe;EACiC,IAAA;EACJ,IAAA;EACC,IAAA;EACA,IAAA;EACC,IAAA;AAC9C,EACJ;AAEA,MAAa,iCAAiC,EAC1C,cAAc;CACV,IAAA;CACA,UAAA;CACA,UAAA;AACJ,EACJ;AAEA,MAAa,wBAAwB;CACjC,cAAc;EACV,QAAA;EACA,UAAA;CACJ;CACA,eAAe;GAC2B,IAAA;GACL,IAAA;GACE,IAAA;CACvC;AACJ;AAEA,MAAa,0BAA0B,EACnC,eAAe;EAC6C,IAAA;EACJ,IAAA;EACA,IAAA;EACA,IAAA;EACG,IAAA;EACJ,IAAA;EACA,IAAA;EACA,IAAA;EACE,IAAA;EACG,IAAA;AAC5D,EACJ;AAEA,MAAa,2BAA2B,EACpC,eAAe;EAC8C,IAAA;EACJ,IAAA;EACA,IAAA;EACA,IAAA;EACA,IAAA;EACC,IAAA;EACD,IAAA;EACC,IAAA;EACA,IAAA;EACD,IAAA;EACD,KAAA;EACC,KAAA;EACA,KAAA;EACI,KAAA;EACE,KAAA;AAC/D,EACJ;AAEA,MAAa,2BAA2B,EACpC,eAAe;EAC8C,IAAA;EACR,IAAA;EACG,IAAA;EACH,IAAA;AACrD,EACJ"}
1
+ {"version":3,"file":"subaccounts.codecs.js","names":[],"sources":["../../../src/services/subaccounts/subaccounts.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/auth/v1/subaccounts_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const SUBACCOUNT_ROLE_VALUES = [\n \"owner\",\n \"admin\",\n \"treasury\",\n \"leveraged_trader\",\n \"trader\",\n \"viewer\",\n] as const;\nexport type SubaccountRoleValue = (typeof SUBACCOUNT_ROLE_VALUES)[number];\n\nexport const SUBACCOUNT_PERMISSION_VALUES = [\n \"read_subaccount\",\n \"update_subaccount\",\n \"read_balances\",\n \"read_spot\",\n \"trade_spot\",\n \"read_internal_transfers\",\n \"internal_transfer\",\n \"external_withdraw\",\n \"read_address_book\",\n \"manage_address_book\",\n \"read_members\",\n \"manage_members\",\n \"read_invites\",\n \"manage_invites\",\n \"read_api_keys\",\n \"manage_api_keys\",\n \"read_subaccount_policy\",\n \"manage_subaccount_policy\",\n \"read_activity\",\n \"read_activity_security_details\",\n \"manage_member_mfa_requirement\",\n \"create_deposit_address\",\n \"read_deposit_addresses\",\n \"read_guard_signer_status\",\n \"manage_guard_signer\",\n \"read_auto_withdraw\",\n \"manage_auto_withdraw\",\n \"swap\",\n] as const;\nexport type SubaccountPermissionValue = (typeof SUBACCOUNT_PERMISSION_VALUES)[number];\n\nexport const SUBACCOUNT_INVITE_ACTION_VALUES = [\"accept\", \"decline\", \"cancel\"] as const;\nexport type SubaccountInviteActionValue = (typeof SUBACCOUNT_INVITE_ACTION_VALUES)[number];\n\nexport const SUBACCOUNT_INVITE_STATUS_VALUES = [\n \"pending\",\n \"accepted\",\n \"declined\",\n \"canceled\",\n] as const;\nexport type SubaccountInviteStatusValue = (typeof SUBACCOUNT_INVITE_STATUS_VALUES)[number];\n\nexport const SUBACCOUNT_INVITE_DIRECTION_VALUES = [\"\", \"incoming\", \"outgoing\"] as const;\nexport type SubaccountInviteDirectionValue = (typeof SUBACCOUNT_INVITE_DIRECTION_VALUES)[number];\n\nexport const SUBACCOUNT_STATUS_VALUES = [\"active\", \"disabled\"] as const;\nexport type SubaccountStatusValue = (typeof SUBACCOUNT_STATUS_VALUES)[number];\n\nexport const ACTIVITY_ENTITY_KIND_VALUES = [\n \"account\",\n \"session\",\n \"api_key\",\n \"subaccount\",\n \"member\",\n \"policy\",\n \"invite\",\n \"security\",\n \"destination\",\n] as const;\nexport type ActivityEntityKindValue = (typeof ACTIVITY_ENTITY_KIND_VALUES)[number];\n\nexport const ACTIVITY_EVENT_ACTION_VALUES = [\n \"created\",\n \"updated\",\n \"deleted\",\n \"enabled\",\n \"disabled\",\n \"removed\",\n \"role_set\",\n \"received\",\n \"replied\",\n \"failed\",\n \"revoked\",\n \"blocked\",\n \"hold_placed\",\n \"hold_released\",\n \"requested\",\n \"applied\",\n] as const;\nexport type ActivityEventActionValue = (typeof ACTIVITY_EVENT_ACTION_VALUES)[number];\n\nexport const ACTIVITY_EVENT_SOURCE_VALUES = [\"web\", \"mobile\", \"api\"] as const;\nexport type ActivityEventSourceValue = (typeof ACTIVITY_EVENT_SOURCE_VALUES)[number];\n\nexport const SubaccountRoleCodec = {\n inputToProto: {\n owner: Proto.SubaccountRole.OWNER,\n admin: Proto.SubaccountRole.ADMIN,\n treasury: Proto.SubaccountRole.TREASURY,\n leveraged_trader: Proto.SubaccountRole.LEVERAGED_TRADER,\n trader: Proto.SubaccountRole.TRADER,\n viewer: Proto.SubaccountRole.VIEWER,\n } satisfies InputToProto<SubaccountRoleValue, Proto.SubaccountRole>,\n protoToOutput: {\n [Proto.SubaccountRole.SUBACCOUNT_ROLE_UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountRole.OWNER]: \"owner\",\n [Proto.SubaccountRole.ADMIN]: \"admin\",\n [Proto.SubaccountRole.TREASURY]: \"treasury\",\n [Proto.SubaccountRole.LEVERAGED_TRADER]: \"leveraged_trader\",\n [Proto.SubaccountRole.TRADER]: \"trader\",\n [Proto.SubaccountRole.VIEWER]: \"viewer\",\n } satisfies ProtoToOutput<Proto.SubaccountRole, SubaccountRoleValue>,\n} as const;\n\nexport const SubaccountPermissionCodec = {\n protoToOutput: {\n [Proto.SubaccountPermission.UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountPermission.READ_SUBACCOUNT]: \"read_subaccount\",\n [Proto.SubaccountPermission.UPDATE_SUBACCOUNT]: \"update_subaccount\",\n [Proto.SubaccountPermission.READ_BALANCES]: \"read_balances\",\n [Proto.SubaccountPermission.READ_SPOT]: \"read_spot\",\n [Proto.SubaccountPermission.TRADE_SPOT]: \"trade_spot\",\n [Proto.SubaccountPermission.READ_INTERNAL_TRANSFERS]: \"read_internal_transfers\",\n [Proto.SubaccountPermission.INTERNAL_TRANSFER]: \"internal_transfer\",\n [Proto.SubaccountPermission.EXTERNAL_WITHDRAW]: \"external_withdraw\",\n [Proto.SubaccountPermission.READ_ADDRESS_BOOK]: \"read_address_book\",\n [Proto.SubaccountPermission.MANAGE_ADDRESS_BOOK]: \"manage_address_book\",\n [Proto.SubaccountPermission.READ_MEMBERS]: \"read_members\",\n [Proto.SubaccountPermission.MANAGE_MEMBERS]: \"manage_members\",\n [Proto.SubaccountPermission.READ_INVITES]: \"read_invites\",\n [Proto.SubaccountPermission.MANAGE_INVITES]: \"manage_invites\",\n [Proto.SubaccountPermission.READ_API_KEYS]: \"read_api_keys\",\n [Proto.SubaccountPermission.MANAGE_API_KEYS]: \"manage_api_keys\",\n [Proto.SubaccountPermission.READ_SUBACCOUNT_POLICY]: \"read_subaccount_policy\",\n [Proto.SubaccountPermission.MANAGE_SUBACCOUNT_POLICY]: \"manage_subaccount_policy\",\n [Proto.SubaccountPermission.READ_ACTIVITY]: \"read_activity\",\n [Proto.SubaccountPermission.READ_ACTIVITY_SECURITY_DETAILS]:\n \"read_activity_security_details\",\n [Proto.SubaccountPermission.MANAGE_MEMBER_MFA_REQUIREMENT]: \"manage_member_mfa_requirement\",\n [Proto.SubaccountPermission.CREATE_DEPOSIT_ADDRESS]: \"create_deposit_address\",\n [Proto.SubaccountPermission.READ_DEPOSIT_ADDRESSES]: \"read_deposit_addresses\",\n [Proto.SubaccountPermission.READ_GUARD_SIGNER_STATUS]: \"read_guard_signer_status\",\n [Proto.SubaccountPermission.MANAGE_GUARD_SIGNER]: \"manage_guard_signer\",\n [Proto.SubaccountPermission.READ_AUTO_WITHDRAW]: \"read_auto_withdraw\",\n [Proto.SubaccountPermission.MANAGE_AUTO_WITHDRAW]: \"manage_auto_withdraw\",\n [Proto.SubaccountPermission.SWAP]: \"swap\",\n } satisfies ProtoToOutput<Proto.SubaccountPermission, SubaccountPermissionValue>,\n} as const;\n\nexport const InviteActionCodec = {\n inputToProto: {\n accept: Proto.SubaccountInviteAction.ACCEPT,\n decline: Proto.SubaccountInviteAction.DECLINE,\n cancel: Proto.SubaccountInviteAction.CANCEL,\n } satisfies InputToProto<SubaccountInviteActionValue, Proto.SubaccountInviteAction>,\n} as const;\n\nexport const InviteStatusCodec = {\n protoToOutput: {\n [Proto.SubaccountInviteStatus.UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountInviteStatus.PENDING]: \"pending\",\n [Proto.SubaccountInviteStatus.ACCEPTED]: \"accepted\",\n [Proto.SubaccountInviteStatus.DECLINED]: \"declined\",\n [Proto.SubaccountInviteStatus.CANCELLED]: \"canceled\",\n } satisfies ProtoToOutput<Proto.SubaccountInviteStatus, SubaccountInviteStatusValue>,\n} as const;\n\nexport const SubaccountInviteDirectionCodec = {\n inputToProto: {\n \"\": Proto.SubaccountInviteDirection.DIRECTION_UNSPECIFIED,\n incoming: Proto.SubaccountInviteDirection.INCOMING,\n outgoing: Proto.SubaccountInviteDirection.OUTGOING,\n } satisfies InputToProto<SubaccountInviteDirectionValue, Proto.SubaccountInviteDirection>,\n} as const;\n\nexport const SubaccountStatusCodec = {\n inputToProto: {\n active: Proto.SubaccountStatus.ACTIVE,\n disabled: Proto.SubaccountStatus.DISABLED,\n } satisfies InputToProto<SubaccountStatusValue, Proto.SubaccountStatus>,\n protoToOutput: {\n [Proto.SubaccountStatus.UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountStatus.ACTIVE]: \"active\",\n [Proto.SubaccountStatus.DISABLED]: \"disabled\",\n } satisfies ProtoToOutput<Proto.SubaccountStatus, SubaccountStatusValue>,\n} as const;\n\nexport const ActivityEntityKindCodec = {\n protoToOutput: {\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_UNSPECIFIED]: \"unspecified\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_ACCOUNT]: \"account\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_SESSION]: \"session\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_API_KEY]: \"api_key\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_SUBACCOUNT]: \"subaccount\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_MEMBER]: \"member\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_POLICY]: \"policy\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_INVITE]: \"invite\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_SECURITY]: \"security\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_DESTINATION]: \"destination\",\n } satisfies ProtoToOutput<Proto.ActivityEntityKind, ActivityEntityKindValue>,\n} as const;\n\nexport const ActivityEventActionCodec = {\n protoToOutput: {\n [Proto.ActivityEventAction.ACTIVITY_ACTION_UNSPECIFIED]: \"unspecified\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_CREATED]: \"created\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_UPDATED]: \"updated\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_DELETED]: \"deleted\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_ENABLED]: \"enabled\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_DISABLED]: \"disabled\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REMOVED]: \"removed\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_ROLE_SET]: \"role_set\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_RECEIVED]: \"received\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REPLIED]: \"replied\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_FAILED]: \"failed\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REVOKED]: \"revoked\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_BLOCKED]: \"blocked\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_HOLD_PLACED]: \"hold_placed\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_HOLD_RELEASED]: \"hold_released\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REQUESTED]: \"requested\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_APPLIED]: \"applied\",\n } satisfies ProtoToOutput<Proto.ActivityEventAction, ActivityEventActionValue>,\n} as const;\n\nexport const ActivityEventSourceCodec = {\n protoToOutput: {\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_UNSPECIFIED]: \"unspecified\",\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_WEB]: \"web\",\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_MOBILE]: \"mobile\",\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_API]: \"api\",\n } satisfies ProtoToOutput<Proto.ActivityEventSource, ActivityEventSourceValue>,\n} as const;\n"],"mappings":";;AAwDA,MAAa,qCAAqC;CAAC;CAAI;CAAY;AAAU;AAG7E,MAAa,2BAA2B,CAAC,UAAU,UAAU;AAuC7D,MAAa,sBAAsB;CAC/B,cAAc;EACV,OAAA;EACA,OAAA;EACA,UAAA;EACA,kBAAA;EACA,QAAA;EACA,QAAA;CACJ;CACA,eAAe;GACyC,IAAA;GACtB,IAAA;GACA,IAAA;GACG,IAAA;GACQ,IAAA;GACV,IAAA;GACA,IAAA;CACnC;AACJ;AAEA,MAAa,4BAA4B,EACrC,eAAe;EAC+B,IAAA;EACI,IAAA;EACE,IAAA;EACJ,IAAA;EACJ,IAAA;EACC,IAAA;EACa,IAAA;EACN,IAAA;EACA,IAAA;EACA,IAAA;EACE,KAAA;EACP,KAAA;EACE,KAAA;EACF,KAAA;EACE,KAAA;EACD,KAAA;EACE,KAAA;EACO,KAAA;EACE,KAAA;EACX,KAAA;EAExC,KAAA;EACwD,KAAA;EACP,KAAA;EACA,KAAA;EACE,KAAA;EACL,KAAA;EACD,KAAA;EACE,KAAA;EAChB,KAAA;AACvC,EACJ;AAEA,MAAa,oBAAoB,EAC7B,cAAc;CACV,QAAA;CACA,SAAA;CACA,QAAA;AACJ,EACJ;AAEA,MAAa,oBAAoB,EAC7B,eAAe;EACiC,IAAA;EACJ,IAAA;EACC,IAAA;EACA,IAAA;EACC,IAAA;AAC9C,EACJ;AAEA,MAAa,iCAAiC,EAC1C,cAAc;CACV,IAAA;CACA,UAAA;CACA,UAAA;AACJ,EACJ;AAEA,MAAa,wBAAwB;CACjC,cAAc;EACV,QAAA;EACA,UAAA;CACJ;CACA,eAAe;GAC2B,IAAA;GACL,IAAA;GACE,IAAA;CACvC;AACJ;AAEA,MAAa,0BAA0B,EACnC,eAAe;EAC6C,IAAA;EACJ,IAAA;EACA,IAAA;EACA,IAAA;EACG,IAAA;EACJ,IAAA;EACA,IAAA;EACA,IAAA;EACE,IAAA;EACG,IAAA;AAC5D,EACJ;AAEA,MAAa,2BAA2B,EACpC,eAAe;EAC8C,IAAA;EACJ,IAAA;EACA,IAAA;EACA,IAAA;EACA,IAAA;EACC,IAAA;EACD,IAAA;EACC,IAAA;EACA,IAAA;EACD,IAAA;EACD,KAAA;EACC,KAAA;EACA,KAAA;EACI,KAAA;EACE,KAAA;EACJ,KAAA;EACF,KAAA;AACzD,EACJ;AAEA,MAAa,2BAA2B,EACpC,eAAe;EAC8C,IAAA;EACR,IAAA;EACG,IAAA;EACH,IAAA;AACrD,EACJ"}
@@ -9,7 +9,7 @@ declare const SubaccountPermissionDefinitionSchema: v.ObjectSchema<{
9
9
  readonly permission: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "internal_transfer" | "swap" | "read_subaccount" | "update_subaccount" | "read_balances" | "read_spot" | "trade_spot" | "read_internal_transfers" | "external_withdraw" | "read_address_book" | "manage_address_book" | "read_members" | "manage_members" | "read_invites" | "manage_invites" | "read_api_keys" | "manage_api_keys" | "read_subaccount_policy" | "manage_subaccount_policy" | "read_activity" | "read_activity_security_details" | "manage_member_mfa_requirement" | "create_deposit_address" | "read_deposit_addresses" | "read_guard_signer_status" | "manage_guard_signer" | "read_auto_withdraw" | "manage_auto_withdraw">]>;
10
10
  readonly displayName: v.OptionalSchema<v.StringSchema<undefined>, "">;
11
11
  readonly description: v.OptionalSchema<v.StringSchema<undefined>, "">;
12
- readonly policyAction: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "swap" | "trade-spot" | "internal-transfer" | "external-withdraw" | "read-balances" | "read-spot" | "read-internal-transfers" | "read-address-book" | "manage-address-book" | "read-auto-withdraw" | "manage-auto-withdraw" | "read-api-keys" | "read-api-policies" | "read-subaccount-policies" | "read-subaccount-permissions" | "read-vip-status" | "read-social-verification" | "read-profile" | "read-account-directory" | "read-withdraw-validation" | "read-daily-claims" | "claim-daily-reward" | "read-checkpoints" | "read-rewards" | "create-deposit-address" | "read-deposit-addresses" | "read-subaccounts" | "read-subaccount-activity" | "read-subaccount-members" | "read-subaccount-invites" | "read-guard-signer-status">]>;
12
+ readonly policyAction: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "swap" | "trade-spot" | "internal-transfer" | "external-withdraw" | "read-balances" | "read-spot" | "read-internal-transfers" | "read-address-book" | "manage-address-book" | "read-auto-withdraw" | "manage-auto-withdraw" | "read-api-keys" | "read-api-policies" | "read-subaccount-policies" | "read-subaccount-permissions" | "read-vip-status" | "read-social-verification" | "read-profile" | "read-account-directory" | "read-withdraw-validation" | "read-daily-claims" | "claim-daily-reward" | "read-checkpoints" | "read-rewards" | "create-deposit-address" | "read-deposit-addresses" | "read-subaccounts" | "read-subaccount-activity" | "read-subaccount-members" | "read-subaccount-invites" | "read-guard-signer-status" | "read-price-alerts" | "manage-price-alerts">]>;
13
13
  }, undefined>;
14
14
  type SubaccountPermissionDefinition = v.InferOutput<typeof SubaccountPermissionDefinitionSchema>;
15
15
  declare const SubaccountRoleDefinitionSchema: v.ObjectSchema<{
@@ -25,7 +25,7 @@ declare const SubaccountRoleCatalogSchema: v.ObjectSchema<{
25
25
  readonly permission: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "internal_transfer" | "swap" | "read_subaccount" | "update_subaccount" | "read_balances" | "read_spot" | "trade_spot" | "read_internal_transfers" | "external_withdraw" | "read_address_book" | "manage_address_book" | "read_members" | "manage_members" | "read_invites" | "manage_invites" | "read_api_keys" | "manage_api_keys" | "read_subaccount_policy" | "manage_subaccount_policy" | "read_activity" | "read_activity_security_details" | "manage_member_mfa_requirement" | "create_deposit_address" | "read_deposit_addresses" | "read_guard_signer_status" | "manage_guard_signer" | "read_auto_withdraw" | "manage_auto_withdraw">]>;
26
26
  readonly displayName: v.OptionalSchema<v.StringSchema<undefined>, "">;
27
27
  readonly description: v.OptionalSchema<v.StringSchema<undefined>, "">;
28
- readonly policyAction: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "swap" | "trade-spot" | "internal-transfer" | "external-withdraw" | "read-balances" | "read-spot" | "read-internal-transfers" | "read-address-book" | "manage-address-book" | "read-auto-withdraw" | "manage-auto-withdraw" | "read-api-keys" | "read-api-policies" | "read-subaccount-policies" | "read-subaccount-permissions" | "read-vip-status" | "read-social-verification" | "read-profile" | "read-account-directory" | "read-withdraw-validation" | "read-daily-claims" | "claim-daily-reward" | "read-checkpoints" | "read-rewards" | "create-deposit-address" | "read-deposit-addresses" | "read-subaccounts" | "read-subaccount-activity" | "read-subaccount-members" | "read-subaccount-invites" | "read-guard-signer-status">]>;
28
+ readonly policyAction: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "swap" | "trade-spot" | "internal-transfer" | "external-withdraw" | "read-balances" | "read-spot" | "read-internal-transfers" | "read-address-book" | "manage-address-book" | "read-auto-withdraw" | "manage-auto-withdraw" | "read-api-keys" | "read-api-policies" | "read-subaccount-policies" | "read-subaccount-permissions" | "read-vip-status" | "read-social-verification" | "read-profile" | "read-account-directory" | "read-withdraw-validation" | "read-daily-claims" | "claim-daily-reward" | "read-checkpoints" | "read-rewards" | "create-deposit-address" | "read-deposit-addresses" | "read-subaccounts" | "read-subaccount-activity" | "read-subaccount-members" | "read-subaccount-invites" | "read-guard-signer-status" | "read-price-alerts" | "manage-price-alerts">]>;
29
29
  }, undefined>, undefined>, readonly []>;
30
30
  readonly roles: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
31
31
  readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer">]>;
@@ -242,7 +242,7 @@ declare const SubaccountInviteSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<
242
242
  readonly granteeAccountId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
243
243
  readonly inviterAccountId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
244
244
  readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer">]>;
245
- readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "canceled" | "pending" | "accepted" | "declined">]>;
245
+ readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "accepted" | "canceled" | "pending" | "declined">]>;
246
246
  readonly createdAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
247
247
  readonly seconds: v.BigintSchema<undefined>;
248
248
  readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
@@ -269,7 +269,7 @@ declare const SubaccountInviteSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<
269
269
  granteeAccountId: string;
270
270
  inviterAccountId: string;
271
271
  role: "unspecified" | "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer";
272
- status: "unspecified" | "canceled" | "pending" | "accepted" | "declined";
272
+ status: "unspecified" | "accepted" | "canceled" | "pending" | "declined";
273
273
  createdAt?: number | undefined;
274
274
  respondedAt?: number | undefined;
275
275
  granteeUsername: string;
@@ -287,7 +287,7 @@ declare const SubaccountInviteSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<
287
287
  granteeAccountId: string;
288
288
  inviterAccountId: string;
289
289
  role: "unspecified" | "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer";
290
- status: "unspecified" | "canceled" | "pending" | "accepted" | "declined";
290
+ status: "unspecified" | "accepted" | "canceled" | "pending" | "declined";
291
291
  createdAt?: number | undefined;
292
292
  respondedAt?: number | undefined;
293
293
  granteeUsername: string;
@@ -309,8 +309,8 @@ declare const SubaccountActivityEventSchema: v.ObjectSchema<{
309
309
  seconds: bigint;
310
310
  nanos: number;
311
311
  } | undefined, number | undefined>]>;
312
- readonly entityKind: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "api_key" | "account" | "subaccount" | "session" | "policy" | "destination" | "member" | "invite" | "security">]>;
313
- readonly eventAction: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "disabled" | "revoked" | "removed" | "failed" | "created" | "enabled" | "updated" | "deleted" | "role_set" | "received" | "replied" | "blocked" | "hold_placed" | "hold_released">]>;
312
+ readonly entityKind: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "api_key" | "account" | "subaccount" | "destination" | "policy" | "session" | "security" | "member" | "invite">]>;
313
+ readonly eventAction: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "disabled" | "revoked" | "removed" | "applied" | "failed" | "enabled" | "created" | "updated" | "deleted" | "role_set" | "received" | "replied" | "blocked" | "hold_placed" | "hold_released" | "requested">]>;
314
314
  readonly source: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "api" | "web" | "mobile">]>;
315
315
  readonly ip: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
316
316
  readonly userAgent: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
@@ -169,7 +169,7 @@ declare const GetUserTradesInputSchema: v.SchemaWithPipe<readonly [v.UnionSchema
169
169
  readonly orderId: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
170
170
  readonly lineageId: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.TransformAction<string, bigint>]>, v.CheckAction<bigint, `${string} must be greater than zero`>]>;
171
171
  readonly throughGeneration: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>, undefined>;
172
- }, undefined>], undefined>], ({ input }: v.UnionIssue<v.StringIssue | v.NumberIssue | v.BooleanIssue | v.IntegerIssue<number> | v.MinValueIssue<number, 1> | v.MaxValueIssue<number, 4294967295> | v.StrictObjectIssue | v.PicklistIssue | v.MinLengthIssue<string, 1> | v.UnionIssue<v.StringIssue | v.StrictObjectIssue | v.PicklistIssue | v.MinLengthIssue<string, 1>> | v.GtValueIssue<number, 0> | v.CheckIssue<bigint> | v.MaxValueIssue<number, 1000> | v.NeverIssue | v.UnionIssue<v.StringIssue | v.NumberIssue | v.BooleanIssue | v.IntegerIssue<number> | v.MinValueIssue<number, 1> | v.MaxValueIssue<number, 4294967295> | v.StrictObjectIssue | v.PicklistIssue | v.MinLengthIssue<string, 1> | v.UnionIssue<v.StringIssue | v.StrictObjectIssue | v.PicklistIssue | v.MinLengthIssue<string, 1>> | v.GtValueIssue<number, 0> | v.CheckIssue<bigint> | v.MaxValueIssue<number, 1000> | v.NeverIssue>>) => "Provide at most one of orderId or lineageId" | "throughGeneration requires lineageId" | "symbolId is required when afterMatchId is set" | "Invalid trade filters">, v.TransformAction<{
172
+ }, undefined>], undefined>], ({ input }: v.UnionIssue<v.StringIssue | v.NumberIssue | v.BooleanIssue | v.IntegerIssue<number> | v.MinValueIssue<number, 1> | v.MaxValueIssue<number, 4294967295> | v.MinLengthIssue<string, 1> | v.StrictObjectIssue | v.PicklistIssue | v.UnionIssue<v.StringIssue | v.MinLengthIssue<string, 1> | v.StrictObjectIssue | v.PicklistIssue> | v.GtValueIssue<number, 0> | v.CheckIssue<bigint> | v.MaxValueIssue<number, 1000> | v.NeverIssue | v.UnionIssue<v.StringIssue | v.NumberIssue | v.BooleanIssue | v.IntegerIssue<number> | v.MinValueIssue<number, 1> | v.MaxValueIssue<number, 4294967295> | v.MinLengthIssue<string, 1> | v.StrictObjectIssue | v.PicklistIssue | v.UnionIssue<v.StringIssue | v.MinLengthIssue<string, 1> | v.StrictObjectIssue | v.PicklistIssue> | v.GtValueIssue<number, 0> | v.CheckIssue<bigint> | v.MaxValueIssue<number, 1000> | v.NeverIssue>>) => "Provide at most one of orderId or lineageId" | "throughGeneration requires lineageId" | "symbolId is required when afterMatchId is set" | "Invalid trade filters">, v.TransformAction<{
173
173
  symbolId?: number | undefined;
174
174
  afterMatchId?: undefined;
175
175
  side?: Side.BUY | Side.SELL | undefined;