viem 0.0.1-alpha.33 → 0.0.1-alpha.34
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/LICENSE +1 -1
- package/dist/chains.js +46 -46
- package/dist/chains.mjs +1 -1
- package/dist/{chunk-DHSIBSJL.js → chunk-7ALCXZ5K.js} +75 -75
- package/dist/{chunk-RNGEVZVH.js → chunk-EBLS4P77.js} +14 -14
- package/dist/{chunk-BUCF6SRR.js → chunk-EJEZIHXK.js} +22 -22
- package/dist/{chunk-R7MSY2BH.js → chunk-F76TECTY.js} +4 -3
- package/dist/chunk-F76TECTY.js.map +1 -0
- package/dist/{chunk-3CEIPU6M.js → chunk-IUCGWGPX.js} +15 -15
- package/dist/{chunk-KMBDF3HQ.mjs → chunk-KQQLLKZV.mjs} +3 -3
- package/dist/{chunk-DYALOQ44.mjs → chunk-NMET3ZHG.mjs} +2 -2
- package/dist/{chunk-VEAHSGOL.mjs → chunk-TNN5X44H.mjs} +2 -2
- package/dist/{chunk-HN7IYO7U.mjs → chunk-VHZHROXW.mjs} +2 -2
- package/dist/{chunk-JB4TWW3U.mjs → chunk-VP57P6CD.mjs} +4 -3
- package/dist/chunk-VP57P6CD.mjs.map +1 -0
- package/dist/contract.js +4 -4
- package/dist/contract.mjs +3 -3
- package/dist/ens.js +4 -4
- package/dist/ens.mjs +3 -3
- package/dist/index.js +90 -90
- package/dist/index.mjs +5 -5
- package/dist/public.js +3 -3
- package/dist/public.mjs +2 -2
- package/dist/test.js +3 -3
- package/dist/test.mjs +2 -2
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.mjs +1 -1
- package/dist/wallet.js +3 -3
- package/dist/wallet.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-JB4TWW3U.mjs.map +0 -1
- package/dist/chunk-R7MSY2BH.js.map +0 -1
- /package/dist/{chunk-DHSIBSJL.js.map → chunk-7ALCXZ5K.js.map} +0 -0
- /package/dist/{chunk-RNGEVZVH.js.map → chunk-EBLS4P77.js.map} +0 -0
- /package/dist/{chunk-BUCF6SRR.js.map → chunk-EJEZIHXK.js.map} +0 -0
- /package/dist/{chunk-3CEIPU6M.js.map → chunk-IUCGWGPX.js.map} +0 -0
- /package/dist/{chunk-KMBDF3HQ.mjs.map → chunk-KQQLLKZV.mjs.map} +0 -0
- /package/dist/{chunk-DYALOQ44.mjs.map → chunk-NMET3ZHG.mjs.map} +0 -0
- /package/dist/{chunk-VEAHSGOL.mjs.map → chunk-TNN5X44H.mjs.map} +0 -0
- /package/dist/{chunk-HN7IYO7U.mjs.map → chunk-VHZHROXW.mjs.map} +0 -0
@@ -11,7 +11,7 @@
|
|
11
11
|
|
12
12
|
|
13
13
|
|
14
|
-
var
|
14
|
+
var _chunkF76TECTYjs = require('./chunk-F76TECTY.js');
|
15
15
|
|
16
16
|
// src/actions/wallet/addChain.ts
|
17
17
|
async function addChain(client, { chain }) {
|
@@ -20,7 +20,7 @@ async function addChain(client, { chain }) {
|
|
20
20
|
method: "wallet_addEthereumChain",
|
21
21
|
params: [
|
22
22
|
{
|
23
|
-
chainId:
|
23
|
+
chainId: _chunkF76TECTYjs.numberToHex.call(void 0, id),
|
24
24
|
chainName: name,
|
25
25
|
nativeCurrency,
|
26
26
|
rpcUrls: rpcUrls.default.http,
|
@@ -33,7 +33,7 @@ async function addChain(client, { chain }) {
|
|
33
33
|
// src/actions/wallet/getAccounts.ts
|
34
34
|
async function getAccounts(client) {
|
35
35
|
const addresses = await client.request({ method: "eth_accounts" });
|
36
|
-
return addresses.map((address) =>
|
36
|
+
return addresses.map((address) => _chunkF76TECTYjs.checksumAddress.call(void 0, address));
|
37
37
|
}
|
38
38
|
|
39
39
|
// src/actions/wallet/getPermissions.ts
|
@@ -45,7 +45,7 @@ async function getPermissions(client) {
|
|
45
45
|
// src/actions/wallet/requestAccounts.ts
|
46
46
|
async function requestAccounts(client) {
|
47
47
|
const addresses = await client.request({ method: "eth_requestAccounts" });
|
48
|
-
return addresses.map((address) =>
|
48
|
+
return addresses.map((address) => _chunkF76TECTYjs.getAddress.call(void 0, address));
|
49
49
|
}
|
50
50
|
|
51
51
|
// src/actions/wallet/requestPermissions.ts
|
@@ -73,9 +73,9 @@ async function sendTransaction(client, args) {
|
|
73
73
|
...rest
|
74
74
|
} = args;
|
75
75
|
try {
|
76
|
-
|
76
|
+
_chunkF76TECTYjs.assertRequest.call(void 0, args);
|
77
77
|
const formatter = _optionalChain([chain, 'optionalAccess', _ => _.formatters, 'optionalAccess', _2 => _2.transactionRequest]);
|
78
|
-
const request_ =
|
78
|
+
const request_ = _chunkF76TECTYjs.format.call(void 0,
|
79
79
|
{
|
80
80
|
from,
|
81
81
|
accessList,
|
@@ -88,10 +88,10 @@ async function sendTransaction(client, args) {
|
|
88
88
|
to,
|
89
89
|
value,
|
90
90
|
// Pick out extra data that might exist on the chain's transaction request type.
|
91
|
-
...
|
91
|
+
..._chunkF76TECTYjs.extract.call(void 0, rest, { formatter })
|
92
92
|
},
|
93
93
|
{
|
94
|
-
formatter: formatter ||
|
94
|
+
formatter: formatter || _chunkF76TECTYjs.formatTransactionRequest
|
95
95
|
}
|
96
96
|
);
|
97
97
|
const hash = await client.request({
|
@@ -100,7 +100,7 @@ async function sendTransaction(client, args) {
|
|
100
100
|
});
|
101
101
|
return hash;
|
102
102
|
} catch (err) {
|
103
|
-
throw
|
103
|
+
throw _chunkF76TECTYjs.getTransactionError.call(void 0, err, args);
|
104
104
|
}
|
105
105
|
}
|
106
106
|
|
@@ -109,7 +109,7 @@ async function signMessage(client, { from, data: data_ }) {
|
|
109
109
|
let data;
|
110
110
|
if (typeof data_ === "string") {
|
111
111
|
if (!data_.startsWith("0x"))
|
112
|
-
throw new (0,
|
112
|
+
throw new (0, _chunkF76TECTYjs.BaseError)(
|
113
113
|
`data ("${data_}") must be a hex value. Encode it first to a hex with the \`toHex\` util.`,
|
114
114
|
{
|
115
115
|
docsPath: "/TODO"
|
@@ -117,7 +117,7 @@ async function signMessage(client, { from, data: data_ }) {
|
|
117
117
|
);
|
118
118
|
data = data_;
|
119
119
|
} else {
|
120
|
-
data =
|
120
|
+
data = _chunkF76TECTYjs.toHex.call(void 0, data_);
|
121
121
|
}
|
122
122
|
const signed = await client.request({
|
123
123
|
method: "personal_sign",
|
@@ -132,7 +132,7 @@ async function switchChain(client, { id }) {
|
|
132
132
|
method: "wallet_switchEthereumChain",
|
133
133
|
params: [
|
134
134
|
{
|
135
|
-
chainId:
|
135
|
+
chainId: _chunkF76TECTYjs.numberToHex.call(void 0, id)
|
136
136
|
}
|
137
137
|
]
|
138
138
|
});
|
@@ -155,7 +155,7 @@ async function writeContract(client, {
|
|
155
155
|
functionName,
|
156
156
|
...request
|
157
157
|
}) {
|
158
|
-
const data =
|
158
|
+
const data = _chunkF76TECTYjs.encodeFunctionData.call(void 0, {
|
159
159
|
abi,
|
160
160
|
args,
|
161
161
|
functionName
|
@@ -170,7 +170,7 @@ async function writeContract(client, {
|
|
170
170
|
|
171
171
|
// src/actions/wallet/deployContract.ts
|
172
172
|
function deployContract(walletClient, { abi, args, bytecode, ...request }) {
|
173
|
-
const calldata =
|
173
|
+
const calldata = _chunkF76TECTYjs.encodeDeployData.call(void 0, {
|
174
174
|
abi,
|
175
175
|
args,
|
176
176
|
bytecode
|
@@ -194,4 +194,4 @@ function deployContract(walletClient, { abi, args, bytecode, ...request }) {
|
|
194
194
|
|
195
195
|
|
196
196
|
exports.addChain = addChain; exports.deployContract = deployContract; exports.getAccounts = getAccounts; exports.getPermissions = getPermissions; exports.requestAccounts = requestAccounts; exports.requestPermissions = requestPermissions; exports.sendTransaction = sendTransaction; exports.signMessage = signMessage; exports.switchChain = switchChain; exports.watchAsset = watchAsset; exports.writeContract = writeContract;
|
197
|
-
//# sourceMappingURL=chunk-
|
197
|
+
//# sourceMappingURL=chunk-IUCGWGPX.js.map
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import {
|
2
2
|
readContract
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-VHZHROXW.mjs";
|
4
4
|
import {
|
5
5
|
ChainDoesNotSupportContract,
|
6
6
|
ContractFunctionExecutionError,
|
@@ -13,7 +13,7 @@ import {
|
|
13
13
|
stringToBytes,
|
14
14
|
toBytes,
|
15
15
|
toHex
|
16
|
-
} from "./chunk-
|
16
|
+
} from "./chunk-VP57P6CD.mjs";
|
17
17
|
|
18
18
|
// src/utils/ens/labelhash.ts
|
19
19
|
function labelhash(label) {
|
@@ -207,4 +207,4 @@ export {
|
|
207
207
|
getEnsAddress,
|
208
208
|
getEnsName
|
209
209
|
};
|
210
|
-
//# sourceMappingURL=chunk-
|
210
|
+
//# sourceMappingURL=chunk-KQQLLKZV.mjs.map
|
@@ -2,7 +2,7 @@ import {
|
|
2
2
|
formatTransactionRequest,
|
3
3
|
hexToNumber,
|
4
4
|
numberToHex
|
5
|
-
} from "./chunk-
|
5
|
+
} from "./chunk-VP57P6CD.mjs";
|
6
6
|
|
7
7
|
// src/actions/test/dropTransaction.ts
|
8
8
|
async function dropTransaction(client, { hash }) {
|
@@ -262,4 +262,4 @@ export {
|
|
262
262
|
snapshot,
|
263
263
|
stopImpersonatingAccount
|
264
264
|
};
|
265
|
-
//# sourceMappingURL=chunk-
|
265
|
+
//# sourceMappingURL=chunk-NMET3ZHG.mjs.map
|
@@ -11,7 +11,7 @@ import {
|
|
11
11
|
getTransactionError,
|
12
12
|
numberToHex,
|
13
13
|
toHex
|
14
|
-
} from "./chunk-
|
14
|
+
} from "./chunk-VP57P6CD.mjs";
|
15
15
|
|
16
16
|
// src/actions/wallet/addChain.ts
|
17
17
|
async function addChain(client, { chain }) {
|
@@ -194,4 +194,4 @@ export {
|
|
194
194
|
watchAsset,
|
195
195
|
writeContract
|
196
196
|
};
|
197
|
-
//# sourceMappingURL=chunk-
|
197
|
+
//# sourceMappingURL=chunk-TNN5X44H.mjs.map
|
@@ -28,7 +28,7 @@ import {
|
|
28
28
|
numberToHex,
|
29
29
|
wait,
|
30
30
|
withCache
|
31
|
-
} from "./chunk-
|
31
|
+
} from "./chunk-VP57P6CD.mjs";
|
32
32
|
|
33
33
|
// src/actions/public/call.ts
|
34
34
|
async function call(client, args) {
|
@@ -1213,4 +1213,4 @@ export {
|
|
1213
1213
|
watchEvent,
|
1214
1214
|
watchPendingTransactions
|
1215
1215
|
};
|
1216
|
-
//# sourceMappingURL=chunk-
|
1216
|
+
//# sourceMappingURL=chunk-VHZHROXW.mjs.map
|
@@ -9,7 +9,7 @@ var __publicField = (obj, key, value) => {
|
|
9
9
|
var package_default = {
|
10
10
|
name: "viem",
|
11
11
|
description: "TypeScript Interface for Ethereum",
|
12
|
-
version: "0.0.1-alpha.
|
12
|
+
version: "0.0.1-alpha.34",
|
13
13
|
scripts: {
|
14
14
|
anvil: "source .env && anvil --fork-url $VITE_ANVIL_FORK_URL --fork-block-number $VITE_ANVIL_BLOCK_NUMBER --block-time $VITE_ANVIL_BLOCK_TIME",
|
15
15
|
bench: "vitest bench --no-threads",
|
@@ -2022,7 +2022,8 @@ function encodeTuple(value, { param }) {
|
|
2022
2022
|
value: value[index]
|
2023
2023
|
});
|
2024
2024
|
preparedParams.push(preparedParam);
|
2025
|
-
|
2025
|
+
if (preparedParam.dynamic)
|
2026
|
+
dynamic = true;
|
2026
2027
|
}
|
2027
2028
|
return {
|
2028
2029
|
dynamic,
|
@@ -3463,4 +3464,4 @@ export {
|
|
3463
3464
|
parseEther,
|
3464
3465
|
parseGwei
|
3465
3466
|
};
|
3466
|
-
//# sourceMappingURL=chunk-
|
3467
|
+
//# sourceMappingURL=chunk-VP57P6CD.mjs.map
|