viem 0.1.21 → 0.1.22

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.
@@ -11,27 +11,27 @@
11
11
 
12
12
 
13
13
 
14
- var _chunkM5K2FJOMjs = require('./chunk-M5K2FJOM.js');
14
+ var _chunkBGUMUWIEjs = require('./chunk-BGUMUWIE.js');
15
15
 
16
16
  // src/utils/ens/labelhash.ts
17
17
  function labelhash(label) {
18
18
  let result = new Uint8Array(32).fill(0);
19
19
  if (!label)
20
- return _chunkM5K2FJOMjs.bytesToHex.call(void 0, result);
21
- return _chunkM5K2FJOMjs.keccak256.call(void 0, _chunkM5K2FJOMjs.stringToBytes.call(void 0, label));
20
+ return _chunkBGUMUWIEjs.bytesToHex.call(void 0, result);
21
+ return _chunkBGUMUWIEjs.keccak256.call(void 0, _chunkBGUMUWIEjs.stringToBytes.call(void 0, label));
22
22
  }
23
23
 
24
24
  // src/utils/ens/namehash.ts
25
25
  function namehash(name) {
26
26
  let result = new Uint8Array(32).fill(0);
27
27
  if (!name)
28
- return _chunkM5K2FJOMjs.bytesToHex.call(void 0, result);
28
+ return _chunkBGUMUWIEjs.bytesToHex.call(void 0, result);
29
29
  const labels = name.split(".");
30
30
  for (let i = labels.length - 1; i >= 0; i -= 1) {
31
- const hashed = _chunkM5K2FJOMjs.keccak256.call(void 0, _chunkM5K2FJOMjs.stringToBytes.call(void 0, labels[i]), "bytes");
32
- result = _chunkM5K2FJOMjs.keccak256.call(void 0, _chunkM5K2FJOMjs.concat.call(void 0, [result, hashed]), "bytes");
31
+ const hashed = _chunkBGUMUWIEjs.keccak256.call(void 0, _chunkBGUMUWIEjs.stringToBytes.call(void 0, labels[i]), "bytes");
32
+ result = _chunkBGUMUWIEjs.keccak256.call(void 0, _chunkBGUMUWIEjs.concat.call(void 0, [result, hashed]), "bytes");
33
33
  }
34
- return _chunkM5K2FJOMjs.bytesToHex.call(void 0, result);
34
+ return _chunkBGUMUWIEjs.bytesToHex.call(void 0, result);
35
35
  }
36
36
 
37
37
  // src/utils/ens/packetToBytes.ts
@@ -39,7 +39,7 @@ function packetToBytes(packet) {
39
39
  function length(value2) {
40
40
  if (value2 === "." || value2 === "..")
41
41
  return 1;
42
- return _chunkM5K2FJOMjs.toBytes.call(void 0, value2.replace(/^\.|\.$/gm, "")).length + 2;
42
+ return _chunkBGUMUWIEjs.toBytes.call(void 0, value2.replace(/^\.|\.$/gm, "")).length + 2;
43
43
  }
44
44
  const bytes = new Uint8Array(length(packet));
45
45
  const value = packet.replace(/^\.|\.$/gm, "");
@@ -48,7 +48,7 @@ function packetToBytes(packet) {
48
48
  let offset = 0;
49
49
  const list = value.split(".");
50
50
  for (let i = 0; i < list.length; i++) {
51
- const encoded = _chunkM5K2FJOMjs.toBytes.call(void 0, list[i]);
51
+ const encoded = _chunkBGUMUWIEjs.toBytes.call(void 0, list[i]);
52
52
  bytes[offset] = encoded.length;
53
53
  bytes.set(encoded, offset + 1);
54
54
  offset += encoded.length + 1;
@@ -69,13 +69,13 @@ async function getEnsAddress(client, {
69
69
  throw new Error(
70
70
  "client chain not configured. universalResolverAddress is required."
71
71
  );
72
- universalResolverAddress = _chunkM5K2FJOMjs.getChainContractAddress.call(void 0, {
72
+ universalResolverAddress = _chunkBGUMUWIEjs.getChainContractAddress.call(void 0, {
73
73
  blockNumber,
74
74
  chain: client.chain,
75
75
  contract: "ensUniversalResolver"
76
76
  });
77
77
  }
78
- const res = await _chunkM5K2FJOMjs.readContract.call(void 0, client, {
78
+ const res = await _chunkBGUMUWIEjs.readContract.call(void 0, client, {
79
79
  address: universalResolverAddress,
80
80
  abi: [
81
81
  {
@@ -94,8 +94,8 @@ async function getEnsAddress(client, {
94
94
  ],
95
95
  functionName: "resolve",
96
96
  args: [
97
- _chunkM5K2FJOMjs.toHex.call(void 0, packetToBytes(name)),
98
- _chunkM5K2FJOMjs.encodeFunctionData.call(void 0, {
97
+ _chunkBGUMUWIEjs.toHex.call(void 0, packetToBytes(name)),
98
+ _chunkBGUMUWIEjs.encodeFunctionData.call(void 0, {
99
99
  abi: [
100
100
  {
101
101
  name: "addr",
@@ -112,7 +112,7 @@ async function getEnsAddress(client, {
112
112
  blockNumber,
113
113
  blockTag
114
114
  });
115
- return _chunkM5K2FJOMjs.decodeFunctionResult.call(void 0, {
115
+ return _chunkBGUMUWIEjs.decodeFunctionResult.call(void 0, {
116
116
  abi: [
117
117
  {
118
118
  name: "addr",
@@ -140,7 +140,7 @@ async function getEnsName(client, {
140
140
  throw new Error(
141
141
  "client chain not configured. universalResolverAddress is required."
142
142
  );
143
- universalResolverAddress = _chunkM5K2FJOMjs.getChainContractAddress.call(void 0, {
143
+ universalResolverAddress = _chunkBGUMUWIEjs.getChainContractAddress.call(void 0, {
144
144
  blockNumber,
145
145
  chain: client.chain,
146
146
  contract: "ensUniversalResolver"
@@ -148,7 +148,7 @@ async function getEnsName(client, {
148
148
  }
149
149
  const reverseNode = `${address.toLowerCase().substring(2)}.addr.reverse`;
150
150
  try {
151
- const res = await _chunkM5K2FJOMjs.readContract.call(void 0, client, {
151
+ const res = await _chunkBGUMUWIEjs.readContract.call(void 0, client, {
152
152
  address: universalResolverAddress,
153
153
  abi: [
154
154
  {
@@ -165,13 +165,13 @@ async function getEnsName(client, {
165
165
  }
166
166
  ],
167
167
  functionName: "reverse",
168
- args: [_chunkM5K2FJOMjs.toHex.call(void 0, packetToBytes(reverseNode))],
168
+ args: [_chunkBGUMUWIEjs.toHex.call(void 0, packetToBytes(reverseNode))],
169
169
  blockNumber,
170
170
  blockTag
171
171
  });
172
172
  return res[0];
173
173
  } catch (error) {
174
- if (error instanceof _chunkM5K2FJOMjs.ContractFunctionExecutionError && error.cause.reason === _chunkM5K2FJOMjs.panicReasons[50])
174
+ if (error instanceof _chunkBGUMUWIEjs.ContractFunctionExecutionError && error.cause.reason === _chunkBGUMUWIEjs.panicReasons[50])
175
175
  return null;
176
176
  throw error;
177
177
  }
@@ -183,4 +183,4 @@ async function getEnsName(client, {
183
183
 
184
184
 
185
185
  exports.labelhash = labelhash; exports.namehash = namehash; exports.getEnsAddress = getEnsAddress; exports.getEnsName = getEnsName;
186
- //# sourceMappingURL=chunk-YYL4XXAP.js.map
186
+ //# sourceMappingURL=chunk-JI5BLUJI.js.map
@@ -20,7 +20,7 @@ import "abitype";
20
20
  var package_default = {
21
21
  name: "viem",
22
22
  description: "TypeScript Interface for Ethereum",
23
- version: "0.1.21",
23
+ version: "0.1.22",
24
24
  scripts: {
25
25
  anvil: "source .env && anvil --fork-url $VITE_ANVIL_FORK_URL --fork-block-number $VITE_ANVIL_BLOCK_NUMBER --block-time $VITE_ANVIL_BLOCK_TIME",
26
26
  bench: "vitest bench --no-threads",
@@ -194,7 +194,7 @@ var package_default = {
194
194
  },
195
195
  pnpm: {
196
196
  patchedDependencies: {
197
- "vitepress@1.0.0-alpha.49": "patches/vitepress@1.0.0-alpha.49.patch"
197
+ "vitepress@1.0.0-alpha.61": "patches/vitepress@1.0.0-alpha.61.patch"
198
198
  },
199
199
  peerDependencyRules: {
200
200
  ignoreMissing: [
@@ -1811,7 +1811,7 @@ function parse2(value) {
1811
1811
  function format2(bytes, to) {
1812
1812
  if (Array.isArray(bytes))
1813
1813
  return bytes.map((b) => format2(b, to));
1814
- return to === "hex" ? trim(bytesToHex(bytes)) : bytes;
1814
+ return to === "hex" ? bytesToHex(bytes) : bytes;
1815
1815
  }
1816
1816
  function rlpToBytes(bytes, offset = 0) {
1817
1817
  if (bytes.length === 0)
@@ -5593,4 +5593,4 @@ export {
5593
5593
  formatGwei,
5594
5594
  parseEther
5595
5595
  };
5596
- //# sourceMappingURL=chunk-HZ3XNLWB.mjs.map
5596
+ //# sourceMappingURL=chunk-N4453NXA.mjs.map