@chainflip/rpc 1.11.0-beta.1 → 1.11.0-beta.3
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.d.cts +1 -0
- package/dist/Client.d.ts +1 -0
- package/dist/HttpClient.d.cts +1 -0
- package/dist/HttpClient.d.ts +1 -0
- package/dist/WsClient.d.cts +1 -0
- package/dist/WsClient.d.ts +1 -0
- package/dist/common.cjs +3 -1
- package/dist/common.d.cts +227 -203
- package/dist/common.d.ts +227 -203
- package/dist/common.mjs +4 -2
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/parsers.cjs +17 -12
- package/dist/parsers.d.cts +235 -210
- package/dist/parsers.d.ts +235 -210
- package/dist/parsers.mjs +16 -11
- package/dist/types.d.cts +4 -1
- package/dist/types.d.ts +4 -1
- package/package.json +2 -2
package/dist/parsers.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// src/parsers.ts
|
|
2
|
+
import { priceAssets } from "@chainflip/utils/chainflip";
|
|
2
3
|
import { isUndefined } from "@chainflip/utils/guard";
|
|
3
4
|
import { isHex } from "@chainflip/utils/string";
|
|
4
5
|
import { z } from "zod";
|
|
@@ -113,8 +114,7 @@ var cfSwappingEnvironment = z.object({
|
|
|
113
114
|
max_swap_retry_duration_blocks: z.number().optional(),
|
|
114
115
|
max_swap_request_duration_blocks: z.number().optional(),
|
|
115
116
|
minimum_chunk_size: chainAssetMapFactory(numberOrHex.nullable(), null).optional(),
|
|
116
|
-
network_fees: networkFees
|
|
117
|
-
// TODO(1.10): remove optional
|
|
117
|
+
network_fees: networkFees
|
|
118
118
|
});
|
|
119
119
|
var cfFundingEnvironment = z.object({
|
|
120
120
|
redemption_tax: numberOrHex,
|
|
@@ -221,12 +221,13 @@ var broker = z.object({
|
|
|
221
221
|
).optional().default([])
|
|
222
222
|
});
|
|
223
223
|
var operator = z.object({
|
|
224
|
+
flip_balance: numberOrHex,
|
|
224
225
|
role: z.literal("operator"),
|
|
225
226
|
managed_validators: z.record(z.string(), numberOrHex),
|
|
226
227
|
delegators: z.record(z.string(), numberOrHex),
|
|
227
228
|
settings: z.object({
|
|
228
229
|
fee_bps: z.number(),
|
|
229
|
-
delegation_acceptance: z.
|
|
230
|
+
delegation_acceptance: z.enum(["Allow", "Deny"])
|
|
230
231
|
}),
|
|
231
232
|
allowed: z.array(z.string()).optional().default([]),
|
|
232
233
|
blocked: z.array(z.string()).optional().default([])
|
|
@@ -263,8 +264,7 @@ var validator = z.object({
|
|
|
263
264
|
bound_redeem_address: hexString.nullable(),
|
|
264
265
|
apy_bp: z.number().nullable(),
|
|
265
266
|
restricted_balances: z.record(hexString, numberOrHex),
|
|
266
|
-
estimated_redeemable_balance: numberOrHex
|
|
267
|
-
// TODO(1.10): remove optional
|
|
267
|
+
estimated_redeemable_balance: numberOrHex
|
|
268
268
|
});
|
|
269
269
|
var cfAccountInfo = z.discriminatedUnion("role", [
|
|
270
270
|
unregistered,
|
|
@@ -365,8 +365,7 @@ var cfAuctionState = z.object({
|
|
|
365
365
|
min_funding: numberOrHex,
|
|
366
366
|
auction_size_range: range(z.number()),
|
|
367
367
|
min_active_bid: numberOrHex,
|
|
368
|
-
min_bid: numberOrHex
|
|
369
|
-
// TODO(1.10): remove optional
|
|
368
|
+
min_bid: numberOrHex
|
|
370
369
|
}).transform(rename({ epoch_duration: "epoch_duration_blocks" }));
|
|
371
370
|
var cfFlipSuppy = range(numberOrHex).transform(([totalIssuance, offchainFunds]) => ({
|
|
372
371
|
totalIssuance,
|
|
@@ -419,6 +418,15 @@ var cfAvailablePools = z.array(
|
|
|
419
418
|
quote: z.object({ chain: z.literal("Ethereum"), asset: z.literal("USDC") })
|
|
420
419
|
})
|
|
421
420
|
);
|
|
421
|
+
var cfOraclePrices = z.array(
|
|
422
|
+
z.object({
|
|
423
|
+
price: numberOrHex,
|
|
424
|
+
updated_at_oracle_timestamp: z.number(),
|
|
425
|
+
updated_at_statechain_block: z.number(),
|
|
426
|
+
base_asset: z.enum(priceAssets),
|
|
427
|
+
quote_asset: z.enum(priceAssets)
|
|
428
|
+
})
|
|
429
|
+
);
|
|
422
430
|
var broadcastPalletSafeModeStatuses = z.object({
|
|
423
431
|
retry_enabled: z.boolean(),
|
|
424
432
|
// TODO(1.10): make not optional
|
|
@@ -460,10 +468,6 @@ var cfSafeModeStatusesBase = z.object({
|
|
|
460
468
|
strategy_updates_enabled: z.boolean(),
|
|
461
469
|
strategy_closure_enabled: z.boolean(),
|
|
462
470
|
strategy_execution_enabled: z.boolean()
|
|
463
|
-
}).optional().default({
|
|
464
|
-
strategy_updates_enabled: false,
|
|
465
|
-
strategy_closure_enabled: false,
|
|
466
|
-
strategy_execution_enabled: false
|
|
467
471
|
}),
|
|
468
472
|
reputation: z.object({
|
|
469
473
|
reporting_enabled: z.boolean()
|
|
@@ -560,6 +564,7 @@ export {
|
|
|
560
564
|
cfGetTradingStrategies,
|
|
561
565
|
cfGetTradingStrategyLimits,
|
|
562
566
|
cfIngressEgressEnvironment,
|
|
567
|
+
cfOraclePrices,
|
|
563
568
|
cfPoolDepth,
|
|
564
569
|
cfPoolOrderbook,
|
|
565
570
|
cfPoolOrders,
|
package/dist/types.d.cts
CHANGED
|
@@ -3,6 +3,7 @@ import { RpcResult, RpcResponse } from './common.cjs';
|
|
|
3
3
|
export { RpcMethod, RpcRequest as RpcParams } from './common.cjs';
|
|
4
4
|
import { unregistered, broker, validator, liquidityProvider, operator } from './parsers.cjs';
|
|
5
5
|
export { RpcLimitOrder, RpcRangeOrder } from './parsers.cjs';
|
|
6
|
+
import '@chainflip/utils/chainflip';
|
|
6
7
|
import '@chainflip/utils/types';
|
|
7
8
|
|
|
8
9
|
type CfAccountInfo = RpcResult<'cf_account_info'>;
|
|
@@ -33,6 +34,7 @@ type CfSwappingEnvironment = RpcResult<'cf_swapping_environment'>;
|
|
|
33
34
|
type CfSwapRate = RpcResult<'cf_swap_rate'>;
|
|
34
35
|
type CfSwapRateV2 = RpcResult<'cf_swap_rate_v2'>;
|
|
35
36
|
type CfSwapRateV3 = RpcResult<'cf_swap_rate_v3'>;
|
|
37
|
+
type CfOraclePrices = RpcResult<'cf_oracle_prices'>;
|
|
36
38
|
type CfAccountInfoResponse = RpcResponse<'cf_account_info'>;
|
|
37
39
|
type CfAccountsResponse = RpcResponse<'cf_accounts'>;
|
|
38
40
|
type CfAuctionStateResponse = RpcResponse<'cf_auction_state'>;
|
|
@@ -61,6 +63,7 @@ type CfSwappingEnvironmentResponse = RpcResponse<'cf_swapping_environment'>;
|
|
|
61
63
|
type CfSwapRateResponse = RpcResponse<'cf_swap_rate'>;
|
|
62
64
|
type CfSwapRateV2Response = RpcResponse<'cf_swap_rate_v2'>;
|
|
63
65
|
type CfSwapRateV3Response = RpcResponse<'cf_swap_rate_v3'>;
|
|
66
|
+
type CfOraclePricesResponse = RpcResponse<'cf_oracle_prices'>;
|
|
64
67
|
type CfUnregisteredAccount = z.output<typeof unregistered>;
|
|
65
68
|
type CfBrokerAccount = z.output<typeof broker>;
|
|
66
69
|
type CfValidatorAccount = z.output<typeof validator>;
|
|
@@ -69,4 +72,4 @@ type CfOperatorAccount = z.output<typeof operator>;
|
|
|
69
72
|
type LpTotalBalances = RpcResult<'lp_total_balances'>;
|
|
70
73
|
type LpTotalBalancesResponse = RpcResponse<'lp_total_balances'>;
|
|
71
74
|
|
|
72
|
-
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 CfOperatorAccount, 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 };
|
|
75
|
+
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 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
|
@@ -3,6 +3,7 @@ import { RpcResult, RpcResponse } from './common.js';
|
|
|
3
3
|
export { RpcMethod, RpcRequest as RpcParams } from './common.js';
|
|
4
4
|
import { unregistered, broker, validator, liquidityProvider, operator } from './parsers.js';
|
|
5
5
|
export { RpcLimitOrder, RpcRangeOrder } from './parsers.js';
|
|
6
|
+
import '@chainflip/utils/chainflip';
|
|
6
7
|
import '@chainflip/utils/types';
|
|
7
8
|
|
|
8
9
|
type CfAccountInfo = RpcResult<'cf_account_info'>;
|
|
@@ -33,6 +34,7 @@ type CfSwappingEnvironment = RpcResult<'cf_swapping_environment'>;
|
|
|
33
34
|
type CfSwapRate = RpcResult<'cf_swap_rate'>;
|
|
34
35
|
type CfSwapRateV2 = RpcResult<'cf_swap_rate_v2'>;
|
|
35
36
|
type CfSwapRateV3 = RpcResult<'cf_swap_rate_v3'>;
|
|
37
|
+
type CfOraclePrices = RpcResult<'cf_oracle_prices'>;
|
|
36
38
|
type CfAccountInfoResponse = RpcResponse<'cf_account_info'>;
|
|
37
39
|
type CfAccountsResponse = RpcResponse<'cf_accounts'>;
|
|
38
40
|
type CfAuctionStateResponse = RpcResponse<'cf_auction_state'>;
|
|
@@ -61,6 +63,7 @@ type CfSwappingEnvironmentResponse = RpcResponse<'cf_swapping_environment'>;
|
|
|
61
63
|
type CfSwapRateResponse = RpcResponse<'cf_swap_rate'>;
|
|
62
64
|
type CfSwapRateV2Response = RpcResponse<'cf_swap_rate_v2'>;
|
|
63
65
|
type CfSwapRateV3Response = RpcResponse<'cf_swap_rate_v3'>;
|
|
66
|
+
type CfOraclePricesResponse = RpcResponse<'cf_oracle_prices'>;
|
|
64
67
|
type CfUnregisteredAccount = z.output<typeof unregistered>;
|
|
65
68
|
type CfBrokerAccount = z.output<typeof broker>;
|
|
66
69
|
type CfValidatorAccount = z.output<typeof validator>;
|
|
@@ -69,4 +72,4 @@ type CfOperatorAccount = z.output<typeof operator>;
|
|
|
69
72
|
type LpTotalBalances = RpcResult<'lp_total_balances'>;
|
|
70
73
|
type LpTotalBalancesResponse = RpcResponse<'lp_total_balances'>;
|
|
71
74
|
|
|
72
|
-
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 CfOperatorAccount, 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 };
|
|
75
|
+
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 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