@chainflip/rpc 2.1.10 → 2.2.0-alpha.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 +1 -0
- package/dist/Client.mjs +1 -0
- package/dist/common.cjs +1 -0
- package/dist/common.d.cts +5722 -1557
- package/dist/common.d.mts +5722 -1557
- package/dist/common.mjs +1 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/parsers.cjs +48 -9
- package/dist/parsers.d.cts +6830 -1887
- package/dist/parsers.d.mts +6830 -1887
- package/dist/parsers.mjs +48 -9
- package/dist/types.d.cts +3 -1
- package/dist/types.d.mts +3 -1
- package/package.json +2 -2
package/dist/parsers.mjs
CHANGED
|
@@ -39,6 +39,13 @@ const chainAssetMapFactory = (parser, defaultValue) => z.object({
|
|
|
39
39
|
DOT: parser,
|
|
40
40
|
USDC: parser,
|
|
41
41
|
USDT: parser
|
|
42
|
+
}),
|
|
43
|
+
Tron: z.object({
|
|
44
|
+
TRX: parser,
|
|
45
|
+
USDT: parser.default(defaultValue)
|
|
46
|
+
}).default({
|
|
47
|
+
TRX: defaultValue,
|
|
48
|
+
USDT: defaultValue
|
|
42
49
|
})
|
|
43
50
|
});
|
|
44
51
|
const chainBaseAssetMapFactory = (parser, defaultValue) => z.object({
|
|
@@ -63,14 +70,22 @@ const chainBaseAssetMapFactory = (parser, defaultValue) => z.object({
|
|
|
63
70
|
DOT: parser,
|
|
64
71
|
USDC: parser,
|
|
65
72
|
USDT: parser
|
|
73
|
+
}),
|
|
74
|
+
Tron: z.object({
|
|
75
|
+
TRX: parser,
|
|
76
|
+
USDT: parser.default(defaultValue)
|
|
77
|
+
}).default({
|
|
78
|
+
TRX: defaultValue,
|
|
79
|
+
USDT: defaultValue
|
|
66
80
|
})
|
|
67
81
|
});
|
|
68
|
-
const chainMapFactory = (parser,
|
|
82
|
+
const chainMapFactory = (parser, defaultValue) => z.object({
|
|
69
83
|
Bitcoin: parser,
|
|
70
84
|
Ethereum: parser,
|
|
71
85
|
Arbitrum: parser,
|
|
72
86
|
Solana: parser,
|
|
73
|
-
Assethub: parser
|
|
87
|
+
Assethub: parser,
|
|
88
|
+
Tron: parser.default(defaultValue)
|
|
74
89
|
});
|
|
75
90
|
const rpcAssetSchema = z.union([
|
|
76
91
|
z.object({
|
|
@@ -132,6 +147,14 @@ const rpcAssetSchema = z.union([
|
|
|
132
147
|
z.object({
|
|
133
148
|
chain: z.literal("Assethub"),
|
|
134
149
|
asset: z.literal("USDT")
|
|
150
|
+
}),
|
|
151
|
+
z.object({
|
|
152
|
+
chain: z.literal("Tron"),
|
|
153
|
+
asset: z.literal("TRX")
|
|
154
|
+
}),
|
|
155
|
+
z.object({
|
|
156
|
+
chain: z.literal("Tron"),
|
|
157
|
+
asset: z.literal("USDT")
|
|
135
158
|
})
|
|
136
159
|
]);
|
|
137
160
|
const networkFee = z.object({
|
|
@@ -311,6 +334,10 @@ const requestSwapParameterEncoding = z.discriminatedUnion("chain", [
|
|
|
311
334
|
}),
|
|
312
335
|
evmBrokerRequestSwapParameterEncoding.extend({ chain: z.literal("Ethereum") }),
|
|
313
336
|
evmBrokerRequestSwapParameterEncoding.extend({ chain: z.literal("Arbitrum") }),
|
|
337
|
+
evmBrokerRequestSwapParameterEncoding.extend({
|
|
338
|
+
chain: z.literal("Tron"),
|
|
339
|
+
note: hexString
|
|
340
|
+
}),
|
|
314
341
|
z.object({
|
|
315
342
|
chain: z.literal("Solana"),
|
|
316
343
|
program_id: z.string(),
|
|
@@ -660,12 +687,14 @@ const cfSafeModeStatuses = z.object({
|
|
|
660
687
|
broadcast_arbitrum: broadcastPalletSafeModeStatuses,
|
|
661
688
|
broadcast_solana: broadcastPalletSafeModeStatuses,
|
|
662
689
|
broadcast_assethub: broadcastPalletSafeModeStatuses,
|
|
690
|
+
broadcast_tron: broadcastPalletSafeModeStatuses.optional(),
|
|
663
691
|
ingress_egress_ethereum: ingressEgressPalletSafeModeStatuses,
|
|
664
692
|
ingress_egress_bitcoin: ingressEgressPalletSafeModeStatuses,
|
|
665
693
|
ingress_egress_polkadot: ingressEgressPalletSafeModeStatuses,
|
|
666
694
|
ingress_egress_arbitrum: ingressEgressPalletSafeModeStatuses,
|
|
667
695
|
ingress_egress_solana: ingressEgressPalletSafeModeStatuses,
|
|
668
696
|
ingress_egress_assethub: ingressEgressPalletSafeModeStatuses,
|
|
697
|
+
ingress_egress_tron: ingressEgressPalletSafeModeStatuses.optional(),
|
|
669
698
|
witnesser: z.enum([
|
|
670
699
|
"CodeRed",
|
|
671
700
|
"CodeGreen",
|
|
@@ -752,10 +781,15 @@ const cfLendingPoolSupplyBalances = z.array(z.intersection(rpcAssetSchema, z.obj
|
|
|
752
781
|
lp_id: accountId,
|
|
753
782
|
total_amount: numberOrHex
|
|
754
783
|
})) })));
|
|
784
|
+
const u128 = z.union([
|
|
785
|
+
z.number(),
|
|
786
|
+
numericString,
|
|
787
|
+
hexString
|
|
788
|
+
]).transform((arg) => BigInt(arg));
|
|
755
789
|
const ingressEgressDeposit = z.object({
|
|
756
790
|
deposit_chain_block_height: z.number(),
|
|
757
791
|
deposit_address: z.string(),
|
|
758
|
-
amount:
|
|
792
|
+
amount: u128,
|
|
759
793
|
asset: z.object({
|
|
760
794
|
chain: z.string(),
|
|
761
795
|
asset: z.string()
|
|
@@ -763,13 +797,18 @@ const ingressEgressDeposit = z.object({
|
|
|
763
797
|
deposit_details: z.union([z.object({ tx_hashes: z.array(hexString) }), z.object({
|
|
764
798
|
tx_id: z.string().transform((v) => v.startsWith("0x") ? v : `0x${v}`),
|
|
765
799
|
vout: z.number().int()
|
|
766
|
-
})]).nullable()
|
|
800
|
+
})]).nullable().optional()
|
|
767
801
|
});
|
|
802
|
+
const txRef = z.object({ hash: z.string() });
|
|
803
|
+
const txOutId = z.union([z.object({ hash: z.string() }), z.object({ signature: z.object({
|
|
804
|
+
s: z.array(z.number()),
|
|
805
|
+
k_times_g_address: z.array(z.number())
|
|
806
|
+
}) })]);
|
|
768
807
|
const ingressEgressBroadcast = z.object({
|
|
769
808
|
broadcast_id: z.number(),
|
|
770
809
|
broadcast_chain_block_height: z.number(),
|
|
771
|
-
tx_out_id:
|
|
772
|
-
tx_ref:
|
|
810
|
+
tx_out_id: txOutId,
|
|
811
|
+
tx_ref: txRef
|
|
773
812
|
});
|
|
774
813
|
const ingressEgressVaultDeposit = z.object({
|
|
775
814
|
tx_id: z.string(),
|
|
@@ -782,7 +821,7 @@ const ingressEgressVaultDeposit = z.object({
|
|
|
782
821
|
chain: z.string(),
|
|
783
822
|
asset: z.string()
|
|
784
823
|
}),
|
|
785
|
-
amount:
|
|
824
|
+
amount: u128,
|
|
786
825
|
destination_address: z.string(),
|
|
787
826
|
ccm_deposit_metadata: z.unknown().nullable().optional(),
|
|
788
827
|
deposit_details: z.unknown().nullable().optional(),
|
|
@@ -803,9 +842,9 @@ const ingressEgressVaultDeposit = z.object({
|
|
|
803
842
|
refund_params: z.object({
|
|
804
843
|
retry_duration: z.number(),
|
|
805
844
|
refund_address: z.string(),
|
|
806
|
-
min_price:
|
|
845
|
+
min_price: u128,
|
|
807
846
|
refund_ccm_metadata: z.unknown().nullable().optional(),
|
|
808
|
-
max_oracle_price_slippage: z.
|
|
847
|
+
max_oracle_price_slippage: z.number().nullable().optional()
|
|
809
848
|
}).nullable().optional(),
|
|
810
849
|
dca_params: z.object({
|
|
811
850
|
number_of_chunks: z.number(),
|
package/dist/types.d.cts
CHANGED
|
@@ -15,6 +15,7 @@ type CfEncodeCfParameters = RpcResult<'cf_encode_cf_parameters'>;
|
|
|
15
15
|
type CfEnvironment = RpcResult<'cf_environment'>;
|
|
16
16
|
type CfFailedCallArbitrum = RpcResult<'cf_failed_call_arbitrum'>;
|
|
17
17
|
type CfFailedCallEthereum = RpcResult<'cf_failed_call_ethereum'>;
|
|
18
|
+
type CfFailedCallTron = RpcResult<'cf_failed_call_tron'>;
|
|
18
19
|
type CfFlipSupply = RpcResult<'cf_flip_supply'>;
|
|
19
20
|
type CfFundingEnvironment = RpcResult<'cf_funding_environment'>;
|
|
20
21
|
type CfGetTradingStrategies = RpcResult<'cf_get_trading_strategies'>;
|
|
@@ -51,6 +52,7 @@ type CfEncodeCfParametersResponse = RpcResponse<'cf_encode_cf_parameters'>;
|
|
|
51
52
|
type CfEnvironmentResponse = RpcResponse<'cf_environment'>;
|
|
52
53
|
type CfFailedCallArbitrumResponse = RpcResponse<'cf_failed_call_arbitrum'>;
|
|
53
54
|
type CfFailedCallEthereumResponse = RpcResponse<'cf_failed_call_ethereum'>;
|
|
55
|
+
type CfFailedCallTronResponse = RpcResponse<'cf_failed_call_tron'>;
|
|
54
56
|
type CfFlipSupplyResponse = RpcResponse<'cf_flip_supply'>;
|
|
55
57
|
type CfFundingEnvironmentResponse = RpcResponse<'cf_funding_environment'>;
|
|
56
58
|
type CfGetTradingStrategiesResponse = RpcResponse<'cf_get_trading_strategies'>;
|
|
@@ -83,4 +85,4 @@ type CfOperatorAccount = z.output<typeof operator>;
|
|
|
83
85
|
type LpTotalBalances = RpcResult<'lp_total_balances'>;
|
|
84
86
|
type LpTotalBalancesResponse = RpcResponse<'lp_total_balances'>;
|
|
85
87
|
//#endregion
|
|
86
|
-
export { CfAccountInfo, CfAccountInfoResponse, CfAccounts, CfAccountsResponse, CfAuctionState, CfAuctionStateResponse, CfAvailablePools, CfAvailablePoolsResponse, CfBoostPoolDetails, CfBoostPoolDetailsResponse, CfBoostPoolPendingFees, CfBoostPoolPendingFeesResponse, CfBoostPoolsDepth, CfBoostPoolsDepthResponse, CfBrokerAccount, CfEncodeCfParameters, CfEncodeCfParametersResponse, CfEnvironment, CfEnvironmentResponse, CfFailedCallArbitrum, CfFailedCallArbitrumResponse, CfFailedCallEthereum, CfFailedCallEthereumResponse, CfFlipSupply, CfFlipSupplyResponse, CfFundingEnvironment, CfFundingEnvironmentResponse, CfGetTradingStrategies, CfGetTradingStrategiesResponse, CfGetTradingStrategyLimits, CfGetTradingStrategyLimitsResponse, CfIngressEgressEnvironment, CfIngressEgressEnvironmentResponse, CfIngressEgressEvents, CfIngressEgressEventsResponse, CfLendingConfig, CfLendingConfigResponse, CfLendingPoolSupplyBalances, CfLendingPoolSupplyBalancesResponse, CfLendingPools, CfLendingPoolsResponse, CfLiquidityProviderAccount, CfLoanAccounts, CfLoanAccountsResponse, CfMonitoringSimulateAuction, CfMonitoringSimulateAuctionResponse, CfOperatorAccount, CfOraclePrices, CfOraclePricesResponse, CfPoolDepth, CfPoolDepthResponse, CfPoolOrderbook, CfPoolOrderbookResponse, CfPoolOrders, CfPoolOrdersResponse, CfPoolPriceV2, CfPoolPriceV2Response, CfPoolsEnvironment, CfPoolsEnvironmentResponse, CfRequestSwapParameterEncoding, CfRequestSwapParameterEncodingResponse, CfSafeModeStatuses, CfSafeModeStatusesResponse, CfSupportedAssets, CfSupportedAssetsResponse, CfSwapRate, CfSwapRateResponse, CfSwapRateV2, CfSwapRateV2Response, CfSwapRateV3, CfSwapRateV3Response, CfSwappingEnvironment, CfSwappingEnvironmentResponse, CfUnregisteredAccount, CfValidatorAccount, CfVaultAddresses, CfVaultAddressesResponse, LpTotalBalances, LpTotalBalancesResponse, type RpcLimitOrder, type RpcMethod, type RpcRequest as RpcParams, type RpcRangeOrder, type RpcResult };
|
|
88
|
+
export { CfAccountInfo, CfAccountInfoResponse, CfAccounts, CfAccountsResponse, CfAuctionState, CfAuctionStateResponse, CfAvailablePools, CfAvailablePoolsResponse, CfBoostPoolDetails, CfBoostPoolDetailsResponse, CfBoostPoolPendingFees, CfBoostPoolPendingFeesResponse, CfBoostPoolsDepth, CfBoostPoolsDepthResponse, CfBrokerAccount, CfEncodeCfParameters, CfEncodeCfParametersResponse, CfEnvironment, CfEnvironmentResponse, CfFailedCallArbitrum, CfFailedCallArbitrumResponse, CfFailedCallEthereum, CfFailedCallEthereumResponse, CfFailedCallTron, CfFailedCallTronResponse, CfFlipSupply, CfFlipSupplyResponse, CfFundingEnvironment, CfFundingEnvironmentResponse, CfGetTradingStrategies, CfGetTradingStrategiesResponse, CfGetTradingStrategyLimits, CfGetTradingStrategyLimitsResponse, CfIngressEgressEnvironment, CfIngressEgressEnvironmentResponse, CfIngressEgressEvents, CfIngressEgressEventsResponse, CfLendingConfig, CfLendingConfigResponse, CfLendingPoolSupplyBalances, CfLendingPoolSupplyBalancesResponse, CfLendingPools, CfLendingPoolsResponse, CfLiquidityProviderAccount, CfLoanAccounts, CfLoanAccountsResponse, CfMonitoringSimulateAuction, CfMonitoringSimulateAuctionResponse, CfOperatorAccount, CfOraclePrices, CfOraclePricesResponse, CfPoolDepth, CfPoolDepthResponse, CfPoolOrderbook, CfPoolOrderbookResponse, CfPoolOrders, CfPoolOrdersResponse, CfPoolPriceV2, CfPoolPriceV2Response, CfPoolsEnvironment, CfPoolsEnvironmentResponse, CfRequestSwapParameterEncoding, CfRequestSwapParameterEncodingResponse, CfSafeModeStatuses, CfSafeModeStatusesResponse, CfSupportedAssets, CfSupportedAssetsResponse, CfSwapRate, CfSwapRateResponse, CfSwapRateV2, CfSwapRateV2Response, CfSwapRateV3, CfSwapRateV3Response, CfSwappingEnvironment, CfSwappingEnvironmentResponse, CfUnregisteredAccount, CfValidatorAccount, CfVaultAddresses, CfVaultAddressesResponse, LpTotalBalances, LpTotalBalancesResponse, type RpcLimitOrder, type RpcMethod, type RpcRequest as RpcParams, type RpcRangeOrder, type RpcResult };
|
package/dist/types.d.mts
CHANGED
|
@@ -15,6 +15,7 @@ type CfEncodeCfParameters = RpcResult<'cf_encode_cf_parameters'>;
|
|
|
15
15
|
type CfEnvironment = RpcResult<'cf_environment'>;
|
|
16
16
|
type CfFailedCallArbitrum = RpcResult<'cf_failed_call_arbitrum'>;
|
|
17
17
|
type CfFailedCallEthereum = RpcResult<'cf_failed_call_ethereum'>;
|
|
18
|
+
type CfFailedCallTron = RpcResult<'cf_failed_call_tron'>;
|
|
18
19
|
type CfFlipSupply = RpcResult<'cf_flip_supply'>;
|
|
19
20
|
type CfFundingEnvironment = RpcResult<'cf_funding_environment'>;
|
|
20
21
|
type CfGetTradingStrategies = RpcResult<'cf_get_trading_strategies'>;
|
|
@@ -51,6 +52,7 @@ type CfEncodeCfParametersResponse = RpcResponse<'cf_encode_cf_parameters'>;
|
|
|
51
52
|
type CfEnvironmentResponse = RpcResponse<'cf_environment'>;
|
|
52
53
|
type CfFailedCallArbitrumResponse = RpcResponse<'cf_failed_call_arbitrum'>;
|
|
53
54
|
type CfFailedCallEthereumResponse = RpcResponse<'cf_failed_call_ethereum'>;
|
|
55
|
+
type CfFailedCallTronResponse = RpcResponse<'cf_failed_call_tron'>;
|
|
54
56
|
type CfFlipSupplyResponse = RpcResponse<'cf_flip_supply'>;
|
|
55
57
|
type CfFundingEnvironmentResponse = RpcResponse<'cf_funding_environment'>;
|
|
56
58
|
type CfGetTradingStrategiesResponse = RpcResponse<'cf_get_trading_strategies'>;
|
|
@@ -83,4 +85,4 @@ type CfOperatorAccount = z.output<typeof operator>;
|
|
|
83
85
|
type LpTotalBalances = RpcResult<'lp_total_balances'>;
|
|
84
86
|
type LpTotalBalancesResponse = RpcResponse<'lp_total_balances'>;
|
|
85
87
|
//#endregion
|
|
86
|
-
export { CfAccountInfo, CfAccountInfoResponse, CfAccounts, CfAccountsResponse, CfAuctionState, CfAuctionStateResponse, CfAvailablePools, CfAvailablePoolsResponse, CfBoostPoolDetails, CfBoostPoolDetailsResponse, CfBoostPoolPendingFees, CfBoostPoolPendingFeesResponse, CfBoostPoolsDepth, CfBoostPoolsDepthResponse, CfBrokerAccount, CfEncodeCfParameters, CfEncodeCfParametersResponse, CfEnvironment, CfEnvironmentResponse, CfFailedCallArbitrum, CfFailedCallArbitrumResponse, CfFailedCallEthereum, CfFailedCallEthereumResponse, CfFlipSupply, CfFlipSupplyResponse, CfFundingEnvironment, CfFundingEnvironmentResponse, CfGetTradingStrategies, CfGetTradingStrategiesResponse, CfGetTradingStrategyLimits, CfGetTradingStrategyLimitsResponse, CfIngressEgressEnvironment, CfIngressEgressEnvironmentResponse, CfIngressEgressEvents, CfIngressEgressEventsResponse, CfLendingConfig, CfLendingConfigResponse, CfLendingPoolSupplyBalances, CfLendingPoolSupplyBalancesResponse, CfLendingPools, CfLendingPoolsResponse, CfLiquidityProviderAccount, CfLoanAccounts, CfLoanAccountsResponse, CfMonitoringSimulateAuction, CfMonitoringSimulateAuctionResponse, CfOperatorAccount, CfOraclePrices, CfOraclePricesResponse, CfPoolDepth, CfPoolDepthResponse, CfPoolOrderbook, CfPoolOrderbookResponse, CfPoolOrders, CfPoolOrdersResponse, CfPoolPriceV2, CfPoolPriceV2Response, CfPoolsEnvironment, CfPoolsEnvironmentResponse, CfRequestSwapParameterEncoding, CfRequestSwapParameterEncodingResponse, CfSafeModeStatuses, CfSafeModeStatusesResponse, CfSupportedAssets, CfSupportedAssetsResponse, CfSwapRate, CfSwapRateResponse, CfSwapRateV2, CfSwapRateV2Response, CfSwapRateV3, CfSwapRateV3Response, CfSwappingEnvironment, CfSwappingEnvironmentResponse, CfUnregisteredAccount, CfValidatorAccount, CfVaultAddresses, CfVaultAddressesResponse, LpTotalBalances, LpTotalBalancesResponse, type RpcLimitOrder, type RpcMethod, type RpcRequest as RpcParams, type RpcRangeOrder, type RpcResult };
|
|
88
|
+
export { CfAccountInfo, CfAccountInfoResponse, CfAccounts, CfAccountsResponse, CfAuctionState, CfAuctionStateResponse, CfAvailablePools, CfAvailablePoolsResponse, CfBoostPoolDetails, CfBoostPoolDetailsResponse, CfBoostPoolPendingFees, CfBoostPoolPendingFeesResponse, CfBoostPoolsDepth, CfBoostPoolsDepthResponse, CfBrokerAccount, CfEncodeCfParameters, CfEncodeCfParametersResponse, CfEnvironment, CfEnvironmentResponse, CfFailedCallArbitrum, CfFailedCallArbitrumResponse, CfFailedCallEthereum, CfFailedCallEthereumResponse, CfFailedCallTron, CfFailedCallTronResponse, CfFlipSupply, CfFlipSupplyResponse, CfFundingEnvironment, CfFundingEnvironmentResponse, CfGetTradingStrategies, CfGetTradingStrategiesResponse, CfGetTradingStrategyLimits, CfGetTradingStrategyLimitsResponse, CfIngressEgressEnvironment, CfIngressEgressEnvironmentResponse, CfIngressEgressEvents, CfIngressEgressEventsResponse, CfLendingConfig, CfLendingConfigResponse, CfLendingPoolSupplyBalances, CfLendingPoolSupplyBalancesResponse, CfLendingPools, CfLendingPoolsResponse, CfLiquidityProviderAccount, CfLoanAccounts, CfLoanAccountsResponse, CfMonitoringSimulateAuction, CfMonitoringSimulateAuctionResponse, CfOperatorAccount, CfOraclePrices, CfOraclePricesResponse, CfPoolDepth, CfPoolDepthResponse, CfPoolOrderbook, CfPoolOrderbookResponse, CfPoolOrders, CfPoolOrdersResponse, CfPoolPriceV2, CfPoolPriceV2Response, CfPoolsEnvironment, CfPoolsEnvironmentResponse, CfRequestSwapParameterEncoding, CfRequestSwapParameterEncodingResponse, CfSafeModeStatuses, CfSafeModeStatusesResponse, CfSupportedAssets, CfSupportedAssetsResponse, CfSwapRate, CfSwapRateResponse, CfSwapRateV2, CfSwapRateV2Response, CfSwapRateV3, CfSwapRateV3Response, CfSwappingEnvironment, CfSwappingEnvironmentResponse, CfUnregisteredAccount, CfValidatorAccount, CfVaultAddresses, CfVaultAddressesResponse, LpTotalBalances, LpTotalBalancesResponse, type RpcLimitOrder, type RpcMethod, type RpcRequest as RpcParams, type RpcRangeOrder, type RpcResult };
|
package/package.json
CHANGED