@polyester/sdk 0.36.0-devnet-20261112144059 → 0.36.0-devnet-20261112202000
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 +3 -1
- package/dist/browser-core.js +1 -1
- package/dist/gen/ai/v1/assistant_pb.d.ts +1 -1
- package/dist/gen/ai/v1/assistant_pb.js +1 -1
- package/dist/gen/alerts/v1/price_alerts_pb.d.ts +1 -1
- package/dist/gen/auth/v1/address_book_pb.d.ts +1 -1
- package/dist/gen/auth/v1/api_keys_pb.d.ts +1 -1
- package/dist/gen/auth/v1/auth_pb.d.ts +1 -1
- package/dist/gen/auth/v1/mfa_pb.d.ts +1 -1
- package/dist/gen/auth/v1/policies_pb.d.ts +1 -1
- package/dist/gen/auth/v1/profile_pb.d.ts +1 -1
- package/dist/gen/auth/v1/resolve_pb.d.ts +1 -1
- package/dist/gen/auth/v1/social_verification_pb.d.ts +1 -1
- package/dist/gen/auth/v1/subaccounts_pb.d.ts +1 -1
- package/dist/gen/auth/v1/subaccounts_pb.js +1 -1
- package/dist/gen/chain/analytics/v1/analytics_read_pb.d.ts +1 -1
- package/dist/gen/chain/deposit/v1/deposit_pb.d.ts +1 -1
- package/dist/gen/chain/guard/v1/guard_signer_pb.d.ts +1 -1
- package/dist/gen/chain/lifecycle/v1/lifecycle_read_pb.d.ts +1 -1
- package/dist/gen/chain/lifecycle/v1/types_pb.d.ts +1 -1
- package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts +1 -1
- package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts +1 -1
- package/dist/gen/chain/zipper/v1/reason_pb.d.ts +1 -1
- package/dist/gen/chain/zipper/v1/zipper_pb.d.ts +1 -1
- package/dist/gen/changelog/v1/changelog_pb.d.ts +1 -1
- package/dist/gen/checkpoints/v1/checkpoints_pb.d.ts +1 -1
- package/dist/gen/claims/v1/claims_pb.d.ts +1 -1
- package/dist/gen/fees/v1/fees_pb.d.ts +1 -1
- package/dist/gen/index.js +20 -20
- package/dist/gen/ledger/read/v1/ledger_read_pb.d.ts +1 -1
- package/dist/gen/marketdata/v1/heatmap_pb.d.ts +1 -1
- package/dist/gen/marketdata/v1/marketdata_pb.d.ts +1 -1
- package/dist/gen/marketoverview/v1/marketoverview_pb.d.ts +1 -1
- package/dist/gen/notifications/v1/notifications_pb.d.ts +1 -1
- package/dist/gen/orderbook/v1/orderbook_pb.d.ts +1 -1
- package/dist/gen/orders/v1/orders_pb.d.ts +1 -1
- package/dist/gen/orders/v1/orders_read_pb.d.ts +1 -1
- package/dist/gen/polyester/ratelimit/v1/types_pb.d.ts +1 -1
- package/dist/gen/polyester/type/v1/u128_pb.d.ts +1 -1
- package/dist/gen/privatews/v1/private_ws_pb.d.ts +1 -1
- package/dist/gen/ratelimit/v1/ratelimit_pb.d.ts +1 -1
- package/dist/gen/rewards/v1/rewards_pb.d.ts +1 -1
- package/dist/gen/swap/quickswap/v1/quickswap_broker_pb.d.ts +1 -1
- package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts +1 -1
- package/dist/gen/swap/quickswap/v1/quickswap_referral_pb.d.ts +1 -1
- package/dist/gen/swap/v1/swap_pb.d.ts +1 -1
- package/dist/gen/system/v1/system_pb.d.ts +1 -1
- package/dist/gen/tradews/v1/trade_ws_pb.d.ts +1 -1
- package/dist/gen/transfer/v1/internal_transfer_pb.d.ts +1 -1
- package/dist/gen/triggers/v1/triggers_pb.d.ts +1 -1
- package/dist/gen/vip/v1/vip_pb.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/realtime/snapshot-then-stream.js +1 -1
- package/dist/server-core.js +3 -3
- package/dist/services/accounts/accounts.js +1 -1
- package/dist/services/accounts/accounts.schemas.js +1 -1
- package/dist/services/address-book/address-book.js +1 -1
- package/dist/services/api-keys/api-keys.js +1 -1
- package/dist/services/api-keys/api-keys.schemas.js +1 -1
- package/dist/services/assistant/assistant-events.schemas.d.ts +27 -27
- package/dist/services/assistant/assistant.codecs.d.ts +1 -1
- package/dist/services/assistant/assistant.codecs.js +1 -1
- package/dist/services/assistant/assistant.codecs.js.map +1 -1
- package/dist/services/assistant/assistant.d.ts +3 -3
- package/dist/services/assistant/assistant.js +4 -4
- package/dist/services/assistant/assistant.js.map +1 -1
- package/dist/services/assistant/assistant.schemas.d.ts +1 -1
- package/dist/services/assistant/assistant.schemas.js +1 -1
- package/dist/services/auth/account-signer-auth.js +2 -2
- package/dist/services/auth/auth.js +1 -1
- package/dist/services/auth/profile/profile.js +2 -2
- package/dist/services/auto-withdraw/auto-withdraw.js +1 -1
- package/dist/services/auto-withdraw/auto-withdraw.schemas.d.ts +19 -19
- package/dist/services/auto-withdraw/auto-withdraw.schemas.js +1 -1
- package/dist/services/balances/balances.js +1 -1
- package/dist/services/candles/candles.js +2 -2
- package/dist/services/chain-analytics/chain-analytics.js +1 -1
- package/dist/services/changelog/changelog.js +1 -1
- package/dist/services/checkpoints/checkpoints.js +1 -1
- package/dist/services/claims/claims.js +1 -1
- package/dist/services/claims/claims.schemas.js +1 -1
- package/dist/services/deposit/deposit.js +1 -1
- package/dist/services/fees/fees.js +1 -1
- package/dist/services/guard-signer/guard-signer.js +1 -1
- package/dist/services/guard-signer/guard-signer.schemas.js +1 -1
- package/dist/services/heatmap/heatmap.js +2 -2
- package/dist/services/heatmap/heatmap.schemas.d.ts +4 -4
- package/dist/services/internal-transfers/internal-transfers.js +1 -1
- package/dist/services/internal-transfers/internal-transfers.schemas.d.ts +3 -3
- package/dist/services/lifecycle/lifecycle.js +3 -3
- package/dist/services/lifecycle/lifecycle.schemas.d.ts +2 -2
- package/dist/services/lifecycle/lifecycle.schemas.js +2 -2
- package/dist/services/market-data/market-data.js +2 -2
- package/dist/services/market-overview/market-overview.js +2 -2
- package/dist/services/market-overview/market-overview.schemas.js +1 -1
- package/dist/services/notifications/notifications.js +1 -1
- package/dist/services/notifications/notifications.schemas.d.ts +9 -1
- package/dist/services/notifications/notifications.schemas.d.ts.map +1 -1
- package/dist/services/orderbook/orderbook.js +1 -1
- package/dist/services/orderbook/orderbook.schemas.d.ts +1 -1
- package/dist/services/orders/order-errors.schemas.js +1 -1
- package/dist/services/orders/orders-batch.schemas.d.ts +7 -7
- package/dist/services/orders/orders-batch.schemas.js +2 -2
- package/dist/services/orders/orders-input.schemas.d.ts +1 -1
- package/dist/services/orders/orders-input.schemas.js +2 -2
- package/dist/services/orders/orders-modify.schemas.js +2 -2
- package/dist/services/orders/orders-output.schemas.d.ts +16 -16
- package/dist/services/orders/orders-output.schemas.js +1 -1
- package/dist/services/orders/orders-risk.schemas.js +3 -3
- package/dist/services/orders/orders.js +2 -2
- package/dist/services/policies/api-key-policies/api-key-policies.js +1 -1
- package/dist/services/policies/shared.codecs.js +1 -1
- package/dist/services/policies/subaccount-policies/subaccount-policies.js +2 -2
- package/dist/services/price-alerts/price-alerts.codecs.d.ts +1 -1
- package/dist/services/price-alerts/price-alerts.codecs.js +3 -3
- package/dist/services/price-alerts/price-alerts.codecs.js.map +1 -1
- package/dist/services/price-alerts/price-alerts.d.ts +2 -2
- package/dist/services/price-alerts/price-alerts.js +3 -3
- package/dist/services/price-alerts/price-alerts.js.map +1 -1
- package/dist/services/price-alerts/price-alerts.schemas.d.ts +11 -11
- package/dist/services/rate-limits/rate-limits.js +1 -1
- package/dist/services/rewards/rewards.js +1 -1
- package/dist/services/rewards/rewards.schemas.d.ts +4 -4
- package/dist/services/social-verification/social-verification.js +1 -1
- package/dist/services/social-verification/social-verification.schemas.js +1 -1
- package/dist/services/subaccounts/subaccounts.js +3 -3
- package/dist/services/subaccounts/subaccounts.schemas.d.ts +5 -5
- package/dist/services/system/system.js +1 -1
- package/dist/services/trades/trades.js +2 -2
- package/dist/services/trades/trades.schemas.d.ts +1 -1
- package/dist/services/trading-withdraws/trading-withdraws.js +1 -1
- package/dist/services/trading-withdraws/trading-withdraws.schemas.js +1 -1
- package/dist/services/trading-withdraws/wallet-message.js +1 -1
- package/dist/services/transfers/transfers.js +2 -2
- package/dist/services/triggers/trigger-child-order.schemas.js +3 -3
- package/dist/services/triggers/trigger-input.schemas.d.ts +2 -2
- package/dist/services/triggers/trigger-input.schemas.js +2 -2
- package/dist/services/triggers/triggers-output.schemas.d.ts +28 -28
- package/dist/services/triggers/triggers.js +2 -2
- package/dist/services/vip/vip.js +1 -1
- package/dist/services/vip/vip.schemas.d.ts +3 -3
- package/dist/services/vip/vip.schemas.js +1 -1
- package/dist/services/zipper/zipper.js +1 -1
- package/dist/services/zipper/zipper.schemas.js +1 -1
- package/dist/shared/error-details/alerts.js +1 -1
- package/dist/shared/error-details/assistant.js +1 -1
- package/dist/shared/error-details/auth.js +1 -1
- package/dist/shared/error-details/claims.js +1 -1
- package/dist/shared/error-details/internal-transfer.js +1 -1
- package/dist/shared/error-details/ledger.js +1 -1
- package/dist/shared/error-details/market-overview.js +1 -1
- package/dist/shared/error-details/notifications.js +1 -1
- package/dist/shared/error-details/orders.js +1 -1
- package/dist/shared/error-details/profile.js +1 -1
- package/dist/shared/error-details/rate-limit.js +1 -1
- package/dist/shared/error-details/withdraw.js +1 -1
- package/dist/shared/rate-limit.schemas.js +1 -1
- package/dist/utils/cookies.js +1 -1
- package/dist/wired-services.js +17 -17
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { isDev } from "../../utils/is-dev.js";
|
|
2
|
+
import { MarketDataService as MarketDataService$1, MarketTradeBatchSchema } from "../../gen/marketdata/v1/marketdata_pb.js";
|
|
1
3
|
import { parse } from "../../shared/validation.js";
|
|
2
4
|
import { toConnectCallOptions } from "../../shared/request-options.js";
|
|
3
5
|
import { deliverBatch } from "../../shared/subscription-errors.js";
|
|
4
6
|
import { SymbolIdInputSchema } from "../shared.js";
|
|
5
|
-
import { MarketDataService as MarketDataService$1, MarketTradeBatchSchema } from "../../gen/marketdata/v1/marketdata_pb.js";
|
|
6
7
|
import { connectReadyGatedProtoChannel } from "../../realtime/ready-gated-subscription.js";
|
|
7
|
-
import { isDev } from "../../utils/is-dev.js";
|
|
8
8
|
import { GetMarketTradesInputSchema, SpotConfigSchema, TradeBackfillSchema, formatMarketTrade } from "./market-data.schemas.js";
|
|
9
9
|
import { createClient } from "@connectrpc/connect";
|
|
10
10
|
//#region src/services/market-data/market-data.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { isDev } from "../../utils/is-dev.js";
|
|
2
|
+
import { MarketOverviewBatchSchema, MarketOverviewService as MarketOverviewService$1 } from "../../gen/marketoverview/v1/marketoverview_pb.js";
|
|
1
3
|
import { parse } from "../../shared/validation.js";
|
|
2
4
|
import { toConnectCallOptions } from "../../shared/request-options.js";
|
|
3
5
|
import { CatalogLookupError } from "../../catalogs/types.js";
|
|
4
|
-
import { isDev } from "../../utils/is-dev.js";
|
|
5
|
-
import { MarketOverviewBatchSchema, MarketOverviewService as MarketOverviewService$1 } from "../../gen/marketoverview/v1/marketoverview_pb.js";
|
|
6
6
|
import { snapshotThenStream } from "../../realtime/snapshot-then-stream.js";
|
|
7
7
|
import { CurrencyConversionConfigSchema, CurrencyConversionRatesSchema, ListMarketOverviewInputSchema, SpotVolumeHistoryInputSchema, SpotVolumeHistoryResponseSchema, createMarketOverviewSchema } from "./market-overview.schemas.js";
|
|
8
8
|
import { createClient } from "@connectrpc/connect";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import "../../gen/marketoverview/v1/marketoverview_pb.js";
|
|
1
2
|
import { tsNsToMs } from "../../utils/time.js";
|
|
2
3
|
import { enumLabelSchema } from "../../shared/proto-enum-codec.js";
|
|
3
4
|
import { scaledToDecimalOutput } from "../../shared/decimal-surface.js";
|
|
4
5
|
import { PositiveUint32InputSchema, SymbolIdInputSchema } from "../shared.js";
|
|
5
|
-
import "../../gen/marketoverview/v1/marketoverview_pb.js";
|
|
6
6
|
import { MARKET_OVERVIEW_ORDER_BY_VALUES, MARKET_OVERVIEW_SORT_VALUES, MarketOverviewOrderByCodec, MarketOverviewSortCodec, SPARKLINE_INTERVAL_VALUES, SparklineIntervalCodec } from "./market-overview.codecs.js";
|
|
7
7
|
import * as v from "valibot";
|
|
8
8
|
//#region src/services/market-overview/market-overview.schemas.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { NotificationService } from "../../gen/notifications/v1/notifications_pb.js";
|
|
1
2
|
import { InternalServerError } from "../../shared/errors.js";
|
|
2
3
|
import { parse } from "../../shared/validation.js";
|
|
3
4
|
import { removeUndefined } from "../../utils/remove-undefined.js";
|
|
4
5
|
import { toConnectCallOptions } from "../../shared/request-options.js";
|
|
5
|
-
import { NotificationService } from "../../gen/notifications/v1/notifications_pb.js";
|
|
6
6
|
import { GetNotificationInputSchema, ListNotificationsInputSchema, MarkAllNotificationsReadInputSchema, MarkNotificationsInputSchema, formatNotification, formatNotificationCounts } from "./notifications.schemas.js";
|
|
7
7
|
import { createClient } from "@connectrpc/connect";
|
|
8
8
|
//#region src/services/notifications/notifications.ts
|
|
@@ -77,17 +77,20 @@ declare function formatNotification(notification: Notification): {
|
|
|
77
77
|
/** Price that fired the alert, as a decimal string. */
|
|
78
78
|
triggeredPrice: string;
|
|
79
79
|
triggeredAt: number | null;
|
|
80
|
+
/** The approval's ID in `client.assistant`. */
|
|
80
81
|
approvalId?: undefined;
|
|
81
82
|
action?: undefined;
|
|
83
|
+
/** Trading account (subaccount) the action acted on. */
|
|
82
84
|
accountId?: undefined;
|
|
83
85
|
summary?: undefined;
|
|
86
|
+
/** Key parameters in display order, such as market, side and quantity. */
|
|
84
87
|
parameters?: undefined;
|
|
85
88
|
approvedAt?: undefined;
|
|
86
89
|
} | {
|
|
87
90
|
type: "telegram_approval";
|
|
88
91
|
/** The approval's ID in `client.assistant`. */
|
|
89
92
|
approvalId: string;
|
|
90
|
-
action: "unspecified" | "
|
|
93
|
+
action: "unspecified" | "place_order" | "place_orders" | "modify_orders" | "cancel_order" | "cancel_all_orders" | "modify_trigger" | "pause_trigger" | "resume_trigger" | "swap";
|
|
91
94
|
/** Trading account (subaccount) the action acted on. */
|
|
92
95
|
accountId: string;
|
|
93
96
|
summary: string;
|
|
@@ -102,6 +105,7 @@ declare function formatNotification(notification: Notification): {
|
|
|
102
105
|
symbolId?: undefined;
|
|
103
106
|
direction?: undefined;
|
|
104
107
|
priceSource?: undefined;
|
|
108
|
+
/** Alert price, as a decimal string. */
|
|
105
109
|
price?: undefined;
|
|
106
110
|
/** Price that fired the alert, as a decimal string. */
|
|
107
111
|
triggeredPrice?: undefined;
|
|
@@ -113,14 +117,18 @@ declare function formatNotification(notification: Notification): {
|
|
|
113
117
|
symbolId?: undefined;
|
|
114
118
|
direction?: undefined;
|
|
115
119
|
priceSource?: undefined;
|
|
120
|
+
/** Alert price, as a decimal string. */
|
|
116
121
|
price?: undefined;
|
|
117
122
|
/** Price that fired the alert, as a decimal string. */
|
|
118
123
|
triggeredPrice?: undefined;
|
|
119
124
|
triggeredAt?: undefined;
|
|
125
|
+
/** The approval's ID in `client.assistant`. */
|
|
120
126
|
approvalId?: undefined;
|
|
121
127
|
action?: undefined;
|
|
128
|
+
/** Trading account (subaccount) the action acted on. */
|
|
122
129
|
accountId?: undefined;
|
|
123
130
|
summary?: undefined;
|
|
131
|
+
/** Key parameters in display order, such as market, side and quantity. */
|
|
124
132
|
parameters?: undefined;
|
|
125
133
|
approvedAt?: undefined;
|
|
126
134
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications.schemas.d.ts","names":[],"sources":["../../../src/services/notifications/notifications.schemas.ts"],"mappings":";;;cAyCa,8BAA4B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2B7B,yBAAyB,EAAE,kBAAkB;cAE5C,4BAA0B,EAAA;;;KAI3B,uBAAuB,EAAE,kBAAkB;cAE1C,8BAA4B,EAAA;;;;KAU7B,yBAAyB,EAAE,kBAAkB;cAE5C,qCAAmC,EAAA;;;;;;;;KASpC,gCAAgC,EAAE,kBACnC;iBAoDK,mBAAmB,cAAc
|
|
1
|
+
{"version":3,"file":"notifications.schemas.d.ts","names":[],"sources":["../../../src/services/notifications/notifications.schemas.ts"],"mappings":";;;cAyCa,8BAA4B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2B7B,yBAAyB,EAAE,kBAAkB;cAE5C,4BAA0B,EAAA;;;KAI3B,uBAAuB,EAAE,kBAAkB;cAE1C,8BAA4B,EAAA;;;;KAU7B,yBAAyB,EAAE,kBAAkB;cAE5C,qCAAmC,EAAA;;;;;;;;KASpC,gCAAgC,EAAE,kBACnC;iBAoDK,mBAAmB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoBrC,sBAAsB,kBAAkB;KAExC,4BAA4B;;KAG5B;EACR,eAAe;EACf;;iBAGY,yBAAyB,QAAQ;;;;;;;;;;;;KAerC,qBAAqB,kBAAkB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { GetOrderBookResponseSchema, OrderBookDeltaSchema, OrderbookService as OrderbookService$1 } from "../../gen/orderbook/v1/orderbook_pb.js";
|
|
1
2
|
import { ServiceUnavailableError } from "../../shared/errors.js";
|
|
2
3
|
import { parse } from "../../shared/validation.js";
|
|
3
4
|
import { toConnectCallOptions } from "../../shared/request-options.js";
|
|
@@ -5,7 +6,6 @@ import { decimalInputToScaled } from "../../shared/decimal-surface.js";
|
|
|
5
6
|
import { publicationHandlerErrorContext } from "../../shared/subscription-errors.js";
|
|
6
7
|
import { isResourceNotFoundError } from "../../utils/errors.js";
|
|
7
8
|
import { snapshotThenStream } from "../../realtime/snapshot-then-stream.js";
|
|
8
|
-
import { GetOrderBookResponseSchema, OrderBookDeltaSchema, OrderbookService as OrderbookService$1 } from "../../gen/orderbook/v1/orderbook_pb.js";
|
|
9
9
|
import { orderbookWsChannelDepth } from "./orderbook.codecs.js";
|
|
10
10
|
import { GetOrderbookInputSchema, createOrderbookDataSchema, formatOrderbookLevel } from "./orderbook.schemas.js";
|
|
11
11
|
import { create } from "@bufbuild/protobuf";
|
|
@@ -10,7 +10,7 @@ declare const GetOrderbookInputSchema: v.SchemaWithPipe<readonly [v.ObjectSchema
|
|
|
10
10
|
depth: number;
|
|
11
11
|
}, {
|
|
12
12
|
symbolId: number;
|
|
13
|
-
depth: 1 |
|
|
13
|
+
depth: 1 | 10 | 5 | 20 | 100 | 200 | 500 | 1000 | 50;
|
|
14
14
|
protoDepth: Depth;
|
|
15
15
|
}>]>;
|
|
16
16
|
type GetOrderbookInput = v.InferInput<typeof GetOrderbookInputSchema>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OptionalPublicIdSchema } from "../../shared/schemas.js";
|
|
2
1
|
import { ErrorCode } from "../../gen/orders/v1/orders_pb.js";
|
|
2
|
+
import { OptionalPublicIdSchema } from "../../shared/schemas.js";
|
|
3
3
|
import { RateLimitDetailSchema } from "../../shared/rate-limit.schemas.js";
|
|
4
4
|
import * as v from "valibot";
|
|
5
5
|
//#region src/services/orders/order-errors.schemas.ts
|
|
@@ -6029,7 +6029,7 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
|
|
|
6029
6029
|
readonly oldOrderId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BigintSchema<undefined>, undefined>, v.TransformAction<bigint | undefined, string | undefined>]>;
|
|
6030
6030
|
readonly replacementOrderId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BigintSchema<undefined>, undefined>, v.TransformAction<bigint | undefined, string | undefined>]>;
|
|
6031
6031
|
readonly actionTaken: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "replaced" | "amended">]>;
|
|
6032
|
-
readonly orderStatus: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
6032
|
+
readonly orderStatus: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "pending" | "canceled" | "rejected" | "pending_cancel" | "working" | "filled">]>;
|
|
6033
6033
|
readonly code: v.StringSchema<undefined>;
|
|
6034
6034
|
readonly updatedTsNs: v.BigintSchema<undefined>;
|
|
6035
6035
|
}, undefined>, v.TransformAction<{
|
|
@@ -6038,7 +6038,7 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
|
|
|
6038
6038
|
oldOrderId?: string | undefined;
|
|
6039
6039
|
replacementOrderId?: string | undefined;
|
|
6040
6040
|
actionTaken: "unspecified" | "replaced" | "amended";
|
|
6041
|
-
orderStatus: "unspecified" | "
|
|
6041
|
+
orderStatus: "unspecified" | "pending" | "canceled" | "rejected" | "pending_cancel" | "working" | "filled";
|
|
6042
6042
|
code: string;
|
|
6043
6043
|
updatedTsNs: bigint;
|
|
6044
6044
|
}, {
|
|
@@ -6050,7 +6050,7 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
|
|
|
6050
6050
|
oldOrderId?: string | undefined;
|
|
6051
6051
|
replacementOrderId?: string | undefined;
|
|
6052
6052
|
actionTaken: "unspecified" | "replaced" | "amended";
|
|
6053
|
-
orderStatus: "unspecified" | "
|
|
6053
|
+
orderStatus: "unspecified" | "pending" | "canceled" | "rejected" | "pending_cancel" | "working" | "filled";
|
|
6054
6054
|
}>]>, undefined>;
|
|
6055
6055
|
readonly acceptedCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
6056
6056
|
readonly rejectedCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
@@ -6068,7 +6068,7 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
|
|
|
6068
6068
|
oldOrderId?: string | undefined;
|
|
6069
6069
|
replacementOrderId?: string | undefined;
|
|
6070
6070
|
actionTaken: "unspecified" | "replaced" | "amended";
|
|
6071
|
-
orderStatus: "unspecified" | "
|
|
6071
|
+
orderStatus: "unspecified" | "pending" | "canceled" | "rejected" | "pending_cancel" | "working" | "filled";
|
|
6072
6072
|
}[];
|
|
6073
6073
|
acceptedCount: number;
|
|
6074
6074
|
rejectedCount: number;
|
|
@@ -6086,7 +6086,7 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
|
|
|
6086
6086
|
oldOrderId?: string | undefined;
|
|
6087
6087
|
replacementOrderId?: string | undefined;
|
|
6088
6088
|
actionTaken: "unspecified" | "replaced" | "amended";
|
|
6089
|
-
orderStatus: "unspecified" | "
|
|
6089
|
+
orderStatus: "unspecified" | "pending" | "canceled" | "rejected" | "pending_cancel" | "working" | "filled";
|
|
6090
6090
|
}[];
|
|
6091
6091
|
acceptedCount: number;
|
|
6092
6092
|
rejectedCount: number;
|
|
@@ -6104,7 +6104,7 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
|
|
|
6104
6104
|
oldOrderId?: string | undefined;
|
|
6105
6105
|
replacementOrderId?: string | undefined;
|
|
6106
6106
|
actionTaken: "unspecified" | "replaced" | "amended";
|
|
6107
|
-
orderStatus: "unspecified" | "
|
|
6107
|
+
orderStatus: "unspecified" | "pending" | "canceled" | "rejected" | "pending_cancel" | "working" | "filled";
|
|
6108
6108
|
}[];
|
|
6109
6109
|
acceptedCount: number;
|
|
6110
6110
|
rejectedCount: number;
|
|
@@ -6126,7 +6126,7 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
|
|
|
6126
6126
|
oldOrderId?: string | undefined;
|
|
6127
6127
|
replacementOrderId?: string | undefined;
|
|
6128
6128
|
actionTaken: "unspecified" | "replaced" | "amended";
|
|
6129
|
-
orderStatus: "unspecified" | "
|
|
6129
|
+
orderStatus: "unspecified" | "pending" | "canceled" | "rejected" | "pending_cancel" | "working" | "filled";
|
|
6130
6130
|
}[];
|
|
6131
6131
|
acceptedCount: number;
|
|
6132
6132
|
rejectedCount: number;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RiskPolicySchema } from "../../gen/orders/v1/orders_pb.js";
|
|
1
2
|
import { formatId } from "../../utils/base58-id.js";
|
|
2
3
|
import { tsNsToMs } from "../../utils/time.js";
|
|
3
4
|
import { OptionalPublicIdSchema, PublicIdSchema, idInputSchema } from "../../shared/schemas.js";
|
|
@@ -5,15 +6,14 @@ import { enumLabelSchema } from "../../shared/proto-enum-codec.js";
|
|
|
5
6
|
import { positiveDecimalInputToScaled, scaledToDecimalOutput } from "../../shared/decimal-surface.js";
|
|
6
7
|
import { SideSchema, SymbolIdInputSchema } from "../shared.js";
|
|
7
8
|
import { AccountScopeInputEntries, accountScopeToSubaccountId } from "../../shared/account-scope.js";
|
|
8
|
-
import { RiskPolicySchema } from "../../gen/orders/v1/orders_pb.js";
|
|
9
9
|
import { OrderSideCodec } from "./order-enums.codecs.js";
|
|
10
10
|
import { BatchCancelOrderStatusCodec, BatchReplaceAdmissionStatusCodec, BatchReplaceItemAdmissionStatusCodec, BatchReplacePhaseCodec, CancelAllAfterStatusCodec, ModifyActionCodec, OrderStatusCodec } from "./orders.codecs.js";
|
|
11
11
|
import { ClientOrderIdInputSchema, OrderRequestIdInputSchema, positiveOrderIdInputSchema } from "./orders-identifiers.schemas.js";
|
|
12
12
|
import { OrderErrorDetailSchema } from "./order-errors.schemas.js";
|
|
13
13
|
import { createOrderIntentInputSchema } from "./orders-input.schemas.js";
|
|
14
14
|
import { createModifyOrderPatchInputSchema } from "./orders-modify.schemas.js";
|
|
15
|
-
import { create } from "@bufbuild/protobuf";
|
|
16
15
|
import * as v from "valibot";
|
|
16
|
+
import { create } from "@bufbuild/protobuf";
|
|
17
17
|
//#region src/services/orders/orders-batch.schemas.ts
|
|
18
18
|
const BatchCountSchema = v.pipe(v.number(), v.integer(), v.minValue(0));
|
|
19
19
|
const BatchItemIndexSchema = v.pipe(v.number(), v.integer(), v.minValue(0));
|
|
@@ -39,7 +39,7 @@ type OpenOrdersInput = v.InferInput<typeof OpenOrdersInputSchema>;
|
|
|
39
39
|
declare const OrderHistoryInputSchema: v.SchemaWithPipe<readonly [v.StrictObjectSchema<{
|
|
40
40
|
readonly includeAttachedRisk: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
41
41
|
readonly includeAttachedRiskState: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
42
|
-
readonly status: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["filled", "canceled", "rejected"], undefined>, undefined>, v.TransformAction<"
|
|
42
|
+
readonly status: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["filled", "canceled", "rejected"], undefined>, undefined>, v.TransformAction<"canceled" | "rejected" | "filled" | undefined, OrderStatus.FILLED | OrderStatus.CANCELED | OrderStatus.REJECTED | undefined>]>;
|
|
43
43
|
readonly startTsNs: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, bigint | undefined>]>;
|
|
44
44
|
readonly endTsNs: v.SchemaWithPipe<readonly [v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, undefined>, v.TransformAction<string | undefined, bigint | undefined>]>;
|
|
45
45
|
readonly symbolId: v.OptionalSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>, undefined>, undefined>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LimitFokSchema, LimitGtcSchema, LimitGtdSchema, LimitIocSchema, MarketIocSchema, StaticPegSchema } from "../../gen/orders/v1/orders_pb.js";
|
|
1
2
|
import { PROTOBUF_INT64_MAX } from "../../shared/wire-bounds.js";
|
|
2
3
|
import { tsNsToMs } from "../../utils/time.js";
|
|
3
4
|
import { OptionalPublicIdSchema, OptionalTimestampMsSchema, PublicIdSchema, TimestampMsSchema, optionalIdInputSchema, optionalUint64DecimalFilterSchema } from "../../shared/schemas.js";
|
|
@@ -7,15 +8,14 @@ import { positiveDecimalInputToScaled, scaledToDecimalOutput } from "../../share
|
|
|
7
8
|
import { SideSchema, SymbolIdInputSchema } from "../shared.js";
|
|
8
9
|
import { AccountScopeInputEntries, accountScopeToSubaccountId } from "../../shared/account-scope.js";
|
|
9
10
|
import { msToTimestamp } from "../../utils/timestamp.js";
|
|
10
|
-
import { LimitFokSchema, LimitGtcSchema, LimitGtdSchema, LimitIocSchema, MarketIocSchema, StaticPegSchema } from "../../gen/orders/v1/orders_pb.js";
|
|
11
11
|
import { FEE_ASSET_VALUES, FeeAssetCodec, OrderSideCodec, PEG_REFERENCE_VALUES, PegReferenceCodec, SELF_TRADE_PREVENTION_MODE_VALUES, SelfTradePreventionModeCodec } from "./order-enums.codecs.js";
|
|
12
12
|
import { CancelAllListingStatusCodec, CancelAllOrdersStatusCodec, CancelOrderStatusCodec, ORDER_STATUS_FILTER_VALUES, OrderStatusFilterCodec } from "./orders.codecs.js";
|
|
13
13
|
import { ClientOrderIdInputSchema, OptionalClientOrderIdInputSchema, OrderIdInputSchema, OrderRequestIdInputSchema } from "./orders-identifiers.schemas.js";
|
|
14
14
|
import { MAX_SELLING_SLIPPAGE_BPS } from "../trailing-oneof-inputs.js";
|
|
15
15
|
import { ATTACHED_TRAILING_LIMIT_SIDE_MESSAGE, MarketMaxSlippageSchema, attachedTrailingLimitMatchesSide, createRiskPolicyInputSchema, parseMarketMaxSlippage } from "./orders-risk.schemas.js";
|
|
16
16
|
import { OrderErrorDetailSchema } from "./order-errors.schemas.js";
|
|
17
|
-
import { create } from "@bufbuild/protobuf";
|
|
18
17
|
import * as v from "valibot";
|
|
18
|
+
import { create } from "@bufbuild/protobuf";
|
|
19
19
|
//#region src/services/orders/orders-input.schemas.ts
|
|
20
20
|
const OrderStatusSchema = v.picklist(ORDER_STATUS_FILTER_VALUES);
|
|
21
21
|
const FeeAssetSchema = v.picklist(FEE_ASSET_VALUES);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import { RiskPolicySchema } from "../../gen/orders/v1/orders_pb.js";
|
|
1
2
|
import { PROTOBUF_UINT32_MAX } from "../../shared/wire-bounds.js";
|
|
2
3
|
import { tsNsToMs } from "../../utils/time.js";
|
|
3
4
|
import { OptionalPublicIdSchema, PublicIdSchema } from "../../shared/schemas.js";
|
|
4
5
|
import { enumLabelSchema } from "../../shared/proto-enum-codec.js";
|
|
5
6
|
import { positiveDecimalInputToScaled } from "../../shared/decimal-surface.js";
|
|
6
7
|
import { AccountScopeInputEntries, accountScopeToSubaccountId } from "../../shared/account-scope.js";
|
|
7
|
-
import { RiskPolicySchema } from "../../gen/orders/v1/orders_pb.js";
|
|
8
8
|
import { MODIFY_BEHAVIOR_VALUES, ModifyActionCodec, ModifyBehaviorCodec } from "./orders.codecs.js";
|
|
9
9
|
import { ClientOrderIdInputSchema, OrderIdInputSchema, OrderRequestIdInputSchema } from "./orders-identifiers.schemas.js";
|
|
10
10
|
import { createRequiredRiskPolicyInputSchema } from "./orders-risk.schemas.js";
|
|
11
|
-
import { create } from "@bufbuild/protobuf";
|
|
12
11
|
import * as v from "valibot";
|
|
12
|
+
import { create } from "@bufbuild/protobuf";
|
|
13
13
|
//#region src/services/orders/orders-modify.schemas.ts
|
|
14
14
|
const ModifyBehaviorInputSchema = v.picklist(MODIFY_BEHAVIOR_VALUES);
|
|
15
15
|
const DecimalInputStringSchema = v.pipe(v.string(), v.trim(), v.minLength(1));
|
|
@@ -12,7 +12,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
12
12
|
readonly symbolId: v.NumberSchema<undefined>;
|
|
13
13
|
readonly clientOrderId: v.StringSchema<undefined>;
|
|
14
14
|
readonly side: v.NumberSchema<undefined>;
|
|
15
|
-
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
15
|
+
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "pending" | "canceled" | "rejected" | "pending_cancel" | "working" | "filled">]>;
|
|
16
16
|
readonly orderType: v.NumberSchema<undefined>;
|
|
17
17
|
readonly timeInForce: v.NumberSchema<undefined>;
|
|
18
18
|
readonly selfTradePreventionMode: v.NumberSchema<undefined>;
|
|
@@ -149,7 +149,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
149
149
|
symbolId: number;
|
|
150
150
|
clientOrderId: string;
|
|
151
151
|
side: number;
|
|
152
|
-
status: "unspecified" | "
|
|
152
|
+
status: "unspecified" | "pending" | "canceled" | "rejected" | "pending_cancel" | "working" | "filled";
|
|
153
153
|
orderType: number;
|
|
154
154
|
timeInForce: number;
|
|
155
155
|
selfTradePreventionMode: number;
|
|
@@ -235,11 +235,11 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
235
235
|
trailingStop?: {
|
|
236
236
|
policy?: {
|
|
237
237
|
trailingDistance: {
|
|
238
|
-
case?: "
|
|
238
|
+
case?: "trailingDistanceTicks" | "trailingDistanceBps" | undefined;
|
|
239
239
|
value?: number | bigint | undefined;
|
|
240
240
|
};
|
|
241
241
|
maxSlippage: {
|
|
242
|
-
case: "
|
|
242
|
+
case: "maxSlippageTicks" | "maxSlippageBps" | undefined;
|
|
243
243
|
value?: number | bigint | undefined;
|
|
244
244
|
};
|
|
245
245
|
activationPriceTicks: bigint;
|
|
@@ -289,7 +289,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
289
289
|
attachedRisk: {
|
|
290
290
|
takeProfit: {
|
|
291
291
|
state: {
|
|
292
|
-
status: "unspecified" | "
|
|
292
|
+
status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "armed" | "not_configured" | "created" | "running";
|
|
293
293
|
armedTs: number | undefined;
|
|
294
294
|
armedTsNs: string | undefined;
|
|
295
295
|
terminalTs: number | undefined;
|
|
@@ -309,7 +309,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
309
309
|
} | undefined;
|
|
310
310
|
stopLoss: {
|
|
311
311
|
state: {
|
|
312
|
-
status: "unspecified" | "
|
|
312
|
+
status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "armed" | "not_configured" | "created" | "running";
|
|
313
313
|
armedTs: number | undefined;
|
|
314
314
|
armedTsNs: string | undefined;
|
|
315
315
|
terminalTs: number | undefined;
|
|
@@ -329,7 +329,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
329
329
|
} | undefined;
|
|
330
330
|
trailingStop: {
|
|
331
331
|
state: {
|
|
332
|
-
status: "unspecified" | "
|
|
332
|
+
status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "armed" | "not_configured" | "created" | "running";
|
|
333
333
|
armedTs: number | undefined;
|
|
334
334
|
armedTsNs: string | undefined;
|
|
335
335
|
terminalTs: number | undefined;
|
|
@@ -375,7 +375,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
375
375
|
hiddenQty?: string | undefined;
|
|
376
376
|
symbolId: number;
|
|
377
377
|
clientOrderId: string;
|
|
378
|
-
status: "unspecified" | "
|
|
378
|
+
status: "unspecified" | "pending" | "canceled" | "rejected" | "pending_cancel" | "working" | "filled" | "partial";
|
|
379
379
|
side: "unspecified" | "buy" | "sell";
|
|
380
380
|
orderType: "unspecified" | "limit" | "market";
|
|
381
381
|
timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
|
|
@@ -442,7 +442,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
442
442
|
readonly symbolId: v.NumberSchema<undefined>;
|
|
443
443
|
readonly clientOrderId: v.StringSchema<undefined>;
|
|
444
444
|
readonly side: v.NumberSchema<undefined>;
|
|
445
|
-
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
445
|
+
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "pending" | "canceled" | "rejected" | "pending_cancel" | "working" | "filled">]>;
|
|
446
446
|
readonly orderType: v.NumberSchema<undefined>;
|
|
447
447
|
readonly timeInForce: v.NumberSchema<undefined>;
|
|
448
448
|
readonly selfTradePreventionMode: v.NumberSchema<undefined>;
|
|
@@ -579,7 +579,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
579
579
|
symbolId: number;
|
|
580
580
|
clientOrderId: string;
|
|
581
581
|
side: number;
|
|
582
|
-
status: "unspecified" | "
|
|
582
|
+
status: "unspecified" | "pending" | "canceled" | "rejected" | "pending_cancel" | "working" | "filled";
|
|
583
583
|
orderType: number;
|
|
584
584
|
timeInForce: number;
|
|
585
585
|
selfTradePreventionMode: number;
|
|
@@ -665,11 +665,11 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
665
665
|
trailingStop?: {
|
|
666
666
|
policy?: {
|
|
667
667
|
trailingDistance: {
|
|
668
|
-
case?: "
|
|
668
|
+
case?: "trailingDistanceTicks" | "trailingDistanceBps" | undefined;
|
|
669
669
|
value?: number | bigint | undefined;
|
|
670
670
|
};
|
|
671
671
|
maxSlippage: {
|
|
672
|
-
case: "
|
|
672
|
+
case: "maxSlippageTicks" | "maxSlippageBps" | undefined;
|
|
673
673
|
value?: number | bigint | undefined;
|
|
674
674
|
};
|
|
675
675
|
activationPriceTicks: bigint;
|
|
@@ -719,7 +719,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
719
719
|
attachedRisk: {
|
|
720
720
|
takeProfit: {
|
|
721
721
|
state: {
|
|
722
|
-
status: "unspecified" | "
|
|
722
|
+
status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "armed" | "not_configured" | "created" | "running";
|
|
723
723
|
armedTs: number | undefined;
|
|
724
724
|
armedTsNs: string | undefined;
|
|
725
725
|
terminalTs: number | undefined;
|
|
@@ -739,7 +739,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
739
739
|
} | undefined;
|
|
740
740
|
stopLoss: {
|
|
741
741
|
state: {
|
|
742
|
-
status: "unspecified" | "
|
|
742
|
+
status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "armed" | "not_configured" | "created" | "running";
|
|
743
743
|
armedTs: number | undefined;
|
|
744
744
|
armedTsNs: string | undefined;
|
|
745
745
|
terminalTs: number | undefined;
|
|
@@ -759,7 +759,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
759
759
|
} | undefined;
|
|
760
760
|
trailingStop: {
|
|
761
761
|
state: {
|
|
762
|
-
status: "unspecified" | "
|
|
762
|
+
status: "unspecified" | "completed" | "failed" | "paused" | "canceled" | "armed" | "not_configured" | "created" | "running";
|
|
763
763
|
armedTs: number | undefined;
|
|
764
764
|
armedTsNs: string | undefined;
|
|
765
765
|
terminalTs: number | undefined;
|
|
@@ -805,7 +805,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
805
805
|
hiddenQty?: string | undefined;
|
|
806
806
|
symbolId: number;
|
|
807
807
|
clientOrderId: string;
|
|
808
|
-
status: "unspecified" | "
|
|
808
|
+
status: "unspecified" | "pending" | "canceled" | "rejected" | "pending_cancel" | "working" | "filled" | "partial";
|
|
809
809
|
side: "unspecified" | "buy" | "sell";
|
|
810
810
|
orderType: "unspecified" | "limit" | "market";
|
|
811
811
|
timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { ErrorCode } from "../../gen/orders/v1/orders_pb.js";
|
|
1
2
|
import { parse } from "../../shared/validation.js";
|
|
2
3
|
import { formatId } from "../../utils/base58-id.js";
|
|
3
4
|
import { tsNsToMs, tsObjToMs } from "../../utils/time.js";
|
|
4
5
|
import { OptionalPublicIdSchema, OptionalTimestampMsSchema, U128Schema } from "../../shared/schemas.js";
|
|
5
6
|
import { enumLabel, enumLabelSchema } from "../../shared/proto-enum-codec.js";
|
|
6
7
|
import { scaledToDecimalOutput } from "../../shared/decimal-surface.js";
|
|
7
|
-
import { ErrorCode } from "../../gen/orders/v1/orders_pb.js";
|
|
8
8
|
import { fromU128 } from "../../utils/u128.js";
|
|
9
9
|
import { AccountCodeCodec, TransferCodeCodec } from "../../shared/ledger-codes.js";
|
|
10
10
|
import { FeeAssetCodec, OrderSideCodec, OrderTypeCodec, SelfTradePreventionModeCodec, TimeInForceCodec } from "./order-enums.codecs.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
+
import { RiskLimitGtcSchema, RiskMarketIocSchema } from "../../gen/orders/v1/orders_pb.js";
|
|
2
|
+
import "../../gen/orders/v1/orders_read_pb.js";
|
|
1
3
|
import { formatId } from "../../utils/base58-id.js";
|
|
2
4
|
import { tsNsToMs } from "../../utils/time.js";
|
|
3
5
|
import { enumLabel } from "../../shared/proto-enum-codec.js";
|
|
4
6
|
import { CatalogConversionError } from "../../catalogs/types.js";
|
|
5
7
|
import { positiveDecimalInputToScaled, scaledToDecimalOutput } from "../../shared/decimal-surface.js";
|
|
6
8
|
import { BpsStringOrNumberInputSchema, NoneInputSchema, PriceDistanceInputSchema, PriceSlippageInputSchema } from "../shared.js";
|
|
7
|
-
import { RiskLimitGtcSchema, RiskMarketIocSchema } from "../../gen/orders/v1/orders_pb.js";
|
|
8
|
-
import "../../gen/orders/v1/orders_read_pb.js";
|
|
9
9
|
import { TriggerPriceSourceCodec, TriggerPriceSourceInputSchema } from "./order-enums.codecs.js";
|
|
10
10
|
import { AttachedRiskLegStatusCodec } from "./orders.codecs.js";
|
|
11
11
|
import { MAX_SELLING_SLIPPAGE_BPS, MAX_SLIPPAGE_BPS, parseSlippageInput, parseTrailingDistanceInput } from "../trailing-oneof-inputs.js";
|
|
12
|
-
import { create } from "@bufbuild/protobuf";
|
|
13
12
|
import * as v from "valibot";
|
|
13
|
+
import { create } from "@bufbuild/protobuf";
|
|
14
14
|
//#region src/services/orders/orders-risk.schemas.ts
|
|
15
15
|
const DecimalInputStringSchema = v.pipe(v.string(), v.trim(), v.minLength(1));
|
|
16
16
|
function attachedTriggerInputSchema(scales, fieldPrefix) {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { OrdersService as OrdersService$1 } from "../../gen/orders/v1/orders_pb.js";
|
|
2
|
+
import { OrdersReadService } from "../../gen/orders/v1/orders_read_pb.js";
|
|
1
3
|
import { PolyesterError } from "../../shared/errors.js";
|
|
2
4
|
import { loadErrorDetailDecoders } from "../../shared/error-detail.js";
|
|
3
5
|
import { toPolyesterError } from "../../shared/connect-error-mapping.js";
|
|
@@ -7,8 +9,6 @@ import { toConnectCallOptions } from "../../shared/request-options.js";
|
|
|
7
9
|
import { formatId, idToBigInt } from "../../utils/base58-id.js";
|
|
8
10
|
import { deliverBatch } from "../../shared/subscription-errors.js";
|
|
9
11
|
import { resolveAccountScopedInput } from "../subaccount-resolver.js";
|
|
10
|
-
import { OrdersService as OrdersService$1 } from "../../gen/orders/v1/orders_pb.js";
|
|
11
|
-
import { OrdersReadService } from "../../gen/orders/v1/orders_read_pb.js";
|
|
12
12
|
import { createOrderDetailsSchema, formatOrder } from "./orders-output.schemas.js";
|
|
13
13
|
import { connectReadyGated } from "../../realtime/ready-gated-subscription.js";
|
|
14
14
|
import { formatConnectError, isResourceNotFoundError } from "../../utils/errors.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { PolicyService } from "../../../gen/auth/v1/policies_pb.js";
|
|
1
2
|
import { parse } from "../../../shared/validation.js";
|
|
2
3
|
import { removeUndefined } from "../../../utils/remove-undefined.js";
|
|
3
4
|
import { toConnectCallOptions } from "../../../shared/request-options.js";
|
|
4
|
-
import { PolicyService } from "../../../gen/auth/v1/policies_pb.js";
|
|
5
5
|
import { PolicyIdSchema } from "../shared.js";
|
|
6
6
|
import { ApiKeyPolicySchema, ApplyApiKeyPolicyInputSchema, CreateApiKeyPolicyInputSchema, DEFAULT_API_KEY_POLICY, GetApiKeyPolicyInputSchema, ListApiKeyPoliciesInputSchema, ListApiKeyPoliciesResponseSchema, UpdateApiKeyPolicyInputSchema } from "./api-key-policies.schemas.js";
|
|
7
7
|
import { createClient } from "@connectrpc/connect";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { enumLabel } from "../../shared/proto-enum-codec.js";
|
|
2
1
|
import "../../gen/auth/v1/policies_pb.js";
|
|
2
|
+
import { enumLabel } from "../../shared/proto-enum-codec.js";
|
|
3
3
|
//#region src/services/policies/shared.codecs.ts
|
|
4
4
|
/** Product actions, accepted by sub-account and API-key policies. */
|
|
5
5
|
const PRODUCT_POLICY_ACTION_LABELS = [
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import { PolicyService, SubaccountPolicyViewSchema } from "../../../gen/auth/v1/policies_pb.js";
|
|
1
2
|
import { parse } from "../../../shared/validation.js";
|
|
2
3
|
import { removeUndefined } from "../../../utils/remove-undefined.js";
|
|
3
4
|
import { toConnectCallOptions } from "../../../shared/request-options.js";
|
|
4
|
-
import { PolicyService, SubaccountPolicyViewSchema } from "../../../gen/auth/v1/policies_pb.js";
|
|
5
5
|
import { resolveAccountScopedInput } from "../../subaccount-resolver.js";
|
|
6
6
|
import { ApplySubaccountPolicyInputSchema, CreateSubaccountPolicyInputSchema, GetSubaccountPolicyInputSchema, ListSubaccountPoliciesInputSchema, PolicyIdSchema, SubaccountPolicySchema, UpdateSubaccountPolicyInputSchema } from "./subaccount-policies.schemas.js";
|
|
7
|
-
import { createClient } from "@connectrpc/connect";
|
|
8
7
|
import * as v from "valibot";
|
|
8
|
+
import { createClient } from "@connectrpc/connect";
|
|
9
9
|
//#region src/services/policies/subaccount-policies/subaccount-policies.ts
|
|
10
10
|
/**
|
|
11
11
|
* Manages reusable subaccount policy templates, assignments, and realtime policy updates.
|
|
@@ -5,7 +5,7 @@ declare const PRICE_ALERT_DIRECTION_VALUES: readonly ["above", "below"];
|
|
|
5
5
|
type PriceAlertDirection = (typeof PRICE_ALERT_DIRECTION_VALUES)[number];
|
|
6
6
|
declare const PRICE_ALERT_PRICE_SOURCE_VALUES: readonly ["last_price", "index_price"];
|
|
7
7
|
type PriceAlertPriceSource = (typeof PRICE_ALERT_PRICE_SOURCE_VALUES)[number];
|
|
8
|
-
declare const PRICE_ALERT_STATUS_VALUES: readonly ["active", "triggered", "
|
|
8
|
+
declare const PRICE_ALERT_STATUS_VALUES: readonly ["active", "triggered", "canceled"];
|
|
9
9
|
type PriceAlertStatus = (typeof PRICE_ALERT_STATUS_VALUES)[number];
|
|
10
10
|
declare const PRICE_ALERT_CHANNEL_VALUES: readonly ["in_app", "telegram"];
|
|
11
11
|
type PriceAlertChannel = (typeof PRICE_ALERT_CHANNEL_VALUES)[number];
|
|
@@ -5,7 +5,7 @@ const PRICE_ALERT_PRICE_SOURCE_VALUES = ["last_price", "index_price"];
|
|
|
5
5
|
const PRICE_ALERT_STATUS_VALUES = [
|
|
6
6
|
"active",
|
|
7
7
|
"triggered",
|
|
8
|
-
"
|
|
8
|
+
"canceled"
|
|
9
9
|
];
|
|
10
10
|
const PRICE_ALERT_CHANNEL_VALUES = ["in_app", "telegram"];
|
|
11
11
|
const PriceAlertDirectionCodec = {
|
|
@@ -34,13 +34,13 @@ const PriceAlertStatusCodec = {
|
|
|
34
34
|
inputToProto: {
|
|
35
35
|
active: 1,
|
|
36
36
|
triggered: 2,
|
|
37
|
-
|
|
37
|
+
canceled: 3
|
|
38
38
|
},
|
|
39
39
|
protoToOutput: {
|
|
40
40
|
[0]: "unspecified",
|
|
41
41
|
[1]: "active",
|
|
42
42
|
[2]: "triggered",
|
|
43
|
-
[3]: "
|
|
43
|
+
[3]: "canceled"
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
const PriceAlertChannelCodec = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"price-alerts.codecs.js","names":[],"sources":["../../../src/services/price-alerts/price-alerts.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/alerts/v1/price_alerts_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const PRICE_ALERT_DIRECTION_VALUES = [\"above\", \"below\"] as const;\n/** `above` fires at or above the alert price, `below` at or below it. */\nexport type PriceAlertDirection = (typeof PRICE_ALERT_DIRECTION_VALUES)[number];\n\nexport const PRICE_ALERT_PRICE_SOURCE_VALUES = [\"last_price\", \"index_price\"] as const;\nexport type PriceAlertPriceSource = (typeof PRICE_ALERT_PRICE_SOURCE_VALUES)[number];\n\nexport const PRICE_ALERT_STATUS_VALUES = [\"active\", \"triggered\", \"
|
|
1
|
+
{"version":3,"file":"price-alerts.codecs.js","names":[],"sources":["../../../src/services/price-alerts/price-alerts.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/alerts/v1/price_alerts_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const PRICE_ALERT_DIRECTION_VALUES = [\"above\", \"below\"] as const;\n/** `above` fires at or above the alert price, `below` at or below it. */\nexport type PriceAlertDirection = (typeof PRICE_ALERT_DIRECTION_VALUES)[number];\n\nexport const PRICE_ALERT_PRICE_SOURCE_VALUES = [\"last_price\", \"index_price\"] as const;\nexport type PriceAlertPriceSource = (typeof PRICE_ALERT_PRICE_SOURCE_VALUES)[number];\n\nexport const PRICE_ALERT_STATUS_VALUES = [\"active\", \"triggered\", \"canceled\"] as const;\nexport type PriceAlertStatus = (typeof PRICE_ALERT_STATUS_VALUES)[number];\n\nexport const PRICE_ALERT_CHANNEL_VALUES = [\"in_app\", \"telegram\"] as const;\nexport type PriceAlertChannel = (typeof PRICE_ALERT_CHANNEL_VALUES)[number];\n\nexport const PRICE_ALERT_UPDATE_OUTCOME_VALUES = [\"applied\", \"unchanged\", \"replayed\"] as const;\n/**\n * What an update did: `applied` changed the alert, `unchanged` found it already as requested,\n * and `replayed` recognized a reused idempotency key and changed nothing.\n */\nexport type PriceAlertUpdateOutcome = (typeof PRICE_ALERT_UPDATE_OUTCOME_VALUES)[number];\n\nexport const PriceAlertDirectionCodec = {\n inputToProto: {\n above: Proto.AlertDirection.ABOVE,\n below: Proto.AlertDirection.BELOW,\n } satisfies InputToProto<PriceAlertDirection, Proto.AlertDirection>,\n protoToOutput: {\n [Proto.AlertDirection.DIRECTION_UNSPECIFIED]: \"unspecified\",\n [Proto.AlertDirection.ABOVE]: \"above\",\n [Proto.AlertDirection.BELOW]: \"below\",\n } satisfies ProtoToOutput<Proto.AlertDirection, PriceAlertDirection>,\n} as const;\n\nexport const PriceAlertPriceSourceCodec = {\n inputToProto: {\n last_price: Proto.AlertPriceSource.LAST_PRICE,\n index_price: Proto.AlertPriceSource.INDEX_PRICE,\n } satisfies InputToProto<PriceAlertPriceSource, Proto.AlertPriceSource>,\n protoToOutput: {\n [Proto.AlertPriceSource.PRICE_SOURCE_UNSPECIFIED]: \"unspecified\",\n [Proto.AlertPriceSource.LAST_PRICE]: \"last_price\",\n [Proto.AlertPriceSource.INDEX_PRICE]: \"index_price\",\n } satisfies ProtoToOutput<Proto.AlertPriceSource, PriceAlertPriceSource>,\n} as const;\n\nexport const PriceAlertStatusCodec = {\n inputToProto: {\n active: Proto.AlertStatus.ACTIVE,\n triggered: Proto.AlertStatus.TRIGGERED,\n canceled: Proto.AlertStatus.CANCELLED,\n } satisfies InputToProto<PriceAlertStatus, Proto.AlertStatus>,\n protoToOutput: {\n [Proto.AlertStatus.STATUS_UNSPECIFIED]: \"unspecified\",\n [Proto.AlertStatus.ACTIVE]: \"active\",\n [Proto.AlertStatus.TRIGGERED]: \"triggered\",\n [Proto.AlertStatus.CANCELLED]: \"canceled\",\n } satisfies ProtoToOutput<Proto.AlertStatus, PriceAlertStatus>,\n} as const;\n\nexport const PriceAlertChannelCodec = {\n inputToProto: {\n in_app: Proto.AlertChannel.IN_APP,\n telegram: Proto.AlertChannel.TELEGRAM,\n } satisfies InputToProto<PriceAlertChannel, Proto.AlertChannel>,\n protoToOutput: {\n [Proto.AlertChannel.CHANNEL_UNSPECIFIED]: \"unspecified\",\n [Proto.AlertChannel.IN_APP]: \"in_app\",\n [Proto.AlertChannel.TELEGRAM]: \"telegram\",\n } satisfies ProtoToOutput<Proto.AlertChannel, PriceAlertChannel>,\n} as const;\n\nexport const PriceAlertUpdateOutcomeCodec = {\n protoToOutput: {\n [Proto.UpdateOutcome.UPDATE_OUTCOME_UNSPECIFIED]: \"unspecified\",\n [Proto.UpdateOutcome.APPLIED]: \"applied\",\n [Proto.UpdateOutcome.UNCHANGED]: \"unchanged\",\n [Proto.UpdateOutcome.REPLAYED]: \"replayed\",\n } satisfies ProtoToOutput<Proto.UpdateOutcome, PriceAlertUpdateOutcome>,\n} as const;\n"],"mappings":";;AAGA,MAAa,+BAA+B,CAAC,SAAS,OAAO;AAI7D,MAAa,kCAAkC,CAAC,cAAc,aAAa;AAG3E,MAAa,4BAA4B;CAAC;CAAU;CAAa;AAAU;AAG3E,MAAa,6BAA6B,CAAC,UAAU,UAAU;AAU/D,MAAa,2BAA2B;CACpC,cAAc;EACV,OAAA;EACA,OAAA;CACJ;CACA,eAAe;GACmC,IAAA;GAChB,IAAA;GACA,IAAA;CAClC;AACJ;AAEA,MAAa,6BAA6B;CACtC,cAAc;EACV,YAAA;EACA,aAAA;CACJ;CACA,eAAe;GACwC,IAAA;GACd,IAAA;GACC,IAAA;CAC1C;AACJ;AAEA,MAAa,wBAAwB;CACjC,cAAc;EACV,QAAA;EACA,WAAA;EACA,UAAA;CACJ;CACA,eAAe;GAC6B,IAAA;GACZ,IAAA;GACG,IAAA;GACA,IAAA;CACnC;AACJ;AAEA,MAAa,yBAAyB;CAClC,cAAc;EACV,QAAA;EACA,UAAA;CACJ;CACA,eAAe;GAC+B,IAAA;GACb,IAAA;GACE,IAAA;CACnC;AACJ;AAEA,MAAa,+BAA+B,EACxC,eAAe;EACuC,IAAA;EACnB,IAAA;EACE,IAAA;EACD,IAAA;AACpC,EACJ"}
|
|
@@ -27,12 +27,12 @@ declare class PriceAlertsService {
|
|
|
27
27
|
* Changes an alert's direction, price or channels; omitted fields stay as they are. A new
|
|
28
28
|
* direction or price records a new reference price. Updating a triggered alert sets it
|
|
29
29
|
* again, even with no field given. A stale `expectedRevision` throws
|
|
30
|
-
* `RevisionConflictError`; a
|
|
30
|
+
* `RevisionConflictError`; a canceled alert throws `PreconditionFailedError`. API keys need
|
|
31
31
|
* `manage-price-alerts`.
|
|
32
32
|
*/
|
|
33
33
|
update(input: UpdatePriceAlertInput, options?: PolyesterRequestOptions): Promise<UpdatePriceAlertResult>;
|
|
34
34
|
/**
|
|
35
|
-
* Cancels an active alert;
|
|
35
|
+
* Cancels an active alert; canceling a canceled alert returns it unchanged. A triggered
|
|
36
36
|
* alert throws `PreconditionFailedError` (`ALERT_TRIGGERED`). API keys need
|
|
37
37
|
* `manage-price-alerts`.
|
|
38
38
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { PriceAlertService } from "../../gen/alerts/v1/price_alerts_pb.js";
|
|
1
2
|
import { parse } from "../../shared/validation.js";
|
|
2
3
|
import { removeUndefined } from "../../utils/remove-undefined.js";
|
|
3
4
|
import { toConnectCallOptions } from "../../shared/request-options.js";
|
|
4
|
-
import { PriceAlertService } from "../../gen/alerts/v1/price_alerts_pb.js";
|
|
5
5
|
import { CancelPriceAlertInputSchema, CreatePriceAlertInputSchema, ListPriceAlertsInputSchema, ListPriceAlertsResultSchema, PriceAlertSchema, UpdatePriceAlertInputSchema, UpdatePriceAlertResultSchema } from "./price-alerts.schemas.js";
|
|
6
6
|
import { createClient } from "@connectrpc/connect";
|
|
7
7
|
//#region src/services/price-alerts/price-alerts.ts
|
|
@@ -40,7 +40,7 @@ var PriceAlertsService = class {
|
|
|
40
40
|
* Changes an alert's direction, price or channels; omitted fields stay as they are. A new
|
|
41
41
|
* direction or price records a new reference price. Updating a triggered alert sets it
|
|
42
42
|
* again, even with no field given. A stale `expectedRevision` throws
|
|
43
|
-
* `RevisionConflictError`; a
|
|
43
|
+
* `RevisionConflictError`; a canceled alert throws `PreconditionFailedError`. API keys need
|
|
44
44
|
* `manage-price-alerts`.
|
|
45
45
|
*/
|
|
46
46
|
async update(input, options) {
|
|
@@ -49,7 +49,7 @@ var PriceAlertsService = class {
|
|
|
49
49
|
return parse(UpdatePriceAlertResultSchema, response);
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
* Cancels an active alert;
|
|
52
|
+
* Cancels an active alert; canceling a canceled alert returns it unchanged. A triggered
|
|
53
53
|
* alert throws `PreconditionFailedError` (`ALERT_TRIGGERED`). API keys need
|
|
54
54
|
* `manage-price-alerts`.
|
|
55
55
|
*/
|