viem 0.0.1-alpha.20 → 0.0.1-alpha.22
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.
- package/dist/{chain-32f56cfa.d.ts → chain-4b39613a.d.ts} +2 -2
- package/dist/{chain-f12cdc7f.d.ts → chain-aa4898d0.d.ts} +1 -1
- package/dist/chains.d.ts +3 -3
- package/dist/chains.js +46 -46
- package/dist/chains.mjs +1 -1
- package/dist/{chunk-ZVGTYLKU.mjs → chunk-JMFNAGCD.mjs} +4 -3
- package/dist/chunk-JMFNAGCD.mjs.map +1 -0
- package/dist/{chunk-NHAKUPTF.js → chunk-MVD4Y3AE.js} +67 -63
- package/dist/chunk-MVD4Y3AE.js.map +1 -0
- package/dist/{chunk-YODUQCHJ.mjs → chunk-OZIBQJYR.mjs} +2 -2
- package/dist/{chunk-YODUQCHJ.mjs.map → chunk-OZIBQJYR.mjs.map} +0 -0
- package/dist/{chunk-FHXXG7I6.js → chunk-PMPJGAHY.js} +14 -13
- package/dist/chunk-PMPJGAHY.js.map +1 -0
- package/dist/{chunk-YFKR74XG.js → chunk-QA3IE5DU.js} +14 -14
- package/dist/{chunk-YFKR74XG.js.map → chunk-QA3IE5DU.js.map} +0 -0
- package/dist/{chunk-T7CBAKLI.mjs → chunk-QN2NCTEN.mjs} +2 -2
- package/dist/{chunk-T7CBAKLI.mjs.map → chunk-QN2NCTEN.mjs.map} +1 -1
- package/dist/{chunk-IAQPMSGJ.js → chunk-S77NLWHO.js} +13 -13
- package/dist/{chunk-IAQPMSGJ.js.map → chunk-S77NLWHO.js.map} +1 -1
- package/dist/{chunk-SF4I2NKC.js → chunk-V5U5S7PQ.js} +411 -167
- package/dist/chunk-V5U5S7PQ.js.map +1 -0
- package/dist/{chunk-5Q6FSUU2.mjs → chunk-WWJ5YPTJ.mjs} +412 -168
- package/dist/chunk-WWJ5YPTJ.mjs.map +1 -0
- package/dist/{chunk-MYQNZSWD.mjs → chunk-ZXXEENRD.mjs} +7 -3
- package/dist/chunk-ZXXEENRD.mjs.map +1 -0
- package/dist/clients/index.d.ts +7 -7
- package/dist/clients/index.js +3 -3
- package/dist/clients/index.mjs +2 -2
- package/dist/{contract-9af4608b.d.ts → contract-74f34ac9.d.ts} +14 -3
- package/dist/{createClient-5d316c7e.d.ts → createClient-55a04188.d.ts} +2 -2
- package/dist/{createPublicClient-9d2b42e1.d.ts → createPublicClient-3b27b282.d.ts} +3 -3
- package/dist/{createTestClient-79498dab.d.ts → createTestClient-93f9eac6.d.ts} +3 -3
- package/dist/{createWalletClient-f69a5230.d.ts → createWalletClient-c10df94d.d.ts} +3 -3
- package/dist/{eip1193-6c485d63.d.ts → eip1193-4c24765a.d.ts} +1 -1
- package/dist/ens.d.ts +1 -0
- package/dist/ens.js +11 -0
- package/dist/ens.js.map +1 -0
- package/dist/ens.mjs +11 -0
- package/dist/ens.mjs.map +1 -0
- package/dist/index.d.ts +125 -113
- package/dist/index.js +14 -6
- package/dist/index.mjs +13 -5
- package/dist/normalize-ef9240c0.d.ts +33 -0
- package/dist/{parseGwei-4308ad80.d.ts → parseGwei-b323fb0a.d.ts} +101 -37
- package/dist/public.d.ts +9 -9
- package/dist/public.js +4 -4
- package/dist/public.mjs +3 -3
- package/dist/{sendTransaction-1c8290a9.d.ts → sendTransaction-f17a2389.d.ts} +3 -3
- package/dist/{stopImpersonatingAccount-7781842a.d.ts → stopImpersonatingAccount-afb26486.d.ts} +2 -2
- package/dist/test.d.ts +5 -5
- package/dist/test.js +3 -3
- package/dist/test.mjs +2 -2
- package/dist/{transactionRequest-341b6ed2.d.ts → transactionRequest-93e9f001.d.ts} +2 -2
- package/dist/utils/index.d.ts +14 -16
- package/dist/utils/index.js +8 -2
- package/dist/utils/index.mjs +7 -1
- package/dist/wallet.d.ts +7 -7
- package/dist/wallet.js +3 -3
- package/dist/wallet.mjs +2 -2
- package/dist/{watchAsset-afaad3c7.d.ts → watchAsset-efd3dd05.d.ts} +3 -3
- package/dist/{watchPendingTransactions-3b722547.d.ts → watchPendingTransactions-a8688b26.d.ts} +17 -27
- package/dist/{webSocket-b180e679.d.ts → webSocket-d2e7bd0e.d.ts} +2 -2
- package/dist/window.d.ts +2 -2
- package/package.json +8 -2
- package/src/_test/abis.ts +7 -0
- package/src/_test/bench.ts +4 -4
- package/src/_test/index.ts +3 -1
- package/src/_test/utils.ts +39 -1
- package/src/actions/public/call.bench.ts +5 -5
- package/src/actions/public/deployContract.ts +4 -4
- package/src/actions/public/estimateGas.bench.ts +6 -6
- package/src/actions/public/getBlock.bench.ts +5 -5
- package/src/actions/public/getBlockNumber.bench.ts +5 -5
- package/src/actions/public/getGasPrice.bench.ts +1 -10
- package/src/actions/public/getTransaction.bench.ts +5 -5
- package/src/actions/public/getTransactionReceipt.bench.ts +5 -5
- package/src/actions/public/multicall.test.ts +452 -0
- package/src/actions/public/multicall.ts +103 -0
- package/src/actions/public/readContract.test.ts +226 -26
- package/src/actions/public/readContract.ts +13 -27
- package/src/actions/public/simulateContract.bench.ts +10 -0
- package/src/actions/public/simulateContract.test.ts +209 -37
- package/src/actions/public/simulateContract.ts +17 -21
- package/src/actions/public/watchContractEvent.test.ts +36 -32
- package/src/actions/public/watchEvent.test.ts +34 -29
- package/src/actions/wallet/signMessage.test.ts +0 -1
- package/src/actions/wallet/switchChain.test.ts +1 -2
- package/src/actions/wallet/watchAsset.test.ts +1 -2
- package/src/actions/wallet/writeContract.test.ts +37 -7
- package/src/actions/wallet/writeContract.ts +5 -14
- package/src/clients/transports/fallback.test.ts +34 -0
- package/src/clients/transports/fallback.ts +3 -1
- package/src/clients/transports/http.test.ts +0 -1
- package/src/clients/transports/webSocket.test.ts +0 -1
- package/src/constants/abis.test.ts +53 -0
- package/src/constants/abis.ts +44 -0
- package/src/constants/index.test.ts +14 -0
- package/src/constants/index.ts +3 -0
- package/src/constants/solidity.test.ts +41 -0
- package/src/constants/solidity.ts +35 -0
- package/src/ens.ts +5 -0
- package/src/errors/abi.test.ts +0 -2
- package/src/errors/base.test.ts +44 -2
- package/src/errors/base.ts +12 -12
- package/src/errors/block.test.ts +6 -6
- package/src/errors/contract.test.ts +233 -0
- package/src/errors/contract.ts +133 -80
- package/src/errors/index.ts +4 -2
- package/src/errors/request.test.ts +3 -4
- package/src/errors/request.ts +17 -17
- package/src/errors/rpc.test.ts +1 -2
- package/src/errors/transaction.test.ts +12 -12
- package/src/errors/transport.test.ts +0 -1
- package/src/index.test.ts +46 -0
- package/src/index.ts +8 -0
- package/src/types/contract.ts +55 -4
- package/src/types/index.ts +5 -0
- package/src/types/multicall.ts +82 -0
- package/src/utils/abi/decodeAbi.test.ts +1 -2
- package/src/utils/abi/decodeAbi.ts +11 -7
- package/src/utils/abi/decodeDeployData.test.ts +7 -15
- package/src/utils/abi/decodeDeployData.ts +10 -7
- package/src/utils/abi/decodeErrorResult.test.ts +103 -3
- package/src/utils/abi/decodeErrorResult.ts +30 -13
- package/src/utils/abi/decodeFunctionData.test.ts +0 -1
- package/src/utils/abi/decodeFunctionResult.test.ts +80 -9
- package/src/utils/abi/decodeFunctionResult.ts +15 -11
- package/src/utils/abi/encodeAbi.test.ts +40 -7
- package/src/utils/abi/encodeAbi.ts +28 -13
- package/src/utils/abi/encodeDeployData.test.ts +6 -13
- package/src/utils/abi/encodeDeployData.ts +10 -7
- package/src/utils/abi/encodeErrorResult.test.ts +2 -7
- package/src/utils/abi/encodeErrorResult.ts +18 -11
- package/src/utils/abi/encodeEventTopics.test.ts +11 -14
- package/src/utils/abi/encodeEventTopics.ts +15 -9
- package/src/utils/abi/encodeFunctionData.test.ts +5 -7
- package/src/utils/abi/encodeFunctionData.ts +16 -9
- package/src/utils/abi/encodeFunctionResult.test.ts +10 -15
- package/src/utils/abi/encodeFunctionResult.ts +9 -7
- package/src/utils/abi/getAbiItem.test.ts +547 -0
- package/src/utils/abi/getAbiItem.ts +93 -3
- package/src/utils/abi/index.ts +5 -1
- package/src/utils/address/getAddress.test.ts +6 -6
- package/src/utils/contract/getContractError.test.ts +247 -62
- package/src/utils/contract/getContractError.ts +30 -38
- package/src/utils/data/pad.bench.ts +0 -9
- package/src/utils/data/trim.bench.ts +0 -16
- package/src/utils/encoding/encodeBytes.bench.ts +0 -12
- package/src/utils/encoding/encodeHex.bench.ts +0 -11
- package/src/utils/ens/index.test.ts +13 -0
- package/src/utils/ens/index.ts +5 -0
- package/src/utils/ens/labelhash.test.ts +55 -0
- package/src/utils/ens/labelhash.ts +16 -0
- package/src/utils/ens/namehash.test.ts +65 -0
- package/src/utils/ens/namehash.ts +28 -0
- package/src/utils/ens/normalize.bench.ts +14 -0
- package/src/utils/ens/normalize.test.ts +35 -0
- package/src/utils/ens/normalize.ts +14 -0
- package/src/utils/hash/keccak256.ts +3 -5
- package/src/utils/index.test.ts +3 -0
- package/src/utils/index.ts +4 -0
- package/src/utils/rpc.test.ts +3 -6
- package/src/utils/unit/formatUnit.bench.ts +0 -5
- package/src/utils/unit/parseUnit.bench.ts +0 -5
- package/dist/chunk-5Q6FSUU2.mjs.map +0 -1
- package/dist/chunk-FHXXG7I6.js.map +0 -1
- package/dist/chunk-MYQNZSWD.mjs.map +0 -1
- package/dist/chunk-NHAKUPTF.js.map +0 -1
- package/dist/chunk-SF4I2NKC.js.map +0 -1
- package/dist/chunk-ZVGTYLKU.mjs.map +0 -1
@@ -0,0 +1,65 @@
|
|
1
|
+
import { test, expect } from 'vitest'
|
2
|
+
|
3
|
+
import { namehash } from './namehash'
|
4
|
+
|
5
|
+
test.each([
|
6
|
+
{
|
7
|
+
name: '',
|
8
|
+
expected:
|
9
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
10
|
+
},
|
11
|
+
{
|
12
|
+
name: 'eth',
|
13
|
+
expected:
|
14
|
+
'0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae',
|
15
|
+
},
|
16
|
+
{
|
17
|
+
name: 'alice.eth',
|
18
|
+
expected:
|
19
|
+
'0x787192fc5378cc32aa956ddfdedbf26b24e8d78e40109add0eea2c1a012c3dec',
|
20
|
+
},
|
21
|
+
{
|
22
|
+
name: 'iam.alice.eth',
|
23
|
+
expected:
|
24
|
+
'0x5bec9e288ed3df984a80a1ac48538a7f19370794d676506adfbddefad210775b',
|
25
|
+
},
|
26
|
+
{
|
27
|
+
name: 'awkweb.eth',
|
28
|
+
expected:
|
29
|
+
'0x52d0f5fbf348925621be297a61b88ec492ebbbdfa9477d82892e2786020ad61c',
|
30
|
+
},
|
31
|
+
{
|
32
|
+
name: 'awkw𝝣b.eth',
|
33
|
+
expected:
|
34
|
+
'0x4e372358e2e47fdbba39e5ca56d412e6dc4216a260a733b1b5d8df0001d28202',
|
35
|
+
},
|
36
|
+
{
|
37
|
+
name: '\u{0061}wkweb.eth',
|
38
|
+
expected:
|
39
|
+
'0x52d0f5fbf348925621be297a61b88ec492ebbbdfa9477d82892e2786020ad61c',
|
40
|
+
},
|
41
|
+
{
|
42
|
+
name: '\u{0061}wkw\u{0065}b.eth',
|
43
|
+
expected:
|
44
|
+
'0x52d0f5fbf348925621be297a61b88ec492ebbbdfa9477d82892e2786020ad61c',
|
45
|
+
},
|
46
|
+
{
|
47
|
+
name: 'awkweb.eth',
|
48
|
+
// ^ latin small "a"
|
49
|
+
expected:
|
50
|
+
'0x52d0f5fbf348925621be297a61b88ec492ebbbdfa9477d82892e2786020ad61c',
|
51
|
+
},
|
52
|
+
{
|
53
|
+
name: 'awkweb.eth',
|
54
|
+
// ^ latin small "e"
|
55
|
+
expected:
|
56
|
+
'0x52d0f5fbf348925621be297a61b88ec492ebbbdfa9477d82892e2786020ad61c',
|
57
|
+
},
|
58
|
+
{
|
59
|
+
name: 'ʘ‿ʘ.eth',
|
60
|
+
expected:
|
61
|
+
'0x61e4a7cb09f4b512f41d02fedcc851cf8e43161e1f34e4264d7d911bb6c9c7af',
|
62
|
+
},
|
63
|
+
])("namehash('$name') -> '$expected'", ({ name, expected }) => {
|
64
|
+
expect(namehash(name)).toBe(expected)
|
65
|
+
})
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { concat } from '../data'
|
2
|
+
import { bytesToHex, stringToBytes } from '../encoding'
|
3
|
+
import { keccak256 } from '../hash'
|
4
|
+
import { normalize } from './normalize'
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @description Hashes ENS name
|
8
|
+
*
|
9
|
+
* @example
|
10
|
+
* namehash('wagmi-dev.eth')
|
11
|
+
* '0xf246651c1b9a6b141d19c2604e9a58f567973833990f830d882534a747801359'
|
12
|
+
*
|
13
|
+
* @see https://eips.ethereum.org/EIPS/eip-137
|
14
|
+
* @see https://docs.ens.domains/contract-api-reference/name-processing#hashing-names
|
15
|
+
*/
|
16
|
+
export function namehash(name: string) {
|
17
|
+
let result = new Uint8Array(32).fill(0)
|
18
|
+
if (!name) return bytesToHex(result)
|
19
|
+
|
20
|
+
const labels = normalize(name).split('.')
|
21
|
+
// Iterate in reverse order building up hash
|
22
|
+
for (let i = labels.length - 1; i >= 0; i -= 1) {
|
23
|
+
const hashed = keccak256(stringToBytes(labels[i]), 'bytes')
|
24
|
+
result = keccak256(concat([result, hashed]), 'bytes')
|
25
|
+
}
|
26
|
+
|
27
|
+
return bytesToHex(result)
|
28
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { describe, bench } from 'vitest'
|
2
|
+
import { ens_normalize } from '@adraffy/ens-normalize'
|
3
|
+
|
4
|
+
import { normalize } from './normalize'
|
5
|
+
|
6
|
+
describe('Normalize ENS name', () => {
|
7
|
+
bench('viem: `normalize`', () => {
|
8
|
+
normalize('\u{0061}wkw𝝣b.eth')
|
9
|
+
})
|
10
|
+
|
11
|
+
bench('@adraffy/ens-normalize: `ens_normalize`', () => {
|
12
|
+
ens_normalize('\u{0061}wkw𝝣b.eth')
|
13
|
+
})
|
14
|
+
})
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { test, expect } from 'vitest'
|
2
|
+
import { normalize } from './normalize'
|
3
|
+
|
4
|
+
test.each([
|
5
|
+
{ name: 'awkweb.eth', expected: 'awkweb.eth' },
|
6
|
+
{ name: 'Awkweb.eth', expected: 'awkweb.eth' },
|
7
|
+
{ name: '🖖.eth', expected: '🖖.eth' },
|
8
|
+
{ name: 'awkw𝝣b.eth', expected: 'awkwξb.eth' },
|
9
|
+
{ name: '\u{0061}wkweb.eth', expected: 'awkweb.eth' },
|
10
|
+
{ name: '\u{0061}wkw\u{0065}b.eth', expected: 'awkweb.eth' },
|
11
|
+
{ name: 'awkweb.eth', expected: 'awkweb.eth' },
|
12
|
+
// ^ latin small "a"
|
13
|
+
{ name: 'awkweb.eth', expected: 'awkweb.eth' },
|
14
|
+
// ^ latin small "e"
|
15
|
+
])("normalize('$name') -> '$expected'", ({ name, expected }) => {
|
16
|
+
expect(normalize(name)).toBe(expected)
|
17
|
+
})
|
18
|
+
|
19
|
+
test('invalid label extension', () => {
|
20
|
+
expect(() => normalize('34--A.eth')).toThrowErrorMatchingInlineSnapshot(
|
21
|
+
'"Failed to validate 34--a"',
|
22
|
+
)
|
23
|
+
})
|
24
|
+
|
25
|
+
test('illegal placement: leading combining mark', () => {
|
26
|
+
expect(() => normalize('\u{303}.eth')).toThrowErrorMatchingInlineSnapshot(
|
27
|
+
'"Label contains illegal character: 771"',
|
28
|
+
)
|
29
|
+
})
|
30
|
+
|
31
|
+
test('underscore allowed only at start', () => {
|
32
|
+
expect(() => normalize('a_b_c.eth')).toThrowErrorMatchingInlineSnapshot(
|
33
|
+
'"Illegal char _"',
|
34
|
+
)
|
35
|
+
})
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { toUnicode } from 'idna-uts46-hx'
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @description Normalizes ENS name
|
5
|
+
*
|
6
|
+
* @example
|
7
|
+
* normalize('wagmi-dev.eth')
|
8
|
+
* 'wagmi-dev.eth'
|
9
|
+
*
|
10
|
+
* @see https://docs.ens.domains/contract-api-reference/name-processing#normalising-names
|
11
|
+
*/
|
12
|
+
export function normalize(name: string) {
|
13
|
+
return toUnicode(name, { useStd3ASCII: true })
|
14
|
+
}
|
@@ -6,11 +6,9 @@ import { encodeHex } from '../encoding'
|
|
6
6
|
|
7
7
|
type To = 'hex' | 'bytes'
|
8
8
|
|
9
|
-
export type Keccak256Hash<TTo extends To> =
|
10
|
-
? ByteArray
|
11
|
-
|
12
|
-
? Hex
|
13
|
-
: never
|
9
|
+
export type Keccak256Hash<TTo extends To> =
|
10
|
+
| (TTo extends 'bytes' ? ByteArray : never)
|
11
|
+
| (TTo extends 'hex' ? Hex : never)
|
14
12
|
|
15
13
|
export function keccak256<TTo extends To = 'hex'>(
|
16
14
|
value: ByteArray,
|
package/src/utils/index.test.ts
CHANGED
@@ -75,6 +75,9 @@ test('exports utils', () => {
|
|
75
75
|
"isBytes": [Function],
|
76
76
|
"isHex": [Function],
|
77
77
|
"keccak256": [Function],
|
78
|
+
"labelhash": [Function],
|
79
|
+
"namehash": [Function],
|
80
|
+
"normalize": [Function],
|
78
81
|
"numberToBytes": [Function],
|
79
82
|
"numberToHex": [Function],
|
80
83
|
"pad": [Function],
|
package/src/utils/index.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
export type {
|
2
2
|
DecodeAbiArgs,
|
3
3
|
DecodeErrorResultArgs,
|
4
|
+
DecodeErrorResultResponse,
|
4
5
|
DecodeFunctionDataArgs,
|
5
6
|
DecodeFunctionResultArgs,
|
6
7
|
DecodeFunctionResultResponse,
|
@@ -10,6 +11,7 @@ export type {
|
|
10
11
|
EncodeEventTopicsArgs,
|
11
12
|
EncodeFunctionDataArgs,
|
12
13
|
EncodeFunctionResultArgs,
|
14
|
+
GetAbiItemArgs,
|
13
15
|
} from './abi'
|
14
16
|
export {
|
15
17
|
decodeAbi,
|
@@ -66,6 +68,8 @@ export {
|
|
66
68
|
trim,
|
67
69
|
} from './data'
|
68
70
|
|
71
|
+
export { labelhash, namehash, normalize } from './ens'
|
72
|
+
|
69
73
|
export type {
|
70
74
|
BlockFormatter,
|
71
75
|
ExtractFormatter,
|
package/src/utils/rpc.test.ts
CHANGED
@@ -70,8 +70,7 @@ describe('http', () => {
|
|
70
70
|
Request body: {\\"method\\":\\"eth_wagmi\\"}
|
71
71
|
|
72
72
|
Details: Method not found
|
73
|
-
Version: viem@1.0.2
|
74
|
-
Internal Error: {\\"code\\":-32601,\\"message\\":\\"Method not found\\"}"
|
73
|
+
Version: viem@1.0.2"
|
75
74
|
`)
|
76
75
|
})
|
77
76
|
|
@@ -706,8 +705,7 @@ describe('webSocket (subscription)', () => {
|
|
706
705
|
Request body: {"method":"eth_subscribe","params":["fakeHeadz"]}
|
707
706
|
|
708
707
|
Details: data did not match any variant of untagged enum EthRpcCall
|
709
|
-
Version: viem@1.0.2
|
710
|
-
Internal Error: {"code":-32602,"message":"data did not match any variant of untagged enum EthRpcCall"}]
|
708
|
+
Version: viem@1.0.2]
|
711
709
|
`)
|
712
710
|
})
|
713
711
|
})
|
@@ -961,8 +959,7 @@ describe('webSocketAsync', () => {
|
|
961
959
|
Request body: {\\"method\\":\\"wagmi_lol\\"}
|
962
960
|
|
963
961
|
Details: data did not match any variant of untagged enum EthRpcCall
|
964
|
-
Version: viem@1.0.2
|
965
|
-
Internal Error: {\\"code\\":-32602,\\"message\\":\\"data did not match any variant of untagged enum EthRpcCall\\"}"
|
962
|
+
Version: viem@1.0.2"
|
966
963
|
`,
|
967
964
|
)
|
968
965
|
})
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { bench, describe } from 'vitest'
|
2
2
|
import { utils } from 'ethers'
|
3
3
|
import Web3 from 'web3'
|
4
|
-
import { weiToEther } from 'essential-eth'
|
5
4
|
|
6
5
|
import { formatUnit } from './formatUnit'
|
7
6
|
|
@@ -19,8 +18,4 @@ describe('Format Unit', () => {
|
|
19
18
|
bench('web3.js: `toWei`', () => {
|
20
19
|
web3.utils.toWei('40000000000000000000')
|
21
20
|
})
|
22
|
-
|
23
|
-
bench('essential-eth: `etherToWei`', () => {
|
24
|
-
weiToEther('40000000000000000000')
|
25
|
-
})
|
26
21
|
})
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { bench, describe } from 'vitest'
|
2
2
|
import { utils } from 'ethers'
|
3
3
|
import Web3 from 'web3'
|
4
|
-
import { etherToWei } from 'essential-eth'
|
5
4
|
|
6
5
|
import { parseUnit } from './parseUnit'
|
7
6
|
|
@@ -19,8 +18,4 @@ describe('Parse Unit', () => {
|
|
19
18
|
bench('web3.js: `fromWei`', () => {
|
20
19
|
web3.utils.fromWei('40')
|
21
20
|
})
|
22
|
-
|
23
|
-
bench('essential-eth: `etherToWei`', () => {
|
24
|
-
etherToWei('40')
|
25
|
-
})
|
26
21
|
})
|