@chainflip/rpc 2.1.4 → 2.1.6
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 +34 -13
- package/dist/Client.d.cts +3 -0
- package/dist/Client.d.mts +3 -0
- package/dist/Client.mjs +33 -13
- package/dist/WsClient.cjs +1 -0
- package/dist/_virtual/_rolldown/runtime.cjs +25 -1
- package/dist/common.cjs +3 -1
- package/dist/common.d.cts +756 -414
- package/dist/common.d.mts +756 -414
- package/dist/common.mjs +3 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/parsers.cjs +71 -0
- package/dist/parsers.d.cts +956 -615
- package/dist/parsers.d.mts +956 -615
- package/dist/parsers.mjs +69 -1
- package/dist/types.d.cts +3 -1
- package/dist/types.d.mts +3 -1
- package/package.json +3 -3
package/dist/parsers.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { bytesToHex } from "@chainflip/utils/bytes";
|
|
3
3
|
import { priceAssets } from "@chainflip/utils/chainflip";
|
|
4
|
+
import { CHAINFLIP_SS58_PREFIX } from "@chainflip/utils/consts";
|
|
4
5
|
import { isUndefined } from "@chainflip/utils/guard";
|
|
6
|
+
import * as ss58 from "@chainflip/utils/ss58";
|
|
5
7
|
import { isHex } from "@chainflip/utils/string";
|
|
6
8
|
|
|
7
9
|
//#region src/parsers.ts
|
|
@@ -741,6 +743,72 @@ const cfLendingPoolSupplyBalances = z.array(z.intersection(rpcAssetSchema, z.obj
|
|
|
741
743
|
lp_id: accountId,
|
|
742
744
|
total_amount: numberOrHex
|
|
743
745
|
})) })));
|
|
746
|
+
const ingressEgressDeposit = z.object({
|
|
747
|
+
deposit_chain_block_height: z.number(),
|
|
748
|
+
deposit_address: z.string(),
|
|
749
|
+
amount: z.string(),
|
|
750
|
+
asset: z.object({
|
|
751
|
+
chain: z.string(),
|
|
752
|
+
asset: z.string()
|
|
753
|
+
}),
|
|
754
|
+
deposit_details: z.union([z.object({ tx_hashes: z.array(hexString) }), z.object({
|
|
755
|
+
tx_id: z.string().transform((v) => v.startsWith("0x") ? v : `0x${v}`),
|
|
756
|
+
vout: z.number().int()
|
|
757
|
+
})]).nullable()
|
|
758
|
+
});
|
|
759
|
+
const ingressEgressBroadcast = z.object({
|
|
760
|
+
broadcast_id: z.number(),
|
|
761
|
+
broadcast_chain_block_height: z.number(),
|
|
762
|
+
tx_out_id: z.unknown(),
|
|
763
|
+
tx_ref: z.unknown()
|
|
764
|
+
});
|
|
765
|
+
const ingressEgressVaultDeposit = z.object({
|
|
766
|
+
tx_id: z.string(),
|
|
767
|
+
deposit_chain_block_height: z.number().nullable().optional(),
|
|
768
|
+
input_asset: z.object({
|
|
769
|
+
chain: z.string(),
|
|
770
|
+
asset: z.string()
|
|
771
|
+
}),
|
|
772
|
+
output_asset: z.object({
|
|
773
|
+
chain: z.string(),
|
|
774
|
+
asset: z.string()
|
|
775
|
+
}),
|
|
776
|
+
amount: z.string(),
|
|
777
|
+
destination_address: z.string(),
|
|
778
|
+
ccm_deposit_metadata: z.unknown().nullable().optional(),
|
|
779
|
+
deposit_details: z.unknown().nullable().optional(),
|
|
780
|
+
broker_fee: z.object({
|
|
781
|
+
account: z.string().transform((v) => ss58.encode({
|
|
782
|
+
data: ss58.decode(v).data,
|
|
783
|
+
ss58Format: CHAINFLIP_SS58_PREFIX
|
|
784
|
+
})),
|
|
785
|
+
bps: z.number()
|
|
786
|
+
}).optional(),
|
|
787
|
+
affiliate_fees: z.array(z.object({
|
|
788
|
+
account: z.string().transform((v) => ss58.encode({
|
|
789
|
+
data: ss58.decode(v).data,
|
|
790
|
+
ss58Format: CHAINFLIP_SS58_PREFIX
|
|
791
|
+
})),
|
|
792
|
+
bps: z.number()
|
|
793
|
+
})),
|
|
794
|
+
refund_params: z.object({
|
|
795
|
+
retry_duration: z.number(),
|
|
796
|
+
refund_address: z.string(),
|
|
797
|
+
min_price: z.string(),
|
|
798
|
+
refund_ccm_metadata: z.unknown().nullable().optional(),
|
|
799
|
+
max_oracle_price_slippage: z.unknown().nullable().optional()
|
|
800
|
+
}).nullable().optional(),
|
|
801
|
+
dca_params: z.object({
|
|
802
|
+
number_of_chunks: z.number(),
|
|
803
|
+
chunk_interval: z.number()
|
|
804
|
+
}).nullable().optional(),
|
|
805
|
+
max_boost_fee: z.number().optional()
|
|
806
|
+
});
|
|
807
|
+
const cfIngressEgressEvents = z.object({
|
|
808
|
+
deposits: z.array(ingressEgressDeposit),
|
|
809
|
+
broadcasts: z.array(ingressEgressBroadcast),
|
|
810
|
+
vault_deposits: z.array(ingressEgressVaultDeposit)
|
|
811
|
+
});
|
|
744
812
|
const cfVaultAddresses = z.object({
|
|
745
813
|
ethereum: z.object({ Eth: z.array(z.number()).length(20).transform(bytesToHex) }),
|
|
746
814
|
arbitrum: z.object({ Arb: z.array(z.number()).length(20).transform(bytesToHex) }),
|
|
@@ -755,4 +823,4 @@ const cfVaultAddresses = z.object({
|
|
|
755
823
|
});
|
|
756
824
|
|
|
757
825
|
//#endregion
|
|
758
|
-
export { accountInfoCommon, broker, brokerRequestAccountCreationDepositAddress, brokerRequestSwapDepositAddress, cfAccountInfo, cfAccounts, cfAuctionState, cfAvailablePools, cfBoostPoolDetails, cfBoostPoolPendingFees, cfBoostPoolsDepth, cfEnvironment, cfFailedCallEvm, cfFlipSuppy, cfFundingEnvironment, cfGetTradingStrategies, cfGetTradingStrategyLimits, cfIngressEgressEnvironment, cfLendingConfig, cfLendingPoolSupplyBalances, cfLendingPools, cfLoanAccount, cfLoanAccounts, cfMonitoringSimulateAuction, cfOraclePrices, cfPoolDepth, cfPoolOrderbook, cfPoolOrders, cfPoolPriceV2, cfPoolsEnvironment, cfSafeModeStatuses, cfSupportedAssets, cfSwapRate, cfSwapRateV2, cfSwapRateV3, cfSwappingEnvironment, cfTradingStrategy, cfVaultAddresses, chainGetBlockHash, ethereumAddress, hexString, liquidityProvider, lpTotalBalances, numberOrHex, numericString, operator, requestSwapParameterEncoding, rpcResponse, stateGetMetadata, stateGetRuntimeVersion, u256, unregistered, validator };
|
|
826
|
+
export { accountInfoCommon, broker, brokerRequestAccountCreationDepositAddress, brokerRequestSwapDepositAddress, cfAccountInfo, cfAccounts, cfAuctionState, cfAvailablePools, cfBoostPoolDetails, cfBoostPoolPendingFees, cfBoostPoolsDepth, cfEnvironment, cfFailedCallEvm, cfFlipSuppy, cfFundingEnvironment, cfGetTradingStrategies, cfGetTradingStrategyLimits, cfIngressEgressEnvironment, cfIngressEgressEvents, cfLendingConfig, cfLendingPoolSupplyBalances, cfLendingPools, cfLoanAccount, cfLoanAccounts, cfMonitoringSimulateAuction, cfOraclePrices, cfPoolDepth, cfPoolOrderbook, cfPoolOrders, cfPoolPriceV2, cfPoolsEnvironment, cfSafeModeStatuses, cfSupportedAssets, cfSwapRate, cfSwapRateV2, cfSwapRateV3, cfSwappingEnvironment, cfTradingStrategy, cfVaultAddresses, chainGetBlockHash, ethereumAddress, hexString, liquidityProvider, lpTotalBalances, numberOrHex, numericString, operator, requestSwapParameterEncoding, rpcResponse, stateGetMetadata, stateGetRuntimeVersion, u256, unregistered, validator };
|
package/dist/types.d.cts
CHANGED
|
@@ -20,6 +20,7 @@ type CfFundingEnvironment = RpcResult<'cf_funding_environment'>;
|
|
|
20
20
|
type CfGetTradingStrategies = RpcResult<'cf_get_trading_strategies'>;
|
|
21
21
|
type CfGetTradingStrategyLimits = RpcResult<'cf_get_trading_strategy_limits'>;
|
|
22
22
|
type CfIngressEgressEnvironment = RpcResult<'cf_ingress_egress_environment'>;
|
|
23
|
+
type CfIngressEgressEvents = RpcResult<'cf_ingress_egress_events'>;
|
|
23
24
|
type CfPoolDepth = RpcResult<'cf_pool_depth'>;
|
|
24
25
|
type CfPoolOrderbook = RpcResult<'cf_pool_orderbook'>;
|
|
25
26
|
type CfPoolOrders = RpcResult<'cf_pool_orders'>;
|
|
@@ -55,6 +56,7 @@ type CfFundingEnvironmentResponse = RpcResponse<'cf_funding_environment'>;
|
|
|
55
56
|
type CfGetTradingStrategiesResponse = RpcResponse<'cf_get_trading_strategies'>;
|
|
56
57
|
type CfGetTradingStrategyLimitsResponse = RpcResponse<'cf_get_trading_strategy_limits'>;
|
|
57
58
|
type CfIngressEgressEnvironmentResponse = RpcResponse<'cf_ingress_egress_environment'>;
|
|
59
|
+
type CfIngressEgressEventsResponse = RpcResponse<'cf_ingress_egress_events'>;
|
|
58
60
|
type CfPoolDepthResponse = RpcResponse<'cf_pool_depth'>;
|
|
59
61
|
type CfPoolOrderbookResponse = RpcResponse<'cf_pool_orderbook'>;
|
|
60
62
|
type CfPoolOrdersResponse = RpcResponse<'cf_pool_orders'>;
|
|
@@ -81,4 +83,4 @@ type CfOperatorAccount = z.output<typeof operator>;
|
|
|
81
83
|
type LpTotalBalances = RpcResult<'lp_total_balances'>;
|
|
82
84
|
type LpTotalBalancesResponse = RpcResponse<'lp_total_balances'>;
|
|
83
85
|
//#endregion
|
|
84
|
-
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, 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 };
|
|
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 };
|
package/dist/types.d.mts
CHANGED
|
@@ -20,6 +20,7 @@ type CfFundingEnvironment = RpcResult<'cf_funding_environment'>;
|
|
|
20
20
|
type CfGetTradingStrategies = RpcResult<'cf_get_trading_strategies'>;
|
|
21
21
|
type CfGetTradingStrategyLimits = RpcResult<'cf_get_trading_strategy_limits'>;
|
|
22
22
|
type CfIngressEgressEnvironment = RpcResult<'cf_ingress_egress_environment'>;
|
|
23
|
+
type CfIngressEgressEvents = RpcResult<'cf_ingress_egress_events'>;
|
|
23
24
|
type CfPoolDepth = RpcResult<'cf_pool_depth'>;
|
|
24
25
|
type CfPoolOrderbook = RpcResult<'cf_pool_orderbook'>;
|
|
25
26
|
type CfPoolOrders = RpcResult<'cf_pool_orders'>;
|
|
@@ -55,6 +56,7 @@ type CfFundingEnvironmentResponse = RpcResponse<'cf_funding_environment'>;
|
|
|
55
56
|
type CfGetTradingStrategiesResponse = RpcResponse<'cf_get_trading_strategies'>;
|
|
56
57
|
type CfGetTradingStrategyLimitsResponse = RpcResponse<'cf_get_trading_strategy_limits'>;
|
|
57
58
|
type CfIngressEgressEnvironmentResponse = RpcResponse<'cf_ingress_egress_environment'>;
|
|
59
|
+
type CfIngressEgressEventsResponse = RpcResponse<'cf_ingress_egress_events'>;
|
|
58
60
|
type CfPoolDepthResponse = RpcResponse<'cf_pool_depth'>;
|
|
59
61
|
type CfPoolOrderbookResponse = RpcResponse<'cf_pool_orderbook'>;
|
|
60
62
|
type CfPoolOrdersResponse = RpcResponse<'cf_pool_orders'>;
|
|
@@ -81,4 +83,4 @@ type CfOperatorAccount = z.output<typeof operator>;
|
|
|
81
83
|
type LpTotalBalances = RpcResult<'lp_total_balances'>;
|
|
82
84
|
type LpTotalBalancesResponse = RpcResponse<'lp_total_balances'>;
|
|
83
85
|
//#endregion
|
|
84
|
-
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, 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 };
|
|
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 };
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainflip/rpc",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@chainflip/utils": "2.1.2",
|
|
7
7
|
"zod": "^3.25.75"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"@types/node": "^25.
|
|
10
|
+
"@types/node": "^25.5.0",
|
|
11
11
|
"@types/ws": "^8.18.1",
|
|
12
|
-
"ws": "^8.
|
|
12
|
+
"ws": "^8.20.0"
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
15
|
"dist",
|