@chainflip/rpc 1.10.3 → 1.11.0-beta.0
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 +4 -4
- package/dist/Client.d.cts +2 -1
- package/dist/Client.d.ts +2 -1
- package/dist/Client.mjs +3 -3
- package/dist/common.d.cts +36 -0
- package/dist/common.d.ts +36 -0
- package/dist/parsers.cjs +14 -1
- package/dist/parsers.d.cts +74 -1
- package/dist/parsers.d.ts +74 -1
- package/dist/parsers.mjs +13 -0
- package/package.json +2 -2
package/dist/Client.cjs
CHANGED
|
@@ -3,9 +3,8 @@ var _async = require('@chainflip/utils/async');
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
var _commoncjs = require('./common.cjs');
|
|
6
|
-
var Client = (_class = class
|
|
7
|
-
constructor(url, opts = {}) {
|
|
8
|
-
super();_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);;
|
|
6
|
+
var Client = (_class = class {
|
|
7
|
+
constructor(url, opts = {}) {;_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);
|
|
9
8
|
this.url = url;
|
|
10
9
|
this.archiveNodeUrl = opts.archiveNodeUrl;
|
|
11
10
|
}
|
|
@@ -13,6 +12,7 @@ var Client = (_class = class extends EventTarget {
|
|
|
13
12
|
__init2() {this.timer = null}
|
|
14
13
|
__init3() {this.requestMap = /* @__PURE__ */ new Map()}
|
|
15
14
|
|
|
15
|
+
__init4() {this.eventTarget = new EventTarget()}
|
|
16
16
|
getRequestId() {
|
|
17
17
|
try {
|
|
18
18
|
return crypto.randomUUID();
|
|
@@ -72,7 +72,7 @@ var Client = (_class = class extends EventTarget {
|
|
|
72
72
|
return deferred.promise.catch((error) => {
|
|
73
73
|
if (error instanceof Error) {
|
|
74
74
|
if (this.archiveNodeUrl && error.message.includes("Unknown block: State already discarded")) {
|
|
75
|
-
this.dispatchEvent(
|
|
75
|
+
this.eventTarget.dispatchEvent(
|
|
76
76
|
new CustomEvent("archiveNodeFallback", { detail: { method, params } })
|
|
77
77
|
);
|
|
78
78
|
return new this.constructor(
|
package/dist/Client.d.cts
CHANGED
|
@@ -21,12 +21,13 @@ type RequestMap = Map<string, {
|
|
|
21
21
|
type ClientOpts = {
|
|
22
22
|
archiveNodeUrl?: string;
|
|
23
23
|
};
|
|
24
|
-
declare abstract class Client
|
|
24
|
+
declare abstract class Client {
|
|
25
25
|
protected readonly url: string;
|
|
26
26
|
private lastRequestId;
|
|
27
27
|
private timer;
|
|
28
28
|
private requestMap;
|
|
29
29
|
private readonly archiveNodeUrl?;
|
|
30
|
+
readonly eventTarget: EventTarget;
|
|
30
31
|
constructor(url: string, opts?: ClientOpts);
|
|
31
32
|
protected abstract send<const T extends RpcMethod>(data: JsonRpcRequest<T>[], clonedMap: RequestMap): Promise<void>;
|
|
32
33
|
private getRequestId;
|
package/dist/Client.d.ts
CHANGED
|
@@ -21,12 +21,13 @@ type RequestMap = Map<string, {
|
|
|
21
21
|
type ClientOpts = {
|
|
22
22
|
archiveNodeUrl?: string;
|
|
23
23
|
};
|
|
24
|
-
declare abstract class Client
|
|
24
|
+
declare abstract class Client {
|
|
25
25
|
protected readonly url: string;
|
|
26
26
|
private lastRequestId;
|
|
27
27
|
private timer;
|
|
28
28
|
private requestMap;
|
|
29
29
|
private readonly archiveNodeUrl?;
|
|
30
|
+
readonly eventTarget: EventTarget;
|
|
30
31
|
constructor(url: string, opts?: ClientOpts);
|
|
31
32
|
protected abstract send<const T extends RpcMethod>(data: JsonRpcRequest<T>[], clonedMap: RequestMap): Promise<void>;
|
|
32
33
|
private getRequestId;
|
package/dist/Client.mjs
CHANGED
|
@@ -3,9 +3,8 @@ import { deferredPromise } from "@chainflip/utils/async";
|
|
|
3
3
|
import {
|
|
4
4
|
rpcResult
|
|
5
5
|
} from "./common.mjs";
|
|
6
|
-
var Client = class
|
|
6
|
+
var Client = class {
|
|
7
7
|
constructor(url, opts = {}) {
|
|
8
|
-
super();
|
|
9
8
|
this.url = url;
|
|
10
9
|
this.archiveNodeUrl = opts.archiveNodeUrl;
|
|
11
10
|
}
|
|
@@ -13,6 +12,7 @@ var Client = class extends EventTarget {
|
|
|
13
12
|
timer = null;
|
|
14
13
|
requestMap = /* @__PURE__ */ new Map();
|
|
15
14
|
archiveNodeUrl;
|
|
15
|
+
eventTarget = new EventTarget();
|
|
16
16
|
getRequestId() {
|
|
17
17
|
try {
|
|
18
18
|
return crypto.randomUUID();
|
|
@@ -72,7 +72,7 @@ var Client = class extends EventTarget {
|
|
|
72
72
|
return deferred.promise.catch((error) => {
|
|
73
73
|
if (error instanceof Error) {
|
|
74
74
|
if (this.archiveNodeUrl && error.message.includes("Unknown block: State already discarded")) {
|
|
75
|
-
this.dispatchEvent(
|
|
75
|
+
this.eventTarget.dispatchEvent(
|
|
76
76
|
new CustomEvent("archiveNodeFallback", { detail: { method, params } })
|
|
77
77
|
);
|
|
78
78
|
return new this.constructor(
|
package/dist/common.d.cts
CHANGED
|
@@ -774,6 +774,42 @@ declare const rpcResult: {
|
|
|
774
774
|
short_id: number;
|
|
775
775
|
withdrawal_address: string;
|
|
776
776
|
}[] | undefined;
|
|
777
|
+
}>, z.ZodObject<{
|
|
778
|
+
role: z.ZodLiteral<"operator">;
|
|
779
|
+
managed_validators: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEffects<z.ZodNumber, bigint, number>, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>]>>;
|
|
780
|
+
delegators: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEffects<z.ZodNumber, bigint, number>, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>]>>;
|
|
781
|
+
settings: z.ZodObject<{
|
|
782
|
+
fee_bps: z.ZodNumber;
|
|
783
|
+
delegation_acceptance: z.ZodEffects<z.ZodUnion<[z.ZodLiteral<"Allow">, z.ZodLiteral<"Deny">]>, boolean, "Allow" | "Deny">;
|
|
784
|
+
}, "strip", z.ZodTypeAny, {
|
|
785
|
+
fee_bps: number;
|
|
786
|
+
delegation_acceptance: boolean;
|
|
787
|
+
}, {
|
|
788
|
+
fee_bps: number;
|
|
789
|
+
delegation_acceptance: "Allow" | "Deny";
|
|
790
|
+
}>;
|
|
791
|
+
allowed: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
792
|
+
blocked: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
793
|
+
}, "strip", z.ZodTypeAny, {
|
|
794
|
+
role: "operator";
|
|
795
|
+
managed_validators: Record<string, bigint>;
|
|
796
|
+
delegators: Record<string, bigint>;
|
|
797
|
+
settings: {
|
|
798
|
+
fee_bps: number;
|
|
799
|
+
delegation_acceptance: boolean;
|
|
800
|
+
};
|
|
801
|
+
allowed: string[];
|
|
802
|
+
blocked: string[];
|
|
803
|
+
}, {
|
|
804
|
+
role: "operator";
|
|
805
|
+
managed_validators: Record<string, string | number>;
|
|
806
|
+
delegators: Record<string, string | number>;
|
|
807
|
+
settings: {
|
|
808
|
+
fee_bps: number;
|
|
809
|
+
delegation_acceptance: "Allow" | "Deny";
|
|
810
|
+
};
|
|
811
|
+
allowed?: string[] | undefined;
|
|
812
|
+
blocked?: string[] | undefined;
|
|
777
813
|
}>, z.ZodObject<{
|
|
778
814
|
role: z.ZodLiteral<"liquidity_provider">;
|
|
779
815
|
balances: z.ZodObject<{
|
package/dist/common.d.ts
CHANGED
|
@@ -774,6 +774,42 @@ declare const rpcResult: {
|
|
|
774
774
|
short_id: number;
|
|
775
775
|
withdrawal_address: string;
|
|
776
776
|
}[] | undefined;
|
|
777
|
+
}>, z.ZodObject<{
|
|
778
|
+
role: z.ZodLiteral<"operator">;
|
|
779
|
+
managed_validators: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEffects<z.ZodNumber, bigint, number>, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>]>>;
|
|
780
|
+
delegators: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEffects<z.ZodNumber, bigint, number>, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>]>>;
|
|
781
|
+
settings: z.ZodObject<{
|
|
782
|
+
fee_bps: z.ZodNumber;
|
|
783
|
+
delegation_acceptance: z.ZodEffects<z.ZodUnion<[z.ZodLiteral<"Allow">, z.ZodLiteral<"Deny">]>, boolean, "Allow" | "Deny">;
|
|
784
|
+
}, "strip", z.ZodTypeAny, {
|
|
785
|
+
fee_bps: number;
|
|
786
|
+
delegation_acceptance: boolean;
|
|
787
|
+
}, {
|
|
788
|
+
fee_bps: number;
|
|
789
|
+
delegation_acceptance: "Allow" | "Deny";
|
|
790
|
+
}>;
|
|
791
|
+
allowed: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
792
|
+
blocked: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
793
|
+
}, "strip", z.ZodTypeAny, {
|
|
794
|
+
role: "operator";
|
|
795
|
+
managed_validators: Record<string, bigint>;
|
|
796
|
+
delegators: Record<string, bigint>;
|
|
797
|
+
settings: {
|
|
798
|
+
fee_bps: number;
|
|
799
|
+
delegation_acceptance: boolean;
|
|
800
|
+
};
|
|
801
|
+
allowed: string[];
|
|
802
|
+
blocked: string[];
|
|
803
|
+
}, {
|
|
804
|
+
role: "operator";
|
|
805
|
+
managed_validators: Record<string, string | number>;
|
|
806
|
+
delegators: Record<string, string | number>;
|
|
807
|
+
settings: {
|
|
808
|
+
fee_bps: number;
|
|
809
|
+
delegation_acceptance: "Allow" | "Deny";
|
|
810
|
+
};
|
|
811
|
+
allowed?: string[] | undefined;
|
|
812
|
+
blocked?: string[] | undefined;
|
|
777
813
|
}>, z.ZodObject<{
|
|
778
814
|
role: z.ZodLiteral<"liquidity_provider">;
|
|
779
815
|
balances: z.ZodObject<{
|
package/dist/parsers.cjs
CHANGED
|
@@ -220,6 +220,17 @@ var broker = _zod.z.object({
|
|
|
220
220
|
_zod.z.object({ account_id: _zod.z.string(), short_id: _zod.z.number(), withdrawal_address: hexString })
|
|
221
221
|
).optional().default([])
|
|
222
222
|
});
|
|
223
|
+
var operator = _zod.z.object({
|
|
224
|
+
role: _zod.z.literal("operator"),
|
|
225
|
+
managed_validators: _zod.z.record(_zod.z.string(), numberOrHex),
|
|
226
|
+
delegators: _zod.z.record(_zod.z.string(), numberOrHex),
|
|
227
|
+
settings: _zod.z.object({
|
|
228
|
+
fee_bps: _zod.z.number(),
|
|
229
|
+
delegation_acceptance: _zod.z.union([_zod.z.literal("Allow"), _zod.z.literal("Deny")]).transform((value) => value === "Allow")
|
|
230
|
+
}),
|
|
231
|
+
allowed: _zod.z.array(_zod.z.string()).optional().default([]),
|
|
232
|
+
blocked: _zod.z.array(_zod.z.string()).optional().default([])
|
|
233
|
+
});
|
|
223
234
|
var boostBalances = _zod.z.array(
|
|
224
235
|
_zod.z.object({
|
|
225
236
|
fee_tier: _zod.z.number(),
|
|
@@ -258,6 +269,7 @@ var validator = _zod.z.object({
|
|
|
258
269
|
var cfAccountInfo = _zod.z.discriminatedUnion("role", [
|
|
259
270
|
unregistered,
|
|
260
271
|
broker,
|
|
272
|
+
operator,
|
|
261
273
|
liquidityProvider,
|
|
262
274
|
validator
|
|
263
275
|
]);
|
|
@@ -573,4 +585,5 @@ var cfSafeModeStatuses = _zod.z.union([
|
|
|
573
585
|
|
|
574
586
|
|
|
575
587
|
|
|
576
|
-
|
|
588
|
+
|
|
589
|
+
exports.broker = broker; exports.brokerRequestSwapDepositAddress = brokerRequestSwapDepositAddress; exports.cfAccountInfo = cfAccountInfo; exports.cfAccounts = cfAccounts; exports.cfAuctionState = cfAuctionState; exports.cfAvailablePools = cfAvailablePools; exports.cfBoostPoolDetails = cfBoostPoolDetails; exports.cfBoostPoolPendingFees = cfBoostPoolPendingFees; exports.cfBoostPoolsDepth = cfBoostPoolsDepth; exports.cfEnvironment = cfEnvironment; exports.cfFailedCallEvm = cfFailedCallEvm; exports.cfFlipSuppy = cfFlipSuppy; exports.cfFundingEnvironment = cfFundingEnvironment; exports.cfGetTradingStrategies = cfGetTradingStrategies; exports.cfGetTradingStrategyLimits = cfGetTradingStrategyLimits; exports.cfIngressEgressEnvironment = cfIngressEgressEnvironment; exports.cfPoolDepth = cfPoolDepth; exports.cfPoolOrderbook = cfPoolOrderbook; exports.cfPoolOrders = cfPoolOrders; exports.cfPoolPriceV2 = cfPoolPriceV2; exports.cfPoolsEnvironment = cfPoolsEnvironment; exports.cfSafeModeStatuses = cfSafeModeStatuses; exports.cfSupportedAssets = cfSupportedAssets; exports.cfSwapRate = cfSwapRate; exports.cfSwapRateV2 = cfSwapRateV2; exports.cfSwapRateV3 = cfSwapRateV3; exports.cfSwappingEnvironment = cfSwappingEnvironment; exports.cfTradingStrategy = cfTradingStrategy; exports.chainGetBlockHash = chainGetBlockHash; exports.ethereumAddress = ethereumAddress; exports.hexString = hexString; exports.liquidityProvider = liquidityProvider; exports.lpTotalBalances = lpTotalBalances; exports.numberOrHex = numberOrHex; exports.operator = operator; exports.requestSwapParameterEncoding = requestSwapParameterEncoding; exports.rpcResponse = rpcResponse; exports.stateGetMetadata = stateGetMetadata; exports.stateGetRuntimeVersion = stateGetRuntimeVersion; exports.u256 = u256; exports.unregistered = unregistered; exports.validator = validator;
|
package/dist/parsers.d.cts
CHANGED
|
@@ -17335,6 +17335,43 @@ declare const broker: z.ZodObject<{
|
|
|
17335
17335
|
withdrawal_address: string;
|
|
17336
17336
|
}[] | undefined;
|
|
17337
17337
|
}>;
|
|
17338
|
+
declare const operator: z.ZodObject<{
|
|
17339
|
+
role: z.ZodLiteral<"operator">;
|
|
17340
|
+
managed_validators: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEffects<z.ZodNumber, bigint, number>, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>]>>;
|
|
17341
|
+
delegators: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEffects<z.ZodNumber, bigint, number>, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>]>>;
|
|
17342
|
+
settings: z.ZodObject<{
|
|
17343
|
+
fee_bps: z.ZodNumber;
|
|
17344
|
+
delegation_acceptance: z.ZodEffects<z.ZodUnion<[z.ZodLiteral<"Allow">, z.ZodLiteral<"Deny">]>, boolean, "Allow" | "Deny">;
|
|
17345
|
+
}, "strip", z.ZodTypeAny, {
|
|
17346
|
+
fee_bps: number;
|
|
17347
|
+
delegation_acceptance: boolean;
|
|
17348
|
+
}, {
|
|
17349
|
+
fee_bps: number;
|
|
17350
|
+
delegation_acceptance: "Allow" | "Deny";
|
|
17351
|
+
}>;
|
|
17352
|
+
allowed: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
17353
|
+
blocked: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
17354
|
+
}, "strip", z.ZodTypeAny, {
|
|
17355
|
+
role: "operator";
|
|
17356
|
+
managed_validators: Record<string, bigint>;
|
|
17357
|
+
delegators: Record<string, bigint>;
|
|
17358
|
+
settings: {
|
|
17359
|
+
fee_bps: number;
|
|
17360
|
+
delegation_acceptance: boolean;
|
|
17361
|
+
};
|
|
17362
|
+
allowed: string[];
|
|
17363
|
+
blocked: string[];
|
|
17364
|
+
}, {
|
|
17365
|
+
role: "operator";
|
|
17366
|
+
managed_validators: Record<string, string | number>;
|
|
17367
|
+
delegators: Record<string, string | number>;
|
|
17368
|
+
settings: {
|
|
17369
|
+
fee_bps: number;
|
|
17370
|
+
delegation_acceptance: "Allow" | "Deny";
|
|
17371
|
+
};
|
|
17372
|
+
allowed?: string[] | undefined;
|
|
17373
|
+
blocked?: string[] | undefined;
|
|
17374
|
+
}>;
|
|
17338
17375
|
declare const liquidityProvider: z.ZodObject<{
|
|
17339
17376
|
role: z.ZodLiteral<"liquidity_provider">;
|
|
17340
17377
|
balances: z.ZodObject<{
|
|
@@ -19036,6 +19073,42 @@ declare const cfAccountInfo: z.ZodDiscriminatedUnion<"role", [z.ZodObject<{
|
|
|
19036
19073
|
short_id: number;
|
|
19037
19074
|
withdrawal_address: string;
|
|
19038
19075
|
}[] | undefined;
|
|
19076
|
+
}>, z.ZodObject<{
|
|
19077
|
+
role: z.ZodLiteral<"operator">;
|
|
19078
|
+
managed_validators: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEffects<z.ZodNumber, bigint, number>, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>]>>;
|
|
19079
|
+
delegators: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEffects<z.ZodNumber, bigint, number>, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>]>>;
|
|
19080
|
+
settings: z.ZodObject<{
|
|
19081
|
+
fee_bps: z.ZodNumber;
|
|
19082
|
+
delegation_acceptance: z.ZodEffects<z.ZodUnion<[z.ZodLiteral<"Allow">, z.ZodLiteral<"Deny">]>, boolean, "Allow" | "Deny">;
|
|
19083
|
+
}, "strip", z.ZodTypeAny, {
|
|
19084
|
+
fee_bps: number;
|
|
19085
|
+
delegation_acceptance: boolean;
|
|
19086
|
+
}, {
|
|
19087
|
+
fee_bps: number;
|
|
19088
|
+
delegation_acceptance: "Allow" | "Deny";
|
|
19089
|
+
}>;
|
|
19090
|
+
allowed: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
19091
|
+
blocked: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
19092
|
+
}, "strip", z.ZodTypeAny, {
|
|
19093
|
+
role: "operator";
|
|
19094
|
+
managed_validators: Record<string, bigint>;
|
|
19095
|
+
delegators: Record<string, bigint>;
|
|
19096
|
+
settings: {
|
|
19097
|
+
fee_bps: number;
|
|
19098
|
+
delegation_acceptance: boolean;
|
|
19099
|
+
};
|
|
19100
|
+
allowed: string[];
|
|
19101
|
+
blocked: string[];
|
|
19102
|
+
}, {
|
|
19103
|
+
role: "operator";
|
|
19104
|
+
managed_validators: Record<string, string | number>;
|
|
19105
|
+
delegators: Record<string, string | number>;
|
|
19106
|
+
settings: {
|
|
19107
|
+
fee_bps: number;
|
|
19108
|
+
delegation_acceptance: "Allow" | "Deny";
|
|
19109
|
+
};
|
|
19110
|
+
allowed?: string[] | undefined;
|
|
19111
|
+
blocked?: string[] | undefined;
|
|
19039
19112
|
}>, z.ZodObject<{
|
|
19040
19113
|
role: z.ZodLiteral<"liquidity_provider">;
|
|
19041
19114
|
balances: z.ZodObject<{
|
|
@@ -26158,4 +26231,4 @@ declare const cfSafeModeStatuses: z.ZodUnion<[z.ZodObject<{
|
|
|
26158
26231
|
} | undefined;
|
|
26159
26232
|
}>]>;
|
|
26160
26233
|
|
|
26161
|
-
export { type AssetAndChain, type RpcLimitOrder, type RpcRangeOrder, broker, brokerRequestSwapDepositAddress, cfAccountInfo, cfAccounts, cfAuctionState, cfAvailablePools, cfBoostPoolDetails, cfBoostPoolPendingFees, cfBoostPoolsDepth, cfEnvironment, cfFailedCallEvm, cfFlipSuppy, cfFundingEnvironment, cfGetTradingStrategies, cfGetTradingStrategyLimits, cfIngressEgressEnvironment, cfPoolDepth, cfPoolOrderbook, cfPoolOrders, cfPoolPriceV2, cfPoolsEnvironment, cfSafeModeStatuses, cfSupportedAssets, cfSwapRate, cfSwapRateV2, cfSwapRateV3, cfSwappingEnvironment, cfTradingStrategy, chainGetBlockHash, ethereumAddress, hexString, liquidityProvider, lpTotalBalances, numberOrHex, requestSwapParameterEncoding, rpcResponse, stateGetMetadata, stateGetRuntimeVersion, u256, unregistered, validator };
|
|
26234
|
+
export { type AssetAndChain, type RpcLimitOrder, type RpcRangeOrder, broker, brokerRequestSwapDepositAddress, cfAccountInfo, cfAccounts, cfAuctionState, cfAvailablePools, cfBoostPoolDetails, cfBoostPoolPendingFees, cfBoostPoolsDepth, cfEnvironment, cfFailedCallEvm, cfFlipSuppy, cfFundingEnvironment, cfGetTradingStrategies, cfGetTradingStrategyLimits, cfIngressEgressEnvironment, cfPoolDepth, cfPoolOrderbook, cfPoolOrders, cfPoolPriceV2, cfPoolsEnvironment, cfSafeModeStatuses, cfSupportedAssets, cfSwapRate, cfSwapRateV2, cfSwapRateV3, cfSwappingEnvironment, cfTradingStrategy, chainGetBlockHash, ethereumAddress, hexString, liquidityProvider, lpTotalBalances, numberOrHex, operator, requestSwapParameterEncoding, rpcResponse, stateGetMetadata, stateGetRuntimeVersion, u256, unregistered, validator };
|
package/dist/parsers.d.ts
CHANGED
|
@@ -17335,6 +17335,43 @@ declare const broker: z.ZodObject<{
|
|
|
17335
17335
|
withdrawal_address: string;
|
|
17336
17336
|
}[] | undefined;
|
|
17337
17337
|
}>;
|
|
17338
|
+
declare const operator: z.ZodObject<{
|
|
17339
|
+
role: z.ZodLiteral<"operator">;
|
|
17340
|
+
managed_validators: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEffects<z.ZodNumber, bigint, number>, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>]>>;
|
|
17341
|
+
delegators: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEffects<z.ZodNumber, bigint, number>, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>]>>;
|
|
17342
|
+
settings: z.ZodObject<{
|
|
17343
|
+
fee_bps: z.ZodNumber;
|
|
17344
|
+
delegation_acceptance: z.ZodEffects<z.ZodUnion<[z.ZodLiteral<"Allow">, z.ZodLiteral<"Deny">]>, boolean, "Allow" | "Deny">;
|
|
17345
|
+
}, "strip", z.ZodTypeAny, {
|
|
17346
|
+
fee_bps: number;
|
|
17347
|
+
delegation_acceptance: boolean;
|
|
17348
|
+
}, {
|
|
17349
|
+
fee_bps: number;
|
|
17350
|
+
delegation_acceptance: "Allow" | "Deny";
|
|
17351
|
+
}>;
|
|
17352
|
+
allowed: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
17353
|
+
blocked: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
17354
|
+
}, "strip", z.ZodTypeAny, {
|
|
17355
|
+
role: "operator";
|
|
17356
|
+
managed_validators: Record<string, bigint>;
|
|
17357
|
+
delegators: Record<string, bigint>;
|
|
17358
|
+
settings: {
|
|
17359
|
+
fee_bps: number;
|
|
17360
|
+
delegation_acceptance: boolean;
|
|
17361
|
+
};
|
|
17362
|
+
allowed: string[];
|
|
17363
|
+
blocked: string[];
|
|
17364
|
+
}, {
|
|
17365
|
+
role: "operator";
|
|
17366
|
+
managed_validators: Record<string, string | number>;
|
|
17367
|
+
delegators: Record<string, string | number>;
|
|
17368
|
+
settings: {
|
|
17369
|
+
fee_bps: number;
|
|
17370
|
+
delegation_acceptance: "Allow" | "Deny";
|
|
17371
|
+
};
|
|
17372
|
+
allowed?: string[] | undefined;
|
|
17373
|
+
blocked?: string[] | undefined;
|
|
17374
|
+
}>;
|
|
17338
17375
|
declare const liquidityProvider: z.ZodObject<{
|
|
17339
17376
|
role: z.ZodLiteral<"liquidity_provider">;
|
|
17340
17377
|
balances: z.ZodObject<{
|
|
@@ -19036,6 +19073,42 @@ declare const cfAccountInfo: z.ZodDiscriminatedUnion<"role", [z.ZodObject<{
|
|
|
19036
19073
|
short_id: number;
|
|
19037
19074
|
withdrawal_address: string;
|
|
19038
19075
|
}[] | undefined;
|
|
19076
|
+
}>, z.ZodObject<{
|
|
19077
|
+
role: z.ZodLiteral<"operator">;
|
|
19078
|
+
managed_validators: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEffects<z.ZodNumber, bigint, number>, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>]>>;
|
|
19079
|
+
delegators: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEffects<z.ZodNumber, bigint, number>, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>]>>;
|
|
19080
|
+
settings: z.ZodObject<{
|
|
19081
|
+
fee_bps: z.ZodNumber;
|
|
19082
|
+
delegation_acceptance: z.ZodEffects<z.ZodUnion<[z.ZodLiteral<"Allow">, z.ZodLiteral<"Deny">]>, boolean, "Allow" | "Deny">;
|
|
19083
|
+
}, "strip", z.ZodTypeAny, {
|
|
19084
|
+
fee_bps: number;
|
|
19085
|
+
delegation_acceptance: boolean;
|
|
19086
|
+
}, {
|
|
19087
|
+
fee_bps: number;
|
|
19088
|
+
delegation_acceptance: "Allow" | "Deny";
|
|
19089
|
+
}>;
|
|
19090
|
+
allowed: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
19091
|
+
blocked: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
19092
|
+
}, "strip", z.ZodTypeAny, {
|
|
19093
|
+
role: "operator";
|
|
19094
|
+
managed_validators: Record<string, bigint>;
|
|
19095
|
+
delegators: Record<string, bigint>;
|
|
19096
|
+
settings: {
|
|
19097
|
+
fee_bps: number;
|
|
19098
|
+
delegation_acceptance: boolean;
|
|
19099
|
+
};
|
|
19100
|
+
allowed: string[];
|
|
19101
|
+
blocked: string[];
|
|
19102
|
+
}, {
|
|
19103
|
+
role: "operator";
|
|
19104
|
+
managed_validators: Record<string, string | number>;
|
|
19105
|
+
delegators: Record<string, string | number>;
|
|
19106
|
+
settings: {
|
|
19107
|
+
fee_bps: number;
|
|
19108
|
+
delegation_acceptance: "Allow" | "Deny";
|
|
19109
|
+
};
|
|
19110
|
+
allowed?: string[] | undefined;
|
|
19111
|
+
blocked?: string[] | undefined;
|
|
19039
19112
|
}>, z.ZodObject<{
|
|
19040
19113
|
role: z.ZodLiteral<"liquidity_provider">;
|
|
19041
19114
|
balances: z.ZodObject<{
|
|
@@ -26158,4 +26231,4 @@ declare const cfSafeModeStatuses: z.ZodUnion<[z.ZodObject<{
|
|
|
26158
26231
|
} | undefined;
|
|
26159
26232
|
}>]>;
|
|
26160
26233
|
|
|
26161
|
-
export { type AssetAndChain, type RpcLimitOrder, type RpcRangeOrder, broker, brokerRequestSwapDepositAddress, cfAccountInfo, cfAccounts, cfAuctionState, cfAvailablePools, cfBoostPoolDetails, cfBoostPoolPendingFees, cfBoostPoolsDepth, cfEnvironment, cfFailedCallEvm, cfFlipSuppy, cfFundingEnvironment, cfGetTradingStrategies, cfGetTradingStrategyLimits, cfIngressEgressEnvironment, cfPoolDepth, cfPoolOrderbook, cfPoolOrders, cfPoolPriceV2, cfPoolsEnvironment, cfSafeModeStatuses, cfSupportedAssets, cfSwapRate, cfSwapRateV2, cfSwapRateV3, cfSwappingEnvironment, cfTradingStrategy, chainGetBlockHash, ethereumAddress, hexString, liquidityProvider, lpTotalBalances, numberOrHex, requestSwapParameterEncoding, rpcResponse, stateGetMetadata, stateGetRuntimeVersion, u256, unregistered, validator };
|
|
26234
|
+
export { type AssetAndChain, type RpcLimitOrder, type RpcRangeOrder, broker, brokerRequestSwapDepositAddress, cfAccountInfo, cfAccounts, cfAuctionState, cfAvailablePools, cfBoostPoolDetails, cfBoostPoolPendingFees, cfBoostPoolsDepth, cfEnvironment, cfFailedCallEvm, cfFlipSuppy, cfFundingEnvironment, cfGetTradingStrategies, cfGetTradingStrategyLimits, cfIngressEgressEnvironment, cfPoolDepth, cfPoolOrderbook, cfPoolOrders, cfPoolPriceV2, cfPoolsEnvironment, cfSafeModeStatuses, cfSupportedAssets, cfSwapRate, cfSwapRateV2, cfSwapRateV3, cfSwappingEnvironment, cfTradingStrategy, chainGetBlockHash, ethereumAddress, hexString, liquidityProvider, lpTotalBalances, numberOrHex, operator, requestSwapParameterEncoding, rpcResponse, stateGetMetadata, stateGetRuntimeVersion, u256, unregistered, validator };
|
package/dist/parsers.mjs
CHANGED
|
@@ -220,6 +220,17 @@ var broker = z.object({
|
|
|
220
220
|
z.object({ account_id: z.string(), short_id: z.number(), withdrawal_address: hexString })
|
|
221
221
|
).optional().default([])
|
|
222
222
|
});
|
|
223
|
+
var operator = z.object({
|
|
224
|
+
role: z.literal("operator"),
|
|
225
|
+
managed_validators: z.record(z.string(), numberOrHex),
|
|
226
|
+
delegators: z.record(z.string(), numberOrHex),
|
|
227
|
+
settings: z.object({
|
|
228
|
+
fee_bps: z.number(),
|
|
229
|
+
delegation_acceptance: z.union([z.literal("Allow"), z.literal("Deny")]).transform((value) => value === "Allow")
|
|
230
|
+
}),
|
|
231
|
+
allowed: z.array(z.string()).optional().default([]),
|
|
232
|
+
blocked: z.array(z.string()).optional().default([])
|
|
233
|
+
});
|
|
223
234
|
var boostBalances = z.array(
|
|
224
235
|
z.object({
|
|
225
236
|
fee_tier: z.number(),
|
|
@@ -258,6 +269,7 @@ var validator = z.object({
|
|
|
258
269
|
var cfAccountInfo = z.discriminatedUnion("role", [
|
|
259
270
|
unregistered,
|
|
260
271
|
broker,
|
|
272
|
+
operator,
|
|
261
273
|
liquidityProvider,
|
|
262
274
|
validator
|
|
263
275
|
]);
|
|
@@ -566,6 +578,7 @@ export {
|
|
|
566
578
|
liquidityProvider,
|
|
567
579
|
lpTotalBalances,
|
|
568
580
|
numberOrHex,
|
|
581
|
+
operator,
|
|
569
582
|
requestSwapParameterEncoding,
|
|
570
583
|
rpcResponse,
|
|
571
584
|
stateGetMetadata,
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainflip/rpc",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0-beta.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@chainflip/utils": "0.8.6",
|
|
7
7
|
"zod": "^3.25.75"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"@types/node": "^24.0
|
|
10
|
+
"@types/node": "^24.1.0",
|
|
11
11
|
"@types/ws": "^8.18.1",
|
|
12
12
|
"ws": "^8.18.3"
|
|
13
13
|
},
|