@polyester/sdk 0.36.0-devnet-20261118184607 → 0.36.0-devnet-20261119010940
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 +28 -2
- 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 +5 -6
- package/dist/gen/ai/v1/assistant_pb.d.ts.map +1 -1
- package/dist/gen/ai/v1/assistant_pb.js.map +1 -1
- package/dist/gen/auth/v1/address_book_pb.d.ts +1 -1
- package/dist/gen/auth/v1/address_book_pb.js +1 -1
- package/dist/gen/auth/v1/address_book_pb.js.map +1 -1
- package/dist/gen/auth/v1/api_keys_pb.d.ts +70 -9
- package/dist/gen/auth/v1/api_keys_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/api_keys_pb.js +16 -1
- package/dist/gen/auth/v1/api_keys_pb.js.map +1 -1
- package/dist/gen/auth/v1/auth_pb.d.ts +74 -5
- package/dist/gen/auth/v1/auth_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/auth_pb.js +58 -6
- package/dist/gen/auth/v1/auth_pb.js.map +1 -1
- package/dist/gen/auth/v1/connected_apps_pb.d.ts +382 -0
- package/dist/gen/auth/v1/connected_apps_pb.d.ts.map +1 -0
- package/dist/gen/auth/v1/connected_apps_pb.js +107 -0
- package/dist/gen/auth/v1/connected_apps_pb.js.map +1 -0
- package/dist/gen/auth/v1/mfa_pb.d.ts +2 -140
- package/dist/gen/auth/v1/mfa_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/mfa_pb.js +8 -80
- package/dist/gen/auth/v1/mfa_pb.js.map +1 -1
- package/dist/gen/auth/v1/policies_pb.d.ts +164 -41
- package/dist/gen/auth/v1/policies_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/policies_pb.js +36 -3
- package/dist/gen/auth/v1/policies_pb.js.map +1 -1
- package/dist/gen/auth/v1/social_verification_pb.d.ts +4 -4
- package/dist/gen/auth/v1/social_verification_pb.js.map +1 -1
- package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.d.ts +17 -10
- package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.d.ts.map +1 -1
- package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.js.map +1 -1
- package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts +3 -1
- package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts.map +1 -1
- package/dist/gen/chain/withdraw/v1/withdraw_pb.js.map +1 -1
- package/dist/gen/fees/v1/fees_pb.d.ts +2 -1
- package/dist/gen/fees/v1/fees_pb.d.ts.map +1 -1
- package/dist/gen/fees/v1/fees_pb.js.map +1 -1
- package/dist/gen/index.d.ts +8 -5
- package/dist/gen/index.js +8 -5
- package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts +3 -2
- package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts.map +1 -1
- package/dist/gen/ledger/read/v1/ledger_read_pb.js.map +1 -1
- package/dist/gen/marketdata/v1/heatmap_pb.d.ts +9 -58
- package/dist/gen/marketdata/v1/heatmap_pb.d.ts.map +1 -1
- package/dist/gen/marketdata/v1/heatmap_pb.js +8 -57
- package/dist/gen/marketdata/v1/heatmap_pb.js.map +1 -1
- package/dist/gen/notifications/v1/notifications_pb.d.ts +141 -4
- package/dist/gen/notifications/v1/notifications_pb.d.ts.map +1 -1
- package/dist/gen/notifications/v1/notifications_pb.js +94 -16
- package/dist/gen/notifications/v1/notifications_pb.js.map +1 -1
- package/dist/gen/orderbook/v1/orderbook_pb.d.ts +14 -12
- package/dist/gen/orderbook/v1/orderbook_pb.d.ts.map +1 -1
- package/dist/gen/orderbook/v1/orderbook_pb.js +6 -1
- package/dist/gen/orderbook/v1/orderbook_pb.js.map +1 -1
- package/dist/gen/orders/v1/orders_pb.d.ts +66 -18
- package/dist/gen/orders/v1/orders_pb.d.ts.map +1 -1
- package/dist/gen/orders/v1/orders_pb.js +1 -1
- package/dist/gen/orders/v1/orders_pb.js.map +1 -1
- package/dist/gen/orders/v1/orders_read_pb.d.ts +8 -0
- package/dist/gen/orders/v1/orders_read_pb.d.ts.map +1 -1
- package/dist/gen/orders/v1/orders_read_pb.js.map +1 -1
- package/dist/gen/polyester/api/options_pb.d.ts +2 -1
- package/dist/gen/polyester/api/options_pb.d.ts.map +1 -1
- package/dist/gen/polyester/api/options_pb.js +2 -1
- package/dist/gen/polyester/api/options_pb.js.map +1 -1
- package/dist/gen/polyester/api/v1/request_error_pb.d.ts +66 -0
- package/dist/gen/polyester/api/v1/request_error_pb.d.ts.map +1 -0
- package/dist/gen/polyester/api/v1/request_error_pb.js +49 -0
- package/dist/gen/polyester/api/v1/request_error_pb.js.map +1 -0
- package/dist/gen/polyester/type/v1/depth_tier_pb.d.ts +98 -0
- package/dist/gen/polyester/type/v1/depth_tier_pb.d.ts.map +1 -0
- package/dist/gen/polyester/type/v1/depth_tier_pb.js +104 -0
- package/dist/gen/polyester/type/v1/depth_tier_pb.js.map +1 -0
- package/dist/gen/ratelimit/v1/ratelimit_pb.d.ts +42 -23
- package/dist/gen/ratelimit/v1/ratelimit_pb.d.ts.map +1 -1
- package/dist/gen/ratelimit/v1/ratelimit_pb.js +14 -2
- package/dist/gen/ratelimit/v1/ratelimit_pb.js.map +1 -1
- package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts +126 -13
- package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts.map +1 -1
- package/dist/gen/swap/quickswap/v1/quickswap_pb.js +100 -28
- package/dist/gen/swap/quickswap/v1/quickswap_pb.js.map +1 -1
- package/dist/gen/transfer/v1/internal_transfer_pb.d.ts +5 -3
- package/dist/gen/transfer/v1/internal_transfer_pb.d.ts.map +1 -1
- package/dist/gen/transfer/v1/internal_transfer_pb.js.map +1 -1
- package/dist/gen/triggers/v1/triggers_pb.d.ts +25 -3
- package/dist/gen/triggers/v1/triggers_pb.d.ts.map +1 -1
- package/dist/gen/triggers/v1/triggers_pb.js +18 -1
- package/dist/gen/triggers/v1/triggers_pb.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/services/account-activity/account-activity.schemas.d.ts +2 -2
- package/dist/services/address-book/address-book.js +1 -1
- package/dist/services/address-book/address-book.schemas.d.ts +2 -2
- package/dist/services/api-keys/api-keys.codecs.d.ts +6 -1
- package/dist/services/api-keys/api-keys.codecs.d.ts.map +1 -1
- package/dist/services/api-keys/api-keys.codecs.js +19 -7
- package/dist/services/api-keys/api-keys.codecs.js.map +1 -1
- package/dist/services/api-keys/api-keys.js +1 -1
- package/dist/services/api-keys/api-keys.schemas.d.ts +12 -4
- package/dist/services/api-keys/api-keys.schemas.d.ts.map +1 -1
- package/dist/services/api-keys/api-keys.schemas.js +15 -6
- 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/assistant/assistant-events.schemas.d.ts +25 -25
- package/dist/services/assistant/assistant.schemas.d.ts +1 -1
- package/dist/services/auth/auth.d.ts +4 -0
- package/dist/services/auth/auth.d.ts.map +1 -1
- package/dist/services/auth/auth.js +12 -2
- package/dist/services/auth/auth.js.map +1 -1
- package/dist/services/balances/balances.js +1 -1
- package/dist/services/changelog/changelog.schemas.d.ts +38 -38
- package/dist/services/claims/claims.schemas.d.ts +2 -2
- package/dist/services/connected-apps/connected-apps.d.ts +46 -0
- package/dist/services/connected-apps/connected-apps.d.ts.map +1 -0
- package/dist/services/connected-apps/connected-apps.js +69 -0
- package/dist/services/connected-apps/connected-apps.js.map +1 -0
- package/dist/services/connected-apps/connected-apps.schemas.d.ts +132 -0
- package/dist/services/connected-apps/connected-apps.schemas.d.ts.map +1 -0
- package/dist/services/connected-apps/connected-apps.schemas.js +68 -0
- package/dist/services/connected-apps/connected-apps.schemas.js.map +1 -0
- package/dist/services/connected-apps/connected-apps.types.d.ts +2 -0
- package/dist/services/connected-apps/service.d.ts +8 -0
- package/dist/services/connected-apps/service.d.ts.map +1 -0
- package/dist/services/connected-apps/service.js +9 -0
- package/dist/services/connected-apps/service.js.map +1 -0
- package/dist/services/dust-conversion/dust-conversion.schemas.d.ts +2 -2
- package/dist/services/heatmap/heatmap.codecs.d.ts +1 -0
- package/dist/services/heatmap/heatmap.codecs.d.ts.map +1 -1
- package/dist/services/heatmap/heatmap.codecs.js +2 -27
- package/dist/services/heatmap/heatmap.codecs.js.map +1 -1
- package/dist/services/heatmap/heatmap.schemas.d.ts +9 -8
- package/dist/services/heatmap/heatmap.schemas.d.ts.map +1 -1
- package/dist/services/heatmap/heatmap.schemas.js +4 -3
- package/dist/services/heatmap/heatmap.schemas.js.map +1 -1
- package/dist/services/internal-transfers/internal-transfers.schemas.d.ts +2 -2
- package/dist/services/lifecycle/lifecycle.schemas.d.ts +52 -52
- package/dist/services/notifications/notifications.codecs.d.ts +6 -3
- package/dist/services/notifications/notifications.codecs.d.ts.map +1 -1
- package/dist/services/notifications/notifications.codecs.js +14 -3
- package/dist/services/notifications/notifications.codecs.js.map +1 -1
- package/dist/services/notifications/notifications.schemas.d.ts +97 -3
- package/dist/services/notifications/notifications.schemas.d.ts.map +1 -1
- package/dist/services/notifications/notifications.schemas.js +18 -1
- package/dist/services/notifications/notifications.schemas.js.map +1 -1
- package/dist/services/notifications/notifications.types.d.ts +2 -2
- package/dist/services/orderbook/orderbook.codecs.js +1 -1
- package/dist/services/orderbook/orderbook.codecs.js.map +1 -1
- package/dist/services/orderbook/orderbook.d.ts +2 -2
- package/dist/services/orderbook/orderbook.d.ts.map +1 -1
- package/dist/services/orderbook/orderbook.js +7 -9
- package/dist/services/orderbook/orderbook.js.map +1 -1
- package/dist/services/orderbook/orderbook.schemas.d.ts +3 -6
- package/dist/services/orderbook/orderbook.schemas.d.ts.map +1 -1
- package/dist/services/orderbook/orderbook.schemas.js +5 -5
- package/dist/services/orderbook/orderbook.schemas.js.map +1 -1
- package/dist/services/orders/order-errors.schemas.d.ts +6 -6
- package/dist/services/orders/orders-batch.schemas.d.ts +78 -74
- package/dist/services/orders/orders-batch.schemas.d.ts.map +1 -1
- package/dist/services/orders/orders-batch.schemas.js +2 -0
- package/dist/services/orders/orders-batch.schemas.js.map +1 -1
- package/dist/services/orders/orders-input.schemas.d.ts +18 -10
- package/dist/services/orders/orders-input.schemas.d.ts.map +1 -1
- package/dist/services/orders/orders-input.schemas.js +7 -2
- package/dist/services/orders/orders-input.schemas.js.map +1 -1
- package/dist/services/orders/orders-output.schemas.d.ts +14 -14
- package/dist/services/policies/api-key-policies/api-key-policies.d.ts +4 -1
- package/dist/services/policies/api-key-policies/api-key-policies.d.ts.map +1 -1
- package/dist/services/policies/api-key-policies/api-key-policies.js +5 -2
- package/dist/services/policies/api-key-policies/api-key-policies.js.map +1 -1
- package/dist/services/policies/api-key-policies/api-key-policies.schemas.d.ts +25 -15
- package/dist/services/policies/api-key-policies/api-key-policies.schemas.d.ts.map +1 -1
- package/dist/services/policies/api-key-policies/api-key-policies.schemas.js +3 -0
- package/dist/services/policies/api-key-policies/api-key-policies.schemas.js.map +1 -1
- package/dist/services/policies/shared.codecs.js +25 -5
- 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.d.ts +4 -1
- package/dist/services/policies/subaccount-policies/subaccount-policies.d.ts.map +1 -1
- package/dist/services/policies/subaccount-policies/subaccount-policies.js +5 -2
- package/dist/services/policies/subaccount-policies/subaccount-policies.js.map +1 -1
- package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.d.ts +11 -3
- package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.d.ts.map +1 -1
- package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.js +4 -0
- package/dist/services/policies/subaccount-policies/subaccount-policies.schemas.js.map +1 -1
- package/dist/services/rate-limits/rate-limits.codecs.d.ts +1 -1
- package/dist/services/rate-limits/rate-limits.codecs.js +2 -1
- package/dist/services/rate-limits/rate-limits.codecs.js.map +1 -1
- package/dist/services/rate-limits/rate-limits.schemas.d.ts +4 -4
- package/dist/services/rewards/rewards.schemas.d.ts +4 -4
- package/dist/services/statement-exports/statement-exports.schemas.d.ts +6 -6
- package/dist/services/subaccounts/subaccounts.js +2 -2
- package/dist/services/subaccounts/subaccounts.schemas.d.ts +22 -22
- package/dist/services/system/system.schemas.d.ts +13 -13
- package/dist/services/trades/trades.schemas.d.ts +1 -1
- package/dist/services/transfers/transfers.js +1 -1
- package/dist/services/triggers/trigger-input.schemas.d.ts +1 -1
- package/dist/services/triggers/triggers-output.schemas.d.ts +43 -43
- package/dist/services/triggers/triggers.codecs.d.ts.map +1 -1
- package/dist/services/triggers/triggers.codecs.js +2 -0
- package/dist/services/triggers/triggers.codecs.js.map +1 -1
- package/dist/shared/connect-error-mapping.d.ts.map +1 -1
- package/dist/shared/connect-error-mapping.js +1 -1
- package/dist/shared/connect-error-mapping.js.map +1 -1
- package/dist/shared/depth-tier.js +46 -0
- package/dist/shared/depth-tier.js.map +1 -0
- package/dist/shared/error-detail.d.ts +6 -0
- package/dist/shared/error-detail.d.ts.map +1 -1
- package/dist/shared/error-detail.js +2 -1
- package/dist/shared/error-detail.js.map +1 -1
- package/dist/shared/error-details/request.js +16 -0
- package/dist/shared/error-details/request.js.map +1 -0
- package/dist/wired-services.d.ts.map +1 -1
- package/dist/wired-services.js +6 -4
- package/dist/wired-services.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { OptionalTimestampMsSchema, PublicIdSchema, idInputSchema } from "../../shared/schemas.js";
|
|
2
|
+
import { PositiveStringInputSchema } from "../shared.js";
|
|
3
|
+
import * as v from "valibot";
|
|
4
|
+
//#region src/services/connected-apps/connected-apps.schemas.ts
|
|
5
|
+
/** Selects a pending app connection request. */
|
|
6
|
+
const AppAuthorizationInputSchema = v.strictObject({
|
|
7
|
+
/** The `request` query parameter the authorization endpoint gave the consent page. */
|
|
8
|
+
requestId: PositiveStringInputSchema });
|
|
9
|
+
const RevokeConnectedAppInputSchema = v.strictObject({
|
|
10
|
+
/** `connectedAppId` from `connectedApps.list`. */
|
|
11
|
+
connectedAppId: idInputSchema("connectedAppId") });
|
|
12
|
+
/** The OAuth client of an app, as it presents itself on the consent page. */
|
|
13
|
+
const ConnectedAppClientSchema = v.object({
|
|
14
|
+
clientId: v.string(),
|
|
15
|
+
name: v.string()
|
|
16
|
+
});
|
|
17
|
+
const ClientSchema = v.optional(ConnectedAppClientSchema, {
|
|
18
|
+
clientId: "",
|
|
19
|
+
name: ""
|
|
20
|
+
});
|
|
21
|
+
/** A pending request from an app to connect to the account. Times are epoch milliseconds. */
|
|
22
|
+
const AppAuthorizationSchema = v.pipe(v.object({
|
|
23
|
+
client: ClientSchema,
|
|
24
|
+
scopes: v.array(v.string()),
|
|
25
|
+
resource: v.string(),
|
|
26
|
+
redirectHost: v.string(),
|
|
27
|
+
expiresAt: OptionalTimestampMsSchema
|
|
28
|
+
}), v.transform((authorization) => ({
|
|
29
|
+
client: authorization.client,
|
|
30
|
+
/** OAuth scopes the app asks for, e.g. `"account:read"`. */
|
|
31
|
+
scopes: authorization.scopes,
|
|
32
|
+
/** Absolute URL of the server the app will use the account through. */
|
|
33
|
+
resource: authorization.resource,
|
|
34
|
+
/** Host the app receives the answer on. */
|
|
35
|
+
redirectHost: authorization.redirectHost,
|
|
36
|
+
/** After this the request can no longer be approved or denied. */
|
|
37
|
+
expiresAt: authorization.expiresAt ?? null
|
|
38
|
+
})));
|
|
39
|
+
/** An app connected to the account. Times are epoch milliseconds. */
|
|
40
|
+
const ConnectedAppSchema = v.pipe(v.object({
|
|
41
|
+
connectedAppId: PublicIdSchema,
|
|
42
|
+
client: ClientSchema,
|
|
43
|
+
scopes: v.array(v.string()),
|
|
44
|
+
resource: v.string(),
|
|
45
|
+
connectedAt: OptionalTimestampMsSchema,
|
|
46
|
+
lastUsedAt: OptionalTimestampMsSchema,
|
|
47
|
+
expiresAt: OptionalTimestampMsSchema
|
|
48
|
+
}), v.transform((app) => ({
|
|
49
|
+
/** Pass to `connectedApps.revoke`. */
|
|
50
|
+
connectedAppId: app.connectedAppId,
|
|
51
|
+
client: app.client,
|
|
52
|
+
/** OAuth scopes the account granted the app. */
|
|
53
|
+
scopes: app.scopes,
|
|
54
|
+
/** Absolute URL of the server the app uses the account through. */
|
|
55
|
+
resource: app.resource,
|
|
56
|
+
connectedAt: app.connectedAt ?? null,
|
|
57
|
+
/** Last use or refresh, at minute precision; null until the app first uses its access. */
|
|
58
|
+
lastUsedAt: app.lastUsedAt ?? null,
|
|
59
|
+
/** The connection ends then unless it is disconnected first. */
|
|
60
|
+
expiresAt: app.expiresAt ?? null
|
|
61
|
+
})));
|
|
62
|
+
const ConnectedAppsSchema = v.array(ConnectedAppSchema);
|
|
63
|
+
/** Where to send the browser to hand the app its answer. */
|
|
64
|
+
const AppAuthorizationRedirectSchema = v.object({ redirectUrl: v.string() });
|
|
65
|
+
//#endregion
|
|
66
|
+
export { AppAuthorizationInputSchema, AppAuthorizationRedirectSchema, AppAuthorizationSchema, ConnectedAppClientSchema, ConnectedAppSchema, ConnectedAppsSchema, RevokeConnectedAppInputSchema };
|
|
67
|
+
|
|
68
|
+
//# sourceMappingURL=connected-apps.schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connected-apps.schemas.js","names":[],"sources":["../../../src/services/connected-apps/connected-apps.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport { OptionalTimestampMsSchema, PublicIdSchema, idInputSchema } from \"../../shared/schemas.js\";\nimport { PositiveStringInputSchema } from \"../shared.js\";\n\n/** Selects a pending app connection request. */\nexport const AppAuthorizationInputSchema = v.strictObject({\n /** The `request` query parameter the authorization endpoint gave the consent page. */\n requestId: PositiveStringInputSchema,\n});\n\nexport type AppAuthorizationInput = v.InferInput<typeof AppAuthorizationInputSchema>;\n\nexport const RevokeConnectedAppInputSchema = v.strictObject({\n /** `connectedAppId` from `connectedApps.list`. */\n connectedAppId: idInputSchema(\"connectedAppId\"),\n});\n\nexport type RevokeConnectedAppInput = v.InferInput<typeof RevokeConnectedAppInputSchema>;\n\n/** The OAuth client of an app, as it presents itself on the consent page. */\nexport const ConnectedAppClientSchema = v.object({\n clientId: v.string(),\n name: v.string(),\n});\n\nexport type ConnectedAppClient = v.InferOutput<typeof ConnectedAppClientSchema>;\n\nconst ClientSchema = v.optional(ConnectedAppClientSchema, { clientId: \"\", name: \"\" });\n\n/** A pending request from an app to connect to the account. Times are epoch milliseconds. */\nexport const AppAuthorizationSchema = v.pipe(\n v.object({\n client: ClientSchema,\n scopes: v.array(v.string()),\n resource: v.string(),\n redirectHost: v.string(),\n expiresAt: OptionalTimestampMsSchema,\n }),\n v.transform((authorization) => ({\n client: authorization.client,\n /** OAuth scopes the app asks for, e.g. `\"account:read\"`. */\n scopes: authorization.scopes,\n /** Absolute URL of the server the app will use the account through. */\n resource: authorization.resource,\n /** Host the app receives the answer on. */\n redirectHost: authorization.redirectHost,\n /** After this the request can no longer be approved or denied. */\n expiresAt: authorization.expiresAt ?? null,\n })),\n);\n\nexport type AppAuthorization = v.InferOutput<typeof AppAuthorizationSchema>;\n\n/** An app connected to the account. Times are epoch milliseconds. */\nexport const ConnectedAppSchema = v.pipe(\n v.object({\n connectedAppId: PublicIdSchema,\n client: ClientSchema,\n scopes: v.array(v.string()),\n resource: v.string(),\n connectedAt: OptionalTimestampMsSchema,\n lastUsedAt: OptionalTimestampMsSchema,\n expiresAt: OptionalTimestampMsSchema,\n }),\n v.transform((app) => ({\n /** Pass to `connectedApps.revoke`. */\n connectedAppId: app.connectedAppId,\n client: app.client,\n /** OAuth scopes the account granted the app. */\n scopes: app.scopes,\n /** Absolute URL of the server the app uses the account through. */\n resource: app.resource,\n connectedAt: app.connectedAt ?? null,\n /** Last use or refresh, at minute precision; null until the app first uses its access. */\n lastUsedAt: app.lastUsedAt ?? null,\n /** The connection ends then unless it is disconnected first. */\n expiresAt: app.expiresAt ?? null,\n })),\n);\n\nexport type ConnectedApp = v.InferOutput<typeof ConnectedAppSchema>;\n\nexport const ConnectedAppsSchema = v.array(ConnectedAppSchema);\n\n/** Where to send the browser to hand the app its answer. */\nexport const AppAuthorizationRedirectSchema = v.object({ redirectUrl: v.string() });\n\nexport type AppAuthorizationRedirect = v.InferOutput<typeof AppAuthorizationRedirectSchema>;\n"],"mappings":";;;;;AAKA,MAAa,8BAA8B,EAAE,aAAa;;AAEtD,WAAW,0BACf,CAAC;AAID,MAAa,gCAAgC,EAAE,aAAa;;AAExD,gBAAgB,cAAc,gBAAgB,EAClD,CAAC;;AAKD,MAAa,2BAA2B,EAAE,OAAO;CAC7C,UAAU,EAAE,OAAO;CACnB,MAAM,EAAE,OAAO;AACnB,CAAC;AAID,MAAM,eAAe,EAAE,SAAS,0BAA0B;CAAE,UAAU;CAAI,MAAM;AAAG,CAAC;;AAGpF,MAAa,yBAAyB,EAAE,KACpC,EAAE,OAAO;CACL,QAAQ;CACR,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC;CAC1B,UAAU,EAAE,OAAO;CACnB,cAAc,EAAE,OAAO;CACvB,WAAW;AACf,CAAC,GACD,EAAE,WAAW,mBAAmB;CAC5B,QAAQ,cAAc;;CAEtB,QAAQ,cAAc;;CAEtB,UAAU,cAAc;;CAExB,cAAc,cAAc;;CAE5B,WAAW,cAAc,aAAa;AAC1C,EAAE,CACN;;AAKA,MAAa,qBAAqB,EAAE,KAChC,EAAE,OAAO;CACL,gBAAgB;CAChB,QAAQ;CACR,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC;CAC1B,UAAU,EAAE,OAAO;CACnB,aAAa;CACb,YAAY;CACZ,WAAW;AACf,CAAC,GACD,EAAE,WAAW,SAAS;;CAElB,gBAAgB,IAAI;CACpB,QAAQ,IAAI;;CAEZ,QAAQ,IAAI;;CAEZ,UAAU,IAAI;CACd,aAAa,IAAI,eAAe;;CAEhC,YAAY,IAAI,cAAc;;CAE9B,WAAW,IAAI,aAAa;AAChC,EAAE,CACN;AAIA,MAAa,sBAAsB,EAAE,MAAM,kBAAkB;;AAG7D,MAAa,iCAAiC,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { AppAuthorization, AppAuthorizationInput, AppAuthorizationRedirect, ConnectedApp, ConnectedAppClient, RevokeConnectedAppInput } from "./connected-apps.schemas.js";
|
|
2
|
+
export type { AppAuthorization, AppAuthorizationInput, AppAuthorizationRedirect, ConnectedApp, ConnectedAppClient, RevokeConnectedAppInput };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ConnectedAppsService } from "./connected-apps.js";
|
|
2
|
+
import { PolyesterCore } from "../../core-client.js";
|
|
3
|
+
//#region src/services/connected-apps/service.d.ts
|
|
4
|
+
/** Returns the client's ConnectedAppsService, creating it on first use. */
|
|
5
|
+
declare const connectedAppsService: (client: PolyesterCore) => ConnectedAppsService;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { connectedAppsService };
|
|
8
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","names":[],"sources":["../../../src/services/connected-apps/service.ts"],"mappings":";;;;cAIa,uBAAoB,QAApB,kBAAoB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defineService } from "../../core-client.js";
|
|
2
|
+
import { ConnectedAppsService } from "./connected-apps.js";
|
|
3
|
+
//#region src/services/connected-apps/service.ts
|
|
4
|
+
/** Returns the client's ConnectedAppsService, creating it on first use. */
|
|
5
|
+
const connectedAppsService = defineService((context) => new ConnectedAppsService(context.transports));
|
|
6
|
+
//#endregion
|
|
7
|
+
export { connectedAppsService };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","names":[],"sources":["../../../src/services/connected-apps/service.ts"],"sourcesContent":["import { defineService } from \"../../core-client.js\";\nimport { ConnectedAppsService } from \"./connected-apps.js\";\n\n/** Returns the client's ConnectedAppsService, creating it on first use. */\nexport const connectedAppsService = defineService(\n (context) => new ConnectedAppsService(context.transports),\n);\n"],"mappings":";;;;AAIA,MAAa,uBAAuB,eAC/B,YAAY,IAAI,qBAAqB,QAAQ,UAAU,CAC5D"}
|
|
@@ -218,7 +218,7 @@ declare const DustConversionSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
|
218
218
|
quoteId: string;
|
|
219
219
|
state: "unspecified" | "processing" | "completed" | "refused";
|
|
220
220
|
/** Why a `refused` conversion was refused; null otherwise. */
|
|
221
|
-
refusalCode: "UNSPECIFIED" | "
|
|
221
|
+
refusalCode: "UNSPECIFIED" | "UNAUTHENTICATED" | "RATE_LIMIT_EXCEEDED" | "CONFLICT" | "INVALID_REQUEST" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR" | "PERMISSION_DENIED" | "FAILED_PRECONDITION" | "SUBACCOUNT_NOT_FOUND" | "INSUFFICIENT_FUNDS" | "INVALID_SUBACCOUNT_ID" | "SOURCE_ACCOUNT_INACTIVE" | "UNSUPPORTED_ASSET" | "INVALID_AMOUNT" | "INVALID_DESTINATION" | "DESTINATION_NOT_FOUND" | "DESTINATION_INACTIVE" | "SAME_SOURCE_DESTINATION" | "DESTINATION_NOT_WHITELISTED" | "SMART_ACCOUNT_UNAVAILABLE" | "STEP_UP_UNAVAILABLE" | "IDEMPOTENCY_CONFLICT" | "FUNDS_LOCK_CONFLICT" | "CAPITAL_VIEW_UNAVAILABLE" | "ACCOUNT_SHARD_UNAVAILABLE" | "POLICY_DENIED" | "NOT_FOUND" | "DUST_QUOTE_EXPIRED" | "DUST_PRICE_MOVED" | "DUST_NOT_ELIGIBLE" | "DUST_WINDOW_ACTIVE" | "DUST_DAILY_LIMIT" | "DUST_BUSY" | "DUST_TARGET_UNAVAILABLE" | "DUST_BALANCE_CHANGED" | "DUST_CONVERSION_FAILED" | "BATCH_TOO_MANY_SOURCES" | null;
|
|
222
222
|
targetAssetId: number;
|
|
223
223
|
/** Whole quoted balances moved, in asset id order. */
|
|
224
224
|
sources: {
|
|
@@ -534,7 +534,7 @@ declare const ListDustConversionsResultSchema: v.ObjectSchema<{
|
|
|
534
534
|
quoteId: string;
|
|
535
535
|
state: "unspecified" | "processing" | "completed" | "refused";
|
|
536
536
|
/** Why a `refused` conversion was refused; null otherwise. */
|
|
537
|
-
refusalCode: "UNSPECIFIED" | "
|
|
537
|
+
refusalCode: "UNSPECIFIED" | "UNAUTHENTICATED" | "RATE_LIMIT_EXCEEDED" | "CONFLICT" | "INVALID_REQUEST" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR" | "PERMISSION_DENIED" | "FAILED_PRECONDITION" | "SUBACCOUNT_NOT_FOUND" | "INSUFFICIENT_FUNDS" | "INVALID_SUBACCOUNT_ID" | "SOURCE_ACCOUNT_INACTIVE" | "UNSUPPORTED_ASSET" | "INVALID_AMOUNT" | "INVALID_DESTINATION" | "DESTINATION_NOT_FOUND" | "DESTINATION_INACTIVE" | "SAME_SOURCE_DESTINATION" | "DESTINATION_NOT_WHITELISTED" | "SMART_ACCOUNT_UNAVAILABLE" | "STEP_UP_UNAVAILABLE" | "IDEMPOTENCY_CONFLICT" | "FUNDS_LOCK_CONFLICT" | "CAPITAL_VIEW_UNAVAILABLE" | "ACCOUNT_SHARD_UNAVAILABLE" | "POLICY_DENIED" | "NOT_FOUND" | "DUST_QUOTE_EXPIRED" | "DUST_PRICE_MOVED" | "DUST_NOT_ELIGIBLE" | "DUST_WINDOW_ACTIVE" | "DUST_DAILY_LIMIT" | "DUST_BUSY" | "DUST_TARGET_UNAVAILABLE" | "DUST_BALANCE_CHANGED" | "DUST_CONVERSION_FAILED" | "BATCH_TOO_MANY_SOURCES" | null;
|
|
538
538
|
targetAssetId: number;
|
|
539
539
|
/** Whole quoted balances moved, in asset id order. */
|
|
540
540
|
sources: {
|
|
@@ -2,6 +2,7 @@ import "../../gen/marketdata/v1/heatmap_pb.js";
|
|
|
2
2
|
//#region src/services/heatmap/heatmap.codecs.d.ts
|
|
3
3
|
declare const HEATMAP_INTERVAL_VALUES: readonly ["1s", "1m", "5m", "1h"];
|
|
4
4
|
type HeatmapIntervalValue = (typeof HEATMAP_INTERVAL_VALUES)[number];
|
|
5
|
+
/** Every `DepthTier` except 5000, which the heatmap refuses. */
|
|
5
6
|
declare const HEATMAP_DEPTH_VALUES: readonly [1, 5, 10, 20, 50, 100, 200, 500, 1000];
|
|
6
7
|
type HeatmapDepthValue = (typeof HEATMAP_DEPTH_VALUES)[number];
|
|
7
8
|
declare const HEATMAP_QUANTITY_MODE_VALUES: readonly ["close", "peak"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heatmap.codecs.d.ts","names":[],"sources":["../../../src/services/heatmap/heatmap.codecs.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"heatmap.codecs.d.ts","names":[],"sources":["../../../src/services/heatmap/heatmap.codecs.ts"],"mappings":";;cAGa;KACD,+BAA+B;;cAG9B;KACD,4BAA4B;cAE3B;KACD,mCAAmC"}
|
|
@@ -6,6 +6,7 @@ const HEATMAP_INTERVAL_VALUES = [
|
|
|
6
6
|
"5m",
|
|
7
7
|
"1h"
|
|
8
8
|
];
|
|
9
|
+
/** Every `DepthTier` except 5000, which the heatmap refuses. */
|
|
9
10
|
const HEATMAP_DEPTH_VALUES = [
|
|
10
11
|
1,
|
|
11
12
|
5,
|
|
@@ -33,32 +34,6 @@ const HeatmapIntervalCodec = {
|
|
|
33
34
|
[4]: "1h"
|
|
34
35
|
}
|
|
35
36
|
};
|
|
36
|
-
const HeatmapDepthCodec = {
|
|
37
|
-
inputToProto: {
|
|
38
|
-
1: 1,
|
|
39
|
-
5: 2,
|
|
40
|
-
10: 3,
|
|
41
|
-
20: 4,
|
|
42
|
-
50: 5,
|
|
43
|
-
100: 6,
|
|
44
|
-
200: 7,
|
|
45
|
-
500: 8,
|
|
46
|
-
1e3: 9
|
|
47
|
-
},
|
|
48
|
-
protoToOutput: {
|
|
49
|
-
[0]: "unspecified",
|
|
50
|
-
[1]: 1,
|
|
51
|
-
[2]: 5,
|
|
52
|
-
[3]: 10,
|
|
53
|
-
[4]: 20,
|
|
54
|
-
[5]: 50,
|
|
55
|
-
[6]: 100,
|
|
56
|
-
[7]: 200,
|
|
57
|
-
[8]: 500,
|
|
58
|
-
[9]: 1e3
|
|
59
|
-
},
|
|
60
|
-
supportedDepths: HEATMAP_DEPTH_VALUES
|
|
61
|
-
};
|
|
62
37
|
const HeatmapQuantityModeCodec = {
|
|
63
38
|
inputToProto: {
|
|
64
39
|
close: 1,
|
|
@@ -71,6 +46,6 @@ const HeatmapQuantityModeCodec = {
|
|
|
71
46
|
}
|
|
72
47
|
};
|
|
73
48
|
//#endregion
|
|
74
|
-
export { HEATMAP_DEPTH_VALUES, HEATMAP_INTERVAL_VALUES, HEATMAP_QUANTITY_MODE_VALUES,
|
|
49
|
+
export { HEATMAP_DEPTH_VALUES, HEATMAP_INTERVAL_VALUES, HEATMAP_QUANTITY_MODE_VALUES, HeatmapIntervalCodec, HeatmapQuantityModeCodec };
|
|
75
50
|
|
|
76
51
|
//# sourceMappingURL=heatmap.codecs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heatmap.codecs.js","names":[],"sources":["../../../src/services/heatmap/heatmap.codecs.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"heatmap.codecs.js","names":[],"sources":["../../../src/services/heatmap/heatmap.codecs.ts"],"sourcesContent":["import { HeatmapInterval, HeatmapQuantityMode } from \"../../gen/marketdata/v1/heatmap_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const HEATMAP_INTERVAL_VALUES = [\"1s\", \"1m\", \"5m\", \"1h\"] as const;\nexport type HeatmapIntervalValue = (typeof HEATMAP_INTERVAL_VALUES)[number];\n\n/** Every `DepthTier` except 5000, which the heatmap refuses. */\nexport const HEATMAP_DEPTH_VALUES = [1, 5, 10, 20, 50, 100, 200, 500, 1000] as const;\nexport type HeatmapDepthValue = (typeof HEATMAP_DEPTH_VALUES)[number];\n\nexport const HEATMAP_QUANTITY_MODE_VALUES = [\"close\", \"peak\"] as const;\nexport type HeatmapQuantityModeValue = (typeof HEATMAP_QUANTITY_MODE_VALUES)[number];\n\nexport const HeatmapIntervalCodec = {\n inputToProto: {\n \"1s\": HeatmapInterval.INTERVAL_1S,\n \"1m\": HeatmapInterval.INTERVAL_1M,\n \"5m\": HeatmapInterval.INTERVAL_5M,\n \"1h\": HeatmapInterval.INTERVAL_1H,\n } satisfies InputToProto<HeatmapIntervalValue, HeatmapInterval>,\n protoToOutput: {\n [HeatmapInterval.INTERVAL_UNSPECIFIED]: \"unspecified\",\n [HeatmapInterval.INTERVAL_1S]: \"1s\",\n [HeatmapInterval.INTERVAL_1M]: \"1m\",\n [HeatmapInterval.INTERVAL_5M]: \"5m\",\n [HeatmapInterval.INTERVAL_1H]: \"1h\",\n } satisfies ProtoToOutput<HeatmapInterval, HeatmapIntervalValue>,\n} as const;\n\nexport const HeatmapQuantityModeCodec = {\n inputToProto: {\n close: HeatmapQuantityMode.CLOSE,\n peak: HeatmapQuantityMode.PEAK,\n } satisfies InputToProto<HeatmapQuantityModeValue, HeatmapQuantityMode>,\n protoToOutput: {\n [HeatmapQuantityMode.QTY_MODE_UNSPECIFIED]: \"unspecified\",\n [HeatmapQuantityMode.CLOSE]: \"close\",\n [HeatmapQuantityMode.PEAK]: \"peak\",\n } satisfies ProtoToOutput<HeatmapQuantityMode, HeatmapQuantityModeValue>,\n} as const;\n"],"mappings":";;AAGA,MAAa,0BAA0B;CAAC;CAAM;CAAM;CAAM;AAAI;;AAI9D,MAAa,uBAAuB;CAAC;CAAG;CAAG;CAAI;CAAI;CAAI;CAAK;CAAK;CAAK;AAAI;AAG1E,MAAa,+BAA+B,CAAC,SAAS,MAAM;AAG5D,MAAa,uBAAuB;CAChC,cAAc;EACV,MAAA;EACA,MAAA;EACA,MAAA;EACA,MAAA;CACJ;CACA,eAAe;GAC6B,IAAA;GACT,IAAA;GACA,IAAA;GACA,IAAA;GACA,IAAA;CACnC;AACJ;AAEA,MAAa,2BAA2B;CACpC,cAAc;EACV,OAAA;EACA,MAAA;CACJ;CACA,eAAe;GACiC,IAAA;GACf,IAAA;GACD,IAAA;CAChC;AACJ"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DepthTier } from "../../gen/polyester/type/v1/depth_tier_pb.js";
|
|
2
|
+
import { HeatmapInterval, HeatmapQuantityMode } from "../../gen/marketdata/v1/heatmap_pb.js";
|
|
2
3
|
import { DecodedEnum } from "../../utils/types.js";
|
|
3
4
|
import { SdkScales } from "../../shared/decimal-surface.js";
|
|
4
5
|
import * as v from "valibot";
|
|
@@ -14,7 +15,7 @@ type TimestampInit = {
|
|
|
14
15
|
declare const GetOrderbookHeatmapInputSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
15
16
|
readonly symbolId: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>;
|
|
16
17
|
readonly interval: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["1s", "1m", "5m", "1h"], undefined>, "1s">, v.TransformAction<"1s" | "1m" | "5m" | "1h", HeatmapInterval>]>;
|
|
17
|
-
readonly depth: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly [1, 5, 10, 20, 50, 100, 200, 500, 1000], undefined>, 50>, v.TransformAction<1 | 5 | 10 | 20 | 200 | 100 |
|
|
18
|
+
readonly depth: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly [1, 5, 10, 20, 50, 100, 200, 500, 1000], undefined>, 50>, v.TransformAction<1 | 5 | 10 | 20 | 200 | 100 | 1000 | 500 | 50, DepthTier>]>;
|
|
18
19
|
readonly quantityMode: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["close", "peak"], undefined>, "close">, v.TransformAction<"close" | "peak", HeatmapQuantityMode>]>;
|
|
19
20
|
readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 20000, undefined>]>;
|
|
20
21
|
readonly startTsSec: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, number, undefined>, v.TransformAction<number, bigint>]>, undefined>;
|
|
@@ -23,7 +24,7 @@ declare const GetOrderbookHeatmapInputSchema: v.SchemaWithPipe<readonly [v.Objec
|
|
|
23
24
|
}, undefined>, v.CheckAction<{
|
|
24
25
|
symbolId: number;
|
|
25
26
|
interval: HeatmapInterval;
|
|
26
|
-
depth:
|
|
27
|
+
depth: DepthTier;
|
|
27
28
|
quantityMode: HeatmapQuantityMode;
|
|
28
29
|
limit: number;
|
|
29
30
|
startTsSec?: bigint | undefined;
|
|
@@ -32,7 +33,7 @@ declare const GetOrderbookHeatmapInputSchema: v.SchemaWithPipe<readonly [v.Objec
|
|
|
32
33
|
}, "pageToken, startTsSec, or endTsSec is required">, v.TransformAction<{
|
|
33
34
|
symbolId: number;
|
|
34
35
|
interval: HeatmapInterval;
|
|
35
|
-
depth:
|
|
36
|
+
depth: DepthTier;
|
|
36
37
|
quantityMode: HeatmapQuantityMode;
|
|
37
38
|
limit: number;
|
|
38
39
|
startTsSec?: bigint | undefined;
|
|
@@ -41,7 +42,7 @@ declare const GetOrderbookHeatmapInputSchema: v.SchemaWithPipe<readonly [v.Objec
|
|
|
41
42
|
}, {
|
|
42
43
|
symbolId: number;
|
|
43
44
|
interval: HeatmapInterval;
|
|
44
|
-
depth:
|
|
45
|
+
depth: DepthTier;
|
|
45
46
|
quantityMode: HeatmapQuantityMode;
|
|
46
47
|
limit: number;
|
|
47
48
|
pageToken: string;
|
|
@@ -227,7 +228,7 @@ type OrderbookHeatmapDeltaChain = ReturnType<typeof convertHeatmapDeltaChain>;
|
|
|
227
228
|
declare function createOrderbookHeatmapResponseSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
228
229
|
readonly symbolId: v.NumberSchema<undefined>;
|
|
229
230
|
readonly interval: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1s" | "1m" | "5m" | "1h">>]>;
|
|
230
|
-
readonly depth: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, 1 | 5 | 10 | 20 |
|
|
231
|
+
readonly depth: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, 1 | "unspecified" | 5 | 10 | 20 | 200 | 100 | 1000 | 500 | 50 | 5000>]>;
|
|
231
232
|
readonly chain: v.OptionalSchema<v.ObjectSchema<{
|
|
232
233
|
readonly baseKeyframe: v.OptionalSchema<v.ObjectSchema<{
|
|
233
234
|
readonly tsSec: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, number>]>;
|
|
@@ -287,7 +288,7 @@ declare function createOrderbookHeatmapResponseSchema(scales: SdkScales): v.Sche
|
|
|
287
288
|
}, undefined>, v.TransformAction<{
|
|
288
289
|
symbolId: number;
|
|
289
290
|
interval: DecodedEnum<"1s" | "1m" | "5m" | "1h">;
|
|
290
|
-
depth: 1 | 5 | 10 | 20 |
|
|
291
|
+
depth: 1 | "unspecified" | 5 | 10 | 20 | 200 | 100 | 1000 | 500 | 50 | 5000;
|
|
291
292
|
chain?: {
|
|
292
293
|
baseKeyframe?: {
|
|
293
294
|
tsSec: number;
|
|
@@ -347,7 +348,7 @@ declare function createOrderbookHeatmapResponseSchema(scales: SdkScales): v.Sche
|
|
|
347
348
|
}, {
|
|
348
349
|
symbolId: number;
|
|
349
350
|
interval: DecodedEnum<"1s" | "1m" | "5m" | "1h">;
|
|
350
|
-
depth: 1 | 5 | 10 | 20 |
|
|
351
|
+
depth: 1 | "unspecified" | 5 | 10 | 20 | 200 | 100 | 1000 | 500 | 50 | 5000;
|
|
351
352
|
chain: {
|
|
352
353
|
baseKeyframe: {
|
|
353
354
|
tsSec: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heatmap.schemas.d.ts","names":[],"sources":["../../../src/services/heatmap/heatmap.schemas.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"heatmap.schemas.d.ts","names":[],"sources":["../../../src/services/heatmap/heatmap.schemas.ts"],"mappings":";;;;;;KAmBK;EACD,YAAY;EACZ,UAAU;;KAGT;EAAkB;EAAiB;;cAqB3B,gCAA8B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0DrC,iCAA+B,EAAA;;;;KAKhC,4BAA4B,EAAE,mBAAmB;iBAE7C,qBACL,QAAQ,2BACR,oBACA;;;;KAQQ,yBAAyB,kBAAkB;KAE3C,8BAA8B;cAEpC,mCAAiC,EAAA;;;;;;;;;;;;;;;KAUlC,8BAA8B,EAAE,mBAAmB;iBAE/C,uBACL,UAAU,6BACV,oBACA;;;;;;;;;;;;;;;KAaQ,2BAA2B,kBAAkB;cAEnD,sCAAoC,EAAA;;;;;;;;;;;;;;KASrC,iCAAiC,EAAE,mBAAmB;iBAElD,0BACL,QAAQ,gCACR,oBACA;;;;;;;;;;;;;;KAYQ,8BAA8B,kBAAkB;cAEtD,qCAAmC,EAAA;;;;;;;;;;;;;;;;;;;KAcpC,gCAAgC,EAAE,mBAAmB;iBAEjD,yBAAyB,QAAQ,+BAA+B,QAAQ;;;;;;;;;;;;;;;;;;;KAkBrE,6BAA6B,kBAAkB;cASrD,qCAAmC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAKpC,gCAAgC,EAAE,mBAAmB;iBAEjD,yBACL,OAAO,+BACP,oBACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAYQ,6BAA6B,kBAAkB;iBAmB3C,qCAAqC,QAAQ,YAAS,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2B1D,2BAA2B,EAAE,kBAAkB;KAE/C,2BAA2B,EAAE,YACrC,kBAAkB"}
|
|
@@ -2,11 +2,12 @@ import { OptionalTimestampSecondsInputSchema } from "../../shared/schemas.js";
|
|
|
2
2
|
import { enumLabel } from "../../shared/proto-enum-codec.js";
|
|
3
3
|
import { scaledToDecimalOutput } from "../../shared/decimal-surface.js";
|
|
4
4
|
import { SymbolIdInputSchema } from "../shared.js";
|
|
5
|
-
import { HEATMAP_DEPTH_VALUES, HEATMAP_INTERVAL_VALUES, HEATMAP_QUANTITY_MODE_VALUES,
|
|
5
|
+
import { HEATMAP_DEPTH_VALUES, HEATMAP_INTERVAL_VALUES, HEATMAP_QUANTITY_MODE_VALUES, HeatmapIntervalCodec, HeatmapQuantityModeCodec } from "./heatmap.codecs.js";
|
|
6
|
+
import { DepthTierCodec } from "../../shared/depth-tier.js";
|
|
6
7
|
import * as v from "valibot";
|
|
7
8
|
//#region src/services/heatmap/heatmap.schemas.ts
|
|
8
9
|
const IntervalInputSchema = v.pipe(v.optional(v.picklist(HEATMAP_INTERVAL_VALUES), "1s"), v.transform((value) => HeatmapIntervalCodec.inputToProto[value]));
|
|
9
|
-
const DepthInputSchema = v.pipe(v.optional(v.picklist(HEATMAP_DEPTH_VALUES), 50), v.transform((value) =>
|
|
10
|
+
const DepthInputSchema = v.pipe(v.optional(v.picklist(HEATMAP_DEPTH_VALUES), 50), v.transform((value) => DepthTierCodec.inputToProto[value]));
|
|
10
11
|
const QuantityModeInputSchema = v.pipe(v.optional(v.picklist(HEATMAP_QUANTITY_MODE_VALUES), "close"), v.transform((value) => HeatmapQuantityModeCodec.inputToProto[value]));
|
|
11
12
|
function timestampFromTsSec(tsSec) {
|
|
12
13
|
return {
|
|
@@ -140,7 +141,7 @@ function convertHeatmapDeltaChain(chain, priceScale, qtyScale) {
|
|
|
140
141
|
const OrderbookHeatmapResponseRawSchema = v.object({
|
|
141
142
|
symbolId: v.number(),
|
|
142
143
|
interval: v.pipe(v.number(), v.transform(intervalLabelFor)),
|
|
143
|
-
depth: v.pipe(v.number(), v.transform((value) => enumLabel(
|
|
144
|
+
depth: v.pipe(v.number(), v.transform((value) => enumLabel(DepthTierCodec.protoToOutput, value))),
|
|
144
145
|
chain: v.optional(OrderbookHeatmapDeltaChainRawSchema),
|
|
145
146
|
lastPersistedTsSec: TimestampSecondsSchema,
|
|
146
147
|
liveFromBookSeqEnd: Uint64StringSchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heatmap.schemas.js","names":[],"sources":["../../../src/services/heatmap/heatmap.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport { SymbolIdInputSchema } from \"../shared.js\";\nimport type {\n HeatmapDepth,\n HeatmapInterval,\n HeatmapQuantityMode,\n} from \"../../gen/marketdata/v1/heatmap_pb.js\";\nimport { OptionalTimestampSecondsInputSchema } from \"../../shared/schemas.js\";\nimport { enumLabel } from \"../../shared/proto-enum-codec.js\";\nimport type { DecodedEnum } from \"../../utils/types.js\";\nimport { scaledToDecimalOutput, type SdkScales } from \"../../shared/decimal-surface.js\";\nimport {\n HEATMAP_DEPTH_VALUES,\n HEATMAP_INTERVAL_VALUES,\n HEATMAP_QUANTITY_MODE_VALUES,\n HeatmapDepthCodec,\n HeatmapIntervalCodec,\n HeatmapQuantityModeCodec,\n type HeatmapIntervalValue,\n type HeatmapQuantityModeValue,\n} from \"./heatmap.codecs.js\";\n\ntype HeatmapTimeRangeInit = {\n startTime?: TimestampInit;\n endTime?: TimestampInit;\n};\n\ntype TimestampInit = { seconds: bigint; nanos: number };\n\nconst IntervalInputSchema = v.pipe(\n v.optional(v.picklist(HEATMAP_INTERVAL_VALUES), \"1s\"),\n v.transform((value): HeatmapInterval => HeatmapIntervalCodec.inputToProto[value]),\n);\n\nconst DepthInputSchema = v.pipe(\n v.optional(v.picklist(HEATMAP_DEPTH_VALUES), 50),\n v.transform((value): HeatmapDepth => HeatmapDepthCodec.inputToProto[value]),\n);\n\nconst QuantityModeInputSchema = v.pipe(\n v.optional(v.picklist(HEATMAP_QUANTITY_MODE_VALUES), \"close\"),\n v.transform((value): HeatmapQuantityMode => HeatmapQuantityModeCodec.inputToProto[value]),\n);\n\nfunction timestampFromTsSec(tsSec: bigint): TimestampInit {\n return { seconds: tsSec, nanos: 0 };\n}\n\nexport const GetOrderbookHeatmapInputSchema = v.pipe(\n v.object({\n symbolId: SymbolIdInputSchema,\n interval: IntervalInputSchema,\n depth: DepthInputSchema,\n quantityMode: QuantityModeInputSchema,\n limit: v.pipe(v.number(), v.integer(), v.gtValue(0), v.maxValue(20_000)),\n startTsSec: OptionalTimestampSecondsInputSchema,\n endTsSec: OptionalTimestampSecondsInputSchema,\n pageToken: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n }),\n v.check(\n (value) => value.pageToken !== \"\" || value.startTsSec != null || value.endTsSec != null,\n \"pageToken, startTsSec, or endTsSec is required\",\n ),\n v.transform((value) => {\n const timeRange: HeatmapTimeRangeInit | undefined =\n value.pageToken !== \"\"\n ? undefined\n : {\n startTime:\n value.startTsSec != null\n ? timestampFromTsSec(value.startTsSec)\n : undefined,\n endTime:\n value.endTsSec != null ? timestampFromTsSec(value.endTsSec) : undefined,\n };\n\n return {\n symbolId: value.symbolId,\n interval: value.interval,\n depth: value.depth,\n quantityMode: value.quantityMode,\n limit: value.limit,\n pageToken: value.pageToken,\n timeRange,\n };\n }),\n);\n\nfunction intervalLabelFor(value: number): DecodedEnum<HeatmapIntervalValue> {\n return enumLabel(HeatmapIntervalCodec.protoToOutput, value);\n}\n\nfunction quantityModeLabelFor(value: number): DecodedEnum<HeatmapQuantityModeValue> {\n return enumLabel(HeatmapQuantityModeCodec.protoToOutput, value);\n}\n\nconst TimestampSecondsSchema = v.pipe(\n v.bigint(),\n v.transform((value) => Number(value)),\n);\n\nconst Uint64StringSchema = v.pipe(\n v.bigint(),\n v.transform((value) => value.toString()),\n);\n\nconst OrderbookHeatmapLevelsRawSchema = v.object({\n priceTicks: v.array(v.bigint()),\n qtyScaled: v.array(v.bigint()),\n});\n\ntype OrderbookHeatmapLevelsRaw = v.InferOutput<typeof OrderbookHeatmapLevelsRawSchema>;\n\nfunction convertHeatmapLevels(\n levels: OrderbookHeatmapLevelsRaw,\n priceScale: number,\n qtyScale: number,\n) {\n return {\n price: levels.priceTicks.map((tick) => scaledToDecimalOutput(tick, priceScale)),\n qty: levels.qtyScaled.map((qty) => scaledToDecimalOutput(qty, qtyScale)),\n };\n}\n\nexport type OrderbookHeatmapLevels = ReturnType<typeof convertHeatmapLevels>;\n\nexport type OrderbookHeatmapDeltaLevels = OrderbookHeatmapLevels;\n\nconst OrderbookHeatmapKeyframeRawSchema = v.object({\n tsSec: TimestampSecondsSchema,\n bestBidTicks: v.bigint(),\n bestAskTicks: v.bigint(),\n midTicks: v.bigint(),\n bids: v.optional(OrderbookHeatmapLevelsRawSchema),\n asks: v.optional(OrderbookHeatmapLevelsRawSchema),\n bookSeq: Uint64StringSchema,\n});\n\ntype OrderbookHeatmapKeyframeRaw = v.InferOutput<typeof OrderbookHeatmapKeyframeRawSchema>;\n\nfunction convertHeatmapKeyframe(\n keyframe: OrderbookHeatmapKeyframeRaw,\n priceScale: number,\n qtyScale: number,\n) {\n return {\n tsSec: keyframe.tsSec,\n bestBid: scaledToDecimalOutput(keyframe.bestBidTicks, priceScale),\n bestAsk: scaledToDecimalOutput(keyframe.bestAskTicks, priceScale),\n mid: scaledToDecimalOutput(keyframe.midTicks, priceScale),\n bids: keyframe.bids ? convertHeatmapLevels(keyframe.bids, priceScale, qtyScale) : undefined,\n asks: keyframe.asks ? convertHeatmapLevels(keyframe.asks, priceScale, qtyScale) : undefined,\n bookSeq: keyframe.bookSeq,\n };\n}\n\nexport type OrderbookHeatmapKeyframe = ReturnType<typeof convertHeatmapKeyframe>;\n\nconst OrderbookHeatmapDeltaBucketRawSchema = v.object({\n tsSec: TimestampSecondsSchema,\n bids: v.optional(OrderbookHeatmapLevelsRawSchema),\n asks: v.optional(OrderbookHeatmapLevelsRawSchema),\n updatesInBucket: v.number(),\n bookSeqStart: Uint64StringSchema,\n bookSeqEnd: Uint64StringSchema,\n});\n\ntype OrderbookHeatmapDeltaBucketRaw = v.InferOutput<typeof OrderbookHeatmapDeltaBucketRawSchema>;\n\nfunction convertHeatmapDeltaBucket(\n bucket: OrderbookHeatmapDeltaBucketRaw,\n priceScale: number,\n qtyScale: number,\n) {\n return {\n tsSec: bucket.tsSec,\n bids: bucket.bids ? convertHeatmapLevels(bucket.bids, priceScale, qtyScale) : undefined,\n asks: bucket.asks ? convertHeatmapLevels(bucket.asks, priceScale, qtyScale) : undefined,\n updatesInBucket: bucket.updatesInBucket,\n bookSeqStart: bucket.bookSeqStart,\n bookSeqEnd: bucket.bookSeqEnd,\n };\n}\n\nexport type OrderbookHeatmapDeltaBucket = ReturnType<typeof convertHeatmapDeltaBucket>;\n\nconst OrderbookHeatmapLiveBucketRawSchema = v.object({\n symbolId: v.number(),\n interval: v.pipe(v.number(), v.transform(intervalLabelFor)),\n tsSec: TimestampSecondsSchema,\n isFinal: v.boolean(),\n bids: v.optional(OrderbookHeatmapLevelsRawSchema),\n asks: v.optional(OrderbookHeatmapLevelsRawSchema),\n updatesInBucket: v.number(),\n bookSeqStart: Uint64StringSchema,\n bookSeqEnd: Uint64StringSchema,\n quantityMode: v.pipe(v.number(), v.transform(quantityModeLabelFor)),\n effectiveBinTicks: v.bigint(),\n});\n\ntype OrderbookHeatmapLiveBucketRaw = v.InferOutput<typeof OrderbookHeatmapLiveBucketRawSchema>;\n\nfunction convertHeatmapLiveBucket(bucket: OrderbookHeatmapLiveBucketRaw, scales: SdkScales) {\n const priceScale = scales.price();\n const qtyScale = scales.baseQty(bucket.symbolId);\n return {\n symbolId: bucket.symbolId,\n interval: bucket.interval,\n tsSec: bucket.tsSec,\n isFinal: bucket.isFinal,\n bids: bucket.bids ? convertHeatmapLevels(bucket.bids, priceScale, qtyScale) : undefined,\n asks: bucket.asks ? convertHeatmapLevels(bucket.asks, priceScale, qtyScale) : undefined,\n updatesInBucket: bucket.updatesInBucket,\n bookSeqStart: bucket.bookSeqStart,\n bookSeqEnd: bucket.bookSeqEnd,\n quantityMode: bucket.quantityMode,\n effectiveBinSize: scaledToDecimalOutput(bucket.effectiveBinTicks, priceScale),\n };\n}\n\nexport type OrderbookHeatmapLiveBucket = ReturnType<typeof convertHeatmapLiveBucket>;\n\nexport function createOrderbookHeatmapLiveBucketSchema(scales: SdkScales) {\n return v.pipe(\n OrderbookHeatmapLiveBucketRawSchema,\n v.transform((bucket) => convertHeatmapLiveBucket(bucket, scales)),\n );\n}\n\nconst OrderbookHeatmapDeltaChainRawSchema = v.object({\n baseKeyframe: v.optional(OrderbookHeatmapKeyframeRawSchema),\n deltas: v.optional(v.array(OrderbookHeatmapDeltaBucketRawSchema), []),\n});\n\ntype OrderbookHeatmapDeltaChainRaw = v.InferOutput<typeof OrderbookHeatmapDeltaChainRawSchema>;\n\nfunction convertHeatmapDeltaChain(\n chain: OrderbookHeatmapDeltaChainRaw,\n priceScale: number,\n qtyScale: number,\n) {\n return {\n baseKeyframe: chain.baseKeyframe\n ? convertHeatmapKeyframe(chain.baseKeyframe, priceScale, qtyScale)\n : undefined,\n deltas: chain.deltas.map((bucket) =>\n convertHeatmapDeltaBucket(bucket, priceScale, qtyScale),\n ),\n };\n}\n\nexport type OrderbookHeatmapDeltaChain = ReturnType<typeof convertHeatmapDeltaChain>;\n\nconst OrderbookHeatmapResponseRawSchema = v.object({\n symbolId: v.number(),\n interval: v.pipe(v.number(), v.transform(intervalLabelFor)),\n depth: v.pipe(\n v.number(),\n v.transform((value) => enumLabel(HeatmapDepthCodec.protoToOutput, value)),\n ),\n chain: v.optional(OrderbookHeatmapDeltaChainRawSchema),\n lastPersistedTsSec: TimestampSecondsSchema,\n liveFromBookSeqEnd: Uint64StringSchema,\n hasLiveAnchor: v.boolean(),\n nextPageToken: v.optional(v.string(), \"\"),\n serverTimeSec: TimestampSecondsSchema,\n quantityMode: v.pipe(v.number(), v.transform(quantityModeLabelFor)),\n liveBucket: v.optional(OrderbookHeatmapLiveBucketRawSchema),\n});\n\nexport function createOrderbookHeatmapResponseSchema(scales: SdkScales) {\n return v.pipe(\n OrderbookHeatmapResponseRawSchema,\n v.transform((res) => {\n const priceScale = scales.price();\n const qtyScale = scales.baseQty(res.symbolId);\n return {\n symbolId: res.symbolId,\n interval: res.interval,\n depth: res.depth,\n chain: res.chain\n ? convertHeatmapDeltaChain(res.chain, priceScale, qtyScale)\n : undefined,\n lastPersistedTsSec: res.lastPersistedTsSec,\n liveFromBookSeqEnd: res.liveFromBookSeqEnd,\n hasLiveAnchor: res.hasLiveAnchor,\n nextPageToken: res.nextPageToken,\n serverTimeSec: res.serverTimeSec,\n quantityMode: res.quantityMode,\n liveBucket: res.liveBucket\n ? convertHeatmapLiveBucket(res.liveBucket, scales)\n : undefined,\n };\n }),\n );\n}\n\nexport type GetOrderbookHeatmapInput = v.InferInput<typeof GetOrderbookHeatmapInputSchema>;\nexport type ParsedGetOrderbookHeatmapInput = v.InferOutput<typeof GetOrderbookHeatmapInputSchema>;\nexport type OrderbookHeatmapResponse = v.InferOutput<\n ReturnType<typeof createOrderbookHeatmapResponseSchema>\n>;\nexport type ParsedHeatmapTimeRange = HeatmapTimeRangeInit;\n"],"mappings":";;;;;;;AA6BA,MAAM,sBAAsB,EAAE,KAC1B,EAAE,SAAS,EAAE,SAAS,uBAAuB,GAAG,IAAI,GACp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cAAc,IAAI;GAClB,YAAY,IAAI,aACV,yBAAyB,IAAI,YAAY,MAAM,IAC/C,KAAA;EACV;CACJ,CAAC,CACL;AACJ"}
|
|
1
|
+
{"version":3,"file":"heatmap.schemas.js","names":[],"sources":["../../../src/services/heatmap/heatmap.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport { SymbolIdInputSchema } from \"../shared.js\";\nimport type { HeatmapInterval, HeatmapQuantityMode } from \"../../gen/marketdata/v1/heatmap_pb.js\";\nimport type { DepthTier } from \"../../gen/polyester/type/v1/depth_tier_pb.js\";\nimport { DepthTierCodec } from \"../../shared/depth-tier.js\";\nimport { OptionalTimestampSecondsInputSchema } from \"../../shared/schemas.js\";\nimport { enumLabel } from \"../../shared/proto-enum-codec.js\";\nimport type { DecodedEnum } from \"../../utils/types.js\";\nimport { scaledToDecimalOutput, type SdkScales } from \"../../shared/decimal-surface.js\";\nimport {\n HEATMAP_DEPTH_VALUES,\n HEATMAP_INTERVAL_VALUES,\n HEATMAP_QUANTITY_MODE_VALUES,\n HeatmapIntervalCodec,\n HeatmapQuantityModeCodec,\n type HeatmapIntervalValue,\n type HeatmapQuantityModeValue,\n} from \"./heatmap.codecs.js\";\n\ntype HeatmapTimeRangeInit = {\n startTime?: TimestampInit;\n endTime?: TimestampInit;\n};\n\ntype TimestampInit = { seconds: bigint; nanos: number };\n\nconst IntervalInputSchema = v.pipe(\n v.optional(v.picklist(HEATMAP_INTERVAL_VALUES), \"1s\"),\n v.transform((value): HeatmapInterval => HeatmapIntervalCodec.inputToProto[value]),\n);\n\nconst DepthInputSchema = v.pipe(\n v.optional(v.picklist(HEATMAP_DEPTH_VALUES), 50),\n v.transform((value): DepthTier => DepthTierCodec.inputToProto[value]),\n);\n\nconst QuantityModeInputSchema = v.pipe(\n v.optional(v.picklist(HEATMAP_QUANTITY_MODE_VALUES), \"close\"),\n v.transform((value): HeatmapQuantityMode => HeatmapQuantityModeCodec.inputToProto[value]),\n);\n\nfunction timestampFromTsSec(tsSec: bigint): TimestampInit {\n return { seconds: tsSec, nanos: 0 };\n}\n\nexport const GetOrderbookHeatmapInputSchema = v.pipe(\n v.object({\n symbolId: SymbolIdInputSchema,\n interval: IntervalInputSchema,\n depth: DepthInputSchema,\n quantityMode: QuantityModeInputSchema,\n limit: v.pipe(v.number(), v.integer(), v.gtValue(0), v.maxValue(20_000)),\n startTsSec: OptionalTimestampSecondsInputSchema,\n endTsSec: OptionalTimestampSecondsInputSchema,\n pageToken: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n }),\n v.check(\n (value) => value.pageToken !== \"\" || value.startTsSec != null || value.endTsSec != null,\n \"pageToken, startTsSec, or endTsSec is required\",\n ),\n v.transform((value) => {\n const timeRange: HeatmapTimeRangeInit | undefined =\n value.pageToken !== \"\"\n ? undefined\n : {\n startTime:\n value.startTsSec != null\n ? timestampFromTsSec(value.startTsSec)\n : undefined,\n endTime:\n value.endTsSec != null ? timestampFromTsSec(value.endTsSec) : undefined,\n };\n\n return {\n symbolId: value.symbolId,\n interval: value.interval,\n depth: value.depth,\n quantityMode: value.quantityMode,\n limit: value.limit,\n pageToken: value.pageToken,\n timeRange,\n };\n }),\n);\n\nfunction intervalLabelFor(value: number): DecodedEnum<HeatmapIntervalValue> {\n return enumLabel(HeatmapIntervalCodec.protoToOutput, value);\n}\n\nfunction quantityModeLabelFor(value: number): DecodedEnum<HeatmapQuantityModeValue> {\n return enumLabel(HeatmapQuantityModeCodec.protoToOutput, value);\n}\n\nconst TimestampSecondsSchema = v.pipe(\n v.bigint(),\n v.transform((value) => Number(value)),\n);\n\nconst Uint64StringSchema = v.pipe(\n v.bigint(),\n v.transform((value) => value.toString()),\n);\n\nconst OrderbookHeatmapLevelsRawSchema = v.object({\n priceTicks: v.array(v.bigint()),\n qtyScaled: v.array(v.bigint()),\n});\n\ntype OrderbookHeatmapLevelsRaw = v.InferOutput<typeof OrderbookHeatmapLevelsRawSchema>;\n\nfunction convertHeatmapLevels(\n levels: OrderbookHeatmapLevelsRaw,\n priceScale: number,\n qtyScale: number,\n) {\n return {\n price: levels.priceTicks.map((tick) => scaledToDecimalOutput(tick, priceScale)),\n qty: levels.qtyScaled.map((qty) => scaledToDecimalOutput(qty, qtyScale)),\n };\n}\n\nexport type OrderbookHeatmapLevels = ReturnType<typeof convertHeatmapLevels>;\n\nexport type OrderbookHeatmapDeltaLevels = OrderbookHeatmapLevels;\n\nconst OrderbookHeatmapKeyframeRawSchema = v.object({\n tsSec: TimestampSecondsSchema,\n bestBidTicks: v.bigint(),\n bestAskTicks: v.bigint(),\n midTicks: v.bigint(),\n bids: v.optional(OrderbookHeatmapLevelsRawSchema),\n asks: v.optional(OrderbookHeatmapLevelsRawSchema),\n bookSeq: Uint64StringSchema,\n});\n\ntype OrderbookHeatmapKeyframeRaw = v.InferOutput<typeof OrderbookHeatmapKeyframeRawSchema>;\n\nfunction convertHeatmapKeyframe(\n keyframe: OrderbookHeatmapKeyframeRaw,\n priceScale: number,\n qtyScale: number,\n) {\n return {\n tsSec: keyframe.tsSec,\n bestBid: scaledToDecimalOutput(keyframe.bestBidTicks, priceScale),\n bestAsk: scaledToDecimalOutput(keyframe.bestAskTicks, priceScale),\n mid: scaledToDecimalOutput(keyframe.midTicks, priceScale),\n bids: keyframe.bids ? convertHeatmapLevels(keyframe.bids, priceScale, qtyScale) : undefined,\n asks: keyframe.asks ? convertHeatmapLevels(keyframe.asks, priceScale, qtyScale) : undefined,\n bookSeq: keyframe.bookSeq,\n };\n}\n\nexport type OrderbookHeatmapKeyframe = ReturnType<typeof convertHeatmapKeyframe>;\n\nconst OrderbookHeatmapDeltaBucketRawSchema = v.object({\n tsSec: TimestampSecondsSchema,\n bids: v.optional(OrderbookHeatmapLevelsRawSchema),\n asks: v.optional(OrderbookHeatmapLevelsRawSchema),\n updatesInBucket: v.number(),\n bookSeqStart: Uint64StringSchema,\n bookSeqEnd: Uint64StringSchema,\n});\n\ntype OrderbookHeatmapDeltaBucketRaw = v.InferOutput<typeof OrderbookHeatmapDeltaBucketRawSchema>;\n\nfunction convertHeatmapDeltaBucket(\n bucket: OrderbookHeatmapDeltaBucketRaw,\n priceScale: number,\n qtyScale: number,\n) {\n return {\n tsSec: bucket.tsSec,\n bids: bucket.bids ? convertHeatmapLevels(bucket.bids, priceScale, qtyScale) : undefined,\n asks: bucket.asks ? convertHeatmapLevels(bucket.asks, priceScale, qtyScale) : undefined,\n updatesInBucket: bucket.updatesInBucket,\n bookSeqStart: bucket.bookSeqStart,\n bookSeqEnd: bucket.bookSeqEnd,\n };\n}\n\nexport type OrderbookHeatmapDeltaBucket = ReturnType<typeof convertHeatmapDeltaBucket>;\n\nconst OrderbookHeatmapLiveBucketRawSchema = v.object({\n symbolId: v.number(),\n interval: v.pipe(v.number(), v.transform(intervalLabelFor)),\n tsSec: TimestampSecondsSchema,\n isFinal: v.boolean(),\n bids: v.optional(OrderbookHeatmapLevelsRawSchema),\n asks: v.optional(OrderbookHeatmapLevelsRawSchema),\n updatesInBucket: v.number(),\n bookSeqStart: Uint64StringSchema,\n bookSeqEnd: Uint64StringSchema,\n quantityMode: v.pipe(v.number(), v.transform(quantityModeLabelFor)),\n effectiveBinTicks: v.bigint(),\n});\n\ntype OrderbookHeatmapLiveBucketRaw = v.InferOutput<typeof OrderbookHeatmapLiveBucketRawSchema>;\n\nfunction convertHeatmapLiveBucket(bucket: OrderbookHeatmapLiveBucketRaw, scales: SdkScales) {\n const priceScale = scales.price();\n const qtyScale = scales.baseQty(bucket.symbolId);\n return {\n symbolId: bucket.symbolId,\n interval: bucket.interval,\n tsSec: bucket.tsSec,\n isFinal: bucket.isFinal,\n bids: bucket.bids ? convertHeatmapLevels(bucket.bids, priceScale, qtyScale) : undefined,\n asks: bucket.asks ? convertHeatmapLevels(bucket.asks, priceScale, qtyScale) : undefined,\n updatesInBucket: bucket.updatesInBucket,\n bookSeqStart: bucket.bookSeqStart,\n bookSeqEnd: bucket.bookSeqEnd,\n quantityMode: bucket.quantityMode,\n effectiveBinSize: scaledToDecimalOutput(bucket.effectiveBinTicks, priceScale),\n };\n}\n\nexport type OrderbookHeatmapLiveBucket = ReturnType<typeof convertHeatmapLiveBucket>;\n\nexport function createOrderbookHeatmapLiveBucketSchema(scales: SdkScales) {\n return v.pipe(\n OrderbookHeatmapLiveBucketRawSchema,\n v.transform((bucket) => convertHeatmapLiveBucket(bucket, scales)),\n );\n}\n\nconst OrderbookHeatmapDeltaChainRawSchema = v.object({\n baseKeyframe: v.optional(OrderbookHeatmapKeyframeRawSchema),\n deltas: v.optional(v.array(OrderbookHeatmapDeltaBucketRawSchema), []),\n});\n\ntype OrderbookHeatmapDeltaChainRaw = v.InferOutput<typeof OrderbookHeatmapDeltaChainRawSchema>;\n\nfunction convertHeatmapDeltaChain(\n chain: OrderbookHeatmapDeltaChainRaw,\n priceScale: number,\n qtyScale: number,\n) {\n return {\n baseKeyframe: chain.baseKeyframe\n ? convertHeatmapKeyframe(chain.baseKeyframe, priceScale, qtyScale)\n : undefined,\n deltas: chain.deltas.map((bucket) =>\n convertHeatmapDeltaBucket(bucket, priceScale, qtyScale),\n ),\n };\n}\n\nexport type OrderbookHeatmapDeltaChain = ReturnType<typeof convertHeatmapDeltaChain>;\n\nconst OrderbookHeatmapResponseRawSchema = v.object({\n symbolId: v.number(),\n interval: v.pipe(v.number(), v.transform(intervalLabelFor)),\n depth: v.pipe(\n v.number(),\n v.transform((value) => enumLabel(DepthTierCodec.protoToOutput, value)),\n ),\n chain: v.optional(OrderbookHeatmapDeltaChainRawSchema),\n lastPersistedTsSec: TimestampSecondsSchema,\n liveFromBookSeqEnd: Uint64StringSchema,\n hasLiveAnchor: v.boolean(),\n nextPageToken: v.optional(v.string(), \"\"),\n serverTimeSec: TimestampSecondsSchema,\n quantityMode: v.pipe(v.number(), v.transform(quantityModeLabelFor)),\n liveBucket: v.optional(OrderbookHeatmapLiveBucketRawSchema),\n});\n\nexport function createOrderbookHeatmapResponseSchema(scales: SdkScales) {\n return v.pipe(\n OrderbookHeatmapResponseRawSchema,\n v.transform((res) => {\n const priceScale = scales.price();\n const qtyScale = scales.baseQty(res.symbolId);\n return {\n symbolId: res.symbolId,\n interval: res.interval,\n depth: res.depth,\n chain: res.chain\n ? convertHeatmapDeltaChain(res.chain, priceScale, qtyScale)\n : undefined,\n lastPersistedTsSec: res.lastPersistedTsSec,\n liveFromBookSeqEnd: res.liveFromBookSeqEnd,\n hasLiveAnchor: res.hasLiveAnchor,\n nextPageToken: res.nextPageToken,\n serverTimeSec: res.serverTimeSec,\n quantityMode: res.quantityMode,\n liveBucket: res.liveBucket\n ? convertHeatmapLiveBucket(res.liveBucket, scales)\n : undefined,\n };\n }),\n );\n}\n\nexport type GetOrderbookHeatmapInput = v.InferInput<typeof GetOrderbookHeatmapInputSchema>;\nexport type ParsedGetOrderbookHeatmapInput = v.InferOutput<typeof GetOrderbookHeatmapInputSchema>;\nexport type OrderbookHeatmapResponse = v.InferOutput<\n ReturnType<typeof createOrderbookHeatmapResponseSchema>\n>;\nexport type ParsedHeatmapTimeRange = HeatmapTimeRangeInit;\n"],"mappings":";;;;;;;;AA0BA,MAAM,sBAAsB,EAAE,KAC1B,EAAE,SAAS,EAAE,SAAS,uBAAuB,GAAG,IAAI,GACpD,EAAE,WAAW,UAA2B,qBAAqB,aAAa,MAAM,CACpF;AAEA,MAAM,mBAAmB,EAAE,KACvB,EAAE,SAAS,EAAE,SAAS,oBAAoB,GAAG,EAAE,GAC/C,EAAE,WAAW,UAAqB,eAAe,aAAa,MAAM,CACxE;AAEA,MAAM,0BAA0B,EAAE,KAC9B,EAAE,SAAS,EAAE,SAAS,4BAA4B,GAAG,OAAO,GAC5D,EAAE,WAAW,UAA+B,yBAAyB,aAAa,MAAM,CAC5F;AAEA,SAAS,mBAAmB,OAA8B;CACtD,OAAO;EAAE,SAAS;EAAO,OAAO;CAAE;AACtC;AAEA,MAAa,iCAAiC,EAAE,KAC5C,EAAE,OAAO;CACL,UAAU;CACV,UAAU;CACV,OAAO;CACP,cAAc;CACd,OAAO,EAAE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;CAC1D,OAAO,EAAE,KACL,EAAE,OAAO,GACT,EAAE,WAAW,UAAU,UAAU,eAAe,eAAe,KAAK,CAAC,CACzE;CACA,OAAO,EAAE,SAAS,mCAAmC;CACrD,oBAAoB;CACpB,oBAAoB;CACpB,eAAe,EAAE,QAAQ;CACzB,eAAe,EAAE,SAAS,EAAE,OAAO,GAAG,EAAE;CACxC,eAAe;CACf,cAAc,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,UAAU,oBAAoB,CAAC;CAClE,YAAY,EAAE,SAAS,mCAAmC;AAC9D,CAAC;AAED,SAAgB,qCAAqC,QAAmB;CACpE,OAAO,EAAE,KACL,mCACA,EAAE,WAAW,QAAQ;EACjB,MAAM,aAAa,OAAO,MAAM;EAChC,MAAM,WAAW,OAAO,QAAQ,IAAI,QAAQ;EAC5C,OAAO;GACH,UAAU,IAAI;GACd,UAAU,IAAI;GACd,OAAO,IAAI;GACX,OAAO,IAAI,QACL,yBAAyB,IAAI,OAAO,YAAY,QAAQ,IACxD,KAAA;GACN,oBAAoB,IAAI;GACxB,oBAAoB,IAAI;GACxB,eAAe,IAAI;GACnB,eAAe,IAAI;GACnB,eAAe,IAAI;GACnB,cAAc,IAAI;GAClB,YAAY,IAAI,aACV,yBAAyB,IAAI,YAAY,MAAM,IAC/C,KAAA;EACV;CACJ,CAAC,CACL;AACJ"}
|
|
@@ -349,7 +349,7 @@ declare const InternalTransferBatchLegResultSchema: v.SchemaWithPipe<readonly [v
|
|
|
349
349
|
creditedAtNs: string | undefined;
|
|
350
350
|
quantity: string | undefined;
|
|
351
351
|
/** Why the leg caused its batch's refusal; unset for every other leg. */
|
|
352
|
-
errorCode: "UNSPECIFIED" | "
|
|
352
|
+
errorCode: "UNSPECIFIED" | "UNAUTHENTICATED" | "RATE_LIMIT_EXCEEDED" | "CONFLICT" | "INVALID_REQUEST" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR" | "PERMISSION_DENIED" | "FAILED_PRECONDITION" | "SUBACCOUNT_NOT_FOUND" | "INSUFFICIENT_FUNDS" | "INVALID_SUBACCOUNT_ID" | "SOURCE_ACCOUNT_INACTIVE" | "UNSUPPORTED_ASSET" | "INVALID_AMOUNT" | "INVALID_DESTINATION" | "DESTINATION_NOT_FOUND" | "DESTINATION_INACTIVE" | "SAME_SOURCE_DESTINATION" | "DESTINATION_NOT_WHITELISTED" | "SMART_ACCOUNT_UNAVAILABLE" | "STEP_UP_UNAVAILABLE" | "IDEMPOTENCY_CONFLICT" | "FUNDS_LOCK_CONFLICT" | "CAPITAL_VIEW_UNAVAILABLE" | "ACCOUNT_SHARD_UNAVAILABLE" | "POLICY_DENIED" | "NOT_FOUND" | "DUST_QUOTE_EXPIRED" | "DUST_PRICE_MOVED" | "DUST_NOT_ELIGIBLE" | "DUST_WINDOW_ACTIVE" | "DUST_DAILY_LIMIT" | "DUST_BUSY" | "DUST_TARGET_UNAVAILABLE" | "DUST_BALANCE_CHANGED" | "DUST_CONVERSION_FAILED" | "BATCH_TOO_MANY_SOURCES" | undefined;
|
|
353
353
|
legIndex: number;
|
|
354
354
|
status: "unspecified" | "processing" | "credited" | "not_moved";
|
|
355
355
|
transferId?: string | undefined;
|
|
@@ -427,7 +427,7 @@ declare const BatchCreateInternalTransfersResultSchema: v.ObjectSchema<{
|
|
|
427
427
|
creditedAtNs: string | undefined;
|
|
428
428
|
quantity: string | undefined;
|
|
429
429
|
/** Why the leg caused its batch's refusal; unset for every other leg. */
|
|
430
|
-
errorCode: "UNSPECIFIED" | "
|
|
430
|
+
errorCode: "UNSPECIFIED" | "UNAUTHENTICATED" | "RATE_LIMIT_EXCEEDED" | "CONFLICT" | "INVALID_REQUEST" | "SERVICE_UNAVAILABLE" | "INTERNAL_ERROR" | "PERMISSION_DENIED" | "FAILED_PRECONDITION" | "SUBACCOUNT_NOT_FOUND" | "INSUFFICIENT_FUNDS" | "INVALID_SUBACCOUNT_ID" | "SOURCE_ACCOUNT_INACTIVE" | "UNSUPPORTED_ASSET" | "INVALID_AMOUNT" | "INVALID_DESTINATION" | "DESTINATION_NOT_FOUND" | "DESTINATION_INACTIVE" | "SAME_SOURCE_DESTINATION" | "DESTINATION_NOT_WHITELISTED" | "SMART_ACCOUNT_UNAVAILABLE" | "STEP_UP_UNAVAILABLE" | "IDEMPOTENCY_CONFLICT" | "FUNDS_LOCK_CONFLICT" | "CAPITAL_VIEW_UNAVAILABLE" | "ACCOUNT_SHARD_UNAVAILABLE" | "POLICY_DENIED" | "NOT_FOUND" | "DUST_QUOTE_EXPIRED" | "DUST_PRICE_MOVED" | "DUST_NOT_ELIGIBLE" | "DUST_WINDOW_ACTIVE" | "DUST_DAILY_LIMIT" | "DUST_BUSY" | "DUST_TARGET_UNAVAILABLE" | "DUST_BALANCE_CHANGED" | "DUST_CONVERSION_FAILED" | "BATCH_TOO_MANY_SOURCES" | undefined;
|
|
431
431
|
legIndex: number;
|
|
432
432
|
status: "unspecified" | "processing" | "credited" | "not_moved";
|
|
433
433
|
transferId?: string | undefined;
|