viem 0.2.0-canary.20230316T020523 → 0.2.0-canary.20230316T042447

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 (42) 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-ZTHR4YS2.js → chunk-A5BRAPQQ.js} +3 -3
  6. package/dist/chunk-A5BRAPQQ.js.map +1 -0
  7. package/dist/{chunk-FDTKU2PS.js → chunk-GZ67J32T.js} +19 -19
  8. package/dist/{chunk-MWJLP6MO.mjs → chunk-ISLCPEI2.mjs} +3 -3
  9. package/dist/chunk-ISLCPEI2.mjs.map +1 -0
  10. package/dist/{chunk-7OP5XRWB.mjs → chunk-PLALZ2GD.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-0021fc35.d.ts → createPublicClient-75540130.d.ts} +2 -2
  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 +92 -90
  23. package/dist/index.js.map +1 -1
  24. package/dist/index.mjs +4 -2
  25. package/dist/index.mjs.map +1 -1
  26. package/dist/{parseGwei-c2fb9fa2.d.ts → parseGwei-6fff7cbe.d.ts} +1 -1
  27. package/dist/public.d.ts +1 -1
  28. package/dist/public.js +2 -2
  29. package/dist/public.mjs +1 -1
  30. package/dist/test.js +2 -2
  31. package/dist/test.mjs +1 -1
  32. package/dist/utils/index.d.ts +4 -4
  33. package/dist/utils/index.js +2 -2
  34. package/dist/utils/index.mjs +1 -1
  35. package/dist/wallet.d.ts +1 -1
  36. package/dist/wallet.js +2 -2
  37. package/dist/wallet.mjs +1 -1
  38. package/package.json +1 -1
  39. package/dist/chunk-MWJLP6MO.mjs.map +0 -1
  40. package/dist/chunk-ZTHR4YS2.js.map +0 -1
  41. /package/dist/{chunk-FDTKU2PS.js.map → chunk-GZ67J32T.js.map} +0 -0
  42. /package/dist/{chunk-7OP5XRWB.mjs.map → chunk-PLALZ2GD.mjs.map} +0 -0
@@ -11,27 +11,27 @@
11
11
 
12
12
 
13
13
 
14
- var _chunkZTHR4YS2js = require('./chunk-ZTHR4YS2.js');
14
+ var _chunkA5BRAPQQjs = require('./chunk-A5BRAPQQ.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 _chunkZTHR4YS2js.bytesToHex.call(void 0, result);
21
- return _chunkZTHR4YS2js.keccak256.call(void 0, _chunkZTHR4YS2js.stringToBytes.call(void 0, label));
20
+ return _chunkA5BRAPQQjs.bytesToHex.call(void 0, result);
21
+ return _chunkA5BRAPQQjs.keccak256.call(void 0, _chunkA5BRAPQQjs.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 _chunkZTHR4YS2js.bytesToHex.call(void 0, result);
28
+ return _chunkA5BRAPQQjs.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 = _chunkZTHR4YS2js.keccak256.call(void 0, _chunkZTHR4YS2js.stringToBytes.call(void 0, labels[i]), "bytes");
32
- result = _chunkZTHR4YS2js.keccak256.call(void 0, _chunkZTHR4YS2js.concat.call(void 0, [result, hashed]), "bytes");
31
+ const hashed = _chunkA5BRAPQQjs.keccak256.call(void 0, _chunkA5BRAPQQjs.stringToBytes.call(void 0, labels[i]), "bytes");
32
+ result = _chunkA5BRAPQQjs.keccak256.call(void 0, _chunkA5BRAPQQjs.concat.call(void 0, [result, hashed]), "bytes");
33
33
  }
34
- return _chunkZTHR4YS2js.bytesToHex.call(void 0, result);
34
+ return _chunkA5BRAPQQjs.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 _chunkZTHR4YS2js.toBytes.call(void 0, value2.replace(/^\.|\.$/gm, "")).length + 2;
42
+ return _chunkA5BRAPQQjs.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 = _chunkZTHR4YS2js.toBytes.call(void 0, list[i]);
51
+ const encoded = _chunkA5BRAPQQjs.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 = _chunkZTHR4YS2js.getChainContractAddress.call(void 0, {
72
+ universalResolverAddress = _chunkA5BRAPQQjs.getChainContractAddress.call(void 0, {
73
73
  blockNumber,
74
74
  chain: client.chain,
75
75
  contract: "ensUniversalResolver"
76
76
  });
77
77
  }
78
- const res = await _chunkZTHR4YS2js.readContract.call(void 0, client, {
78
+ const res = await _chunkA5BRAPQQjs.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
- _chunkZTHR4YS2js.toHex.call(void 0, packetToBytes(name)),
98
- _chunkZTHR4YS2js.encodeFunctionData.call(void 0, {
97
+ _chunkA5BRAPQQjs.toHex.call(void 0, packetToBytes(name)),
98
+ _chunkA5BRAPQQjs.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 _chunkZTHR4YS2js.decodeFunctionResult.call(void 0, {
115
+ return _chunkA5BRAPQQjs.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 = _chunkZTHR4YS2js.getChainContractAddress.call(void 0, {
143
+ universalResolverAddress = _chunkA5BRAPQQjs.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 _chunkZTHR4YS2js.readContract.call(void 0, client, {
151
+ const res = await _chunkA5BRAPQQjs.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: [_chunkZTHR4YS2js.toHex.call(void 0, packetToBytes(reverseNode))],
168
+ args: [_chunkA5BRAPQQjs.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 _chunkZTHR4YS2js.ContractFunctionExecutionError && error.cause.reason === _chunkZTHR4YS2js.panicReasons[50])
174
+ if (error instanceof _chunkA5BRAPQQjs.ContractFunctionExecutionError && error.cause.reason === _chunkA5BRAPQQjs.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-FDTKU2PS.js.map
186
+ //# sourceMappingURL=chunk-GZ67J32T.js.map
@@ -572,7 +572,7 @@ var ChainMismatchError = class extends BaseError {
572
572
  currentChainId
573
573
  }) {
574
574
  super(
575
- `The current chain (id: ${currentChainId}) does not match the chain passed to the request (id: ${chain.id} \u2013 ${chain.name}).`,
575
+ `The current chain of the wallet (id: ${currentChainId}) does not match the target chain for the transaction (id: ${chain.id} \u2013 ${chain.name}).`,
576
576
  {
577
577
  metaMessages: [
578
578
  `Current Chain ID: ${currentChainId}`,
@@ -5022,7 +5022,7 @@ async function requestPermissions(client, permissions) {
5022
5022
  async function sendTransaction(client, args) {
5023
5023
  const {
5024
5024
  account,
5025
- chain,
5025
+ chain = client.chain,
5026
5026
  accessList,
5027
5027
  assertChain = true,
5028
5028
  data,
@@ -5593,4 +5593,4 @@ export {
5593
5593
  formatGwei,
5594
5594
  parseEther
5595
5595
  };
5596
- //# sourceMappingURL=chunk-MWJLP6MO.mjs.map
5596
+ //# sourceMappingURL=chunk-ISLCPEI2.mjs.map