@chainflip/rpc 1.11.0-beta.13 → 1.11.0-beta.15

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/parsers.mjs CHANGED
@@ -5,7 +5,8 @@ import { isHex } from "@chainflip/utils/string";
5
5
  import { z } from "zod";
6
6
  var hexString = z.string().refine(isHex, { message: "Invalid hex string" });
7
7
  var u256 = hexString.transform((value) => BigInt(value));
8
- var numberOrHex = z.union([z.number().transform((n) => BigInt(n)), u256]);
8
+ var numericString = z.string().regex(/^[0-9]+$/);
9
+ var numberOrHex = z.union([z.number(), u256, numericString]).transform((n) => BigInt(n));
9
10
  var chainAssetMapFactory = (parser, _defaultValue) => z.object({
10
11
  Bitcoin: z.object({ BTC: parser }),
11
12
  Ethereum: z.object({ ETH: parser, USDC: parser, FLIP: parser, USDT: parser }),
@@ -13,7 +14,7 @@ var chainAssetMapFactory = (parser, _defaultValue) => z.object({
13
14
  Arbitrum: z.object({ ETH: parser, USDC: parser }),
14
15
  Solana: z.object({ SOL: parser, USDC: parser }),
15
16
  Assethub: z.object({ DOT: parser, USDC: parser, USDT: parser })
16
- });
17
+ }).omit({ Polkadot: true });
17
18
  var chainBaseAssetMapFactory = (parser, _defaultValue) => z.object({
18
19
  Bitcoin: z.object({ BTC: parser }),
19
20
  Ethereum: z.object({ ETH: parser, FLIP: parser, USDT: parser }),
@@ -21,7 +22,7 @@ var chainBaseAssetMapFactory = (parser, _defaultValue) => z.object({
21
22
  Arbitrum: z.object({ ETH: parser, USDC: parser }),
22
23
  Solana: z.object({ SOL: parser, USDC: parser }),
23
24
  Assethub: z.object({ DOT: parser, USDC: parser, USDT: parser })
24
- });
25
+ }).omit({ Polkadot: true });
25
26
  var chainMapFactory = (parser, _defaultValue) => z.object({
26
27
  Bitcoin: parser,
27
28
  Ethereum: parser,
@@ -29,7 +30,7 @@ var chainMapFactory = (parser, _defaultValue) => z.object({
29
30
  Arbitrum: parser,
30
31
  Solana: parser,
31
32
  Assethub: parser
32
- });
33
+ }).omit({ Polkadot: true });
33
34
  var rpcAssetSchema = z.union([
34
35
  z.object({ chain: z.literal("Bitcoin"), asset: z.literal("BTC") }),
35
36
  z.object({ chain: z.literal("Polkadot"), asset: z.literal("DOT") }),
@@ -660,6 +661,29 @@ var cfLendingPools = z.array(
660
661
  })
661
662
  })
662
663
  );
664
+ var cfLendingConfig = z.object({
665
+ ltv_thresholds: z.object({
666
+ minimum: numberOrHex,
667
+ target: numberOrHex,
668
+ topup: numberOrHex,
669
+ soft_liquidation: numberOrHex,
670
+ soft_liquidation_abort: numberOrHex,
671
+ hard_liquidation: numberOrHex,
672
+ hard_liquidation_abort: numberOrHex
673
+ }),
674
+ network_fee_contributions: z.object({
675
+ from_interest: z.number(),
676
+ from_origination_fee: z.number(),
677
+ from_liquidation_fee: z.number()
678
+ }),
679
+ fee_swap_interval_blocks: z.number(),
680
+ interest_payment_interval_blocks: z.number(),
681
+ fee_swap_threshold_usd: numberOrHex,
682
+ liquidation_swap_chunk_size_usd: numberOrHex,
683
+ soft_liquidation_max_oracle_slippage: z.number(),
684
+ hard_liquidation_max_oracle_slippage: z.number(),
685
+ fee_swap_max_oracle_slippage: z.number()
686
+ });
663
687
  export {
664
688
  accountInfoCommon,
665
689
  broker,
@@ -678,6 +702,7 @@ export {
678
702
  cfGetTradingStrategies,
679
703
  cfGetTradingStrategyLimits,
680
704
  cfIngressEgressEnvironment,
705
+ cfLendingConfig,
681
706
  cfLendingPools,
682
707
  cfOraclePrices,
683
708
  cfPoolDepth,
@@ -699,6 +724,7 @@ export {
699
724
  lpTotalBalances,
700
725
  newCfAccountInfo,
701
726
  numberOrHex,
727
+ numericString,
702
728
  oldBroker,
703
729
  oldCfAccountInfo,
704
730
  oldLiquidityProvider,
package/dist/types.d.cts CHANGED
@@ -36,6 +36,7 @@ type CfSwapRateV2 = RpcResult<'cf_swap_rate_v2'>;
36
36
  type CfSwapRateV3 = RpcResult<'cf_swap_rate_v3'>;
37
37
  type CfOraclePrices = RpcResult<'cf_oracle_prices'>;
38
38
  type CfLendingPools = RpcResult<'cf_lending_pools'>;
39
+ type CfLendingConfig = RpcResult<'cf_lending_config'>;
39
40
  type CfAccountInfoResponse = RpcResponse<'cf_account_info'>;
40
41
  type CfAccountsResponse = RpcResponse<'cf_accounts'>;
41
42
  type CfAuctionStateResponse = RpcResponse<'cf_auction_state'>;
@@ -66,6 +67,7 @@ type CfSwapRateV2Response = RpcResponse<'cf_swap_rate_v2'>;
66
67
  type CfSwapRateV3Response = RpcResponse<'cf_swap_rate_v3'>;
67
68
  type CfOraclePricesResponse = RpcResponse<'cf_oracle_prices'>;
68
69
  type CfLendingPoolsResponse = RpcResponse<'cf_lending_pools'>;
70
+ type CfLendingConfigResponse = RpcResponse<'cf_lending_config'>;
69
71
  type CfUnregisteredAccount = z.output<typeof unregistered>;
70
72
  type CfBrokerAccount = z.output<typeof broker>;
71
73
  type CfValidatorAccount = z.output<typeof validator>;
@@ -74,4 +76,4 @@ type CfOperatorAccount = z.output<typeof operator>;
74
76
  type LpTotalBalances = RpcResult<'lp_total_balances'>;
75
77
  type LpTotalBalancesResponse = RpcResponse<'lp_total_balances'>;
76
78
 
77
- export { type CfAccountInfo, type CfAccountInfoResponse, type CfAccounts, type CfAccountsResponse, type CfAuctionState, type CfAuctionStateResponse, type CfAvailablePools, type CfAvailablePoolsResponse, type CfBoostPoolDetails, type CfBoostPoolDetailsResponse, type CfBoostPoolPendingFees, type CfBoostPoolPendingFeesResponse, type CfBoostPoolsDepth, type CfBoostPoolsDepthResponse, type CfBrokerAccount, type CfEncodeCfParameters, type CfEncodeCfParametersResponse, type CfEnvironment, type CfEnvironmentResponse, type CfFailedCallArbitrum, type CfFailedCallArbitrumResponse, type CfFailedCallEthereum, type CfFailedCallEthereumResponse, type CfFlipSupply, type CfFlipSupplyResponse, type CfFundingEnvironment, type CfFundingEnvironmentResponse, type CfGetTradingStrategies, type CfGetTradingStrategiesResponse, type CfGetTradingStrategyLimits, type CfGetTradingStrategyLimitsResponse, type CfIngressEgressEnvironment, type CfIngressEgressEnvironmentResponse, type CfLendingPools, type CfLendingPoolsResponse, type CfLiquidityProviderAccount, type CfOperatorAccount, type CfOraclePrices, type CfOraclePricesResponse, 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 CfSafeModeStatuses, type CfSafeModeStatusesResponse, 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 };
79
+ export { type CfAccountInfo, type CfAccountInfoResponse, type CfAccounts, type CfAccountsResponse, type CfAuctionState, type CfAuctionStateResponse, type CfAvailablePools, type CfAvailablePoolsResponse, type CfBoostPoolDetails, type CfBoostPoolDetailsResponse, type CfBoostPoolPendingFees, type CfBoostPoolPendingFeesResponse, type CfBoostPoolsDepth, type CfBoostPoolsDepthResponse, type CfBrokerAccount, type CfEncodeCfParameters, type CfEncodeCfParametersResponse, type CfEnvironment, type CfEnvironmentResponse, type CfFailedCallArbitrum, type CfFailedCallArbitrumResponse, type CfFailedCallEthereum, type CfFailedCallEthereumResponse, type CfFlipSupply, type CfFlipSupplyResponse, type CfFundingEnvironment, type CfFundingEnvironmentResponse, type CfGetTradingStrategies, type CfGetTradingStrategiesResponse, type CfGetTradingStrategyLimits, type CfGetTradingStrategyLimitsResponse, type CfIngressEgressEnvironment, type CfIngressEgressEnvironmentResponse, type CfLendingConfig, type CfLendingConfigResponse, type CfLendingPools, type CfLendingPoolsResponse, type CfLiquidityProviderAccount, type CfOperatorAccount, type CfOraclePrices, type CfOraclePricesResponse, 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 CfSafeModeStatuses, type CfSafeModeStatusesResponse, 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
@@ -36,6 +36,7 @@ type CfSwapRateV2 = RpcResult<'cf_swap_rate_v2'>;
36
36
  type CfSwapRateV3 = RpcResult<'cf_swap_rate_v3'>;
37
37
  type CfOraclePrices = RpcResult<'cf_oracle_prices'>;
38
38
  type CfLendingPools = RpcResult<'cf_lending_pools'>;
39
+ type CfLendingConfig = RpcResult<'cf_lending_config'>;
39
40
  type CfAccountInfoResponse = RpcResponse<'cf_account_info'>;
40
41
  type CfAccountsResponse = RpcResponse<'cf_accounts'>;
41
42
  type CfAuctionStateResponse = RpcResponse<'cf_auction_state'>;
@@ -66,6 +67,7 @@ type CfSwapRateV2Response = RpcResponse<'cf_swap_rate_v2'>;
66
67
  type CfSwapRateV3Response = RpcResponse<'cf_swap_rate_v3'>;
67
68
  type CfOraclePricesResponse = RpcResponse<'cf_oracle_prices'>;
68
69
  type CfLendingPoolsResponse = RpcResponse<'cf_lending_pools'>;
70
+ type CfLendingConfigResponse = RpcResponse<'cf_lending_config'>;
69
71
  type CfUnregisteredAccount = z.output<typeof unregistered>;
70
72
  type CfBrokerAccount = z.output<typeof broker>;
71
73
  type CfValidatorAccount = z.output<typeof validator>;
@@ -74,4 +76,4 @@ type CfOperatorAccount = z.output<typeof operator>;
74
76
  type LpTotalBalances = RpcResult<'lp_total_balances'>;
75
77
  type LpTotalBalancesResponse = RpcResponse<'lp_total_balances'>;
76
78
 
77
- export { type CfAccountInfo, type CfAccountInfoResponse, type CfAccounts, type CfAccountsResponse, type CfAuctionState, type CfAuctionStateResponse, type CfAvailablePools, type CfAvailablePoolsResponse, type CfBoostPoolDetails, type CfBoostPoolDetailsResponse, type CfBoostPoolPendingFees, type CfBoostPoolPendingFeesResponse, type CfBoostPoolsDepth, type CfBoostPoolsDepthResponse, type CfBrokerAccount, type CfEncodeCfParameters, type CfEncodeCfParametersResponse, type CfEnvironment, type CfEnvironmentResponse, type CfFailedCallArbitrum, type CfFailedCallArbitrumResponse, type CfFailedCallEthereum, type CfFailedCallEthereumResponse, type CfFlipSupply, type CfFlipSupplyResponse, type CfFundingEnvironment, type CfFundingEnvironmentResponse, type CfGetTradingStrategies, type CfGetTradingStrategiesResponse, type CfGetTradingStrategyLimits, type CfGetTradingStrategyLimitsResponse, type CfIngressEgressEnvironment, type CfIngressEgressEnvironmentResponse, type CfLendingPools, type CfLendingPoolsResponse, type CfLiquidityProviderAccount, type CfOperatorAccount, type CfOraclePrices, type CfOraclePricesResponse, 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 CfSafeModeStatuses, type CfSafeModeStatusesResponse, 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 };
79
+ export { type CfAccountInfo, type CfAccountInfoResponse, type CfAccounts, type CfAccountsResponse, type CfAuctionState, type CfAuctionStateResponse, type CfAvailablePools, type CfAvailablePoolsResponse, type CfBoostPoolDetails, type CfBoostPoolDetailsResponse, type CfBoostPoolPendingFees, type CfBoostPoolPendingFeesResponse, type CfBoostPoolsDepth, type CfBoostPoolsDepthResponse, type CfBrokerAccount, type CfEncodeCfParameters, type CfEncodeCfParametersResponse, type CfEnvironment, type CfEnvironmentResponse, type CfFailedCallArbitrum, type CfFailedCallArbitrumResponse, type CfFailedCallEthereum, type CfFailedCallEthereumResponse, type CfFlipSupply, type CfFlipSupplyResponse, type CfFundingEnvironment, type CfFundingEnvironmentResponse, type CfGetTradingStrategies, type CfGetTradingStrategiesResponse, type CfGetTradingStrategyLimits, type CfGetTradingStrategyLimitsResponse, type CfIngressEgressEnvironment, type CfIngressEgressEnvironmentResponse, type CfLendingConfig, type CfLendingConfigResponse, type CfLendingPools, type CfLendingPoolsResponse, type CfLiquidityProviderAccount, type CfOperatorAccount, type CfOraclePrices, type CfOraclePricesResponse, 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 CfSafeModeStatuses, type CfSafeModeStatusesResponse, 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,13 +1,13 @@
1
1
  {
2
2
  "name": "@chainflip/rpc",
3
- "version": "1.11.0-beta.13",
3
+ "version": "1.11.0-beta.15",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "@chainflip/utils": "0.8.18",
6
+ "@chainflip/utils": "0.11.0",
7
7
  "zod": "^3.25.75"
8
8
  },
9
9
  "devDependencies": {
10
- "@types/node": "^24.3.1",
10
+ "@types/node": "^24.5.2",
11
11
  "@types/ws": "^8.18.1",
12
12
  "ws": "^8.18.3"
13
13
  },