@polyester/sdk 0.36.0-devnet-20261115165158 → 0.36.0-devnet-20261116002603
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -4
- package/dist/browser-core.js +1 -1
- package/dist/client.d.ts +4 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +4 -0
- package/dist/client.js.map +1 -1
- package/dist/gen/ai/v1/assistant_pb.d.ts +83 -5
- package/dist/gen/ai/v1/assistant_pb.d.ts.map +1 -1
- package/dist/gen/ai/v1/assistant_pb.js +67 -11
- package/dist/gen/ai/v1/assistant_pb.js.map +1 -1
- package/dist/gen/alerts/v1/price_alerts_pb.d.ts +1 -1
- package/dist/gen/auth/v1/address_book_pb.d.ts +1 -1
- package/dist/gen/auth/v1/api_keys_pb.d.ts +5 -5
- package/dist/gen/auth/v1/api_keys_pb.js +4 -4
- package/dist/gen/auth/v1/api_keys_pb.js.map +1 -1
- package/dist/gen/auth/v1/auth_pb.d.ts +27 -2
- package/dist/gen/auth/v1/auth_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/auth_pb.js +18 -1
- package/dist/gen/auth/v1/auth_pb.js.map +1 -1
- package/dist/gen/auth/v1/mfa_pb.d.ts +1 -1
- package/dist/gen/auth/v1/policies_pb.d.ts +19 -2
- package/dist/gen/auth/v1/policies_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/policies_pb.js +18 -1
- package/dist/gen/auth/v1/policies_pb.js.map +1 -1
- package/dist/gen/auth/v1/profile_pb.d.ts +8 -12
- package/dist/gen/auth/v1/profile_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/profile_pb.js +1 -1
- package/dist/gen/auth/v1/profile_pb.js.map +1 -1
- package/dist/gen/auth/v1/resolve_pb.d.ts +1 -1
- package/dist/gen/auth/v1/social_verification_pb.d.ts +45 -11
- package/dist/gen/auth/v1/social_verification_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/social_verification_pb.js +1 -1
- package/dist/gen/auth/v1/social_verification_pb.js.map +1 -1
- package/dist/gen/auth/v1/subaccounts_pb.d.ts +18 -2
- package/dist/gen/auth/v1/subaccounts_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/subaccounts_pb.js +16 -2
- package/dist/gen/auth/v1/subaccounts_pb.js.map +1 -1
- package/dist/gen/chain/analytics/v1/analytics_read_pb.d.ts +1 -1
- package/dist/gen/chain/deposit/v1/deposit_pb.d.ts +1 -1
- package/dist/gen/chain/guard/v1/guard_signer_pb.d.ts +1 -1
- package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.d.ts +229 -39
- package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.d.ts.map +1 -1
- package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.js +34 -10
- package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.js.map +1 -1
- package/dist/gen/chain/lifecycle/v1/types_pb.d.ts +13 -1
- package/dist/gen/chain/lifecycle/v1/types_pb.d.ts.map +1 -1
- package/dist/gen/chain/lifecycle/v1/types_pb.js +13 -1
- package/dist/gen/chain/lifecycle/v1/types_pb.js.map +1 -1
- package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts +7 -4
- package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts.map +1 -1
- package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.js.map +1 -1
- package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts +11 -2
- package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts.map +1 -1
- package/dist/gen/chain/withdraw/v1/withdraw_pb.js +10 -1
- package/dist/gen/chain/withdraw/v1/withdraw_pb.js.map +1 -1
- package/dist/gen/chain/zipper/v1/reason_pb.d.ts +1 -1
- package/dist/gen/chain/zipper/v1/zipper_pb.d.ts +11 -7
- package/dist/gen/chain/zipper/v1/zipper_pb.d.ts.map +1 -1
- package/dist/gen/chain/zipper/v1/zipper_pb.js +2 -2
- package/dist/gen/chain/zipper/v1/zipper_pb.js.map +1 -1
- package/dist/gen/changelog/v1/changelog_pb.d.ts +1 -1
- package/dist/gen/checkpoints/v1/checkpoints_pb.d.ts +1 -1
- package/dist/gen/claims/v1/claims_pb.d.ts +1 -1
- package/dist/gen/fees/v1/fees_pb.d.ts +1 -1
- package/dist/gen/index.d.ts +3 -1
- package/dist/gen/index.js +23 -21
- package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts +58 -17
- package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts.map +1 -1
- package/dist/gen/ledger/read/v1/ledger_read_pb.js +32 -1
- package/dist/gen/ledger/read/v1/ledger_read_pb.js.map +1 -1
- package/dist/gen/ledger/read/v1/statement_export_pb.d.ts +424 -0
- package/dist/gen/ledger/read/v1/statement_export_pb.d.ts.map +1 -0
- package/dist/gen/ledger/read/v1/statement_export_pb.js +154 -0
- package/dist/gen/ledger/read/v1/statement_export_pb.js.map +1 -0
- package/dist/gen/marketdata/v1/asset_info_pb.d.ts +1 -1
- package/dist/gen/marketdata/v1/heatmap_pb.d.ts +1 -1
- package/dist/gen/marketdata/v1/marketdata_pb.d.ts +1 -1
- package/dist/gen/marketoverview/v1/marketoverview_pb.d.ts +1 -1
- package/dist/gen/notifications/v1/notifications_pb.d.ts +1 -1
- package/dist/gen/orderbook/v1/orderbook_pb.d.ts +1 -1
- package/dist/gen/orders/v1/orders_pb.d.ts +29 -5
- package/dist/gen/orders/v1/orders_pb.d.ts.map +1 -1
- package/dist/gen/orders/v1/orders_pb.js +1 -1
- package/dist/gen/orders/v1/orders_pb.js.map +1 -1
- package/dist/gen/orders/v1/orders_read_pb.d.ts +3 -2
- package/dist/gen/orders/v1/orders_read_pb.d.ts.map +1 -1
- package/dist/gen/orders/v1/orders_read_pb.js.map +1 -1
- package/dist/gen/polyester/ratelimit/v1/types_pb.d.ts +1 -1
- package/dist/gen/polyester/type/v1/u128_pb.d.ts +1 -1
- package/dist/gen/privatews/v1/private_ws_pb.d.ts +1 -1
- package/dist/gen/ratelimit/v1/ratelimit_pb.d.ts +13 -8
- package/dist/gen/ratelimit/v1/ratelimit_pb.d.ts.map +1 -1
- package/dist/gen/ratelimit/v1/ratelimit_pb.js.map +1 -1
- package/dist/gen/rewards/v1/rewards_pb.d.ts +1 -1
- package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts +23 -11
- package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts.map +1 -1
- package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js +4 -2
- package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js.map +1 -1
- package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts +48 -12
- package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts.map +1 -1
- package/dist/gen/swap/quickswap/v1/quickswap_pb.js +35 -6
- package/dist/gen/swap/quickswap/v1/quickswap_pb.js.map +1 -1
- package/dist/gen/swap/quickswap/v1/quickswap_referral_pb.d.ts +1 -1
- package/dist/gen/swap/v1/swap_pb.d.ts +1 -1
- package/dist/gen/system/v1/system_pb.d.ts +1 -1
- package/dist/gen/tradews/v1/trade_ws_pb.d.ts +1 -1
- package/dist/gen/transfer/v1/dust_conversion_pb.d.ts +741 -0
- package/dist/gen/transfer/v1/dust_conversion_pb.d.ts.map +1 -0
- package/dist/gen/transfer/v1/dust_conversion_pb.js +235 -0
- package/dist/gen/transfer/v1/dust_conversion_pb.js.map +1 -0
- package/dist/gen/transfer/v1/internal_transfer_pb.d.ts +368 -4
- package/dist/gen/transfer/v1/internal_transfer_pb.d.ts.map +1 -1
- package/dist/gen/transfer/v1/internal_transfer_pb.js +166 -4
- package/dist/gen/transfer/v1/internal_transfer_pb.js.map +1 -1
- package/dist/gen/triggers/v1/triggers_pb.d.ts +11 -6
- package/dist/gen/triggers/v1/triggers_pb.d.ts.map +1 -1
- package/dist/gen/triggers/v1/triggers_pb.js +4 -2
- package/dist/gen/triggers/v1/triggers_pb.js.map +1 -1
- package/dist/gen/vip/v1/vip_pb.d.ts +1 -1
- package/dist/index.d.ts +13 -7
- package/dist/index.js +1 -1
- package/dist/realtime/snapshot-then-stream.js +1 -1
- package/dist/server-core.js +3 -3
- package/dist/services/accounts/accounts.js +1 -1
- package/dist/services/accounts/accounts.schemas.js +1 -1
- package/dist/services/address-book/address-book.js +1 -1
- package/dist/services/api-keys/api-keys.js +1 -1
- package/dist/services/api-keys/api-keys.schemas.js +1 -1
- package/dist/services/assistant/assistant-events.schemas.d.ts +29 -29
- package/dist/services/assistant/assistant.codecs.d.ts +7 -1
- package/dist/services/assistant/assistant.codecs.d.ts.map +1 -1
- package/dist/services/assistant/assistant.codecs.js +5 -1
- package/dist/services/assistant/assistant.codecs.js.map +1 -1
- package/dist/services/assistant/assistant.d.ts +4 -3
- package/dist/services/assistant/assistant.d.ts.map +1 -1
- package/dist/services/assistant/assistant.js +7 -5
- package/dist/services/assistant/assistant.js.map +1 -1
- package/dist/services/assistant/assistant.schemas.d.ts +40 -3
- package/dist/services/assistant/assistant.schemas.d.ts.map +1 -1
- package/dist/services/assistant/assistant.schemas.js +19 -5
- package/dist/services/assistant/assistant.schemas.js.map +1 -1
- package/dist/services/assistant/assistant.types.d.ts +3 -3
- package/dist/services/auth/account-signer-auth.js +2 -2
- package/dist/services/auth/auth.js +1 -1
- package/dist/services/auth/profile/profile.d.ts +1 -1
- package/dist/services/auth/profile/profile.js +3 -3
- package/dist/services/auth/profile/profile.js.map +1 -1
- package/dist/services/auth/profile/profile.schemas.d.ts +0 -1
- package/dist/services/auth/profile/profile.schemas.d.ts.map +1 -1
- package/dist/services/auth/profile/profile.schemas.js +0 -1
- package/dist/services/auth/profile/profile.schemas.js.map +1 -1
- package/dist/services/auto-withdraw/auto-withdraw.codecs.d.ts +3 -1
- package/dist/services/auto-withdraw/auto-withdraw.codecs.d.ts.map +1 -1
- package/dist/services/auto-withdraw/auto-withdraw.codecs.js.map +1 -1
- package/dist/services/auto-withdraw/auto-withdraw.js +1 -1
- package/dist/services/auto-withdraw/auto-withdraw.schemas.d.ts +22 -22
- package/dist/services/auto-withdraw/auto-withdraw.schemas.js +1 -1
- package/dist/services/balances/balances.d.ts +4 -3
- package/dist/services/balances/balances.d.ts.map +1 -1
- package/dist/services/balances/balances.js +13 -5
- package/dist/services/balances/balances.js.map +1 -1
- package/dist/services/balances/balances.schemas.d.ts +30 -5
- package/dist/services/balances/balances.schemas.d.ts.map +1 -1
- package/dist/services/balances/balances.schemas.js +5 -9
- package/dist/services/balances/balances.schemas.js.map +1 -1
- package/dist/services/balances/balances.types.d.ts +2 -2
- package/dist/services/candles/candles.js +2 -2
- package/dist/services/candles/candles.schemas.d.ts +10 -10
- package/dist/services/chain-analytics/chain-analytics.js +1 -1
- package/dist/services/changelog/changelog.js +1 -1
- package/dist/services/changelog/changelog.schemas.d.ts +22 -22
- package/dist/services/checkpoints/checkpoints.js +1 -1
- package/dist/services/claims/claims.js +1 -1
- package/dist/services/claims/claims.schemas.d.ts +2 -2
- package/dist/services/claims/claims.schemas.js +1 -1
- package/dist/services/deposit/deposit.js +1 -1
- package/dist/services/dust-conversion/dust-conversion.codecs.d.ts +22 -0
- package/dist/services/dust-conversion/dust-conversion.codecs.d.ts.map +1 -0
- package/dist/services/dust-conversion/dust-conversion.codecs.js +22 -0
- package/dist/services/dust-conversion/dust-conversion.codecs.js.map +1 -0
- package/dist/services/dust-conversion/dust-conversion.d.ts +59 -0
- package/dist/services/dust-conversion/dust-conversion.d.ts.map +1 -0
- package/dist/services/dust-conversion/dust-conversion.js +87 -0
- package/dist/services/dust-conversion/dust-conversion.js.map +1 -0
- package/dist/services/dust-conversion/dust-conversion.schemas.d.ts +561 -0
- package/dist/services/dust-conversion/dust-conversion.schemas.d.ts.map +1 -0
- package/dist/services/dust-conversion/dust-conversion.schemas.js +190 -0
- package/dist/services/dust-conversion/dust-conversion.schemas.js.map +1 -0
- package/dist/services/dust-conversion/dust-conversion.types.d.ts +3 -0
- package/dist/services/dust-conversion/service.d.ts +8 -0
- package/dist/services/dust-conversion/service.d.ts.map +1 -0
- package/dist/services/dust-conversion/service.js +9 -0
- package/dist/services/dust-conversion/service.js.map +1 -0
- package/dist/services/fees/fees.js +1 -1
- package/dist/services/guard-signer/guard-signer.js +1 -1
- package/dist/services/guard-signer/guard-signer.schemas.js +1 -1
- package/dist/services/heatmap/heatmap.js +2 -2
- package/dist/services/internal-transfers/internal-transfers.codecs.d.ts +13 -1
- package/dist/services/internal-transfers/internal-transfers.codecs.d.ts.map +1 -1
- package/dist/services/internal-transfers/internal-transfers.codecs.js +22 -2
- package/dist/services/internal-transfers/internal-transfers.codecs.js.map +1 -1
- package/dist/services/internal-transfers/internal-transfers.d.ts +14 -2
- package/dist/services/internal-transfers/internal-transfers.d.ts.map +1 -1
- package/dist/services/internal-transfers/internal-transfers.js +30 -4
- package/dist/services/internal-transfers/internal-transfers.js.map +1 -1
- package/dist/services/internal-transfers/internal-transfers.schemas.d.ts +265 -5
- package/dist/services/internal-transfers/internal-transfers.schemas.d.ts.map +1 -1
- package/dist/services/internal-transfers/internal-transfers.schemas.js +62 -4
- package/dist/services/internal-transfers/internal-transfers.schemas.js.map +1 -1
- package/dist/services/internal-transfers/internal-transfers.types.d.ts +3 -3
- package/dist/services/lifecycle/lifecycle.codecs.d.ts +1 -1
- package/dist/services/lifecycle/lifecycle.codecs.d.ts.map +1 -1
- package/dist/services/lifecycle/lifecycle.codecs.js +1 -0
- package/dist/services/lifecycle/lifecycle.codecs.js.map +1 -1
- package/dist/services/lifecycle/lifecycle.d.ts +26 -8
- package/dist/services/lifecycle/lifecycle.d.ts.map +1 -1
- package/dist/services/lifecycle/lifecycle.js +42 -10
- package/dist/services/lifecycle/lifecycle.js.map +1 -1
- package/dist/services/lifecycle/lifecycle.schemas.d.ts +108 -84
- package/dist/services/lifecycle/lifecycle.schemas.d.ts.map +1 -1
- package/dist/services/lifecycle/lifecycle.schemas.js +45 -46
- package/dist/services/lifecycle/lifecycle.schemas.js.map +1 -1
- package/dist/services/lifecycle/lifecycle.types.d.ts +2 -2
- package/dist/services/lifecycle/service.js +1 -1
- package/dist/services/lifecycle/service.js.map +1 -1
- package/dist/services/market-data/market-data.js +3 -3
- package/dist/services/market-overview/market-overview.js +2 -2
- package/dist/services/market-overview/market-overview.schemas.js +1 -1
- package/dist/services/notifications/notifications.js +1 -1
- package/dist/services/orderbook/orderbook.d.ts.map +1 -1
- package/dist/services/orderbook/orderbook.js +3 -2
- package/dist/services/orderbook/orderbook.js.map +1 -1
- package/dist/services/orderbook/orderbook.schemas.d.ts +10 -0
- package/dist/services/orderbook/orderbook.schemas.d.ts.map +1 -1
- package/dist/services/orderbook/orderbook.schemas.js +4 -1
- package/dist/services/orderbook/orderbook.schemas.js.map +1 -1
- package/dist/services/orders/order-errors.schemas.d.ts +11 -1
- package/dist/services/orders/order-errors.schemas.d.ts.map +1 -1
- package/dist/services/orders/order-errors.schemas.js +12 -2
- package/dist/services/orders/order-errors.schemas.js.map +1 -1
- package/dist/services/orders/orders-batch.schemas.d.ts +67 -27
- package/dist/services/orders/orders-batch.schemas.d.ts.map +1 -1
- package/dist/services/orders/orders-batch.schemas.js +2 -2
- package/dist/services/orders/orders-identifiers.schemas.js +2 -1
- package/dist/services/orders/orders-identifiers.schemas.js.map +1 -1
- package/dist/services/orders/orders-input.schemas.d.ts +11 -4
- package/dist/services/orders/orders-input.schemas.d.ts.map +1 -1
- package/dist/services/orders/orders-input.schemas.js +3 -2
- package/dist/services/orders/orders-input.schemas.js.map +1 -1
- package/dist/services/orders/orders-modify.schemas.js +2 -2
- package/dist/services/orders/orders-output.schemas.d.ts +14 -14
- package/dist/services/orders/orders-risk.schemas.js +3 -3
- package/dist/services/orders/orders.js +2 -2
- package/dist/services/policies/api-key-policies/api-key-policies.js +1 -1
- package/dist/services/policies/api-key-policies/api-key-policies.schemas.d.ts +15 -15
- package/dist/services/policies/shared.codecs.js +10 -4
- package/dist/services/policies/shared.codecs.js.map +1 -1
- package/dist/services/policies/shared.d.ts +1 -1
- package/dist/services/policies/subaccount-policies/subaccount-policies.js +2 -2
- package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.d.ts +3 -3
- package/dist/services/price-alerts/price-alerts.js +1 -1
- package/dist/services/price-alerts/price-alerts.schemas.d.ts +10 -10
- package/dist/services/rate-limits/rate-limits.d.ts +4 -1
- package/dist/services/rate-limits/rate-limits.d.ts.map +1 -1
- package/dist/services/rate-limits/rate-limits.js +5 -2
- package/dist/services/rate-limits/rate-limits.js.map +1 -1
- package/dist/services/rate-limits/rate-limits.schemas.d.ts +1 -0
- package/dist/services/rate-limits/rate-limits.schemas.d.ts.map +1 -1
- package/dist/services/rate-limits/rate-limits.schemas.js +1 -0
- package/dist/services/rate-limits/rate-limits.schemas.js.map +1 -1
- package/dist/services/rewards/rewards.js +1 -1
- package/dist/services/social-verification/social-verification.codecs.js +6 -2
- package/dist/services/social-verification/social-verification.codecs.js.map +1 -1
- package/dist/services/social-verification/social-verification.d.ts +14 -3
- package/dist/services/social-verification/social-verification.d.ts.map +1 -1
- package/dist/services/social-verification/social-verification.js +15 -4
- package/dist/services/social-verification/social-verification.js.map +1 -1
- package/dist/services/social-verification/social-verification.schemas.d.ts +13 -3
- package/dist/services/social-verification/social-verification.schemas.d.ts.map +1 -1
- package/dist/services/social-verification/social-verification.schemas.js +13 -5
- package/dist/services/social-verification/social-verification.schemas.js.map +1 -1
- package/dist/services/statement-exports/service.d.ts +8 -0
- package/dist/services/statement-exports/service.d.ts.map +1 -0
- package/dist/services/statement-exports/service.js +9 -0
- package/dist/services/statement-exports/service.js.map +1 -0
- package/dist/services/statement-exports/statement-exports.codecs.d.ts +17 -0
- package/dist/services/statement-exports/statement-exports.codecs.d.ts.map +1 -0
- package/dist/services/statement-exports/statement-exports.codecs.js +19 -0
- package/dist/services/statement-exports/statement-exports.codecs.js.map +1 -0
- package/dist/services/statement-exports/statement-exports.d.ts +34 -0
- package/dist/services/statement-exports/statement-exports.d.ts.map +1 -0
- package/dist/services/statement-exports/statement-exports.js +53 -0
- package/dist/services/statement-exports/statement-exports.js.map +1 -0
- package/dist/services/statement-exports/statement-exports.schemas.d.ts +269 -0
- package/dist/services/statement-exports/statement-exports.schemas.d.ts.map +1 -0
- package/dist/services/statement-exports/statement-exports.schemas.js +98 -0
- package/dist/services/statement-exports/statement-exports.schemas.js.map +1 -0
- package/dist/services/statement-exports/statement-exports.types.d.ts +3 -0
- package/dist/services/subaccounts/subaccounts.codecs.js +3 -1
- package/dist/services/subaccounts/subaccounts.codecs.js.map +1 -1
- package/dist/services/subaccounts/subaccounts.js +3 -3
- package/dist/services/subaccounts/subaccounts.schemas.d.ts +13 -13
- package/dist/services/system/system.js +1 -1
- package/dist/services/system/system.schemas.d.ts +7 -7
- package/dist/services/trades/trades.js +2 -2
- package/dist/services/trades/trades.schemas.d.ts +1 -1
- package/dist/services/trading-withdraws/trading-withdraws.js +1 -1
- package/dist/services/trading-withdraws/trading-withdraws.schemas.js +1 -1
- package/dist/services/trading-withdraws/wallet-message.js +1 -1
- package/dist/services/transfers/transfers.js +2 -2
- package/dist/services/triggers/trigger-child-order.schemas.js +3 -3
- package/dist/services/triggers/trigger-input.schemas.d.ts +5 -4
- package/dist/services/triggers/trigger-input.schemas.d.ts.map +1 -1
- package/dist/services/triggers/trigger-input.schemas.js +4 -4
- package/dist/services/triggers/trigger-input.schemas.js.map +1 -1
- package/dist/services/triggers/triggers-output.schemas.d.ts +33 -23
- package/dist/services/triggers/triggers-output.schemas.d.ts.map +1 -1
- package/dist/services/triggers/triggers.js +2 -2
- package/dist/services/vip/vip.js +1 -1
- package/dist/services/vip/vip.schemas.js +1 -1
- package/dist/services/zipper/zipper.js +1 -1
- package/dist/services/zipper/zipper.schemas.d.ts.map +1 -1
- package/dist/services/zipper/zipper.schemas.js +11 -1
- package/dist/services/zipper/zipper.schemas.js.map +1 -1
- package/dist/shared/account-scope.js +4 -1
- package/dist/shared/account-scope.js.map +1 -1
- package/dist/shared/connect-error-mapping.d.ts.map +1 -1
- package/dist/shared/connect-error-mapping.js +3 -0
- package/dist/shared/connect-error-mapping.js.map +1 -1
- package/dist/shared/error-detail.d.ts +5 -0
- package/dist/shared/error-detail.d.ts.map +1 -1
- package/dist/shared/error-detail.js.map +1 -1
- package/dist/shared/error-details/alerts.js +1 -1
- package/dist/shared/error-details/assistant.js +1 -1
- package/dist/shared/error-details/auth.js +8 -3
- package/dist/shared/error-details/auth.js.map +1 -1
- package/dist/shared/error-details/claims.js +1 -1
- package/dist/shared/error-details/internal-transfer.js +1 -1
- package/dist/shared/error-details/ledger.js +1 -1
- package/dist/shared/error-details/market-overview.js +1 -1
- package/dist/shared/error-details/notifications.js +1 -1
- package/dist/shared/error-details/orders.js +1 -1
- package/dist/shared/error-details/profile.js +1 -1
- package/dist/shared/error-details/rate-limit.js +1 -1
- package/dist/shared/error-details/withdraw.js +1 -1
- package/dist/shared/rate-limit.schemas.js +1 -1
- package/dist/utils/cookies.js +1 -1
- package/dist/wired-services.d.ts.map +1 -1
- package/dist/wired-services.js +21 -17
- package/dist/wired-services.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"balances.schemas.js","names":[],"sources":["../../../src/services/balances/balances.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport type * as ProtoLedgerRead from \"../../gen/ledger/read/v1/ledger_read_pb.js\";\nimport { fromU128 } from \"../../utils/u128.js\";\nimport { enumLabel, enumLabelSchema } from \"../../shared/proto-enum-codec.js\";\nimport type { DecodedEnum } from \"../../utils/types.js\";\nimport {\n AccountCodeCodec,\n ACCOUNT_CODE_VALUES,\n type AccountCodeValue,\n} from \"../../shared/ledger-codes.js\";\nimport { E18_SCALE, scaledToDecimalOutput, type SdkScales } from \"../../shared/decimal-surface.js\";\nimport { BalanceRangeCodec, EquityGroupByCodec } from \"./balances.codecs.js\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n} from \"../../shared/account-scope.js\";\nimport { PublicIdSchema, U128Schema } from \"../../shared/schemas.js\";\nimport { PROTOBUF_UINT32_MAX } from \"../../shared/wire-bounds.js\";\nimport { msToTimestamp } from \"../../utils/timestamp.js\";\n\n/**\n * Equity history values are quoted in the response's quote currency at a fixed\n * 4-decimal wire scale (proto: \"Equity in quote currency scaled by 1e4\").\n */\nconst EQUITY_SCALE = 4;\n\n/**\n * Balance history buckets use a fixed 7-decimal scale (proto: \"balance in\n * asset units scaled by 1e7\"), unlike live ledger balances which use E18.\n */\nconst BALANCE_HISTORY_SCALE = 7;\n\n/**\n * AssetBalance u128 fields on the ledger wire are always 18-decimal scaled\n * (PolyesterChain base units), independent of per-asset quantityScale used\n * elsewhere for order quantities and transfer inputs.\n */\nconst LedgerBalanceFieldsSchema = v.object({\n assetId: v.number(),\n trading: v.pipe(v.optional(U128Schema), v.transform(fromU128)),\n funding: v.pipe(v.optional(U128Schema), v.transform(fromU128)),\n reserved: v.pipe(v.optional(U128Schema), v.transform(fromU128)),\n available: v.pipe(v.optional(U128Schema), v.transform(fromU128)),\n tradingRevision: v.pipe(\n v.optional(v.bigint(), 0n),\n v.transform((value) => value.toString()),\n ),\n fundingRevision: v.pipe(\n v.optional(v.bigint(), 0n),\n v.transform((value) => value.toString()),\n ),\n});\n\nfunction toLedgerBalance(b: v.InferOutput<typeof LedgerBalanceFieldsSchema>) {\n return {\n assetId: b.assetId,\n funding: scaledToDecimalOutput(b.funding ?? 0n, E18_SCALE),\n trading: scaledToDecimalOutput(b.trading ?? 0n, E18_SCALE),\n reserved: scaledToDecimalOutput(b.reserved ?? 0n, E18_SCALE),\n available: scaledToDecimalOutput(b.available ?? 0n, E18_SCALE),\n tradingRevision: b.tradingRevision,\n fundingRevision: b.fundingRevision,\n };\n}\n\nexport function createLedgerBalanceSchema() {\n return v.pipe(LedgerBalanceFieldsSchema, v.transform(toLedgerBalance));\n}\n\n/**\n * Converts a `ledger.read.v1.AssetBalance` message to the `LedgerBalance` that `balances.list`\n * returns. Its U128 amounts are always at the 18-decimal ledger scale, whatever the asset's own\n * decimals, so the result needs no catalog.\n */\nexport function formatLedgerBalance(b: ProtoLedgerRead.AssetBalance): LedgerBalance {\n return toLedgerBalance({\n assetId: b.assetId,\n trading: fromU128(b.trading),\n funding: fromU128(b.funding),\n reserved: fromU128(b.reserved),\n available: fromU128(b.available),\n tradingRevision: (b.tradingRevision ?? 0n).toString(),\n fundingRevision: (b.fundingRevision ?? 0n).toString(),\n });\n}\n\nexport type LedgerBalance = v.InferOutput<ReturnType<typeof createLedgerBalanceSchema>>;\n\nexport const BalancesListInputSchema = v.strictObject(AccountScopeInputEntries);\n\nexport type BalancesListInput = v.InferInput<typeof BalancesListInputSchema>;\n\nexport const BALANCE_RANGES = [\"1d\", \"7d\", \"30d\", \"90d\", \"180d\", \"365d\"] as const;\n\nexport const BalanceRangeSchema = v.picklist(BALANCE_RANGES);\n\nexport type BalanceRange = v.InferOutput<typeof BalanceRangeSchema>;\n\nconst BalanceRangeInputSchema = v.pipe(\n BalanceRangeSchema,\n v.transform((value) => BalanceRangeCodec.inputToProto[value]),\n);\n\nexport const EQUITY_GROUP_BYS = [\"account\", \"asset\"] as const;\n\nexport const EquityGroupBySchema = v.picklist(EQUITY_GROUP_BYS);\n\nexport type EquityGroupBy = v.InferOutput<typeof EquityGroupBySchema>;\n\nexport const BalanceHistoryInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n range: BalanceRangeInputSchema,\n ledger: v.optional(\n v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(4_294_967_295)),\n 0,\n ),\n accountCodes: v.optional(\n v.array(\n v.pipe(\n v.picklist(ACCOUNT_CODE_VALUES),\n v.transform((value) => AccountCodeCodec.inputToProto[value]),\n ),\n ),\n [],\n ),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type BalanceHistoryInput = v.InferInput<typeof BalanceHistoryInputSchema>;\n\n/** The longest statement period the server accepts. */\nconst MAX_STATEMENT_PERIOD_MS = 366 * 24 * 60 * 60 * 1000;\n\nconst EpochMsInputSchema = v.pipe(v.number(), v.integer(), v.minValue(0));\n\nexport const ExportStatementInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n /** Period start, inclusive, in epoch milliseconds (UTC). */\n startTime: EpochMsInputSchema,\n /** Period end, exclusive, in epoch milliseconds (UTC); at most 366 days after `startTime`. */\n endTime: EpochMsInputSchema,\n /** Ledger asset ID to cover only that asset; omit or `0` for every asset. */\n assetId: v.optional(\n v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(PROTOBUF_UINT32_MAX)),\n 0,\n ),\n /** Previous `nextPageToken`; reuse only with the same account, asset and period. */\n pageToken: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n }),\n v.check(({ startTime, endTime }) => endTime > startTime, \"endTime must be after startTime.\"),\n v.check(\n ({ startTime, endTime }) => endTime - startTime <= MAX_STATEMENT_PERIOD_MS,\n \"A statement period is at most 366 days.\",\n ),\n v.transform(({ account, startTime, endTime, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n startTime: msToTimestamp(startTime),\n endTime: msToTimestamp(endTime),\n })),\n);\n\nexport type ExportStatementInput = v.InferInput<typeof ExportStatementInputSchema>;\n\n/**\n * One page of an account statement. `csv` is RFC 4180 UTF-8 text with CRLF line endings; only\n * the first page starts with the header row, so concatenating pages in order yields the whole\n * statement. Read columns by header name, since later releases may append columns, and keep\n * amounts as decimal strings. An empty `nextPageToken` means no more pages.\n */\nexport interface StatementPage {\n csv: string;\n nextPageToken: string;\n}\n\nconst BalanceSeriesSchema = v.object({\n assetId: v.number(),\n accountCode: v.number(),\n balanceQ: v.array(v.bigint()),\n});\n\nexport function createBalanceHistoryResponseSchema() {\n return v.pipe(\n v.object({\n range: enumLabelSchema(BalanceRangeCodec.protoToOutput),\n bucket: v.string(),\n startTsSec: v.number(),\n endTsSec: v.number(),\n points: v.number(),\n series: v.array(BalanceSeriesSchema),\n }),\n v.transform((data) => ({\n range: data.range,\n bucket: data.bucket,\n startTsSec: data.startTsSec,\n endTsSec: data.endTsSec,\n points: data.points,\n series: data.series.map((s) => {\n return {\n assetId: s.assetId,\n accountCode: enumLabel(AccountCodeCodec.protoToOutput, s.accountCode),\n balance: s.balanceQ.map((b) => scaledToDecimalOutput(b, BALANCE_HISTORY_SCALE)),\n };\n }),\n })),\n );\n}\n\nexport type BalanceHistoryResponse = v.InferOutput<\n ReturnType<typeof createBalanceHistoryResponseSchema>\n>;\n\nexport const EquityHistoryInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n range: BalanceRangeInputSchema,\n accountCodes: v.optional(\n v.array(\n v.pipe(\n v.picklist(ACCOUNT_CODE_VALUES),\n v.transform((value) => AccountCodeCodec.inputToProto[value]),\n ),\n ),\n [],\n ),\n groupBy: v.pipe(\n v.optional(EquityGroupBySchema, \"account\"),\n v.transform((v) => EquityGroupByCodec.inputToProto[v ?? \"account\"]),\n ),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type EquityHistoryInput = v.InferInput<typeof EquityHistoryInputSchema>;\n\nexport const PortfolioEquityHistoryInputSchema = v.strictObject({\n range: BalanceRangeInputSchema,\n});\n\nexport type PortfolioEquityHistoryInput = v.InferInput<typeof PortfolioEquityHistoryInputSchema>;\n\nconst EquitySeriesGroupingSchema = v.union([\n v.object({\n case: v.literal(\"account\"),\n value: v.object({\n accountCode: v.number(),\n name: v.string(),\n }),\n }),\n v.object({\n case: v.literal(\"asset\"),\n value: v.object({\n id: v.number(),\n symbol: v.string(),\n }),\n }),\n]);\n\nexport type EquitySeriesGrouping =\n | {\n type: \"account\";\n accountCode: DecodedEnum<AccountCodeValue>;\n name: string;\n }\n | {\n type: \"asset\";\n assetId: number;\n symbol: string;\n };\n\nexport const EquitySeriesSchema = v.pipe(\n v.object({\n grouping: EquitySeriesGroupingSchema,\n equityQ: v.array(v.bigint()),\n }),\n v.transform((series): { grouping: EquitySeriesGrouping; equity: string[] } => {\n const equity = series.equityQ.map((value) => scaledToDecimalOutput(value, EQUITY_SCALE));\n if (series.grouping.case === \"account\") {\n return {\n grouping: {\n type: \"account\",\n accountCode: enumLabel(\n AccountCodeCodec.protoToOutput,\n series.grouping.value.accountCode,\n ),\n name: series.grouping.value.name,\n },\n equity,\n };\n }\n\n return {\n grouping: {\n type: \"asset\",\n assetId: series.grouping.value.id,\n symbol: series.grouping.value.symbol,\n },\n equity,\n };\n }),\n);\n\nexport function createEquityHistoryResponseSchema(scales: SdkScales) {\n return v.pipe(\n v.object({\n range: enumLabelSchema(BalanceRangeCodec.protoToOutput),\n bucket: v.string(),\n startTsSec: v.number(),\n endTsSec: v.number(),\n quoteAsset: v.string(),\n points: v.number(),\n series: v.array(EquitySeriesSchema),\n btcPricesQ: v.optional(v.array(v.bigint()), []),\n }),\n v.transform((data) => ({\n range: data.range,\n bucket: data.bucket,\n startTsSec: data.startTsSec,\n endTsSec: data.endTsSec,\n quoteAsset: data.quoteAsset,\n points: data.points,\n series: data.series,\n // BTC price in USDT at each timestamp, carried as price ticks on the wire.\n btcPrices: data.btcPricesQ.map((value) => scaledToDecimalOutput(value, scales.price())),\n })),\n );\n}\n\nexport type EquitySeries = v.InferOutput<typeof EquitySeriesSchema>;\nexport type EquityHistoryResponse = v.InferOutput<\n ReturnType<typeof createEquityHistoryResponseSchema>\n>;\n\nconst PortfolioAccountGroupingSchema = v.variant(\"remaining\", [\n v.object({\n accountId: PublicIdSchema,\n remaining: v.literal(false),\n }),\n v.object({\n accountId: v.optional(v.never()),\n remaining: v.literal(true),\n }),\n]);\n\nexport type PortfolioEquitySeriesGrouping =\n | { type: \"portfolioAccount\"; accountId: string; remaining: false }\n | { type: \"portfolioAccount\"; accountId?: never; remaining: true };\n\nexport const PortfolioEquitySeriesSchema = v.pipe(\n v.object({\n grouping: v.object({\n case: v.literal(\"portfolioAccount\"),\n value: PortfolioAccountGroupingSchema,\n }),\n equityQ: v.array(v.bigint()),\n }),\n v.transform((series): { grouping: PortfolioEquitySeriesGrouping; equity: string[] } => ({\n grouping: series.grouping.value.remaining\n ? { type: \"portfolioAccount\", remaining: true }\n : {\n type: \"portfolioAccount\",\n accountId: series.grouping.value.accountId,\n remaining: false,\n },\n equity: series.equityQ.map((value) => scaledToDecimalOutput(value, EQUITY_SCALE)),\n })),\n);\n\nexport function createPortfolioEquityHistoryResponseSchema(scales: SdkScales) {\n return v.pipe(\n v.object({\n range: enumLabelSchema(BalanceRangeCodec.protoToOutput),\n bucket: v.string(),\n startTsSec: v.number(),\n endTsSec: v.number(),\n quoteAsset: v.string(),\n points: v.number(),\n series: v.array(PortfolioEquitySeriesSchema),\n btcPricesQ: v.optional(v.array(v.bigint()), []),\n }),\n v.transform((data) => ({\n range: data.range,\n bucket: data.bucket,\n startTsSec: data.startTsSec,\n endTsSec: data.endTsSec,\n quoteAsset: data.quoteAsset,\n points: data.points,\n series: data.series,\n btcPrices: data.btcPricesQ.map((value) => scaledToDecimalOutput(value, scales.price())),\n })),\n );\n}\n\nexport type PortfolioEquitySeries = v.InferOutput<typeof PortfolioEquitySeriesSchema>;\nexport type PortfolioEquityHistoryResponse = v.InferOutput<\n ReturnType<typeof createPortfolioEquityHistoryResponseSchema>\n>;\n\nconst PortfolioAccountEquitySchema = v.pipe(\n v.object({\n accountId: PublicIdSchema,\n equityQ: v.bigint(),\n topAssetIds: v.array(v.number()),\n }),\n v.transform((account) => ({\n accountId: account.accountId,\n equity: scaledToDecimalOutput(account.equityQ, EQUITY_SCALE),\n topAssetIds: account.topAssetIds,\n })),\n);\n\nconst PortfolioAssetEquitySchema = v.pipe(\n v.object({\n assetId: v.number(),\n balanceQ: v.bigint(),\n equityQ: v.bigint(),\n }),\n v.transform((asset) => ({\n assetId: asset.assetId,\n balance: scaledToDecimalOutput(asset.balanceQ, BALANCE_HISTORY_SCALE),\n equity: scaledToDecimalOutput(asset.equityQ, EQUITY_SCALE),\n })),\n);\n\nexport function createPortfolioEquitySnapshotResponseSchema(scales: SdkScales) {\n return v.pipe(\n v.object({\n quoteAsset: v.string(),\n totalEquityQ: v.bigint(),\n accounts: v.array(PortfolioAccountEquitySchema),\n assets: v.array(PortfolioAssetEquitySchema),\n btcPriceQ: v.bigint(),\n }),\n v.transform((snapshot) => ({\n quoteAsset: snapshot.quoteAsset,\n totalEquity: scaledToDecimalOutput(snapshot.totalEquityQ, EQUITY_SCALE),\n accounts: snapshot.accounts,\n assets: snapshot.assets,\n btcPrice: scaledToDecimalOutput(snapshot.btcPriceQ, scales.price()),\n })),\n );\n}\n\nexport type PortfolioEquitySnapshotResponse = v.InferOutput<\n ReturnType<typeof createPortfolioEquitySnapshotResponseSchema>\n>;\n"],"mappings":";;;;;;;;;;;;;;;AAwBA,MAAM,eAAe;;;;;AAMrB,MAAM,wBAAwB;;;;;;AAO9B,MAAM,4BAA4B,EAAE,OAAO;CACvC,SAAS,EAAE,OAAO;CAClB,SAAS,EAAE,KAAK,EAAE,SAAS,UAAU,GAAG,EAAE,UAAU,QAAQ,CAAC;CAC7D,SAAS,EAAE,KAAK,EAAE,SAAS,UAAU,GAAG,EAAE,UAAU,QAAQ,CAAC;CAC7D,UAAU,EAAE,KAAK,EAAE,SAAS,UAAU,GAAG,EAAE,UAAU,QAAQ,CAAC;CAC9D,WAAW,EAAE,KAAK,EAAE,SAAS,UAAU,GAAG,EAAE,UAAU,QAAQ,CAAC;CAC/D,iBAAiB,EAAE,KACf,EAAE,SAAS,EAAE,OAAO,GAAG,EAAE,GACzB,EAAE,WAAW,UAAU,MAAM,SAAS,CAAC,CAC3C;CACA,iBAAiB,EAAE,KACf,EAAE,SAAS,EAAE,OAAO,GAAG,EAAE,GACzB,EAAE,WAAW,UAAU,MAAM,SAAS,CAAC,CAC3C;AACJ,CAAC;AAED,SAAS,gBAAgB,GAAoD;CACzE,OAAO;EACH,SAAS,EAAE;EACX,SAAS,sBAAsB,EAAE,WAAW,IAAA,EAAa;EACzD,SAAS,sBAAsB,EAAE,WAAW,IAAA,EAAa;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nB,SAAS,EAAE,OAAO;AACtB,CAAC,GACD,EAAE,WAAW,WAAW;CACpB,SAAS,MAAM;CACf,SAAS,sBAAsB,MAAM,UAAU,qBAAqB;CACpE,QAAQ,sBAAsB,MAAM,SAAS,YAAY;AAC7D,EAAE,CACN;AAEA,SAAgB,4CAA4C,QAAmB;CAC3E,OAAO,EAAE,KACL,EAAE,OAAO;EACL,YAAY,EAAE,OAAO;EACrB,cAAc,EAAE,OAAO;EACvB,UAAU,EAAE,MAAM,4BAA4B;EAC9C,QAAQ,EAAE,MAAM,0BAA0B;EAC1C,WAAW,EAAE,OAAO;CACxB,CAAC,GACD,EAAE,WAAW,cAAc;EACvB,YAAY,SAAS;EACrB,aAAa,sBAAsB,SAAS,cAAc,YAAY;EACtE,UAAU,SAAS;EACnB,QAAQ,SAAS;EACjB,UAAU,sBAAsB,SAAS,WAAW,OAAO,MAAM,CAAC;CACtE,EAAE,CACN;AACJ"}
|
|
1
|
+
{"version":3,"file":"balances.schemas.js","names":[],"sources":["../../../src/services/balances/balances.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport type * as ProtoLedgerRead from \"../../gen/ledger/read/v1/ledger_read_pb.js\";\nimport { fromU128 } from \"../../utils/u128.js\";\nimport { enumLabel, enumLabelSchema } from \"../../shared/proto-enum-codec.js\";\nimport type { DecodedEnum } from \"../../utils/types.js\";\nimport {\n AccountCodeCodec,\n ACCOUNT_CODE_VALUES,\n type AccountCodeValue,\n} from \"../../shared/ledger-codes.js\";\nimport { E18_SCALE, scaledToDecimalOutput, type SdkScales } from \"../../shared/decimal-surface.js\";\nimport { BalanceRangeCodec, EquityGroupByCodec } from \"./balances.codecs.js\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n} from \"../../shared/account-scope.js\";\nimport { PublicIdSchema, U128Schema } from \"../../shared/schemas.js\";\nimport { PROTOBUF_UINT32_MAX } from \"../../shared/wire-bounds.js\";\nimport { msToTimestamp } from \"../../utils/timestamp.js\";\n\n/**\n * Equity history values are quoted in the response's quote currency at a fixed\n * 4-decimal wire scale (proto: \"Equity in quote currency scaled by 1e4\").\n */\nconst EQUITY_SCALE = 4;\n\n/**\n * AssetBalance u128 fields on the ledger wire are always 18-decimal scaled\n * (PolyesterChain base units), independent of per-asset quantityScale used\n * elsewhere for order quantities and transfer inputs.\n */\nconst LedgerBalanceFieldsSchema = v.object({\n assetId: v.number(),\n trading: v.pipe(v.optional(U128Schema), v.transform(fromU128)),\n funding: v.pipe(v.optional(U128Schema), v.transform(fromU128)),\n reserved: v.pipe(v.optional(U128Schema), v.transform(fromU128)),\n available: v.pipe(v.optional(U128Schema), v.transform(fromU128)),\n tradingRevision: v.pipe(\n v.optional(v.bigint(), 0n),\n v.transform((value) => value.toString()),\n ),\n fundingRevision: v.pipe(\n v.optional(v.bigint(), 0n),\n v.transform((value) => value.toString()),\n ),\n});\n\nfunction toLedgerBalance(b: v.InferOutput<typeof LedgerBalanceFieldsSchema>) {\n return {\n assetId: b.assetId,\n funding: scaledToDecimalOutput(b.funding ?? 0n, E18_SCALE),\n trading: scaledToDecimalOutput(b.trading ?? 0n, E18_SCALE),\n reserved: scaledToDecimalOutput(b.reserved ?? 0n, E18_SCALE),\n available: scaledToDecimalOutput(b.available ?? 0n, E18_SCALE),\n tradingRevision: b.tradingRevision,\n fundingRevision: b.fundingRevision,\n };\n}\n\nexport function createLedgerBalanceSchema() {\n return v.pipe(LedgerBalanceFieldsSchema, v.transform(toLedgerBalance));\n}\n\n/**\n * Converts a `ledger.read.v1.AssetBalance` message to the `LedgerBalance` that `balances.list`\n * returns. Its U128 amounts are always at the 18-decimal ledger scale, whatever the asset's own\n * decimals, so the result needs no catalog.\n */\nexport function formatLedgerBalance(b: ProtoLedgerRead.AssetBalance): LedgerBalance {\n return toLedgerBalance({\n assetId: b.assetId,\n trading: fromU128(b.trading),\n funding: fromU128(b.funding),\n reserved: fromU128(b.reserved),\n available: fromU128(b.available),\n tradingRevision: (b.tradingRevision ?? 0n).toString(),\n fundingRevision: (b.fundingRevision ?? 0n).toString(),\n });\n}\n\nexport type LedgerBalance = v.InferOutput<ReturnType<typeof createLedgerBalanceSchema>>;\n\nexport const BalancesListInputSchema = v.strictObject(AccountScopeInputEntries);\n\nexport type BalancesListInput = v.InferInput<typeof BalancesListInputSchema>;\n\nexport const BALANCE_RANGES = [\"1d\", \"7d\", \"30d\", \"90d\", \"180d\", \"365d\"] as const;\n\nexport const BalanceRangeSchema = v.picklist(BALANCE_RANGES);\n\nexport type BalanceRange = v.InferOutput<typeof BalanceRangeSchema>;\n\nconst BalanceRangeInputSchema = v.pipe(\n BalanceRangeSchema,\n v.transform((value) => BalanceRangeCodec.inputToProto[value]),\n);\n\nexport const EQUITY_GROUP_BYS = [\"account\", \"asset\"] as const;\n\nexport const EquityGroupBySchema = v.picklist(EQUITY_GROUP_BYS);\n\nexport type EquityGroupBy = v.InferOutput<typeof EquityGroupBySchema>;\n\nexport const BalanceHistoryInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n range: BalanceRangeInputSchema,\n ledger: v.optional(\n v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(4_294_967_295)),\n 0,\n ),\n accountCodes: v.optional(\n v.array(\n v.pipe(\n v.picklist(ACCOUNT_CODE_VALUES),\n v.transform((value) => AccountCodeCodec.inputToProto[value]),\n ),\n ),\n [],\n ),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type BalanceHistoryInput = v.InferInput<typeof BalanceHistoryInputSchema>;\n\n/** The longest statement period the server accepts. */\nconst MAX_STATEMENT_PERIOD_MS = 366 * 24 * 60 * 60 * 1000;\n\nconst EpochMsInputSchema = v.pipe(v.number(), v.integer(), v.minValue(0));\n\nexport const ExportStatementInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n /** Period start, inclusive, in epoch milliseconds (UTC). */\n startTime: EpochMsInputSchema,\n /** Period end, exclusive, in epoch milliseconds (UTC); at most 366 days after `startTime`. */\n endTime: EpochMsInputSchema,\n /** Ledger asset ID to cover only that asset; omit or `0` for every asset. */\n assetId: v.optional(\n v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(PROTOBUF_UINT32_MAX)),\n 0,\n ),\n /** Previous `nextPageToken`; reuse only with the same account, asset and period. */\n pageToken: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n }),\n v.check(({ startTime, endTime }) => endTime > startTime, \"endTime must be after startTime.\"),\n v.check(\n ({ startTime, endTime }) => endTime - startTime <= MAX_STATEMENT_PERIOD_MS,\n \"A statement period is at most 366 days.\",\n ),\n v.transform(({ account, startTime, endTime, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n startTime: msToTimestamp(startTime),\n endTime: msToTimestamp(endTime),\n })),\n);\n\nexport type ExportStatementInput = v.InferInput<typeof ExportStatementInputSchema>;\n\n/**\n * One page of an account statement. `csv` is RFC 4180 UTF-8 text with CRLF line endings; only\n * the first page starts with the header row, so concatenating pages in order yields the whole\n * statement. Read columns by header name, since later releases may append columns, and keep\n * amounts as decimal strings. An empty `nextPageToken` means no more pages.\n */\nexport interface StatementPage {\n csv: string;\n nextPageToken: string;\n /**\n * The statement covers movements up to this time (epoch ms, exclusive): the earliest of\n * `endTime`, the first page's request time and the time account history is complete\n * through. Every page carries the same value. Before `endTime`, the statement is partial:\n * the rest appears in a statement requested later.\n */\n completeThrough: number | undefined;\n}\n\n/** A whole account statement: every page's CSV and the time it is complete through. */\nexport interface Statement {\n csv: string;\n completeThrough: number | undefined;\n}\n\nconst BalanceSeriesSchema = v.object({\n assetId: v.number(),\n accountCode: v.number(),\n /** One exact 18-decimal U128 balance per point, like live ledger balances. */\n balance: v.array(U128Schema),\n});\n\nexport function createBalanceHistoryResponseSchema() {\n return v.pipe(\n v.object({\n range: enumLabelSchema(BalanceRangeCodec.protoToOutput),\n bucket: v.string(),\n startTsSec: v.number(),\n endTsSec: v.number(),\n points: v.number(),\n series: v.array(BalanceSeriesSchema),\n }),\n v.transform((data) => ({\n range: data.range,\n bucket: data.bucket,\n startTsSec: data.startTsSec,\n endTsSec: data.endTsSec,\n points: data.points,\n series: data.series.map((s) => {\n return {\n assetId: s.assetId,\n accountCode: enumLabel(AccountCodeCodec.protoToOutput, s.accountCode),\n balance: s.balance.map((b) => scaledToDecimalOutput(fromU128(b), E18_SCALE)),\n };\n }),\n })),\n );\n}\n\nexport type BalanceHistoryResponse = v.InferOutput<\n ReturnType<typeof createBalanceHistoryResponseSchema>\n>;\n\nexport const EquityHistoryInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n range: BalanceRangeInputSchema,\n accountCodes: v.optional(\n v.array(\n v.pipe(\n v.picklist(ACCOUNT_CODE_VALUES),\n v.transform((value) => AccountCodeCodec.inputToProto[value]),\n ),\n ),\n [],\n ),\n groupBy: v.pipe(\n v.optional(EquityGroupBySchema, \"account\"),\n v.transform((v) => EquityGroupByCodec.inputToProto[v ?? \"account\"]),\n ),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type EquityHistoryInput = v.InferInput<typeof EquityHistoryInputSchema>;\n\nexport const PortfolioEquityHistoryInputSchema = v.strictObject({\n range: BalanceRangeInputSchema,\n});\n\nexport type PortfolioEquityHistoryInput = v.InferInput<typeof PortfolioEquityHistoryInputSchema>;\n\nconst EquitySeriesGroupingSchema = v.union([\n v.object({\n case: v.literal(\"account\"),\n value: v.object({\n accountCode: v.number(),\n name: v.string(),\n }),\n }),\n v.object({\n case: v.literal(\"asset\"),\n value: v.object({\n id: v.number(),\n symbol: v.string(),\n }),\n }),\n]);\n\nexport type EquitySeriesGrouping =\n | {\n type: \"account\";\n accountCode: DecodedEnum<AccountCodeValue>;\n name: string;\n }\n | {\n type: \"asset\";\n assetId: number;\n symbol: string;\n };\n\nexport const EquitySeriesSchema = v.pipe(\n v.object({\n grouping: EquitySeriesGroupingSchema,\n equityQ: v.array(v.bigint()),\n }),\n v.transform((series): { grouping: EquitySeriesGrouping; equity: string[] } => {\n const equity = series.equityQ.map((value) => scaledToDecimalOutput(value, EQUITY_SCALE));\n if (series.grouping.case === \"account\") {\n return {\n grouping: {\n type: \"account\",\n accountCode: enumLabel(\n AccountCodeCodec.protoToOutput,\n series.grouping.value.accountCode,\n ),\n name: series.grouping.value.name,\n },\n equity,\n };\n }\n\n return {\n grouping: {\n type: \"asset\",\n assetId: series.grouping.value.id,\n symbol: series.grouping.value.symbol,\n },\n equity,\n };\n }),\n);\n\nexport function createEquityHistoryResponseSchema(scales: SdkScales) {\n return v.pipe(\n v.object({\n range: enumLabelSchema(BalanceRangeCodec.protoToOutput),\n bucket: v.string(),\n startTsSec: v.number(),\n endTsSec: v.number(),\n quoteAsset: v.string(),\n points: v.number(),\n series: v.array(EquitySeriesSchema),\n btcPricesQ: v.optional(v.array(v.bigint()), []),\n }),\n v.transform((data) => ({\n range: data.range,\n bucket: data.bucket,\n startTsSec: data.startTsSec,\n endTsSec: data.endTsSec,\n quoteAsset: data.quoteAsset,\n points: data.points,\n series: data.series,\n // BTC price in USDT at each timestamp, carried as price ticks on the wire.\n btcPrices: data.btcPricesQ.map((value) => scaledToDecimalOutput(value, scales.price())),\n })),\n );\n}\n\nexport type EquitySeries = v.InferOutput<typeof EquitySeriesSchema>;\nexport type EquityHistoryResponse = v.InferOutput<\n ReturnType<typeof createEquityHistoryResponseSchema>\n>;\n\nconst PortfolioAccountGroupingSchema = v.variant(\"remaining\", [\n v.object({\n accountId: PublicIdSchema,\n remaining: v.literal(false),\n }),\n v.object({\n accountId: v.optional(v.never()),\n remaining: v.literal(true),\n }),\n]);\n\nexport type PortfolioEquitySeriesGrouping =\n | { type: \"portfolioAccount\"; accountId: string; remaining: false }\n | { type: \"portfolioAccount\"; accountId?: never; remaining: true };\n\nexport const PortfolioEquitySeriesSchema = v.pipe(\n v.object({\n grouping: v.object({\n case: v.literal(\"portfolioAccount\"),\n value: PortfolioAccountGroupingSchema,\n }),\n equityQ: v.array(v.bigint()),\n }),\n v.transform((series): { grouping: PortfolioEquitySeriesGrouping; equity: string[] } => ({\n grouping: series.grouping.value.remaining\n ? { type: \"portfolioAccount\", remaining: true }\n : {\n type: \"portfolioAccount\",\n accountId: series.grouping.value.accountId,\n remaining: false,\n },\n equity: series.equityQ.map((value) => scaledToDecimalOutput(value, EQUITY_SCALE)),\n })),\n);\n\nexport function createPortfolioEquityHistoryResponseSchema(scales: SdkScales) {\n return v.pipe(\n v.object({\n range: enumLabelSchema(BalanceRangeCodec.protoToOutput),\n bucket: v.string(),\n startTsSec: v.number(),\n endTsSec: v.number(),\n quoteAsset: v.string(),\n points: v.number(),\n series: v.array(PortfolioEquitySeriesSchema),\n btcPricesQ: v.optional(v.array(v.bigint()), []),\n }),\n v.transform((data) => ({\n range: data.range,\n bucket: data.bucket,\n startTsSec: data.startTsSec,\n endTsSec: data.endTsSec,\n quoteAsset: data.quoteAsset,\n points: data.points,\n series: data.series,\n btcPrices: data.btcPricesQ.map((value) => scaledToDecimalOutput(value, scales.price())),\n })),\n );\n}\n\nexport type PortfolioEquitySeries = v.InferOutput<typeof PortfolioEquitySeriesSchema>;\nexport type PortfolioEquityHistoryResponse = v.InferOutput<\n ReturnType<typeof createPortfolioEquityHistoryResponseSchema>\n>;\n\nconst PortfolioAccountEquitySchema = v.pipe(\n v.object({\n accountId: PublicIdSchema,\n equityQ: v.bigint(),\n topAssetIds: v.array(v.number()),\n }),\n v.transform((account) => ({\n accountId: account.accountId,\n equity: scaledToDecimalOutput(account.equityQ, EQUITY_SCALE),\n topAssetIds: account.topAssetIds,\n })),\n);\n\nconst PortfolioAssetEquitySchema = v.pipe(\n v.object({\n assetId: v.number(),\n balance: v.optional(U128Schema),\n equityQ: v.bigint(),\n }),\n v.transform((asset) => ({\n assetId: asset.assetId,\n balance: scaledToDecimalOutput(fromU128(asset.balance), E18_SCALE),\n equity: scaledToDecimalOutput(asset.equityQ, EQUITY_SCALE),\n })),\n);\n\nexport function createPortfolioEquitySnapshotResponseSchema(scales: SdkScales) {\n return v.pipe(\n v.object({\n quoteAsset: v.string(),\n totalEquityQ: v.bigint(),\n accounts: v.array(PortfolioAccountEquitySchema),\n assets: v.array(PortfolioAssetEquitySchema),\n btcPriceQ: v.bigint(),\n }),\n v.transform((snapshot) => ({\n quoteAsset: snapshot.quoteAsset,\n totalEquity: scaledToDecimalOutput(snapshot.totalEquityQ, EQUITY_SCALE),\n accounts: snapshot.accounts,\n assets: snapshot.assets,\n btcPrice: scaledToDecimalOutput(snapshot.btcPriceQ, scales.price()),\n })),\n );\n}\n\nexport type PortfolioEquitySnapshotResponse = v.InferOutput<\n ReturnType<typeof createPortfolioEquitySnapshotResponseSchema>\n>;\n"],"mappings":";;;;;;;;;;;;;;;AAwBA,MAAM,eAAe;;;;;;AAOrB,MAAM,4BAA4B,EAAE,OAAO;CACvC,SAAS,EAAE,OAAO;CAClB,SAAS,EAAE,KAAK,EAAE,SAAS,UAAU,GAAG,EAAE,UAAU,QAAQ,CAAC;CAC7D,SAAS,EAAE,KAAK,EAAE,SAAS,UAAU,GAAG,EAAE,UAAU,QAAQ,CAAC;CAC7D,UAAU,EAAE,KAAK,EAAE,SAAS,UAAU,GAAG,EAAE,UAAU,QAAQ,CAAC;CAC9D,WAAW,EAAE,KAAK,EAAE,SAAS,UAAU,GAAG,EAAE,UAAU,QAAQ,CAAC;CAC/D,iBAAiB,EAAE,KACf,EAAE,SAAS,EAAE,OAAO,GAAG,EAAE,GACzB,EAAE,WAAW,UAAU,MAAM,SAAS,CAAC,CAC3C;CACA,iBAAiB,EAAE,KACf,EAAE,SAAS,EAAE,OAAO,GAAG,EAAE,GACzB,EAAE,WAAW,UAAU,MAAM,SAAS,CAAC,CAC3C;AACJ,CAAC;AAED,SAAS,gBAAgB,GAAoD;CACzE,OAAO;EACH,SAAS,EAAE;EACX,SAAS,sBAAsB,EAAE,WAAW,IAAA,EAAa;EACzD,SAAS,sBAAsB,EAAE,WAA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AAS,EAAE,SAAS,UAAU;CAC9B,SAAS,EAAE,OAAO;AACtB,CAAC,GACD,EAAE,WAAW,WAAW;CACpB,SAAS,MAAM;CACf,SAAS,sBAAsB,SAAS,MAAM,OAAO,GAAA,EAAY;CACjE,QAAQ,sBAAsB,MAAM,SAAS,YAAY;AAC7D,EAAE,CACN;AAEA,SAAgB,4CAA4C,QAAmB;CAC3E,OAAO,EAAE,KACL,EAAE,OAAO;EACL,YAAY,EAAE,OAAO;EACrB,cAAc,EAAE,OAAO;EACvB,UAAU,EAAE,MAAM,4BAA4B;EAC9C,QAAQ,EAAE,MAAM,0BAA0B;EAC1C,WAAW,EAAE,OAAO;CACxB,CAAC,GACD,EAAE,WAAW,cAAc;EACvB,YAAY,SAAS;EACrB,aAAa,sBAAsB,SAAS,cAAc,YAAY;EACtE,UAAU,SAAS;EACnB,QAAQ,SAAS;EACjB,UAAU,sBAAsB,SAAS,WAAW,OAAO,MAAM,CAAC;CACtE,EAAE,CACN;AACJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { BalanceHistoryInput, BalanceHistoryResponse, BalanceRange, EquityGroupBy, EquityHistoryInput, EquityHistoryResponse, EquitySeries, EquitySeriesGrouping, ExportStatementInput, LedgerBalance, PortfolioEquityHistoryInput, PortfolioEquityHistoryResponse, PortfolioEquitySeries, PortfolioEquitySeriesGrouping, PortfolioEquitySnapshotResponse, StatementPage } from "./balances.schemas.js";
|
|
2
|
-
export type { BalanceHistoryInput, BalanceHistoryResponse, BalanceRange, EquityGroupBy, EquityHistoryInput, EquityHistoryResponse, EquitySeries, EquitySeriesGrouping, ExportStatementInput, LedgerBalance, PortfolioEquityHistoryInput, PortfolioEquityHistoryResponse, PortfolioEquitySeries, PortfolioEquitySeriesGrouping, PortfolioEquitySnapshotResponse, StatementPage };
|
|
1
|
+
import { BalanceHistoryInput, BalanceHistoryResponse, BalanceRange, EquityGroupBy, EquityHistoryInput, EquityHistoryResponse, EquitySeries, EquitySeriesGrouping, ExportStatementInput, LedgerBalance, PortfolioEquityHistoryInput, PortfolioEquityHistoryResponse, PortfolioEquitySeries, PortfolioEquitySeriesGrouping, PortfolioEquitySnapshotResponse, Statement, StatementPage } from "./balances.schemas.js";
|
|
2
|
+
export type { BalanceHistoryInput, BalanceHistoryResponse, BalanceRange, EquityGroupBy, EquityHistoryInput, EquityHistoryResponse, EquitySeries, EquitySeriesGrouping, ExportStatementInput, LedgerBalance, PortfolioEquityHistoryInput, PortfolioEquityHistoryResponse, PortfolioEquitySeries, PortfolioEquitySeriesGrouping, PortfolioEquitySnapshotResponse, Statement, StatementPage };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { CandlePointSchema, MarketDataService } from "../../gen/marketdata/v1/marketdata_pb.js";
|
|
2
1
|
import { parse } from "../../shared/validation.js";
|
|
3
2
|
import { toConnectCallOptions } from "../../shared/request-options.js";
|
|
4
3
|
import { SymbolIdInputSchema } from "../shared.js";
|
|
4
|
+
import { CandlePointSchema, MarketDataService } from "../../gen/marketdata/v1/marketdata_pb.js";
|
|
5
5
|
import { TimeframeCodec } from "./candles.codecs.js";
|
|
6
6
|
import { ListCandlesInputSchema, TimeframeSchema, createCandleColumnarIntSchema, createCandleColumnarSchema, formatCandleRow } from "./candles.schemas.js";
|
|
7
7
|
import { connectReadyGatedProtoChannel } from "../../realtime/ready-gated-subscription.js";
|
|
8
|
-
import * as v from "valibot";
|
|
9
8
|
import { createClient } from "@connectrpc/connect";
|
|
9
|
+
import * as v from "valibot";
|
|
10
10
|
//#region src/services/candles/candles.ts
|
|
11
11
|
const SubscribeCandlesParamsSchema = v.object({
|
|
12
12
|
symbolId: SymbolIdInputSchema,
|
|
@@ -11,7 +11,7 @@ type TimestampInit = {
|
|
|
11
11
|
};
|
|
12
12
|
declare function createCandleRowSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
13
13
|
readonly symbolId: v.NumberSchema<undefined>;
|
|
14
|
-
readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"
|
|
14
|
+
readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1s" | "1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "8h" | "12h" | "1d" | "3d" | "1w" | "1mo">>]>;
|
|
15
15
|
readonly tsSec: v.BigintSchema<undefined>;
|
|
16
16
|
readonly open: v.BigintSchema<undefined>;
|
|
17
17
|
readonly high: v.BigintSchema<undefined>;
|
|
@@ -22,7 +22,7 @@ declare function createCandleRowSchema(scales: SdkScales): v.SchemaWithPipe<read
|
|
|
22
22
|
readonly isClosed: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
23
23
|
}, undefined>, v.TransformAction<{
|
|
24
24
|
symbolId: number;
|
|
25
|
-
timeframe: DecodedEnum<"
|
|
25
|
+
timeframe: DecodedEnum<"1s" | "1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "8h" | "12h" | "1d" | "3d" | "1w" | "1mo">;
|
|
26
26
|
tsSec: bigint;
|
|
27
27
|
open: bigint;
|
|
28
28
|
high: bigint;
|
|
@@ -33,7 +33,7 @@ declare function createCandleRowSchema(scales: SdkScales): v.SchemaWithPipe<read
|
|
|
33
33
|
isClosed: boolean;
|
|
34
34
|
}, {
|
|
35
35
|
symbolId: number;
|
|
36
|
-
timeframe: DecodedEnum<"
|
|
36
|
+
timeframe: DecodedEnum<"1s" | "1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "8h" | "12h" | "1d" | "3d" | "1w" | "1mo">;
|
|
37
37
|
time: number;
|
|
38
38
|
open: string;
|
|
39
39
|
high: string;
|
|
@@ -46,7 +46,7 @@ declare function createCandleRowSchema(scales: SdkScales): v.SchemaWithPipe<read
|
|
|
46
46
|
declare const createCandleRowIntSchema: typeof createCandleRowSchema;
|
|
47
47
|
declare function createCandleColumnarSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
48
48
|
readonly symbolId: v.NumberSchema<undefined>;
|
|
49
|
-
readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"
|
|
49
|
+
readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1s" | "1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "8h" | "12h" | "1d" | "3d" | "1w" | "1mo">>]>;
|
|
50
50
|
readonly tsSec: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
|
|
51
51
|
readonly open: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
|
|
52
52
|
readonly high: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
|
|
@@ -63,7 +63,7 @@ declare function createCandleColumnarSchema(scales: SdkScales): v.SchemaWithPipe
|
|
|
63
63
|
readonly nextPageToken: v.OptionalSchema<v.StringSchema<undefined>, "">;
|
|
64
64
|
}, undefined>, v.TransformAction<{
|
|
65
65
|
symbolId: number;
|
|
66
|
-
timeframe: DecodedEnum<"
|
|
66
|
+
timeframe: DecodedEnum<"1s" | "1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "8h" | "12h" | "1d" | "3d" | "1w" | "1mo">;
|
|
67
67
|
tsSec: bigint[];
|
|
68
68
|
open: bigint[];
|
|
69
69
|
high: bigint[];
|
|
@@ -80,7 +80,7 @@ declare function createCandleColumnarSchema(scales: SdkScales): v.SchemaWithPipe
|
|
|
80
80
|
nextPageToken: string;
|
|
81
81
|
}, {
|
|
82
82
|
symbolId: number;
|
|
83
|
-
timeframe: DecodedEnum<"
|
|
83
|
+
timeframe: DecodedEnum<"1s" | "1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "8h" | "12h" | "1d" | "3d" | "1w" | "1mo">;
|
|
84
84
|
time: number[];
|
|
85
85
|
open: string[];
|
|
86
86
|
high: string[];
|
|
@@ -100,7 +100,7 @@ declare function createCandleColumnarSchema(scales: SdkScales): v.SchemaWithPipe
|
|
|
100
100
|
}>]>;
|
|
101
101
|
declare function createCandleColumnarIntSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
102
102
|
readonly symbolId: v.NumberSchema<undefined>;
|
|
103
|
-
readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"
|
|
103
|
+
readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1s" | "1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "8h" | "12h" | "1d" | "3d" | "1w" | "1mo">>]>;
|
|
104
104
|
readonly tsSec: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
|
|
105
105
|
readonly open: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
|
|
106
106
|
readonly high: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
|
|
@@ -117,7 +117,7 @@ declare function createCandleColumnarIntSchema(scales: SdkScales): v.SchemaWithP
|
|
|
117
117
|
readonly nextPageToken: v.OptionalSchema<v.StringSchema<undefined>, "">;
|
|
118
118
|
}, undefined>, v.TransformAction<{
|
|
119
119
|
symbolId: number;
|
|
120
|
-
timeframe: DecodedEnum<"
|
|
120
|
+
timeframe: DecodedEnum<"1s" | "1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "8h" | "12h" | "1d" | "3d" | "1w" | "1mo">;
|
|
121
121
|
tsSec: bigint[];
|
|
122
122
|
open: bigint[];
|
|
123
123
|
high: bigint[];
|
|
@@ -134,7 +134,7 @@ declare function createCandleColumnarIntSchema(scales: SdkScales): v.SchemaWithP
|
|
|
134
134
|
nextPageToken: string;
|
|
135
135
|
}, {
|
|
136
136
|
symbolId: number;
|
|
137
|
-
timeframe: DecodedEnum<"
|
|
137
|
+
timeframe: DecodedEnum<"1s" | "1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "8h" | "12h" | "1d" | "3d" | "1w" | "1mo">;
|
|
138
138
|
tsSec: number[];
|
|
139
139
|
open: string[];
|
|
140
140
|
high: string[];
|
|
@@ -158,7 +158,7 @@ type CandleColumnar = v.InferOutput<ReturnType<typeof createCandleColumnarSchema
|
|
|
158
158
|
type CandleColumnarInt = v.InferOutput<ReturnType<typeof createCandleColumnarIntSchema>>;
|
|
159
159
|
declare function createListCandlesInputSchema(): v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
160
160
|
readonly symbolId: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>;
|
|
161
|
-
readonly timeframe: v.SchemaWithPipe<readonly [v.PicklistSchema<readonly ["1s", "1m", "3m", "5m", "15m", "30m", "1h", "2h", "4h", "6h", "8h", "12h", "1d", "3d", "1w", "1mo"], undefined>, v.TransformAction<"
|
|
161
|
+
readonly timeframe: v.SchemaWithPipe<readonly [v.PicklistSchema<readonly ["1s", "1m", "3m", "5m", "15m", "30m", "1h", "2h", "4h", "6h", "8h", "12h", "1d", "3d", "1w", "1mo"], undefined>, v.TransformAction<"1s" | "1m" | "3m" | "5m" | "15m" | "30m" | "1h" | "2h" | "4h" | "6h" | "8h" | "12h" | "1d" | "3d" | "1w" | "1mo", Timeframe$1.SEC_1 | Timeframe$1.MIN_1 | Timeframe$1.MIN_3 | Timeframe$1.MIN_5 | Timeframe$1.MIN_15 | Timeframe$1.MIN_30 | Timeframe$1.HOUR_1 | Timeframe$1.HOUR_2 | Timeframe$1.HOUR_4 | Timeframe$1.HOUR_6 | Timeframe$1.HOUR_8 | Timeframe$1.HOUR_12 | Timeframe$1.DAY_1 | Timeframe$1.DAY_3 | Timeframe$1.WEEK_1 | Timeframe$1.MONTH_1>]>;
|
|
162
162
|
readonly limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 10000, undefined>]>, undefined>;
|
|
163
163
|
readonly includeIncomplete: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
164
164
|
readonly includeReference: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ChainAnalyticsService as ChainAnalyticsService$1 } from "../../gen/chain/analytics/v1/analytics_read_pb.js";
|
|
2
1
|
import { parse } from "../../shared/validation.js";
|
|
3
2
|
import { toConnectCallOptions } from "../../shared/request-options.js";
|
|
3
|
+
import { ChainAnalyticsService as ChainAnalyticsService$1 } from "../../gen/chain/analytics/v1/analytics_read_pb.js";
|
|
4
4
|
import { GetUnifiedAssetBalancesInputSchema, GetZippedAssetSupplyGroupInputSchema, GetZippedAssetSupplyInputSchema, createUnifiedAssetBalancesResponseSchema, createZippedAssetSupplyGroupResponseSchema, createZippedAssetSupplyResponseSchema } from "./chain-analytics.schemas.js";
|
|
5
5
|
import { createClient } from "@connectrpc/connect";
|
|
6
6
|
//#region src/services/chain-analytics/chain-analytics.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ChangelogService as ChangelogService$1 } from "../../gen/changelog/v1/changelog_pb.js";
|
|
2
1
|
import { parse } from "../../shared/validation.js";
|
|
3
2
|
import { toConnectCallOptions } from "../../shared/request-options.js";
|
|
3
|
+
import { ChangelogService as ChangelogService$1 } from "../../gen/changelog/v1/changelog_pb.js";
|
|
4
4
|
import { GetChangelogDeploymentGroupInputSchema, GetChangelogDeploymentGroupResultSchema, GetChangelogPostInputSchema, GetChangelogPostResultSchema, ListChangelogChangesInputSchema, ListChangelogChangesResultSchema, ListChangelogDeploymentGroupsInputSchema, ListChangelogDeploymentGroupsResultSchema, ListChangelogPostsInputSchema, ListChangelogPostsResultSchema } from "./changelog.schemas.js";
|
|
5
5
|
import { createClient } from "@connectrpc/connect";
|
|
6
6
|
//#region src/services/changelog/changelog.ts
|
|
@@ -31,7 +31,7 @@ declare const ListChangelogChangesInputSchema: v.SchemaWithPipe<readonly [v.Stri
|
|
|
31
31
|
}, undefined>, v.CheckAction<{
|
|
32
32
|
categories: ("breaking_change" | "new_feature" | "improvement" | "bug_fix")[];
|
|
33
33
|
actionRequired?: boolean | undefined;
|
|
34
|
-
surfaces: ("assistant" | "
|
|
34
|
+
surfaces: ("assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards")[];
|
|
35
35
|
audiences: ("all_users" | "traders" | "market_makers" | "developers")[];
|
|
36
36
|
startTime?: number | undefined;
|
|
37
37
|
endTime?: number | undefined;
|
|
@@ -42,7 +42,7 @@ declare const ListChangelogChangesInputSchema: v.SchemaWithPipe<readonly [v.Stri
|
|
|
42
42
|
}, "endTime: must be after startTime">, v.TransformAction<{
|
|
43
43
|
categories: ("breaking_change" | "new_feature" | "improvement" | "bug_fix")[];
|
|
44
44
|
actionRequired?: boolean | undefined;
|
|
45
|
-
surfaces: ("assistant" | "
|
|
45
|
+
surfaces: ("assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards")[];
|
|
46
46
|
audiences: ("all_users" | "traders" | "market_makers" | "developers")[];
|
|
47
47
|
startTime?: number | undefined;
|
|
48
48
|
endTime?: number | undefined;
|
|
@@ -77,7 +77,7 @@ declare const ChangelogChangeSchema: v.ObjectSchema<{
|
|
|
77
77
|
readonly actionRequired: v.BooleanSchema<undefined>;
|
|
78
78
|
readonly migrationGuidance: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
79
79
|
readonly audiences: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "all_users" | "traders" | "market_makers" | "developers">]>, undefined>, readonly []>;
|
|
80
|
-
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "
|
|
80
|
+
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards">]>, undefined>, readonly []>;
|
|
81
81
|
readonly environmentExceptions: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
82
82
|
readonly environment: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "devnet" | "testnet" | "mainnet">]>;
|
|
83
83
|
readonly availability: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "unavailable" | "pending" | "ahead">]>;
|
|
@@ -95,7 +95,7 @@ type ChangelogChange = v.InferOutput<typeof ChangelogChangeSchema>;
|
|
|
95
95
|
declare const ChangelogSectionSchema: v.ObjectSchema<{
|
|
96
96
|
readonly heading: v.StringSchema<undefined>;
|
|
97
97
|
readonly summary: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
98
|
-
readonly surface: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "
|
|
98
|
+
readonly surface: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards">]>;
|
|
99
99
|
readonly changes: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
100
100
|
readonly id: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
101
101
|
readonly title: v.StringSchema<undefined>;
|
|
@@ -105,7 +105,7 @@ declare const ChangelogSectionSchema: v.ObjectSchema<{
|
|
|
105
105
|
readonly actionRequired: v.BooleanSchema<undefined>;
|
|
106
106
|
readonly migrationGuidance: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
107
107
|
readonly audiences: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "all_users" | "traders" | "market_makers" | "developers">]>, undefined>, readonly []>;
|
|
108
|
-
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "
|
|
108
|
+
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards">]>, undefined>, readonly []>;
|
|
109
109
|
readonly environmentExceptions: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
110
110
|
readonly environment: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "devnet" | "testnet" | "mainnet">]>;
|
|
111
111
|
readonly availability: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "unavailable" | "pending" | "ahead">]>;
|
|
@@ -278,7 +278,7 @@ declare const ChangelogPostSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
|
278
278
|
readonly sections: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
279
279
|
readonly heading: v.StringSchema<undefined>;
|
|
280
280
|
readonly summary: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
281
|
-
readonly surface: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "
|
|
281
|
+
readonly surface: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards">]>;
|
|
282
282
|
readonly changes: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
283
283
|
readonly id: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
284
284
|
readonly title: v.StringSchema<undefined>;
|
|
@@ -288,7 +288,7 @@ declare const ChangelogPostSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
|
288
288
|
readonly actionRequired: v.BooleanSchema<undefined>;
|
|
289
289
|
readonly migrationGuidance: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
290
290
|
readonly audiences: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "all_users" | "traders" | "market_makers" | "developers">]>, undefined>, readonly []>;
|
|
291
|
-
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "
|
|
291
|
+
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards">]>, undefined>, readonly []>;
|
|
292
292
|
readonly environmentExceptions: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
293
293
|
readonly environment: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "devnet" | "testnet" | "mainnet">]>;
|
|
294
294
|
readonly availability: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "unavailable" | "pending" | "ahead">]>;
|
|
@@ -327,7 +327,7 @@ declare const ChangelogPostSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
|
327
327
|
sections: {
|
|
328
328
|
heading: string;
|
|
329
329
|
summary?: string | undefined;
|
|
330
|
-
surface: "unspecified" | "assistant" | "
|
|
330
|
+
surface: "unspecified" | "assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards";
|
|
331
331
|
changes: {
|
|
332
332
|
id: string;
|
|
333
333
|
title: string;
|
|
@@ -337,7 +337,7 @@ declare const ChangelogPostSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
|
337
337
|
actionRequired: boolean;
|
|
338
338
|
migrationGuidance?: string | undefined;
|
|
339
339
|
audiences: ("unspecified" | "all_users" | "traders" | "market_makers" | "developers")[];
|
|
340
|
-
surfaces: ("unspecified" | "assistant" | "
|
|
340
|
+
surfaces: ("unspecified" | "assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards")[];
|
|
341
341
|
environmentExceptions: {
|
|
342
342
|
environment: "unspecified" | "devnet" | "testnet" | "mainnet";
|
|
343
343
|
availability: "unspecified" | "unavailable" | "pending" | "ahead";
|
|
@@ -349,7 +349,7 @@ declare const ChangelogPostSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
|
349
349
|
sections: {
|
|
350
350
|
heading: string;
|
|
351
351
|
summary?: string | undefined;
|
|
352
|
-
surface: "unspecified" | "assistant" | "
|
|
352
|
+
surface: "unspecified" | "assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards";
|
|
353
353
|
changes: {
|
|
354
354
|
id: string;
|
|
355
355
|
title: string;
|
|
@@ -359,7 +359,7 @@ declare const ChangelogPostSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
|
359
359
|
actionRequired: boolean;
|
|
360
360
|
migrationGuidance?: string | undefined;
|
|
361
361
|
audiences: ("unspecified" | "all_users" | "traders" | "market_makers" | "developers")[];
|
|
362
|
-
surfaces: ("unspecified" | "assistant" | "
|
|
362
|
+
surfaces: ("unspecified" | "assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards")[];
|
|
363
363
|
environmentExceptions: {
|
|
364
364
|
environment: "unspecified" | "devnet" | "testnet" | "mainnet";
|
|
365
365
|
availability: "unspecified" | "unavailable" | "pending" | "ahead";
|
|
@@ -398,7 +398,7 @@ declare const ChangelogChangeEntrySchema: v.SchemaWithPipe<readonly [v.ObjectSch
|
|
|
398
398
|
readonly actionRequired: v.BooleanSchema<undefined>;
|
|
399
399
|
readonly migrationGuidance: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
400
400
|
readonly audiences: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "all_users" | "traders" | "market_makers" | "developers">]>, undefined>, readonly []>;
|
|
401
|
-
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "
|
|
401
|
+
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards">]>, undefined>, readonly []>;
|
|
402
402
|
readonly environmentExceptions: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
403
403
|
readonly environment: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "devnet" | "testnet" | "mainnet">]>;
|
|
404
404
|
readonly availability: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "unavailable" | "pending" | "ahead">]>;
|
|
@@ -430,7 +430,7 @@ declare const ChangelogChangeEntrySchema: v.SchemaWithPipe<readonly [v.ObjectSch
|
|
|
430
430
|
actionRequired: boolean;
|
|
431
431
|
migrationGuidance?: string | undefined;
|
|
432
432
|
audiences: ("unspecified" | "all_users" | "traders" | "market_makers" | "developers")[];
|
|
433
|
-
surfaces: ("unspecified" | "assistant" | "
|
|
433
|
+
surfaces: ("unspecified" | "assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards")[];
|
|
434
434
|
environmentExceptions: {
|
|
435
435
|
environment: "unspecified" | "devnet" | "testnet" | "mainnet";
|
|
436
436
|
availability: "unspecified" | "unavailable" | "pending" | "ahead";
|
|
@@ -452,7 +452,7 @@ declare const ChangelogChangeEntrySchema: v.SchemaWithPipe<readonly [v.ObjectSch
|
|
|
452
452
|
actionRequired: boolean;
|
|
453
453
|
migrationGuidance?: string | undefined;
|
|
454
454
|
audiences: ("unspecified" | "all_users" | "traders" | "market_makers" | "developers")[];
|
|
455
|
-
surfaces: ("unspecified" | "assistant" | "
|
|
455
|
+
surfaces: ("unspecified" | "assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards")[];
|
|
456
456
|
environmentExceptions: {
|
|
457
457
|
environment: "unspecified" | "devnet" | "testnet" | "mainnet";
|
|
458
458
|
availability: "unspecified" | "unavailable" | "pending" | "ahead";
|
|
@@ -472,7 +472,7 @@ declare const ListChangelogChangesResultSchema: v.ObjectSchema<{
|
|
|
472
472
|
readonly actionRequired: v.BooleanSchema<undefined>;
|
|
473
473
|
readonly migrationGuidance: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
474
474
|
readonly audiences: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "all_users" | "traders" | "market_makers" | "developers">]>, undefined>, readonly []>;
|
|
475
|
-
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "
|
|
475
|
+
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards">]>, undefined>, readonly []>;
|
|
476
476
|
readonly environmentExceptions: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
477
477
|
readonly environment: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "devnet" | "testnet" | "mainnet">]>;
|
|
478
478
|
readonly availability: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "unavailable" | "pending" | "ahead">]>;
|
|
@@ -504,7 +504,7 @@ declare const ListChangelogChangesResultSchema: v.ObjectSchema<{
|
|
|
504
504
|
actionRequired: boolean;
|
|
505
505
|
migrationGuidance?: string | undefined;
|
|
506
506
|
audiences: ("unspecified" | "all_users" | "traders" | "market_makers" | "developers")[];
|
|
507
|
-
surfaces: ("unspecified" | "assistant" | "
|
|
507
|
+
surfaces: ("unspecified" | "assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards")[];
|
|
508
508
|
environmentExceptions: {
|
|
509
509
|
environment: "unspecified" | "devnet" | "testnet" | "mainnet";
|
|
510
510
|
availability: "unspecified" | "unavailable" | "pending" | "ahead";
|
|
@@ -526,7 +526,7 @@ declare const ListChangelogChangesResultSchema: v.ObjectSchema<{
|
|
|
526
526
|
actionRequired: boolean;
|
|
527
527
|
migrationGuidance?: string | undefined;
|
|
528
528
|
audiences: ("unspecified" | "all_users" | "traders" | "market_makers" | "developers")[];
|
|
529
|
-
surfaces: ("unspecified" | "assistant" | "
|
|
529
|
+
surfaces: ("unspecified" | "assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards")[];
|
|
530
530
|
environmentExceptions: {
|
|
531
531
|
environment: "unspecified" | "devnet" | "testnet" | "mainnet";
|
|
532
532
|
availability: "unspecified" | "unavailable" | "pending" | "ahead";
|
|
@@ -678,7 +678,7 @@ declare const ChangelogDeploymentGroupSchema: v.SchemaWithPipe<readonly [v.Objec
|
|
|
678
678
|
readonly actionRequired: v.BooleanSchema<undefined>;
|
|
679
679
|
readonly migrationGuidance: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
680
680
|
readonly audiences: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "all_users" | "traders" | "market_makers" | "developers">]>, undefined>, readonly []>;
|
|
681
|
-
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "
|
|
681
|
+
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards">]>, undefined>, readonly []>;
|
|
682
682
|
readonly environmentExceptions: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
683
683
|
readonly environment: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "devnet" | "testnet" | "mainnet">]>;
|
|
684
684
|
readonly availability: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "unavailable" | "pending" | "ahead">]>;
|
|
@@ -703,7 +703,7 @@ declare const ChangelogDeploymentGroupSchema: v.SchemaWithPipe<readonly [v.Objec
|
|
|
703
703
|
actionRequired: boolean;
|
|
704
704
|
migrationGuidance?: string | undefined;
|
|
705
705
|
audiences: ("unspecified" | "all_users" | "traders" | "market_makers" | "developers")[];
|
|
706
|
-
surfaces: ("unspecified" | "assistant" | "
|
|
706
|
+
surfaces: ("unspecified" | "assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards")[];
|
|
707
707
|
environmentExceptions: {
|
|
708
708
|
environment: "unspecified" | "devnet" | "testnet" | "mainnet";
|
|
709
709
|
availability: "unspecified" | "unavailable" | "pending" | "ahead";
|
|
@@ -723,7 +723,7 @@ declare const ChangelogDeploymentGroupSchema: v.SchemaWithPipe<readonly [v.Objec
|
|
|
723
723
|
actionRequired: boolean;
|
|
724
724
|
migrationGuidance?: string | undefined;
|
|
725
725
|
audiences: ("unspecified" | "all_users" | "traders" | "market_makers" | "developers")[];
|
|
726
|
-
surfaces: ("unspecified" | "assistant" | "
|
|
726
|
+
surfaces: ("unspecified" | "assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards")[];
|
|
727
727
|
environmentExceptions: {
|
|
728
728
|
environment: "unspecified" | "devnet" | "testnet" | "mainnet";
|
|
729
729
|
availability: "unspecified" | "unavailable" | "pending" | "ahead";
|
|
@@ -765,7 +765,7 @@ declare const ChangelogDeploymentGroupSchema: v.SchemaWithPipe<readonly [v.Objec
|
|
|
765
765
|
actionRequired: boolean;
|
|
766
766
|
migrationGuidance?: string | undefined;
|
|
767
767
|
audiences: ("unspecified" | "all_users" | "traders" | "market_makers" | "developers")[];
|
|
768
|
-
surfaces: ("unspecified" | "assistant" | "
|
|
768
|
+
surfaces: ("unspecified" | "assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards")[];
|
|
769
769
|
environmentExceptions: {
|
|
770
770
|
environment: "unspecified" | "devnet" | "testnet" | "mainnet";
|
|
771
771
|
availability: "unspecified" | "unavailable" | "pending" | "ahead";
|
|
@@ -789,7 +789,7 @@ declare const ChangelogDeploymentGroupSchema: v.SchemaWithPipe<readonly [v.Objec
|
|
|
789
789
|
actionRequired: boolean;
|
|
790
790
|
migrationGuidance?: string | undefined;
|
|
791
791
|
audiences: ("unspecified" | "all_users" | "traders" | "market_makers" | "developers")[];
|
|
792
|
-
surfaces: ("unspecified" | "assistant" | "
|
|
792
|
+
surfaces: ("unspecified" | "assistant" | "trading" | "market_data" | "accounts" | "api" | "quickswap" | "funding" | "explorer" | "documentation" | "platform" | "rewards")[];
|
|
793
793
|
environmentExceptions: {
|
|
794
794
|
environment: "unspecified" | "devnet" | "testnet" | "mainnet";
|
|
795
795
|
availability: "unspecified" | "unavailable" | "pending" | "ahead";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CheckpointService } from "../../gen/checkpoints/v1/checkpoints_pb.js";
|
|
2
1
|
import { parse } from "../../shared/validation.js";
|
|
3
2
|
import { toConnectCallOptions } from "../../shared/request-options.js";
|
|
3
|
+
import { CheckpointService } from "../../gen/checkpoints/v1/checkpoints_pb.js";
|
|
4
4
|
import { ListCheckpointsInputSchema, ListCheckpointsResultSchema } from "./checkpoints.schemas.js";
|
|
5
5
|
import { createClient } from "@connectrpc/connect";
|
|
6
6
|
//#region src/services/checkpoints/checkpoints.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ClaimsService as ClaimsService$1 } from "../../gen/claims/v1/claims_pb.js";
|
|
2
1
|
import { parse } from "../../shared/validation.js";
|
|
3
2
|
import { toConnectCallOptions } from "../../shared/request-options.js";
|
|
3
|
+
import { ClaimsService as ClaimsService$1 } from "../../gen/claims/v1/claims_pb.js";
|
|
4
4
|
import { ClaimDailyRewardInputSchema, ClaimDailyRewardResultSchema, DailyClaimStatusSchema } from "./claims.schemas.js";
|
|
5
5
|
import { createClient } from "@connectrpc/connect";
|
|
6
6
|
//#region src/services/claims/claims.ts
|
|
@@ -36,7 +36,7 @@ declare const DailyClaimTransferSchema: v.ObjectSchema<{
|
|
|
36
36
|
}, undefined>;
|
|
37
37
|
type DailyClaimTransfer = v.InferOutput<typeof DailyClaimTransferSchema>;
|
|
38
38
|
declare const DailyClaimStatusSchema: v.ObjectSchema<{
|
|
39
|
-
readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
39
|
+
readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "processing" | "unavailable" | "available" | "claimed" | "payout_delayed">]>;
|
|
40
40
|
readonly resetAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
41
41
|
readonly seconds: v.BigintSchema<undefined>;
|
|
42
42
|
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
@@ -76,7 +76,7 @@ declare const DailyClaimStatusSchema: v.ObjectSchema<{
|
|
|
76
76
|
type DailyClaimStatus = v.InferOutput<typeof DailyClaimStatusSchema>;
|
|
77
77
|
declare const ClaimDailyRewardResultSchema: v.ObjectSchema<{
|
|
78
78
|
readonly claimId: v.StringSchema<undefined>;
|
|
79
|
-
readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
79
|
+
readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "processing" | "unavailable" | "available" | "claimed" | "payout_delayed">]>;
|
|
80
80
|
readonly claimedAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
81
81
|
readonly seconds: v.BigintSchema<undefined>;
|
|
82
82
|
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ErrorCode } from "../../gen/claims/v1/claims_pb.js";
|
|
2
1
|
import { OptionalPublicIdSchema, OptionalTimestampMsSchema, U128Schema, optionalSubaccountIdInputSchema } from "../../shared/schemas.js";
|
|
3
2
|
import { enumLabelSchema } from "../../shared/proto-enum-codec.js";
|
|
4
3
|
import { scaledToDecimalOutput } from "../../shared/decimal-surface.js";
|
|
5
4
|
import { fromU128 } from "../../utils/u128.js";
|
|
5
|
+
import { ErrorCode } from "../../gen/claims/v1/claims_pb.js";
|
|
6
6
|
import { ClaimPolicyCodec, DailyClaimStateCodec } from "./claims.codecs.js";
|
|
7
7
|
import * as v from "valibot";
|
|
8
8
|
//#region src/services/claims/claims.schemas.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { DepositAddressService } from "../../gen/chain/deposit/v1/deposit_pb.js";
|
|
2
1
|
import { parse } from "../../shared/validation.js";
|
|
3
2
|
import { removeUndefined } from "../../utils/remove-undefined.js";
|
|
4
3
|
import { toConnectCallOptions } from "../../shared/request-options.js";
|
|
5
4
|
import { resolveAccountScopedInput } from "../subaccount-resolver.js";
|
|
5
|
+
import { DepositAddressService } from "../../gen/chain/deposit/v1/deposit_pb.js";
|
|
6
6
|
import { CreateDepositAddressInputSchema, DepositAddressSchema, DepositAddressesSchema, ListDepositAddressesInputSchema } from "./deposit.schemas.js";
|
|
7
7
|
import { createClient } from "@connectrpc/connect";
|
|
8
8
|
//#region src/services/deposit/deposit.ts
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ErrorCode } from "../../gen/transfer/v1/internal_transfer_pb.js";
|
|
2
|
+
//#region src/services/dust-conversion/dust-conversion.codecs.d.ts
|
|
3
|
+
declare const DUST_ASSET_ELIGIBILITY_VALUES: readonly ["eligible", "target_asset", "tradable", "above_value_limit", "no_price", "unsupported_asset", "source_limit"];
|
|
4
|
+
/**
|
|
5
|
+
* Whether a Trading balance converts as dust: `eligible` converts; `target_asset` is the
|
|
6
|
+
* conversion's target; `tradable` has an open market that takes an order for it (sell or spend
|
|
7
|
+
* it instead); `above_value_limit` is worth more than 10 USD; `no_price` has no current index
|
|
8
|
+
* price; `unsupported_asset` never converts; `source_limit` waits for the next conversion, which
|
|
9
|
+
* takes at most 20 balances, highest-valued first.
|
|
10
|
+
*/
|
|
11
|
+
type DustAssetEligibility = (typeof DUST_ASSET_ELIGIBILITY_VALUES)[number];
|
|
12
|
+
declare const DUST_CONVERSION_STATE_VALUES: readonly ["processing", "completed", "refused"];
|
|
13
|
+
/**
|
|
14
|
+
* `processing` completes or is refused with no further request (read it again with `get`);
|
|
15
|
+
* `completed` moved every source and credited the payout atomically; `refused` moved nothing.
|
|
16
|
+
*/
|
|
17
|
+
type DustConversionState = (typeof DUST_CONVERSION_STATE_VALUES)[number];
|
|
18
|
+
/** Transfer error code a refused conversion carries, e.g. `DUST_BALANCE_CHANGED`. */
|
|
19
|
+
type DustConversionRefusalCode = keyof typeof ErrorCode;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { DUST_ASSET_ELIGIBILITY_VALUES, DUST_CONVERSION_STATE_VALUES, DustAssetEligibility, DustConversionRefusalCode, DustConversionState };
|
|
22
|
+
//# sourceMappingURL=dust-conversion.codecs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dust-conversion.codecs.d.ts","names":[],"sources":["../../../src/services/dust-conversion/dust-conversion.codecs.ts"],"mappings":";;cAIa;;;;;;;;KAgBD,+BAA+B;cAE9B;;;;;KAKD,8BAA8B;;KAG9B,yCAAyC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "../../gen/transfer/v1/dust_conversion_pb.js";
|
|
2
|
+
//#region src/services/dust-conversion/dust-conversion.codecs.ts
|
|
3
|
+
const DustAssetEligibilityCodec = { protoToOutput: {
|
|
4
|
+
[0]: "unspecified",
|
|
5
|
+
[1]: "eligible",
|
|
6
|
+
[2]: "target_asset",
|
|
7
|
+
[3]: "tradable",
|
|
8
|
+
[4]: "above_value_limit",
|
|
9
|
+
[5]: "no_price",
|
|
10
|
+
[6]: "unsupported_asset",
|
|
11
|
+
[7]: "source_limit"
|
|
12
|
+
} };
|
|
13
|
+
const DustConversionStateCodec = { protoToOutput: {
|
|
14
|
+
[0]: "unspecified",
|
|
15
|
+
[1]: "processing",
|
|
16
|
+
[2]: "completed",
|
|
17
|
+
[3]: "refused"
|
|
18
|
+
} };
|
|
19
|
+
//#endregion
|
|
20
|
+
export { DustAssetEligibilityCodec, DustConversionStateCodec };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=dust-conversion.codecs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dust-conversion.codecs.js","names":[],"sources":["../../../src/services/dust-conversion/dust-conversion.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/transfer/v1/dust_conversion_pb.js\";\nimport type { ErrorCode } from \"../../gen/transfer/v1/internal_transfer_pb.js\";\nimport type { ProtoToOutput } from \"../../utils/types.js\";\n\nexport const DUST_ASSET_ELIGIBILITY_VALUES = [\n \"eligible\",\n \"target_asset\",\n \"tradable\",\n \"above_value_limit\",\n \"no_price\",\n \"unsupported_asset\",\n \"source_limit\",\n] as const;\n/**\n * Whether a Trading balance converts as dust: `eligible` converts; `target_asset` is the\n * conversion's target; `tradable` has an open market that takes an order for it (sell or spend\n * it instead); `above_value_limit` is worth more than 10 USD; `no_price` has no current index\n * price; `unsupported_asset` never converts; `source_limit` waits for the next conversion, which\n * takes at most 20 balances, highest-valued first.\n */\nexport type DustAssetEligibility = (typeof DUST_ASSET_ELIGIBILITY_VALUES)[number];\n\nexport const DUST_CONVERSION_STATE_VALUES = [\"processing\", \"completed\", \"refused\"] as const;\n/**\n * `processing` completes or is refused with no further request (read it again with `get`);\n * `completed` moved every source and credited the payout atomically; `refused` moved nothing.\n */\nexport type DustConversionState = (typeof DUST_CONVERSION_STATE_VALUES)[number];\n\n/** Transfer error code a refused conversion carries, e.g. `DUST_BALANCE_CHANGED`. */\nexport type DustConversionRefusalCode = keyof typeof ErrorCode;\n\nexport const DustAssetEligibilityCodec = {\n protoToOutput: {\n [Proto.DustAssetEligibility.UNSPECIFIED]: \"unspecified\",\n [Proto.DustAssetEligibility.ELIGIBLE]: \"eligible\",\n [Proto.DustAssetEligibility.TARGET_ASSET]: \"target_asset\",\n [Proto.DustAssetEligibility.TRADABLE]: \"tradable\",\n [Proto.DustAssetEligibility.ABOVE_VALUE_LIMIT]: \"above_value_limit\",\n [Proto.DustAssetEligibility.NO_PRICE]: \"no_price\",\n [Proto.DustAssetEligibility.UNSUPPORTED_ASSET]: \"unsupported_asset\",\n [Proto.DustAssetEligibility.SOURCE_LIMIT]: \"source_limit\",\n } satisfies ProtoToOutput<Proto.DustAssetEligibility, DustAssetEligibility>,\n} as const;\n\nexport const DustConversionStateCodec = {\n protoToOutput: {\n [Proto.DustConversionState.UNSPECIFIED]: \"unspecified\",\n [Proto.DustConversionState.PROCESSING]: \"processing\",\n [Proto.DustConversionState.COMPLETED]: \"completed\",\n [Proto.DustConversionState.REFUSED]: \"refused\",\n } satisfies ProtoToOutput<Proto.DustConversionState, DustConversionState>,\n} as const;\n"],"mappings":";;AAgCA,MAAa,4BAA4B,EACrC,eAAe;EAC+B,IAAA;EACH,IAAA;EACI,IAAA;EACJ,IAAA;EACS,IAAA;EACT,IAAA;EACS,IAAA;EACL,IAAA;AAC/C,EACJ;AAEA,MAAa,2BAA2B,EACpC,eAAe;EAC8B,IAAA;EACD,IAAA;EACD,IAAA;EACF,IAAA;AACzC,EACJ"}
|