@chainflip/rpc 1.6.2 → 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 +570 -5755
- package/dist/common.d.ts +570 -5755
- package/dist/{common.mjs → common.js} +3 -16
- package/dist/constants.cjs +1 -2
- package/dist/{constants.mjs → constants.js} +1 -2
- 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 +36 -197
- package/dist/parsers.d.cts +267 -6032
- package/dist/parsers.d.ts +267 -6032
- 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 -274
- /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,5 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true})
|
|
2
|
-
var PUBLIC_RPC_ENDPOINTS = {
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});const PUBLIC_RPC_ENDPOINTS = {
|
|
3
2
|
mainnet: "https://mainnet-archive.chainflip.io",
|
|
4
3
|
perseverance: "https://archive.perseverance.chainflip.io",
|
|
5
4
|
sisyphos: "https://archive.sisyphos.chainflip.io",
|
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
|
|
13
|
-
// Solana: z.object({ SOL: parser.default(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.default(defaultValue), USDC: parser.default(defaultValue) }).default({ ETH: defaultValue, USDC: defaultValue })
|
|
20
|
-
// Solana: z.object({ SOL: parser.default(defaultValue) }),
|
|
21
|
-
});
|
|
22
|
-
var chainMapFactory = (parser, defaultValue) => _zod.z.object({
|
|
23
|
-
Bitcoin: parser,
|
|
24
|
-
Ethereum: parser,
|
|
25
|
-
Polkadot: parser,
|
|
26
|
-
Arbitrum: parser.default(defaultValue)
|
|
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") }),
|
|
@@ -36,37 +21,37 @@ var rpcAssetSchema = _zod.z.union([
|
|
|
36
21
|
_zod.z.object({ chain: _zod.z.literal("Arbitrum"), asset: _zod.z.literal("ETH") }),
|
|
37
22
|
_zod.z.object({ chain: _zod.z.literal("Arbitrum"), asset: _zod.z.literal("USDC") })
|
|
38
23
|
]);
|
|
39
|
-
|
|
24
|
+
const rename = (mapping) => (obj) => Object.fromEntries(
|
|
40
25
|
Object.entries(obj).map(([key, value]) => [
|
|
41
26
|
key in mapping ? mapping[key] : key,
|
|
42
27
|
value
|
|
43
28
|
])
|
|
44
29
|
);
|
|
45
|
-
|
|
30
|
+
const rpcBaseResponse = _zod.z.object({
|
|
46
31
|
id: _zod.z.union([_zod.z.string(), _zod.z.number()]),
|
|
47
32
|
jsonrpc: _zod.z.literal("2.0")
|
|
48
33
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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({
|
|
52
37
|
error: _zod.z.object({ code: _zod.z.number(), message: _zod.z.string() })
|
|
53
38
|
});
|
|
54
|
-
|
|
55
|
-
|
|
39
|
+
const rpcResponse = _zod.z.union([rpcSuccessResponse, rpcErrorResponse]);
|
|
40
|
+
const cfSwapRate = _zod.z.object({
|
|
56
41
|
intermediary: numberOrHex.nullable(),
|
|
57
42
|
output: numberOrHex
|
|
58
43
|
});
|
|
59
|
-
|
|
60
|
-
|
|
44
|
+
const fee = _zod.z.intersection(rpcAssetSchema, _zod.z.object({ amount: numberOrHex }));
|
|
45
|
+
const cfSwapRateV2 = _zod.z.object({
|
|
61
46
|
egress_fee: fee,
|
|
62
47
|
ingress_fee: fee,
|
|
63
48
|
intermediary: u256.nullable(),
|
|
64
49
|
network_fee: fee,
|
|
65
50
|
output: u256
|
|
66
51
|
});
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
52
|
+
const chainGetBlockHash = hexString;
|
|
53
|
+
const stateGetMetadata = hexString;
|
|
54
|
+
const stateGetRuntimeVersion = _zod.z.object({
|
|
70
55
|
specName: _zod.z.string(),
|
|
71
56
|
implName: _zod.z.string(),
|
|
72
57
|
authoringVersion: _zod.z.number(),
|
|
@@ -76,184 +61,38 @@ var stateGetRuntimeVersion = _zod.z.object({
|
|
|
76
61
|
transactionVersion: _zod.z.number(),
|
|
77
62
|
stateVersion: _zod.z.number()
|
|
78
63
|
});
|
|
79
|
-
|
|
80
|
-
minimum_deposit_amounts: chainAssetMapFactory(numberOrHex
|
|
81
|
-
ingress_fees: chainAssetMapFactory(numberOrHex.nullable()
|
|
82
|
-
egress_fees: chainAssetMapFactory(numberOrHex.nullable()
|
|
83
|
-
witness_safety_margins: chainMapFactory(_zod.z.number().nullable()
|
|
84
|
-
egress_dust_limits: chainAssetMapFactory(numberOrHex
|
|
85
|
-
channel_opening_fees: chainMapFactory(numberOrHex
|
|
86
|
-
max_swap_retry_duration_blocks: chainMapFactory(_zod.z.number(), 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)
|
|
87
71
|
}).transform(rename({ egress_dust_limits: "minimum_egress_amounts" }));
|
|
88
|
-
|
|
89
|
-
maximum_swap_amounts: chainAssetMapFactory(numberOrHex.nullable()
|
|
72
|
+
const cfSwappingEnvironment = _zod.z.object({
|
|
73
|
+
maximum_swap_amounts: chainAssetMapFactory(numberOrHex.nullable()),
|
|
90
74
|
network_fee_hundredth_pips: _zod.z.number()
|
|
91
75
|
});
|
|
92
|
-
|
|
76
|
+
const cfFundingEnvironment = _zod.z.object({
|
|
93
77
|
redemption_tax: numberOrHex,
|
|
94
78
|
minimum_funding_amount: numberOrHex
|
|
95
79
|
});
|
|
96
|
-
|
|
97
|
-
fees: chainBaseAssetMapFactory(
|
|
98
|
-
_zod.z.object({
|
|
99
|
-
limit_order_fee_hundredth_pips: _zod.z.number(),
|
|
100
|
-
range_order_fee_hundredth_pips: _zod.z.number(),
|
|
101
|
-
range_order_total_fees_earned: _zod.z.object({ base: u256, quote: u256 }),
|
|
102
|
-
limit_order_total_fees_earned: _zod.z.object({ base: u256, quote: u256 }),
|
|
103
|
-
range_total_swap_inputs: _zod.z.object({ base: u256, quote: u256 }),
|
|
104
|
-
limit_total_swap_inputs: _zod.z.object({ base: u256, quote: u256 }),
|
|
105
|
-
quote_asset: _zod.z.object({ chain: _zod.z.literal("Ethereum"), asset: _zod.z.literal("USDC") })
|
|
106
|
-
}),
|
|
107
|
-
{
|
|
108
|
-
limit_order_fee_hundredth_pips: 0,
|
|
109
|
-
range_order_fee_hundredth_pips: 0,
|
|
110
|
-
range_order_total_fees_earned: { base: "0x0", quote: "0x0" },
|
|
111
|
-
limit_order_total_fees_earned: { base: "0x0", quote: "0x0" },
|
|
112
|
-
range_total_swap_inputs: { base: "0x0", quote: "0x0" },
|
|
113
|
-
limit_total_swap_inputs: { base: "0x0", quote: "0x0" },
|
|
114
|
-
quote_asset: { chain: "Ethereum", asset: "USDC" }
|
|
115
|
-
}
|
|
116
|
-
)
|
|
117
|
-
});
|
|
118
|
-
var cfEnvironment = _zod.z.object({
|
|
80
|
+
const cfEnvironment = _zod.z.object({
|
|
119
81
|
ingress_egress: cfIngressEgressEnvironment,
|
|
120
82
|
swapping: cfSwappingEnvironment,
|
|
121
|
-
funding: cfFundingEnvironment
|
|
122
|
-
pools: cfPoolsEnvironment
|
|
83
|
+
funding: cfFundingEnvironment
|
|
123
84
|
});
|
|
124
|
-
|
|
85
|
+
const cfBoostPoolsDepth = _zod.z.array(
|
|
125
86
|
_zod.z.intersection(rpcAssetSchema, _zod.z.object({ tier: _zod.z.number(), available_amount: u256 }))
|
|
126
87
|
);
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
);
|
|
130
|
-
var brokerRequestSwapDepositAddress = _zod.z.object({
|
|
88
|
+
const cfSupportedAsssets = _zod.z.array(rpcAssetSchema);
|
|
89
|
+
const brokerRequestSwapDepositAddress = _zod.z.object({
|
|
131
90
|
address: _zod.z.string(),
|
|
132
91
|
issued_block: _zod.z.number(),
|
|
133
92
|
channel_id: _zod.z.number(),
|
|
134
93
|
source_chain_expiry_block: numberOrHex,
|
|
135
94
|
channel_opening_fee: u256
|
|
136
95
|
});
|
|
137
|
-
var unregistered = _zod.z.object({
|
|
138
|
-
role: _zod.z.literal("unregistered"),
|
|
139
|
-
flip_balance: numberOrHex
|
|
140
|
-
});
|
|
141
|
-
var broker = _zod.z.object({
|
|
142
|
-
role: _zod.z.literal("broker"),
|
|
143
|
-
flip_balance: numberOrHex,
|
|
144
|
-
earned_fees: chainAssetMapFactory(numberOrHex, 0)
|
|
145
|
-
});
|
|
146
|
-
var liquidityProvider = _zod.z.object({
|
|
147
|
-
role: _zod.z.literal("liquidity_provider"),
|
|
148
|
-
balances: chainAssetMapFactory(numberOrHex, "0x0"),
|
|
149
|
-
refund_addresses: chainMapFactory(_zod.z.string().nullable(), null),
|
|
150
|
-
flip_balance: numberOrHex,
|
|
151
|
-
earned_fees: chainAssetMapFactory(numberOrHex, 0)
|
|
152
|
-
});
|
|
153
|
-
var validator = _zod.z.object({
|
|
154
|
-
role: _zod.z.literal("validator"),
|
|
155
|
-
flip_balance: numberOrHex,
|
|
156
|
-
bond: numberOrHex,
|
|
157
|
-
last_heartbeat: _zod.z.number(),
|
|
158
|
-
reputation_points: _zod.z.number(),
|
|
159
|
-
keyholder_epochs: _zod.z.array(_zod.z.number()),
|
|
160
|
-
is_current_authority: _zod.z.boolean(),
|
|
161
|
-
is_current_backup: _zod.z.boolean(),
|
|
162
|
-
is_qualified: _zod.z.boolean(),
|
|
163
|
-
is_online: _zod.z.boolean(),
|
|
164
|
-
is_bidding: _zod.z.boolean(),
|
|
165
|
-
bound_redeem_address: hexString.nullable(),
|
|
166
|
-
apy_bp: _zod.z.number().nullable(),
|
|
167
|
-
restricted_balances: _zod.z.record(hexString, numberOrHex)
|
|
168
|
-
});
|
|
169
|
-
var cfAccountInfo = _zod.z.union([unregistered, broker, liquidityProvider, validator]);
|
|
170
|
-
var cfPoolPriceV2 = _zod.z.object({
|
|
171
|
-
sell: numberOrHex.nullable(),
|
|
172
|
-
buy: numberOrHex.nullable(),
|
|
173
|
-
range_order: numberOrHex,
|
|
174
|
-
base_asset: rpcAssetSchema,
|
|
175
|
-
quote_asset: rpcAssetSchema
|
|
176
|
-
});
|
|
177
|
-
var orderId = numberOrHex.transform((n) => String(n));
|
|
178
|
-
var limitOrder = _zod.z.object({
|
|
179
|
-
id: orderId,
|
|
180
|
-
tick: _zod.z.number(),
|
|
181
|
-
sell_amount: numberOrHex,
|
|
182
|
-
fees_earned: numberOrHex,
|
|
183
|
-
original_sell_amount: numberOrHex,
|
|
184
|
-
lp: _zod.z.string()
|
|
185
|
-
});
|
|
186
|
-
var ask = limitOrder.transform((order) => ({
|
|
187
|
-
...order,
|
|
188
|
-
type: "ask"
|
|
189
|
-
}));
|
|
190
|
-
var bid = limitOrder.transform((order) => ({
|
|
191
|
-
...order,
|
|
192
|
-
type: "bid"
|
|
193
|
-
}));
|
|
194
|
-
var rangeOrder = _zod.z.object({
|
|
195
|
-
id: orderId,
|
|
196
|
-
range: _zod.z.object({ start: _zod.z.number(), end: _zod.z.number() }),
|
|
197
|
-
liquidity: numberOrHex,
|
|
198
|
-
fees_earned: _zod.z.object({ base: numberOrHex, quote: numberOrHex }),
|
|
199
|
-
lp: _zod.z.string()
|
|
200
|
-
}).transform((order) => ({ ...order, type: "range" }));
|
|
201
|
-
var cfPoolOrders = _zod.z.object({
|
|
202
|
-
limit_orders: _zod.z.object({
|
|
203
|
-
asks: _zod.z.array(ask),
|
|
204
|
-
bids: _zod.z.array(bid)
|
|
205
|
-
}),
|
|
206
|
-
range_orders: _zod.z.array(rangeOrder)
|
|
207
|
-
});
|
|
208
|
-
var boostPoolAmount = _zod.z.object({
|
|
209
|
-
account_id: _zod.z.string(),
|
|
210
|
-
amount: u256
|
|
211
|
-
});
|
|
212
|
-
var cfBoostPoolDetails = _zod.z.array(
|
|
213
|
-
_zod.z.intersection(
|
|
214
|
-
rpcAssetSchema,
|
|
215
|
-
_zod.z.object({
|
|
216
|
-
fee_tier: _zod.z.number(),
|
|
217
|
-
available_amounts: _zod.z.array(boostPoolAmount),
|
|
218
|
-
deposits_pending_finalization: _zod.z.array(
|
|
219
|
-
_zod.z.object({
|
|
220
|
-
deposit_id: _zod.z.number().transform(BigInt),
|
|
221
|
-
owed_amounts: _zod.z.array(boostPoolAmount)
|
|
222
|
-
})
|
|
223
|
-
),
|
|
224
|
-
pending_withdrawals: _zod.z.array(
|
|
225
|
-
_zod.z.object({
|
|
226
|
-
account_id: _zod.z.string(),
|
|
227
|
-
pending_deposits: _zod.z.array(_zod.z.bigint())
|
|
228
|
-
})
|
|
229
|
-
)
|
|
230
|
-
})
|
|
231
|
-
)
|
|
232
|
-
);
|
|
233
|
-
var cfBoostPoolPendingFees = _zod.z.array(
|
|
234
|
-
_zod.z.intersection(
|
|
235
|
-
rpcAssetSchema,
|
|
236
|
-
_zod.z.object({
|
|
237
|
-
fee_tier: _zod.z.number(),
|
|
238
|
-
pending_fees: _zod.z.array(
|
|
239
|
-
_zod.z.object({
|
|
240
|
-
deposit_id: _zod.z.number().transform(BigInt),
|
|
241
|
-
fees: _zod.z.array(boostPoolAmount)
|
|
242
|
-
})
|
|
243
|
-
)
|
|
244
|
-
})
|
|
245
|
-
)
|
|
246
|
-
);
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
96
|
|
|
258
97
|
|
|
259
98
|
|
|
@@ -271,4 +110,4 @@ var cfBoostPoolPendingFees = _zod.z.array(
|
|
|
271
110
|
|
|
272
111
|
|
|
273
112
|
|
|
274
|
-
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;
|