ox 0.4.0 → 0.4.2

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 (40) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/_cjs/erc6492/WrappedSignature.js +103 -0
  3. package/_cjs/erc6492/WrappedSignature.js.map +1 -0
  4. package/_cjs/erc6492/index.js +5 -0
  5. package/_cjs/erc6492/index.js.map +1 -0
  6. package/_cjs/index.docs.js +6 -0
  7. package/_cjs/index.docs.js.map +1 -0
  8. package/_cjs/index.js.map +1 -1
  9. package/_cjs/version.js +1 -1
  10. package/_esm/erc6492/WrappedSignature.js +199 -0
  11. package/_esm/erc6492/WrappedSignature.js.map +1 -0
  12. package/_esm/erc6492/index.js +25 -0
  13. package/_esm/erc6492/index.js.map +1 -0
  14. package/_esm/index.docs.js +5 -0
  15. package/_esm/index.docs.js.map +1 -0
  16. package/_esm/index.js +1 -1
  17. package/_esm/index.js.map +1 -1
  18. package/_esm/version.js +1 -1
  19. package/_types/erc6492/WrappedSignature.d.ts +178 -0
  20. package/_types/erc6492/WrappedSignature.d.ts.map +1 -0
  21. package/_types/erc6492/index.d.ts +27 -0
  22. package/_types/erc6492/index.d.ts.map +1 -0
  23. package/_types/index.d.ts +3 -1
  24. package/_types/index.d.ts.map +1 -1
  25. package/_types/index.docs.d.ts +4 -0
  26. package/_types/index.docs.d.ts.map +1 -0
  27. package/_types/version.d.ts +1 -1
  28. package/erc6492/WrappedSignature/package.json +6 -0
  29. package/erc6492/WrappedSignature.ts +262 -0
  30. package/erc6492/index.ts +28 -0
  31. package/erc6492/package.json +6 -0
  32. package/index.docs/package.json +6 -0
  33. package/index.docs.ts +4 -0
  34. package/index.ts +5 -1
  35. package/package.json +16 -6
  36. package/trusted-setups/Paths/package.json +3 -3
  37. package/version.ts +1 -1
  38. package/trusted-setups/Paths.test.ts +0 -10
  39. package/trusted-setups/index.test.ts +0 -10
  40. package/version/package.json +0 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # ox
2
2
 
3
+ ## 0.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#40](https://github.com/wevm/ox/pull/40) [`47e306d`](https://github.com/wevm/ox/commit/47e306d8ab95140eb7e2589c05351d1663a507ae) Thanks [@jxom](https://github.com/jxom)! - **ox/erc6492:** Added universal signature verification exports.
8
+
9
+ ## 0.4.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#37](https://github.com/wevm/ox/pull/37) [`39604df`](https://github.com/wevm/ox/commit/39604df9f84b810322e12f767ef450c0c2ced308) Thanks [@jxom](https://github.com/jxom)! - Added `ox/erc6492` entrypoint.
14
+
3
15
  ## 0.4.0
4
16
 
5
17
  ### Minor Changes
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InvalidWrappedSignatureError = exports.universalSignatureValidatorAbi = exports.universalSignatureValidatorBytecode = exports.magicBytes = void 0;
4
+ exports.assert = assert;
5
+ exports.from = from;
6
+ exports.fromHex = fromHex;
7
+ exports.toHex = toHex;
8
+ exports.validate = validate;
9
+ const AbiParameters = require("../core/AbiParameters.js");
10
+ const Errors = require("../core/Errors.js");
11
+ const Hex = require("../core/Hex.js");
12
+ const Signature = require("../core/Signature.js");
13
+ exports.magicBytes = '0x6492649264926492649264926492649264926492649264926492649264926492';
14
+ exports.universalSignatureValidatorBytecode = '0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572';
15
+ exports.universalSignatureValidatorAbi = [
16
+ {
17
+ inputs: [
18
+ {
19
+ name: '_signer',
20
+ type: 'address',
21
+ },
22
+ {
23
+ name: '_hash',
24
+ type: 'bytes32',
25
+ },
26
+ {
27
+ name: '_signature',
28
+ type: 'bytes',
29
+ },
30
+ ],
31
+ stateMutability: 'nonpayable',
32
+ type: 'constructor',
33
+ },
34
+ {
35
+ inputs: [
36
+ {
37
+ name: '_signer',
38
+ type: 'address',
39
+ },
40
+ {
41
+ name: '_hash',
42
+ type: 'bytes32',
43
+ },
44
+ {
45
+ name: '_signature',
46
+ type: 'bytes',
47
+ },
48
+ ],
49
+ outputs: [
50
+ {
51
+ type: 'bool',
52
+ },
53
+ ],
54
+ stateMutability: 'nonpayable',
55
+ type: 'function',
56
+ name: 'isValidSig',
57
+ },
58
+ ];
59
+ function assert(wrapped) {
60
+ if (Hex.slice(wrapped, -32) !== exports.magicBytes)
61
+ throw new InvalidWrappedSignatureError(wrapped);
62
+ }
63
+ function from(wrapped) {
64
+ if (typeof wrapped === 'string')
65
+ return fromHex(wrapped);
66
+ return wrapped;
67
+ }
68
+ function fromHex(wrapped) {
69
+ assert(wrapped);
70
+ const [to, data, signature_hex] = AbiParameters.decode(AbiParameters.from('address, bytes, bytes'), wrapped);
71
+ const signature = Signature.fromHex(signature_hex);
72
+ return { data, signature, to };
73
+ }
74
+ function toHex(value) {
75
+ const { data, signature, to } = value;
76
+ return Hex.concat(AbiParameters.encode(AbiParameters.from('address, bytes, bytes'), [
77
+ to,
78
+ data,
79
+ Signature.toHex(signature),
80
+ ]), exports.magicBytes);
81
+ }
82
+ function validate(wrapped) {
83
+ try {
84
+ assert(wrapped);
85
+ return true;
86
+ }
87
+ catch {
88
+ return false;
89
+ }
90
+ }
91
+ class InvalidWrappedSignatureError extends Errors.BaseError {
92
+ constructor(wrapped) {
93
+ super(`Value \`${wrapped}\` is an invalid ERC-6492 wrapped signature.`);
94
+ Object.defineProperty(this, "name", {
95
+ enumerable: true,
96
+ configurable: true,
97
+ writable: true,
98
+ value: 'WrappedSignature.InvalidWrappedSignatureError'
99
+ });
100
+ }
101
+ }
102
+ exports.InvalidWrappedSignatureError = InvalidWrappedSignatureError;
103
+ //# sourceMappingURL=WrappedSignature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WrappedSignature.js","sourceRoot":"","sources":["../../erc6492/WrappedSignature.ts"],"names":[],"mappings":";;;AA4FA,wBAGC;AAuCD,oBAGC;AAyBD,0BAWC;AAiCD,sBAWC;AAwBD,4BAOC;AAvPD,0DAAyD;AAEzD,4CAA2C;AAC3C,sCAAqC;AACrC,kDAAiD;AAepC,QAAA,UAAU,GACrB,oEAA6E,CAAA;AAKlE,QAAA,mCAAmC,GAC9C,4yGAA4yG,CAAA;AAOjyG,QAAA,8BAA8B,GAAG;IAC5C;QACE,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,OAAO;aACd;SACF;QACD,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,aAAa;KACpB;IACD;QACE,MAAM,EAAE;YACN;gBACE,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,SAAS;aAChB;YACD;gBACE,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,OAAO;aACd;SACF;QACD,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,MAAM;aACb;SACF;QACD,eAAe,EAAE,YAAY;QAC7B,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,YAAY;KACnB;CACyB,CAAA;AAe5B,SAAg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OAAgB;QAC1B,KAAK,CAAC,WAAW,OAAO,8CAA8C,CAAC,CAAA;QAHvD;;;;mBAAO,+CAA+C;WAAA;IAIxE,CAAC;CACF;AAND,oEAMC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WrappedSignature = void 0;
4
+ exports.WrappedSignature = require("./WrappedSignature.js");
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../erc6492/index.ts"],"names":[],"mappings":";;;AA2BA,4DAAyD"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ tslib_1.__exportStar(require("./index.js"), exports);
5
+ tslib_1.__exportStar(require("./erc6492/index.js"), exports);
6
+ //# sourceMappingURL=index.docs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.docs.js","sourceRoot":"","sources":["../index.docs.ts"],"names":[],"mappings":";;;AAEA,qDAA0B;AAC1B,6DAAkC"}
package/_cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;AAmHA,uCAAoC;AA4EpC,6DAA0D;AAwE1D,iDAA8C;AAmH9C,iDAA8C;AA8F9C,uDAAoD;AA8EpD,+CAA4C;AAwG5C,2DAAwD;AAOxD,qDAAkD;AAOlD,yDAAsD;AAuDtD,+CAA4C;AAqC5C,6CAA0C;AA0E1C,2DAAwD;AAuDxD,6CAA0C;AAsD1C,6CAA0C;AAO1C,2CAAwC;AAgCxC,2CAAwC;AAOxC,2CAAwC;AAoHxC,uCAAoC;AA6CpC,iDAA8C;AAgI9C,2CAAwC;AAExC,6CAA0C;AAsC1C,+DAA4D;AA+B5D,uCAAoC;AAEpC,6CAA0C;AAO1C,6CAA0C;AAe1C,yCAAsC;AActC,2CAAwC;AAmHxC,uC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AgD;AAmChD,qDAAkD;AAmFlD,uDAAoD;AA0BpD,yDAAsD;AAyEtD,mDAAgD;AAyEhD,yCAAsC;AAmCtC,mDAAgD;AAqGhD,yCAAsC;AAEtC,iDAA8C;AAuC9C,uDAAoD;AAgBpD,uEAAoE;AA2JpE,mFAAgF;AAuKhF,qFAAkF;AA+JlF,qFAAkF;AAwLlF,qFAAkF;AAqIlF,qFAAkF;AA6ClF,qEAAkE;AAyBlE,qEAAkE;AAkDlE,mDAAgD;AAOhD,2DAAwD;AAsBxD,2CAAwC;AAkFxC,yDAAsD;AAiEtD,2DAAwD;AAOxD,qDAAkD"}
package/_cjs/version.js CHANGED
@@ -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 = '0.4.0';
4
+ exports.version = '0.4.2';
5
5
  //# sourceMappingURL=version.js.map
@@ -0,0 +1,199 @@
1
+ import * as AbiParameters from '../core/AbiParameters.js';
2
+ import * as Errors from '../core/Errors.js';
3
+ import * as Hex from '../core/Hex.js';
4
+ import * as Signature from '../core/Signature.js';
5
+ /**
6
+ * Magic bytes used to identify ERC-6492 wrapped signatures.
7
+ */
8
+ export const magicBytes = '0x6492649264926492649264926492649264926492649264926492649264926492';
9
+ /**
10
+ * Deployless ERC-6492 signature verification bytecode.
11
+ */
12
+ export const universalSignatureValidatorBytecode = '0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572';
13
+ /**
14
+ * ABI for the ERC-6492 universal deployless signature validator contract.
15
+ *
16
+ * Constructor return value is `0x1` (valid) or `0x0` (invalid).
17
+ */
18
+ export const universalSignatureValidatorAbi = [
19
+ {
20
+ inputs: [
21
+ {
22
+ name: '_signer',
23
+ type: 'address',
24
+ },
25
+ {
26
+ name: '_hash',
27
+ type: 'bytes32',
28
+ },
29
+ {
30
+ name: '_signature',
31
+ type: 'bytes',
32
+ },
33
+ ],
34
+ stateMutability: 'nonpayable',
35
+ type: 'constructor',
36
+ },
37
+ {
38
+ inputs: [
39
+ {
40
+ name: '_signer',
41
+ type: 'address',
42
+ },
43
+ {
44
+ name: '_hash',
45
+ type: 'bytes32',
46
+ },
47
+ {
48
+ name: '_signature',
49
+ type: 'bytes',
50
+ },
51
+ ],
52
+ outputs: [
53
+ {
54
+ type: 'bool',
55
+ },
56
+ ],
57
+ stateMutability: 'nonpayable',
58
+ type: 'function',
59
+ name: 'isValidSig',
60
+ },
61
+ ];
62
+ /**
63
+ * Asserts that the wrapped signature is valid.
64
+ *
65
+ * @example
66
+ * ```ts twoslash
67
+ * import { WrappedSignature } from 'ox/erc6492'
68
+ *
69
+ * WrappedSignature.assert('0xdeadbeef')
70
+ * // @error: InvalidWrappedSignatureError: Value `0xdeadbeef` is an invalid ERC-6492 wrapped signature.
71
+ * ```
72
+ *
73
+ * @param wrapped - The wrapped signature to assert.
74
+ */
75
+ export function assert(wrapped) {
76
+ if (Hex.slice(wrapped, -32) !== magicBytes)
77
+ throw new InvalidWrappedSignatureError(wrapped);
78
+ }
79
+ /**
80
+ * Parses an [ERC-6492 wrapped signature](https://eips.ethereum.org/EIPS/eip-6492#specification) into its constituent parts.
81
+ *
82
+ * @example
83
+ * ```ts twoslash
84
+ * // @noErrors
85
+ * import { Secp256k1 } from 'ox'
86
+ * import { WrappedSignature } from 'ox/erc6492' // [!code focus]
87
+ *
88
+ * const signature = Secp256k1.sign({
89
+ * payload: '0x...',
90
+ * privateKey: '0x...',
91
+ * })
92
+ *
93
+ * // Instantiate from serialized format. // [!code focus]
94
+ * const wrapped = WrappedSignature.from('0x...') // [!code focus]
95
+ * // @log: { data: '0x...', signature: { ... }, to: '0x...', } // [!code focus]
96
+ *
97
+ * // Instantiate from constituent parts. // [!code focus]
98
+ * const wrapped = WrappedSignature.from({ // [!code focus]
99
+ * data: '0x...', // [!code focus]
100
+ * signature, // [!code focus]
101
+ * to: '0x...', // [!code focus]
102
+ * })
103
+ * // @log: { data: '0x...', signature: { ... }, to: '0x...', }
104
+ * ```
105
+ *
106
+ * @param wrapped - Wrapped signature to parse.
107
+ * @returns Wrapped signature.
108
+ */
109
+ export function from(wrapped) {
110
+ if (typeof wrapped === 'string')
111
+ return fromHex(wrapped);
112
+ return wrapped;
113
+ }
114
+ /**
115
+ * Parses an [ERC-6492 wrapped signature](https://eips.ethereum.org/EIPS/eip-6492#specification) into its constituent parts.
116
+ *
117
+ * @example
118
+ * ```ts twoslash
119
+ * import { WrappedSignature } from 'ox/erc6492'
120
+ *
121
+ * const { data, signature, to } = WrappedSignature.fromHex('0x...')
122
+ * ```
123
+ *
124
+ * @param wrapped - Wrapped signature to parse.
125
+ * @returns Wrapped signature.
126
+ */
127
+ export function fromHex(wrapped) {
128
+ assert(wrapped);
129
+ const [to, data, signature_hex] = AbiParameters.decode(AbiParameters.from('address, bytes, bytes'), wrapped);
130
+ const signature = Signature.fromHex(signature_hex);
131
+ return { data, signature, to };
132
+ }
133
+ /**
134
+ * Serializes an [ERC-6492 wrapped signature](https://eips.ethereum.org/EIPS/eip-6492#specification).
135
+ *
136
+ * @example
137
+ * ```ts twoslash
138
+ * import { Secp256k1 } from 'ox'
139
+ * import { WrappedSignature } from 'ox/erc6492' // [!code focus]
140
+ *
141
+ * const signature = Secp256k1.sign({
142
+ * payload: '0x...',
143
+ * privateKey: '0x...',
144
+ * })
145
+ *
146
+ * const wrapped = WrappedSignature.toHex({ // [!code focus]
147
+ * data: '0xdeadbeef', // [!code focus]
148
+ * signature, // [!code focus]
149
+ * to: '0x00000000219ab540356cBB839Cbe05303d7705Fa', // [!code focus]
150
+ * }) // [!code focus]
151
+ * ```
152
+ *
153
+ * @param value - Wrapped signature to serialize.
154
+ * @returns Serialized wrapped signature.
155
+ */
156
+ export function toHex(value) {
157
+ const { data, signature, to } = value;
158
+ return Hex.concat(AbiParameters.encode(AbiParameters.from('address, bytes, bytes'), [
159
+ to,
160
+ data,
161
+ Signature.toHex(signature),
162
+ ]), magicBytes);
163
+ }
164
+ /**
165
+ * Validates a wrapped signature. Returns `true` if the wrapped signature is valid, `false` otherwise.
166
+ *
167
+ * @example
168
+ * ```ts twoslash
169
+ * import { WrappedSignature } from 'ox/erc6492'
170
+ *
171
+ * const valid = WrappedSignature.validate('0xdeadbeef')
172
+ * // @log: false
173
+ * ```
174
+ *
175
+ * @param wrapped - The wrapped signature to validate.
176
+ * @returns `true` if the wrapped signature is valid, `false` otherwise.
177
+ */
178
+ export function validate(wrapped) {
179
+ try {
180
+ assert(wrapped);
181
+ return true;
182
+ }
183
+ catch {
184
+ return false;
185
+ }
186
+ }
187
+ /** Thrown when the ERC-6492 wrapped signature is invalid. */
188
+ export class InvalidWrappedSignatureError extends Errors.BaseError {
189
+ constructor(wrapped) {
190
+ super(`Value \`${wrapped}\` is an invalid ERC-6492 wrapped signature.`);
191
+ Object.defineProperty(this, "name", {
192
+ enumerable: true,
193
+ configurable: true,
194
+ writable: true,
195
+ value: 'WrappedSignature.InvalidWrappedSignatureError'
196
+ });
197
+ }
198
+ }
199
+ //# sourceMappingURL=WrappedSignature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WrappedSignature.js","sourceRoot":"","sources":["../../erc6492/WrappedSignature.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAA;AAEzD,OAAO,KAAK,MAAM,MAAM,mB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 @@
1
+ /**
2
+ * Utility functions for working with [ERC-6492 wrapped signatures](https://eips.ethereum.org/EIPS/eip-6492#specification).
3
+ *
4
+ * @example
5
+ * ```ts twoslash
6
+ * import { Secp256k1, PersonalMessage } from 'ox'
7
+ * import { WrappedSignature } from 'ox/erc6492' // [!code focus]
8
+ *
9
+ * const signature = Secp256k1.sign({
10
+ * payload: PersonalMessage.getSignPayload('0xdeadbeef'),
11
+ * privateKey: '0x...',
12
+ * })
13
+ *
14
+ * const wrapped = WrappedSignature.toHex({ // [!code focus]
15
+ * data: '0xcafebabe', // [!code focus]
16
+ * signature, // [!code focus]
17
+ * to: '0xcafebabecafebabecafebabecafebabecafebabe', // [!code focus]
18
+ * }) // [!code focus]
19
+ * // @log: '0x000000000000000000000000cafebabecafebabecafebabecafebabecafebabe000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000004deadbeef000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041fa78c5905fb0b9d6066ef531f962a62bc6ef0d5eb59ecb134056d206f75aaed7780926ff2601a935c2c79707d9e1799948c9f19dcdde1e090e903b19a07923d01c000000000000000000000000000000000000000000000000000000000000006492649264926492649264926492649264926492649264926492649264926492'
20
+ * ```
21
+ *
22
+ * @category ERC-6492
23
+ */
24
+ export * as WrappedSignature from './WrappedSignature.js';
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../erc6492/index.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA"}
@@ -0,0 +1,5 @@
1
+ // @ts-nocheck
2
+ /** Used by api-extractor for docgen. https://github.com/microsoft/rushstack/issues/3557 */
3
+ export * from './index.js';
4
+ export * from './erc6492/index.js';
5
+ //# sourceMappingURL=index.docs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.docs.js","sourceRoot":"","sources":["../index.docs.ts"],"names":[],"mappings":"AAAA,cAAc;AACd,2FAA2F;AAC3F,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA"}
package/_esm/index.js CHANGED
@@ -973,7 +973,7 @@ export * as Block from './core/Block.js';
973
973
  */
974
974
  export * as Bloom from './core/Bloom.js';
975
975
  /**
976
- * Utility functions for [BLS12-381](https://hackmd.io/@benjaminion/bls12-381) cryptography.
976
+ * Utility functions for [BLS12-381](https://hackmd.io/\@benjaminion/bls12-381) cryptography.
977
977
  *
978
978
  * :::info
979
979
  *
package/_esm/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkHG;AACH,OAAO,KAAK,GAAG,MAAM,eAAe,CAAA;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,OAAO,KAAK,cAAc,MAAM,0BAA0B,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgHG;AACH,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,OAAO,KAAK,YAAY,MAAM,wBAAwB,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,OAAO,KAAK,aAAa,MAAM,yBAAyB,CAAA;AAExD;;;;GAIG;AACH,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAA"}
package/_esm/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  /** @internal */
2
- export const version = '0.4.0';
2
+ export const version = '0.4.2';
3
3
  //# sourceMappingURL=version.js.map
@@ -0,0 +1,178 @@
1
+ import * as AbiParameters from '../core/AbiParameters.js';
2
+ import type * as Address from '../core/Address.js';
3
+ import * as Errors from '../core/Errors.js';
4
+ import * as Hex from '../core/Hex.js';
5
+ import * as Signature from '../core/Signature.js';
6
+ /** ERC-6492 Wrapped Signature. */
7
+ export type WrappedSignature = {
8
+ /** Calldata to pass to the target address for counterfactual verification. */
9
+ data: Hex.Hex;
10
+ /** The original signature. */
11
+ signature: Signature.Signature;
12
+ /** The target address to use for counterfactual verification. */
13
+ to: Address.Address;
14
+ };
15
+ /**
16
+ * Magic bytes used to identify ERC-6492 wrapped signatures.
17
+ */
18
+ export declare const magicBytes: "0x6492649264926492649264926492649264926492649264926492649264926492";
19
+ /**
20
+ * Deployless ERC-6492 signature verification bytecode.
21
+ */
22
+ export declare const universalSignatureValidatorBytecode = "0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";
23
+ /**
24
+ * ABI for the ERC-6492 universal deployless signature validator contract.
25
+ *
26
+ * Constructor return value is `0x1` (valid) or `0x0` (invalid).
27
+ */
28
+ export declare const universalSignatureValidatorAbi: readonly [{
29
+ readonly inputs: readonly [{
30
+ readonly name: "_signer";
31
+ readonly type: "address";
32
+ }, {
33
+ readonly name: "_hash";
34
+ readonly type: "bytes32";
35
+ }, {
36
+ readonly name: "_signature";
37
+ readonly type: "bytes";
38
+ }];
39
+ readonly stateMutability: "nonpayable";
40
+ readonly type: "constructor";
41
+ }, {
42
+ readonly inputs: readonly [{
43
+ readonly name: "_signer";
44
+ readonly type: "address";
45
+ }, {
46
+ readonly name: "_hash";
47
+ readonly type: "bytes32";
48
+ }, {
49
+ readonly name: "_signature";
50
+ readonly type: "bytes";
51
+ }];
52
+ readonly outputs: readonly [{
53
+ readonly type: "bool";
54
+ }];
55
+ readonly stateMutability: "nonpayable";
56
+ readonly type: "function";
57
+ readonly name: "isValidSig";
58
+ }];
59
+ /**
60
+ * Asserts that the wrapped signature is valid.
61
+ *
62
+ * @example
63
+ * ```ts twoslash
64
+ * import { WrappedSignature } from 'ox/erc6492'
65
+ *
66
+ * WrappedSignature.assert('0xdeadbeef')
67
+ * // @error: InvalidWrappedSignatureError: Value `0xdeadbeef` is an invalid ERC-6492 wrapped signature.
68
+ * ```
69
+ *
70
+ * @param wrapped - The wrapped signature to assert.
71
+ */
72
+ export declare function assert(wrapped: Hex.Hex): void;
73
+ export declare namespace assert {
74
+ type ErrorType = InvalidWrappedSignatureError | Hex.slice.ErrorType | Errors.GlobalErrorType;
75
+ }
76
+ /**
77
+ * Parses an [ERC-6492 wrapped signature](https://eips.ethereum.org/EIPS/eip-6492#specification) into its constituent parts.
78
+ *
79
+ * @example
80
+ * ```ts twoslash
81
+ * // @noErrors
82
+ * import { Secp256k1 } from 'ox'
83
+ * import { WrappedSignature } from 'ox/erc6492' // [!code focus]
84
+ *
85
+ * const signature = Secp256k1.sign({
86
+ * payload: '0x...',
87
+ * privateKey: '0x...',
88
+ * })
89
+ *
90
+ * // Instantiate from serialized format. // [!code focus]
91
+ * const wrapped = WrappedSignature.from('0x...') // [!code focus]
92
+ * // @log: { data: '0x...', signature: { ... }, to: '0x...', } // [!code focus]
93
+ *
94
+ * // Instantiate from constituent parts. // [!code focus]
95
+ * const wrapped = WrappedSignature.from({ // [!code focus]
96
+ * data: '0x...', // [!code focus]
97
+ * signature, // [!code focus]
98
+ * to: '0x...', // [!code focus]
99
+ * })
100
+ * // @log: { data: '0x...', signature: { ... }, to: '0x...', }
101
+ * ```
102
+ *
103
+ * @param wrapped - Wrapped signature to parse.
104
+ * @returns Wrapped signature.
105
+ */
106
+ export declare function from(wrapped: WrappedSignature | Hex.Hex): WrappedSignature;
107
+ export declare namespace from {
108
+ type ReturnType = WrappedSignature;
109
+ type ErrorType = AbiParameters.from.ErrorType | AbiParameters.decode.ErrorType | Signature.fromHex.ErrorType | Errors.GlobalErrorType;
110
+ }
111
+ /**
112
+ * Parses an [ERC-6492 wrapped signature](https://eips.ethereum.org/EIPS/eip-6492#specification) into its constituent parts.
113
+ *
114
+ * @example
115
+ * ```ts twoslash
116
+ * import { WrappedSignature } from 'ox/erc6492'
117
+ *
118
+ * const { data, signature, to } = WrappedSignature.fromHex('0x...')
119
+ * ```
120
+ *
121
+ * @param wrapped - Wrapped signature to parse.
122
+ * @returns Wrapped signature.
123
+ */
124
+ export declare function fromHex(wrapped: Hex.Hex): WrappedSignature;
125
+ export declare namespace fromHex {
126
+ type ErrorType = AbiParameters.from.ErrorType | AbiParameters.decode.ErrorType | Signature.fromHex.ErrorType | Errors.GlobalErrorType;
127
+ }
128
+ /**
129
+ * Serializes an [ERC-6492 wrapped signature](https://eips.ethereum.org/EIPS/eip-6492#specification).
130
+ *
131
+ * @example
132
+ * ```ts twoslash
133
+ * import { Secp256k1 } from 'ox'
134
+ * import { WrappedSignature } from 'ox/erc6492' // [!code focus]
135
+ *
136
+ * const signature = Secp256k1.sign({
137
+ * payload: '0x...',
138
+ * privateKey: '0x...',
139
+ * })
140
+ *
141
+ * const wrapped = WrappedSignature.toHex({ // [!code focus]
142
+ * data: '0xdeadbeef', // [!code focus]
143
+ * signature, // [!code focus]
144
+ * to: '0x00000000219ab540356cBB839Cbe05303d7705Fa', // [!code focus]
145
+ * }) // [!code focus]
146
+ * ```
147
+ *
148
+ * @param value - Wrapped signature to serialize.
149
+ * @returns Serialized wrapped signature.
150
+ */
151
+ export declare function toHex(value: WrappedSignature): Hex.Hex;
152
+ export declare namespace toHex {
153
+ type ErrorType = AbiParameters.encode.ErrorType | Hex.concat.ErrorType | Signature.toHex.ErrorType | Errors.GlobalErrorType;
154
+ }
155
+ /**
156
+ * Validates a wrapped signature. Returns `true` if the wrapped signature is valid, `false` otherwise.
157
+ *
158
+ * @example
159
+ * ```ts twoslash
160
+ * import { WrappedSignature } from 'ox/erc6492'
161
+ *
162
+ * const valid = WrappedSignature.validate('0xdeadbeef')
163
+ * // @log: false
164
+ * ```
165
+ *
166
+ * @param wrapped - The wrapped signature to validate.
167
+ * @returns `true` if the wrapped signature is valid, `false` otherwise.
168
+ */
169
+ export declare function validate(wrapped: Hex.Hex): boolean;
170
+ export declare namespace validate {
171
+ type ErrorType = Errors.GlobalErrorType;
172
+ }
173
+ /** Thrown when the ERC-6492 wrapped signature is invalid. */
174
+ export declare class InvalidWrappedSignatureError extends Errors.BaseError {
175
+ readonly name = "WrappedSignature.InvalidWrappedSignatureError";
176
+ constructor(wrapped: Hex.Hex);
177
+ }
178
+ //# sourceMappingURL=WrappedSignature.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WrappedSignature.d.ts","sourceRoot":"","sources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AAC,SAAS,GAC9B,SAAS,CAAC,OAAO,CAAC,SAAS,GAC3B,MAAM,CAAC,eAAe,CAAA;CAC3B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,GAAG,gBAAgB,CAW1D;AAED,MAAM,CAAC,OAAO,WAAW,OAAO,CAAC;IAC/B,KAAK,SAAS,GACV,aAAa,CAAC,IAAI,CAAC,SAAS,GAC5B,aAAa,CAAC,MAAM,CAAC,SAAS,GAC9B,SAAS,CAAC,OAAO,CAAC,SAAS,GAC3B,MAAM,CAAC,eAAe,CAAA;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,gBAAgB,GAAG,GAAG,CAAC,GAAG,CAWtD;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,KAAK,SAAS,GACV,aAAa,CAAC,MAAM,CAAC,SAAS,GAC9B,GAAG,CAAC,MAAM,CAAC,SAAS,GACpB,SAAS,CAAC,KAAK,CAAC,SAAS,GACzB,MAAM,CAAC,eAAe,CAAA;CAC3B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,GAAG,GAAG,OAAO,CAOlD;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,KAAK,SAAS,GAAG,MAAM,CAAC,eAAe,CAAA;CACxC;AAED,6DAA6D;AAC7D,qBAAa,4BAA6B,SAAQ,MAAM,CAAC,SAAS;IAChE,SAAkB,IAAI,mDAAkD;gBAE5D,OAAO,EAAE,GAAG,CAAC,GAAG;CAG7B"}
@@ -0,0 +1,27 @@
1
+ /** @entrypointCategory ERCs */
2
+ export type {};
3
+ /**
4
+ * Utility functions for working with [ERC-6492 wrapped signatures](https://eips.ethereum.org/EIPS/eip-6492#specification).
5
+ *
6
+ * @example
7
+ * ```ts twoslash
8
+ * import { Secp256k1, PersonalMessage } from 'ox'
9
+ * import { WrappedSignature } from 'ox/erc6492' // [!code focus]
10
+ *
11
+ * const signature = Secp256k1.sign({
12
+ * payload: PersonalMessage.getSignPayload('0xdeadbeef'),
13
+ * privateKey: '0x...',
14
+ * })
15
+ *
16
+ * const wrapped = WrappedSignature.toHex({ // [!code focus]
17
+ * data: '0xcafebabe', // [!code focus]
18
+ * signature, // [!code focus]
19
+ * to: '0xcafebabecafebabecafebabecafebabecafebabe', // [!code focus]
20
+ * }) // [!code focus]
21
+ * // @log: '0x000000000000000000000000cafebabecafebabecafebabecafebabecafebabe000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000004deadbeef000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041fa78c5905fb0b9d6066ef531f962a62bc6ef0d5eb59ecb134056d206f75aaed7780926ff2601a935c2c79707d9e1799948c9f19dcdde1e090e903b19a07923d01c000000000000000000000000000000000000000000000000000000000000006492649264926492649264926492649264926492649264926492649264926492'
22
+ * ```
23
+ *
24
+ * @category ERC-6492
25
+ */
26
+ export * as WrappedSignature from './WrappedSignature.js';
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../erc6492/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAE/B,YAAY,EAAE,CAAA;AAEd;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,gBAAgB,MAAM,uBAAuB,CAAA"}
package/_types/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ /** @entrypointCategory Core */
2
+ export type {};
1
3
  /**
2
4
  * Utilities & types for working with [Application Binary Interfaces (ABIs)](https://docs.soliditylang.org/en/latest/abi-spec.html)
3
5
  *
@@ -973,7 +975,7 @@ export * as Block from './core/Block.js';
973
975
  */
974
976
  export * as Bloom from './core/Bloom.js';
975
977
  /**
976
- * Utility functions for [BLS12-381](https://hackmd.io/@benjaminion/bls12-381) cryptography.
978
+ * Utility functions for [BLS12-381](https://hackmd.io/\@benjaminion/bls12-381) cryptography.
977
979
  *
978
980
  * :::info
979
981
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkHG;AACH,OAAO,KAAK,GAAG,MAAM,eAAe,CAAA;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,OAAO,KAAK,cAAc,MAAM,0BAA0B,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgHG;AACH,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAA;AAE9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2FG;AACH,OAAO,KAAK,WAAW,MAAM,uBAAuB,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2EG;AACH,OAAO,KAAK,OAAO,MAAM,mBAAmB,CAAA;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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MAAM,wBAAwB,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8DG;AACH,OAAO,KAAK,aAAa,MAAM,yBAAyB,CAAA;AAExD;;;;GAIG;AACH,OAAO,KAAK,UAAU,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,4 @@
1
+ /** Used by api-extractor for docgen. https://github.com/microsoft/rushstack/issues/3557 */
2
+ export * from './index.js';
3
+ export * from './erc6492/index.js';
4
+ //# sourceMappingURL=index.docs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.docs.d.ts","sourceRoot":"","sources":["../index.docs.ts"],"names":[],"mappings":"AACA,2FAA2F;AAC3F,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA"}
@@ -1,3 +1,3 @@
1
1
  /** @internal */
2
- export declare const version = "0.4.0";
2
+ export declare const version = "0.4.2";
3
3
  //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1,6 @@
1
+ {
2
+ "type": "module",
3
+ "types": "../../_types/erc6492/WrappedSignature.d.ts",
4
+ "main": "../../_cjs/erc6492/WrappedSignature.js",
5
+ "module": "../../_esm/erc6492/WrappedSignature.js"
6
+ }
@@ -0,0 +1,262 @@
1
+ import type * as Abi from '../core/Abi.js'
2
+ import * as AbiParameters from '../core/AbiParameters.js'
3
+ import type * as Address from '../core/Address.js'
4
+ import * as Errors from '../core/Errors.js'
5
+ import * as Hex from '../core/Hex.js'
6
+ import * as Signature from '../core/Signature.js'
7
+
8
+ /** ERC-6492 Wrapped Signature. */
9
+ export type WrappedSignature = {
10
+ /** Calldata to pass to the target address for counterfactual verification. */
11
+ data: Hex.Hex
12
+ /** The original signature. */
13
+ signature: Signature.Signature
14
+ /** The target address to use for counterfactual verification. */
15
+ to: Address.Address
16
+ }
17
+
18
+ /**
19
+ * Magic bytes used to identify ERC-6492 wrapped signatures.
20
+ */
21
+ export const magicBytes =
22
+ '0x6492649264926492649264926492649264926492649264926492649264926492' as const
23
+
24
+ /**
25
+ * Deployless ERC-6492 signature verification bytecode.
26
+ */
27
+ export const universalSignatureValidatorBytecode =
28
+ '0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572'
29
+
30
+ /**
31
+ * ABI for the ERC-6492 universal deployless signature validator contract.
32
+ *
33
+ * Constructor return value is `0x1` (valid) or `0x0` (invalid).
34
+ */
35
+ export const universalSignatureValidatorAbi = [
36
+ {
37
+ inputs: [
38
+ {
39
+ name: '_signer',
40
+ type: 'address',
41
+ },
42
+ {
43
+ name: '_hash',
44
+ type: 'bytes32',
45
+ },
46
+ {
47
+ name: '_signature',
48
+ type: 'bytes',
49
+ },
50
+ ],
51
+ stateMutability: 'nonpayable',
52
+ type: 'constructor',
53
+ },
54
+ {
55
+ inputs: [
56
+ {
57
+ name: '_signer',
58
+ type: 'address',
59
+ },
60
+ {
61
+ name: '_hash',
62
+ type: 'bytes32',
63
+ },
64
+ {
65
+ name: '_signature',
66
+ type: 'bytes',
67
+ },
68
+ ],
69
+ outputs: [
70
+ {
71
+ type: 'bool',
72
+ },
73
+ ],
74
+ stateMutability: 'nonpayable',
75
+ type: 'function',
76
+ name: 'isValidSig',
77
+ },
78
+ ] as const satisfies Abi.Abi
79
+
80
+ /**
81
+ * Asserts that the wrapped signature is valid.
82
+ *
83
+ * @example
84
+ * ```ts twoslash
85
+ * import { WrappedSignature } from 'ox/erc6492'
86
+ *
87
+ * WrappedSignature.assert('0xdeadbeef')
88
+ * // @error: InvalidWrappedSignatureError: Value `0xdeadbeef` is an invalid ERC-6492 wrapped signature.
89
+ * ```
90
+ *
91
+ * @param wrapped - The wrapped signature to assert.
92
+ */
93
+ export function assert(wrapped: Hex.Hex) {
94
+ if (Hex.slice(wrapped, -32) !== magicBytes)
95
+ throw new InvalidWrappedSignatureError(wrapped)
96
+ }
97
+
98
+ export declare namespace assert {
99
+ type ErrorType =
100
+ | InvalidWrappedSignatureError
101
+ | Hex.slice.ErrorType
102
+ | Errors.GlobalErrorType
103
+ }
104
+
105
+ /**
106
+ * Parses an [ERC-6492 wrapped signature](https://eips.ethereum.org/EIPS/eip-6492#specification) into its constituent parts.
107
+ *
108
+ * @example
109
+ * ```ts twoslash
110
+ * // @noErrors
111
+ * import { Secp256k1 } from 'ox'
112
+ * import { WrappedSignature } from 'ox/erc6492' // [!code focus]
113
+ *
114
+ * const signature = Secp256k1.sign({
115
+ * payload: '0x...',
116
+ * privateKey: '0x...',
117
+ * })
118
+ *
119
+ * // Instantiate from serialized format. // [!code focus]
120
+ * const wrapped = WrappedSignature.from('0x...') // [!code focus]
121
+ * // @log: { data: '0x...', signature: { ... }, to: '0x...', } // [!code focus]
122
+ *
123
+ * // Instantiate from constituent parts. // [!code focus]
124
+ * const wrapped = WrappedSignature.from({ // [!code focus]
125
+ * data: '0x...', // [!code focus]
126
+ * signature, // [!code focus]
127
+ * to: '0x...', // [!code focus]
128
+ * })
129
+ * // @log: { data: '0x...', signature: { ... }, to: '0x...', }
130
+ * ```
131
+ *
132
+ * @param wrapped - Wrapped signature to parse.
133
+ * @returns Wrapped signature.
134
+ */
135
+ export function from(wrapped: WrappedSignature | Hex.Hex): WrappedSignature {
136
+ if (typeof wrapped === 'string') return fromHex(wrapped)
137
+ return wrapped
138
+ }
139
+
140
+ export declare namespace from {
141
+ type ReturnType = WrappedSignature
142
+
143
+ type ErrorType =
144
+ | AbiParameters.from.ErrorType
145
+ | AbiParameters.decode.ErrorType
146
+ | Signature.fromHex.ErrorType
147
+ | Errors.GlobalErrorType
148
+ }
149
+
150
+ /**
151
+ * Parses an [ERC-6492 wrapped signature](https://eips.ethereum.org/EIPS/eip-6492#specification) into its constituent parts.
152
+ *
153
+ * @example
154
+ * ```ts twoslash
155
+ * import { WrappedSignature } from 'ox/erc6492'
156
+ *
157
+ * const { data, signature, to } = WrappedSignature.fromHex('0x...')
158
+ * ```
159
+ *
160
+ * @param wrapped - Wrapped signature to parse.
161
+ * @returns Wrapped signature.
162
+ */
163
+ export function fromHex(wrapped: Hex.Hex): WrappedSignature {
164
+ assert(wrapped)
165
+
166
+ const [to, data, signature_hex] = AbiParameters.decode(
167
+ AbiParameters.from('address, bytes, bytes'),
168
+ wrapped,
169
+ )
170
+
171
+ const signature = Signature.fromHex(signature_hex)
172
+
173
+ return { data, signature, to }
174
+ }
175
+
176
+ export declare namespace fromHex {
177
+ type ErrorType =
178
+ | AbiParameters.from.ErrorType
179
+ | AbiParameters.decode.ErrorType
180
+ | Signature.fromHex.ErrorType
181
+ | Errors.GlobalErrorType
182
+ }
183
+
184
+ /**
185
+ * Serializes an [ERC-6492 wrapped signature](https://eips.ethereum.org/EIPS/eip-6492#specification).
186
+ *
187
+ * @example
188
+ * ```ts twoslash
189
+ * import { Secp256k1 } from 'ox'
190
+ * import { WrappedSignature } from 'ox/erc6492' // [!code focus]
191
+ *
192
+ * const signature = Secp256k1.sign({
193
+ * payload: '0x...',
194
+ * privateKey: '0x...',
195
+ * })
196
+ *
197
+ * const wrapped = WrappedSignature.toHex({ // [!code focus]
198
+ * data: '0xdeadbeef', // [!code focus]
199
+ * signature, // [!code focus]
200
+ * to: '0x00000000219ab540356cBB839Cbe05303d7705Fa', // [!code focus]
201
+ * }) // [!code focus]
202
+ * ```
203
+ *
204
+ * @param value - Wrapped signature to serialize.
205
+ * @returns Serialized wrapped signature.
206
+ */
207
+ export function toHex(value: WrappedSignature): Hex.Hex {
208
+ const { data, signature, to } = value
209
+
210
+ return Hex.concat(
211
+ AbiParameters.encode(AbiParameters.from('address, bytes, bytes'), [
212
+ to,
213
+ data,
214
+ Signature.toHex(signature),
215
+ ]),
216
+ magicBytes,
217
+ )
218
+ }
219
+
220
+ export declare namespace toHex {
221
+ type ErrorType =
222
+ | AbiParameters.encode.ErrorType
223
+ | Hex.concat.ErrorType
224
+ | Signature.toHex.ErrorType
225
+ | Errors.GlobalErrorType
226
+ }
227
+
228
+ /**
229
+ * Validates a wrapped signature. Returns `true` if the wrapped signature is valid, `false` otherwise.
230
+ *
231
+ * @example
232
+ * ```ts twoslash
233
+ * import { WrappedSignature } from 'ox/erc6492'
234
+ *
235
+ * const valid = WrappedSignature.validate('0xdeadbeef')
236
+ * // @log: false
237
+ * ```
238
+ *
239
+ * @param wrapped - The wrapped signature to validate.
240
+ * @returns `true` if the wrapped signature is valid, `false` otherwise.
241
+ */
242
+ export function validate(wrapped: Hex.Hex): boolean {
243
+ try {
244
+ assert(wrapped)
245
+ return true
246
+ } catch {
247
+ return false
248
+ }
249
+ }
250
+
251
+ export declare namespace validate {
252
+ type ErrorType = Errors.GlobalErrorType
253
+ }
254
+
255
+ /** Thrown when the ERC-6492 wrapped signature is invalid. */
256
+ export class InvalidWrappedSignatureError extends Errors.BaseError {
257
+ override readonly name = 'WrappedSignature.InvalidWrappedSignatureError'
258
+
259
+ constructor(wrapped: Hex.Hex) {
260
+ super(`Value \`${wrapped}\` is an invalid ERC-6492 wrapped signature.`)
261
+ }
262
+ }
@@ -0,0 +1,28 @@
1
+ /** @entrypointCategory ERCs */
2
+ // biome-ignore lint/complexity/noUselessEmptyExport: tsdoc
3
+ export type {}
4
+
5
+ /**
6
+ * Utility functions for working with [ERC-6492 wrapped signatures](https://eips.ethereum.org/EIPS/eip-6492#specification).
7
+ *
8
+ * @example
9
+ * ```ts twoslash
10
+ * import { Secp256k1, PersonalMessage } from 'ox'
11
+ * import { WrappedSignature } from 'ox/erc6492' // [!code focus]
12
+ *
13
+ * const signature = Secp256k1.sign({
14
+ * payload: PersonalMessage.getSignPayload('0xdeadbeef'),
15
+ * privateKey: '0x...',
16
+ * })
17
+ *
18
+ * const wrapped = WrappedSignature.toHex({ // [!code focus]
19
+ * data: '0xcafebabe', // [!code focus]
20
+ * signature, // [!code focus]
21
+ * to: '0xcafebabecafebabecafebabecafebabecafebabe', // [!code focus]
22
+ * }) // [!code focus]
23
+ * // @log: '0x000000000000000000000000cafebabecafebabecafebabecafebabecafebabe000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000004deadbeef000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041fa78c5905fb0b9d6066ef531f962a62bc6ef0d5eb59ecb134056d206f75aaed7780926ff2601a935c2c79707d9e1799948c9f19dcdde1e090e903b19a07923d01c000000000000000000000000000000000000000000000000000000000000006492649264926492649264926492649264926492649264926492649264926492'
24
+ * ```
25
+ *
26
+ * @category ERC-6492
27
+ */
28
+ export * as WrappedSignature from './WrappedSignature.js'
@@ -0,0 +1,6 @@
1
+ {
2
+ "type": "module",
3
+ "types": "../_types/erc6492/index.d.ts",
4
+ "main": "../_cjs/erc6492/index.js",
5
+ "module": "../_esm/erc6492/index.js"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "type": "module",
3
+ "types": "../_types/undefined/index.docs.d.ts",
4
+ "main": "../_cjs/undefined/index.docs.js",
5
+ "module": "../_esm/undefined/index.docs.js"
6
+ }
package/index.docs.ts ADDED
@@ -0,0 +1,4 @@
1
+ // @ts-nocheck
2
+ /** Used by api-extractor for docgen. https://github.com/microsoft/rushstack/issues/3557 */
3
+ export * from './index.js'
4
+ export * from './erc6492/index.js'
package/index.ts CHANGED
@@ -1,3 +1,7 @@
1
+ /** @entrypointCategory Core */
2
+ // biome-ignore lint/complexity/noUselessEmptyExport: tsdoc
3
+ export type {}
4
+
1
5
  /**
2
6
  * Utilities & types for working with [Application Binary Interfaces (ABIs)](https://docs.soliditylang.org/en/latest/abi-spec.html)
3
7
  *
@@ -990,7 +994,7 @@ export * as Block from './core/Block.js'
990
994
  export * as Bloom from './core/Bloom.js'
991
995
 
992
996
  /**
993
- * Utility functions for [BLS12-381](https://hackmd.io/@benjaminion/bls12-381) cryptography.
997
+ * Utility functions for [BLS12-381](https://hackmd.io/\@benjaminion/bls12-381) cryptography.
994
998
  *
995
999
  * :::info
996
1000
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ox",
3
3
  "description": "Ethereum Standard Library",
4
- "version": "0.4.0",
4
+ "version": "0.4.2",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
7
7
  "types": "./_types/index.d.ts",
@@ -357,6 +357,21 @@
357
357
  "import": "./_esm/core/Withdrawal.js",
358
358
  "default": "./_cjs/core/Withdrawal.js"
359
359
  },
360
+ "./erc6492/WrappedSignature": {
361
+ "types": "./_types/erc6492/WrappedSignature.d.ts",
362
+ "import": "./_esm/erc6492/WrappedSignature.js",
363
+ "default": "./_cjs/erc6492/WrappedSignature.js"
364
+ },
365
+ "./erc6492": {
366
+ "types": "./_types/erc6492/index.d.ts",
367
+ "import": "./_esm/erc6492/index.js",
368
+ "default": "./_cjs/erc6492/index.js"
369
+ },
370
+ "./index.docs": {
371
+ "types": "./_types/index.docs.d.ts",
372
+ "import": "./_esm/index.docs.js",
373
+ "default": "./_cjs/index.docs.js"
374
+ },
360
375
  ".": {
361
376
  "types": "./_types/index.d.ts",
362
377
  "import": "./_esm/index.js",
@@ -373,11 +388,6 @@
373
388
  "import": "./_esm/trusted-setups/index.js",
374
389
  "default": "./_cjs/trusted-setups/index.js"
375
390
  },
376
- "./version": {
377
- "types": "./_types/version.d.ts",
378
- "import": "./_esm/version.js",
379
- "default": "./_cjs/version.js"
380
- },
381
391
  "./window": {
382
392
  "types": "./_types/window/index.d.ts",
383
393
  "import": "./_esm/window/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "type": "module",
3
- "types": "../_types/trusted-setups/Paths.d.ts",
4
- "main": "../_cjs/trusted-setups/Paths.js",
5
- "module": "../_esm/trusted-setups/Paths.js"
3
+ "types": "../../_types/trusted-setups/Paths.d.ts",
4
+ "main": "../../_cjs/trusted-setups/Paths.js",
5
+ "module": "../../_esm/trusted-setups/Paths.js"
6
6
  }
package/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** @internal */
2
- export const version = '0.4.0'
2
+ export const version = '0.4.2'
@@ -1,10 +0,0 @@
1
- import { expect, test } from 'vitest'
2
- import * as Module from './Paths.js'
3
-
4
- test('exports', () => {
5
- expect(Object.keys(Module)).toMatchInlineSnapshot(`
6
- [
7
- "mainnet",
8
- ]
9
- `)
10
- })
@@ -1,10 +0,0 @@
1
- import { expect, test } from 'vitest'
2
- import * as Module from './index.js'
3
-
4
- test('exports', () => {
5
- expect(Object.keys(Module)).toMatchInlineSnapshot(`
6
- [
7
- "Paths",
8
- ]
9
- `)
10
- })
@@ -1,6 +0,0 @@
1
- {
2
- "type": "module",
3
- "types": "../_types/version.d.ts",
4
- "main": "../_cjs/version.js",
5
- "module": "../_esm/version.js"
6
- }