@chainflip/rpc 1.11.0-beta.1 → 1.11.0-beta.11
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/Client.d.cts +1 -0
- package/dist/Client.d.ts +1 -0
- package/dist/HttpClient.d.cts +1 -0
- package/dist/HttpClient.d.ts +1 -0
- package/dist/WsClient.d.cts +1 -0
- package/dist/WsClient.d.ts +1 -0
- package/dist/common.cjs +5 -1
- package/dist/common.d.cts +4065 -514
- package/dist/common.d.ts +4065 -514
- package/dist/common.mjs +6 -2
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/parsers.cjs +137 -37
- package/dist/parsers.d.cts +12332 -1110
- package/dist/parsers.d.ts +12332 -1110
- package/dist/parsers.mjs +135 -35
- package/dist/types.d.cts +6 -1
- package/dist/types.d.ts +6 -1
- package/package.json +3 -3
package/dist/parsers.mjs
CHANGED
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
// src/parsers.ts
|
|
2
|
+
import { priceAssets } from "@chainflip/utils/chainflip";
|
|
2
3
|
import { isUndefined } from "@chainflip/utils/guard";
|
|
3
4
|
import { isHex } from "@chainflip/utils/string";
|
|
4
5
|
import { z } from "zod";
|
|
5
6
|
var hexString = z.string().refine(isHex, { message: "Invalid hex string" });
|
|
6
7
|
var u256 = hexString.transform((value) => BigInt(value));
|
|
7
8
|
var numberOrHex = z.union([z.number().transform((n) => BigInt(n)), u256]);
|
|
8
|
-
var chainAssetMapFactory = (parser,
|
|
9
|
+
var chainAssetMapFactory = (parser, _defaultValue) => z.object({
|
|
9
10
|
Bitcoin: z.object({ BTC: parser }),
|
|
10
11
|
Ethereum: z.object({ ETH: parser, USDC: parser, FLIP: parser, USDT: parser }),
|
|
11
12
|
Polkadot: z.object({ DOT: parser }),
|
|
12
13
|
Arbitrum: z.object({ ETH: parser, USDC: parser }),
|
|
13
14
|
Solana: z.object({ SOL: parser, USDC: parser }),
|
|
14
|
-
Assethub: z.object({ DOT: parser, USDC: parser, USDT: parser })
|
|
15
|
+
Assethub: z.object({ DOT: parser, USDC: parser, USDT: parser })
|
|
15
16
|
});
|
|
16
|
-
var chainBaseAssetMapFactory = (parser,
|
|
17
|
+
var chainBaseAssetMapFactory = (parser, _defaultValue) => z.object({
|
|
17
18
|
Bitcoin: z.object({ BTC: parser }),
|
|
18
19
|
Ethereum: z.object({ ETH: parser, FLIP: parser, USDT: parser }),
|
|
19
20
|
Polkadot: z.object({ DOT: parser }),
|
|
20
21
|
Arbitrum: z.object({ ETH: parser, USDC: parser }),
|
|
21
22
|
Solana: z.object({ SOL: parser, USDC: parser }),
|
|
22
|
-
Assethub: z.object({ DOT: parser, USDC: parser, USDT: parser })
|
|
23
|
+
Assethub: z.object({ DOT: parser, USDC: parser, USDT: parser })
|
|
23
24
|
});
|
|
24
|
-
var chainMapFactory = (parser,
|
|
25
|
+
var chainMapFactory = (parser, _defaultValue) => z.object({
|
|
25
26
|
Bitcoin: parser,
|
|
26
27
|
Ethereum: parser,
|
|
27
28
|
Polkadot: parser,
|
|
28
29
|
Arbitrum: parser,
|
|
29
30
|
Solana: parser,
|
|
30
|
-
Assethub: parser
|
|
31
|
+
Assethub: parser
|
|
31
32
|
});
|
|
32
33
|
var rpcAssetSchema = z.union([
|
|
33
34
|
z.object({ chain: z.literal("Bitcoin"), asset: z.literal("BTC") }),
|
|
@@ -113,8 +114,7 @@ var cfSwappingEnvironment = z.object({
|
|
|
113
114
|
max_swap_retry_duration_blocks: z.number().optional(),
|
|
114
115
|
max_swap_request_duration_blocks: z.number().optional(),
|
|
115
116
|
minimum_chunk_size: chainAssetMapFactory(numberOrHex.nullable(), null).optional(),
|
|
116
|
-
network_fees: networkFees
|
|
117
|
-
// TODO(1.10): remove optional
|
|
117
|
+
network_fees: networkFees
|
|
118
118
|
});
|
|
119
119
|
var cfFundingEnvironment = z.object({
|
|
120
120
|
redemption_tax: numberOrHex,
|
|
@@ -205,31 +205,62 @@ var requestSwapParameterEncoding = z.discriminatedUnion("chain", [
|
|
|
205
205
|
)
|
|
206
206
|
})
|
|
207
207
|
]);
|
|
208
|
-
var
|
|
208
|
+
var accountId = z.string().refine((val) => val.startsWith("cF"));
|
|
209
|
+
var delegationStatus = z.object({
|
|
210
|
+
operator: accountId,
|
|
211
|
+
bid: numberOrHex
|
|
212
|
+
});
|
|
213
|
+
var accountInfoCommon = {
|
|
214
|
+
flip_balance: numberOrHex,
|
|
215
|
+
asset_balances: chainAssetMapFactory(numberOrHex, 0),
|
|
216
|
+
bond: numberOrHex,
|
|
217
|
+
estimated_redeemable_balance: numberOrHex,
|
|
218
|
+
bound_redeem_address: hexString.optional(),
|
|
219
|
+
restricted_balances: z.record(hexString, numberOrHex).optional(),
|
|
220
|
+
current_delegation_status: delegationStatus.optional(),
|
|
221
|
+
upcoming_delegation_status: delegationStatus.optional()
|
|
222
|
+
};
|
|
223
|
+
var oldUnregistered = z.object({
|
|
209
224
|
role: z.literal("unregistered"),
|
|
210
225
|
flip_balance: numberOrHex,
|
|
211
226
|
asset_balances: chainAssetMapFactory(numberOrHex, 0)
|
|
212
227
|
});
|
|
213
|
-
var
|
|
228
|
+
var unregistered = z.object({
|
|
229
|
+
role: z.literal("unregistered"),
|
|
230
|
+
...accountInfoCommon
|
|
231
|
+
});
|
|
232
|
+
var oldBroker = z.object({
|
|
214
233
|
role: z.literal("broker"),
|
|
215
234
|
bond: numberOrHex,
|
|
216
235
|
flip_balance: numberOrHex,
|
|
217
236
|
earned_fees: chainAssetMapFactory(numberOrHex, 0),
|
|
218
237
|
btc_vault_deposit_address: z.string().nullable().optional(),
|
|
219
|
-
affiliates: z.array(
|
|
220
|
-
|
|
221
|
-
|
|
238
|
+
affiliates: z.array(z.object({ account_id: accountId, short_id: z.number(), withdrawal_address: hexString })).optional().default([])
|
|
239
|
+
});
|
|
240
|
+
var broker = z.object({
|
|
241
|
+
role: z.literal("broker"),
|
|
242
|
+
...accountInfoCommon,
|
|
243
|
+
earned_fees: chainAssetMapFactory(numberOrHex, 0),
|
|
244
|
+
btc_vault_deposit_address: z.string().nullable().optional(),
|
|
245
|
+
affiliates: z.array(z.object({ account_id: accountId, short_id: z.number(), withdrawal_address: hexString })).optional().default([])
|
|
222
246
|
});
|
|
223
247
|
var operator = z.object({
|
|
224
248
|
role: z.literal("operator"),
|
|
225
|
-
|
|
226
|
-
|
|
249
|
+
...accountInfoCommon,
|
|
250
|
+
managed_validators: z.record(accountId, numberOrHex),
|
|
251
|
+
delegators: z.record(accountId, numberOrHex),
|
|
227
252
|
settings: z.object({
|
|
228
253
|
fee_bps: z.number(),
|
|
229
|
-
delegation_acceptance: z.
|
|
254
|
+
delegation_acceptance: z.enum(["Allow", "Deny"])
|
|
230
255
|
}),
|
|
231
|
-
allowed: z.array(
|
|
232
|
-
blocked: z.array(
|
|
256
|
+
allowed: z.array(accountId).optional().default([]),
|
|
257
|
+
blocked: z.array(accountId).optional().default([]),
|
|
258
|
+
active_delegation: z.object({
|
|
259
|
+
operator: accountId,
|
|
260
|
+
validators: z.record(accountId, numberOrHex),
|
|
261
|
+
delegators: z.record(accountId, numberOrHex),
|
|
262
|
+
delegation_fee_bps: z.number()
|
|
263
|
+
}).optional()
|
|
233
264
|
});
|
|
234
265
|
var boostBalances = z.array(
|
|
235
266
|
z.object({
|
|
@@ -240,7 +271,7 @@ var boostBalances = z.array(
|
|
|
240
271
|
is_withdrawing: z.boolean()
|
|
241
272
|
})
|
|
242
273
|
);
|
|
243
|
-
var
|
|
274
|
+
var oldLiquidityProvider = z.object({
|
|
244
275
|
role: z.literal("liquidity_provider"),
|
|
245
276
|
balances: chainAssetMapFactory(numberOrHex, "0x0"),
|
|
246
277
|
refund_addresses: chainMapFactory(z.string().nullable(), null),
|
|
@@ -248,7 +279,14 @@ var liquidityProvider = z.object({
|
|
|
248
279
|
earned_fees: chainAssetMapFactory(numberOrHex, 0),
|
|
249
280
|
boost_balances: chainAssetMapFactory(boostBalances, [])
|
|
250
281
|
});
|
|
251
|
-
var
|
|
282
|
+
var liquidityProvider = z.object({
|
|
283
|
+
role: z.literal("liquidity_provider"),
|
|
284
|
+
...accountInfoCommon,
|
|
285
|
+
refund_addresses: chainMapFactory(z.string().nullable(), null),
|
|
286
|
+
earned_fees: chainAssetMapFactory(numberOrHex, 0),
|
|
287
|
+
boost_balances: chainAssetMapFactory(boostBalances, [])
|
|
288
|
+
});
|
|
289
|
+
var oldValidator = z.object({
|
|
252
290
|
role: z.literal("validator"),
|
|
253
291
|
flip_balance: numberOrHex,
|
|
254
292
|
bond: numberOrHex,
|
|
@@ -263,16 +301,56 @@ var validator = z.object({
|
|
|
263
301
|
bound_redeem_address: hexString.nullable(),
|
|
264
302
|
apy_bp: z.number().nullable(),
|
|
265
303
|
restricted_balances: z.record(hexString, numberOrHex),
|
|
266
|
-
estimated_redeemable_balance: numberOrHex
|
|
267
|
-
|
|
304
|
+
estimated_redeemable_balance: numberOrHex,
|
|
305
|
+
operator: accountId.optional()
|
|
268
306
|
});
|
|
269
|
-
var
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
307
|
+
var validator = z.object({
|
|
308
|
+
role: z.literal("validator"),
|
|
309
|
+
...accountInfoCommon,
|
|
310
|
+
last_heartbeat: z.number(),
|
|
311
|
+
reputation_points: z.number(),
|
|
312
|
+
keyholder_epochs: z.array(z.number()),
|
|
313
|
+
is_current_authority: z.boolean(),
|
|
314
|
+
is_current_backup: z.boolean(),
|
|
315
|
+
is_qualified: z.boolean(),
|
|
316
|
+
is_online: z.boolean(),
|
|
317
|
+
is_bidding: z.boolean(),
|
|
318
|
+
apy_bp: z.number().nullable(),
|
|
319
|
+
operator: accountId.optional()
|
|
320
|
+
});
|
|
321
|
+
var newCfAccountInfo = z.discriminatedUnion("role", [unregistered, broker, operator, liquidityProvider, validator]).transform((account) => {
|
|
322
|
+
switch (account.role) {
|
|
323
|
+
case "broker":
|
|
324
|
+
case "validator":
|
|
325
|
+
case "unregistered":
|
|
326
|
+
return account;
|
|
327
|
+
case "operator": {
|
|
328
|
+
const { managed_validators, delegators, settings, ...rest } = account;
|
|
329
|
+
return {
|
|
330
|
+
...rest,
|
|
331
|
+
upcoming_delegation: {
|
|
332
|
+
validators: managed_validators,
|
|
333
|
+
delegators,
|
|
334
|
+
delegation_fee_bps: settings.fee_bps,
|
|
335
|
+
delegation_acceptance: settings.delegation_acceptance
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
// TODO(1.11): remove after all networks upgraded
|
|
340
|
+
case "liquidity_provider":
|
|
341
|
+
return {
|
|
342
|
+
...account,
|
|
343
|
+
balances: account.asset_balances
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
var oldCfAccountInfo = z.discriminatedUnion("role", [
|
|
348
|
+
oldUnregistered,
|
|
349
|
+
oldBroker,
|
|
350
|
+
oldLiquidityProvider,
|
|
351
|
+
oldValidator
|
|
275
352
|
]);
|
|
353
|
+
var cfAccountInfo = z.union([newCfAccountInfo, oldCfAccountInfo]);
|
|
276
354
|
var cfAccounts = z.array(z.tuple([z.string(), z.string()]));
|
|
277
355
|
var cfPoolPriceV2 = z.object({
|
|
278
356
|
sell: numberOrHex.nullable(),
|
|
@@ -364,9 +442,8 @@ var cfAuctionState = z.object({
|
|
|
364
442
|
redemption_period_as_percentage: z.number(),
|
|
365
443
|
min_funding: numberOrHex,
|
|
366
444
|
auction_size_range: range(z.number()),
|
|
367
|
-
min_active_bid: numberOrHex,
|
|
368
|
-
min_bid: numberOrHex
|
|
369
|
-
// TODO(1.10): remove optional
|
|
445
|
+
min_active_bid: numberOrHex.nullable(),
|
|
446
|
+
min_bid: numberOrHex
|
|
370
447
|
}).transform(rename({ epoch_duration: "epoch_duration_blocks" }));
|
|
371
448
|
var cfFlipSuppy = range(numberOrHex).transform(([totalIssuance, offchainFunds]) => ({
|
|
372
449
|
totalIssuance,
|
|
@@ -419,6 +496,15 @@ var cfAvailablePools = z.array(
|
|
|
419
496
|
quote: z.object({ chain: z.literal("Ethereum"), asset: z.literal("USDC") })
|
|
420
497
|
})
|
|
421
498
|
);
|
|
499
|
+
var cfOraclePrices = z.array(
|
|
500
|
+
z.object({
|
|
501
|
+
price: numberOrHex,
|
|
502
|
+
updated_at_oracle_timestamp: z.number(),
|
|
503
|
+
updated_at_statechain_block: z.number(),
|
|
504
|
+
base_asset: z.enum(priceAssets),
|
|
505
|
+
quote_asset: z.enum(priceAssets)
|
|
506
|
+
})
|
|
507
|
+
);
|
|
422
508
|
var broadcastPalletSafeModeStatuses = z.object({
|
|
423
509
|
retry_enabled: z.boolean(),
|
|
424
510
|
// TODO(1.10): make not optional
|
|
@@ -460,10 +546,6 @@ var cfSafeModeStatusesBase = z.object({
|
|
|
460
546
|
strategy_updates_enabled: z.boolean(),
|
|
461
547
|
strategy_closure_enabled: z.boolean(),
|
|
462
548
|
strategy_execution_enabled: z.boolean()
|
|
463
|
-
}).optional().default({
|
|
464
|
-
strategy_updates_enabled: false,
|
|
465
|
-
strategy_closure_enabled: false,
|
|
466
|
-
strategy_execution_enabled: false
|
|
467
549
|
}),
|
|
468
550
|
reputation: z.object({
|
|
469
551
|
reporting_enabled: z.boolean()
|
|
@@ -543,7 +625,17 @@ var cfSafeModeStatuses = z.union([
|
|
|
543
625
|
ingress_egress_assethub: ingressEgressPalletSafeModeStatuses
|
|
544
626
|
})
|
|
545
627
|
]);
|
|
628
|
+
var cfLendingPools = z.array(
|
|
629
|
+
z.object({
|
|
630
|
+
asset: rpcAssetSchema,
|
|
631
|
+
total_amount: numberOrHex,
|
|
632
|
+
available_amount: numberOrHex,
|
|
633
|
+
utilisation_rate: z.number(),
|
|
634
|
+
interest_rate: z.number()
|
|
635
|
+
})
|
|
636
|
+
);
|
|
546
637
|
export {
|
|
638
|
+
accountInfoCommon,
|
|
547
639
|
broker,
|
|
548
640
|
brokerRequestSwapDepositAddress,
|
|
549
641
|
cfAccountInfo,
|
|
@@ -560,6 +652,8 @@ export {
|
|
|
560
652
|
cfGetTradingStrategies,
|
|
561
653
|
cfGetTradingStrategyLimits,
|
|
562
654
|
cfIngressEgressEnvironment,
|
|
655
|
+
cfLendingPools,
|
|
656
|
+
cfOraclePrices,
|
|
563
657
|
cfPoolDepth,
|
|
564
658
|
cfPoolOrderbook,
|
|
565
659
|
cfPoolOrders,
|
|
@@ -577,7 +671,13 @@ export {
|
|
|
577
671
|
hexString,
|
|
578
672
|
liquidityProvider,
|
|
579
673
|
lpTotalBalances,
|
|
674
|
+
newCfAccountInfo,
|
|
580
675
|
numberOrHex,
|
|
676
|
+
oldBroker,
|
|
677
|
+
oldCfAccountInfo,
|
|
678
|
+
oldLiquidityProvider,
|
|
679
|
+
oldUnregistered,
|
|
680
|
+
oldValidator,
|
|
581
681
|
operator,
|
|
582
682
|
requestSwapParameterEncoding,
|
|
583
683
|
rpcResponse,
|
package/dist/types.d.cts
CHANGED
|
@@ -3,6 +3,7 @@ import { RpcResult, RpcResponse } from './common.cjs';
|
|
|
3
3
|
export { RpcMethod, RpcRequest as RpcParams } from './common.cjs';
|
|
4
4
|
import { unregistered, broker, validator, liquidityProvider, operator } from './parsers.cjs';
|
|
5
5
|
export { RpcLimitOrder, RpcRangeOrder } from './parsers.cjs';
|
|
6
|
+
import '@chainflip/utils/chainflip';
|
|
6
7
|
import '@chainflip/utils/types';
|
|
7
8
|
|
|
8
9
|
type CfAccountInfo = RpcResult<'cf_account_info'>;
|
|
@@ -33,6 +34,8 @@ type CfSwappingEnvironment = RpcResult<'cf_swapping_environment'>;
|
|
|
33
34
|
type CfSwapRate = RpcResult<'cf_swap_rate'>;
|
|
34
35
|
type CfSwapRateV2 = RpcResult<'cf_swap_rate_v2'>;
|
|
35
36
|
type CfSwapRateV3 = RpcResult<'cf_swap_rate_v3'>;
|
|
37
|
+
type CfOraclePrices = RpcResult<'cf_oracle_prices'>;
|
|
38
|
+
type CfLendingPools = RpcResult<'cf_lending_pools'>;
|
|
36
39
|
type CfAccountInfoResponse = RpcResponse<'cf_account_info'>;
|
|
37
40
|
type CfAccountsResponse = RpcResponse<'cf_accounts'>;
|
|
38
41
|
type CfAuctionStateResponse = RpcResponse<'cf_auction_state'>;
|
|
@@ -61,6 +64,8 @@ type CfSwappingEnvironmentResponse = RpcResponse<'cf_swapping_environment'>;
|
|
|
61
64
|
type CfSwapRateResponse = RpcResponse<'cf_swap_rate'>;
|
|
62
65
|
type CfSwapRateV2Response = RpcResponse<'cf_swap_rate_v2'>;
|
|
63
66
|
type CfSwapRateV3Response = RpcResponse<'cf_swap_rate_v3'>;
|
|
67
|
+
type CfOraclePricesResponse = RpcResponse<'cf_oracle_prices'>;
|
|
68
|
+
type CfLendingPoolsResponse = RpcResponse<'cf_lending_pools'>;
|
|
64
69
|
type CfUnregisteredAccount = z.output<typeof unregistered>;
|
|
65
70
|
type CfBrokerAccount = z.output<typeof broker>;
|
|
66
71
|
type CfValidatorAccount = z.output<typeof validator>;
|
|
@@ -69,4 +74,4 @@ type CfOperatorAccount = z.output<typeof operator>;
|
|
|
69
74
|
type LpTotalBalances = RpcResult<'lp_total_balances'>;
|
|
70
75
|
type LpTotalBalancesResponse = RpcResponse<'lp_total_balances'>;
|
|
71
76
|
|
|
72
|
-
export { type CfAccountInfo, type CfAccountInfoResponse, type CfAccounts, type CfAccountsResponse, type CfAuctionState, type CfAuctionStateResponse, type CfAvailablePools, type CfAvailablePoolsResponse, type CfBoostPoolDetails, type CfBoostPoolDetailsResponse, type CfBoostPoolPendingFees, type CfBoostPoolPendingFeesResponse, type CfBoostPoolsDepth, type CfBoostPoolsDepthResponse, type CfBrokerAccount, type CfEncodeCfParameters, type CfEncodeCfParametersResponse, type CfEnvironment, type CfEnvironmentResponse, type CfFailedCallArbitrum, type CfFailedCallArbitrumResponse, type CfFailedCallEthereum, type CfFailedCallEthereumResponse, type CfFlipSupply, type CfFlipSupplyResponse, type CfFundingEnvironment, type CfFundingEnvironmentResponse, type CfGetTradingStrategies, type CfGetTradingStrategiesResponse, type CfGetTradingStrategyLimits, type CfGetTradingStrategyLimitsResponse, type CfIngressEgressEnvironment, type CfIngressEgressEnvironmentResponse, type CfLiquidityProviderAccount, type CfOperatorAccount, type CfPoolDepth, type CfPoolDepthResponse, type CfPoolOrderbook, type CfPoolOrderbookResponse, type CfPoolOrders, type CfPoolOrdersResponse, type CfPoolPriceV2, type CfPoolPriceV2Response, type CfPoolsEnvironment, type CfPoolsEnvironmentResponse, type CfRequestSwapParameterEncoding, type CfRequestSwapParameterEncodingResponse, type CfSafeModeStatuses, type CfSafeModeStatusesResponse, type CfSupportedAssets, type CfSupportedAssetsResponse, type CfSwapRate, type CfSwapRateResponse, type CfSwapRateV2, type CfSwapRateV2Response, type CfSwapRateV3, type CfSwapRateV3Response, type CfSwappingEnvironment, type CfSwappingEnvironmentResponse, type CfUnregisteredAccount, type CfValidatorAccount, type LpTotalBalances, type LpTotalBalancesResponse, RpcResult };
|
|
77
|
+
export { type CfAccountInfo, type CfAccountInfoResponse, type CfAccounts, type CfAccountsResponse, type CfAuctionState, type CfAuctionStateResponse, type CfAvailablePools, type CfAvailablePoolsResponse, type CfBoostPoolDetails, type CfBoostPoolDetailsResponse, type CfBoostPoolPendingFees, type CfBoostPoolPendingFeesResponse, type CfBoostPoolsDepth, type CfBoostPoolsDepthResponse, type CfBrokerAccount, type CfEncodeCfParameters, type CfEncodeCfParametersResponse, type CfEnvironment, type CfEnvironmentResponse, type CfFailedCallArbitrum, type CfFailedCallArbitrumResponse, type CfFailedCallEthereum, type CfFailedCallEthereumResponse, type CfFlipSupply, type CfFlipSupplyResponse, type CfFundingEnvironment, type CfFundingEnvironmentResponse, type CfGetTradingStrategies, type CfGetTradingStrategiesResponse, type CfGetTradingStrategyLimits, type CfGetTradingStrategyLimitsResponse, type CfIngressEgressEnvironment, type CfIngressEgressEnvironmentResponse, type CfLendingPools, type CfLendingPoolsResponse, type CfLiquidityProviderAccount, type CfOperatorAccount, type CfOraclePrices, type CfOraclePricesResponse, type CfPoolDepth, type CfPoolDepthResponse, type CfPoolOrderbook, type CfPoolOrderbookResponse, type CfPoolOrders, type CfPoolOrdersResponse, type CfPoolPriceV2, type CfPoolPriceV2Response, type CfPoolsEnvironment, type CfPoolsEnvironmentResponse, type CfRequestSwapParameterEncoding, type CfRequestSwapParameterEncodingResponse, type CfSafeModeStatuses, type CfSafeModeStatusesResponse, type CfSupportedAssets, type CfSupportedAssetsResponse, type CfSwapRate, type CfSwapRateResponse, type CfSwapRateV2, type CfSwapRateV2Response, type CfSwapRateV3, type CfSwapRateV3Response, type CfSwappingEnvironment, type CfSwappingEnvironmentResponse, type CfUnregisteredAccount, type CfValidatorAccount, type LpTotalBalances, type LpTotalBalancesResponse, RpcResult };
|
package/dist/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { RpcResult, RpcResponse } from './common.js';
|
|
|
3
3
|
export { RpcMethod, RpcRequest as RpcParams } from './common.js';
|
|
4
4
|
import { unregistered, broker, validator, liquidityProvider, operator } from './parsers.js';
|
|
5
5
|
export { RpcLimitOrder, RpcRangeOrder } from './parsers.js';
|
|
6
|
+
import '@chainflip/utils/chainflip';
|
|
6
7
|
import '@chainflip/utils/types';
|
|
7
8
|
|
|
8
9
|
type CfAccountInfo = RpcResult<'cf_account_info'>;
|
|
@@ -33,6 +34,8 @@ type CfSwappingEnvironment = RpcResult<'cf_swapping_environment'>;
|
|
|
33
34
|
type CfSwapRate = RpcResult<'cf_swap_rate'>;
|
|
34
35
|
type CfSwapRateV2 = RpcResult<'cf_swap_rate_v2'>;
|
|
35
36
|
type CfSwapRateV3 = RpcResult<'cf_swap_rate_v3'>;
|
|
37
|
+
type CfOraclePrices = RpcResult<'cf_oracle_prices'>;
|
|
38
|
+
type CfLendingPools = RpcResult<'cf_lending_pools'>;
|
|
36
39
|
type CfAccountInfoResponse = RpcResponse<'cf_account_info'>;
|
|
37
40
|
type CfAccountsResponse = RpcResponse<'cf_accounts'>;
|
|
38
41
|
type CfAuctionStateResponse = RpcResponse<'cf_auction_state'>;
|
|
@@ -61,6 +64,8 @@ type CfSwappingEnvironmentResponse = RpcResponse<'cf_swapping_environment'>;
|
|
|
61
64
|
type CfSwapRateResponse = RpcResponse<'cf_swap_rate'>;
|
|
62
65
|
type CfSwapRateV2Response = RpcResponse<'cf_swap_rate_v2'>;
|
|
63
66
|
type CfSwapRateV3Response = RpcResponse<'cf_swap_rate_v3'>;
|
|
67
|
+
type CfOraclePricesResponse = RpcResponse<'cf_oracle_prices'>;
|
|
68
|
+
type CfLendingPoolsResponse = RpcResponse<'cf_lending_pools'>;
|
|
64
69
|
type CfUnregisteredAccount = z.output<typeof unregistered>;
|
|
65
70
|
type CfBrokerAccount = z.output<typeof broker>;
|
|
66
71
|
type CfValidatorAccount = z.output<typeof validator>;
|
|
@@ -69,4 +74,4 @@ type CfOperatorAccount = z.output<typeof operator>;
|
|
|
69
74
|
type LpTotalBalances = RpcResult<'lp_total_balances'>;
|
|
70
75
|
type LpTotalBalancesResponse = RpcResponse<'lp_total_balances'>;
|
|
71
76
|
|
|
72
|
-
export { type CfAccountInfo, type CfAccountInfoResponse, type CfAccounts, type CfAccountsResponse, type CfAuctionState, type CfAuctionStateResponse, type CfAvailablePools, type CfAvailablePoolsResponse, type CfBoostPoolDetails, type CfBoostPoolDetailsResponse, type CfBoostPoolPendingFees, type CfBoostPoolPendingFeesResponse, type CfBoostPoolsDepth, type CfBoostPoolsDepthResponse, type CfBrokerAccount, type CfEncodeCfParameters, type CfEncodeCfParametersResponse, type CfEnvironment, type CfEnvironmentResponse, type CfFailedCallArbitrum, type CfFailedCallArbitrumResponse, type CfFailedCallEthereum, type CfFailedCallEthereumResponse, type CfFlipSupply, type CfFlipSupplyResponse, type CfFundingEnvironment, type CfFundingEnvironmentResponse, type CfGetTradingStrategies, type CfGetTradingStrategiesResponse, type CfGetTradingStrategyLimits, type CfGetTradingStrategyLimitsResponse, type CfIngressEgressEnvironment, type CfIngressEgressEnvironmentResponse, type CfLiquidityProviderAccount, type CfOperatorAccount, type CfPoolDepth, type CfPoolDepthResponse, type CfPoolOrderbook, type CfPoolOrderbookResponse, type CfPoolOrders, type CfPoolOrdersResponse, type CfPoolPriceV2, type CfPoolPriceV2Response, type CfPoolsEnvironment, type CfPoolsEnvironmentResponse, type CfRequestSwapParameterEncoding, type CfRequestSwapParameterEncodingResponse, type CfSafeModeStatuses, type CfSafeModeStatusesResponse, type CfSupportedAssets, type CfSupportedAssetsResponse, type CfSwapRate, type CfSwapRateResponse, type CfSwapRateV2, type CfSwapRateV2Response, type CfSwapRateV3, type CfSwapRateV3Response, type CfSwappingEnvironment, type CfSwappingEnvironmentResponse, type CfUnregisteredAccount, type CfValidatorAccount, type LpTotalBalances, type LpTotalBalancesResponse, RpcResult };
|
|
77
|
+
export { type CfAccountInfo, type CfAccountInfoResponse, type CfAccounts, type CfAccountsResponse, type CfAuctionState, type CfAuctionStateResponse, type CfAvailablePools, type CfAvailablePoolsResponse, type CfBoostPoolDetails, type CfBoostPoolDetailsResponse, type CfBoostPoolPendingFees, type CfBoostPoolPendingFeesResponse, type CfBoostPoolsDepth, type CfBoostPoolsDepthResponse, type CfBrokerAccount, type CfEncodeCfParameters, type CfEncodeCfParametersResponse, type CfEnvironment, type CfEnvironmentResponse, type CfFailedCallArbitrum, type CfFailedCallArbitrumResponse, type CfFailedCallEthereum, type CfFailedCallEthereumResponse, type CfFlipSupply, type CfFlipSupplyResponse, type CfFundingEnvironment, type CfFundingEnvironmentResponse, type CfGetTradingStrategies, type CfGetTradingStrategiesResponse, type CfGetTradingStrategyLimits, type CfGetTradingStrategyLimitsResponse, type CfIngressEgressEnvironment, type CfIngressEgressEnvironmentResponse, type CfLendingPools, type CfLendingPoolsResponse, type CfLiquidityProviderAccount, type CfOperatorAccount, type CfOraclePrices, type CfOraclePricesResponse, type CfPoolDepth, type CfPoolDepthResponse, type CfPoolOrderbook, type CfPoolOrderbookResponse, type CfPoolOrders, type CfPoolOrdersResponse, type CfPoolPriceV2, type CfPoolPriceV2Response, type CfPoolsEnvironment, type CfPoolsEnvironmentResponse, type CfRequestSwapParameterEncoding, type CfRequestSwapParameterEncodingResponse, type CfSafeModeStatuses, type CfSafeModeStatusesResponse, type CfSupportedAssets, type CfSupportedAssetsResponse, type CfSwapRate, type CfSwapRateResponse, type CfSwapRateV2, type CfSwapRateV2Response, type CfSwapRateV3, type CfSwapRateV3Response, type CfSwappingEnvironment, type CfSwappingEnvironmentResponse, type CfUnregisteredAccount, type CfValidatorAccount, type LpTotalBalances, type LpTotalBalancesResponse, RpcResult };
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainflip/rpc",
|
|
3
|
-
"version": "1.11.0-beta.
|
|
3
|
+
"version": "1.11.0-beta.11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@chainflip/utils": "0.8.
|
|
6
|
+
"@chainflip/utils": "0.8.18",
|
|
7
7
|
"zod": "^3.25.75"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"@types/node": "^24.1
|
|
10
|
+
"@types/node": "^24.3.1",
|
|
11
11
|
"@types/ws": "^8.18.1",
|
|
12
12
|
"ws": "^8.18.3"
|
|
13
13
|
},
|