@polyester/sdk 0.35.0-devnet-20261111161451 → 0.35.0
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/services/accounts/accounts.d.ts +1 -1
- package/dist/services/accounts/accounts.js +1 -1
- package/dist/services/accounts/accounts.js.map +1 -1
- package/dist/services/api-keys/api-keys.d.ts +2 -2
- package/dist/services/api-keys/api-keys.js +2 -2
- package/dist/services/api-keys/api-keys.js.map +1 -1
- package/dist/services/assistant/assistant-events.schemas.d.ts +129 -101
- package/dist/services/assistant/assistant-events.schemas.d.ts.map +1 -1
- package/dist/services/auth/profile/profile.d.ts +2 -2
- package/dist/services/auth/profile/profile.js +2 -2
- package/dist/services/auth/profile/profile.js.map +1 -1
- package/dist/services/balances/balances.schemas.d.ts +3 -3
- package/dist/services/candles/candles.schemas.d.ts +10 -10
- package/dist/services/changelog/changelog.schemas.d.ts +17 -17
- package/dist/services/checkpoints/checkpoints.d.ts +2 -2
- package/dist/services/checkpoints/checkpoints.js +2 -2
- package/dist/services/checkpoints/checkpoints.js.map +1 -1
- package/dist/services/checkpoints/checkpoints.schemas.d.ts +1 -1
- package/dist/services/deposit/deposit.d.ts +2 -2
- package/dist/services/deposit/deposit.js +2 -2
- package/dist/services/deposit/deposit.js.map +1 -1
- package/dist/services/guard-signer/guard-signer.d.ts +1 -1
- package/dist/services/guard-signer/guard-signer.js +1 -1
- package/dist/services/guard-signer/guard-signer.js.map +1 -1
- package/dist/services/heatmap/heatmap.schemas.d.ts +13 -13
- package/dist/services/internal-transfers/internal-transfers.schemas.d.ts +3 -3
- package/dist/services/lifecycle/lifecycle.schemas.d.ts +148 -148
- package/dist/services/market-overview/market-overview.schemas.d.ts +3 -3
- package/dist/services/orderbook/orderbook.schemas.d.ts +1 -1
- package/dist/services/orders/orders-batch.schemas.d.ts +19 -19
- package/dist/services/orders/orders-input.schemas.d.ts +1 -1
- package/dist/services/orders/orders-output.schemas.d.ts +22 -22
- package/dist/services/policies/api-key-policies/api-key-policies.d.ts +2 -2
- package/dist/services/policies/api-key-policies/api-key-policies.js +2 -2
- package/dist/services/policies/api-key-policies/api-key-policies.js.map +1 -1
- package/dist/services/policies/subaccount-policies/subaccount-policies.d.ts +2 -2
- package/dist/services/policies/subaccount-policies/subaccount-policies.js +2 -2
- package/dist/services/policies/subaccount-policies/subaccount-policies.js.map +1 -1
- package/dist/services/rewards/rewards.schemas.d.ts +4 -4
- package/dist/services/social-verification/social-verification.d.ts +1 -1
- package/dist/services/social-verification/social-verification.js +1 -1
- package/dist/services/social-verification/social-verification.js.map +1 -1
- package/dist/services/subaccounts/subaccounts.d.ts +6 -6
- package/dist/services/subaccounts/subaccounts.js +6 -6
- package/dist/services/subaccounts/subaccounts.js.map +1 -1
- package/dist/services/subaccounts/subaccounts.schemas.d.ts +12 -12
- package/dist/services/trades/trades.schemas.d.ts +1 -1
- package/dist/services/trading-withdraws/trading-withdraws.d.ts +1 -1
- package/dist/services/trading-withdraws/trading-withdraws.js +1 -1
- package/dist/services/trading-withdraws/trading-withdraws.js.map +1 -1
- package/dist/services/transfers/transfers.schemas.d.ts +1 -1
- package/dist/services/triggers/trigger-input.schemas.d.ts +2 -2
- package/dist/services/triggers/triggers-output.schemas.d.ts +37 -37
- package/dist/services/vip/vip.d.ts +1 -1
- package/dist/services/vip/vip.js +1 -1
- package/dist/services/vip/vip.js.map +1 -1
- package/dist/services/vip/vip.schemas.d.ts +3 -3
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@ declare function createMarketOverviewSchema(scales: SdkScales): v.SchemaWithPipe
|
|
|
30
30
|
readonly bestAskTicks: v.BigintSchema<undefined>;
|
|
31
31
|
readonly bestAskQtyScaled: v.BigintSchema<undefined>;
|
|
32
32
|
readonly sparklines: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
33
|
-
readonly interval: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
33
|
+
readonly interval: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "1m" | "1h" | "1w" | "24h">]>;
|
|
34
34
|
readonly closeTicks: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
|
|
35
35
|
}, undefined>, undefined>, readonly []>;
|
|
36
36
|
readonly indexPriceTicks: v.BigintSchema<undefined>;
|
|
@@ -50,7 +50,7 @@ declare function createMarketOverviewSchema(scales: SdkScales): v.SchemaWithPipe
|
|
|
50
50
|
bestAskTicks: bigint;
|
|
51
51
|
bestAskQtyScaled: bigint;
|
|
52
52
|
sparklines: {
|
|
53
|
-
interval: "unspecified" | "
|
|
53
|
+
interval: "unspecified" | "1m" | "1h" | "1w" | "24h";
|
|
54
54
|
closeTicks: bigint[];
|
|
55
55
|
}[];
|
|
56
56
|
indexPriceTicks: bigint;
|
|
@@ -80,7 +80,7 @@ declare const ListMarketOverviewInputSchema: v.SchemaWithPipe<readonly [v.Strict
|
|
|
80
80
|
readonly orderBy: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["change_24h_bps", "volume_24h_usd", "last_price", "date_added"], undefined>, "volume_24h_usd">, v.TransformAction<"last_price" | "change_24h_bps" | "volume_24h_usd" | "date_added", MarketOrderBy.ORDER_BY_CHANGE_24H_BPS | MarketOrderBy.ORDER_BY_VOLUME_24H_USD | MarketOrderBy.ORDER_BY_LAST_PRICE | MarketOrderBy.ORDER_BY_DATE_ADDED>]>;
|
|
81
81
|
readonly sort: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["asc", "desc"], undefined>, "desc">, v.TransformAction<"asc" | "desc", SortDirection.SORT_ASC | SortDirection.SORT_DESC>]>;
|
|
82
82
|
readonly includeSparklines: v.OptionalSchema<v.BooleanSchema<undefined>, true>;
|
|
83
|
-
readonly sparklineIntervals: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["1h", "24h", "1w", "1m"], undefined>, undefined>, readonly ["24h"]>, v.TransformAction<("
|
|
83
|
+
readonly sparklineIntervals: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ArraySchema<v.PicklistSchema<readonly ["1h", "24h", "1w", "1m"], undefined>, undefined>, readonly ["24h"]>, v.TransformAction<("1m" | "1h" | "1w" | "24h")[], (SparklineInterval.SPARKLINE_1H | SparklineInterval.SPARKLINE_24H | SparklineInterval.SPARKLINE_1W | SparklineInterval.SPARKLINE_1M)[]>]>;
|
|
84
84
|
}, undefined>, v.TransformAction<{
|
|
85
85
|
symbolIds: number[];
|
|
86
86
|
limit: number;
|
|
@@ -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 | 5 | 10 | 20 | 100 | 200 | 500 | 1000 | 50;
|
|
14
14
|
protoDepth: Depth;
|
|
15
15
|
}>]>;
|
|
16
16
|
type GetOrderbookInput = v.InferInput<typeof GetOrderbookInputSchema>;
|
|
@@ -3754,20 +3754,20 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
|
|
|
3754
3754
|
readonly admissionStatus: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "rejected" | "admitted" | "partially_admitted">]>;
|
|
3755
3755
|
readonly items: v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
3756
3756
|
readonly itemIndex: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
3757
|
-
readonly phase: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "rejected" | "
|
|
3757
|
+
readonly phase: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "rejected" | "working" | "terminal" | "admitted">]>;
|
|
3758
3758
|
readonly oldOrderId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BigintSchema<undefined>, undefined>, v.TransformAction<bigint | undefined, string | undefined>]>;
|
|
3759
3759
|
readonly replacementOrderId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BigintSchema<undefined>, undefined>, v.TransformAction<bigint | undefined, string | undefined>]>;
|
|
3760
3760
|
readonly actionTaken: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "replaced" | "amended">]>;
|
|
3761
|
-
readonly orderStatus: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
3761
|
+
readonly orderStatus: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "canceled" | "pending" | "rejected" | "pending_cancel" | "working" | "filled">]>;
|
|
3762
3762
|
readonly code: v.StringSchema<undefined>;
|
|
3763
3763
|
readonly updatedTsNs: v.BigintSchema<undefined>;
|
|
3764
3764
|
}, undefined>, v.TransformAction<{
|
|
3765
3765
|
itemIndex: number;
|
|
3766
|
-
phase: "unspecified" | "rejected" | "
|
|
3766
|
+
phase: "unspecified" | "rejected" | "working" | "terminal" | "admitted";
|
|
3767
3767
|
oldOrderId?: string | undefined;
|
|
3768
3768
|
replacementOrderId?: string | undefined;
|
|
3769
3769
|
actionTaken: "unspecified" | "replaced" | "amended";
|
|
3770
|
-
orderStatus: "unspecified" | "
|
|
3770
|
+
orderStatus: "unspecified" | "canceled" | "pending" | "rejected" | "pending_cancel" | "working" | "filled";
|
|
3771
3771
|
code: string;
|
|
3772
3772
|
updatedTsNs: bigint;
|
|
3773
3773
|
}, {
|
|
@@ -3775,11 +3775,11 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
|
|
|
3775
3775
|
updatedTs: number;
|
|
3776
3776
|
updatedTsNs: string;
|
|
3777
3777
|
itemIndex: number;
|
|
3778
|
-
phase: "unspecified" | "rejected" | "
|
|
3778
|
+
phase: "unspecified" | "rejected" | "working" | "terminal" | "admitted";
|
|
3779
3779
|
oldOrderId?: string | undefined;
|
|
3780
3780
|
replacementOrderId?: string | undefined;
|
|
3781
3781
|
actionTaken: "unspecified" | "replaced" | "amended";
|
|
3782
|
-
orderStatus: "unspecified" | "
|
|
3782
|
+
orderStatus: "unspecified" | "canceled" | "pending" | "rejected" | "pending_cancel" | "working" | "filled";
|
|
3783
3783
|
}>]>, undefined>;
|
|
3784
3784
|
readonly acceptedCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
3785
3785
|
readonly rejectedCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
@@ -3793,11 +3793,11 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
|
|
|
3793
3793
|
updatedTs: number;
|
|
3794
3794
|
updatedTsNs: string;
|
|
3795
3795
|
itemIndex: number;
|
|
3796
|
-
phase: "unspecified" | "rejected" | "
|
|
3796
|
+
phase: "unspecified" | "rejected" | "working" | "terminal" | "admitted";
|
|
3797
3797
|
oldOrderId?: string | undefined;
|
|
3798
3798
|
replacementOrderId?: string | undefined;
|
|
3799
3799
|
actionTaken: "unspecified" | "replaced" | "amended";
|
|
3800
|
-
orderStatus: "unspecified" | "
|
|
3800
|
+
orderStatus: "unspecified" | "canceled" | "pending" | "rejected" | "pending_cancel" | "working" | "filled";
|
|
3801
3801
|
}[];
|
|
3802
3802
|
acceptedCount: number;
|
|
3803
3803
|
rejectedCount: number;
|
|
@@ -3811,11 +3811,11 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
|
|
|
3811
3811
|
updatedTs: number;
|
|
3812
3812
|
updatedTsNs: string;
|
|
3813
3813
|
itemIndex: number;
|
|
3814
|
-
phase: "unspecified" | "rejected" | "
|
|
3814
|
+
phase: "unspecified" | "rejected" | "working" | "terminal" | "admitted";
|
|
3815
3815
|
oldOrderId?: string | undefined;
|
|
3816
3816
|
replacementOrderId?: string | undefined;
|
|
3817
3817
|
actionTaken: "unspecified" | "replaced" | "amended";
|
|
3818
|
-
orderStatus: "unspecified" | "
|
|
3818
|
+
orderStatus: "unspecified" | "canceled" | "pending" | "rejected" | "pending_cancel" | "working" | "filled";
|
|
3819
3819
|
}[];
|
|
3820
3820
|
acceptedCount: number;
|
|
3821
3821
|
rejectedCount: number;
|
|
@@ -3829,11 +3829,11 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
|
|
|
3829
3829
|
updatedTs: number;
|
|
3830
3830
|
updatedTsNs: string;
|
|
3831
3831
|
itemIndex: number;
|
|
3832
|
-
phase: "unspecified" | "rejected" | "
|
|
3832
|
+
phase: "unspecified" | "rejected" | "working" | "terminal" | "admitted";
|
|
3833
3833
|
oldOrderId?: string | undefined;
|
|
3834
3834
|
replacementOrderId?: string | undefined;
|
|
3835
3835
|
actionTaken: "unspecified" | "replaced" | "amended";
|
|
3836
|
-
orderStatus: "unspecified" | "
|
|
3836
|
+
orderStatus: "unspecified" | "canceled" | "pending" | "rejected" | "pending_cancel" | "working" | "filled";
|
|
3837
3837
|
}[];
|
|
3838
3838
|
acceptedCount: number;
|
|
3839
3839
|
rejectedCount: number;
|
|
@@ -3851,11 +3851,11 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
|
|
|
3851
3851
|
updatedTs: number;
|
|
3852
3852
|
updatedTsNs: string;
|
|
3853
3853
|
itemIndex: number;
|
|
3854
|
-
phase: "unspecified" | "rejected" | "
|
|
3854
|
+
phase: "unspecified" | "rejected" | "working" | "terminal" | "admitted";
|
|
3855
3855
|
oldOrderId?: string | undefined;
|
|
3856
3856
|
replacementOrderId?: string | undefined;
|
|
3857
3857
|
actionTaken: "unspecified" | "replaced" | "amended";
|
|
3858
|
-
orderStatus: "unspecified" | "
|
|
3858
|
+
orderStatus: "unspecified" | "canceled" | "pending" | "rejected" | "pending_cancel" | "working" | "filled";
|
|
3859
3859
|
}[];
|
|
3860
3860
|
acceptedCount: number;
|
|
3861
3861
|
rejectedCount: number;
|
|
@@ -3950,7 +3950,7 @@ declare const BatchCancelOrdersInputSchema: v.SchemaWithPipe<readonly [v.StrictO
|
|
|
3950
3950
|
}>]>;
|
|
3951
3951
|
type BatchCancelOrdersInput = v.InferInput<typeof BatchCancelOrdersInputSchema>;
|
|
3952
3952
|
declare const BatchCancelOrderResultSchema: v.ObjectSchema<{
|
|
3953
|
-
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
3953
|
+
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "rejected" | "accepted">]>;
|
|
3954
3954
|
readonly orderId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BigintSchema<undefined>, undefined>, v.TransformAction<bigint | undefined, string | undefined>]>;
|
|
3955
3955
|
readonly clientOrderId: v.StringSchema<undefined>;
|
|
3956
3956
|
readonly code: v.StringSchema<undefined>;
|
|
@@ -3978,7 +3978,7 @@ declare const BatchCancelOrderResultSchema: v.ObjectSchema<{
|
|
|
3978
3978
|
type BatchCancelOrderResult = v.InferOutput<typeof BatchCancelOrderResultSchema>;
|
|
3979
3979
|
declare const BatchCancelOrdersResultSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
3980
3980
|
readonly results: v.ArraySchema<v.ObjectSchema<{
|
|
3981
|
-
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
3981
|
+
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "rejected" | "accepted">]>;
|
|
3982
3982
|
readonly orderId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BigintSchema<undefined>, undefined>, v.TransformAction<bigint | undefined, string | undefined>]>;
|
|
3983
3983
|
readonly clientOrderId: v.StringSchema<undefined>;
|
|
3984
3984
|
readonly code: v.StringSchema<undefined>;
|
|
@@ -4008,7 +4008,7 @@ declare const BatchCancelOrdersResultSchema: v.SchemaWithPipe<readonly [v.Object
|
|
|
4008
4008
|
readonly tsNs: v.BigintSchema<undefined>;
|
|
4009
4009
|
}, undefined>, v.CheckAction<{
|
|
4010
4010
|
results: {
|
|
4011
|
-
status: "unspecified" | "
|
|
4011
|
+
status: "unspecified" | "rejected" | "accepted";
|
|
4012
4012
|
orderId?: string | undefined;
|
|
4013
4013
|
clientOrderId: string;
|
|
4014
4014
|
code: string;
|
|
@@ -4038,7 +4038,7 @@ declare const BatchCancelOrdersResultSchema: v.SchemaWithPipe<readonly [v.Object
|
|
|
4038
4038
|
tsNs: bigint;
|
|
4039
4039
|
}, "Batch cancel result counts do not match the returned results.">, v.TransformAction<{
|
|
4040
4040
|
results: {
|
|
4041
|
-
status: "unspecified" | "
|
|
4041
|
+
status: "unspecified" | "rejected" | "accepted";
|
|
4042
4042
|
orderId?: string | undefined;
|
|
4043
4043
|
clientOrderId: string;
|
|
4044
4044
|
code: string;
|
|
@@ -4070,7 +4070,7 @@ declare const BatchCancelOrdersResultSchema: v.SchemaWithPipe<readonly [v.Object
|
|
|
4070
4070
|
ts: number;
|
|
4071
4071
|
tsNs: string;
|
|
4072
4072
|
results: {
|
|
4073
|
-
status: "unspecified" | "
|
|
4073
|
+
status: "unspecified" | "rejected" | "accepted";
|
|
4074
4074
|
orderId?: string | undefined;
|
|
4075
4075
|
clientOrderId: string;
|
|
4076
4076
|
code: string;
|
|
@@ -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>;
|
|
@@ -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" | "canceled" | "pending" | "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>;
|
|
@@ -146,7 +146,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
146
146
|
symbolId: number;
|
|
147
147
|
clientOrderId: string;
|
|
148
148
|
side: number;
|
|
149
|
-
status: "unspecified" | "
|
|
149
|
+
status: "unspecified" | "canceled" | "pending" | "rejected" | "pending_cancel" | "working" | "filled";
|
|
150
150
|
orderType: number;
|
|
151
151
|
timeInForce: number;
|
|
152
152
|
selfTradePreventionMode: number;
|
|
@@ -230,11 +230,11 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
230
230
|
trailingStop?: {
|
|
231
231
|
policy?: {
|
|
232
232
|
trailingDistance: {
|
|
233
|
-
case?: "
|
|
233
|
+
case?: "trailingDistanceBps" | "trailingDistanceTicks" | undefined;
|
|
234
234
|
value?: number | bigint | undefined;
|
|
235
235
|
};
|
|
236
236
|
maxSlippage: {
|
|
237
|
-
case: "
|
|
237
|
+
case: "maxSlippageBps" | "maxSlippageTicks" | undefined;
|
|
238
238
|
value?: number | bigint | undefined;
|
|
239
239
|
};
|
|
240
240
|
activationPriceTicks: bigint;
|
|
@@ -282,7 +282,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
282
282
|
attachedRisk: {
|
|
283
283
|
takeProfit: {
|
|
284
284
|
state: {
|
|
285
|
-
status: "unspecified" | "
|
|
285
|
+
status: "unspecified" | "armed" | "failed" | "canceled" | "created" | "running" | "completed" | "paused" | "not_configured";
|
|
286
286
|
armedTs: number | undefined;
|
|
287
287
|
armedTsNs: string | undefined;
|
|
288
288
|
terminalTs: number | undefined;
|
|
@@ -293,7 +293,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
293
293
|
triggerPrice?: string | undefined;
|
|
294
294
|
execution?: {
|
|
295
295
|
readonly type: "market_ioc";
|
|
296
|
-
|
|
296
|
+
price?: undefined;
|
|
297
297
|
} | {
|
|
298
298
|
readonly type: "limit_gtc";
|
|
299
299
|
readonly price: string;
|
|
@@ -302,7 +302,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
302
302
|
} | undefined;
|
|
303
303
|
stopLoss: {
|
|
304
304
|
state: {
|
|
305
|
-
status: "unspecified" | "
|
|
305
|
+
status: "unspecified" | "armed" | "failed" | "canceled" | "created" | "running" | "completed" | "paused" | "not_configured";
|
|
306
306
|
armedTs: number | undefined;
|
|
307
307
|
armedTsNs: string | undefined;
|
|
308
308
|
terminalTs: number | undefined;
|
|
@@ -313,7 +313,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
313
313
|
triggerPrice?: string | undefined;
|
|
314
314
|
execution?: {
|
|
315
315
|
readonly type: "market_ioc";
|
|
316
|
-
|
|
316
|
+
price?: undefined;
|
|
317
317
|
} | {
|
|
318
318
|
readonly type: "limit_gtc";
|
|
319
319
|
readonly price: string;
|
|
@@ -322,7 +322,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
322
322
|
} | undefined;
|
|
323
323
|
trailingStop: {
|
|
324
324
|
state: {
|
|
325
|
-
status: "unspecified" | "
|
|
325
|
+
status: "unspecified" | "armed" | "failed" | "canceled" | "created" | "running" | "completed" | "paused" | "not_configured";
|
|
326
326
|
armedTs: number | undefined;
|
|
327
327
|
armedTsNs: string | undefined;
|
|
328
328
|
terminalTs: number | undefined;
|
|
@@ -364,7 +364,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
364
364
|
} | undefined;
|
|
365
365
|
symbolId: number;
|
|
366
366
|
clientOrderId: string;
|
|
367
|
-
status: "unspecified" | "
|
|
367
|
+
status: "unspecified" | "canceled" | "pending" | "rejected" | "pending_cancel" | "working" | "filled" | "partial";
|
|
368
368
|
side: "unspecified" | "buy" | "sell";
|
|
369
369
|
orderType: "unspecified" | "limit" | "market";
|
|
370
370
|
timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
|
|
@@ -419,7 +419,7 @@ declare function createOrderTransferSchema(): v.SchemaWithPipe<readonly [v.Objec
|
|
|
419
419
|
timestamp: number;
|
|
420
420
|
amount: string;
|
|
421
421
|
type: "unspecified" | "internal_transfer" | "deposit" | "withdraw" | "maker_fee" | "taker_fee" | "trade_base" | "trade_quote" | "rebate" | "funding_to_trading" | "trading_to_funding" | "trading_withdraw_reserve" | "funding_user_transfer" | "trading_withdraw_request_fee" | "trading_withdraw_fee_leg" | "quickswap_polyester_fee" | "quickswap_broker_fee" | "quickswap_affiliate_fee" | "fee_sweep" | "fee_refill" | "system_adjustment" | "withdraw_failed";
|
|
422
|
-
accountCode: "unspecified" | "
|
|
422
|
+
accountCode: "unspecified" | "trading" | "funding";
|
|
423
423
|
}>]>;
|
|
424
424
|
type OrderTransfer = v.InferOutput<ReturnType<typeof createOrderTransferSchema>>;
|
|
425
425
|
declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
@@ -433,7 +433,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
433
433
|
readonly symbolId: v.NumberSchema<undefined>;
|
|
434
434
|
readonly clientOrderId: v.StringSchema<undefined>;
|
|
435
435
|
readonly side: v.NumberSchema<undefined>;
|
|
436
|
-
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
436
|
+
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "canceled" | "pending" | "rejected" | "pending_cancel" | "working" | "filled">]>;
|
|
437
437
|
readonly orderType: v.NumberSchema<undefined>;
|
|
438
438
|
readonly timeInForce: v.NumberSchema<undefined>;
|
|
439
439
|
readonly selfTradePreventionMode: v.NumberSchema<undefined>;
|
|
@@ -567,7 +567,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
567
567
|
symbolId: number;
|
|
568
568
|
clientOrderId: string;
|
|
569
569
|
side: number;
|
|
570
|
-
status: "unspecified" | "
|
|
570
|
+
status: "unspecified" | "canceled" | "pending" | "rejected" | "pending_cancel" | "working" | "filled";
|
|
571
571
|
orderType: number;
|
|
572
572
|
timeInForce: number;
|
|
573
573
|
selfTradePreventionMode: number;
|
|
@@ -651,11 +651,11 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
651
651
|
trailingStop?: {
|
|
652
652
|
policy?: {
|
|
653
653
|
trailingDistance: {
|
|
654
|
-
case?: "
|
|
654
|
+
case?: "trailingDistanceBps" | "trailingDistanceTicks" | undefined;
|
|
655
655
|
value?: number | bigint | undefined;
|
|
656
656
|
};
|
|
657
657
|
maxSlippage: {
|
|
658
|
-
case: "
|
|
658
|
+
case: "maxSlippageBps" | "maxSlippageTicks" | undefined;
|
|
659
659
|
value?: number | bigint | undefined;
|
|
660
660
|
};
|
|
661
661
|
activationPriceTicks: bigint;
|
|
@@ -703,7 +703,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
703
703
|
attachedRisk: {
|
|
704
704
|
takeProfit: {
|
|
705
705
|
state: {
|
|
706
|
-
status: "unspecified" | "
|
|
706
|
+
status: "unspecified" | "armed" | "failed" | "canceled" | "created" | "running" | "completed" | "paused" | "not_configured";
|
|
707
707
|
armedTs: number | undefined;
|
|
708
708
|
armedTsNs: string | undefined;
|
|
709
709
|
terminalTs: number | undefined;
|
|
@@ -714,7 +714,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
714
714
|
triggerPrice?: string | undefined;
|
|
715
715
|
execution?: {
|
|
716
716
|
readonly type: "market_ioc";
|
|
717
|
-
|
|
717
|
+
price?: undefined;
|
|
718
718
|
} | {
|
|
719
719
|
readonly type: "limit_gtc";
|
|
720
720
|
readonly price: string;
|
|
@@ -723,7 +723,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
723
723
|
} | undefined;
|
|
724
724
|
stopLoss: {
|
|
725
725
|
state: {
|
|
726
|
-
status: "unspecified" | "
|
|
726
|
+
status: "unspecified" | "armed" | "failed" | "canceled" | "created" | "running" | "completed" | "paused" | "not_configured";
|
|
727
727
|
armedTs: number | undefined;
|
|
728
728
|
armedTsNs: string | undefined;
|
|
729
729
|
terminalTs: number | undefined;
|
|
@@ -734,7 +734,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
734
734
|
triggerPrice?: string | undefined;
|
|
735
735
|
execution?: {
|
|
736
736
|
readonly type: "market_ioc";
|
|
737
|
-
|
|
737
|
+
price?: undefined;
|
|
738
738
|
} | {
|
|
739
739
|
readonly type: "limit_gtc";
|
|
740
740
|
readonly price: string;
|
|
@@ -743,7 +743,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
743
743
|
} | undefined;
|
|
744
744
|
trailingStop: {
|
|
745
745
|
state: {
|
|
746
|
-
status: "unspecified" | "
|
|
746
|
+
status: "unspecified" | "armed" | "failed" | "canceled" | "created" | "running" | "completed" | "paused" | "not_configured";
|
|
747
747
|
armedTs: number | undefined;
|
|
748
748
|
armedTsNs: string | undefined;
|
|
749
749
|
terminalTs: number | undefined;
|
|
@@ -785,7 +785,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
785
785
|
} | undefined;
|
|
786
786
|
symbolId: number;
|
|
787
787
|
clientOrderId: string;
|
|
788
|
-
status: "unspecified" | "
|
|
788
|
+
status: "unspecified" | "canceled" | "pending" | "rejected" | "pending_cancel" | "working" | "filled" | "partial";
|
|
789
789
|
side: "unspecified" | "buy" | "sell";
|
|
790
790
|
orderType: "unspecified" | "limit" | "market";
|
|
791
791
|
timeInForce: "unspecified" | "gtc" | "ioc" | "fok" | "gtd";
|
|
@@ -905,7 +905,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
905
905
|
timestamp: number;
|
|
906
906
|
amount: string;
|
|
907
907
|
type: "unspecified" | "internal_transfer" | "deposit" | "withdraw" | "maker_fee" | "taker_fee" | "trade_base" | "trade_quote" | "rebate" | "funding_to_trading" | "trading_to_funding" | "trading_withdraw_reserve" | "funding_user_transfer" | "trading_withdraw_request_fee" | "trading_withdraw_fee_leg" | "quickswap_polyester_fee" | "quickswap_broker_fee" | "quickswap_affiliate_fee" | "fee_sweep" | "fee_refill" | "system_adjustment" | "withdraw_failed";
|
|
908
|
-
accountCode: "unspecified" | "
|
|
908
|
+
accountCode: "unspecified" | "trading" | "funding";
|
|
909
909
|
}>]>, undefined>, readonly []>;
|
|
910
910
|
readonly executionsComplete: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
|
|
911
911
|
}, undefined>;
|
|
@@ -10,11 +10,11 @@ declare class ApiKeyPoliciesService {
|
|
|
10
10
|
#private;
|
|
11
11
|
constructor(transports: AuthApiTransports);
|
|
12
12
|
/**
|
|
13
|
-
* Returns API key policy templates available to the caller.
|
|
13
|
+
* Returns API key policy templates available to the caller. API keys need `read-api-policies`; a key scoped to a sub-account sees only the policies attached to that sub-account's keys.
|
|
14
14
|
*/
|
|
15
15
|
list(input?: v.InferInput<typeof ListApiKeyPoliciesInputSchema>, options?: PolyesterRequestOptions): Promise<ApiKeyPolicy[]>;
|
|
16
16
|
/**
|
|
17
|
-
* Fetches an API key policy by base58 policy ID, falling back to the SDK default no-permissions policy when no ID or policy is returned.
|
|
17
|
+
* Fetches an API key policy by base58 policy ID, falling back to the SDK default no-permissions policy when no ID or policy is returned. API keys need `read-api-policies`.
|
|
18
18
|
*/
|
|
19
19
|
get(input: v.InferInput<typeof GetApiKeyPolicyInputSchema>, options?: PolyesterRequestOptions): Promise<ApiKeyPolicy>;
|
|
20
20
|
/**
|
|
@@ -15,7 +15,7 @@ var ApiKeyPoliciesService = class {
|
|
|
15
15
|
this.#client = createClient(PolicyService, transports.authApi);
|
|
16
16
|
}
|
|
17
17
|
/**
|
|
18
|
-
* Returns API key policy templates available to the caller.
|
|
18
|
+
* Returns API key policy templates available to the caller. API keys need `read-api-policies`; a key scoped to a sub-account sees only the policies attached to that sub-account's keys.
|
|
19
19
|
*/
|
|
20
20
|
async list(input = {}, options) {
|
|
21
21
|
const request = parse(ListApiKeyPoliciesInputSchema, input);
|
|
@@ -23,7 +23,7 @@ var ApiKeyPoliciesService = class {
|
|
|
23
23
|
return parse(ListApiKeyPoliciesResponseSchema, res);
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
* Fetches an API key policy by base58 policy ID, falling back to the SDK default no-permissions policy when no ID or policy is returned.
|
|
26
|
+
* Fetches an API key policy by base58 policy ID, falling back to the SDK default no-permissions policy when no ID or policy is returned. API keys need `read-api-policies`.
|
|
27
27
|
*/
|
|
28
28
|
async get(input, options) {
|
|
29
29
|
const { policyId, keyId } = parse(GetApiKeyPolicyInputSchema, input);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-key-policies.js","names":["#client","Proto.PolicyService"],"sources":["../../../../src/services/policies/api-key-policies/api-key-policies.ts"],"sourcesContent":["import * as Proto from \"../../../gen/auth/v1/policies_pb.js\";\nimport { createClient, type Client } from \"@connectrpc/connect\";\nimport type { AuthApiTransports } from \"../../../shared/transports.js\";\nimport type * as v from \"valibot\";\nimport { parse } from \"../../../shared/validation.js\";\nimport { removeUndefined } from \"../../../utils/remove-undefined.js\";\nimport {\n toConnectCallOptions,\n type PolyesterMutationOptions,\n type PolyesterRequestOptions,\n} from \"../../../shared/request-options.js\";\nimport {\n ApiKeyPolicySchema,\n ListApiKeyPoliciesResponseSchema,\n CreateApiKeyPolicyInputSchema,\n UpdateApiKeyPolicyInputSchema,\n ApplyApiKeyPolicyInputSchema,\n DEFAULT_API_KEY_POLICY,\n type ApiKeyPolicy,\n ListApiKeyPoliciesInputSchema,\n GetApiKeyPolicyInputSchema,\n} from \"./api-key-policies.schemas.js\";\nimport { PolicyIdSchema } from \"../shared.js\";\n\n/**\n * Manages reusable API key policy templates and their assignment to API keys.\n */\nexport class ApiKeyPoliciesService {\n #client: Client<typeof Proto.PolicyService>;\n\n constructor(transports: AuthApiTransports) {\n this.#client = createClient(Proto.PolicyService, transports.authApi);\n }\n\n /**\n * Returns API key policy templates available to the caller.\n */\n async list(\n input: v.InferInput<typeof ListApiKeyPoliciesInputSchema> = {},\n options?: PolyesterRequestOptions,\n ): Promise<ApiKeyPolicy[]> {\n const request = parse(ListApiKeyPoliciesInputSchema, input);\n const res = await this.#client.listApiPolicies(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(ListApiKeyPoliciesResponseSchema, res);\n }\n\n /**\n * Fetches an API key policy by base58 policy ID, falling back to the SDK default no-permissions policy when no ID or policy is returned
|
|
1
|
+
{"version":3,"file":"api-key-policies.js","names":["#client","Proto.PolicyService"],"sources":["../../../../src/services/policies/api-key-policies/api-key-policies.ts"],"sourcesContent":["import * as Proto from \"../../../gen/auth/v1/policies_pb.js\";\nimport { createClient, type Client } from \"@connectrpc/connect\";\nimport type { AuthApiTransports } from \"../../../shared/transports.js\";\nimport type * as v from \"valibot\";\nimport { parse } from \"../../../shared/validation.js\";\nimport { removeUndefined } from \"../../../utils/remove-undefined.js\";\nimport {\n toConnectCallOptions,\n type PolyesterMutationOptions,\n type PolyesterRequestOptions,\n} from \"../../../shared/request-options.js\";\nimport {\n ApiKeyPolicySchema,\n ListApiKeyPoliciesResponseSchema,\n CreateApiKeyPolicyInputSchema,\n UpdateApiKeyPolicyInputSchema,\n ApplyApiKeyPolicyInputSchema,\n DEFAULT_API_KEY_POLICY,\n type ApiKeyPolicy,\n ListApiKeyPoliciesInputSchema,\n GetApiKeyPolicyInputSchema,\n} from \"./api-key-policies.schemas.js\";\nimport { PolicyIdSchema } from \"../shared.js\";\n\n/**\n * Manages reusable API key policy templates and their assignment to API keys.\n */\nexport class ApiKeyPoliciesService {\n #client: Client<typeof Proto.PolicyService>;\n\n constructor(transports: AuthApiTransports) {\n this.#client = createClient(Proto.PolicyService, transports.authApi);\n }\n\n /**\n * Returns API key policy templates available to the caller. API keys need `read-api-policies`; a key scoped to a sub-account sees only the policies attached to that sub-account's keys.\n */\n async list(\n input: v.InferInput<typeof ListApiKeyPoliciesInputSchema> = {},\n options?: PolyesterRequestOptions,\n ): Promise<ApiKeyPolicy[]> {\n const request = parse(ListApiKeyPoliciesInputSchema, input);\n const res = await this.#client.listApiPolicies(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(ListApiKeyPoliciesResponseSchema, res);\n }\n\n /**\n * Fetches an API key policy by base58 policy ID, falling back to the SDK default no-permissions policy when no ID or policy is returned. API keys need `read-api-policies`.\n */\n async get(\n input: v.InferInput<typeof GetApiKeyPolicyInputSchema>,\n options?: PolyesterRequestOptions,\n ): Promise<ApiKeyPolicy> {\n const { policyId, keyId } = parse(GetApiKeyPolicyInputSchema, input);\n if (!policyId) return DEFAULT_API_KEY_POLICY;\n const res = await this.#client.getApiPolicy(\n removeUndefined({ policyId, keyId }),\n toConnectCallOptions(options),\n );\n if (!res.policy) return DEFAULT_API_KEY_POLICY;\n return parse(ApiKeyPolicySchema, res.policy);\n }\n\n /**\n * Creates an API key policy template with a spot-market scope, allowed actions, and optional immediate assignment to a key.\n */\n async create(\n input: v.InferInput<typeof CreateApiKeyPolicyInputSchema>,\n options?: PolyesterMutationOptions,\n ): Promise<ApiKeyPolicy> {\n const validatedInput = parse(CreateApiKeyPolicyInputSchema, input);\n const res = await this.#client.createApiPolicy(\n removeUndefined(validatedInput),\n toConnectCallOptions(options),\n );\n if (!res.policy) throw new Error(\"Failed to create API key policy\");\n return parse(ApiKeyPolicySchema, res.policy);\n }\n\n /**\n * Updates selected API key policy fields using optimistic concurrency.\n */\n async update(\n input: v.InferInput<typeof UpdateApiKeyPolicyInputSchema>,\n options?: PolyesterMutationOptions,\n ): Promise<ApiKeyPolicy> {\n const validatedInput = parse(UpdateApiKeyPolicyInputSchema, input);\n const res = await this.#client.updateApiPolicy(\n removeUndefined(validatedInput),\n toConnectCallOptions(options),\n );\n if (!res.policy) throw new Error(\"Failed to update API key policy\");\n return parse(ApiKeyPolicySchema, res.policy);\n }\n\n /**\n * Deletes an API key policy template when it is not in use.\n */\n async delete(policyId: string, options?: PolyesterMutationOptions): Promise<void> {\n const validatedPolicyId = parse(PolicyIdSchema, policyId);\n await this.#client.deleteApiPolicy(\n { policyId: validatedPolicyId },\n toConnectCallOptions(options),\n );\n }\n\n /**\n * Attaches a policy to an API key. Passing a null policyId clears the binding and leaves the key with no permissions.\n */\n async apply(\n input: v.InferInput<typeof ApplyApiKeyPolicyInputSchema>,\n options?: PolyesterMutationOptions,\n ): Promise<void> {\n const validatedInput = parse(ApplyApiKeyPolicyInputSchema, input);\n await this.#client.setApiKeyPolicy(\n removeUndefined(validatedInput),\n toConnectCallOptions(options),\n );\n }\n}\n"],"mappings":";;;;;;;;;;;AA2BA,IAAa,wBAAb,MAAmC;CAC/B;CAEA,YAAY,YAA+B;EACvC,KAAKA,UAAU,aAAaC,eAAqB,WAAW,OAAO;CACvE;;;;CAKA,MAAM,KACF,QAA4D,CAAC,GAC7D,SACuB;EACvB,MAAM,UAAU,MAAM,+BAA+B,KAAK;EAC1D,MAAM,MAAM,MAAM,KAAKD,QAAQ,gBAC3B,gBAAgB,OAAO,GACvB,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,kCAAkC,GAAG;CACtD;;;;CAKA,MAAM,IACF,OACA,SACqB;EACrB,MAAM,EAAE,UAAU,UAAU,MAAM,4BAA4B,KAAK;EACnE,IAAI,CAAC,UAAU,OAAO;EACtB,MAAM,MAAM,MAAM,KAAKA,QAAQ,aAC3B,gBAAgB;GAAE;GAAU;EAAM,CAAC,GACnC,qBAAqB,OAAO,CAChC;EACA,IAAI,CAAC,IAAI,QAAQ,OAAO;EACxB,OAAO,MAAM,oBAAoB,IAAI,MAAM;CAC/C;;;;CAKA,MAAM,OACF,OACA,SACqB;EACrB,MAAM,iBAAiB,MAAM,+BAA+B,KAAK;EACjE,MAAM,MAAM,MAAM,KAAKA,QAAQ,gBAC3B,gBAAgB,cAAc,GAC9B,qBAAqB,OAAO,CAChC;EACA,IAAI,CAAC,IAAI,QAAQ,MAAM,IAAI,MAAM,iCAAiC;EAClE,OAAO,MAAM,oBAAoB,IAAI,MAAM;CAC/C;;;;CAKA,MAAM,OACF,OACA,SACqB;EACrB,MAAM,iBAAiB,MAAM,+BAA+B,KAAK;EACjE,MAAM,MAAM,MAAM,KAAKA,QAAQ,gBAC3B,gBAAgB,cAAc,GAC9B,qBAAqB,OAAO,CAChC;EACA,IAAI,CAAC,IAAI,QAAQ,MAAM,IAAI,MAAM,iCAAiC;EAClE,OAAO,MAAM,oBAAoB,IAAI,MAAM;CAC/C;;;;CAKA,MAAM,OAAO,UAAkB,SAAmD;EAC9E,MAAM,oBAAoB,MAAM,gBAAgB,QAAQ;EACxD,MAAM,KAAKA,QAAQ,gBACf,EAAE,UAAU,kBAAkB,GAC9B,qBAAqB,OAAO,CAChC;CACJ;;;;CAKA,MAAM,MACF,OACA,SACa;EACb,MAAM,iBAAiB,MAAM,8BAA8B,KAAK;EAChE,MAAM,KAAKA,QAAQ,gBACf,gBAAgB,cAAc,GAC9B,qBAAqB,OAAO,CAChC;CACJ;AACJ"}
|
|
@@ -17,11 +17,11 @@ declare class SubaccountPoliciesService {
|
|
|
17
17
|
#private;
|
|
18
18
|
constructor(transports: AuthApiTransports, realtime: PolyesterRealtime, resolver?: SubaccountResolver);
|
|
19
19
|
/**
|
|
20
|
-
* Returns subaccount policy templates visible to the caller, sorted by ascending policy ID.
|
|
20
|
+
* Returns subaccount policy templates visible to the caller, sorted by ascending policy ID. API keys need `read-subaccount-policies`; a key scoped to a sub-account sees only that sub-account's policy.
|
|
21
21
|
*/
|
|
22
22
|
list(input?: v.InferInput<typeof ListSubaccountPoliciesInputSchema>, options?: PolyesterRequestOptions): Promise<SubaccountPolicy[]>;
|
|
23
23
|
/**
|
|
24
|
-
* Fetches one subaccount policy template by base58 policy ID and returns null when no policy is returned.
|
|
24
|
+
* Fetches one subaccount policy template by base58 policy ID and returns null when no policy is returned. API keys need `read-subaccount-policies`.
|
|
25
25
|
*/
|
|
26
26
|
get(input: v.InferInput<typeof GetSubaccountPolicyInputSchema>, options?: PolyesterRequestOptions): Promise<SubaccountPolicy | null>;
|
|
27
27
|
/**
|
|
@@ -20,7 +20,7 @@ var SubaccountPoliciesService = class {
|
|
|
20
20
|
this.#resolver = resolver;
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
|
-
* Returns subaccount policy templates visible to the caller, sorted by ascending policy ID.
|
|
23
|
+
* Returns subaccount policy templates visible to the caller, sorted by ascending policy ID. API keys need `read-subaccount-policies`; a key scoped to a sub-account sees only that sub-account's policy.
|
|
24
24
|
*/
|
|
25
25
|
async list(input = {}, options) {
|
|
26
26
|
const resolved = resolveAccountScopedInput(input, this.#resolver);
|
|
@@ -29,7 +29,7 @@ var SubaccountPoliciesService = class {
|
|
|
29
29
|
return parse(v.array(SubaccountPolicySchema), result.policies);
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
* Fetches one subaccount policy template by base58 policy ID and returns null when no policy is returned.
|
|
32
|
+
* Fetches one subaccount policy template by base58 policy ID and returns null when no policy is returned. API keys need `read-subaccount-policies`.
|
|
33
33
|
*/
|
|
34
34
|
async get(input, options) {
|
|
35
35
|
const resolved = resolveAccountScopedInput(input, this.#resolver);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subaccount-policies.js","names":["#client","Proto.PolicyService","#realtime","#resolver","Proto.SubaccountPolicyViewSchema"],"sources":["../../../../src/services/policies/subaccount-policies/subaccount-policies.ts"],"sourcesContent":["import * as Proto from \"../../../gen/auth/v1/policies_pb.js\";\nimport { createClient, type Client } from \"@connectrpc/connect\";\nimport * as v from \"valibot\";\nimport { parse } from \"../../../shared/validation.js\";\nimport { removeUndefined } from \"../../../utils/remove-undefined.js\";\nimport {\n toConnectCallOptions,\n type PolyesterMutationOptions,\n type PolyesterRequestOptions,\n} from \"../../../shared/request-options.js\";\nimport type { BaseSubscribeInput } from \"../../../shared/types.js\";\nimport type { PolyesterRealtime } from \"../../../realtime/index.js\";\nimport type { AuthApiTransports } from \"../../../shared/transports.js\";\nimport { type SubaccountResolver, resolveAccountScopedInput } from \"../../subaccount-resolver.js\";\nimport {\n SubaccountPolicySchema,\n CreateSubaccountPolicyInputSchema,\n UpdateSubaccountPolicyInputSchema,\n PolicyIdSchema,\n ApplySubaccountPolicyInputSchema,\n type SubaccountPolicy,\n ListSubaccountPoliciesInputSchema,\n GetSubaccountPolicyInputSchema,\n} from \"./subaccount-policies.schemas.js\";\n\ninterface SubscribePoliciesInput extends BaseSubscribeInput<SubaccountPolicy> {\n accountId: string;\n}\n\n/**\n * Manages reusable subaccount policy templates, assignments, and realtime policy updates.\n */\nexport class SubaccountPoliciesService {\n #client: Client<typeof Proto.PolicyService>;\n #realtime: PolyesterRealtime;\n #resolver?: SubaccountResolver;\n\n constructor(\n transports: AuthApiTransports,\n realtime: PolyesterRealtime,\n resolver?: SubaccountResolver,\n ) {\n this.#client = createClient(Proto.PolicyService, transports.authApi);\n this.#realtime = realtime;\n this.#resolver = resolver;\n }\n\n /**\n * Returns subaccount policy templates visible to the caller, sorted by ascending policy ID.\n */\n async list(\n input: v.InferInput<typeof ListSubaccountPoliciesInputSchema> = {},\n options?: PolyesterRequestOptions,\n ): Promise<SubaccountPolicy[]> {\n const resolved = resolveAccountScopedInput(input, this.#resolver);\n const request = parse(ListSubaccountPoliciesInputSchema, resolved);\n const result = await this.#client.listSubaccountPolicies(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(v.array(SubaccountPolicySchema), result.policies);\n }\n\n /**\n * Fetches one subaccount policy template by base58 policy ID and returns null when no policy is returned
|
|
1
|
+
{"version":3,"file":"subaccount-policies.js","names":["#client","Proto.PolicyService","#realtime","#resolver","Proto.SubaccountPolicyViewSchema"],"sources":["../../../../src/services/policies/subaccount-policies/subaccount-policies.ts"],"sourcesContent":["import * as Proto from \"../../../gen/auth/v1/policies_pb.js\";\nimport { createClient, type Client } from \"@connectrpc/connect\";\nimport * as v from \"valibot\";\nimport { parse } from \"../../../shared/validation.js\";\nimport { removeUndefined } from \"../../../utils/remove-undefined.js\";\nimport {\n toConnectCallOptions,\n type PolyesterMutationOptions,\n type PolyesterRequestOptions,\n} from \"../../../shared/request-options.js\";\nimport type { BaseSubscribeInput } from \"../../../shared/types.js\";\nimport type { PolyesterRealtime } from \"../../../realtime/index.js\";\nimport type { AuthApiTransports } from \"../../../shared/transports.js\";\nimport { type SubaccountResolver, resolveAccountScopedInput } from \"../../subaccount-resolver.js\";\nimport {\n SubaccountPolicySchema,\n CreateSubaccountPolicyInputSchema,\n UpdateSubaccountPolicyInputSchema,\n PolicyIdSchema,\n ApplySubaccountPolicyInputSchema,\n type SubaccountPolicy,\n ListSubaccountPoliciesInputSchema,\n GetSubaccountPolicyInputSchema,\n} from \"./subaccount-policies.schemas.js\";\n\ninterface SubscribePoliciesInput extends BaseSubscribeInput<SubaccountPolicy> {\n accountId: string;\n}\n\n/**\n * Manages reusable subaccount policy templates, assignments, and realtime policy updates.\n */\nexport class SubaccountPoliciesService {\n #client: Client<typeof Proto.PolicyService>;\n #realtime: PolyesterRealtime;\n #resolver?: SubaccountResolver;\n\n constructor(\n transports: AuthApiTransports,\n realtime: PolyesterRealtime,\n resolver?: SubaccountResolver,\n ) {\n this.#client = createClient(Proto.PolicyService, transports.authApi);\n this.#realtime = realtime;\n this.#resolver = resolver;\n }\n\n /**\n * Returns subaccount policy templates visible to the caller, sorted by ascending policy ID. API keys need `read-subaccount-policies`; a key scoped to a sub-account sees only that sub-account's policy.\n */\n async list(\n input: v.InferInput<typeof ListSubaccountPoliciesInputSchema> = {},\n options?: PolyesterRequestOptions,\n ): Promise<SubaccountPolicy[]> {\n const resolved = resolveAccountScopedInput(input, this.#resolver);\n const request = parse(ListSubaccountPoliciesInputSchema, resolved);\n const result = await this.#client.listSubaccountPolicies(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n return parse(v.array(SubaccountPolicySchema), result.policies);\n }\n\n /**\n * Fetches one subaccount policy template by base58 policy ID and returns null when no policy is returned. API keys need `read-subaccount-policies`.\n */\n async get(\n input: v.InferInput<typeof GetSubaccountPolicyInputSchema>,\n options?: PolyesterRequestOptions,\n ): Promise<SubaccountPolicy | null> {\n const resolved = resolveAccountScopedInput(input, this.#resolver);\n const request = parse(GetSubaccountPolicyInputSchema, resolved);\n const result = await this.#client.getSubaccountPolicy(\n removeUndefined(request),\n toConnectCallOptions(options),\n );\n if (!result.policy) return null;\n return parse(SubaccountPolicySchema, result.policy);\n }\n\n /**\n * Creates a subaccount policy template, optionally attaching it to a target subaccount in the same request.\n */\n async create(\n input: v.InferInput<typeof CreateSubaccountPolicyInputSchema>,\n options?: PolyesterMutationOptions,\n ): Promise<SubaccountPolicy> {\n const validatedInput = parse(CreateSubaccountPolicyInputSchema, input);\n const result = await this.#client.createSubaccountPolicy(\n removeUndefined(validatedInput),\n toConnectCallOptions(options),\n );\n if (!result.policy) throw new Error(\"Failed to create subaccount policy\");\n return parse(SubaccountPolicySchema, result.policy);\n }\n\n /**\n * Updates selected subaccount policy fields using optimistic concurrency.\n */\n async update(\n input: v.InferInput<typeof UpdateSubaccountPolicyInputSchema>,\n options?: PolyesterMutationOptions,\n ): Promise<SubaccountPolicy> {\n const validatedInput = parse(UpdateSubaccountPolicyInputSchema, input);\n const result = await this.#client.updateSubaccountPolicy(\n removeUndefined(validatedInput),\n toConnectCallOptions(options),\n );\n if (!result.policy) throw new Error(\"Failed to update subaccount policy\");\n return parse(SubaccountPolicySchema, result.policy);\n }\n\n /**\n * Deletes a subaccount policy template when it is not in use.\n */\n async delete(policyId: string, options?: PolyesterMutationOptions): Promise<void> {\n const validatedPolicyId = parse(PolicyIdSchema, policyId);\n await this.#client.deleteSubaccountPolicy(\n { policyId: validatedPolicyId },\n toConnectCallOptions(options),\n );\n }\n\n /**\n * Attaches a policy to a subaccount. Passing a null policyId clears the explicit binding and restores the system read-only policy.\n */\n async apply(\n input: v.InferInput<typeof ApplySubaccountPolicyInputSchema>,\n options?: PolyesterMutationOptions,\n ): Promise<void> {\n const validatedInput = parse(ApplySubaccountPolicyInputSchema, input);\n await this.#client.setSubaccountPolicy(\n removeUndefined(validatedInput),\n toConnectCallOptions(options),\n );\n }\n\n /**\n * Subscribes to private subaccount policy updates for an account and emits normalized policy views.\n */\n subscribePolicies(input: SubscribePoliciesInput) {\n const channel = `private:auth:subaccount-policies:${input.accountId}:proto`;\n\n return this.#realtime.connectProtoChannel({\n channel,\n schema: Proto.SubaccountPolicyViewSchema,\n onPublication: (data) => {\n const policy = parse(SubaccountPolicySchema, data);\n input.onEvent(policy);\n },\n onConnected: () => input.onOpen?.(),\n onDisconnected: () => input.onClose?.(),\n onError: input.onError,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;AAgCA,IAAa,4BAAb,MAAuC;CACnC;CACA;CACA;CAEA,YACI,YACA,UACA,UACF;EACE,KAAKA,UAAU,aAAaC,eAAqB,WAAW,OAAO;EACnE,KAAKC,YAAY;EACjB,KAAKC,YAAY;CACrB;;;;CAKA,MAAM,KACF,QAAgE,CAAC,GACjE,SAC2B;EAC3B,MAAM,WAAW,0BAA0B,OAAO,KAAKA,SAAS;EAChE,MAAM,UAAU,MAAM,mCAAmC,QAAQ;EACjE,MAAM,SAAS,MAAM,KAAKH,QAAQ,uBAC9B,gBAAgB,OAAO,GACvB,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,EAAE,MAAM,sBAAsB,GAAG,OAAO,QAAQ;CACjE;;;;CAKA,MAAM,IACF,OACA,SACgC;EAChC,MAAM,WAAW,0BAA0B,OAAO,KAAKG,SAAS;EAChE,MAAM,UAAU,MAAM,gCAAgC,QAAQ;EAC9D,MAAM,SAAS,MAAM,KAAKH,QAAQ,oBAC9B,gBAAgB,OAAO,GACvB,qBAAqB,OAAO,CAChC;EACA,IAAI,CAAC,OAAO,QAAQ,OAAO;EAC3B,OAAO,MAAM,wBAAwB,OAAO,MAAM;CACtD;;;;CAKA,MAAM,OACF,OACA,SACyB;EACzB,MAAM,iBAAiB,MAAM,mCAAmC,KAAK;EACrE,MAAM,SAAS,MAAM,KAAKA,QAAQ,uBAC9B,gBAAgB,cAAc,GAC9B,qBAAqB,OAAO,CAChC;EACA,IAAI,CAAC,OAAO,QAAQ,MAAM,IAAI,MAAM,oCAAoC;EACxE,OAAO,MAAM,wBAAwB,OAAO,MAAM;CACtD;;;;CAKA,MAAM,OACF,OACA,SACyB;EACzB,MAAM,iBAAiB,MAAM,mCAAmC,KAAK;EACrE,MAAM,SAAS,MAAM,KAAKA,QAAQ,uBAC9B,gBAAgB,cAAc,GAC9B,qBAAqB,OAAO,CAChC;EACA,IAAI,CAAC,OAAO,QAAQ,MAAM,IAAI,MAAM,oCAAoC;EACxE,OAAO,MAAM,wBAAwB,OAAO,MAAM;CACtD;;;;CAKA,MAAM,OAAO,UAAkB,SAAmD;EAC9E,MAAM,oBAAoB,MAAM,gBAAgB,QAAQ;EACxD,MAAM,KAAKA,QAAQ,uBACf,EAAE,UAAU,kBAAkB,GAC9B,qBAAqB,OAAO,CAChC;CACJ;;;;CAKA,MAAM,MACF,OACA,SACa;EACb,MAAM,iBAAiB,MAAM,kCAAkC,KAAK;EACpE,MAAM,KAAKA,QAAQ,oBACf,gBAAgB,cAAc,GAC9B,qBAAqB,OAAO,CAChC;CACJ;;;;CAKA,kBAAkB,OAA+B;EAC7C,MAAM,UAAU,oCAAoC,MAAM,UAAU;EAEpE,OAAO,KAAKE,UAAU,oBAAoB;GACtC;GACA,QAAQE;GACR,gBAAgB,SAAS;IACrB,MAAM,SAAS,MAAM,wBAAwB,IAAI;IACjD,MAAM,QAAQ,MAAM;GACxB;GACA,mBAAmB,MAAM,SAAS;GAClC,sBAAsB,MAAM,UAAU;GACtC,SAAS,MAAM;EACnB,CAAC;CACL;AACJ"}
|
|
@@ -29,7 +29,7 @@ declare const RewardAwardSchema: v.ObjectSchema<{
|
|
|
29
29
|
readonly assetId: v.NumberSchema<undefined>;
|
|
30
30
|
readonly amountBaseUnits: v.StringSchema<undefined>;
|
|
31
31
|
readonly fulfillmentMethod: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "external_testnet" | "internal_trading">]>;
|
|
32
|
-
readonly fulfillmentState: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
32
|
+
readonly fulfillmentState: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "awaiting_destination" | "ready_for_payout" | "paid" | "failed" | "canceled">]>;
|
|
33
33
|
readonly publishedAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
34
34
|
readonly seconds: v.BigintSchema<undefined>;
|
|
35
35
|
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
@@ -67,7 +67,7 @@ declare const ListRewardAwardsResultSchema: v.ObjectSchema<{
|
|
|
67
67
|
readonly assetId: v.NumberSchema<undefined>;
|
|
68
68
|
readonly amountBaseUnits: v.StringSchema<undefined>;
|
|
69
69
|
readonly fulfillmentMethod: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "external_testnet" | "internal_trading">]>;
|
|
70
|
-
readonly fulfillmentState: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
70
|
+
readonly fulfillmentState: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "awaiting_destination" | "ready_for_payout" | "paid" | "failed" | "canceled">]>;
|
|
71
71
|
readonly publishedAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
72
72
|
readonly seconds: v.BigintSchema<undefined>;
|
|
73
73
|
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
@@ -114,7 +114,7 @@ declare const SetRewardDestinationResultSchema: v.ObjectSchema<{
|
|
|
114
114
|
readonly assetId: v.NumberSchema<undefined>;
|
|
115
115
|
readonly amountBaseUnits: v.StringSchema<undefined>;
|
|
116
116
|
readonly fulfillmentMethod: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "external_testnet" | "internal_trading">]>;
|
|
117
|
-
readonly fulfillmentState: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
117
|
+
readonly fulfillmentState: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "awaiting_destination" | "ready_for_payout" | "paid" | "failed" | "canceled">]>;
|
|
118
118
|
readonly publishedAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
119
119
|
readonly seconds: v.BigintSchema<undefined>;
|
|
120
120
|
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
@@ -153,7 +153,7 @@ declare const AcknowledgeRewardAwardResultSchema: v.ObjectSchema<{
|
|
|
153
153
|
readonly assetId: v.NumberSchema<undefined>;
|
|
154
154
|
readonly amountBaseUnits: v.StringSchema<undefined>;
|
|
155
155
|
readonly fulfillmentMethod: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "external_testnet" | "internal_trading">]>;
|
|
156
|
-
readonly fulfillmentState: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
156
|
+
readonly fulfillmentState: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "awaiting_destination" | "ready_for_payout" | "paid" | "failed" | "canceled">]>;
|
|
157
157
|
readonly publishedAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
158
158
|
readonly seconds: v.BigintSchema<undefined>;
|
|
159
159
|
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
@@ -18,7 +18,7 @@ declare class SocialVerificationService {
|
|
|
18
18
|
*/
|
|
19
19
|
markReady(input: v.InferInput<typeof SocialProviderInputSchema>, options?: PolyesterMutationOptions): Promise<VerificationReadyResponse>;
|
|
20
20
|
/**
|
|
21
|
-
* Returns the caller's current verification state for a provider, including status, challenge metadata, attempts, last error, and verified timestamp.
|
|
21
|
+
* Returns the caller's current verification state for a provider, including status, challenge metadata, attempts, last error, and verified timestamp. API keys need `read-social-verification` and must be scoped to the main account.
|
|
22
22
|
*/
|
|
23
23
|
get(input: v.InferInput<typeof SocialProviderInputSchema>, options?: PolyesterRequestOptions): Promise<GetVerificationResponse>;
|
|
24
24
|
/**
|
|
@@ -29,7 +29,7 @@ var SocialVerificationService = class {
|
|
|
29
29
|
return parse(VerificationReadyResponseSchema, res);
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
-
* Returns the caller's current verification state for a provider, including status, challenge metadata, attempts, last error, and verified timestamp.
|
|
32
|
+
* Returns the caller's current verification state for a provider, including status, challenge metadata, attempts, last error, and verified timestamp. API keys need `read-social-verification` and must be scoped to the main account.
|
|
33
33
|
*/
|
|
34
34
|
async get(input, options) {
|
|
35
35
|
const validated = parse(SocialProviderInputSchema, input);
|