@polyester/sdk 0.35.0 → 0.36.0-devnet-20261112144059
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/dist/catalogs/snapshot-validation.js +5 -0
- package/dist/catalogs/snapshot-validation.js.map +1 -1
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +2 -0
- package/dist/client.js.map +1 -1
- package/dist/gen/ai/v1/assistant_pb.d.ts +144 -2
- package/dist/gen/ai/v1/assistant_pb.d.ts.map +1 -1
- package/dist/gen/ai/v1/assistant_pb.js +32 -2
- package/dist/gen/ai/v1/assistant_pb.js.map +1 -1
- package/dist/gen/alerts/v1/price_alerts_pb.d.ts +11 -5
- package/dist/gen/alerts/v1/price_alerts_pb.d.ts.map +1 -1
- package/dist/gen/alerts/v1/price_alerts_pb.js +3 -1
- package/dist/gen/alerts/v1/price_alerts_pb.js.map +1 -1
- package/dist/gen/auth/v1/policies_pb.d.ts +14 -1
- package/dist/gen/auth/v1/policies_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/policies_pb.js +14 -1
- package/dist/gen/auth/v1/policies_pb.js.map +1 -1
- package/dist/gen/auth/v1/subaccounts_pb.d.ts +14 -1
- package/dist/gen/auth/v1/subaccounts_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/subaccounts_pb.js +14 -1
- package/dist/gen/auth/v1/subaccounts_pb.js.map +1 -1
- package/dist/gen/changelog/v1/changelog_pb.d.ts +7 -1
- package/dist/gen/changelog/v1/changelog_pb.d.ts.map +1 -1
- package/dist/gen/changelog/v1/changelog_pb.js +7 -1
- package/dist/gen/changelog/v1/changelog_pb.js.map +1 -1
- package/dist/gen/index.d.ts +2 -1
- package/dist/gen/index.js +2 -1
- package/dist/gen/marketdata/v1/marketdata_pb.d.ts +57 -5
- package/dist/gen/marketdata/v1/marketdata_pb.d.ts.map +1 -1
- package/dist/gen/marketdata/v1/marketdata_pb.js +10 -4
- package/dist/gen/marketdata/v1/marketdata_pb.js.map +1 -1
- package/dist/gen/notifications/v1/notifications_pb.d.ts +827 -0
- package/dist/gen/notifications/v1/notifications_pb.d.ts.map +1 -0
- package/dist/gen/notifications/v1/notifications_pb.js +346 -0
- package/dist/gen/notifications/v1/notifications_pb.js.map +1 -0
- package/dist/gen/orders/v1/orders_pb.d.ts +247 -19
- package/dist/gen/orders/v1/orders_pb.d.ts.map +1 -1
- package/dist/gen/orders/v1/orders_pb.js +188 -66
- package/dist/gen/orders/v1/orders_pb.js.map +1 -1
- package/dist/gen/orders/v1/orders_read_pb.d.ts +73 -5
- package/dist/gen/orders/v1/orders_read_pb.d.ts.map +1 -1
- package/dist/gen/orders/v1/orders_read_pb.js +40 -5
- package/dist/gen/orders/v1/orders_read_pb.js.map +1 -1
- package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts +1195 -190
- package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts.map +1 -1
- package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js +317 -7
- package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.js.map +1 -1
- package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts +369 -6
- package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts.map +1 -1
- package/dist/gen/swap/quickswap/v1/quickswap_pb.js +237 -14
- package/dist/gen/swap/quickswap/v1/quickswap_pb.js.map +1 -1
- package/dist/gen/tradews/v1/trade_ws_pb.d.ts +39 -1
- package/dist/gen/tradews/v1/trade_ws_pb.d.ts.map +1 -1
- package/dist/gen/tradews/v1/trade_ws_pb.js +2 -1
- package/dist/gen/tradews/v1/trade_ws_pb.js.map +1 -1
- package/dist/gen/triggers/v1/triggers_pb.d.ts +526 -13
- package/dist/gen/triggers/v1/triggers_pb.d.ts.map +1 -1
- package/dist/gen/triggers/v1/triggers_pb.js +126 -26
- package/dist/gen/triggers/v1/triggers_pb.js.map +1 -1
- package/dist/index.d.ts +7 -4
- package/dist/services/assistant/assistant-events.schemas.d.ts +57 -39
- package/dist/services/assistant/assistant-events.schemas.d.ts.map +1 -1
- package/dist/services/assistant/assistant.d.ts +16 -1
- package/dist/services/assistant/assistant.d.ts.map +1 -1
- package/dist/services/assistant/assistant.js +24 -1
- package/dist/services/assistant/assistant.js.map +1 -1
- package/dist/services/assistant/assistant.schemas.d.ts +13 -1
- package/dist/services/assistant/assistant.schemas.d.ts.map +1 -1
- package/dist/services/assistant/assistant.schemas.js +15 -1
- package/dist/services/assistant/assistant.schemas.js.map +1 -1
- package/dist/services/assistant/assistant.types.d.ts +2 -2
- package/dist/services/auto-withdraw/auto-withdraw.schemas.d.ts +22 -22
- package/dist/services/changelog/changelog.codecs.d.ts +1 -1
- package/dist/services/changelog/changelog.codecs.d.ts.map +1 -1
- package/dist/services/changelog/changelog.codecs.js +6 -3
- package/dist/services/changelog/changelog.codecs.js.map +1 -1
- package/dist/services/changelog/changelog.schemas.d.ts +19 -19
- package/dist/services/checkpoints/checkpoints.schemas.d.ts +1 -1
- package/dist/services/internal-transfers/internal-transfers.schemas.d.ts +3 -3
- package/dist/services/lifecycle/lifecycle.schemas.d.ts +13 -13
- package/dist/services/market-data/market-data.schemas.js +16 -1
- package/dist/services/market-data/market-data.schemas.js.map +1 -1
- package/dist/services/notifications/notifications.codecs.d.ts +16 -0
- package/dist/services/notifications/notifications.codecs.d.ts.map +1 -0
- package/dist/services/notifications/notifications.codecs.js +40 -0
- package/dist/services/notifications/notifications.codecs.js.map +1 -0
- package/dist/services/notifications/notifications.d.ts +41 -0
- package/dist/services/notifications/notifications.d.ts.map +1 -0
- package/dist/services/notifications/notifications.js +67 -0
- package/dist/services/notifications/notifications.js.map +1 -0
- package/dist/services/notifications/notifications.schemas.d.ts +154 -0
- package/dist/services/notifications/notifications.schemas.d.ts.map +1 -0
- package/dist/services/notifications/notifications.schemas.js +116 -0
- package/dist/services/notifications/notifications.schemas.js.map +1 -0
- package/dist/services/notifications/notifications.types.d.ts +3 -0
- package/dist/services/notifications/service.d.ts +8 -0
- package/dist/services/notifications/service.d.ts.map +1 -0
- package/dist/services/notifications/service.js +9 -0
- package/dist/services/notifications/service.js.map +1 -0
- package/dist/services/orders/order-enums.codecs.js +12 -4
- package/dist/services/orders/order-enums.codecs.js.map +1 -1
- package/dist/services/orders/order-errors.schemas.d.ts +1 -1
- package/dist/services/orders/orders-batch.schemas.d.ts +2688 -417
- package/dist/services/orders/orders-batch.schemas.d.ts.map +1 -1
- package/dist/services/orders/orders-batch.schemas.js +5 -3
- package/dist/services/orders/orders-batch.schemas.js.map +1 -1
- package/dist/services/orders/orders-input.schemas.d.ts +4828 -1265
- package/dist/services/orders/orders-input.schemas.d.ts.map +1 -1
- package/dist/services/orders/orders-input.schemas.js +104 -32
- package/dist/services/orders/orders-input.schemas.js.map +1 -1
- package/dist/services/orders/orders-output.schemas.d.ts +40 -22
- package/dist/services/orders/orders-output.schemas.d.ts.map +1 -1
- package/dist/services/orders/orders-output.schemas.js +8 -0
- package/dist/services/orders/orders-output.schemas.js.map +1 -1
- package/dist/services/orders/orders-risk.schemas.d.ts +1 -1
- package/dist/services/orders/orders-risk.schemas.d.ts.map +1 -1
- package/dist/services/orders/orders-risk.schemas.js +1 -1
- package/dist/services/orders/orders-risk.schemas.js.map +1 -1
- package/dist/services/orders/orders.codecs.js +3 -0
- package/dist/services/orders/orders.codecs.js.map +1 -1
- package/dist/services/orders/orders.d.ts +3 -1
- package/dist/services/orders/orders.d.ts.map +1 -1
- package/dist/services/orders/orders.js +5 -12
- package/dist/services/orders/orders.js.map +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 +3 -3
- package/dist/services/price-alerts/price-alerts.d.ts +10 -5
- package/dist/services/price-alerts/price-alerts.d.ts.map +1 -1
- package/dist/services/price-alerts/price-alerts.js +10 -5
- package/dist/services/price-alerts/price-alerts.js.map +1 -1
- package/dist/services/rewards/rewards.schemas.d.ts +4 -4
- 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 +7 -7
- package/dist/services/trades/trades.schemas.d.ts +1 -1
- package/dist/services/triggers/trigger-input.schemas.d.ts +271 -41
- package/dist/services/triggers/trigger-input.schemas.d.ts.map +1 -1
- package/dist/services/triggers/trigger-input.schemas.js +51 -3
- package/dist/services/triggers/trigger-input.schemas.js.map +1 -1
- package/dist/services/triggers/triggers-output.schemas.d.ts +235 -24
- package/dist/services/triggers/triggers-output.schemas.d.ts.map +1 -1
- package/dist/services/triggers/triggers-output.schemas.js +49 -2
- package/dist/services/triggers/triggers-output.schemas.js.map +1 -1
- package/dist/services/triggers/triggers.codecs.js +7 -2
- package/dist/services/triggers/triggers.codecs.js.map +1 -1
- package/dist/services/triggers/triggers.d.ts +25 -3
- package/dist/services/triggers/triggers.d.ts.map +1 -1
- package/dist/services/triggers/triggers.js +49 -3
- package/dist/services/triggers/triggers.js.map +1 -1
- package/dist/services/triggers/triggers.schemas.d.ts +3 -3
- package/dist/services/triggers/triggers.types.d.ts +3 -3
- package/dist/services/vip/vip.schemas.d.ts +3 -3
- package/dist/shared/catalog-config.d.ts +6 -0
- package/dist/shared/catalog-config.d.ts.map +1 -1
- package/dist/shared/catalog-config.js.map +1 -1
- package/dist/shared/error-detail.d.ts +6 -2
- package/dist/shared/error-detail.d.ts.map +1 -1
- package/dist/shared/error-detail.js +1 -0
- package/dist/shared/error-detail.js.map +1 -1
- package/dist/shared/error-details/notifications.js +15 -0
- package/dist/shared/error-details/notifications.js.map +1 -0
- package/dist/shared/request-id.d.ts +6 -0
- package/dist/shared/request-id.d.ts.map +1 -0
- package/dist/shared/request-id.js +17 -0
- package/dist/shared/request-id.js.map +1 -0
- package/dist/wired-services.d.ts.map +1 -1
- package/dist/wired-services.js +2 -0
- package/dist/wired-services.js.map +1 -1
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@ type GetChangelogPostInput = v.InferInput<typeof GetChangelogPostInputSchema>;
|
|
|
20
20
|
declare const ListChangelogChangesInputSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
21
21
|
readonly categories: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["breaking_change", "new_feature", "improvement", "bug_fix"], undefined>, undefined>, readonly []>;
|
|
22
22
|
readonly actionRequired: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
23
|
-
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["trading", "funding", "accounts", "api", "explorer", "documentation", "platform", "market_data", "quickswap", "rewards"], undefined>, undefined>, readonly []>;
|
|
23
|
+
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["trading", "funding", "accounts", "api", "explorer", "documentation", "platform", "market_data", "quickswap", "rewards", "assistant"], undefined>, undefined>, readonly []>;
|
|
24
24
|
readonly audiences: v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["all_users", "traders", "market_makers", "developers"], undefined>, undefined>, readonly []>;
|
|
25
25
|
readonly startTime: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>, undefined>;
|
|
26
26
|
readonly endTime: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>]>, undefined>;
|
|
@@ -31,7 +31,7 @@ declare const ListChangelogChangesInputSchema: v.SchemaWithPipe<readonly [v.Stri
|
|
|
31
31
|
}, undefined>, v.CheckAction<{
|
|
32
32
|
categories: ("breaking_change" | "new_feature" | "improvement" | "bug_fix")[];
|
|
33
33
|
actionRequired?: boolean | undefined;
|
|
34
|
-
surfaces: ("
|
|
34
|
+
surfaces: ("assistant" | "rewards" | "trading" | "funding" | "accounts" | "api" | "explorer" | "documentation" | "platform" | "market_data" | "quickswap")[];
|
|
35
35
|
audiences: ("all_users" | "traders" | "market_makers" | "developers")[];
|
|
36
36
|
startTime?: number | undefined;
|
|
37
37
|
endTime?: number | undefined;
|
|
@@ -42,7 +42,7 @@ declare const ListChangelogChangesInputSchema: v.SchemaWithPipe<readonly [v.Stri
|
|
|
42
42
|
}, "endTime: must be after startTime">, v.TransformAction<{
|
|
43
43
|
categories: ("breaking_change" | "new_feature" | "improvement" | "bug_fix")[];
|
|
44
44
|
actionRequired?: boolean | undefined;
|
|
45
|
-
surfaces: ("
|
|
45
|
+
surfaces: ("assistant" | "rewards" | "trading" | "funding" | "accounts" | "api" | "explorer" | "documentation" | "platform" | "market_data" | "quickswap")[];
|
|
46
46
|
audiences: ("all_users" | "traders" | "market_makers" | "developers")[];
|
|
47
47
|
startTime?: number | undefined;
|
|
48
48
|
endTime?: number | undefined;
|
|
@@ -52,7 +52,7 @@ declare const ListChangelogChangesInputSchema: v.SchemaWithPipe<readonly [v.Stri
|
|
|
52
52
|
pageToken: string;
|
|
53
53
|
}, {
|
|
54
54
|
categories: (ChangeCategory.BREAKING_CHANGE | ChangeCategory.NEW_FEATURE | ChangeCategory.IMPROVEMENT | ChangeCategory.BUG_FIX)[];
|
|
55
|
-
surfaces: (Surface.TRADING | Surface.FUNDING | Surface.ACCOUNTS | Surface.API | Surface.EXPLORER | Surface.DOCUMENTATION | Surface.PLATFORM | Surface.MARKET_DATA | Surface.QUICKSWAP | Surface.REWARDS)[];
|
|
55
|
+
surfaces: (Surface.TRADING | Surface.FUNDING | Surface.ACCOUNTS | Surface.API | Surface.EXPLORER | Surface.DOCUMENTATION | Surface.PLATFORM | Surface.MARKET_DATA | Surface.QUICKSWAP | Surface.REWARDS | Surface.ASSISTANT)[];
|
|
56
56
|
audiences: (Audience.ALL_USERS | Audience.TRADERS | Audience.MARKET_MAKERS | Audience.DEVELOPERS)[];
|
|
57
57
|
startTime: import("@bufbuild/protobuf/wkt").Timestamp | undefined;
|
|
58
58
|
endTime: import("@bufbuild/protobuf/wkt").Timestamp | undefined;
|
|
@@ -73,14 +73,14 @@ declare const ChangelogChangeSchema: v.ObjectSchema<{
|
|
|
73
73
|
readonly actionRequired: v.BooleanSchema<undefined>;
|
|
74
74
|
readonly migrationGuidance: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
75
75
|
readonly audiences: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "all_users" | "traders" | "market_makers" | "developers">]>, undefined>, readonly []>;
|
|
76
|
-
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
76
|
+
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "rewards" | "trading" | "funding" | "accounts" | "api" | "explorer" | "documentation" | "platform" | "market_data" | "quickswap">]>, undefined>, readonly []>;
|
|
77
77
|
}, undefined>;
|
|
78
78
|
type ChangelogChange = v.InferOutput<typeof ChangelogChangeSchema>;
|
|
79
79
|
/** `surface` is the product area the section covers, `"unspecified"` when it spans several. */
|
|
80
80
|
declare const ChangelogSectionSchema: v.ObjectSchema<{
|
|
81
81
|
readonly heading: v.StringSchema<undefined>;
|
|
82
82
|
readonly summary: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
83
|
-
readonly surface: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
83
|
+
readonly surface: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "rewards" | "trading" | "funding" | "accounts" | "api" | "explorer" | "documentation" | "platform" | "market_data" | "quickswap">]>;
|
|
84
84
|
readonly changes: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
85
85
|
readonly id: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
86
86
|
readonly title: v.StringSchema<undefined>;
|
|
@@ -90,7 +90,7 @@ declare const ChangelogSectionSchema: v.ObjectSchema<{
|
|
|
90
90
|
readonly actionRequired: v.BooleanSchema<undefined>;
|
|
91
91
|
readonly migrationGuidance: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
92
92
|
readonly audiences: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "all_users" | "traders" | "market_makers" | "developers">]>, undefined>, readonly []>;
|
|
93
|
-
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
93
|
+
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "rewards" | "trading" | "funding" | "accounts" | "api" | "explorer" | "documentation" | "platform" | "market_data" | "quickswap">]>, undefined>, readonly []>;
|
|
94
94
|
}, undefined>, undefined>, readonly []>;
|
|
95
95
|
}, undefined>;
|
|
96
96
|
type ChangelogSection = v.InferOutput<typeof ChangelogSectionSchema>;
|
|
@@ -209,7 +209,7 @@ declare const ChangelogPostSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
|
209
209
|
readonly sections: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
210
210
|
readonly heading: v.StringSchema<undefined>;
|
|
211
211
|
readonly summary: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
212
|
-
readonly surface: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
212
|
+
readonly surface: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "rewards" | "trading" | "funding" | "accounts" | "api" | "explorer" | "documentation" | "platform" | "market_data" | "quickswap">]>;
|
|
213
213
|
readonly changes: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
214
214
|
readonly id: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
215
215
|
readonly title: v.StringSchema<undefined>;
|
|
@@ -219,7 +219,7 @@ declare const ChangelogPostSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
|
219
219
|
readonly actionRequired: v.BooleanSchema<undefined>;
|
|
220
220
|
readonly migrationGuidance: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
221
221
|
readonly audiences: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "all_users" | "traders" | "market_makers" | "developers">]>, undefined>, readonly []>;
|
|
222
|
-
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
222
|
+
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "rewards" | "trading" | "funding" | "accounts" | "api" | "explorer" | "documentation" | "platform" | "market_data" | "quickswap">]>, undefined>, readonly []>;
|
|
223
223
|
}, undefined>, undefined>, readonly []>;
|
|
224
224
|
}, undefined>, undefined>, readonly []>;
|
|
225
225
|
}, undefined>, v.TransformAction<{
|
|
@@ -241,7 +241,7 @@ declare const ChangelogPostSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
|
241
241
|
sections: {
|
|
242
242
|
heading: string;
|
|
243
243
|
summary?: string | undefined;
|
|
244
|
-
surface: "unspecified" | "
|
|
244
|
+
surface: "unspecified" | "assistant" | "rewards" | "trading" | "funding" | "accounts" | "api" | "explorer" | "documentation" | "platform" | "market_data" | "quickswap";
|
|
245
245
|
changes: {
|
|
246
246
|
id: string;
|
|
247
247
|
title: string;
|
|
@@ -251,14 +251,14 @@ declare const ChangelogPostSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
|
251
251
|
actionRequired: boolean;
|
|
252
252
|
migrationGuidance?: string | undefined;
|
|
253
253
|
audiences: ("unspecified" | "all_users" | "traders" | "market_makers" | "developers")[];
|
|
254
|
-
surfaces: ("unspecified" | "
|
|
254
|
+
surfaces: ("unspecified" | "assistant" | "rewards" | "trading" | "funding" | "accounts" | "api" | "explorer" | "documentation" | "platform" | "market_data" | "quickswap")[];
|
|
255
255
|
}[];
|
|
256
256
|
}[];
|
|
257
257
|
}, {
|
|
258
258
|
sections: {
|
|
259
259
|
heading: string;
|
|
260
260
|
summary?: string | undefined;
|
|
261
|
-
surface: "unspecified" | "
|
|
261
|
+
surface: "unspecified" | "assistant" | "rewards" | "trading" | "funding" | "accounts" | "api" | "explorer" | "documentation" | "platform" | "market_data" | "quickswap";
|
|
262
262
|
changes: {
|
|
263
263
|
id: string;
|
|
264
264
|
title: string;
|
|
@@ -268,7 +268,7 @@ declare const ChangelogPostSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
|
268
268
|
actionRequired: boolean;
|
|
269
269
|
migrationGuidance?: string | undefined;
|
|
270
270
|
audiences: ("unspecified" | "all_users" | "traders" | "market_makers" | "developers")[];
|
|
271
|
-
surfaces: ("unspecified" | "
|
|
271
|
+
surfaces: ("unspecified" | "assistant" | "rewards" | "trading" | "funding" | "accounts" | "api" | "explorer" | "documentation" | "platform" | "market_data" | "quickswap")[];
|
|
272
272
|
}[];
|
|
273
273
|
}[];
|
|
274
274
|
slug: string;
|
|
@@ -296,7 +296,7 @@ declare const ChangelogChangeEntrySchema: v.SchemaWithPipe<readonly [v.ObjectSch
|
|
|
296
296
|
readonly actionRequired: v.BooleanSchema<undefined>;
|
|
297
297
|
readonly migrationGuidance: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
298
298
|
readonly audiences: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "all_users" | "traders" | "market_makers" | "developers">]>, undefined>, readonly []>;
|
|
299
|
-
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
299
|
+
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "rewards" | "trading" | "funding" | "accounts" | "api" | "explorer" | "documentation" | "platform" | "market_data" | "quickswap">]>, undefined>, readonly []>;
|
|
300
300
|
}, undefined>;
|
|
301
301
|
readonly postSlug: v.StringSchema<undefined>;
|
|
302
302
|
readonly publishedAt: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
@@ -317,7 +317,7 @@ declare const ChangelogChangeEntrySchema: v.SchemaWithPipe<readonly [v.ObjectSch
|
|
|
317
317
|
actionRequired: boolean;
|
|
318
318
|
migrationGuidance?: string | undefined;
|
|
319
319
|
audiences: ("unspecified" | "all_users" | "traders" | "market_makers" | "developers")[];
|
|
320
|
-
surfaces: ("unspecified" | "
|
|
320
|
+
surfaces: ("unspecified" | "assistant" | "rewards" | "trading" | "funding" | "accounts" | "api" | "explorer" | "documentation" | "platform" | "market_data" | "quickswap")[];
|
|
321
321
|
};
|
|
322
322
|
postSlug: string;
|
|
323
323
|
publishedAt: number;
|
|
@@ -334,7 +334,7 @@ declare const ChangelogChangeEntrySchema: v.SchemaWithPipe<readonly [v.ObjectSch
|
|
|
334
334
|
actionRequired: boolean;
|
|
335
335
|
migrationGuidance?: string | undefined;
|
|
336
336
|
audiences: ("unspecified" | "all_users" | "traders" | "market_makers" | "developers")[];
|
|
337
|
-
surfaces: ("unspecified" | "
|
|
337
|
+
surfaces: ("unspecified" | "assistant" | "rewards" | "trading" | "funding" | "accounts" | "api" | "explorer" | "documentation" | "platform" | "market_data" | "quickswap")[];
|
|
338
338
|
}>]>;
|
|
339
339
|
/** A change with the slug, first publication time and section heading of the post that announced it. */
|
|
340
340
|
type ChangelogChangeEntry = v.InferOutput<typeof ChangelogChangeEntrySchema>;
|
|
@@ -349,7 +349,7 @@ declare const ListChangelogChangesResultSchema: v.ObjectSchema<{
|
|
|
349
349
|
readonly actionRequired: v.BooleanSchema<undefined>;
|
|
350
350
|
readonly migrationGuidance: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
351
351
|
readonly audiences: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "all_users" | "traders" | "market_makers" | "developers">]>, undefined>, readonly []>;
|
|
352
|
-
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
352
|
+
readonly surfaces: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "assistant" | "rewards" | "trading" | "funding" | "accounts" | "api" | "explorer" | "documentation" | "platform" | "market_data" | "quickswap">]>, undefined>, readonly []>;
|
|
353
353
|
}, undefined>;
|
|
354
354
|
readonly postSlug: v.StringSchema<undefined>;
|
|
355
355
|
readonly publishedAt: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
@@ -370,7 +370,7 @@ declare const ListChangelogChangesResultSchema: v.ObjectSchema<{
|
|
|
370
370
|
actionRequired: boolean;
|
|
371
371
|
migrationGuidance?: string | undefined;
|
|
372
372
|
audiences: ("unspecified" | "all_users" | "traders" | "market_makers" | "developers")[];
|
|
373
|
-
surfaces: ("unspecified" | "
|
|
373
|
+
surfaces: ("unspecified" | "assistant" | "rewards" | "trading" | "funding" | "accounts" | "api" | "explorer" | "documentation" | "platform" | "market_data" | "quickswap")[];
|
|
374
374
|
};
|
|
375
375
|
postSlug: string;
|
|
376
376
|
publishedAt: number;
|
|
@@ -387,7 +387,7 @@ declare const ListChangelogChangesResultSchema: v.ObjectSchema<{
|
|
|
387
387
|
actionRequired: boolean;
|
|
388
388
|
migrationGuidance?: string | undefined;
|
|
389
389
|
audiences: ("unspecified" | "all_users" | "traders" | "market_makers" | "developers")[];
|
|
390
|
-
surfaces: ("unspecified" | "
|
|
390
|
+
surfaces: ("unspecified" | "assistant" | "rewards" | "trading" | "funding" | "accounts" | "api" | "explorer" | "documentation" | "platform" | "market_data" | "quickswap")[];
|
|
391
391
|
}>]>, undefined>, readonly []>;
|
|
392
392
|
readonly nextPageToken: v.StringSchema<undefined>;
|
|
393
393
|
}, undefined>;
|
|
@@ -427,7 +427,7 @@ declare const CheckpointSchema: v.ObjectSchema<{
|
|
|
427
427
|
readonly seasonResultUsd: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>]>, undefined>;
|
|
428
428
|
readonly subaccounts: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.MaxValueAction<bigint, bigint, undefined>, v.TransformAction<any, number>]>;
|
|
429
429
|
/** Values computed from partial evidence; show them with an approximation marker. */
|
|
430
|
-
readonly incomplete: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
430
|
+
readonly incomplete: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "tools" | "deposits" | "withdrawals" | "volume" | "top_pairs" | "order_types" | "time_in_force" | "order_status" | "median_limit_rest" | "internal_transfers" | "daily_claim_amounts" | "portfolio_value" | "trading_balances" | "funding_balances" | "transfers" | "season_result">]>, undefined>, readonly []>;
|
|
431
431
|
}, undefined>;
|
|
432
432
|
/**
|
|
433
433
|
* One frozen season recap of a root account and all of its subaccounts. An absent USD value
|
|
@@ -138,7 +138,7 @@ declare function createCreateInternalTransferResultSchema(): v.SchemaWithPipe<re
|
|
|
138
138
|
subaccountId: string | undefined;
|
|
139
139
|
smartAccountAddress: string | undefined;
|
|
140
140
|
}>]>, undefined>;
|
|
141
|
-
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
141
|
+
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "accepted" | "rejected" | "failed">]>;
|
|
142
142
|
/** Lifecycle flow ID for `lifecycle.getFlow`; empty when the server did not return one. */
|
|
143
143
|
readonly flowId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, "">;
|
|
144
144
|
}, undefined>, v.TransformAction<{
|
|
@@ -157,7 +157,7 @@ declare function createCreateInternalTransferResultSchema(): v.SchemaWithPipe<re
|
|
|
157
157
|
subaccountId: string | undefined;
|
|
158
158
|
smartAccountAddress: string | undefined;
|
|
159
159
|
} | undefined;
|
|
160
|
-
status: "unspecified" | "
|
|
160
|
+
status: "unspecified" | "accepted" | "rejected" | "failed";
|
|
161
161
|
flowId: string;
|
|
162
162
|
}, {
|
|
163
163
|
acceptedAtUnixMs: number;
|
|
@@ -172,7 +172,7 @@ declare function createCreateInternalTransferResultSchema(): v.SchemaWithPipe<re
|
|
|
172
172
|
subaccountId: string | undefined;
|
|
173
173
|
smartAccountAddress: string | undefined;
|
|
174
174
|
} | undefined;
|
|
175
|
-
status: "unspecified" | "
|
|
175
|
+
status: "unspecified" | "accepted" | "rejected" | "failed";
|
|
176
176
|
flowId: string;
|
|
177
177
|
}>]>;
|
|
178
178
|
type CreateInternalTransferResult = v.InferOutput<ReturnType<typeof createCreateInternalTransferResultSchema>>;
|
|
@@ -522,7 +522,7 @@ declare const LifecycleFlowStepSchema: v.SchemaWithPipe<readonly [v.ObjectSchema
|
|
|
522
522
|
declare const LifecycleFlowTimelineItemSchema: v.ObjectSchema<{
|
|
523
523
|
readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
524
524
|
readonly step: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "validation" | "unspecified" | "failed" | "execution" | "source" | "transfer" | "dropped" | "refunded" | "request" | "bridge_fulfillment" | "fulfilling" | "settlement">]>;
|
|
525
|
-
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
525
|
+
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "planned" | "completed" | "current">]>;
|
|
526
526
|
readonly expectedDurationMs: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, number>]>;
|
|
527
527
|
}, undefined>;
|
|
528
528
|
declare const LifecycleFlowSummaryProgressSchema: v.ObjectSchema<{
|
|
@@ -622,7 +622,7 @@ declare const LifecycleFlowSummarySchema: v.SchemaWithPipe<readonly [v.ObjectSch
|
|
|
622
622
|
readonly progressTimeline: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
623
623
|
readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
624
624
|
readonly step: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "validation" | "unspecified" | "failed" | "execution" | "source" | "transfer" | "dropped" | "refunded" | "request" | "bridge_fulfillment" | "fulfilling" | "settlement">]>;
|
|
625
|
-
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
625
|
+
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "planned" | "completed" | "current">]>;
|
|
626
626
|
readonly expectedDurationMs: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, number>]>;
|
|
627
627
|
}, undefined>, undefined>, readonly []>;
|
|
628
628
|
readonly estimatedCompletionUnixMs: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, number>]>;
|
|
@@ -692,7 +692,7 @@ declare const LifecycleFlowSummarySchema: v.SchemaWithPipe<readonly [v.ObjectSch
|
|
|
692
692
|
progressTimeline: {
|
|
693
693
|
sequence: number;
|
|
694
694
|
step: "validation" | "unspecified" | "failed" | "execution" | "source" | "transfer" | "dropped" | "refunded" | "request" | "bridge_fulfillment" | "fulfilling" | "settlement";
|
|
695
|
-
status: "unspecified" | "
|
|
695
|
+
status: "unspecified" | "planned" | "completed" | "current";
|
|
696
696
|
expectedDurationMs: number;
|
|
697
697
|
}[];
|
|
698
698
|
estimatedCompletionUnixMs: number;
|
|
@@ -756,7 +756,7 @@ declare const LifecycleFlowSummarySchema: v.SchemaWithPipe<readonly [v.ObjectSch
|
|
|
756
756
|
progressTimeline: {
|
|
757
757
|
sequence: number;
|
|
758
758
|
step: "validation" | "unspecified" | "failed" | "execution" | "source" | "transfer" | "dropped" | "refunded" | "request" | "bridge_fulfillment" | "fulfilling" | "settlement";
|
|
759
|
-
status: "unspecified" | "
|
|
759
|
+
status: "unspecified" | "planned" | "completed" | "current";
|
|
760
760
|
expectedDurationMs: number;
|
|
761
761
|
}[];
|
|
762
762
|
estimatedCompletionUnixMs: number;
|
|
@@ -852,7 +852,7 @@ declare const LifecycleFlowDetailSchema: v.ObjectSchema<{
|
|
|
852
852
|
readonly progressTimeline: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
853
853
|
readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
854
854
|
readonly step: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "validation" | "unspecified" | "failed" | "execution" | "source" | "transfer" | "dropped" | "refunded" | "request" | "bridge_fulfillment" | "fulfilling" | "settlement">]>;
|
|
855
|
-
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
855
|
+
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "planned" | "completed" | "current">]>;
|
|
856
856
|
readonly expectedDurationMs: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, number>]>;
|
|
857
857
|
}, undefined>, undefined>, readonly []>;
|
|
858
858
|
readonly estimatedCompletionUnixMs: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, number>]>;
|
|
@@ -922,7 +922,7 @@ declare const LifecycleFlowDetailSchema: v.ObjectSchema<{
|
|
|
922
922
|
progressTimeline: {
|
|
923
923
|
sequence: number;
|
|
924
924
|
step: "validation" | "unspecified" | "failed" | "execution" | "source" | "transfer" | "dropped" | "refunded" | "request" | "bridge_fulfillment" | "fulfilling" | "settlement";
|
|
925
|
-
status: "unspecified" | "
|
|
925
|
+
status: "unspecified" | "planned" | "completed" | "current";
|
|
926
926
|
expectedDurationMs: number;
|
|
927
927
|
}[];
|
|
928
928
|
estimatedCompletionUnixMs: number;
|
|
@@ -986,7 +986,7 @@ declare const LifecycleFlowDetailSchema: v.ObjectSchema<{
|
|
|
986
986
|
progressTimeline: {
|
|
987
987
|
sequence: number;
|
|
988
988
|
step: "validation" | "unspecified" | "failed" | "execution" | "source" | "transfer" | "dropped" | "refunded" | "request" | "bridge_fulfillment" | "fulfilling" | "settlement";
|
|
989
|
-
status: "unspecified" | "
|
|
989
|
+
status: "unspecified" | "planned" | "completed" | "current";
|
|
990
990
|
expectedDurationMs: number;
|
|
991
991
|
}[];
|
|
992
992
|
estimatedCompletionUnixMs: number;
|
|
@@ -1364,7 +1364,7 @@ declare const ListLifecycleFlowsOutputSchema: v.ObjectSchema<{
|
|
|
1364
1364
|
readonly progressTimeline: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
1365
1365
|
readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
1366
1366
|
readonly step: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "validation" | "unspecified" | "failed" | "execution" | "source" | "transfer" | "dropped" | "refunded" | "request" | "bridge_fulfillment" | "fulfilling" | "settlement">]>;
|
|
1367
|
-
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
1367
|
+
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "planned" | "completed" | "current">]>;
|
|
1368
1368
|
readonly expectedDurationMs: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, number>]>;
|
|
1369
1369
|
}, undefined>, undefined>, readonly []>;
|
|
1370
1370
|
readonly estimatedCompletionUnixMs: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, number>]>;
|
|
@@ -1434,7 +1434,7 @@ declare const ListLifecycleFlowsOutputSchema: v.ObjectSchema<{
|
|
|
1434
1434
|
progressTimeline: {
|
|
1435
1435
|
sequence: number;
|
|
1436
1436
|
step: "validation" | "unspecified" | "failed" | "execution" | "source" | "transfer" | "dropped" | "refunded" | "request" | "bridge_fulfillment" | "fulfilling" | "settlement";
|
|
1437
|
-
status: "unspecified" | "
|
|
1437
|
+
status: "unspecified" | "planned" | "completed" | "current";
|
|
1438
1438
|
expectedDurationMs: number;
|
|
1439
1439
|
}[];
|
|
1440
1440
|
estimatedCompletionUnixMs: number;
|
|
@@ -1498,7 +1498,7 @@ declare const ListLifecycleFlowsOutputSchema: v.ObjectSchema<{
|
|
|
1498
1498
|
progressTimeline: {
|
|
1499
1499
|
sequence: number;
|
|
1500
1500
|
step: "validation" | "unspecified" | "failed" | "execution" | "source" | "transfer" | "dropped" | "refunded" | "request" | "bridge_fulfillment" | "fulfilling" | "settlement";
|
|
1501
|
-
status: "unspecified" | "
|
|
1501
|
+
status: "unspecified" | "planned" | "completed" | "current";
|
|
1502
1502
|
expectedDurationMs: number;
|
|
1503
1503
|
}[];
|
|
1504
1504
|
estimatedCompletionUnixMs: number;
|
|
@@ -1597,7 +1597,7 @@ declare const GetLifecycleFlowOutputSchema: v.ObjectSchema<{
|
|
|
1597
1597
|
readonly progressTimeline: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
1598
1598
|
readonly sequence: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
1599
1599
|
readonly step: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "validation" | "unspecified" | "failed" | "execution" | "source" | "transfer" | "dropped" | "refunded" | "request" | "bridge_fulfillment" | "fulfilling" | "settlement">]>;
|
|
1600
|
-
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
1600
|
+
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "planned" | "completed" | "current">]>;
|
|
1601
1601
|
readonly expectedDurationMs: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, number>]>;
|
|
1602
1602
|
}, undefined>, undefined>, readonly []>;
|
|
1603
1603
|
readonly estimatedCompletionUnixMs: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, number>]>;
|
|
@@ -1667,7 +1667,7 @@ declare const GetLifecycleFlowOutputSchema: v.ObjectSchema<{
|
|
|
1667
1667
|
progressTimeline: {
|
|
1668
1668
|
sequence: number;
|
|
1669
1669
|
step: "validation" | "unspecified" | "failed" | "execution" | "source" | "transfer" | "dropped" | "refunded" | "request" | "bridge_fulfillment" | "fulfilling" | "settlement";
|
|
1670
|
-
status: "unspecified" | "
|
|
1670
|
+
status: "unspecified" | "planned" | "completed" | "current";
|
|
1671
1671
|
expectedDurationMs: number;
|
|
1672
1672
|
}[];
|
|
1673
1673
|
estimatedCompletionUnixMs: number;
|
|
@@ -1731,7 +1731,7 @@ declare const GetLifecycleFlowOutputSchema: v.ObjectSchema<{
|
|
|
1731
1731
|
progressTimeline: {
|
|
1732
1732
|
sequence: number;
|
|
1733
1733
|
step: "validation" | "unspecified" | "failed" | "execution" | "source" | "transfer" | "dropped" | "refunded" | "request" | "bridge_fulfillment" | "fulfilling" | "settlement";
|
|
1734
|
-
status: "unspecified" | "
|
|
1734
|
+
status: "unspecified" | "planned" | "completed" | "current";
|
|
1735
1735
|
expectedDurationMs: number;
|
|
1736
1736
|
}[];
|
|
1737
1737
|
estimatedCompletionUnixMs: number;
|
|
@@ -61,7 +61,8 @@ const TradeBackfillSchema = v.object({
|
|
|
61
61
|
/** Integer wire scales are protocol-bounded to 0..18 decimal places. */
|
|
62
62
|
const WireScaleSchema = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(18));
|
|
63
63
|
const OptionalDecimalLimitSchema = v.optional(v.pipe(v.string(), v.regex(/^\d+(\.\d+)?$/)));
|
|
64
|
-
const
|
|
64
|
+
const Uint32Schema = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(PROTOBUF_UINT32_MAX));
|
|
65
|
+
const OpenOrdersLimitSchema = v.optional(Uint32Schema, 0);
|
|
65
66
|
const AssetConfigSchema = v.pipe(v.object({
|
|
66
67
|
/**
|
|
67
68
|
* Asset identifier/symbol, e.g. 'USDT', 'BTC'.
|
|
@@ -170,6 +171,20 @@ const PairConfigSchema = v.pipe(v.object({
|
|
|
170
171
|
*/
|
|
171
172
|
maxOpenOrdersPerPair: OpenOrdersLimitSchema,
|
|
172
173
|
/**
|
|
174
|
+
* How far from the reference price (the last trade, or the index when they diverge
|
|
175
|
+
* by more than the band) an order may be priced or trade, in basis points. A buy limit
|
|
176
|
+
* above `reference × (1 + upperBps / 10000)` rounded down to the tick, or a sell limit
|
|
177
|
+
* below `reference × (1 − lowerBps / 10000)` rounded up, is rejected with
|
|
178
|
+
* `PRICE_BAND_VIOLATION`; a market order trades up to the limit and its remainder is
|
|
179
|
+
* canceled with `price_band`. The reference stays fixed for `referenceWindowMs` (zero
|
|
180
|
+
* moves it with every order). Absent when the pair has no band.
|
|
181
|
+
*/
|
|
182
|
+
priceBand: v.optional(v.object({
|
|
183
|
+
lowerBps: Uint32Schema,
|
|
184
|
+
upperBps: Uint32Schema,
|
|
185
|
+
referenceWindowMs: Uint32Schema
|
|
186
|
+
})),
|
|
187
|
+
/**
|
|
173
188
|
* Controls whether trading fee can be deducted from what you receive when buying.
|
|
174
189
|
* Example
|
|
175
190
|
* - You buy 1 ETH, fee is 0.1%
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"market-data.schemas.js","names":[],"sources":["../../../src/services/market-data/market-data.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport { SideSchema, SymbolIdInputSchema } from \"../shared.js\";\nimport {\n PAIR_STATUSES,\n type AssetConfig,\n type PairConfig,\n type PairMarketDataConfig,\n type PairStatus,\n type SpotConfig,\n} from \"../../shared/catalog-config.js\";\nimport { tsNsToMs } from \"../../utils/time.js\";\nimport { timestampToMs, tsNsToTimestamp } from \"../../utils/timestamp.js\";\nimport { optionalUint64DecimalFilterSchema } from \"../../shared/schemas.js\";\nimport { scaledToDecimalOutput, type SdkScales } from \"../../shared/decimal-surface.js\";\nimport { PROTOBUF_UINT32_MAX } from \"../../shared/wire-bounds.js\";\nimport { PairStatusCodec, SideFilterCodec } from \"./market-data.codecs.js\";\n\nexport type { AssetConfig, PairConfig, PairMarketDataConfig, PairStatus, SpotConfig };\nexport { PAIR_STATUSES };\n\nconst MarketTradeFieldsSchema = v.object({\n symbolId: v.number(),\n matchId: v.bigint(),\n isBuy: v.boolean(),\n priceTicks: v.bigint(),\n qtyScaled: v.bigint(),\n tsNs: v.optional(v.bigint(), 0n),\n});\n\n/** Formats a market trade; protobuf-decoded trades can be passed directly, they need no re-validation. */\nexport function formatMarketTrade(\n scales: SdkScales,\n t: v.InferOutput<typeof MarketTradeFieldsSchema>,\n) {\n const sideLabel: v.InferOutput<typeof SideSchema> = t.isBuy ? \"buy\" : \"sell\";\n return {\n symbolId: t.symbolId,\n matchId: t.matchId.toString(),\n isBuy: t.isBuy,\n sideLabel,\n qty: scaledToDecimalOutput(t.qtyScaled, scales.baseQty(t.symbolId)),\n price: scaledToDecimalOutput(t.priceTicks, scales.price()),\n tsNs: t.tsNs.toString(),\n tsMs: tsNsToMs(t.tsNs),\n };\n}\n\nexport function createMarketTradeSchema(scales: SdkScales) {\n return v.pipe(\n MarketTradeFieldsSchema,\n v.transform((t) => formatMarketTrade(scales, t)),\n );\n}\n\nexport type MarketTrade = v.InferOutput<ReturnType<typeof createMarketTradeSchema>>;\n\nexport const GetMarketTradesInputSchema = v.pipe(\n v.object({\n symbolId: SymbolIdInputSchema,\n side: v.optional(SideSchema),\n startTsNs: optionalUint64DecimalFilterSchema(\"startTsNs\"),\n endTsNs: optionalUint64DecimalFilterSchema(\"endTsNs\"),\n limit: v.optional(v.pipe(v.number(), v.integer(), v.gtValue(0), v.maxValue(1_000))),\n pageToken: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n afterTradeId: optionalUint64DecimalFilterSchema(\"afterTradeId\"),\n }),\n v.check(\n (input) =>\n input.afterTradeId === undefined ||\n (input.side === undefined &&\n input.startTsNs === undefined &&\n input.endTsNs === undefined &&\n input.pageToken === \"\"),\n \"afterTradeId cannot be combined with side, startTsNs, endTsNs or pageToken\",\n ),\n v.transform((input) => ({\n symbolId: input.symbolId,\n side: input.side ? SideFilterCodec.inputToProto[input.side] : undefined,\n startTime: tsNsToTimestamp(input.startTsNs),\n endTime: tsNsToTimestamp(input.endTsNs),\n limit: input.limit,\n pageToken: input.pageToken,\n afterTradeId: input.afterTradeId,\n })),\n);\n\n/** Cursor fields of a gap-free `afterTradeId` backfill page. */\nexport const TradeBackfillSchema = v.object({\n completeThroughTradeId: v.pipe(\n v.bigint(),\n v.transform((value) => value.toString()),\n ),\n nextAfterTradeId: v.pipe(\n v.bigint(),\n v.transform((value) => value.toString()),\n ),\n epochEnds: v.array(\n v.pipe(\n v.object({ epoch: v.bigint(), lastTradeId: v.bigint() }),\n v.transform(({ epoch, lastTradeId }) => ({\n epoch: epoch.toString(),\n lastTradeId: lastTradeId.toString(),\n })),\n ),\n ),\n});\n\nexport type TradeBackfill = v.InferOutput<typeof TradeBackfillSchema>;\n\nexport function createGetMarketTradesInputSchema() {\n return GetMarketTradesInputSchema;\n}\n\nexport type GetMarketTradesInput = v.InferInput<\n ReturnType<typeof createGetMarketTradesInputSchema>\n>;\nexport type GetMarketTradesRequest = v.InferOutput<\n ReturnType<typeof createGetMarketTradesInputSchema>\n>;\n\n/** Integer wire scales are protocol-bounded to 0..18 decimal places. */\nconst WireScaleSchema = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(18));\nconst OptionalDecimalLimitSchema = v.optional(v.pipe(v.string(), v.regex(/^\\d+(\\.\\d+)?$/)));\nconst OpenOrdersLimitSchema = v.optional(\n v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(PROTOBUF_UINT32_MAX)),\n 0,\n);\n\nexport const AssetConfigSchema = v.pipe(\n v.object({\n /**\n * Asset identifier/symbol, e.g. 'USDT', 'BTC'.\n */\n asset: v.string(),\n /**\n * Internal ledger identifier for settlement systems.\n */\n ledgerId: v.number(),\n /**\n * The friendly display name for the asset (e.g. 'Bitcoin').\n */\n name: v.string(),\n /**\n * UI-only display precision for asset amounts/balances.\n */\n quantityDisplayDecimals: v.number(),\n /**\n * Fixed integer scaling for quantities/amounts in this asset (0..18).\n */\n quantityScale: v.number(),\n /**\n * Integer scale for public candle and market-overview base volume (0..18).\n */\n marketDataVolumeScale: v.optional(WireScaleSchema, 0),\n /**\n * Whether the asset counts toward total equity; absent means unknown, never false.\n */\n includedInEquity: v.optional(v.boolean()),\n }),\n v.transform((a) => ({\n symbol: a.asset,\n ledgerId: a.ledgerId,\n name: a.name,\n quantityDisplayDecimals: a.quantityDisplayDecimals,\n quantityScale: a.quantityScale,\n marketDataVolumeScale: a.marketDataVolumeScale,\n ...(a.includedInEquity === undefined ? {} : { includedInEquity: a.includedInEquity }),\n })),\n);\n\nexport const PairMarketDataConfigSchema = v.optional(\n v.object({\n /**\n * Available price grouping sizes for the orderbook in quote units.\n * Allows viewing orders bucketed by larger increments (e.g., [0.01, 0.1, 1, 10]).\n */\n orderbookPriceBuckets: v.array(v.number()),\n }),\n {\n orderbookPriceBuckets: [] as number[],\n },\n);\n\nfunction bpsToPercent(bps: number): number {\n return bps / 100;\n}\n\nexport const PairConfigSchema = v.pipe(\n v.object({\n /**\n * Internal engine symbol id for the pair.\n */\n symbolId: v.number(),\n /**\n * Pair symbol string, e.g. 'BTC-USDT'\n */\n symbol: v.string(),\n /**\n * Base asset symbol, e.g. 'BTC'\n */\n baseAsset: v.string(),\n /**\n * Quote asset symbol, e.g. 'USDT'\n */\n quoteAsset: v.string(),\n /**\n * (e.g., \"0.01\") - The smallest price increment allowed. If tick size is 0.01, you can price at $100.00, $100.01, $100.02... but NOT $100.005.\n */\n tickSize: v.string(),\n /**\n * (e.g., \"0.0001\") - The smallest quantity increment allowed. If step size is 0.0001, you can order 100.0000, 100.0001, 100.0002... but NOT 100.00005.\n */\n stepSize: v.string(),\n /**\n * (e.g., \"1\") - Minimum order value in quote currency. If it's \"1\" and quote is USD, your order must be worth at least $1. So you can't buy $0.50 worth of something.\n */\n minNotionalQuote: v.string(),\n /**\n * Minimum quantity you can order in base currency terms. If it's \"0.001\" for BTC, smallest order is 0.001 BTC.\n */\n minQtyBase: v.string(),\n /**\n * Largest quantity of one limit order in base units. A replace is checked on its\n * new total less the filled quantity. Absent when the pair has no maximum.\n */\n maxLimitQtyBase: OptionalDecimalLimitSchema,\n /**\n * Largest quantity of one market order in base units, after converting a\n * quote-sized order to base. Absent when the pair has no maximum.\n */\n maxMarketQtyBase: OptionalDecimalLimitSchema,\n /**\n * Largest notional of one order in quote units: quantity times limit price, or\n * times protection price for a market order. Absent when the pair has no maximum.\n */\n maxOrderNotionalQuote: OptionalDecimalLimitSchema,\n /**\n * Largest notional of one market order in quote units, compared exactly with no\n * rounding. A buy is valued at its protection price and a sell at its reference\n * price (the touch or the client's reference price), before slippage. An order\n * above it is rejected with `MAX_NOTIONAL`. Absent when the pair has no maximum.\n */\n maxMarketNotionalQuote: OptionalDecimalLimitSchema,\n /**\n * Default resting-order limit (GTC and GTD) for a typical account on this pair.\n * An account may have a lower limit of its own.\n */\n maxOpenOrdersPerPair: OpenOrdersLimitSchema,\n\n /**\n * Controls whether trading fee can be deducted from what you receive when buying.\n * Example\n * - You buy 1 ETH, fee is 0.1%\n * - if `true`, you receive 0.999 ETH (fee taken from ETH you're getting)\n * - if `false`, you receive 1 ETH, but you pay the fee separately in the quote currency (e.g., extra USDT)\n */\n allowBuyFeeFromBase: v.boolean(),\n /**\n * Default market slippage for buy orders in basis points from proto.\n */\n defaultMarketSlippageBpsBuy: v.optional(v.number(), 0),\n /**\n * Default market slippage for sell orders in basis points from proto.\n */\n defaultMarketSlippageBpsSell: v.optional(v.number(), 0),\n /**\n * Maximum server/client reference-price drift in basis points from proto.\n */\n maxClientRefDriftBps: v.optional(v.number(), 0),\n\n /**\n * Market-data configuration for this pair (orderbook bucket sizes, depths).\n */\n marketdata: v.optional(PairMarketDataConfigSchema),\n /**\n * Base asset quantity scale copied from AssetConfig.quantityScale.\n */\n baseQuantityScale: v.number(),\n /**\n * Quote asset quantity scale copied from AssetConfig.quantityScale.\n */\n quoteQuantityScale: v.number(),\n /**\n * Integer scale for composite reference prices in candle responses (0..18).\n * Primary market and execution prices use the fixed scale 9.\n */\n referencePriceScale: v.optional(WireScaleSchema, 0),\n /**\n * Optional scheduled listing timestamp (UTC).\n */\n listingAt: v.pipe(v.optional(v.unknown()), v.transform(timestampToMs)),\n /**\n * Optional scheduled delisting timestamp (UTC).\n */\n delistingAt: v.pipe(v.optional(v.unknown()), v.transform(timestampToMs)),\n /**\n * Operational status of the pair.\n */\n status: v.pipe(\n v.number(),\n v.transform(\n (status): PairStatus =>\n PairStatusCodec.protoToOutput[\n status as keyof typeof PairStatusCodec.protoToOutput\n ] ?? \"unknown\",\n ),\n ),\n }),\n v.transform(\n ({\n defaultMarketSlippageBpsBuy,\n defaultMarketSlippageBpsSell,\n maxClientRefDriftBps,\n ...pair\n }) => ({\n ...pair,\n defaultMarketSlippagePctBuy: bpsToPercent(defaultMarketSlippageBpsBuy),\n defaultMarketSlippagePctSell: bpsToPercent(defaultMarketSlippageBpsSell),\n maxClientRefDriftPct: bpsToPercent(maxClientRefDriftBps),\n }),\n ),\n);\n\nexport const SpotConfigSchema = v.object({\n assets: v.array(AssetConfigSchema),\n pairs: v.array(PairConfigSchema),\n /**\n * Default resting-order limit (GTC and GTD) for a typical account across all pairs.\n * An account may have a lower limit of its own.\n */\n maxOpenOrdersTotal: OpenOrdersLimitSchema,\n tsSec: v.pipe(\n v.bigint(),\n v.transform((v) => Number(v) * 1000),\n ),\n});\n"],"mappings":";;;;;;;;;AAoBgC,EAAE,OAAO;CACrC,UAAU,EAAE,OAAO;CACnB,SAAS,EAAE,OAAO;CAClB,OAAO,EAAE,QAAQ;CACjB,YAAY,EAAE,OAAO;CACrB,WAAW,EAAE,OAAO;CACpB,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,EAAE;AACnC,CAAC;;AAGD,SAAgB,kBACZ,QACA,GACF;CACE,MAAM,YAA8C,EAAE,QAAQ,QAAQ;CACtE,OAAO;EACH,UAAU,EAAE;EACZ,SAAS,EAAE,QAAQ,SAAS;EAC5B,OAAO,EAAE;EACT;EACA,KAAK,sBAAsB,EAAE,WAAW,OAAO,QAAQ,EAAE,QAAQ,CAAC;EAClE,OAAO,sBAAsB,EAAE,YAAY,OAAO,MAAM,CAAC;EACzD,MAAM,EAAE,KAAK,SAAS;EACtB,MAAM,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CACvC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"market-data.schemas.js","names":[],"sources":["../../../src/services/market-data/market-data.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport { SideSchema, SymbolIdInputSchema } from \"../shared.js\";\nimport {\n PAIR_STATUSES,\n type AssetConfig,\n type PairConfig,\n type PairMarketDataConfig,\n type PairStatus,\n type SpotConfig,\n} from \"../../shared/catalog-config.js\";\nimport { tsNsToMs } from \"../../utils/time.js\";\nimport { timestampToMs, tsNsToTimestamp } from \"../../utils/timestamp.js\";\nimport { optionalUint64DecimalFilterSchema } from \"../../shared/schemas.js\";\nimport { scaledToDecimalOutput, type SdkScales } from \"../../shared/decimal-surface.js\";\nimport { PROTOBUF_UINT32_MAX } from \"../../shared/wire-bounds.js\";\nimport { PairStatusCodec, SideFilterCodec } from \"./market-data.codecs.js\";\n\nexport type { AssetConfig, PairConfig, PairMarketDataConfig, PairStatus, SpotConfig };\nexport { PAIR_STATUSES };\n\nconst MarketTradeFieldsSchema = v.object({\n symbolId: v.number(),\n matchId: v.bigint(),\n isBuy: v.boolean(),\n priceTicks: v.bigint(),\n qtyScaled: v.bigint(),\n tsNs: v.optional(v.bigint(), 0n),\n});\n\n/** Formats a market trade; protobuf-decoded trades can be passed directly, they need no re-validation. */\nexport function formatMarketTrade(\n scales: SdkScales,\n t: v.InferOutput<typeof MarketTradeFieldsSchema>,\n) {\n const sideLabel: v.InferOutput<typeof SideSchema> = t.isBuy ? \"buy\" : \"sell\";\n return {\n symbolId: t.symbolId,\n matchId: t.matchId.toString(),\n isBuy: t.isBuy,\n sideLabel,\n qty: scaledToDecimalOutput(t.qtyScaled, scales.baseQty(t.symbolId)),\n price: scaledToDecimalOutput(t.priceTicks, scales.price()),\n tsNs: t.tsNs.toString(),\n tsMs: tsNsToMs(t.tsNs),\n };\n}\n\nexport function createMarketTradeSchema(scales: SdkScales) {\n return v.pipe(\n MarketTradeFieldsSchema,\n v.transform((t) => formatMarketTrade(scales, t)),\n );\n}\n\nexport type MarketTrade = v.InferOutput<ReturnType<typeof createMarketTradeSchema>>;\n\nexport const GetMarketTradesInputSchema = v.pipe(\n v.object({\n symbolId: SymbolIdInputSchema,\n side: v.optional(SideSchema),\n startTsNs: optionalUint64DecimalFilterSchema(\"startTsNs\"),\n endTsNs: optionalUint64DecimalFilterSchema(\"endTsNs\"),\n limit: v.optional(v.pipe(v.number(), v.integer(), v.gtValue(0), v.maxValue(1_000))),\n pageToken: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n afterTradeId: optionalUint64DecimalFilterSchema(\"afterTradeId\"),\n }),\n v.check(\n (input) =>\n input.afterTradeId === undefined ||\n (input.side === undefined &&\n input.startTsNs === undefined &&\n input.endTsNs === undefined &&\n input.pageToken === \"\"),\n \"afterTradeId cannot be combined with side, startTsNs, endTsNs or pageToken\",\n ),\n v.transform((input) => ({\n symbolId: input.symbolId,\n side: input.side ? SideFilterCodec.inputToProto[input.side] : undefined,\n startTime: tsNsToTimestamp(input.startTsNs),\n endTime: tsNsToTimestamp(input.endTsNs),\n limit: input.limit,\n pageToken: input.pageToken,\n afterTradeId: input.afterTradeId,\n })),\n);\n\n/** Cursor fields of a gap-free `afterTradeId` backfill page. */\nexport const TradeBackfillSchema = v.object({\n completeThroughTradeId: v.pipe(\n v.bigint(),\n v.transform((value) => value.toString()),\n ),\n nextAfterTradeId: v.pipe(\n v.bigint(),\n v.transform((value) => value.toString()),\n ),\n epochEnds: v.array(\n v.pipe(\n v.object({ epoch: v.bigint(), lastTradeId: v.bigint() }),\n v.transform(({ epoch, lastTradeId }) => ({\n epoch: epoch.toString(),\n lastTradeId: lastTradeId.toString(),\n })),\n ),\n ),\n});\n\nexport type TradeBackfill = v.InferOutput<typeof TradeBackfillSchema>;\n\nexport function createGetMarketTradesInputSchema() {\n return GetMarketTradesInputSchema;\n}\n\nexport type GetMarketTradesInput = v.InferInput<\n ReturnType<typeof createGetMarketTradesInputSchema>\n>;\nexport type GetMarketTradesRequest = v.InferOutput<\n ReturnType<typeof createGetMarketTradesInputSchema>\n>;\n\n/** Integer wire scales are protocol-bounded to 0..18 decimal places. */\nconst WireScaleSchema = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(18));\nconst OptionalDecimalLimitSchema = v.optional(v.pipe(v.string(), v.regex(/^\\d+(\\.\\d+)?$/)));\nconst Uint32Schema = v.pipe(\n v.number(),\n v.integer(),\n v.minValue(0),\n v.maxValue(PROTOBUF_UINT32_MAX),\n);\nconst OpenOrdersLimitSchema = v.optional(Uint32Schema, 0);\n\nexport const AssetConfigSchema = v.pipe(\n v.object({\n /**\n * Asset identifier/symbol, e.g. 'USDT', 'BTC'.\n */\n asset: v.string(),\n /**\n * Internal ledger identifier for settlement systems.\n */\n ledgerId: v.number(),\n /**\n * The friendly display name for the asset (e.g. 'Bitcoin').\n */\n name: v.string(),\n /**\n * UI-only display precision for asset amounts/balances.\n */\n quantityDisplayDecimals: v.number(),\n /**\n * Fixed integer scaling for quantities/amounts in this asset (0..18).\n */\n quantityScale: v.number(),\n /**\n * Integer scale for public candle and market-overview base volume (0..18).\n */\n marketDataVolumeScale: v.optional(WireScaleSchema, 0),\n /**\n * Whether the asset counts toward total equity; absent means unknown, never false.\n */\n includedInEquity: v.optional(v.boolean()),\n }),\n v.transform((a) => ({\n symbol: a.asset,\n ledgerId: a.ledgerId,\n name: a.name,\n quantityDisplayDecimals: a.quantityDisplayDecimals,\n quantityScale: a.quantityScale,\n marketDataVolumeScale: a.marketDataVolumeScale,\n ...(a.includedInEquity === undefined ? {} : { includedInEquity: a.includedInEquity }),\n })),\n);\n\nexport const PairMarketDataConfigSchema = v.optional(\n v.object({\n /**\n * Available price grouping sizes for the orderbook in quote units.\n * Allows viewing orders bucketed by larger increments (e.g., [0.01, 0.1, 1, 10]).\n */\n orderbookPriceBuckets: v.array(v.number()),\n }),\n {\n orderbookPriceBuckets: [] as number[],\n },\n);\n\nfunction bpsToPercent(bps: number): number {\n return bps / 100;\n}\n\nexport const PairConfigSchema = v.pipe(\n v.object({\n /**\n * Internal engine symbol id for the pair.\n */\n symbolId: v.number(),\n /**\n * Pair symbol string, e.g. 'BTC-USDT'\n */\n symbol: v.string(),\n /**\n * Base asset symbol, e.g. 'BTC'\n */\n baseAsset: v.string(),\n /**\n * Quote asset symbol, e.g. 'USDT'\n */\n quoteAsset: v.string(),\n /**\n * (e.g., \"0.01\") - The smallest price increment allowed. If tick size is 0.01, you can price at $100.00, $100.01, $100.02... but NOT $100.005.\n */\n tickSize: v.string(),\n /**\n * (e.g., \"0.0001\") - The smallest quantity increment allowed. If step size is 0.0001, you can order 100.0000, 100.0001, 100.0002... but NOT 100.00005.\n */\n stepSize: v.string(),\n /**\n * (e.g., \"1\") - Minimum order value in quote currency. If it's \"1\" and quote is USD, your order must be worth at least $1. So you can't buy $0.50 worth of something.\n */\n minNotionalQuote: v.string(),\n /**\n * Minimum quantity you can order in base currency terms. If it's \"0.001\" for BTC, smallest order is 0.001 BTC.\n */\n minQtyBase: v.string(),\n /**\n * Largest quantity of one limit order in base units. A replace is checked on its\n * new total less the filled quantity. Absent when the pair has no maximum.\n */\n maxLimitQtyBase: OptionalDecimalLimitSchema,\n /**\n * Largest quantity of one market order in base units, after converting a\n * quote-sized order to base. Absent when the pair has no maximum.\n */\n maxMarketQtyBase: OptionalDecimalLimitSchema,\n /**\n * Largest notional of one order in quote units: quantity times limit price, or\n * times protection price for a market order. Absent when the pair has no maximum.\n */\n maxOrderNotionalQuote: OptionalDecimalLimitSchema,\n /**\n * Largest notional of one market order in quote units, compared exactly with no\n * rounding. A buy is valued at its protection price and a sell at its reference\n * price (the touch or the client's reference price), before slippage. An order\n * above it is rejected with `MAX_NOTIONAL`. Absent when the pair has no maximum.\n */\n maxMarketNotionalQuote: OptionalDecimalLimitSchema,\n /**\n * Default resting-order limit (GTC and GTD) for a typical account on this pair.\n * An account may have a lower limit of its own.\n */\n maxOpenOrdersPerPair: OpenOrdersLimitSchema,\n /**\n * How far from the reference price (the last trade, or the index when they diverge\n * by more than the band) an order may be priced or trade, in basis points. A buy limit\n * above `reference × (1 + upperBps / 10000)` rounded down to the tick, or a sell limit\n * below `reference × (1 − lowerBps / 10000)` rounded up, is rejected with\n * `PRICE_BAND_VIOLATION`; a market order trades up to the limit and its remainder is\n * canceled with `price_band`. The reference stays fixed for `referenceWindowMs` (zero\n * moves it with every order). Absent when the pair has no band.\n */\n priceBand: v.optional(\n v.object({\n lowerBps: Uint32Schema,\n upperBps: Uint32Schema,\n referenceWindowMs: Uint32Schema,\n }),\n ),\n\n /**\n * Controls whether trading fee can be deducted from what you receive when buying.\n * Example\n * - You buy 1 ETH, fee is 0.1%\n * - if `true`, you receive 0.999 ETH (fee taken from ETH you're getting)\n * - if `false`, you receive 1 ETH, but you pay the fee separately in the quote currency (e.g., extra USDT)\n */\n allowBuyFeeFromBase: v.boolean(),\n /**\n * Default market slippage for buy orders in basis points from proto.\n */\n defaultMarketSlippageBpsBuy: v.optional(v.number(), 0),\n /**\n * Default market slippage for sell orders in basis points from proto.\n */\n defaultMarketSlippageBpsSell: v.optional(v.number(), 0),\n /**\n * Maximum server/client reference-price drift in basis points from proto.\n */\n maxClientRefDriftBps: v.optional(v.number(), 0),\n\n /**\n * Market-data configuration for this pair (orderbook bucket sizes, depths).\n */\n marketdata: v.optional(PairMarketDataConfigSchema),\n /**\n * Base asset quantity scale copied from AssetConfig.quantityScale.\n */\n baseQuantityScale: v.number(),\n /**\n * Quote asset quantity scale copied from AssetConfig.quantityScale.\n */\n quoteQuantityScale: v.number(),\n /**\n * Integer scale for composite reference prices in candle responses (0..18).\n * Primary market and execution prices use the fixed scale 9.\n */\n referencePriceScale: v.optional(WireScaleSchema, 0),\n /**\n * Optional scheduled listing timestamp (UTC).\n */\n listingAt: v.pipe(v.optional(v.unknown()), v.transform(timestampToMs)),\n /**\n * Optional scheduled delisting timestamp (UTC).\n */\n delistingAt: v.pipe(v.optional(v.unknown()), v.transform(timestampToMs)),\n /**\n * Operational status of the pair.\n */\n status: v.pipe(\n v.number(),\n v.transform(\n (status): PairStatus =>\n PairStatusCodec.protoToOutput[\n status as keyof typeof PairStatusCodec.protoToOutput\n ] ?? \"unknown\",\n ),\n ),\n }),\n v.transform(\n ({\n defaultMarketSlippageBpsBuy,\n defaultMarketSlippageBpsSell,\n maxClientRefDriftBps,\n ...pair\n }) => ({\n ...pair,\n defaultMarketSlippagePctBuy: bpsToPercent(defaultMarketSlippageBpsBuy),\n defaultMarketSlippagePctSell: bpsToPercent(defaultMarketSlippageBpsSell),\n maxClientRefDriftPct: bpsToPercent(maxClientRefDriftBps),\n }),\n ),\n);\n\nexport const SpotConfigSchema = v.object({\n assets: v.array(AssetConfigSchema),\n pairs: v.array(PairConfigSchema),\n /**\n * Default resting-order limit (GTC and GTD) for a typical account across all pairs.\n * An account may have a lower limit of its own.\n */\n maxOpenOrdersTotal: OpenOrdersLimitSchema,\n tsSec: v.pipe(\n v.bigint(),\n v.transform((v) => Number(v) * 1000),\n ),\n});\n"],"mappings":";;;;;;;;;AAoBgC,EAAE,OAAO;CACrC,UAAU,EAAE,OAAO;CACnB,SAAS,EAAE,OAAO;CAClB,OAAO,EAAE,QAAQ;CACjB,YAAY,EAAE,OAAO;CACrB,WAAW,EAAE,OAAO;CACpB,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,EAAE;AACnC,CAAC;;AAGD,SAAgB,kBACZ,QACA,GACF;CACE,MAAM,YAA8C,EAAE,QAAQ,QAAQ;CACtE,OAAO;EACH,UAAU,EAAE;EACZ,SAAS,EAAE,QAAQ,SAAS;EAC5B,OAAO,EAAE;EACT;EACA,KAAK,sBAAsB,EAAE,WAAW,OAAO,QAAQ,EAAE,QAAQ,CAAC;EAClE,OAAO,sBAAsB,EAAE,YAAY,OAAO,MAAM,CAAC;EACzD,MAAM,EAAE,KAAK,SAAS;EACtB,MAAM,SAAS,EAAE,IAAI;CACzB;AACJ;AAWA,MAAa,6BAA6B,EAAE,KACxC,EAAE,OAAO;CACL,UAAU;CACV,MAA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AC,IAAI,GAAI,CACvC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "../../gen/notifications/v1/notifications_pb.js";
|
|
2
|
+
//#region src/services/notifications/notifications.codecs.d.ts
|
|
3
|
+
declare const NOTIFICATION_TYPE_VALUES: readonly ["price_alert", "telegram_approval"];
|
|
4
|
+
/** What a notification reports; each type belongs to one category. */
|
|
5
|
+
type NotificationType = (typeof NOTIFICATION_TYPE_VALUES)[number];
|
|
6
|
+
declare const NOTIFICATION_CATEGORY_VALUES: readonly ["alerts", "security"];
|
|
7
|
+
/** `alerts` holds alerts the caller set; `security` holds account security events. */
|
|
8
|
+
type NotificationCategory = (typeof NOTIFICATION_CATEGORY_VALUES)[number];
|
|
9
|
+
declare const NOTIFICATION_READ_STATE_VALUES: readonly ["unread", "read"];
|
|
10
|
+
type NotificationReadState = (typeof NOTIFICATION_READ_STATE_VALUES)[number];
|
|
11
|
+
declare const TELEGRAM_APPROVAL_ACTION_VALUES: readonly ["place_order", "place_orders", "modify_orders", "cancel_order", "cancel_all_orders", "modify_trigger", "pause_trigger", "resume_trigger", "swap"];
|
|
12
|
+
/** What an approval from the linked Telegram account approved. */
|
|
13
|
+
type TelegramApprovalAction = (typeof TELEGRAM_APPROVAL_ACTION_VALUES)[number];
|
|
14
|
+
//#endregion
|
|
15
|
+
export { NOTIFICATION_CATEGORY_VALUES, NOTIFICATION_READ_STATE_VALUES, NOTIFICATION_TYPE_VALUES, NotificationCategory, NotificationReadState, NotificationType, TELEGRAM_APPROVAL_ACTION_VALUES, TelegramApprovalAction };
|
|
16
|
+
//# sourceMappingURL=notifications.codecs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.codecs.d.ts","names":[],"sources":["../../../src/services/notifications/notifications.codecs.ts"],"mappings":";;cAGa;;KAED,2BAA2B;cAE1B;;KAED,+BAA+B;cAE9B;KACD,gCAAgC;cAE/B;;KAYD,iCAAiC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import "../../gen/notifications/v1/notifications_pb.js";
|
|
2
|
+
//#region src/services/notifications/notifications.codecs.ts
|
|
3
|
+
const NOTIFICATION_CATEGORY_VALUES = ["alerts", "security"];
|
|
4
|
+
const NOTIFICATION_READ_STATE_VALUES = ["unread", "read"];
|
|
5
|
+
const NotificationTypeCodec = { protoToOutput: {
|
|
6
|
+
[0]: "unspecified",
|
|
7
|
+
[1]: "price_alert",
|
|
8
|
+
[2]: "telegram_approval"
|
|
9
|
+
} };
|
|
10
|
+
const NotificationCategoryCodec = {
|
|
11
|
+
inputToProto: {
|
|
12
|
+
alerts: 1,
|
|
13
|
+
security: 2
|
|
14
|
+
},
|
|
15
|
+
protoToOutput: {
|
|
16
|
+
[0]: "unspecified",
|
|
17
|
+
[1]: "alerts",
|
|
18
|
+
[2]: "security"
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const NotificationReadStateCodec = { inputToProto: {
|
|
22
|
+
unread: 1,
|
|
23
|
+
read: 2
|
|
24
|
+
} };
|
|
25
|
+
const TelegramApprovalActionCodec = { protoToOutput: {
|
|
26
|
+
[0]: "unspecified",
|
|
27
|
+
[1]: "place_order",
|
|
28
|
+
[2]: "place_orders",
|
|
29
|
+
[3]: "modify_orders",
|
|
30
|
+
[4]: "cancel_order",
|
|
31
|
+
[5]: "cancel_all_orders",
|
|
32
|
+
[6]: "modify_trigger",
|
|
33
|
+
[7]: "pause_trigger",
|
|
34
|
+
[8]: "resume_trigger",
|
|
35
|
+
[9]: "swap"
|
|
36
|
+
} };
|
|
37
|
+
//#endregion
|
|
38
|
+
export { NOTIFICATION_CATEGORY_VALUES, NOTIFICATION_READ_STATE_VALUES, NotificationCategoryCodec, NotificationReadStateCodec, NotificationTypeCodec, TelegramApprovalActionCodec };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=notifications.codecs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.codecs.js","names":[],"sources":["../../../src/services/notifications/notifications.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/notifications/v1/notifications_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const NOTIFICATION_TYPE_VALUES = [\"price_alert\", \"telegram_approval\"] as const;\n/** What a notification reports; each type belongs to one category. */\nexport type NotificationType = (typeof NOTIFICATION_TYPE_VALUES)[number];\n\nexport const NOTIFICATION_CATEGORY_VALUES = [\"alerts\", \"security\"] as const;\n/** `alerts` holds alerts the caller set; `security` holds account security events. */\nexport type NotificationCategory = (typeof NOTIFICATION_CATEGORY_VALUES)[number];\n\nexport const NOTIFICATION_READ_STATE_VALUES = [\"unread\", \"read\"] as const;\nexport type NotificationReadState = (typeof NOTIFICATION_READ_STATE_VALUES)[number];\n\nexport const TELEGRAM_APPROVAL_ACTION_VALUES = [\n \"place_order\",\n \"place_orders\",\n \"modify_orders\",\n \"cancel_order\",\n \"cancel_all_orders\",\n \"modify_trigger\",\n \"pause_trigger\",\n \"resume_trigger\",\n \"swap\",\n] as const;\n/** What an approval from the linked Telegram account approved. */\nexport type TelegramApprovalAction = (typeof TELEGRAM_APPROVAL_ACTION_VALUES)[number];\n\nexport const NotificationTypeCodec = {\n protoToOutput: {\n [Proto.NotificationType.TYPE_UNSPECIFIED]: \"unspecified\",\n [Proto.NotificationType.PRICE_ALERT]: \"price_alert\",\n [Proto.NotificationType.TELEGRAM_APPROVAL]: \"telegram_approval\",\n } satisfies ProtoToOutput<Proto.NotificationType, NotificationType>,\n} as const;\n\nexport const NotificationCategoryCodec = {\n inputToProto: {\n alerts: Proto.NotificationCategory.ALERTS,\n security: Proto.NotificationCategory.SECURITY,\n } satisfies InputToProto<NotificationCategory, Proto.NotificationCategory>,\n protoToOutput: {\n [Proto.NotificationCategory.CATEGORY_UNSPECIFIED]: \"unspecified\",\n [Proto.NotificationCategory.ALERTS]: \"alerts\",\n [Proto.NotificationCategory.SECURITY]: \"security\",\n } satisfies ProtoToOutput<Proto.NotificationCategory, NotificationCategory>,\n} as const;\n\nexport const NotificationReadStateCodec = {\n inputToProto: {\n unread: Proto.ReadState.UNREAD,\n read: Proto.ReadState.READ,\n } satisfies InputToProto<NotificationReadState, Proto.ReadState>,\n} as const;\n\nexport const TelegramApprovalActionCodec = {\n protoToOutput: {\n [Proto.TelegramApprovalAction.ACTION_UNSPECIFIED]: \"unspecified\",\n [Proto.TelegramApprovalAction.PLACE_ORDER]: \"place_order\",\n [Proto.TelegramApprovalAction.PLACE_ORDERS]: \"place_orders\",\n [Proto.TelegramApprovalAction.MODIFY_ORDERS]: \"modify_orders\",\n [Proto.TelegramApprovalAction.CANCEL_ORDER]: \"cancel_order\",\n [Proto.TelegramApprovalAction.CANCEL_ALL_ORDERS]: \"cancel_all_orders\",\n [Proto.TelegramApprovalAction.MODIFY_TRIGGER]: \"modify_trigger\",\n [Proto.TelegramApprovalAction.PAUSE_TRIGGER]: \"pause_trigger\",\n [Proto.TelegramApprovalAction.RESUME_TRIGGER]: \"resume_trigger\",\n [Proto.TelegramApprovalAction.SWAP]: \"swap\",\n } satisfies ProtoToOutput<Proto.TelegramApprovalAction, TelegramApprovalAction>,\n} as const;\n"],"mappings":";;AAOA,MAAa,+BAA+B,CAAC,UAAU,UAAU;AAIjE,MAAa,iCAAiC,CAAC,UAAU,MAAM;AAiB/D,MAAa,wBAAwB,EACjC,eAAe;EACgC,IAAA;EACL,IAAA;EACM,IAAA;AAChD,EACJ;AAEA,MAAa,4BAA4B;CACrC,cAAc;EACV,QAAA;EACA,UAAA;CACJ;CACA,eAAe;GACwC,IAAA;GACd,IAAA;GACE,IAAA;CAC3C;AACJ;AAEA,MAAa,6BAA6B,EACtC,cAAc;CACV,QAAA;CACA,MAAA;AACJ,EACJ;AAEA,MAAa,8BAA8B,EACvC,eAAe;EACwC,IAAA;EACP,IAAA;EACC,IAAA;EACC,IAAA;EACD,IAAA;EACK,IAAA;EACH,IAAA;EACD,IAAA;EACC,IAAA;EACV,IAAA;AACzC,EACJ"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AuthApiTransports } from "../../shared/transports.js";
|
|
2
|
+
import { PolyesterRequestOptions } from "../../shared/request-options.js";
|
|
3
|
+
import { AccountNotification, GetNotificationInput, ListNotificationsInput, ListNotificationsResult, MarkAllNotificationsReadInput, MarkNotificationsInput, NotificationCounts } from "./notifications.schemas.js";
|
|
4
|
+
//#region src/services/notifications/notifications.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Reads and marks the caller's notification center. Available on devnet only. Session JWT only:
|
|
7
|
+
* API keys are refused. An unknown notification ID, including another account's, throws
|
|
8
|
+
* `ResourceNotFoundError` (`NOTIFICATION_NOT_FOUND`); a retryable `ServiceUnavailableError`
|
|
9
|
+
* means retry the same request.
|
|
10
|
+
*/
|
|
11
|
+
declare class NotificationsService {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(transports: AuthApiTransports);
|
|
14
|
+
/** Lists the caller's notifications, newest first. */
|
|
15
|
+
list(input?: ListNotificationsInput, options?: PolyesterRequestOptions): Promise<ListNotificationsResult>;
|
|
16
|
+
/** Reads one notification. */
|
|
17
|
+
get(input: GetNotificationInput, options?: PolyesterRequestOptions): Promise<AccountNotification>;
|
|
18
|
+
/** Counts the caller's notifications and unread notifications, in total and by type. */
|
|
19
|
+
getCounts(options?: PolyesterRequestOptions): Promise<NotificationCounts>;
|
|
20
|
+
/**
|
|
21
|
+
* Marks notifications read. All or nothing: one unknown ID throws `ResourceNotFoundError`
|
|
22
|
+
* and marks none. `changed` leaves out notifications already read.
|
|
23
|
+
*/
|
|
24
|
+
markRead(input: MarkNotificationsInput, options?: PolyesterRequestOptions): Promise<{
|
|
25
|
+
changed: number;
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* Marks notifications unread. All or nothing: one unknown ID throws `ResourceNotFoundError`
|
|
29
|
+
* and marks none. `changed` leaves out notifications already unread.
|
|
30
|
+
*/
|
|
31
|
+
markUnread(input: MarkNotificationsInput, options?: PolyesterRequestOptions): Promise<{
|
|
32
|
+
changed: number;
|
|
33
|
+
}>;
|
|
34
|
+
/** Marks every unread notification read, within the given categories and up to the given one. */
|
|
35
|
+
markAllRead(input?: MarkAllNotificationsReadInput, options?: PolyesterRequestOptions): Promise<{
|
|
36
|
+
changed: number;
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { NotificationsService };
|
|
41
|
+
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","names":[],"sources":["../../../src/services/notifications/notifications.ts"],"mappings":";;;;;;;;;;cAgCa;;EAGG,YAAA,YAAY;;EAKlB,KACF,QAAO,wBACP,UAAU,0BACX,QAAQ;;EAaL,IACF,OAAO,sBACP,UAAU,0BACX,QAAQ;;EAWL,UAAU,UAAU,0BAA0B,QAAQ;;;;;EAYtD,SACF,OAAO,wBACP,UAAU,0BACX;IAAU;;;;;;EAaP,WACF,OAAO,wBACP,UAAU,0BACX;IAAU;;;EAUP,YACF,QAAO,+BACP,UAAU,0BACX;IAAU"}
|