viem 0.1.16 → 0.1.17
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/abi.d.ts +3 -3
- package/dist/abi.js +2 -2
- package/dist/abi.mjs +1 -1
- package/dist/{chain-3a97fb0b.d.ts → chain-1b53ef88.d.ts} +1 -1
- package/dist/{chain-94e42876.d.ts → chain-ec8c485d.d.ts} +1 -1
- package/dist/chains.d.ts +3 -3
- package/dist/chains.js +63 -63
- package/dist/chains.mjs +1 -1
- package/dist/{chunk-EUMT64YW.js → chunk-7FL2Z6KZ.js} +19 -19
- package/dist/{chunk-S53L3VGF.mjs → chunk-7VL5TXOM.mjs} +5 -4
- package/dist/{chunk-S53L3VGF.mjs.map → chunk-7VL5TXOM.mjs.map} +1 -1
- package/dist/{chunk-SA6IPLJF.js → chunk-D4NT4PPV.js} +5 -4
- package/dist/chunk-D4NT4PPV.js.map +1 -0
- package/dist/{chunk-6CRQ2Z6Y.mjs → chunk-SEQCMEKG.mjs} +2 -2
- package/dist/contract.d.ts +7 -7
- package/dist/contract.js +2 -2
- package/dist/contract.mjs +1 -1
- package/dist/{createClient-ddc3fa22.d.ts → createClient-a28317a9.d.ts} +2 -2
- package/dist/{createPublicClient-1e28879c.d.ts → createPublicClient-0021fc35.d.ts} +4 -4
- package/dist/{eip1193-343f2a94.d.ts → eip1193-4f4e240c.d.ts} +1 -1
- package/dist/{encodeFunctionResult-4d3bafb8.d.ts → encodeFunctionResult-1f324375.d.ts} +1 -1
- package/dist/{encodePacked-a51cd55a.d.ts → encodePacked-d5d5264a.d.ts} +1 -1
- package/dist/ens.d.ts +4 -4
- package/dist/ens.js +3 -3
- package/dist/ens.mjs +2 -2
- package/dist/ethers.d.ts +10 -5
- package/dist/ethers.js +5 -4
- package/dist/ethers.js.map +1 -1
- package/dist/ethers.mjs +3 -2
- package/dist/ethers.mjs.map +1 -1
- package/dist/{formatAbiItem-e5d7437a.d.ts → formatAbiItem-15e8817d.d.ts} +1 -1
- package/dist/{getAbiItem-de2d6ac0.d.ts → getAbiItem-3e809ff9.d.ts} +1 -1
- package/dist/index.d.ts +13 -13
- package/dist/index.js +90 -90
- package/dist/index.mjs +2 -2
- package/dist/{parseGwei-da38c1af.d.ts → parseGwei-eda6728f.d.ts} +3 -3
- package/dist/public.d.ts +4 -4
- package/dist/public.js +2 -2
- package/dist/public.mjs +1 -1
- package/dist/{test-07a99259.d.ts → test-a203fdee.d.ts} +3 -3
- package/dist/test.d.ts +5 -5
- package/dist/test.js +2 -2
- package/dist/test.mjs +1 -1
- package/dist/utils/index.d.ts +13 -13
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.mjs +1 -1
- package/dist/wallet.d.ts +4 -4
- package/dist/wallet.js +2 -2
- package/dist/wallet.mjs +1 -1
- package/dist/window.d.ts +2 -2
- package/package.json +1 -1
- package/dist/chunk-SA6IPLJF.js.map +0 -1
- /package/dist/{chunk-EUMT64YW.js.map → chunk-7FL2Z6KZ.js.map} +0 -0
- /package/dist/{chunk-6CRQ2Z6Y.mjs.map → chunk-SEQCMEKG.mjs.map} +0 -0
@@ -11,7 +11,7 @@ import {
|
|
11
11
|
stringToBytes,
|
12
12
|
toBytes,
|
13
13
|
toHex
|
14
|
-
} from "./chunk-
|
14
|
+
} from "./chunk-7VL5TXOM.mjs";
|
15
15
|
|
16
16
|
// src/utils/ens/labelhash.ts
|
17
17
|
function labelhash(label) {
|
@@ -183,4 +183,4 @@ export {
|
|
183
183
|
getEnsAddress,
|
184
184
|
getEnsName
|
185
185
|
};
|
186
|
-
//# sourceMappingURL=chunk-
|
186
|
+
//# sourceMappingURL=chunk-SEQCMEKG.mjs.map
|
package/dist/contract.d.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
export { m as CreateContractEventFilterParameters, n as CreateContractEventFilterReturnType, V as DeployContractParameters, X as DeployContractReturnType, o as EstimateContractGasParameters, p as EstimateContractGasReturnType, G as GetBytecodeParameters, q as GetBytecodeReturnType, r as GetStorageAtParameters, s as GetStorageAtReturnType, M as MulticallParameters, t as MulticallReturnType, O as OnLogsFn, u as OnLogsParameter, R as ReadContractParameters, v as ReadContractReturnType, w as SimulateContractParameters, x as SimulateContractReturnType, y as WatchContractEventParameters, Y as WriteContractParameters, Z as WriteContractReturnType, z as createContractEventFilter, _ as deployContract, D as estimateContractGas, H as getBytecode, I as getStorageAt, K as multicall, N as readContract, Q as simulateContract, U as watchContractEvent, $ as writeContract } from './createPublicClient-
|
2
|
-
export { D as DecodeAbiParametersReturnType, E as EncodeAbiParametersReturnType, G as GetAbiItemParameters, d as decodeAbiParameters, e as encodeAbiParameters, g as getAbiItem } from './getAbiItem-
|
3
|
-
export { D as DecodeErrorResultParameters, a as DecodeErrorResultReturnType, b as DecodeEventLogParameters, c as DecodeEventLogReturnType, d as DecodeFunctionDataParameters, e as DecodeFunctionResultParameters, f as DecodeFunctionResultReturnType, E as EncodeDeployDataParameters, g as EncodeErrorResultParameters, h as EncodeEventTopicsParameters, i as EncodeFunctionDataParameters, j as EncodeFunctionResultParameters, k as decodeErrorResult, l as decodeEventLog, m as decodeFunctionData, n as decodeFunctionResult, o as encodeDeployData, p as encodeErrorResult, q as encodeEventTopics, r as encodeFunctionData, s as encodeFunctionResult } from './encodeFunctionResult-
|
4
|
-
export { a as formatAbiItem, f as formatAbiItemWithArgs } from './formatAbiItem-
|
5
|
-
import './eip1193-
|
1
|
+
export { m as CreateContractEventFilterParameters, n as CreateContractEventFilterReturnType, V as DeployContractParameters, X as DeployContractReturnType, o as EstimateContractGasParameters, p as EstimateContractGasReturnType, G as GetBytecodeParameters, q as GetBytecodeReturnType, r as GetStorageAtParameters, s as GetStorageAtReturnType, M as MulticallParameters, t as MulticallReturnType, O as OnLogsFn, u as OnLogsParameter, R as ReadContractParameters, v as ReadContractReturnType, w as SimulateContractParameters, x as SimulateContractReturnType, y as WatchContractEventParameters, Y as WriteContractParameters, Z as WriteContractReturnType, z as createContractEventFilter, _ as deployContract, D as estimateContractGas, H as getBytecode, I as getStorageAt, K as multicall, N as readContract, Q as simulateContract, U as watchContractEvent, $ as writeContract } from './createPublicClient-0021fc35.js';
|
2
|
+
export { D as DecodeAbiParametersReturnType, E as EncodeAbiParametersReturnType, G as GetAbiItemParameters, d as decodeAbiParameters, e as encodeAbiParameters, g as getAbiItem } from './getAbiItem-3e809ff9.js';
|
3
|
+
export { D as DecodeErrorResultParameters, a as DecodeErrorResultReturnType, b as DecodeEventLogParameters, c as DecodeEventLogReturnType, d as DecodeFunctionDataParameters, e as DecodeFunctionResultParameters, f as DecodeFunctionResultReturnType, E as EncodeDeployDataParameters, g as EncodeErrorResultParameters, h as EncodeEventTopicsParameters, i as EncodeFunctionDataParameters, j as EncodeFunctionResultParameters, k as decodeErrorResult, l as decodeEventLog, m as decodeFunctionData, n as decodeFunctionResult, o as encodeDeployData, p as encodeErrorResult, q as encodeEventTopics, r as encodeFunctionData, s as encodeFunctionResult } from './encodeFunctionResult-1f324375.js';
|
4
|
+
export { a as formatAbiItem, f as formatAbiItemWithArgs } from './formatAbiItem-15e8817d.js';
|
5
|
+
import './eip1193-4f4e240c.js';
|
6
6
|
import 'abitype';
|
7
|
-
import './chain-
|
7
|
+
import './chain-1b53ef88.js';
|
8
8
|
import '@wagmi/chains';
|
9
|
-
import './createClient-
|
9
|
+
import './createClient-a28317a9.js';
|
package/dist/contract.js
CHANGED
@@ -23,7 +23,7 @@
|
|
23
23
|
|
24
24
|
|
25
25
|
|
26
|
-
var
|
26
|
+
var _chunkD4NT4PPVjs = require('./chunk-D4NT4PPV.js');
|
27
27
|
|
28
28
|
|
29
29
|
|
@@ -49,5 +49,5 @@ var _chunkSA6IPLJFjs = require('./chunk-SA6IPLJF.js');
|
|
49
49
|
|
50
50
|
|
51
51
|
|
52
|
-
exports.createContractEventFilter =
|
52
|
+
exports.createContractEventFilter = _chunkD4NT4PPVjs.createContractEventFilter; exports.decodeAbiParameters = _chunkD4NT4PPVjs.decodeAbiParameters; exports.decodeErrorResult = _chunkD4NT4PPVjs.decodeErrorResult; exports.decodeEventLog = _chunkD4NT4PPVjs.decodeEventLog; exports.decodeFunctionData = _chunkD4NT4PPVjs.decodeFunctionData; exports.decodeFunctionResult = _chunkD4NT4PPVjs.decodeFunctionResult; exports.deployContract = _chunkD4NT4PPVjs.deployContract; exports.encodeAbiParameters = _chunkD4NT4PPVjs.encodeAbiParameters; exports.encodeDeployData = _chunkD4NT4PPVjs.encodeDeployData; exports.encodeErrorResult = _chunkD4NT4PPVjs.encodeErrorResult; exports.encodeEventTopics = _chunkD4NT4PPVjs.encodeEventTopics; exports.encodeFunctionData = _chunkD4NT4PPVjs.encodeFunctionData; exports.encodeFunctionResult = _chunkD4NT4PPVjs.encodeFunctionResult; exports.estimateContractGas = _chunkD4NT4PPVjs.estimateContractGas; exports.formatAbiItem = _chunkD4NT4PPVjs.formatAbiItem; exports.formatAbiItemWithArgs = _chunkD4NT4PPVjs.formatAbiItemWithArgs; exports.getAbiItem = _chunkD4NT4PPVjs.getAbiItem; exports.getBytecode = _chunkD4NT4PPVjs.getBytecode; exports.getStorageAt = _chunkD4NT4PPVjs.getStorageAt; exports.multicall = _chunkD4NT4PPVjs.multicall; exports.readContract = _chunkD4NT4PPVjs.readContract; exports.simulateContract = _chunkD4NT4PPVjs.simulateContract; exports.watchContractEvent = _chunkD4NT4PPVjs.watchContractEvent; exports.writeContract = _chunkD4NT4PPVjs.writeContract;
|
53
53
|
//# sourceMappingURL=contract.js.map
|
package/dist/contract.mjs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { R as Requests } from './eip1193-
|
2
|
-
import { C as Chain } from './chain-
|
1
|
+
import { R as Requests } from './eip1193-4f4e240c.js';
|
2
|
+
import { C as Chain } from './chain-1b53ef88.js';
|
3
3
|
|
4
4
|
type BaseRpcRequests = {
|
5
5
|
request(...args: any): Promise<any>;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { W as WalletPermission, a as WatchAssetParams, P as PublicRequests } from './eip1193-
|
2
|
-
import { a as Transport, b as ClientConfig, C as Client } from './createClient-
|
1
|
+
import { W as WalletPermission, a as WatchAssetParams, P as PublicRequests } from './eip1193-4f4e240c.js';
|
2
|
+
import { a as Transport, b as ClientConfig, C as Client } from './createClient-a28317a9.js';
|
3
3
|
import { Abi, Narrow, Address, AbiEvent, ExtractAbiEvent, TypedData, TypedDataDomain, TypedDataToPrimitiveTypes } from 'abitype';
|
4
|
-
import { C as Chain, H as Hex,
|
4
|
+
import { C as Chain, H as Hex, h as ExtractConstructorArgsFromAbi, W as ExtractFormatter, a1 as Formatters, a2 as Formatter, X as Formatted, c as Block, R as RpcBlock, O as Transaction, T as TransactionReceipt, z as RpcTransactionReceipt, a3 as TransactionType, D as RpcTransactionRequest, I as TransactionRequest, f as BlockTag, a4 as MergeIntersectionProperties, g as ContractConfig, a5 as GetValue, p as ExtractResultFromAbi, a6 as MaybeAbiEventName, a7 as MaybeExtractEventArgsFromAbi, e as BlockNumber, m as ExtractEventNameFromAbi, a as Hash, F as FeeHistory, L as Log, Y as FormattedTransaction, Z as TransactionFormatter, k as ExtractEventArgsFromAbi, a8 as Prettify } from './chain-1b53ef88.js';
|
5
5
|
|
6
6
|
type AddChainParameters = {
|
7
7
|
chain: Chain;
|
@@ -444,7 +444,7 @@ type MulticallResults<TContracts extends Contract[], TAllowFailure extends boole
|
|
444
444
|
|
445
445
|
type MulticallParameters<TContracts extends ContractConfig[] = ContractConfig[], TAllowFailure extends boolean = true> = Pick<CallParameters, 'blockNumber' | 'blockTag'> & {
|
446
446
|
allowFailure?: TAllowFailure;
|
447
|
-
contracts: readonly [...MulticallContracts<TContracts>]
|
447
|
+
contracts: Narrow<readonly [...MulticallContracts<TContracts>]>;
|
448
448
|
multicallAddress?: Address;
|
449
449
|
};
|
450
450
|
type MulticallReturnType<TContracts extends ContractConfig[] = ContractConfig[], TAllowFailure extends boolean = true> = MulticallResults<TContracts, TAllowFailure>;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Address } from 'abitype';
|
2
|
-
import { a as Hash,
|
2
|
+
import { a as Hash, a9 as Quantity, D as RpcTransactionRequest, u as RpcBlockNumber, f as BlockTag, t as RpcBlockIdentifier, H as Hex, v as RpcFeeHistory, R as RpcBlock, x as RpcLog, ab as LogTopic, y as RpcTransaction, z as RpcTransactionReceipt, G as RpcUncle } from './chain-1b53ef88.js';
|
3
3
|
|
4
4
|
declare class RpcError extends Error {
|
5
5
|
code: number;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Abi, Narrow } from 'abitype';
|
2
|
-
import { H as Hex, A as AbiItem,
|
2
|
+
import { H as Hex, A as AbiItem, m as ExtractEventNameFromAbi, l as ExtractEventArgsFromTopics, n as ExtractFunctionNameFromAbi, E as ExtractArgsFromAbi, p as ExtractResultFromAbi, h as ExtractConstructorArgsFromAbi, j as ExtractErrorNameFromAbi, i as ExtractErrorArgsFromAbi, k as ExtractEventArgsFromAbi } from './chain-1b53ef88.js';
|
3
3
|
|
4
4
|
type DecodeErrorResultParameters = {
|
5
5
|
abi?: Abi;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Narrow, SolidityAddress, SolidityBool, SolidityBytes, SolidityInt, SolidityString, SolidityArrayWithoutTuple, AbiType, AbiParameterToPrimitiveType } from 'abitype';
|
2
|
-
import { H as Hex } from './chain-
|
2
|
+
import { H as Hex } from './chain-1b53ef88.js';
|
3
3
|
|
4
4
|
type PackedAbiType = SolidityAddress | SolidityBool | SolidityBytes | SolidityInt | SolidityString | SolidityArrayWithoutTuple;
|
5
5
|
type EncodePackedValues<TPackedAbiTypes extends PackedAbiType[] | unknown[]> = {
|
package/dist/ens.d.ts
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
export { a0 as GetEnsAddressParameters, a1 as GetEnsNameParameters, a2 as getEnsAddress, a3 as getEnsName } from './createPublicClient-
|
1
|
+
export { a0 as GetEnsAddressParameters, a1 as GetEnsNameParameters, a2 as getEnsAddress, a3 as getEnsName } from './createPublicClient-0021fc35.js';
|
2
2
|
export { l as labelhash, n as namehash } from './namehash-afff0feb.js';
|
3
|
-
import './eip1193-
|
3
|
+
import './eip1193-4f4e240c.js';
|
4
4
|
import 'abitype';
|
5
|
-
import './chain-
|
5
|
+
import './chain-1b53ef88.js';
|
6
6
|
import '@wagmi/chains';
|
7
|
-
import './createClient-
|
7
|
+
import './createClient-a28317a9.js';
|
8
8
|
|
9
9
|
/**
|
10
10
|
* @description Normalizes ENS name
|
package/dist/ens.js
CHANGED
@@ -3,8 +3,8 @@
|
|
3
3
|
|
4
4
|
|
5
5
|
|
6
|
-
var
|
7
|
-
require('./chunk-
|
6
|
+
var _chunk7FL2Z6KZjs = require('./chunk-7FL2Z6KZ.js');
|
7
|
+
require('./chunk-D4NT4PPV.js');
|
8
8
|
|
9
9
|
// src/utils/ens/normalize.ts
|
10
10
|
var _idnauts46hx = require('idna-uts46-hx');
|
@@ -17,5 +17,5 @@ function normalize(name) {
|
|
17
17
|
|
18
18
|
|
19
19
|
|
20
|
-
exports.getEnsAddress =
|
20
|
+
exports.getEnsAddress = _chunk7FL2Z6KZjs.getEnsAddress; exports.getEnsName = _chunk7FL2Z6KZjs.getEnsName; exports.labelhash = _chunk7FL2Z6KZjs.labelhash; exports.namehash = _chunk7FL2Z6KZjs.namehash; exports.normalize = normalize;
|
21
21
|
//# sourceMappingURL=ens.js.map
|
package/dist/ens.mjs
CHANGED
package/dist/ethers.d.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
import { A as Account } from './createPublicClient-
|
2
|
-
import './eip1193-
|
1
|
+
import { A as Account } from './createPublicClient-0021fc35.js';
|
2
|
+
import './eip1193-4f4e240c.js';
|
3
3
|
import 'abitype';
|
4
|
-
import './chain-
|
4
|
+
import './chain-1b53ef88.js';
|
5
5
|
import '@wagmi/chains';
|
6
|
-
import './createClient-
|
6
|
+
import './createClient-a28317a9.js';
|
7
7
|
|
8
8
|
type BigNumberish = string | number | bigint;
|
9
9
|
type BytesLike = string | Uint8Array;
|
@@ -22,8 +22,13 @@ type EthersWallet = {
|
|
22
22
|
address: string;
|
23
23
|
signMessage(message: Uint8Array): Promise<string>;
|
24
24
|
signTransaction(txn: any): Promise<string>;
|
25
|
+
} & ({
|
25
26
|
signTypedData(domain: TypedDataDomain, types: Record<string, TypedDataField[]>, value: Record<string, any>): Promise<string>;
|
26
|
-
|
27
|
+
_signTypedData?: never;
|
28
|
+
} | {
|
29
|
+
signTypedData?: never;
|
30
|
+
_signTypedData(domain: TypedDataDomain, types: Record<string, TypedDataField[]>, value: Record<string, any>): Promise<string>;
|
31
|
+
});
|
27
32
|
declare const getAccount: (wallet: EthersWallet) => Account;
|
28
33
|
|
29
34
|
export { getAccount };
|
package/dist/ethers.js
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
2
2
|
|
3
3
|
|
4
|
-
var
|
4
|
+
var _chunkD4NT4PPVjs = require('./chunk-D4NT4PPV.js');
|
5
5
|
|
6
6
|
// src/adapters/ethers.ts
|
7
|
-
var getAccount2 = (wallet) =>
|
7
|
+
var getAccount2 = (wallet) => _chunkD4NT4PPVjs.getAccount.call(void 0, {
|
8
8
|
address: wallet.address,
|
9
9
|
async signMessage(message) {
|
10
|
-
return await wallet.signMessage(
|
10
|
+
return await wallet.signMessage(_chunkD4NT4PPVjs.toBytes.call(void 0, message));
|
11
11
|
},
|
12
12
|
async signTransaction(txn) {
|
13
13
|
return await wallet.signTransaction({
|
@@ -17,7 +17,8 @@ var getAccount2 = (wallet) => _chunkSA6IPLJFjs.getAccount.call(void 0, {
|
|
17
17
|
},
|
18
18
|
async signTypedData({ domain, types: types_, message }) {
|
19
19
|
const { EIP712Domain: _, ...types } = types_;
|
20
|
-
|
20
|
+
const signTypedData = wallet.signTypedData || wallet._signTypedData;
|
21
|
+
return await signTypedData(
|
21
22
|
_nullishCoalesce(domain, () => ( {})),
|
22
23
|
types,
|
23
24
|
message
|
package/dist/ethers.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/adapters/ethers.ts"],"names":["getAccount"],"mappings":";;;;;;
|
1
|
+
{"version":3,"sources":["../src/adapters/ethers.ts"],"names":["getAccount"],"mappings":";;;;;;AAyCO,IAAMA,cAAa,CAAC,WACzB,WAAY;AAAA,EACV,SAAS,OAAO;AAAA,EAChB,MAAM,YAAY,SAAS;AACzB,WAAQ,MAAM,OAAO,YAAY,QAAQ,OAAO,CAAC;AAAA,EACnD;AAAA,EACA,MAAM,gBAAgB,KAAK;AACzB,WAAQ,MAAM,OAAO,gBAAgB;AAAA,MACnC,GAAG;AAAA,MACH,UAAU,IAAI;AAAA,IAChB,CAAC;AAAA,EACH;AAAA,EACA,MAAM,cAAc,EAAE,QAAQ,OAAO,QAAQ,QAAQ,GAAG;AACtD,UAAM,EAAE,cAAc,GAAG,GAAG,MAAM,IAAI;AACtC,UAAM,gBAAgB,OAAO,iBAAiB,OAAO;AACrD,WAAQ,MAAM;AAAA,MACZ,UAAU,CAAC;AAAA,MACX;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF,CAAC","sourcesContent":["import { Address, Hash } from '../types'\nimport { getAccount as getAccount_, toBytes } from '../utils'\n\ntype BigNumberish = string | number | bigint\ntype BytesLike = string | Uint8Array\n\ntype TypedDataDomain = {\n name?: string\n version?: string\n chainId?: BigNumberish\n verifyingContract?: string\n salt?: BytesLike\n}\ntype TypedDataField = {\n name: string\n type: string\n}\n\ntype EthersWallet = {\n address: string\n signMessage(message: Uint8Array): Promise<string>\n signTransaction(txn: any): Promise<string>\n} & (\n | {\n signTypedData(\n domain: TypedDataDomain,\n types: Record<string, TypedDataField[]>,\n value: Record<string, any>,\n ): Promise<string>\n _signTypedData?: never\n }\n | {\n signTypedData?: never\n _signTypedData(\n domain: TypedDataDomain,\n types: Record<string, TypedDataField[]>,\n value: Record<string, any>,\n ): Promise<string>\n }\n)\n\nexport const getAccount = (wallet: EthersWallet) =>\n getAccount_({\n address: wallet.address as Address,\n async signMessage(message) {\n return (await wallet.signMessage(toBytes(message))) as Hash\n },\n async signTransaction(txn) {\n return (await wallet.signTransaction({\n ...txn,\n gasLimit: txn.gas,\n })) as Hash\n },\n async signTypedData({ domain, types: types_, message }) {\n const { EIP712Domain: _, ...types } = types_ as any\n const signTypedData = wallet.signTypedData || wallet._signTypedData\n return (await signTypedData(\n domain ?? {},\n types as Record<string, TypedDataField[]>,\n message,\n )) as Hash\n },\n })\n"]}
|
package/dist/ethers.mjs
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import {
|
2
2
|
getAccount,
|
3
3
|
toBytes
|
4
|
-
} from "./chunk-
|
4
|
+
} from "./chunk-7VL5TXOM.mjs";
|
5
5
|
|
6
6
|
// src/adapters/ethers.ts
|
7
7
|
var getAccount2 = (wallet) => getAccount({
|
@@ -17,7 +17,8 @@ var getAccount2 = (wallet) => getAccount({
|
|
17
17
|
},
|
18
18
|
async signTypedData({ domain, types: types_, message }) {
|
19
19
|
const { EIP712Domain: _, ...types } = types_;
|
20
|
-
|
20
|
+
const signTypedData = wallet.signTypedData || wallet._signTypedData;
|
21
|
+
return await signTypedData(
|
21
22
|
domain ?? {},
|
22
23
|
types,
|
23
24
|
message
|
package/dist/ethers.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/adapters/ethers.ts"],"sourcesContent":["import { Address, Hash } from '../types'\nimport { getAccount as getAccount_, toBytes } from '../utils'\n\ntype BigNumberish = string | number | bigint\ntype BytesLike = string | Uint8Array\n\ntype TypedDataDomain = {\n name?: string\n version?: string\n chainId?: BigNumberish\n verifyingContract?: string\n salt?: BytesLike\n}\ntype TypedDataField = {\n name: string\n type: string\n}\n\ntype EthersWallet = {\n address: string\n signMessage(message: Uint8Array): Promise<string>\n signTransaction(txn: any): Promise<string>\n signTypedData(\n domain: TypedDataDomain,\n
|
1
|
+
{"version":3,"sources":["../src/adapters/ethers.ts"],"sourcesContent":["import { Address, Hash } from '../types'\nimport { getAccount as getAccount_, toBytes } from '../utils'\n\ntype BigNumberish = string | number | bigint\ntype BytesLike = string | Uint8Array\n\ntype TypedDataDomain = {\n name?: string\n version?: string\n chainId?: BigNumberish\n verifyingContract?: string\n salt?: BytesLike\n}\ntype TypedDataField = {\n name: string\n type: string\n}\n\ntype EthersWallet = {\n address: string\n signMessage(message: Uint8Array): Promise<string>\n signTransaction(txn: any): Promise<string>\n} & (\n | {\n signTypedData(\n domain: TypedDataDomain,\n types: Record<string, TypedDataField[]>,\n value: Record<string, any>,\n ): Promise<string>\n _signTypedData?: never\n }\n | {\n signTypedData?: never\n _signTypedData(\n domain: TypedDataDomain,\n types: Record<string, TypedDataField[]>,\n value: Record<string, any>,\n ): Promise<string>\n }\n)\n\nexport const getAccount = (wallet: EthersWallet) =>\n getAccount_({\n address: wallet.address as Address,\n async signMessage(message) {\n return (await wallet.signMessage(toBytes(message))) as Hash\n },\n async signTransaction(txn) {\n return (await wallet.signTransaction({\n ...txn,\n gasLimit: txn.gas,\n })) as Hash\n },\n async signTypedData({ domain, types: types_, message }) {\n const { EIP712Domain: _, ...types } = types_ as any\n const signTypedData = wallet.signTypedData || wallet._signTypedData\n return (await signTypedData(\n domain ?? {},\n types as Record<string, TypedDataField[]>,\n message,\n )) as Hash\n },\n })\n"],"mappings":";;;;;;AAyCO,IAAMA,cAAa,CAAC,WACzB,WAAY;AAAA,EACV,SAAS,OAAO;AAAA,EAChB,MAAM,YAAY,SAAS;AACzB,WAAQ,MAAM,OAAO,YAAY,QAAQ,OAAO,CAAC;AAAA,EACnD;AAAA,EACA,MAAM,gBAAgB,KAAK;AACzB,WAAQ,MAAM,OAAO,gBAAgB;AAAA,MACnC,GAAG;AAAA,MACH,UAAU,IAAI;AAAA,IAChB,CAAC;AAAA,EACH;AAAA,EACA,MAAM,cAAc,EAAE,QAAQ,OAAO,QAAQ,QAAQ,GAAG;AACtD,UAAM,EAAE,cAAc,GAAG,GAAG,MAAM,IAAI;AACtC,UAAM,gBAAgB,OAAO,iBAAiB,OAAO;AACrD,WAAQ,MAAM;AAAA,MACZ,UAAU,CAAC;AAAA,MACX;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF,CAAC;","names":["getAccount"]}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { AbiParameter, AbiParametersToPrimitiveTypes, Narrow, Abi } from 'abitype';
|
2
|
-
import { H as Hex,
|
2
|
+
import { H as Hex, o as ExtractNameFromAbi, E as ExtractArgsFromAbi } from './chain-1b53ef88.js';
|
3
3
|
|
4
4
|
type DecodeAbiParametersReturnType<TParams extends readonly AbiParameter[] | readonly unknown[] = readonly AbiParameter[]> = AbiParametersToPrimitiveTypes<TParams extends readonly AbiParameter[] ? TParams : AbiParameter[]>;
|
5
5
|
declare function decodeAbiParameters<TParams extends readonly AbiParameter[] | readonly unknown[]>(params: Narrow<TParams>, data: Hex): DecodeAbiParametersReturnType<TParams>;
|
package/dist/index.d.ts
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
import { T as TransportConfig, a as Transport, B as BaseRpcRequests } from './createClient-
|
2
|
-
export { C as Client, b as ClientConfig, a as Transport, T as TransportConfig, c as createClient, d as createTransport } from './createClient-
|
3
|
-
import { B as BaseError, H as HttpOptions, R as RpcResponse } from './parseGwei-
|
4
|
-
export { B as BaseError, C as CallExecutionError, a as ContractFunctionExecutionError, b as ContractFunctionRevertedError, c as ContractFunctionZeroDataError, E as EstimateGasExecutionError, d as ExecutionRevertedError, F as FeeCapTooHighError, e as FeeCapTooLowError, G as GetContractAddressOptions, o as GetCreate2AddressOptions, p as GetCreateAddressOptions, I as InsufficientFundsError, f as IntrinsicGasTooHighError, g as IntrinsicGasTooLowError, N as NonceMaxValueError, h as NonceTooHighError, i as NonceTooLowError, j as RawContractError, T as TipAboveFeeCapError, q as ToRlpReturnType, k as TransactionExecutionError, m as TransactionNotFoundError, n as TransactionReceiptNotFoundError, l as TransactionTypeNotSupportedError, U as UnknownNodeError, W as WaitForTransactionReceiptTimeoutError, r as boolToBytes, s as boolToHex, t as bytesToBigint, u as bytesToBool, v as bytesToHex, w as bytesToNumber, x as bytesToString, y as concat, z as concatBytes, A as concatHex, D as formatEther, J as formatGwei, K as formatUnits, L as fromBytes, M as fromHex, O as fromRlp, P as getAccount, Q as getAddress, S as getContractAddress, V as getContractError, X as getCreate2Address, Y as getCreateAddress, Z as getEventSelector, _ as getFunctionSelector, $ as hashMessage, a0 as hexToBigInt, a1 as hexToBool, a2 as hexToBytes, a3 as hexToNumber, a4 as hexToString, a5 as isAddress, a6 as isAddressEqual, a7 as isBytes, a8 as isHex, a9 as keccak256, aa as numberToBytes, ab as numberToHex, ac as pad, ad as padBytes, ae as padHex, af as parseEther, ag as parseGwei, ah as parseUnits, ai as recoverAddress, aj as size, ak as slice, al as sliceBytes, am as sliceHex, an as stringToBytes, ao as stringToHex, ap as stringify, aq as toBytes, ar as toHex, as as toRlp, at as trim } from './parseGwei-
|
1
|
+
import { T as TransportConfig, a as Transport, B as BaseRpcRequests } from './createClient-a28317a9.js';
|
2
|
+
export { C as Client, b as ClientConfig, a as Transport, T as TransportConfig, c as createClient, d as createTransport } from './createClient-a28317a9.js';
|
3
|
+
import { B as BaseError, H as HttpOptions, R as RpcResponse } from './parseGwei-eda6728f.js';
|
4
|
+
export { B as BaseError, C as CallExecutionError, a as ContractFunctionExecutionError, b as ContractFunctionRevertedError, c as ContractFunctionZeroDataError, E as EstimateGasExecutionError, d as ExecutionRevertedError, F as FeeCapTooHighError, e as FeeCapTooLowError, G as GetContractAddressOptions, o as GetCreate2AddressOptions, p as GetCreateAddressOptions, I as InsufficientFundsError, f as IntrinsicGasTooHighError, g as IntrinsicGasTooLowError, N as NonceMaxValueError, h as NonceTooHighError, i as NonceTooLowError, j as RawContractError, T as TipAboveFeeCapError, q as ToRlpReturnType, k as TransactionExecutionError, m as TransactionNotFoundError, n as TransactionReceiptNotFoundError, l as TransactionTypeNotSupportedError, U as UnknownNodeError, W as WaitForTransactionReceiptTimeoutError, r as boolToBytes, s as boolToHex, t as bytesToBigint, u as bytesToBool, v as bytesToHex, w as bytesToNumber, x as bytesToString, y as concat, z as concatBytes, A as concatHex, D as formatEther, J as formatGwei, K as formatUnits, L as fromBytes, M as fromHex, O as fromRlp, P as getAccount, Q as getAddress, S as getContractAddress, V as getContractError, X as getCreate2Address, Y as getCreateAddress, Z as getEventSelector, _ as getFunctionSelector, $ as hashMessage, a0 as hexToBigInt, a1 as hexToBool, a2 as hexToBytes, a3 as hexToNumber, a4 as hexToString, a5 as isAddress, a6 as isAddressEqual, a7 as isBytes, a8 as isHex, a9 as keccak256, aa as numberToBytes, ab as numberToHex, ac as pad, ad as padBytes, ae as padHex, af as parseEther, ag as parseGwei, ah as parseUnits, ai as recoverAddress, aj as size, ak as slice, al as sliceBytes, am as sliceHex, an as stringToBytes, ao as stringToHex, ap as stringify, aq as toBytes, ar as toHex, as as toRlp, at as trim } from './parseGwei-eda6728f.js';
|
5
5
|
import WebSocket from 'isomorphic-ws';
|
6
|
-
import { H as Hex, A as AbiItem, a as Hash, C as Chain, B as ByteArray } from './chain-
|
7
|
-
export { A as AbiItem, b as AccessList, c as Block, d as BlockIdentifier, e as BlockNumber, f as BlockTag, B as ByteArray, C as Chain, g as ContractConfig,
|
8
|
-
export { A as Account, B as BlockFormatter, F as FormattedBlock, e as FormattedTransactionReceipt, f as FormattedTransactionRequest, J as JsonRpcAccount, L as LocalAccount, P as PublicClient, a as PublicClientConfig, T as TransactionReceiptFormatter, g as TransactionRequestFormatter, W as WalletClient, b as WalletClientConfig, c as createPublicClient, d as createWalletClient, h as defineBlock, i as defineTransactionReceipt, j as defineTransactionRequest, k as formatBlock, l as formatTransactionRequest } from './createPublicClient-
|
9
|
-
export { T as TestClient, a as TestClientConfig, c as createTestClient } from './test-
|
6
|
+
import { H as Hex, A as AbiItem, a as Hash, C as Chain, B as ByteArray } from './chain-1b53ef88.js';
|
7
|
+
export { A as AbiItem, b as AccessList, c as Block, d as BlockIdentifier, e as BlockNumber, f as BlockTag, B as ByteArray, C as Chain, g as ContractConfig, E as ExtractArgsFromAbi, h as ExtractConstructorArgsFromAbi, i as ExtractErrorArgsFromAbi, j as ExtractErrorNameFromAbi, k as ExtractEventArgsFromAbi, l as ExtractEventArgsFromTopics, m as ExtractEventNameFromAbi, W as ExtractFormatter, n as ExtractFunctionNameFromAbi, o as ExtractNameFromAbi, p as ExtractResultFromAbi, F as FeeHistory, q as FeeValues, r as FeeValuesEIP1559, s as FeeValuesLegacy, X as Formatted, Y as FormattedTransaction, a as Hash, H as Hex, L as Log, R as RpcBlock, t as RpcBlockIdentifier, u as RpcBlockNumber, v as RpcFeeHistory, w as RpcFeeValues, x as RpcLog, y as RpcTransaction, z as RpcTransactionReceipt, D as RpcTransactionRequest, G as RpcUncle, O as Transaction, P as TransactionBase, Q as TransactionEIP1559, S as TransactionEIP2930, Z as TransactionFormatter, U as TransactionLegacy, T as TransactionReceipt, I as TransactionRequest, J as TransactionRequestBase, K as TransactionRequestEIP1559, M as TransactionRequestEIP2930, N as TransactionRequestLegacy, V as Uncle, _ as defineTransaction, $ as formatTransaction, a0 as transactionType } from './chain-1b53ef88.js';
|
8
|
+
export { A as Account, B as BlockFormatter, F as FormattedBlock, e as FormattedTransactionReceipt, f as FormattedTransactionRequest, J as JsonRpcAccount, L as LocalAccount, P as PublicClient, a as PublicClientConfig, T as TransactionReceiptFormatter, g as TransactionRequestFormatter, W as WalletClient, b as WalletClientConfig, c as createPublicClient, d as createWalletClient, h as defineBlock, i as defineTransactionReceipt, j as defineTransactionRequest, k as formatBlock, l as formatTransactionRequest } from './createPublicClient-0021fc35.js';
|
9
|
+
export { T as TestClient, a as TestClientConfig, c as createTestClient } from './test-a203fdee.js';
|
10
10
|
import { AbiParameter } from 'abitype';
|
11
11
|
export { Address, ParseAbi, ParseAbiItem, ParseAbiParameter, ParseAbiParameters, parseAbi, parseAbiItem, parseAbiParameter, parseAbiParameters } from 'abitype';
|
12
12
|
export { l as labelhash, n as namehash } from './namehash-afff0feb.js';
|
13
|
-
export { D as DecodeAbiParametersReturnType, E as EncodeAbiParametersReturnType, G as GetAbiItemParameters, d as decodeAbiParameters, e as encodeAbiParameters, g as getAbiItem } from './getAbiItem-
|
14
|
-
export { D as DecodeErrorResultParameters, a as DecodeErrorResultReturnType, b as DecodeEventLogParameters, c as DecodeEventLogReturnType, d as DecodeFunctionDataParameters, e as DecodeFunctionResultParameters, f as DecodeFunctionResultReturnType, E as EncodeDeployDataParameters, g as EncodeErrorResultParameters, h as EncodeEventTopicsParameters, i as EncodeFunctionDataParameters, j as EncodeFunctionResultParameters, k as decodeErrorResult, l as decodeEventLog, m as decodeFunctionData, n as decodeFunctionResult, o as encodeDeployData, p as encodeErrorResult, q as encodeEventTopics, r as encodeFunctionData, s as encodeFunctionResult } from './encodeFunctionResult-
|
15
|
-
export { e as encodePacked } from './encodePacked-
|
16
|
-
export { d as defineChain } from './chain-
|
17
|
-
import './eip1193-
|
13
|
+
export { D as DecodeAbiParametersReturnType, E as EncodeAbiParametersReturnType, G as GetAbiItemParameters, d as decodeAbiParameters, e as encodeAbiParameters, g as getAbiItem } from './getAbiItem-3e809ff9.js';
|
14
|
+
export { D as DecodeErrorResultParameters, a as DecodeErrorResultReturnType, b as DecodeEventLogParameters, c as DecodeEventLogReturnType, d as DecodeFunctionDataParameters, e as DecodeFunctionResultParameters, f as DecodeFunctionResultReturnType, E as EncodeDeployDataParameters, g as EncodeErrorResultParameters, h as EncodeEventTopicsParameters, i as EncodeFunctionDataParameters, j as EncodeFunctionResultParameters, k as decodeErrorResult, l as decodeEventLog, m as decodeFunctionData, n as decodeFunctionResult, o as encodeDeployData, p as encodeErrorResult, q as encodeEventTopics, r as encodeFunctionData, s as encodeFunctionResult } from './encodeFunctionResult-1f324375.js';
|
15
|
+
export { e as encodePacked } from './encodePacked-d5d5264a.js';
|
16
|
+
export { d as defineChain } from './chain-ec8c485d.js';
|
17
|
+
import './eip1193-4f4e240c.js';
|
18
18
|
import '@wagmi/chains';
|
19
19
|
|
20
20
|
declare class AbiConstructorNotFoundError extends BaseError {
|