@chainflip/rpc 2.0.6-wbtc-dev.4 → 2.0.7-wbtc-dev.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/Client.cjs +88 -91
- package/dist/Client.d.ts +30 -33
- package/dist/Client.mjs +87 -90
- package/dist/HttpClient.cjs +33 -32
- package/dist/HttpClient.d.ts +6 -10
- package/dist/HttpClient.mjs +32 -31
- package/dist/WsClient.cjs +119 -124
- package/dist/WsClient.d.ts +23 -24
- package/dist/WsClient.mjs +117 -122
- package/dist/_virtual/rolldown_runtime.cjs +19 -0
- package/dist/_virtual/rolldown_runtime.mjs +18 -0
- package/dist/common.cjs +55 -98
- package/dist/common.d.ts +30444 -31238
- package/dist/common.mjs +54 -98
- package/dist/constants.cjs +16 -7
- package/dist/constants.d.ts +11 -1
- package/dist/constants.mjs +12 -9
- package/dist/index.cjs +12 -10
- package/dist/index.d.ts +7 -11
- package/dist/index.mjs +5 -10
- package/dist/parsers.cjs +794 -751
- package/dist/parsers.d.ts +36226 -37034
- package/dist/parsers.mjs +738 -747
- package/dist/types.cjs +0 -1
- package/dist/types.d.ts +6 -9
- package/dist/types.mjs +1 -0
- package/package.json +18 -18
- package/dist/Client.d.cts +0 -43
- package/dist/HttpClient.d.cts +0 -13
- package/dist/WsClient.d.cts +0 -27
- package/dist/common.d.cts +0 -31922
- package/dist/constants-jLrn-AnI.d.cts +0 -13
- package/dist/constants-jLrn-AnI.d.ts +0 -13
- package/dist/constants.d.cts +0 -1
- package/dist/index.d.cts +0 -11
- package/dist/parsers.d.cts +0 -37861
- package/dist/types.d.cts +0 -87
package/dist/types.cjs
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/dist/types.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { unregistered, broker, validator, liquidityProvider, operator } from './parsers.js';
|
|
5
|
-
export { RpcLimitOrder, RpcRangeOrder } from './parsers.js';
|
|
6
|
-
import '@chainflip/utils/chainflip';
|
|
7
|
-
import '@chainflip/utils/types';
|
|
1
|
+
import { RpcLimitOrder, RpcRangeOrder, broker, liquidityProvider, operator, unregistered, validator } from "./parsers.js";
|
|
2
|
+
import { RpcMethod, RpcRequest, RpcResponse, RpcResult } from "./common.js";
|
|
3
|
+
import { z } from "zod";
|
|
8
4
|
|
|
5
|
+
//#region src/types.d.ts
|
|
9
6
|
type CfAccountInfo = RpcResult<'cf_account_info'>;
|
|
10
7
|
type CfAccounts = RpcResult<'cf_accounts'>;
|
|
11
8
|
type CfAuctionState = RpcResult<'cf_auction_state'>;
|
|
@@ -83,5 +80,5 @@ type CfLiquidityProviderAccount = z.output<typeof liquidityProvider>;
|
|
|
83
80
|
type CfOperatorAccount = z.output<typeof operator>;
|
|
84
81
|
type LpTotalBalances = RpcResult<'lp_total_balances'>;
|
|
85
82
|
type LpTotalBalancesResponse = RpcResponse<'lp_total_balances'>;
|
|
86
|
-
|
|
87
|
-
export {
|
|
83
|
+
//#endregion
|
|
84
|
+
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, CfLendingConfig, CfLendingConfigResponse, CfLendingPoolSupplyBalances, CfLendingPoolSupplyBalancesResponse, CfLendingPools, CfLendingPoolsResponse, CfLiquidityProviderAccount, CfLoanAccounts, CfLoanAccountsResponse, CfMonitoringSimulateAuction, CfMonitoringSimulateAuctionResponse, CfOperatorAccount, CfOraclePrices, CfOraclePricesResponse, 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, CfVaultAddresses, CfVaultAddressesResponse, LpTotalBalances, LpTotalBalancesResponse, type RpcLimitOrder, type RpcMethod, type RpcRequest as RpcParams, type RpcRangeOrder, type RpcResult };
|
package/dist/types.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,27 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainflip/rpc",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7-wbtc-dev.2",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"eslint:check": "pnpm eslint --max-warnings 0 './**/*.ts'",
|
|
7
|
-
"prettier:base": "prettier ./** --ignore-path=../../.prettierignore",
|
|
8
|
-
"prettier:check": "pnpm prettier:base --check",
|
|
9
|
-
"prettier:write": "pnpm prettier:base --write",
|
|
10
|
-
"clean": "rm -rf dist",
|
|
11
|
-
"prepublish": "pnpm test run && pnpm build",
|
|
12
|
-
"build": "pnpm clean && pnpm tsup",
|
|
13
|
-
"test:ci": "CI=1 pnpm t run",
|
|
14
|
-
"test": "vitest",
|
|
15
|
-
"coverage": "vitest run --coverage"
|
|
16
|
-
},
|
|
17
5
|
"dependencies": {
|
|
18
6
|
"@chainflip/utils": "0.11.2-wbtc-dev.2",
|
|
19
7
|
"zod": "^3.25.75"
|
|
20
8
|
},
|
|
21
9
|
"devDependencies": {
|
|
22
|
-
"@types/node": "^25.0.
|
|
10
|
+
"@types/node": "^25.0.10",
|
|
23
11
|
"@types/ws": "^8.18.1",
|
|
24
|
-
"ws": "^8.
|
|
12
|
+
"ws": "^8.19.0"
|
|
25
13
|
},
|
|
26
14
|
"files": [
|
|
27
15
|
"dist",
|
|
@@ -30,7 +18,7 @@
|
|
|
30
18
|
"exports": {
|
|
31
19
|
"./*": {
|
|
32
20
|
"require": {
|
|
33
|
-
"types": "./dist/*.d.
|
|
21
|
+
"types": "./dist/*.d.ts",
|
|
34
22
|
"default": "./dist/*.cjs"
|
|
35
23
|
},
|
|
36
24
|
"import": {
|
|
@@ -40,7 +28,7 @@
|
|
|
40
28
|
},
|
|
41
29
|
".": {
|
|
42
30
|
"require": {
|
|
43
|
-
"types": "./dist/index.d.
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
44
32
|
"default": "./dist/index.cjs"
|
|
45
33
|
},
|
|
46
34
|
"import": {
|
|
@@ -53,5 +41,17 @@
|
|
|
53
41
|
"publishConfig": {
|
|
54
42
|
"registry": "https://registry.npmjs.org/",
|
|
55
43
|
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"scripts": {
|
|
46
|
+
"eslint:check": "pnpm eslint --max-warnings 0 './**/*.ts'",
|
|
47
|
+
"prettier:base": "prettier ./** --ignore-path=../../.prettierignore",
|
|
48
|
+
"prettier:check": "pnpm prettier:base --check",
|
|
49
|
+
"prettier:write": "pnpm prettier:base --write",
|
|
50
|
+
"clean": "rm -rf dist",
|
|
51
|
+
"prepublish": "pnpm test run && pnpm build",
|
|
52
|
+
"build": "pnpm clean && pnpm tsdown",
|
|
53
|
+
"test:ci": "CI=1 pnpm t run",
|
|
54
|
+
"test": "vitest",
|
|
55
|
+
"coverage": "vitest run --coverage"
|
|
56
56
|
}
|
|
57
|
-
}
|
|
57
|
+
}
|
package/dist/Client.d.cts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { DeferredPromise } from '@chainflip/utils/async';
|
|
2
|
-
import { RpcMethod, JsonRpcRequest, RpcResult, JsonRpcResponse, RpcRequest } from './common.cjs';
|
|
3
|
-
import '@chainflip/utils/chainflip';
|
|
4
|
-
import '@chainflip/utils/types';
|
|
5
|
-
import 'zod';
|
|
6
|
-
import './parsers.cjs';
|
|
7
|
-
|
|
8
|
-
type Response = {
|
|
9
|
-
success: true;
|
|
10
|
-
id: string;
|
|
11
|
-
result: JsonRpcResponse;
|
|
12
|
-
} | {
|
|
13
|
-
success: false;
|
|
14
|
-
id: string;
|
|
15
|
-
error: Error;
|
|
16
|
-
};
|
|
17
|
-
type RequestMap = Map<string, {
|
|
18
|
-
deferred: DeferredPromise<RpcResult<RpcMethod>>;
|
|
19
|
-
body: JsonRpcRequest<RpcMethod>;
|
|
20
|
-
method: RpcMethod;
|
|
21
|
-
}>;
|
|
22
|
-
type ClientOpts = {
|
|
23
|
-
archiveNodeUrl?: string;
|
|
24
|
-
};
|
|
25
|
-
declare abstract class Client {
|
|
26
|
-
protected readonly url: string;
|
|
27
|
-
private lastRequestId;
|
|
28
|
-
private timer;
|
|
29
|
-
private requestMap;
|
|
30
|
-
private readonly archiveNodeUrl?;
|
|
31
|
-
readonly eventTarget: EventTarget;
|
|
32
|
-
constructor(url: string, opts?: ClientOpts);
|
|
33
|
-
protected abstract send<const T extends RpcMethod>(data: JsonRpcRequest<T>[], clonedMap: RequestMap): Promise<void>;
|
|
34
|
-
private getRequestId;
|
|
35
|
-
private formatRequest;
|
|
36
|
-
protected handleResponse(response: Response, clonedMap: RequestMap): void;
|
|
37
|
-
protected handleErrorResponse(error: Error, clonedMap: RequestMap): void;
|
|
38
|
-
private handleBatch;
|
|
39
|
-
sendRequest<const T extends RpcMethod>(method: T, ...params: RpcRequest[T]): Promise<RpcResult<T>>;
|
|
40
|
-
methods(): RpcMethod[];
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export { type ClientOpts, type RequestMap, type Response, Client as default };
|
package/dist/HttpClient.d.cts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import Client, { RequestMap } from './Client.cjs';
|
|
2
|
-
import { RpcMethod, JsonRpcRequest } from './common.cjs';
|
|
3
|
-
import '@chainflip/utils/async';
|
|
4
|
-
import '@chainflip/utils/chainflip';
|
|
5
|
-
import '@chainflip/utils/types';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import './parsers.cjs';
|
|
8
|
-
|
|
9
|
-
declare class HttpClient extends Client {
|
|
10
|
-
protected send<const T extends RpcMethod>(request: JsonRpcRequest<T>[], requestMap: RequestMap): Promise<void>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export { HttpClient as default };
|
package/dist/WsClient.d.cts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import Client, { ClientOpts, RequestMap } from './Client.cjs';
|
|
2
|
-
import { JsonRpcRequest, RpcMethod } from './common.cjs';
|
|
3
|
-
import '@chainflip/utils/async';
|
|
4
|
-
import '@chainflip/utils/chainflip';
|
|
5
|
-
import '@chainflip/utils/types';
|
|
6
|
-
import 'zod';
|
|
7
|
-
import './parsers.cjs';
|
|
8
|
-
|
|
9
|
-
declare class WsClient extends Client {
|
|
10
|
-
private ws?;
|
|
11
|
-
private reconnectAttempts;
|
|
12
|
-
private emitter;
|
|
13
|
-
private inFlightRequestMap;
|
|
14
|
-
private readonly timeout;
|
|
15
|
-
private shouldConnect;
|
|
16
|
-
constructor(url: string, { timeout, ...opts }?: {
|
|
17
|
-
timeout?: number;
|
|
18
|
-
} & ClientOpts);
|
|
19
|
-
close(): Promise<void>;
|
|
20
|
-
private connectionReady;
|
|
21
|
-
private handleDisconnect;
|
|
22
|
-
private handleMessage;
|
|
23
|
-
private connect;
|
|
24
|
-
protected send(requests: JsonRpcRequest<RpcMethod>[], requestMap: RequestMap): Promise<void>;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export { WsClient as default };
|