@chainflip/rpc 1.6.3 → 1.6.4
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.cjs +6 -7
- package/dist/Client.d.cts +1 -1
- package/dist/Client.d.ts +1 -1
- package/dist/{Client.mjs → Client.js} +3 -4
- package/dist/HttpClient.cjs +3 -4
- package/dist/HttpClient.d.cts +1 -1
- package/dist/HttpClient.d.ts +1 -1
- package/dist/{HttpClient.mjs → HttpClient.js} +3 -4
- package/dist/WsClient.cjs +9 -10
- package/dist/WsClient.d.cts +1 -1
- package/dist/WsClient.d.ts +1 -1
- package/dist/{WsClient.mjs → WsClient.js} +6 -7
- package/dist/common.cjs +17 -30
- package/dist/common.d.cts +1725 -12105
- package/dist/common.d.ts +1725 -12105
- package/dist/{common.mjs → common.js} +3 -16
- package/dist/constants.cjs +2 -3
- package/dist/{constants.mjs → constants.js} +2 -3
- package/dist/index.cjs +5 -6
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -0
- package/dist/parsers.cjs +37 -212
- package/dist/parsers.d.cts +376 -12098
- package/dist/parsers.d.ts +376 -12098
- package/dist/parsers.js +113 -0
- package/dist/types.d.cts +3 -20
- package/dist/types.d.ts +3 -20
- package/package.json +1 -1
- package/dist/index.mjs +0 -10
- package/dist/parsers.mjs +0 -288
- /package/dist/{types.mjs → types.js} +0 -0
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
// src/common.ts
|
|
2
1
|
import {
|
|
3
|
-
cfBoostPoolDetails,
|
|
4
|
-
cfBoostPoolPendingFees,
|
|
5
2
|
brokerRequestSwapDepositAddress,
|
|
6
|
-
cfAccountInfo,
|
|
7
3
|
cfBoostPoolsDepth,
|
|
8
4
|
cfEnvironment,
|
|
9
5
|
cfFundingEnvironment,
|
|
10
6
|
cfIngressEgressEnvironment,
|
|
11
|
-
cfPoolOrders,
|
|
12
|
-
cfPoolPriceV2,
|
|
13
|
-
cfPoolsEnvironment,
|
|
14
7
|
cfSupportedAsssets,
|
|
15
8
|
cfSwapRate,
|
|
16
9
|
cfSwapRateV2,
|
|
@@ -18,28 +11,22 @@ import {
|
|
|
18
11
|
chainGetBlockHash,
|
|
19
12
|
stateGetMetadata,
|
|
20
13
|
stateGetRuntimeVersion
|
|
21
|
-
} from "./parsers
|
|
22
|
-
|
|
23
|
-
var rpcResult = {
|
|
14
|
+
} from "./parsers";
|
|
15
|
+
const rpcResult = {
|
|
24
16
|
broker_requestSwapDepositAddress: brokerRequestSwapDepositAddress,
|
|
25
|
-
cf_account_info: cfAccountInfo,
|
|
26
17
|
cf_boost_pools_depth: cfBoostPoolsDepth,
|
|
27
18
|
cf_environment: cfEnvironment,
|
|
28
19
|
cf_funding_environment: cfFundingEnvironment,
|
|
29
20
|
cf_ingress_egress_environment: cfIngressEgressEnvironment,
|
|
30
|
-
cf_pool_orders: cfPoolOrders,
|
|
31
|
-
cf_pool_price_v2: cfPoolPriceV2,
|
|
32
|
-
cf_pools_environment: cfPoolsEnvironment,
|
|
33
21
|
cf_supported_assets: cfSupportedAsssets,
|
|
34
22
|
cf_swap_rate: cfSwapRate,
|
|
35
23
|
cf_swap_rate_v2: cfSwapRateV2,
|
|
36
24
|
cf_swapping_environment: cfSwappingEnvironment,
|
|
37
25
|
chain_getBlockHash: chainGetBlockHash,
|
|
38
|
-
cf_boost_pool_details: cfBoostPoolDetails,
|
|
39
|
-
cf_boost_pool_pending_fees: cfBoostPoolPendingFees,
|
|
40
26
|
state_getMetadata: stateGetMetadata,
|
|
41
27
|
state_getRuntimeVersion: stateGetRuntimeVersion
|
|
42
28
|
};
|
|
29
|
+
import { rpcResponse as rpcResponse2 } from "./parsers";
|
|
43
30
|
export {
|
|
44
31
|
rpcResponse2 as rpcResponse,
|
|
45
32
|
rpcResult
|
package/dist/constants.cjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true})
|
|
2
|
-
|
|
3
|
-
mainnet: "https://rpc.mainnet.chainflip.io",
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});const PUBLIC_RPC_ENDPOINTS = {
|
|
2
|
+
mainnet: "https://mainnet-archive.chainflip.io",
|
|
4
3
|
perseverance: "https://archive.perseverance.chainflip.io",
|
|
5
4
|
sisyphos: "https://archive.sisyphos.chainflip.io",
|
|
6
5
|
backspin: "https://backspin-rpc.staging"
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
mainnet: "https://rpc.mainnet.chainflip.io",
|
|
1
|
+
const PUBLIC_RPC_ENDPOINTS = {
|
|
2
|
+
mainnet: "https://mainnet-archive.chainflip.io",
|
|
4
3
|
perseverance: "https://archive.perseverance.chainflip.io",
|
|
5
4
|
sisyphos: "https://archive.sisyphos.chainflip.io",
|
|
6
5
|
backspin: "https://backspin-rpc.staging"
|
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var _constantscjs = require('./constants.cjs'); var constants = _interopRequireWildcard(_constantscjs);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _createStarExport(obj) { Object.keys(obj) .filter((key) => key !== "default" && key !== "__esModule") .forEach((key) => { if (exports.hasOwnProperty(key)) { return; } Object.defineProperty(exports, key, {enumerable: true, configurable: true, get: () => obj[key]}); }); }var _HttpClient = require('./HttpClient'); var _HttpClient2 = _interopRequireDefault(_HttpClient);
|
|
2
|
+
var _WsClient = require('./WsClient'); var _WsClient2 = _interopRequireDefault(_WsClient);
|
|
3
|
+
var _types = require('./types'); _createStarExport(_types);
|
|
4
|
+
var _constants = require('./constants'); var constants = _interopRequireWildcard(_constants);
|
|
6
5
|
|
|
7
6
|
|
|
8
7
|
|
|
9
8
|
|
|
10
|
-
exports.HttpClient =
|
|
9
|
+
exports.HttpClient = _HttpClient2.default; exports.WsClient = _WsClient2.default; exports.constants = constants;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { default as HttpClient } from './HttpClient.cjs';
|
|
2
2
|
export { default as WsClient } from './WsClient.cjs';
|
|
3
|
-
export {
|
|
3
|
+
export { CfBoostPoolsDepth, CfBoostPoolsDepthResponse, CfEnvironment, CfEnvironmentResponse, CfFundingEnvironment, CfFundingEnvironmentResponse, CfIngressEgressEnvironment, CfIngressEgressEnvironmentResponse, CfSupportedAssets, CfSupportedAssetsResponse, CfSwapRate, CfSwapRateResponse, CfSwapRateV2, CfSwapRateV2Response, CfSwappingEnvironment, CfSwappingEnvironmentResponse } from './types.cjs';
|
|
4
4
|
export { c as constants } from './constants-jLrn-AnI.cjs';
|
|
5
|
-
export { RpcLimitOrder, RpcRangeOrder } from './parsers.cjs';
|
|
6
5
|
export { RpcMethod, RpcRequest as RpcParams, RpcResult } from './common.cjs';
|
|
7
6
|
import './Client.cjs';
|
|
8
7
|
import 'zod';
|
|
8
|
+
import './parsers.cjs';
|
|
9
9
|
import '@chainflip/utils/types';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export { default as HttpClient } from './HttpClient.js';
|
|
2
2
|
export { default as WsClient } from './WsClient.js';
|
|
3
|
-
export {
|
|
3
|
+
export { CfBoostPoolsDepth, CfBoostPoolsDepthResponse, CfEnvironment, CfEnvironmentResponse, CfFundingEnvironment, CfFundingEnvironmentResponse, CfIngressEgressEnvironment, CfIngressEgressEnvironmentResponse, CfSupportedAssets, CfSupportedAssetsResponse, CfSwapRate, CfSwapRateResponse, CfSwapRateV2, CfSwapRateV2Response, CfSwappingEnvironment, CfSwappingEnvironmentResponse } from './types.js';
|
|
4
4
|
export { c as constants } from './constants-jLrn-AnI.js';
|
|
5
|
-
export { RpcLimitOrder, RpcRangeOrder } from './parsers.js';
|
|
6
5
|
export { RpcMethod, RpcRequest as RpcParams, RpcResult } from './common.js';
|
|
7
6
|
import './Client.js';
|
|
8
7
|
import 'zod';
|
|
8
|
+
import './parsers.js';
|
|
9
9
|
import '@chainflip/utils/types';
|
package/dist/index.js
ADDED
package/dist/parsers.cjs
CHANGED
|
@@ -1,32 +1,17 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
var _guard = require('@chainflip/utils/guard');
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _guard = require('@chainflip/utils/guard');
|
|
3
2
|
var _string = require('@chainflip/utils/string');
|
|
4
3
|
var _zod = require('zod');
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
const hexString = _zod.z.string().refine(_string.isHex, { message: "Invalid hex string" });
|
|
5
|
+
const u256 = hexString.transform((value) => BigInt(value));
|
|
6
|
+
const numberOrHex = _zod.z.union([_zod.z.number().transform((n) => BigInt(n)), u256]);
|
|
7
|
+
const chainAssetMapFactory = (parser) => _zod.z.object({
|
|
9
8
|
Bitcoin: _zod.z.object({ BTC: parser }),
|
|
10
9
|
Ethereum: _zod.z.object({ ETH: parser, USDC: parser, FLIP: parser, USDT: parser }),
|
|
11
10
|
Polkadot: _zod.z.object({ DOT: parser }),
|
|
12
|
-
Arbitrum: _zod.z.object({ ETH: parser, USDC: parser })
|
|
13
|
-
Solana: _zod.z.object({ SOL: parser.default(defaultValue), USDC: parser.default(defaultValue) }).default({ SOL: defaultValue, USDC: defaultValue })
|
|
11
|
+
Arbitrum: _zod.z.object({ ETH: parser, USDC: parser })
|
|
14
12
|
});
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
Ethereum: _zod.z.object({ ETH: parser, FLIP: parser, USDT: parser }),
|
|
18
|
-
Polkadot: _zod.z.object({ DOT: parser }),
|
|
19
|
-
Arbitrum: _zod.z.object({ ETH: parser, USDC: parser }),
|
|
20
|
-
Solana: _zod.z.object({ SOL: parser.default(defaultValue), USDC: parser.default(defaultValue) }).default({ SOL: defaultValue, USDC: defaultValue })
|
|
21
|
-
});
|
|
22
|
-
var chainMapFactory = (parser, defaultValue) => _zod.z.object({
|
|
23
|
-
Bitcoin: parser,
|
|
24
|
-
Ethereum: parser,
|
|
25
|
-
Polkadot: parser,
|
|
26
|
-
Arbitrum: parser,
|
|
27
|
-
Solana: parser.default(defaultValue)
|
|
28
|
-
});
|
|
29
|
-
var rpcAssetSchema = _zod.z.union([
|
|
13
|
+
const chainMapFactory = (parser) => _zod.z.object({ Bitcoin: parser, Ethereum: parser, Polkadot: parser, Arbitrum: parser });
|
|
14
|
+
const rpcAssetSchema = _zod.z.union([
|
|
30
15
|
_zod.z.object({ chain: _zod.z.literal("Bitcoin"), asset: _zod.z.literal("BTC") }),
|
|
31
16
|
_zod.z.object({ chain: _zod.z.literal("Polkadot"), asset: _zod.z.literal("DOT") }),
|
|
32
17
|
_zod.z.object({ chain: _zod.z.literal("Ethereum"), asset: _zod.z.literal("FLIP") }),
|
|
@@ -34,41 +19,39 @@ var rpcAssetSchema = _zod.z.union([
|
|
|
34
19
|
_zod.z.object({ chain: _zod.z.literal("Ethereum"), asset: _zod.z.literal("USDC") }),
|
|
35
20
|
_zod.z.object({ chain: _zod.z.literal("Ethereum"), asset: _zod.z.literal("USDT") }),
|
|
36
21
|
_zod.z.object({ chain: _zod.z.literal("Arbitrum"), asset: _zod.z.literal("ETH") }),
|
|
37
|
-
_zod.z.object({ chain: _zod.z.literal("Arbitrum"), asset: _zod.z.literal("USDC") })
|
|
38
|
-
_zod.z.object({ chain: _zod.z.literal("Solana"), asset: _zod.z.literal("SOL") }),
|
|
39
|
-
_zod.z.object({ chain: _zod.z.literal("Solana"), asset: _zod.z.literal("USDC") })
|
|
22
|
+
_zod.z.object({ chain: _zod.z.literal("Arbitrum"), asset: _zod.z.literal("USDC") })
|
|
40
23
|
]);
|
|
41
|
-
|
|
24
|
+
const rename = (mapping) => (obj) => Object.fromEntries(
|
|
42
25
|
Object.entries(obj).map(([key, value]) => [
|
|
43
26
|
key in mapping ? mapping[key] : key,
|
|
44
27
|
value
|
|
45
28
|
])
|
|
46
29
|
);
|
|
47
|
-
|
|
30
|
+
const rpcBaseResponse = _zod.z.object({
|
|
48
31
|
id: _zod.z.union([_zod.z.string(), _zod.z.number()]),
|
|
49
32
|
jsonrpc: _zod.z.literal("2.0")
|
|
50
33
|
});
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
34
|
+
const nonNullish = _zod.z.any().refine(_guard.isNotNullish, { message: "Value must not be null or undefined" });
|
|
35
|
+
const rpcSuccessResponse = rpcBaseResponse.extend({ result: nonNullish });
|
|
36
|
+
const rpcErrorResponse = rpcBaseResponse.extend({
|
|
54
37
|
error: _zod.z.object({ code: _zod.z.number(), message: _zod.z.string() })
|
|
55
38
|
});
|
|
56
|
-
|
|
57
|
-
|
|
39
|
+
const rpcResponse = _zod.z.union([rpcSuccessResponse, rpcErrorResponse]);
|
|
40
|
+
const cfSwapRate = _zod.z.object({
|
|
58
41
|
intermediary: numberOrHex.nullable(),
|
|
59
42
|
output: numberOrHex
|
|
60
43
|
});
|
|
61
|
-
|
|
62
|
-
|
|
44
|
+
const fee = _zod.z.intersection(rpcAssetSchema, _zod.z.object({ amount: numberOrHex }));
|
|
45
|
+
const cfSwapRateV2 = _zod.z.object({
|
|
63
46
|
egress_fee: fee,
|
|
64
47
|
ingress_fee: fee,
|
|
65
48
|
intermediary: u256.nullable(),
|
|
66
49
|
network_fee: fee,
|
|
67
50
|
output: u256
|
|
68
51
|
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
52
|
+
const chainGetBlockHash = hexString;
|
|
53
|
+
const stateGetMetadata = hexString;
|
|
54
|
+
const stateGetRuntimeVersion = _zod.z.object({
|
|
72
55
|
specName: _zod.z.string(),
|
|
73
56
|
implName: _zod.z.string(),
|
|
74
57
|
authoringVersion: _zod.z.number(),
|
|
@@ -78,196 +61,38 @@ var stateGetRuntimeVersion = _zod.z.object({
|
|
|
78
61
|
transactionVersion: _zod.z.number(),
|
|
79
62
|
stateVersion: _zod.z.number()
|
|
80
63
|
});
|
|
81
|
-
|
|
82
|
-
minimum_deposit_amounts: chainAssetMapFactory(numberOrHex
|
|
83
|
-
ingress_fees: chainAssetMapFactory(numberOrHex.nullable()
|
|
84
|
-
egress_fees: chainAssetMapFactory(numberOrHex.nullable()
|
|
85
|
-
witness_safety_margins: chainMapFactory(_zod.z.number().nullable()
|
|
86
|
-
egress_dust_limits: chainAssetMapFactory(numberOrHex
|
|
87
|
-
channel_opening_fees: chainMapFactory(numberOrHex
|
|
88
|
-
// TODO(1.6): no longer optional
|
|
89
|
-
max_swap_retry_duration_blocks: chainMapFactory(_zod.z.number(), 0).optional().default({ Arbitrum: 0, Bitcoin: 0, Ethereum: 0, Polkadot: 0, Solana: 0 })
|
|
64
|
+
const cfIngressEgressEnvironment = _zod.z.object({
|
|
65
|
+
minimum_deposit_amounts: chainAssetMapFactory(numberOrHex),
|
|
66
|
+
ingress_fees: chainAssetMapFactory(numberOrHex.nullable()),
|
|
67
|
+
egress_fees: chainAssetMapFactory(numberOrHex.nullable()),
|
|
68
|
+
witness_safety_margins: chainMapFactory(_zod.z.number().nullable()),
|
|
69
|
+
egress_dust_limits: chainAssetMapFactory(numberOrHex),
|
|
70
|
+
channel_opening_fees: chainMapFactory(numberOrHex)
|
|
90
71
|
}).transform(rename({ egress_dust_limits: "minimum_egress_amounts" }));
|
|
91
|
-
|
|
92
|
-
maximum_swap_amounts: chainAssetMapFactory(numberOrHex.nullable()
|
|
72
|
+
const cfSwappingEnvironment = _zod.z.object({
|
|
73
|
+
maximum_swap_amounts: chainAssetMapFactory(numberOrHex.nullable()),
|
|
93
74
|
network_fee_hundredth_pips: _zod.z.number()
|
|
94
75
|
});
|
|
95
|
-
|
|
76
|
+
const cfFundingEnvironment = _zod.z.object({
|
|
96
77
|
redemption_tax: numberOrHex,
|
|
97
78
|
minimum_funding_amount: numberOrHex
|
|
98
79
|
});
|
|
99
|
-
|
|
100
|
-
limit_order_fee_hundredth_pips: 0,
|
|
101
|
-
range_order_fee_hundredth_pips: 0,
|
|
102
|
-
range_order_total_fees_earned: { base: "0x0", quote: "0x0" },
|
|
103
|
-
limit_order_total_fees_earned: { base: "0x0", quote: "0x0" },
|
|
104
|
-
range_total_swap_inputs: { base: "0x0", quote: "0x0" },
|
|
105
|
-
limit_total_swap_inputs: { base: "0x0", quote: "0x0" },
|
|
106
|
-
quote_asset: { chain: "Ethereum", asset: "USDC" }
|
|
107
|
-
};
|
|
108
|
-
var cfPoolsEnvironment = _zod.z.object({
|
|
109
|
-
fees: chainBaseAssetMapFactory(
|
|
110
|
-
_zod.z.object({
|
|
111
|
-
limit_order_fee_hundredth_pips: _zod.z.number(),
|
|
112
|
-
range_order_fee_hundredth_pips: _zod.z.number(),
|
|
113
|
-
range_order_total_fees_earned: _zod.z.object({ base: u256, quote: u256 }),
|
|
114
|
-
limit_order_total_fees_earned: _zod.z.object({ base: u256, quote: u256 }),
|
|
115
|
-
range_total_swap_inputs: _zod.z.object({ base: u256, quote: u256 }),
|
|
116
|
-
limit_total_swap_inputs: _zod.z.object({ base: u256, quote: u256 }),
|
|
117
|
-
quote_asset: _zod.z.object({ chain: _zod.z.literal("Ethereum"), asset: _zod.z.literal("USDC") })
|
|
118
|
-
}).nullable().transform((info) => _nullishCoalesce(info, () => ( structuredClone(defaultFeeInfo)))),
|
|
119
|
-
structuredClone(defaultFeeInfo)
|
|
120
|
-
)
|
|
121
|
-
});
|
|
122
|
-
var cfEnvironment = _zod.z.object({
|
|
80
|
+
const cfEnvironment = _zod.z.object({
|
|
123
81
|
ingress_egress: cfIngressEgressEnvironment,
|
|
124
82
|
swapping: cfSwappingEnvironment,
|
|
125
|
-
funding: cfFundingEnvironment
|
|
126
|
-
pools: cfPoolsEnvironment
|
|
83
|
+
funding: cfFundingEnvironment
|
|
127
84
|
});
|
|
128
|
-
|
|
85
|
+
const cfBoostPoolsDepth = _zod.z.array(
|
|
129
86
|
_zod.z.intersection(rpcAssetSchema, _zod.z.object({ tier: _zod.z.number(), available_amount: u256 }))
|
|
130
87
|
);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
);
|
|
134
|
-
var brokerRequestSwapDepositAddress = _zod.z.object({
|
|
88
|
+
const cfSupportedAsssets = _zod.z.array(rpcAssetSchema);
|
|
89
|
+
const brokerRequestSwapDepositAddress = _zod.z.object({
|
|
135
90
|
address: _zod.z.string(),
|
|
136
91
|
issued_block: _zod.z.number(),
|
|
137
92
|
channel_id: _zod.z.number(),
|
|
138
93
|
source_chain_expiry_block: numberOrHex,
|
|
139
94
|
channel_opening_fee: u256
|
|
140
95
|
});
|
|
141
|
-
var unregistered = _zod.z.object({
|
|
142
|
-
role: _zod.z.literal("unregistered"),
|
|
143
|
-
flip_balance: numberOrHex
|
|
144
|
-
});
|
|
145
|
-
var broker = _zod.z.object({
|
|
146
|
-
role: _zod.z.literal("broker"),
|
|
147
|
-
flip_balance: numberOrHex,
|
|
148
|
-
earned_fees: chainAssetMapFactory(numberOrHex, 0)
|
|
149
|
-
});
|
|
150
|
-
var boostBalances = _zod.z.array(
|
|
151
|
-
_zod.z.object({
|
|
152
|
-
fee_tier: _zod.z.number(),
|
|
153
|
-
total_balance: u256,
|
|
154
|
-
available_balance: u256,
|
|
155
|
-
in_use_balance: u256,
|
|
156
|
-
is_withdrawing: _zod.z.boolean()
|
|
157
|
-
})
|
|
158
|
-
);
|
|
159
|
-
var liquidityProvider = _zod.z.object({
|
|
160
|
-
role: _zod.z.literal("liquidity_provider"),
|
|
161
|
-
balances: chainAssetMapFactory(numberOrHex, "0x0"),
|
|
162
|
-
refund_addresses: chainMapFactory(_zod.z.string().nullable(), null),
|
|
163
|
-
flip_balance: numberOrHex,
|
|
164
|
-
earned_fees: chainAssetMapFactory(numberOrHex, 0),
|
|
165
|
-
boost_balances: chainAssetMapFactory(boostBalances, [])
|
|
166
|
-
});
|
|
167
|
-
var validator = _zod.z.object({
|
|
168
|
-
role: _zod.z.literal("validator"),
|
|
169
|
-
flip_balance: numberOrHex,
|
|
170
|
-
bond: numberOrHex,
|
|
171
|
-
last_heartbeat: _zod.z.number(),
|
|
172
|
-
reputation_points: _zod.z.number(),
|
|
173
|
-
keyholder_epochs: _zod.z.array(_zod.z.number()),
|
|
174
|
-
is_current_authority: _zod.z.boolean(),
|
|
175
|
-
is_current_backup: _zod.z.boolean(),
|
|
176
|
-
is_qualified: _zod.z.boolean(),
|
|
177
|
-
is_online: _zod.z.boolean(),
|
|
178
|
-
is_bidding: _zod.z.boolean(),
|
|
179
|
-
bound_redeem_address: hexString.nullable(),
|
|
180
|
-
apy_bp: _zod.z.number().nullable(),
|
|
181
|
-
restricted_balances: _zod.z.record(hexString, numberOrHex)
|
|
182
|
-
});
|
|
183
|
-
var cfAccountInfo = _zod.z.union([unregistered, broker, liquidityProvider, validator]);
|
|
184
|
-
var cfPoolPriceV2 = _zod.z.object({
|
|
185
|
-
sell: numberOrHex.nullable(),
|
|
186
|
-
buy: numberOrHex.nullable(),
|
|
187
|
-
range_order: numberOrHex,
|
|
188
|
-
base_asset: rpcAssetSchema,
|
|
189
|
-
quote_asset: rpcAssetSchema
|
|
190
|
-
});
|
|
191
|
-
var orderId = numberOrHex.transform((n) => String(n));
|
|
192
|
-
var limitOrder = _zod.z.object({
|
|
193
|
-
id: orderId,
|
|
194
|
-
tick: _zod.z.number(),
|
|
195
|
-
sell_amount: numberOrHex,
|
|
196
|
-
fees_earned: numberOrHex,
|
|
197
|
-
original_sell_amount: numberOrHex,
|
|
198
|
-
lp: _zod.z.string()
|
|
199
|
-
});
|
|
200
|
-
var ask = limitOrder.transform((order) => ({
|
|
201
|
-
...order,
|
|
202
|
-
type: "ask"
|
|
203
|
-
}));
|
|
204
|
-
var bid = limitOrder.transform((order) => ({
|
|
205
|
-
...order,
|
|
206
|
-
type: "bid"
|
|
207
|
-
}));
|
|
208
|
-
var rangeOrder = _zod.z.object({
|
|
209
|
-
id: orderId,
|
|
210
|
-
range: _zod.z.object({ start: _zod.z.number(), end: _zod.z.number() }),
|
|
211
|
-
liquidity: numberOrHex,
|
|
212
|
-
fees_earned: _zod.z.object({ base: numberOrHex, quote: numberOrHex }),
|
|
213
|
-
lp: _zod.z.string()
|
|
214
|
-
}).transform((order) => ({ ...order, type: "range" }));
|
|
215
|
-
var cfPoolOrders = _zod.z.object({
|
|
216
|
-
limit_orders: _zod.z.object({
|
|
217
|
-
asks: _zod.z.array(ask),
|
|
218
|
-
bids: _zod.z.array(bid)
|
|
219
|
-
}),
|
|
220
|
-
range_orders: _zod.z.array(rangeOrder)
|
|
221
|
-
});
|
|
222
|
-
var boostPoolAmount = _zod.z.object({
|
|
223
|
-
account_id: _zod.z.string(),
|
|
224
|
-
amount: u256
|
|
225
|
-
});
|
|
226
|
-
var cfBoostPoolDetails = _zod.z.array(
|
|
227
|
-
_zod.z.intersection(
|
|
228
|
-
rpcAssetSchema,
|
|
229
|
-
_zod.z.object({
|
|
230
|
-
fee_tier: _zod.z.number(),
|
|
231
|
-
available_amounts: _zod.z.array(boostPoolAmount),
|
|
232
|
-
deposits_pending_finalization: _zod.z.array(
|
|
233
|
-
_zod.z.object({
|
|
234
|
-
deposit_id: _zod.z.number().transform(BigInt),
|
|
235
|
-
owed_amounts: _zod.z.array(boostPoolAmount)
|
|
236
|
-
})
|
|
237
|
-
),
|
|
238
|
-
pending_withdrawals: _zod.z.array(
|
|
239
|
-
_zod.z.object({
|
|
240
|
-
account_id: _zod.z.string(),
|
|
241
|
-
pending_deposits: _zod.z.array(_zod.z.bigint())
|
|
242
|
-
})
|
|
243
|
-
)
|
|
244
|
-
})
|
|
245
|
-
)
|
|
246
|
-
);
|
|
247
|
-
var cfBoostPoolPendingFees = _zod.z.array(
|
|
248
|
-
_zod.z.intersection(
|
|
249
|
-
rpcAssetSchema,
|
|
250
|
-
_zod.z.object({
|
|
251
|
-
fee_tier: _zod.z.number(),
|
|
252
|
-
pending_fees: _zod.z.array(
|
|
253
|
-
_zod.z.object({
|
|
254
|
-
deposit_id: _zod.z.number().transform(BigInt),
|
|
255
|
-
fees: _zod.z.array(boostPoolAmount)
|
|
256
|
-
})
|
|
257
|
-
)
|
|
258
|
-
})
|
|
259
|
-
)
|
|
260
|
-
);
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
96
|
|
|
272
97
|
|
|
273
98
|
|
|
@@ -285,4 +110,4 @@ var cfBoostPoolPendingFees = _zod.z.array(
|
|
|
285
110
|
|
|
286
111
|
|
|
287
112
|
|
|
288
|
-
exports.
|
|
113
|
+
exports.brokerRequestSwapDepositAddress = brokerRequestSwapDepositAddress; exports.cfBoostPoolsDepth = cfBoostPoolsDepth; exports.cfEnvironment = cfEnvironment; exports.cfFundingEnvironment = cfFundingEnvironment; exports.cfIngressEgressEnvironment = cfIngressEgressEnvironment; exports.cfSupportedAsssets = cfSupportedAsssets; exports.cfSwapRate = cfSwapRate; exports.cfSwapRateV2 = cfSwapRateV2; exports.cfSwappingEnvironment = cfSwappingEnvironment; exports.chainGetBlockHash = chainGetBlockHash; exports.hexString = hexString; exports.numberOrHex = numberOrHex; exports.rpcResponse = rpcResponse; exports.stateGetMetadata = stateGetMetadata; exports.stateGetRuntimeVersion = stateGetRuntimeVersion; exports.u256 = u256;
|