viem 0.2.0-main.20230330T201928 → 0.2.0-main.20230403T061632
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/accounts/package.json +4 -0
- package/dist/abi.d.ts +3 -3
- package/dist/abi.js +2 -2
- package/dist/abi.mjs +1 -1
- package/dist/accounts/index.d.ts +81 -0
- package/dist/accounts/index.js +142 -0
- package/dist/accounts/index.js.map +1 -0
- package/dist/accounts/index.mjs +142 -0
- package/dist/accounts/index.mjs.map +1 -0
- package/dist/{chain-1b53ef88.d.ts → chain-5507c6f0.d.ts} +212 -148
- package/dist/{chain-ec8c485d.d.ts → chain-fe47467d.d.ts} +1 -1
- package/dist/chains.d.ts +867 -99
- package/dist/chains.js +115 -63
- package/dist/chains.js.map +1 -1
- package/dist/chains.mjs +58 -6
- package/dist/chains.mjs.map +1 -1
- package/dist/chunk-EMXJKA5P.mjs +31 -0
- package/dist/chunk-EMXJKA5P.mjs.map +1 -0
- package/dist/{chunk-LGWBVIG5.mjs → chunk-KILBOPDD.mjs} +1887 -262
- package/dist/chunk-KILBOPDD.mjs.map +1 -0
- package/dist/chunk-KQOOAYBY.js +31 -0
- package/dist/chunk-KQOOAYBY.js.map +1 -0
- package/dist/{chunk-VLSWFKRM.js → chunk-PWUNCH5G.js} +1943 -318
- package/dist/chunk-PWUNCH5G.js.map +1 -0
- package/dist/contract.d.ts +9 -7
- package/dist/contract.js +2 -2
- package/dist/contract.mjs +1 -1
- package/dist/{createTransport-e3eba9f7.d.ts → createTransport-21a0d2b3.d.ts} +24 -10
- package/dist/{eip1193-4f4e240c.d.ts → eip1193-2f3a9cd2.d.ts} +1 -1
- package/dist/{encodeFunctionResult-1f324375.d.ts → encodeFunctionResult-c5185b98.d.ts} +15 -15
- package/dist/{encodePacked-d5d5264a.d.ts → encodePacked-98f67d09.d.ts} +1 -1
- package/dist/ens.d.ts +6 -4
- package/dist/ens.js +8 -3
- package/dist/ens.js.map +1 -1
- package/dist/ens.mjs +7 -2
- package/dist/ens.mjs.map +1 -1
- package/dist/ethers.d.ts +5 -6
- package/dist/ethers.js +7 -5
- package/dist/ethers.js.map +1 -1
- package/dist/ethers.mjs +7 -5
- package/dist/ethers.mjs.map +1 -1
- package/dist/{formatAbiItem-15e8817d.d.ts → formatAbiItem-56dff508.d.ts} +1 -1
- package/dist/{getAbiItem-3e809ff9.d.ts → getAbiItem-bfba73d1.d.ts} +3 -3
- package/dist/getEnsResolver-9e26c596.d.ts +876 -0
- package/dist/index.d.ts +132 -15
- package/dist/index.js +150 -103
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +96 -49
- package/dist/index.mjs.map +1 -1
- package/dist/{parseGwei-361e8a12.d.ts → parseGwei-d2147f8b.d.ts} +95 -15
- package/dist/public.d.ts +6 -4
- package/dist/public.js +2 -2
- package/dist/public.mjs +1 -1
- package/dist/publicKeyToAddress-623eb398.d.ts +16 -0
- package/dist/test-b67569fe.d.ts +198 -0
- package/dist/test.d.ts +11 -11
- package/dist/test.js +2 -2
- package/dist/test.mjs +1 -1
- package/dist/typedData-46b4d81f.d.ts +93 -0
- package/dist/utils/index.d.ts +22 -30
- package/dist/utils/index.js +28 -2
- package/dist/utils/index.mjs +31 -5
- package/dist/wallet.d.ts +6 -4
- package/dist/wallet.js +2 -2
- package/dist/wallet.mjs +1 -1
- package/dist/window.d.ts +2 -2
- package/package.json +12 -3
- package/dist/chunk-3JK5RHC7.mjs +0 -186
- package/dist/chunk-3JK5RHC7.mjs.map +0 -1
- package/dist/chunk-LGWBVIG5.mjs.map +0 -1
- package/dist/chunk-M4VQVSC6.js +0 -186
- package/dist/chunk-M4VQVSC6.js.map +0 -1
- package/dist/chunk-VLSWFKRM.js.map +0 -1
- package/dist/createPublicClient-31d44569.d.ts +0 -841
- package/dist/test-67630299.d.ts +0 -205
package/dist/contract.d.ts
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
-
export {
|
2
|
-
export { D as
|
3
|
-
export {
|
4
|
-
export {
|
5
|
-
import './eip1193-4f4e240c.js';
|
1
|
+
export { D as DecodeAbiParametersReturnType, E as EncodeAbiParametersReturnType, G as GetAbiItemParameters, d as decodeAbiParameters, e as encodeAbiParameters, g as getAbiItem } from './getAbiItem-bfba73d1.js';
|
2
|
+
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-c5185b98.js';
|
3
|
+
export { a as formatAbiItem, f as formatAbiItemWithArgs } from './formatAbiItem-56dff508.js';
|
4
|
+
export { C as CreateContractEventFilterParameters, f as CreateContractEventFilterReturnType, D as DeployContractParameters, o as DeployContractReturnType, E as EstimateContractGasParameters, b as EstimateContractGasReturnType, z as GetBytecodeParameters, B as GetBytecodeReturnType, $ as GetStorageAtParameters, a0 as GetStorageAtReturnType, a9 as MulticallParameters, aa as MulticallReturnType, af as OnLogsFn, ag as OnLogsParameter, R as ReadContractParameters, a as ReadContractReturnType, S as SimulateContractParameters, c as SimulateContractReturnType, g as WatchContractEventParameters, d as WriteContractParameters, e as WriteContractReturnType, b4 as createContractEventFilter, bc as deployContract, b5 as estimateContractGas, b6 as getBytecode, b7 as getStorageAt, b8 as multicall, b9 as readContract, ba as simulateContract, bb as watchContractEvent, bd as writeContract } from './getEnsResolver-9e26c596.js';
|
6
5
|
import 'abitype';
|
7
|
-
import './chain-
|
6
|
+
import './chain-5507c6f0.js';
|
8
7
|
import '@wagmi/chains';
|
9
|
-
import './createTransport-
|
8
|
+
import './createTransport-21a0d2b3.js';
|
9
|
+
import './eip1193-2f3a9cd2.js';
|
10
|
+
import './typedData-46b4d81f.js';
|
11
|
+
import '@scure/bip32';
|
package/dist/contract.js
CHANGED
@@ -23,7 +23,7 @@
|
|
23
23
|
|
24
24
|
|
25
25
|
|
26
|
-
var
|
26
|
+
var _chunkPWUNCH5Gjs = require('./chunk-PWUNCH5G.js');
|
27
27
|
|
28
28
|
|
29
29
|
|
@@ -49,5 +49,5 @@ var _chunkVLSWFKRMjs = require('./chunk-VLSWFKRM.js');
|
|
49
49
|
|
50
50
|
|
51
51
|
|
52
|
-
exports.createContractEventFilter =
|
52
|
+
exports.createContractEventFilter = _chunkPWUNCH5Gjs.createContractEventFilter; exports.decodeAbiParameters = _chunkPWUNCH5Gjs.decodeAbiParameters; exports.decodeErrorResult = _chunkPWUNCH5Gjs.decodeErrorResult; exports.decodeEventLog = _chunkPWUNCH5Gjs.decodeEventLog; exports.decodeFunctionData = _chunkPWUNCH5Gjs.decodeFunctionData; exports.decodeFunctionResult = _chunkPWUNCH5Gjs.decodeFunctionResult; exports.deployContract = _chunkPWUNCH5Gjs.deployContract; exports.encodeAbiParameters = _chunkPWUNCH5Gjs.encodeAbiParameters; exports.encodeDeployData = _chunkPWUNCH5Gjs.encodeDeployData; exports.encodeErrorResult = _chunkPWUNCH5Gjs.encodeErrorResult; exports.encodeEventTopics = _chunkPWUNCH5Gjs.encodeEventTopics; exports.encodeFunctionData = _chunkPWUNCH5Gjs.encodeFunctionData; exports.encodeFunctionResult = _chunkPWUNCH5Gjs.encodeFunctionResult; exports.estimateContractGas = _chunkPWUNCH5Gjs.estimateContractGas; exports.formatAbiItem = _chunkPWUNCH5Gjs.formatAbiItem; exports.formatAbiItemWithArgs = _chunkPWUNCH5Gjs.formatAbiItemWithArgs; exports.getAbiItem = _chunkPWUNCH5Gjs.getAbiItem; exports.getBytecode = _chunkPWUNCH5Gjs.getBytecode; exports.getStorageAt = _chunkPWUNCH5Gjs.getStorageAt; exports.multicall = _chunkPWUNCH5Gjs.multicall; exports.readContract = _chunkPWUNCH5Gjs.readContract; exports.simulateContract = _chunkPWUNCH5Gjs.simulateContract; exports.watchContractEvent = _chunkPWUNCH5Gjs.watchContractEvent; exports.writeContract = _chunkPWUNCH5Gjs.writeContract;
|
53
53
|
//# sourceMappingURL=contract.js.map
|
package/dist/contract.mjs
CHANGED
@@ -1,10 +1,27 @@
|
|
1
|
-
import { R as Requests } from './eip1193-
|
2
|
-
import { C as Chain } from './chain-
|
1
|
+
import { R as Requests } from './eip1193-2f3a9cd2.js';
|
2
|
+
import { C as Chain } from './chain-5507c6f0.js';
|
3
3
|
|
4
|
-
type
|
4
|
+
type ClientConfig<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined> = {
|
5
5
|
/** Chain for the client. */
|
6
6
|
chain?: TChain;
|
7
7
|
/** A key for the client. */
|
8
|
+
key?: string;
|
9
|
+
/** A name for the client. */
|
10
|
+
name?: string;
|
11
|
+
/**
|
12
|
+
* Frequency (in ms) for polling enabled actions & events.
|
13
|
+
* @default 4_000
|
14
|
+
*/
|
15
|
+
pollingInterval?: number;
|
16
|
+
/** The RPC transport */
|
17
|
+
transport: TTransport;
|
18
|
+
/** The type of client. */
|
19
|
+
type?: string;
|
20
|
+
};
|
21
|
+
type Client<TTransport extends Transport = Transport, TRequests extends BaseRpcRequests = Requests, TChain extends Chain | undefined = Chain | undefined> = {
|
22
|
+
/** Chain for the client. */
|
23
|
+
chain: TChain;
|
24
|
+
/** A key for the client. */
|
8
25
|
key: string;
|
9
26
|
/** A name for the client. */
|
10
27
|
name: string;
|
@@ -12,20 +29,17 @@ type Client<TTransport extends Transport = Transport, TChain extends Chain = Cha
|
|
12
29
|
pollingInterval: number;
|
13
30
|
/** Request function wrapped with friendly error handling */
|
14
31
|
request: TRequests['request'];
|
15
|
-
/** The RPC transport
|
32
|
+
/** The RPC transport */
|
16
33
|
transport: ReturnType<TTransport>['config'] & ReturnType<TTransport>['value'];
|
17
34
|
/** The type of client. */
|
18
35
|
type: string;
|
19
36
|
/** A unique ID for the client. */
|
20
37
|
uid: string;
|
21
38
|
};
|
22
|
-
type ClientConfig<TTransport extends Transport = Transport, TChain extends Chain = Chain, TRequests extends BaseRpcRequests = Requests> = Partial<Pick<Client<TTransport, TChain, TRequests>, 'chain' | 'key' | 'name' | 'pollingInterval' | 'type'>> & {
|
23
|
-
transport: TTransport;
|
24
|
-
};
|
25
39
|
/**
|
26
40
|
* @description Creates a base client with the given transport.
|
27
41
|
*/
|
28
|
-
declare function createClient<TTransport extends Transport,
|
42
|
+
declare function createClient<TTransport extends Transport, TRequests extends BaseRpcRequests, TChain extends Chain | undefined = undefined>({ chain, key, name, pollingInterval, transport, type, }: ClientConfig<TTransport, TChain>): Client<TTransport, TRequests, TChain>;
|
29
43
|
|
30
44
|
type BaseRpcRequests = {
|
31
45
|
request(...args: any): Promise<any>;
|
@@ -46,7 +60,7 @@ type TransportConfig<TType extends string = string, TRequests extends BaseRpcReq
|
|
46
60
|
/** The type of the transport. */
|
47
61
|
type: TType;
|
48
62
|
};
|
49
|
-
type Transport<TType extends string = string, TRpcAttributes = Record<string, any>, TRequests extends BaseRpcRequests['request'] = Requests['request']> = <TChain extends Chain = Chain>({ chain, }: {
|
63
|
+
type Transport<TType extends string = string, TRpcAttributes = Record<string, any>, TRequests extends BaseRpcRequests['request'] = Requests['request']> = <TChain extends Chain | undefined = Chain>({ chain, }: {
|
50
64
|
chain?: TChain;
|
51
65
|
pollingInterval?: ClientConfig['pollingInterval'];
|
52
66
|
retryCount?: TransportConfig['retryCount'];
|
@@ -59,6 +73,6 @@ type Transport<TType extends string = string, TRpcAttributes = Record<string, an
|
|
59
73
|
/**
|
60
74
|
* @description Creates an transport intended to be used with a client.
|
61
75
|
*/
|
62
|
-
declare function createTransport<TType extends string
|
76
|
+
declare function createTransport<TType extends string, TRpcAttributes extends Record<string, any>>({ key, name, request, retryCount, retryDelay, timeout, type, }: TransportConfig<TType>, value?: TRpcAttributes): ReturnType<Transport<TType, TRpcAttributes>>;
|
63
77
|
|
64
78
|
export { BaseRpcRequests as B, Client as C, TransportConfig as T, Transport as a, ClientConfig as b, createClient as c, createTransport as d };
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Address } from 'abitype';
|
2
|
-
import { a as Hash,
|
2
|
+
import { a as Hash, an as Quantity, K as RpcTransactionRequest, x as RpcBlockNumber, i as BlockTag, w as RpcBlockIdentifier, H as Hex, y as RpcFeeHistory, R as RpcBlock, D as RpcLog, aq as LogTopic, E as RpcTransaction, J as RpcTransactionReceipt, N as RpcUncle } from './chain-5507c6f0.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, t as InferEventName, q as GetEventArgsFromTopics, u as InferFunctionName, r as GetFunctionArgs, k as ContractFunctionResult, G as GetConstructorArgs, s as InferErrorName, o as GetErrorArgs, p as GetEventArgs } from './chain-5507c6f0.js';
|
3
3
|
|
4
4
|
type DecodeErrorResultParameters = {
|
5
5
|
abi?: Abi;
|
@@ -15,12 +15,12 @@ declare function decodeErrorResult({ abi, data, }: DecodeErrorResultParameters):
|
|
15
15
|
type DecodeEventLogParameters<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string = string, TTopics extends Hex[] = Hex[], TData extends Hex | undefined = undefined> = {
|
16
16
|
abi: Narrow<TAbi>;
|
17
17
|
data?: TData;
|
18
|
-
eventName?:
|
18
|
+
eventName?: InferEventName<TAbi, TEventName>;
|
19
19
|
topics: [signature: Hex, ...args: TTopics] | [];
|
20
20
|
};
|
21
21
|
type DecodeEventLogReturnType<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string = string, TTopics extends Hex[] = Hex[], TData extends Hex | undefined = undefined> = {
|
22
22
|
eventName: TEventName;
|
23
|
-
} &
|
23
|
+
} & GetEventArgsFromTopics<TAbi, TEventName, TTopics, TData>;
|
24
24
|
declare function decodeEventLog<TAbi extends Abi | readonly unknown[], TEventName extends string, TTopics extends Hex[], TData extends Hex | undefined = undefined>({ abi, data, topics, }: DecodeEventLogParameters<TAbi, TEventName, TTopics, TData>): DecodeEventLogReturnType<TAbi, TEventName, TTopics, TData>;
|
25
25
|
|
26
26
|
type DecodeFunctionDataParameters = {
|
@@ -34,41 +34,41 @@ declare function decodeFunctionData({ abi, data, }: DecodeFunctionDataParameters
|
|
34
34
|
|
35
35
|
type DecodeFunctionResultParameters<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = {
|
36
36
|
abi: Narrow<TAbi>;
|
37
|
-
functionName:
|
37
|
+
functionName: InferFunctionName<TAbi, TFunctionName>;
|
38
38
|
data: Hex;
|
39
|
-
} & Partial<
|
40
|
-
type DecodeFunctionResultReturnType<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> =
|
39
|
+
} & Partial<GetFunctionArgs<TAbi, TFunctionName>>;
|
40
|
+
type DecodeFunctionResultReturnType<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = ContractFunctionResult<TAbi, TFunctionName>;
|
41
41
|
declare function decodeFunctionResult<TAbi extends Abi | readonly unknown[], TFunctionName extends string>({ abi, args, functionName, data, }: DecodeFunctionResultParameters<TAbi, TFunctionName>): DecodeFunctionResultReturnType<TAbi, TFunctionName>;
|
42
42
|
|
43
43
|
type EncodeDeployDataParameters<TAbi extends Abi | readonly unknown[] = Abi> = {
|
44
44
|
abi: Narrow<TAbi>;
|
45
45
|
bytecode: Hex;
|
46
|
-
} &
|
46
|
+
} & GetConstructorArgs<TAbi>;
|
47
47
|
declare function encodeDeployData<TAbi extends Abi | readonly unknown[]>({ abi, args, bytecode, }: EncodeDeployDataParameters<TAbi>): `0x${string}`;
|
48
48
|
|
49
49
|
type EncodeErrorResultParameters<TAbi extends Abi | readonly unknown[] = Abi, TErrorName extends string = string> = {
|
50
50
|
abi: Narrow<TAbi>;
|
51
|
-
errorName:
|
52
|
-
} &
|
51
|
+
errorName: InferErrorName<TAbi, TErrorName>;
|
52
|
+
} & GetErrorArgs<TAbi, TErrorName>;
|
53
53
|
declare function encodeErrorResult<TAbi extends Abi | readonly unknown[], TErrorName extends string>({ abi, errorName, args }: EncodeErrorResultParameters<TAbi, TErrorName>): `0x${string}`;
|
54
54
|
|
55
55
|
type EncodeEventTopicsParameters<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string = string> = {
|
56
56
|
abi: Narrow<TAbi>;
|
57
|
-
args?:
|
58
|
-
eventName:
|
57
|
+
args?: GetEventArgs<TAbi, TEventName>;
|
58
|
+
eventName: InferEventName<TAbi, TEventName>;
|
59
59
|
};
|
60
60
|
declare function encodeEventTopics<TAbi extends Abi | readonly unknown[], TEventName extends string>({ abi, eventName, args }: EncodeEventTopicsParameters<TAbi, TEventName>): `0x${string}`[];
|
61
61
|
|
62
62
|
type EncodeFunctionDataParameters<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = {
|
63
63
|
abi: Narrow<TAbi>;
|
64
|
-
functionName:
|
65
|
-
} &
|
64
|
+
functionName: InferFunctionName<TAbi, TFunctionName>;
|
65
|
+
} & GetFunctionArgs<TAbi, TFunctionName>;
|
66
66
|
declare function encodeFunctionData<TAbi extends Abi | readonly unknown[], TFunctionName extends string>({ abi, args, functionName, }: EncodeFunctionDataParameters<TAbi, TFunctionName>): `0x${string}`;
|
67
67
|
|
68
68
|
type EncodeFunctionResultParameters<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = {
|
69
69
|
abi: Narrow<TAbi>;
|
70
|
-
functionName:
|
71
|
-
result?:
|
70
|
+
functionName: InferFunctionName<TAbi, TFunctionName>;
|
71
|
+
result?: ContractFunctionResult<TAbi, TFunctionName>;
|
72
72
|
};
|
73
73
|
declare function encodeFunctionResult<TAbi extends Abi | readonly unknown[], TFunctionName extends string>({ abi, functionName, result, }: EncodeFunctionResultParameters<TAbi, TFunctionName>): `0x${string}`;
|
74
74
|
|
@@ -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-5507c6f0.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,12 @@
|
|
1
|
-
export {
|
1
|
+
export { H as GetEnsAddressParameters, I as GetEnsAddressReturnType, be as GetEnsAvatarParameters, bf as GetEnsAvatarReturnType, J as GetEnsNameParameters, K as GetEnsNameReturnType, L as GetEnsResolverParameters, M as GetEnsResolverReturnType, bg as GetEnsTextParameters, bh as GetEnsTextReturnType, bi as getEnsAddress, bj as getEnsAvatar, bk as getEnsName, bl as getEnsResolver, bm as getEnsText } from './getEnsResolver-9e26c596.js';
|
2
2
|
export { l as labelhash, n as namehash } from './namehash-afff0feb.js';
|
3
|
-
import './
|
3
|
+
import './createTransport-21a0d2b3.js';
|
4
|
+
import './eip1193-2f3a9cd2.js';
|
4
5
|
import 'abitype';
|
5
|
-
import './chain-
|
6
|
+
import './chain-5507c6f0.js';
|
6
7
|
import '@wagmi/chains';
|
7
|
-
import './
|
8
|
+
import './typedData-46b4d81f.js';
|
9
|
+
import '@scure/bip32';
|
8
10
|
|
9
11
|
/**
|
10
12
|
* @description Normalizes ENS name
|
package/dist/ens.js
CHANGED
@@ -3,8 +3,10 @@
|
|
3
3
|
|
4
4
|
|
5
5
|
|
6
|
-
|
7
|
-
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
var _chunkPWUNCH5Gjs = require('./chunk-PWUNCH5G.js');
|
8
10
|
|
9
11
|
// src/utils/ens/normalize.ts
|
10
12
|
var _idnauts46hx = require('idna-uts46-hx');
|
@@ -17,5 +19,8 @@ function normalize(name) {
|
|
17
19
|
|
18
20
|
|
19
21
|
|
20
|
-
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
exports.getEnsAddress = _chunkPWUNCH5Gjs.getEnsAddress; exports.getEnsAvatar = _chunkPWUNCH5Gjs.getEnsAvatar; exports.getEnsName = _chunkPWUNCH5Gjs.getEnsName; exports.getEnsResolver = _chunkPWUNCH5Gjs.getEnsResolver; exports.getEnsText = _chunkPWUNCH5Gjs.getEnsText; exports.labelhash = _chunkPWUNCH5Gjs.labelhash; exports.namehash = _chunkPWUNCH5Gjs.namehash; exports.normalize = normalize;
|
21
26
|
//# sourceMappingURL=ens.js.map
|
package/dist/ens.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/utils/ens/normalize.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../src/utils/ens/normalize.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,SAAS,iBAAiB;AAWnB,SAAS,UAAU,MAAc;AACtC,SAAO,UAAU,MAAM,EAAE,cAAc,KAAK,CAAC;AAC/C","sourcesContent":["import { toUnicode } from 'idna-uts46-hx'\n\n/**\n * @description Normalizes ENS name\n *\n * @example\n * normalize('wagmi-dev.eth')\n * 'wagmi-dev.eth'\n *\n * @see https://docs.ens.domains/contract-api-reference/name-processing#normalising-names\n */\nexport function normalize(name: string) {\n return toUnicode(name, { useStd3ASCII: true })\n}\n"]}
|
package/dist/ens.mjs
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
import {
|
2
2
|
getEnsAddress,
|
3
|
+
getEnsAvatar,
|
3
4
|
getEnsName,
|
5
|
+
getEnsResolver,
|
6
|
+
getEnsText,
|
4
7
|
labelhash,
|
5
8
|
namehash
|
6
|
-
} from "./chunk-
|
7
|
-
import "./chunk-LGWBVIG5.mjs";
|
9
|
+
} from "./chunk-KILBOPDD.mjs";
|
8
10
|
|
9
11
|
// src/utils/ens/normalize.ts
|
10
12
|
import { toUnicode } from "idna-uts46-hx";
|
@@ -13,7 +15,10 @@ function normalize(name) {
|
|
13
15
|
}
|
14
16
|
export {
|
15
17
|
getEnsAddress,
|
18
|
+
getEnsAvatar,
|
16
19
|
getEnsName,
|
20
|
+
getEnsResolver,
|
21
|
+
getEnsText,
|
17
22
|
labelhash,
|
18
23
|
namehash,
|
19
24
|
normalize
|
package/dist/ens.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/utils/ens/normalize.ts"],"sourcesContent":["import { toUnicode } from 'idna-uts46-hx'\n\n/**\n * @description Normalizes ENS name\n *\n * @example\n * normalize('wagmi-dev.eth')\n * 'wagmi-dev.eth'\n *\n * @see https://docs.ens.domains/contract-api-reference/name-processing#normalising-names\n */\nexport function normalize(name: string) {\n return toUnicode(name, { useStd3ASCII: true })\n}\n"],"mappings":"
|
1
|
+
{"version":3,"sources":["../src/utils/ens/normalize.ts"],"sourcesContent":["import { toUnicode } from 'idna-uts46-hx'\n\n/**\n * @description Normalizes ENS name\n *\n * @example\n * normalize('wagmi-dev.eth')\n * 'wagmi-dev.eth'\n *\n * @see https://docs.ens.domains/contract-api-reference/name-processing#normalising-names\n */\nexport function normalize(name: string) {\n return toUnicode(name, { useStd3ASCII: true })\n}\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,iBAAiB;AAWnB,SAAS,UAAU,MAAc;AACtC,SAAO,UAAU,MAAM,EAAE,cAAc,KAAK,CAAC;AAC/C;","names":[]}
|
package/dist/ethers.d.ts
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
import {
|
2
|
-
import '
|
1
|
+
import { L as LocalAccount } from './typedData-46b4d81f.js';
|
2
|
+
import '@scure/bip32';
|
3
3
|
import 'abitype';
|
4
|
-
import './chain-
|
4
|
+
import './chain-5507c6f0.js';
|
5
5
|
import '@wagmi/chains';
|
6
|
-
import './createTransport-e3eba9f7.js';
|
7
6
|
|
8
7
|
type BigNumberish = string | number | bigint;
|
9
8
|
type BytesLike = string | Uint8Array;
|
@@ -29,6 +28,6 @@ type EthersWallet = {
|
|
29
28
|
signTypedData?: never;
|
30
29
|
_signTypedData(domain: TypedDataDomain, types: Record<string, TypedDataField[]>, value: Record<string, any>): Promise<string>;
|
31
30
|
});
|
32
|
-
declare const
|
31
|
+
declare const ethersWalletToAccount: (wallet: EthersWallet) => LocalAccount<"custom", `0x${string}`>;
|
33
32
|
|
34
|
-
export {
|
33
|
+
export { ethersWalletToAccount };
|
package/dist/ethers.js
CHANGED
@@ -1,13 +1,15 @@
|
|
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
|
+
var _chunkKQOOAYBYjs = require('./chunk-KQOOAYBY.js');
|
3
4
|
|
4
|
-
|
5
|
+
|
6
|
+
var _chunkPWUNCH5Gjs = require('./chunk-PWUNCH5G.js');
|
5
7
|
|
6
8
|
// src/adapters/ethers.ts
|
7
|
-
var
|
9
|
+
var ethersWalletToAccount = (wallet) => _chunkKQOOAYBYjs.toAccount.call(void 0, {
|
8
10
|
address: wallet.address,
|
9
|
-
async signMessage(message) {
|
10
|
-
return await wallet.signMessage(
|
11
|
+
async signMessage({ message }) {
|
12
|
+
return await wallet.signMessage(_chunkPWUNCH5Gjs.toBytes.call(void 0, message));
|
11
13
|
},
|
12
14
|
async signTransaction(txn) {
|
13
15
|
return await wallet.signTransaction({
|
@@ -27,5 +29,5 @@ var getAccount2 = (wallet) => _chunkVLSWFKRMjs.getAccount.call(void 0, {
|
|
27
29
|
});
|
28
30
|
|
29
31
|
|
30
|
-
exports.
|
32
|
+
exports.ethersWalletToAccount = ethersWalletToAccount;
|
31
33
|
//# sourceMappingURL=ethers.js.map
|
package/dist/ethers.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/adapters/ethers.ts"],"names":[
|
1
|
+
{"version":3,"sources":["../src/adapters/ethers.ts"],"names":[],"mappings":";;;;;;;;AA0CO,IAAM,wBAAwB,CAAC,WACpC,UAAU;AAAA,EACR,SAAS,OAAO;AAAA,EAChB,MAAM,YAAY,EAAE,QAAQ,GAAG;AAC7B,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,gBACzB,OAAO,cAAc,KAAK,MAAM,IAChC,OAAO,eAAe,KAAK,MAAM;AACrC,WAAQ,MAAM;AAAA,MACZ,UAAU,CAAC;AAAA,MACX;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF,CAAC","sourcesContent":["import { toAccount } from '../accounts/toAccount'\nimport type { Address, Hash } from '../types'\nimport { 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 ethersWalletToAccount = (wallet: EthersWallet) =>\n toAccount({\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\n ? wallet.signTypedData.bind(wallet)\n : wallet._signTypedData.bind(wallet)\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,12 +1,14 @@
|
|
1
1
|
import {
|
2
|
-
|
2
|
+
toAccount
|
3
|
+
} from "./chunk-EMXJKA5P.mjs";
|
4
|
+
import {
|
3
5
|
toBytes
|
4
|
-
} from "./chunk-
|
6
|
+
} from "./chunk-KILBOPDD.mjs";
|
5
7
|
|
6
8
|
// src/adapters/ethers.ts
|
7
|
-
var
|
9
|
+
var ethersWalletToAccount = (wallet) => toAccount({
|
8
10
|
address: wallet.address,
|
9
|
-
async signMessage(message) {
|
11
|
+
async signMessage({ message }) {
|
10
12
|
return await wallet.signMessage(toBytes(message));
|
11
13
|
},
|
12
14
|
async signTransaction(txn) {
|
@@ -26,6 +28,6 @@ var getAccount2 = (wallet) => getAccount({
|
|
26
28
|
}
|
27
29
|
});
|
28
30
|
export {
|
29
|
-
|
31
|
+
ethersWalletToAccount
|
30
32
|
};
|
31
33
|
//# sourceMappingURL=ethers.mjs.map
|
package/dist/ethers.mjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../src/adapters/ethers.ts"],"sourcesContent":["import type { Address, Hash } from '../types'\nimport {
|
1
|
+
{"version":3,"sources":["../src/adapters/ethers.ts"],"sourcesContent":["import { toAccount } from '../accounts/toAccount'\nimport type { Address, Hash } from '../types'\nimport { 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 ethersWalletToAccount = (wallet: EthersWallet) =>\n toAccount({\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\n ? wallet.signTypedData.bind(wallet)\n : wallet._signTypedData.bind(wallet)\n return (await signTypedData(\n domain ?? {},\n types as Record<string, TypedDataField[]>,\n message,\n )) as Hash\n },\n })\n"],"mappings":";;;;;;;;AA0CO,IAAM,wBAAwB,CAAC,WACpC,UAAU;AAAA,EACR,SAAS,OAAO;AAAA,EAChB,MAAM,YAAY,EAAE,QAAQ,GAAG;AAC7B,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,gBACzB,OAAO,cAAc,KAAK,MAAM,IAChC,OAAO,eAAe,KAAK,MAAM;AACrC,WAAQ,MAAM;AAAA,MACZ,UAAU,CAAC;AAAA,MACX;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF,CAAC;","names":[]}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { AbiParameter, AbiParametersToPrimitiveTypes, Narrow, Abi } from 'abitype';
|
2
|
-
import { H as Hex,
|
2
|
+
import { H as Hex, v as InferItemName, r as GetFunctionArgs } from './chain-5507c6f0.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>;
|
@@ -12,8 +12,8 @@ declare function encodeAbiParameters<TParams extends readonly AbiParameter[] | r
|
|
12
12
|
|
13
13
|
type GetAbiItemParameters<TAbi extends Abi | readonly unknown[] = Abi, TItemName extends string = string> = {
|
14
14
|
abi: Narrow<TAbi>;
|
15
|
-
name:
|
16
|
-
} & Partial<
|
15
|
+
name: InferItemName<TAbi, TItemName>;
|
16
|
+
} & Partial<GetFunctionArgs<TAbi, TItemName>>;
|
17
17
|
type GetAbiItemReturnType<TAbi extends Abi | readonly unknown[] = Abi, TItemName extends string = string> = Extract<TAbi[number], {
|
18
18
|
name: TItemName;
|
19
19
|
}>;
|