@chainflip/rpc 1.8.8 → 1.9.0-assethub.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 +24 -56
- package/dist/Client.d.cts +11 -18
- package/dist/Client.d.ts +11 -18
- package/dist/Client.mjs +22 -54
- package/dist/HttpClient.cjs +65 -23
- package/dist/HttpClient.d.cts +8 -4
- package/dist/HttpClient.d.ts +8 -4
- package/dist/HttpClient.mjs +62 -20
- package/dist/WsClient.cjs +63 -74
- package/dist/WsClient.d.cts +7 -10
- package/dist/WsClient.d.ts +7 -10
- package/dist/WsClient.mjs +61 -72
- package/dist/common.cjs +2 -9
- package/dist/common.d.cts +948 -1948
- package/dist/common.d.ts +948 -1948
- package/dist/common.mjs +5 -12
- package/dist/constants.cjs +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/parsers.cjs +11 -56
- package/dist/parsers.d.cts +1113 -1965
- package/dist/parsers.d.ts +1113 -1965
- package/dist/parsers.mjs +10 -55
- package/dist/types.d.cts +1 -5
- package/dist/types.d.ts +1 -5
- package/package.json +14 -14
package/dist/common.mjs
CHANGED
|
@@ -19,16 +19,11 @@ import {
|
|
|
19
19
|
stateGetMetadata,
|
|
20
20
|
stateGetRuntimeVersion,
|
|
21
21
|
cfPoolDepth,
|
|
22
|
-
cfAccounts
|
|
23
|
-
cfSwapRateV3,
|
|
24
|
-
requestSwapParameterEncoding,
|
|
25
|
-
lpTotalBalances
|
|
22
|
+
cfAccounts
|
|
26
23
|
} from "./parsers.mjs";
|
|
27
|
-
import { rpcResponse } from "./parsers.mjs";
|
|
24
|
+
import { rpcResponse as rpcResponse2 } from "./parsers.mjs";
|
|
28
25
|
var rpcResult = {
|
|
29
|
-
|
|
30
|
-
broker_request_swap_parameter_encoding: requestSwapParameterEncoding,
|
|
31
|
-
cf_request_swap_parameter_encoding: requestSwapParameterEncoding,
|
|
26
|
+
broker_requestSwapDepositAddress: brokerRequestSwapDepositAddress,
|
|
32
27
|
cf_accounts: cfAccounts,
|
|
33
28
|
cf_account_info: cfAccountInfo,
|
|
34
29
|
cf_pool_depth: cfPoolDepth,
|
|
@@ -42,16 +37,14 @@ var rpcResult = {
|
|
|
42
37
|
cf_supported_assets: cfSupportedAssets,
|
|
43
38
|
cf_swap_rate: cfSwapRate,
|
|
44
39
|
cf_swap_rate_v2: cfSwapRateV2,
|
|
45
|
-
cf_swap_rate_v3: cfSwapRateV3,
|
|
46
40
|
cf_swapping_environment: cfSwappingEnvironment,
|
|
47
41
|
chain_getBlockHash: chainGetBlockHash,
|
|
48
42
|
cf_boost_pool_details: cfBoostPoolDetails,
|
|
49
43
|
cf_boost_pool_pending_fees: cfBoostPoolPendingFees,
|
|
50
44
|
state_getMetadata: stateGetMetadata,
|
|
51
|
-
state_getRuntimeVersion: stateGetRuntimeVersion
|
|
52
|
-
lp_total_balances: lpTotalBalances
|
|
45
|
+
state_getRuntimeVersion: stateGetRuntimeVersion
|
|
53
46
|
};
|
|
54
47
|
export {
|
|
55
|
-
rpcResponse,
|
|
48
|
+
rpcResponse2 as rpcResponse,
|
|
56
49
|
rpcResult
|
|
57
50
|
};
|
package/dist/constants.cjs
CHANGED
|
@@ -3,7 +3,7 @@ var PUBLIC_RPC_ENDPOINTS = {
|
|
|
3
3
|
mainnet: "https://rpc.mainnet.chainflip.io",
|
|
4
4
|
perseverance: "https://archive.perseverance.chainflip.io",
|
|
5
5
|
sisyphos: "https://archive.sisyphos.chainflip.io",
|
|
6
|
-
backspin: "https://rpc.
|
|
6
|
+
backspin: "https://backspin-rpc.staging"
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
|
package/dist/constants.mjs
CHANGED
|
@@ -3,7 +3,7 @@ var PUBLIC_RPC_ENDPOINTS = {
|
|
|
3
3
|
mainnet: "https://rpc.mainnet.chainflip.io",
|
|
4
4
|
perseverance: "https://archive.perseverance.chainflip.io",
|
|
5
5
|
sisyphos: "https://archive.sisyphos.chainflip.io",
|
|
6
|
-
backspin: "https://rpc.
|
|
6
|
+
backspin: "https://backspin-rpc.staging"
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
9
|
PUBLIC_RPC_ENDPOINTS
|
package/dist/index.d.cts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
export { default as HttpClient } from './HttpClient.cjs';
|
|
2
2
|
export { default as WsClient } from './WsClient.cjs';
|
|
3
|
-
export { CfAccountInfo, CfAccountInfoResponse, CfAccounts, CfAccountsResponse, CfBoostPoolDetails, CfBoostPoolDetailsResponse, CfBoostPoolPendingFees, CfBoostPoolPendingFeesResponse, CfBoostPoolsDepth, CfBoostPoolsDepthResponse, CfBrokerAccount, CfEnvironment, CfEnvironmentResponse, CfFundingEnvironment, CfFundingEnvironmentResponse, CfIngressEgressEnvironment, CfIngressEgressEnvironmentResponse, CfLiquidityProviderAccount, CfPoolDepth, CfPoolDepthResponse, CfPoolOrders, CfPoolOrdersResponse, CfPoolPriceV2, CfPoolPriceV2Response, CfPoolsEnvironment, CfPoolsEnvironmentResponse,
|
|
3
|
+
export { CfAccountInfo, CfAccountInfoResponse, CfAccounts, CfAccountsResponse, CfBoostPoolDetails, CfBoostPoolDetailsResponse, CfBoostPoolPendingFees, CfBoostPoolPendingFeesResponse, CfBoostPoolsDepth, CfBoostPoolsDepthResponse, CfBrokerAccount, CfEnvironment, CfEnvironmentResponse, CfFundingEnvironment, CfFundingEnvironmentResponse, CfIngressEgressEnvironment, CfIngressEgressEnvironmentResponse, CfLiquidityProviderAccount, CfPoolDepth, CfPoolDepthResponse, CfPoolOrders, CfPoolOrdersResponse, CfPoolPriceV2, CfPoolPriceV2Response, CfPoolsEnvironment, CfPoolsEnvironmentResponse, CfSupportedAssets, CfSupportedAssetsResponse, CfSwapRate, CfSwapRateResponse, CfSwapRateV2, CfSwapRateV2Response, CfSwappingEnvironment, CfSwappingEnvironmentResponse, CfUnregisteredAccount, CfValidatorAccount } from './types.cjs';
|
|
4
4
|
export { c as constants } from './constants-jLrn-AnI.cjs';
|
|
5
5
|
export { RpcLimitOrder, RpcRangeOrder } from './parsers.cjs';
|
|
6
6
|
export { RpcMethod, RpcRequest as RpcParams, RpcResult } from './common.cjs';
|
|
7
7
|
import './Client.cjs';
|
|
8
|
-
import '@chainflip/utils/async';
|
|
9
8
|
import 'zod';
|
|
10
9
|
import '@chainflip/utils/types';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
export { default as HttpClient } from './HttpClient.js';
|
|
2
2
|
export { default as WsClient } from './WsClient.js';
|
|
3
|
-
export { CfAccountInfo, CfAccountInfoResponse, CfAccounts, CfAccountsResponse, CfBoostPoolDetails, CfBoostPoolDetailsResponse, CfBoostPoolPendingFees, CfBoostPoolPendingFeesResponse, CfBoostPoolsDepth, CfBoostPoolsDepthResponse, CfBrokerAccount, CfEnvironment, CfEnvironmentResponse, CfFundingEnvironment, CfFundingEnvironmentResponse, CfIngressEgressEnvironment, CfIngressEgressEnvironmentResponse, CfLiquidityProviderAccount, CfPoolDepth, CfPoolDepthResponse, CfPoolOrders, CfPoolOrdersResponse, CfPoolPriceV2, CfPoolPriceV2Response, CfPoolsEnvironment, CfPoolsEnvironmentResponse,
|
|
3
|
+
export { CfAccountInfo, CfAccountInfoResponse, CfAccounts, CfAccountsResponse, CfBoostPoolDetails, CfBoostPoolDetailsResponse, CfBoostPoolPendingFees, CfBoostPoolPendingFeesResponse, CfBoostPoolsDepth, CfBoostPoolsDepthResponse, CfBrokerAccount, CfEnvironment, CfEnvironmentResponse, CfFundingEnvironment, CfFundingEnvironmentResponse, CfIngressEgressEnvironment, CfIngressEgressEnvironmentResponse, CfLiquidityProviderAccount, CfPoolDepth, CfPoolDepthResponse, CfPoolOrders, CfPoolOrdersResponse, CfPoolPriceV2, CfPoolPriceV2Response, CfPoolsEnvironment, CfPoolsEnvironmentResponse, CfSupportedAssets, CfSupportedAssetsResponse, CfSwapRate, CfSwapRateResponse, CfSwapRateV2, CfSwapRateV2Response, CfSwappingEnvironment, CfSwappingEnvironmentResponse, CfUnregisteredAccount, CfValidatorAccount } from './types.js';
|
|
4
4
|
export { c as constants } from './constants-jLrn-AnI.js';
|
|
5
5
|
export { RpcLimitOrder, RpcRangeOrder } from './parsers.js';
|
|
6
6
|
export { RpcMethod, RpcRequest as RpcParams, RpcResult } from './common.js';
|
|
7
7
|
import './Client.js';
|
|
8
|
-
import '@chainflip/utils/async';
|
|
9
8
|
import 'zod';
|
|
10
9
|
import '@chainflip/utils/types';
|
package/dist/parsers.cjs
CHANGED
|
@@ -5,26 +5,26 @@ var _zod = require('zod');
|
|
|
5
5
|
var hexString = _zod.z.string().refine(_string.isHex, { message: "Invalid hex string" });
|
|
6
6
|
var u256 = hexString.transform((value) => BigInt(value));
|
|
7
7
|
var numberOrHex = _zod.z.union([_zod.z.number().transform((n) => BigInt(n)), u256]);
|
|
8
|
-
var chainAssetMapFactory = (parser,
|
|
8
|
+
var chainAssetMapFactory = (parser, defaultValue) => _zod.z.object({
|
|
9
9
|
Bitcoin: _zod.z.object({ BTC: parser }),
|
|
10
10
|
Ethereum: _zod.z.object({ ETH: parser, USDC: parser, FLIP: parser, USDT: parser }),
|
|
11
11
|
Polkadot: _zod.z.object({ DOT: parser }),
|
|
12
12
|
Arbitrum: _zod.z.object({ ETH: parser, USDC: parser }),
|
|
13
|
-
Solana: _zod.z.object({ SOL: parser, USDC: parser })
|
|
13
|
+
Solana: _zod.z.object({ SOL: parser.default(defaultValue), USDC: parser.default(defaultValue) }).default({ SOL: defaultValue, USDC: defaultValue })
|
|
14
14
|
});
|
|
15
|
-
var chainBaseAssetMapFactory = (parser,
|
|
15
|
+
var chainBaseAssetMapFactory = (parser, defaultValue) => _zod.z.object({
|
|
16
16
|
Bitcoin: _zod.z.object({ BTC: parser }),
|
|
17
17
|
Ethereum: _zod.z.object({ ETH: parser, FLIP: parser, USDT: parser }),
|
|
18
18
|
Polkadot: _zod.z.object({ DOT: parser }),
|
|
19
19
|
Arbitrum: _zod.z.object({ ETH: parser, USDC: parser }),
|
|
20
|
-
Solana: _zod.z.object({ SOL: parser, USDC: parser })
|
|
20
|
+
Solana: _zod.z.object({ SOL: parser.default(defaultValue), USDC: parser.default(defaultValue) }).default({ SOL: defaultValue, USDC: defaultValue })
|
|
21
21
|
});
|
|
22
|
-
var chainMapFactory = (parser,
|
|
22
|
+
var chainMapFactory = (parser, defaultValue) => _zod.z.object({
|
|
23
23
|
Bitcoin: parser,
|
|
24
24
|
Ethereum: parser,
|
|
25
25
|
Polkadot: parser,
|
|
26
26
|
Arbitrum: parser,
|
|
27
|
-
Solana: parser
|
|
27
|
+
Solana: parser.default(defaultValue)
|
|
28
28
|
});
|
|
29
29
|
var rpcAssetSchema = _zod.z.union([
|
|
30
30
|
_zod.z.object({ chain: _zod.z.literal("Bitcoin"), asset: _zod.z.literal("BTC") }),
|
|
@@ -45,7 +45,7 @@ var rename = (mapping) => (obj) => Object.fromEntries(
|
|
|
45
45
|
])
|
|
46
46
|
);
|
|
47
47
|
var rpcBaseResponse = _zod.z.object({
|
|
48
|
-
id: _zod.z.string(),
|
|
48
|
+
id: _zod.z.union([_zod.z.string(), _zod.z.number()]),
|
|
49
49
|
jsonrpc: _zod.z.literal("2.0")
|
|
50
50
|
});
|
|
51
51
|
var nonNullish = _zod.z.any().refine(_guard.isNotNullish, { message: "Value must not be null or undefined" });
|
|
@@ -66,9 +66,6 @@ var cfSwapRateV2 = _zod.z.object({
|
|
|
66
66
|
network_fee: fee,
|
|
67
67
|
output: u256
|
|
68
68
|
});
|
|
69
|
-
var cfSwapRateV3 = cfSwapRateV2.extend({
|
|
70
|
-
broker_commission: fee
|
|
71
|
-
});
|
|
72
69
|
var chainGetBlockHash = hexString;
|
|
73
70
|
var stateGetMetadata = hexString;
|
|
74
71
|
var stateGetRuntimeVersion = _zod.z.object({
|
|
@@ -153,37 +150,6 @@ var brokerRequestSwapDepositAddress = _zod.z.object({
|
|
|
153
150
|
source_chain_expiry_block: numberOrHex,
|
|
154
151
|
channel_opening_fee: u256
|
|
155
152
|
});
|
|
156
|
-
var evmBrokerRequestSwapParameterEncoding = _zod.z.object({
|
|
157
|
-
to: hexString,
|
|
158
|
-
calldata: hexString,
|
|
159
|
-
value: numberOrHex,
|
|
160
|
-
source_token_address: hexString.optional()
|
|
161
|
-
});
|
|
162
|
-
var requestSwapParameterEncoding = _zod.z.discriminatedUnion("chain", [
|
|
163
|
-
_zod.z.object({
|
|
164
|
-
chain: _zod.z.literal("Bitcoin"),
|
|
165
|
-
nulldata_payload: hexString,
|
|
166
|
-
deposit_address: _zod.z.string()
|
|
167
|
-
}),
|
|
168
|
-
evmBrokerRequestSwapParameterEncoding.extend({
|
|
169
|
-
chain: _zod.z.literal("Ethereum")
|
|
170
|
-
}),
|
|
171
|
-
evmBrokerRequestSwapParameterEncoding.extend({
|
|
172
|
-
chain: _zod.z.literal("Arbitrum")
|
|
173
|
-
}),
|
|
174
|
-
_zod.z.object({
|
|
175
|
-
chain: _zod.z.literal("Solana"),
|
|
176
|
-
program_id: _zod.z.string(),
|
|
177
|
-
data: hexString,
|
|
178
|
-
accounts: _zod.z.array(
|
|
179
|
-
_zod.z.object({
|
|
180
|
-
pubkey: _zod.z.string(),
|
|
181
|
-
is_signer: _zod.z.boolean(),
|
|
182
|
-
is_writable: _zod.z.boolean()
|
|
183
|
-
})
|
|
184
|
-
)
|
|
185
|
-
})
|
|
186
|
-
]);
|
|
187
153
|
var unregistered = _zod.z.object({
|
|
188
154
|
role: _zod.z.literal("unregistered"),
|
|
189
155
|
flip_balance: numberOrHex
|
|
@@ -191,8 +157,7 @@ var unregistered = _zod.z.object({
|
|
|
191
157
|
var broker = _zod.z.object({
|
|
192
158
|
role: _zod.z.literal("broker"),
|
|
193
159
|
flip_balance: numberOrHex,
|
|
194
|
-
earned_fees: chainAssetMapFactory(numberOrHex, 0)
|
|
195
|
-
btc_vault_deposit_address: _zod.z.string().nullable().optional()
|
|
160
|
+
earned_fees: chainAssetMapFactory(numberOrHex, 0)
|
|
196
161
|
});
|
|
197
162
|
var boostBalances = _zod.z.array(
|
|
198
163
|
_zod.z.object({
|
|
@@ -227,12 +192,7 @@ var validator = _zod.z.object({
|
|
|
227
192
|
apy_bp: _zod.z.number().nullable(),
|
|
228
193
|
restricted_balances: _zod.z.record(hexString, numberOrHex)
|
|
229
194
|
});
|
|
230
|
-
var cfAccountInfo = _zod.z.
|
|
231
|
-
unregistered,
|
|
232
|
-
broker,
|
|
233
|
-
liquidityProvider,
|
|
234
|
-
validator
|
|
235
|
-
]);
|
|
195
|
+
var cfAccountInfo = _zod.z.union([unregistered, broker, liquidityProvider, validator]);
|
|
236
196
|
var cfAccounts = _zod.z.array(_zod.z.tuple([_zod.z.string(), _zod.z.string()]));
|
|
237
197
|
var cfPoolPriceV2 = _zod.z.object({
|
|
238
198
|
sell: numberOrHex.nullable(),
|
|
@@ -293,8 +253,7 @@ var cfBoostPoolDetails = _zod.z.array(
|
|
|
293
253
|
account_id: _zod.z.string(),
|
|
294
254
|
pending_deposits: _zod.z.array(_zod.z.bigint())
|
|
295
255
|
})
|
|
296
|
-
)
|
|
297
|
-
network_fee_deduction_percent: _zod.z.number().optional()
|
|
256
|
+
)
|
|
298
257
|
})
|
|
299
258
|
)
|
|
300
259
|
);
|
|
@@ -312,10 +271,6 @@ var cfBoostPoolPendingFees = _zod.z.array(
|
|
|
312
271
|
})
|
|
313
272
|
)
|
|
314
273
|
);
|
|
315
|
-
var lpTotalBalances = chainAssetMapFactory(numberOrHex, 0);
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
274
|
|
|
320
275
|
|
|
321
276
|
|
|
@@ -345,4 +300,4 @@ var lpTotalBalances = chainAssetMapFactory(numberOrHex, 0);
|
|
|
345
300
|
|
|
346
301
|
|
|
347
302
|
|
|
348
|
-
exports.broker = broker; exports.brokerRequestSwapDepositAddress = brokerRequestSwapDepositAddress; exports.cfAccountInfo = cfAccountInfo; exports.cfAccounts = cfAccounts; exports.cfBoostPoolDetails = cfBoostPoolDetails; exports.cfBoostPoolPendingFees = cfBoostPoolPendingFees; exports.cfBoostPoolsDepth = cfBoostPoolsDepth; exports.cfEnvironment = cfEnvironment; exports.cfFundingEnvironment = cfFundingEnvironment; exports.cfIngressEgressEnvironment = cfIngressEgressEnvironment; exports.cfPoolDepth = cfPoolDepth; exports.cfPoolOrders = cfPoolOrders; exports.cfPoolPriceV2 = cfPoolPriceV2; exports.cfPoolsEnvironment = cfPoolsEnvironment; exports.cfSupportedAssets = cfSupportedAssets; exports.cfSwapRate = cfSwapRate; exports.cfSwapRateV2 = cfSwapRateV2; exports.
|
|
303
|
+
exports.broker = broker; exports.brokerRequestSwapDepositAddress = brokerRequestSwapDepositAddress; exports.cfAccountInfo = cfAccountInfo; exports.cfAccounts = cfAccounts; exports.cfBoostPoolDetails = cfBoostPoolDetails; exports.cfBoostPoolPendingFees = cfBoostPoolPendingFees; exports.cfBoostPoolsDepth = cfBoostPoolsDepth; exports.cfEnvironment = cfEnvironment; exports.cfFundingEnvironment = cfFundingEnvironment; exports.cfIngressEgressEnvironment = cfIngressEgressEnvironment; exports.cfPoolDepth = cfPoolDepth; exports.cfPoolOrders = cfPoolOrders; exports.cfPoolPriceV2 = cfPoolPriceV2; exports.cfPoolsEnvironment = cfPoolsEnvironment; exports.cfSupportedAssets = cfSupportedAssets; exports.cfSwapRate = cfSwapRate; exports.cfSwapRateV2 = cfSwapRateV2; exports.cfSwappingEnvironment = cfSwappingEnvironment; exports.chainGetBlockHash = chainGetBlockHash; exports.hexString = hexString; exports.liquidityProvider = liquidityProvider; exports.numberOrHex = numberOrHex; exports.rpcResponse = rpcResponse; exports.stateGetMetadata = stateGetMetadata; exports.stateGetRuntimeVersion = stateGetRuntimeVersion; exports.u256 = u256; exports.unregistered = unregistered; exports.validator = validator;
|