@chainflip/rpc 1.8.0-assethub.1 → 1.8.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.cjs +3 -0
- package/dist/common.d.cts +1000 -4634
- package/dist/common.d.ts +1000 -4634
- package/dist/common.mjs +4 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.mjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/parsers.cjs +38 -20
- package/dist/parsers.d.cts +2088 -6168
- package/dist/parsers.d.ts +2088 -6168
- package/dist/parsers.mjs +37 -19
- package/dist/types.d.cts +3 -1
- package/dist/types.d.ts +3 -1
- package/package.json +4 -4
package/dist/parsers.mjs
CHANGED
|
@@ -10,32 +10,21 @@ 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.default(defaultValue), USDC: parser.default(defaultValue) }).default({ SOL: defaultValue, USDC: defaultValue })
|
|
14
|
-
Assethub: z.object({
|
|
15
|
-
DOT: parser.default(defaultValue),
|
|
16
|
-
USDC: parser.default(defaultValue),
|
|
17
|
-
USDT: parser.default(defaultValue)
|
|
18
|
-
})
|
|
13
|
+
Solana: z.object({ SOL: parser.default(defaultValue), USDC: parser.default(defaultValue) }).default({ SOL: defaultValue, USDC: defaultValue })
|
|
19
14
|
});
|
|
20
15
|
var chainBaseAssetMapFactory = (parser, defaultValue) => z.object({
|
|
21
16
|
Bitcoin: z.object({ BTC: parser }),
|
|
22
17
|
Ethereum: z.object({ ETH: parser, FLIP: parser, USDT: parser }),
|
|
23
18
|
Polkadot: z.object({ DOT: parser }),
|
|
24
19
|
Arbitrum: z.object({ ETH: parser, USDC: parser }),
|
|
25
|
-
Solana: z.object({ SOL: parser.default(defaultValue), USDC: parser.default(defaultValue) }).default({ SOL: defaultValue, USDC: defaultValue })
|
|
26
|
-
Assethub: z.object({
|
|
27
|
-
DOT: parser.default(defaultValue),
|
|
28
|
-
USDC: parser.default(defaultValue),
|
|
29
|
-
USDT: parser.default(defaultValue)
|
|
30
|
-
})
|
|
20
|
+
Solana: z.object({ SOL: parser.default(defaultValue), USDC: parser.default(defaultValue) }).default({ SOL: defaultValue, USDC: defaultValue })
|
|
31
21
|
});
|
|
32
22
|
var chainMapFactory = (parser, defaultValue) => z.object({
|
|
33
23
|
Bitcoin: parser,
|
|
34
24
|
Ethereum: parser,
|
|
35
25
|
Polkadot: parser,
|
|
36
26
|
Arbitrum: parser,
|
|
37
|
-
Solana: parser.default(defaultValue)
|
|
38
|
-
Assethub: parser.default(defaultValue)
|
|
27
|
+
Solana: parser.default(defaultValue)
|
|
39
28
|
});
|
|
40
29
|
var rpcAssetSchema = z.union([
|
|
41
30
|
z.object({ chain: z.literal("Bitcoin"), asset: z.literal("BTC") }),
|
|
@@ -47,10 +36,7 @@ var rpcAssetSchema = z.union([
|
|
|
47
36
|
z.object({ chain: z.literal("Arbitrum"), asset: z.literal("ETH") }),
|
|
48
37
|
z.object({ chain: z.literal("Arbitrum"), asset: z.literal("USDC") }),
|
|
49
38
|
z.object({ chain: z.literal("Solana"), asset: z.literal("SOL") }),
|
|
50
|
-
z.object({ chain: z.literal("Solana"), asset: z.literal("USDC") })
|
|
51
|
-
z.object({ chain: z.literal("Assethub"), asset: z.literal("DOT") }),
|
|
52
|
-
z.object({ chain: z.literal("Assethub"), asset: z.literal("USDC") }),
|
|
53
|
-
z.object({ chain: z.literal("Assethub"), asset: z.literal("USDT") })
|
|
39
|
+
z.object({ chain: z.literal("Solana"), asset: z.literal("USDC") })
|
|
54
40
|
]);
|
|
55
41
|
var rename = (mapping) => (obj) => Object.fromEntries(
|
|
56
42
|
Object.entries(obj).map(([key, value]) => [
|
|
@@ -167,6 +153,36 @@ var brokerRequestSwapDepositAddress = z.object({
|
|
|
167
153
|
source_chain_expiry_block: numberOrHex,
|
|
168
154
|
channel_opening_fee: u256
|
|
169
155
|
});
|
|
156
|
+
var evmBrokerRequestSwapParameterEncoding = z.object({
|
|
157
|
+
to: hexString,
|
|
158
|
+
calldata: hexString,
|
|
159
|
+
value: numberOrHex
|
|
160
|
+
});
|
|
161
|
+
var requestSwapParameterEncoding = z.discriminatedUnion("chain", [
|
|
162
|
+
z.object({
|
|
163
|
+
chain: z.literal("Bitcoin"),
|
|
164
|
+
nulldata_payload: hexString,
|
|
165
|
+
deposit_address: z.string()
|
|
166
|
+
}),
|
|
167
|
+
evmBrokerRequestSwapParameterEncoding.extend({
|
|
168
|
+
chain: z.literal("Ethereum")
|
|
169
|
+
}),
|
|
170
|
+
evmBrokerRequestSwapParameterEncoding.extend({
|
|
171
|
+
chain: z.literal("Arbitrum")
|
|
172
|
+
}),
|
|
173
|
+
z.object({
|
|
174
|
+
chain: z.literal("Solana"),
|
|
175
|
+
program_id: z.string(),
|
|
176
|
+
data: hexString,
|
|
177
|
+
accounts: z.array(
|
|
178
|
+
z.object({
|
|
179
|
+
pubkey: z.string(),
|
|
180
|
+
is_signer: z.boolean(),
|
|
181
|
+
is_writable: z.boolean()
|
|
182
|
+
})
|
|
183
|
+
)
|
|
184
|
+
})
|
|
185
|
+
]);
|
|
170
186
|
var unregistered = z.object({
|
|
171
187
|
role: z.literal("unregistered"),
|
|
172
188
|
flip_balance: numberOrHex
|
|
@@ -174,7 +190,8 @@ var unregistered = z.object({
|
|
|
174
190
|
var broker = z.object({
|
|
175
191
|
role: z.literal("broker"),
|
|
176
192
|
flip_balance: numberOrHex,
|
|
177
|
-
earned_fees: chainAssetMapFactory(numberOrHex, 0)
|
|
193
|
+
earned_fees: chainAssetMapFactory(numberOrHex, 0),
|
|
194
|
+
btc_vault_deposit_address: z.string().nullable()
|
|
178
195
|
});
|
|
179
196
|
var boostBalances = z.array(
|
|
180
197
|
z.object({
|
|
@@ -312,6 +329,7 @@ export {
|
|
|
312
329
|
hexString,
|
|
313
330
|
liquidityProvider,
|
|
314
331
|
numberOrHex,
|
|
332
|
+
requestSwapParameterEncoding,
|
|
315
333
|
rpcResponse,
|
|
316
334
|
stateGetMetadata,
|
|
317
335
|
stateGetRuntimeVersion,
|
package/dist/types.d.cts
CHANGED
|
@@ -22,6 +22,7 @@ type CfSwapRateV2 = RpcResult<'cf_swap_rate_v2'>;
|
|
|
22
22
|
type CfSwapRateV3 = RpcResult<'cf_swap_rate_v3'>;
|
|
23
23
|
type CfPoolDepth = RpcResult<'cf_pool_depth'>;
|
|
24
24
|
type CfAccounts = RpcResult<'cf_accounts'>;
|
|
25
|
+
type CfRequestSwapParameterEncoding = RpcResult<'cf_request_swap_parameter_encoding'>;
|
|
25
26
|
type CfAccountInfoResponse = RpcResponse<'cf_account_info'>;
|
|
26
27
|
type CfBoostPoolDetailsResponse = RpcResponse<'cf_boost_pool_details'>;
|
|
27
28
|
type CfBoostPoolPendingFeesResponse = RpcResponse<'cf_boost_pool_pending_fees'>;
|
|
@@ -39,9 +40,10 @@ type CfSwapRateV2Response = RpcResponse<'cf_swap_rate_v2'>;
|
|
|
39
40
|
type CfSwapRateV3Response = RpcResponse<'cf_swap_rate_v3'>;
|
|
40
41
|
type CfPoolDepthResponse = RpcResponse<'cf_pool_depth'>;
|
|
41
42
|
type CfAccountsResponse = RpcResponse<'cf_accounts'>;
|
|
43
|
+
type CfRequestSwapParameterEncodingResponse = RpcResponse<'cf_request_swap_parameter_encoding'>;
|
|
42
44
|
type CfUnregisteredAccount = z.output<typeof unregistered>;
|
|
43
45
|
type CfBrokerAccount = z.output<typeof broker>;
|
|
44
46
|
type CfValidatorAccount = z.output<typeof validator>;
|
|
45
47
|
type CfLiquidityProviderAccount = z.output<typeof liquidityProvider>;
|
|
46
48
|
|
|
47
|
-
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 CfSwapRateV3, type CfSwapRateV3Response, type CfSwappingEnvironment, type CfSwappingEnvironmentResponse, type CfUnregisteredAccount, type CfValidatorAccount, RpcResult };
|
|
49
|
+
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 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, RpcResult };
|
package/dist/types.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ type CfSwapRateV2 = RpcResult<'cf_swap_rate_v2'>;
|
|
|
22
22
|
type CfSwapRateV3 = RpcResult<'cf_swap_rate_v3'>;
|
|
23
23
|
type CfPoolDepth = RpcResult<'cf_pool_depth'>;
|
|
24
24
|
type CfAccounts = RpcResult<'cf_accounts'>;
|
|
25
|
+
type CfRequestSwapParameterEncoding = RpcResult<'cf_request_swap_parameter_encoding'>;
|
|
25
26
|
type CfAccountInfoResponse = RpcResponse<'cf_account_info'>;
|
|
26
27
|
type CfBoostPoolDetailsResponse = RpcResponse<'cf_boost_pool_details'>;
|
|
27
28
|
type CfBoostPoolPendingFeesResponse = RpcResponse<'cf_boost_pool_pending_fees'>;
|
|
@@ -39,9 +40,10 @@ type CfSwapRateV2Response = RpcResponse<'cf_swap_rate_v2'>;
|
|
|
39
40
|
type CfSwapRateV3Response = RpcResponse<'cf_swap_rate_v3'>;
|
|
40
41
|
type CfPoolDepthResponse = RpcResponse<'cf_pool_depth'>;
|
|
41
42
|
type CfAccountsResponse = RpcResponse<'cf_accounts'>;
|
|
43
|
+
type CfRequestSwapParameterEncodingResponse = RpcResponse<'cf_request_swap_parameter_encoding'>;
|
|
42
44
|
type CfUnregisteredAccount = z.output<typeof unregistered>;
|
|
43
45
|
type CfBrokerAccount = z.output<typeof broker>;
|
|
44
46
|
type CfValidatorAccount = z.output<typeof validator>;
|
|
45
47
|
type CfLiquidityProviderAccount = z.output<typeof liquidityProvider>;
|
|
46
48
|
|
|
47
|
-
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 CfSwapRateV3, type CfSwapRateV3Response, type CfSwappingEnvironment, type CfSwappingEnvironmentResponse, type CfUnregisteredAccount, type CfValidatorAccount, RpcResult };
|
|
49
|
+
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 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, RpcResult };
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainflip/rpc",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@chainflip/utils": "0.4.0",
|
|
7
|
-
"zod": "^3.
|
|
7
|
+
"zod": "^3.24.1"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"@types/node": "^22.
|
|
11
|
-
"@types/ws": "^8.5.
|
|
10
|
+
"@types/node": "^22.13.0",
|
|
11
|
+
"@types/ws": "^8.5.14",
|
|
12
12
|
"ws": "^8.18.0"
|
|
13
13
|
},
|
|
14
14
|
"files": [
|