@polyester/sdk 0.36.0-devnet-20261115165158 → 0.36.0-devnet-20261116010019
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 +42 -4
- 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 +82 -4
- package/dist/gen/ai/v1/assistant_pb.d.ts.map +1 -1
- package/dist/gen/ai/v1/assistant_pb.js +66 -10
- package/dist/gen/ai/v1/assistant_pb.js.map +1 -1
- package/dist/gen/auth/v1/api_keys_pb.d.ts +4 -4
- 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 +26 -1
- 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/policies_pb.d.ts +18 -1
- 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 +7 -11
- 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/social_verification_pb.d.ts +44 -10
- 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 +17 -1
- package/dist/gen/auth/v1/subaccounts_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/subaccounts_pb.js +15 -1
- package/dist/gen/auth/v1/subaccounts_pb.js.map +1 -1
- package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.d.ts +228 -38
- 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 +12 -0
- 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 +6 -3
- 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 +10 -1
- 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/zipper_pb.d.ts +10 -6
- 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/index.d.ts +3 -1
- package/dist/gen/index.js +4 -2
- package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts +57 -16
- 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/orders/v1/orders_pb.d.ts +28 -4
- 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 +2 -1
- 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/ratelimit/v1/ratelimit_pb.d.ts +12 -7
- 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/swap/quickswap/v1/quickswap_broker_pb.d.ts +22 -10
- 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 +47 -11
- 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/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 +367 -3
- 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 +10 -5
- 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/index.d.ts +13 -7
- package/dist/services/address-book/address-book.schemas.d.ts +2 -2
- package/dist/services/assistant/assistant-events.schemas.d.ts +66 -66
- 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 +6 -4
- 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 +18 -4
- package/dist/services/assistant/assistant.schemas.js.map +1 -1
- package/dist/services/assistant/assistant.types.d.ts +3 -3
- package/dist/services/auth/profile/profile.d.ts +1 -1
- package/dist/services/auth/profile/profile.js +1 -1
- 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.schemas.d.ts +19 -19
- 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 +12 -4
- 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 +6 -10
- package/dist/services/balances/balances.schemas.js.map +1 -1
- package/dist/services/balances/balances.types.d.ts +2 -2
- package/dist/services/checkpoints/checkpoints.schemas.d.ts +2 -2
- package/dist/services/claims/claims.schemas.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/heatmap/heatmap.schemas.d.ts +3 -3
- 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 +29 -3
- 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 +63 -5
- 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 +39 -7
- package/dist/services/lifecycle/lifecycle.js.map +1 -1
- package/dist/services/lifecycle/lifecycle.schemas.d.ts +160 -136
- package/dist/services/lifecycle/lifecycle.schemas.d.ts.map +1 -1
- package/dist/services/lifecycle/lifecycle.schemas.js +44 -45
- 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/orderbook/orderbook.d.ts.map +1 -1
- package/dist/services/orderbook/orderbook.js +2 -1
- 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 +11 -1
- 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-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 +1 -0
- package/dist/services/orders/orders-input.schemas.js.map +1 -1
- package/dist/services/orders/orders-output.schemas.d.ts +17 -17
- package/dist/services/orders/orders-output.schemas.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 +9 -3
- 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.schemas.d.ts +5 -5
- package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.d.ts.map +1 -1
- package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.js +2 -3
- package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.js.map +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 +4 -1
- 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.schemas.d.ts +4 -4
- 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 +14 -3
- 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 +12 -4
- 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.schemas.d.ts +22 -22
- package/dist/services/system/system.schemas.d.ts +7 -7
- package/dist/services/trades/trades.schemas.d.ts +2 -2
- package/dist/services/trades/trades.schemas.js +1 -1
- package/dist/services/trading-withdraws/trading-withdraws.schemas.js +1 -1
- package/dist/services/transfers/transfers.schemas.js +1 -1
- 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 +2 -2
- package/dist/services/triggers/trigger-input.schemas.js.map +1 -1
- package/dist/services/triggers/triggers-output.schemas.d.ts +45 -35
- package/dist/services/triggers/triggers-output.schemas.d.ts.map +1 -1
- package/dist/services/zipper/zipper.schemas.d.ts.map +1 -1
- package/dist/services/zipper/zipper.schemas.js +10 -0
- 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/decimal-surface.d.ts.map +1 -1
- package/dist/shared/decimal-surface.js +4 -1
- package/dist/shared/decimal-surface.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/auth.js +7 -2
- package/dist/shared/error-details/auth.js.map +1 -1
- package/dist/shared/error-details/withdraw.js +1 -1
- package/dist/shared/schemas.js +2 -2
- package/dist/shared/schemas.js.map +1 -1
- package/dist/utils/numbers.js +1 -10
- package/dist/utils/numbers.js.map +1 -1
- package/dist/utils/u128.js +1 -1
- package/dist/utils/u128.js.map +1 -1
- package/dist/wired-services.d.ts.map +1 -1
- package/dist/wired-services.js +5 -1
- package/dist/wired-services.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { PROTOBUF_UINT32_MAX } from "../../shared/wire-bounds.js";
|
|
2
|
+
import { BigIntStringSchema, OptionalPublicIdSchema, OptionalTimestampMsSchema, PublicIdSchema, TimestampMsSchema, idInputSchema } from "../../shared/schemas.js";
|
|
3
|
+
import { enumLabelSchema } from "../../shared/proto-enum-codec.js";
|
|
4
|
+
import { AccountScopeInputEntries, accountScopeToSubaccountId } from "../../shared/account-scope.js";
|
|
5
|
+
import { msToTimestamp } from "../../utils/timestamp.js";
|
|
6
|
+
import { StatementExportFailureReasonCodec, StatementExportStatusCodec } from "./statement-exports.codecs.js";
|
|
7
|
+
import * as v from "valibot";
|
|
8
|
+
//#region src/services/statement-exports/statement-exports.schemas.ts
|
|
9
|
+
/** Latest period end the server accepts: 2262-04-11T23:47:16Z, the int64-nanosecond limit. */
|
|
10
|
+
const LATEST_END_TIME_MS = Date.UTC(2262, 3, 11, 23, 47, 16);
|
|
11
|
+
const IdempotencyKeySchema = v.pipe(v.string(), v.trim(), v.regex(/^[A-Za-z0-9._:-]{1,64}$/u, "idempotencyKey must be 1 to 64 letters, digits, '.', '_', ':' or '-'."));
|
|
12
|
+
const CreateStatementExportInputSchema = v.pipe(v.strictObject({
|
|
13
|
+
...AccountScopeInputEntries,
|
|
14
|
+
/** Period start, inclusive, in epoch milliseconds (UTC); after the epoch and not in the future. */
|
|
15
|
+
startTime: v.pipe(v.number(), v.integer(), v.minValue(1, "startTime must be after 1970-01-01T00:00:00Z.")),
|
|
16
|
+
/**
|
|
17
|
+
* Period end, exclusive, in epoch milliseconds (UTC), by 2262-04-11T23:47:16Z. A period
|
|
18
|
+
* still open when the export is created ends then; see `completeThrough`.
|
|
19
|
+
*/
|
|
20
|
+
endTime: v.pipe(v.number(), v.integer(), v.maxValue(LATEST_END_TIME_MS, "endTime must be by 2262-04-11T23:47:16Z.")),
|
|
21
|
+
/** Ledger asset ID to cover only that asset; omit or `0` for every asset. */
|
|
22
|
+
assetId: v.optional(v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(PROTOBUF_UINT32_MAX)), 0),
|
|
23
|
+
/**
|
|
24
|
+
* 1 to 64 letters, digits, `.`, `_`, `:` or `-`, unique per root account. Repeating the
|
|
25
|
+
* request with the same key returns the same export; the same key with other fields
|
|
26
|
+
* throws `PreconditionFailedError` (`IDEMPOTENCY_KEY_REUSED`).
|
|
27
|
+
*/
|
|
28
|
+
idempotencyKey: IdempotencyKeySchema
|
|
29
|
+
}), v.check(({ startTime, endTime }) => endTime > startTime, "endTime must be after startTime."), v.transform(({ account, startTime, endTime, ...input }) => ({
|
|
30
|
+
...input,
|
|
31
|
+
subaccountId: accountScopeToSubaccountId(account),
|
|
32
|
+
startTime: msToTimestamp(startTime),
|
|
33
|
+
endTime: msToTimestamp(endTime)
|
|
34
|
+
})));
|
|
35
|
+
const GetStatementExportInputSchema = v.strictObject({ exportId: idInputSchema("exportId") });
|
|
36
|
+
const ListStatementExportsInputSchema = v.pipe(v.strictObject({
|
|
37
|
+
...AccountScopeInputEntries,
|
|
38
|
+
/** Page size, at most 100; 0 or omitted uses the server default of 20. */
|
|
39
|
+
limit: v.optional(v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(100)), 0),
|
|
40
|
+
/** Previous `nextPageToken`; reuse only with the same account. */
|
|
41
|
+
pageToken: v.optional(v.pipe(v.string(), v.trim()), "")
|
|
42
|
+
}), v.transform(({ account, ...input }) => ({
|
|
43
|
+
...input,
|
|
44
|
+
subaccountId: accountScopeToSubaccountId(account)
|
|
45
|
+
})));
|
|
46
|
+
/** A whole-period statement file being produced, ready, failed or expired. Times are epoch ms. */
|
|
47
|
+
const StatementExportSchema = v.pipe(v.object({
|
|
48
|
+
exportId: PublicIdSchema,
|
|
49
|
+
subaccountId: OptionalPublicIdSchema,
|
|
50
|
+
startTime: TimestampMsSchema,
|
|
51
|
+
endTime: TimestampMsSchema,
|
|
52
|
+
assetId: v.number(),
|
|
53
|
+
idempotencyKey: v.string(),
|
|
54
|
+
status: enumLabelSchema(StatementExportStatusCodec.protoToOutput),
|
|
55
|
+
completeThrough: TimestampMsSchema,
|
|
56
|
+
movements: BigIntStringSchema,
|
|
57
|
+
bytes: BigIntStringSchema,
|
|
58
|
+
createdAt: TimestampMsSchema,
|
|
59
|
+
readyAt: OptionalTimestampMsSchema,
|
|
60
|
+
expiresAt: OptionalTimestampMsSchema,
|
|
61
|
+
failureReason: enumLabelSchema(StatementExportFailureReasonCodec.protoToOutput)
|
|
62
|
+
}), v.transform((statement) => ({
|
|
63
|
+
exportId: statement.exportId,
|
|
64
|
+
/** Public subaccount ID the statement covers; null for the root account. */
|
|
65
|
+
subaccountId: statement.subaccountId ?? null,
|
|
66
|
+
/** Period start, inclusive. */
|
|
67
|
+
startTime: statement.startTime,
|
|
68
|
+
/** Requested period end, exclusive. */
|
|
69
|
+
endTime: statement.endTime,
|
|
70
|
+
/** Ledger asset ID the statement is limited to; 0 for every asset. */
|
|
71
|
+
assetId: statement.assetId,
|
|
72
|
+
idempotencyKey: statement.idempotencyKey,
|
|
73
|
+
status: statement.status,
|
|
74
|
+
/**
|
|
75
|
+
* End of what the file covers, exclusive: the earlier of `endTime` and when the export
|
|
76
|
+
* was created. Every movement recorded before both is in the file.
|
|
77
|
+
*/
|
|
78
|
+
completeThrough: statement.completeThrough,
|
|
79
|
+
/** Ledger movements written so far, as a uint64 decimal string; the total once ready. */
|
|
80
|
+
movements: statement.movements,
|
|
81
|
+
/** Bytes written so far, as a uint64 decimal string; the file size once ready. */
|
|
82
|
+
bytes: statement.bytes,
|
|
83
|
+
createdAt: statement.createdAt,
|
|
84
|
+
/** When the file became ready; null before. */
|
|
85
|
+
readyAt: statement.readyAt ?? null,
|
|
86
|
+
/** When a ready file expires, 7 days after `readyAt`; null before ready. */
|
|
87
|
+
expiresAt: statement.expiresAt ?? null,
|
|
88
|
+
/** Why the export failed; `unspecified` unless `status` is `failed`. */
|
|
89
|
+
failureReason: statement.failureReason
|
|
90
|
+
})));
|
|
91
|
+
const ListStatementExportsResultSchema = v.object({
|
|
92
|
+
exports: v.array(StatementExportSchema),
|
|
93
|
+
nextPageToken: v.optional(v.string(), "")
|
|
94
|
+
});
|
|
95
|
+
//#endregion
|
|
96
|
+
export { CreateStatementExportInputSchema, GetStatementExportInputSchema, ListStatementExportsInputSchema, ListStatementExportsResultSchema, StatementExportSchema };
|
|
97
|
+
|
|
98
|
+
//# sourceMappingURL=statement-exports.schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statement-exports.schemas.js","names":[],"sources":["../../../src/services/statement-exports/statement-exports.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n} from \"../../shared/account-scope.js\";\nimport { enumLabelSchema } from \"../../shared/proto-enum-codec.js\";\nimport {\n BigIntStringSchema,\n OptionalPublicIdSchema,\n OptionalTimestampMsSchema,\n PublicIdSchema,\n TimestampMsSchema,\n idInputSchema,\n} from \"../../shared/schemas.js\";\nimport { PROTOBUF_UINT32_MAX } from \"../../shared/wire-bounds.js\";\nimport { msToTimestamp } from \"../../utils/timestamp.js\";\nimport {\n StatementExportFailureReasonCodec,\n StatementExportStatusCodec,\n} from \"./statement-exports.codecs.js\";\n\n/** Latest period end the server accepts: 2262-04-11T23:47:16Z, the int64-nanosecond limit. */\nconst LATEST_END_TIME_MS = Date.UTC(2262, 3, 11, 23, 47, 16);\n\nconst IdempotencyKeySchema = v.pipe(\n v.string(),\n v.trim(),\n v.regex(\n /^[A-Za-z0-9._:-]{1,64}$/u,\n \"idempotencyKey must be 1 to 64 letters, digits, '.', '_', ':' or '-'.\",\n ),\n);\n\nexport const CreateStatementExportInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n /** Period start, inclusive, in epoch milliseconds (UTC); after the epoch and not in the future. */\n startTime: v.pipe(\n v.number(),\n v.integer(),\n v.minValue(1, \"startTime must be after 1970-01-01T00:00:00Z.\"),\n ),\n /**\n * Period end, exclusive, in epoch milliseconds (UTC), by 2262-04-11T23:47:16Z. A period\n * still open when the export is created ends then; see `completeThrough`.\n */\n endTime: v.pipe(\n v.number(),\n v.integer(),\n v.maxValue(LATEST_END_TIME_MS, \"endTime must be by 2262-04-11T23:47:16Z.\"),\n ),\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 /**\n * 1 to 64 letters, digits, `.`, `_`, `:` or `-`, unique per root account. Repeating the\n * request with the same key returns the same export; the same key with other fields\n * throws `PreconditionFailedError` (`IDEMPOTENCY_KEY_REUSED`).\n */\n idempotencyKey: IdempotencyKeySchema,\n }),\n v.check(({ startTime, endTime }) => endTime > startTime, \"endTime must be after startTime.\"),\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 CreateStatementExportInput = v.InferInput<typeof CreateStatementExportInputSchema>;\n\nexport const GetStatementExportInputSchema = v.strictObject({\n exportId: idInputSchema(\"exportId\"),\n});\n\nexport type GetStatementExportInput = v.InferInput<typeof GetStatementExportInputSchema>;\n\nexport const ListStatementExportsInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n /** Page size, at most 100; 0 or omitted uses the server default of 20. */\n limit: v.optional(v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(100)), 0),\n /** Previous `nextPageToken`; reuse only with the same account. */\n pageToken: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type ListStatementExportsInput = v.InferInput<typeof ListStatementExportsInputSchema>;\n\n/** A whole-period statement file being produced, ready, failed or expired. Times are epoch ms. */\nexport const StatementExportSchema = v.pipe(\n v.object({\n exportId: PublicIdSchema,\n subaccountId: OptionalPublicIdSchema,\n startTime: TimestampMsSchema,\n endTime: TimestampMsSchema,\n assetId: v.number(),\n idempotencyKey: v.string(),\n status: enumLabelSchema(StatementExportStatusCodec.protoToOutput),\n completeThrough: TimestampMsSchema,\n movements: BigIntStringSchema,\n bytes: BigIntStringSchema,\n createdAt: TimestampMsSchema,\n readyAt: OptionalTimestampMsSchema,\n expiresAt: OptionalTimestampMsSchema,\n failureReason: enumLabelSchema(StatementExportFailureReasonCodec.protoToOutput),\n }),\n v.transform((statement) => ({\n exportId: statement.exportId,\n /** Public subaccount ID the statement covers; null for the root account. */\n subaccountId: statement.subaccountId ?? null,\n /** Period start, inclusive. */\n startTime: statement.startTime,\n /** Requested period end, exclusive. */\n endTime: statement.endTime,\n /** Ledger asset ID the statement is limited to; 0 for every asset. */\n assetId: statement.assetId,\n idempotencyKey: statement.idempotencyKey,\n status: statement.status,\n /**\n * End of what the file covers, exclusive: the earlier of `endTime` and when the export\n * was created. Every movement recorded before both is in the file.\n */\n completeThrough: statement.completeThrough,\n /** Ledger movements written so far, as a uint64 decimal string; the total once ready. */\n movements: statement.movements,\n /** Bytes written so far, as a uint64 decimal string; the file size once ready. */\n bytes: statement.bytes,\n createdAt: statement.createdAt,\n /** When the file became ready; null before. */\n readyAt: statement.readyAt ?? null,\n /** When a ready file expires, 7 days after `readyAt`; null before ready. */\n expiresAt: statement.expiresAt ?? null,\n /** Why the export failed; `unspecified` unless `status` is `failed`. */\n failureReason: statement.failureReason,\n })),\n);\n\nexport type StatementExport = v.InferOutput<typeof StatementExportSchema>;\n\nexport const ListStatementExportsResultSchema = v.object({\n exports: v.array(StatementExportSchema),\n nextPageToken: v.optional(v.string(), \"\"),\n});\n\n/** One page of exports, newest first; an empty `nextPageToken` means no more. */\nexport type ListStatementExportsResult = v.InferOutput<typeof ListStatementExportsResultSchema>;\n"],"mappings":";;;;;;;;;AAsBA,MAAM,qBAAqB,KAAK,IAAI,MAAM,GAAG,IAAI,IAAI,IAAI,EAAE;AAE3D,MAAM,uBAAuB,EAAE,KAC3B,EAAE,OAAO,GACT,EAAE,KAAK,GACP,EAAE,MACE,4BACA,uEACJ,CACJ;AAEA,MAAa,mCAAmC,EAAE,KAC9C,EAAE,aAAa;CACX,GAAG;;CAEH,WAAW,EAAE,KACT,EAAE,OAAO,GACT,EAAE,QAAQ,GACV,EAAE,SAAS,GAAG,+CAA+C,CACjE;;;;;CAKA,SAAS,EAAE,KACP,EAAE,OAAO,GACT,EAAE,QAAQ,GACV,EAAE,SAAS,oBAAoB,0CAA0C,CAC7E;;CAEA,SAAS,EAAE,SACP,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,SAAS,mBAAmB,CAAC,GAC9E,CACJ;;;;;;CAMA,gBAAgB;AACpB,CAAC,GACD,EAAE,OAAO,EAAE,WAAW,cAAc,UAAU,WAAW,kCAAkC,GAC3F,EAAE,WAAW,EAAE,SAAS,WAAW,SAAS,GAAG,aAAa;CACxD,GAAG;CACH,cAAc,2BAA2B,OAAO;CAChD,WAAW,cAAc,SAAS;CAClC,SAAS,cAAc,OAAO;AAClC,EAAE,CACN;AAIA,MAAa,gCAAgC,EAAE,aAAa,EACxD,UAAU,cAAc,UAAU,EACtC,CAAC;AAID,MAAa,kCAAkC,EAAE,KAC7C,EAAE,aAAa;CACX,GAAG;;CAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,SAAS,GAAG,CAAC,GAAG,CAAC;;CAEpF,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE;AAC1D,CAAC,GACD,EAAE,WAAW,EAAE,SAAS,GAAG,aAAa;CACpC,GAAG;CACH,cAAc,2BAA2B,OAAO;AACpD,EAAE,CACN;;AAKA,MAAa,wBAAwB,EAAE,KACnC,EAAE,OAAO;CACL,UAAU;CACV,cAAc;CACd,WAAW;CACX,SAAS;CACT,SAAS,EAAE,OAAO;CAClB,gBAAgB,EAAE,OAAO;CACzB,QAAQ,gBAAgB,2BAA2B,aAAa;CAChE,iBAAiB;CACjB,WAAW;CACX,OAAO;CACP,WAAW;CACX,SAAS;CACT,WAAW;CACX,eAAe,gBAAgB,kCAAkC,aAAa;AAClF,CAAC,GACD,EAAE,WAAW,eAAe;CACxB,UAAU,UAAU;;CAEpB,cAAc,UAAU,gBAAgB;;CAExC,WAAW,UAAU;;CAErB,SAAS,UAAU;;CAEnB,SAAS,UAAU;CACnB,gBAAgB,UAAU;CAC1B,QAAQ,UAAU;;;;;CAKlB,iBAAiB,UAAU;;CAE3B,WAAW,UAAU;;CAErB,OAAO,UAAU;CACjB,WAAW,UAAU;;CAErB,SAAS,UAAU,WAAW;;CAE9B,WAAW,UAAU,aAAa;;CAElC,eAAe,UAAU;AAC7B,EAAE,CACN;AAIA,MAAa,mCAAmC,EAAE,OAAO;CACrD,SAAS,EAAE,MAAM,qBAAqB;CACtC,eAAe,EAAE,SAAS,EAAE,OAAO,GAAG,EAAE;AAC5C,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CreateStatementExportInput, GetStatementExportInput, ListStatementExportsInput, ListStatementExportsResult, StatementExport } from "./statement-exports.schemas.js";
|
|
2
|
+
import { StatementExportFailureReason, StatementExportStatus } from "./statement-exports.codecs.js";
|
|
3
|
+
export type { CreateStatementExportInput, GetStatementExportInput, ListStatementExportsInput, ListStatementExportsResult, StatementExport, StatementExportFailureReason, StatementExportStatus };
|
|
@@ -55,7 +55,9 @@ const SubaccountPermissionCodec = { protoToOutput: {
|
|
|
55
55
|
[26]: "read_auto_withdraw",
|
|
56
56
|
[27]: "manage_auto_withdraw",
|
|
57
57
|
[28]: "swap",
|
|
58
|
-
[29]: "read_statements"
|
|
58
|
+
[29]: "read_statements",
|
|
59
|
+
[30]: "convert_dust",
|
|
60
|
+
[31]: "read_funding_flows"
|
|
59
61
|
} };
|
|
60
62
|
const InviteActionCodec = { inputToProto: {
|
|
61
63
|
accept: 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subaccounts.codecs.js","names":[],"sources":["../../../src/services/subaccounts/subaccounts.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/auth/v1/subaccounts_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const SUBACCOUNT_ROLE_VALUES = [\n \"owner\",\n \"admin\",\n \"treasury\",\n \"leveraged_trader\",\n \"trader\",\n \"viewer\",\n] as const;\nexport type SubaccountRoleValue = (typeof SUBACCOUNT_ROLE_VALUES)[number];\n\nexport const SUBACCOUNT_PERMISSION_VALUES = [\n \"read_subaccount\",\n \"update_subaccount\",\n \"read_balances\",\n \"read_spot\",\n \"trade_spot\",\n \"read_internal_transfers\",\n \"internal_transfer\",\n \"external_withdraw\",\n \"read_address_book\",\n \"manage_address_book\",\n \"read_members\",\n \"manage_members\",\n \"read_invites\",\n \"manage_invites\",\n \"read_api_keys\",\n \"manage_api_keys\",\n \"read_subaccount_policy\",\n \"manage_subaccount_policy\",\n \"read_activity\",\n \"read_activity_security_details\",\n \"manage_member_mfa_requirement\",\n \"create_deposit_address\",\n \"read_deposit_addresses\",\n \"read_guard_signer_status\",\n \"manage_guard_signer\",\n \"read_auto_withdraw\",\n \"manage_auto_withdraw\",\n \"swap\",\n \"read_statements\",\n] as const;\nexport type SubaccountPermissionValue = (typeof SUBACCOUNT_PERMISSION_VALUES)[number];\n\nexport const SUBACCOUNT_INVITE_ACTION_VALUES = [\"accept\", \"decline\", \"cancel\"] as const;\nexport type SubaccountInviteActionValue = (typeof SUBACCOUNT_INVITE_ACTION_VALUES)[number];\n\nexport const SUBACCOUNT_INVITE_STATUS_VALUES = [\n \"pending\",\n \"accepted\",\n \"declined\",\n \"canceled\",\n] as const;\nexport type SubaccountInviteStatusValue = (typeof SUBACCOUNT_INVITE_STATUS_VALUES)[number];\n\nexport const SUBACCOUNT_INVITE_DIRECTION_VALUES = [\"\", \"incoming\", \"outgoing\"] as const;\nexport type SubaccountInviteDirectionValue = (typeof SUBACCOUNT_INVITE_DIRECTION_VALUES)[number];\n\nexport const SUBACCOUNT_STATUS_VALUES = [\"active\", \"disabled\"] as const;\nexport type SubaccountStatusValue = (typeof SUBACCOUNT_STATUS_VALUES)[number];\n\nexport const ACTIVITY_ENTITY_KIND_VALUES = [\n \"account\",\n \"session\",\n \"api_key\",\n \"subaccount\",\n \"member\",\n \"policy\",\n \"invite\",\n \"security\",\n \"destination\",\n] as const;\nexport type ActivityEntityKindValue = (typeof ACTIVITY_ENTITY_KIND_VALUES)[number];\n\nexport const ACTIVITY_EVENT_ACTION_VALUES = [\n \"created\",\n \"updated\",\n \"deleted\",\n \"enabled\",\n \"disabled\",\n \"removed\",\n \"role_set\",\n \"received\",\n \"replied\",\n \"failed\",\n \"revoked\",\n \"blocked\",\n \"hold_placed\",\n \"hold_released\",\n \"requested\",\n \"applied\",\n] as const;\nexport type ActivityEventActionValue = (typeof ACTIVITY_EVENT_ACTION_VALUES)[number];\n\nexport const ACTIVITY_EVENT_SOURCE_VALUES = [\"web\", \"mobile\", \"api\"] as const;\nexport type ActivityEventSourceValue = (typeof ACTIVITY_EVENT_SOURCE_VALUES)[number];\n\nexport const SubaccountRoleCodec = {\n inputToProto: {\n owner: Proto.SubaccountRole.OWNER,\n admin: Proto.SubaccountRole.ADMIN,\n treasury: Proto.SubaccountRole.TREASURY,\n leveraged_trader: Proto.SubaccountRole.LEVERAGED_TRADER,\n trader: Proto.SubaccountRole.TRADER,\n viewer: Proto.SubaccountRole.VIEWER,\n } satisfies InputToProto<SubaccountRoleValue, Proto.SubaccountRole>,\n protoToOutput: {\n [Proto.SubaccountRole.SUBACCOUNT_ROLE_UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountRole.OWNER]: \"owner\",\n [Proto.SubaccountRole.ADMIN]: \"admin\",\n [Proto.SubaccountRole.TREASURY]: \"treasury\",\n [Proto.SubaccountRole.LEVERAGED_TRADER]: \"leveraged_trader\",\n [Proto.SubaccountRole.TRADER]: \"trader\",\n [Proto.SubaccountRole.VIEWER]: \"viewer\",\n } satisfies ProtoToOutput<Proto.SubaccountRole, SubaccountRoleValue>,\n} as const;\n\nexport const SubaccountPermissionCodec = {\n protoToOutput: {\n [Proto.SubaccountPermission.UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountPermission.READ_SUBACCOUNT]: \"read_subaccount\",\n [Proto.SubaccountPermission.UPDATE_SUBACCOUNT]: \"update_subaccount\",\n [Proto.SubaccountPermission.READ_BALANCES]: \"read_balances\",\n [Proto.SubaccountPermission.READ_SPOT]: \"read_spot\",\n [Proto.SubaccountPermission.TRADE_SPOT]: \"trade_spot\",\n [Proto.SubaccountPermission.READ_INTERNAL_TRANSFERS]: \"read_internal_transfers\",\n [Proto.SubaccountPermission.INTERNAL_TRANSFER]: \"internal_transfer\",\n [Proto.SubaccountPermission.EXTERNAL_WITHDRAW]: \"external_withdraw\",\n [Proto.SubaccountPermission.READ_ADDRESS_BOOK]: \"read_address_book\",\n [Proto.SubaccountPermission.MANAGE_ADDRESS_BOOK]: \"manage_address_book\",\n [Proto.SubaccountPermission.READ_MEMBERS]: \"read_members\",\n [Proto.SubaccountPermission.MANAGE_MEMBERS]: \"manage_members\",\n [Proto.SubaccountPermission.READ_INVITES]: \"read_invites\",\n [Proto.SubaccountPermission.MANAGE_INVITES]: \"manage_invites\",\n [Proto.SubaccountPermission.READ_API_KEYS]: \"read_api_keys\",\n [Proto.SubaccountPermission.MANAGE_API_KEYS]: \"manage_api_keys\",\n [Proto.SubaccountPermission.READ_SUBACCOUNT_POLICY]: \"read_subaccount_policy\",\n [Proto.SubaccountPermission.MANAGE_SUBACCOUNT_POLICY]: \"manage_subaccount_policy\",\n [Proto.SubaccountPermission.READ_ACTIVITY]: \"read_activity\",\n [Proto.SubaccountPermission.READ_ACTIVITY_SECURITY_DETAILS]:\n \"read_activity_security_details\",\n [Proto.SubaccountPermission.MANAGE_MEMBER_MFA_REQUIREMENT]: \"manage_member_mfa_requirement\",\n [Proto.SubaccountPermission.CREATE_DEPOSIT_ADDRESS]: \"create_deposit_address\",\n [Proto.SubaccountPermission.READ_DEPOSIT_ADDRESSES]: \"read_deposit_addresses\",\n [Proto.SubaccountPermission.READ_GUARD_SIGNER_STATUS]: \"read_guard_signer_status\",\n [Proto.SubaccountPermission.MANAGE_GUARD_SIGNER]: \"manage_guard_signer\",\n [Proto.SubaccountPermission.READ_AUTO_WITHDRAW]: \"read_auto_withdraw\",\n [Proto.SubaccountPermission.MANAGE_AUTO_WITHDRAW]: \"manage_auto_withdraw\",\n [Proto.SubaccountPermission.SWAP]: \"swap\",\n [Proto.SubaccountPermission.READ_STATEMENTS]: \"read_statements\",\n } satisfies ProtoToOutput<Proto.SubaccountPermission, SubaccountPermissionValue>,\n} as const;\n\nexport const InviteActionCodec = {\n inputToProto: {\n accept: Proto.SubaccountInviteAction.ACCEPT,\n decline: Proto.SubaccountInviteAction.DECLINE,\n cancel: Proto.SubaccountInviteAction.CANCEL,\n } satisfies InputToProto<SubaccountInviteActionValue, Proto.SubaccountInviteAction>,\n} as const;\n\nexport const InviteStatusCodec = {\n protoToOutput: {\n [Proto.SubaccountInviteStatus.UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountInviteStatus.PENDING]: \"pending\",\n [Proto.SubaccountInviteStatus.ACCEPTED]: \"accepted\",\n [Proto.SubaccountInviteStatus.DECLINED]: \"declined\",\n [Proto.SubaccountInviteStatus.CANCELLED]: \"canceled\",\n } satisfies ProtoToOutput<Proto.SubaccountInviteStatus, SubaccountInviteStatusValue>,\n} as const;\n\nexport const SubaccountInviteDirectionCodec = {\n inputToProto: {\n \"\": Proto.SubaccountInviteDirection.DIRECTION_UNSPECIFIED,\n incoming: Proto.SubaccountInviteDirection.INCOMING,\n outgoing: Proto.SubaccountInviteDirection.OUTGOING,\n } satisfies InputToProto<SubaccountInviteDirectionValue, Proto.SubaccountInviteDirection>,\n} as const;\n\nexport const SubaccountStatusCodec = {\n inputToProto: {\n active: Proto.SubaccountStatus.ACTIVE,\n disabled: Proto.SubaccountStatus.DISABLED,\n } satisfies InputToProto<SubaccountStatusValue, Proto.SubaccountStatus>,\n protoToOutput: {\n [Proto.SubaccountStatus.UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountStatus.ACTIVE]: \"active\",\n [Proto.SubaccountStatus.DISABLED]: \"disabled\",\n } satisfies ProtoToOutput<Proto.SubaccountStatus, SubaccountStatusValue>,\n} as const;\n\nexport const ActivityEntityKindCodec = {\n protoToOutput: {\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_UNSPECIFIED]: \"unspecified\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_ACCOUNT]: \"account\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_SESSION]: \"session\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_API_KEY]: \"api_key\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_SUBACCOUNT]: \"subaccount\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_MEMBER]: \"member\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_POLICY]: \"policy\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_INVITE]: \"invite\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_SECURITY]: \"security\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_DESTINATION]: \"destination\",\n } satisfies ProtoToOutput<Proto.ActivityEntityKind, ActivityEntityKindValue>,\n} as const;\n\nexport const ActivityEventActionCodec = {\n protoToOutput: {\n [Proto.ActivityEventAction.ACTIVITY_ACTION_UNSPECIFIED]: \"unspecified\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_CREATED]: \"created\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_UPDATED]: \"updated\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_DELETED]: \"deleted\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_ENABLED]: \"enabled\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_DISABLED]: \"disabled\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REMOVED]: \"removed\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_ROLE_SET]: \"role_set\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_RECEIVED]: \"received\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REPLIED]: \"replied\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_FAILED]: \"failed\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REVOKED]: \"revoked\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_BLOCKED]: \"blocked\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_HOLD_PLACED]: \"hold_placed\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_HOLD_RELEASED]: \"hold_released\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REQUESTED]: \"requested\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_APPLIED]: \"applied\",\n } satisfies ProtoToOutput<Proto.ActivityEventAction, ActivityEventActionValue>,\n} as const;\n\nexport const ActivityEventSourceCodec = {\n protoToOutput: {\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_UNSPECIFIED]: \"unspecified\",\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_WEB]: \"web\",\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_MOBILE]: \"mobile\",\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_API]: \"api\",\n } satisfies ProtoToOutput<Proto.ActivityEventSource, ActivityEventSourceValue>,\n} as const;\n"],"mappings":";;AAyDA,MAAa,qCAAqC;CAAC;CAAI;CAAY;AAAU;AAG7E,MAAa,2BAA2B,CAAC,UAAU,UAAU;AAuC7D,MAAa,sBAAsB;CAC/B,cAAc;EACV,OAAA;EACA,OAAA;EACA,UAAA;EACA,kBAAA;EACA,QAAA;EACA,QAAA;CACJ;CACA,eAAe;GACyC,IAAA;GACtB,IAAA;GACA,IAAA;GACG,IAAA;GACQ,IAAA;GACV,IAAA;GACA,IAAA;CACnC;AACJ;AAEA,MAAa,4BAA4B,EACrC,eAAe;EAC+B,IAAA;EACI,IAAA;EACE,IAAA;EACJ,IAAA;EACJ,IAAA;EACC,IAAA;EACa,IAAA;EACN,IAAA;EACA,IAAA;EACA,IAAA;EACE,KAAA;EACP,KAAA;EACE,KAAA;EACF,KAAA;EACE,KAAA;EACD,KAAA;EACE,KAAA;EACO,KAAA;EACE,KAAA;EACX,KAAA;EAExC,KAAA;EACwD,KAAA;EACP,KAAA;EACA,KAAA;EACE,KAAA;EACL,KAAA;EACD,KAAA;EACE,KAAA;EAChB,KAAA;EACW,KAAA;AAClD,EACJ;AAEA,MAAa,oBAAoB,EAC7B,cAAc;CACV,QAAA;CACA,SAAA;CACA,QAAA;AACJ,EACJ;AAEA,MAAa,oBAAoB,EAC7B,eAAe;EACiC,IAAA;EACJ,IAAA;EACC,IAAA;EACA,IAAA;EACC,IAAA;AAC9C,EACJ;AAEA,MAAa,iCAAiC,EAC1C,cAAc;CACV,IAAA;CACA,UAAA;CACA,UAAA;AACJ,EACJ;AAEA,MAAa,wBAAwB;CACjC,cAAc;EACV,QAAA;EACA,UAAA;CACJ;CACA,eAAe;GAC2B,IAAA;GACL,IAAA;GACE,IAAA;CACvC;AACJ;AAEA,MAAa,0BAA0B,EACnC,eAAe;EAC6C,IAAA;EACJ,IAAA;EACA,IAAA;EACA,IAAA;EACG,IAAA;EACJ,IAAA;EACA,IAAA;EACA,IAAA;EACE,IAAA;EACG,IAAA;AAC5D,EACJ;AAEA,MAAa,2BAA2B,EACpC,eAAe;EAC8C,IAAA;EACJ,IAAA;EACA,IAAA;EACA,IAAA;EACA,IAAA;EACC,IAAA;EACD,IAAA;EACC,IAAA;EACA,IAAA;EACD,IAAA;EACD,KAAA;EACC,KAAA;EACA,KAAA;EACI,KAAA;EACE,KAAA;EACJ,KAAA;EACF,KAAA;AACzD,EACJ;AAEA,MAAa,2BAA2B,EACpC,eAAe;EAC8C,IAAA;EACR,IAAA;EACG,IAAA;EACH,IAAA;AACrD,EACJ"}
|
|
1
|
+
{"version":3,"file":"subaccounts.codecs.js","names":[],"sources":["../../../src/services/subaccounts/subaccounts.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/auth/v1/subaccounts_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const SUBACCOUNT_ROLE_VALUES = [\n \"owner\",\n \"admin\",\n \"treasury\",\n \"leveraged_trader\",\n \"trader\",\n \"viewer\",\n] as const;\nexport type SubaccountRoleValue = (typeof SUBACCOUNT_ROLE_VALUES)[number];\n\nexport const SUBACCOUNT_PERMISSION_VALUES = [\n \"read_subaccount\",\n \"update_subaccount\",\n \"read_balances\",\n \"read_spot\",\n \"trade_spot\",\n \"read_internal_transfers\",\n \"internal_transfer\",\n \"external_withdraw\",\n \"read_address_book\",\n \"manage_address_book\",\n \"read_members\",\n \"manage_members\",\n \"read_invites\",\n \"manage_invites\",\n \"read_api_keys\",\n \"manage_api_keys\",\n \"read_subaccount_policy\",\n \"manage_subaccount_policy\",\n \"read_activity\",\n \"read_activity_security_details\",\n \"manage_member_mfa_requirement\",\n \"create_deposit_address\",\n \"read_deposit_addresses\",\n \"read_guard_signer_status\",\n \"manage_guard_signer\",\n \"read_auto_withdraw\",\n \"manage_auto_withdraw\",\n \"swap\",\n \"read_statements\",\n \"convert_dust\",\n \"read_funding_flows\",\n] as const;\nexport type SubaccountPermissionValue = (typeof SUBACCOUNT_PERMISSION_VALUES)[number];\n\nexport const SUBACCOUNT_INVITE_ACTION_VALUES = [\"accept\", \"decline\", \"cancel\"] as const;\nexport type SubaccountInviteActionValue = (typeof SUBACCOUNT_INVITE_ACTION_VALUES)[number];\n\nexport const SUBACCOUNT_INVITE_STATUS_VALUES = [\n \"pending\",\n \"accepted\",\n \"declined\",\n \"canceled\",\n] as const;\nexport type SubaccountInviteStatusValue = (typeof SUBACCOUNT_INVITE_STATUS_VALUES)[number];\n\nexport const SUBACCOUNT_INVITE_DIRECTION_VALUES = [\"\", \"incoming\", \"outgoing\"] as const;\nexport type SubaccountInviteDirectionValue = (typeof SUBACCOUNT_INVITE_DIRECTION_VALUES)[number];\n\nexport const SUBACCOUNT_STATUS_VALUES = [\"active\", \"disabled\"] as const;\nexport type SubaccountStatusValue = (typeof SUBACCOUNT_STATUS_VALUES)[number];\n\nexport const ACTIVITY_ENTITY_KIND_VALUES = [\n \"account\",\n \"session\",\n \"api_key\",\n \"subaccount\",\n \"member\",\n \"policy\",\n \"invite\",\n \"security\",\n \"destination\",\n] as const;\nexport type ActivityEntityKindValue = (typeof ACTIVITY_ENTITY_KIND_VALUES)[number];\n\nexport const ACTIVITY_EVENT_ACTION_VALUES = [\n \"created\",\n \"updated\",\n \"deleted\",\n \"enabled\",\n \"disabled\",\n \"removed\",\n \"role_set\",\n \"received\",\n \"replied\",\n \"failed\",\n \"revoked\",\n \"blocked\",\n \"hold_placed\",\n \"hold_released\",\n \"requested\",\n \"applied\",\n] as const;\nexport type ActivityEventActionValue = (typeof ACTIVITY_EVENT_ACTION_VALUES)[number];\n\nexport const ACTIVITY_EVENT_SOURCE_VALUES = [\"web\", \"mobile\", \"api\"] as const;\nexport type ActivityEventSourceValue = (typeof ACTIVITY_EVENT_SOURCE_VALUES)[number];\n\nexport const SubaccountRoleCodec = {\n inputToProto: {\n owner: Proto.SubaccountRole.OWNER,\n admin: Proto.SubaccountRole.ADMIN,\n treasury: Proto.SubaccountRole.TREASURY,\n leveraged_trader: Proto.SubaccountRole.LEVERAGED_TRADER,\n trader: Proto.SubaccountRole.TRADER,\n viewer: Proto.SubaccountRole.VIEWER,\n } satisfies InputToProto<SubaccountRoleValue, Proto.SubaccountRole>,\n protoToOutput: {\n [Proto.SubaccountRole.SUBACCOUNT_ROLE_UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountRole.OWNER]: \"owner\",\n [Proto.SubaccountRole.ADMIN]: \"admin\",\n [Proto.SubaccountRole.TREASURY]: \"treasury\",\n [Proto.SubaccountRole.LEVERAGED_TRADER]: \"leveraged_trader\",\n [Proto.SubaccountRole.TRADER]: \"trader\",\n [Proto.SubaccountRole.VIEWER]: \"viewer\",\n } satisfies ProtoToOutput<Proto.SubaccountRole, SubaccountRoleValue>,\n} as const;\n\nexport const SubaccountPermissionCodec = {\n protoToOutput: {\n [Proto.SubaccountPermission.UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountPermission.READ_SUBACCOUNT]: \"read_subaccount\",\n [Proto.SubaccountPermission.UPDATE_SUBACCOUNT]: \"update_subaccount\",\n [Proto.SubaccountPermission.READ_BALANCES]: \"read_balances\",\n [Proto.SubaccountPermission.READ_SPOT]: \"read_spot\",\n [Proto.SubaccountPermission.TRADE_SPOT]: \"trade_spot\",\n [Proto.SubaccountPermission.READ_INTERNAL_TRANSFERS]: \"read_internal_transfers\",\n [Proto.SubaccountPermission.INTERNAL_TRANSFER]: \"internal_transfer\",\n [Proto.SubaccountPermission.EXTERNAL_WITHDRAW]: \"external_withdraw\",\n [Proto.SubaccountPermission.READ_ADDRESS_BOOK]: \"read_address_book\",\n [Proto.SubaccountPermission.MANAGE_ADDRESS_BOOK]: \"manage_address_book\",\n [Proto.SubaccountPermission.READ_MEMBERS]: \"read_members\",\n [Proto.SubaccountPermission.MANAGE_MEMBERS]: \"manage_members\",\n [Proto.SubaccountPermission.READ_INVITES]: \"read_invites\",\n [Proto.SubaccountPermission.MANAGE_INVITES]: \"manage_invites\",\n [Proto.SubaccountPermission.READ_API_KEYS]: \"read_api_keys\",\n [Proto.SubaccountPermission.MANAGE_API_KEYS]: \"manage_api_keys\",\n [Proto.SubaccountPermission.READ_SUBACCOUNT_POLICY]: \"read_subaccount_policy\",\n [Proto.SubaccountPermission.MANAGE_SUBACCOUNT_POLICY]: \"manage_subaccount_policy\",\n [Proto.SubaccountPermission.READ_ACTIVITY]: \"read_activity\",\n [Proto.SubaccountPermission.READ_ACTIVITY_SECURITY_DETAILS]:\n \"read_activity_security_details\",\n [Proto.SubaccountPermission.MANAGE_MEMBER_MFA_REQUIREMENT]: \"manage_member_mfa_requirement\",\n [Proto.SubaccountPermission.CREATE_DEPOSIT_ADDRESS]: \"create_deposit_address\",\n [Proto.SubaccountPermission.READ_DEPOSIT_ADDRESSES]: \"read_deposit_addresses\",\n [Proto.SubaccountPermission.READ_GUARD_SIGNER_STATUS]: \"read_guard_signer_status\",\n [Proto.SubaccountPermission.MANAGE_GUARD_SIGNER]: \"manage_guard_signer\",\n [Proto.SubaccountPermission.READ_AUTO_WITHDRAW]: \"read_auto_withdraw\",\n [Proto.SubaccountPermission.MANAGE_AUTO_WITHDRAW]: \"manage_auto_withdraw\",\n [Proto.SubaccountPermission.SWAP]: \"swap\",\n [Proto.SubaccountPermission.READ_STATEMENTS]: \"read_statements\",\n [Proto.SubaccountPermission.CONVERT_DUST]: \"convert_dust\",\n [Proto.SubaccountPermission.READ_FUNDING_FLOWS]: \"read_funding_flows\",\n } satisfies ProtoToOutput<Proto.SubaccountPermission, SubaccountPermissionValue>,\n} as const;\n\nexport const InviteActionCodec = {\n inputToProto: {\n accept: Proto.SubaccountInviteAction.ACCEPT,\n decline: Proto.SubaccountInviteAction.DECLINE,\n cancel: Proto.SubaccountInviteAction.CANCEL,\n } satisfies InputToProto<SubaccountInviteActionValue, Proto.SubaccountInviteAction>,\n} as const;\n\nexport const InviteStatusCodec = {\n protoToOutput: {\n [Proto.SubaccountInviteStatus.UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountInviteStatus.PENDING]: \"pending\",\n [Proto.SubaccountInviteStatus.ACCEPTED]: \"accepted\",\n [Proto.SubaccountInviteStatus.DECLINED]: \"declined\",\n [Proto.SubaccountInviteStatus.CANCELLED]: \"canceled\",\n } satisfies ProtoToOutput<Proto.SubaccountInviteStatus, SubaccountInviteStatusValue>,\n} as const;\n\nexport const SubaccountInviteDirectionCodec = {\n inputToProto: {\n \"\": Proto.SubaccountInviteDirection.DIRECTION_UNSPECIFIED,\n incoming: Proto.SubaccountInviteDirection.INCOMING,\n outgoing: Proto.SubaccountInviteDirection.OUTGOING,\n } satisfies InputToProto<SubaccountInviteDirectionValue, Proto.SubaccountInviteDirection>,\n} as const;\n\nexport const SubaccountStatusCodec = {\n inputToProto: {\n active: Proto.SubaccountStatus.ACTIVE,\n disabled: Proto.SubaccountStatus.DISABLED,\n } satisfies InputToProto<SubaccountStatusValue, Proto.SubaccountStatus>,\n protoToOutput: {\n [Proto.SubaccountStatus.UNSPECIFIED]: \"unspecified\",\n [Proto.SubaccountStatus.ACTIVE]: \"active\",\n [Proto.SubaccountStatus.DISABLED]: \"disabled\",\n } satisfies ProtoToOutput<Proto.SubaccountStatus, SubaccountStatusValue>,\n} as const;\n\nexport const ActivityEntityKindCodec = {\n protoToOutput: {\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_UNSPECIFIED]: \"unspecified\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_ACCOUNT]: \"account\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_SESSION]: \"session\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_API_KEY]: \"api_key\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_SUBACCOUNT]: \"subaccount\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_MEMBER]: \"member\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_POLICY]: \"policy\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_INVITE]: \"invite\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_SECURITY]: \"security\",\n [Proto.ActivityEntityKind.ACTIVITY_ENTITY_DESTINATION]: \"destination\",\n } satisfies ProtoToOutput<Proto.ActivityEntityKind, ActivityEntityKindValue>,\n} as const;\n\nexport const ActivityEventActionCodec = {\n protoToOutput: {\n [Proto.ActivityEventAction.ACTIVITY_ACTION_UNSPECIFIED]: \"unspecified\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_CREATED]: \"created\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_UPDATED]: \"updated\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_DELETED]: \"deleted\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_ENABLED]: \"enabled\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_DISABLED]: \"disabled\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REMOVED]: \"removed\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_ROLE_SET]: \"role_set\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_RECEIVED]: \"received\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REPLIED]: \"replied\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_FAILED]: \"failed\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REVOKED]: \"revoked\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_BLOCKED]: \"blocked\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_HOLD_PLACED]: \"hold_placed\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_HOLD_RELEASED]: \"hold_released\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_REQUESTED]: \"requested\",\n [Proto.ActivityEventAction.ACTIVITY_ACTION_APPLIED]: \"applied\",\n } satisfies ProtoToOutput<Proto.ActivityEventAction, ActivityEventActionValue>,\n} as const;\n\nexport const ActivityEventSourceCodec = {\n protoToOutput: {\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_UNSPECIFIED]: \"unspecified\",\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_WEB]: \"web\",\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_MOBILE]: \"mobile\",\n [Proto.ActivityEventSource.ACTIVITY_SOURCE_API]: \"api\",\n } satisfies ProtoToOutput<Proto.ActivityEventSource, ActivityEventSourceValue>,\n} as const;\n"],"mappings":";;AA2DA,MAAa,qCAAqC;CAAC;CAAI;CAAY;AAAU;AAG7E,MAAa,2BAA2B,CAAC,UAAU,UAAU;AAuC7D,MAAa,sBAAsB;CAC/B,cAAc;EACV,OAAA;EACA,OAAA;EACA,UAAA;EACA,kBAAA;EACA,QAAA;EACA,QAAA;CACJ;CACA,eAAe;GACyC,IAAA;GACtB,IAAA;GACA,IAAA;GACG,IAAA;GACQ,IAAA;GACV,IAAA;GACA,IAAA;CACnC;AACJ;AAEA,MAAa,4BAA4B,EACrC,eAAe;EAC+B,IAAA;EACI,IAAA;EACE,IAAA;EACJ,IAAA;EACJ,IAAA;EACC,IAAA;EACa,IAAA;EACN,IAAA;EACA,IAAA;EACA,IAAA;EACE,KAAA;EACP,KAAA;EACE,KAAA;EACF,KAAA;EACE,KAAA;EACD,KAAA;EACE,KAAA;EACO,KAAA;EACE,KAAA;EACX,KAAA;EAExC,KAAA;EACwD,KAAA;EACP,KAAA;EACA,KAAA;EACE,KAAA;EACL,KAAA;EACD,KAAA;EACE,KAAA;EAChB,KAAA;EACW,KAAA;EACH,KAAA;EACM,KAAA;AACrD,EACJ;AAEA,MAAa,oBAAoB,EAC7B,cAAc;CACV,QAAA;CACA,SAAA;CACA,QAAA;AACJ,EACJ;AAEA,MAAa,oBAAoB,EAC7B,eAAe;EACiC,IAAA;EACJ,IAAA;EACC,IAAA;EACA,IAAA;EACC,IAAA;AAC9C,EACJ;AAEA,MAAa,iCAAiC,EAC1C,cAAc;CACV,IAAA;CACA,UAAA;CACA,UAAA;AACJ,EACJ;AAEA,MAAa,wBAAwB;CACjC,cAAc;EACV,QAAA;EACA,UAAA;CACJ;CACA,eAAe;GAC2B,IAAA;GACL,IAAA;GACE,IAAA;CACvC;AACJ;AAEA,MAAa,0BAA0B,EACnC,eAAe;EAC6C,IAAA;EACJ,IAAA;EACA,IAAA;EACA,IAAA;EACG,IAAA;EACJ,IAAA;EACA,IAAA;EACA,IAAA;EACE,IAAA;EACG,IAAA;AAC5D,EACJ;AAEA,MAAa,2BAA2B,EACpC,eAAe;EAC8C,IAAA;EACJ,IAAA;EACA,IAAA;EACA,IAAA;EACA,IAAA;EACC,IAAA;EACD,IAAA;EACC,IAAA;EACA,IAAA;EACD,IAAA;EACD,KAAA;EACC,KAAA;EACA,KAAA;EACI,KAAA;EACE,KAAA;EACJ,KAAA;EACF,KAAA;AACzD,EACJ;AAEA,MAAa,2BAA2B,EACpC,eAAe;EAC8C,IAAA;EACR,IAAA;EACG,IAAA;EACH,IAAA;AACrD,EACJ"}
|
|
@@ -3,42 +3,42 @@ import * as v from "valibot";
|
|
|
3
3
|
//#region src/services/subaccounts/subaccounts.schemas.d.ts
|
|
4
4
|
declare const SubaccountRoleSchema: v.PicklistSchema<readonly ["owner", "admin", "treasury", "leveraged_trader", "trader", "viewer"], undefined>;
|
|
5
5
|
type SubaccountRole = v.InferOutput<typeof SubaccountRoleSchema>;
|
|
6
|
-
declare const ProtoSubaccountPermissionSchema: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "internal_transfer" | "swap" | "read_subaccount" | "update_subaccount" | "read_balances" | "read_spot" | "trade_spot" | "read_internal_transfers" | "external_withdraw" | "read_address_book" | "manage_address_book" | "read_members" | "manage_members" | "read_invites" | "manage_invites" | "read_api_keys" | "manage_api_keys" | "read_subaccount_policy" | "manage_subaccount_policy" | "read_activity" | "read_activity_security_details" | "manage_member_mfa_requirement" | "create_deposit_address" | "read_deposit_addresses" | "read_guard_signer_status" | "manage_guard_signer" | "read_auto_withdraw" | "manage_auto_withdraw" | "read_statements">]>;
|
|
6
|
+
declare const ProtoSubaccountPermissionSchema: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "internal_transfer" | "swap" | "read_subaccount" | "update_subaccount" | "read_balances" | "read_spot" | "trade_spot" | "read_internal_transfers" | "external_withdraw" | "read_address_book" | "manage_address_book" | "read_members" | "manage_members" | "read_invites" | "manage_invites" | "read_api_keys" | "manage_api_keys" | "read_subaccount_policy" | "manage_subaccount_policy" | "read_activity" | "read_activity_security_details" | "manage_member_mfa_requirement" | "create_deposit_address" | "read_deposit_addresses" | "read_guard_signer_status" | "manage_guard_signer" | "read_auto_withdraw" | "manage_auto_withdraw" | "read_statements" | "convert_dust" | "read_funding_flows">]>;
|
|
7
7
|
type SubaccountPermission = v.InferOutput<typeof ProtoSubaccountPermissionSchema>;
|
|
8
8
|
declare const SubaccountPermissionDefinitionSchema: v.ObjectSchema<{
|
|
9
|
-
readonly permission: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "internal_transfer" | "swap" | "read_subaccount" | "update_subaccount" | "read_balances" | "read_spot" | "trade_spot" | "read_internal_transfers" | "external_withdraw" | "read_address_book" | "manage_address_book" | "read_members" | "manage_members" | "read_invites" | "manage_invites" | "read_api_keys" | "manage_api_keys" | "read_subaccount_policy" | "manage_subaccount_policy" | "read_activity" | "read_activity_security_details" | "manage_member_mfa_requirement" | "create_deposit_address" | "read_deposit_addresses" | "read_guard_signer_status" | "manage_guard_signer" | "read_auto_withdraw" | "manage_auto_withdraw" | "read_statements">]>;
|
|
9
|
+
readonly permission: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "internal_transfer" | "swap" | "read_subaccount" | "update_subaccount" | "read_balances" | "read_spot" | "trade_spot" | "read_internal_transfers" | "external_withdraw" | "read_address_book" | "manage_address_book" | "read_members" | "manage_members" | "read_invites" | "manage_invites" | "read_api_keys" | "manage_api_keys" | "read_subaccount_policy" | "manage_subaccount_policy" | "read_activity" | "read_activity_security_details" | "manage_member_mfa_requirement" | "create_deposit_address" | "read_deposit_addresses" | "read_guard_signer_status" | "manage_guard_signer" | "read_auto_withdraw" | "manage_auto_withdraw" | "read_statements" | "convert_dust" | "read_funding_flows">]>;
|
|
10
10
|
readonly displayName: v.OptionalSchema<v.StringSchema<undefined>, "">;
|
|
11
11
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, "">;
|
|
12
|
-
readonly policyAction: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "swap" | "trade-spot" | "internal-transfer" | "external-withdraw" | "read-balances" | "read-spot" | "read-internal-transfers" | "read-address-book" | "manage-address-book" | "read-auto-withdraw" | "manage-auto-withdraw" | "read-api-keys" | "read-api-policies" | "read-subaccount-policies" | "read-subaccount-permissions" | "read-vip-status" | "read-social-verification" | "read-profile" | "read-account-directory" | "read-withdraw-validation" | "read-daily-claims" | "claim-daily-reward" | "read-checkpoints" | "read-rewards" | "create-deposit-address" | "read-deposit-addresses" | "read-subaccounts" | "read-subaccount-activity" | "read-subaccount-members" | "read-subaccount-invites" | "read-guard-signer-status" | "read-price-alerts" | "manage-price-alerts" | "read-statements">]>;
|
|
12
|
+
readonly policyAction: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "swap" | "trade-spot" | "internal-transfer" | "external-withdraw" | "read-balances" | "read-spot" | "read-internal-transfers" | "read-address-book" | "manage-address-book" | "read-auto-withdraw" | "manage-auto-withdraw" | "read-api-keys" | "read-api-policies" | "read-subaccount-policies" | "read-subaccount-permissions" | "read-vip-status" | "read-social-verification" | "read-profile" | "read-account-directory" | "read-withdraw-validation" | "read-daily-claims" | "claim-daily-reward" | "read-checkpoints" | "read-rewards" | "create-deposit-address" | "read-deposit-addresses" | "read-subaccounts" | "read-subaccount-activity" | "read-subaccount-members" | "read-subaccount-invites" | "read-guard-signer-status" | "read-price-alerts" | "manage-price-alerts" | "read-statements" | "convert-dust" | "read-funding-flows">]>;
|
|
13
13
|
}, undefined>;
|
|
14
14
|
type SubaccountPermissionDefinition = v.InferOutput<typeof SubaccountPermissionDefinitionSchema>;
|
|
15
15
|
declare const SubaccountRoleDefinitionSchema: v.ObjectSchema<{
|
|
16
|
-
readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "
|
|
16
|
+
readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer" | "unspecified">]>;
|
|
17
17
|
readonly displayName: v.OptionalSchema<v.StringSchema<undefined>, "">;
|
|
18
18
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, "">;
|
|
19
19
|
readonly assignable: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
20
|
-
readonly permissions: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "internal_transfer" | "swap" | "read_subaccount" | "update_subaccount" | "read_balances" | "read_spot" | "trade_spot" | "read_internal_transfers" | "external_withdraw" | "read_address_book" | "manage_address_book" | "read_members" | "manage_members" | "read_invites" | "manage_invites" | "read_api_keys" | "manage_api_keys" | "read_subaccount_policy" | "manage_subaccount_policy" | "read_activity" | "read_activity_security_details" | "manage_member_mfa_requirement" | "create_deposit_address" | "read_deposit_addresses" | "read_guard_signer_status" | "manage_guard_signer" | "read_auto_withdraw" | "manage_auto_withdraw" | "read_statements">]>, undefined>, readonly []>;
|
|
20
|
+
readonly permissions: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "internal_transfer" | "swap" | "read_subaccount" | "update_subaccount" | "read_balances" | "read_spot" | "trade_spot" | "read_internal_transfers" | "external_withdraw" | "read_address_book" | "manage_address_book" | "read_members" | "manage_members" | "read_invites" | "manage_invites" | "read_api_keys" | "manage_api_keys" | "read_subaccount_policy" | "manage_subaccount_policy" | "read_activity" | "read_activity_security_details" | "manage_member_mfa_requirement" | "create_deposit_address" | "read_deposit_addresses" | "read_guard_signer_status" | "manage_guard_signer" | "read_auto_withdraw" | "manage_auto_withdraw" | "read_statements" | "convert_dust" | "read_funding_flows">]>, undefined>, readonly []>;
|
|
21
21
|
}, undefined>;
|
|
22
22
|
type SubaccountRoleDefinition = v.InferOutput<typeof SubaccountRoleDefinitionSchema>;
|
|
23
23
|
declare const SubaccountRoleCatalogSchema: v.ObjectSchema<{
|
|
24
24
|
readonly permissions: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
25
|
-
readonly permission: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "internal_transfer" | "swap" | "read_subaccount" | "update_subaccount" | "read_balances" | "read_spot" | "trade_spot" | "read_internal_transfers" | "external_withdraw" | "read_address_book" | "manage_address_book" | "read_members" | "manage_members" | "read_invites" | "manage_invites" | "read_api_keys" | "manage_api_keys" | "read_subaccount_policy" | "manage_subaccount_policy" | "read_activity" | "read_activity_security_details" | "manage_member_mfa_requirement" | "create_deposit_address" | "read_deposit_addresses" | "read_guard_signer_status" | "manage_guard_signer" | "read_auto_withdraw" | "manage_auto_withdraw" | "read_statements">]>;
|
|
25
|
+
readonly permission: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "internal_transfer" | "swap" | "read_subaccount" | "update_subaccount" | "read_balances" | "read_spot" | "trade_spot" | "read_internal_transfers" | "external_withdraw" | "read_address_book" | "manage_address_book" | "read_members" | "manage_members" | "read_invites" | "manage_invites" | "read_api_keys" | "manage_api_keys" | "read_subaccount_policy" | "manage_subaccount_policy" | "read_activity" | "read_activity_security_details" | "manage_member_mfa_requirement" | "create_deposit_address" | "read_deposit_addresses" | "read_guard_signer_status" | "manage_guard_signer" | "read_auto_withdraw" | "manage_auto_withdraw" | "read_statements" | "convert_dust" | "read_funding_flows">]>;
|
|
26
26
|
readonly displayName: v.OptionalSchema<v.StringSchema<undefined>, "">;
|
|
27
27
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, "">;
|
|
28
|
-
readonly policyAction: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "swap" | "trade-spot" | "internal-transfer" | "external-withdraw" | "read-balances" | "read-spot" | "read-internal-transfers" | "read-address-book" | "manage-address-book" | "read-auto-withdraw" | "manage-auto-withdraw" | "read-api-keys" | "read-api-policies" | "read-subaccount-policies" | "read-subaccount-permissions" | "read-vip-status" | "read-social-verification" | "read-profile" | "read-account-directory" | "read-withdraw-validation" | "read-daily-claims" | "claim-daily-reward" | "read-checkpoints" | "read-rewards" | "create-deposit-address" | "read-deposit-addresses" | "read-subaccounts" | "read-subaccount-activity" | "read-subaccount-members" | "read-subaccount-invites" | "read-guard-signer-status" | "read-price-alerts" | "manage-price-alerts" | "read-statements">]>;
|
|
28
|
+
readonly policyAction: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "swap" | "trade-spot" | "internal-transfer" | "external-withdraw" | "read-balances" | "read-spot" | "read-internal-transfers" | "read-address-book" | "manage-address-book" | "read-auto-withdraw" | "manage-auto-withdraw" | "read-api-keys" | "read-api-policies" | "read-subaccount-policies" | "read-subaccount-permissions" | "read-vip-status" | "read-social-verification" | "read-profile" | "read-account-directory" | "read-withdraw-validation" | "read-daily-claims" | "claim-daily-reward" | "read-checkpoints" | "read-rewards" | "create-deposit-address" | "read-deposit-addresses" | "read-subaccounts" | "read-subaccount-activity" | "read-subaccount-members" | "read-subaccount-invites" | "read-guard-signer-status" | "read-price-alerts" | "manage-price-alerts" | "read-statements" | "convert-dust" | "read-funding-flows">]>;
|
|
29
29
|
}, undefined>, undefined>, readonly []>;
|
|
30
30
|
readonly roles: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
31
|
-
readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "
|
|
31
|
+
readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer" | "unspecified">]>;
|
|
32
32
|
readonly displayName: v.OptionalSchema<v.StringSchema<undefined>, "">;
|
|
33
33
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, "">;
|
|
34
34
|
readonly assignable: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
35
|
-
readonly permissions: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "internal_transfer" | "swap" | "read_subaccount" | "update_subaccount" | "read_balances" | "read_spot" | "trade_spot" | "read_internal_transfers" | "external_withdraw" | "read_address_book" | "manage_address_book" | "read_members" | "manage_members" | "read_invites" | "manage_invites" | "read_api_keys" | "manage_api_keys" | "read_subaccount_policy" | "manage_subaccount_policy" | "read_activity" | "read_activity_security_details" | "manage_member_mfa_requirement" | "create_deposit_address" | "read_deposit_addresses" | "read_guard_signer_status" | "manage_guard_signer" | "read_auto_withdraw" | "manage_auto_withdraw" | "read_statements">]>, undefined>, readonly []>;
|
|
35
|
+
readonly permissions: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "internal_transfer" | "swap" | "read_subaccount" | "update_subaccount" | "read_balances" | "read_spot" | "trade_spot" | "read_internal_transfers" | "external_withdraw" | "read_address_book" | "manage_address_book" | "read_members" | "manage_members" | "read_invites" | "manage_invites" | "read_api_keys" | "manage_api_keys" | "read_subaccount_policy" | "manage_subaccount_policy" | "read_activity" | "read_activity_security_details" | "manage_member_mfa_requirement" | "create_deposit_address" | "read_deposit_addresses" | "read_guard_signer_status" | "manage_guard_signer" | "read_auto_withdraw" | "manage_auto_withdraw" | "read_statements" | "convert_dust" | "read_funding_flows">]>, undefined>, readonly []>;
|
|
36
36
|
}, undefined>, undefined>, readonly []>;
|
|
37
37
|
}, undefined>;
|
|
38
38
|
type SubaccountRoleCatalog = v.InferOutput<typeof SubaccountRoleCatalogSchema>;
|
|
39
39
|
declare const EffectiveSubaccountPermissionsSchema: v.ObjectSchema<{
|
|
40
|
-
readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "
|
|
41
|
-
readonly permissions: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "internal_transfer" | "swap" | "read_subaccount" | "update_subaccount" | "read_balances" | "read_spot" | "trade_spot" | "read_internal_transfers" | "external_withdraw" | "read_address_book" | "manage_address_book" | "read_members" | "manage_members" | "read_invites" | "manage_invites" | "read_api_keys" | "manage_api_keys" | "read_subaccount_policy" | "manage_subaccount_policy" | "read_activity" | "read_activity_security_details" | "manage_member_mfa_requirement" | "create_deposit_address" | "read_deposit_addresses" | "read_guard_signer_status" | "manage_guard_signer" | "read_auto_withdraw" | "manage_auto_withdraw" | "read_statements">]>, undefined>, readonly []>;
|
|
40
|
+
readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer" | "unspecified">]>;
|
|
41
|
+
readonly permissions: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "internal_transfer" | "swap" | "read_subaccount" | "update_subaccount" | "read_balances" | "read_spot" | "trade_spot" | "read_internal_transfers" | "external_withdraw" | "read_address_book" | "manage_address_book" | "read_members" | "manage_members" | "read_invites" | "manage_invites" | "read_api_keys" | "manage_api_keys" | "read_subaccount_policy" | "manage_subaccount_policy" | "read_activity" | "read_activity_security_details" | "manage_member_mfa_requirement" | "create_deposit_address" | "read_deposit_addresses" | "read_guard_signer_status" | "manage_guard_signer" | "read_auto_withdraw" | "manage_auto_withdraw" | "read_statements" | "convert_dust" | "read_funding_flows">]>, undefined>, readonly []>;
|
|
42
42
|
readonly subaccountPolicyId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
43
43
|
}, undefined>;
|
|
44
44
|
type EffectiveSubaccountPermissions = v.InferOutput<typeof EffectiveSubaccountPermissionsSchema>;
|
|
@@ -163,7 +163,7 @@ declare const ProtoSubaccountStatusSchema: v.SchemaWithPipe<readonly [v.NumberSc
|
|
|
163
163
|
type SubaccountStatus = v.InferOutput<typeof ProtoSubaccountStatusSchema>;
|
|
164
164
|
declare const SubaccountSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
165
165
|
readonly id: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
166
|
-
readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "
|
|
166
|
+
readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer" | "unspecified">]>;
|
|
167
167
|
readonly label: v.OptionalSchema<v.StringSchema<undefined>, "">;
|
|
168
168
|
readonly icon: v.OptionalSchema<v.StringSchema<undefined>, "">;
|
|
169
169
|
readonly color: v.OptionalSchema<v.StringSchema<undefined>, "">;
|
|
@@ -189,7 +189,7 @@ declare const SubaccountSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
|
189
189
|
readonly removed: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
190
190
|
}, undefined>, v.TransformAction<{
|
|
191
191
|
id: string;
|
|
192
|
-
role: "
|
|
192
|
+
role: "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer" | "unspecified";
|
|
193
193
|
label: string;
|
|
194
194
|
icon: string;
|
|
195
195
|
color: string;
|
|
@@ -211,7 +211,7 @@ declare const SubaccountSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
|
211
211
|
updatedAt: number | undefined;
|
|
212
212
|
updatedAtNs: string | undefined;
|
|
213
213
|
id: string;
|
|
214
|
-
role: "
|
|
214
|
+
role: "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer" | "unspecified";
|
|
215
215
|
label: string;
|
|
216
216
|
icon: string;
|
|
217
217
|
color: string;
|
|
@@ -229,7 +229,7 @@ declare const SubaccountSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
|
229
229
|
type Subaccount = v.InferOutput<typeof SubaccountSchema>;
|
|
230
230
|
declare const SubaccountMemberSchema: v.ObjectSchema<{
|
|
231
231
|
readonly accountId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
232
|
-
readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "
|
|
232
|
+
readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer" | "unspecified">]>;
|
|
233
233
|
readonly username: v.OptionalSchema<v.StringSchema<undefined>, "">;
|
|
234
234
|
readonly smartAccountAddress: v.StringSchema<undefined>;
|
|
235
235
|
readonly avatarUrl: v.OptionalSchema<v.StringSchema<undefined>, "">;
|
|
@@ -241,8 +241,8 @@ declare const SubaccountInviteSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<
|
|
|
241
241
|
readonly subaccountId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
242
242
|
readonly granteeAccountId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
243
243
|
readonly inviterAccountId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
244
|
-
readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "
|
|
245
|
-
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
244
|
+
readonly role: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer" | "unspecified">]>;
|
|
245
|
+
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "pending" | "canceled" | "accepted" | "declined">]>;
|
|
246
246
|
readonly createdAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
247
247
|
readonly seconds: v.BigintSchema<undefined>;
|
|
248
248
|
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
@@ -268,8 +268,8 @@ declare const SubaccountInviteSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<
|
|
|
268
268
|
subaccountId: string;
|
|
269
269
|
granteeAccountId: string;
|
|
270
270
|
inviterAccountId: string;
|
|
271
|
-
role: "
|
|
272
|
-
status: "unspecified" | "
|
|
271
|
+
role: "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer" | "unspecified";
|
|
272
|
+
status: "unspecified" | "pending" | "canceled" | "accepted" | "declined";
|
|
273
273
|
createdAt?: number | undefined;
|
|
274
274
|
respondedAt?: number | undefined;
|
|
275
275
|
granteeUsername: string;
|
|
@@ -286,8 +286,8 @@ declare const SubaccountInviteSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<
|
|
|
286
286
|
id: string;
|
|
287
287
|
granteeAccountId: string;
|
|
288
288
|
inviterAccountId: string;
|
|
289
|
-
role: "
|
|
290
|
-
status: "unspecified" | "
|
|
289
|
+
role: "owner" | "admin" | "treasury" | "leveraged_trader" | "trader" | "viewer" | "unspecified";
|
|
290
|
+
status: "unspecified" | "pending" | "canceled" | "accepted" | "declined";
|
|
291
291
|
createdAt?: number | undefined;
|
|
292
292
|
respondedAt?: number | undefined;
|
|
293
293
|
granteeUsername: string;
|
|
@@ -310,7 +310,7 @@ declare const SubaccountActivityEventSchema: v.ObjectSchema<{
|
|
|
310
310
|
nanos: number;
|
|
311
311
|
} | undefined, number | undefined>]>;
|
|
312
312
|
readonly entityKind: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "subaccount" | "api_key" | "account" | "destination" | "security" | "policy" | "session" | "member" | "invite">]>;
|
|
313
|
-
readonly eventAction: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "disabled" | "
|
|
313
|
+
readonly eventAction: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "disabled" | "removed" | "revoked" | "enabled" | "failed" | "applied" | "created" | "updated" | "deleted" | "role_set" | "received" | "replied" | "blocked" | "hold_placed" | "hold_released" | "requested">]>;
|
|
314
314
|
readonly source: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "api" | "web" | "mobile">]>;
|
|
315
315
|
readonly ip: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
316
316
|
readonly userAgent: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -11,7 +11,7 @@ declare const ListStatusEventsInputSchema: v.SchemaWithPipe<readonly [v.StrictOb
|
|
|
11
11
|
/** Previous `nextPageToken`; resend the same `states` and `kinds` with it. */
|
|
12
12
|
readonly pageToken: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>;
|
|
13
13
|
}, undefined>, v.TransformAction<{
|
|
14
|
-
states?: ("
|
|
14
|
+
states?: ("completed" | "canceled" | "scheduled" | "in_progress")[] | undefined;
|
|
15
15
|
kinds?: ("maintenance" | "incident")[] | undefined;
|
|
16
16
|
limit?: number | undefined;
|
|
17
17
|
pageToken?: string | undefined;
|
|
@@ -26,7 +26,7 @@ type ListStatusEventsInput = v.InferInput<typeof ListStatusEventsInputSchema>;
|
|
|
26
26
|
declare const StatusEventSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
27
27
|
readonly id: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
28
28
|
readonly kind: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "maintenance" | "incident">]>;
|
|
29
|
-
readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
29
|
+
readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "completed" | "canceled" | "scheduled" | "in_progress">]>;
|
|
30
30
|
readonly title: v.StringSchema<undefined>;
|
|
31
31
|
readonly message: v.StringSchema<undefined>;
|
|
32
32
|
readonly startTime: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -77,7 +77,7 @@ declare const StatusEventSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
|
77
77
|
}, undefined>, v.TransformAction<{
|
|
78
78
|
id: string;
|
|
79
79
|
kind: "unspecified" | "maintenance" | "incident";
|
|
80
|
-
state: "unspecified" | "
|
|
80
|
+
state: "unspecified" | "completed" | "canceled" | "scheduled" | "in_progress";
|
|
81
81
|
title: string;
|
|
82
82
|
message: string;
|
|
83
83
|
startTime?: number | undefined;
|
|
@@ -98,7 +98,7 @@ declare const StatusEventSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
|
98
98
|
/** Stable across updates; match events across pages by it. */
|
|
99
99
|
id: string;
|
|
100
100
|
kind: "unspecified" | "maintenance" | "incident";
|
|
101
|
-
state: "unspecified" | "
|
|
101
|
+
state: "unspecified" | "completed" | "canceled" | "scheduled" | "in_progress";
|
|
102
102
|
title: string;
|
|
103
103
|
message: string;
|
|
104
104
|
startTime: number | null;
|
|
@@ -128,7 +128,7 @@ declare const ListStatusEventsResultSchema: v.ObjectSchema<{
|
|
|
128
128
|
readonly events: v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
129
129
|
readonly id: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
130
130
|
readonly kind: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "maintenance" | "incident">]>;
|
|
131
|
-
readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
131
|
+
readonly state: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "completed" | "canceled" | "scheduled" | "in_progress">]>;
|
|
132
132
|
readonly title: v.StringSchema<undefined>;
|
|
133
133
|
readonly message: v.StringSchema<undefined>;
|
|
134
134
|
readonly startTime: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -179,7 +179,7 @@ declare const ListStatusEventsResultSchema: v.ObjectSchema<{
|
|
|
179
179
|
}, undefined>, v.TransformAction<{
|
|
180
180
|
id: string;
|
|
181
181
|
kind: "unspecified" | "maintenance" | "incident";
|
|
182
|
-
state: "unspecified" | "
|
|
182
|
+
state: "unspecified" | "completed" | "canceled" | "scheduled" | "in_progress";
|
|
183
183
|
title: string;
|
|
184
184
|
message: string;
|
|
185
185
|
startTime?: number | undefined;
|
|
@@ -200,7 +200,7 @@ declare const ListStatusEventsResultSchema: v.ObjectSchema<{
|
|
|
200
200
|
/** Stable across updates; match events across pages by it. */
|
|
201
201
|
id: string;
|
|
202
202
|
kind: "unspecified" | "maintenance" | "incident";
|
|
203
|
-
state: "unspecified" | "
|
|
203
|
+
state: "unspecified" | "completed" | "canceled" | "scheduled" | "in_progress";
|
|
204
204
|
title: string;
|
|
205
205
|
message: string;
|
|
206
206
|
startTime: number | null;
|
|
@@ -63,7 +63,7 @@ declare function createUserTradeSchema(scales: SdkScales): v.SchemaWithPipe<read
|
|
|
63
63
|
referralShare?: string | undefined;
|
|
64
64
|
orderId: string;
|
|
65
65
|
symbolId: number;
|
|
66
|
-
sideLabel: "
|
|
66
|
+
sideLabel: "unspecified" | "buy" | "sell";
|
|
67
67
|
liquidityLabel: "maker" | "taker";
|
|
68
68
|
feeAsset: "unspecified" | "quote" | "base";
|
|
69
69
|
qty: string;
|
|
@@ -169,7 +169,7 @@ declare const GetUserTradesInputSchema: v.SchemaWithPipe<readonly [v.UnionSchema
|
|
|
169
169
|
readonly orderId: v.OptionalSchema<v.NeverSchema<undefined>, undefined>;
|
|
170
170
|
readonly lineageId: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.TransformAction<string, bigint>]>, v.CheckAction<bigint, `${string} must be greater than zero`>]>;
|
|
171
171
|
readonly throughGeneration: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>, undefined>;
|
|
172
|
-
}, undefined>], undefined>], ({ input }: v.UnionIssue<v.NumberIssue | v.BooleanIssue | v.IntegerIssue<number> | v.MinValueIssue<number, 1> | v.MaxValueIssue<number, 4294967295> | v.
|
|
172
|
+
}, undefined>], undefined>], ({ input }: v.UnionIssue<v.NumberIssue | v.StringIssue | v.BooleanIssue | v.IntegerIssue<number> | v.MinValueIssue<number, 1> | v.MaxValueIssue<number, 4294967295> | v.StrictObjectIssue | v.PicklistIssue | v.MinLengthIssue<string, 1> | v.UnionIssue<v.StringIssue | v.StrictObjectIssue | v.PicklistIssue | v.MinLengthIssue<string, 1>> | v.GtValueIssue<number, 0> | v.CheckIssue<bigint> | v.NeverIssue | v.MaxValueIssue<number, 1000> | v.UnionIssue<v.NumberIssue | v.StringIssue | v.BooleanIssue | v.IntegerIssue<number> | v.MinValueIssue<number, 1> | v.MaxValueIssue<number, 4294967295> | v.StrictObjectIssue | v.PicklistIssue | v.MinLengthIssue<string, 1> | v.UnionIssue<v.StringIssue | v.StrictObjectIssue | v.PicklistIssue | v.MinLengthIssue<string, 1>> | v.GtValueIssue<number, 0> | v.CheckIssue<bigint> | v.NeverIssue | v.MaxValueIssue<number, 1000>>>) => "Provide at most one of orderId or lineageId" | "throughGeneration requires lineageId" | "symbolId is required when afterMatchId is set" | "Invalid trade filters">, v.TransformAction<{
|
|
173
173
|
symbolId?: number | undefined;
|
|
174
174
|
afterMatchId?: undefined;
|
|
175
175
|
side?: Side.BUY | Side.SELL | undefined;
|
|
@@ -5,10 +5,10 @@ import { parseOptionalUint64DecimalStrict } from "../../utils/numbers.js";
|
|
|
5
5
|
import { tsNsToISO, tsNsToMs } from "../../utils/time.js";
|
|
6
6
|
import { U128Schema, optionalUint64DecimalFilterSchema } from "../../shared/schemas.js";
|
|
7
7
|
import { enumLabel } from "../../shared/proto-enum-codec.js";
|
|
8
|
+
import { fromU128 } from "../../utils/u128.js";
|
|
8
9
|
import { scaledToDecimalOutput } from "../../shared/decimal-surface.js";
|
|
9
10
|
import { SideSchema, SymbolIdInputSchema } from "../shared.js";
|
|
10
11
|
import { AccountScopeInputEntries, accountScopeToSubaccountId } from "../../shared/account-scope.js";
|
|
11
|
-
import { fromU128 } from "../../utils/u128.js";
|
|
12
12
|
import { FeeAssetCodec, OrderSideCodec } from "../orders/order-enums.codecs.js";
|
|
13
13
|
import { OrderLineageSchema } from "../orders/order-lineage.schemas.js";
|
|
14
14
|
import { TradeSideCodec } from "./trades.codecs.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../../gen/chain/withdraw/v1/withdraw_pb.js";
|
|
2
2
|
import { ConfigurationError } from "../../shared/errors.js";
|
|
3
3
|
import { U128Schema } from "../../shared/schemas.js";
|
|
4
|
+
import { fromU128, toU128 } from "../../utils/u128.js";
|
|
4
5
|
import { quantityInputToE18, scaledToDecimalOutput } from "../../shared/decimal-surface.js";
|
|
5
6
|
import { PositiveUint32InputSchema } from "../shared.js";
|
|
6
7
|
import { AccountScopeInputEntries, accountScopeToSubaccountId } from "../../shared/account-scope.js";
|
|
7
|
-
import { fromU128, toU128 } from "../../utils/u128.js";
|
|
8
8
|
import { TradingWithdrawActionCodec, WithdrawDestinationValidationCodeCodec } from "./trading-withdraws.codecs.js";
|
|
9
9
|
import * as v from "valibot";
|
|
10
10
|
//#region src/services/trading-withdraws/trading-withdraws.schemas.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { wireTimestampToMs } from "../../utils/time.js";
|
|
2
2
|
import { OptionalPublicIdSchema, OptionalTimestampMsToUsInputSchema, U128Schema } from "../../shared/schemas.js";
|
|
3
3
|
import { enumLabel, enumLabelSchema } from "../../shared/proto-enum-codec.js";
|
|
4
|
+
import { fromU128 } from "../../utils/u128.js";
|
|
4
5
|
import { scaledToDecimalOutput } from "../../shared/decimal-surface.js";
|
|
5
6
|
import { AccountScopeInputEntries, accountScopeToSubaccountId } from "../../shared/account-scope.js";
|
|
6
|
-
import { fromU128 } from "../../utils/u128.js";
|
|
7
7
|
import { AccountCodeCodec, TRANSFER_CODE_VALUES, TransferCodeCodec } from "../../shared/ledger-codes.js";
|
|
8
8
|
import { TransferSideKindCodec } from "./transfers.codecs.js";
|
|
9
9
|
import * as v from "valibot";
|
|
@@ -1116,9 +1116,9 @@ declare const ListTriggersInputSchema: v.SchemaWithPipe<readonly [v.StrictObject
|
|
|
1116
1116
|
/** Both legs of the OCO with this ID. */
|
|
1117
1117
|
readonly orderListId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, bigint | undefined>]>;
|
|
1118
1118
|
/** Both legs of the OCO created with this client list ID. */
|
|
1119
|
-
readonly clientListId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.
|
|
1119
|
+
readonly clientListId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, "clientListId has an invalid format">]>, undefined>;
|
|
1120
1120
|
readonly symbolId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>, undefined>;
|
|
1121
|
-
readonly status: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["created", "armed", "running", "completed", "canceled", "failed", "paused"], undefined>, undefined>, undefined>, v.TransformAction<("
|
|
1121
|
+
readonly status: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["created", "armed", "running", "completed", "canceled", "failed", "paused"], undefined>, undefined>, undefined>, v.TransformAction<("completed" | "failed" | "paused" | "canceled" | "armed" | "created" | "running")[] | undefined, (TriggerStatus.STATUS_CREATED | TriggerStatus.STATUS_ARMED | TriggerStatus.STATUS_RUNNING | TriggerStatus.STATUS_COMPLETED | TriggerStatus.STATUS_CANCELED | TriggerStatus.STATUS_FAILED | TriggerStatus.STATUS_PAUSED)[]>]>;
|
|
1122
1122
|
readonly triggerType: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["stop_loss", "take_profit", "trailing_stop", "twap", "ladder"], undefined>, undefined>, v.TransformAction<"twap" | "ladder" | "stop_loss" | "take_profit" | "trailing_stop" | undefined, TriggerType>]>;
|
|
1123
1123
|
readonly limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 1000, undefined>]>, 50>;
|
|
1124
1124
|
readonly pageToken: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, "">;
|
|
@@ -1204,7 +1204,7 @@ declare function createCreateOcoInputSchema(scales: SdkScales): v.SchemaWithPipe
|
|
|
1204
1204
|
readonly symbolId: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>;
|
|
1205
1205
|
readonly side: v.SchemaWithPipe<readonly [v.PicklistSchema<readonly ["buy", "sell"], undefined>, v.TransformAction<"buy" | "sell", Side.BUY | Side.SELL>]>;
|
|
1206
1206
|
readonly qty: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
1207
|
-
readonly clientListId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.
|
|
1207
|
+
readonly clientListId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 36, undefined>, v.RegexAction<string, "clientListId has an invalid format">]>, typeof createMutationRequestId>;
|
|
1208
1208
|
readonly selfTradePreventionMode: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["expire_taker", "expire_maker", "expire_both", "decrement"], undefined>, "expire_maker">, v.TransformAction<"expire_taker" | "expire_maker" | "expire_both" | "decrement", SelfTradePreventionMode.EXPIRE_MAKER | SelfTradePreventionMode.EXPIRE_TAKER | SelfTradePreventionMode.EXPIRE_BOTH | SelfTradePreventionMode.DECREMENT>]>;
|
|
1209
1209
|
readonly takeProfit: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
1210
1210
|
readonly triggerPrice: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>;
|
|
@@ -1382,7 +1382,8 @@ declare function createCreateOcoInputSchema(scales: SdkScales): v.SchemaWithPipe
|
|
|
1382
1382
|
* reserved `qty` of `side` and cancel each other. A sell protects held base, a buy spends held
|
|
1383
1383
|
* quote. Each leg exits at market (`market_ioc`) or with a resting `limit_gtc`. The server
|
|
1384
1384
|
* refuses `decrement` self-trade prevention on an OCO.
|
|
1385
|
-
* `clientListId` (1 to 36
|
|
1385
|
+
* `clientListId` (1 to 36 letters, digits, `.`, `_`, `:`, `/` or `-`, like `clientOrderId`) is
|
|
1386
|
+
* the idempotency key and is generated when omitted: pass your
|
|
1386
1387
|
* own to find the legs with `list({ clientListId })` after an `OutcomeUnknownError`.
|
|
1387
1388
|
*/
|
|
1388
1389
|
type CreateOcoInput = v.InferInput<ReturnType<typeof createCreateOcoInputSchema>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger-input.schemas.d.ts","names":[],"sources":["../../../src/services/triggers/trigger-input.schemas.ts"],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"trigger-input.schemas.d.ts","names":[],"sources":["../../../src/services/triggers/trigger-input.schemas.ts"],"mappings":";;;;;;;;;;;;iBAmZgB,+BAA+B,QAAQ,YAAS,EAAA,WAAA,EAAA,WAAA,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8CAe/D,EAAA;;KAGW,qBAAqB,EAAE,WAAW,kBAAkB;;cAGnD,yBAAuB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoCxB,oBAAoB,EAAE,kBAAkB;cAEvC,0BAAwB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;KACzB,qBAAqB,EAAE,kBAAkB;;cAGxC,gCAA8B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;KAgB/B,2BAA2B,EAAE,kBAAkB;cAE9C,sBAAoB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;KAWrB,iBAAiB,EAAE,kBAAkB;iBAEjC,2BAA2B,QAAQ,YAAS,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+ChD,iBAAiB,EAAE,WAAW,kBAAkB;cAE/C,uBAAqB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;KACtB,kBAAkB,EAAE,kBAAkB;cAErC,yBAAuB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;KACxB,oBAAoB,EAAE,kBAAkB;cAEvC,0BAAwB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;KAWzB,qBAAqB,EAAE,kBAAkB;iBAErC,+BAA+B,QAAQ,YAAS,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4DpD,qBAAqB,EAAE,WAAW,kBAAkB;cAEnD,8BAA4B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;KAiB7B,yBAAyB,EAAE,kBAAkB"}
|
|
@@ -9,7 +9,7 @@ import { positiveDecimalInputToScaled } from "../../shared/decimal-surface.js";
|
|
|
9
9
|
import { BpsStringOrNumberInputSchema, NoneInputSchema, SymbolIdInputSchema } from "../shared.js";
|
|
10
10
|
import { AccountScopeInputEntries, accountScopeToSubaccountId } from "../../shared/account-scope.js";
|
|
11
11
|
import { OrderSideCodec, TriggerPriceSourceInputSchema } from "../orders/order-enums.codecs.js";
|
|
12
|
-
import { OrderRequestIdInputSchema, positiveOrderIdInputSchema } from "../orders/orders-identifiers.schemas.js";
|
|
12
|
+
import { OrderIdempotencyKeyPattern, OrderRequestIdInputSchema, positiveOrderIdInputSchema } from "../orders/orders-identifiers.schemas.js";
|
|
13
13
|
import { MAX_SELLING_SLIPPAGE_BPS, parseTrailingDistanceInput } from "../trailing-oneof-inputs.js";
|
|
14
14
|
import { attachedTriggerInputSchema } from "../orders/orders-risk.schemas.js";
|
|
15
15
|
import { TRIGGER_EVENT_TYPE_VALUES, TRIGGER_STATUS_FILTER_VALUES, TRIGGER_TYPE_VALUES, TriggerEventTypeCodec, TriggerStatusCodec, TriggerTypeCodec } from "./triggers.codecs.js";
|
|
@@ -21,7 +21,7 @@ const TriggerTypeSchema = v.picklist(TRIGGER_TYPE_VALUES);
|
|
|
21
21
|
const TriggerStatusFilterSchema = v.picklist(TRIGGER_STATUS_FILTER_VALUES);
|
|
22
22
|
const TriggerEventTypeSchema = v.picklist(TRIGGER_EVENT_TYPE_VALUES);
|
|
23
23
|
const TriggerIdInputSchema = positiveOrderIdInputSchema("triggerId");
|
|
24
|
-
const ClientListIdInputSchema = v.pipe(v.string(), v.minLength(1), v.
|
|
24
|
+
const ClientListIdInputSchema = v.pipe(v.string(), v.minLength(1), v.maxLength(36), v.regex(OrderIdempotencyKeyPattern, "clientListId has an invalid format"));
|
|
25
25
|
const TriggerScopedInputEntries = {
|
|
26
26
|
triggerId: TriggerIdInputSchema,
|
|
27
27
|
...AccountScopeInputEntries
|