@chainflip/rpc 1.9.10 → 1.10.0

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
@@ -251,7 +251,9 @@ var validator = z.object({
251
251
  is_bidding: z.boolean(),
252
252
  bound_redeem_address: hexString.nullable(),
253
253
  apy_bp: z.number().nullable(),
254
- restricted_balances: z.record(hexString, numberOrHex)
254
+ restricted_balances: z.record(hexString, numberOrHex),
255
+ estimated_redeemable_balance: numberOrHex.optional()
256
+ // TODO(1.10): remove optional
255
257
  });
256
258
  var cfAccountInfo = z.discriminatedUnion("role", [
257
259
  unregistered,
@@ -364,12 +366,30 @@ var cfPoolOrderbook = z.object({
364
366
  var cfTradingStrategy = z.object({
365
367
  lp_id: z.string(),
366
368
  strategy_id: z.string(),
367
- strategy: z.object({
368
- TickZeroCentered: z.object({
369
- spread_tick: z.number(),
370
- base_asset: rpcAssetSchema
369
+ strategy: z.union([
370
+ z.object({
371
+ TickZeroCentered: z.object({
372
+ spread_tick: z.number(),
373
+ base_asset: rpcAssetSchema
374
+ })
375
+ }),
376
+ z.object({
377
+ SimpleBuySell: z.object({
378
+ buy_tick: z.number(),
379
+ sell_tick: z.number(),
380
+ base_asset: rpcAssetSchema
381
+ })
382
+ }),
383
+ z.object({
384
+ InventoryBased: z.object({
385
+ min_buy_tick: z.number(),
386
+ max_buy_tick: z.number(),
387
+ min_sell_tick: z.number(),
388
+ max_sell_tick: z.number(),
389
+ base_asset: rpcAssetSchema
390
+ })
371
391
  })
372
- }),
392
+ ]),
373
393
  balance: z.array(z.tuple([rpcAssetSchema, numberOrHex]))
374
394
  });
375
395
  var cfGetTradingStrategies = z.array(cfTradingStrategy).default([]);
package/dist/types.d.cts CHANGED
@@ -8,14 +8,18 @@ import '@chainflip/utils/types';
8
8
  type CfAccountInfo = RpcResult<'cf_account_info'>;
9
9
  type CfAccounts = RpcResult<'cf_accounts'>;
10
10
  type CfAuctionState = RpcResult<'cf_auction_state'>;
11
+ type CfAvailablePools = RpcResult<'cf_available_pools'>;
11
12
  type CfBoostPoolDetails = RpcResult<'cf_boost_pool_details'>;
12
13
  type CfBoostPoolPendingFees = RpcResult<'cf_boost_pool_pending_fees'>;
13
14
  type CfBoostPoolsDepth = RpcResult<'cf_boost_pools_depth'>;
15
+ type CfEncodeCfParameters = RpcResult<'cf_encode_cf_parameters'>;
14
16
  type CfEnvironment = RpcResult<'cf_environment'>;
15
17
  type CfFailedCallArbitrum = RpcResult<'cf_failed_call_arbitrum'>;
16
18
  type CfFailedCallEthereum = RpcResult<'cf_failed_call_ethereum'>;
17
19
  type CfFlipSupply = RpcResult<'cf_flip_supply'>;
18
20
  type CfFundingEnvironment = RpcResult<'cf_funding_environment'>;
21
+ type CfGetTradingStrategies = RpcResult<'cf_get_trading_strategies'>;
22
+ type CfGetTradingStrategyLimits = RpcResult<'cf_get_trading_strategy_limits'>;
19
23
  type CfIngressEgressEnvironment = RpcResult<'cf_ingress_egress_environment'>;
20
24
  type CfPoolDepth = RpcResult<'cf_pool_depth'>;
21
25
  type CfPoolOrderbook = RpcResult<'cf_pool_orderbook'>;
@@ -23,26 +27,27 @@ type CfPoolOrders = RpcResult<'cf_pool_orders'>;
23
27
  type CfPoolPriceV2 = RpcResult<'cf_pool_price_v2'>;
24
28
  type CfPoolsEnvironment = RpcResult<'cf_pools_environment'>;
25
29
  type CfRequestSwapParameterEncoding = RpcResult<'cf_request_swap_parameter_encoding'>;
30
+ type CfSafeModeStatuses = RpcResult<'cf_safe_mode_statuses'>;
26
31
  type CfSupportedAssets = RpcResult<'cf_supported_assets'>;
27
32
  type CfSwappingEnvironment = RpcResult<'cf_swapping_environment'>;
28
33
  type CfSwapRate = RpcResult<'cf_swap_rate'>;
29
34
  type CfSwapRateV2 = RpcResult<'cf_swap_rate_v2'>;
30
35
  type CfSwapRateV3 = RpcResult<'cf_swap_rate_v3'>;
31
- type CfGetTradingStrategies = RpcResult<'cf_get_trading_strategies'>;
32
- type CfGetTradingStrategyLimits = RpcResult<'cf_get_trading_strategy_limits'>;
33
- type CfAvailablePools = RpcResult<'cf_available_pools'>;
34
- type CfSafeModeStatuses = RpcResult<'cf_safe_mode_statuses'>;
35
36
  type CfAccountInfoResponse = RpcResponse<'cf_account_info'>;
36
37
  type CfAccountsResponse = RpcResponse<'cf_accounts'>;
37
38
  type CfAuctionStateResponse = RpcResponse<'cf_auction_state'>;
39
+ type CfAvailablePoolsResponse = RpcResponse<'cf_available_pools'>;
38
40
  type CfBoostPoolDetailsResponse = RpcResponse<'cf_boost_pool_details'>;
39
41
  type CfBoostPoolPendingFeesResponse = RpcResponse<'cf_boost_pool_pending_fees'>;
40
42
  type CfBoostPoolsDepthResponse = RpcResponse<'cf_boost_pools_depth'>;
43
+ type CfEncodeCfParametersResponse = RpcResponse<'cf_encode_cf_parameters'>;
41
44
  type CfEnvironmentResponse = RpcResponse<'cf_environment'>;
42
45
  type CfFailedCallArbitrumResponse = RpcResponse<'cf_failed_call_arbitrum'>;
43
46
  type CfFailedCallEthereumResponse = RpcResponse<'cf_failed_call_ethereum'>;
44
47
  type CfFlipSupplyResponse = RpcResponse<'cf_flip_supply'>;
45
48
  type CfFundingEnvironmentResponse = RpcResponse<'cf_funding_environment'>;
49
+ type CfGetTradingStrategiesResponse = RpcResponse<'cf_get_trading_strategies'>;
50
+ type CfGetTradingStrategyLimitsResponse = RpcResponse<'cf_get_trading_strategy_limits'>;
46
51
  type CfIngressEgressEnvironmentResponse = RpcResponse<'cf_ingress_egress_environment'>;
47
52
  type CfPoolDepthResponse = RpcResponse<'cf_pool_depth'>;
48
53
  type CfPoolOrderbookResponse = RpcResponse<'cf_pool_orderbook'>;
@@ -50,15 +55,12 @@ type CfPoolOrdersResponse = RpcResponse<'cf_pool_orders'>;
50
55
  type CfPoolPriceV2Response = RpcResponse<'cf_pool_price_v2'>;
51
56
  type CfPoolsEnvironmentResponse = RpcResponse<'cf_pools_environment'>;
52
57
  type CfRequestSwapParameterEncodingResponse = RpcResponse<'cf_request_swap_parameter_encoding'>;
58
+ type CfSafeModeStatusesResponse = RpcResponse<'cf_safe_mode_statuses'>;
53
59
  type CfSupportedAssetsResponse = RpcResponse<'cf_supported_assets'>;
54
60
  type CfSwappingEnvironmentResponse = RpcResponse<'cf_swapping_environment'>;
55
61
  type CfSwapRateResponse = RpcResponse<'cf_swap_rate'>;
56
62
  type CfSwapRateV2Response = RpcResponse<'cf_swap_rate_v2'>;
57
63
  type CfSwapRateV3Response = RpcResponse<'cf_swap_rate_v3'>;
58
- type CfGetTradingStrategiesResponse = RpcResponse<'cf_get_trading_strategies'>;
59
- type CfGetTradingStrategyLimitsResponse = RpcResponse<'cf_get_trading_strategy_limits'>;
60
- type CfAvailablePoolsResponse = RpcResponse<'cf_available_pools'>;
61
- type CfSafeModeStatusesResponse = RpcResponse<'cf_safe_mode_statuses'>;
62
64
  type CfUnregisteredAccount = z.output<typeof unregistered>;
63
65
  type CfBrokerAccount = z.output<typeof broker>;
64
66
  type CfValidatorAccount = z.output<typeof validator>;
@@ -66,4 +68,4 @@ type CfLiquidityProviderAccount = z.output<typeof liquidityProvider>;
66
68
  type LpTotalBalances = RpcResult<'lp_total_balances'>;
67
69
  type LpTotalBalancesResponse = RpcResponse<'lp_total_balances'>;
68
70
 
69
- 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 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 CfLiquidityProviderAccount, 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 };
71
+ 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 CfLiquidityProviderAccount, 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
@@ -8,14 +8,18 @@ import '@chainflip/utils/types';
8
8
  type CfAccountInfo = RpcResult<'cf_account_info'>;
9
9
  type CfAccounts = RpcResult<'cf_accounts'>;
10
10
  type CfAuctionState = RpcResult<'cf_auction_state'>;
11
+ type CfAvailablePools = RpcResult<'cf_available_pools'>;
11
12
  type CfBoostPoolDetails = RpcResult<'cf_boost_pool_details'>;
12
13
  type CfBoostPoolPendingFees = RpcResult<'cf_boost_pool_pending_fees'>;
13
14
  type CfBoostPoolsDepth = RpcResult<'cf_boost_pools_depth'>;
15
+ type CfEncodeCfParameters = RpcResult<'cf_encode_cf_parameters'>;
14
16
  type CfEnvironment = RpcResult<'cf_environment'>;
15
17
  type CfFailedCallArbitrum = RpcResult<'cf_failed_call_arbitrum'>;
16
18
  type CfFailedCallEthereum = RpcResult<'cf_failed_call_ethereum'>;
17
19
  type CfFlipSupply = RpcResult<'cf_flip_supply'>;
18
20
  type CfFundingEnvironment = RpcResult<'cf_funding_environment'>;
21
+ type CfGetTradingStrategies = RpcResult<'cf_get_trading_strategies'>;
22
+ type CfGetTradingStrategyLimits = RpcResult<'cf_get_trading_strategy_limits'>;
19
23
  type CfIngressEgressEnvironment = RpcResult<'cf_ingress_egress_environment'>;
20
24
  type CfPoolDepth = RpcResult<'cf_pool_depth'>;
21
25
  type CfPoolOrderbook = RpcResult<'cf_pool_orderbook'>;
@@ -23,26 +27,27 @@ type CfPoolOrders = RpcResult<'cf_pool_orders'>;
23
27
  type CfPoolPriceV2 = RpcResult<'cf_pool_price_v2'>;
24
28
  type CfPoolsEnvironment = RpcResult<'cf_pools_environment'>;
25
29
  type CfRequestSwapParameterEncoding = RpcResult<'cf_request_swap_parameter_encoding'>;
30
+ type CfSafeModeStatuses = RpcResult<'cf_safe_mode_statuses'>;
26
31
  type CfSupportedAssets = RpcResult<'cf_supported_assets'>;
27
32
  type CfSwappingEnvironment = RpcResult<'cf_swapping_environment'>;
28
33
  type CfSwapRate = RpcResult<'cf_swap_rate'>;
29
34
  type CfSwapRateV2 = RpcResult<'cf_swap_rate_v2'>;
30
35
  type CfSwapRateV3 = RpcResult<'cf_swap_rate_v3'>;
31
- type CfGetTradingStrategies = RpcResult<'cf_get_trading_strategies'>;
32
- type CfGetTradingStrategyLimits = RpcResult<'cf_get_trading_strategy_limits'>;
33
- type CfAvailablePools = RpcResult<'cf_available_pools'>;
34
- type CfSafeModeStatuses = RpcResult<'cf_safe_mode_statuses'>;
35
36
  type CfAccountInfoResponse = RpcResponse<'cf_account_info'>;
36
37
  type CfAccountsResponse = RpcResponse<'cf_accounts'>;
37
38
  type CfAuctionStateResponse = RpcResponse<'cf_auction_state'>;
39
+ type CfAvailablePoolsResponse = RpcResponse<'cf_available_pools'>;
38
40
  type CfBoostPoolDetailsResponse = RpcResponse<'cf_boost_pool_details'>;
39
41
  type CfBoostPoolPendingFeesResponse = RpcResponse<'cf_boost_pool_pending_fees'>;
40
42
  type CfBoostPoolsDepthResponse = RpcResponse<'cf_boost_pools_depth'>;
43
+ type CfEncodeCfParametersResponse = RpcResponse<'cf_encode_cf_parameters'>;
41
44
  type CfEnvironmentResponse = RpcResponse<'cf_environment'>;
42
45
  type CfFailedCallArbitrumResponse = RpcResponse<'cf_failed_call_arbitrum'>;
43
46
  type CfFailedCallEthereumResponse = RpcResponse<'cf_failed_call_ethereum'>;
44
47
  type CfFlipSupplyResponse = RpcResponse<'cf_flip_supply'>;
45
48
  type CfFundingEnvironmentResponse = RpcResponse<'cf_funding_environment'>;
49
+ type CfGetTradingStrategiesResponse = RpcResponse<'cf_get_trading_strategies'>;
50
+ type CfGetTradingStrategyLimitsResponse = RpcResponse<'cf_get_trading_strategy_limits'>;
46
51
  type CfIngressEgressEnvironmentResponse = RpcResponse<'cf_ingress_egress_environment'>;
47
52
  type CfPoolDepthResponse = RpcResponse<'cf_pool_depth'>;
48
53
  type CfPoolOrderbookResponse = RpcResponse<'cf_pool_orderbook'>;
@@ -50,15 +55,12 @@ type CfPoolOrdersResponse = RpcResponse<'cf_pool_orders'>;
50
55
  type CfPoolPriceV2Response = RpcResponse<'cf_pool_price_v2'>;
51
56
  type CfPoolsEnvironmentResponse = RpcResponse<'cf_pools_environment'>;
52
57
  type CfRequestSwapParameterEncodingResponse = RpcResponse<'cf_request_swap_parameter_encoding'>;
58
+ type CfSafeModeStatusesResponse = RpcResponse<'cf_safe_mode_statuses'>;
53
59
  type CfSupportedAssetsResponse = RpcResponse<'cf_supported_assets'>;
54
60
  type CfSwappingEnvironmentResponse = RpcResponse<'cf_swapping_environment'>;
55
61
  type CfSwapRateResponse = RpcResponse<'cf_swap_rate'>;
56
62
  type CfSwapRateV2Response = RpcResponse<'cf_swap_rate_v2'>;
57
63
  type CfSwapRateV3Response = RpcResponse<'cf_swap_rate_v3'>;
58
- type CfGetTradingStrategiesResponse = RpcResponse<'cf_get_trading_strategies'>;
59
- type CfGetTradingStrategyLimitsResponse = RpcResponse<'cf_get_trading_strategy_limits'>;
60
- type CfAvailablePoolsResponse = RpcResponse<'cf_available_pools'>;
61
- type CfSafeModeStatusesResponse = RpcResponse<'cf_safe_mode_statuses'>;
62
64
  type CfUnregisteredAccount = z.output<typeof unregistered>;
63
65
  type CfBrokerAccount = z.output<typeof broker>;
64
66
  type CfValidatorAccount = z.output<typeof validator>;
@@ -66,4 +68,4 @@ type CfLiquidityProviderAccount = z.output<typeof liquidityProvider>;
66
68
  type LpTotalBalances = RpcResult<'lp_total_balances'>;
67
69
  type LpTotalBalancesResponse = RpcResponse<'lp_total_balances'>;
68
70
 
69
- 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 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 CfLiquidityProviderAccount, 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 };
71
+ 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 CfLiquidityProviderAccount, 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,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainflip/rpc",
3
- "version": "1.9.10",
3
+ "version": "1.10.0",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@chainflip/utils": "0.8.6",