@chainflip/rpc 1.9.0-assethub.1 → 1.9.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/Client.cjs +56 -24
- package/dist/Client.d.cts +18 -11
- package/dist/Client.d.ts +18 -11
- package/dist/Client.mjs +54 -22
- package/dist/HttpClient.cjs +23 -65
- package/dist/HttpClient.d.cts +4 -8
- package/dist/HttpClient.d.ts +4 -8
- package/dist/HttpClient.mjs +20 -62
- package/dist/WsClient.cjs +74 -63
- package/dist/WsClient.d.cts +10 -7
- package/dist/WsClient.d.ts +10 -7
- package/dist/WsClient.mjs +72 -61
- package/dist/common.cjs +25 -2
- package/dist/common.d.cts +6878 -1699
- package/dist/common.d.ts +6878 -1699
- package/dist/common.mjs +28 -5
- package/dist/constants.cjs +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/parsers.cjs +98 -16
- package/dist/parsers.d.cts +7177 -1649
- package/dist/parsers.d.ts +7177 -1649
- package/dist/parsers.mjs +98 -16
- package/dist/types.d.cts +21 -5
- package/dist/types.d.ts +21 -5
- package/package.json +15 -15
package/dist/parsers.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/parsers.ts
|
|
2
|
-
import {
|
|
2
|
+
import { isUndefined } from "@chainflip/utils/guard";
|
|
3
3
|
import { isHex } from "@chainflip/utils/string";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
var hexString = z.string().refine(isHex, { message: "Invalid hex string" });
|
|
@@ -10,21 +10,24 @@ var chainAssetMapFactory = (parser, defaultValue) => z.object({
|
|
|
10
10
|
Ethereum: z.object({ ETH: parser, USDC: parser, FLIP: parser, USDT: parser }),
|
|
11
11
|
Polkadot: z.object({ DOT: parser }),
|
|
12
12
|
Arbitrum: z.object({ ETH: parser, USDC: parser }),
|
|
13
|
-
Solana: z.object({ SOL: parser
|
|
13
|
+
Solana: z.object({ SOL: parser, USDC: parser }),
|
|
14
|
+
Assethub: z.object({ DOT: parser, USDC: parser, USDT: parser }).default({ DOT: defaultValue, USDC: defaultValue, USDT: defaultValue })
|
|
14
15
|
});
|
|
15
16
|
var chainBaseAssetMapFactory = (parser, defaultValue) => z.object({
|
|
16
17
|
Bitcoin: z.object({ BTC: parser }),
|
|
17
18
|
Ethereum: z.object({ ETH: parser, FLIP: parser, USDT: parser }),
|
|
18
19
|
Polkadot: z.object({ DOT: parser }),
|
|
19
20
|
Arbitrum: z.object({ ETH: parser, USDC: parser }),
|
|
20
|
-
Solana: z.object({ SOL: parser
|
|
21
|
+
Solana: z.object({ SOL: parser, USDC: parser }),
|
|
22
|
+
Assethub: z.object({ DOT: parser, USDC: parser, USDT: parser }).default({ DOT: defaultValue, USDC: defaultValue, USDT: defaultValue })
|
|
21
23
|
});
|
|
22
24
|
var chainMapFactory = (parser, defaultValue) => z.object({
|
|
23
25
|
Bitcoin: parser,
|
|
24
26
|
Ethereum: parser,
|
|
25
27
|
Polkadot: parser,
|
|
26
28
|
Arbitrum: parser,
|
|
27
|
-
Solana: parser
|
|
29
|
+
Solana: parser,
|
|
30
|
+
Assethub: parser.default(defaultValue)
|
|
28
31
|
});
|
|
29
32
|
var rpcAssetSchema = z.union([
|
|
30
33
|
z.object({ chain: z.literal("Bitcoin"), asset: z.literal("BTC") }),
|
|
@@ -36,7 +39,10 @@ var rpcAssetSchema = z.union([
|
|
|
36
39
|
z.object({ chain: z.literal("Arbitrum"), asset: z.literal("ETH") }),
|
|
37
40
|
z.object({ chain: z.literal("Arbitrum"), asset: z.literal("USDC") }),
|
|
38
41
|
z.object({ chain: z.literal("Solana"), asset: z.literal("SOL") }),
|
|
39
|
-
z.object({ chain: z.literal("Solana"), asset: z.literal("USDC") })
|
|
42
|
+
z.object({ chain: z.literal("Solana"), asset: z.literal("USDC") }),
|
|
43
|
+
z.object({ chain: z.literal("Assethub"), asset: z.literal("DOT") }),
|
|
44
|
+
z.object({ chain: z.literal("Assethub"), asset: z.literal("USDC") }),
|
|
45
|
+
z.object({ chain: z.literal("Assethub"), asset: z.literal("USDT") })
|
|
40
46
|
]);
|
|
41
47
|
var rename = (mapping) => (obj) => Object.fromEntries(
|
|
42
48
|
Object.entries(obj).map(([key, value]) => [
|
|
@@ -45,11 +51,11 @@ var rename = (mapping) => (obj) => Object.fromEntries(
|
|
|
45
51
|
])
|
|
46
52
|
);
|
|
47
53
|
var rpcBaseResponse = z.object({
|
|
48
|
-
id: z.
|
|
54
|
+
id: z.string(),
|
|
49
55
|
jsonrpc: z.literal("2.0")
|
|
50
56
|
});
|
|
51
|
-
var
|
|
52
|
-
var rpcSuccessResponse = rpcBaseResponse.extend({ result:
|
|
57
|
+
var notUndefined = z.any().refine((v) => !isUndefined(v), { message: "Value must not be undefined" });
|
|
58
|
+
var rpcSuccessResponse = rpcBaseResponse.extend({ result: notUndefined });
|
|
53
59
|
var rpcErrorResponse = rpcBaseResponse.extend({
|
|
54
60
|
error: z.object({ code: z.number(), message: z.string() })
|
|
55
61
|
});
|
|
@@ -66,6 +72,9 @@ var cfSwapRateV2 = z.object({
|
|
|
66
72
|
network_fee: fee,
|
|
67
73
|
output: u256
|
|
68
74
|
});
|
|
75
|
+
var cfSwapRateV3 = cfSwapRateV2.extend({
|
|
76
|
+
broker_commission: fee
|
|
77
|
+
});
|
|
69
78
|
var chainGetBlockHash = hexString;
|
|
70
79
|
var stateGetMetadata = hexString;
|
|
71
80
|
var stateGetRuntimeVersion = z.object({
|
|
@@ -85,8 +94,7 @@ var cfIngressEgressEnvironment = z.object({
|
|
|
85
94
|
witness_safety_margins: chainMapFactory(z.number().nullable(), null),
|
|
86
95
|
egress_dust_limits: chainAssetMapFactory(numberOrHex, 0),
|
|
87
96
|
channel_opening_fees: chainMapFactory(numberOrHex, 0),
|
|
88
|
-
|
|
89
|
-
max_swap_retry_duration_blocks: chainMapFactory(z.number(), 0).optional().default({ Arbitrum: 0, Bitcoin: 0, Ethereum: 0, Polkadot: 0, Solana: 0 })
|
|
97
|
+
max_swap_retry_duration_blocks: chainMapFactory(z.number(), 0)
|
|
90
98
|
}).transform(rename({ egress_dust_limits: "minimum_egress_amounts" }));
|
|
91
99
|
var cfSwappingEnvironment = z.object({
|
|
92
100
|
maximum_swap_amounts: chainAssetMapFactory(numberOrHex.nullable(), null),
|
|
@@ -150,14 +158,51 @@ var brokerRequestSwapDepositAddress = z.object({
|
|
|
150
158
|
source_chain_expiry_block: numberOrHex,
|
|
151
159
|
channel_opening_fee: u256
|
|
152
160
|
});
|
|
161
|
+
var evmBrokerRequestSwapParameterEncoding = z.object({
|
|
162
|
+
to: hexString,
|
|
163
|
+
calldata: hexString,
|
|
164
|
+
value: numberOrHex,
|
|
165
|
+
source_token_address: hexString.optional()
|
|
166
|
+
});
|
|
167
|
+
var requestSwapParameterEncoding = z.discriminatedUnion("chain", [
|
|
168
|
+
z.object({
|
|
169
|
+
chain: z.literal("Bitcoin"),
|
|
170
|
+
nulldata_payload: hexString,
|
|
171
|
+
deposit_address: z.string()
|
|
172
|
+
}),
|
|
173
|
+
evmBrokerRequestSwapParameterEncoding.extend({
|
|
174
|
+
chain: z.literal("Ethereum")
|
|
175
|
+
}),
|
|
176
|
+
evmBrokerRequestSwapParameterEncoding.extend({
|
|
177
|
+
chain: z.literal("Arbitrum")
|
|
178
|
+
}),
|
|
179
|
+
z.object({
|
|
180
|
+
chain: z.literal("Solana"),
|
|
181
|
+
program_id: z.string(),
|
|
182
|
+
data: hexString,
|
|
183
|
+
accounts: z.array(
|
|
184
|
+
z.object({
|
|
185
|
+
pubkey: z.string(),
|
|
186
|
+
is_signer: z.boolean(),
|
|
187
|
+
is_writable: z.boolean()
|
|
188
|
+
})
|
|
189
|
+
)
|
|
190
|
+
})
|
|
191
|
+
]);
|
|
153
192
|
var unregistered = z.object({
|
|
154
193
|
role: z.literal("unregistered"),
|
|
155
|
-
flip_balance: numberOrHex
|
|
194
|
+
flip_balance: numberOrHex,
|
|
195
|
+
asset_balances: chainAssetMapFactory(numberOrHex, 0)
|
|
156
196
|
});
|
|
157
197
|
var broker = z.object({
|
|
158
198
|
role: z.literal("broker"),
|
|
199
|
+
bond: numberOrHex,
|
|
159
200
|
flip_balance: numberOrHex,
|
|
160
|
-
earned_fees: chainAssetMapFactory(numberOrHex, 0)
|
|
201
|
+
earned_fees: chainAssetMapFactory(numberOrHex, 0),
|
|
202
|
+
btc_vault_deposit_address: z.string().nullable().optional(),
|
|
203
|
+
affiliates: z.array(
|
|
204
|
+
z.object({ account_id: z.string(), short_id: z.number(), withdrawal_address: hexString })
|
|
205
|
+
).optional().default([])
|
|
161
206
|
});
|
|
162
207
|
var boostBalances = z.array(
|
|
163
208
|
z.object({
|
|
@@ -192,7 +237,12 @@ var validator = z.object({
|
|
|
192
237
|
apy_bp: z.number().nullable(),
|
|
193
238
|
restricted_balances: z.record(hexString, numberOrHex)
|
|
194
239
|
});
|
|
195
|
-
var cfAccountInfo = z.
|
|
240
|
+
var cfAccountInfo = z.discriminatedUnion("role", [
|
|
241
|
+
unregistered,
|
|
242
|
+
broker,
|
|
243
|
+
liquidityProvider,
|
|
244
|
+
validator
|
|
245
|
+
]);
|
|
196
246
|
var cfAccounts = z.array(z.tuple([z.string(), z.string()]));
|
|
197
247
|
var cfPoolPriceV2 = z.object({
|
|
198
248
|
sell: numberOrHex.nullable(),
|
|
@@ -244,16 +294,17 @@ var cfBoostPoolDetails = z.array(
|
|
|
244
294
|
available_amounts: z.array(boostPoolAmount),
|
|
245
295
|
deposits_pending_finalization: z.array(
|
|
246
296
|
z.object({
|
|
247
|
-
deposit_id:
|
|
297
|
+
deposit_id: numberOrHex,
|
|
248
298
|
owed_amounts: z.array(boostPoolAmount)
|
|
249
299
|
})
|
|
250
300
|
),
|
|
251
301
|
pending_withdrawals: z.array(
|
|
252
302
|
z.object({
|
|
253
303
|
account_id: z.string(),
|
|
254
|
-
pending_deposits: z.array(
|
|
304
|
+
pending_deposits: z.array(numberOrHex)
|
|
255
305
|
})
|
|
256
|
-
)
|
|
306
|
+
),
|
|
307
|
+
network_fee_deduction_percent: z.number().optional()
|
|
257
308
|
})
|
|
258
309
|
)
|
|
259
310
|
);
|
|
@@ -271,29 +322,60 @@ var cfBoostPoolPendingFees = z.array(
|
|
|
271
322
|
})
|
|
272
323
|
)
|
|
273
324
|
);
|
|
325
|
+
var lpTotalBalances = chainAssetMapFactory(numberOrHex, 0);
|
|
326
|
+
var cfFailedCallEvm = z.object({
|
|
327
|
+
contract: hexString,
|
|
328
|
+
data: z.string()
|
|
329
|
+
});
|
|
330
|
+
var range = (parser) => z.tuple([parser, parser]);
|
|
331
|
+
var cfAuctionState = z.object({
|
|
332
|
+
epoch_duration: z.number(),
|
|
333
|
+
current_epoch_started_at: z.number(),
|
|
334
|
+
redemption_period_as_percentage: z.number(),
|
|
335
|
+
min_funding: numberOrHex,
|
|
336
|
+
auction_size_range: range(z.number()),
|
|
337
|
+
min_active_bid: numberOrHex
|
|
338
|
+
}).transform(rename({ epoch_duration: "epoch_duration_blocks" }));
|
|
339
|
+
var cfFlipSuppy = range(numberOrHex).transform(([totalIssuance, offchainFunds]) => ({
|
|
340
|
+
totalIssuance,
|
|
341
|
+
offchainFunds
|
|
342
|
+
}));
|
|
343
|
+
var ethereumAddress = z.string().transform((address) => `0x${address}`);
|
|
344
|
+
var cfPoolOrderbook = z.object({
|
|
345
|
+
bids: z.array(z.object({ amount: u256, sqrt_price: u256 })),
|
|
346
|
+
asks: z.array(z.object({ amount: u256, sqrt_price: u256 }))
|
|
347
|
+
});
|
|
274
348
|
export {
|
|
275
349
|
broker,
|
|
276
350
|
brokerRequestSwapDepositAddress,
|
|
277
351
|
cfAccountInfo,
|
|
278
352
|
cfAccounts,
|
|
353
|
+
cfAuctionState,
|
|
279
354
|
cfBoostPoolDetails,
|
|
280
355
|
cfBoostPoolPendingFees,
|
|
281
356
|
cfBoostPoolsDepth,
|
|
282
357
|
cfEnvironment,
|
|
358
|
+
cfFailedCallEvm,
|
|
359
|
+
cfFlipSuppy,
|
|
283
360
|
cfFundingEnvironment,
|
|
284
361
|
cfIngressEgressEnvironment,
|
|
285
362
|
cfPoolDepth,
|
|
363
|
+
cfPoolOrderbook,
|
|
286
364
|
cfPoolOrders,
|
|
287
365
|
cfPoolPriceV2,
|
|
288
366
|
cfPoolsEnvironment,
|
|
289
367
|
cfSupportedAssets,
|
|
290
368
|
cfSwapRate,
|
|
291
369
|
cfSwapRateV2,
|
|
370
|
+
cfSwapRateV3,
|
|
292
371
|
cfSwappingEnvironment,
|
|
293
372
|
chainGetBlockHash,
|
|
373
|
+
ethereumAddress,
|
|
294
374
|
hexString,
|
|
295
375
|
liquidityProvider,
|
|
376
|
+
lpTotalBalances,
|
|
296
377
|
numberOrHex,
|
|
378
|
+
requestSwapParameterEncoding,
|
|
297
379
|
rpcResponse,
|
|
298
380
|
stateGetMetadata,
|
|
299
381
|
stateGetRuntimeVersion,
|
package/dist/types.d.cts
CHANGED
|
@@ -6,40 +6,56 @@ export { RpcLimitOrder, RpcRangeOrder } from './parsers.cjs';
|
|
|
6
6
|
import '@chainflip/utils/types';
|
|
7
7
|
|
|
8
8
|
type CfAccountInfo = RpcResult<'cf_account_info'>;
|
|
9
|
+
type CfAccounts = RpcResult<'cf_accounts'>;
|
|
10
|
+
type CfAuctionState = RpcResult<'cf_auction_state'>;
|
|
9
11
|
type CfBoostPoolDetails = RpcResult<'cf_boost_pool_details'>;
|
|
10
12
|
type CfBoostPoolPendingFees = RpcResult<'cf_boost_pool_pending_fees'>;
|
|
11
13
|
type CfBoostPoolsDepth = RpcResult<'cf_boost_pools_depth'>;
|
|
12
14
|
type CfEnvironment = RpcResult<'cf_environment'>;
|
|
15
|
+
type CfFailedCallArbitrum = RpcResult<'cf_failed_call_arbitrum'>;
|
|
16
|
+
type CfFailedCallEthereum = RpcResult<'cf_failed_call_ethereum'>;
|
|
17
|
+
type CfFlipSupply = RpcResult<'cf_flip_supply'>;
|
|
13
18
|
type CfFundingEnvironment = RpcResult<'cf_funding_environment'>;
|
|
14
19
|
type CfIngressEgressEnvironment = RpcResult<'cf_ingress_egress_environment'>;
|
|
20
|
+
type CfPoolDepth = RpcResult<'cf_pool_depth'>;
|
|
21
|
+
type CfPoolOrderbook = RpcResult<'cf_pool_orderbook'>;
|
|
15
22
|
type CfPoolOrders = RpcResult<'cf_pool_orders'>;
|
|
16
23
|
type CfPoolPriceV2 = RpcResult<'cf_pool_price_v2'>;
|
|
17
24
|
type CfPoolsEnvironment = RpcResult<'cf_pools_environment'>;
|
|
25
|
+
type CfRequestSwapParameterEncoding = RpcResult<'cf_request_swap_parameter_encoding'>;
|
|
18
26
|
type CfSupportedAssets = RpcResult<'cf_supported_assets'>;
|
|
19
27
|
type CfSwappingEnvironment = RpcResult<'cf_swapping_environment'>;
|
|
20
28
|
type CfSwapRate = RpcResult<'cf_swap_rate'>;
|
|
21
29
|
type CfSwapRateV2 = RpcResult<'cf_swap_rate_v2'>;
|
|
22
|
-
type
|
|
23
|
-
type CfAccounts = RpcResult<'cf_accounts'>;
|
|
30
|
+
type CfSwapRateV3 = RpcResult<'cf_swap_rate_v3'>;
|
|
24
31
|
type CfAccountInfoResponse = RpcResponse<'cf_account_info'>;
|
|
32
|
+
type CfAccountsResponse = RpcResponse<'cf_accounts'>;
|
|
33
|
+
type CfAuctionStateResponse = RpcResponse<'cf_auction_state'>;
|
|
25
34
|
type CfBoostPoolDetailsResponse = RpcResponse<'cf_boost_pool_details'>;
|
|
26
35
|
type CfBoostPoolPendingFeesResponse = RpcResponse<'cf_boost_pool_pending_fees'>;
|
|
27
36
|
type CfBoostPoolsDepthResponse = RpcResponse<'cf_boost_pools_depth'>;
|
|
28
37
|
type CfEnvironmentResponse = RpcResponse<'cf_environment'>;
|
|
38
|
+
type CfFailedCallArbitrumResponse = RpcResponse<'cf_failed_call_arbitrum'>;
|
|
39
|
+
type CfFailedCallEthereumResponse = RpcResponse<'cf_failed_call_ethereum'>;
|
|
40
|
+
type CfFlipSupplyResponse = RpcResponse<'cf_flip_supply'>;
|
|
29
41
|
type CfFundingEnvironmentResponse = RpcResponse<'cf_funding_environment'>;
|
|
30
42
|
type CfIngressEgressEnvironmentResponse = RpcResponse<'cf_ingress_egress_environment'>;
|
|
43
|
+
type CfPoolDepthResponse = RpcResponse<'cf_pool_depth'>;
|
|
44
|
+
type CfPoolOrderbookResponse = RpcResponse<'cf_pool_orderbook'>;
|
|
31
45
|
type CfPoolOrdersResponse = RpcResponse<'cf_pool_orders'>;
|
|
32
46
|
type CfPoolPriceV2Response = RpcResponse<'cf_pool_price_v2'>;
|
|
33
47
|
type CfPoolsEnvironmentResponse = RpcResponse<'cf_pools_environment'>;
|
|
48
|
+
type CfRequestSwapParameterEncodingResponse = RpcResponse<'cf_request_swap_parameter_encoding'>;
|
|
34
49
|
type CfSupportedAssetsResponse = RpcResponse<'cf_supported_assets'>;
|
|
35
50
|
type CfSwappingEnvironmentResponse = RpcResponse<'cf_swapping_environment'>;
|
|
36
51
|
type CfSwapRateResponse = RpcResponse<'cf_swap_rate'>;
|
|
37
52
|
type CfSwapRateV2Response = RpcResponse<'cf_swap_rate_v2'>;
|
|
38
|
-
type
|
|
39
|
-
type CfAccountsResponse = RpcResponse<'cf_accounts'>;
|
|
53
|
+
type CfSwapRateV3Response = RpcResponse<'cf_swap_rate_v3'>;
|
|
40
54
|
type CfUnregisteredAccount = z.output<typeof unregistered>;
|
|
41
55
|
type CfBrokerAccount = z.output<typeof broker>;
|
|
42
56
|
type CfValidatorAccount = z.output<typeof validator>;
|
|
43
57
|
type CfLiquidityProviderAccount = z.output<typeof liquidityProvider>;
|
|
58
|
+
type LpTotalBalances = RpcResult<'lp_total_balances'>;
|
|
59
|
+
type LpTotalBalancesResponse = RpcResponse<'lp_total_balances'>;
|
|
44
60
|
|
|
45
|
-
export { type CfAccountInfo, type CfAccountInfoResponse, type CfAccounts, type CfAccountsResponse, type CfBoostPoolDetails, type CfBoostPoolDetailsResponse, type CfBoostPoolPendingFees, type CfBoostPoolPendingFeesResponse, type CfBoostPoolsDepth, type CfBoostPoolsDepthResponse, type CfBrokerAccount, type CfEnvironment, type CfEnvironmentResponse, type CfFundingEnvironment, type CfFundingEnvironmentResponse, type CfIngressEgressEnvironment, type CfIngressEgressEnvironmentResponse, type CfLiquidityProviderAccount, type CfPoolDepth, type CfPoolDepthResponse, type CfPoolOrders, type CfPoolOrdersResponse, type CfPoolPriceV2, type CfPoolPriceV2Response, type CfPoolsEnvironment, type CfPoolsEnvironmentResponse, type CfSupportedAssets, type CfSupportedAssetsResponse, type CfSwapRate, type CfSwapRateResponse, type CfSwapRateV2, type CfSwapRateV2Response, type CfSwappingEnvironment, type CfSwappingEnvironmentResponse, type CfUnregisteredAccount, type CfValidatorAccount, RpcResult };
|
|
61
|
+
export { type CfAccountInfo, type CfAccountInfoResponse, type CfAccounts, type CfAccountsResponse, type CfAuctionState, type CfAuctionStateResponse, type CfBoostPoolDetails, type CfBoostPoolDetailsResponse, type CfBoostPoolPendingFees, type CfBoostPoolPendingFeesResponse, type CfBoostPoolsDepth, type CfBoostPoolsDepthResponse, type CfBrokerAccount, type CfEnvironment, type CfEnvironmentResponse, type CfFailedCallArbitrum, type CfFailedCallArbitrumResponse, type CfFailedCallEthereum, type CfFailedCallEthereumResponse, type CfFlipSupply, type CfFlipSupplyResponse, type CfFundingEnvironment, type CfFundingEnvironmentResponse, type CfIngressEgressEnvironment, type CfIngressEgressEnvironmentResponse, type CfLiquidityProviderAccount, 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 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
|
@@ -6,40 +6,56 @@ export { RpcLimitOrder, RpcRangeOrder } from './parsers.js';
|
|
|
6
6
|
import '@chainflip/utils/types';
|
|
7
7
|
|
|
8
8
|
type CfAccountInfo = RpcResult<'cf_account_info'>;
|
|
9
|
+
type CfAccounts = RpcResult<'cf_accounts'>;
|
|
10
|
+
type CfAuctionState = RpcResult<'cf_auction_state'>;
|
|
9
11
|
type CfBoostPoolDetails = RpcResult<'cf_boost_pool_details'>;
|
|
10
12
|
type CfBoostPoolPendingFees = RpcResult<'cf_boost_pool_pending_fees'>;
|
|
11
13
|
type CfBoostPoolsDepth = RpcResult<'cf_boost_pools_depth'>;
|
|
12
14
|
type CfEnvironment = RpcResult<'cf_environment'>;
|
|
15
|
+
type CfFailedCallArbitrum = RpcResult<'cf_failed_call_arbitrum'>;
|
|
16
|
+
type CfFailedCallEthereum = RpcResult<'cf_failed_call_ethereum'>;
|
|
17
|
+
type CfFlipSupply = RpcResult<'cf_flip_supply'>;
|
|
13
18
|
type CfFundingEnvironment = RpcResult<'cf_funding_environment'>;
|
|
14
19
|
type CfIngressEgressEnvironment = RpcResult<'cf_ingress_egress_environment'>;
|
|
20
|
+
type CfPoolDepth = RpcResult<'cf_pool_depth'>;
|
|
21
|
+
type CfPoolOrderbook = RpcResult<'cf_pool_orderbook'>;
|
|
15
22
|
type CfPoolOrders = RpcResult<'cf_pool_orders'>;
|
|
16
23
|
type CfPoolPriceV2 = RpcResult<'cf_pool_price_v2'>;
|
|
17
24
|
type CfPoolsEnvironment = RpcResult<'cf_pools_environment'>;
|
|
25
|
+
type CfRequestSwapParameterEncoding = RpcResult<'cf_request_swap_parameter_encoding'>;
|
|
18
26
|
type CfSupportedAssets = RpcResult<'cf_supported_assets'>;
|
|
19
27
|
type CfSwappingEnvironment = RpcResult<'cf_swapping_environment'>;
|
|
20
28
|
type CfSwapRate = RpcResult<'cf_swap_rate'>;
|
|
21
29
|
type CfSwapRateV2 = RpcResult<'cf_swap_rate_v2'>;
|
|
22
|
-
type
|
|
23
|
-
type CfAccounts = RpcResult<'cf_accounts'>;
|
|
30
|
+
type CfSwapRateV3 = RpcResult<'cf_swap_rate_v3'>;
|
|
24
31
|
type CfAccountInfoResponse = RpcResponse<'cf_account_info'>;
|
|
32
|
+
type CfAccountsResponse = RpcResponse<'cf_accounts'>;
|
|
33
|
+
type CfAuctionStateResponse = RpcResponse<'cf_auction_state'>;
|
|
25
34
|
type CfBoostPoolDetailsResponse = RpcResponse<'cf_boost_pool_details'>;
|
|
26
35
|
type CfBoostPoolPendingFeesResponse = RpcResponse<'cf_boost_pool_pending_fees'>;
|
|
27
36
|
type CfBoostPoolsDepthResponse = RpcResponse<'cf_boost_pools_depth'>;
|
|
28
37
|
type CfEnvironmentResponse = RpcResponse<'cf_environment'>;
|
|
38
|
+
type CfFailedCallArbitrumResponse = RpcResponse<'cf_failed_call_arbitrum'>;
|
|
39
|
+
type CfFailedCallEthereumResponse = RpcResponse<'cf_failed_call_ethereum'>;
|
|
40
|
+
type CfFlipSupplyResponse = RpcResponse<'cf_flip_supply'>;
|
|
29
41
|
type CfFundingEnvironmentResponse = RpcResponse<'cf_funding_environment'>;
|
|
30
42
|
type CfIngressEgressEnvironmentResponse = RpcResponse<'cf_ingress_egress_environment'>;
|
|
43
|
+
type CfPoolDepthResponse = RpcResponse<'cf_pool_depth'>;
|
|
44
|
+
type CfPoolOrderbookResponse = RpcResponse<'cf_pool_orderbook'>;
|
|
31
45
|
type CfPoolOrdersResponse = RpcResponse<'cf_pool_orders'>;
|
|
32
46
|
type CfPoolPriceV2Response = RpcResponse<'cf_pool_price_v2'>;
|
|
33
47
|
type CfPoolsEnvironmentResponse = RpcResponse<'cf_pools_environment'>;
|
|
48
|
+
type CfRequestSwapParameterEncodingResponse = RpcResponse<'cf_request_swap_parameter_encoding'>;
|
|
34
49
|
type CfSupportedAssetsResponse = RpcResponse<'cf_supported_assets'>;
|
|
35
50
|
type CfSwappingEnvironmentResponse = RpcResponse<'cf_swapping_environment'>;
|
|
36
51
|
type CfSwapRateResponse = RpcResponse<'cf_swap_rate'>;
|
|
37
52
|
type CfSwapRateV2Response = RpcResponse<'cf_swap_rate_v2'>;
|
|
38
|
-
type
|
|
39
|
-
type CfAccountsResponse = RpcResponse<'cf_accounts'>;
|
|
53
|
+
type CfSwapRateV3Response = RpcResponse<'cf_swap_rate_v3'>;
|
|
40
54
|
type CfUnregisteredAccount = z.output<typeof unregistered>;
|
|
41
55
|
type CfBrokerAccount = z.output<typeof broker>;
|
|
42
56
|
type CfValidatorAccount = z.output<typeof validator>;
|
|
43
57
|
type CfLiquidityProviderAccount = z.output<typeof liquidityProvider>;
|
|
58
|
+
type LpTotalBalances = RpcResult<'lp_total_balances'>;
|
|
59
|
+
type LpTotalBalancesResponse = RpcResponse<'lp_total_balances'>;
|
|
44
60
|
|
|
45
|
-
export { type CfAccountInfo, type CfAccountInfoResponse, type CfAccounts, type CfAccountsResponse, type CfBoostPoolDetails, type CfBoostPoolDetailsResponse, type CfBoostPoolPendingFees, type CfBoostPoolPendingFeesResponse, type CfBoostPoolsDepth, type CfBoostPoolsDepthResponse, type CfBrokerAccount, type CfEnvironment, type CfEnvironmentResponse, type CfFundingEnvironment, type CfFundingEnvironmentResponse, type CfIngressEgressEnvironment, type CfIngressEgressEnvironmentResponse, type CfLiquidityProviderAccount, type CfPoolDepth, type CfPoolDepthResponse, type CfPoolOrders, type CfPoolOrdersResponse, type CfPoolPriceV2, type CfPoolPriceV2Response, type CfPoolsEnvironment, type CfPoolsEnvironmentResponse, type CfSupportedAssets, type CfSupportedAssetsResponse, type CfSwapRate, type CfSwapRateResponse, type CfSwapRateV2, type CfSwapRateV2Response, type CfSwappingEnvironment, type CfSwappingEnvironmentResponse, type CfUnregisteredAccount, type CfValidatorAccount, RpcResult };
|
|
61
|
+
export { type CfAccountInfo, type CfAccountInfoResponse, type CfAccounts, type CfAccountsResponse, type CfAuctionState, type CfAuctionStateResponse, type CfBoostPoolDetails, type CfBoostPoolDetailsResponse, type CfBoostPoolPendingFees, type CfBoostPoolPendingFeesResponse, type CfBoostPoolsDepth, type CfBoostPoolsDepthResponse, type CfBrokerAccount, type CfEnvironment, type CfEnvironmentResponse, type CfFailedCallArbitrum, type CfFailedCallArbitrumResponse, type CfFailedCallEthereum, type CfFailedCallEthereumResponse, type CfFlipSupply, type CfFlipSupplyResponse, type CfFundingEnvironment, type CfFundingEnvironmentResponse, type CfIngressEgressEnvironment, type CfIngressEgressEnvironmentResponse, type CfLiquidityProviderAccount, 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 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,25 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainflip/rpc",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.1",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"eslint:check": "pnpm eslint --max-warnings 0 './**/*.ts'",
|
|
7
|
-
"prettier:base": "prettier ./** --ignore-path=../../.prettierignore",
|
|
8
|
-
"prettier:check": "pnpm prettier:base --check",
|
|
9
|
-
"prettier:write": "pnpm prettier:base --write",
|
|
10
|
-
"clean": "rm -rf dist",
|
|
11
|
-
"prepublish": "pnpm test run && pnpm build",
|
|
12
|
-
"build": "pnpm clean && pnpm tsup",
|
|
13
|
-
"test:ci": "CI=1 pnpm t run",
|
|
14
|
-
"test": "vitest",
|
|
15
|
-
"coverage": "vitest run --coverage"
|
|
16
|
-
},
|
|
17
5
|
"dependencies": {
|
|
18
6
|
"@chainflip/utils": "0.7.0",
|
|
19
7
|
"zod": "^3.24.2"
|
|
20
8
|
},
|
|
21
9
|
"devDependencies": {
|
|
22
|
-
"@types/node": "^22.13.
|
|
10
|
+
"@types/node": "^22.13.14",
|
|
23
11
|
"@types/ws": "^8.18.0",
|
|
24
12
|
"ws": "^8.18.1"
|
|
25
13
|
},
|
|
@@ -53,5 +41,17 @@
|
|
|
53
41
|
"publishConfig": {
|
|
54
42
|
"registry": "https://registry.npmjs.org/",
|
|
55
43
|
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"eslint:check": "pnpm eslint --max-warnings 0 './**/*.ts'",
|
|
47
|
+
"prettier:base": "prettier ./** --ignore-path=../../.prettierignore",
|
|
48
|
+
"prettier:check": "pnpm prettier:base --check",
|
|
49
|
+
"prettier:write": "pnpm prettier:base --write",
|
|
50
|
+
"clean": "rm -rf dist",
|
|
51
|
+
"prepublish": "pnpm test run && pnpm build",
|
|
52
|
+
"build": "pnpm clean && pnpm tsup",
|
|
53
|
+
"test:ci": "CI=1 pnpm t run",
|
|
54
|
+
"test": "vitest",
|
|
55
|
+
"coverage": "vitest run --coverage"
|
|
56
56
|
}
|
|
57
|
-
}
|
|
57
|
+
}
|