viem 0.2.0-0-2-0.20230329T022953 → 0.2.0-0-2-0.20230330T023229

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 (69) hide show
  1. package/dist/abi.d.ts +3 -3
  2. package/dist/abi.js +2 -2
  3. package/dist/abi.mjs +1 -1
  4. package/dist/accounts/index.d.ts +5 -14
  5. package/dist/accounts/index.js +20 -30
  6. package/dist/accounts/index.js.map +1 -1
  7. package/dist/accounts/index.mjs +14 -24
  8. package/dist/accounts/index.mjs.map +1 -1
  9. package/dist/{chain-5b28fc53.d.ts → chain-9da1e6b6.d.ts} +132 -120
  10. package/dist/{chain-e9b996ff.d.ts → chain-b53ed5d9.d.ts} +1 -1
  11. package/dist/chains.d.ts +867 -99
  12. package/dist/chains.js +115 -63
  13. package/dist/chains.js.map +1 -1
  14. package/dist/chains.mjs +58 -6
  15. package/dist/chains.mjs.map +1 -1
  16. package/dist/{chunk-564BCC7H.js → chunk-2ESQNALV.js} +18 -16
  17. package/dist/chunk-2ESQNALV.js.map +1 -0
  18. package/dist/{chunk-CXE4XSMF.js → chunk-ASAFFZMD.js} +19 -19
  19. package/dist/{chunk-UCZWRYV5.mjs → chunk-B7WOV4RY.mjs} +18 -16
  20. package/dist/chunk-B7WOV4RY.mjs.map +1 -0
  21. package/dist/{chunk-D3ALNUWN.js → chunk-GNHXOZCH.js} +6 -6
  22. package/dist/{chunk-BJ5KRDTG.mjs → chunk-RFOQRRYW.mjs} +2 -2
  23. package/dist/{chunk-7QEOFHC7.mjs → chunk-S4GWZ3LJ.mjs} +2 -2
  24. package/dist/contract.d.ts +8 -8
  25. package/dist/contract.js +2 -2
  26. package/dist/contract.mjs +1 -1
  27. package/dist/{createClient-e52de308.d.ts → createTransport-e031366b.d.ts} +36 -34
  28. package/dist/{eip1193-9080db42.d.ts → eip1193-e79469af.d.ts} +1 -1
  29. package/dist/{encodeFunctionResult-47ad60ed.d.ts → encodeFunctionResult-d206ceb9.d.ts} +15 -15
  30. package/dist/{encodePacked-35c796fb.d.ts → encodePacked-b36ce88a.d.ts} +1 -1
  31. package/dist/ens.d.ts +5 -5
  32. package/dist/ens.js +3 -3
  33. package/dist/ens.mjs +2 -2
  34. package/dist/ethers.d.ts +2 -2
  35. package/dist/ethers.js +4 -4
  36. package/dist/ethers.mjs +2 -2
  37. package/dist/{formatAbiItem-d9e801dd.d.ts → formatAbiItem-a7a3fb0f.d.ts} +1 -1
  38. package/dist/{getAbiItem-1d94ae0e.d.ts → getAbiItem-5e8b01de.d.ts} +3 -3
  39. package/dist/index.d.ts +49 -15
  40. package/dist/index.js +218 -138
  41. package/dist/index.js.map +1 -1
  42. package/dist/index.mjs +127 -47
  43. package/dist/index.mjs.map +1 -1
  44. package/dist/{parseGwei-c9e9d320.d.ts → parseGwei-7678c2fa.d.ts} +6 -6
  45. package/dist/public.d.ts +5 -5
  46. package/dist/public.js +2 -2
  47. package/dist/public.mjs +1 -1
  48. package/dist/publicKeyToAddress-87b9856c.d.ts +16 -0
  49. package/dist/{test-f3d06763.d.ts → test-68dbda5b.d.ts} +3 -3
  50. package/dist/test.d.ts +5 -5
  51. package/dist/test.js +2 -2
  52. package/dist/test.mjs +1 -1
  53. package/dist/{typedData-42b43450.d.ts → typedData-8b24374d.d.ts} +1 -1
  54. package/dist/utils/index.d.ts +15 -15
  55. package/dist/utils/index.js +4 -2
  56. package/dist/utils/index.mjs +3 -1
  57. package/dist/wallet.d.ts +5 -5
  58. package/dist/wallet.js +2 -2
  59. package/dist/wallet.mjs +1 -1
  60. package/dist/{watchPendingTransactions-468f53f2.d.ts → watchPendingTransactions-53449c4e.d.ts} +34 -31
  61. package/dist/window.d.ts +2 -2
  62. package/package.json +3 -3
  63. package/dist/chunk-564BCC7H.js.map +0 -1
  64. package/dist/chunk-UCZWRYV5.mjs.map +0 -1
  65. package/dist/parseAccount-4209fa24.d.ts +0 -6
  66. /package/dist/{chunk-CXE4XSMF.js.map → chunk-ASAFFZMD.js.map} +0 -0
  67. /package/dist/{chunk-D3ALNUWN.js.map → chunk-GNHXOZCH.js.map} +0 -0
  68. /package/dist/{chunk-BJ5KRDTG.mjs.map → chunk-RFOQRRYW.mjs.map} +0 -0
  69. /package/dist/{chunk-7QEOFHC7.mjs.map → chunk-S4GWZ3LJ.mjs.map} +0 -0
package/dist/abi.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { ParseAbi, ParseAbiItem, ParseAbiParameter, ParseAbiParameters, parseAbi, parseAbiItem, parseAbiParameter, parseAbiParameters } from 'abitype';
2
- export { D as DecodeAbiParametersReturnType, E as EncodeAbiParametersReturnType, G as GetAbiItemParameters, d as decodeAbiParameters, e as encodeAbiParameters, g as getAbiItem } from './getAbiItem-1d94ae0e.js';
3
- export { e as encodePacked } from './encodePacked-35c796fb.js';
4
- import './chain-5b28fc53.js';
2
+ export { D as DecodeAbiParametersReturnType, E as EncodeAbiParametersReturnType, G as GetAbiItemParameters, d as decodeAbiParameters, e as encodeAbiParameters, g as getAbiItem } from './getAbiItem-5e8b01de.js';
3
+ export { e as encodePacked } from './encodePacked-b36ce88a.js';
4
+ import './chain-9da1e6b6.js';
5
5
  import '@wagmi/chains';
package/dist/abi.js CHANGED
@@ -7,7 +7,7 @@
7
7
 
8
8
 
9
9
 
10
- var _chunk564BCC7Hjs = require('./chunk-564BCC7H.js');
10
+ var _chunk2ESQNALVjs = require('./chunk-2ESQNALV.js');
11
11
 
12
12
 
13
13
 
@@ -17,5 +17,5 @@ var _chunk564BCC7Hjs = require('./chunk-564BCC7H.js');
17
17
 
18
18
 
19
19
 
20
- exports.decodeAbiParameters = _chunk564BCC7Hjs.decodeAbiParameters; exports.encodeAbiParameters = _chunk564BCC7Hjs.encodeAbiParameters; exports.encodePacked = _chunk564BCC7Hjs.encodePacked; exports.getAbiItem = _chunk564BCC7Hjs.getAbiItem; exports.parseAbi = _chunk564BCC7Hjs.parseAbi; exports.parseAbiItem = _chunk564BCC7Hjs.parseAbiItem; exports.parseAbiParameter = _chunk564BCC7Hjs.parseAbiParameter; exports.parseAbiParameters = _chunk564BCC7Hjs.parseAbiParameters;
20
+ exports.decodeAbiParameters = _chunk2ESQNALVjs.decodeAbiParameters; exports.encodeAbiParameters = _chunk2ESQNALVjs.encodeAbiParameters; exports.encodePacked = _chunk2ESQNALVjs.encodePacked; exports.getAbiItem = _chunk2ESQNALVjs.getAbiItem; exports.parseAbi = _chunk2ESQNALVjs.parseAbi; exports.parseAbiItem = _chunk2ESQNALVjs.parseAbiItem; exports.parseAbiParameter = _chunk2ESQNALVjs.parseAbiParameter; exports.parseAbiParameters = _chunk2ESQNALVjs.parseAbiParameters;
21
21
  //# sourceMappingURL=abi.js.map
package/dist/abi.mjs CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  parseAbiItem,
8
8
  parseAbiParameter,
9
9
  parseAbiParameters
10
- } from "./chunk-UCZWRYV5.mjs";
10
+ } from "./chunk-B7WOV4RY.mjs";
11
11
  export {
12
12
  decodeAbiParameters,
13
13
  encodeAbiParameters,
@@ -1,9 +1,9 @@
1
1
  export { HDKey } from '@scure/bip32';
2
- import { H as Hex } from '../chain-5b28fc53.js';
3
- import { P as PrivateKeyAccount, a as AccountSource, J as JsonRpcAccount, C as CustomSource, L as LocalAccount, T as TypedDataDefinition } from '../typedData-42b43450.js';
4
- export { A as Account, a as AccountSource, C as CustomSource, H as HDAccount, b as HDOptions, J as JsonRpcAccount, L as LocalAccount, P as PrivateKeyAccount } from '../typedData-42b43450.js';
2
+ import { H as Hex } from '../chain-9da1e6b6.js';
3
+ import { P as PrivateKeyAccount, a as AccountSource, J as JsonRpcAccount, C as CustomSource, L as LocalAccount, T as TypedDataDefinition } from '../typedData-8b24374d.js';
4
+ export { A as Account, a as AccountSource, C as CustomSource, H as HDAccount, b as HDOptions, J as JsonRpcAccount, L as LocalAccount, P as PrivateKeyAccount } from '../typedData-8b24374d.js';
5
5
  import { Address, TypedData } from 'abitype';
6
- export { p as parseAccount } from '../parseAccount-4209fa24.js';
6
+ export { p as parseAccount, a as publicKeyToAddress } from '../publicKeyToAddress-87b9856c.js';
7
7
  export { wordlist as czech } from '@scure/bip39/wordlists/czech';
8
8
  export { wordlist as english } from '@scure/bip39/wordlists/english';
9
9
  export { wordlist as french } from '@scure/bip39/wordlists/french';
@@ -46,15 +46,6 @@ type GetAccountReturnType<TAccountSource extends AccountSource> = (TAccountSourc
46
46
  */
47
47
  declare function toAccount<TAccountSource extends AccountSource>(source: TAccountSource): GetAccountReturnType<TAccountSource>;
48
48
 
49
- /**
50
- * @description Converts an ECDSA public key to an address.
51
- *
52
- * @param publicKey The public key to convert.
53
- *
54
- * @returns The address.
55
- */
56
- declare function publicKeyToAddress(publicKey: Hex): Address;
57
-
58
49
  type SignMessageParameters = {
59
50
  /** The message to sign. */
60
51
  message: string;
@@ -87,4 +78,4 @@ declare function signTypedData<TTypedData extends TypedData | {
87
78
  [key: string]: unknown;
88
79
  }, TPrimaryType extends string = string>({ privateKey, ...typedData }: SignTypedDataParameters<TTypedData, TPrimaryType>): Promise<SignTypedDataReturnType>;
89
80
 
90
- export { SignMessageParameters, SignMessageReturnType, SignTypedDataParameters, SignTypedDataReturnType, generateMnemonic, generatePrivateKey, privateKeyToAccount, publicKeyToAddress, signMessage, signTypedData, toAccount };
81
+ export { SignMessageParameters, SignMessageReturnType, SignTypedDataParameters, SignTypedDataReturnType, generateMnemonic, generatePrivateKey, privateKeyToAccount, signMessage, signTypedData, toAccount };
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkD3ALNUWNjs = require('../chunk-D3ALNUWN.js');
3
+ var _chunkGNHXOZCHjs = require('../chunk-GNHXOZCH.js');
4
4
 
5
5
 
6
6
 
@@ -10,7 +10,7 @@ var _chunkD3ALNUWNjs = require('../chunk-D3ALNUWN.js');
10
10
 
11
11
 
12
12
 
13
- var _chunk564BCC7Hjs = require('../chunk-564BCC7H.js');
13
+ var _chunk2ESQNALVjs = require('../chunk-2ESQNALV.js');
14
14
 
15
15
  // src/accounts/index.ts
16
16
  var _bip32 = require('@scure/bip32');
@@ -22,45 +22,35 @@ function generateMnemonic(wordlist10) {
22
22
  }
23
23
 
24
24
  // src/accounts/generatePrivateKey.ts
25
- var _secp256k1 = require('@noble/secp256k1');
25
+ var _secp256k1 = require('@noble/curves/secp256k1');
26
26
  function generatePrivateKey() {
27
- return _chunk564BCC7Hjs.toHex.call(void 0, _secp256k1.utils.randomPrivateKey());
27
+ return _chunk2ESQNALVjs.toHex.call(void 0, _secp256k1.secp256k1.utils.randomPrivateKey());
28
28
  }
29
29
 
30
30
  // src/accounts/privateKeyToAccount.ts
31
31
 
32
32
 
33
- // src/accounts/utils/publicKeyToAddress.ts
34
- function publicKeyToAddress(publicKey) {
35
- const address = _chunk564BCC7Hjs.keccak256.call(void 0, `0x${publicKey.substring(4)}`).substring(26);
36
- return _chunk564BCC7Hjs.checksumAddress.call(void 0, `0x${address}`);
37
- }
38
-
39
33
  // src/accounts/utils/sign.ts
40
34
 
41
35
  async function sign({
42
36
  hash,
43
37
  privateKey
44
38
  }) {
45
- const [sigBytes, recId] = await _secp256k1.sign.call(void 0, hash.slice(2), privateKey.slice(2), {
46
- canonical: true,
47
- recovered: true
48
- });
49
- const sig = _secp256k1.Signature.fromHex(sigBytes);
39
+ const { r, s, recovery } = _secp256k1.secp256k1.sign(hash.slice(2), privateKey.slice(2));
50
40
  return {
51
- r: _chunk564BCC7Hjs.toHex.call(void 0, sig.r),
52
- s: _chunk564BCC7Hjs.toHex.call(void 0, sig.s),
53
- v: recId ? 28n : 27n
41
+ r: _chunk2ESQNALVjs.toHex.call(void 0, r),
42
+ s: _chunk2ESQNALVjs.toHex.call(void 0, s),
43
+ v: recovery ? 28n : 27n
54
44
  };
55
45
  }
56
46
 
57
47
  // src/accounts/utils/signatureToHex.ts
58
48
 
59
49
  function signatureToHex({ r, s, v }) {
60
- return `0x${new (0, _secp256k1.Signature)(
61
- _chunk564BCC7Hjs.hexToBigInt.call(void 0, r),
62
- _chunk564BCC7Hjs.hexToBigInt.call(void 0, s)
63
- ).toCompactHex()}${_chunk564BCC7Hjs.toHex.call(void 0, v).slice(2)}`;
50
+ return `0x${new _secp256k1.secp256k1.Signature(
51
+ _chunk2ESQNALVjs.hexToBigInt.call(void 0, r),
52
+ _chunk2ESQNALVjs.hexToBigInt.call(void 0, s)
53
+ ).toCompactHex()}${_chunk2ESQNALVjs.toHex.call(void 0, v).slice(2)}`;
64
54
  }
65
55
 
66
56
  // src/accounts/utils/signMessage.ts
@@ -68,7 +58,7 @@ async function signMessage({
68
58
  message,
69
59
  privateKey
70
60
  }) {
71
- const signature = await sign({ hash: _chunk564BCC7Hjs.hashMessage.call(void 0, message), privateKey });
61
+ const signature = await sign({ hash: _chunk2ESQNALVjs.hashMessage.call(void 0, message), privateKey });
72
62
  return signatureToHex(signature);
73
63
  }
74
64
 
@@ -78,10 +68,10 @@ async function signTransaction({
78
68
  transaction
79
69
  }) {
80
70
  const signature = await sign({
81
- hash: _chunk564BCC7Hjs.keccak256.call(void 0, _chunk564BCC7Hjs.serializeTransaction.call(void 0, transaction)),
71
+ hash: _chunk2ESQNALVjs.keccak256.call(void 0, _chunk2ESQNALVjs.serializeTransaction.call(void 0, transaction)),
82
72
  privateKey
83
73
  });
84
- return _chunk564BCC7Hjs.serializeTransaction.call(void 0, transaction, signature);
74
+ return _chunk2ESQNALVjs.serializeTransaction.call(void 0, transaction, signature);
85
75
  }
86
76
 
87
77
  // src/accounts/utils/signTypedData.ts
@@ -90,7 +80,7 @@ async function signTypedData({
90
80
  ...typedData
91
81
  }) {
92
82
  const signature = await sign({
93
- hash: _chunk564BCC7Hjs.hashTypedData.call(void 0, typedData),
83
+ hash: _chunk2ESQNALVjs.hashTypedData.call(void 0, typedData),
94
84
  privateKey
95
85
  });
96
86
  return signatureToHex(signature);
@@ -98,9 +88,9 @@ async function signTypedData({
98
88
 
99
89
  // src/accounts/privateKeyToAccount.ts
100
90
  function privateKeyToAccount(privateKey) {
101
- const publicKey = _chunk564BCC7Hjs.toHex.call(void 0, _secp256k1.getPublicKey.call(void 0, privateKey.slice(2)));
102
- const address = publicKeyToAddress(publicKey);
103
- const account = _chunkD3ALNUWNjs.toAccount.call(void 0, {
91
+ const publicKey = _chunk2ESQNALVjs.toHex.call(void 0, _secp256k1.secp256k1.getPublicKey(privateKey.slice(2), false));
92
+ const address = _chunk2ESQNALVjs.publicKeyToAddress.call(void 0, publicKey);
93
+ const account = _chunkGNHXOZCHjs.toAccount.call(void 0, {
104
94
  address,
105
95
  async signMessage({ message }) {
106
96
  return signMessage({ message, privateKey });
@@ -148,5 +138,5 @@ var _traditionalchinese = require('@scure/bip39/wordlists/traditional-chinese');
148
138
 
149
139
 
150
140
 
151
- exports.HDKey = _bip32.HDKey; exports.czech = _czech.wordlist; exports.english = _english.wordlist; exports.french = _french.wordlist; exports.generateMnemonic = generateMnemonic; exports.generatePrivateKey = generatePrivateKey; exports.italian = _italian.wordlist; exports.japanese = _japanese.wordlist; exports.korean = _korean.wordlist; exports.parseAccount = _chunk564BCC7Hjs.parseAccount; exports.privateKeyToAccount = privateKeyToAccount; exports.publicKeyToAddress = publicKeyToAddress; exports.signMessage = signMessage; exports.signTypedData = signTypedData; exports.simplifiedChinese = _simplifiedchinese.wordlist; exports.spanish = _spanish.wordlist; exports.toAccount = _chunkD3ALNUWNjs.toAccount; exports.traditionalChinese = _traditionalchinese.wordlist;
141
+ exports.HDKey = _bip32.HDKey; exports.czech = _czech.wordlist; exports.english = _english.wordlist; exports.french = _french.wordlist; exports.generateMnemonic = generateMnemonic; exports.generatePrivateKey = generatePrivateKey; exports.italian = _italian.wordlist; exports.japanese = _japanese.wordlist; exports.korean = _korean.wordlist; exports.parseAccount = _chunk2ESQNALVjs.parseAccount; exports.privateKeyToAccount = privateKeyToAccount; exports.publicKeyToAddress = _chunk2ESQNALVjs.publicKeyToAddress; exports.signMessage = signMessage; exports.signTypedData = signTypedData; exports.simplifiedChinese = _simplifiedchinese.wordlist; exports.spanish = _spanish.wordlist; exports.toAccount = _chunkGNHXOZCHjs.toAccount; exports.traditionalChinese = _traditionalchinese.wordlist;
152
142
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/accounts/index.ts","../../src/accounts/generateMnemonic.ts","../../src/accounts/generatePrivateKey.ts","../../src/accounts/privateKeyToAccount.ts","../../src/accounts/utils/publicKeyToAddress.ts","../../src/accounts/utils/sign.ts","../../src/accounts/utils/signatureToHex.ts","../../src/accounts/utils/signMessage.ts","../../src/accounts/utils/signTransaction.ts","../../src/accounts/utils/signTypedData.ts","../../src/accounts/wordlists.ts"],"names":["wordlist","Signature_"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,aAAa;;;ACAtB,SAAS,oBAAoB,yBAAyB;AAS/C,SAAS,iBAAiBA,YAA4B;AAC3D,SAAO,kBAAkBA,UAAQ;AACnC;;;ACXA,SAAS,aAAa;AAUf,SAAS,qBAA0B;AACxC,SAAO,MAAM,MAAM,iBAAiB,CAAC;AACvC;;;ACZA,SAAS,oBAAoB;;;ACWtB,SAAS,mBAAmB,WAAyB;AAC1D,QAAM,UAAU,UAAU,KAAK,UAAU,UAAU,CAAC,GAAG,EAAE,UAAU,EAAE;AACrE,SAAO,gBAAgB,KAAK,SAAS;AACvC;;;ACdA,SAAS,QAAQ,OAAO,aAAa,kBAAkB;AAmBvD,eAAsB,KAAK;AAAA,EACzB;AAAA,EACA;AACF,GAA4C;AAC1C,QAAM,CAAC,UAAU,KAAK,IAAI,MAAM,MAAM,KAAK,MAAM,CAAC,GAAG,WAAW,MAAM,CAAC,GAAG;AAAA,IACxE,WAAW;AAAA,IACX,WAAW;AAAA,EACb,CAAC;AACD,QAAM,MAAM,WAAW,QAAQ,QAAQ;AACvC,SAAO;AAAA,IACL,GAAG,MAAM,IAAI,CAAC;AAAA,IACd,GAAG,MAAM,IAAI,CAAC;AAAA,IACd,GAAG,QAAQ,MAAM;AAAA,EACn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AAA,IACL,GAAG;AAAA,IACH;AAAA,IACA,QAAQ;AAAA,EACV;AACF;;;AOxCA,SAAqB,gBAAa;AAClC,SAAqB,YAAZD,iBAA2B;AACpC,SAAqB,YAAZA,iBAA0B;AACnC,SAAqB,YAAZA,iBAA2B;AACpC,SAAqB,YAAZA,iBAA4B;AACrC,SAAqB,YAAZA,iBAA0B;AACnC,SAAqB,YAAZA,iBAAqC;AAC9C,SAAqB,YAAZA,iBAA2B;AACpC,SAAqB,YAAZA,iBAAsC","sourcesContent":["import { HDKey } from '@scure/bip32'\n\nexport { HDKey }\n\nexport { generateMnemonic } from './generateMnemonic'\n\nexport { generatePrivateKey } from './generatePrivateKey'\n\nexport { privateKeyToAccount } from './privateKeyToAccount'\n\nexport { toAccount } from './toAccount'\n\nexport type {\n Account,\n AccountSource,\n CustomSource,\n HDOptions,\n JsonRpcAccount,\n LocalAccount,\n HDAccount,\n PrivateKeyAccount,\n} from './types'\n\nexport type {\n SignMessageParameters,\n SignMessageReturnType,\n SignTypedDataParameters,\n SignTypedDataReturnType,\n} from './utils'\nexport {\n parseAccount,\n publicKeyToAddress,\n signMessage,\n signTypedData,\n} from './utils'\n\nexport {\n czech,\n english,\n french,\n italian,\n japanese,\n korean,\n simplifiedChinese,\n spanish,\n traditionalChinese,\n} from './wordlists'\n","import { generateMnemonic as generateMnemonic_ } from '@scure/bip39'\n\n/**\n * @description Generates a random mnemonic phrase with a given wordlist.\n *\n * @param wordlist The wordlist to use for generating the mnemonic phrase.\n *\n * @returns A randomly generated mnemonic phrase.\n */\nexport function generateMnemonic(wordlist: string[]): string {\n return generateMnemonic_(wordlist)\n}\n","import { utils } from '@noble/secp256k1'\n\nimport type { Hex } from '../types'\nimport { toHex } from '../utils'\n\n/**\n * @description Generates a random private key.\n *\n * @returns A randomly generated private key.\n */\nexport function generatePrivateKey(): Hex {\n return toHex(utils.randomPrivateKey())\n}\n","import { getPublicKey } from '@noble/secp256k1'\n\nimport type { Hex } from '../types'\nimport { toHex } from '../utils'\nimport {\n publicKeyToAddress,\n signMessage,\n signTransaction,\n signTypedData,\n} from './utils'\nimport { toAccount } from './toAccount'\nimport type { PrivateKeyAccount } from './types'\n\n/**\n * @description Creates an Account from a private key.\n *\n * @returns A Private Key Account.\n */\nexport function privateKeyToAccount(privateKey: Hex): PrivateKeyAccount {\n const publicKey = toHex(getPublicKey(privateKey.slice(2)))\n const address = publicKeyToAddress(publicKey)\n\n const account = toAccount({\n address,\n async signMessage({ message }) {\n return signMessage({ message, privateKey })\n },\n async signTransaction(transaction) {\n return signTransaction({ privateKey, transaction })\n },\n async signTypedData(typedData) {\n return signTypedData({ ...typedData, privateKey })\n },\n })\n\n return {\n ...account,\n publicKey,\n source: 'privateKey',\n }\n}\n","import type { Address, Hex } from '../../types'\nimport { keccak256 } from '../../utils'\nimport { checksumAddress } from '../../utils/address'\n\n/**\n * @description Converts an ECDSA public key to an address.\n *\n * @param publicKey The public key to convert.\n *\n * @returns The address.\n */\nexport function publicKeyToAddress(publicKey: Hex): Address {\n const address = keccak256(`0x${publicKey.substring(4)}`).substring(26)\n return checksumAddress(`0x${address}`) as Address\n}\n","import { sign as sign_, Signature as Signature_ } from '@noble/secp256k1'\n\nimport type { Hex, Signature } from '../../types'\nimport { toHex } from '../../utils'\n\nexport type SignParameters = {\n hash: Hex\n privateKey: Hex\n}\nexport type SignReturnType = Signature\n\n/**\n * @description Signs a hash with a given private key.\n *\n * @param hash The hash to sign.\n * @param privateKey The private key to sign with.\n *\n * @returns The signature.\n */\nexport async function sign({\n hash,\n privateKey,\n}: SignParameters): Promise<SignReturnType> {\n const [sigBytes, recId] = await sign_(hash.slice(2), privateKey.slice(2), {\n canonical: true,\n recovered: true,\n })\n const sig = Signature_.fromHex(sigBytes)\n return {\n r: toHex(sig.r),\n s: toHex(sig.s),\n v: recId ? 28n : 27n,\n }\n}\n","import { Signature as Signature_ } from '@noble/secp256k1'\n\nimport type { Hex, Signature } from '../../types'\nimport { hexToBigInt, toHex } from '../../utils'\n\nexport function signatureToHex({ r, s, v }: Signature): Hex {\n return `0x${new Signature_(\n hexToBigInt(r),\n hexToBigInt(s),\n ).toCompactHex()}${toHex(v).slice(2)}`\n}\n","import type { Hex } from '../../types'\nimport { hashMessage } from '../../utils'\nimport { sign } from './sign'\nimport { signatureToHex } from './signatureToHex'\n\nexport type SignMessageParameters = {\n /** The message to sign. */\n message: string\n /** The private key to sign with. */\n privateKey: Hex\n}\nexport type SignMessageReturnType = Hex\n\n/**\n * @description Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191):\n * `keccak256(\"\\x19Ethereum Signed Message:\\n\" + len(message) + message))`.\n *\n * @returns The signature.\n */\nexport async function signMessage({\n message,\n privateKey,\n}: SignMessageParameters): Promise<SignMessageReturnType> {\n const signature = await sign({ hash: hashMessage(message), privateKey })\n return signatureToHex(signature)\n}\n","import type {\n Hex,\n TransactionSerializable,\n TransactionSerialized,\n TransactionType,\n} from '../../types'\nimport {\n GetTransactionType,\n keccak256,\n serializeTransaction,\n} from '../../utils'\nimport { sign } from './sign'\n\nexport type SignTransactionArgs<\n TTransactionSerializable extends TransactionSerializable = TransactionSerializable,\n> = {\n privateKey: Hex\n transaction: TTransactionSerializable\n}\nexport type SignTransactionReturnType<\n TTransactionSerializable extends TransactionSerializable = TransactionSerializable,\n TTransactionType extends TransactionType = GetTransactionType<TTransactionSerializable>,\n> = TransactionSerialized<TTransactionType>\n\nexport async function signTransaction<\n TTransactionSerializable extends TransactionSerializable,\n>({\n privateKey,\n transaction,\n}: SignTransactionArgs<TTransactionSerializable>): Promise<\n SignTransactionReturnType<TTransactionSerializable>\n> {\n const signature = await sign({\n hash: keccak256(serializeTransaction(transaction)),\n privateKey,\n })\n return serializeTransaction(transaction, signature)\n}\n","import type { TypedData } from 'abitype'\n\nimport type { Hex, TypedDataDefinition } from '../../types'\nimport { HashTypedDataParameters, hashTypedData } from '../../utils'\nimport { sign } from './sign'\nimport { signatureToHex } from './signatureToHex'\n\nexport type SignTypedDataParameters<\n TTypedData extends TypedData | { [key: string]: unknown } = TypedData,\n TPrimaryType extends string = string,\n> = TypedDataDefinition<TTypedData, TPrimaryType> & {\n /** The private key to sign with. */\n privateKey: Hex\n}\n\nexport type SignTypedDataReturnType = Hex\n\n/**\n * @description Signs typed data and calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191):\n * `keccak256(\"\\x19Ethereum Signed Message:\\n\" + len(message) + message))`.\n *\n * @returns The signature.\n */\nexport async function signTypedData<\n TTypedData extends TypedData | { [key: string]: unknown },\n TPrimaryType extends string = string,\n>({\n privateKey,\n ...typedData\n}: SignTypedDataParameters<\n TTypedData,\n TPrimaryType\n>): Promise<SignTypedDataReturnType> {\n const signature = await sign({\n hash: hashTypedData(typedData as HashTypedDataParameters),\n privateKey,\n })\n return signatureToHex(signature)\n}\n","export { wordlist as czech } from '@scure/bip39/wordlists/czech'\nexport { wordlist as english } from '@scure/bip39/wordlists/english'\nexport { wordlist as french } from '@scure/bip39/wordlists/french'\nexport { wordlist as italian } from '@scure/bip39/wordlists/italian'\nexport { wordlist as japanese } from '@scure/bip39/wordlists/japanese'\nexport { wordlist as korean } from '@scure/bip39/wordlists/korean'\nexport { wordlist as simplifiedChinese } from '@scure/bip39/wordlists/simplified-chinese'\nexport { wordlist as spanish } from '@scure/bip39/wordlists/spanish'\nexport { wordlist as traditionalChinese } from '@scure/bip39/wordlists/traditional-chinese'\n"]}
1
+ {"version":3,"sources":["../../src/accounts/index.ts","../../src/accounts/generateMnemonic.ts","../../src/accounts/generatePrivateKey.ts","../../src/accounts/privateKeyToAccount.ts","../../src/accounts/utils/sign.ts","../../src/accounts/utils/signatureToHex.ts","../../src/accounts/utils/signMessage.ts","../../src/accounts/utils/signTransaction.ts","../../src/accounts/utils/signTypedData.ts","../../src/accounts/wordlists.ts"],"names":["wordlist","secp256k1"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,aAAa;;;ACAtB,SAAS,oBAAoB,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A,EACF,CAAC;AACD,SAAO,eAAe,SAAS;AACjC;;;ALpBO,SAAS,oBAAoB,YAAoC;AACtE,QAAM,YAAY,MAAMA,WAAU,aAAa,WAAW,MAAM,CAAC,GAAG,KAAK,CAAC;AAC1E,QAAM,UAAU,mBAAmB,SAAS;AAE5C,QAAM,UAAU,UAAU;AAAA,IACxB;AAAA,IACA,MAAM,YAAY,EAAE,QAAQ,GAAG;AAC7B,aAAO,YAAY,EAAE,SAAS,WAAW,CAAC;AAAA,IAC5C;AAAA,IACA,MAAM,gBAAgB,aAAa;AACjC,aAAO,gBAAgB,EAAE,YAAY,YAAY,CAAC;AAAA,IACpD;AAAA,IACA,MAAM,cAAc,WAAW;AAC7B,aAAO,cAAc,EAAE,GAAG,WAAW,WAAW,CAAC;AAAA,IACnD;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL,GAAG;AAAA,IACH;AAAA,IACA,QAAQ;AAAA,EACV;AACF;;;AMxCA,SAAqB,gBAAa;AAClC,SAAqB,YAAZD,iBAA2B;AACpC,SAAqB,YAAZA,iBAA0B;AACnC,SAAqB,YAAZA,iBAA2B;AACpC,SAAqB,YAAZA,iBAA4B;AACrC,SAAqB,YAAZA,iBAA0B;AACnC,SAAqB,YAAZA,iBAAqC;AAC9C,SAAqB,YAAZA,iBAA2B;AACpC,SAAqB,YAAZA,iBAAsC","sourcesContent":["import { HDKey } from '@scure/bip32'\n\nexport { HDKey }\n\nexport { generateMnemonic } from './generateMnemonic'\n\nexport { generatePrivateKey } from './generatePrivateKey'\n\nexport { privateKeyToAccount } from './privateKeyToAccount'\n\nexport { toAccount } from './toAccount'\n\nexport type {\n Account,\n AccountSource,\n CustomSource,\n HDOptions,\n JsonRpcAccount,\n LocalAccount,\n HDAccount,\n PrivateKeyAccount,\n} from './types'\n\nexport type {\n SignMessageParameters,\n SignMessageReturnType,\n SignTypedDataParameters,\n SignTypedDataReturnType,\n} from './utils'\nexport {\n parseAccount,\n publicKeyToAddress,\n signMessage,\n signTypedData,\n} from './utils'\n\nexport {\n czech,\n english,\n french,\n italian,\n japanese,\n korean,\n simplifiedChinese,\n spanish,\n traditionalChinese,\n} from './wordlists'\n","import { generateMnemonic as generateMnemonic_ } from '@scure/bip39'\n\n/**\n * @description Generates a random mnemonic phrase with a given wordlist.\n *\n * @param wordlist The wordlist to use for generating the mnemonic phrase.\n *\n * @returns A randomly generated mnemonic phrase.\n */\nexport function generateMnemonic(wordlist: string[]): string {\n return generateMnemonic_(wordlist)\n}\n","import { secp256k1 } from '@noble/curves/secp256k1'\n\nimport type { Hex } from '../types'\nimport { toHex } from '../utils'\n\n/**\n * @description Generates a random private key.\n *\n * @returns A randomly generated private key.\n */\nexport function generatePrivateKey(): Hex {\n return toHex(secp256k1.utils.randomPrivateKey())\n}\n","import { secp256k1 } from '@noble/curves/secp256k1'\n\nimport type { Hex } from '../types'\nimport { toHex } from '../utils'\nimport {\n publicKeyToAddress,\n signMessage,\n signTransaction,\n signTypedData,\n} from './utils'\nimport { toAccount } from './toAccount'\nimport type { PrivateKeyAccount } from './types'\n\n/**\n * @description Creates an Account from a private key.\n *\n * @returns A Private Key Account.\n */\nexport function privateKeyToAccount(privateKey: Hex): PrivateKeyAccount {\n const publicKey = toHex(secp256k1.getPublicKey(privateKey.slice(2), false))\n const address = publicKeyToAddress(publicKey)\n\n const account = toAccount({\n address,\n async signMessage({ message }) {\n return signMessage({ message, privateKey })\n },\n async signTransaction(transaction) {\n return signTransaction({ privateKey, transaction })\n },\n async signTypedData(typedData) {\n return signTypedData({ ...typedData, privateKey })\n },\n })\n\n return {\n ...account,\n publicKey,\n source: 'privateKey',\n }\n}\n","import { secp256k1 } from '@noble/curves/secp256k1'\n\nimport type { Hex, Signature } from '../../types'\nimport { toHex } from '../../utils'\n\nexport type SignParameters = {\n hash: Hex\n privateKey: Hex\n}\nexport type SignReturnType = Signature\n\n/**\n * @description Signs a hash with a given private key.\n *\n * @param hash The hash to sign.\n * @param privateKey The private key to sign with.\n *\n * @returns The signature.\n */\nexport async function sign({\n hash,\n privateKey,\n}: SignParameters): Promise<SignReturnType> {\n const { r, s, recovery } = secp256k1.sign(hash.slice(2), privateKey.slice(2))\n return {\n r: toHex(r),\n s: toHex(s),\n v: recovery ? 28n : 27n,\n }\n}\n","import { secp256k1 } from '@noble/curves/secp256k1'\n\nimport type { Hex, Signature } from '../../types'\nimport { hexToBigInt, toHex } from '../../utils'\n\nexport function signatureToHex({ r, s, v }: Signature): Hex {\n return `0x${new secp256k1.Signature(\n hexToBigInt(r),\n hexToBigInt(s),\n ).toCompactHex()}${toHex(v).slice(2)}`\n}\n","import type { Hex } from '../../types'\nimport { hashMessage } from '../../utils'\nimport { sign } from './sign'\nimport { signatureToHex } from './signatureToHex'\n\nexport type SignMessageParameters = {\n /** The message to sign. */\n message: string\n /** The private key to sign with. */\n privateKey: Hex\n}\nexport type SignMessageReturnType = Hex\n\n/**\n * @description Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191):\n * `keccak256(\"\\x19Ethereum Signed Message:\\n\" + len(message) + message))`.\n *\n * @returns The signature.\n */\nexport async function signMessage({\n message,\n privateKey,\n}: SignMessageParameters): Promise<SignMessageReturnType> {\n const signature = await sign({ hash: hashMessage(message), privateKey })\n return signatureToHex(signature)\n}\n","import type {\n Hex,\n TransactionSerializable,\n TransactionSerialized,\n TransactionType,\n} from '../../types'\nimport {\n GetTransactionType,\n keccak256,\n serializeTransaction,\n} from '../../utils'\nimport { sign } from './sign'\n\nexport type SignTransactionArgs<\n TTransactionSerializable extends TransactionSerializable = TransactionSerializable,\n> = {\n privateKey: Hex\n transaction: TTransactionSerializable\n}\nexport type SignTransactionReturnType<\n TTransactionSerializable extends TransactionSerializable = TransactionSerializable,\n TTransactionType extends TransactionType = GetTransactionType<TTransactionSerializable>,\n> = TransactionSerialized<TTransactionType>\n\nexport async function signTransaction<\n TTransactionSerializable extends TransactionSerializable,\n>({\n privateKey,\n transaction,\n}: SignTransactionArgs<TTransactionSerializable>): Promise<\n SignTransactionReturnType<TTransactionSerializable>\n> {\n const signature = await sign({\n hash: keccak256(serializeTransaction(transaction)),\n privateKey,\n })\n return serializeTransaction(transaction, signature)\n}\n","import type { TypedData } from 'abitype'\n\nimport type { Hex, TypedDataDefinition } from '../../types'\nimport { HashTypedDataParameters, hashTypedData } from '../../utils'\nimport { sign } from './sign'\nimport { signatureToHex } from './signatureToHex'\n\nexport type SignTypedDataParameters<\n TTypedData extends TypedData | { [key: string]: unknown } = TypedData,\n TPrimaryType extends string = string,\n> = TypedDataDefinition<TTypedData, TPrimaryType> & {\n /** The private key to sign with. */\n privateKey: Hex\n}\n\nexport type SignTypedDataReturnType = Hex\n\n/**\n * @description Signs typed data and calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191):\n * `keccak256(\"\\x19Ethereum Signed Message:\\n\" + len(message) + message))`.\n *\n * @returns The signature.\n */\nexport async function signTypedData<\n TTypedData extends TypedData | { [key: string]: unknown },\n TPrimaryType extends string = string,\n>({\n privateKey,\n ...typedData\n}: SignTypedDataParameters<\n TTypedData,\n TPrimaryType\n>): Promise<SignTypedDataReturnType> {\n const signature = await sign({\n hash: hashTypedData(typedData as HashTypedDataParameters),\n privateKey,\n })\n return signatureToHex(signature)\n}\n","export { wordlist as czech } from '@scure/bip39/wordlists/czech'\nexport { wordlist as english } from '@scure/bip39/wordlists/english'\nexport { wordlist as french } from '@scure/bip39/wordlists/french'\nexport { wordlist as italian } from '@scure/bip39/wordlists/italian'\nexport { wordlist as japanese } from '@scure/bip39/wordlists/japanese'\nexport { wordlist as korean } from '@scure/bip39/wordlists/korean'\nexport { wordlist as simplifiedChinese } from '@scure/bip39/wordlists/simplified-chinese'\nexport { wordlist as spanish } from '@scure/bip39/wordlists/spanish'\nexport { wordlist as traditionalChinese } from '@scure/bip39/wordlists/traditional-chinese'\n"]}
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  toAccount
3
- } from "../chunk-7QEOFHC7.mjs";
3
+ } from "../chunk-S4GWZ3LJ.mjs";
4
4
  import {
5
- checksumAddress,
6
5
  hashMessage,
7
6
  hashTypedData,
8
7
  hexToBigInt,
9
8
  keccak256,
10
9
  parseAccount,
10
+ publicKeyToAddress,
11
11
  serializeTransaction,
12
12
  toHex
13
- } from "../chunk-UCZWRYV5.mjs";
13
+ } from "../chunk-B7WOV4RY.mjs";
14
14
 
15
15
  // src/accounts/index.ts
16
16
  import { HDKey } from "@scure/bip32";
@@ -22,42 +22,32 @@ function generateMnemonic(wordlist10) {
22
22
  }
23
23
 
24
24
  // src/accounts/generatePrivateKey.ts
25
- import { utils } from "@noble/secp256k1";
25
+ import { secp256k1 } from "@noble/curves/secp256k1";
26
26
  function generatePrivateKey() {
27
- return toHex(utils.randomPrivateKey());
27
+ return toHex(secp256k1.utils.randomPrivateKey());
28
28
  }
29
29
 
30
30
  // src/accounts/privateKeyToAccount.ts
31
- import { getPublicKey } from "@noble/secp256k1";
32
-
33
- // src/accounts/utils/publicKeyToAddress.ts
34
- function publicKeyToAddress(publicKey) {
35
- const address = keccak256(`0x${publicKey.substring(4)}`).substring(26);
36
- return checksumAddress(`0x${address}`);
37
- }
31
+ import { secp256k1 as secp256k14 } from "@noble/curves/secp256k1";
38
32
 
39
33
  // src/accounts/utils/sign.ts
40
- import { sign as sign_, Signature as Signature_ } from "@noble/secp256k1";
34
+ import { secp256k1 as secp256k12 } from "@noble/curves/secp256k1";
41
35
  async function sign({
42
36
  hash,
43
37
  privateKey
44
38
  }) {
45
- const [sigBytes, recId] = await sign_(hash.slice(2), privateKey.slice(2), {
46
- canonical: true,
47
- recovered: true
48
- });
49
- const sig = Signature_.fromHex(sigBytes);
39
+ const { r, s, recovery } = secp256k12.sign(hash.slice(2), privateKey.slice(2));
50
40
  return {
51
- r: toHex(sig.r),
52
- s: toHex(sig.s),
53
- v: recId ? 28n : 27n
41
+ r: toHex(r),
42
+ s: toHex(s),
43
+ v: recovery ? 28n : 27n
54
44
  };
55
45
  }
56
46
 
57
47
  // src/accounts/utils/signatureToHex.ts
58
- import { Signature as Signature_2 } from "@noble/secp256k1";
48
+ import { secp256k1 as secp256k13 } from "@noble/curves/secp256k1";
59
49
  function signatureToHex({ r, s, v }) {
60
- return `0x${new Signature_2(
50
+ return `0x${new secp256k13.Signature(
61
51
  hexToBigInt(r),
62
52
  hexToBigInt(s)
63
53
  ).toCompactHex()}${toHex(v).slice(2)}`;
@@ -98,7 +88,7 @@ async function signTypedData({
98
88
 
99
89
  // src/accounts/privateKeyToAccount.ts
100
90
  function privateKeyToAccount(privateKey) {
101
- const publicKey = toHex(getPublicKey(privateKey.slice(2)));
91
+ const publicKey = toHex(secp256k14.getPublicKey(privateKey.slice(2), false));
102
92
  const address = publicKeyToAddress(publicKey);
103
93
  const account = toAccount({
104
94
  address,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/accounts/index.ts","../../src/accounts/generateMnemonic.ts","../../src/accounts/generatePrivateKey.ts","../../src/accounts/privateKeyToAccount.ts","../../src/accounts/utils/publicKeyToAddress.ts","../../src/accounts/utils/sign.ts","../../src/accounts/utils/signatureToHex.ts","../../src/accounts/utils/signMessage.ts","../../src/accounts/utils/signTransaction.ts","../../src/accounts/utils/signTypedData.ts","../../src/accounts/wordlists.ts"],"sourcesContent":["import { HDKey } from '@scure/bip32'\n\nexport { HDKey }\n\nexport { generateMnemonic } from './generateMnemonic'\n\nexport { generatePrivateKey } from './generatePrivateKey'\n\nexport { privateKeyToAccount } from './privateKeyToAccount'\n\nexport { toAccount } from './toAccount'\n\nexport type {\n Account,\n AccountSource,\n CustomSource,\n HDOptions,\n JsonRpcAccount,\n LocalAccount,\n HDAccount,\n PrivateKeyAccount,\n} from './types'\n\nexport type {\n SignMessageParameters,\n SignMessageReturnType,\n SignTypedDataParameters,\n SignTypedDataReturnType,\n} from './utils'\nexport {\n parseAccount,\n publicKeyToAddress,\n signMessage,\n signTypedData,\n} from './utils'\n\nexport {\n czech,\n english,\n french,\n italian,\n japanese,\n korean,\n simplifiedChinese,\n spanish,\n traditionalChinese,\n} from './wordlists'\n","import { generateMnemonic as generateMnemonic_ } from '@scure/bip39'\n\n/**\n * @description Generates a random mnemonic phrase with a given wordlist.\n *\n * @param wordlist The wordlist to use for generating the mnemonic phrase.\n *\n * @returns A randomly generated mnemonic phrase.\n */\nexport function generateMnemonic(wordlist: string[]): string {\n return generateMnemonic_(wordlist)\n}\n","import { utils } from '@noble/secp256k1'\n\nimport type { Hex } from '../types'\nimport { toHex } from '../utils'\n\n/**\n * @description Generates a random private key.\n *\n * @returns A randomly generated private key.\n */\nexport function generatePrivateKey(): Hex {\n return toHex(utils.randomPrivateKey())\n}\n","import { getPublicKey } from '@noble/secp256k1'\n\nimport type { Hex } from '../types'\nimport { toHex } from '../utils'\nimport {\n publicKeyToAddress,\n signMessage,\n signTransaction,\n signTypedData,\n} from './utils'\nimport { toAccount } from './toAccount'\nimport type { PrivateKeyAccount } from './types'\n\n/**\n * @description Creates an Account from a private key.\n *\n * @returns A Private Key Account.\n */\nexport function privateKeyToAccount(privateKey: Hex): PrivateKeyAccount {\n const publicKey = toHex(getPublicKey(privateKey.slice(2)))\n const address = publicKeyToAddress(publicKey)\n\n const account = toAccount({\n address,\n async signMessage({ message }) {\n return signMessage({ message, privateKey })\n },\n async signTransaction(transaction) {\n return signTransaction({ privateKey, transaction })\n },\n async signTypedData(typedData) {\n return signTypedData({ ...typedData, privateKey })\n },\n })\n\n return {\n ...account,\n publicKey,\n source: 'privateKey',\n }\n}\n","import type { Address, Hex } from '../../types'\nimport { keccak256 } from '../../utils'\nimport { checksumAddress } from '../../utils/address'\n\n/**\n * @description Converts an ECDSA public key to an address.\n *\n * @param publicKey The public key to convert.\n *\n * @returns The address.\n */\nexport function publicKeyToAddress(publicKey: Hex): Address {\n const address = keccak256(`0x${publicKey.substring(4)}`).substring(26)\n return checksumAddress(`0x${address}`) as Address\n}\n","import { sign as sign_, Signature as Signature_ } from '@noble/secp256k1'\n\nimport type { Hex, Signature } from '../../types'\nimport { toHex } from '../../utils'\n\nexport type SignParameters = {\n hash: Hex\n privateKey: Hex\n}\nexport type SignReturnType = Signature\n\n/**\n * @description Signs a hash with a given private key.\n *\n * @param hash The hash to sign.\n * @param privateKey The private key to sign with.\n *\n * @returns The signature.\n */\nexport async function sign({\n hash,\n privateKey,\n}: SignParameters): Promise<SignReturnType> {\n const [sigBytes, recId] = await sign_(hash.slice(2), privateKey.slice(2), {\n canonical: true,\n recovered: true,\n })\n const sig = Signature_.fromHex(sigBytes)\n return {\n r: toHex(sig.r),\n s: toHex(sig.s),\n v: recId ? 28n : 27n,\n }\n}\n","import { Signature as Signature_ } from '@noble/secp256k1'\n\nimport type { Hex, Signature } from '../../types'\nimport { hexToBigInt, toHex } from '../../utils'\n\nexport function signatureToHex({ r, s, v }: Signature): Hex {\n return `0x${new Signature_(\n hexToBigInt(r),\n hexToBigInt(s),\n ).toCompactHex()}${toHex(v).slice(2)}`\n}\n","import type { Hex } from '../../types'\nimport { hashMessage } from '../../utils'\nimport { sign } from './sign'\nimport { signatureToHex } from './signatureToHex'\n\nexport type SignMessageParameters = {\n /** The message to sign. */\n message: string\n /** The private key to sign with. */\n privateKey: Hex\n}\nexport type SignMessageReturnType = Hex\n\n/**\n * @description Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191):\n * `keccak256(\"\\x19Ethereum Signed Message:\\n\" + len(message) + message))`.\n *\n * @returns The signature.\n */\nexport async function signMessage({\n message,\n privateKey,\n}: SignMessageParameters): Promise<SignMessageReturnType> {\n const signature = await sign({ hash: hashMessage(message), privateKey })\n return signatureToHex(signature)\n}\n","import type {\n Hex,\n TransactionSerializable,\n TransactionSerialized,\n TransactionType,\n} from '../../types'\nimport {\n GetTransactionType,\n keccak256,\n serializeTransaction,\n} from '../../utils'\nimport { sign } from './sign'\n\nexport type SignTransactionArgs<\n TTransactionSerializable extends TransactionSerializable = TransactionSerializable,\n> = {\n privateKey: Hex\n transaction: TTransactionSerializable\n}\nexport type SignTransactionReturnType<\n TTransactionSerializable extends TransactionSerializable = TransactionSerializable,\n TTransactionType extends TransactionType = GetTransactionType<TTransactionSerializable>,\n> = TransactionSerialized<TTransactionType>\n\nexport async function signTransaction<\n TTransactionSerializable extends TransactionSerializable,\n>({\n privateKey,\n transaction,\n}: SignTransactionArgs<TTransactionSerializable>): Promise<\n SignTransactionReturnType<TTransactionSerializable>\n> {\n const signature = await sign({\n hash: keccak256(serializeTransaction(transaction)),\n privateKey,\n })\n return serializeTransaction(transaction, signature)\n}\n","import type { TypedData } from 'abitype'\n\nimport type { Hex, TypedDataDefinition } from '../../types'\nimport { HashTypedDataParameters, hashTypedData } from '../../utils'\nimport { sign } from './sign'\nimport { signatureToHex } from './signatureToHex'\n\nexport type SignTypedDataParameters<\n TTypedData extends TypedData | { [key: string]: unknown } = TypedData,\n TPrimaryType extends string = string,\n> = TypedDataDefinition<TTypedData, TPrimaryType> & {\n /** The private key to sign with. */\n privateKey: Hex\n}\n\nexport type SignTypedDataReturnType = Hex\n\n/**\n * @description Signs typed data and calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191):\n * `keccak256(\"\\x19Ethereum Signed Message:\\n\" + len(message) + message))`.\n *\n * @returns The signature.\n */\nexport async function signTypedData<\n TTypedData extends TypedData | { [key: string]: unknown },\n TPrimaryType extends string = string,\n>({\n privateKey,\n ...typedData\n}: SignTypedDataParameters<\n TTypedData,\n TPrimaryType\n>): Promise<SignTypedDataReturnType> {\n const signature = await sign({\n hash: hashTypedData(typedData as HashTypedDataParameters),\n privateKey,\n })\n return signatureToHex(signature)\n}\n","export { wordlist as czech } from '@scure/bip39/wordlists/czech'\nexport { wordlist as english } from '@scure/bip39/wordlists/english'\nexport { wordlist as french } from '@scure/bip39/wordlists/french'\nexport { wordlist as italian } from '@scure/bip39/wordlists/italian'\nexport { wordlist as japanese } from '@scure/bip39/wordlists/japanese'\nexport { wordlist as korean } from '@scure/bip39/wordlists/korean'\nexport { wordlist as simplifiedChinese } from '@scure/bip39/wordlists/simplified-chinese'\nexport { wordlist as spanish } from '@scure/bip39/wordlists/spanish'\nexport { wordlist as traditionalChinese } from '@scure/bip39/wordlists/traditional-chinese'\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,aAAa;;;ACAtB,SAAS,oBAAoB,yBAAyB;AAS/C,SAAS,iBAAiBA,YAA4B;AAC3D,SAAO,kBAAkBA,UAAQ;AACnC;;;ACXA,SAAS,aAAa;AAUf,SAAS,qBAA0B;AACxC,SAAO,MAAM,MAAM,iBAAiB,CAAC;AACvC;;;ACZA,SAAS,oBAAoB;;;ACWtB,SAAS,mBAAmB,WAAyB;AAC1D,QAAM,UAAU,UAAU,KAAK,UAAU,UAAU,CAAC,GAAG,EAAE,UAAU,EAAE;AACrE,SAAO,gBAAgB,KAAK,SAAS;AACvC;;;ACdA,SAAS,QAAQ,OAAO,aAAa,kBAAkB;AAmBvD,eAAsB,KAAK;AAAA,EACzB;AAAA,EACA;AACF,GAA4C;AAC1C,QAAM,CAAC,UAAU,KAAK,IAAI,MAAM,MAAM,KAAK,MAAM,CAAC,GAAG,WAAW,MAAM,CAAC,GAAG;AAAA,IACxE,WAAW;AAAA,IACX,WAAW;AAAA,EACb,CAAC;AACD,QAAM,MAAM,WAAW,QAAQ,QAAQ;AACvC,SAAO;AAAA,IACL,GAAG,MAAM,IAAI,CAAC;AAAA,IACd,GAAG,MAAM,IAAI,CAAC;AAAA,IACd,GAAG,QAAQ,MAAM;AAAA,EACnB;AACF;;;ACjCA,SAAS,aAAaC,mBAAkB;AAKjC,SAAS,eAAe,EAAE,GAAG,GAAG,EAAE,GAAmB;AAC1D,SAAO,KAAK,IAAIC;AAAA,IACd,YAAY,CAAC;AAAA,IACb,YAAY,CAAC;AAAA,EACf,EAAE,aAAa,IAAI,MAAM,CAAC,EAAE,MAAM,CAAC;AACrC;;;ACSA,eAAsB,YAAY;AAAA,EAChC;AAAA,EACA;AACF,GAA0D;AACxD,QAAM,YAAY,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YAAZA,iBAAsC;","names":["wordlist","Signature_","Signature_","wordlist"]}
1
+ {"version":3,"sources":["../../src/accounts/index.ts","../../src/accounts/generateMnemonic.ts","../../src/accounts/generatePrivateKey.ts","../../src/accounts/privateKeyToAccount.ts","../../src/accounts/utils/sign.ts","../../src/accounts/utils/signatureToHex.ts","../../src/accounts/utils/signMessage.ts","../../src/accounts/utils/signTransaction.ts","../../src/accounts/utils/signTypedData.ts","../../src/accounts/wordlists.ts"],"sourcesContent":["import { HDKey } from '@scure/bip32'\n\nexport { HDKey }\n\nexport { generateMnemonic } from './generateMnemonic'\n\nexport { generatePrivateKey } from './generatePrivateKey'\n\nexport { privateKeyToAccount } from './privateKeyToAccount'\n\nexport { toAccount } from './toAccount'\n\nexport type {\n Account,\n AccountSource,\n CustomSource,\n HDOptions,\n JsonRpcAccount,\n LocalAccount,\n HDAccount,\n PrivateKeyAccount,\n} from './types'\n\nexport type {\n SignMessageParameters,\n SignMessageReturnType,\n SignTypedDataParameters,\n SignTypedDataReturnType,\n} from './utils'\nexport {\n parseAccount,\n publicKeyToAddress,\n signMessage,\n signTypedData,\n} from './utils'\n\nexport {\n czech,\n english,\n french,\n italian,\n japanese,\n korean,\n simplifiedChinese,\n spanish,\n traditionalChinese,\n} from './wordlists'\n","import { generateMnemonic as generateMnemonic_ } from '@scure/bip39'\n\n/**\n * @description Generates a random mnemonic phrase with a given wordlist.\n *\n * @param wordlist The wordlist to use for generating the mnemonic phrase.\n *\n * @returns A randomly generated mnemonic phrase.\n */\nexport function generateMnemonic(wordlist: string[]): string {\n return generateMnemonic_(wordlist)\n}\n","import { secp256k1 } from '@noble/curves/secp256k1'\n\nimport type { Hex } from '../types'\nimport { toHex } from '../utils'\n\n/**\n * @description Generates a random private key.\n *\n * @returns A randomly generated private key.\n */\nexport function generatePrivateKey(): Hex {\n return toHex(secp256k1.utils.randomPrivateKey())\n}\n","import { secp256k1 } from '@noble/curves/secp256k1'\n\nimport type { Hex } from '../types'\nimport { toHex } from '../utils'\nimport {\n publicKeyToAddress,\n signMessage,\n signTransaction,\n signTypedData,\n} from './utils'\nimport { toAccount } from './toAccount'\nimport type { PrivateKeyAccount } from './types'\n\n/**\n * @description Creates an Account from a private key.\n *\n * @returns A Private Key Account.\n */\nexport function privateKeyToAccount(privateKey: Hex): PrivateKeyAccount {\n const publicKey = toHex(secp256k1.getPublicKey(privateKey.slice(2), false))\n const address = publicKeyToAddress(publicKey)\n\n const account = toAccount({\n address,\n async signMessage({ message }) {\n return signMessage({ message, privateKey })\n },\n async signTransaction(transaction) {\n return signTransaction({ privateKey, transaction })\n },\n async signTypedData(typedData) {\n return signTypedData({ ...typedData, privateKey })\n },\n })\n\n return {\n ...account,\n publicKey,\n source: 'privateKey',\n }\n}\n","import { secp256k1 } from '@noble/curves/secp256k1'\n\nimport type { Hex, Signature } from '../../types'\nimport { toHex } from '../../utils'\n\nexport type SignParameters = {\n hash: Hex\n privateKey: Hex\n}\nexport type SignReturnType = Signature\n\n/**\n * @description Signs a hash with a given private key.\n *\n * @param hash The hash to sign.\n * @param privateKey The private key to sign with.\n *\n * @returns The signature.\n */\nexport async function sign({\n hash,\n privateKey,\n}: SignParameters): Promise<SignReturnType> {\n const { r, s, recovery } = secp256k1.sign(hash.slice(2), privateKey.slice(2))\n return {\n r: toHex(r),\n s: toHex(s),\n v: recovery ? 28n : 27n,\n }\n}\n","import { secp256k1 } from '@noble/curves/secp256k1'\n\nimport type { Hex, Signature } from '../../types'\nimport { hexToBigInt, toHex } from '../../utils'\n\nexport function signatureToHex({ r, s, v }: Signature): Hex {\n return `0x${new secp256k1.Signature(\n hexToBigInt(r),\n hexToBigInt(s),\n ).toCompactHex()}${toHex(v).slice(2)}`\n}\n","import type { Hex } from '../../types'\nimport { hashMessage } from '../../utils'\nimport { sign } from './sign'\nimport { signatureToHex } from './signatureToHex'\n\nexport type SignMessageParameters = {\n /** The message to sign. */\n message: string\n /** The private key to sign with. */\n privateKey: Hex\n}\nexport type SignMessageReturnType = Hex\n\n/**\n * @description Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191):\n * `keccak256(\"\\x19Ethereum Signed Message:\\n\" + len(message) + message))`.\n *\n * @returns The signature.\n */\nexport async function signMessage({\n message,\n privateKey,\n}: SignMessageParameters): Promise<SignMessageReturnType> {\n const signature = await sign({ hash: hashMessage(message), privateKey })\n return signatureToHex(signature)\n}\n","import type {\n Hex,\n TransactionSerializable,\n TransactionSerialized,\n TransactionType,\n} from '../../types'\nimport {\n GetTransactionType,\n keccak256,\n serializeTransaction,\n} from '../../utils'\nimport { sign } from './sign'\n\nexport type SignTransactionArgs<\n TTransactionSerializable extends TransactionSerializable = TransactionSerializable,\n> = {\n privateKey: Hex\n transaction: TTransactionSerializable\n}\nexport type SignTransactionReturnType<\n TTransactionSerializable extends TransactionSerializable = TransactionSerializable,\n TTransactionType extends TransactionType = GetTransactionType<TTransactionSerializable>,\n> = TransactionSerialized<TTransactionType>\n\nexport async function signTransaction<\n TTransactionSerializable extends TransactionSerializable,\n>({\n privateKey,\n transaction,\n}: SignTransactionArgs<TTransactionSerializable>): Promise<\n SignTransactionReturnType<TTransactionSerializable>\n> {\n const signature = await sign({\n hash: keccak256(serializeTransaction(transaction)),\n privateKey,\n })\n return serializeTransaction(transaction, signature)\n}\n","import type { TypedData } from 'abitype'\n\nimport type { Hex, TypedDataDefinition } from '../../types'\nimport { HashTypedDataParameters, hashTypedData } from '../../utils'\nimport { sign } from './sign'\nimport { signatureToHex } from './signatureToHex'\n\nexport type SignTypedDataParameters<\n TTypedData extends TypedData | { [key: string]: unknown } = TypedData,\n TPrimaryType extends string = string,\n> = TypedDataDefinition<TTypedData, TPrimaryType> & {\n /** The private key to sign with. */\n privateKey: Hex\n}\n\nexport type SignTypedDataReturnType = Hex\n\n/**\n * @description Signs typed data and calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191):\n * `keccak256(\"\\x19Ethereum Signed Message:\\n\" + len(message) + message))`.\n *\n * @returns The signature.\n */\nexport async function signTypedData<\n TTypedData extends TypedData | { [key: string]: unknown },\n TPrimaryType extends string = string,\n>({\n privateKey,\n ...typedData\n}: SignTypedDataParameters<\n TTypedData,\n TPrimaryType\n>): Promise<SignTypedDataReturnType> {\n const signature = await sign({\n hash: hashTypedData(typedData as HashTypedDataParameters),\n privateKey,\n })\n return signatureToHex(signature)\n}\n","export { wordlist as czech } from '@scure/bip39/wordlists/czech'\nexport { wordlist as english } from '@scure/bip39/wordlists/english'\nexport { wordlist as french } from '@scure/bip39/wordlists/french'\nexport { wordlist as italian } from '@scure/bip39/wordlists/italian'\nexport { wordlist as japanese } from '@scure/bip39/wordlists/japanese'\nexport { wordlist as korean } from '@scure/bip39/wordlists/korean'\nexport { wordlist as simplifiedChinese } from '@scure/bip39/wordlists/simplified-chinese'\nexport { wordlist as spanish } from '@scure/bip39/wordlists/spanish'\nexport { wordlist as traditionalChinese } from '@scure/bip39/wordlists/traditional-chinese'\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,aAAa;;;ACAtB,SAAS,oBAAoB,yBAAyB;AAS/C,SAAS,iBAAiBA,YAA4B;AAC3D,SAAO,kBAAkBA,UAAQ;AACnC;;;ACXA,SAAS,iBAAiB;AAUnB,SAAS,qBAA0B;AACxC,SAAO,MAAM,UAAU,MAAM,iBAAiB,CAAC;AACjD;;;ACZA,SAAS,aAAAC,kBAAiB;;;ACA1B,SAAS,aAAAC,kBAAiB;AAmB1B,eAAsB,KAAK;AAAA,EACzB;AAAA,EACA;AACF,GAA4C;AAC1C,QAAM,EAAE,GAAG,GAAG,SAAS,IAAIC,WAAU,KAAK,KAAK,MAAM,CAAC,GAAG,WAAW,MAAM,CAAC,CAAC;AAC5E,SAAO;AAAA,IACL,GAAG,MAAM,CAAC;AAAA,IACV,GAAG,MAAM,CAAC;AAAA,IACV,GAAG,WAAW,MAAM;AAAA,EACtB;AACF;;;AC7BA,SAAS,aAAAC,kBAAiB;AAKnB,SAAS,eAAe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