@chainflip/rpc 1.11.0 → 1.11.2
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/common.cjs +2 -0
- package/dist/common.d.cts +337 -1918
- package/dist/common.d.ts +337 -1918
- package/dist/common.mjs +3 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/parsers.cjs +20 -59
- package/dist/parsers.d.cts +2814 -11405
- package/dist/parsers.d.ts +2814 -11405
- package/dist/parsers.mjs +20 -59
- package/dist/types.d.cts +3 -1
- package/dist/types.d.ts +3 -1
- package/package.json +1 -1
package/dist/parsers.mjs
CHANGED
|
@@ -222,23 +222,10 @@ var accountInfoCommon = {
|
|
|
222
222
|
current_delegation_status: delegationStatus.optional(),
|
|
223
223
|
upcoming_delegation_status: delegationStatus.optional()
|
|
224
224
|
};
|
|
225
|
-
var oldUnregistered = z.object({
|
|
226
|
-
role: z.literal("unregistered"),
|
|
227
|
-
flip_balance: numberOrHex,
|
|
228
|
-
asset_balances: chainAssetMapFactory(numberOrHex, 0)
|
|
229
|
-
});
|
|
230
225
|
var unregistered = z.object({
|
|
231
226
|
role: z.literal("unregistered"),
|
|
232
227
|
...accountInfoCommon
|
|
233
228
|
});
|
|
234
|
-
var oldBroker = z.object({
|
|
235
|
-
role: z.literal("broker"),
|
|
236
|
-
bond: numberOrHex,
|
|
237
|
-
flip_balance: numberOrHex,
|
|
238
|
-
earned_fees: chainAssetMapFactory(numberOrHex, 0),
|
|
239
|
-
btc_vault_deposit_address: z.string().nullable().optional(),
|
|
240
|
-
affiliates: z.array(z.object({ account_id: accountId, short_id: z.number(), withdrawal_address: hexString })).optional().default([])
|
|
241
|
-
});
|
|
242
229
|
var broker = z.object({
|
|
243
230
|
role: z.literal("broker"),
|
|
244
231
|
...accountInfoCommon,
|
|
@@ -273,14 +260,6 @@ var boostBalances = z.array(
|
|
|
273
260
|
is_withdrawing: z.boolean()
|
|
274
261
|
})
|
|
275
262
|
);
|
|
276
|
-
var oldLiquidityProvider = z.object({
|
|
277
|
-
role: z.literal("liquidity_provider"),
|
|
278
|
-
balances: chainAssetMapFactory(numberOrHex, "0x0"),
|
|
279
|
-
refund_addresses: chainMapFactory(z.string().nullable(), null),
|
|
280
|
-
flip_balance: numberOrHex,
|
|
281
|
-
earned_fees: chainAssetMapFactory(numberOrHex, 0),
|
|
282
|
-
boost_balances: chainAssetMapFactory(boostBalances, [])
|
|
283
|
-
});
|
|
284
263
|
var liquidityProvider = z.object({
|
|
285
264
|
role: z.literal("liquidity_provider"),
|
|
286
265
|
...accountInfoCommon,
|
|
@@ -305,24 +284,6 @@ var liquidityProvider = z.object({
|
|
|
305
284
|
)
|
|
306
285
|
).optional()
|
|
307
286
|
});
|
|
308
|
-
var oldValidator = z.object({
|
|
309
|
-
role: z.literal("validator"),
|
|
310
|
-
flip_balance: numberOrHex,
|
|
311
|
-
bond: numberOrHex,
|
|
312
|
-
last_heartbeat: z.number(),
|
|
313
|
-
reputation_points: z.number(),
|
|
314
|
-
keyholder_epochs: z.array(z.number()),
|
|
315
|
-
is_current_authority: z.boolean(),
|
|
316
|
-
is_current_backup: z.boolean(),
|
|
317
|
-
is_qualified: z.boolean(),
|
|
318
|
-
is_online: z.boolean(),
|
|
319
|
-
is_bidding: z.boolean(),
|
|
320
|
-
bound_redeem_address: hexString.nullable(),
|
|
321
|
-
apy_bp: z.number().nullable(),
|
|
322
|
-
restricted_balances: z.record(hexString, numberOrHex),
|
|
323
|
-
estimated_redeemable_balance: numberOrHex,
|
|
324
|
-
operator: accountId.optional()
|
|
325
|
-
});
|
|
326
287
|
var validator = z.object({
|
|
327
288
|
role: z.literal("validator"),
|
|
328
289
|
...accountInfoCommon,
|
|
@@ -337,11 +298,12 @@ var validator = z.object({
|
|
|
337
298
|
apy_bp: z.number().nullable(),
|
|
338
299
|
operator: accountId.optional()
|
|
339
300
|
});
|
|
340
|
-
var
|
|
301
|
+
var cfAccountInfo = z.discriminatedUnion("role", [unregistered, broker, operator, liquidityProvider, validator]).transform((account) => {
|
|
341
302
|
switch (account.role) {
|
|
342
303
|
case "broker":
|
|
343
304
|
case "validator":
|
|
344
305
|
case "unregistered":
|
|
306
|
+
case "liquidity_provider":
|
|
345
307
|
return account;
|
|
346
308
|
case "operator": {
|
|
347
309
|
const { managed_validators, delegators, settings, ...rest } = account;
|
|
@@ -355,21 +317,8 @@ var newCfAccountInfo = z.discriminatedUnion("role", [unregistered, broker, opera
|
|
|
355
317
|
}
|
|
356
318
|
};
|
|
357
319
|
}
|
|
358
|
-
// TODO(1.11): remove after all networks upgraded
|
|
359
|
-
case "liquidity_provider":
|
|
360
|
-
return {
|
|
361
|
-
...account,
|
|
362
|
-
balances: account.asset_balances
|
|
363
|
-
};
|
|
364
320
|
}
|
|
365
321
|
});
|
|
366
|
-
var oldCfAccountInfo = z.discriminatedUnion("role", [
|
|
367
|
-
oldUnregistered,
|
|
368
|
-
oldBroker,
|
|
369
|
-
oldLiquidityProvider,
|
|
370
|
-
oldValidator
|
|
371
|
-
]);
|
|
372
|
-
var cfAccountInfo = z.union([newCfAccountInfo, oldCfAccountInfo]);
|
|
373
322
|
var cfAccounts = z.array(z.tuple([z.string(), z.string()]));
|
|
374
323
|
var cfPoolPriceV2 = z.object({
|
|
375
324
|
sell: numberOrHex.nullable(),
|
|
@@ -464,6 +413,23 @@ var cfAuctionState = z.object({
|
|
|
464
413
|
min_active_bid: numberOrHex.nullable(),
|
|
465
414
|
min_bid: numberOrHex
|
|
466
415
|
}).transform(rename({ epoch_duration: "epoch_duration_blocks" }));
|
|
416
|
+
var cfMonitoringSimulateAuction = z.object({
|
|
417
|
+
auction_outcome: z.object({
|
|
418
|
+
winners: z.array(accountId),
|
|
419
|
+
bond: numberOrHex
|
|
420
|
+
}),
|
|
421
|
+
operators_info: z.record(
|
|
422
|
+
accountId,
|
|
423
|
+
z.object({
|
|
424
|
+
operator: accountId,
|
|
425
|
+
validators: z.record(accountId, numberOrHex),
|
|
426
|
+
delegators: z.record(accountId, numberOrHex),
|
|
427
|
+
delegation_fee_bps: z.number()
|
|
428
|
+
})
|
|
429
|
+
),
|
|
430
|
+
new_validators: z.array(accountId),
|
|
431
|
+
current_mab: numberOrHex
|
|
432
|
+
});
|
|
467
433
|
var cfFlipSuppy = range(numberOrHex).transform(([totalIssuance, offchainFunds]) => ({
|
|
468
434
|
totalIssuance,
|
|
469
435
|
offchainFunds
|
|
@@ -737,6 +703,7 @@ export {
|
|
|
737
703
|
cfLendingPools,
|
|
738
704
|
cfLoanAccount,
|
|
739
705
|
cfLoanAccounts,
|
|
706
|
+
cfMonitoringSimulateAuction,
|
|
740
707
|
cfOraclePrices,
|
|
741
708
|
cfPoolDepth,
|
|
742
709
|
cfPoolOrderbook,
|
|
@@ -755,14 +722,8 @@ export {
|
|
|
755
722
|
hexString,
|
|
756
723
|
liquidityProvider,
|
|
757
724
|
lpTotalBalances,
|
|
758
|
-
newCfAccountInfo,
|
|
759
725
|
numberOrHex,
|
|
760
726
|
numericString,
|
|
761
|
-
oldBroker,
|
|
762
|
-
oldCfAccountInfo,
|
|
763
|
-
oldLiquidityProvider,
|
|
764
|
-
oldUnregistered,
|
|
765
|
-
oldValidator,
|
|
766
727
|
operator,
|
|
767
728
|
requestSwapParameterEncoding,
|
|
768
729
|
rpcResponse,
|
package/dist/types.d.cts
CHANGED
|
@@ -9,6 +9,7 @@ import '@chainflip/utils/types';
|
|
|
9
9
|
type CfAccountInfo = RpcResult<'cf_account_info'>;
|
|
10
10
|
type CfAccounts = RpcResult<'cf_accounts'>;
|
|
11
11
|
type CfAuctionState = RpcResult<'cf_auction_state'>;
|
|
12
|
+
type CfMonitoringSimulateAuction = RpcResult<'cf_monitoring_simulate_auction'>;
|
|
12
13
|
type CfAvailablePools = RpcResult<'cf_available_pools'>;
|
|
13
14
|
type CfBoostPoolDetails = RpcResult<'cf_boost_pool_details'>;
|
|
14
15
|
type CfBoostPoolPendingFees = RpcResult<'cf_boost_pool_pending_fees'>;
|
|
@@ -41,6 +42,7 @@ type CfLoanAccounts = RpcResult<'cf_loan_accounts'>;
|
|
|
41
42
|
type CfAccountInfoResponse = RpcResponse<'cf_account_info'>;
|
|
42
43
|
type CfAccountsResponse = RpcResponse<'cf_accounts'>;
|
|
43
44
|
type CfAuctionStateResponse = RpcResponse<'cf_auction_state'>;
|
|
45
|
+
type CfMonitoringSimulateAuctionResponse = RpcResponse<'cf_monitoring_simulate_auction'>;
|
|
44
46
|
type CfAvailablePoolsResponse = RpcResponse<'cf_available_pools'>;
|
|
45
47
|
type CfBoostPoolDetailsResponse = RpcResponse<'cf_boost_pool_details'>;
|
|
46
48
|
type CfBoostPoolPendingFeesResponse = RpcResponse<'cf_boost_pool_pending_fees'>;
|
|
@@ -78,4 +80,4 @@ type CfOperatorAccount = z.output<typeof operator>;
|
|
|
78
80
|
type LpTotalBalances = RpcResult<'lp_total_balances'>;
|
|
79
81
|
type LpTotalBalancesResponse = RpcResponse<'lp_total_balances'>;
|
|
80
82
|
|
|
81
|
-
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 CfLoanAccounts, type CfLoanAccountsResponse, 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 };
|
|
83
|
+
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 CfLoanAccounts, type CfLoanAccountsResponse, type CfMonitoringSimulateAuction, type CfMonitoringSimulateAuctionResponse, 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
|
@@ -9,6 +9,7 @@ import '@chainflip/utils/types';
|
|
|
9
9
|
type CfAccountInfo = RpcResult<'cf_account_info'>;
|
|
10
10
|
type CfAccounts = RpcResult<'cf_accounts'>;
|
|
11
11
|
type CfAuctionState = RpcResult<'cf_auction_state'>;
|
|
12
|
+
type CfMonitoringSimulateAuction = RpcResult<'cf_monitoring_simulate_auction'>;
|
|
12
13
|
type CfAvailablePools = RpcResult<'cf_available_pools'>;
|
|
13
14
|
type CfBoostPoolDetails = RpcResult<'cf_boost_pool_details'>;
|
|
14
15
|
type CfBoostPoolPendingFees = RpcResult<'cf_boost_pool_pending_fees'>;
|
|
@@ -41,6 +42,7 @@ type CfLoanAccounts = RpcResult<'cf_loan_accounts'>;
|
|
|
41
42
|
type CfAccountInfoResponse = RpcResponse<'cf_account_info'>;
|
|
42
43
|
type CfAccountsResponse = RpcResponse<'cf_accounts'>;
|
|
43
44
|
type CfAuctionStateResponse = RpcResponse<'cf_auction_state'>;
|
|
45
|
+
type CfMonitoringSimulateAuctionResponse = RpcResponse<'cf_monitoring_simulate_auction'>;
|
|
44
46
|
type CfAvailablePoolsResponse = RpcResponse<'cf_available_pools'>;
|
|
45
47
|
type CfBoostPoolDetailsResponse = RpcResponse<'cf_boost_pool_details'>;
|
|
46
48
|
type CfBoostPoolPendingFeesResponse = RpcResponse<'cf_boost_pool_pending_fees'>;
|
|
@@ -78,4 +80,4 @@ type CfOperatorAccount = z.output<typeof operator>;
|
|
|
78
80
|
type LpTotalBalances = RpcResult<'lp_total_balances'>;
|
|
79
81
|
type LpTotalBalancesResponse = RpcResponse<'lp_total_balances'>;
|
|
80
82
|
|
|
81
|
-
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 CfLoanAccounts, type CfLoanAccountsResponse, 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 };
|
|
83
|
+
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 CfLoanAccounts, type CfLoanAccountsResponse, type CfMonitoringSimulateAuction, type CfMonitoringSimulateAuctionResponse, 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 };
|