@chainflip/rpc 1.8.1 → 1.8.3

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/common.d.cts CHANGED
@@ -333,7 +333,7 @@ declare const rpcResult: {
333
333
  }[];
334
334
  }>]>;
335
335
  readonly cf_accounts: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>, "many">;
336
- readonly cf_account_info: z.ZodUnion<[z.ZodObject<{
336
+ readonly cf_account_info: z.ZodDiscriminatedUnion<"role", [z.ZodObject<{
337
337
  role: z.ZodLiteral<"unregistered">;
338
338
  flip_balance: z.ZodUnion<[z.ZodEffects<z.ZodNumber, bigint, number>, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>]>;
339
339
  }, "strip", z.ZodTypeAny, {
@@ -439,7 +439,7 @@ declare const rpcResult: {
439
439
  SOL?: string | number | undefined;
440
440
  } | undefined;
441
441
  }>;
442
- btc_vault_deposit_address: z.ZodNullable<z.ZodString>;
442
+ btc_vault_deposit_address: z.ZodOptional<z.ZodNullable<z.ZodString>>;
443
443
  }, "strip", z.ZodTypeAny, {
444
444
  role: "broker";
445
445
  flip_balance: bigint;
@@ -465,7 +465,7 @@ declare const rpcResult: {
465
465
  DOT: bigint;
466
466
  };
467
467
  };
468
- btc_vault_deposit_address: string | null;
468
+ btc_vault_deposit_address?: string | null | undefined;
469
469
  }, {
470
470
  role: "broker";
471
471
  flip_balance: string | number;
@@ -491,7 +491,7 @@ declare const rpcResult: {
491
491
  SOL?: string | number | undefined;
492
492
  } | undefined;
493
493
  };
494
- btc_vault_deposit_address: string | null;
494
+ btc_vault_deposit_address?: string | null | undefined;
495
495
  }>, z.ZodObject<{
496
496
  role: z.ZodLiteral<"liquidity_provider">;
497
497
  balances: z.ZodObject<{
@@ -13785,6 +13785,7 @@ declare const rpcResult: {
13785
13785
  account_id: string;
13786
13786
  pending_deposits: bigint[];
13787
13787
  }>, "many">;
13788
+ network_fee_deduction_percent: z.ZodOptional<z.ZodNumber>;
13788
13789
  }, "strip", z.ZodTypeAny, {
13789
13790
  fee_tier: number;
13790
13791
  available_amounts: {
@@ -13802,6 +13803,7 @@ declare const rpcResult: {
13802
13803
  account_id: string;
13803
13804
  pending_deposits: bigint[];
13804
13805
  }[];
13806
+ network_fee_deduction_percent?: number | undefined;
13805
13807
  }, {
13806
13808
  fee_tier: number;
13807
13809
  available_amounts: {
@@ -13819,6 +13821,7 @@ declare const rpcResult: {
13819
13821
  account_id: string;
13820
13822
  pending_deposits: bigint[];
13821
13823
  }[];
13824
+ network_fee_deduction_percent?: number | undefined;
13822
13825
  }>>, "many">;
13823
13826
  readonly cf_boost_pool_pending_fees: z.ZodArray<z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
13824
13827
  chain: z.ZodLiteral<"Bitcoin">;
package/dist/common.d.ts CHANGED
@@ -333,7 +333,7 @@ declare const rpcResult: {
333
333
  }[];
334
334
  }>]>;
335
335
  readonly cf_accounts: z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodString], null>, "many">;
336
- readonly cf_account_info: z.ZodUnion<[z.ZodObject<{
336
+ readonly cf_account_info: z.ZodDiscriminatedUnion<"role", [z.ZodObject<{
337
337
  role: z.ZodLiteral<"unregistered">;
338
338
  flip_balance: z.ZodUnion<[z.ZodEffects<z.ZodNumber, bigint, number>, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>]>;
339
339
  }, "strip", z.ZodTypeAny, {
@@ -439,7 +439,7 @@ declare const rpcResult: {
439
439
  SOL?: string | number | undefined;
440
440
  } | undefined;
441
441
  }>;
442
- btc_vault_deposit_address: z.ZodNullable<z.ZodString>;
442
+ btc_vault_deposit_address: z.ZodOptional<z.ZodNullable<z.ZodString>>;
443
443
  }, "strip", z.ZodTypeAny, {
444
444
  role: "broker";
445
445
  flip_balance: bigint;
@@ -465,7 +465,7 @@ declare const rpcResult: {
465
465
  DOT: bigint;
466
466
  };
467
467
  };
468
- btc_vault_deposit_address: string | null;
468
+ btc_vault_deposit_address?: string | null | undefined;
469
469
  }, {
470
470
  role: "broker";
471
471
  flip_balance: string | number;
@@ -491,7 +491,7 @@ declare const rpcResult: {
491
491
  SOL?: string | number | undefined;
492
492
  } | undefined;
493
493
  };
494
- btc_vault_deposit_address: string | null;
494
+ btc_vault_deposit_address?: string | null | undefined;
495
495
  }>, z.ZodObject<{
496
496
  role: z.ZodLiteral<"liquidity_provider">;
497
497
  balances: z.ZodObject<{
@@ -13785,6 +13785,7 @@ declare const rpcResult: {
13785
13785
  account_id: string;
13786
13786
  pending_deposits: bigint[];
13787
13787
  }>, "many">;
13788
+ network_fee_deduction_percent: z.ZodOptional<z.ZodNumber>;
13788
13789
  }, "strip", z.ZodTypeAny, {
13789
13790
  fee_tier: number;
13790
13791
  available_amounts: {
@@ -13802,6 +13803,7 @@ declare const rpcResult: {
13802
13803
  account_id: string;
13803
13804
  pending_deposits: bigint[];
13804
13805
  }[];
13806
+ network_fee_deduction_percent?: number | undefined;
13805
13807
  }, {
13806
13808
  fee_tier: number;
13807
13809
  available_amounts: {
@@ -13819,6 +13821,7 @@ declare const rpcResult: {
13819
13821
  account_id: string;
13820
13822
  pending_deposits: bigint[];
13821
13823
  }[];
13824
+ network_fee_deduction_percent?: number | undefined;
13822
13825
  }>>, "many">;
13823
13826
  readonly cf_boost_pool_pending_fees: z.ZodArray<z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
13824
13827
  chain: z.ZodLiteral<"Bitcoin">;
package/dist/parsers.cjs CHANGED
@@ -191,7 +191,7 @@ var broker = _zod.z.object({
191
191
  role: _zod.z.literal("broker"),
192
192
  flip_balance: numberOrHex,
193
193
  earned_fees: chainAssetMapFactory(numberOrHex, 0),
194
- btc_vault_deposit_address: _zod.z.string().nullable()
194
+ btc_vault_deposit_address: _zod.z.string().nullable().optional()
195
195
  });
196
196
  var boostBalances = _zod.z.array(
197
197
  _zod.z.object({
@@ -226,7 +226,12 @@ var validator = _zod.z.object({
226
226
  apy_bp: _zod.z.number().nullable(),
227
227
  restricted_balances: _zod.z.record(hexString, numberOrHex)
228
228
  });
229
- var cfAccountInfo = _zod.z.union([unregistered, broker, liquidityProvider, validator]);
229
+ var cfAccountInfo = _zod.z.discriminatedUnion("role", [
230
+ unregistered,
231
+ broker,
232
+ liquidityProvider,
233
+ validator
234
+ ]);
230
235
  var cfAccounts = _zod.z.array(_zod.z.tuple([_zod.z.string(), _zod.z.string()]));
231
236
  var cfPoolPriceV2 = _zod.z.object({
232
237
  sell: numberOrHex.nullable(),
@@ -287,7 +292,8 @@ var cfBoostPoolDetails = _zod.z.array(
287
292
  account_id: _zod.z.string(),
288
293
  pending_deposits: _zod.z.array(_zod.z.bigint())
289
294
  })
290
- )
295
+ ),
296
+ network_fee_deduction_percent: _zod.z.number().optional()
291
297
  })
292
298
  )
293
299
  );
@@ -11873,7 +11873,7 @@ declare const broker: z.ZodObject<{
11873
11873
  SOL?: string | number | undefined;
11874
11874
  } | undefined;
11875
11875
  }>;
11876
- btc_vault_deposit_address: z.ZodNullable<z.ZodString>;
11876
+ btc_vault_deposit_address: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11877
11877
  }, "strip", z.ZodTypeAny, {
11878
11878
  role: "broker";
11879
11879
  flip_balance: bigint;
@@ -11899,7 +11899,7 @@ declare const broker: z.ZodObject<{
11899
11899
  DOT: bigint;
11900
11900
  };
11901
11901
  };
11902
- btc_vault_deposit_address: string | null;
11902
+ btc_vault_deposit_address?: string | null | undefined;
11903
11903
  }, {
11904
11904
  role: "broker";
11905
11905
  flip_balance: string | number;
@@ -11925,7 +11925,7 @@ declare const broker: z.ZodObject<{
11925
11925
  SOL?: string | number | undefined;
11926
11926
  } | undefined;
11927
11927
  };
11928
- btc_vault_deposit_address: string | null;
11928
+ btc_vault_deposit_address?: string | null | undefined;
11929
11929
  }>;
11930
11930
  declare const liquidityProvider: z.ZodObject<{
11931
11931
  role: z.ZodLiteral<"liquidity_provider">;
@@ -12970,7 +12970,7 @@ declare const validator: z.ZodObject<{
12970
12970
  apy_bp: number | null;
12971
12971
  restricted_balances: Record<string, string | number>;
12972
12972
  }>;
12973
- declare const cfAccountInfo: z.ZodUnion<[z.ZodObject<{
12973
+ declare const cfAccountInfo: z.ZodDiscriminatedUnion<"role", [z.ZodObject<{
12974
12974
  role: z.ZodLiteral<"unregistered">;
12975
12975
  flip_balance: z.ZodUnion<[z.ZodEffects<z.ZodNumber, bigint, number>, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>]>;
12976
12976
  }, "strip", z.ZodTypeAny, {
@@ -13076,7 +13076,7 @@ declare const cfAccountInfo: z.ZodUnion<[z.ZodObject<{
13076
13076
  SOL?: string | number | undefined;
13077
13077
  } | undefined;
13078
13078
  }>;
13079
- btc_vault_deposit_address: z.ZodNullable<z.ZodString>;
13079
+ btc_vault_deposit_address: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13080
13080
  }, "strip", z.ZodTypeAny, {
13081
13081
  role: "broker";
13082
13082
  flip_balance: bigint;
@@ -13102,7 +13102,7 @@ declare const cfAccountInfo: z.ZodUnion<[z.ZodObject<{
13102
13102
  DOT: bigint;
13103
13103
  };
13104
13104
  };
13105
- btc_vault_deposit_address: string | null;
13105
+ btc_vault_deposit_address?: string | null | undefined;
13106
13106
  }, {
13107
13107
  role: "broker";
13108
13108
  flip_balance: string | number;
@@ -13128,7 +13128,7 @@ declare const cfAccountInfo: z.ZodUnion<[z.ZodObject<{
13128
13128
  SOL?: string | number | undefined;
13129
13129
  } | undefined;
13130
13130
  };
13131
- btc_vault_deposit_address: string | null;
13131
+ btc_vault_deposit_address?: string | null | undefined;
13132
13132
  }>, z.ZodObject<{
13133
13133
  role: z.ZodLiteral<"liquidity_provider">;
13134
13134
  balances: z.ZodObject<{
@@ -15033,6 +15033,7 @@ declare const cfBoostPoolDetails: z.ZodArray<z.ZodIntersection<z.ZodUnion<[z.Zod
15033
15033
  account_id: string;
15034
15034
  pending_deposits: bigint[];
15035
15035
  }>, "many">;
15036
+ network_fee_deduction_percent: z.ZodOptional<z.ZodNumber>;
15036
15037
  }, "strip", z.ZodTypeAny, {
15037
15038
  fee_tier: number;
15038
15039
  available_amounts: {
@@ -15050,6 +15051,7 @@ declare const cfBoostPoolDetails: z.ZodArray<z.ZodIntersection<z.ZodUnion<[z.Zod
15050
15051
  account_id: string;
15051
15052
  pending_deposits: bigint[];
15052
15053
  }[];
15054
+ network_fee_deduction_percent?: number | undefined;
15053
15055
  }, {
15054
15056
  fee_tier: number;
15055
15057
  available_amounts: {
@@ -15067,6 +15069,7 @@ declare const cfBoostPoolDetails: z.ZodArray<z.ZodIntersection<z.ZodUnion<[z.Zod
15067
15069
  account_id: string;
15068
15070
  pending_deposits: bigint[];
15069
15071
  }[];
15072
+ network_fee_deduction_percent?: number | undefined;
15070
15073
  }>>, "many">;
15071
15074
  declare const cfBoostPoolPendingFees: z.ZodArray<z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
15072
15075
  chain: z.ZodLiteral<"Bitcoin">;
package/dist/parsers.d.ts CHANGED
@@ -11873,7 +11873,7 @@ declare const broker: z.ZodObject<{
11873
11873
  SOL?: string | number | undefined;
11874
11874
  } | undefined;
11875
11875
  }>;
11876
- btc_vault_deposit_address: z.ZodNullable<z.ZodString>;
11876
+ btc_vault_deposit_address: z.ZodOptional<z.ZodNullable<z.ZodString>>;
11877
11877
  }, "strip", z.ZodTypeAny, {
11878
11878
  role: "broker";
11879
11879
  flip_balance: bigint;
@@ -11899,7 +11899,7 @@ declare const broker: z.ZodObject<{
11899
11899
  DOT: bigint;
11900
11900
  };
11901
11901
  };
11902
- btc_vault_deposit_address: string | null;
11902
+ btc_vault_deposit_address?: string | null | undefined;
11903
11903
  }, {
11904
11904
  role: "broker";
11905
11905
  flip_balance: string | number;
@@ -11925,7 +11925,7 @@ declare const broker: z.ZodObject<{
11925
11925
  SOL?: string | number | undefined;
11926
11926
  } | undefined;
11927
11927
  };
11928
- btc_vault_deposit_address: string | null;
11928
+ btc_vault_deposit_address?: string | null | undefined;
11929
11929
  }>;
11930
11930
  declare const liquidityProvider: z.ZodObject<{
11931
11931
  role: z.ZodLiteral<"liquidity_provider">;
@@ -12970,7 +12970,7 @@ declare const validator: z.ZodObject<{
12970
12970
  apy_bp: number | null;
12971
12971
  restricted_balances: Record<string, string | number>;
12972
12972
  }>;
12973
- declare const cfAccountInfo: z.ZodUnion<[z.ZodObject<{
12973
+ declare const cfAccountInfo: z.ZodDiscriminatedUnion<"role", [z.ZodObject<{
12974
12974
  role: z.ZodLiteral<"unregistered">;
12975
12975
  flip_balance: z.ZodUnion<[z.ZodEffects<z.ZodNumber, bigint, number>, z.ZodEffects<z.ZodEffects<z.ZodString, `0x${string}`, string>, bigint, string>]>;
12976
12976
  }, "strip", z.ZodTypeAny, {
@@ -13076,7 +13076,7 @@ declare const cfAccountInfo: z.ZodUnion<[z.ZodObject<{
13076
13076
  SOL?: string | number | undefined;
13077
13077
  } | undefined;
13078
13078
  }>;
13079
- btc_vault_deposit_address: z.ZodNullable<z.ZodString>;
13079
+ btc_vault_deposit_address: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13080
13080
  }, "strip", z.ZodTypeAny, {
13081
13081
  role: "broker";
13082
13082
  flip_balance: bigint;
@@ -13102,7 +13102,7 @@ declare const cfAccountInfo: z.ZodUnion<[z.ZodObject<{
13102
13102
  DOT: bigint;
13103
13103
  };
13104
13104
  };
13105
- btc_vault_deposit_address: string | null;
13105
+ btc_vault_deposit_address?: string | null | undefined;
13106
13106
  }, {
13107
13107
  role: "broker";
13108
13108
  flip_balance: string | number;
@@ -13128,7 +13128,7 @@ declare const cfAccountInfo: z.ZodUnion<[z.ZodObject<{
13128
13128
  SOL?: string | number | undefined;
13129
13129
  } | undefined;
13130
13130
  };
13131
- btc_vault_deposit_address: string | null;
13131
+ btc_vault_deposit_address?: string | null | undefined;
13132
13132
  }>, z.ZodObject<{
13133
13133
  role: z.ZodLiteral<"liquidity_provider">;
13134
13134
  balances: z.ZodObject<{
@@ -15033,6 +15033,7 @@ declare const cfBoostPoolDetails: z.ZodArray<z.ZodIntersection<z.ZodUnion<[z.Zod
15033
15033
  account_id: string;
15034
15034
  pending_deposits: bigint[];
15035
15035
  }>, "many">;
15036
+ network_fee_deduction_percent: z.ZodOptional<z.ZodNumber>;
15036
15037
  }, "strip", z.ZodTypeAny, {
15037
15038
  fee_tier: number;
15038
15039
  available_amounts: {
@@ -15050,6 +15051,7 @@ declare const cfBoostPoolDetails: z.ZodArray<z.ZodIntersection<z.ZodUnion<[z.Zod
15050
15051
  account_id: string;
15051
15052
  pending_deposits: bigint[];
15052
15053
  }[];
15054
+ network_fee_deduction_percent?: number | undefined;
15053
15055
  }, {
15054
15056
  fee_tier: number;
15055
15057
  available_amounts: {
@@ -15067,6 +15069,7 @@ declare const cfBoostPoolDetails: z.ZodArray<z.ZodIntersection<z.ZodUnion<[z.Zod
15067
15069
  account_id: string;
15068
15070
  pending_deposits: bigint[];
15069
15071
  }[];
15072
+ network_fee_deduction_percent?: number | undefined;
15070
15073
  }>>, "many">;
15071
15074
  declare const cfBoostPoolPendingFees: z.ZodArray<z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
15072
15075
  chain: z.ZodLiteral<"Bitcoin">;
package/dist/parsers.mjs CHANGED
@@ -191,7 +191,7 @@ var broker = z.object({
191
191
  role: z.literal("broker"),
192
192
  flip_balance: numberOrHex,
193
193
  earned_fees: chainAssetMapFactory(numberOrHex, 0),
194
- btc_vault_deposit_address: z.string().nullable()
194
+ btc_vault_deposit_address: z.string().nullable().optional()
195
195
  });
196
196
  var boostBalances = z.array(
197
197
  z.object({
@@ -226,7 +226,12 @@ var validator = z.object({
226
226
  apy_bp: z.number().nullable(),
227
227
  restricted_balances: z.record(hexString, numberOrHex)
228
228
  });
229
- var cfAccountInfo = z.union([unregistered, broker, liquidityProvider, validator]);
229
+ var cfAccountInfo = z.discriminatedUnion("role", [
230
+ unregistered,
231
+ broker,
232
+ liquidityProvider,
233
+ validator
234
+ ]);
230
235
  var cfAccounts = z.array(z.tuple([z.string(), z.string()]));
231
236
  var cfPoolPriceV2 = z.object({
232
237
  sell: numberOrHex.nullable(),
@@ -287,7 +292,8 @@ var cfBoostPoolDetails = z.array(
287
292
  account_id: z.string(),
288
293
  pending_deposits: z.array(z.bigint())
289
294
  })
290
- )
295
+ ),
296
+ network_fee_deduction_percent: z.number().optional()
291
297
  })
292
298
  )
293
299
  );
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@chainflip/rpc",
3
- "version": "1.8.1",
3
+ "version": "1.8.3",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@chainflip/utils": "0.4.0",
7
7
  "zod": "^3.24.1"
8
8
  },
9
9
  "devDependencies": {
10
- "@types/node": "^22.13.0",
10
+ "@types/node": "^22.13.1",
11
11
  "@types/ws": "^8.5.14",
12
12
  "ws": "^8.18.0"
13
13
  },