@chainflip/rpc 2.1.5 → 2.1.6

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
@@ -749,9 +751,9 @@ const ingressEgressDeposit = z.object({
749
751
  chain: z.string(),
750
752
  asset: z.string()
751
753
  }),
752
- deposit_details: z.union([z.object({ tx_hashes: z.array(z.string()) }), z.object({
753
- tx_id: z.string(),
754
- vout: z.number()
754
+ deposit_details: z.union([z.object({ tx_hashes: z.array(hexString) }), z.object({
755
+ tx_id: z.string().transform((v) => v.startsWith("0x") ? v : `0x${v}`),
756
+ vout: z.number().int()
755
757
  })]).nullable()
756
758
  });
757
759
  const ingressEgressBroadcast = z.object({
@@ -776,11 +778,17 @@ const ingressEgressVaultDeposit = z.object({
776
778
  ccm_deposit_metadata: z.unknown().nullable().optional(),
777
779
  deposit_details: z.unknown().nullable().optional(),
778
780
  broker_fee: z.object({
779
- account: z.string(),
781
+ account: z.string().transform((v) => ss58.encode({
782
+ data: ss58.decode(v).data,
783
+ ss58Format: CHAINFLIP_SS58_PREFIX
784
+ })),
780
785
  bps: z.number()
781
- }).nullable().optional(),
786
+ }).optional(),
782
787
  affiliate_fees: z.array(z.object({
783
- account: z.string(),
788
+ account: z.string().transform((v) => ss58.encode({
789
+ data: ss58.decode(v).data,
790
+ ss58Format: CHAINFLIP_SS58_PREFIX
791
+ })),
784
792
  bps: z.number()
785
793
  })),
786
794
  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.6",
4
4
  "type": "module",
5
5
  "dependencies": {
6
6
  "@chainflip/utils": "2.1.2",