@chainflip/rpc 1.4.4 → 1.4.6
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 -1
- package/dist/Client.d.ts +1 -1
- package/dist/HttpClient.d.cts +1 -1
- package/dist/HttpClient.d.ts +1 -1
- package/dist/WsClient.d.cts +1 -1
- package/dist/WsClient.d.ts +1 -1
- package/dist/common.cjs +12 -0
- package/dist/common.d.cts +6584 -1455
- package/dist/common.d.ts +6584 -1455
- package/dist/common.mjs +12 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/parsers.cjs +151 -2
- package/dist/parsers.d.cts +5710 -1
- package/dist/parsers.d.ts +5710 -1
- package/dist/parsers.mjs +151 -2
- package/dist/types.d.cts +20 -3
- package/dist/types.d.ts +20 -3
- package/package.json +1 -1
package/dist/common.mjs
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
// src/common.ts
|
|
2
2
|
import {
|
|
3
|
+
cfBoostPoolDetails,
|
|
4
|
+
cfBoostPoolPendingFees,
|
|
3
5
|
brokerRequestSwapDepositAddress,
|
|
6
|
+
cfAccountInfo,
|
|
4
7
|
cfBoostPoolsDepth,
|
|
5
8
|
cfEnvironment,
|
|
6
9
|
cfFundingEnvironment,
|
|
7
10
|
cfIngressEgressEnvironment,
|
|
11
|
+
cfPoolOrders,
|
|
12
|
+
cfPoolPriceV2,
|
|
13
|
+
cfPoolsEnvironment,
|
|
8
14
|
cfSupportedAsssets,
|
|
9
15
|
cfSwapRate,
|
|
10
16
|
cfSwapRateV2,
|
|
@@ -16,15 +22,21 @@ import {
|
|
|
16
22
|
import { rpcResponse as rpcResponse2 } from "./parsers.mjs";
|
|
17
23
|
var rpcResult = {
|
|
18
24
|
broker_requestSwapDepositAddress: brokerRequestSwapDepositAddress,
|
|
25
|
+
cf_account_info: cfAccountInfo,
|
|
19
26
|
cf_boost_pools_depth: cfBoostPoolsDepth,
|
|
20
27
|
cf_environment: cfEnvironment,
|
|
21
28
|
cf_funding_environment: cfFundingEnvironment,
|
|
22
29
|
cf_ingress_egress_environment: cfIngressEgressEnvironment,
|
|
30
|
+
cf_pool_orders: cfPoolOrders,
|
|
31
|
+
cf_pool_price_v2: cfPoolPriceV2,
|
|
32
|
+
cf_pools_environment: cfPoolsEnvironment,
|
|
23
33
|
cf_supported_assets: cfSupportedAsssets,
|
|
24
34
|
cf_swap_rate: cfSwapRate,
|
|
25
35
|
cf_swap_rate_v2: cfSwapRateV2,
|
|
26
36
|
cf_swapping_environment: cfSwappingEnvironment,
|
|
27
37
|
chain_getBlockHash: chainGetBlockHash,
|
|
38
|
+
cf_boost_pool_details: cfBoostPoolDetails,
|
|
39
|
+
cf_boost_pool_pending_fees: cfBoostPoolPendingFees,
|
|
28
40
|
state_getMetadata: stateGetMetadata,
|
|
29
41
|
state_getRuntimeVersion: stateGetRuntimeVersion
|
|
30
42
|
};
|
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 { CfBoostPoolsDepth, CfBoostPoolsDepthResponse, CfEnvironment, CfEnvironmentResponse, CfFundingEnvironment, CfFundingEnvironmentResponse, CfIngressEgressEnvironment, CfIngressEgressEnvironmentResponse, CfSupportedAssets, CfSupportedAssetsResponse, CfSwapRate, CfSwapRateResponse, CfSwapRateV2, CfSwapRateV2Response, CfSwappingEnvironment, CfSwappingEnvironmentResponse } from './types.cjs';
|
|
3
|
+
export { CfAccountInfo, CfAccountInfoResponse, CfBoostPoolDetails, CfBoostPoolDetailsResponse, CfBoostPoolPendingFees, CfBoostPoolPendingFeesResponse, CfBoostPoolsDepth, CfBoostPoolsDepthResponse, CfBrokerAccount, CfEnvironment, CfEnvironmentResponse, CfFundingEnvironment, CfFundingEnvironmentResponse, CfIngressEgressEnvironment, CfIngressEgressEnvironmentResponse, CfLiquidityProviderAccount, CfPoolOrders, CfPoolOrdersResponse, CfPoolPriceV2, CfPoolPriceV2Response, CfPoolsEnvironment, CfPoolsEnvironmentResponse, CfSupportedAssets, CfSupportedAssetsResponse, CfSwapRate, CfSwapRateResponse, CfSwapRateV2, CfSwapRateV2Response, CfSwappingEnvironment, CfSwappingEnvironmentResponse, CfUnregisteredAccount, CfValidatorAccount } from './types.cjs';
|
|
4
4
|
export { c as constants } from './constants-jLrn-AnI.cjs';
|
|
5
|
+
export { RpcLimitOrder, RpcRangeOrder } from './parsers.cjs';
|
|
5
6
|
export { RpcMethod, RpcRequest as RpcParams, RpcResult } from './common.cjs';
|
|
6
7
|
import './Client.cjs';
|
|
7
8
|
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 { CfBoostPoolsDepth, CfBoostPoolsDepthResponse, CfEnvironment, CfEnvironmentResponse, CfFundingEnvironment, CfFundingEnvironmentResponse, CfIngressEgressEnvironment, CfIngressEgressEnvironmentResponse, CfSupportedAssets, CfSupportedAssetsResponse, CfSwapRate, CfSwapRateResponse, CfSwapRateV2, CfSwapRateV2Response, CfSwappingEnvironment, CfSwappingEnvironmentResponse } from './types.js';
|
|
3
|
+
export { CfAccountInfo, CfAccountInfoResponse, CfBoostPoolDetails, CfBoostPoolDetailsResponse, CfBoostPoolPendingFees, CfBoostPoolPendingFeesResponse, CfBoostPoolsDepth, CfBoostPoolsDepthResponse, CfBrokerAccount, CfEnvironment, CfEnvironmentResponse, CfFundingEnvironment, CfFundingEnvironmentResponse, CfIngressEgressEnvironment, CfIngressEgressEnvironmentResponse, CfLiquidityProviderAccount, CfPoolOrders, CfPoolOrdersResponse, CfPoolPriceV2, CfPoolPriceV2Response, CfPoolsEnvironment, CfPoolsEnvironmentResponse, CfSupportedAssets, CfSupportedAssetsResponse, CfSwapRate, CfSwapRateResponse, CfSwapRateV2, CfSwapRateV2Response, CfSwappingEnvironment, CfSwappingEnvironmentResponse, CfUnregisteredAccount, CfValidatorAccount } from './types.js';
|
|
4
4
|
export { c as constants } from './constants-jLrn-AnI.js';
|
|
5
|
+
export { RpcLimitOrder, RpcRangeOrder } from './parsers.js';
|
|
5
6
|
export { RpcMethod, RpcRequest as RpcParams, RpcResult } from './common.js';
|
|
6
7
|
import './Client.js';
|
|
7
8
|
import 'zod';
|
|
8
|
-
import './parsers.js';
|
|
9
9
|
import '@chainflip/utils/types';
|
package/dist/parsers.cjs
CHANGED
|
@@ -11,6 +11,12 @@ var chainAssetMapFactory = (parser, defaultValue) => _zod.z.object({
|
|
|
11
11
|
Polkadot: _zod.z.object({ DOT: parser }),
|
|
12
12
|
Arbitrum: _zod.z.object({ ETH: parser.default(defaultValue), USDC: parser.default(defaultValue) })
|
|
13
13
|
});
|
|
14
|
+
var chainBaseAssetMapFactory = (parser, defaultValue) => _zod.z.object({
|
|
15
|
+
Bitcoin: _zod.z.object({ BTC: parser }),
|
|
16
|
+
Ethereum: _zod.z.object({ ETH: parser, FLIP: parser, USDT: parser }),
|
|
17
|
+
Polkadot: _zod.z.object({ DOT: parser }),
|
|
18
|
+
Arbitrum: _zod.z.object({ ETH: parser.default(defaultValue), USDC: parser.default(defaultValue) })
|
|
19
|
+
});
|
|
14
20
|
var chainMapFactory = (parser, defaultValue) => _zod.z.object({
|
|
15
21
|
Bitcoin: parser,
|
|
16
22
|
Ethereum: parser,
|
|
@@ -83,10 +89,33 @@ var cfFundingEnvironment = _zod.z.object({
|
|
|
83
89
|
redemption_tax: numberOrHex,
|
|
84
90
|
minimum_funding_amount: numberOrHex
|
|
85
91
|
});
|
|
92
|
+
var cfPoolsEnvironment = _zod.z.object({
|
|
93
|
+
fees: chainBaseAssetMapFactory(
|
|
94
|
+
_zod.z.object({
|
|
95
|
+
limit_order_fee_hundredth_pips: _zod.z.number(),
|
|
96
|
+
range_order_fee_hundredth_pips: _zod.z.number(),
|
|
97
|
+
range_order_total_fees_earned: _zod.z.object({ base: u256, quote: u256 }),
|
|
98
|
+
limit_order_total_fees_earned: _zod.z.object({ base: u256, quote: u256 }),
|
|
99
|
+
range_total_swap_inputs: _zod.z.object({ base: u256, quote: u256 }),
|
|
100
|
+
limit_total_swap_inputs: _zod.z.object({ base: u256, quote: u256 }),
|
|
101
|
+
quote_asset: _zod.z.object({ chain: _zod.z.literal("Ethereum"), asset: _zod.z.literal("USDC") })
|
|
102
|
+
}),
|
|
103
|
+
{
|
|
104
|
+
limit_order_fee_hundredth_pips: 0,
|
|
105
|
+
range_order_fee_hundredth_pips: 0,
|
|
106
|
+
range_order_total_fees_earned: { base: "0x0", quote: "0x0" },
|
|
107
|
+
limit_order_total_fees_earned: { base: "0x0", quote: "0x0" },
|
|
108
|
+
range_total_swap_inputs: { base: "0x0", quote: "0x0" },
|
|
109
|
+
limit_total_swap_inputs: { base: "0x0", quote: "0x0" },
|
|
110
|
+
quote_asset: { chain: "Ethereum", asset: "USDC" }
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
});
|
|
86
114
|
var cfEnvironment = _zod.z.object({
|
|
87
115
|
ingress_egress: cfIngressEgressEnvironment,
|
|
88
116
|
swapping: cfSwappingEnvironment,
|
|
89
|
-
funding: cfFundingEnvironment
|
|
117
|
+
funding: cfFundingEnvironment,
|
|
118
|
+
pools: cfPoolsEnvironment
|
|
90
119
|
});
|
|
91
120
|
var cfBoostPoolsDepth = _zod.z.array(
|
|
92
121
|
_zod.z.intersection(rpcAssetSchema, _zod.z.object({ tier: _zod.z.number(), available_amount: u256 }))
|
|
@@ -99,6 +128,126 @@ var brokerRequestSwapDepositAddress = _zod.z.object({
|
|
|
99
128
|
source_chain_expiry_block: numberOrHex,
|
|
100
129
|
channel_opening_fee: u256
|
|
101
130
|
});
|
|
131
|
+
var unregistered = _zod.z.object({
|
|
132
|
+
role: _zod.z.literal("unregistered"),
|
|
133
|
+
flip_balance: numberOrHex
|
|
134
|
+
});
|
|
135
|
+
var broker = _zod.z.object({
|
|
136
|
+
role: _zod.z.literal("broker"),
|
|
137
|
+
flip_balance: numberOrHex,
|
|
138
|
+
earned_fees: chainAssetMapFactory(numberOrHex, 0)
|
|
139
|
+
});
|
|
140
|
+
var liquidityProvider = _zod.z.object({
|
|
141
|
+
role: _zod.z.literal("liquidity_provider"),
|
|
142
|
+
balances: chainAssetMapFactory(numberOrHex, "0x0"),
|
|
143
|
+
refund_addresses: chainMapFactory(_zod.z.string().nullable(), null),
|
|
144
|
+
flip_balance: numberOrHex,
|
|
145
|
+
earned_fees: chainAssetMapFactory(numberOrHex, 0)
|
|
146
|
+
});
|
|
147
|
+
var validator = _zod.z.object({
|
|
148
|
+
role: _zod.z.literal("validator"),
|
|
149
|
+
flip_balance: numberOrHex,
|
|
150
|
+
bond: numberOrHex,
|
|
151
|
+
last_heartbeat: _zod.z.number(),
|
|
152
|
+
reputation_points: _zod.z.number(),
|
|
153
|
+
keyholder_epochs: _zod.z.array(_zod.z.number()),
|
|
154
|
+
is_current_authority: _zod.z.boolean(),
|
|
155
|
+
is_current_backup: _zod.z.boolean(),
|
|
156
|
+
is_qualified: _zod.z.boolean(),
|
|
157
|
+
is_online: _zod.z.boolean(),
|
|
158
|
+
is_bidding: _zod.z.boolean(),
|
|
159
|
+
bound_redeem_address: hexString.nullable(),
|
|
160
|
+
apy_bp: _zod.z.number().nullable(),
|
|
161
|
+
restricted_balances: _zod.z.record(hexString, numberOrHex)
|
|
162
|
+
});
|
|
163
|
+
var cfAccountInfo = _zod.z.union([unregistered, broker, liquidityProvider, validator]);
|
|
164
|
+
var cfPoolPriceV2 = _zod.z.object({
|
|
165
|
+
sell: numberOrHex.nullable(),
|
|
166
|
+
buy: numberOrHex.nullable(),
|
|
167
|
+
range_order: numberOrHex,
|
|
168
|
+
base_asset: rpcAssetSchema,
|
|
169
|
+
quote_asset: rpcAssetSchema
|
|
170
|
+
});
|
|
171
|
+
var orderId = numberOrHex.transform((n) => String(n));
|
|
172
|
+
var limitOrder = _zod.z.object({
|
|
173
|
+
id: orderId,
|
|
174
|
+
tick: _zod.z.number(),
|
|
175
|
+
sell_amount: numberOrHex,
|
|
176
|
+
fees_earned: numberOrHex,
|
|
177
|
+
original_sell_amount: numberOrHex,
|
|
178
|
+
lp: _zod.z.string()
|
|
179
|
+
});
|
|
180
|
+
var ask = limitOrder.transform((order) => ({
|
|
181
|
+
...order,
|
|
182
|
+
type: "ask"
|
|
183
|
+
}));
|
|
184
|
+
var bid = limitOrder.transform((order) => ({
|
|
185
|
+
...order,
|
|
186
|
+
type: "bid"
|
|
187
|
+
}));
|
|
188
|
+
var rangeOrder = _zod.z.object({
|
|
189
|
+
id: orderId,
|
|
190
|
+
range: _zod.z.object({ start: _zod.z.number(), end: _zod.z.number() }),
|
|
191
|
+
liquidity: numberOrHex,
|
|
192
|
+
fees_earned: _zod.z.object({ base: numberOrHex, quote: numberOrHex }),
|
|
193
|
+
lp: _zod.z.string()
|
|
194
|
+
}).transform((order) => ({ ...order, type: "range" }));
|
|
195
|
+
var cfPoolOrders = _zod.z.object({
|
|
196
|
+
limit_orders: _zod.z.object({
|
|
197
|
+
asks: _zod.z.array(ask),
|
|
198
|
+
bids: _zod.z.array(bid)
|
|
199
|
+
}),
|
|
200
|
+
range_orders: _zod.z.array(rangeOrder)
|
|
201
|
+
});
|
|
202
|
+
var boostPoolAmount = _zod.z.object({
|
|
203
|
+
account_id: _zod.z.string(),
|
|
204
|
+
amount: u256
|
|
205
|
+
});
|
|
206
|
+
var cfBoostPoolDetails = _zod.z.array(
|
|
207
|
+
_zod.z.intersection(
|
|
208
|
+
rpcAssetSchema,
|
|
209
|
+
_zod.z.object({
|
|
210
|
+
fee_tier: _zod.z.number(),
|
|
211
|
+
available_amounts: _zod.z.array(boostPoolAmount),
|
|
212
|
+
deposits_pending_finalization: _zod.z.array(
|
|
213
|
+
_zod.z.object({
|
|
214
|
+
deposit_id: _zod.z.number().transform(BigInt),
|
|
215
|
+
owed_amounts: _zod.z.array(boostPoolAmount)
|
|
216
|
+
})
|
|
217
|
+
),
|
|
218
|
+
pending_withdrawals: _zod.z.array(
|
|
219
|
+
_zod.z.object({
|
|
220
|
+
account_id: _zod.z.string(),
|
|
221
|
+
pending_deposits: _zod.z.array(_zod.z.bigint())
|
|
222
|
+
})
|
|
223
|
+
)
|
|
224
|
+
})
|
|
225
|
+
)
|
|
226
|
+
);
|
|
227
|
+
var cfBoostPoolPendingFees = _zod.z.array(
|
|
228
|
+
_zod.z.intersection(
|
|
229
|
+
rpcAssetSchema,
|
|
230
|
+
_zod.z.object({
|
|
231
|
+
fee_tier: _zod.z.number(),
|
|
232
|
+
pending_fees: _zod.z.array(
|
|
233
|
+
_zod.z.object({
|
|
234
|
+
deposit_id: _zod.z.number().transform(BigInt),
|
|
235
|
+
fees: _zod.z.array(boostPoolAmount)
|
|
236
|
+
})
|
|
237
|
+
)
|
|
238
|
+
})
|
|
239
|
+
)
|
|
240
|
+
);
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
102
251
|
|
|
103
252
|
|
|
104
253
|
|
|
@@ -116,4 +265,4 @@ var brokerRequestSwapDepositAddress = _zod.z.object({
|
|
|
116
265
|
|
|
117
266
|
|
|
118
267
|
|
|
119
|
-
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;
|
|
268
|
+
exports.broker = broker; exports.brokerRequestSwapDepositAddress = brokerRequestSwapDepositAddress; exports.cfAccountInfo = cfAccountInfo; exports.cfBoostPoolDetails = cfBoostPoolDetails; exports.cfBoostPoolPendingFees = cfBoostPoolPendingFees; exports.cfBoostPoolsDepth = cfBoostPoolsDepth; exports.cfEnvironment = cfEnvironment; exports.cfFundingEnvironment = cfFundingEnvironment; exports.cfIngressEgressEnvironment = cfIngressEgressEnvironment; exports.cfPoolOrders = cfPoolOrders; exports.cfPoolPriceV2 = cfPoolPriceV2; exports.cfPoolsEnvironment = cfPoolsEnvironment; exports.cfSupportedAsssets = cfSupportedAsssets; exports.cfSwapRate = cfSwapRate; exports.cfSwapRateV2 = cfSwapRateV2; exports.cfSwappingEnvironment = cfSwappingEnvironment; exports.chainGetBlockHash = chainGetBlockHash; exports.hexString = hexString; exports.liquidityProvider = liquidityProvider; exports.numberOrHex = numberOrHex; exports.rpcResponse = rpcResponse; exports.stateGetMetadata = stateGetMetadata; exports.stateGetRuntimeVersion = stateGetRuntimeVersion; exports.u256 = u256; exports.unregistered = unregistered; exports.validator = validator;
|