viem 0.0.1-alpha.21 → 0.0.1-alpha.23
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-EC3NUIJE.js → chunk-7Y5QVLX7.js} +13 -13
- package/dist/{chunk-EC3NUIJE.js.map → chunk-7Y5QVLX7.js.map} +1 -1
- package/dist/{chunk-KEHGSYDO.js → chunk-BV5NTHUX.js} +14 -13
- package/dist/chunk-BV5NTHUX.js.map +1 -0
- package/dist/{chunk-46BO7YAQ.mjs → chunk-EGVXCZNJ.mjs} +4 -3
- package/dist/chunk-EGVXCZNJ.mjs.map +1 -0
- package/dist/{chunk-57ZOFERP.mjs → chunk-GX2KDAM3.mjs} +2 -2
- package/dist/{chunk-57ZOFERP.mjs.map → chunk-GX2KDAM3.mjs.map} +0 -0
- package/dist/{chunk-W7BWWAC4.js → chunk-NW6724MI.js} +14 -14
- package/dist/{chunk-W7BWWAC4.js.map → chunk-NW6724MI.js.map} +0 -0
- package/dist/{chunk-DGO77E2H.mjs → chunk-RJLUZTJS.mjs} +86 -3
- package/dist/chunk-RJLUZTJS.mjs.map +1 -0
- package/dist/{chunk-O2GYLJVD.js → chunk-SSPRUPGN.js} +405 -165
- package/dist/chunk-SSPRUPGN.js.map +1 -0
- package/dist/{chunk-DSPMAIDO.mjs → chunk-TXHOG6KU.mjs} +2 -2
- package/dist/{chunk-DSPMAIDO.mjs.map → chunk-TXHOG6KU.mjs.map} +1 -1
- package/dist/{chunk-62VTYU2V.mjs → chunk-XBUH66KN.mjs} +406 -166
- package/dist/chunk-XBUH66KN.mjs.map +1 -0
- package/dist/{chunk-KZMJR27B.js → chunk-ZKYGWITF.js} +147 -64
- package/dist/chunk-ZKYGWITF.js.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-4c3a37b3.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 +174 -113
- package/dist/index.js +16 -6
- package/dist/index.mjs +15 -5
- package/dist/normalize-ef9240c0.d.ts +33 -0
- package/dist/{parseGwei-4308ad80.d.ts → parseGwei-3411cf2d.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-57df1a13.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/constants.ts +4 -3
- package/src/_test/index.ts +4 -2
- package/src/_test/utils.ts +39 -1
- package/src/actions/index.test.ts +1 -0
- package/src/actions/index.ts +2 -0
- 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/getFilterChanges.test.ts +9 -9
- package/src/actions/public/getFilterLogs.test.ts +7 -7
- package/src/actions/public/getGasPrice.bench.ts +1 -10
- package/src/actions/public/getLogs.test.ts +7 -7
- package/src/actions/public/getTransaction.bench.ts +5 -5
- package/src/actions/public/getTransactionReceipt.bench.ts +5 -5
- package/src/actions/public/index.test.ts +1 -0
- package/src/actions/public/index.ts +3 -0
- 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 +61 -57
- package/src/actions/public/watchEvent.test.ts +42 -37
- package/src/actions/test/impersonateAccount.test.ts +4 -6
- package/src/actions/test/sendUnsignedTransaction.test.ts +2 -2
- package/src/actions/test/stopImpersonatingAccount.test.ts +5 -7
- 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 +47 -0
- package/src/index.ts +10 -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 +3 -4
- package/src/utils/abi/encodeAbi.ts +19 -10
- 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-46BO7YAQ.mjs.map +0 -1
- package/dist/chunk-62VTYU2V.mjs.map +0 -1
- package/dist/chunk-DGO77E2H.mjs.map +0 -1
- package/dist/chunk-KEHGSYDO.js.map +0 -1
- package/dist/chunk-KZMJR27B.js.map +0 -1
- package/dist/chunk-O2GYLJVD.js.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
|
})
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"sources":["../src/clients/transports/createTransport.ts","../src/clients/transports/custom.ts","../src/clients/transports/fallback.ts","../src/clients/transports/http.ts","../src/clients/transports/webSocket.ts","../src/utils/uid.ts","../src/clients/createClient.ts","../src/clients/createPublicClient.ts","../src/clients/createTestClient.ts","../src/clients/createWalletClient.ts"],"sourcesContent":["import type { Chain } from '../../types'\nimport type { Requests } from '../../types/eip1193'\n\nexport type BaseRpcRequests = {\n request(...args: any): Promise<any>\n}\n\nexport type TransportConfig<\n TType extends string = string,\n TRequests extends BaseRpcRequests['request'] = Requests['request'],\n> = {\n /** The name of the transport. */\n name: string\n /** The key of the transport. */\n key: string\n /** The JSON-RPC request function that matches the EIP-1193 request spec. */\n request: TRequests\n /** The type of the transport. */\n type: TType\n}\n\nexport type Transport<\n TType extends string = string,\n TRpcAttributes = Record<string, any>,\n> = <TChain extends Chain = Chain>({\n chain,\n}: {\n chain?: TChain\n}) => {\n config: TransportConfig<TType>\n value?: TRpcAttributes\n}\n\n/**\n * @description Creates an transport intended to be used with a client.\n */\nexport function createTransport<\n TType extends string = string,\n TRpcAttributes = any,\n>(\n config: TransportConfig<TType>,\n value?: TRpcAttributes,\n): ReturnType<Transport<TType, TRpcAttributes>> {\n return {\n config,\n value,\n }\n}\n","import type {\n BaseRpcRequests,\n Transport,\n TransportConfig,\n} from './createTransport'\nimport { createTransport } from './createTransport'\n\ntype EthereumProvider = { request: BaseRpcRequests['request'] }\n\nexport type CustomTransportConfig = {\n /** The key of the transport. */\n key?: TransportConfig['key']\n /** The name of the transport. */\n name?: TransportConfig['name']\n}\n\nexport type CustomTransport = Transport<'custom', EthereumProvider['request']>\n\n/**\n * @description Creates a custom transport given an EIP-1193 compliant `request` attribute.\n */\nexport function custom<TProvider extends EthereumProvider>(\n /** An Ethereum provider with an EIP-1193 \"request\" attribute. */\n provider: TProvider,\n { key = 'custom', name = 'Custom Provider' }: CustomTransportConfig = {},\n): CustomTransport {\n return () =>\n createTransport({\n key,\n name,\n request: provider.request.bind(provider),\n type: 'custom',\n })\n}\n","import type { Transport, TransportConfig } from './createTransport'\nimport { createTransport } from './createTransport'\n\nexport type FallbackTransportConfig = {\n /** The key of the Fallback transport. */\n key?: TransportConfig['key']\n /** The name of the Fallback transport. */\n name?: TransportConfig['name']\n}\n\nexport type FallbackTransport = Transport<\n 'fallback',\n { transports: Transport[] }\n>\n\nexport function fallback(\n transports: Transport[],\n { key = 'fallback', name = 'Fallback' }: FallbackTransportConfig = {},\n): FallbackTransport {\n return ({ chain }) =>\n createTransport(\n {\n key,\n name,\n async request({ method, params }) {\n const fetch = async (i: number = 0): Promise<any> => {\n const transport = transports[i]({ chain })\n try {\n return await transport.config.request({\n method,\n params,\n } as any)\n } catch (err) {\n if (i < transports.length - 1) return fetch(i + 1)\n throw err\n }\n }\n return fetch()\n },\n type: 'fallback',\n },\n {\n transports: transports.map(\n (fn) => fn({ chain }) as unknown as Transport,\n ),\n },\n )\n}\n","import { UrlRequiredError } from '../../errors'\nimport { rpc } from '../../utils/rpc'\nimport type { Transport, TransportConfig } from './createTransport'\nimport { createTransport } from './createTransport'\n\nexport type HttpTransportConfig = {\n /** The key of the HTTP transport. */\n key?: TransportConfig['key']\n /** The name of the HTTP transport. */\n name?: TransportConfig['name']\n}\n\nexport type HttpTransport = Transport<\n 'http',\n {\n url?: string\n }\n>\n\n/**\n * @description Creates a HTTP transport that connects to a JSON-RPC API.\n */\nexport function http(\n /** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */\n url?: string,\n { key = 'http', name = 'HTTP JSON-RPC' }: HttpTransportConfig = {},\n): HttpTransport {\n return ({ chain }) => {\n const url_ = url || chain?.rpcUrls.default.http[0]\n if (!url_) throw new UrlRequiredError()\n return createTransport(\n {\n key,\n name,\n async request({ method, params }) {\n const { result } = await rpc.http(url_, {\n body: {\n method,\n params,\n },\n })\n return result\n },\n type: 'http',\n },\n {\n url,\n },\n )\n }\n}\n","import { UrlRequiredError } from '../../errors'\nimport type { Hash } from '../../types'\nimport type { RpcResponse } from '../../utils/rpc'\nimport { getSocket, rpc } from '../../utils/rpc'\nimport type { Transport, TransportConfig } from './createTransport'\nimport { createTransport } from './createTransport'\n\ntype WebSocketTransportSubscribeArgs = {\n onData: (data: RpcResponse) => void\n onError?: (error: any) => void\n}\n\ntype WebSocketTransportSubscribeResponse = {\n subscriptionId: Hash\n unsubscribe: () => Promise<RpcResponse<boolean>>\n}\n\ntype WebSocketTransportSubscribe = {\n subscribe(\n args: WebSocketTransportSubscribeArgs & {\n /**\n * @description Add information about compiled contracts\n * @link https://hardhat.org/hardhat-network/docs/reference#hardhat_addcompilationresult\n */\n params: ['newHeads']\n },\n ): Promise<WebSocketTransportSubscribeResponse>\n}\n\nexport type WebSocketTransportConfig = {\n /** The key of the WebSocket transport. */\n key?: TransportConfig['key']\n /** The name of the WebSocket transport. */\n name?: TransportConfig['name']\n}\n\nexport type WebSocketTransport = Transport<\n 'webSocket',\n {\n getSocket(): Promise<WebSocket>\n subscribe: WebSocketTransportSubscribe['subscribe']\n }\n>\n\n/**\n * @description Creates a WebSocket transport that connects to a JSON-RPC API.\n */\nexport function webSocket(\n /** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */\n url?: string,\n {\n key = 'webSocket',\n name = 'WebSocket JSON-RPC',\n }: WebSocketTransportConfig = {},\n): WebSocketTransport {\n return ({ chain }) => {\n const url_ = url || chain?.rpcUrls.default.webSocket?.[0]\n if (!url_) throw new UrlRequiredError()\n return createTransport(\n {\n key,\n name,\n async request({ method, params }) {\n const socket = await getSocket(url_)\n const { result } = await rpc.webSocketAsync(socket, {\n body: { method, params },\n })\n return result\n },\n type: 'webSocket',\n },\n {\n getSocket() {\n return getSocket(url_)\n },\n async subscribe({ params, onData, onError }: any) {\n const socket = await getSocket(url_)\n const { result: subscriptionId } = await new Promise<any>(\n (resolve, reject) =>\n rpc.webSocket(socket, {\n body: {\n method: 'eth_subscribe',\n params,\n },\n onData: (data) => {\n if (typeof data.id === 'number') {\n resolve(data)\n return\n }\n onData(data)\n },\n onError: (error) => {\n reject(error)\n onError?.(error)\n },\n }),\n )\n return {\n subscriptionId,\n async unsubscribe() {\n return new Promise<any>((resolve, reject) =>\n rpc.webSocket(socket, {\n body: {\n method: 'eth_unsubscribe',\n params: [subscriptionId],\n },\n onData: resolve,\n onError: reject,\n }),\n )\n },\n }\n },\n },\n )\n }\n}\n","let size = 256\nlet index = size\nlet buffer: string\n\nexport function uid(length = 11) {\n if (!buffer || index + length > size * 2) {\n buffer = ''\n index = 0\n for (let i = 0; i < size; i++) {\n buffer += ((256 + Math.random() * 256) | 0).toString(16).substring(1)\n }\n }\n return buffer.substring(index, index++ + length)\n}\n","import { Chain } from '../types'\nimport type { Requests } from '../types/eip1193'\nimport { buildRequest } from '../utils/buildRequest'\nimport { uid } from '../utils/uid'\nimport type { BaseRpcRequests, Transport } from './transports/createTransport'\n\nexport type Client<\n TTransport extends Transport = Transport,\n TChain extends Chain = Chain,\n TRequests extends BaseRpcRequests = Requests,\n> = {\n /** Chain for the client. */\n chain?: TChain\n /** A key for the client. */\n key: string\n /** A name for the client. */\n name: string\n /** Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. */\n pollingInterval: number\n /** Request function wrapped with friendly error handling */\n request: TRequests['request']\n /** The RPC transport (http, webSocket, custom, etc) */\n transport: ReturnType<TTransport>['config'] & ReturnType<TTransport>['value']\n /** The type of client. */\n type: string\n /** A unique ID for the client. */\n uid: string\n}\n\nexport type ClientConfig<\n TTransport extends Transport = Transport,\n TChain extends Chain = Chain,\n TRequests extends BaseRpcRequests = Requests,\n> = Partial<\n Pick<\n Client<TTransport, TChain, TRequests>,\n 'chain' | 'key' | 'name' | 'pollingInterval' | 'type'\n >\n> & {\n transport: TTransport\n}\n\n/**\n * @description Creates a base RPC client with the given transport.\n *\n * - Intended to be used as a base for other RPC clients.\n * - Has access to _all_ EIP-1474 RPC methods.\n *\n * @example\n * import { mainnet } from 'viem/chains'\n * import { createClient, http } from 'viem/clients'\n * const client = createClient(http({ chain: mainnet }))\n */\nexport function createClient<\n TTransport extends Transport,\n TChain extends Chain,\n TRequests extends BaseRpcRequests,\n>({\n chain,\n key = 'base',\n name = 'Base Client',\n pollingInterval = 4_000,\n transport,\n type = 'base',\n}: ClientConfig<TTransport, TChain, TRequests>): Client<\n TTransport,\n TChain,\n TRequests\n> {\n const { config, value } = transport({ chain })\n return {\n chain,\n key,\n name,\n pollingInterval,\n request: buildRequest(config.request),\n transport: { ...config, ...value },\n type,\n uid: uid(),\n }\n}\n","import type { PublicRequests } from '../types/eip1193'\nimport type { Transport } from './transports/createTransport'\nimport type { Client, ClientConfig } from './createClient'\nimport { createClient } from './createClient'\nimport { Chain } from '../types'\n\nexport type PublicClientConfig<\n TTransport extends Transport = Transport,\n TChain extends Chain = Chain,\n> = Pick<\n ClientConfig<TTransport, TChain>,\n 'chain' | 'key' | 'name' | 'pollingInterval' | 'transport'\n>\n\nexport type PublicClient<\n TTransport extends Transport = Transport,\n TChain extends Chain = Chain,\n> = Client<TTransport, TChain, PublicRequests>\n\n/**\n * @description Creates a public client with a given transport.\n *\n * - Only has access to \"public\" EIP-1474 RPC methods (ie. `eth_blockNumber`, etc).\n *\n * @example\n * import { mainnet } from 'viem/chains'\n * import { createPublicClient, http } from 'viem/clients'\n * const client = createPublicClient(http({ chain: mainnet }))\n */\nexport function createPublicClient<\n TTransport extends Transport,\n TChain extends Chain,\n>({\n chain,\n key = 'public',\n name = 'Public Client',\n transport,\n pollingInterval,\n}: PublicClientConfig<TTransport, TChain>): PublicClient<TTransport, TChain> {\n chain\n return createClient({\n chain,\n key,\n name,\n pollingInterval,\n transport,\n type: 'publicClient',\n })\n}\n","import type { TestRequests } from '../types/eip1193'\nimport type { Transport } from './transports/createTransport'\nimport type { Client, ClientConfig } from './createClient'\nimport { createClient } from './createClient'\nimport { Chain } from '../types'\n\ntype TestClientModes = 'anvil' | 'hardhat'\n\nexport type TestClientConfig<\n TTransport extends Transport = Transport,\n TChain extends Chain = Chain,\n TMode extends TestClientModes = TestClientModes,\n> = {\n chain?: ClientConfig<TTransport, TChain>['chain']\n /** The key of the client. */\n key?: ClientConfig['key']\n /** Mode of the test client. Available: \"anvil\" | \"hardhat\" */\n mode: TMode\n /** The name of the client. */\n name?: ClientConfig['name']\n /** Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. */\n pollingInterval?: ClientConfig['pollingInterval']\n transport: ClientConfig<TTransport, TChain>['transport']\n}\n\nexport type TestClient<\n TTransport extends Transport = Transport,\n TChain extends Chain = Chain,\n TMode extends TestClientModes = TestClientModes,\n> = Client<TTransport, TChain, TestRequests<TMode>> & {\n mode: TMode\n}\n\n/**\n * @description Creates a test client with a given transport.\n *\n * - Only has access to \"test\" RPC methods (ie. `anvil_setBalance`,\n * `evm_mine`, etc).\n *\n * @example\n * import { createTestClient, http } from 'viem'\n * import { local } from 'viem/chains'\n * const client = createTestClient({ chain: local, mode: 'anvil', transport: http() })\n */\nexport function createTestClient<\n TTransport extends Transport,\n TChain extends Chain,\n TMode extends TestClientModes,\n>({\n chain,\n key = 'test',\n name = 'Test Client',\n mode,\n pollingInterval,\n transport,\n}: TestClientConfig<TTransport, TChain, TMode>): TestClient<\n TTransport,\n TChain,\n TMode\n> {\n return {\n ...createClient({\n chain,\n key,\n name,\n pollingInterval,\n transport,\n type: 'testClient',\n }),\n mode,\n }\n}\n","import type { SignableRequests, WalletRequests } from '../types/eip1193'\nimport type { Transport } from './transports/createTransport'\nimport type { Client, ClientConfig } from './createClient'\nimport { createClient } from './createClient'\nimport { Chain } from '../types'\n\nexport type WalletClientConfig<\n TTransport extends Transport = Transport,\n TChain extends Chain = Chain,\n> = {\n chain?: ClientConfig<TTransport, TChain>['chain']\n /** The key of the Wallet Client. */\n key?: ClientConfig['key']\n /** The name of the Wallet Client. */\n name?: ClientConfig['name']\n /** Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. */\n pollingInterval?: ClientConfig['pollingInterval']\n transport: ClientConfig<TTransport, TChain>['transport']\n}\n\nexport type WalletClient<\n TTransport extends Transport = Transport,\n TChain extends Chain = Chain,\n> = Client<TTransport, TChain, SignableRequests & WalletRequests>\n\n/**\n * @description Creates a wallet client with a given transport.\n *\n * - Only has access to \"wallet\" & \"signable\" EIP-1474 RPC methods\n * (ie. `eth_sendTransaction`, `eth_requestAccounts`, etc).\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * const client = createWalletClient(\n * custom(window.ethereum)\n * )\n */\nexport function createWalletClient<\n TTransport extends Transport,\n TChain extends Chain,\n>({\n transport,\n key = 'wallet',\n name = 'Wallet Client',\n pollingInterval,\n}: WalletClientConfig<TTransport, TChain>): WalletClient<TTransport, TChain> {\n return createClient({\n key,\n name,\n pollingInterval,\n transport,\n type: 'walletClient',\n })\n}\n"],"mappings":";;;;;;;;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