viem 2.15.0 → 2.16.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +28 -0
- package/README.md +17 -11
- package/_cjs/actions/public/verifyHash.js +21 -3
- package/_cjs/actions/public/verifyHash.js.map +1 -1
- package/_cjs/actions/public/verifyMessage.js +3 -1
- package/_cjs/actions/public/verifyMessage.js.map +1 -1
- package/_cjs/actions/public/verifyTypedData.js +3 -1
- package/_cjs/actions/public/verifyTypedData.js.map +1 -1
- package/_cjs/chains/definitions/zetachain.js +6 -0
- package/_cjs/chains/definitions/zetachain.js.map +1 -1
- package/_cjs/chains/definitions/zetachainAthensTestnet.js +6 -0
- package/_cjs/chains/definitions/zetachainAthensTestnet.js.map +1 -1
- package/_cjs/chains/definitions/zircuitTestnet.js +27 -0
- package/_cjs/chains/definitions/zircuitTestnet.js.map +1 -0
- package/_cjs/chains/index.js +3 -1
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/experimental/index.js +10 -4
- package/_cjs/experimental/index.js.map +1 -1
- package/_cjs/experimental/solady/actions/signMessage.js +40 -0
- package/_cjs/experimental/solady/actions/signMessage.js.map +1 -0
- package/_cjs/experimental/solady/actions/signTypedData.js +83 -0
- package/_cjs/experimental/solady/actions/signTypedData.js.map +1 -0
- package/_cjs/experimental/solady/decorators/solady.js +16 -0
- package/_cjs/experimental/solady/decorators/solady.js.map +1 -0
- package/_cjs/experimental/solady/types.js +3 -0
- package/_cjs/experimental/solady/types.js.map +1 -0
- package/_cjs/index.js +11 -3
- package/_cjs/index.js.map +1 -1
- package/_cjs/utils/index.js +7 -1
- package/_cjs/utils/index.js.map +1 -1
- package/_cjs/utils/signature/hashMessage.js +2 -12
- package/_cjs/utils/signature/hashMessage.js.map +1 -1
- package/_cjs/utils/signature/hashTypedData.js +3 -1
- package/_cjs/utils/signature/hashTypedData.js.map +1 -1
- package/_cjs/{experimental/erc6492 → utils/signature}/isErc6492Signature.js +1 -1
- package/_cjs/utils/signature/isErc6492Signature.js.map +1 -0
- package/_cjs/{experimental/erc6492 → utils/signature}/parseErc6492Signature.js +1 -1
- package/_cjs/utils/signature/parseErc6492Signature.js.map +1 -0
- package/_cjs/{experimental/erc6492 → utils/signature}/serializeErc6492Signature.js +2 -2
- package/_cjs/utils/signature/serializeErc6492Signature.js.map +1 -0
- package/_cjs/utils/signature/toPrefixedMessage.js +20 -0
- package/_cjs/utils/signature/toPrefixedMessage.js.map +1 -0
- package/_esm/actions/public/getTransactionCount.js +1 -1
- package/_esm/actions/public/verifyHash.js +27 -3
- package/_esm/actions/public/verifyHash.js.map +1 -1
- package/_esm/actions/public/verifyMessage.js +3 -1
- package/_esm/actions/public/verifyMessage.js.map +1 -1
- package/_esm/actions/public/verifyTypedData.js +3 -1
- package/_esm/actions/public/verifyTypedData.js.map +1 -1
- package/_esm/chains/definitions/zetachain.js +6 -0
- package/_esm/chains/definitions/zetachain.js.map +1 -1
- package/_esm/chains/definitions/zetachainAthensTestnet.js +6 -0
- package/_esm/chains/definitions/zetachainAthensTestnet.js.map +1 -1
- package/_esm/chains/definitions/zircuitTestnet.js +24 -0
- package/_esm/chains/definitions/zircuitTestnet.js.map +1 -0
- package/_esm/chains/index.js +1 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/experimental/index.js +12 -3
- package/_esm/experimental/index.js.map +1 -1
- package/_esm/experimental/solady/actions/signMessage.js +84 -0
- package/_esm/experimental/solady/actions/signMessage.js.map +1 -0
- package/_esm/experimental/solady/actions/signTypedData.js +182 -0
- package/_esm/experimental/solady/actions/signTypedData.js.map +1 -0
- package/_esm/experimental/solady/decorators/solady.js +27 -0
- package/_esm/experimental/solady/decorators/solady.js.map +1 -0
- package/_esm/experimental/solady/types.js +2 -0
- package/_esm/experimental/solady/types.js.map +1 -0
- package/_esm/index.js +4 -0
- package/_esm/index.js.map +1 -1
- package/_esm/utils/index.js +3 -0
- package/_esm/utils/index.js.map +1 -1
- package/_esm/utils/signature/hashMessage.js +2 -12
- package/_esm/utils/signature/hashMessage.js.map +1 -1
- package/_esm/utils/signature/hashTypedData.js +2 -2
- package/_esm/utils/signature/hashTypedData.js.map +1 -1
- package/_esm/{experimental/erc6492 → utils/signature}/isErc6492Signature.js +1 -1
- package/_esm/utils/signature/isErc6492Signature.js.map +1 -0
- package/_esm/{experimental/erc6492 → utils/signature}/parseErc6492Signature.js +1 -1
- package/_esm/utils/signature/parseErc6492Signature.js.map +1 -0
- package/_esm/{experimental/erc6492 → utils/signature}/serializeErc6492Signature.js +2 -2
- package/_esm/utils/signature/serializeErc6492Signature.js.map +1 -0
- package/_esm/utils/signature/toPrefixedMessage.js +16 -0
- package/_esm/utils/signature/toPrefixedMessage.js.map +1 -0
- package/_types/actions/public/getTransactionCount.d.ts +1 -1
- package/_types/actions/public/verifyHash.d.ts +6 -2
- package/_types/actions/public/verifyHash.d.ts.map +1 -1
- package/_types/actions/public/verifyMessage.d.ts +1 -1
- package/_types/actions/public/verifyMessage.d.ts.map +1 -1
- package/_types/actions/public/verifyTypedData.d.ts.map +1 -1
- package/_types/chains/definitions/zetachain.d.ts +6 -8
- package/_types/chains/definitions/zetachain.d.ts.map +1 -1
- package/_types/chains/definitions/zetachainAthensTestnet.d.ts +6 -8
- package/_types/chains/definitions/zetachainAthensTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/zircuitTestnet.d.ts +33 -0
- package/_types/chains/definitions/zircuitTestnet.d.ts.map +1 -0
- package/_types/chains/index.d.ts +1 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/experimental/index.d.ts +30 -3
- package/_types/experimental/index.d.ts.map +1 -1
- package/_types/experimental/solady/actions/signMessage.d.ts +71 -0
- package/_types/experimental/solady/actions/signMessage.d.ts.map +1 -0
- package/_types/experimental/solady/actions/signTypedData.d.ts +125 -0
- package/_types/experimental/solady/actions/signTypedData.d.ts.map +1 -0
- package/_types/experimental/solady/decorators/solady.d.ts +183 -0
- package/_types/experimental/solady/decorators/solady.d.ts.map +1 -0
- package/_types/experimental/solady/types.d.ts +7 -0
- package/_types/experimental/solady/types.d.ts.map +1 -0
- package/_types/index.d.ts +4 -0
- package/_types/index.d.ts.map +1 -1
- package/_types/utils/index.d.ts +3 -0
- package/_types/utils/index.d.ts.map +1 -1
- package/_types/utils/signature/hashMessage.d.ts +1 -3
- package/_types/utils/signature/hashMessage.d.ts.map +1 -1
- package/_types/utils/signature/hashTypedData.d.ts +9 -0
- package/_types/utils/signature/hashTypedData.d.ts.map +1 -1
- package/_types/{experimental/erc6492 → utils/signature}/isErc6492Signature.d.ts +1 -1
- package/_types/utils/signature/isErc6492Signature.d.ts.map +1 -0
- package/_types/{experimental/erc6492 → utils/signature}/parseErc6492Signature.d.ts +1 -1
- package/_types/utils/signature/parseErc6492Signature.d.ts.map +1 -0
- package/_types/utils/signature/serializeErc6492Signature.d.ts.map +1 -0
- package/_types/utils/signature/toPrefixedMessage.d.ts +7 -0
- package/_types/utils/signature/toPrefixedMessage.d.ts.map +1 -0
- package/actions/public/getTransactionCount.ts +1 -1
- package/actions/public/verifyHash.ts +31 -4
- package/actions/public/verifyMessage.ts +10 -1
- package/actions/public/verifyTypedData.ts +4 -0
- package/chains/definitions/zetachain.ts +6 -0
- package/chains/definitions/zetachainAthensTestnet.ts +6 -0
- package/chains/definitions/zircuitTestnet.ts +24 -0
- package/chains/index.ts +1 -0
- package/errors/version.ts +1 -1
- package/experimental/index.ts +33 -3
- package/experimental/solady/actions/signMessage.ts +151 -0
- package/experimental/solady/actions/signTypedData.ts +280 -0
- package/experimental/solady/decorators/solady.ts +232 -0
- package/experimental/solady/types.ts +7 -0
- package/index.ts +22 -0
- package/package.json +3 -3
- package/utils/index.ts +18 -0
- package/utils/signature/hashMessage.ts +3 -23
- package/utils/signature/hashTypedData.ts +2 -2
- package/{experimental/erc6492 → utils/signature}/isErc6492Signature.ts +1 -1
- package/{experimental/erc6492 → utils/signature}/parseErc6492Signature.ts +1 -1
- package/{experimental/erc6492 → utils/signature}/serializeErc6492Signature.ts +2 -2
- package/utils/signature/toPrefixedMessage.ts +27 -0
- package/_cjs/experimental/erc6492/isErc6492Signature.js.map +0 -1
- package/_cjs/experimental/erc6492/parseErc6492Signature.js.map +0 -1
- package/_cjs/experimental/erc6492/serializeErc6492Signature.js.map +0 -1
- package/_esm/experimental/erc6492/isErc6492Signature.js.map +0 -1
- package/_esm/experimental/erc6492/parseErc6492Signature.js.map +0 -1
- package/_esm/experimental/erc6492/serializeErc6492Signature.js.map +0 -1
- package/_types/experimental/erc6492/isErc6492Signature.d.ts.map +0 -1
- package/_types/experimental/erc6492/parseErc6492Signature.d.ts.map +0 -1
- package/_types/experimental/erc6492/serializeErc6492Signature.d.ts.map +0 -1
- /package/_types/{experimental/erc6492 → utils/signature}/serializeErc6492Signature.d.ts +0 -0
@@ -5,9 +5,18 @@ export { getCallsStatus, } from './eip5792/actions/getCallsStatus.js';
|
|
5
5
|
export { showCallsStatus, } from './eip5792/actions/showCallsStatus.js';
|
6
6
|
export { writeContracts, } from './eip5792/actions/writeContracts.js';
|
7
7
|
export { walletActionsEip5792, } from './eip5792/decorators/eip5792.js';
|
8
|
-
export {
|
9
|
-
|
10
|
-
|
8
|
+
export {
|
9
|
+
/** @deprecated This is no longer experimental – use `import { parseErc6492Signature } from 'viem'` instead. */
|
10
|
+
parseErc6492Signature, } from '../utils/signature/parseErc6492Signature.js';
|
11
|
+
export {
|
12
|
+
/** @deprecated This is no longer experimental – use `import { isErc6492Signature } from 'viem'` instead. */
|
13
|
+
isErc6492Signature, } from '../utils/signature/isErc6492Signature.js';
|
14
|
+
export {
|
15
|
+
/** @deprecated This is no longer experimental – use `import { serializeErc6492Signature } from 'viem'` instead. */
|
16
|
+
serializeErc6492Signature, } from '../utils/signature/serializeErc6492Signature.js';
|
11
17
|
export { issuePermissions, } from './erc7715/actions/issuePermissions.js';
|
12
18
|
export { walletActionsErc7715, } from './erc7715/decorators/erc7715.js';
|
19
|
+
export { signMessage, } from './solady/actions/signMessage.js';
|
20
|
+
export { signTypedData, } from './solady/actions/signTypedData.js';
|
21
|
+
export { soladyActions, } from './solady/decorators/solady.js';
|
13
22
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../experimental/index.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,OAAO,EAIL,eAAe,GAChB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAIL,SAAS,GACV,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAIL,cAAc,GACf,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAIL,eAAe,GAChB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAKL,cAAc,GACf,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAEL,oBAAoB,GACrB,MAAM,iCAAiC,CAAA;AAExC,OAAO,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../experimental/index.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,OAAO,EAIL,eAAe,GAChB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAIL,SAAS,GACV,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAIL,cAAc,GACf,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAIL,eAAe,GAChB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAKL,cAAc,GACf,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAEL,oBAAoB,GACrB,MAAM,iCAAiC,CAAA;AAExC,OAAO;AAOL,+GAA+G;AAC/G,qBAAqB,GACtB,MAAM,6CAA6C,CAAA;AACpD,OAAO;AAOL,4GAA4G;AAC5G,kBAAkB,GACnB,MAAM,0CAA0C,CAAA;AACjD,OAAO;AAOL,mHAAmH;AACnH,yBAAyB,GAC1B,MAAM,iDAAiD,CAAA;AAExD,OAAO,EAGL,gBAAgB,GACjB,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAEL,oBAAoB,GACrB,MAAM,iCAAiC,CAAA;AAExC,OAAO,EAIL,WAAW,GACZ,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAIL,aAAa,GACd,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAGL,aAAa,GACd,MAAM,+BAA+B,CAAA"}
|
@@ -0,0 +1,84 @@
|
|
1
|
+
import { parseAccount } from '../../../accounts/utils/parseAccount.js';
|
2
|
+
import { getEip712Domain, } from '../../../actions/public/getEip712Domain.js';
|
3
|
+
import { signTypedData } from '../../../actions/wallet/signTypedData.js';
|
4
|
+
import { AccountNotFoundError } from '../../../errors/account.js';
|
5
|
+
import { getAction } from '../../../utils/getAction.js';
|
6
|
+
import { toPrefixedMessage } from '../../../utils/signature/toPrefixedMessage.js';
|
7
|
+
/**
|
8
|
+
* Signs a [EIP-191](https://eips.ethereum.org/EIPS/eip-191) personal sign message via Solady's [ERC1271 `PersonalSign` format](https://github.com/Vectorized/solady/blob/678c9163550810b08f0ffb09624c9f7532392303/src/accounts/ERC1271.sol#L154-L166).
|
9
|
+
*
|
10
|
+
* This Action is suitable to sign messages for Smart Accounts that implement (or conform to) Solady's [ERC1271.sol](https://github.com/Vectorized/solady/blob/main/src/accounts/ERC1271.sol).
|
11
|
+
*
|
12
|
+
* - Docs: https://viem.sh/experimental/solady/signMessage
|
13
|
+
*
|
14
|
+
* With the calculated signature, you can:
|
15
|
+
* - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage) to verify the signature,
|
16
|
+
*
|
17
|
+
* @param client - Client to use
|
18
|
+
* @param parameters - {@link SignMessageParameters}
|
19
|
+
* @returns The signed message. {@link SignMessageReturnType}
|
20
|
+
*
|
21
|
+
* @example
|
22
|
+
* import { createWalletClient, custom } from 'viem'
|
23
|
+
* import { mainnet } from 'viem/chains'
|
24
|
+
* import { signMessage } from 'viem/experimental/solady'
|
25
|
+
*
|
26
|
+
* const client = createWalletClient({
|
27
|
+
* chain: mainnet,
|
28
|
+
* transport: custom(window.ethereum),
|
29
|
+
* })
|
30
|
+
*
|
31
|
+
* const signature = await signMessage(client, {
|
32
|
+
* account: '0xE8Df82fA4E10e6A12a9Dab552bceA2acd26De9bb',
|
33
|
+
* message: 'hello world',
|
34
|
+
* verifier: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
35
|
+
* })
|
36
|
+
*
|
37
|
+
* @example
|
38
|
+
* // Account Hoisting
|
39
|
+
* import { createWalletClient, custom } from 'viem'
|
40
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
41
|
+
* import { mainnet } from 'viem/chains'
|
42
|
+
* import { signMessage } from 'viem/experimental/solady'
|
43
|
+
*
|
44
|
+
* const client = createWalletClient({
|
45
|
+
* account: '0xE8Df82fA4E10e6A12a9Dab552bceA2acd26De9bb',
|
46
|
+
* chain: mainnet,
|
47
|
+
* transport: custom(window.ethereum),
|
48
|
+
* })
|
49
|
+
*
|
50
|
+
* const signature = await signMessage(client, {
|
51
|
+
* message: 'hello world',
|
52
|
+
* verifier: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
53
|
+
* })
|
54
|
+
*/
|
55
|
+
export async function signMessage(client, parameters) {
|
56
|
+
const { account: account_ = client.account, factory, factoryData, message, verifier, } = parameters;
|
57
|
+
if (!account_)
|
58
|
+
throw new AccountNotFoundError({
|
59
|
+
docsPath: '/experimental/solady/signMessage',
|
60
|
+
});
|
61
|
+
const account = parseAccount(account_);
|
62
|
+
const domain = await (async () => {
|
63
|
+
if (parameters.verifierDomain)
|
64
|
+
return parameters.verifierDomain;
|
65
|
+
const { domain: { salt, ...domain }, } = await getAction(client, getEip712Domain, 'getEip712Domain')({
|
66
|
+
address: verifier,
|
67
|
+
factory,
|
68
|
+
factoryData,
|
69
|
+
});
|
70
|
+
return domain;
|
71
|
+
})();
|
72
|
+
return getAction(client, signTypedData, 'signTypedData')({
|
73
|
+
account,
|
74
|
+
domain,
|
75
|
+
types: {
|
76
|
+
PersonalSign: [{ name: 'prefixed', type: 'bytes' }],
|
77
|
+
},
|
78
|
+
primaryType: 'PersonalSign',
|
79
|
+
message: {
|
80
|
+
prefixed: toPrefixedMessage(message),
|
81
|
+
},
|
82
|
+
});
|
83
|
+
}
|
84
|
+
//# sourceMappingURL=signMessage.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"signMessage.js","sourceRoot":"","sources":["../../../../experimental/solady/actions/signMessage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAA;AACtE,OAAO,EAEL,eAAe,GAChB,MAAM,4CAA4C,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAA;AAGxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAMjE,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAA;AAgCjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAK/B,MAAyC,EACzC,UAA2D;IAE3D,MAAM,EACJ,OAAO,EAAE,QAAQ,GAAG,MAAM,CAAC,OAAO,EAClC,OAAO,EACP,WAAW,EACX,OAAO,EACP,QAAQ,GACT,GAAG,UAAU,CAAA;IAEd,IAAI,CAAC,QAAQ;QACX,MAAM,IAAI,oBAAoB,CAAC;YAC7B,QAAQ,EAAE,kCAAkC;SAC7C,CAAC,CAAA;IACJ,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAA;IAEtC,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE;QAC/B,IAAI,UAAU,CAAC,cAAc;YAAE,OAAO,UAAU,CAAC,cAAc,CAAA;QAC/D,MAAM,EACJ,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,GAC5B,GAAG,MAAM,SAAS,CACjB,MAAM,EACN,eAAe,EACf,iBAAiB,CAClB,CAAC;YACA,OAAO,EAAE,QAAS;YAClB,OAAO;YACP,WAAW;SACZ,CAAC,CAAA;QACF,OAAO,MAAM,CAAA;IACf,CAAC,CAAC,EAAE,CAAA;IAEJ,OAAO,SAAS,CACd,MAAM,EACN,aAAa,EACb,eAAe,CAChB,CAAC;QACA,OAAO;QACP,MAAM;QACN,KAAK,EAAE;YACL,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;SACpD;QACD,WAAW,EAAE,cAAc;QAC3B,OAAO,EAAE;YACP,QAAQ,EAAE,iBAAiB,CAAC,OAAO,CAAC;SACrC;KACF,CAAC,CAAA;AACJ,CAAC"}
|
@@ -0,0 +1,182 @@
|
|
1
|
+
import { parseAccount } from '../../../accounts/utils/parseAccount.js';
|
2
|
+
import { getEip712Domain, } from '../../../actions/public/getEip712Domain.js';
|
3
|
+
import { signTypedData as signTypedData_ } from '../../../actions/wallet/signTypedData.js';
|
4
|
+
import { AccountNotFoundError } from '../../../errors/account.js';
|
5
|
+
import { encodePacked } from '../../../utils/abi/encodePacked.js';
|
6
|
+
import { size } from '../../../utils/data/size.js';
|
7
|
+
import { stringToHex } from '../../../utils/encoding/toHex.js';
|
8
|
+
import { getAction } from '../../../utils/getAction.js';
|
9
|
+
import { encodeType, hashStruct, } from '../../../utils/signature/hashTypedData.js';
|
10
|
+
import { getTypesForEIP712Domain } from '../../../utils/typedData.js';
|
11
|
+
/**
|
12
|
+
* Signs an [EIP-712](https://eips.ethereum.org/EIPS/eip-712) typed data message via Solady's [ERC1271 `TypedDataSign` format](https://github.com/Vectorized/solady/blob/678c9163550810b08f0ffb09624c9f7532392303/src/accounts/ERC1271.sol#L130-L151).
|
13
|
+
*
|
14
|
+
* This Action is suitable to sign messages for Smart Accounts that implement (or conform to) Solady's [ERC1271.sol](https://github.com/Vectorized/solady/blob/main/src/accounts/ERC1271.sol).
|
15
|
+
*
|
16
|
+
* - Docs: https://viem.sh/experimental/solady/signTypedData
|
17
|
+
*
|
18
|
+
* @param client - Client to use
|
19
|
+
* @param parameters - {@link SignTypedDataParameters}
|
20
|
+
* @returns The signed data. {@link SignTypedDataReturnType}
|
21
|
+
*
|
22
|
+
* @example
|
23
|
+
* import { createWalletClient, custom } from 'viem'
|
24
|
+
* import { mainnet } from 'viem/chains'
|
25
|
+
* import { signTypedData } from 'viem/experimental/solady'
|
26
|
+
*
|
27
|
+
* const client = createWalletClient({
|
28
|
+
* chain: mainnet,
|
29
|
+
* transport: custom(window.ethereum),
|
30
|
+
* })
|
31
|
+
* const signature = await signTypedData(client, {
|
32
|
+
* account: '0xE8Df82fA4E10e6A12a9Dab552bceA2acd26De9bb',
|
33
|
+
* domain: {
|
34
|
+
* name: 'Ether Mail',
|
35
|
+
* version: '1',
|
36
|
+
* chainId: 1,
|
37
|
+
* verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
|
38
|
+
* },
|
39
|
+
* types: {
|
40
|
+
* Person: [
|
41
|
+
* { name: 'name', type: 'string' },
|
42
|
+
* { name: 'wallet', type: 'address' },
|
43
|
+
* ],
|
44
|
+
* Mail: [
|
45
|
+
* { name: 'from', type: 'Person' },
|
46
|
+
* { name: 'to', type: 'Person' },
|
47
|
+
* { name: 'contents', type: 'string' },
|
48
|
+
* ],
|
49
|
+
* },
|
50
|
+
* primaryType: 'Mail',
|
51
|
+
* message: {
|
52
|
+
* from: {
|
53
|
+
* name: 'Cow',
|
54
|
+
* wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826',
|
55
|
+
* },
|
56
|
+
* to: {
|
57
|
+
* name: 'Bob',
|
58
|
+
* wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',
|
59
|
+
* },
|
60
|
+
* contents: 'Hello, Bob!',
|
61
|
+
* },
|
62
|
+
* verifier: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
63
|
+
* })
|
64
|
+
*
|
65
|
+
* @example
|
66
|
+
* // Account Hoisting
|
67
|
+
* import { createWalletClient, http } from 'viem'
|
68
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
69
|
+
* import { mainnet } from 'viem/chains'
|
70
|
+
* import { signTypedData } from 'viem/experimental/solady'
|
71
|
+
*
|
72
|
+
* const client = createWalletClient({
|
73
|
+
* account: '0xE8Df82fA4E10e6A12a9Dab552bceA2acd26De9bb'
|
74
|
+
* chain: mainnet,
|
75
|
+
* transport: http(),
|
76
|
+
* })
|
77
|
+
* const signature = await signTypedData(client, {
|
78
|
+
* domain: {
|
79
|
+
* name: 'Ether Mail',
|
80
|
+
* version: '1',
|
81
|
+
* chainId: 1,
|
82
|
+
* verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
|
83
|
+
* },
|
84
|
+
* types: {
|
85
|
+
* Person: [
|
86
|
+
* { name: 'name', type: 'string' },
|
87
|
+
* { name: 'wallet', type: 'address' },
|
88
|
+
* ],
|
89
|
+
* Mail: [
|
90
|
+
* { name: 'from', type: 'Person' },
|
91
|
+
* { name: 'to', type: 'Person' },
|
92
|
+
* { name: 'contents', type: 'string' },
|
93
|
+
* ],
|
94
|
+
* },
|
95
|
+
* primaryType: 'Mail',
|
96
|
+
* message: {
|
97
|
+
* from: {
|
98
|
+
* name: 'Cow',
|
99
|
+
* wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826',
|
100
|
+
* },
|
101
|
+
* to: {
|
102
|
+
* name: 'Bob',
|
103
|
+
* wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',
|
104
|
+
* },
|
105
|
+
* contents: 'Hello, Bob!',
|
106
|
+
* },
|
107
|
+
* verifier: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
108
|
+
* })
|
109
|
+
*/
|
110
|
+
export async function signTypedData(client, parameters) {
|
111
|
+
const { account: account_ = client.account, domain, factory, factoryData, message, primaryType, types, verifier, } = parameters;
|
112
|
+
if (!account_)
|
113
|
+
throw new AccountNotFoundError({
|
114
|
+
docsPath: '/experimental/solady/signTypedData',
|
115
|
+
});
|
116
|
+
const account = parseAccount(account_);
|
117
|
+
// Retrieve account EIP712 domain.
|
118
|
+
const { domain: verifierDomain, fields, extensions, } = await (async () => {
|
119
|
+
if (parameters.verifierDomain && parameters.fields && parameters.extensions)
|
120
|
+
return {
|
121
|
+
domain: parameters.verifierDomain,
|
122
|
+
fields: parameters.fields,
|
123
|
+
extensions: parameters.extensions,
|
124
|
+
};
|
125
|
+
return getAction(client, getEip712Domain, 'getEip712Domain')({
|
126
|
+
address: verifier,
|
127
|
+
factory,
|
128
|
+
factoryData,
|
129
|
+
});
|
130
|
+
})();
|
131
|
+
// Sign with typed data wrapper.
|
132
|
+
const signature = await getAction(client, signTypedData_, 'signTypedData')({
|
133
|
+
account,
|
134
|
+
domain,
|
135
|
+
types: {
|
136
|
+
...types,
|
137
|
+
TypedDataSign: [
|
138
|
+
{ name: 'contents', type: primaryType },
|
139
|
+
{ name: 'fields', type: 'bytes1' },
|
140
|
+
{ name: 'name', type: 'string' },
|
141
|
+
{ name: 'version', type: 'string' },
|
142
|
+
{ name: 'chainId', type: 'uint256' },
|
143
|
+
{ name: 'verifyingContract', type: 'address' },
|
144
|
+
{ name: 'salt', type: 'bytes32' },
|
145
|
+
{ name: 'extensions', type: 'uint256[]' },
|
146
|
+
],
|
147
|
+
},
|
148
|
+
primaryType: 'TypedDataSign',
|
149
|
+
message: {
|
150
|
+
contents: message,
|
151
|
+
fields,
|
152
|
+
extensions,
|
153
|
+
...verifierDomain,
|
154
|
+
},
|
155
|
+
});
|
156
|
+
// Compute dependencies for wrapped signature.
|
157
|
+
const hashedDomain = hashStruct({
|
158
|
+
data: domain ?? {},
|
159
|
+
types: {
|
160
|
+
EIP712Domain: getTypesForEIP712Domain({ domain }),
|
161
|
+
},
|
162
|
+
primaryType: 'EIP712Domain',
|
163
|
+
});
|
164
|
+
const hashedContents = hashStruct({
|
165
|
+
data: message,
|
166
|
+
types: types,
|
167
|
+
primaryType,
|
168
|
+
});
|
169
|
+
const encodedType = encodeType({
|
170
|
+
primaryType,
|
171
|
+
types: types,
|
172
|
+
});
|
173
|
+
// Construct wrapped signature.
|
174
|
+
return encodePacked(['bytes', 'bytes32', 'bytes32', 'bytes', 'uint16'], [
|
175
|
+
signature,
|
176
|
+
hashedDomain,
|
177
|
+
hashedContents,
|
178
|
+
stringToHex(encodedType),
|
179
|
+
size(stringToHex(encodedType)),
|
180
|
+
]);
|
181
|
+
}
|
182
|
+
//# sourceMappingURL=signTypedData.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"signTypedData.js","sourceRoot":"","sources":["../../../../experimental/solady/actions/signTypedData.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAA;AACtE,OAAO,EAEL,eAAe,GAChB,MAAM,4CAA4C,CAAA;AACnD,OAAO,EAAE,aAAa,IAAI,cAAc,EAAE,MAAM,0CAA0C,CAAA;AAG1F,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAOjE,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAA;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AACvD,OAAO,EACL,UAAU,EACV,UAAU,GACX,MAAM,2CAA2C,CAAA;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AAwCrE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkGG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAOjC,MAAyC,EACzC,UAKC;I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C,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;gBACpC,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,SAAS,EAAE;gBAC9C,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE;gBACjC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE;aAC1C;SACF;QACD,WAAW,EAAE,eAAe;QAC5B,OAAO,EAAE;YACP,QAAQ,EAAE,OAAc;YACxB,MAAM;YACN,UAAU;YACV,GAAI,cAAsB;SAC3B;KACF,CAAC,CAAA;IAEF,8CAA8C;IAC9C,MAAM,YAAY,GAAG,UAAU,CAAC;QAC9B,IAAI,EAAE,MAAM,IAAI,EAAE;QAClB,KAAK,EAAE;YACL,YAAY,EAAE,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;SAClD;QACD,WAAW,EAAE,cAAc;KAC5B,CAAC,CAAA;IACF,MAAM,cAAc,GAAG,UAAU,CAAC;QAChC,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,KAAY;QACnB,WAAW;KACZ,CAAC,CAAA;IACF,MAAM,WAAW,GAAG,UAAU,CAAC;QAC7B,WAAW;QACX,KAAK,EAAE,KAAY;KACpB,CAAC,CAAA;IAEF,+BAA+B;IAC/B,OAAO,YAAY,CACjB,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,EAClD;QACE,SAAS;QACT,YAAY;QACZ,cAAc;QACd,WAAW,CAAC,WAAW,CAAC;QACxB,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;KAC/B,CACF,CAAA;AACH,CAAC"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { signMessage, } from '../actions/signMessage.js';
|
2
|
+
import { signTypedData, } from '../actions/signTypedData.js';
|
3
|
+
/**
|
4
|
+
* A suite of Actions based on [Solady contracts](https://github.com/Vectorized/solady).
|
5
|
+
*
|
6
|
+
* @example
|
7
|
+
* import { createPublicClient, createWalletClient, http } from 'viem'
|
8
|
+
* import { mainnet } from 'viem/chains'
|
9
|
+
* import { soladyActions } from 'viem/experimental'
|
10
|
+
*
|
11
|
+
* const walletClient = createWalletClient({
|
12
|
+
* chain: mainnet,
|
13
|
+
* transport: http(),
|
14
|
+
* }).extend(soladyActions())
|
15
|
+
*
|
16
|
+
* const result = await walletClient.signMessage({...})
|
17
|
+
*/
|
18
|
+
export function soladyActions(parameters = {}) {
|
19
|
+
const { verifier } = parameters;
|
20
|
+
return (client) => {
|
21
|
+
return {
|
22
|
+
signMessage: (parameters) => signMessage(client, { verifier, ...parameters }),
|
23
|
+
signTypedData: (parameters) => signTypedData(client, { verifier, ...parameters }),
|
24
|
+
};
|
25
|
+
};
|
26
|
+
}
|
27
|
+
//# sourceMappingURL=solady.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"solady.js","sourceRoot":"","sources":["../../../../experimental/solady/decorators/solady.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,WAAW,GACZ,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAGL,aAAa,GACd,MAAM,6BAA6B,CAAA;AAwLpC;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,aAAa,CAC3B,aAAgD,EAAE;IAElD,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAA;IAC/B,OAAO,CAKL,MAAyC,EACP,EAAE;QACpC,OAAO;YACL,WAAW,EAAE,CAAC,UAAU,EAAE,EAAE,CAC1B,WAAW,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,CAAC;YAClD,aAAa,EAAE,CAAC,UAAU,EAAE,EAAE,CAC5B,aAAa,CAAC,MAAM,EAAE,EAAE,QAAQ,EAAE,GAAI,UAAkB,EAAE,CAAC;SAC9D,CAAA;IACH,CAAC,CAAA;AACH,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../experimental/solady/types.ts"],"names":[],"mappings":""}
|
package/_esm/index.js
CHANGED
@@ -90,6 +90,9 @@ serializeSignature as signatureToHex, serializeSignature, } from './utils/signat
|
|
90
90
|
export { bytesToRlp, hexToRlp, toRlp, } from './utils/encoding/toRlp.js';
|
91
91
|
export { verifyMessage, } from './utils/signature/verifyMessage.js';
|
92
92
|
export { verifyTypedData, } from './utils/signature/verifyTypedData.js';
|
93
|
+
export { parseErc6492Signature, } from './utils/signature/parseErc6492Signature.js';
|
94
|
+
export { isErc6492Signature, } from './utils/signature/isErc6492Signature.js';
|
95
|
+
export { serializeErc6492Signature, } from './utils/signature/serializeErc6492Signature.js';
|
93
96
|
export { assertRequest, } from './utils/transaction/assertRequest.js';
|
94
97
|
export { assertTransactionEIP1559, assertTransactionEIP2930, assertTransactionLegacy, } from './utils/transaction/assertTransaction.js';
|
95
98
|
export { boolToBytes, hexToBytes, numberToBytes, stringToBytes, toBytes, } from './utils/encoding/toBytes.js';
|
@@ -138,6 +141,7 @@ toFunctionSignature as getFunctionSignature, } from './utils/hash/toFunctionSign
|
|
138
141
|
export { toEventHash, } from './utils/hash/toEventHash.js';
|
139
142
|
export { toFunctionHash, } from './utils/hash/toFunctionHash.js';
|
140
143
|
export { hashMessage, } from './utils/signature/hashMessage.js';
|
144
|
+
export { toPrefixedMessage, } from './utils/signature/toPrefixedMessage.js';
|
141
145
|
export { isAddress, } from './utils/address/isAddress.js';
|
142
146
|
export { isAddressEqual, } from './utils/address/isAddressEqual.js';
|
143
147
|
export { isBytes } from './utils/data/isBytes.js';
|
package/_esm/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,OAAO,EAkBL,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,4BAA4B,EAC5B,4BAA4B,EAC5B,oBAAoB,EACpB,qBAAqB,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CAAA;AACrC,OAAO,EAGL,cAAc,GACf,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAyB,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAAwB,MAAM,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,EAAuB,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAClE,OAAO,EAGL,SAAS,GACV,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAGL,MAAM,GACP,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAGL,SAAS,GACV,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAKL,GAAG,EACH,QAAQ,EACR,MAAM,GACP,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAEL,UAAU,GACX,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAA2B,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,EAGL,gBAAgB,GACjB,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAEL,UAAU,GACX,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAEL,mBAAmB,GACpB,MAAM,4CAA4C,CAAA;AACnD,OAAO,EACL,oBAAoB,GAIrB,MAAM,6CAA6C,CAAA;AACpD,OAAO,EAAsB,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAC/D,OAAO,EAIL,KAAK,EACL,UAAU,EACV,QAAQ,GACT,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAA2B,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACzE,OAAO,EAGL,IAAI,GACL,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAKL,kBAAkB,EAClB,iBAAiB,EACjB,eAAe,EACf,uBAAuB,GACxB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAIL,kBAAkB,EAClB,YAAY,GACb,MAAM,yBAAyB,CAAA"}
|
package/_esm/utils/index.js
CHANGED
@@ -89,6 +89,9 @@ export { recoverTypedDataAddress, } from './signature/recoverTypedDataAddress.js
|
|
89
89
|
export { verifyMessage, } from './signature/verifyMessage.js';
|
90
90
|
export { verifyTypedData, } from './signature/verifyTypedData.js';
|
91
91
|
export { hashMessage, } from './signature/hashMessage.js';
|
92
|
+
export { parseErc6492Signature, } from './signature/parseErc6492Signature.js';
|
93
|
+
export { isErc6492Signature, } from './signature/isErc6492Signature.js';
|
94
|
+
export { serializeErc6492Signature, } from './signature/serializeErc6492Signature.js';
|
92
95
|
export { getSerializedTransactionType, } from './transaction/getSerializedTransactionType.js';
|
93
96
|
export { getTransactionType, } from './transaction/getTransactionType.js';
|
94
97
|
export { assertRequest, } from './transaction/assertRequest.js';
|
package/_esm/utils/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../utils/index.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,OAAO,EAEL,YAAY,GACb,MAAM,mBAAmB,CAAA;AAE1B,OAAO,EAEL,WAAW;AACX,qCAAqC;AACrC,WAAW,IAAI,SAAS,EACxB,cAAc,EACd,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,WAAW,CAAA;AAElB,OAAO,EAGL,kBAAkB,GACnB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAIL,YAAY,GACb,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAEL,uBAAuB,GACxB,MAAM,oCAAoC,CAAA;AAE3C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAEjE,OAAO,EAOL,SAAS,EACT,GAAG,GACJ,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAML,gBAAgB,GACjB,MAAM,eAAe,CAAA;AACtB,OAAO,EAML,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAA2B,SAAS,EAAE,MAAM,g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C,OAAO,EAIL,qBAAqB,GACtB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAIL,kBAAkB,GACnB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAIL,yBAAyB,GAC1B,MAAM,0CAA0C,CAAA;AACjD,OAAO,EAGL,4BAA4B,GAC7B,MAAM,+CAA+C,CAAA;AACtD,OAAO,EAGL,kBAAkB,GACnB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAEL,aAAa,GACd,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAIL,wBAAwB,EACxB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAEL,gBAAgB,GACjB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EACL,oBAAoB,GAGrB,MAAM,uCAAuC,CAAA;AAC9C,OAAO,EAEL,mBAAmB,GACpB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,EAA6B,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC9E,OAAO,EAA4B,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAC3E,OAAO,EAA6B,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAC9E,OAAO,EAA4B,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAC3E,OAAO,EAA4B,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAC3E,OAAO,EAA2B,SAAS,EAAE,MAAM,qBAAqB,CAAA;AACxE,OAAO,EAIL,kBAAkB,EAClB,YAAY,GACb,MAAM,mBAAmB,CAAA"}
|
@@ -1,16 +1,6 @@
|
|
1
|
-
import { presignMessagePrefix } from '../../constants/strings.js';
|
2
|
-
import { concat } from '../data/concat.js';
|
3
|
-
import { stringToBytes, toBytes, } from '../encoding/toBytes.js';
|
4
1
|
import { keccak256 } from '../hash/keccak256.js';
|
2
|
+
import { toPrefixedMessage } from './toPrefixedMessage.js';
|
5
3
|
export function hashMessage(message, to_) {
|
6
|
-
|
7
|
-
if (typeof message === 'string')
|
8
|
-
return stringToBytes(message);
|
9
|
-
if (message.raw instanceof Uint8Array)
|
10
|
-
return message.raw;
|
11
|
-
return toBytes(message.raw);
|
12
|
-
})();
|
13
|
-
const prefixBytes = stringToBytes(`${presignMessagePrefix}${messageBytes.length}`);
|
14
|
-
return keccak256(concat([prefixBytes, messageBytes]), to_);
|
4
|
+
return keccak256(toPrefixedMessage(message), to_);
|
15
5
|
}
|
16
6
|
//# sourceMappingURL=hashMessage.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"hashMessage.js","sourceRoot":"","sources":["../../../utils/signature/hashMessage.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"hashMessage.js","sourceRoot":"","sources":["../../../utils/signature/hashMessage.ts"],"names":[],"mappings":"AAEA,OAAO,EAA2B,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAU1D,MAAM,UAAU,WAAW,CACzB,OAAwB,EACxB,GAAqB;IAErB,OAAO,SAAS,CAAC,iBAAiB,CAAC,OAAO,CAAC,EAAE,GAAG,CAAC,CAAA;AACnD,CAAC"}
|
@@ -39,7 +39,7 @@ export function hashDomain({ domain, types, }) {
|
|
39
39
|
types,
|
40
40
|
});
|
41
41
|
}
|
42
|
-
function hashStruct({ data, primaryType, types, }) {
|
42
|
+
export function hashStruct({ data, primaryType, types, }) {
|
43
43
|
const encoded = encodeData({
|
44
44
|
data,
|
45
45
|
primaryType,
|
@@ -66,7 +66,7 @@ function hashType({ primaryType, types, }) {
|
|
66
66
|
const encodedHashType = toHex(encodeType({ primaryType, types }));
|
67
67
|
return keccak256(encodedHashType);
|
68
68
|
}
|
69
|
-
function encodeType({ primaryType, types, }) {
|
69
|
+
export function encodeType({ primaryType, types, }) {
|
70
70
|
let result = '';
|
71
71
|
const unsortedDeps = findTypeDependencies({ primaryType, types });
|
72
72
|
unsortedDeps.delete(primaryType);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":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cAAc;QAC3B,KAAK;KACN,CAAC,CAAA;AACJ,CAAC;AAID,
|
1
|
+
{"version":3,"file":"hashTypedData.js","sourceRoot":"","sources":["../../../utils/signature/hashTypedData.ts"],"names":[],"mappings":"AAAA,mHAAmH;AAOnH,OAAO,EAEL,mBAAmB,GACpB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAuB,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,EAA2B,SAAS,EAAE,MAAM,sBAAsB,CAAA;AACzE,OAAO,EAGL,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,iBAAiB,CAAA;AAqBxB,MAAM,UAAU,aAAa,CAI3B,UAA2D;IAE3D,MAAM,EACJ,MAAM,GAAG,EAAE,EACX,OAAO,EACP,WAAW,GACZ,GAAG,UAAqC,CAAA;IACzC,MAAM,KAAK,GAAG;QACZ,YAAY,EAAE,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;QACjD,GAAG,UAAU,CAAC,KAAK;KACpB,CAAA;IAED,uFAAuF;IACvF,qDAAqD;IACrD,iBAAiB,CAAC;QAChB,MAAM;QACN,OAAO;QACP,WAAW;QACX,KAAK;KACN,CAAC,CAAA;IAEF,MAAM,KAAK,GAAU,CAAC,QAAQ,CAAC,CAAA;IAC/B,IAAI,MAAM;QACR,KAAK,CAAC,IAAI,CACR,UAAU,CAAC;YACT,MAAM;YACN,KAAK,EAAE,KAA8C;SACtD,CAAC,CACH,CAAA;IAEH,IAAI,WAAW,KAAK,cAAc;QAChC,KAAK,CAAC,IAAI,CACR,UAAU,CAAC;YACT,IAAI,EAAE,OAAO;YACb,WAAW;YACX,KAAK,EAAE,KAA8C;SACtD,CAAC,CACH,CAAA;IAEH,OAAO,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;AACjC,CAAC;AAID,MAAM,UAAU,UAAU,CAAC,EACzB,MAAM,EACN,KAAK,GA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AAE,IAAI,EAAE,SAAS,EAAE;YACnB,SAAS,CACP,mBAAmB,CACjB,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAC9B,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CACjC,CACF;SACF,CAAA;IACH,CAAC;IAED,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,CAAA;AAC1B,CAAC"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { erc6492MagicBytes } from '../../constants/bytes.js';
|
2
|
-
import { sliceHex } from '
|
2
|
+
import { sliceHex } from '../data/slice.js';
|
3
3
|
/** Whether or not the signature is an ERC-6492 formatted signature. */
|
4
4
|
export function isErc6492Signature(signature) {
|
5
5
|
return sliceHex(signature, -32) === erc6492MagicBytes;
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"isErc6492Signature.js","sourceRoot":"","sources":["../../../utils/signature/isErc6492Signature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAG5D,OAAO,EAA0B,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAMnE,uEAAuE;AACvE,MAAM,UAAU,kBAAkB,CAChC,SAAuC;IAEvC,OAAO,QAAQ,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,KAAK,iBAAiB,CAAA;AACvD,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { decodeAbiParameters, } from '
|
1
|
+
import { decodeAbiParameters, } from '../abi/decodeAbiParameters.js';
|
2
2
|
import { isErc6492Signature, } from './isErc6492Signature.js';
|
3
3
|
/**
|
4
4
|
* @description Parses a hex-formatted ERC-6492 flavoured signature.
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"parseErc6492Signature.js","sourceRoot":"","sources":["../../../utils/signature/parseErc6492Signature.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,mBAAmB,GACpB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAEL,kBAAkB,GACnB,MAAM,yBAAyB,CAAA;AAgChC;;;;;;;;;;GAUG;AACH,MAAM,UAAU,qBAAqB,CACnC,SAA0C;IAE1C,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC;QAAE,OAAO,EAAE,SAAS,EAAE,CAAA;IAExD,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,GAAG,mBAAmB,CACrD,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAC3D,SAAS,CACV,CAAA;IACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAA;AACjD,CAAC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { erc6492MagicBytes } from '../../constants/bytes.js';
|
2
|
-
import { encodeAbiParameters } from '
|
3
|
-
import { concatHex } from '
|
2
|
+
import { encodeAbiParameters } from '../abi/encodeAbiParameters.js';
|
3
|
+
import { concatHex } from '../data/concat.js';
|
4
4
|
/**
|
5
5
|
* @description Serializes a ERC-6492 flavoured signature into hex format.
|
6
6
|
*
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"serializeErc6492Signature.js","sourceRoot":"","sources":["../../../utils/signature/serializeErc6492Signature.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAG5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAe7C;;;;;;;;;GASG;AACH,MAAM,UAAU,yBAAyB,CACvC,UAA+C;IAE/C,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,UAAU,CAAA;IAC/C,OAAO,SAAS,CAAC;QACf,mBAAmB,CACjB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAC3D,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS,CAAC,CAC3B;QACD,iBAAiB;KAClB,CAAC,CAAA;AACJ,CAAC"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { presignMessagePrefix } from '../../constants/strings.js';
|
2
|
+
import { concat } from '../data/concat.js';
|
3
|
+
import { size } from '../data/size.js';
|
4
|
+
import { bytesToHex, stringToHex, } from '../encoding/toHex.js';
|
5
|
+
export function toPrefixedMessage(message_) {
|
6
|
+
const message = (() => {
|
7
|
+
if (typeof message_ === 'string')
|
8
|
+
return stringToHex(message_);
|
9
|
+
if (typeof message_.raw === 'string')
|
10
|
+
return message_.raw;
|
11
|
+
return bytesToHex(message_.raw);
|
12
|
+
})();
|
13
|
+
const prefix = stringToHex(`${presignMessagePrefix}${size(message)}`);
|
14
|
+
return concat([prefix, message]);
|
15
|
+
}
|
16
|
+
//# sourceMappingURL=toPrefixedMessage.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"toPrefixedMessage.js","sourceRoot":"","sources":["../../../utils/signature/toPrefixedMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAGjE,OAAO,EAAwB,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AACtC,OAAO,EAGL,UAAU,EACV,WAAW,GACZ,MAAM,sBAAsB,CAAA;AAQ7B,MAAM,UAAU,iBAAiB,CAAC,QAAyB;IACzD,MAAM,OAAO,GAAG,CAAC,GAAG,EAAE;QACpB,IAAI,OAAO,QAAQ,KAAK,QAAQ;YAAE,OAAO,WAAW,CAAC,QAAQ,CAAC,CAAA;QAC9D,IAAI,OAAO,QAAQ,CAAC,GAAG,KAAK,QAAQ;YAAE,OAAO,QAAQ,CAAC,GAAG,CAAA;QACzD,OAAO,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;IACjC,CAAC,CAAC,EAAE,CAAA;IACJ,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,oBAAoB,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IACrE,OAAO,MAAM,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;AAClC,CAAC"}
|
@@ -23,7 +23,7 @@ export type GetTransactionCountParameters = {
|
|
23
23
|
export type GetTransactionCountReturnType = number;
|
24
24
|
export type GetTransactionCountErrorType = RequestErrorType | NumberToHexErrorType | HexToNumberErrorType | ErrorType;
|
25
25
|
/**
|
26
|
-
* Returns the number of [Transactions](https://viem.sh/docs/glossary/terms#transaction) an Account has
|
26
|
+
* Returns the number of [Transactions](https://viem.sh/docs/glossary/terms#transaction) an Account has sent.
|
27
27
|
*
|
28
28
|
* - Docs: https://viem.sh/docs/actions/public/getTransactionCount
|
29
29
|
* - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount)
|
@@ -4,6 +4,7 @@ import type { Transport } from '../../clients/transports/createTransport.js';
|
|
4
4
|
import type { ErrorType } from '../../errors/utils.js';
|
5
5
|
import type { Chain } from '../../types/chain.js';
|
6
6
|
import type { ByteArray, Hex, Signature } from '../../types/misc.js';
|
7
|
+
import type { OneOf } from '../../types/utils.js';
|
7
8
|
import { type EncodeDeployDataErrorType } from '../../utils/abi/encodeDeployData.js';
|
8
9
|
import { type IsBytesEqualErrorType } from '../../utils/data/isBytesEqual.js';
|
9
10
|
import { type IsHexErrorType } from '../../utils/data/isHex.js';
|
@@ -16,7 +17,10 @@ export type VerifyHashParameters = Pick<CallParameters, 'blockNumber' | 'blockTa
|
|
16
17
|
hash: Hex;
|
17
18
|
/** The signature that was generated by signing the message with the address's private key. */
|
18
19
|
signature: Hex | ByteArray | Signature;
|
19
|
-
}
|
20
|
+
} & OneOf<{
|
21
|
+
factory: Address;
|
22
|
+
factoryData: Hex;
|
23
|
+
} | {}>;
|
20
24
|
export type VerifyHashReturnType = boolean;
|
21
25
|
export type VerifyHashErrorType = CallErrorType | IsHexErrorType | ToHexErrorType | IsBytesEqualErrorType | EncodeDeployDataErrorType | ErrorType;
|
22
26
|
/**
|
@@ -26,5 +30,5 @@ export type VerifyHashErrorType = CallErrorType | IsHexErrorType | ToHexErrorTyp
|
|
26
30
|
* @param parameters - {@link VerifyHashParameters}
|
27
31
|
* @returns Whether or not the signature is valid. {@link VerifyHashReturnType}
|
28
32
|
*/
|
29
|
-
export declare function verifyHash<TChain extends Chain | undefined>(client: Client<Transport, TChain>,
|
33
|
+
export declare function verifyHash<TChain extends Chain | undefined>(client: Client<Transport, TChain>, parameters: VerifyHashParameters): Promise<VerifyHashReturnType>;
|
30
34
|
//# sourceMappingURL=verifyHash.d.ts.map
|