@polyester/sdk 0.35.0-devnet-20261111031027 → 0.35.0-devnet-20261111161451
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 +35 -1
- package/dist/catalogs/snapshot-validation.js +2 -1
- package/dist/catalogs/snapshot-validation.js.map +1 -1
- package/dist/client.d.ts +6 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +6 -0
- package/dist/client.js.map +1 -1
- package/dist/gen/ai/v1/assistant_pb.d.ts +4164 -0
- package/dist/gen/ai/v1/assistant_pb.d.ts.map +1 -0
- package/dist/gen/ai/v1/assistant_pb.js +1174 -0
- package/dist/gen/ai/v1/assistant_pb.js.map +1 -0
- package/dist/gen/alerts/v1/price_alerts_pb.d.ts +776 -0
- package/dist/gen/alerts/v1/price_alerts_pb.d.ts.map +1 -0
- package/dist/gen/alerts/v1/price_alerts_pb.js +378 -0
- package/dist/gen/alerts/v1/price_alerts_pb.js.map +1 -0
- package/dist/gen/auth/v1/address_book_pb.d.ts +6 -0
- package/dist/gen/auth/v1/address_book_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/address_book_pb.js +6 -0
- package/dist/gen/auth/v1/address_book_pb.js.map +1 -1
- package/dist/gen/auth/v1/api_keys_pb.d.ts +242 -2
- package/dist/gen/auth/v1/api_keys_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/api_keys_pb.js +81 -2
- package/dist/gen/auth/v1/api_keys_pb.js.map +1 -1
- package/dist/gen/auth/v1/auth_pb.d.ts +48 -6
- package/dist/gen/auth/v1/auth_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/auth_pb.js +48 -6
- package/dist/gen/auth/v1/auth_pb.js.map +1 -1
- package/dist/gen/auth/v1/policies_pb.d.ts +83 -19
- package/dist/gen/auth/v1/policies_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/policies_pb.js +74 -16
- package/dist/gen/auth/v1/policies_pb.js.map +1 -1
- package/dist/gen/auth/v1/social_verification_pb.d.ts +167 -11
- package/dist/gen/auth/v1/social_verification_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/social_verification_pb.js +41 -3
- package/dist/gen/auth/v1/social_verification_pb.js.map +1 -1
- package/dist/gen/auth/v1/subaccounts_pb.d.ts +17 -6
- package/dist/gen/auth/v1/subaccounts_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/subaccounts_pb.js.map +1 -1
- package/dist/gen/chain/deposit/v1/deposit_pb.d.ts +4 -2
- package/dist/gen/chain/deposit/v1/deposit_pb.d.ts.map +1 -1
- package/dist/gen/chain/deposit/v1/deposit_pb.js.map +1 -1
- package/dist/gen/chain/guard/v1/guard_signer_pb.d.ts +5 -0
- package/dist/gen/chain/guard/v1/guard_signer_pb.d.ts.map +1 -1
- package/dist/gen/chain/guard/v1/guard_signer_pb.js.map +1 -1
- package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.d.ts +10 -0
- package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.d.ts.map +1 -1
- package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.js +1 -1
- package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.js.map +1 -1
- package/dist/gen/chain/lifecycle/v1/types_pb.d.ts +32 -4
- package/dist/gen/chain/lifecycle/v1/types_pb.d.ts.map +1 -1
- package/dist/gen/chain/lifecycle/v1/types_pb.js +32 -4
- package/dist/gen/chain/lifecycle/v1/types_pb.js.map +1 -1
- package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts +391 -42
- package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts.map +1 -1
- package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.js +103 -17
- package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.js.map +1 -1
- package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts +170 -3
- package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts.map +1 -1
- package/dist/gen/chain/withdraw/v1/withdraw_pb.js +63 -2
- package/dist/gen/chain/withdraw/v1/withdraw_pb.js.map +1 -1
- package/dist/gen/claims/v1/claims_pb.d.ts +1 -1
- package/dist/gen/claims/v1/claims_pb.js +1 -1
- package/dist/gen/claims/v1/claims_pb.js.map +1 -1
- package/dist/gen/index.d.ts +14 -10
- package/dist/gen/index.js +11 -7
- package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts +1 -1
- package/dist/gen/ledger/v1/catalog_pb.d.ts +9 -1
- package/dist/gen/ledger/v1/catalog_pb.d.ts.map +1 -1
- package/dist/gen/ledger/v1/catalog_pb.js +9 -1
- package/dist/gen/ledger/v1/catalog_pb.js.map +1 -1
- package/dist/gen/marketdata/v1/marketdata_pb.d.ts +8 -0
- package/dist/gen/marketdata/v1/marketdata_pb.d.ts.map +1 -1
- package/dist/gen/marketdata/v1/marketdata_pb.js +1 -1
- package/dist/gen/marketdata/v1/marketdata_pb.js.map +1 -1
- package/dist/gen/orders/v1/orders_pb.d.ts +4 -4
- package/dist/gen/orders/v1/orders_pb.js.map +1 -1
- package/dist/gen/orders/v1/orders_read_pb.d.ts +1 -1
- package/dist/gen/polyester/ratelimit/v1/types_pb.d.ts +20 -1
- package/dist/gen/polyester/ratelimit/v1/types_pb.d.ts.map +1 -1
- package/dist/gen/polyester/ratelimit/v1/types_pb.js +20 -1
- package/dist/gen/polyester/ratelimit/v1/types_pb.js.map +1 -1
- package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts +1186 -127
- package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts.map +1 -1
- package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js +282 -5
- package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js.map +1 -1
- package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts +253 -38
- package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts.map +1 -1
- package/dist/gen/swap/quickswap/v1/quickswap_pb.js +180 -36
- package/dist/gen/swap/quickswap/v1/quickswap_pb.js.map +1 -1
- package/dist/gen/swap/quickswap/v1/quickswap_referral_pb.d.ts +933 -0
- package/dist/gen/swap/quickswap/v1/quickswap_referral_pb.d.ts.map +1 -0
- package/dist/gen/swap/quickswap/v1/quickswap_referral_pb.js +292 -0
- package/dist/gen/swap/quickswap/v1/quickswap_referral_pb.js.map +1 -0
- package/dist/gen/system/v1/system_pb.d.ts +77 -0
- package/dist/gen/system/v1/system_pb.d.ts.map +1 -0
- package/dist/gen/system/v1/system_pb.js +34 -0
- package/dist/gen/system/v1/system_pb.js.map +1 -0
- package/dist/gen/tradews/v1/trade_ws_pb.d.ts +2 -2
- package/dist/gen/tradews/v1/trade_ws_pb.js.map +1 -1
- package/dist/index.d.ts +14 -6
- package/dist/services/api-keys/api-keys.codecs.js +10 -1
- package/dist/services/api-keys/api-keys.codecs.js.map +1 -1
- package/dist/services/api-keys/api-keys.d.ts +16 -1
- package/dist/services/api-keys/api-keys.d.ts.map +1 -1
- package/dist/services/api-keys/api-keys.js +25 -1
- package/dist/services/api-keys/api-keys.js.map +1 -1
- package/dist/services/api-keys/api-keys.schemas.d.ts +116 -1
- package/dist/services/api-keys/api-keys.schemas.d.ts.map +1 -1
- package/dist/services/api-keys/api-keys.schemas.js +29 -3
- package/dist/services/api-keys/api-keys.schemas.js.map +1 -1
- package/dist/services/api-keys/api-keys.types.d.ts +2 -2
- package/dist/services/api-keys/index.d.ts +2 -2
- package/dist/services/assistant/assistant-events.schemas.d.ts +4618 -0
- package/dist/services/assistant/assistant-events.schemas.d.ts.map +1 -0
- package/dist/services/assistant/assistant-events.schemas.js +485 -0
- package/dist/services/assistant/assistant-events.schemas.js.map +1 -0
- package/dist/services/assistant/assistant.codecs.d.ts +24 -0
- package/dist/services/assistant/assistant.codecs.d.ts.map +1 -0
- package/dist/services/assistant/assistant.codecs.js +88 -0
- package/dist/services/assistant/assistant.codecs.js.map +1 -0
- package/dist/services/assistant/assistant.d.ts +76 -0
- package/dist/services/assistant/assistant.d.ts.map +1 -0
- package/dist/services/assistant/assistant.js +133 -0
- package/dist/services/assistant/assistant.js.map +1 -0
- package/dist/services/assistant/assistant.schemas.d.ts +184 -0
- package/dist/services/assistant/assistant.schemas.d.ts.map +1 -0
- package/dist/services/assistant/assistant.schemas.js +135 -0
- package/dist/services/assistant/assistant.schemas.js.map +1 -0
- package/dist/services/assistant/assistant.types.d.ts +4 -0
- package/dist/services/assistant/service.d.ts +8 -0
- package/dist/services/assistant/service.d.ts.map +1 -0
- package/dist/services/assistant/service.js +9 -0
- package/dist/services/assistant/service.js.map +1 -0
- package/dist/services/auto-withdraw/auto-withdraw.codecs.d.ts +9 -2
- package/dist/services/auto-withdraw/auto-withdraw.codecs.d.ts.map +1 -1
- package/dist/services/auto-withdraw/auto-withdraw.codecs.js +9 -1
- package/dist/services/auto-withdraw/auto-withdraw.codecs.js.map +1 -1
- package/dist/services/auto-withdraw/auto-withdraw.d.ts +15 -4
- package/dist/services/auto-withdraw/auto-withdraw.d.ts.map +1 -1
- package/dist/services/auto-withdraw/auto-withdraw.js +24 -8
- package/dist/services/auto-withdraw/auto-withdraw.js.map +1 -1
- package/dist/services/auto-withdraw/auto-withdraw.schemas.d.ts +394 -26
- package/dist/services/auto-withdraw/auto-withdraw.schemas.d.ts.map +1 -1
- package/dist/services/auto-withdraw/auto-withdraw.schemas.js +67 -12
- package/dist/services/auto-withdraw/auto-withdraw.schemas.js.map +1 -1
- package/dist/services/auto-withdraw/auto-withdraw.types.d.ts +3 -3
- package/dist/services/balances/balances.js +1 -1
- package/dist/services/balances/balances.schemas.d.ts +3 -3
- package/dist/services/candles/candles.js +1 -1
- package/dist/services/candles/candles.schemas.d.ts +10 -10
- package/dist/services/candles/candles.schemas.js +5 -2
- package/dist/services/candles/candles.schemas.js.map +1 -1
- package/dist/services/changelog/changelog.schemas.d.ts +17 -17
- package/dist/services/checkpoints/checkpoints.schemas.d.ts +1 -1
- package/dist/services/heatmap/heatmap.schemas.d.ts +4 -4
- package/dist/services/internal-transfers/internal-transfers.schemas.d.ts +3 -3
- package/dist/services/lifecycle/lifecycle.codecs.d.ts +2 -2
- package/dist/services/lifecycle/lifecycle.codecs.d.ts.map +1 -1
- package/dist/services/lifecycle/lifecycle.codecs.js +3 -1
- package/dist/services/lifecycle/lifecycle.codecs.js.map +1 -1
- package/dist/services/lifecycle/lifecycle.schemas.d.ts +210 -186
- package/dist/services/lifecycle/lifecycle.schemas.d.ts.map +1 -1
- package/dist/services/lifecycle/lifecycle.schemas.js +7 -1
- package/dist/services/lifecycle/lifecycle.schemas.js.map +1 -1
- package/dist/services/market-data/market-data.js +1 -1
- package/dist/services/market-data/market-data.schemas.js +7 -2
- package/dist/services/market-data/market-data.schemas.js.map +1 -1
- package/dist/services/market-overview/market-overview.schemas.d.ts +1 -1
- package/dist/services/orderbook/orderbook.schemas.d.ts +1 -1
- package/dist/services/orders/order-errors.schemas.d.ts +2 -2
- package/dist/services/orders/orders-batch.schemas.d.ts +54 -54
- package/dist/services/orders/orders-input.schemas.d.ts +6 -6
- package/dist/services/orders/orders-input.schemas.js +1 -1
- package/dist/services/orders/orders-modify.schemas.js +1 -1
- package/dist/services/orders/orders-output.schemas.d.ts +16 -16
- package/dist/services/orders/orders-output.schemas.js +3 -3
- package/dist/services/orders/orders-risk.schemas.js +1 -1
- package/dist/services/orders/orders.codecs.js +1 -1
- package/dist/services/orders/orders.js +3 -3
- package/dist/services/policies/api-key-policies/api-key-policies.schemas.d.ts +15 -15
- package/dist/services/policies/shared.codecs.js +24 -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 +3 -3
- package/dist/services/price-alerts/price-alerts.codecs.d.ts +20 -0
- package/dist/services/price-alerts/price-alerts.codecs.d.ts.map +1 -0
- package/dist/services/price-alerts/price-alerts.codecs.js +66 -0
- package/dist/services/price-alerts/price-alerts.codecs.js.map +1 -0
- package/dist/services/price-alerts/price-alerts.d.ts +38 -0
- package/dist/services/price-alerts/price-alerts.d.ts.map +1 -0
- package/dist/services/price-alerts/price-alerts.js +60 -0
- package/dist/services/price-alerts/price-alerts.js.map +1 -0
- package/dist/services/price-alerts/price-alerts.schemas.d.ts +309 -0
- package/dist/services/price-alerts/price-alerts.schemas.d.ts.map +1 -0
- package/dist/services/price-alerts/price-alerts.schemas.js +130 -0
- package/dist/services/price-alerts/price-alerts.schemas.js.map +1 -0
- package/dist/services/price-alerts/price-alerts.types.d.ts +3 -0
- package/dist/services/price-alerts/service.d.ts +8 -0
- package/dist/services/price-alerts/service.d.ts.map +1 -0
- package/dist/services/price-alerts/service.js +9 -0
- package/dist/services/price-alerts/service.js.map +1 -0
- package/dist/services/social-verification/social-verification.codecs.js +13 -5
- package/dist/services/social-verification/social-verification.codecs.js.map +1 -1
- package/dist/services/social-verification/social-verification.d.ts +18 -3
- package/dist/services/social-verification/social-verification.d.ts.map +1 -1
- package/dist/services/social-verification/social-verification.js +26 -3
- package/dist/services/social-verification/social-verification.js.map +1 -1
- package/dist/services/social-verification/social-verification.schemas.d.ts +33 -7
- package/dist/services/social-verification/social-verification.schemas.d.ts.map +1 -1
- package/dist/services/social-verification/social-verification.schemas.js +35 -10
- package/dist/services/social-verification/social-verification.schemas.js.map +1 -1
- package/dist/services/social-verification/social-verification.types.d.ts +2 -2
- package/dist/services/subaccounts/subaccounts.schemas.d.ts +8 -8
- package/dist/services/system/service.d.ts +8 -0
- package/dist/services/system/service.d.ts.map +1 -0
- package/dist/services/system/service.js +9 -0
- package/dist/services/system/service.js.map +1 -0
- package/dist/services/system/system.d.ts +25 -0
- package/dist/services/system/system.d.ts.map +1 -0
- package/dist/services/system/system.js +24 -0
- package/dist/services/system/system.js.map +1 -0
- package/dist/services/trades/trades.js +1 -1
- package/dist/services/trades/trades.schemas.d.ts +1 -1
- package/dist/services/trades/trades.schemas.js +1 -1
- package/dist/services/trading-withdraws/trading-withdraws.d.ts +7 -1
- package/dist/services/trading-withdraws/trading-withdraws.d.ts.map +1 -1
- package/dist/services/trading-withdraws/trading-withdraws.js +11 -1
- package/dist/services/trading-withdraws/trading-withdraws.js.map +1 -1
- package/dist/services/trading-withdraws/trading-withdraws.schemas.d.ts +42 -1
- package/dist/services/trading-withdraws/trading-withdraws.schemas.d.ts.map +1 -1
- package/dist/services/trading-withdraws/trading-withdraws.schemas.js +19 -3
- package/dist/services/trading-withdraws/trading-withdraws.schemas.js.map +1 -1
- package/dist/services/trading-withdraws/trading-withdraws.types.d.ts +2 -2
- package/dist/services/transfers/transfers.schemas.d.ts +5 -5
- package/dist/services/triggers/trigger-child-order.schemas.js +1 -1
- package/dist/services/triggers/trigger-input.schemas.d.ts +2 -2
- package/dist/services/triggers/trigger-input.schemas.js +1 -1
- package/dist/services/triggers/triggers-output.schemas.d.ts +49 -49
- package/dist/services/triggers/triggers.codecs.js +1 -1
- package/dist/services/triggers/triggers.js +2 -2
- package/dist/shared/catalog-config.d.ts +5 -0
- package/dist/shared/catalog-config.d.ts.map +1 -1
- package/dist/shared/catalog-config.js.map +1 -1
- package/dist/shared/connect-error-mapping.d.ts.map +1 -1
- package/dist/shared/connect-error-mapping.js +1 -0
- package/dist/shared/connect-error-mapping.js.map +1 -1
- package/dist/shared/error-detail.d.ts +24 -10
- package/dist/shared/error-detail.d.ts.map +1 -1
- package/dist/shared/error-detail.js +2 -0
- package/dist/shared/error-detail.js.map +1 -1
- package/dist/shared/error-details/alerts.js +15 -0
- package/dist/shared/error-details/alerts.js.map +1 -0
- package/dist/shared/error-details/assistant.js +15 -0
- package/dist/shared/error-details/assistant.js.map +1 -0
- package/dist/shared/error-details/withdraw.js +11 -2
- package/dist/shared/error-details/withdraw.js.map +1 -1
- package/dist/shared/ledger-codes.d.ts +4 -2
- package/dist/shared/ledger-codes.d.ts.map +1 -1
- package/dist/shared/ledger-codes.js +6 -3
- package/dist/shared/ledger-codes.js.map +1 -1
- package/dist/shared/rate-limit.schemas.d.ts +3 -3
- package/dist/shared/rate-limit.schemas.d.ts.map +1 -1
- package/dist/shared/rate-limit.schemas.js +4 -1
- package/dist/shared/rate-limit.schemas.js.map +1 -1
- package/dist/shared/transports.d.ts +2 -1
- package/dist/shared/transports.d.ts.map +1 -1
- package/dist/shared/transports.js.map +1 -1
- package/dist/wired-services.d.ts.map +1 -1
- package/dist/wired-services.js +11 -5
- package/dist/wired-services.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import { AlertChannel, AlertDirection, AlertPriceSource, AlertStatus } from "../../gen/alerts/v1/price_alerts_pb.js";
|
|
2
|
+
import * as v from "valibot";
|
|
3
|
+
//#region src/services/price-alerts/price-alerts.schemas.d.ts
|
|
4
|
+
declare const CreatePriceAlertInputSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
5
|
+
readonly symbolId: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>;
|
|
6
|
+
readonly direction: v.PicklistSchema<readonly ["above", "below"], undefined>;
|
|
7
|
+
/** Omit to watch the index price on markets that have one, else the last price. */
|
|
8
|
+
readonly priceSource: v.OptionalSchema<v.PicklistSchema<readonly ["last_price", "index_price"], undefined>, undefined>;
|
|
9
|
+
/** Alert price as a decimal string, e.g. `"90000"`. */
|
|
10
|
+
readonly price: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, bigint>]>;
|
|
11
|
+
readonly channels: v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<readonly ["in_app", "telegram"], undefined>, undefined>, v.MinLengthAction<("in_app" | "telegram")[], 1, "At least one channel is required.">, v.MaxLengthAction<("in_app" | "telegram")[], 2, "At most two channels are allowed.">, v.CheckAction<("in_app" | "telegram")[], "Channels must be distinct.">, v.TransformAction<("in_app" | "telegram")[], (AlertChannel.IN_APP | AlertChannel.TELEGRAM)[]>]>;
|
|
12
|
+
/** Reusing a key with the same request returns the alert it created. */
|
|
13
|
+
readonly idempotencyKey: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
14
|
+
}, undefined>, v.TransformAction<{
|
|
15
|
+
symbolId: number;
|
|
16
|
+
direction: "above" | "below";
|
|
17
|
+
priceSource?: "last_price" | "index_price" | undefined;
|
|
18
|
+
price: bigint;
|
|
19
|
+
channels: (AlertChannel.IN_APP | AlertChannel.TELEGRAM)[];
|
|
20
|
+
idempotencyKey?: string | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
direction: AlertDirection.ABOVE | AlertDirection.BELOW;
|
|
23
|
+
priceSource: AlertPriceSource.LAST_PRICE | AlertPriceSource.INDEX_PRICE | undefined;
|
|
24
|
+
priceTicks: bigint;
|
|
25
|
+
symbolId: number;
|
|
26
|
+
channels: (AlertChannel.IN_APP | AlertChannel.TELEGRAM)[];
|
|
27
|
+
idempotencyKey?: string | undefined;
|
|
28
|
+
}>]>;
|
|
29
|
+
type CreatePriceAlertInput = v.InferInput<typeof CreatePriceAlertInputSchema>;
|
|
30
|
+
declare const ListPriceAlertsInputSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
31
|
+
/** Only alerts in these states; omit or empty for every state. */
|
|
32
|
+
readonly statuses: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["active", "triggered", "cancelled"], undefined>, undefined>, undefined>;
|
|
33
|
+
/** Only alerts on this market. */
|
|
34
|
+
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>;
|
|
35
|
+
/** Page size: default 50, at most 200. */
|
|
36
|
+
readonly limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>, v.MaxValueAction<number, 200, undefined>]>, undefined>;
|
|
37
|
+
/** Previous `nextPageToken`; reuse only with the same filters. */
|
|
38
|
+
readonly pageToken: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>;
|
|
39
|
+
}, undefined>, v.TransformAction<{
|
|
40
|
+
statuses?: ("active" | "triggered" | "cancelled")[] | undefined;
|
|
41
|
+
symbolId?: number | undefined;
|
|
42
|
+
limit?: number | undefined;
|
|
43
|
+
pageToken?: string | undefined;
|
|
44
|
+
}, {
|
|
45
|
+
statuses: (AlertStatus.ACTIVE | AlertStatus.TRIGGERED | AlertStatus.CANCELLED)[] | undefined;
|
|
46
|
+
symbolId?: number | undefined;
|
|
47
|
+
limit?: number | undefined;
|
|
48
|
+
pageToken?: string | undefined;
|
|
49
|
+
}>]>;
|
|
50
|
+
type ListPriceAlertsInput = v.InferInput<typeof ListPriceAlertsInputSchema>;
|
|
51
|
+
declare const UpdatePriceAlertInputSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
52
|
+
readonly alertId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.TransformAction<string, bigint>]>;
|
|
53
|
+
/** The alert's `revision` from the last read. */
|
|
54
|
+
readonly expectedRevision: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, v.RegexAction<string, `${string} must be a decimal integer`>, v.TransformAction<string, bigint>]>, v.CheckAction<bigint, `${string} must be greater than 0`>]>, v.MaxValueAction<bigint, 18446744073709551615n, "expectedRevision exceeds the uint64 range">]>;
|
|
55
|
+
readonly direction: v.OptionalSchema<v.PicklistSchema<readonly ["above", "below"], undefined>, undefined>;
|
|
56
|
+
readonly price: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TransformAction<string, bigint>]>, undefined>;
|
|
57
|
+
readonly channels: v.OptionalSchema<v.SchemaWithPipe<readonly [v.ArraySchema<v.PicklistSchema<readonly ["in_app", "telegram"], undefined>, undefined>, v.MinLengthAction<("in_app" | "telegram")[], 1, "At least one channel is required.">, v.MaxLengthAction<("in_app" | "telegram")[], 2, "At most two channels are allowed.">, v.CheckAction<("in_app" | "telegram")[], "Channels must be distinct.">, v.TransformAction<("in_app" | "telegram")[], (AlertChannel.IN_APP | AlertChannel.TELEGRAM)[]>]>, undefined>;
|
|
58
|
+
readonly idempotencyKey: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>]>, undefined>;
|
|
59
|
+
}, undefined>, v.TransformAction<{
|
|
60
|
+
alertId: bigint;
|
|
61
|
+
expectedRevision: bigint;
|
|
62
|
+
direction?: "above" | "below" | undefined;
|
|
63
|
+
price?: bigint | undefined;
|
|
64
|
+
channels?: (AlertChannel.IN_APP | AlertChannel.TELEGRAM)[] | undefined;
|
|
65
|
+
idempotencyKey?: string | undefined;
|
|
66
|
+
}, {
|
|
67
|
+
alertId: bigint;
|
|
68
|
+
expectedRevision: bigint;
|
|
69
|
+
idempotencyKey: string | undefined;
|
|
70
|
+
update: Partial<{
|
|
71
|
+
direction: AlertDirection.ABOVE | AlertDirection.BELOW;
|
|
72
|
+
} & {
|
|
73
|
+
priceTicks: bigint;
|
|
74
|
+
} & {
|
|
75
|
+
channels: number[];
|
|
76
|
+
}>;
|
|
77
|
+
updateMask: {
|
|
78
|
+
paths: string[];
|
|
79
|
+
};
|
|
80
|
+
}>]>;
|
|
81
|
+
type UpdatePriceAlertInput = v.InferInput<typeof UpdatePriceAlertInputSchema>;
|
|
82
|
+
declare const CancelPriceAlertInputSchema: v.StrictObjectSchema<{
|
|
83
|
+
readonly alertId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.TransformAction<string, bigint>]>;
|
|
84
|
+
}, undefined>;
|
|
85
|
+
type CancelPriceAlertInput = v.InferInput<typeof CancelPriceAlertInputSchema>;
|
|
86
|
+
/** A price alert of the caller's root account. Prices are decimal strings. */
|
|
87
|
+
declare const PriceAlertSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
88
|
+
readonly alertId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
89
|
+
readonly symbolId: v.NumberSchema<undefined>;
|
|
90
|
+
readonly direction: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "above" | "below">]>;
|
|
91
|
+
readonly priceSource: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "last_price" | "index_price">]>;
|
|
92
|
+
readonly priceTicks: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
93
|
+
readonly referencePriceTicks: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
94
|
+
readonly armed: v.BooleanSchema<undefined>;
|
|
95
|
+
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "active" | "triggered" | "cancelled">]>;
|
|
96
|
+
readonly channels: v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "in_app" | "telegram">]>, undefined>;
|
|
97
|
+
readonly revision: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
98
|
+
readonly createdAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
99
|
+
readonly seconds: v.BigintSchema<undefined>;
|
|
100
|
+
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
101
|
+
}, undefined>, undefined>, v.TransformAction<{
|
|
102
|
+
seconds: bigint;
|
|
103
|
+
nanos: number;
|
|
104
|
+
} | undefined, number | undefined>]>;
|
|
105
|
+
readonly updatedAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
106
|
+
readonly seconds: v.BigintSchema<undefined>;
|
|
107
|
+
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
108
|
+
}, undefined>, undefined>, v.TransformAction<{
|
|
109
|
+
seconds: bigint;
|
|
110
|
+
nanos: number;
|
|
111
|
+
} | undefined, number | undefined>]>;
|
|
112
|
+
readonly triggeredAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
113
|
+
readonly seconds: v.BigintSchema<undefined>;
|
|
114
|
+
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
115
|
+
}, undefined>, undefined>, v.TransformAction<{
|
|
116
|
+
seconds: bigint;
|
|
117
|
+
nanos: number;
|
|
118
|
+
} | undefined, number | undefined>]>;
|
|
119
|
+
readonly triggeredPriceTicks: v.BigintSchema<undefined>;
|
|
120
|
+
}, undefined>, v.TransformAction<{
|
|
121
|
+
alertId: string;
|
|
122
|
+
symbolId: number;
|
|
123
|
+
direction: "unspecified" | "above" | "below";
|
|
124
|
+
priceSource: "unspecified" | "last_price" | "index_price";
|
|
125
|
+
priceTicks: string;
|
|
126
|
+
referencePriceTicks: string;
|
|
127
|
+
armed: boolean;
|
|
128
|
+
status: "unspecified" | "active" | "triggered" | "cancelled";
|
|
129
|
+
channels: ("unspecified" | "in_app" | "telegram")[];
|
|
130
|
+
revision: string;
|
|
131
|
+
createdAt?: number | undefined;
|
|
132
|
+
updatedAt?: number | undefined;
|
|
133
|
+
triggeredAt?: number | undefined;
|
|
134
|
+
triggeredPriceTicks: bigint;
|
|
135
|
+
}, {
|
|
136
|
+
alertId: string;
|
|
137
|
+
symbolId: number;
|
|
138
|
+
direction: "unspecified" | "above" | "below";
|
|
139
|
+
priceSource: "unspecified" | "last_price" | "index_price";
|
|
140
|
+
/** Alert price. */
|
|
141
|
+
price: string;
|
|
142
|
+
/** Price when the alert was created or last set again; it fires on a crossing from here. */
|
|
143
|
+
referencePrice: string;
|
|
144
|
+
/** False while an alert created past its price waits for the price to move back first. */
|
|
145
|
+
armed: boolean;
|
|
146
|
+
status: "unspecified" | "active" | "triggered" | "cancelled";
|
|
147
|
+
channels: ("unspecified" | "in_app" | "telegram")[];
|
|
148
|
+
/** Pass as `expectedRevision` to `update`. */
|
|
149
|
+
revision: string;
|
|
150
|
+
createdAt: number | null;
|
|
151
|
+
updatedAt: number | null;
|
|
152
|
+
/** Set only once the alert fired. */
|
|
153
|
+
triggeredAt: number | null;
|
|
154
|
+
/** Price that fired the alert; null unless it fired. */
|
|
155
|
+
triggeredPrice: string | null;
|
|
156
|
+
}>]>;
|
|
157
|
+
type PriceAlert = v.InferOutput<typeof PriceAlertSchema>;
|
|
158
|
+
declare const ListPriceAlertsResultSchema: v.ObjectSchema<{
|
|
159
|
+
readonly alerts: v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
160
|
+
readonly alertId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
161
|
+
readonly symbolId: v.NumberSchema<undefined>;
|
|
162
|
+
readonly direction: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "above" | "below">]>;
|
|
163
|
+
readonly priceSource: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "last_price" | "index_price">]>;
|
|
164
|
+
readonly priceTicks: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
165
|
+
readonly referencePriceTicks: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
166
|
+
readonly armed: v.BooleanSchema<undefined>;
|
|
167
|
+
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "active" | "triggered" | "cancelled">]>;
|
|
168
|
+
readonly channels: v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "in_app" | "telegram">]>, undefined>;
|
|
169
|
+
readonly revision: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
170
|
+
readonly createdAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
171
|
+
readonly seconds: v.BigintSchema<undefined>;
|
|
172
|
+
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
173
|
+
}, undefined>, undefined>, v.TransformAction<{
|
|
174
|
+
seconds: bigint;
|
|
175
|
+
nanos: number;
|
|
176
|
+
} | undefined, number | undefined>]>;
|
|
177
|
+
readonly updatedAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
178
|
+
readonly seconds: v.BigintSchema<undefined>;
|
|
179
|
+
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
180
|
+
}, undefined>, undefined>, v.TransformAction<{
|
|
181
|
+
seconds: bigint;
|
|
182
|
+
nanos: number;
|
|
183
|
+
} | undefined, number | undefined>]>;
|
|
184
|
+
readonly triggeredAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
185
|
+
readonly seconds: v.BigintSchema<undefined>;
|
|
186
|
+
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
187
|
+
}, undefined>, undefined>, v.TransformAction<{
|
|
188
|
+
seconds: bigint;
|
|
189
|
+
nanos: number;
|
|
190
|
+
} | undefined, number | undefined>]>;
|
|
191
|
+
readonly triggeredPriceTicks: v.BigintSchema<undefined>;
|
|
192
|
+
}, undefined>, v.TransformAction<{
|
|
193
|
+
alertId: string;
|
|
194
|
+
symbolId: number;
|
|
195
|
+
direction: "unspecified" | "above" | "below";
|
|
196
|
+
priceSource: "unspecified" | "last_price" | "index_price";
|
|
197
|
+
priceTicks: string;
|
|
198
|
+
referencePriceTicks: string;
|
|
199
|
+
armed: boolean;
|
|
200
|
+
status: "unspecified" | "active" | "triggered" | "cancelled";
|
|
201
|
+
channels: ("unspecified" | "in_app" | "telegram")[];
|
|
202
|
+
revision: string;
|
|
203
|
+
createdAt?: number | undefined;
|
|
204
|
+
updatedAt?: number | undefined;
|
|
205
|
+
triggeredAt?: number | undefined;
|
|
206
|
+
triggeredPriceTicks: bigint;
|
|
207
|
+
}, {
|
|
208
|
+
alertId: string;
|
|
209
|
+
symbolId: number;
|
|
210
|
+
direction: "unspecified" | "above" | "below";
|
|
211
|
+
priceSource: "unspecified" | "last_price" | "index_price";
|
|
212
|
+
/** Alert price. */
|
|
213
|
+
price: string;
|
|
214
|
+
/** Price when the alert was created or last set again; it fires on a crossing from here. */
|
|
215
|
+
referencePrice: string;
|
|
216
|
+
/** False while an alert created past its price waits for the price to move back first. */
|
|
217
|
+
armed: boolean;
|
|
218
|
+
status: "unspecified" | "active" | "triggered" | "cancelled";
|
|
219
|
+
channels: ("unspecified" | "in_app" | "telegram")[];
|
|
220
|
+
/** Pass as `expectedRevision` to `update`. */
|
|
221
|
+
revision: string;
|
|
222
|
+
createdAt: number | null;
|
|
223
|
+
updatedAt: number | null;
|
|
224
|
+
/** Set only once the alert fired. */
|
|
225
|
+
triggeredAt: number | null;
|
|
226
|
+
/** Price that fired the alert; null unless it fired. */
|
|
227
|
+
triggeredPrice: string | null;
|
|
228
|
+
}>]>, undefined>;
|
|
229
|
+
readonly nextPageToken: v.OptionalSchema<v.StringSchema<undefined>, "">;
|
|
230
|
+
}, undefined>;
|
|
231
|
+
/** One page of alerts, newest first; an empty `nextPageToken` means no more. */
|
|
232
|
+
type ListPriceAlertsResult = v.InferOutput<typeof ListPriceAlertsResultSchema>;
|
|
233
|
+
declare const UpdatePriceAlertResultSchema: v.ObjectSchema<{
|
|
234
|
+
readonly alert: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
235
|
+
readonly alertId: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
236
|
+
readonly symbolId: v.NumberSchema<undefined>;
|
|
237
|
+
readonly direction: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "above" | "below">]>;
|
|
238
|
+
readonly priceSource: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "last_price" | "index_price">]>;
|
|
239
|
+
readonly priceTicks: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
240
|
+
readonly referencePriceTicks: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
241
|
+
readonly armed: v.BooleanSchema<undefined>;
|
|
242
|
+
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "active" | "triggered" | "cancelled">]>;
|
|
243
|
+
readonly channels: v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "in_app" | "telegram">]>, undefined>;
|
|
244
|
+
readonly revision: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
245
|
+
readonly createdAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
246
|
+
readonly seconds: v.BigintSchema<undefined>;
|
|
247
|
+
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
248
|
+
}, undefined>, undefined>, v.TransformAction<{
|
|
249
|
+
seconds: bigint;
|
|
250
|
+
nanos: number;
|
|
251
|
+
} | undefined, number | undefined>]>;
|
|
252
|
+
readonly updatedAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
253
|
+
readonly seconds: v.BigintSchema<undefined>;
|
|
254
|
+
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
255
|
+
}, undefined>, undefined>, v.TransformAction<{
|
|
256
|
+
seconds: bigint;
|
|
257
|
+
nanos: number;
|
|
258
|
+
} | undefined, number | undefined>]>;
|
|
259
|
+
readonly triggeredAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
260
|
+
readonly seconds: v.BigintSchema<undefined>;
|
|
261
|
+
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
262
|
+
}, undefined>, undefined>, v.TransformAction<{
|
|
263
|
+
seconds: bigint;
|
|
264
|
+
nanos: number;
|
|
265
|
+
} | undefined, number | undefined>]>;
|
|
266
|
+
readonly triggeredPriceTicks: v.BigintSchema<undefined>;
|
|
267
|
+
}, undefined>, v.TransformAction<{
|
|
268
|
+
alertId: string;
|
|
269
|
+
symbolId: number;
|
|
270
|
+
direction: "unspecified" | "above" | "below";
|
|
271
|
+
priceSource: "unspecified" | "last_price" | "index_price";
|
|
272
|
+
priceTicks: string;
|
|
273
|
+
referencePriceTicks: string;
|
|
274
|
+
armed: boolean;
|
|
275
|
+
status: "unspecified" | "active" | "triggered" | "cancelled";
|
|
276
|
+
channels: ("unspecified" | "in_app" | "telegram")[];
|
|
277
|
+
revision: string;
|
|
278
|
+
createdAt?: number | undefined;
|
|
279
|
+
updatedAt?: number | undefined;
|
|
280
|
+
triggeredAt?: number | undefined;
|
|
281
|
+
triggeredPriceTicks: bigint;
|
|
282
|
+
}, {
|
|
283
|
+
alertId: string;
|
|
284
|
+
symbolId: number;
|
|
285
|
+
direction: "unspecified" | "above" | "below";
|
|
286
|
+
priceSource: "unspecified" | "last_price" | "index_price";
|
|
287
|
+
/** Alert price. */
|
|
288
|
+
price: string;
|
|
289
|
+
/** Price when the alert was created or last set again; it fires on a crossing from here. */
|
|
290
|
+
referencePrice: string;
|
|
291
|
+
/** False while an alert created past its price waits for the price to move back first. */
|
|
292
|
+
armed: boolean;
|
|
293
|
+
status: "unspecified" | "active" | "triggered" | "cancelled";
|
|
294
|
+
channels: ("unspecified" | "in_app" | "telegram")[];
|
|
295
|
+
/** Pass as `expectedRevision` to `update`. */
|
|
296
|
+
revision: string;
|
|
297
|
+
createdAt: number | null;
|
|
298
|
+
updatedAt: number | null;
|
|
299
|
+
/** Set only once the alert fired. */
|
|
300
|
+
triggeredAt: number | null;
|
|
301
|
+
/** Price that fired the alert; null unless it fired. */
|
|
302
|
+
triggeredPrice: string | null;
|
|
303
|
+
}>]>;
|
|
304
|
+
readonly outcome: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "applied" | "unchanged" | "replayed">]>;
|
|
305
|
+
}, undefined>;
|
|
306
|
+
type UpdatePriceAlertResult = v.InferOutput<typeof UpdatePriceAlertResultSchema>;
|
|
307
|
+
//#endregion
|
|
308
|
+
export { CancelPriceAlertInput, CancelPriceAlertInputSchema, CreatePriceAlertInput, CreatePriceAlertInputSchema, ListPriceAlertsInput, ListPriceAlertsInputSchema, ListPriceAlertsResult, ListPriceAlertsResultSchema, PriceAlert, PriceAlertSchema, UpdatePriceAlertInput, UpdatePriceAlertInputSchema, UpdatePriceAlertResult, UpdatePriceAlertResultSchema };
|
|
309
|
+
//# sourceMappingURL=price-alerts.schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"price-alerts.schemas.d.ts","names":[],"sources":["../../../src/services/price-alerts/price-alerts.schemas.ts"],"mappings":";;;cAqDa,6BAA2B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;KAoB5B,wBAAwB,EAAE,kBAAkB;cAE3C,4BAA0B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;KAiB3B,uBAAuB,EAAE,kBAAkB;cAiB1C,6BAA2B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAmB5B,wBAAwB,EAAE,kBAAkB;cAE3C,6BAA2B,EAAA;;;KAE5B,wBAAwB,EAAE,kBAAkB;;cAQ3C,kBAAgB,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4CjB,aAAa,EAAE,mBAAmB;cAEjC,6BAA2B,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAM5B,wBAAwB,EAAE,mBAAmB;cAE5C,8BAA4B,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAK7B,yBAAyB,EAAE,mBAAmB"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { PROTOBUF_UINT64_MAX } from "../../shared/wire-bounds.js";
|
|
2
|
+
import { BigIntStringSchema, OptionalTimestampMsSchema, PublicIdSchema, idInputSchema, positiveBigintStringInputSchema } from "../../shared/schemas.js";
|
|
3
|
+
import { enumLabelSchema } from "../../shared/proto-enum-codec.js";
|
|
4
|
+
import { positiveDecimalInputToScaled, scaledToDecimalOutput } from "../../shared/decimal-surface.js";
|
|
5
|
+
import { SymbolIdInputSchema } from "../shared.js";
|
|
6
|
+
import { buildProtoPatch, defineProtoPatchFields } from "../../utils/proto-patch.js";
|
|
7
|
+
import { PRICE_ALERT_CHANNEL_VALUES, PRICE_ALERT_DIRECTION_VALUES, PRICE_ALERT_PRICE_SOURCE_VALUES, PRICE_ALERT_STATUS_VALUES, PriceAlertChannelCodec, PriceAlertDirectionCodec, PriceAlertPriceSourceCodec, PriceAlertStatusCodec, PriceAlertUpdateOutcomeCodec } from "./price-alerts.codecs.js";
|
|
8
|
+
import * as v from "valibot";
|
|
9
|
+
//#region src/services/price-alerts/price-alerts.schemas.ts
|
|
10
|
+
const AlertIdInputSchema = idInputSchema("alertId");
|
|
11
|
+
/** Decimal alert price; sent as int64 ticks at the protocol price scale (1e9). */
|
|
12
|
+
function priceInputSchema(field) {
|
|
13
|
+
return v.pipe(v.string(), v.transform((price) => positiveDecimalInputToScaled(field, price, 9)));
|
|
14
|
+
}
|
|
15
|
+
/** One to two distinct delivery channels, sent in ascending enum order. */
|
|
16
|
+
const ChannelsInputSchema = v.pipe(v.array(v.picklist(PRICE_ALERT_CHANNEL_VALUES)), v.minLength(1, "At least one channel is required."), v.maxLength(2, "At most two channels are allowed."), v.check((channels) => new Set(channels).size === channels.length, "Channels must be distinct."), v.transform((channels) => channels.map((channel) => PriceAlertChannelCodec.inputToProto[channel]).sort()));
|
|
17
|
+
const IdempotencyKeySchema = v.optional(v.pipe(v.string(), v.trim(), v.minLength(1)));
|
|
18
|
+
const CreatePriceAlertInputSchema = v.pipe(v.strictObject({
|
|
19
|
+
symbolId: SymbolIdInputSchema,
|
|
20
|
+
direction: v.picklist(PRICE_ALERT_DIRECTION_VALUES),
|
|
21
|
+
/** Omit to watch the index price on markets that have one, else the last price. */
|
|
22
|
+
priceSource: v.optional(v.picklist(PRICE_ALERT_PRICE_SOURCE_VALUES)),
|
|
23
|
+
/** Alert price as a decimal string, e.g. `"90000"`. */
|
|
24
|
+
price: priceInputSchema("price"),
|
|
25
|
+
channels: ChannelsInputSchema,
|
|
26
|
+
/** Reusing a key with the same request returns the alert it created. */
|
|
27
|
+
idempotencyKey: IdempotencyKeySchema
|
|
28
|
+
}), v.transform(({ direction, priceSource, price, ...input }) => ({
|
|
29
|
+
...input,
|
|
30
|
+
direction: PriceAlertDirectionCodec.inputToProto[direction],
|
|
31
|
+
priceSource: priceSource && PriceAlertPriceSourceCodec.inputToProto[priceSource],
|
|
32
|
+
priceTicks: price
|
|
33
|
+
})));
|
|
34
|
+
const ListPriceAlertsInputSchema = v.pipe(v.strictObject({
|
|
35
|
+
/** Only alerts in these states; omit or empty for every state. */
|
|
36
|
+
statuses: v.optional(v.array(v.picklist(PRICE_ALERT_STATUS_VALUES))),
|
|
37
|
+
/** Only alerts on this market. */
|
|
38
|
+
symbolId: v.optional(SymbolIdInputSchema),
|
|
39
|
+
/** Page size: default 50, at most 200. */
|
|
40
|
+
limit: v.optional(v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(200))),
|
|
41
|
+
/** Previous `nextPageToken`; reuse only with the same filters. */
|
|
42
|
+
pageToken: v.optional(v.pipe(v.string(), v.trim()))
|
|
43
|
+
}), v.transform(({ statuses, ...input }) => ({
|
|
44
|
+
...input,
|
|
45
|
+
statuses: statuses?.map((status) => PriceAlertStatusCodec.inputToProto[status])
|
|
46
|
+
})));
|
|
47
|
+
const PRICE_ALERT_PATCH_FIELDS = defineProtoPatchFields()({
|
|
48
|
+
direction: {
|
|
49
|
+
path: "direction",
|
|
50
|
+
encode: (direction) => ({ direction: PriceAlertDirectionCodec.inputToProto[direction] })
|
|
51
|
+
},
|
|
52
|
+
price: {
|
|
53
|
+
path: "price_ticks",
|
|
54
|
+
encode: (priceTicks) => ({ priceTicks })
|
|
55
|
+
},
|
|
56
|
+
channels: {
|
|
57
|
+
path: "channels",
|
|
58
|
+
encode: (channels) => ({ channels })
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
const UpdatePriceAlertInputSchema = v.pipe(v.strictObject({
|
|
62
|
+
alertId: AlertIdInputSchema,
|
|
63
|
+
/** The alert's `revision` from the last read. */
|
|
64
|
+
expectedRevision: v.pipe(positiveBigintStringInputSchema("expectedRevision"), v.maxValue(PROTOBUF_UINT64_MAX, "expectedRevision exceeds the uint64 range")),
|
|
65
|
+
direction: v.optional(v.picklist(PRICE_ALERT_DIRECTION_VALUES)),
|
|
66
|
+
price: v.optional(priceInputSchema("price")),
|
|
67
|
+
channels: v.optional(ChannelsInputSchema),
|
|
68
|
+
idempotencyKey: IdempotencyKeySchema
|
|
69
|
+
}), v.transform(({ alertId, expectedRevision, idempotencyKey, ...fields }) => {
|
|
70
|
+
const { patch: update, updateMask } = buildProtoPatch(fields, PRICE_ALERT_PATCH_FIELDS);
|
|
71
|
+
return {
|
|
72
|
+
alertId,
|
|
73
|
+
expectedRevision,
|
|
74
|
+
idempotencyKey,
|
|
75
|
+
update,
|
|
76
|
+
updateMask
|
|
77
|
+
};
|
|
78
|
+
}));
|
|
79
|
+
const CancelPriceAlertInputSchema = v.strictObject({ alertId: AlertIdInputSchema });
|
|
80
|
+
const PriceSchema = v.pipe(v.bigint(), v.transform((ticks) => scaledToDecimalOutput(ticks, 9)));
|
|
81
|
+
/** A price alert of the caller's root account. Prices are decimal strings. */
|
|
82
|
+
const PriceAlertSchema = v.pipe(v.object({
|
|
83
|
+
alertId: PublicIdSchema,
|
|
84
|
+
symbolId: v.number(),
|
|
85
|
+
direction: enumLabelSchema(PriceAlertDirectionCodec.protoToOutput),
|
|
86
|
+
priceSource: enumLabelSchema(PriceAlertPriceSourceCodec.protoToOutput),
|
|
87
|
+
priceTicks: PriceSchema,
|
|
88
|
+
referencePriceTicks: PriceSchema,
|
|
89
|
+
armed: v.boolean(),
|
|
90
|
+
status: enumLabelSchema(PriceAlertStatusCodec.protoToOutput),
|
|
91
|
+
channels: v.array(enumLabelSchema(PriceAlertChannelCodec.protoToOutput)),
|
|
92
|
+
revision: BigIntStringSchema,
|
|
93
|
+
createdAt: OptionalTimestampMsSchema,
|
|
94
|
+
updatedAt: OptionalTimestampMsSchema,
|
|
95
|
+
triggeredAt: OptionalTimestampMsSchema,
|
|
96
|
+
triggeredPriceTicks: v.bigint()
|
|
97
|
+
}), v.transform((alert) => ({
|
|
98
|
+
alertId: alert.alertId,
|
|
99
|
+
symbolId: alert.symbolId,
|
|
100
|
+
direction: alert.direction,
|
|
101
|
+
priceSource: alert.priceSource,
|
|
102
|
+
/** Alert price. */
|
|
103
|
+
price: alert.priceTicks,
|
|
104
|
+
/** Price when the alert was created or last set again; it fires on a crossing from here. */
|
|
105
|
+
referencePrice: alert.referencePriceTicks,
|
|
106
|
+
/** False while an alert created past its price waits for the price to move back first. */
|
|
107
|
+
armed: alert.armed,
|
|
108
|
+
status: alert.status,
|
|
109
|
+
channels: alert.channels,
|
|
110
|
+
/** Pass as `expectedRevision` to `update`. */
|
|
111
|
+
revision: alert.revision,
|
|
112
|
+
createdAt: alert.createdAt ?? null,
|
|
113
|
+
updatedAt: alert.updatedAt ?? null,
|
|
114
|
+
/** Set only once the alert fired. */
|
|
115
|
+
triggeredAt: alert.triggeredAt ?? null,
|
|
116
|
+
/** Price that fired the alert; null unless it fired. */
|
|
117
|
+
triggeredPrice: alert.status === "triggered" ? scaledToDecimalOutput(alert.triggeredPriceTicks, 9) : null
|
|
118
|
+
})));
|
|
119
|
+
const ListPriceAlertsResultSchema = v.object({
|
|
120
|
+
alerts: v.array(PriceAlertSchema),
|
|
121
|
+
nextPageToken: v.optional(v.string(), "")
|
|
122
|
+
});
|
|
123
|
+
const UpdatePriceAlertResultSchema = v.object({
|
|
124
|
+
alert: PriceAlertSchema,
|
|
125
|
+
outcome: enumLabelSchema(PriceAlertUpdateOutcomeCodec.protoToOutput)
|
|
126
|
+
});
|
|
127
|
+
//#endregion
|
|
128
|
+
export { CancelPriceAlertInputSchema, CreatePriceAlertInputSchema, ListPriceAlertsInputSchema, ListPriceAlertsResultSchema, PriceAlertSchema, UpdatePriceAlertInputSchema, UpdatePriceAlertResultSchema };
|
|
129
|
+
|
|
130
|
+
//# sourceMappingURL=price-alerts.schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"price-alerts.schemas.js","names":[],"sources":["../../../src/services/price-alerts/price-alerts.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport { PRICE_SCALE } from \"../../catalogs/readers.js\";\nimport {\n positiveDecimalInputToScaled,\n scaledToDecimalOutput,\n} from \"../../shared/decimal-surface.js\";\nimport { enumLabelSchema } from \"../../shared/proto-enum-codec.js\";\nimport {\n BigIntStringSchema,\n OptionalTimestampMsSchema,\n PublicIdSchema,\n idInputSchema,\n positiveBigintStringInputSchema,\n} from \"../../shared/schemas.js\";\nimport { PROTOBUF_UINT64_MAX } from \"../../shared/wire-bounds.js\";\nimport { buildProtoPatch, defineProtoPatchFields } from \"../../utils/proto-patch.js\";\nimport { SymbolIdInputSchema } from \"../shared.js\";\nimport {\n PRICE_ALERT_CHANNEL_VALUES,\n PRICE_ALERT_DIRECTION_VALUES,\n PRICE_ALERT_PRICE_SOURCE_VALUES,\n PRICE_ALERT_STATUS_VALUES,\n PriceAlertChannelCodec,\n PriceAlertDirectionCodec,\n PriceAlertPriceSourceCodec,\n PriceAlertStatusCodec,\n PriceAlertUpdateOutcomeCodec,\n type PriceAlertDirection,\n} from \"./price-alerts.codecs.js\";\n\nconst AlertIdInputSchema = idInputSchema(\"alertId\");\n\n/** Decimal alert price; sent as int64 ticks at the protocol price scale (1e9). */\nfunction priceInputSchema(field: string) {\n return v.pipe(\n v.string(),\n v.transform((price) => positiveDecimalInputToScaled(field, price, PRICE_SCALE)),\n );\n}\n\n/** One to two distinct delivery channels, sent in ascending enum order. */\nconst ChannelsInputSchema = v.pipe(\n v.array(v.picklist(PRICE_ALERT_CHANNEL_VALUES)),\n v.minLength(1, \"At least one channel is required.\"),\n v.maxLength(2, \"At most two channels are allowed.\"),\n v.check((channels) => new Set(channels).size === channels.length, \"Channels must be distinct.\"),\n v.transform((channels) =>\n channels.map((channel) => PriceAlertChannelCodec.inputToProto[channel]).sort(),\n ),\n);\n\nconst IdempotencyKeySchema = v.optional(v.pipe(v.string(), v.trim(), v.minLength(1)));\n\nexport const CreatePriceAlertInputSchema = v.pipe(\n v.strictObject({\n symbolId: SymbolIdInputSchema,\n direction: v.picklist(PRICE_ALERT_DIRECTION_VALUES),\n /** Omit to watch the index price on markets that have one, else the last price. */\n priceSource: v.optional(v.picklist(PRICE_ALERT_PRICE_SOURCE_VALUES)),\n /** Alert price as a decimal string, e.g. `\"90000\"`. */\n price: priceInputSchema(\"price\"),\n channels: ChannelsInputSchema,\n /** Reusing a key with the same request returns the alert it created. */\n idempotencyKey: IdempotencyKeySchema,\n }),\n v.transform(({ direction, priceSource, price, ...input }) => ({\n ...input,\n direction: PriceAlertDirectionCodec.inputToProto[direction],\n priceSource: priceSource && PriceAlertPriceSourceCodec.inputToProto[priceSource],\n priceTicks: price,\n })),\n);\n\nexport type CreatePriceAlertInput = v.InferInput<typeof CreatePriceAlertInputSchema>;\n\nexport const ListPriceAlertsInputSchema = v.pipe(\n v.strictObject({\n /** Only alerts in these states; omit or empty for every state. */\n statuses: v.optional(v.array(v.picklist(PRICE_ALERT_STATUS_VALUES))),\n /** Only alerts on this market. */\n symbolId: v.optional(SymbolIdInputSchema),\n /** Page size: default 50, at most 200. */\n limit: v.optional(v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(200))),\n /** Previous `nextPageToken`; reuse only with the same filters. */\n pageToken: v.optional(v.pipe(v.string(), v.trim())),\n }),\n v.transform(({ statuses, ...input }) => ({\n ...input,\n statuses: statuses?.map((status) => PriceAlertStatusCodec.inputToProto[status]),\n })),\n);\n\nexport type ListPriceAlertsInput = v.InferInput<typeof ListPriceAlertsInputSchema>;\n\ntype PriceAlertPatch = {\n direction?: PriceAlertDirection;\n price?: bigint;\n channels?: number[];\n};\n\nconst PRICE_ALERT_PATCH_FIELDS = defineProtoPatchFields<PriceAlertPatch>()({\n direction: {\n path: \"direction\",\n encode: (direction) => ({ direction: PriceAlertDirectionCodec.inputToProto[direction] }),\n },\n price: { path: \"price_ticks\", encode: (priceTicks) => ({ priceTicks }) },\n channels: { path: \"channels\", encode: (channels) => ({ channels }) },\n});\n\nexport const UpdatePriceAlertInputSchema = v.pipe(\n v.strictObject({\n alertId: AlertIdInputSchema,\n /** The alert's `revision` from the last read. */\n expectedRevision: v.pipe(\n positiveBigintStringInputSchema(\"expectedRevision\"),\n v.maxValue(PROTOBUF_UINT64_MAX, \"expectedRevision exceeds the uint64 range\"),\n ),\n direction: v.optional(v.picklist(PRICE_ALERT_DIRECTION_VALUES)),\n price: v.optional(priceInputSchema(\"price\")),\n channels: v.optional(ChannelsInputSchema),\n idempotencyKey: IdempotencyKeySchema,\n }),\n v.transform(({ alertId, expectedRevision, idempotencyKey, ...fields }) => {\n const { patch: update, updateMask } = buildProtoPatch(fields, PRICE_ALERT_PATCH_FIELDS);\n return { alertId, expectedRevision, idempotencyKey, update, updateMask };\n }),\n);\n\nexport type UpdatePriceAlertInput = v.InferInput<typeof UpdatePriceAlertInputSchema>;\n\nexport const CancelPriceAlertInputSchema = v.strictObject({ alertId: AlertIdInputSchema });\n\nexport type CancelPriceAlertInput = v.InferInput<typeof CancelPriceAlertInputSchema>;\n\nconst PriceSchema = v.pipe(\n v.bigint(),\n v.transform((ticks) => scaledToDecimalOutput(ticks, PRICE_SCALE)),\n);\n\n/** A price alert of the caller's root account. Prices are decimal strings. */\nexport const PriceAlertSchema = v.pipe(\n v.object({\n alertId: PublicIdSchema,\n symbolId: v.number(),\n direction: enumLabelSchema(PriceAlertDirectionCodec.protoToOutput),\n priceSource: enumLabelSchema(PriceAlertPriceSourceCodec.protoToOutput),\n priceTicks: PriceSchema,\n referencePriceTicks: PriceSchema,\n armed: v.boolean(),\n status: enumLabelSchema(PriceAlertStatusCodec.protoToOutput),\n channels: v.array(enumLabelSchema(PriceAlertChannelCodec.protoToOutput)),\n revision: BigIntStringSchema,\n createdAt: OptionalTimestampMsSchema,\n updatedAt: OptionalTimestampMsSchema,\n triggeredAt: OptionalTimestampMsSchema,\n triggeredPriceTicks: v.bigint(),\n }),\n v.transform((alert) => ({\n alertId: alert.alertId,\n symbolId: alert.symbolId,\n direction: alert.direction,\n priceSource: alert.priceSource,\n /** Alert price. */\n price: alert.priceTicks,\n /** Price when the alert was created or last set again; it fires on a crossing from here. */\n referencePrice: alert.referencePriceTicks,\n /** False while an alert created past its price waits for the price to move back first. */\n armed: alert.armed,\n status: alert.status,\n channels: alert.channels,\n /** Pass as `expectedRevision` to `update`. */\n revision: alert.revision,\n createdAt: alert.createdAt ?? null,\n updatedAt: alert.updatedAt ?? null,\n /** Set only once the alert fired. */\n triggeredAt: alert.triggeredAt ?? null,\n /** Price that fired the alert; null unless it fired. */\n triggeredPrice:\n alert.status === \"triggered\"\n ? scaledToDecimalOutput(alert.triggeredPriceTicks, PRICE_SCALE)\n : null,\n })),\n);\n\nexport type PriceAlert = v.InferOutput<typeof PriceAlertSchema>;\n\nexport const ListPriceAlertsResultSchema = v.object({\n alerts: v.array(PriceAlertSchema),\n nextPageToken: v.optional(v.string(), \"\"),\n});\n\n/** One page of alerts, newest first; an empty `nextPageToken` means no more. */\nexport type ListPriceAlertsResult = v.InferOutput<typeof ListPriceAlertsResultSchema>;\n\nexport const UpdatePriceAlertResultSchema = v.object({\n alert: PriceAlertSchema,\n outcome: enumLabelSchema(PriceAlertUpdateOutcomeCodec.protoToOutput),\n});\n\nexport type UpdatePriceAlertResult = v.InferOutput<typeof UpdatePriceAlertResultSchema>;\n"],"mappings":";;;;;;;;;AA8BA,MAAM,qBAAqB,cAAc,SAAS;;AAGlD,SAAS,iBAAiB,OAAe;CACrC,OAAO,EAAE,KACL,EAAE,OAAO,GACT,EAAE,WAAW,UAAU,6BAA6B,OAAO,OAAA,CAAkB,CAAC,CAClF;AACJ;;AAGA,MAAM,sBAAsB,EAAE,KAC1B,EAAE,MAAM,EAAE,SAAS,0BAA0B,CAAC,GAC9C,EAAE,UAAU,GAAG,mCAAmC,GAClD,EAAE,UAAU,GAAG,mCAAmC,GAClD,EAAE,OAAO,aAAa,IAAI,IAAI,QAAQ,CAAC,CAAC,SAAS,SAAS,QAAQ,4BAA4B,GAC9F,EAAE,WAAW,aACT,SAAS,KAAK,YAAY,uBAAuB,aAAa,QAAQ,CAAC,CAAC,KAAK,CACjF,CACJ;AAEA,MAAM,uBAAuB,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC;AAEpF,MAAa,8BAA8B,EAAE,KACzC,EAAE,aAAa;CACX,UAAU;CACV,WAAW,EAAE,SAAS,4BAA4B;;CAElD,aAAa,EAAE,SAAS,EAAE,SAAS,+BAA+B,CAAC;;CAEnE,OAAO,iBAAiB,OAAO;CAC/B,UAAU;;CAEV,gBAAgB;AACpB,CAAC,GACD,EAAE,WAAW,EAAE,WAAW,aAAa,OAAO,GAAG,aAAa;CAC1D,GAAG;CACH,WAAW,yBAAyB,aAAa;CACjD,aAAa,eAAe,2BAA2B,aAAa;CACpE,YAAY;AAChB,EAAE,CACN;AAIA,MAAa,6BAA6B,EAAE,KACxC,EAAE,aAAa;;CAEX,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,yBAAyB,CAAC,CAAC;;CAEnE,UAAU,EAAE,SAAS,mBAAmB;;CAExC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,SAAS,GAAG,CAAC,CAAC;;CAEjF,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,CAAC,CAAC;AACtD,CAAC,GACD,EAAE,WAAW,EAAE,UAAU,GAAG,aAAa;CACrC,GAAG;CACH,UAAU,UAAU,KAAK,WAAW,sBAAsB,aAAa,OAAO;AAClF,EAAE,CACN;AAUA,MAAM,2BAA2B,uBAAwC,CAAC,CAAC;CACvE,WAAW;EACP,MAAM;EACN,SAAS,eAAe,EAAE,WAAW,yBAAyB,aAAa,WAAW;CAC1F;CACA,OAAO;EAAE,MAAM;EAAe,SAAS,gBAAgB,EAAE,WAAW;CAAG;CACvE,UAAU;EAAE,MAAM;EAAY,SAAS,cAAc,EAAE,SAAS;CAAG;AACvE,CAAC;AAED,MAAa,8BAA8B,EAAE,KACzC,EAAE,aAAa;CACX,SAAS;;CAET,kBAAkB,EAAE,KAChB,gCAAgC,kBAAkB,GAClD,EAAE,SAAS,qBAAqB,2CAA2C,CAC/E;CACA,WAAW,EAAE,SAAS,EAAE,SAAS,4BAA4B,CAAC;CAC9D,OAAO,EAAE,SAAS,iBAAiB,OAAO,CAAC;CAC3C,UAAU,EAAE,SAAS,mBAAmB;CACxC,gBAAgB;AACpB,CAAC,GACD,EAAE,WAAW,EAAE,SAAS,kBAAkB,gBAAgB,GAAG,aAAa;CACtE,MAAM,EAAE,OAAO,QAAQ,eAAe,gBAAgB,QAAQ,wBAAwB;CACtF,OAAO;EAAE;EAAS;EAAkB;EAAgB;EAAQ;CAAW;AAC3E,CAAC,CACL;AAIA,MAAa,8BAA8B,EAAE,aAAa,EAAE,SAAS,mBAAmB,CAAC;AAIzF,MAAM,cAAc,EAAE,KAClB,EAAE,OAAO,GACT,EAAE,WAAW,UAAU,sBAAsB,OAAA,CAAkB,CAAC,CACpE;;AAGA,MAAa,mBAAmB,EAAE,KAC9B,EAAE,OAAO;CACL,SAAS;CACT,UAAU,EAAE,OAAO;CACnB,WAAW,gBAAgB,yBAAyB,aAAa;CACjE,aAAa,gBAAgB,2BAA2B,aAAa;CACrE,YAAY;CACZ,qBAAqB;CACrB,OAAO,EAAE,QAAQ;CACjB,QAAQ,gBAAgB,sBAAsB,aAAa;CAC3D,UAAU,EAAE,MAAM,gBAAgB,uBAAuB,aAAa,CAAC;CACvE,UAAU;CACV,WAAW;CACX,WAAW;CACX,aAAa;CACb,qBAAqB,EAAE,OAAO;AAClC,CAAC,GACD,EAAE,WAAW,WAAW;CACpB,SAAS,MAAM;CACf,UAAU,MAAM;CAChB,WAAW,MAAM;CACjB,aAAa,MAAM;;CAEnB,OAAO,MAAM;;CAEb,gBAAgB,MAAM;;CAEtB,OAAO,MAAM;CACb,QAAQ,MAAM;CACd,UAAU,MAAM;;CAEhB,UAAU,MAAM;CAChB,WAAW,MAAM,aAAa;CAC9B,WAAW,MAAM,aAAa;;CAE9B,aAAa,MAAM,eAAe;;CAElC,gBACI,MAAM,WAAW,cACX,sBAAsB,MAAM,qBAAA,CAAgC,IAC5D;AACd,EAAE,CACN;AAIA,MAAa,8BAA8B,EAAE,OAAO;CAChD,QAAQ,EAAE,MAAM,gBAAgB;CAChC,eAAe,EAAE,SAAS,EAAE,OAAO,GAAG,EAAE;AAC5C,CAAC;AAKD,MAAa,+BAA+B,EAAE,OAAO;CACjD,OAAO;CACP,SAAS,gBAAgB,6BAA6B,aAAa;AACvE,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CancelPriceAlertInput, CreatePriceAlertInput, ListPriceAlertsInput, ListPriceAlertsResult, PriceAlert, UpdatePriceAlertInput, UpdatePriceAlertResult } from "./price-alerts.schemas.js";
|
|
2
|
+
import { PriceAlertChannel, PriceAlertDirection, PriceAlertPriceSource, PriceAlertStatus, PriceAlertUpdateOutcome } from "./price-alerts.codecs.js";
|
|
3
|
+
export type { CancelPriceAlertInput, CreatePriceAlertInput, ListPriceAlertsInput, ListPriceAlertsResult, PriceAlert, PriceAlertChannel, PriceAlertDirection, PriceAlertPriceSource, PriceAlertStatus, PriceAlertUpdateOutcome, UpdatePriceAlertInput, UpdatePriceAlertResult };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PriceAlertsService } from "./price-alerts.js";
|
|
2
|
+
import { PolyesterCore } from "../../core-client.js";
|
|
3
|
+
//#region src/services/price-alerts/service.d.ts
|
|
4
|
+
/** Returns the client's PriceAlertsService, creating it on first use. */
|
|
5
|
+
declare const priceAlertsService: (client: PolyesterCore) => PriceAlertsService;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { priceAlertsService };
|
|
8
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","names":[],"sources":["../../../src/services/price-alerts/service.ts"],"mappings":";;;;cAIa,qBAAkB,QAAlB,kBAAkB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defineService } from "../../core-client.js";
|
|
2
|
+
import { PriceAlertsService } from "./price-alerts.js";
|
|
3
|
+
//#region src/services/price-alerts/service.ts
|
|
4
|
+
/** Returns the client's PriceAlertsService, creating it on first use. */
|
|
5
|
+
const priceAlertsService = defineService((context) => new PriceAlertsService(context.transports));
|
|
6
|
+
//#endregion
|
|
7
|
+
export { priceAlertsService };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","names":[],"sources":["../../../src/services/price-alerts/service.ts"],"sourcesContent":["import { defineService } from \"../../core-client.js\";\nimport { PriceAlertsService } from \"./price-alerts.js\";\n\n/** Returns the client's PriceAlertsService, creating it on first use. */\nexport const priceAlertsService = defineService(\n (context) => new PriceAlertsService(context.transports),\n);\n"],"mappings":";;;;AAIA,MAAa,qBAAqB,eAC7B,YAAY,IAAI,mBAAmB,QAAQ,UAAU,CAC1D"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import "../../gen/auth/v1/auth_pb.js";
|
|
2
2
|
import "../../gen/auth/v1/social_verification_pb.js";
|
|
3
3
|
//#region src/services/social-verification/social-verification.codecs.ts
|
|
4
|
-
const SOCIAL_PROVIDER_VALUES = [
|
|
4
|
+
const SOCIAL_PROVIDER_VALUES = [
|
|
5
|
+
"twitter",
|
|
6
|
+
"discord",
|
|
7
|
+
"telegram"
|
|
8
|
+
];
|
|
5
9
|
const SOCIAL_VERIFICATION_METHOD_VALUES = [
|
|
6
10
|
"profile",
|
|
7
11
|
"channel",
|
|
@@ -14,17 +18,20 @@ const SOCIAL_VERIFICATION_STATUS_VALUES = [
|
|
|
14
18
|
"verified",
|
|
15
19
|
"failed",
|
|
16
20
|
"expired",
|
|
17
|
-
"canceled"
|
|
21
|
+
"canceled",
|
|
22
|
+
"awaiting_confirmation"
|
|
18
23
|
];
|
|
19
24
|
const SocialProviderCodec = {
|
|
20
25
|
inputToProto: {
|
|
21
26
|
twitter: 1,
|
|
22
|
-
discord: 2
|
|
27
|
+
discord: 2,
|
|
28
|
+
telegram: 3
|
|
23
29
|
},
|
|
24
30
|
protoToOutput: {
|
|
25
31
|
[0]: "unspecified",
|
|
26
32
|
[1]: "twitter",
|
|
27
|
-
[2]: "discord"
|
|
33
|
+
[2]: "discord",
|
|
34
|
+
[3]: "telegram"
|
|
28
35
|
}
|
|
29
36
|
};
|
|
30
37
|
const SocialVerificationMethodCodec = {
|
|
@@ -48,7 +55,8 @@ const SocialVerificationStatusCodec = { protoToOutput: {
|
|
|
48
55
|
[4]: "verified",
|
|
49
56
|
[5]: "failed",
|
|
50
57
|
[6]: "expired",
|
|
51
|
-
[7]: "canceled"
|
|
58
|
+
[7]: "canceled",
|
|
59
|
+
[8]: "awaiting_confirmation"
|
|
52
60
|
} };
|
|
53
61
|
const SOCIAL_VERIFICATION_ERROR_CODE_VALUES = [
|
|
54
62
|
"username_invalid",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social-verification.codecs.js","names":[],"sources":["../../../src/services/social-verification/social-verification.codecs.ts"],"sourcesContent":["import { AuthErrorCode } from \"../../gen/auth/v1/auth_pb.js\";\nimport * as Proto from \"../../gen/auth/v1/social_verification_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const SOCIAL_PROVIDER_VALUES = [\"twitter\", \"discord\"] as const;\nexport type SocialProviderValue = (typeof SOCIAL_PROVIDER_VALUES)[number];\n\nexport const SOCIAL_VERIFICATION_METHOD_VALUES = [\"profile\", \"channel\", \"dm\"] as const;\nexport type SocialVerificationMethodValue = (typeof SOCIAL_VERIFICATION_METHOD_VALUES)[number];\n\nexport const SOCIAL_VERIFICATION_STATUS_VALUES = [\n \"pending_user_action\",\n \"queued\",\n \"in_progress\",\n \"verified\",\n \"failed\",\n \"expired\",\n \"canceled\",\n] as const;\nexport type SocialVerificationStatusValue = (typeof SOCIAL_VERIFICATION_STATUS_VALUES)[number];\n\nexport const SocialProviderCodec = {\n inputToProto: {\n twitter: Proto.SocialProvider.TWITTER,\n discord: Proto.SocialProvider.DISCORD,\n } satisfies InputToProto<SocialProviderValue, Proto.SocialProvider>,\n protoToOutput: {\n [Proto.SocialProvider.PROVIDER_UNSPECIFIED]: \"unspecified\",\n [Proto.SocialProvider.TWITTER]: \"twitter\",\n [Proto.SocialProvider.DISCORD]: \"discord\",\n } satisfies ProtoToOutput<Proto.SocialProvider, SocialProviderValue>,\n} as const;\n\nexport const SocialVerificationMethodCodec = {\n inputToProto: {\n profile: Proto.SocialVerificationMethod.METHOD_PROFILE,\n channel: Proto.SocialVerificationMethod.METHOD_CHANNEL,\n dm: Proto.SocialVerificationMethod.METHOD_DM,\n } satisfies InputToProto<SocialVerificationMethodValue, Proto.SocialVerificationMethod>,\n protoToOutput: {\n [Proto.SocialVerificationMethod.METHOD_UNSPECIFIED]: \"unspecified\",\n [Proto.SocialVerificationMethod.METHOD_PROFILE]: \"profile\",\n [Proto.SocialVerificationMethod.METHOD_CHANNEL]: \"channel\",\n [Proto.SocialVerificationMethod.METHOD_DM]: \"dm\",\n } satisfies ProtoToOutput<Proto.SocialVerificationMethod, SocialVerificationMethodValue>,\n} as const;\n\nexport const SocialVerificationStatusCodec = {\n protoToOutput: {\n [Proto.SocialVerificationStatus.STATUS_UNSPECIFIED]: \"unspecified\",\n [Proto.SocialVerificationStatus.STATUS_PENDING_USER_ACTION]: \"pending_user_action\",\n [Proto.SocialVerificationStatus.STATUS_QUEUED]: \"queued\",\n [Proto.SocialVerificationStatus.STATUS_IN_PROGRESS]: \"in_progress\",\n [Proto.SocialVerificationStatus.STATUS_VERIFIED]: \"verified\",\n [Proto.SocialVerificationStatus.STATUS_FAILED]: \"failed\",\n [Proto.SocialVerificationStatus.STATUS_EXPIRED]: \"expired\",\n [Proto.SocialVerificationStatus.STATUS_CANCELLED]: \"canceled\",\n } satisfies ProtoToOutput<Proto.SocialVerificationStatus, SocialVerificationStatusValue>,\n} as const;\n\nexport const SOCIAL_VERIFICATION_ERROR_CODE_VALUES = [\n \"username_invalid\",\n \"username_taken\",\n \"username_cooldown\",\n \"username_feature_locked\",\n \"username_reserved\",\n \"invalid_request\",\n \"authentication_required\",\n \"session_kind_not_allowed\",\n \"wallet_login_failed\",\n \"resource_not_found\",\n \"subaccount_access_denied\",\n \"api_key_access_denied\",\n \"api_key_invalid_status_transition\",\n \"policy_invalid\",\n \"smart_account_already_linked\",\n \"invite_access_denied\",\n \"invite_invalid_state\",\n \"mfa_disabled\",\n \"mfa_not_enrolled\",\n \"mfa_session_invalid\",\n \"mfa_challenge_not_found\",\n \"mfa_challenge_invalid\",\n \"mfa_challenge_locked\",\n \"mfa_otp_invalid\",\n \"mfa_recovery_invalid\",\n \"mfa_passkey_not_available\",\n \"mfa_passkey_credential_invalid\",\n \"mfa_passkey_verify_failed\",\n \"mfa_enrollment_binding_invalid\",\n \"step_up_required\",\n \"step_up_proof_unavailable\",\n \"step_up_already_claimed\",\n \"policy_in_use\",\n \"policy_locked\",\n \"policy_scope_mismatch\",\n \"revision_conflict\",\n \"mfa_elevation_required\",\n \"mfa_last_factor_required\",\n \"internal_error\",\n \"terms_not_accepted\",\n \"social_verification_expired\",\n \"social_verification_invalid_state\",\n \"subaccount_challenge_invalid\",\n \"social_account_already_linked\",\n] as const;\nexport type SocialVerificationErrorCodeValue =\n (typeof SOCIAL_VERIFICATION_ERROR_CODE_VALUES)[number];\n\n// Partial: auth codes added upstream decode to \"unspecified\" until mapped here.\nexport const SocialVerificationErrorCodeCodec = {\n protoToOutput: {\n [AuthErrorCode.AUTH_UNSPECIFIED]: \"unspecified\",\n [AuthErrorCode.AUTH_USERNAME_INVALID]: \"username_invalid\",\n [AuthErrorCode.AUTH_USERNAME_TAKEN]: \"username_taken\",\n [AuthErrorCode.AUTH_USERNAME_COOLDOWN]: \"username_cooldown\",\n [AuthErrorCode.AUTH_USERNAME_FEATURE_LOCKED]: \"username_feature_locked\",\n [AuthErrorCode.AUTH_USERNAME_RESERVED]: \"username_reserved\",\n [AuthErrorCode.AUTH_INVALID_REQUEST]: \"invalid_request\",\n [AuthErrorCode.AUTH_AUTHENTICATION_REQUIRED]: \"authentication_required\",\n [AuthErrorCode.AUTH_SESSION_KIND_NOT_ALLOWED]: \"session_kind_not_allowed\",\n [AuthErrorCode.AUTH_WALLET_LOGIN_FAILED]: \"wallet_login_failed\",\n [AuthErrorCode.AUTH_RESOURCE_NOT_FOUND]: \"resource_not_found\",\n [AuthErrorCode.AUTH_SUBACCOUNT_ACCESS_DENIED]: \"subaccount_access_denied\",\n [AuthErrorCode.AUTH_API_KEY_ACCESS_DENIED]: \"api_key_access_denied\",\n [AuthErrorCode.AUTH_API_KEY_INVALID_STATUS_TRANSITION]: \"api_key_invalid_status_transition\",\n [AuthErrorCode.AUTH_POLICY_INVALID]: \"policy_invalid\",\n [AuthErrorCode.AUTH_SMART_ACCOUNT_ALREADY_LINKED]: \"smart_account_already_linked\",\n [AuthErrorCode.AUTH_INVITE_ACCESS_DENIED]: \"invite_access_denied\",\n [AuthErrorCode.AUTH_INVITE_INVALID_STATE]: \"invite_invalid_state\",\n [AuthErrorCode.AUTH_MFA_DISABLED]: \"mfa_disabled\",\n [AuthErrorCode.AUTH_MFA_NOT_ENROLLED]: \"mfa_not_enrolled\",\n [AuthErrorCode.AUTH_MFA_SESSION_INVALID]: \"mfa_session_invalid\",\n [AuthErrorCode.AUTH_MFA_CHALLENGE_NOT_FOUND]: \"mfa_challenge_not_found\",\n [AuthErrorCode.AUTH_MFA_CHALLENGE_INVALID]: \"mfa_challenge_invalid\",\n [AuthErrorCode.AUTH_MFA_CHALLENGE_LOCKED]: \"mfa_challenge_locked\",\n [AuthErrorCode.AUTH_MFA_OTP_INVALID]: \"mfa_otp_invalid\",\n [AuthErrorCode.AUTH_MFA_RECOVERY_INVALID]: \"mfa_recovery_invalid\",\n [AuthErrorCode.AUTH_MFA_PASSKEY_NOT_AVAILABLE]: \"mfa_passkey_not_available\",\n [AuthErrorCode.AUTH_MFA_PASSKEY_CREDENTIAL_INVALID]: \"mfa_passkey_credential_invalid\",\n [AuthErrorCode.AUTH_MFA_PASSKEY_VERIFY_FAILED]: \"mfa_passkey_verify_failed\",\n [AuthErrorCode.AUTH_MFA_ENROLLMENT_BINDING_INVALID]: \"mfa_enrollment_binding_invalid\",\n [AuthErrorCode.AUTH_STEP_UP_REQUIRED]: \"step_up_required\",\n [AuthErrorCode.AUTH_STEP_UP_PROOF_UNAVAILABLE]: \"step_up_proof_unavailable\",\n [AuthErrorCode.AUTH_STEP_UP_ALREADY_CLAIMED]: \"step_up_already_claimed\",\n [AuthErrorCode.AUTH_POLICY_IN_USE]: \"policy_in_use\",\n [AuthErrorCode.AUTH_POLICY_LOCKED]: \"policy_locked\",\n [AuthErrorCode.AUTH_POLICY_SCOPE_MISMATCH]: \"policy_scope_mismatch\",\n [AuthErrorCode.AUTH_REVISION_CONFLICT]: \"revision_conflict\",\n [AuthErrorCode.AUTH_MFA_ELEVATION_REQUIRED]: \"mfa_elevation_required\",\n [AuthErrorCode.AUTH_MFA_LAST_FACTOR_REQUIRED]: \"mfa_last_factor_required\",\n [AuthErrorCode.AUTH_INTERNAL_ERROR]: \"internal_error\",\n [AuthErrorCode.AUTH_TERMS_NOT_ACCEPTED]: \"terms_not_accepted\",\n [AuthErrorCode.AUTH_SOCIAL_VERIFICATION_EXPIRED]: \"social_verification_expired\",\n [AuthErrorCode.AUTH_SOCIAL_VERIFICATION_INVALID_STATE]: \"social_verification_invalid_state\",\n [AuthErrorCode.AUTH_SUBACCOUNT_CHALLENGE_INVALID]: \"subaccount_challenge_invalid\",\n [AuthErrorCode.AUTH_SOCIAL_ACCOUNT_ALREADY_LINKED]: \"social_account_already_linked\",\n } satisfies Partial<ProtoToOutput<AuthErrorCode, SocialVerificationErrorCodeValue>>,\n} as const;\n"],"mappings":";;;AAIA,MAAa,yBAAyB,CAAC,WAAW,SAAS;AAG3D,MAAa,oCAAoC;CAAC;CAAW;CAAW;AAAI;AAG5E,MAAa,oCAAoC;CAC7C;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;AAGA,MAAa,sBAAsB;CAC/B,cAAc;EACV,SAAA;EACA,SAAA;CACJ;CACA,eAAe;GACkC,IAAA;GACb,IAAA;GACA,IAAA;CACpC;AACJ;AAEA,MAAa,gCAAgC;CACzC,cAAc;EACV,SAAA;EACA,SAAA;EACA,IAAA;CACJ;CACA,eAAe;GAC0C,IAAA;GACJ,IAAA;GACA,IAAA;GACL,IAAA;CAChD;AACJ;AAEA,MAAa,gCAAgC,EACzC,eAAe;EAC0C,IAAA;EACQ,IAAA;EACb,IAAA;EACK,IAAA;EACH,IAAA;EACF,IAAA;EACC,IAAA;EACE,IAAA;AACvD,EACJ;AAEA,MAAa,wCAAwC;CACjD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;AAKA,MAAa,mCAAmC,EAC5C,eAAe;EACuB,IAAA;EACK,IAAA;EACF,IAAA;EACG,IAAA;EACM,IAAA;EACN,IAAA;EACF,IAAA;EACQ,IAAA;EACC,IAAA;EACL,IAAA;EACD,KAAA;EACM,KAAA;EACH,KAAA;EACY,KAAA;EACnB,KAAA;EACc,KAAA;EACR,KAAA;EACA,KAAA;EACR,KAAA;EACI,KAAA;EACG,KAAA;EACI,KAAA;EACF,KAAA;EACD,KAAA;EACL,KAAA;EACK,KAAA;EACK,KAAA;EACK,KAAA;EACL,KAAA;EACK,KAAA;EACd,KAAA;EACS,KAAA;EACF,KAAA;EACV,KAAA;EACA,KAAA;EACQ,KAAA;EACJ,KAAA;EACK,KAAA;EACE,KAAA;EACV,KAAA;EACI,KAAA;EACS,KAAA;EACM,KAAA;EACL,KAAA;EACC,KAAA;AACxD,EACJ"}
|
|
1
|
+
{"version":3,"file":"social-verification.codecs.js","names":[],"sources":["../../../src/services/social-verification/social-verification.codecs.ts"],"sourcesContent":["import { AuthErrorCode } from \"../../gen/auth/v1/auth_pb.js\";\nimport * as Proto from \"../../gen/auth/v1/social_verification_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const SOCIAL_PROVIDER_VALUES = [\"twitter\", \"discord\", \"telegram\"] as const;\nexport type SocialProviderValue = (typeof SOCIAL_PROVIDER_VALUES)[number];\n\nexport const SOCIAL_VERIFICATION_METHOD_VALUES = [\"profile\", \"channel\", \"dm\"] as const;\nexport type SocialVerificationMethodValue = (typeof SOCIAL_VERIFICATION_METHOD_VALUES)[number];\n\nexport const SOCIAL_VERIFICATION_STATUS_VALUES = [\n \"pending_user_action\",\n \"queued\",\n \"in_progress\",\n \"verified\",\n \"failed\",\n \"expired\",\n \"canceled\",\n \"awaiting_confirmation\",\n] as const;\nexport type SocialVerificationStatusValue = (typeof SOCIAL_VERIFICATION_STATUS_VALUES)[number];\n\nexport const SocialProviderCodec = {\n inputToProto: {\n twitter: Proto.SocialProvider.TWITTER,\n discord: Proto.SocialProvider.DISCORD,\n telegram: Proto.SocialProvider.TELEGRAM,\n } satisfies InputToProto<SocialProviderValue, Proto.SocialProvider>,\n protoToOutput: {\n [Proto.SocialProvider.PROVIDER_UNSPECIFIED]: \"unspecified\",\n [Proto.SocialProvider.TWITTER]: \"twitter\",\n [Proto.SocialProvider.DISCORD]: \"discord\",\n [Proto.SocialProvider.TELEGRAM]: \"telegram\",\n } satisfies ProtoToOutput<Proto.SocialProvider, SocialProviderValue>,\n} as const;\n\nexport const SocialVerificationMethodCodec = {\n inputToProto: {\n profile: Proto.SocialVerificationMethod.METHOD_PROFILE,\n channel: Proto.SocialVerificationMethod.METHOD_CHANNEL,\n dm: Proto.SocialVerificationMethod.METHOD_DM,\n } satisfies InputToProto<SocialVerificationMethodValue, Proto.SocialVerificationMethod>,\n protoToOutput: {\n [Proto.SocialVerificationMethod.METHOD_UNSPECIFIED]: \"unspecified\",\n [Proto.SocialVerificationMethod.METHOD_PROFILE]: \"profile\",\n [Proto.SocialVerificationMethod.METHOD_CHANNEL]: \"channel\",\n [Proto.SocialVerificationMethod.METHOD_DM]: \"dm\",\n } satisfies ProtoToOutput<Proto.SocialVerificationMethod, SocialVerificationMethodValue>,\n} as const;\n\nexport const SocialVerificationStatusCodec = {\n protoToOutput: {\n [Proto.SocialVerificationStatus.STATUS_UNSPECIFIED]: \"unspecified\",\n [Proto.SocialVerificationStatus.STATUS_PENDING_USER_ACTION]: \"pending_user_action\",\n [Proto.SocialVerificationStatus.STATUS_QUEUED]: \"queued\",\n [Proto.SocialVerificationStatus.STATUS_IN_PROGRESS]: \"in_progress\",\n [Proto.SocialVerificationStatus.STATUS_VERIFIED]: \"verified\",\n [Proto.SocialVerificationStatus.STATUS_FAILED]: \"failed\",\n [Proto.SocialVerificationStatus.STATUS_EXPIRED]: \"expired\",\n [Proto.SocialVerificationStatus.STATUS_CANCELLED]: \"canceled\",\n [Proto.SocialVerificationStatus.STATUS_AWAITING_CONFIRMATION]: \"awaiting_confirmation\",\n } satisfies ProtoToOutput<Proto.SocialVerificationStatus, SocialVerificationStatusValue>,\n} as const;\n\nexport const SOCIAL_VERIFICATION_ERROR_CODE_VALUES = [\n \"username_invalid\",\n \"username_taken\",\n \"username_cooldown\",\n \"username_feature_locked\",\n \"username_reserved\",\n \"invalid_request\",\n \"authentication_required\",\n \"session_kind_not_allowed\",\n \"wallet_login_failed\",\n \"resource_not_found\",\n \"subaccount_access_denied\",\n \"api_key_access_denied\",\n \"api_key_invalid_status_transition\",\n \"policy_invalid\",\n \"smart_account_already_linked\",\n \"invite_access_denied\",\n \"invite_invalid_state\",\n \"mfa_disabled\",\n \"mfa_not_enrolled\",\n \"mfa_session_invalid\",\n \"mfa_challenge_not_found\",\n \"mfa_challenge_invalid\",\n \"mfa_challenge_locked\",\n \"mfa_otp_invalid\",\n \"mfa_recovery_invalid\",\n \"mfa_passkey_not_available\",\n \"mfa_passkey_credential_invalid\",\n \"mfa_passkey_verify_failed\",\n \"mfa_enrollment_binding_invalid\",\n \"step_up_required\",\n \"step_up_proof_unavailable\",\n \"step_up_already_claimed\",\n \"policy_in_use\",\n \"policy_locked\",\n \"policy_scope_mismatch\",\n \"revision_conflict\",\n \"mfa_elevation_required\",\n \"mfa_last_factor_required\",\n \"internal_error\",\n \"terms_not_accepted\",\n \"social_verification_expired\",\n \"social_verification_invalid_state\",\n \"subaccount_challenge_invalid\",\n \"social_account_already_linked\",\n] as const;\nexport type SocialVerificationErrorCodeValue =\n (typeof SOCIAL_VERIFICATION_ERROR_CODE_VALUES)[number];\n\n// Partial: auth codes added upstream decode to \"unspecified\" until mapped here.\nexport const SocialVerificationErrorCodeCodec = {\n protoToOutput: {\n [AuthErrorCode.AUTH_UNSPECIFIED]: \"unspecified\",\n [AuthErrorCode.AUTH_USERNAME_INVALID]: \"username_invalid\",\n [AuthErrorCode.AUTH_USERNAME_TAKEN]: \"username_taken\",\n [AuthErrorCode.AUTH_USERNAME_COOLDOWN]: \"username_cooldown\",\n [AuthErrorCode.AUTH_USERNAME_FEATURE_LOCKED]: \"username_feature_locked\",\n [AuthErrorCode.AUTH_USERNAME_RESERVED]: \"username_reserved\",\n [AuthErrorCode.AUTH_INVALID_REQUEST]: \"invalid_request\",\n [AuthErrorCode.AUTH_AUTHENTICATION_REQUIRED]: \"authentication_required\",\n [AuthErrorCode.AUTH_SESSION_KIND_NOT_ALLOWED]: \"session_kind_not_allowed\",\n [AuthErrorCode.AUTH_WALLET_LOGIN_FAILED]: \"wallet_login_failed\",\n [AuthErrorCode.AUTH_RESOURCE_NOT_FOUND]: \"resource_not_found\",\n [AuthErrorCode.AUTH_SUBACCOUNT_ACCESS_DENIED]: \"subaccount_access_denied\",\n [AuthErrorCode.AUTH_API_KEY_ACCESS_DENIED]: \"api_key_access_denied\",\n [AuthErrorCode.AUTH_API_KEY_INVALID_STATUS_TRANSITION]: \"api_key_invalid_status_transition\",\n [AuthErrorCode.AUTH_POLICY_INVALID]: \"policy_invalid\",\n [AuthErrorCode.AUTH_SMART_ACCOUNT_ALREADY_LINKED]: \"smart_account_already_linked\",\n [AuthErrorCode.AUTH_INVITE_ACCESS_DENIED]: \"invite_access_denied\",\n [AuthErrorCode.AUTH_INVITE_INVALID_STATE]: \"invite_invalid_state\",\n [AuthErrorCode.AUTH_MFA_DISABLED]: \"mfa_disabled\",\n [AuthErrorCode.AUTH_MFA_NOT_ENROLLED]: \"mfa_not_enrolled\",\n [AuthErrorCode.AUTH_MFA_SESSION_INVALID]: \"mfa_session_invalid\",\n [AuthErrorCode.AUTH_MFA_CHALLENGE_NOT_FOUND]: \"mfa_challenge_not_found\",\n [AuthErrorCode.AUTH_MFA_CHALLENGE_INVALID]: \"mfa_challenge_invalid\",\n [AuthErrorCode.AUTH_MFA_CHALLENGE_LOCKED]: \"mfa_challenge_locked\",\n [AuthErrorCode.AUTH_MFA_OTP_INVALID]: \"mfa_otp_invalid\",\n [AuthErrorCode.AUTH_MFA_RECOVERY_INVALID]: \"mfa_recovery_invalid\",\n [AuthErrorCode.AUTH_MFA_PASSKEY_NOT_AVAILABLE]: \"mfa_passkey_not_available\",\n [AuthErrorCode.AUTH_MFA_PASSKEY_CREDENTIAL_INVALID]: \"mfa_passkey_credential_invalid\",\n [AuthErrorCode.AUTH_MFA_PASSKEY_VERIFY_FAILED]: \"mfa_passkey_verify_failed\",\n [AuthErrorCode.AUTH_MFA_ENROLLMENT_BINDING_INVALID]: \"mfa_enrollment_binding_invalid\",\n [AuthErrorCode.AUTH_STEP_UP_REQUIRED]: \"step_up_required\",\n [AuthErrorCode.AUTH_STEP_UP_PROOF_UNAVAILABLE]: \"step_up_proof_unavailable\",\n [AuthErrorCode.AUTH_STEP_UP_ALREADY_CLAIMED]: \"step_up_already_claimed\",\n [AuthErrorCode.AUTH_POLICY_IN_USE]: \"policy_in_use\",\n [AuthErrorCode.AUTH_POLICY_LOCKED]: \"policy_locked\",\n [AuthErrorCode.AUTH_POLICY_SCOPE_MISMATCH]: \"policy_scope_mismatch\",\n [AuthErrorCode.AUTH_REVISION_CONFLICT]: \"revision_conflict\",\n [AuthErrorCode.AUTH_MFA_ELEVATION_REQUIRED]: \"mfa_elevation_required\",\n [AuthErrorCode.AUTH_MFA_LAST_FACTOR_REQUIRED]: \"mfa_last_factor_required\",\n [AuthErrorCode.AUTH_INTERNAL_ERROR]: \"internal_error\",\n [AuthErrorCode.AUTH_TERMS_NOT_ACCEPTED]: \"terms_not_accepted\",\n [AuthErrorCode.AUTH_SOCIAL_VERIFICATION_EXPIRED]: \"social_verification_expired\",\n [AuthErrorCode.AUTH_SOCIAL_VERIFICATION_INVALID_STATE]: \"social_verification_invalid_state\",\n [AuthErrorCode.AUTH_SUBACCOUNT_CHALLENGE_INVALID]: \"subaccount_challenge_invalid\",\n [AuthErrorCode.AUTH_SOCIAL_ACCOUNT_ALREADY_LINKED]: \"social_account_already_linked\",\n } satisfies Partial<ProtoToOutput<AuthErrorCode, SocialVerificationErrorCodeValue>>,\n} as const;\n"],"mappings":";;;AAIA,MAAa,yBAAyB;CAAC;CAAW;CAAW;AAAU;AAGvE,MAAa,oCAAoC;CAAC;CAAW;CAAW;AAAI;AAG5E,MAAa,oCAAoC;CAC7C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;AAGA,MAAa,sBAAsB;CAC/B,cAAc;EACV,SAAA;EACA,SAAA;EACA,UAAA;CACJ;CACA,eAAe;GACkC,IAAA;GACb,IAAA;GACA,IAAA;GACC,IAAA;CACrC;AACJ;AAEA,MAAa,gCAAgC;CACzC,cAAc;EACV,SAAA;EACA,SAAA;EACA,IAAA;CACJ;CACA,eAAe;GAC0C,IAAA;GACJ,IAAA;GACA,IAAA;GACL,IAAA;CAChD;AACJ;AAEA,MAAa,gCAAgC,EACzC,eAAe;EAC0C,IAAA;EACQ,IAAA;EACb,IAAA;EACK,IAAA;EACH,IAAA;EACF,IAAA;EACC,IAAA;EACE,IAAA;EACY,IAAA;AACnE,EACJ;AAEA,MAAa,wCAAwC;CACjD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;AAKA,MAAa,mCAAmC,EAC5C,eAAe;EACuB,IAAA;EACK,IAAA;EACF,IAAA;EACG,IAAA;EACM,IAAA;EACN,IAAA;EACF,IAAA;EACQ,IAAA;EACC,IAAA;EACL,IAAA;EACD,KAAA;EACM,KAAA;EACH,KAAA;EACY,KAAA;EACnB,KAAA;EACc,KAAA;EACR,KAAA;EACA,KAAA;EACR,KAAA;EACI,KAAA;EACG,KAAA;EACI,KAAA;EACF,KAAA;EACD,KAAA;EACL,KAAA;EACK,KAAA;EACK,KAAA;EACK,KAAA;EACL,KAAA;EACK,KAAA;EACd,KAAA;EACS,KAAA;EACF,KAAA;EACV,KAAA;EACA,KAAA;EACQ,KAAA;EACJ,KAAA;EACK,KAAA;EACE,KAAA;EACV,KAAA;EACI,KAAA;EACS,KAAA;EACM,KAAA;EACL,KAAA;EACC,KAAA;AACxD,EACJ"}
|