@chainflip/rpc 2.1.5 → 2.1.7-dev.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/parsers.mjs CHANGED
@@ -1,7 +1,9 @@
1
1
  import { z } from "zod";
2
2
  import { bytesToHex } from "@chainflip/utils/bytes";
3
3
  import { priceAssets } from "@chainflip/utils/chainflip";
4
+ import { CHAINFLIP_SS58_PREFIX } from "@chainflip/utils/consts";
4
5
  import { isUndefined } from "@chainflip/utils/guard";
6
+ import * as ss58 from "@chainflip/utils/ss58";
5
7
  import { isHex } from "@chainflip/utils/string";
6
8
 
7
9
  //#region src/parsers.ts
@@ -562,6 +564,14 @@ const cfTradingStrategy = z.object({
562
564
  min_sell_tick: z.number(),
563
565
  max_sell_tick: z.number(),
564
566
  base_asset: rpcAssetSchema
567
+ }) }),
568
+ z.object({ OracleTracking: z.object({
569
+ min_buy_offset_tick: z.number(),
570
+ max_buy_offset_tick: z.number(),
571
+ min_sell_offset_tick: z.number(),
572
+ max_sell_offset_tick: z.number(),
573
+ base_asset: rpcAssetSchema,
574
+ quote_asset: rpcAssetSchema
565
575
  }) })
566
576
  ]),
567
577
  balance: z.array(z.tuple([rpcAssetSchema, numberOrHex]))
@@ -749,9 +759,9 @@ const ingressEgressDeposit = z.object({
749
759
  chain: z.string(),
750
760
  asset: z.string()
751
761
  }),
752
- deposit_details: z.union([z.object({ tx_hashes: z.array(z.string()) }), z.object({
753
- tx_id: z.string(),
754
- vout: z.number()
762
+ deposit_details: z.union([z.object({ tx_hashes: z.array(hexString) }), z.object({
763
+ tx_id: z.string().transform((v) => v.startsWith("0x") ? v : `0x${v}`),
764
+ vout: z.number().int()
755
765
  })]).nullable()
756
766
  });
757
767
  const ingressEgressBroadcast = z.object({
@@ -776,11 +786,17 @@ const ingressEgressVaultDeposit = z.object({
776
786
  ccm_deposit_metadata: z.unknown().nullable().optional(),
777
787
  deposit_details: z.unknown().nullable().optional(),
778
788
  broker_fee: z.object({
779
- account: z.string(),
789
+ account: z.string().transform((v) => ss58.encode({
790
+ data: ss58.decode(v).data,
791
+ ss58Format: CHAINFLIP_SS58_PREFIX
792
+ })),
780
793
  bps: z.number()
781
- }).nullable().optional(),
794
+ }).optional(),
782
795
  affiliate_fees: z.array(z.object({
783
- account: z.string(),
796
+ account: z.string().transform((v) => ss58.encode({
797
+ data: ss58.decode(v).data,
798
+ ss58Format: CHAINFLIP_SS58_PREFIX
799
+ })),
784
800
  bps: z.number()
785
801
  })),
786
802
  refund_params: z.object({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainflip/rpc",
3
- "version": "2.1.5",
3
+ "version": "2.1.7-dev.0",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@chainflip/utils": "2.1.2",