@chainflip/rpc 2.0.6 → 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/types.cjs CHANGED
@@ -1 +0,0 @@
1
- "use strict";
package/dist/types.d.ts CHANGED
@@ -1,11 +1,8 @@
1
- import { z } from 'zod';
2
- import { RpcResult, RpcResponse } from './common.js';
3
- export { RpcMethod, RpcRequest as RpcParams } from './common.js';
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 { type CfAccountInfo, type CfAccountInfoResponse, type CfAccounts, type CfAccountsResponse, type CfAuctionState, type CfAuctionStateResponse, type CfAvailablePools, type CfAvailablePoolsResponse, type CfBoostPoolDetails, type CfBoostPoolDetailsResponse, type CfBoostPoolPendingFees, type CfBoostPoolPendingFeesResponse, type CfBoostPoolsDepth, type CfBoostPoolsDepthResponse, type CfBrokerAccount, type CfEncodeCfParameters, type CfEncodeCfParametersResponse, type CfEnvironment, type CfEnvironmentResponse, type CfFailedCallArbitrum, type CfFailedCallArbitrumResponse, type CfFailedCallEthereum, type CfFailedCallEthereumResponse, type CfFlipSupply, type CfFlipSupplyResponse, type CfFundingEnvironment, type CfFundingEnvironmentResponse, type CfGetTradingStrategies, type CfGetTradingStrategiesResponse, type CfGetTradingStrategyLimits, type CfGetTradingStrategyLimitsResponse, type CfIngressEgressEnvironment, type CfIngressEgressEnvironmentResponse, type CfLendingConfig, type CfLendingConfigResponse, type CfLendingPoolSupplyBalances, type CfLendingPoolSupplyBalancesResponse, type CfLendingPools, type CfLendingPoolsResponse, type CfLiquidityProviderAccount, type CfLoanAccounts, type CfLoanAccountsResponse, type CfMonitoringSimulateAuction, type CfMonitoringSimulateAuctionResponse, type CfOperatorAccount, type CfOraclePrices, type CfOraclePricesResponse, type CfPoolDepth, type CfPoolDepthResponse, type CfPoolOrderbook, type CfPoolOrderbookResponse, type CfPoolOrders, type CfPoolOrdersResponse, type CfPoolPriceV2, type CfPoolPriceV2Response, type CfPoolsEnvironment, type CfPoolsEnvironmentResponse, type CfRequestSwapParameterEncoding, type CfRequestSwapParameterEncodingResponse, type CfSafeModeStatuses, type CfSafeModeStatusesResponse, type CfSupportedAssets, type CfSupportedAssetsResponse, type CfSwapRate, type CfSwapRateResponse, type CfSwapRateV2, type CfSwapRateV2Response, type CfSwapRateV3, type CfSwapRateV3Response, type CfSwappingEnvironment, type CfSwappingEnvironmentResponse, type CfUnregisteredAccount, type CfValidatorAccount, type CfVaultAddresses, type CfVaultAddressesResponse, type LpTotalBalances, type LpTotalBalancesResponse, RpcResult };
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,15 +1,15 @@
1
1
  {
2
2
  "name": "@chainflip/rpc",
3
- "version": "2.0.6",
3
+ "version": "2.0.7-wbtc-dev.2",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "@chainflip/utils": "0.11.0",
6
+ "@chainflip/utils": "0.11.2-wbtc-dev.2",
7
7
  "zod": "^3.25.75"
8
8
  },
9
9
  "devDependencies": {
10
- "@types/node": "^24.10.1",
10
+ "@types/node": "^25.0.10",
11
11
  "@types/ws": "^8.18.1",
12
- "ws": "^8.18.3"
12
+ "ws": "^8.19.0"
13
13
  },
14
14
  "files": [
15
15
  "dist",
@@ -18,7 +18,7 @@
18
18
  "exports": {
19
19
  "./*": {
20
20
  "require": {
21
- "types": "./dist/*.d.cts",
21
+ "types": "./dist/*.d.ts",
22
22
  "default": "./dist/*.cjs"
23
23
  },
24
24
  "import": {
@@ -28,7 +28,7 @@
28
28
  },
29
29
  ".": {
30
30
  "require": {
31
- "types": "./dist/index.d.cts",
31
+ "types": "./dist/index.d.ts",
32
32
  "default": "./dist/index.cjs"
33
33
  },
34
34
  "import": {
@@ -49,7 +49,7 @@
49
49
  "prettier:write": "pnpm prettier:base --write",
50
50
  "clean": "rm -rf dist",
51
51
  "prepublish": "pnpm test run && pnpm build",
52
- "build": "pnpm clean && pnpm tsup",
52
+ "build": "pnpm clean && pnpm tsdown",
53
53
  "test:ci": "CI=1 pnpm t run",
54
54
  "test": "vitest",
55
55
  "coverage": "vitest run --coverage"
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 };
@@ -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 };
@@ -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 };