viem 0.1.13 → 0.1.14

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 (55) hide show
  1. package/dist/abi.d.ts +3 -3
  2. package/dist/abi.js +2 -2
  3. package/dist/abi.mjs +1 -1
  4. package/dist/{chain-792d51c3.d.ts → chain-0ce17567.d.ts} +1 -1
  5. package/dist/{chain-41dcec4b.d.ts → chain-5b8fb5eb.d.ts} +1 -1
  6. package/dist/chains.d.ts +3 -3
  7. package/dist/chains.js +63 -63
  8. package/dist/chains.mjs +1 -1
  9. package/dist/{chunk-BJPR4EAT.mjs → chunk-KH3WJ45D.mjs} +2 -2
  10. package/dist/{chunk-3FWCHYKE.js → chunk-P5JTF7JS.js} +27 -13
  11. package/dist/chunk-P5JTF7JS.js.map +1 -0
  12. package/dist/{chunk-S4MOKUQW.mjs → chunk-S3SV7Y4G.mjs} +26 -12
  13. package/dist/chunk-S3SV7Y4G.mjs.map +1 -0
  14. package/dist/{chunk-65E5HTFA.js → chunk-TZWWCJQ5.js} +19 -19
  15. package/dist/contract.d.ts +7 -7
  16. package/dist/contract.js +2 -2
  17. package/dist/contract.mjs +1 -1
  18. package/dist/{createClient-6cd6daa3.d.ts → createClient-98b1c2e7.d.ts} +2 -2
  19. package/dist/{createPublicClient-34d3ba9d.d.ts → createPublicClient-812a1dae.d.ts} +3 -3
  20. package/dist/{eip1193-2f116cf7.d.ts → eip1193-44504199.d.ts} +1 -1
  21. package/dist/{encodeFunctionResult-874fe003.d.ts → encodeFunctionResult-e491eb56.d.ts} +4 -4
  22. package/dist/{encodePacked-9ab98aa9.d.ts → encodePacked-d7942f6b.d.ts} +1 -1
  23. package/dist/ens.d.ts +4 -4
  24. package/dist/ens.js +3 -3
  25. package/dist/ens.mjs +2 -2
  26. package/dist/ethers.d.ts +4 -4
  27. package/dist/ethers.js +3 -3
  28. package/dist/ethers.mjs +1 -1
  29. package/dist/{formatAbiItem-1bdb43d3.d.ts → formatAbiItem-29a73545.d.ts} +1 -1
  30. package/dist/{getAbiItem-f19d50a2.d.ts → getAbiItem-779cb566.d.ts} +1 -1
  31. package/dist/index.d.ts +24 -14
  32. package/dist/index.js +92 -90
  33. package/dist/index.js.map +1 -1
  34. package/dist/index.mjs +4 -2
  35. package/dist/index.mjs.map +1 -1
  36. package/dist/{parseGwei-a35c7c87.d.ts → parseGwei-75956089.d.ts} +3 -3
  37. package/dist/public.d.ts +4 -4
  38. package/dist/public.js +2 -2
  39. package/dist/public.mjs +1 -1
  40. package/dist/{test-6b2b1b0d.d.ts → test-d0a36452.d.ts} +3 -3
  41. package/dist/test.d.ts +5 -5
  42. package/dist/test.js +2 -2
  43. package/dist/test.mjs +1 -1
  44. package/dist/utils/index.d.ts +13 -13
  45. package/dist/utils/index.js +2 -2
  46. package/dist/utils/index.mjs +1 -1
  47. package/dist/wallet.d.ts +4 -4
  48. package/dist/wallet.js +2 -2
  49. package/dist/wallet.mjs +1 -1
  50. package/dist/window.d.ts +2 -2
  51. package/package.json +1 -1
  52. package/dist/chunk-3FWCHYKE.js.map +0 -1
  53. package/dist/chunk-S4MOKUQW.mjs.map +0 -1
  54. /package/dist/{chunk-BJPR4EAT.mjs.map → chunk-KH3WJ45D.mjs.map} +0 -0
  55. /package/dist/{chunk-65E5HTFA.js.map → chunk-TZWWCJQ5.js.map} +0 -0
@@ -17,7 +17,7 @@ import {
17
17
  var package_default = {
18
18
  name: "viem",
19
19
  description: "TypeScript Interface for Ethereum",
20
- version: "0.1.13",
20
+ version: "0.1.14",
21
21
  scripts: {
22
22
  anvil: "source .env && anvil --fork-url $VITE_ANVIL_FORK_URL --fork-block-number $VITE_ANVIL_BLOCK_NUMBER --block-time $VITE_ANVIL_BLOCK_TIME",
23
23
  bench: "vitest bench --no-threads",
@@ -445,6 +445,19 @@ var BytesSizeMismatchError = class extends BaseError {
445
445
  __publicField(this, "name", "BytesSizeMismatchError");
446
446
  }
447
447
  };
448
+ var DecodeLogTopicsMismatch = class extends BaseError {
449
+ constructor({
450
+ abiItem,
451
+ param
452
+ }) {
453
+ super(
454
+ [
455
+ `Expected a topic for indexed event parameter${param.name ? ` "${param.name}"` : ""} on event "${formatAbiItem(abiItem, { includeName: true })}".`
456
+ ].join("\n")
457
+ );
458
+ __publicField(this, "name", "DecodeLogTopicsMismatch");
459
+ }
460
+ };
448
461
  var InvalidAbiEncodingTypeError = class extends BaseError {
449
462
  constructor(type, { docsPath: docsPath5 }) {
450
463
  super(
@@ -2430,16 +2443,16 @@ function decodeEventLog({
2430
2443
  const { name, inputs } = abiItem;
2431
2444
  const isUnnamed = inputs?.some((x) => !("name" in x && x.name));
2432
2445
  let args = isUnnamed ? [] : {};
2433
- for (let i = 0; i < inputs.length; i++) {
2434
- const param = inputs[i];
2435
- const topic = argTopics[i];
2436
- if (topic === null)
2437
- args[param.name || i] = null;
2438
- if (!topic)
2439
- continue;
2440
- if (Array.isArray(topic)) {
2441
- args[param.name || i] = topic.map((t) => decodeTopic({ param, value: t }));
2442
- } else {
2446
+ if (argTopics.length > 0) {
2447
+ const indexedInputs = inputs.filter((x) => "indexed" in x && x.indexed);
2448
+ for (let i = 0; i < indexedInputs.length; i++) {
2449
+ const param = indexedInputs[i];
2450
+ const topic = argTopics[i];
2451
+ if (!topic)
2452
+ throw new DecodeLogTopicsMismatch({
2453
+ abiItem,
2454
+ param
2455
+ });
2443
2456
  args[param.name || i] = decodeTopic({ param, value: topic });
2444
2457
  }
2445
2458
  }
@@ -5252,6 +5265,7 @@ export {
5252
5265
  AbiFunctionNotFoundError,
5253
5266
  AbiFunctionOutputsNotFoundError,
5254
5267
  AbiFunctionSignatureNotFoundError,
5268
+ DecodeLogTopicsMismatch,
5255
5269
  InvalidAbiEncodingTypeError,
5256
5270
  InvalidAbiDecodingTypeError,
5257
5271
  InvalidArrayError,
@@ -5494,4 +5508,4 @@ export {
5494
5508
  formatGwei,
5495
5509
  parseEther
5496
5510
  };
5497
- //# sourceMappingURL=chunk-S4MOKUQW.mjs.map
5511
+ //# sourceMappingURL=chunk-S3SV7Y4G.mjs.map