@polyester/sdk 0.32.2-devnet-20261102211233 → 0.32.2-devnet-20261103155212

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.
Files changed (102) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/dist/client.d.ts +2 -0
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +2 -0
  5. package/dist/client.js.map +1 -1
  6. package/dist/gen/auth/v1/address_book_pb.d.ts +6 -3
  7. package/dist/gen/auth/v1/address_book_pb.d.ts.map +1 -1
  8. package/dist/gen/auth/v1/address_book_pb.js.map +1 -1
  9. package/dist/gen/auth/v1/auth_pb.d.ts +48 -1
  10. package/dist/gen/auth/v1/auth_pb.d.ts.map +1 -1
  11. package/dist/gen/auth/v1/auth_pb.js +48 -1
  12. package/dist/gen/auth/v1/auth_pb.js.map +1 -1
  13. package/dist/gen/auth/v1/subaccounts_pb.d.ts +4 -2
  14. package/dist/gen/auth/v1/subaccounts_pb.d.ts.map +1 -1
  15. package/dist/gen/auth/v1/subaccounts_pb.js.map +1 -1
  16. package/dist/gen/chain/guard/v1/guard_signer_pb.d.ts +1 -1
  17. package/dist/gen/chain/guard/v1/guard_signer_pb.js.map +1 -1
  18. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts +16 -1
  19. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.d.ts.map +1 -1
  20. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.js +4 -1
  21. package/dist/gen/chain/withdraw/v1/auto_withdraw_pb.js.map +1 -1
  22. package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts +3 -1
  23. package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts.map +1 -1
  24. package/dist/gen/chain/withdraw/v1/withdraw_pb.js.map +1 -1
  25. package/dist/gen/changelog/v1/changelog_pb.d.ts +29 -3
  26. package/dist/gen/changelog/v1/changelog_pb.d.ts.map +1 -1
  27. package/dist/gen/changelog/v1/changelog_pb.js +22 -3
  28. package/dist/gen/changelog/v1/changelog_pb.js.map +1 -1
  29. package/dist/gen/index.js +2 -2
  30. package/dist/gen/ledger/read/v1/ledger_read_pb.js +1 -1
  31. package/dist/gen/marketoverview/v1/marketoverview_pb.d.ts +5 -0
  32. package/dist/gen/marketoverview/v1/marketoverview_pb.d.ts.map +1 -1
  33. package/dist/gen/marketoverview/v1/marketoverview_pb.js.map +1 -1
  34. package/dist/gen/orders/v1/orders_pb.d.ts +58 -6
  35. package/dist/gen/orders/v1/orders_pb.d.ts.map +1 -1
  36. package/dist/gen/orders/v1/orders_pb.js.map +1 -1
  37. package/dist/gen/orders/v1/orders_read_pb.d.ts +97 -7
  38. package/dist/gen/orders/v1/orders_read_pb.d.ts.map +1 -1
  39. package/dist/gen/orders/v1/orders_read_pb.js +36 -22
  40. package/dist/gen/orders/v1/orders_read_pb.js.map +1 -1
  41. package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts +11 -9
  42. package/dist/gen/swap/quickswap/v1/quickswap_pb.d.ts.map +1 -1
  43. package/dist/gen/swap/quickswap/v1/quickswap_pb.js.map +1 -1
  44. package/dist/gen/triggers/v1/triggers_pb.d.ts +53 -11
  45. package/dist/gen/triggers/v1/triggers_pb.d.ts.map +1 -1
  46. package/dist/gen/triggers/v1/triggers_pb.js +38 -10
  47. package/dist/gen/triggers/v1/triggers_pb.js.map +1 -1
  48. package/dist/index.d.ts +4 -1
  49. package/dist/services/address-book/address-book.schemas.d.ts +2 -2
  50. package/dist/services/auto-withdraw/auto-withdraw.codecs.d.ts +19 -0
  51. package/dist/services/auto-withdraw/auto-withdraw.codecs.d.ts.map +1 -0
  52. package/dist/services/auto-withdraw/auto-withdraw.codecs.js +61 -0
  53. package/dist/services/auto-withdraw/auto-withdraw.codecs.js.map +1 -0
  54. package/dist/services/auto-withdraw/auto-withdraw.d.ts +40 -0
  55. package/dist/services/auto-withdraw/auto-withdraw.d.ts.map +1 -0
  56. package/dist/services/auto-withdraw/auto-withdraw.js +82 -0
  57. package/dist/services/auto-withdraw/auto-withdraw.js.map +1 -0
  58. package/dist/services/auto-withdraw/auto-withdraw.schemas.d.ts +751 -0
  59. package/dist/services/auto-withdraw/auto-withdraw.schemas.d.ts.map +1 -0
  60. package/dist/services/auto-withdraw/auto-withdraw.schemas.js +238 -0
  61. package/dist/services/auto-withdraw/auto-withdraw.schemas.js.map +1 -0
  62. package/dist/services/auto-withdraw/auto-withdraw.types.d.ts +3 -0
  63. package/dist/services/auto-withdraw/service.d.ts +8 -0
  64. package/dist/services/auto-withdraw/service.d.ts.map +1 -0
  65. package/dist/services/auto-withdraw/service.js +9 -0
  66. package/dist/services/auto-withdraw/service.js.map +1 -0
  67. package/dist/services/candles/candles.schemas.d.ts +10 -10
  68. package/dist/services/changelog/changelog.codecs.d.ts +1 -1
  69. package/dist/services/changelog/changelog.codecs.d.ts.map +1 -1
  70. package/dist/services/changelog/changelog.codecs.js +12 -3
  71. package/dist/services/changelog/changelog.codecs.js.map +1 -1
  72. package/dist/services/changelog/changelog.schemas.d.ts +20 -15
  73. package/dist/services/changelog/changelog.schemas.d.ts.map +1 -1
  74. package/dist/services/changelog/changelog.schemas.js +2 -0
  75. package/dist/services/changelog/changelog.schemas.js.map +1 -1
  76. package/dist/services/checkpoints/checkpoints.schemas.d.ts +2 -2
  77. package/dist/services/heatmap/heatmap.schemas.d.ts +13 -13
  78. package/dist/services/lifecycle/lifecycle.schemas.d.ts +94 -94
  79. package/dist/services/market-overview/market-overview.schemas.d.ts +3 -3
  80. package/dist/services/orderbook/orderbook.schemas.d.ts +1 -1
  81. package/dist/services/orders/orders-batch.schemas.d.ts +14 -14
  82. package/dist/services/orders/orders-output.schemas.d.ts +97 -21
  83. package/dist/services/orders/orders-output.schemas.d.ts.map +1 -1
  84. package/dist/services/orders/orders-output.schemas.js +15 -2
  85. package/dist/services/orders/orders-output.schemas.js.map +1 -1
  86. package/dist/services/rewards/rewards.schemas.d.ts +3 -3
  87. package/dist/services/subaccounts/subaccounts.schemas.d.ts +14 -14
  88. package/dist/services/trades/trades.schemas.d.ts +2 -2
  89. package/dist/services/triggers/trigger-input.schemas.d.ts +4 -4
  90. package/dist/services/triggers/triggers-output.schemas.d.ts +40 -32
  91. package/dist/services/triggers/triggers-output.schemas.d.ts.map +1 -1
  92. package/dist/services/triggers/triggers-output.schemas.js +5 -2
  93. package/dist/services/triggers/triggers-output.schemas.js.map +1 -1
  94. package/dist/services/triggers/triggers.codecs.js +7 -3
  95. package/dist/services/triggers/triggers.codecs.js.map +1 -1
  96. package/dist/shared/connect-error-mapping.d.ts.map +1 -1
  97. package/dist/shared/connect-error-mapping.js +1 -1
  98. package/dist/shared/connect-error-mapping.js.map +1 -1
  99. package/dist/wired-services.d.ts.map +1 -1
  100. package/dist/wired-services.js +2 -0
  101. package/dist/wired-services.js.map +1 -1
  102. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto-withdraw.schemas.d.ts","names":[],"sources":["../../../src/services/auto-withdraw/auto-withdraw.schemas.ts"],"mappings":";;;;;;cAmDM,0BAAwB,EAAA;;;;;KAElB,0BAA0B,EAAE,kBAAkB;;;;;;;cAiC7C,iCAA+B,EAAA,yBAAA,EAAA,0BAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkChC,4BAA4B,EAAE,kBAAkB;;;;;;cAOtD,oCAAkC,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;gBAAA;;;;;KA8B5B,+BAA+B,EAAE,kBAAkB;cAElD,gCAA8B,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2B/B,2BAA2B,EAAE,kBAAkB;cAE9C,oCAAkC,EAAA,yBAAA,EAAA;;;;;;;;;;;;;;;KAYnC,+BAA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UF_UINT32_MAX } from "../../shared/wire-bounds.js";
3
+ import { BigIntStringSchema, OptionalTimestampMsSchema, PublicIdOrEmptySchema, TimestampMsSchema, U128Schema } from "../../shared/schemas.js";
4
+ import { enumLabel, enumLabelSchema } from "../../shared/proto-enum-codec.js";
5
+ import { decimalInputToScaled, scaledToDecimalOutput } from "../../shared/decimal-surface.js";
6
+ import { PositiveUint32InputSchema } from "../shared.js";
7
+ import { AccountScopeInputEntries, accountScopeToSubaccountId } from "../../shared/account-scope.js";
8
+ import "../../gen/chain/withdraw/v1/auto_withdraw_pb.js";
9
+ import { fromU128, toU128 } from "../../utils/u128.js";
10
+ import { AUTO_WITHDRAW_WEEKDAY_VALUES, AutoWithdrawCadenceCodec, AutoWithdrawRunStateCodec, AutoWithdrawStepStateCodec, AutoWithdrawWeekdayCodec } from "./auto-withdraw.codecs.js";
11
+ import * as v from "valibot";
12
+ //#region src/services/auto-withdraw/auto-withdraw.schemas.ts
13
+ const U128_MAX = (1n << 128n) - 1n;
14
+ /** Decimal string → 18-decimal U128 integer, exact; throws `ValidationError`. */
15
+ function decimalToE18(field, value) {
16
+ const scaled = decimalInputToScaled(field, value, 18);
17
+ if (scaled > U128_MAX) throw new ValidationError(`${field} exceeds the maximum supported value: ${value}`);
18
+ return scaled;
19
+ }
20
+ function e18ToDecimal(value) {
21
+ return scaledToDecimalOutput(fromU128(value), 18);
22
+ }
23
+ const AccountScopedInputSchema = v.strictObject({ ...AccountScopeInputEntries });
24
+ const AutoWithdrawScopedInputSchema = v.pipe(AccountScopedInputSchema, v.transform(({ account }) => ({ subaccountId: accountScopeToSubaccountId(account) })));
25
+ const Uint32InputSchema = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(PROTOBUF_UINT32_MAX));
26
+ const MinuteOfDaySchema = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(1439));
27
+ const MinuteOfHourSchema = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(59));
28
+ const DayOfMonthSchema = v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(31));
29
+ const WeekdaySchema = v.picklist(AUTO_WITHDRAW_WEEKDAY_VALUES);
30
+ const AnchorDateSchema = v.pipe(v.string(), v.trim(), v.isoDate("anchorDate must be a UTC date, YYYY-MM-DD"), v.check((date) => {
31
+ const parsed = /* @__PURE__ */ new Date(`${date}T00:00:00Z`);
32
+ return !Number.isNaN(parsed.getTime()) && parsed.toISOString().startsWith(date);
33
+ }, "anchorDate must be a real calendar date"));
34
+ /**
35
+ * A rule's UTC run slot. Each cadence takes only its own fields; any other field is rejected.
36
+ * `minuteOfDay` is minutes after 00:00 UTC (0–1439), `minuteOfHour` 0–59, `dayOfMonth` 1–31
37
+ * (a shorter month runs on its last day), and `anchorDate` is a UTC date in a week a biweekly
38
+ * rule runs.
39
+ */
40
+ const AutoWithdrawScheduleInputSchema = v.pipe(v.variant("cadence", [
41
+ v.strictObject({
42
+ cadence: v.literal("hourly"),
43
+ minuteOfHour: MinuteOfHourSchema
44
+ }),
45
+ v.strictObject({
46
+ cadence: v.literal("daily"),
47
+ minuteOfDay: MinuteOfDaySchema
48
+ }),
49
+ v.strictObject({
50
+ cadence: v.literal("weekly"),
51
+ weekday: WeekdaySchema,
52
+ minuteOfDay: MinuteOfDaySchema
53
+ }),
54
+ v.strictObject({
55
+ cadence: v.literal("biweekly"),
56
+ weekday: WeekdaySchema,
57
+ minuteOfDay: MinuteOfDaySchema,
58
+ anchorDate: AnchorDateSchema
59
+ }),
60
+ v.strictObject({
61
+ cadence: v.literal("monthly"),
62
+ dayOfMonth: DayOfMonthSchema,
63
+ minuteOfDay: MinuteOfDaySchema
64
+ })
65
+ ]), v.transform((schedule) => ({
66
+ cadence: AutoWithdrawCadenceCodec.inputToProto[schedule.cadence],
67
+ weekday: "weekday" in schedule ? AutoWithdrawWeekdayCodec.inputToProto[schedule.weekday] : void 0,
68
+ minuteOfDay: "minuteOfDay" in schedule ? schedule.minuteOfDay : void 0,
69
+ minuteOfHour: "minuteOfHour" in schedule ? schedule.minuteOfHour : void 0,
70
+ dayOfMonth: "dayOfMonth" in schedule ? schedule.dayOfMonth : void 0,
71
+ anchorDate: "anchorDate" in schedule ? schedule.anchorDate : void 0
72
+ })));
73
+ /**
74
+ * One asset paid in kind to one whitelisted external-chain address. `minAmount` and
75
+ * `maxAmount` are decimal asset amounts (up to 18 decimals); a run pays the balance up to
76
+ * `maxAmount` once it reaches `minAmount`.
77
+ */
78
+ const AutoWithdrawDestinationInputSchema = v.pipe(v.strictObject({
79
+ assetId: PositiveUint32InputSchema,
80
+ destinationChainId: v.pipe(v.number(), v.integer(), v.gtValue(0), v.maxValue(Number.MAX_SAFE_INTEGER)),
81
+ destinationAddress: v.pipe(v.string(), v.trim(), v.minLength(1)),
82
+ minAmount: v.string(),
83
+ maxAmount: v.string()
84
+ }), v.transform(({ minAmount, maxAmount, destinationChainId, ...destination }) => {
85
+ const min = decimalToE18("minAmount", minAmount);
86
+ const max = decimalToE18("maxAmount", maxAmount);
87
+ if (max === 0n || max < min) throw new ValidationError(`maxAmount must be greater than 0 and at least minAmount: ${maxAmount}`);
88
+ return {
89
+ ...destination,
90
+ destinationChainId: BigInt(destinationChainId),
91
+ minAmountE18: toU128(min),
92
+ maxAmountE18: toU128(max)
93
+ };
94
+ }));
95
+ const SetAutoWithdrawRuleInputSchema = v.pipe(v.strictObject({
96
+ ...AccountScopeInputEntries,
97
+ /** The version this change replaces: 0 when the account has no rule yet. */
98
+ expectedVersion: Uint32InputSchema,
99
+ schedule: AutoWithdrawScheduleInputSchema,
100
+ destinations: v.pipe(v.array(AutoWithdrawDestinationInputSchema), v.minLength(1, "At least one destination is required."), v.maxLength(32, "At most 32 destinations are allowed."), v.check((destinations) => new Set(destinations.map((d) => d.assetId)).size === destinations.length, "At most one destination per asset is allowed.")),
101
+ /** Least USD value one payout pays, as a decimal; omit or null for no USD minimum. */
102
+ minUsdValue: v.optional(v.nullable(v.string()))
103
+ }), v.transform(({ account, minUsdValue, ...input }) => ({
104
+ ...input,
105
+ subaccountId: accountScopeToSubaccountId(account),
106
+ minUsdValueE18: minUsdValue == null ? void 0 : toU128(decimalToE18("minUsdValue", minUsdValue))
107
+ })));
108
+ const DisableAutoWithdrawRuleInputSchema = v.pipe(v.strictObject({
109
+ ...AccountScopeInputEntries,
110
+ /** The account's latest rule version. */
111
+ expectedVersion: Uint32InputSchema
112
+ }), v.transform(({ account, expectedVersion }) => ({
113
+ subaccountId: accountScopeToSubaccountId(account),
114
+ expectedVersion
115
+ })));
116
+ /** `limit` is 0 through 100; 0 or omitted uses the server default of 20. */
117
+ const ListAutoWithdrawRunsInputSchema = v.pipe(v.strictObject({
118
+ ...AccountScopeInputEntries,
119
+ limit: v.optional(v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(100)), 0),
120
+ pageToken: v.optional(v.pipe(v.string(), v.trim()), "")
121
+ }), v.transform(({ account, ...input }) => ({
122
+ ...input,
123
+ subaccountId: accountScopeToSubaccountId(account)
124
+ })));
125
+ const AutoWithdrawScheduleSchema = v.pipe(v.object({
126
+ cadence: v.optional(v.number(), 0),
127
+ weekday: v.optional(v.number(), 0),
128
+ minuteOfDay: v.optional(v.number(), 0),
129
+ minuteOfHour: v.optional(v.number(), 0),
130
+ dayOfMonth: v.optional(v.number(), 0),
131
+ anchorDate: v.optional(v.string(), "")
132
+ }), v.transform((s) => {
133
+ const weekday = enumLabel(AutoWithdrawWeekdayCodec.protoToOutput, s.weekday);
134
+ const { minuteOfDay } = s;
135
+ switch (s.cadence) {
136
+ case 3: return {
137
+ cadence: "hourly",
138
+ minuteOfHour: s.minuteOfHour
139
+ };
140
+ case 1: return {
141
+ cadence: "daily",
142
+ minuteOfDay
143
+ };
144
+ case 2: return {
145
+ cadence: "weekly",
146
+ weekday,
147
+ minuteOfDay
148
+ };
149
+ case 4: return {
150
+ cadence: "biweekly",
151
+ weekday,
152
+ minuteOfDay,
153
+ anchorDate: s.anchorDate
154
+ };
155
+ case 5: return {
156
+ cadence: "monthly",
157
+ dayOfMonth: s.dayOfMonth,
158
+ minuteOfDay
159
+ };
160
+ default: return { cadence: "unspecified" };
161
+ }
162
+ }));
163
+ function reasonSchema() {
164
+ return v.pipe(v.optional(v.string(), ""), v.transform((reason) => reason ? reason : null));
165
+ }
166
+ const AutoWithdrawDestinationSchema = v.pipe(v.object({
167
+ assetId: v.number(),
168
+ destinationChainId: v.bigint(),
169
+ destinationAddress: v.string(),
170
+ minAmountE18: v.optional(U128Schema),
171
+ maxAmountE18: v.optional(U128Schema)
172
+ }), v.transform(({ minAmountE18, maxAmountE18, destinationChainId, ...destination }) => ({
173
+ ...destination,
174
+ destinationChainId: Number(destinationChainId),
175
+ minAmount: e18ToDecimal(minAmountE18),
176
+ maxAmount: e18ToDecimal(maxAmountE18)
177
+ })));
178
+ const AutoWithdrawPauseSchema = v.object({
179
+ assetId: v.number(),
180
+ reason: v.pipe(v.string(), v.transform((reason) => reason)),
181
+ pausedAt: TimestampMsSchema
182
+ });
183
+ const AutoWithdrawRuleSchema = v.pipe(v.object({
184
+ subaccountId: v.optional(PublicIdOrEmptySchema, 0n),
185
+ version: v.number(),
186
+ enabled: v.boolean(),
187
+ schedule: v.optional(AutoWithdrawScheduleSchema),
188
+ destinations: v.array(AutoWithdrawDestinationSchema),
189
+ createdAt: TimestampMsSchema,
190
+ pause: v.optional(AutoWithdrawPauseSchema),
191
+ minUsdValueE18: v.optional(U128Schema)
192
+ }), v.transform(({ schedule, pause, minUsdValueE18, ...rule }) => ({
193
+ ...rule,
194
+ schedule: schedule ?? { cadence: "unspecified" },
195
+ pause: pause ?? null,
196
+ minUsdValue: fromU128(minUsdValueE18) === 0n ? null : e18ToDecimal(minUsdValueE18)
197
+ })));
198
+ const AutoWithdrawStepSchema = v.pipe(v.object({
199
+ assetId: v.number(),
200
+ destinationChainId: v.bigint(),
201
+ destinationAddress: v.string(),
202
+ availableE18: v.optional(U128Schema),
203
+ amountE18: v.optional(U128Schema),
204
+ valueUsdE18: v.optional(U128Schema),
205
+ state: enumLabelSchema(AutoWithdrawStepStateCodec.protoToOutput),
206
+ reason: reasonSchema(),
207
+ intentId: v.optional(v.string(), ""),
208
+ txHash: v.optional(v.string(), "")
209
+ }), v.transform(({ availableE18, amountE18, valueUsdE18, destinationChainId, intentId, txHash, ...step }) => ({
210
+ ...step,
211
+ destinationChainId: Number(destinationChainId),
212
+ available: e18ToDecimal(availableE18),
213
+ amount: e18ToDecimal(amountE18),
214
+ valueUsd: valueUsdE18 ? e18ToDecimal(valueUsdE18) : null,
215
+ intentId: intentId || null,
216
+ txHash: txHash || null
217
+ })));
218
+ const AutoWithdrawRunSchema = v.pipe(v.object({
219
+ runSeq: BigIntStringSchema,
220
+ ruleVersion: v.number(),
221
+ scheduledFor: TimestampMsSchema,
222
+ state: enumLabelSchema(AutoWithdrawRunStateCodec.protoToOutput),
223
+ reason: reasonSchema(),
224
+ steps: v.array(AutoWithdrawStepSchema),
225
+ createdAt: TimestampMsSchema,
226
+ finishedAt: OptionalTimestampMsSchema
227
+ }), v.transform(({ finishedAt, ...run }) => ({
228
+ ...run,
229
+ finishedAt: finishedAt ?? null
230
+ })));
231
+ const ListAutoWithdrawRunsResultSchema = v.object({
232
+ runs: v.array(AutoWithdrawRunSchema),
233
+ nextPageToken: v.optional(v.string(), "")
234
+ });
235
+ //#endregion
236
+ export { AutoWithdrawRuleSchema, AutoWithdrawScheduleInputSchema, AutoWithdrawScopedInputSchema, DisableAutoWithdrawRuleInputSchema, ListAutoWithdrawRunsInputSchema, ListAutoWithdrawRunsResultSchema, SetAutoWithdrawRuleInputSchema };
237
+
238
+ //# sourceMappingURL=auto-withdraw.schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auto-withdraw.schemas.js","names":[],"sources":["../../../src/services/auto-withdraw/auto-withdraw.schemas.ts"],"sourcesContent":["import * as v from \"valibot\";\nimport * as Proto from \"../../gen/chain/withdraw/v1/auto_withdraw_pb.js\";\nimport {\n AccountScopeInputEntries,\n accountScopeToSubaccountId,\n} from \"../../shared/account-scope.js\";\nimport {\n decimalInputToScaled,\n E18_SCALE,\n scaledToDecimalOutput,\n} from \"../../shared/decimal-surface.js\";\nimport { ValidationError } from \"../../shared/errors.js\";\nimport { enumLabel, enumLabelSchema } from \"../../shared/proto-enum-codec.js\";\nimport {\n BigIntStringSchema,\n OptionalTimestampMsSchema,\n PublicIdOrEmptySchema,\n TimestampMsSchema,\n U128Schema,\n} from \"../../shared/schemas.js\";\nimport { PROTOBUF_UINT32_MAX } from \"../../shared/wire-bounds.js\";\nimport type { DecodedEnum } from \"../../utils/types.js\";\nimport { fromU128, toU128 } from \"../../utils/u128.js\";\nimport { PositiveUint32InputSchema } from \"../shared.js\";\nimport {\n AUTO_WITHDRAW_WEEKDAY_VALUES,\n AutoWithdrawCadenceCodec,\n AutoWithdrawRunStateCodec,\n AutoWithdrawStepStateCodec,\n AutoWithdrawWeekdayCodec,\n type AutoWithdrawPauseReason,\n type AutoWithdrawRunReason,\n type AutoWithdrawStepReason,\n type AutoWithdrawWeekday,\n} from \"./auto-withdraw.codecs.js\";\n\nconst U128_MAX = (1n << 128n) - 1n;\n\n/** Decimal string → 18-decimal U128 integer, exact; throws `ValidationError`. */\nfunction decimalToE18(field: string, value: string): bigint {\n const scaled = decimalInputToScaled(field, value, E18_SCALE);\n if (scaled > U128_MAX) {\n throw new ValidationError(`${field} exceeds the maximum supported value: ${value}`);\n }\n return scaled;\n}\n\nfunction e18ToDecimal(value: v.InferOutput<typeof U128Schema> | undefined): string {\n return scaledToDecimalOutput(fromU128(value), E18_SCALE);\n}\n\nconst AccountScopedInputSchema = v.strictObject({ ...AccountScopeInputEntries });\n\nexport type AutoWithdrawScopedInput = v.InferInput<typeof AccountScopedInputSchema>;\n\nexport const AutoWithdrawScopedInputSchema = v.pipe(\n AccountScopedInputSchema,\n v.transform(({ account }) => ({ subaccountId: accountScopeToSubaccountId(account) })),\n);\n\nconst Uint32InputSchema = v.pipe(\n v.number(),\n v.integer(),\n v.minValue(0),\n v.maxValue(PROTOBUF_UINT32_MAX),\n);\nconst MinuteOfDaySchema = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(1439));\nconst MinuteOfHourSchema = v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(59));\nconst DayOfMonthSchema = v.pipe(v.number(), v.integer(), v.minValue(1), v.maxValue(31));\nconst WeekdaySchema = v.picklist(AUTO_WITHDRAW_WEEKDAY_VALUES);\nconst AnchorDateSchema = v.pipe(\n v.string(),\n v.trim(),\n v.isoDate(\"anchorDate must be a UTC date, YYYY-MM-DD\"),\n v.check((date) => {\n const parsed = new Date(`${date}T00:00:00Z`);\n return !Number.isNaN(parsed.getTime()) && parsed.toISOString().startsWith(date);\n }, \"anchorDate must be a real calendar date\"),\n);\n\n/**\n * A rule's UTC run slot. Each cadence takes only its own fields; any other field is rejected.\n * `minuteOfDay` is minutes after 00:00 UTC (0–1439), `minuteOfHour` 0–59, `dayOfMonth` 1–31\n * (a shorter month runs on its last day), and `anchorDate` is a UTC date in a week a biweekly\n * rule runs.\n */\nexport const AutoWithdrawScheduleInputSchema = v.pipe(\n v.variant(\"cadence\", [\n v.strictObject({ cadence: v.literal(\"hourly\"), minuteOfHour: MinuteOfHourSchema }),\n v.strictObject({ cadence: v.literal(\"daily\"), minuteOfDay: MinuteOfDaySchema }),\n v.strictObject({\n cadence: v.literal(\"weekly\"),\n weekday: WeekdaySchema,\n minuteOfDay: MinuteOfDaySchema,\n }),\n v.strictObject({\n cadence: v.literal(\"biweekly\"),\n weekday: WeekdaySchema,\n minuteOfDay: MinuteOfDaySchema,\n anchorDate: AnchorDateSchema,\n }),\n v.strictObject({\n cadence: v.literal(\"monthly\"),\n dayOfMonth: DayOfMonthSchema,\n minuteOfDay: MinuteOfDaySchema,\n }),\n ]),\n v.transform((schedule) => ({\n cadence: AutoWithdrawCadenceCodec.inputToProto[schedule.cadence],\n weekday:\n \"weekday\" in schedule\n ? AutoWithdrawWeekdayCodec.inputToProto[schedule.weekday]\n : undefined,\n minuteOfDay: \"minuteOfDay\" in schedule ? schedule.minuteOfDay : undefined,\n minuteOfHour: \"minuteOfHour\" in schedule ? schedule.minuteOfHour : undefined,\n dayOfMonth: \"dayOfMonth\" in schedule ? schedule.dayOfMonth : undefined,\n anchorDate: \"anchorDate\" in schedule ? schedule.anchorDate : undefined,\n })),\n);\n\nexport type AutoWithdrawScheduleInput = v.InferInput<typeof AutoWithdrawScheduleInputSchema>;\n\n/**\n * One asset paid in kind to one whitelisted external-chain address. `minAmount` and\n * `maxAmount` are decimal asset amounts (up to 18 decimals); a run pays the balance up to\n * `maxAmount` once it reaches `minAmount`.\n */\nconst AutoWithdrawDestinationInputSchema = v.pipe(\n v.strictObject({\n assetId: PositiveUint32InputSchema,\n destinationChainId: v.pipe(\n v.number(),\n v.integer(),\n v.gtValue(0),\n v.maxValue(Number.MAX_SAFE_INTEGER),\n ),\n destinationAddress: v.pipe(v.string(), v.trim(), v.minLength(1)),\n minAmount: v.string(),\n maxAmount: v.string(),\n }),\n v.transform(({ minAmount, maxAmount, destinationChainId, ...destination }) => {\n const min = decimalToE18(\"minAmount\", minAmount);\n const max = decimalToE18(\"maxAmount\", maxAmount);\n if (max === 0n || max < min) {\n throw new ValidationError(\n `maxAmount must be greater than 0 and at least minAmount: ${maxAmount}`,\n );\n }\n return {\n ...destination,\n destinationChainId: BigInt(destinationChainId),\n minAmountE18: toU128(min),\n maxAmountE18: toU128(max),\n };\n }),\n);\n\nexport type AutoWithdrawDestinationInput = v.InferInput<typeof AutoWithdrawDestinationInputSchema>;\n\nexport const SetAutoWithdrawRuleInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n /** The version this change replaces: 0 when the account has no rule yet. */\n expectedVersion: Uint32InputSchema,\n schedule: AutoWithdrawScheduleInputSchema,\n destinations: v.pipe(\n v.array(AutoWithdrawDestinationInputSchema),\n v.minLength(1, \"At least one destination is required.\"),\n v.maxLength(32, \"At most 32 destinations are allowed.\"),\n v.check(\n (destinations) =>\n new Set(destinations.map((d) => d.assetId)).size === destinations.length,\n \"At most one destination per asset is allowed.\",\n ),\n ),\n /** Least USD value one payout pays, as a decimal; omit or null for no USD minimum. */\n minUsdValue: v.optional(v.nullable(v.string())),\n }),\n v.transform(({ account, minUsdValue, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n minUsdValueE18:\n minUsdValue == null ? undefined : toU128(decimalToE18(\"minUsdValue\", minUsdValue)),\n })),\n);\n\nexport type SetAutoWithdrawRuleInput = v.InferInput<typeof SetAutoWithdrawRuleInputSchema>;\n\nexport const DisableAutoWithdrawRuleInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n /** The account's latest rule version. */\n expectedVersion: Uint32InputSchema,\n }),\n v.transform(({ account, expectedVersion }) => ({\n subaccountId: accountScopeToSubaccountId(account),\n expectedVersion,\n })),\n);\n\nexport type DisableAutoWithdrawRuleInput = v.InferInput<typeof DisableAutoWithdrawRuleInputSchema>;\n\n/** `limit` is 0 through 100; 0 or omitted uses the server default of 20. */\nexport const ListAutoWithdrawRunsInputSchema = v.pipe(\n v.strictObject({\n ...AccountScopeInputEntries,\n limit: v.optional(v.pipe(v.number(), v.integer(), v.minValue(0), v.maxValue(100)), 0),\n pageToken: v.optional(v.pipe(v.string(), v.trim()), \"\"),\n }),\n v.transform(({ account, ...input }) => ({\n ...input,\n subaccountId: accountScopeToSubaccountId(account),\n })),\n);\n\nexport type ListAutoWithdrawRunsInput = v.InferInput<typeof ListAutoWithdrawRunsInputSchema>;\n\ntype ScheduleShape<Weekday> =\n | { cadence: \"hourly\"; minuteOfHour: number }\n | { cadence: \"daily\"; minuteOfDay: number }\n | { cadence: \"weekly\"; weekday: Weekday; minuteOfDay: number }\n | { cadence: \"biweekly\"; weekday: Weekday; minuteOfDay: number; anchorDate: string }\n | { cadence: \"monthly\"; dayOfMonth: number; minuteOfDay: number };\n\n/** A decoded schedule. A cadence this SDK build does not know decodes as `\"unspecified\"`. */\nexport type AutoWithdrawSchedule =\n | ScheduleShape<DecodedEnum<AutoWithdrawWeekday>>\n | { cadence: \"unspecified\" };\n\nconst AutoWithdrawScheduleSchema = v.pipe(\n v.object({\n cadence: v.optional(v.number(), 0),\n weekday: v.optional(v.number(), 0),\n minuteOfDay: v.optional(v.number(), 0),\n minuteOfHour: v.optional(v.number(), 0),\n dayOfMonth: v.optional(v.number(), 0),\n anchorDate: v.optional(v.string(), \"\"),\n }),\n v.transform((s): AutoWithdrawSchedule => {\n const weekday = enumLabel(AutoWithdrawWeekdayCodec.protoToOutput, s.weekday);\n const { minuteOfDay } = s;\n switch (s.cadence) {\n case Proto.AutoWithdrawCadence.HOURLY:\n return { cadence: \"hourly\", minuteOfHour: s.minuteOfHour };\n case Proto.AutoWithdrawCadence.DAILY:\n return { cadence: \"daily\", minuteOfDay };\n case Proto.AutoWithdrawCadence.WEEKLY:\n return { cadence: \"weekly\", weekday, minuteOfDay };\n case Proto.AutoWithdrawCadence.BIWEEKLY:\n return { cadence: \"biweekly\", weekday, minuteOfDay, anchorDate: s.anchorDate };\n case Proto.AutoWithdrawCadence.MONTHLY:\n return { cadence: \"monthly\", dayOfMonth: s.dayOfMonth, minuteOfDay };\n default:\n return { cadence: \"unspecified\" };\n }\n }),\n);\n\nfunction reasonSchema<TReason extends string>() {\n return v.pipe(\n v.optional(v.string(), \"\"),\n v.transform((reason) => (reason ? (reason as TReason) : null)),\n );\n}\n\nconst AutoWithdrawDestinationSchema = v.pipe(\n v.object({\n assetId: v.number(),\n destinationChainId: v.bigint(),\n destinationAddress: v.string(),\n minAmountE18: v.optional(U128Schema),\n maxAmountE18: v.optional(U128Schema),\n }),\n v.transform(({ minAmountE18, maxAmountE18, destinationChainId, ...destination }) => ({\n ...destination,\n destinationChainId: Number(destinationChainId),\n minAmount: e18ToDecimal(minAmountE18),\n maxAmount: e18ToDecimal(maxAmountE18),\n })),\n);\n\nexport type AutoWithdrawDestination = v.InferOutput<typeof AutoWithdrawDestinationSchema>;\n\nconst AutoWithdrawPauseSchema = v.object({\n assetId: v.number(),\n reason: v.pipe(\n v.string(),\n v.transform((reason) => reason as AutoWithdrawPauseReason),\n ),\n pausedAt: TimestampMsSchema,\n});\n\nexport type AutoWithdrawPause = v.InferOutput<typeof AutoWithdrawPauseSchema>;\n\nexport const AutoWithdrawRuleSchema = v.pipe(\n v.object({\n subaccountId: v.optional(PublicIdOrEmptySchema, 0n),\n version: v.number(),\n enabled: v.boolean(),\n schedule: v.optional(AutoWithdrawScheduleSchema),\n destinations: v.array(AutoWithdrawDestinationSchema),\n createdAt: TimestampMsSchema,\n pause: v.optional(AutoWithdrawPauseSchema),\n minUsdValueE18: v.optional(U128Schema),\n }),\n v.transform(({ schedule, pause, minUsdValueE18, ...rule }) => ({\n ...rule,\n schedule: schedule ?? ({ cadence: \"unspecified\" } as AutoWithdrawSchedule),\n pause: pause ?? null,\n minUsdValue: fromU128(minUsdValueE18) === 0n ? null : e18ToDecimal(minUsdValueE18),\n })),\n);\n\n/**\n * One version of an account's rule. `subaccountId` is the public subaccount ID, `\"\"` for the\n * root account. Times are epoch milliseconds. `minUsdValue` is null when the rule has no USD\n * minimum; `pause` is set when the rule paused itself, and a new version resumes it.\n */\nexport type AutoWithdrawRule = v.InferOutput<typeof AutoWithdrawRuleSchema>;\n\nconst AutoWithdrawStepSchema = v.pipe(\n v.object({\n assetId: v.number(),\n destinationChainId: v.bigint(),\n destinationAddress: v.string(),\n availableE18: v.optional(U128Schema),\n amountE18: v.optional(U128Schema),\n valueUsdE18: v.optional(U128Schema),\n state: enumLabelSchema(AutoWithdrawStepStateCodec.protoToOutput),\n reason: reasonSchema<AutoWithdrawStepReason>(),\n intentId: v.optional(v.string(), \"\"),\n txHash: v.optional(v.string(), \"\"),\n }),\n v.transform(\n ({\n availableE18,\n amountE18,\n valueUsdE18,\n destinationChainId,\n intentId,\n txHash,\n ...step\n }) => ({\n ...step,\n destinationChainId: Number(destinationChainId),\n available: e18ToDecimal(availableE18),\n amount: e18ToDecimal(amountE18),\n valueUsd: valueUsdE18 ? e18ToDecimal(valueUsdE18) : null,\n intentId: intentId || null,\n txHash: txHash || null,\n }),\n ),\n);\n\n/**\n * One asset's payout in a run. `available`, `amount` and `valueUsd` are decimal strings;\n * `valueUsd` is null when the rule has no USD minimum or no price was available.\n */\nexport type AutoWithdrawStep = v.InferOutput<typeof AutoWithdrawStepSchema>;\n\nconst AutoWithdrawRunSchema = v.pipe(\n v.object({\n runSeq: BigIntStringSchema,\n ruleVersion: v.number(),\n scheduledFor: TimestampMsSchema,\n state: enumLabelSchema(AutoWithdrawRunStateCodec.protoToOutput),\n reason: reasonSchema<AutoWithdrawRunReason>(),\n steps: v.array(AutoWithdrawStepSchema),\n createdAt: TimestampMsSchema,\n finishedAt: OptionalTimestampMsSchema,\n }),\n v.transform(({ finishedAt, ...run }) => ({ ...run, finishedAt: finishedAt ?? null })),\n);\n\n/** One scheduled run. Times are epoch milliseconds; `finishedAt` is null while in progress. */\nexport type AutoWithdrawRun = v.InferOutput<typeof AutoWithdrawRunSchema>;\n\nexport const ListAutoWithdrawRunsResultSchema = v.object({\n runs: v.array(AutoWithdrawRunSchema),\n nextPageToken: v.optional(v.string(), \"\"),\n});\n\n/** One page of runs, newest first. An empty `nextPageToken` means no more runs. */\nexport type ListAutoWithdrawRunsResult = v.InferOutput<typeof ListAutoWithdrawRunsResultSchema>;\n"],"mappings":";;;;;;;;;;;;AAoCA,MAAM,YAAY,MAAM,QAAQ;;AAGhC,SAAS,aAAa,OAAe,OAAuB;CACxD,MAAM,SAAS,qBAAqB,OAAO,OAAA,EAAgB;CAC3D,IAAI,SAAS,UACT,MAAM,IAAI,gBAAgB,GAAG,MAAM,wCAAwC,OAAO;CAEtF,OAAO;AACX;AAEA,SAAS,aAAa,OAA6D;CAC/E,OAAO,sBAAsB,SAAS,KAAK,GAAA,EAAY;AAC3D;AAEA,MAAM,2BAA2B,EAAE,aAAa,EAAE,GAAG,yBAAyB,CAAC;AAI/E,MAAa,gCAAgC,EAAE,K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M,sBAAsB;CACrC,WAAW;CACX,YAAY;AAChB,CAAC,GACD,EAAE,WAAW,EAAE,YAAY,GAAG,WAAW;CAAE,GAAG;CAAK,YAAY,cAAc;AAAK,EAAE,CACxF;AAKA,MAAa,mCAAmC,EAAE,OAAO;CACrD,MAAM,EAAE,MAAM,qBAAqB;CACnC,eAAe,EAAE,SAAS,EAAE,OAAO,GAAG,EAAE;AAC5C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { AutoWithdrawCadence, AutoWithdrawPauseReason, AutoWithdrawRunReason, AutoWithdrawRunState, AutoWithdrawStepReason, AutoWithdrawStepState, AutoWithdrawWeekday } from "./auto-withdraw.codecs.js";
2
+ import { AutoWithdrawDestination, AutoWithdrawDestinationInput, AutoWithdrawPause, AutoWithdrawRule, AutoWithdrawRun, AutoWithdrawSchedule, AutoWithdrawScheduleInput, AutoWithdrawScopedInput, AutoWithdrawStep, DisableAutoWithdrawRuleInput, ListAutoWithdrawRunsInput, ListAutoWithdrawRunsResult, SetAutoWithdrawRuleInput } from "./auto-withdraw.schemas.js";
3
+ export type { AutoWithdrawCadence, AutoWithdrawDestination, AutoWithdrawDestinationInput, AutoWithdrawPause, AutoWithdrawPauseReason, AutoWithdrawRule, AutoWithdrawRun, AutoWithdrawRunReason, AutoWithdrawRunState, AutoWithdrawSchedule, AutoWithdrawScheduleInput, AutoWithdrawScopedInput, AutoWithdrawStep, AutoWithdrawStepReason, AutoWithdrawStepState, AutoWithdrawWeekday, DisableAutoWithdrawRuleInput, ListAutoWithdrawRunsInput, ListAutoWithdrawRunsResult, SetAutoWithdrawRuleInput };
@@ -0,0 +1,8 @@
1
+ import { AutoWithdrawService } from "./auto-withdraw.js";
2
+ import { PolyesterCore } from "../../core-client.js";
3
+ //#region src/services/auto-withdraw/service.d.ts
4
+ /** Returns the client's AutoWithdrawService, creating it on first use. */
5
+ declare const autoWithdrawService: (client: PolyesterCore) => AutoWithdrawService;
6
+ //#endregion
7
+ export { autoWithdrawService };
8
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.d.ts","names":[],"sources":["../../../src/services/auto-withdraw/service.ts"],"mappings":";;;;cAIa,sBAAmB,QAAnB,kBAAmB"}
@@ -0,0 +1,9 @@
1
+ import { defineService } from "../../core-client.js";
2
+ import { AutoWithdrawService } from "./auto-withdraw.js";
3
+ //#region src/services/auto-withdraw/service.ts
4
+ /** Returns the client's AutoWithdrawService, creating it on first use. */
5
+ const autoWithdrawService = defineService((context) => new AutoWithdrawService(context.transports, context.resolver));
6
+ //#endregion
7
+ export { autoWithdrawService };
8
+
9
+ //# sourceMappingURL=service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.js","names":[],"sources":["../../../src/services/auto-withdraw/service.ts"],"sourcesContent":["import { defineService } from \"../../core-client.js\";\nimport { AutoWithdrawService } from \"./auto-withdraw.js\";\n\n/** Returns the client's AutoWithdrawService, creating it on first use. */\nexport const autoWithdrawService = defineService(\n (context) => new AutoWithdrawService(context.transports, context.resolver),\n);\n"],"mappings":";;;;AAIA,MAAa,sBAAsB,eAC9B,YAAY,IAAI,oBAAoB,QAAQ,YAAY,QAAQ,QAAQ,CAC7E"}
@@ -11,7 +11,7 @@ type TimestampInit = {
11
11
  };
12
12
  declare function createCandleRowSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.ObjectSchema<{
13
13
  readonly symbolId: v.NumberSchema<undefined>;
14
- readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1d" | "1s" | "1m" | "5m" | "1h" | "1w" | "3m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">>]>;
14
+ readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "3m" | "5m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">>]>;
15
15
  readonly tsSec: v.BigintSchema<undefined>;
16
16
  readonly open: v.BigintSchema<undefined>;
17
17
  readonly high: v.BigintSchema<undefined>;
@@ -22,7 +22,7 @@ declare function createCandleRowSchema(scales: SdkScales): v.SchemaWithPipe<read
22
22
  readonly isClosed: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
23
23
  }, undefined>, v.TransformAction<{
24
24
  symbolId: number;
25
- timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "1h" | "1w" | "3m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">;
25
+ timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "3m" | "5m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">;
26
26
  tsSec: bigint;
27
27
  open: bigint;
28
28
  high: bigint;
@@ -33,7 +33,7 @@ declare function createCandleRowSchema(scales: SdkScales): v.SchemaWithPipe<read
33
33
  isClosed: boolean;
34
34
  }, {
35
35
  symbolId: number;
36
- timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "1h" | "1w" | "3m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">;
36
+ timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "3m" | "5m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">;
37
37
  time: number;
38
38
  open: string;
39
39
  high: string;
@@ -46,7 +46,7 @@ declare function createCandleRowSchema(scales: SdkScales): v.SchemaWithPipe<read
46
46
  declare const createCandleRowIntSchema: typeof createCandleRowSchema;
47
47
  declare function createCandleColumnarSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.ObjectSchema<{
48
48
  readonly symbolId: v.NumberSchema<undefined>;
49
- readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1d" | "1s" | "1m" | "5m" | "1h" | "1w" | "3m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">>]>;
49
+ readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "3m" | "5m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">>]>;
50
50
  readonly tsSec: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
51
51
  readonly open: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
52
52
  readonly high: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
@@ -63,7 +63,7 @@ declare function createCandleColumnarSchema(scales: SdkScales): v.SchemaWithPipe
63
63
  readonly nextPageToken: v.OptionalSchema<v.StringSchema<undefined>, "">;
64
64
  }, undefined>, v.TransformAction<{
65
65
  symbolId: number;
66
- timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "1h" | "1w" | "3m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">;
66
+ timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "3m" | "5m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">;
67
67
  tsSec: bigint[];
68
68
  open: bigint[];
69
69
  high: bigint[];
@@ -80,7 +80,7 @@ declare function createCandleColumnarSchema(scales: SdkScales): v.SchemaWithPipe
80
80
  nextPageToken: string;
81
81
  }, {
82
82
  symbolId: number;
83
- timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "1h" | "1w" | "3m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">;
83
+ timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "3m" | "5m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">;
84
84
  time: number[];
85
85
  open: string[];
86
86
  high: string[];
@@ -100,7 +100,7 @@ declare function createCandleColumnarSchema(scales: SdkScales): v.SchemaWithPipe
100
100
  }>]>;
101
101
  declare function createCandleColumnarIntSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.ObjectSchema<{
102
102
  readonly symbolId: v.NumberSchema<undefined>;
103
- readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1d" | "1s" | "1m" | "5m" | "1h" | "1w" | "3m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">>]>;
103
+ readonly timeframe: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "3m" | "5m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">>]>;
104
104
  readonly tsSec: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
105
105
  readonly open: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
106
106
  readonly high: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
@@ -117,7 +117,7 @@ declare function createCandleColumnarIntSchema(scales: SdkScales): v.SchemaWithP
117
117
  readonly nextPageToken: v.OptionalSchema<v.StringSchema<undefined>, "">;
118
118
  }, undefined>, v.TransformAction<{
119
119
  symbolId: number;
120
- timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "1h" | "1w" | "3m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">;
120
+ timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "3m" | "5m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">;
121
121
  tsSec: bigint[];
122
122
  open: bigint[];
123
123
  high: bigint[];
@@ -134,7 +134,7 @@ declare function createCandleColumnarIntSchema(scales: SdkScales): v.SchemaWithP
134
134
  nextPageToken: string;
135
135
  }, {
136
136
  symbolId: number;
137
- timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "1h" | "1w" | "3m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">;
137
+ timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "3m" | "5m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo">;
138
138
  tsSec: number[];
139
139
  open: string[];
140
140
  high: string[];
@@ -158,7 +158,7 @@ type CandleColumnar = v.InferOutput<ReturnType<typeof createCandleColumnarSchema
158
158
  type CandleColumnarInt = v.InferOutput<ReturnType<typeof createCandleColumnarIntSchema>>;
159
159
  declare function createListCandlesInputSchema(): v.SchemaWithPipe<readonly [v.ObjectSchema<{
160
160
  readonly symbolId: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>;
161
- readonly timeframe: v.SchemaWithPipe<readonly [v.PicklistSchema<readonly ["1s", "1m", "3m", "5m", "15m", "30m", "1h", "2h", "4h", "6h", "8h", "12h", "1d", "3d", "1w", "1mo"], undefined>, v.TransformAction<"1d" | "1s" | "1m" | "5m" | "1h" | "1w" | "3m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo", Timeframe$1.SEC_1 | Timeframe$1.MIN_1 | Timeframe$1.MIN_3 | Timeframe$1.MIN_5 | Timeframe$1.MIN_15 | Timeframe$1.MIN_30 | Timeframe$1.HOUR_1 | Timeframe$1.HOUR_2 | Timeframe$1.HOUR_4 | Timeframe$1.HOUR_6 | Timeframe$1.HOUR_8 | Timeframe$1.HOUR_12 | Timeframe$1.DAY_1 | Timeframe$1.DAY_3 | Timeframe$1.WEEK_1 | Timeframe$1.MONTH_1>]>;
161
+ readonly timeframe: v.SchemaWithPipe<readonly [v.PicklistSchema<readonly ["1s", "1m", "3m", "5m", "15m", "30m", "1h", "2h", "4h", "6h", "8h", "12h", "1d", "3d", "1w", "1mo"], undefined>, v.TransformAction<"1d" | "1h" | "1w" | "1m" | "1s" | "3m" | "5m" | "15m" | "30m" | "2h" | "4h" | "6h" | "8h" | "12h" | "3d" | "1mo", Timeframe$1.SEC_1 | Timeframe$1.MIN_1 | Timeframe$1.MIN_3 | Timeframe$1.MIN_5 | Timeframe$1.MIN_15 | Timeframe$1.MIN_30 | Timeframe$1.HOUR_1 | Timeframe$1.HOUR_2 | Timeframe$1.HOUR_4 | Timeframe$1.HOUR_6 | Timeframe$1.HOUR_8 | Timeframe$1.HOUR_12 | Timeframe$1.DAY_1 | Timeframe$1.DAY_3 | Timeframe$1.WEEK_1 | Timeframe$1.MONTH_1>]>;
162
162
  readonly limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 10000, undefined>]>, undefined>;
163
163
  readonly includeIncomplete: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
164
164
  readonly includeReference: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
@@ -4,7 +4,7 @@ declare const CHANGELOG_CHANGE_CATEGORY_VALUES: readonly ["breaking_change", "ne
4
4
  type ChangelogChangeCategory = (typeof CHANGELOG_CHANGE_CATEGORY_VALUES)[number];
5
5
  declare const CHANGELOG_AUDIENCE_VALUES: readonly ["all_users", "traders", "market_makers", "developers"];
6
6
  type ChangelogAudience = (typeof CHANGELOG_AUDIENCE_VALUES)[number];
7
- declare const CHANGELOG_SURFACE_VALUES: readonly ["trading", "funding", "accounts", "api", "explorer", "documentation", "platform"];
7
+ declare const CHANGELOG_SURFACE_VALUES: readonly ["trading", "funding", "accounts", "api", "explorer", "documentation", "platform", "market_data", "quickswap", "rewards"];
8
8
  type ChangelogSurface = (typeof CHANGELOG_SURFACE_VALUES)[number];
9
9
  declare const CHANGELOG_SORT_VALUES: readonly ["asc", "desc"];
10
10
  type ChangelogSort = (typeof CHANGELOG_SORT_VALUES)[number];
@@ -1 +1 @@
1
- {"version":3,"file":"changelog.codecs.d.ts","names":[],"sources":["../../../src/services/changelog/changelog.codecs.ts"],"mappings":";;cAGa;KAMD,kCAAkC;cAEjC;KAMD,4BAA4B;cAE3B;KASD,2BAA2B;cAE1B;KACD,wBAAwB"}
1
+ {"version":3,"file":"changelog.codecs.d.ts","names":[],"sources":["../../../src/services/changelog/changelog.codecs.ts"],"mappings":";;cAGa;KAMD,kCAAkC;cAEjC;KAMD,4BAA4B;cAE3B;KAYD,2BAA2B;cAE1B;KACD,wBAAwB"}
@@ -19,7 +19,10 @@ const CHANGELOG_SURFACE_VALUES = [
19
19
  "api",
20
20
  "explorer",
21
21
  "documentation",
22
- "platform"
22
+ "platform",
23
+ "market_data",
24
+ "quickswap",
25
+ "rewards"
23
26
  ];
24
27
  const CHANGELOG_SORT_VALUES = ["asc", "desc"];
25
28
  const ChangelogChangeCategoryCodec = {
@@ -60,7 +63,10 @@ const ChangelogSurfaceCodec = {
60
63
  api: 4,
61
64
  explorer: 5,
62
65
  documentation: 6,
63
- platform: 7
66
+ platform: 7,
67
+ market_data: 8,
68
+ quickswap: 9,
69
+ rewards: 10
64
70
  },
65
71
  protoToOutput: {
66
72
  [0]: "unspecified",
@@ -70,7 +76,10 @@ const ChangelogSurfaceCodec = {
70
76
  [4]: "api",
71
77
  [5]: "explorer",
72
78
  [6]: "documentation",
73
- [7]: "platform"
79
+ [7]: "platform",
80
+ [8]: "market_data",
81
+ [9]: "quickswap",
82
+ [10]: "rewards"
74
83
  }
75
84
  };
76
85
  const ChangelogSortCodec = { inputToProto: {
@@ -1 +1 @@
1
- {"version":3,"file":"changelog.codecs.js","names":[],"sources":["../../../src/services/changelog/changelog.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/changelog/v1/changelog_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const CHANGELOG_CHANGE_CATEGORY_VALUES = [\n \"breaking_change\",\n \"new_feature\",\n \"improvement\",\n \"bug_fix\",\n] as const;\nexport type ChangelogChangeCategory = (typeof CHANGELOG_CHANGE_CATEGORY_VALUES)[number];\n\nexport const CHANGELOG_AUDIENCE_VALUES = [\n \"all_users\",\n \"traders\",\n \"market_makers\",\n \"developers\",\n] as const;\nexport type ChangelogAudience = (typeof CHANGELOG_AUDIENCE_VALUES)[number];\n\nexport const CHANGELOG_SURFACE_VALUES = [\n \"trading\",\n \"funding\",\n \"accounts\",\n \"api\",\n \"explorer\",\n \"documentation\",\n \"platform\",\n] as const;\nexport type ChangelogSurface = (typeof CHANGELOG_SURFACE_VALUES)[number];\n\nexport const CHANGELOG_SORT_VALUES = [\"asc\", \"desc\"] as const;\nexport type ChangelogSort = (typeof CHANGELOG_SORT_VALUES)[number];\n\nexport const ChangelogChangeCategoryCodec = {\n inputToProto: {\n breaking_change: Proto.ChangeCategory.BREAKING_CHANGE,\n new_feature: Proto.ChangeCategory.NEW_FEATURE,\n improvement: Proto.ChangeCategory.IMPROVEMENT,\n bug_fix: Proto.ChangeCategory.BUG_FIX,\n } satisfies InputToProto<ChangelogChangeCategory, Proto.ChangeCategory>,\n protoToOutput: {\n [Proto.ChangeCategory.CATEGORY_UNSPECIFIED]: \"unspecified\",\n [Proto.ChangeCategory.BREAKING_CHANGE]: \"breaking_change\",\n [Proto.ChangeCategory.NEW_FEATURE]: \"new_feature\",\n [Proto.ChangeCategory.IMPROVEMENT]: \"improvement\",\n [Proto.ChangeCategory.BUG_FIX]: \"bug_fix\",\n } satisfies ProtoToOutput<Proto.ChangeCategory, ChangelogChangeCategory>,\n} as const;\n\nexport const ChangelogAudienceCodec = {\n inputToProto: {\n all_users: Proto.Audience.ALL_USERS,\n traders: Proto.Audience.TRADERS,\n market_makers: Proto.Audience.MARKET_MAKERS,\n developers: Proto.Audience.DEVELOPERS,\n } satisfies InputToProto<ChangelogAudience, Proto.Audience>,\n protoToOutput: {\n [Proto.Audience.AUDIENCE_UNSPECIFIED]: \"unspecified\",\n [Proto.Audience.ALL_USERS]: \"all_users\",\n [Proto.Audience.TRADERS]: \"traders\",\n [Proto.Audience.MARKET_MAKERS]: \"market_makers\",\n [Proto.Audience.DEVELOPERS]: \"developers\",\n } satisfies ProtoToOutput<Proto.Audience, ChangelogAudience>,\n} as const;\n\nexport const ChangelogSurfaceCodec = {\n inputToProto: {\n trading: Proto.Surface.TRADING,\n funding: Proto.Surface.FUNDING,\n accounts: Proto.Surface.ACCOUNTS,\n api: Proto.Surface.API,\n explorer: Proto.Surface.EXPLORER,\n documentation: Proto.Surface.DOCUMENTATION,\n platform: Proto.Surface.PLATFORM,\n } satisfies InputToProto<ChangelogSurface, Proto.Surface>,\n protoToOutput: {\n [Proto.Surface.SURFACE_UNSPECIFIED]: \"unspecified\",\n [Proto.Surface.TRADING]: \"trading\",\n [Proto.Surface.FUNDING]: \"funding\",\n [Proto.Surface.ACCOUNTS]: \"accounts\",\n [Proto.Surface.API]: \"api\",\n [Proto.Surface.EXPLORER]: \"explorer\",\n [Proto.Surface.DOCUMENTATION]: \"documentation\",\n [Proto.Surface.PLATFORM]: \"platform\",\n } satisfies ProtoToOutput<Proto.Surface, ChangelogSurface>,\n} as const;\n\nexport const ChangelogSortCodec = {\n inputToProto: {\n asc: Proto.SortDirection.SORT_ASC,\n desc: Proto.SortDirection.SORT_DESC,\n } satisfies InputToProto<ChangelogSort, Proto.SortDirection>,\n} as const;\n"],"mappings":";;AAGA,MAAa,mCAAmC;CAC5C;CACA;CACA;CACA;AACJ;AAGA,MAAa,4BAA4B;CACrC;CACA;CACA;CACA;AACJ;AAGA,MAAa,2BAA2B;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;AAGA,MAAa,wBAAwB,CAAC,OAAO,MAAM;AAGnD,MAAa,+BAA+B;CACxC,cAAc;EACV,iBAAA;EACA,aAAA;EACA,aAAA;EACA,SAAA;CACJ;CACA,eAAe;GACkC,IAAA;GACL,IAAA;GACJ,IAAA;GACA,IAAA;GACJ,IAAA;CACpC;AACJ;AAEA,MAAa,yBAAyB;CAClC,cAAc;EACV,WAAA;EACA,SAAA;EACA,eAAA;EACA,YAAA;CACJ;CACA,eAAe;GAC4B,IAAA;GACX,IAAA;GACF,IAAA;GACM,IAAA;GACH,IAAA;CACjC;AACJ;AAEA,MAAa,wBAAwB;CACjC,cAAc;EACV,SAAA;EACA,SAAA;EACA,UAAA;EACA,KAAA;EACA,UAAA;EACA,eAAA;EACA,UAAA;CACJ;CACA,eAAe;GAC0B,IAAA;GACZ,IAAA;GACA,IAAA;GACC,IAAA;GACL,IAAA;GACK,IAAA;GACK,IAAA;GACL,IAAA;CAC9B;AACJ;AAEA,MAAa,qBAAqB,EAC9B,cAAc;CACV,KAAA;CACA,MAAA;AACJ,EACJ"}
1
+ {"version":3,"file":"changelog.codecs.js","names":[],"sources":["../../../src/services/changelog/changelog.codecs.ts"],"sourcesContent":["import * as Proto from \"../../gen/changelog/v1/changelog_pb.js\";\nimport type { InputToProto, ProtoToOutput } from \"../../utils/types.js\";\n\nexport const CHANGELOG_CHANGE_CATEGORY_VALUES = [\n \"breaking_change\",\n \"new_feature\",\n \"improvement\",\n \"bug_fix\",\n] as const;\nexport type ChangelogChangeCategory = (typeof CHANGELOG_CHANGE_CATEGORY_VALUES)[number];\n\nexport const CHANGELOG_AUDIENCE_VALUES = [\n \"all_users\",\n \"traders\",\n \"market_makers\",\n \"developers\",\n] as const;\nexport type ChangelogAudience = (typeof CHANGELOG_AUDIENCE_VALUES)[number];\n\nexport const CHANGELOG_SURFACE_VALUES = [\n \"trading\",\n \"funding\",\n \"accounts\",\n \"api\",\n \"explorer\",\n \"documentation\",\n \"platform\",\n \"market_data\",\n \"quickswap\",\n \"rewards\",\n] as const;\nexport type ChangelogSurface = (typeof CHANGELOG_SURFACE_VALUES)[number];\n\nexport const CHANGELOG_SORT_VALUES = [\"asc\", \"desc\"] as const;\nexport type ChangelogSort = (typeof CHANGELOG_SORT_VALUES)[number];\n\nexport const ChangelogChangeCategoryCodec = {\n inputToProto: {\n breaking_change: Proto.ChangeCategory.BREAKING_CHANGE,\n new_feature: Proto.ChangeCategory.NEW_FEATURE,\n improvement: Proto.ChangeCategory.IMPROVEMENT,\n bug_fix: Proto.ChangeCategory.BUG_FIX,\n } satisfies InputToProto<ChangelogChangeCategory, Proto.ChangeCategory>,\n protoToOutput: {\n [Proto.ChangeCategory.CATEGORY_UNSPECIFIED]: \"unspecified\",\n [Proto.ChangeCategory.BREAKING_CHANGE]: \"breaking_change\",\n [Proto.ChangeCategory.NEW_FEATURE]: \"new_feature\",\n [Proto.ChangeCategory.IMPROVEMENT]: \"improvement\",\n [Proto.ChangeCategory.BUG_FIX]: \"bug_fix\",\n } satisfies ProtoToOutput<Proto.ChangeCategory, ChangelogChangeCategory>,\n} as const;\n\nexport const ChangelogAudienceCodec = {\n inputToProto: {\n all_users: Proto.Audience.ALL_USERS,\n traders: Proto.Audience.TRADERS,\n market_makers: Proto.Audience.MARKET_MAKERS,\n developers: Proto.Audience.DEVELOPERS,\n } satisfies InputToProto<ChangelogAudience, Proto.Audience>,\n protoToOutput: {\n [Proto.Audience.AUDIENCE_UNSPECIFIED]: \"unspecified\",\n [Proto.Audience.ALL_USERS]: \"all_users\",\n [Proto.Audience.TRADERS]: \"traders\",\n [Proto.Audience.MARKET_MAKERS]: \"market_makers\",\n [Proto.Audience.DEVELOPERS]: \"developers\",\n } satisfies ProtoToOutput<Proto.Audience, ChangelogAudience>,\n} as const;\n\nexport const ChangelogSurfaceCodec = {\n inputToProto: {\n trading: Proto.Surface.TRADING,\n funding: Proto.Surface.FUNDING,\n accounts: Proto.Surface.ACCOUNTS,\n api: Proto.Surface.API,\n explorer: Proto.Surface.EXPLORER,\n documentation: Proto.Surface.DOCUMENTATION,\n platform: Proto.Surface.PLATFORM,\n market_data: Proto.Surface.MARKET_DATA,\n quickswap: Proto.Surface.QUICKSWAP,\n rewards: Proto.Surface.REWARDS,\n } satisfies InputToProto<ChangelogSurface, Proto.Surface>,\n protoToOutput: {\n [Proto.Surface.SURFACE_UNSPECIFIED]: \"unspecified\",\n [Proto.Surface.TRADING]: \"trading\",\n [Proto.Surface.FUNDING]: \"funding\",\n [Proto.Surface.ACCOUNTS]: \"accounts\",\n [Proto.Surface.API]: \"api\",\n [Proto.Surface.EXPLORER]: \"explorer\",\n [Proto.Surface.DOCUMENTATION]: \"documentation\",\n [Proto.Surface.PLATFORM]: \"platform\",\n [Proto.Surface.MARKET_DATA]: \"market_data\",\n [Proto.Surface.QUICKSWAP]: \"quickswap\",\n [Proto.Surface.REWARDS]: \"rewards\",\n } satisfies ProtoToOutput<Proto.Surface, ChangelogSurface>,\n} as const;\n\nexport const ChangelogSortCodec = {\n inputToProto: {\n asc: Proto.SortDirection.SORT_ASC,\n desc: Proto.SortDirection.SORT_DESC,\n } satisfies InputToProto<ChangelogSort, Proto.SortDirection>,\n} as const;\n"],"mappings":";;AAGA,MAAa,mCAAmC;CAC5C;CACA;CACA;CACA;AACJ;AAGA,MAAa,4BAA4B;CACrC;CACA;CACA;CACA;AACJ;AAGA,MAAa,2BAA2B;CACpC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACJ;AAGA,MAAa,wBAAwB,CAAC,OAAO,MAAM;AAGnD,MAAa,+BAA+B;CACxC,cAAc;EACV,iBAAA;EACA,aAAA;EACA,aAAA;EACA,SAAA;CACJ;CACA,eAAe;GACkC,IAAA;GACL,IAAA;GACJ,IAAA;GACA,IAAA;GACJ,IAAA;CACpC;AACJ;AAEA,MAAa,yBAAyB;CAClC,cAAc;EACV,WAAA;EACA,SAAA;EACA,eAAA;EACA,YAAA;CACJ;CACA,eAAe;GAC4B,IAAA;GACX,IAAA;GACF,IAAA;GACM,IAAA;GACH,IAAA;CACjC;AACJ;AAEA,MAAa,wBAAwB;CACjC,cAAc;EACV,SAAA;EACA,SAAA;EACA,UAAA;EACA,KAAA;EACA,UAAA;EACA,eAAA;EACA,UAAA;EACA,aAAA;EACA,WAAA;EACA,SAAA;CACJ;CACA,eAAe;GAC0B,IAAA;GACZ,IAAA;GACA,IAAA;GACC,IAAA;GACL,IAAA;GACK,IAAA;GACK,IAAA;GACL,IAAA;GACG,IAAA;GACF,IAAA;GACF,KAAA;CAC7B;AACJ;AAEA,MAAa,qBAAqB,EAC9B,cAAc;CACV,KAAA;CACA,MAAA;AACJ,EACJ"}