viem 0.2.0-canary.20230314T220053 → 0.2.0-canary.20230314T222417

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.
Files changed (39) hide show
  1. package/dist/abi.js +2 -2
  2. package/dist/abi.mjs +1 -1
  3. package/dist/chains.js +63 -63
  4. package/dist/chains.mjs +1 -1
  5. package/dist/{chunk-SA6IPLJF.js → chunk-4APUUDQK.js} +4 -3
  6. package/dist/chunk-4APUUDQK.js.map +1 -0
  7. package/dist/{chunk-EUMT64YW.js → chunk-FGHDFVEC.js} +19 -19
  8. package/dist/{chunk-S53L3VGF.mjs → chunk-MGOCDAKD.mjs} +4 -3
  9. package/dist/{chunk-S53L3VGF.mjs.map → chunk-MGOCDAKD.mjs.map} +1 -1
  10. package/dist/{chunk-6CRQ2Z6Y.mjs → chunk-NVOOOH72.mjs} +2 -2
  11. package/dist/contract.d.ts +1 -1
  12. package/dist/contract.js +2 -2
  13. package/dist/contract.mjs +1 -1
  14. package/dist/{createPublicClient-3f3b6b26.d.ts → createPublicClient-0021fc35.d.ts} +1 -1
  15. package/dist/ens.d.ts +1 -1
  16. package/dist/ens.js +3 -3
  17. package/dist/ens.mjs +2 -2
  18. package/dist/ethers.d.ts +1 -1
  19. package/dist/ethers.js +3 -3
  20. package/dist/ethers.mjs +1 -1
  21. package/dist/index.d.ts +3 -3
  22. package/dist/index.js +90 -90
  23. package/dist/index.mjs +2 -2
  24. package/dist/{parseGwei-c2f9e338.d.ts → parseGwei-eda6728f.d.ts} +1 -1
  25. package/dist/public.d.ts +1 -1
  26. package/dist/public.js +2 -2
  27. package/dist/public.mjs +1 -1
  28. package/dist/test.js +2 -2
  29. package/dist/test.mjs +1 -1
  30. package/dist/utils/index.d.ts +4 -4
  31. package/dist/utils/index.js +2 -2
  32. package/dist/utils/index.mjs +1 -1
  33. package/dist/wallet.d.ts +1 -1
  34. package/dist/wallet.js +2 -2
  35. package/dist/wallet.mjs +1 -1
  36. package/package.json +1 -1
  37. package/dist/chunk-SA6IPLJF.js.map +0 -1
  38. /package/dist/{chunk-EUMT64YW.js.map → chunk-FGHDFVEC.js.map} +0 -0
  39. /package/dist/{chunk-6CRQ2Z6Y.mjs.map → chunk-NVOOOH72.mjs.map} +0 -0
@@ -11,27 +11,27 @@
11
11
 
12
12
 
13
13
 
14
- var _chunkSA6IPLJFjs = require('./chunk-SA6IPLJF.js');
14
+ var _chunk4APUUDQKjs = require('./chunk-4APUUDQK.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 _chunkSA6IPLJFjs.bytesToHex.call(void 0, result);
21
- return _chunkSA6IPLJFjs.keccak256.call(void 0, _chunkSA6IPLJFjs.stringToBytes.call(void 0, label));
20
+ return _chunk4APUUDQKjs.bytesToHex.call(void 0, result);
21
+ return _chunk4APUUDQKjs.keccak256.call(void 0, _chunk4APUUDQKjs.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 _chunkSA6IPLJFjs.bytesToHex.call(void 0, result);
28
+ return _chunk4APUUDQKjs.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 = _chunkSA6IPLJFjs.keccak256.call(void 0, _chunkSA6IPLJFjs.stringToBytes.call(void 0, labels[i]), "bytes");
32
- result = _chunkSA6IPLJFjs.keccak256.call(void 0, _chunkSA6IPLJFjs.concat.call(void 0, [result, hashed]), "bytes");
31
+ const hashed = _chunk4APUUDQKjs.keccak256.call(void 0, _chunk4APUUDQKjs.stringToBytes.call(void 0, labels[i]), "bytes");
32
+ result = _chunk4APUUDQKjs.keccak256.call(void 0, _chunk4APUUDQKjs.concat.call(void 0, [result, hashed]), "bytes");
33
33
  }
34
- return _chunkSA6IPLJFjs.bytesToHex.call(void 0, result);
34
+ return _chunk4APUUDQKjs.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 _chunkSA6IPLJFjs.toBytes.call(void 0, value2.replace(/^\.|\.$/gm, "")).length + 2;
42
+ return _chunk4APUUDQKjs.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 = _chunkSA6IPLJFjs.toBytes.call(void 0, list[i]);
51
+ const encoded = _chunk4APUUDQKjs.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 = _chunkSA6IPLJFjs.getChainContractAddress.call(void 0, {
72
+ universalResolverAddress = _chunk4APUUDQKjs.getChainContractAddress.call(void 0, {
73
73
  blockNumber,
74
74
  chain: client.chain,
75
75
  contract: "ensUniversalResolver"
76
76
  });
77
77
  }
78
- const res = await _chunkSA6IPLJFjs.readContract.call(void 0, client, {
78
+ const res = await _chunk4APUUDQKjs.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
- _chunkSA6IPLJFjs.toHex.call(void 0, packetToBytes(name)),
98
- _chunkSA6IPLJFjs.encodeFunctionData.call(void 0, {
97
+ _chunk4APUUDQKjs.toHex.call(void 0, packetToBytes(name)),
98
+ _chunk4APUUDQKjs.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 _chunkSA6IPLJFjs.decodeFunctionResult.call(void 0, {
115
+ return _chunk4APUUDQKjs.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 = _chunkSA6IPLJFjs.getChainContractAddress.call(void 0, {
143
+ universalResolverAddress = _chunk4APUUDQKjs.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 _chunkSA6IPLJFjs.readContract.call(void 0, client, {
151
+ const res = await _chunk4APUUDQKjs.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: [_chunkSA6IPLJFjs.toHex.call(void 0, packetToBytes(reverseNode))],
168
+ args: [_chunk4APUUDQKjs.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 _chunkSA6IPLJFjs.ContractFunctionExecutionError && error.cause.reason === _chunkSA6IPLJFjs.panicReasons[50])
174
+ if (error instanceof _chunk4APUUDQKjs.ContractFunctionExecutionError && error.cause.reason === _chunk4APUUDQKjs.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-EUMT64YW.js.map
186
+ //# sourceMappingURL=chunk-FGHDFVEC.js.map
@@ -4156,9 +4156,10 @@ async function multicall(client, args) {
4156
4156
  allowFailure = true,
4157
4157
  blockNumber,
4158
4158
  blockTag,
4159
- contracts,
4159
+ contracts: contracts_,
4160
4160
  multicallAddress: multicallAddress_
4161
4161
  } = args;
4162
+ const contracts = contracts_;
4162
4163
  let multicallAddress = multicallAddress_;
4163
4164
  if (!multicallAddress) {
4164
4165
  if (!client.chain)
@@ -4221,7 +4222,7 @@ async function multicall(client, args) {
4221
4222
  data: returnData,
4222
4223
  functionName
4223
4224
  });
4224
- return { result, status: "success" };
4225
+ return allowFailure ? { result, status: "success" } : result;
4225
4226
  } catch (err) {
4226
4227
  const error = getContractError(err, {
4227
4228
  abi,
@@ -5589,4 +5590,4 @@ export {
5589
5590
  formatGwei,
5590
5591
  parseEther
5591
5592
  };
5592
- //# sourceMappingURL=chunk-S53L3VGF.mjs.map
5593
+ //# sourceMappingURL=chunk-MGOCDAKD.mjs.map