@chainflip/rpc 1.4.1 → 1.4.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/parsers.mjs CHANGED
@@ -5,13 +5,18 @@ import { z } from "zod";
5
5
  var hexString = z.string().refine(isHex, { message: "Invalid hex string" });
6
6
  var u256 = hexString.transform((value) => BigInt(value));
7
7
  var numberOrHex = z.union([z.number().transform((n) => BigInt(n)), u256]);
8
- var chainAssetMapFactory = (parser) => z.object({
8
+ var chainAssetMapFactory = (parser, defaultValue) => z.object({
9
9
  Bitcoin: z.object({ BTC: parser }),
10
10
  Ethereum: z.object({ ETH: parser, USDC: parser, FLIP: parser, USDT: parser }),
11
11
  Polkadot: z.object({ DOT: parser }),
12
- Arbitrum: z.object({ ETH: parser, USDC: parser })
12
+ Arbitrum: z.object({ ETH: parser.default(defaultValue), USDC: parser.default(defaultValue) })
13
+ });
14
+ var chainMapFactory = (parser, defaultValue) => z.object({
15
+ Bitcoin: parser,
16
+ Ethereum: parser,
17
+ Polkadot: parser,
18
+ Arbitrum: parser.default(defaultValue)
13
19
  });
14
- var chainMapFactory = (parser) => z.object({ Bitcoin: parser, Ethereum: parser, Polkadot: parser, Arbitrum: parser });
15
20
  var rpcAssetSchema = z.union([
16
21
  z.object({ chain: z.literal("Bitcoin"), asset: z.literal("BTC") }),
17
22
  z.object({ chain: z.literal("Polkadot"), asset: z.literal("DOT") }),
@@ -63,15 +68,15 @@ var stateGetRuntimeVersion = z.object({
63
68
  stateVersion: z.number()
64
69
  });
65
70
  var cfIngressEgressEnvironment = z.object({
66
- minimum_deposit_amounts: chainAssetMapFactory(numberOrHex),
67
- ingress_fees: chainAssetMapFactory(numberOrHex.nullable()),
68
- egress_fees: chainAssetMapFactory(numberOrHex.nullable()),
69
- witness_safety_margins: chainMapFactory(z.number().nullable()),
70
- egress_dust_limits: chainAssetMapFactory(numberOrHex),
71
- channel_opening_fees: chainMapFactory(numberOrHex)
71
+ minimum_deposit_amounts: chainAssetMapFactory(numberOrHex, 0),
72
+ ingress_fees: chainAssetMapFactory(numberOrHex.nullable(), null),
73
+ egress_fees: chainAssetMapFactory(numberOrHex.nullable(), null),
74
+ witness_safety_margins: chainMapFactory(z.number().nullable(), null),
75
+ egress_dust_limits: chainAssetMapFactory(numberOrHex, 0),
76
+ channel_opening_fees: chainMapFactory(numberOrHex, 0)
72
77
  }).transform(rename({ egress_dust_limits: "minimum_egress_amounts" }));
73
78
  var cfSwappingEnvironment = z.object({
74
- maximum_swap_amounts: chainAssetMapFactory(numberOrHex.nullable()),
79
+ maximum_swap_amounts: chainAssetMapFactory(numberOrHex.nullable(), null),
75
80
  network_fee_hundredth_pips: z.number()
76
81
  });
77
82
  var cfFundingEnvironment = z.object({
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@chainflip/rpc",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "type": "module",
5
5
  "dependencies": {
6
- "@chainflip/utils": "^0.1.3",
6
+ "@chainflip/utils": "^0.3.0",
7
7
  "zod": "^3.22.8"
8
8
  },
9
9
  "devDependencies": {
@@ -22,8 +22,8 @@
22
22
  "default": "./dist/*.cjs"
23
23
  },
24
24
  "import": {
25
- "types": "./dist/*.d.ts",
26
- "default": "./dist/*.js"
25
+ "types": "./dist/*.d.mts",
26
+ "default": "./dist/*.mjs"
27
27
  }
28
28
  },
29
29
  ".": {
@@ -32,8 +32,8 @@
32
32
  "default": "./dist/index.cjs"
33
33
  },
34
34
  "import": {
35
- "types": "./dist/index.d.ts",
36
- "default": "./dist/index.js"
35
+ "types": "./dist/index.d.mts",
36
+ "default": "./dist/index.mjs"
37
37
  }
38
38
  }
39
39
  },