viem 2.21.31 → 2.21.32

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # viem
2
2
 
3
+ ## 2.21.32
4
+
5
+ ### Patch Changes
6
+
7
+ - [`d461c657b4f7ed8c0e255254356d8e5b2b65e173`](https://github.com/wevm/viem/commit/d461c657b4f7ed8c0e255254356d8e5b2b65e173) Thanks [@jxom](https://github.com/jxom)! - Added ability to pass a `0` chain ID to EIP-7702 Authorizations.
8
+
3
9
  ## 2.21.31
4
10
 
5
11
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
- exports.version = '2.21.31';
4
+ exports.version = '2.21.32';
5
5
  //# sourceMappingURL=version.js.map
@@ -11,7 +11,7 @@ function hashAuthorization(parameters) {
11
11
  const hash = (0, keccak256_js_1.keccak256)((0, concat_js_1.concatHex)([
12
12
  '0x05',
13
13
  (0, toRlp_js_1.toRlp)([
14
- (0, toHex_js_1.numberToHex)(chainId),
14
+ chainId ? (0, toHex_js_1.numberToHex)(chainId) : '0x',
15
15
  contractAddress,
16
16
  nonce ? (0, toHex_js_1.numberToHex)(nonce) : '0x',
17
17
  ]),
@@ -1 +1 @@
1
- {"version":3,"file":"hashAuthorization.js","sourceRoot":"","sources":["../../../../experimental/eip7702/utils/hashAuthorization.ts"],"names":[],"mappings":";;AA2CA,8CAgBC;AAzDD,6DAGsC;AACtC,mEAG2C;AAC3C,+DAGyC;AACzC,+DAA6E;AAC7E,mEAGyC;AAyBzC,SAAgB,iBAAiB,CAC/B,UAA2C;IAE3C,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,UAAU,CAAA;IAC1D,MAAM,IAAI,GAAG,IAAA,wBAAS,EACpB,IAAA,qBAAS,EAAC;QACR,MAAM;QACN,IAAA,gBAAK,EAAC;YACJ,IAAA,sBAAW,EAAC,OAAO,CAAC;YACpB,eAAe;YACf,KAAK,CAAC,CAAC,CAAC,IAAA,sBAAW,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;SAClC,CAAC;KACH,CAAC,CACH,CAAA;IACD,IAAI,EAAE,KAAK,OAAO;QAAE,OAAO,IAAA,uBAAU,EAAC,IAAI,CAAoC,CAAA;IAC9E,OAAO,IAAuC,CAAA;AAChD,CAAC"}
1
+ {"version":3,"file":"hashAuthorization.js","sourceRoot":"","sources":["../../../../experimental/eip7702/utils/hashAuthorization.ts"],"names":[],"mappings":";;AA2CA,8CAgBC;AAzDD,6DAGsC;AACtC,mEAG2C;AAC3C,+DAGyC;AACzC,+DAA6E;AAC7E,mEAGyC;AAyBzC,SAAgB,iBAAiB,CAC/B,UAA2C;IAE3C,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,UAAU,CAAA;IAC1D,MAAM,IAAI,GAAG,IAAA,wBAAS,EACpB,IAAA,qBAAS,EAAC;QACR,MAAM;QACN,IAAA,gBAAK,EAAC;YACJ,OAAO,CAAC,CAAC,CAAC,IAAA,sBAAW,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI;YACrC,eAAe;YACf,KAAK,CAAC,CAAC,CAAC,IAAA,sBAAW,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;SAClC,CAAC;KACH,CAAC,CACH,CAAA;IACD,IAAI,EAAE,KAAK,OAAO;QAAE,OAAO,IAAA,uBAAU,EAAC,IAAI,CAAoC,CAAA;IAC9E,OAAO,IAAuC,CAAA;AAChD,CAAC"}
@@ -10,7 +10,7 @@ function serializeAuthorizationList(authorizationList) {
10
10
  for (const authorization of authorizationList) {
11
11
  const { contractAddress, chainId, nonce, ...signature } = authorization;
12
12
  serializedAuthorizationList.push([
13
- (0, toHex_js_1.toHex)(chainId),
13
+ chainId ? (0, toHex_js_1.toHex)(chainId) : '0x',
14
14
  contractAddress,
15
15
  nonce ? (0, toHex_js_1.toHex)(nonce) : '0x',
16
16
  ...(0, serializeTransaction_js_1.toYParitySignatureArray)({}, signature),
@@ -1 +1 @@
1
- {"version":3,"file":"serializeAuthorizationList.js","sourceRoot":"","sources":["../../../../experimental/eip7702/utils/serializeAuthorizationList.ts"],"names":[],"mappings":";;AAeA,gEAiBC;AA/BD,+DAAwD;AACxD,gGAA4F;AAa5F,SAAgB,0BAA0B,CACxC,iBAA+D;IAE/D,IAAI,CAAC,iBAAiB,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IAEnE,MAAM,2BAA2B,GAAG,EAAE,CAAA;IACtC,KAAK,MAAM,aAAa,IAAI,iBAAiB,EAAE,CAAC;QAC9C,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,SAAS,EAAE,GAAG,aAAa,CAAA;QACvE,2BAA2B,CAAC,IAAI,CAAC;YAC/B,IAAA,gBAAK,EAAC,OAAO,CAAC;YACd,eAAe;YACf,KAAK,CAAC,CAAC,CAAC,IAAA,gBAAK,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;YAC3B,GAAG,IAAA,iDAAuB,EAAC,EAAE,EAAE,SAAS,CAAC;SAC1C,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,2BAAyE,CAAA;AAClF,CAAC"}
1
+ {"version":3,"file":"serializeAuthorizationList.js","sourceRoot":"","sources":["../../../../experimental/eip7702/utils/serializeAuthorizationList.ts"],"names":[],"mappings":";;AAeA,gEAiBC;AA/BD,+DAAwD;AACxD,gGAA4F;AAa5F,SAAgB,0BAA0B,CACxC,iBAA+D;IAE/D,IAAI,CAAC,iBAAiB,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IAEnE,MAAM,2BAA2B,GAAG,EAAE,CAAA;IACtC,KAAK,MAAM,aAAa,IAAI,iBAAiB,EAAE,CAAC;QAC9C,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,SAAS,EAAE,GAAG,aAAa,CAAA;QACvE,2BAA2B,CAAC,IAAI,CAAC;YAC/B,OAAO,CAAC,CAAC,CAAC,IAAA,gBAAK,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI;YAC/B,eAAe;YACf,KAAK,CAAC,CAAC,CAAC,IAAA,gBAAK,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;YAC3B,GAAG,IAAA,iDAAuB,EAAC,EAAE,EAAE,SAAS,CAAC;SAC1C,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,2BAAyE,CAAA;AAClF,CAAC"}
@@ -23,7 +23,7 @@ function assertTransactionEIP7702(transaction) {
23
23
  const { contractAddress, chainId } = authorization;
24
24
  if (!(0, isAddress_js_1.isAddress)(contractAddress))
25
25
  throw new address_js_1.InvalidAddressError({ address: contractAddress });
26
- if (chainId <= 0)
26
+ if (chainId < 0)
27
27
  throw new chain_js_1.InvalidChainIdError({ chainId });
28
28
  }
29
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"assertTransaction.js","sourceRoot":"","sources":["../../../utils/transaction/assertTransaction.ts"],"names":[],"mappings":";;AA4CA,4DAaC;AASD,4DAmBC;AAWD,4DAcC;AAUD,4DAaC;AAUD,0DAcC;AA7JD,mDAAgE;AAChE,yDAAsD;AACtD,wDAGgC;AAChC,kDAAoE;AACpE,kDAO6B;AAC7B,oDAG8B;AAC9B,kDAK6B;AAS7B,0DAA4E;AAC5E,6CAAsC;AACtC,+CAAwC;AACxC,uDAAoD;AAQpD,SAAgB,wBAAwB,CACtC,WAA2C;IAE3C,MAAM,EAAE,iBAAiB,EAAE,GAAG,WAAW,CAAA;IACzC,IAAI,iBAAiB,EAAE,CAAC;QACtB,KAAK,MAAM,aAAa,IAAI,iBAAiB,EAAE,CAAC;YAC9C,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,aAAa,CAAA;YAClD,IAAI,CAAC,IAAA,wBAAS,EA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AC"}
@@ -1,2 +1,2 @@
1
- export const version = '2.21.31';
1
+ export const version = '2.21.32';
2
2
  //# sourceMappingURL=version.js.map
@@ -11,7 +11,7 @@ export function hashAuthorization(parameters) {
11
11
  const hash = keccak256(concatHex([
12
12
  '0x05',
13
13
  toRlp([
14
- numberToHex(chainId),
14
+ chainId ? numberToHex(chainId) : '0x',
15
15
  contractAddress,
16
16
  nonce ? numberToHex(nonce) : '0x',
17
17
  ]),
@@ -1 +1 @@
1
- {"version":3,"file":"hashAuthorization.js","sourceRoot":"","sources":["../../../../experimental/eip7702/utils/hashAuthorization.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,SAAS,GACV,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAEL,UAAU,GACX,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAEL,WAAW,GACZ,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAuB,KAAK,EAAE,MAAM,kCAAkC,CAAA;AAC7E,OAAO,EAEL,SAAS,GACV,MAAM,kCAAkC,CAAA;AAsBzC;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,UAA2C;IAE3C,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,UAAU,CAAA;IAC1D,MAAM,IAAI,GAAG,SAAS,CACpB,SAAS,CAAC;QACR,MAAM;QACN,KAAK,CAAC;YACJ,WAAW,CAAC,OAAO,CAAC;YACpB,eAAe;YACf,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;SAClC,CAAC;KACH,CAAC,CACH,CAAA;IACD,IAAI,EAAE,KAAK,OAAO;QAAE,OAAO,UAAU,CAAC,IAAI,CAAoC,CAAA;IAC9E,OAAO,IAAuC,CAAA;AAChD,CAAC"}
1
+ {"version":3,"file":"hashAuthorization.js","sourceRoot":"","sources":["../../../../experimental/eip7702/utils/hashAuthorization.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,SAAS,GACV,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAEL,UAAU,GACX,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAEL,WAAW,GACZ,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAuB,KAAK,EAAE,MAAM,kCAAkC,CAAA;AAC7E,OAAO,EAEL,SAAS,GACV,MAAM,kCAAkC,CAAA;AAsBzC;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAC/B,UAA2C;IAE3C,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,EAAE,EAAE,GAAG,UAAU,CAAA;IAC1D,MAAM,IAAI,GAAG,SAAS,CACpB,SAAS,CAAC;QACR,MAAM;QACN,KAAK,CAAC;YACJ,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI;YACrC,eAAe;YACf,KAAK,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;SAClC,CAAC;KACH,CAAC,CACH,CAAA;IACD,IAAI,EAAE,KAAK,OAAO;QAAE,OAAO,UAAU,CAAC,IAAI,CAAoC,CAAA;IAC9E,OAAO,IAAuC,CAAA;AAChD,CAAC"}
@@ -10,7 +10,7 @@ export function serializeAuthorizationList(authorizationList) {
10
10
  for (const authorization of authorizationList) {
11
11
  const { contractAddress, chainId, nonce, ...signature } = authorization;
12
12
  serializedAuthorizationList.push([
13
- toHex(chainId),
13
+ chainId ? toHex(chainId) : '0x',
14
14
  contractAddress,
15
15
  nonce ? toHex(nonce) : '0x',
16
16
  ...toYParitySignatureArray({}, signature),
@@ -1 +1 @@
1
- {"version":3,"file":"serializeAuthorizationList.js","sourceRoot":"","sources":["../../../../experimental/eip7702/utils/serializeAuthorizationList.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAA;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oDAAoD,CAAA;AAU5F;;GAEG;AACH,MAAM,UAAU,0BAA0B,CACxC,iBAA+D;IAE/D,IAAI,CAAC,iBAAiB,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IAEnE,MAAM,2BAA2B,GAAG,EAAE,CAAA;IACtC,KAAK,MAAM,aAAa,IAAI,iBAAiB,EAAE,CAAC;QAC9C,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,SAAS,EAAE,GAAG,aAAa,CAAA;QACvE,2BAA2B,CAAC,IAAI,CAAC;YAC/B,KAAK,CAAC,OAAO,CAAC;YACd,eAAe;YACf,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;YAC3B,GAAG,uBAAuB,CAAC,EAAE,EAAE,SAAS,CAAC;SAC1C,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,2BAAyE,CAAA;AAClF,CAAC"}
1
+ {"version":3,"file":"serializeAuthorizationList.js","sourceRoot":"","sources":["../../../../experimental/eip7702/utils/serializeAuthorizationList.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAA;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,oDAAoD,CAAA;AAU5F;;GAEG;AACH,MAAM,UAAU,0BAA0B,CACxC,iBAA+D;IAE/D,IAAI,CAAC,iBAAiB,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IAEnE,MAAM,2BAA2B,GAAG,EAAE,CAAA;IACtC,KAAK,MAAM,aAAa,IAAI,iBAAiB,EAAE,CAAC;QAC9C,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,SAAS,EAAE,GAAG,aAAa,CAAA;QACvE,2BAA2B,CAAC,IAAI,CAAC;YAC/B,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI;YAC/B,eAAe;YACf,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI;YAC3B,GAAG,uBAAuB,CAAC,EAAE,EAAE,SAAS,CAAC;SAC1C,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,2BAAyE,CAAA;AAClF,CAAC"}
@@ -16,7 +16,7 @@ export function assertTransactionEIP7702(transaction) {
16
16
  const { contractAddress, chainId } = authorization;
17
17
  if (!isAddress(contractAddress))
18
18
  throw new InvalidAddressError({ address: contractAddress });
19
- if (chainId <= 0)
19
+ if (chainId < 0)
20
20
  throw new InvalidChainIdError({ chainId });
21
21
  }
22
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"assertTransaction.js","sourceRoot":"","sources":["../../../utils/transaction/assertTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,EACL,mBAAmB,GAEpB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,SAAS,EAAsB,MAAM,sBAAsB,CAAA;AACpE,OAAO,EACL,cAAc,EAEd,6BAA6B,EAE7B,gCAAgC,GAEjC,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,mBAAmB,GAEpB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,kBAAkB,EAElB,mBAAmB,GAEpB,MAAM,sBAAsB,CAAA;AAS7B,OAAO,EAA2B,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAQpD,MAAM,UAAU,wBAAwB,CACtC,WAA2C;IAE3C,MAAM,EAAE,iBAAiB,EAAE,GAAG,WAAW,CAAA;IACzC,I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AE,GACjE,WAAW,CAAA;IACb,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC;QAAE,MAAM,IAAI,mBAAmB,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAA;IACxE,IAAI,OAAO,OAAO,KAAK,WAAW,IAAI,OAAO,IAAI,CAAC;QAChD,MAAM,IAAI,mBAAmB,CAAC,EAAE,OAAO,EAAE,CAAC,CAAA;IAC5C,IAAI,oBAAoB,IAAI,YAAY;QACtC,MAAM,IAAI,SAAS,CACjB,oFAAoF,CACrF,CAAA;IACH,IAAI,QAAQ,IAAI,QAAQ,GAAG,UAAU;QACnC,MAAM,IAAI,kBAAkB,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,CAAA;AAC5D,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const version = "2.21.31";
1
+ export declare const version = "2.21.32";
2
2
  //# sourceMappingURL=version.d.ts.map
package/errors/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '2.21.31'
1
+ export const version = '2.21.32'
@@ -49,7 +49,7 @@ export function hashAuthorization<to extends To = 'hex'>(
49
49
  concatHex([
50
50
  '0x05',
51
51
  toRlp([
52
- numberToHex(chainId),
52
+ chainId ? numberToHex(chainId) : '0x',
53
53
  contractAddress,
54
54
  nonce ? numberToHex(nonce) : '0x',
55
55
  ]),
@@ -22,7 +22,7 @@ export function serializeAuthorizationList(
22
22
  for (const authorization of authorizationList) {
23
23
  const { contractAddress, chainId, nonce, ...signature } = authorization
24
24
  serializedAuthorizationList.push([
25
- toHex(chainId),
25
+ chainId ? toHex(chainId) : '0x',
26
26
  contractAddress,
27
27
  nonce ? toHex(nonce) : '0x',
28
28
  ...toYParitySignatureArray({}, signature),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "viem",
3
3
  "description": "TypeScript Interface for Ethereum",
4
- "version": "2.21.31",
4
+ "version": "2.21.32",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
7
7
  "types": "./_types/index.d.ts",
@@ -51,7 +51,7 @@ export function assertTransactionEIP7702(
51
51
  const { contractAddress, chainId } = authorization
52
52
  if (!isAddress(contractAddress))
53
53
  throw new InvalidAddressError({ address: contractAddress })
54
- if (chainId <= 0) throw new InvalidChainIdError({ chainId })
54
+ if (chainId < 0) throw new InvalidChainIdError({ chainId })
55
55
  }
56
56
  }
57
57
  assertTransactionEIP1559(transaction as {} as TransactionSerializableEIP1559)