@chainflip/rpc 2.1.1-beta.0 → 2.1.2-bsc-dev.1
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/dist/common.d.cts +14840 -3154
- package/dist/common.d.mts +14840 -3154
- package/dist/parsers.cjs +74 -19
- package/dist/parsers.d.cts +18211 -4558
- package/dist/parsers.d.mts +18211 -4558
- package/dist/parsers.mjs +74 -19
- package/package.json +3 -3
package/dist/parsers.cjs
CHANGED
|
@@ -38,7 +38,17 @@ const chainAssetMapFactory = (parser, defaultValue) => zod.z.object({
|
|
|
38
38
|
DOT: parser,
|
|
39
39
|
USDC: parser,
|
|
40
40
|
USDT: parser
|
|
41
|
-
})
|
|
41
|
+
}),
|
|
42
|
+
Bsc: zod.z.object({
|
|
43
|
+
BNB: parser.default(defaultValue),
|
|
44
|
+
USDC: parser.default(defaultValue),
|
|
45
|
+
USDT: parser.default(defaultValue),
|
|
46
|
+
WBTC: parser.default(defaultValue)
|
|
47
|
+
}).optional(),
|
|
48
|
+
Tron: zod.z.object({
|
|
49
|
+
TRX: parser.default(defaultValue),
|
|
50
|
+
USDT: parser.default(defaultValue)
|
|
51
|
+
}).optional()
|
|
42
52
|
});
|
|
43
53
|
const chainBaseAssetMapFactory = (parser, defaultValue) => zod.z.object({
|
|
44
54
|
Bitcoin: zod.z.object({ BTC: parser }),
|
|
@@ -62,14 +72,26 @@ const chainBaseAssetMapFactory = (parser, defaultValue) => zod.z.object({
|
|
|
62
72
|
DOT: parser,
|
|
63
73
|
USDC: parser,
|
|
64
74
|
USDT: parser
|
|
65
|
-
})
|
|
75
|
+
}),
|
|
76
|
+
Bsc: zod.z.object({
|
|
77
|
+
BNB: parser.default(defaultValue),
|
|
78
|
+
USDC: parser.default(defaultValue),
|
|
79
|
+
USDT: parser.default(defaultValue),
|
|
80
|
+
WBTC: parser.default(defaultValue)
|
|
81
|
+
}).optional(),
|
|
82
|
+
Tron: zod.z.object({
|
|
83
|
+
TRX: parser.default(defaultValue),
|
|
84
|
+
USDT: parser.default(defaultValue)
|
|
85
|
+
}).optional()
|
|
66
86
|
});
|
|
67
|
-
const chainMapFactory = (parser,
|
|
87
|
+
const chainMapFactory = (parser, defaultValue) => zod.z.object({
|
|
68
88
|
Bitcoin: parser,
|
|
69
89
|
Ethereum: parser,
|
|
70
90
|
Arbitrum: parser,
|
|
71
91
|
Solana: parser,
|
|
72
|
-
Assethub: parser
|
|
92
|
+
Assethub: parser,
|
|
93
|
+
Bsc: parser.default(defaultValue).optional(),
|
|
94
|
+
Tron: parser.default(defaultValue).optional()
|
|
73
95
|
});
|
|
74
96
|
const rpcAssetSchema = zod.z.union([
|
|
75
97
|
zod.z.object({
|
|
@@ -131,6 +153,30 @@ const rpcAssetSchema = zod.z.union([
|
|
|
131
153
|
zod.z.object({
|
|
132
154
|
chain: zod.z.literal("Assethub"),
|
|
133
155
|
asset: zod.z.literal("USDT")
|
|
156
|
+
}),
|
|
157
|
+
zod.z.object({
|
|
158
|
+
chain: zod.z.literal("Bsc"),
|
|
159
|
+
asset: zod.z.literal("BNB")
|
|
160
|
+
}),
|
|
161
|
+
zod.z.object({
|
|
162
|
+
chain: zod.z.literal("Bsc"),
|
|
163
|
+
asset: zod.z.literal("USDC")
|
|
164
|
+
}),
|
|
165
|
+
zod.z.object({
|
|
166
|
+
chain: zod.z.literal("Bsc"),
|
|
167
|
+
asset: zod.z.literal("USDT")
|
|
168
|
+
}),
|
|
169
|
+
zod.z.object({
|
|
170
|
+
chain: zod.z.literal("Bsc"),
|
|
171
|
+
asset: zod.z.literal("WBTC")
|
|
172
|
+
}),
|
|
173
|
+
zod.z.object({
|
|
174
|
+
chain: zod.z.literal("Tron"),
|
|
175
|
+
asset: zod.z.literal("TRX")
|
|
176
|
+
}),
|
|
177
|
+
zod.z.object({
|
|
178
|
+
chain: zod.z.literal("Tron"),
|
|
179
|
+
asset: zod.z.literal("USDT")
|
|
134
180
|
})
|
|
135
181
|
]);
|
|
136
182
|
const networkFee = zod.z.object({
|
|
@@ -188,17 +234,18 @@ const cfIngressEgressEnvironment = zod.z.object({
|
|
|
188
234
|
witness_safety_margins: chainMapFactory(zod.z.number().nullable(), null),
|
|
189
235
|
egress_dust_limits: chainAssetMapFactory(numberOrHex, 0),
|
|
190
236
|
channel_opening_fees: chainMapFactory(numberOrHex, 0),
|
|
191
|
-
ingress_delays: chainMapFactory(zod.z.number(), 0)
|
|
192
|
-
boost_delays: chainMapFactory(zod.z.number(), 0)
|
|
237
|
+
ingress_delays: chainMapFactory(zod.z.number(), 0),
|
|
238
|
+
boost_delays: chainMapFactory(zod.z.number(), 0)
|
|
193
239
|
}).transform(rename({ egress_dust_limits: "minimum_egress_amounts" }));
|
|
194
240
|
const cfSwappingEnvironment = zod.z.object({
|
|
195
241
|
maximum_swap_amounts: chainAssetMapFactory(numberOrHex.nullable(), null),
|
|
196
242
|
network_fee_hundredth_pips: zod.z.number(),
|
|
197
|
-
swap_retry_delay_blocks: zod.z.number()
|
|
198
|
-
max_swap_retry_duration_blocks: zod.z.number()
|
|
199
|
-
max_swap_request_duration_blocks: zod.z.number()
|
|
200
|
-
minimum_chunk_size: chainAssetMapFactory(numberOrHex.nullable(), null)
|
|
201
|
-
network_fees: networkFees
|
|
243
|
+
swap_retry_delay_blocks: zod.z.number(),
|
|
244
|
+
max_swap_retry_duration_blocks: zod.z.number(),
|
|
245
|
+
max_swap_request_duration_blocks: zod.z.number(),
|
|
246
|
+
minimum_chunk_size: chainAssetMapFactory(numberOrHex.nullable(), null),
|
|
247
|
+
network_fees: networkFees,
|
|
248
|
+
default_oracle_price_protection: chainAssetMapFactory(zod.z.number().nullable(), null).optional()
|
|
202
249
|
});
|
|
203
250
|
const cfFundingEnvironment = zod.z.object({
|
|
204
251
|
redemption_tax: numberOrHex,
|
|
@@ -308,6 +355,7 @@ const requestSwapParameterEncoding = zod.z.discriminatedUnion("chain", [
|
|
|
308
355
|
}),
|
|
309
356
|
evmBrokerRequestSwapParameterEncoding.extend({ chain: zod.z.literal("Ethereum") }),
|
|
310
357
|
evmBrokerRequestSwapParameterEncoding.extend({ chain: zod.z.literal("Arbitrum") }),
|
|
358
|
+
evmBrokerRequestSwapParameterEncoding.extend({ chain: zod.z.literal("Bsc") }),
|
|
311
359
|
zod.z.object({
|
|
312
360
|
chain: zod.z.literal("Solana"),
|
|
313
361
|
program_id: zod.z.string(),
|
|
@@ -317,6 +365,13 @@ const requestSwapParameterEncoding = zod.z.discriminatedUnion("chain", [
|
|
|
317
365
|
is_signer: zod.z.boolean(),
|
|
318
366
|
is_writable: zod.z.boolean()
|
|
319
367
|
}))
|
|
368
|
+
}),
|
|
369
|
+
zod.z.object({
|
|
370
|
+
chain: zod.z.literal("Tron"),
|
|
371
|
+
to: hexString,
|
|
372
|
+
calldata: hexString,
|
|
373
|
+
value: numberOrHex,
|
|
374
|
+
source_token_address: hexString.optional()
|
|
320
375
|
})
|
|
321
376
|
]);
|
|
322
377
|
const delegationStatus = zod.z.object({
|
|
@@ -383,8 +438,8 @@ const liquidityProvider = zod.z.object({
|
|
|
383
438
|
lending_positions: zod.z.array(zod.z.intersection(rpcAssetSchema, zod.z.object({
|
|
384
439
|
total_amount: numberOrHex,
|
|
385
440
|
available_amount: numberOrHex
|
|
386
|
-
})))
|
|
387
|
-
collateral_balances: zod.z.array(zod.z.intersection(rpcAssetSchema, zod.z.object({ amount: numberOrHex })))
|
|
441
|
+
}))),
|
|
442
|
+
collateral_balances: zod.z.array(zod.z.intersection(rpcAssetSchema, zod.z.object({ amount: numberOrHex })))
|
|
388
443
|
});
|
|
389
444
|
const validator = zod.z.object({
|
|
390
445
|
role: zod.z.literal("validator"),
|
|
@@ -587,7 +642,7 @@ const cfOraclePrices = zod.z.array(zod.z.object({
|
|
|
587
642
|
"UpToDate",
|
|
588
643
|
"Stale",
|
|
589
644
|
"MaybeStale"
|
|
590
|
-
])
|
|
645
|
+
])
|
|
591
646
|
}));
|
|
592
647
|
const broadcastPalletSafeModeStatuses = zod.z.object({
|
|
593
648
|
retry_enabled: zod.z.boolean(),
|
|
@@ -635,11 +690,11 @@ const cfSafeModeStatuses = zod.z.object({
|
|
|
635
690
|
lending_pools: zod.z.object({
|
|
636
691
|
add_boost_funds_enabled: zod.z.boolean(),
|
|
637
692
|
stop_boosting_enabled: zod.z.boolean(),
|
|
638
|
-
borrowing_enabled: zod.z.array(rpcAssetSchema)
|
|
639
|
-
add_lender_funds_enabled: zod.z.array(rpcAssetSchema)
|
|
640
|
-
withdraw_lender_funds_enabled: zod.z.array(rpcAssetSchema)
|
|
641
|
-
add_collateral_enabled: zod.z.array(rpcAssetSchema)
|
|
642
|
-
remove_collateral_enabled: zod.z.array(rpcAssetSchema)
|
|
693
|
+
borrowing_enabled: zod.z.array(rpcAssetSchema),
|
|
694
|
+
add_lender_funds_enabled: zod.z.array(rpcAssetSchema),
|
|
695
|
+
withdraw_lender_funds_enabled: zod.z.array(rpcAssetSchema),
|
|
696
|
+
add_collateral_enabled: zod.z.array(rpcAssetSchema),
|
|
697
|
+
remove_collateral_enabled: zod.z.array(rpcAssetSchema)
|
|
643
698
|
}),
|
|
644
699
|
broadcast_ethereum: broadcastPalletSafeModeStatuses,
|
|
645
700
|
broadcast_bitcoin: broadcastPalletSafeModeStatuses,
|