@polyester/sdk 0.30.0 → 0.30.2
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 +14 -0
- package/dist/catalogs/snapshot-validation.js +6 -1
- package/dist/catalogs/snapshot-validation.js.map +1 -1
- package/dist/catalogs/zipper-supply.d.ts.map +1 -1
- package/dist/catalogs/zipper-supply.js +3 -3
- package/dist/catalogs/zipper-supply.js.map +1 -1
- package/dist/client.d.ts +2 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +2 -0
- package/dist/client.js.map +1 -1
- package/dist/gen/index.d.ts +2 -1
- package/dist/gen/index.js +2 -1
- package/dist/gen/rewards/v1/rewards_pb.d.ts +284 -0
- package/dist/gen/rewards/v1/rewards_pb.d.ts.map +1 -0
- package/dist/gen/rewards/v1/rewards_pb.js +117 -0
- package/dist/gen/rewards/v1/rewards_pb.js.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/services/address-book/address-book.schemas.d.ts +2 -2
- package/dist/services/balances/balances.schemas.d.ts +3 -3
- package/dist/services/candles/candles.schemas.d.ts +10 -10
- package/dist/services/heatmap/heatmap.schemas.d.ts +3 -3
- package/dist/services/lifecycle/lifecycle.schemas.d.ts +96 -96
- package/dist/services/orders/orders-batch.schemas.d.ts +14 -14
- package/dist/services/orders/orders-output.schemas.d.ts +14 -14
- package/dist/services/rewards/rewards.codecs.d.ts +8 -0
- package/dist/services/rewards/rewards.codecs.d.ts.map +1 -0
- package/dist/services/rewards/rewards.codecs.js +19 -0
- package/dist/services/rewards/rewards.codecs.js.map +1 -0
- package/dist/services/rewards/rewards.d.ts +23 -0
- package/dist/services/rewards/rewards.d.ts.map +1 -0
- package/dist/services/rewards/rewards.js +36 -0
- package/dist/services/rewards/rewards.js.map +1 -0
- package/dist/services/rewards/rewards.schemas.d.ts +85 -0
- package/dist/services/rewards/rewards.schemas.d.ts.map +1 -0
- package/dist/services/rewards/rewards.schemas.js +38 -0
- package/dist/services/rewards/rewards.schemas.js.map +1 -0
- package/dist/services/rewards/rewards.types.d.ts +3 -0
- package/dist/services/rewards/service.d.ts +8 -0
- package/dist/services/rewards/service.d.ts.map +1 -0
- package/dist/services/rewards/service.js +9 -0
- package/dist/services/rewards/service.js.map +1 -0
- package/dist/services/subaccounts/subaccounts.schemas.d.ts +11 -11
- package/dist/services/trades/trades.schemas.d.ts +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 +18 -18
- package/dist/services/whiteboard/whiteboard.schemas.d.ts +49 -49
- package/dist/wired-services.d.ts.map +1 -1
- package/dist/wired-services.js +2 -0
- package/dist/wired-services.js.map +1 -1
- package/package.json +1 -1
|
@@ -3228,20 +3228,20 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
|
|
|
3228
3228
|
readonly admissionStatus: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "rejected" | "admitted" | "partially_admitted">]>;
|
|
3229
3229
|
readonly items: v.ArraySchema<v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
3230
3230
|
readonly itemIndex: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
3231
|
-
readonly phase: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
3231
|
+
readonly phase: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "terminal" | "working" | "rejected" | "admitted">]>;
|
|
3232
3232
|
readonly oldOrderId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BigintSchema<undefined>, undefined>, v.TransformAction<bigint | undefined, string | undefined>]>;
|
|
3233
3233
|
readonly replacementOrderId: v.SchemaWithPipe<readonly [v.OptionalSchema<v.BigintSchema<undefined>, undefined>, v.TransformAction<bigint | undefined, string | undefined>]>;
|
|
3234
3234
|
readonly actionTaken: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "AMENDED" | "REPLACED">]>;
|
|
3235
|
-
readonly orderStatus: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
3235
|
+
readonly orderStatus: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "canceled" | "pending" | "pending_cancel" | "working" | "filled" | "rejected">]>;
|
|
3236
3236
|
readonly code: v.StringSchema<undefined>;
|
|
3237
3237
|
readonly updatedTsNs: v.BigintSchema<undefined>;
|
|
3238
3238
|
}, undefined>, v.TransformAction<{
|
|
3239
3239
|
itemIndex: number;
|
|
3240
|
-
phase: "unspecified" | "
|
|
3240
|
+
phase: "unspecified" | "terminal" | "working" | "rejected" | "admitted";
|
|
3241
3241
|
oldOrderId?: string | undefined;
|
|
3242
3242
|
replacementOrderId?: string | undefined;
|
|
3243
3243
|
actionTaken: "unspecified" | "AMENDED" | "REPLACED";
|
|
3244
|
-
orderStatus: "unspecified" | "
|
|
3244
|
+
orderStatus: "unspecified" | "canceled" | "pending" | "pending_cancel" | "working" | "filled" | "rejected";
|
|
3245
3245
|
code: string;
|
|
3246
3246
|
updatedTsNs: bigint;
|
|
3247
3247
|
}, {
|
|
@@ -3249,11 +3249,11 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
|
|
|
3249
3249
|
updatedTs: number;
|
|
3250
3250
|
updatedTsNs: string;
|
|
3251
3251
|
itemIndex: number;
|
|
3252
|
-
phase: "unspecified" | "
|
|
3252
|
+
phase: "unspecified" | "terminal" | "working" | "rejected" | "admitted";
|
|
3253
3253
|
oldOrderId?: string | undefined;
|
|
3254
3254
|
replacementOrderId?: string | undefined;
|
|
3255
3255
|
actionTaken: "unspecified" | "AMENDED" | "REPLACED";
|
|
3256
|
-
orderStatus: "unspecified" | "
|
|
3256
|
+
orderStatus: "unspecified" | "canceled" | "pending" | "pending_cancel" | "working" | "filled" | "rejected";
|
|
3257
3257
|
}>]>, undefined>;
|
|
3258
3258
|
readonly acceptedCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
3259
3259
|
readonly rejectedCount: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
|
|
@@ -3267,11 +3267,11 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
|
|
|
3267
3267
|
updatedTs: number;
|
|
3268
3268
|
updatedTsNs: string;
|
|
3269
3269
|
itemIndex: number;
|
|
3270
|
-
phase: "unspecified" | "
|
|
3270
|
+
phase: "unspecified" | "terminal" | "working" | "rejected" | "admitted";
|
|
3271
3271
|
oldOrderId?: string | undefined;
|
|
3272
3272
|
replacementOrderId?: string | undefined;
|
|
3273
3273
|
actionTaken: "unspecified" | "AMENDED" | "REPLACED";
|
|
3274
|
-
orderStatus: "unspecified" | "
|
|
3274
|
+
orderStatus: "unspecified" | "canceled" | "pending" | "pending_cancel" | "working" | "filled" | "rejected";
|
|
3275
3275
|
}[];
|
|
3276
3276
|
acceptedCount: number;
|
|
3277
3277
|
rejectedCount: number;
|
|
@@ -3285,11 +3285,11 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
|
|
|
3285
3285
|
updatedTs: number;
|
|
3286
3286
|
updatedTsNs: string;
|
|
3287
3287
|
itemIndex: number;
|
|
3288
|
-
phase: "unspecified" | "
|
|
3288
|
+
phase: "unspecified" | "terminal" | "working" | "rejected" | "admitted";
|
|
3289
3289
|
oldOrderId?: string | undefined;
|
|
3290
3290
|
replacementOrderId?: string | undefined;
|
|
3291
3291
|
actionTaken: "unspecified" | "AMENDED" | "REPLACED";
|
|
3292
|
-
orderStatus: "unspecified" | "
|
|
3292
|
+
orderStatus: "unspecified" | "canceled" | "pending" | "pending_cancel" | "working" | "filled" | "rejected";
|
|
3293
3293
|
}[];
|
|
3294
3294
|
acceptedCount: number;
|
|
3295
3295
|
rejectedCount: number;
|
|
@@ -3303,11 +3303,11 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
|
|
|
3303
3303
|
updatedTs: number;
|
|
3304
3304
|
updatedTsNs: string;
|
|
3305
3305
|
itemIndex: number;
|
|
3306
|
-
phase: "unspecified" | "
|
|
3306
|
+
phase: "unspecified" | "terminal" | "working" | "rejected" | "admitted";
|
|
3307
3307
|
oldOrderId?: string | undefined;
|
|
3308
3308
|
replacementOrderId?: string | undefined;
|
|
3309
3309
|
actionTaken: "unspecified" | "AMENDED" | "REPLACED";
|
|
3310
|
-
orderStatus: "unspecified" | "
|
|
3310
|
+
orderStatus: "unspecified" | "canceled" | "pending" | "pending_cancel" | "working" | "filled" | "rejected";
|
|
3311
3311
|
}[];
|
|
3312
3312
|
acceptedCount: number;
|
|
3313
3313
|
rejectedCount: number;
|
|
@@ -3325,11 +3325,11 @@ declare const GetBatchReplaceStatusResultSchema: v.SchemaWithPipe<readonly [v.Ob
|
|
|
3325
3325
|
updatedTs: number;
|
|
3326
3326
|
updatedTsNs: string;
|
|
3327
3327
|
itemIndex: number;
|
|
3328
|
-
phase: "unspecified" | "
|
|
3328
|
+
phase: "unspecified" | "terminal" | "working" | "rejected" | "admitted";
|
|
3329
3329
|
oldOrderId?: string | undefined;
|
|
3330
3330
|
replacementOrderId?: string | undefined;
|
|
3331
3331
|
actionTaken: "unspecified" | "AMENDED" | "REPLACED";
|
|
3332
|
-
orderStatus: "unspecified" | "
|
|
3332
|
+
orderStatus: "unspecified" | "canceled" | "pending" | "pending_cancel" | "working" | "filled" | "rejected";
|
|
3333
3333
|
}[];
|
|
3334
3334
|
acceptedCount: number;
|
|
3335
3335
|
rejectedCount: number;
|
|
@@ -11,7 +11,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
11
11
|
readonly symbolId: v.NumberSchema<undefined>;
|
|
12
12
|
readonly clientOrderId: v.StringSchema<undefined>;
|
|
13
13
|
readonly side: v.NumberSchema<undefined>;
|
|
14
|
-
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
14
|
+
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "canceled" | "pending" | "pending_cancel" | "working" | "filled" | "rejected">]>;
|
|
15
15
|
readonly orderType: v.NumberSchema<undefined>;
|
|
16
16
|
readonly timeInForce: v.NumberSchema<undefined>;
|
|
17
17
|
readonly selfTradePreventionMode: v.NumberSchema<undefined>;
|
|
@@ -125,7 +125,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
125
125
|
symbolId: number;
|
|
126
126
|
clientOrderId: string;
|
|
127
127
|
side: number;
|
|
128
|
-
status: "unspecified" | "
|
|
128
|
+
status: "unspecified" | "canceled" | "pending" | "pending_cancel" | "working" | "filled" | "rejected";
|
|
129
129
|
orderType: number;
|
|
130
130
|
timeInForce: number;
|
|
131
131
|
selfTradePreventionMode: number;
|
|
@@ -240,7 +240,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
240
240
|
} | undefined;
|
|
241
241
|
symbolId: number;
|
|
242
242
|
clientOrderId: string;
|
|
243
|
-
status: "unspecified" | "
|
|
243
|
+
status: "unspecified" | "canceled" | "pending" | "pending_cancel" | "working" | "filled" | "rejected" | "partial";
|
|
244
244
|
side: "unspecified" | "buy" | "sell";
|
|
245
245
|
orderType: "unspecified" | "limit" | "market";
|
|
246
246
|
timeInForce: "unspecified" | "GTC" | "IOC" | "FOK" | "GTD";
|
|
@@ -260,7 +260,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
260
260
|
attachedRisk: {
|
|
261
261
|
takeProfit: {
|
|
262
262
|
state: {
|
|
263
|
-
status: "unspecified" | "failed" | "
|
|
263
|
+
status: "unspecified" | "failed" | "canceled" | "created" | "completed" | "not_configured" | "armed" | "running" | "paused";
|
|
264
264
|
armedTs: number | undefined;
|
|
265
265
|
armedTsNs: string | undefined;
|
|
266
266
|
terminalTs: number | undefined;
|
|
@@ -279,7 +279,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
279
279
|
} | undefined;
|
|
280
280
|
stopLoss: {
|
|
281
281
|
state: {
|
|
282
|
-
status: "unspecified" | "failed" | "
|
|
282
|
+
status: "unspecified" | "failed" | "canceled" | "created" | "completed" | "not_configured" | "armed" | "running" | "paused";
|
|
283
283
|
armedTs: number | undefined;
|
|
284
284
|
armedTsNs: string | undefined;
|
|
285
285
|
terminalTs: number | undefined;
|
|
@@ -298,7 +298,7 @@ declare function createOrderSchema(scales: SdkScales): v.SchemaWithPipe<readonly
|
|
|
298
298
|
} | undefined;
|
|
299
299
|
trailingStop: {
|
|
300
300
|
state: {
|
|
301
|
-
status: "unspecified" | "failed" | "
|
|
301
|
+
status: "unspecified" | "failed" | "canceled" | "created" | "completed" | "not_configured" | "armed" | "running" | "paused";
|
|
302
302
|
armedTs: number | undefined;
|
|
303
303
|
armedTsNs: string | undefined;
|
|
304
304
|
terminalTs: number | undefined;
|
|
@@ -368,7 +368,7 @@ declare function createOrderTransferSchema(): v.SchemaWithPipe<readonly [v.Objec
|
|
|
368
368
|
timestamp: number;
|
|
369
369
|
amount: string;
|
|
370
370
|
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";
|
|
371
|
-
accountCode: "unspecified" | "
|
|
371
|
+
accountCode: "unspecified" | "funding" | "trading";
|
|
372
372
|
}>]>;
|
|
373
373
|
type OrderTransfer = v.InferOutput<ReturnType<typeof createOrderTransferSchema>>;
|
|
374
374
|
declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
@@ -382,7 +382,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
382
382
|
readonly symbolId: v.NumberSchema<undefined>;
|
|
383
383
|
readonly clientOrderId: v.StringSchema<undefined>;
|
|
384
384
|
readonly side: v.NumberSchema<undefined>;
|
|
385
|
-
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "
|
|
385
|
+
readonly status: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "canceled" | "pending" | "pending_cancel" | "working" | "filled" | "rejected">]>;
|
|
386
386
|
readonly orderType: v.NumberSchema<undefined>;
|
|
387
387
|
readonly timeInForce: v.NumberSchema<undefined>;
|
|
388
388
|
readonly selfTradePreventionMode: v.NumberSchema<undefined>;
|
|
@@ -496,7 +496,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
496
496
|
symbolId: number;
|
|
497
497
|
clientOrderId: string;
|
|
498
498
|
side: number;
|
|
499
|
-
status: "unspecified" | "
|
|
499
|
+
status: "unspecified" | "canceled" | "pending" | "pending_cancel" | "working" | "filled" | "rejected";
|
|
500
500
|
orderType: number;
|
|
501
501
|
timeInForce: number;
|
|
502
502
|
selfTradePreventionMode: number;
|
|
@@ -611,7 +611,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
611
611
|
} | undefined;
|
|
612
612
|
symbolId: number;
|
|
613
613
|
clientOrderId: string;
|
|
614
|
-
status: "unspecified" | "
|
|
614
|
+
status: "unspecified" | "canceled" | "pending" | "pending_cancel" | "working" | "filled" | "rejected" | "partial";
|
|
615
615
|
side: "unspecified" | "buy" | "sell";
|
|
616
616
|
orderType: "unspecified" | "limit" | "market";
|
|
617
617
|
timeInForce: "unspecified" | "GTC" | "IOC" | "FOK" | "GTD";
|
|
@@ -631,7 +631,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
631
631
|
attachedRisk: {
|
|
632
632
|
takeProfit: {
|
|
633
633
|
state: {
|
|
634
|
-
status: "unspecified" | "failed" | "
|
|
634
|
+
status: "unspecified" | "failed" | "canceled" | "created" | "completed" | "not_configured" | "armed" | "running" | "paused";
|
|
635
635
|
armedTs: number | undefined;
|
|
636
636
|
armedTsNs: string | undefined;
|
|
637
637
|
terminalTs: number | undefined;
|
|
@@ -650,7 +650,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
650
650
|
} | undefined;
|
|
651
651
|
stopLoss: {
|
|
652
652
|
state: {
|
|
653
|
-
status: "unspecified" | "failed" | "
|
|
653
|
+
status: "unspecified" | "failed" | "canceled" | "created" | "completed" | "not_configured" | "armed" | "running" | "paused";
|
|
654
654
|
armedTs: number | undefined;
|
|
655
655
|
armedTsNs: string | undefined;
|
|
656
656
|
terminalTs: number | undefined;
|
|
@@ -669,7 +669,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
669
669
|
} | undefined;
|
|
670
670
|
trailingStop: {
|
|
671
671
|
state: {
|
|
672
|
-
status: "unspecified" | "failed" | "
|
|
672
|
+
status: "unspecified" | "failed" | "canceled" | "created" | "completed" | "not_configured" | "armed" | "running" | "paused";
|
|
673
673
|
armedTs: number | undefined;
|
|
674
674
|
armedTsNs: string | undefined;
|
|
675
675
|
terminalTs: number | undefined;
|
|
@@ -804,7 +804,7 @@ declare function createOrderDetailsSchema(scales: SdkScales): v.ObjectSchema<{
|
|
|
804
804
|
timestamp: number;
|
|
805
805
|
amount: string;
|
|
806
806
|
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";
|
|
807
|
-
accountCode: "unspecified" | "
|
|
807
|
+
accountCode: "unspecified" | "funding" | "trading";
|
|
808
808
|
}>]>, undefined>, readonly []>;
|
|
809
809
|
}, undefined>;
|
|
810
810
|
type OrderDetails = v.InferOutput<ReturnType<typeof createOrderDetailsSchema>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/services/rewards/rewards.codecs.d.ts
|
|
2
|
+
declare const REWARD_FULFILLMENT_METHOD_VALUES: readonly ["unspecified", "external_testnet", "internal_trading"];
|
|
3
|
+
type RewardFulfillmentMethod = (typeof REWARD_FULFILLMENT_METHOD_VALUES)[number];
|
|
4
|
+
declare const REWARD_FULFILLMENT_STATE_VALUES: readonly ["unspecified", "awaiting_destination", "ready_for_payout", "paid", "failed", "canceled"];
|
|
5
|
+
type RewardFulfillmentState = (typeof REWARD_FULFILLMENT_STATE_VALUES)[number];
|
|
6
|
+
//#endregion
|
|
7
|
+
export { REWARD_FULFILLMENT_METHOD_VALUES, REWARD_FULFILLMENT_STATE_VALUES, RewardFulfillmentMethod, RewardFulfillmentState };
|
|
8
|
+
//# sourceMappingURL=rewards.codecs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rewards.codecs.d.ts","names":[],"sources":["../../../src/services/rewards/rewards.codecs.ts"],"mappings":";cAGa;KAKD,kCAAkC;cAEjC;KAQD,iCAAiC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import "../../gen/rewards/v1/rewards_pb.js";
|
|
2
|
+
//#region src/services/rewards/rewards.codecs.ts
|
|
3
|
+
const RewardFulfillmentMethodCodec = { protoToOutput: {
|
|
4
|
+
[0]: "unspecified",
|
|
5
|
+
[1]: "external_testnet",
|
|
6
|
+
[2]: "internal_trading"
|
|
7
|
+
} };
|
|
8
|
+
const RewardFulfillmentStateCodec = { protoToOutput: {
|
|
9
|
+
[0]: "unspecified",
|
|
10
|
+
[1]: "awaiting_destination",
|
|
11
|
+
[2]: "ready_for_payout",
|
|
12
|
+
[3]: "paid",
|
|
13
|
+
[4]: "failed",
|
|
14
|
+
[5]: "canceled"
|
|
15
|
+
} };
|
|
16
|
+
//#endregion
|
|
17
|
+
export { RewardFulfillmentMethodCodec, RewardFulfillmentStateCodec };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=rewards.codecs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rewards.codecs.js","names":[],"sources":["../../../src/services/rewards/rewards.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/rewards/v1/rewards_pb.js\";\nimport type { ProtoToOutput } from \"../../utils/types.js\";\n\nexport const REWARD_FULFILLMENT_METHOD_VALUES = [\n \"unspecified\",\n \"external_testnet\",\n \"internal_trading\",\n] as const;\nexport type RewardFulfillmentMethod = (typeof REWARD_FULFILLMENT_METHOD_VALUES)[number];\n\nexport const REWARD_FULFILLMENT_STATE_VALUES = [\n \"unspecified\",\n \"awaiting_destination\",\n \"ready_for_payout\",\n \"paid\",\n \"failed\",\n \"canceled\",\n] as const;\nexport type RewardFulfillmentState = (typeof REWARD_FULFILLMENT_STATE_VALUES)[number];\n\nexport const RewardFulfillmentMethodCodec = {\n protoToOutput: {\n [Proto.RewardFulfillmentMethod.METHOD_UNSPECIFIED]: \"unspecified\",\n [Proto.RewardFulfillmentMethod.EXTERNAL_TESTNET]: \"external_testnet\",\n [Proto.RewardFulfillmentMethod.INTERNAL_TRADING]: \"internal_trading\",\n } satisfies ProtoToOutput<Proto.RewardFulfillmentMethod, RewardFulfillmentMethod>,\n} as const;\n\nexport const RewardFulfillmentStateCodec = {\n protoToOutput: {\n [Proto.RewardFulfillmentState.STATE_UNSPECIFIED]: \"unspecified\",\n [Proto.RewardFulfillmentState.AWAITING_DESTINATION]: \"awaiting_destination\",\n [Proto.RewardFulfillmentState.READY_FOR_PAYOUT]: \"ready_for_payout\",\n [Proto.RewardFulfillmentState.PAID]: \"paid\",\n [Proto.RewardFulfillmentState.FAILED]: \"failed\",\n [Proto.RewardFulfillmentState.CANCELED]: \"canceled\",\n } satisfies ProtoToOutput<Proto.RewardFulfillmentState, RewardFulfillmentState>,\n} as const;\n"],"mappings":";;AAoBA,MAAa,+BAA+B,EACxC,eAAe;EACyC,IAAA;EACF,IAAA;EACA,IAAA;AACtD,EACJ;AAEA,MAAa,8BAA8B,EACvC,eAAe;EACuC,IAAA;EACG,IAAA;EACJ,IAAA;EACZ,IAAA;EACE,IAAA;EACE,IAAA;AAC7C,EACJ"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AuthApiTransports } from "../../shared/transports.js";
|
|
2
|
+
import { PolyesterMutationOptions, PolyesterRequestOptions } from "../../shared/request-options.js";
|
|
3
|
+
import { ListRewardAwardsInput, ListRewardAwardsResult, SetRewardDestinationInput, SetRewardDestinationResult } from "./rewards.schemas.js";
|
|
4
|
+
//#region src/services/rewards/rewards.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Reads published reward campaign awards for the authenticated root account and records payout destinations.
|
|
7
|
+
* The server accepts session JWTs for this service; API keys are not accepted.
|
|
8
|
+
*/
|
|
9
|
+
declare class RewardsService {
|
|
10
|
+
#private;
|
|
11
|
+
constructor(transports: AuthApiTransports);
|
|
12
|
+
/**
|
|
13
|
+
* Returns published awards newest first. `limit` is 0 through 100 (0 or omitted uses 50); pass the previous `nextPageToken` as `pageToken` to continue. An empty `nextPageToken` means no more awards.
|
|
14
|
+
*/
|
|
15
|
+
listAwards(input?: ListRewardAwardsInput, options?: PolyesterRequestOptions): Promise<ListRewardAwardsResult>;
|
|
16
|
+
/**
|
|
17
|
+
* Records a write-once payout destination for an award, interpreted in the award's `network`. Pass the award's `fulfillmentRevision` as `expectedRevision` and reuse the same `requestId` when retrying. Requires a fresh step-up proof via `options.stepUpToken`. This does not execute a transfer or mark the award delivered.
|
|
18
|
+
*/
|
|
19
|
+
setDestination(input: SetRewardDestinationInput, options?: PolyesterMutationOptions): Promise<SetRewardDestinationResult>;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { RewardsService };
|
|
23
|
+
//# sourceMappingURL=rewards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rewards.d.ts","names":[],"sources":["../../../src/services/rewards/rewards.ts"],"mappings":";;;;;;;;cAwBa;;EAGG,YAAA,YAAY;;;;EAOlB,WACF,QAAO,uBACP,UAAU,0BACX,QAAQ;;;;EAYL,eACF,OAAO,2BACP,UAAU,2BACX,QAAQ"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { parse } from "../../shared/validation.js";
|
|
2
|
+
import { toConnectCallOptions } from "../../shared/request-options.js";
|
|
3
|
+
import { RewardCampaignService } from "../../gen/rewards/v1/rewards_pb.js";
|
|
4
|
+
import { ListRewardAwardsInputSchema, ListRewardAwardsResultSchema, SetRewardDestinationInputSchema, SetRewardDestinationResultSchema } from "./rewards.schemas.js";
|
|
5
|
+
import { createClient } from "@connectrpc/connect";
|
|
6
|
+
//#region src/services/rewards/rewards.ts
|
|
7
|
+
/**
|
|
8
|
+
* Reads published reward campaign awards for the authenticated root account and records payout destinations.
|
|
9
|
+
* The server accepts session JWTs for this service; API keys are not accepted.
|
|
10
|
+
*/
|
|
11
|
+
var RewardsService = class {
|
|
12
|
+
#client;
|
|
13
|
+
constructor(transports) {
|
|
14
|
+
this.#client = createClient(RewardCampaignService, transports.authApi);
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Returns published awards newest first. `limit` is 0 through 100 (0 or omitted uses 50); pass the previous `nextPageToken` as `pageToken` to continue. An empty `nextPageToken` means no more awards.
|
|
18
|
+
*/
|
|
19
|
+
async listAwards(input = {}, options) {
|
|
20
|
+
const request = parse(ListRewardAwardsInputSchema, input);
|
|
21
|
+
const response = await this.#client.listMyRewardAwards(request, toConnectCallOptions(options));
|
|
22
|
+
return parse(ListRewardAwardsResultSchema, response);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Records a write-once payout destination for an award, interpreted in the award's `network`. Pass the award's `fulfillmentRevision` as `expectedRevision` and reuse the same `requestId` when retrying. Requires a fresh step-up proof via `options.stepUpToken`. This does not execute a transfer or mark the award delivered.
|
|
26
|
+
*/
|
|
27
|
+
async setDestination(input, options) {
|
|
28
|
+
const request = parse(SetRewardDestinationInputSchema, input);
|
|
29
|
+
const response = await this.#client.setMyRewardDestination(request, toConnectCallOptions(options));
|
|
30
|
+
return parse(SetRewardDestinationResultSchema, response);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { RewardsService };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=rewards.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rewards.js","names":["#client","Proto.RewardCampaignService"],"sources":["../../../src/services/rewards/rewards.ts"],"sourcesContent":["import { createClient, type Client } from \"@connectrpc/connect\";\nimport * as Proto from \"../../gen/rewards/v1/rewards_pb.js\";\nimport {\n toConnectCallOptions,\n type PolyesterMutationOptions,\n type PolyesterRequestOptions,\n} from \"../../shared/request-options.js\";\nimport type { AuthApiTransports } from \"../../shared/transports.js\";\nimport { parse } from \"../../shared/validation.js\";\nimport {\n ListRewardAwardsInputSchema,\n ListRewardAwardsResultSchema,\n type ListRewardAwardsInput,\n type ListRewardAwardsResult,\n SetRewardDestinationInputSchema,\n SetRewardDestinationResultSchema,\n type SetRewardDestinationInput,\n type SetRewardDestinationResult,\n} from \"./rewards.schemas.js\";\n\n/**\n * Reads published reward campaign awards for the authenticated root account and records payout destinations.\n * The server accepts session JWTs for this service; API keys are not accepted.\n */\nexport class RewardsService {\n #client: Client<typeof Proto.RewardCampaignService>;\n\n constructor(transports: AuthApiTransports) {\n this.#client = createClient(Proto.RewardCampaignService, transports.authApi);\n }\n\n /**\n * Returns published awards newest first. `limit` is 0 through 100 (0 or omitted uses 50); pass the previous `nextPageToken` as `pageToken` to continue. An empty `nextPageToken` means no more awards.\n */\n async listAwards(\n input: ListRewardAwardsInput = {},\n options?: PolyesterRequestOptions,\n ): Promise<ListRewardAwardsResult> {\n const request = parse(ListRewardAwardsInputSchema, input);\n const response = await this.#client.listMyRewardAwards(\n request,\n toConnectCallOptions(options),\n );\n return parse(ListRewardAwardsResultSchema, response);\n }\n\n /**\n * Records a write-once payout destination for an award, interpreted in the award's `network`. Pass the award's `fulfillmentRevision` as `expectedRevision` and reuse the same `requestId` when retrying. Requires a fresh step-up proof via `options.stepUpToken`. This does not execute a transfer or mark the award delivered.\n */\n async setDestination(\n input: SetRewardDestinationInput,\n options?: PolyesterMutationOptions,\n ): Promise<SetRewardDestinationResult> {\n const request = parse(SetRewardDestinationInputSchema, input);\n const response = await this.#client.setMyRewardDestination(\n request,\n toConnectCallOptions(options),\n );\n return parse(SetRewardDestinationResultSchema, response);\n }\n}\n"],"mappings":";;;;;;;;;;AAwBA,IAAa,iBAAb,MAA4B;CACxB;CAEA,YAAY,YAA+B;EACvC,KAAKA,UAAU,aAAaC,uBAA6B,WAAW,OAAO;CAC/E;;;;CAKA,MAAM,WACF,QAA+B,CAAC,GAChC,SAC+B;EAC/B,MAAM,UAAU,MAAM,6BAA6B,KAAK;EACxD,MAAM,WAAW,MAAM,KAAKD,QAAQ,mBAChC,SACA,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,8BAA8B,QAAQ;CACvD;;;;CAKA,MAAM,eACF,OACA,SACmC;EACnC,MAAM,UAAU,MAAM,iCAAiC,KAAK;EAC5D,MAAM,WAAW,MAAM,KAAKA,QAAQ,uBAChC,SACA,qBAAqB,OAAO,CAChC;EACA,OAAO,MAAM,kCAAkC,QAAQ;CAC3D;AACJ"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
//#region src/services/rewards/rewards.schemas.d.ts
|
|
3
|
+
declare const ListRewardAwardsInputSchema: v.StrictObjectSchema<{
|
|
4
|
+
readonly limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>, v.MaxValueAction<number, 100, undefined>]>, undefined>;
|
|
5
|
+
readonly pageToken: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MaxLengthAction<string, 256, undefined>]>, "">;
|
|
6
|
+
}, undefined>;
|
|
7
|
+
type ListRewardAwardsInput = v.InferInput<typeof ListRewardAwardsInputSchema>;
|
|
8
|
+
declare const SetRewardDestinationInputSchema: v.StrictObjectSchema<{
|
|
9
|
+
readonly awardId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>]>;
|
|
10
|
+
readonly destinationAddress: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 512, undefined>]>;
|
|
11
|
+
readonly expectedRevision: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction]>, v.RegexAction<string, `${string} must be a decimal integer`>, v.TransformAction<string, bigint>]>, v.CheckAction<bigint, `${string} must be greater than 0`>]>;
|
|
12
|
+
readonly requestId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 128, undefined>]>;
|
|
13
|
+
}, undefined>;
|
|
14
|
+
type SetRewardDestinationInput = v.InferInput<typeof SetRewardDestinationInputSchema>;
|
|
15
|
+
declare const RewardAwardSchema: v.ObjectSchema<{
|
|
16
|
+
readonly awardId: v.StringSchema<undefined>;
|
|
17
|
+
readonly campaignId: v.StringSchema<undefined>;
|
|
18
|
+
readonly campaignName: v.StringSchema<undefined>;
|
|
19
|
+
readonly assetId: v.NumberSchema<undefined>;
|
|
20
|
+
readonly amountBaseUnits: v.StringSchema<undefined>;
|
|
21
|
+
readonly fulfillmentMethod: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "external_testnet" | "internal_trading">]>;
|
|
22
|
+
readonly fulfillmentState: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "awaiting_destination" | "ready_for_payout" | "paid" | "failed" | "canceled">]>;
|
|
23
|
+
readonly publishedAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
24
|
+
readonly seconds: v.BigintSchema<undefined>;
|
|
25
|
+
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
26
|
+
}, undefined>, undefined>, v.TransformAction<{
|
|
27
|
+
seconds: bigint;
|
|
28
|
+
nanos: number;
|
|
29
|
+
} | undefined, number | undefined>]>;
|
|
30
|
+
readonly network: v.StringSchema<undefined>;
|
|
31
|
+
readonly fulfillmentRevision: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
32
|
+
readonly destinationAddress: v.StringSchema<undefined>;
|
|
33
|
+
readonly transactionId: v.StringSchema<undefined>;
|
|
34
|
+
}, undefined>;
|
|
35
|
+
type RewardAward = v.InferOutput<typeof RewardAwardSchema>;
|
|
36
|
+
declare const ListRewardAwardsResultSchema: v.ObjectSchema<{
|
|
37
|
+
readonly awards: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
38
|
+
readonly awardId: v.StringSchema<undefined>;
|
|
39
|
+
readonly campaignId: v.StringSchema<undefined>;
|
|
40
|
+
readonly campaignName: v.StringSchema<undefined>;
|
|
41
|
+
readonly assetId: v.NumberSchema<undefined>;
|
|
42
|
+
readonly amountBaseUnits: v.StringSchema<undefined>;
|
|
43
|
+
readonly fulfillmentMethod: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "external_testnet" | "internal_trading">]>;
|
|
44
|
+
readonly fulfillmentState: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "awaiting_destination" | "ready_for_payout" | "paid" | "failed" | "canceled">]>;
|
|
45
|
+
readonly publishedAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
46
|
+
readonly seconds: v.BigintSchema<undefined>;
|
|
47
|
+
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
48
|
+
}, undefined>, undefined>, v.TransformAction<{
|
|
49
|
+
seconds: bigint;
|
|
50
|
+
nanos: number;
|
|
51
|
+
} | undefined, number | undefined>]>;
|
|
52
|
+
readonly network: v.StringSchema<undefined>;
|
|
53
|
+
readonly fulfillmentRevision: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
54
|
+
readonly destinationAddress: v.StringSchema<undefined>;
|
|
55
|
+
readonly transactionId: v.StringSchema<undefined>;
|
|
56
|
+
}, undefined>, undefined>, readonly []>;
|
|
57
|
+
readonly nextPageToken: v.StringSchema<undefined>;
|
|
58
|
+
}, undefined>;
|
|
59
|
+
type ListRewardAwardsResult = v.InferOutput<typeof ListRewardAwardsResultSchema>;
|
|
60
|
+
declare const SetRewardDestinationResultSchema: v.ObjectSchema<{
|
|
61
|
+
readonly award: v.ObjectSchema<{
|
|
62
|
+
readonly awardId: v.StringSchema<undefined>;
|
|
63
|
+
readonly campaignId: v.StringSchema<undefined>;
|
|
64
|
+
readonly campaignName: v.StringSchema<undefined>;
|
|
65
|
+
readonly assetId: v.NumberSchema<undefined>;
|
|
66
|
+
readonly amountBaseUnits: v.StringSchema<undefined>;
|
|
67
|
+
readonly fulfillmentMethod: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "external_testnet" | "internal_trading">]>;
|
|
68
|
+
readonly fulfillmentState: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, "unspecified" | "awaiting_destination" | "ready_for_payout" | "paid" | "failed" | "canceled">]>;
|
|
69
|
+
readonly publishedAt: v.SchemaWithPipe<readonly [v.OptionalSchema<v.ObjectSchema<{
|
|
70
|
+
readonly seconds: v.BigintSchema<undefined>;
|
|
71
|
+
readonly nanos: v.OptionalSchema<v.NumberSchema<undefined>, 0>;
|
|
72
|
+
}, undefined>, undefined>, v.TransformAction<{
|
|
73
|
+
seconds: bigint;
|
|
74
|
+
nanos: number;
|
|
75
|
+
} | undefined, number | undefined>]>;
|
|
76
|
+
readonly network: v.StringSchema<undefined>;
|
|
77
|
+
readonly fulfillmentRevision: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, string>]>;
|
|
78
|
+
readonly destinationAddress: v.StringSchema<undefined>;
|
|
79
|
+
readonly transactionId: v.StringSchema<undefined>;
|
|
80
|
+
}, undefined>;
|
|
81
|
+
}, undefined>;
|
|
82
|
+
type SetRewardDestinationResult = v.InferOutput<typeof SetRewardDestinationResultSchema>;
|
|
83
|
+
//#endregion
|
|
84
|
+
export { ListRewardAwardsInput, ListRewardAwardsInputSchema, ListRewardAwardsResult, ListRewardAwardsResultSchema, RewardAward, RewardAwardSchema, SetRewardDestinationInput, SetRewardDestinationInputSchema, SetRewardDestinationResult, SetRewardDestinationResultSchema };
|
|
85
|
+
//# sourceMappingURL=rewards.schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rewards.schemas.d.ts","names":[],"sources":["../../../src/services/rewards/rewards.schemas.ts"],"mappings":";;cASa,6BAA2B,EAAA;;;;KAK5B,wBAAwB,EAAE,kBAAkB;cAE3C,iCAA+B,EAAA;;;;;;KAOhC,4BAA4B,EAAE,kBAAkB;cAE/C,mBAAiB,EAAA;;;;;;;;;;;;;;;;;;;;KAelB,cAAc,EAAE,mBAAmB;cAElC,8BAA4B,EAAA;;;;;;;;;;;;;;;;;;;;;;;KAK7B,yBAAyB,EAAE,mBAAmB;cAE7C,kCAAgC,EAAA;;;;;;;;;;;;;;;;;;;;;;KAIjC,6BAA6B,EAAE,mBAAmB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { BigIntStringSchema, OptionalTimestampMsSchema, positiveBigintStringInputSchema } from "../../shared/schemas.js";
|
|
2
|
+
import { enumLabelSchema } from "../../shared/proto-enum-codec.js";
|
|
3
|
+
import { RewardFulfillmentMethodCodec, RewardFulfillmentStateCodec } from "./rewards.codecs.js";
|
|
4
|
+
import * as v from "valibot";
|
|
5
|
+
//#region src/services/rewards/rewards.schemas.ts
|
|
6
|
+
const ListRewardAwardsInputSchema = v.strictObject({
|
|
7
|
+
limit: v.optional(v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(100))),
|
|
8
|
+
pageToken: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(256)), "")
|
|
9
|
+
});
|
|
10
|
+
const SetRewardDestinationInputSchema = v.strictObject({
|
|
11
|
+
awardId: v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(128)),
|
|
12
|
+
destinationAddress: v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(512)),
|
|
13
|
+
expectedRevision: positiveBigintStringInputSchema("expectedRevision"),
|
|
14
|
+
requestId: v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(128))
|
|
15
|
+
});
|
|
16
|
+
const RewardAwardSchema = v.object({
|
|
17
|
+
awardId: v.string(),
|
|
18
|
+
campaignId: v.string(),
|
|
19
|
+
campaignName: v.string(),
|
|
20
|
+
assetId: v.number(),
|
|
21
|
+
amountBaseUnits: v.string(),
|
|
22
|
+
fulfillmentMethod: enumLabelSchema(RewardFulfillmentMethodCodec.protoToOutput),
|
|
23
|
+
fulfillmentState: enumLabelSchema(RewardFulfillmentStateCodec.protoToOutput),
|
|
24
|
+
publishedAt: OptionalTimestampMsSchema,
|
|
25
|
+
network: v.string(),
|
|
26
|
+
fulfillmentRevision: BigIntStringSchema,
|
|
27
|
+
destinationAddress: v.string(),
|
|
28
|
+
transactionId: v.string()
|
|
29
|
+
});
|
|
30
|
+
const ListRewardAwardsResultSchema = v.object({
|
|
31
|
+
awards: v.optional(v.array(RewardAwardSchema), []),
|
|
32
|
+
nextPageToken: v.string()
|
|
33
|
+
});
|
|
34
|
+
const SetRewardDestinationResultSchema = v.object({ award: RewardAwardSchema });
|
|
35
|
+
//#endregion
|
|
36
|
+
export { ListRewardAwardsInputSchema, ListRewardAwardsResultSchema, RewardAwardSchema, SetRewardDestinationInputSchema, SetRewardDestinationResultSchema };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=rewards.schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rewards.schemas.js","names":[],"sources":["../../../src/services/rewards/rewards.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport { enumLabelSchema } from \"../../shared/proto-enum-codec.js\";\nimport {\n BigIntStringSchema,\n OptionalTimestampMsSchema,\n positiveBigintStringInputSchema,\n} from \"../../shared/schemas.js\";\nimport { RewardFulfillmentMethodCodec, RewardFulfillmentStateCodec } from \"./rewards.codecs.js\";\n\nexport const ListRewardAwardsInputSchema = v.strictObject({\n limit: v.optional(v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(100))),\n pageToken: v.optional(v.pipe(v.string(), v.trim(), v.maxLength(256)), \"\"),\n});\n\nexport type ListRewardAwardsInput = v.InferInput<typeof ListRewardAwardsInputSchema>;\n\nexport const SetRewardDestinationInputSchema = v.strictObject({\n awardId: v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(128)),\n destinationAddress: v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(512)),\n expectedRevision: positiveBigintStringInputSchema(\"expectedRevision\"),\n requestId: v.pipe(v.string(), v.trim(), v.minLength(1), v.maxLength(128)),\n});\n\nexport type SetRewardDestinationInput = v.InferInput<typeof SetRewardDestinationInputSchema>;\n\nexport const RewardAwardSchema = v.object({\n awardId: v.string(),\n campaignId: v.string(),\n campaignName: v.string(),\n assetId: v.number(),\n amountBaseUnits: v.string(),\n fulfillmentMethod: enumLabelSchema(RewardFulfillmentMethodCodec.protoToOutput),\n fulfillmentState: enumLabelSchema(RewardFulfillmentStateCodec.protoToOutput),\n publishedAt: OptionalTimestampMsSchema,\n network: v.string(),\n fulfillmentRevision: BigIntStringSchema,\n destinationAddress: v.string(),\n transactionId: v.string(),\n});\n\nexport type RewardAward = v.InferOutput<typeof RewardAwardSchema>;\n\nexport const ListRewardAwardsResultSchema = v.object({\n awards: v.optional(v.array(RewardAwardSchema), []),\n nextPageToken: v.string(),\n});\n\nexport type ListRewardAwardsResult = v.InferOutput<typeof ListRewardAwardsResultSchema>;\n\nexport const SetRewardDestinationResultSchema = v.object({\n award: RewardAwardSchema,\n});\n\nexport type SetRewardDestinationResult = v.InferOutput<typeof SetRewardDestinationResultSchema>;\n"],"mappings":";;;;;AASA,MAAa,8BAA8B,EAAE,aAAa;CACtD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,QAAQ,GAAG,EAAE,SAAS,CAAC,GAAG,EAAE,SAAS,GAAG,CAAC,CAAC;CACjF,WAAW,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,GAAG,EAAE,UAAU,GAAG,CAAC,GAAG,EAAE;AAC5E,CAAC;AAID,MAAa,kCAAkC,EAAE,aAAa;CAC1D,SAAS,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,CAAC;CACtE,oBAAoB,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,CAAC;CACjF,kBAAkB,gCAAgC,kBAAkB;CACpE,WAAW,EAAE,KAAK,EAAE,OAAO,GAAG,EAAE,KAAK,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,CAAC;AAC5E,CAAC;AAID,MAAa,oBAAoB,EAAE,OAAO;CACtC,SAAS,EAAE,OAAO;CAClB,YAAY,EAAE,OAAO;CACrB,cAAc,EAAE,OAAO;CACvB,SAAS,EAAE,OAAO;CAClB,iBAAiB,EAAE,OAAO;CAC1B,mBAAmB,gBAAgB,6BAA6B,aAAa;CAC7E,kBAAkB,gBAAgB,4BAA4B,aAAa;CAC3E,aAAa;CACb,SAAS,EAAE,OAAO;CAClB,qBAAqB;CACrB,oBAAoB,EAAE,OAAO;CAC7B,eAAe,EAAE,OAAO;AAC5B,CAAC;AAID,MAAa,+BAA+B,EAAE,OAAO;CACjD,QAAQ,EAAE,SAAS,EAAE,MAAM,iBAAiB,GAAG,CAAC,CAAC;CACjD,eAAe,EAAE,OAAO;AAC5B,CAAC;AAID,MAAa,mCAAmC,EAAE,OAAO,EACrD,OAAO,kBACX,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ListRewardAwardsInput, ListRewardAwardsResult, RewardAward, SetRewardDestinationInput, SetRewardDestinationResult } from "./rewards.schemas.js";
|
|
2
|
+
import { RewardFulfillmentMethod, RewardFulfillmentState } from "./rewards.codecs.js";
|
|
3
|
+
export type { ListRewardAwardsInput, ListRewardAwardsResult, RewardAward, RewardFulfillmentMethod, RewardFulfillmentState, SetRewardDestinationInput, SetRewardDestinationResult };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RewardsService } from "./rewards.js";
|
|
2
|
+
import { PolyesterCore } from "../../core-client.js";
|
|
3
|
+
//#region src/services/rewards/service.d.ts
|
|
4
|
+
/** Returns the client's RewardsService, creating it on first use. */
|
|
5
|
+
declare const rewardsService: (client: PolyesterCore) => RewardsService;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { rewardsService };
|
|
8
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","names":[],"sources":["../../../src/services/rewards/service.ts"],"mappings":";;;;cAIa,iBAAc,QAAd,kBAAc"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { defineService } from "../../core-client.js";
|
|
2
|
+
import { RewardsService } from "./rewards.js";
|
|
3
|
+
//#region src/services/rewards/service.ts
|
|
4
|
+
/** Returns the client's RewardsService, creating it on first use. */
|
|
5
|
+
const rewardsService = defineService((context) => new RewardsService(context.transports));
|
|
6
|
+
//#endregion
|
|
7
|
+
export { rewardsService };
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.js","names":[],"sources":["../../../src/services/rewards/service.ts"],"sourcesContent":["import { defineService } from \"../../core-client.js\";\nimport { RewardsService } from \"./rewards.js\";\n\n/** Returns the client's RewardsService, creating it on first use. */\nexport const rewardsService = defineService((context) => new RewardsService(context.transports));\n"],"mappings":";;;;AAIA,MAAa,iBAAiB,eAAe,YAAY,IAAI,eAAe,QAAQ,UAAU,CAAC"}
|