@chainflip/rpc 1.9.9 → 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/common.cjs +4 -1
- package/dist/common.d.cts +3448 -760
- package/dist/common.d.ts +3448 -760
- package/dist/common.mjs +5 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/parsers.cjs +114 -49
- package/dist/parsers.d.cts +4418 -953
- package/dist/parsers.d.ts +4418 -953
- package/dist/parsers.mjs +114 -49
- package/dist/types.d.cts +11 -9
- package/dist/types.d.ts +11 -9
- package/package.json +2 -2
package/dist/common.mjs
CHANGED
|
@@ -33,7 +33,8 @@ import {
|
|
|
33
33
|
cfGetTradingStrategies,
|
|
34
34
|
cfAvailablePools,
|
|
35
35
|
cfSafeModeStatuses,
|
|
36
|
-
cfGetTradingStrategyLimits
|
|
36
|
+
cfGetTradingStrategyLimits,
|
|
37
|
+
hexString
|
|
37
38
|
} from "./parsers.mjs";
|
|
38
39
|
import { rpcResponse } from "./parsers.mjs";
|
|
39
40
|
var rpcResult = {
|
|
@@ -73,7 +74,9 @@ var rpcResult = {
|
|
|
73
74
|
cf_get_trading_strategies: cfGetTradingStrategies,
|
|
74
75
|
cf_get_trading_strategy_limits: cfGetTradingStrategyLimits,
|
|
75
76
|
cf_available_pools: cfAvailablePools,
|
|
76
|
-
cf_safe_mode_statuses: cfSafeModeStatuses
|
|
77
|
+
cf_safe_mode_statuses: cfSafeModeStatuses,
|
|
78
|
+
broker_encode_cf_parameters: hexString,
|
|
79
|
+
cf_encode_cf_parameters: hexString
|
|
77
80
|
};
|
|
78
81
|
export {
|
|
79
82
|
rpcResponse,
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as HttpClient } from './HttpClient.cjs';
|
|
2
2
|
export { default as WsClient } from './WsClient.cjs';
|
|
3
|
-
export { CfAccountInfo, CfAccountInfoResponse, CfAccounts, CfAccountsResponse, CfAuctionState, CfAuctionStateResponse, CfAvailablePools, CfAvailablePoolsResponse, CfBoostPoolDetails, CfBoostPoolDetailsResponse, CfBoostPoolPendingFees, CfBoostPoolPendingFeesResponse, CfBoostPoolsDepth, CfBoostPoolsDepthResponse, CfBrokerAccount, CfEnvironment, CfEnvironmentResponse, CfFailedCallArbitrum, CfFailedCallArbitrumResponse, CfFailedCallEthereum, CfFailedCallEthereumResponse, CfFlipSupply, CfFlipSupplyResponse, CfFundingEnvironment, CfFundingEnvironmentResponse, CfGetTradingStrategies, CfGetTradingStrategiesResponse, CfGetTradingStrategyLimits, CfGetTradingStrategyLimitsResponse, CfIngressEgressEnvironment, CfIngressEgressEnvironmentResponse, CfLiquidityProviderAccount, 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, LpTotalBalances, LpTotalBalancesResponse } from './types.cjs';
|
|
3
|
+
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, CfLiquidityProviderAccount, 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, LpTotalBalances, LpTotalBalancesResponse } from './types.cjs';
|
|
4
4
|
export { c as constants } from './constants-jLrn-AnI.cjs';
|
|
5
5
|
export { RpcLimitOrder, RpcRangeOrder } from './parsers.cjs';
|
|
6
6
|
export { RpcMethod, RpcRequest as RpcParams, RpcResult } from './common.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { default as HttpClient } from './HttpClient.js';
|
|
2
2
|
export { default as WsClient } from './WsClient.js';
|
|
3
|
-
export { CfAccountInfo, CfAccountInfoResponse, CfAccounts, CfAccountsResponse, CfAuctionState, CfAuctionStateResponse, CfAvailablePools, CfAvailablePoolsResponse, CfBoostPoolDetails, CfBoostPoolDetailsResponse, CfBoostPoolPendingFees, CfBoostPoolPendingFeesResponse, CfBoostPoolsDepth, CfBoostPoolsDepthResponse, CfBrokerAccount, CfEnvironment, CfEnvironmentResponse, CfFailedCallArbitrum, CfFailedCallArbitrumResponse, CfFailedCallEthereum, CfFailedCallEthereumResponse, CfFlipSupply, CfFlipSupplyResponse, CfFundingEnvironment, CfFundingEnvironmentResponse, CfGetTradingStrategies, CfGetTradingStrategiesResponse, CfGetTradingStrategyLimits, CfGetTradingStrategyLimitsResponse, CfIngressEgressEnvironment, CfIngressEgressEnvironmentResponse, CfLiquidityProviderAccount, 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, LpTotalBalances, LpTotalBalancesResponse } from './types.js';
|
|
3
|
+
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, CfLiquidityProviderAccount, 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, LpTotalBalances, LpTotalBalancesResponse } from './types.js';
|
|
4
4
|
export { c as constants } from './constants-jLrn-AnI.js';
|
|
5
5
|
export { RpcLimitOrder, RpcRangeOrder } from './parsers.js';
|
|
6
6
|
export { RpcMethod, RpcRequest as RpcParams, RpcResult } from './common.js';
|
package/dist/parsers.cjs
CHANGED
|
@@ -44,6 +44,17 @@ var rpcAssetSchema = _zod.z.union([
|
|
|
44
44
|
_zod.z.object({ chain: _zod.z.literal("Assethub"), asset: _zod.z.literal("USDC") }),
|
|
45
45
|
_zod.z.object({ chain: _zod.z.literal("Assethub"), asset: _zod.z.literal("USDT") })
|
|
46
46
|
]);
|
|
47
|
+
var networkFee = _zod.z.object({
|
|
48
|
+
standard_rate_and_minimum: _zod.z.object({
|
|
49
|
+
rate: numberOrHex,
|
|
50
|
+
minimum: numberOrHex
|
|
51
|
+
}),
|
|
52
|
+
rates: chainAssetMapFactory(numberOrHex, 0)
|
|
53
|
+
});
|
|
54
|
+
var networkFees = _zod.z.object({
|
|
55
|
+
regular_network_fee: networkFee,
|
|
56
|
+
internal_swap_network_fee: networkFee
|
|
57
|
+
});
|
|
47
58
|
var rename = (mapping) => (obj) => Object.fromEntries(
|
|
48
59
|
Object.entries(obj).map(([key, value]) => [
|
|
49
60
|
key in mapping ? mapping[key] : key,
|
|
@@ -101,7 +112,9 @@ var cfSwappingEnvironment = _zod.z.object({
|
|
|
101
112
|
swap_retry_delay_blocks: _zod.z.number().optional(),
|
|
102
113
|
max_swap_retry_duration_blocks: _zod.z.number().optional(),
|
|
103
114
|
max_swap_request_duration_blocks: _zod.z.number().optional(),
|
|
104
|
-
minimum_chunk_size: chainAssetMapFactory(numberOrHex.nullable(), null).optional()
|
|
115
|
+
minimum_chunk_size: chainAssetMapFactory(numberOrHex.nullable(), null).optional(),
|
|
116
|
+
network_fees: networkFees.optional()
|
|
117
|
+
// TODO(1.10): remove optional
|
|
105
118
|
});
|
|
106
119
|
var cfFundingEnvironment = _zod.z.object({
|
|
107
120
|
redemption_tax: numberOrHex,
|
|
@@ -238,7 +251,9 @@ var validator = _zod.z.object({
|
|
|
238
251
|
is_bidding: _zod.z.boolean(),
|
|
239
252
|
bound_redeem_address: hexString.nullable(),
|
|
240
253
|
apy_bp: _zod.z.number().nullable(),
|
|
241
|
-
restricted_balances: _zod.z.record(hexString, numberOrHex)
|
|
254
|
+
restricted_balances: _zod.z.record(hexString, numberOrHex),
|
|
255
|
+
estimated_redeemable_balance: numberOrHex.optional()
|
|
256
|
+
// TODO(1.10): remove optional
|
|
242
257
|
});
|
|
243
258
|
var cfAccountInfo = _zod.z.discriminatedUnion("role", [
|
|
244
259
|
unregistered,
|
|
@@ -351,12 +366,30 @@ var cfPoolOrderbook = _zod.z.object({
|
|
|
351
366
|
var cfTradingStrategy = _zod.z.object({
|
|
352
367
|
lp_id: _zod.z.string(),
|
|
353
368
|
strategy_id: _zod.z.string(),
|
|
354
|
-
strategy: _zod.z.
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
369
|
+
strategy: _zod.z.union([
|
|
370
|
+
_zod.z.object({
|
|
371
|
+
TickZeroCentered: _zod.z.object({
|
|
372
|
+
spread_tick: _zod.z.number(),
|
|
373
|
+
base_asset: rpcAssetSchema
|
|
374
|
+
})
|
|
375
|
+
}),
|
|
376
|
+
_zod.z.object({
|
|
377
|
+
SimpleBuySell: _zod.z.object({
|
|
378
|
+
buy_tick: _zod.z.number(),
|
|
379
|
+
sell_tick: _zod.z.number(),
|
|
380
|
+
base_asset: rpcAssetSchema
|
|
381
|
+
})
|
|
382
|
+
}),
|
|
383
|
+
_zod.z.object({
|
|
384
|
+
InventoryBased: _zod.z.object({
|
|
385
|
+
min_buy_tick: _zod.z.number(),
|
|
386
|
+
max_buy_tick: _zod.z.number(),
|
|
387
|
+
min_sell_tick: _zod.z.number(),
|
|
388
|
+
max_sell_tick: _zod.z.number(),
|
|
389
|
+
base_asset: rpcAssetSchema
|
|
390
|
+
})
|
|
358
391
|
})
|
|
359
|
-
|
|
392
|
+
]),
|
|
360
393
|
balance: _zod.z.array(_zod.z.tuple([rpcAssetSchema, numberOrHex]))
|
|
361
394
|
});
|
|
362
395
|
var cfGetTradingStrategies = _zod.z.array(cfTradingStrategy).default([]);
|
|
@@ -372,7 +405,7 @@ var cfAvailablePools = _zod.z.array(
|
|
|
372
405
|
quote: _zod.z.object({ chain: _zod.z.literal("Ethereum"), asset: _zod.z.literal("USDC") })
|
|
373
406
|
})
|
|
374
407
|
);
|
|
375
|
-
var
|
|
408
|
+
var cfSafeModeStatusesBase = _zod.z.object({
|
|
376
409
|
emissions: _zod.z.object({
|
|
377
410
|
emissions_sync_enabled: _zod.z.boolean()
|
|
378
411
|
}),
|
|
@@ -440,49 +473,81 @@ var cfSafeModeStatuses = _zod.z.object({
|
|
|
440
473
|
broadcast_solana: _zod.z.object({
|
|
441
474
|
retry_enabled: _zod.z.boolean()
|
|
442
475
|
}),
|
|
443
|
-
broadcast_assethub: _zod.z.object({
|
|
444
|
-
|
|
445
|
-
boost_deposits_enabled: _zod.z.boolean(),
|
|
446
|
-
add_boost_funds_enabled: _zod.z.boolean(),
|
|
447
|
-
stop_boosting_enabled: _zod.z.boolean(),
|
|
448
|
-
deposits_enabled: _zod.z.boolean()
|
|
449
|
-
}),
|
|
450
|
-
ingress_egress_bitcoin: _zod.z.object({
|
|
451
|
-
boost_deposits_enabled: _zod.z.boolean(),
|
|
452
|
-
add_boost_funds_enabled: _zod.z.boolean(),
|
|
453
|
-
stop_boosting_enabled: _zod.z.boolean(),
|
|
454
|
-
deposits_enabled: _zod.z.boolean()
|
|
455
|
-
}),
|
|
456
|
-
ingress_egress_polkadot: _zod.z.object({
|
|
457
|
-
boost_deposits_enabled: _zod.z.boolean(),
|
|
458
|
-
add_boost_funds_enabled: _zod.z.boolean(),
|
|
459
|
-
stop_boosting_enabled: _zod.z.boolean(),
|
|
460
|
-
deposits_enabled: _zod.z.boolean()
|
|
461
|
-
}),
|
|
462
|
-
ingress_egress_arbitrum: _zod.z.object({
|
|
463
|
-
boost_deposits_enabled: _zod.z.boolean(),
|
|
464
|
-
add_boost_funds_enabled: _zod.z.boolean(),
|
|
465
|
-
stop_boosting_enabled: _zod.z.boolean(),
|
|
466
|
-
deposits_enabled: _zod.z.boolean()
|
|
467
|
-
}),
|
|
468
|
-
ingress_egress_solana: _zod.z.object({
|
|
469
|
-
boost_deposits_enabled: _zod.z.boolean(),
|
|
470
|
-
add_boost_funds_enabled: _zod.z.boolean(),
|
|
471
|
-
stop_boosting_enabled: _zod.z.boolean(),
|
|
472
|
-
deposits_enabled: _zod.z.boolean()
|
|
473
|
-
}),
|
|
474
|
-
ingress_egress_assethub: _zod.z.object({
|
|
475
|
-
boost_deposits_enabled: _zod.z.boolean(),
|
|
476
|
-
add_boost_funds_enabled: _zod.z.boolean(),
|
|
477
|
-
stop_boosting_enabled: _zod.z.boolean(),
|
|
478
|
-
deposits_enabled: _zod.z.boolean()
|
|
479
|
-
}).optional().default({
|
|
480
|
-
boost_deposits_enabled: false,
|
|
481
|
-
add_boost_funds_enabled: false,
|
|
482
|
-
stop_boosting_enabled: false,
|
|
483
|
-
deposits_enabled: false
|
|
476
|
+
broadcast_assethub: _zod.z.object({
|
|
477
|
+
retry_enabled: _zod.z.boolean()
|
|
484
478
|
})
|
|
485
479
|
});
|
|
480
|
+
var cfSafeModeStatuses = _zod.z.union([
|
|
481
|
+
// TODO(1.10): remove
|
|
482
|
+
cfSafeModeStatusesBase.extend({
|
|
483
|
+
ingress_egress_ethereum: _zod.z.object({
|
|
484
|
+
boost_deposits_enabled: _zod.z.boolean(),
|
|
485
|
+
add_boost_funds_enabled: _zod.z.boolean(),
|
|
486
|
+
stop_boosting_enabled: _zod.z.boolean(),
|
|
487
|
+
deposits_enabled: _zod.z.boolean()
|
|
488
|
+
}),
|
|
489
|
+
ingress_egress_bitcoin: _zod.z.object({
|
|
490
|
+
boost_deposits_enabled: _zod.z.boolean(),
|
|
491
|
+
add_boost_funds_enabled: _zod.z.boolean(),
|
|
492
|
+
stop_boosting_enabled: _zod.z.boolean(),
|
|
493
|
+
deposits_enabled: _zod.z.boolean()
|
|
494
|
+
}),
|
|
495
|
+
ingress_egress_polkadot: _zod.z.object({
|
|
496
|
+
boost_deposits_enabled: _zod.z.boolean(),
|
|
497
|
+
add_boost_funds_enabled: _zod.z.boolean(),
|
|
498
|
+
stop_boosting_enabled: _zod.z.boolean(),
|
|
499
|
+
deposits_enabled: _zod.z.boolean()
|
|
500
|
+
}),
|
|
501
|
+
ingress_egress_arbitrum: _zod.z.object({
|
|
502
|
+
boost_deposits_enabled: _zod.z.boolean(),
|
|
503
|
+
add_boost_funds_enabled: _zod.z.boolean(),
|
|
504
|
+
stop_boosting_enabled: _zod.z.boolean(),
|
|
505
|
+
deposits_enabled: _zod.z.boolean()
|
|
506
|
+
}),
|
|
507
|
+
ingress_egress_solana: _zod.z.object({
|
|
508
|
+
boost_deposits_enabled: _zod.z.boolean(),
|
|
509
|
+
add_boost_funds_enabled: _zod.z.boolean(),
|
|
510
|
+
stop_boosting_enabled: _zod.z.boolean(),
|
|
511
|
+
deposits_enabled: _zod.z.boolean()
|
|
512
|
+
}),
|
|
513
|
+
ingress_egress_assethub: _zod.z.object({
|
|
514
|
+
boost_deposits_enabled: _zod.z.boolean(),
|
|
515
|
+
add_boost_funds_enabled: _zod.z.boolean(),
|
|
516
|
+
stop_boosting_enabled: _zod.z.boolean(),
|
|
517
|
+
deposits_enabled: _zod.z.boolean()
|
|
518
|
+
})
|
|
519
|
+
}),
|
|
520
|
+
cfSafeModeStatusesBase.extend({
|
|
521
|
+
lending_pools: _zod.z.object({
|
|
522
|
+
add_boost_funds_enabled: _zod.z.boolean(),
|
|
523
|
+
stop_boosting_enabled: _zod.z.boolean()
|
|
524
|
+
}),
|
|
525
|
+
ingress_egress_ethereum: _zod.z.object({
|
|
526
|
+
boost_deposits_enabled: _zod.z.boolean(),
|
|
527
|
+
deposits_enabled: _zod.z.boolean()
|
|
528
|
+
}),
|
|
529
|
+
ingress_egress_bitcoin: _zod.z.object({
|
|
530
|
+
boost_deposits_enabled: _zod.z.boolean(),
|
|
531
|
+
deposits_enabled: _zod.z.boolean()
|
|
532
|
+
}),
|
|
533
|
+
ingress_egress_polkadot: _zod.z.object({
|
|
534
|
+
boost_deposits_enabled: _zod.z.boolean(),
|
|
535
|
+
deposits_enabled: _zod.z.boolean()
|
|
536
|
+
}),
|
|
537
|
+
ingress_egress_arbitrum: _zod.z.object({
|
|
538
|
+
boost_deposits_enabled: _zod.z.boolean(),
|
|
539
|
+
deposits_enabled: _zod.z.boolean()
|
|
540
|
+
}),
|
|
541
|
+
ingress_egress_solana: _zod.z.object({
|
|
542
|
+
boost_deposits_enabled: _zod.z.boolean(),
|
|
543
|
+
deposits_enabled: _zod.z.boolean()
|
|
544
|
+
}),
|
|
545
|
+
ingress_egress_assethub: _zod.z.object({
|
|
546
|
+
boost_deposits_enabled: _zod.z.boolean(),
|
|
547
|
+
deposits_enabled: _zod.z.boolean()
|
|
548
|
+
})
|
|
549
|
+
})
|
|
550
|
+
]);
|
|
486
551
|
|
|
487
552
|
|
|
488
553
|
|