viem 0.0.1-alpha.13 → 0.0.1-alpha.15
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/chains.js +5 -5
- package/dist/chains.mjs +1 -1
- package/dist/{chunk-4XV4JRFM.mjs → chunk-2HENAFQN.mjs} +16 -6
- package/dist/{chunk-O3XABJRL.js → chunk-EMQSYKNY.js} +11 -11
- package/dist/{chunk-OHOJCVQD.js → chunk-HTYEJEWI.js} +156 -529
- package/dist/chunk-IMYI7Z6M.js +255 -0
- package/dist/chunk-KGXH5DYI.js +152 -0
- package/dist/chunk-NYXBQHNJ.mjs +255 -0
- package/dist/chunk-PHAG5KUF.mjs +152 -0
- package/dist/{chunk-NJ5NFIT4.mjs → chunk-PPDHFNFM.mjs} +107 -480
- package/dist/{chunk-AGF7GU6G.js → chunk-QMLDI5JU.js} +16 -6
- package/dist/{chunk-KZVBHS2T.mjs → chunk-SX7GPOCZ.mjs} +1 -1
- package/dist/clients/index.d.ts +6 -3
- package/dist/clients/index.js +3 -3
- package/dist/clients/index.mjs +2 -2
- package/dist/createClient-cd948138.d.ts +62 -0
- package/dist/createPublicClient-989a0556.d.ts +19 -0
- package/dist/createTestClient-81507f58.d.ts +34 -0
- package/dist/createWalletClient-43f801b9.d.ts +30 -0
- package/dist/{eip1193-c001fcd5.d.ts → eip1193-4330b722.d.ts} +1 -1
- package/dist/index.d.ts +13 -6
- package/dist/index.js +10 -4
- package/dist/index.mjs +35 -29
- package/dist/{parseGwei-21f98a29.d.ts → parseGwei-f2d23de6.d.ts} +1 -1
- package/dist/public.d.ts +12 -0
- package/dist/public.js +58 -0
- package/dist/public.mjs +58 -0
- package/dist/sendTransaction-7a9d241a.d.ts +13 -0
- package/dist/stopImpersonatingAccount-8113150e.d.ts +156 -0
- package/dist/test.d.ts +7 -0
- package/dist/test.js +59 -0
- package/dist/test.mjs +59 -0
- package/dist/{transactionRequest-1d4e4385.d.ts → transactionReceipt-5d332aab.d.ts} +4 -32
- package/dist/transactionRequest-327eb7c2.d.ts +33 -0
- package/dist/utils/index.d.ts +4 -3
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.mjs +1 -1
- package/dist/wallet.d.ts +9 -0
- package/dist/wallet.js +23 -0
- package/dist/wallet.mjs +23 -0
- package/dist/watchAsset-0088384c.d.ts +39 -0
- package/dist/{stopImpersonatingAccount-70c4a70c.d.ts → watchPendingTransactions-670a7ca3.d.ts} +19 -197
- package/dist/{webSocket-3385e295.d.ts → webSocket-9a3b0b26.d.ts} +1 -1
- package/dist/window.d.ts +1 -1
- package/package.json +16 -6
- package/actions/package.json +0 -4
- package/dist/actions/index.d.ts +0 -8
- package/dist/actions/index.js +0 -127
- package/dist/actions/index.mjs +0 -127
- package/dist/createWalletClient-3f9fa8b6.d.ts +0 -130
@@ -0,0 +1,13 @@
|
|
1
|
+
import { Formatter, Chain } from './chains.js';
|
2
|
+
import { M as MergeIntersectionProperties, v as TransactionRequest, a as Hash } from './rpc-b77c5aee.js';
|
3
|
+
import { W as WalletClient } from './createWalletClient-43f801b9.js';
|
4
|
+
import { a as Formatted, T as TransactionRequestFormatter } from './transactionRequest-327eb7c2.js';
|
5
|
+
|
6
|
+
type FormattedTransactionRequest<TFormatter extends Formatter | undefined = Formatter> = MergeIntersectionProperties<Formatted<TFormatter, TransactionRequest, true>, TransactionRequest>;
|
7
|
+
type SendTransactionArgs<TChain extends Chain = Chain> = FormattedTransactionRequest<TransactionRequestFormatter<TChain>> & {
|
8
|
+
chain?: TChain;
|
9
|
+
};
|
10
|
+
type SendTransactionResponse = Hash;
|
11
|
+
declare function sendTransaction<TChain extends Chain>(client: WalletClient, { chain, from, accessList, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, ...rest }: SendTransactionArgs<TChain>): Promise<SendTransactionResponse>;
|
12
|
+
|
13
|
+
export { FormattedTransactionRequest as F, SendTransactionArgs as S, SendTransactionResponse as a, sendTransaction as s };
|
@@ -0,0 +1,156 @@
|
|
1
|
+
import { a as Hash, q as RpcTransaction, A as Address, Q as Quantity, v as TransactionRequest, H as Hex } from './rpc-b77c5aee.js';
|
2
|
+
import { T as TestClient } from './createTestClient-81507f58.js';
|
3
|
+
|
4
|
+
type DropTransactionArgs = {
|
5
|
+
/** The hash of the transaction to drop. */
|
6
|
+
hash: Hash;
|
7
|
+
};
|
8
|
+
declare function dropTransaction(client: TestClient, { hash }: DropTransactionArgs): Promise<void>;
|
9
|
+
|
10
|
+
type GetAutomineResponse = boolean;
|
11
|
+
declare function getAutomine(client: TestClient): Promise<GetAutomineResponse>;
|
12
|
+
|
13
|
+
declare function getTxpoolContent(client: TestClient): Promise<{
|
14
|
+
pending: Record<`0x${string}`, Record<string, RpcTransaction>>;
|
15
|
+
queued: Record<`0x${string}`, Record<string, RpcTransaction>>;
|
16
|
+
}>;
|
17
|
+
|
18
|
+
declare function getTxpoolStatus(client: TestClient): Promise<{
|
19
|
+
pending: number;
|
20
|
+
queued: number;
|
21
|
+
}>;
|
22
|
+
|
23
|
+
type ImpersonateAccountArgs = {
|
24
|
+
/** The account to impersonate. */
|
25
|
+
address: Address;
|
26
|
+
};
|
27
|
+
declare function impersonateAccount(client: TestClient, { address }: ImpersonateAccountArgs): Promise<void>;
|
28
|
+
|
29
|
+
type IncreaseTimeArgs = {
|
30
|
+
/** The amount of seconds to jump forward in time. */
|
31
|
+
seconds: number;
|
32
|
+
};
|
33
|
+
declare function increaseTime(client: TestClient, { seconds }: IncreaseTimeArgs): Promise<`0x${string}`>;
|
34
|
+
|
35
|
+
declare function inspectTxpool(client: TestClient): Promise<{
|
36
|
+
pending: Record<`0x${string}`, Record<string, string>>;
|
37
|
+
queued: Record<`0x${string}`, Record<string, string>>;
|
38
|
+
}>;
|
39
|
+
|
40
|
+
type MineArgs = {
|
41
|
+
/** Number of blocks to mine. */
|
42
|
+
blocks: number;
|
43
|
+
/** Interval between each block in seconds. */
|
44
|
+
interval?: number;
|
45
|
+
};
|
46
|
+
declare function mine(client: TestClient, { blocks, interval }: MineArgs): Promise<void>;
|
47
|
+
|
48
|
+
declare function removeBlockTimestampInterval(client: TestClient): Promise<void>;
|
49
|
+
|
50
|
+
type ResetArgs = {
|
51
|
+
/** The block number to reset from. */
|
52
|
+
blockNumber?: bigint;
|
53
|
+
/** The JSON RPC URL. */
|
54
|
+
jsonRpcUrl?: string;
|
55
|
+
};
|
56
|
+
declare function reset(client: TestClient, { blockNumber, jsonRpcUrl }?: ResetArgs): Promise<void>;
|
57
|
+
|
58
|
+
type RevertArgs = {
|
59
|
+
/** The snapshot ID to revert to. */
|
60
|
+
id: Quantity;
|
61
|
+
};
|
62
|
+
declare function revert(client: TestClient, { id }: RevertArgs): Promise<void>;
|
63
|
+
|
64
|
+
type SendUnsignedTransactionArgs = TransactionRequest;
|
65
|
+
type SendUnsignedTransactionResponse = Hash;
|
66
|
+
declare function sendUnsignedTransaction(client: TestClient, request: SendUnsignedTransactionArgs): Promise<SendUnsignedTransactionResponse>;
|
67
|
+
|
68
|
+
declare function setAutomine(client: TestClient, enabled: boolean): Promise<void>;
|
69
|
+
|
70
|
+
type SetBalanceArgs = {
|
71
|
+
/** The account address. */
|
72
|
+
address: Address;
|
73
|
+
/** Amount (in wei) to set */
|
74
|
+
value: bigint;
|
75
|
+
};
|
76
|
+
declare function setBalance(client: TestClient, { address, value }: SetBalanceArgs): Promise<void>;
|
77
|
+
|
78
|
+
type SetBlockGasLimitArgs = {
|
79
|
+
/** Gas limit (in wei). */
|
80
|
+
gasLimit: bigint;
|
81
|
+
};
|
82
|
+
declare function setBlockGasLimit(client: TestClient, { gasLimit }: SetBlockGasLimitArgs): Promise<void>;
|
83
|
+
|
84
|
+
type SetBlockTimestampIntervalArgs = {
|
85
|
+
/** The interval (in seconds). */
|
86
|
+
interval: number;
|
87
|
+
};
|
88
|
+
declare function setBlockTimestampInterval(client: TestClient, { interval }: SetBlockTimestampIntervalArgs): Promise<void>;
|
89
|
+
|
90
|
+
type SetCodeArgs = {
|
91
|
+
/** The account address. */
|
92
|
+
address: Address;
|
93
|
+
/** The bytecode to set */
|
94
|
+
bytecode: Hex;
|
95
|
+
};
|
96
|
+
declare function setCode(client: TestClient, { address, bytecode }: SetCodeArgs): Promise<void>;
|
97
|
+
|
98
|
+
type SetCoinbaseArgs = {
|
99
|
+
/** The coinbase address. */
|
100
|
+
address: Address;
|
101
|
+
};
|
102
|
+
declare function setCoinbase(client: TestClient, { address }: SetCoinbaseArgs): Promise<void>;
|
103
|
+
|
104
|
+
type SetIntervalMiningArgs = {
|
105
|
+
/** The mining interval. */
|
106
|
+
interval: number;
|
107
|
+
};
|
108
|
+
declare function setIntervalMining(client: TestClient, { interval }: SetIntervalMiningArgs): Promise<void>;
|
109
|
+
|
110
|
+
declare function setLoggingEnabled(client: TestClient, enabled: boolean): Promise<void>;
|
111
|
+
|
112
|
+
type SetMinGasPriceArgs = {
|
113
|
+
/** The gas price. */
|
114
|
+
gasPrice: bigint;
|
115
|
+
};
|
116
|
+
declare function setMinGasPrice(client: TestClient, { gasPrice }: SetMinGasPriceArgs): Promise<void>;
|
117
|
+
|
118
|
+
type SetNextBlockBaseFeePerGasArgs = {
|
119
|
+
/** Base fee per gas (in wei). */
|
120
|
+
baseFeePerGas: bigint;
|
121
|
+
};
|
122
|
+
declare function setNextBlockBaseFeePerGas(client: TestClient, { baseFeePerGas }: SetNextBlockBaseFeePerGasArgs): Promise<void>;
|
123
|
+
|
124
|
+
type SetNextBlockTimestampArgs = {
|
125
|
+
/** The timestamp (in seconds). */
|
126
|
+
timestamp: bigint;
|
127
|
+
};
|
128
|
+
declare function setNextBlockTimestamp(client: TestClient, { timestamp }: SetNextBlockTimestampArgs): Promise<void>;
|
129
|
+
|
130
|
+
type SetNonceArgs = {
|
131
|
+
/** The account address. */
|
132
|
+
address: Address;
|
133
|
+
/** The nonce to set. */
|
134
|
+
nonce: number;
|
135
|
+
};
|
136
|
+
declare function setNonce(client: TestClient, { address, nonce }: SetNonceArgs): Promise<void>;
|
137
|
+
|
138
|
+
type SetStorageAtArgs = {
|
139
|
+
/** The account address. */
|
140
|
+
address: Address;
|
141
|
+
/** The storage slot (index). Can either be a number or hash value. */
|
142
|
+
index: number | Hash;
|
143
|
+
/** The value to store as a 32 byte hex string. */
|
144
|
+
value: Hex;
|
145
|
+
};
|
146
|
+
declare function setStorageAt(client: TestClient, { address, index, value }: SetStorageAtArgs): Promise<void>;
|
147
|
+
|
148
|
+
declare function snapshot(client: TestClient): Promise<`0x${string}`>;
|
149
|
+
|
150
|
+
type StopImpersonatingAccountArgs = {
|
151
|
+
/** The account to impersonate. */
|
152
|
+
address: Address;
|
153
|
+
};
|
154
|
+
declare function stopImpersonatingAccount(client: TestClient, { address }: StopImpersonatingAccountArgs): Promise<void>;
|
155
|
+
|
156
|
+
export { sendUnsignedTransaction as A, setAutomine as B, setBalance as C, DropTransactionArgs as D, setBlockGasLimit as E, setBlockTimestampInterval as F, setCode as G, setCoinbase as H, ImpersonateAccountArgs as I, setIntervalMining as J, setLoggingEnabled as K, setMinGasPrice as L, MineArgs as M, setNextBlockBaseFeePerGas as N, setNextBlockTimestamp as O, setNonce as P, setStorageAt as Q, ResetArgs as R, SendUnsignedTransactionArgs as S, snapshot as T, stopImpersonatingAccount as U, IncreaseTimeArgs as a, RevertArgs as b, SendUnsignedTransactionResponse as c, SetBalanceArgs as d, SetBlockGasLimitArgs as e, SetCodeArgs as f, SetCoinbaseArgs as g, SetIntervalMiningArgs as h, SetMinGasPriceArgs as i, SetBlockTimestampIntervalArgs as j, SetNextBlockTimestampArgs as k, SetNextBlockBaseFeePerGasArgs as l, SetNonceArgs as m, SetStorageAtArgs as n, StopImpersonatingAccountArgs as o, dropTransaction as p, getAutomine as q, getTxpoolContent as r, getTxpoolStatus as s, impersonateAccount as t, increaseTime as u, inspectTxpool as v, mine as w, removeBlockTimestampInterval as x, reset as y, revert as z };
|
package/dist/test.d.ts
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
export { D as DropTransactionArgs, I as ImpersonateAccountArgs, a as IncreaseTimeArgs, M as MineArgs, R as ResetArgs, b as RevertArgs, S as SendUnsignedTransactionArgs, c as SendUnsignedTransactionResponse, d as SetBalanceArgs, e as SetBlockGasLimitArgs, j as SetBlockTimestampIntervalArgs, f as SetCodeArgs, g as SetCoinbaseArgs, h as SetIntervalMiningArgs, i as SetMinGasPriceArgs, l as SetNextBlockBaseFeePerGasArgs, k as SetNextBlockTimestampArgs, m as SetNonceArgs, n as SetStorageAtArgs, o as StopImpersonatingAccountArgs, p as dropTransaction, q as getAutomine, r as getTxpoolContent, s as getTxpoolStatus, t as impersonateAccount, u as increaseTime, v as inspectTxpool, w as mine, x as removeBlockTimestampInterval, y as reset, z as revert, A as sendUnsignedTransaction, B as setAutomine, C as setBalance, E as setBlockGasLimit, F as setBlockTimestampInterval, G as setCode, H as setCoinbase, J as setIntervalMining, K as setLoggingEnabled, L as setMinGasPrice, N as setNextBlockBaseFeePerGas, O as setNextBlockTimestamp, P as setNonce, Q as setStorageAt, T as snapshot, U as stopImpersonatingAccount } from './stopImpersonatingAccount-8113150e.js';
|
2
|
+
import './rpc-b77c5aee.js';
|
3
|
+
import './createTestClient-81507f58.js';
|
4
|
+
import './eip1193-4330b722.js';
|
5
|
+
import './createClient-cd948138.js';
|
6
|
+
import './chains.js';
|
7
|
+
import '@wagmi/chains';
|
package/dist/test.js
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
var _chunkIMYI7Z6Mjs = require('./chunk-IMYI7Z6M.js');
|
30
|
+
require('./chunk-QMLDI5JU.js');
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
exports.dropTransaction = _chunkIMYI7Z6Mjs.dropTransaction; exports.getAutomine = _chunkIMYI7Z6Mjs.getAutomine; exports.getTxpoolContent = _chunkIMYI7Z6Mjs.getTxpoolContent; exports.getTxpoolStatus = _chunkIMYI7Z6Mjs.getTxpoolStatus; exports.impersonateAccount = _chunkIMYI7Z6Mjs.impersonateAccount; exports.increaseTime = _chunkIMYI7Z6Mjs.increaseTime; exports.inspectTxpool = _chunkIMYI7Z6Mjs.inspectTxpool; exports.mine = _chunkIMYI7Z6Mjs.mine; exports.removeBlockTimestampInterval = _chunkIMYI7Z6Mjs.removeBlockTimestampInterval; exports.reset = _chunkIMYI7Z6Mjs.reset; exports.revert = _chunkIMYI7Z6Mjs.revert; exports.sendUnsignedTransaction = _chunkIMYI7Z6Mjs.sendUnsignedTransaction; exports.setAutomine = _chunkIMYI7Z6Mjs.setAutomine; exports.setBalance = _chunkIMYI7Z6Mjs.setBalance; exports.setBlockGasLimit = _chunkIMYI7Z6Mjs.setBlockGasLimit; exports.setBlockTimestampInterval = _chunkIMYI7Z6Mjs.setBlockTimestampInterval; exports.setCode = _chunkIMYI7Z6Mjs.setCode; exports.setCoinbase = _chunkIMYI7Z6Mjs.setCoinbase; exports.setIntervalMining = _chunkIMYI7Z6Mjs.setIntervalMining; exports.setLoggingEnabled = _chunkIMYI7Z6Mjs.setLoggingEnabled; exports.setMinGasPrice = _chunkIMYI7Z6Mjs.setMinGasPrice; exports.setNextBlockBaseFeePerGas = _chunkIMYI7Z6Mjs.setNextBlockBaseFeePerGas; exports.setNextBlockTimestamp = _chunkIMYI7Z6Mjs.setNextBlockTimestamp; exports.setNonce = _chunkIMYI7Z6Mjs.setNonce; exports.setStorageAt = _chunkIMYI7Z6Mjs.setStorageAt; exports.snapshot = _chunkIMYI7Z6Mjs.snapshot; exports.stopImpersonatingAccount = _chunkIMYI7Z6Mjs.stopImpersonatingAccount;
|
package/dist/test.mjs
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
import {
|
2
|
+
dropTransaction,
|
3
|
+
getAutomine,
|
4
|
+
getTxpoolContent,
|
5
|
+
getTxpoolStatus,
|
6
|
+
impersonateAccount,
|
7
|
+
increaseTime,
|
8
|
+
inspectTxpool,
|
9
|
+
mine,
|
10
|
+
removeBlockTimestampInterval,
|
11
|
+
reset,
|
12
|
+
revert,
|
13
|
+
sendUnsignedTransaction,
|
14
|
+
setAutomine,
|
15
|
+
setBalance,
|
16
|
+
setBlockGasLimit,
|
17
|
+
setBlockTimestampInterval,
|
18
|
+
setCode,
|
19
|
+
setCoinbase,
|
20
|
+
setIntervalMining,
|
21
|
+
setLoggingEnabled,
|
22
|
+
setMinGasPrice,
|
23
|
+
setNextBlockBaseFeePerGas,
|
24
|
+
setNextBlockTimestamp,
|
25
|
+
setNonce,
|
26
|
+
setStorageAt,
|
27
|
+
snapshot,
|
28
|
+
stopImpersonatingAccount
|
29
|
+
} from "./chunk-NYXBQHNJ.mjs";
|
30
|
+
import "./chunk-2HENAFQN.mjs";
|
31
|
+
export {
|
32
|
+
dropTransaction,
|
33
|
+
getAutomine,
|
34
|
+
getTxpoolContent,
|
35
|
+
getTxpoolStatus,
|
36
|
+
impersonateAccount,
|
37
|
+
increaseTime,
|
38
|
+
inspectTxpool,
|
39
|
+
mine,
|
40
|
+
removeBlockTimestampInterval,
|
41
|
+
reset,
|
42
|
+
revert,
|
43
|
+
sendUnsignedTransaction,
|
44
|
+
setAutomine,
|
45
|
+
setBalance,
|
46
|
+
setBlockGasLimit,
|
47
|
+
setBlockTimestampInterval,
|
48
|
+
setCode,
|
49
|
+
setCoinbase,
|
50
|
+
setIntervalMining,
|
51
|
+
setLoggingEnabled,
|
52
|
+
setMinGasPrice,
|
53
|
+
setNextBlockBaseFeePerGas,
|
54
|
+
setNextBlockTimestamp,
|
55
|
+
setNonce,
|
56
|
+
setStorageAt,
|
57
|
+
snapshot,
|
58
|
+
stopImpersonatingAccount
|
59
|
+
};
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { Abi, AbiFunction, ExtractAbiFunction, AbiParametersToPrimitiveTypes, AbiError, ExtractAbiError, AbiEvent, ExtractAbiEvent, AbiStateMutability, ExtractAbiFunctionNames, AbiParameter, AbiParameterToPrimitiveType } from 'abitype';
|
2
|
-
import { v as TransactionRequest,
|
3
|
-
import { Chain,
|
2
|
+
import { v as TransactionRequest, d as Block, R as RpcBlock, D as Transaction, q as RpcTransaction, T as TransactionReceipt } from './rpc-b77c5aee.js';
|
3
|
+
import { Chain, Formatters, Formatter } from './chains.js';
|
4
|
+
import { E as ExtractFormatter, a as Formatted } from './transactionRequest-327eb7c2.js';
|
4
5
|
|
5
6
|
type AbiItem = Abi[number];
|
6
7
|
type AbiEventParametersToPrimitiveTypes<TAbiParameters extends readonly AbiParameter[], TBase = TAbiParameters[0] extends {
|
@@ -89,31 +90,6 @@ type GetValue<TAbi extends Abi | readonly unknown[], TFunctionName extends strin
|
|
89
90
|
type: 'function';
|
90
91
|
}> = TAbiFunction['stateMutability'] extends 'payable' ? TValueType : TAbiFunction['payable'] extends true ? TValueType : never;
|
91
92
|
|
92
|
-
type ExtractFormatter<TChain extends Chain, TKey extends keyof NonNullable<TChain['formatters']>, TFallbackFormatter extends Formatter = Formatter> = NonNullable<TChain['formatters']>[TKey] extends NonNullable<unknown> ? NonNullable<TChain['formatters']>[TKey] : TFallbackFormatter;
|
93
|
-
type FormatOptions<TSource, TTarget> = {
|
94
|
-
formatter: Formatter<TSource, TTarget>;
|
95
|
-
};
|
96
|
-
/**
|
97
|
-
* Creates a type that is the result of applying `TFormatter` to `TSource`.
|
98
|
-
*
|
99
|
-
* @example
|
100
|
-
* Formatted<() => { a: undefined, b: bigint }, { a: bigint }>
|
101
|
-
* => { a: undefined, b: bigint }
|
102
|
-
*
|
103
|
-
* @example
|
104
|
-
* Formatted<() => {}, { a: bigint }>
|
105
|
-
* => { a: bigint }
|
106
|
-
*
|
107
|
-
* @example
|
108
|
-
* Formatted<() => { a: bigint | undefined, b: bigint }, { a: bigint, b: bigint }, true>
|
109
|
-
* => { a?: bigint | undefined, b: bigint }
|
110
|
-
*/
|
111
|
-
type Formatted<TFormatter, TFallback, TAllowOptional = false> = TFormatter extends Formatter ? ReturnType<TFormatter> extends Record<string, never> ? TFallback : TAllowOptional extends true ? OptionalNullable<ReturnType<TFormatter>> : ReturnType<TFormatter> : never;
|
112
|
-
/**
|
113
|
-
* @description Formats a data object using the given replacer and an optional formatter.
|
114
|
-
*/
|
115
|
-
declare function format<TFormatter, TSource extends Record<string, any>, TTarget>(data: TSource, { formatter }: FormatOptions<TSource, TTarget>): Formatted<TFormatter, TTarget, false>;
|
116
|
-
|
117
93
|
type BlockFormatter<TChain extends Chain = Chain> = ExtractFormatter<TChain, 'block', NonNullable<Formatters['block']>>;
|
118
94
|
type FormattedBlock<TFormatter extends Formatter | undefined = Formatter> = Formatted<TFormatter, Block>;
|
119
95
|
declare function formatBlock(block: Partial<RpcBlock>): Block<bigint, Transaction<bigint, number>>;
|
@@ -125,8 +101,4 @@ declare function formatTransaction(transaction: Partial<RpcTransaction>): Transa
|
|
125
101
|
type TransactionReceiptFormatter<TChain extends Chain = Chain> = ExtractFormatter<TChain, 'transactionReceipt', NonNullable<Formatters['transactionReceipt']>>;
|
126
102
|
type FormattedTransactionReceipt<TFormatter extends Formatter | undefined = Formatter> = Formatted<TFormatter, TransactionReceipt>;
|
127
103
|
|
128
|
-
|
129
|
-
type FormattedTransactionRequest<TFormatter extends Formatter | undefined = Formatter> = Formatted<TFormatter, RpcTransactionRequest>;
|
130
|
-
declare function formatTransactionRequest(transactionRequest: Partial<TransactionRequest>): RpcTransactionRequest;
|
131
|
-
|
132
|
-
export { AbiItem as A, BlockFormatter as B, ExtractFunctionNameFromAbi as E, FormattedBlock as F, GetValue as G, TransactionRequestFormatter as T, FormattedTransaction as a, FormattedTransactionRequest as b, formatTransaction as c, formatTransactionRequest as d, Formatted as e, formatBlock as f, ExtractArgsFromAbi as g, ExtractResultFromAbi as h, ExtractConstructorArgsFromAbi as i, TransactionFormatter as j, FormattedTransactionReceipt as k, TransactionReceiptFormatter as l, ExtractFormatter as m, ExtractErrorArgsFromAbi as n, ExtractEventArgsFromAbi as o, format as p };
|
104
|
+
export { AbiItem as A, BlockFormatter as B, ExtractFunctionNameFromAbi as E, FormattedBlock as F, GetValue as G, TransactionFormatter as T, FormattedTransaction as a, formatTransaction as b, ExtractArgsFromAbi as c, ExtractResultFromAbi as d, ExtractConstructorArgsFromAbi as e, formatBlock as f, FormattedTransactionReceipt as g, TransactionReceiptFormatter as h, ExtractErrorArgsFromAbi as i, ExtractEventArgsFromAbi as j };
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { Chain, Formatter, Formatters } from './chains.js';
|
2
|
+
import { O as OptionalNullable, s as RpcTransactionRequest, v as TransactionRequest } from './rpc-b77c5aee.js';
|
3
|
+
|
4
|
+
type ExtractFormatter<TChain extends Chain, TKey extends keyof NonNullable<TChain['formatters']>, TFallbackFormatter extends Formatter = Formatter> = NonNullable<TChain['formatters']>[TKey] extends NonNullable<unknown> ? NonNullable<TChain['formatters']>[TKey] : TFallbackFormatter;
|
5
|
+
type FormatOptions<TSource, TTarget> = {
|
6
|
+
formatter: Formatter<TSource, TTarget>;
|
7
|
+
};
|
8
|
+
/**
|
9
|
+
* Creates a type that is the result of applying `TFormatter` to `TSource`.
|
10
|
+
*
|
11
|
+
* @example
|
12
|
+
* Formatted<() => { a: undefined, b: bigint }, { a: bigint }>
|
13
|
+
* => { a: undefined, b: bigint }
|
14
|
+
*
|
15
|
+
* @example
|
16
|
+
* Formatted<() => {}, { a: bigint }>
|
17
|
+
* => { a: bigint }
|
18
|
+
*
|
19
|
+
* @example
|
20
|
+
* Formatted<() => { a: bigint | undefined, b: bigint }, { a: bigint, b: bigint }, true>
|
21
|
+
* => { a?: bigint | undefined, b: bigint }
|
22
|
+
*/
|
23
|
+
type Formatted<TFormatter, TFallback, TAllowOptional = false> = TFormatter extends Formatter ? ReturnType<TFormatter> extends Record<string, never> ? TFallback : TAllowOptional extends true ? OptionalNullable<ReturnType<TFormatter>> : ReturnType<TFormatter> : never;
|
24
|
+
/**
|
25
|
+
* @description Formats a data object using the given replacer and an optional formatter.
|
26
|
+
*/
|
27
|
+
declare function format<TFormatter, TSource extends Record<string, any>, TTarget>(data: TSource, { formatter }: FormatOptions<TSource, TTarget>): Formatted<TFormatter, TTarget, false>;
|
28
|
+
|
29
|
+
type TransactionRequestFormatter<TChain extends Chain = Chain> = ExtractFormatter<TChain, 'transactionRequest', NonNullable<Formatters['transactionRequest']>>;
|
30
|
+
type FormattedTransactionRequest<TFormatter extends Formatter | undefined = Formatter> = Formatted<TFormatter, RpcTransactionRequest>;
|
31
|
+
declare function formatTransactionRequest(transactionRequest: Partial<TransactionRequest>): RpcTransactionRequest;
|
32
|
+
|
33
|
+
export { ExtractFormatter as E, FormattedTransactionRequest as F, TransactionRequestFormatter as T, Formatted as a, format as b, formatTransactionRequest as f };
|
package/dist/utils/index.d.ts
CHANGED
@@ -1,10 +1,11 @@
|
|
1
|
-
export { D as DecodeAbiArgs, a as DecodeErrorResultArgs, b as DecodeFunctionDataArgs, c as DecodeFunctionResultArgs, d as DecodeFunctionResultResponse, E as EncodeAbiArgs, e as EncodeDeployDataArgs, f as EncodeErrorResultArgs, g as EncodeEventTopicsArgs, h as EncodeFunctionDataArgs, i as EncodeFunctionResultArgs, l as EncodeRlpResponse, G as GetContractAddressOptions, k as GetCreate2AddressOptions, j as GetCreateAddressOptions, o as boolToBytes, p as boolToHex, q as bytesToBigint, r as bytesToBool, m as bytesToHex, s as bytesToNumber, n as bytesToString, t as decodeAbi, u as decodeBytes, v as decodeErrorResult, w as decodeFunctionData, x as decodeFunctionResult, y as decodeHex, z as decodeRlp, A as encodeAbi, B as encodeBytes, C as encodeDeployData, F as encodeErrorResult, H as encodeEventTopics, I as encodeFunctionData, J as encodeFunctionResult, K as encodeHex, L as encodeRlp, S as formatEther, a7 as formatGwei, a8 as formatUnit, M as getAddress, N as getContractAddress, P as getCreate2Address, O as getCreateAddress, Q as getEventSignature, R as getFunctionSignature, X as hexToBigInt, Y as hexToBool, Z as hexToBytes, a9 as hexToNumber, _ as hexToString, T as isAddress, U as isAddressEqual, V as isBytes, W as isHex, $ as keccak256, a0 as numberToBytes, aa as numberToHex, a1 as pad, a2 as padBytes, a3 as padHex, a4 as parseEther, a5 as parseGwei, a6 as parseUnit, ab as size, ac as slice, ad as sliceBytes, ae as sliceHex, af as stringToBytes, ag as stringToHex, ah as trim } from '../parseGwei-
|
2
|
-
import { A as AbiItem } from '../
|
3
|
-
export { B as BlockFormatter,
|
1
|
+
export { D as DecodeAbiArgs, a as DecodeErrorResultArgs, b as DecodeFunctionDataArgs, c as DecodeFunctionResultArgs, d as DecodeFunctionResultResponse, E as EncodeAbiArgs, e as EncodeDeployDataArgs, f as EncodeErrorResultArgs, g as EncodeEventTopicsArgs, h as EncodeFunctionDataArgs, i as EncodeFunctionResultArgs, l as EncodeRlpResponse, G as GetContractAddressOptions, k as GetCreate2AddressOptions, j as GetCreateAddressOptions, o as boolToBytes, p as boolToHex, q as bytesToBigint, r as bytesToBool, m as bytesToHex, s as bytesToNumber, n as bytesToString, t as decodeAbi, u as decodeBytes, v as decodeErrorResult, w as decodeFunctionData, x as decodeFunctionResult, y as decodeHex, z as decodeRlp, A as encodeAbi, B as encodeBytes, C as encodeDeployData, F as encodeErrorResult, H as encodeEventTopics, I as encodeFunctionData, J as encodeFunctionResult, K as encodeHex, L as encodeRlp, S as formatEther, a7 as formatGwei, a8 as formatUnit, M as getAddress, N as getContractAddress, P as getCreate2Address, O as getCreateAddress, Q as getEventSignature, R as getFunctionSignature, X as hexToBigInt, Y as hexToBool, Z as hexToBytes, a9 as hexToNumber, _ as hexToString, T as isAddress, U as isAddressEqual, V as isBytes, W as isHex, $ as keccak256, a0 as numberToBytes, aa as numberToHex, a1 as pad, a2 as padBytes, a3 as padHex, a4 as parseEther, a5 as parseGwei, a6 as parseUnit, ab as size, ac as slice, ad as sliceBytes, ae as sliceHex, af as stringToBytes, ag as stringToHex, ah as trim } from '../parseGwei-f2d23de6.js';
|
2
|
+
import { A as AbiItem } from '../transactionReceipt-5d332aab.js';
|
3
|
+
export { B as BlockFormatter, F as FormattedBlock, a as FormattedTransaction, g as FormattedTransactionReceipt, T as TransactionFormatter, h as TransactionReceiptFormatter, f as formatBlock, b as formatTransaction } from '../transactionReceipt-5d332aab.js';
|
4
4
|
import * as abitype_dist_abi_b1bae27f from 'abitype/dist/abi-b1bae27f';
|
5
5
|
import { Abi } from 'abitype';
|
6
6
|
import { A as Address } from '../rpc-b77c5aee.js';
|
7
7
|
import { Formatter } from '../chains.js';
|
8
|
+
export { E as ExtractFormatter, a as Formatted, F as FormattedTransactionRequest, T as TransactionRequestFormatter, b as format, f as formatTransactionRequest } from '../transactionRequest-327eb7c2.js';
|
8
9
|
export { r as rpc } from '../rpc-26932bae.js';
|
9
10
|
import '@wagmi/chains';
|
10
11
|
|
package/dist/utils/index.js
CHANGED
@@ -72,7 +72,7 @@
|
|
72
72
|
|
73
73
|
|
74
74
|
|
75
|
-
var
|
75
|
+
var _chunkQMLDI5JUjs = require('../chunk-QMLDI5JU.js');
|
76
76
|
|
77
77
|
|
78
78
|
|
@@ -147,4 +147,4 @@ var _chunkAGF7GU6Gjs = require('../chunk-AGF7GU6G.js');
|
|
147
147
|
|
148
148
|
|
149
149
|
|
150
|
-
exports.boolToBytes =
|
150
|
+
exports.boolToBytes = _chunkQMLDI5JUjs.boolToBytes; exports.boolToHex = _chunkQMLDI5JUjs.boolToHex; exports.buildRequest = _chunkQMLDI5JUjs.buildRequest; exports.bytesToBigint = _chunkQMLDI5JUjs.bytesToBigint; exports.bytesToBool = _chunkQMLDI5JUjs.bytesToBool; exports.bytesToHex = _chunkQMLDI5JUjs.bytesToHex; exports.bytesToNumber = _chunkQMLDI5JUjs.bytesToNumber; exports.bytesToString = _chunkQMLDI5JUjs.bytesToString; exports.decodeAbi = _chunkQMLDI5JUjs.decodeAbi; exports.decodeBytes = _chunkQMLDI5JUjs.decodeBytes; exports.decodeErrorResult = _chunkQMLDI5JUjs.decodeErrorResult; exports.decodeFunctionData = _chunkQMLDI5JUjs.decodeFunctionData; exports.decodeFunctionResult = _chunkQMLDI5JUjs.decodeFunctionResult; exports.decodeHex = _chunkQMLDI5JUjs.decodeHex; exports.decodeRlp = _chunkQMLDI5JUjs.decodeRlp; exports.encodeAbi = _chunkQMLDI5JUjs.encodeAbi; exports.encodeBytes = _chunkQMLDI5JUjs.encodeBytes; exports.encodeDeployData = _chunkQMLDI5JUjs.encodeDeployData; exports.encodeErrorResult = _chunkQMLDI5JUjs.encodeErrorResult; exports.encodeEventTopics = _chunkQMLDI5JUjs.encodeEventTopics; exports.encodeFunctionData = _chunkQMLDI5JUjs.encodeFunctionData; exports.encodeFunctionResult = _chunkQMLDI5JUjs.encodeFunctionResult; exports.encodeHex = _chunkQMLDI5JUjs.encodeHex; exports.encodeRlp = _chunkQMLDI5JUjs.encodeRlp; exports.extract = _chunkQMLDI5JUjs.extract; exports.extractFunctionName = _chunkQMLDI5JUjs.extractFunctionName; exports.extractFunctionParams = _chunkQMLDI5JUjs.extractFunctionParams; exports.extractFunctionParts = _chunkQMLDI5JUjs.extractFunctionParts; exports.extractFunctionType = _chunkQMLDI5JUjs.extractFunctionType; exports.format = _chunkQMLDI5JUjs.format; exports.formatAbiItemWithArgs = _chunkQMLDI5JUjs.formatAbiItemWithArgs; exports.formatAbiItemWithParams = _chunkQMLDI5JUjs.formatAbiItemWithParams; exports.formatBlock = _chunkQMLDI5JUjs.formatBlock; exports.formatEther = _chunkQMLDI5JUjs.formatEther; exports.formatGwei = _chunkQMLDI5JUjs.formatGwei; exports.formatTransaction = _chunkQMLDI5JUjs.formatTransaction; exports.formatTransactionRequest = _chunkQMLDI5JUjs.formatTransactionRequest; exports.formatUnit = _chunkQMLDI5JUjs.formatUnit; exports.getAbiItem = _chunkQMLDI5JUjs.getAbiItem; exports.getAddress = _chunkQMLDI5JUjs.getAddress; exports.getContractAddress = _chunkQMLDI5JUjs.getContractAddress; exports.getContractError = _chunkQMLDI5JUjs.getContractError; exports.getCreate2Address = _chunkQMLDI5JUjs.getCreate2Address; exports.getCreateAddress = _chunkQMLDI5JUjs.getCreateAddress; exports.getEventSignature = _chunkQMLDI5JUjs.getEventSignature; exports.getFunctionSignature = _chunkQMLDI5JUjs.getFunctionSignature; exports.hexToBigInt = _chunkQMLDI5JUjs.hexToBigInt; exports.hexToBool = _chunkQMLDI5JUjs.hexToBool; exports.hexToBytes = _chunkQMLDI5JUjs.hexToBytes; exports.hexToNumber = _chunkQMLDI5JUjs.hexToNumber; exports.hexToString = _chunkQMLDI5JUjs.hexToString; exports.isAddress = _chunkQMLDI5JUjs.isAddress; exports.isAddressEqual = _chunkQMLDI5JUjs.isAddressEqual; exports.isBytes = _chunkQMLDI5JUjs.isBytes; exports.isHex = _chunkQMLDI5JUjs.isHex; exports.keccak256 = _chunkQMLDI5JUjs.keccak256; exports.numberToBytes = _chunkQMLDI5JUjs.numberToBytes; exports.numberToHex = _chunkQMLDI5JUjs.numberToHex; exports.pad = _chunkQMLDI5JUjs.pad; exports.padBytes = _chunkQMLDI5JUjs.padBytes; exports.padHex = _chunkQMLDI5JUjs.padHex; exports.parseEther = _chunkQMLDI5JUjs.parseEther; exports.parseGwei = _chunkQMLDI5JUjs.parseGwei; exports.parseUnit = _chunkQMLDI5JUjs.parseUnit; exports.rpc = _chunkQMLDI5JUjs.rpc; exports.size = _chunkQMLDI5JUjs.size; exports.slice = _chunkQMLDI5JUjs.slice; exports.sliceBytes = _chunkQMLDI5JUjs.sliceBytes; exports.sliceHex = _chunkQMLDI5JUjs.sliceHex; exports.stringToBytes = _chunkQMLDI5JUjs.stringToBytes; exports.stringToHex = _chunkQMLDI5JUjs.stringToHex; exports.stringify = _chunkQMLDI5JUjs.stringify; exports.trim = _chunkQMLDI5JUjs.trim;
|
package/dist/utils/index.mjs
CHANGED
package/dist/wallet.d.ts
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
export { G as GetPermissionsResponse, R as RequestPermissionsResponse, S as SignMessageArgs, a as SignMessageResponse, b as SwitchChainArgs, W as WatchAssetArgs, c as WatchAssetResponse, d as addChain, g as getAccounts, e as getPermissions, r as requestAccounts, f as requestPermissions, s as signMessage, h as switchChain, w as watchAsset } from './watchAsset-0088384c.js';
|
2
|
+
export { F as FormattedTransactionRequest, S as SendTransactionArgs, a as SendTransactionResponse, s as sendTransaction } from './sendTransaction-7a9d241a.js';
|
3
|
+
import './chains.js';
|
4
|
+
import './rpc-b77c5aee.js';
|
5
|
+
import '@wagmi/chains';
|
6
|
+
import './createWalletClient-43f801b9.js';
|
7
|
+
import './eip1193-4330b722.js';
|
8
|
+
import './createClient-cd948138.js';
|
9
|
+
import './transactionRequest-327eb7c2.js';
|
package/dist/wallet.js
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
var _chunkKGXH5DYIjs = require('./chunk-KGXH5DYI.js');
|
12
|
+
require('./chunk-QMLDI5JU.js');
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
exports.addChain = _chunkKGXH5DYIjs.addChain; exports.getAccounts = _chunkKGXH5DYIjs.getAccounts; exports.getPermissions = _chunkKGXH5DYIjs.getPermissions; exports.requestAccounts = _chunkKGXH5DYIjs.requestAccounts; exports.requestPermissions = _chunkKGXH5DYIjs.requestPermissions; exports.sendTransaction = _chunkKGXH5DYIjs.sendTransaction; exports.signMessage = _chunkKGXH5DYIjs.signMessage; exports.switchChain = _chunkKGXH5DYIjs.switchChain; exports.watchAsset = _chunkKGXH5DYIjs.watchAsset;
|
package/dist/wallet.mjs
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
import {
|
2
|
+
addChain,
|
3
|
+
getAccounts,
|
4
|
+
getPermissions,
|
5
|
+
requestAccounts,
|
6
|
+
requestPermissions,
|
7
|
+
sendTransaction,
|
8
|
+
signMessage,
|
9
|
+
switchChain,
|
10
|
+
watchAsset
|
11
|
+
} from "./chunk-PHAG5KUF.mjs";
|
12
|
+
import "./chunk-2HENAFQN.mjs";
|
13
|
+
export {
|
14
|
+
addChain,
|
15
|
+
getAccounts,
|
16
|
+
getPermissions,
|
17
|
+
requestAccounts,
|
18
|
+
requestPermissions,
|
19
|
+
sendTransaction,
|
20
|
+
signMessage,
|
21
|
+
switchChain,
|
22
|
+
watchAsset
|
23
|
+
};
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { Chain } from './chains.js';
|
2
|
+
import { W as WalletClient } from './createWalletClient-43f801b9.js';
|
3
|
+
import { a as WalletPermission, b as WatchAssetParams } from './eip1193-4330b722.js';
|
4
|
+
import { A as Address, H as Hex, B as ByteArray } from './rpc-b77c5aee.js';
|
5
|
+
|
6
|
+
declare function addChain(client: WalletClient, chain: Chain): Promise<void>;
|
7
|
+
|
8
|
+
declare function getAccounts(client: WalletClient): Promise<`0x${string}`[]>;
|
9
|
+
|
10
|
+
type GetPermissionsResponse = WalletPermission[];
|
11
|
+
declare function getPermissions(client: WalletClient): Promise<WalletPermission[]>;
|
12
|
+
|
13
|
+
declare function requestAccounts(client: WalletClient): Promise<`0x${string}`[]>;
|
14
|
+
|
15
|
+
type RequestPermissionsArgs = {
|
16
|
+
eth_accounts: Record<string, any>;
|
17
|
+
} & {
|
18
|
+
[key: string]: Record<string, any>;
|
19
|
+
};
|
20
|
+
type RequestPermissionsResponse = WalletPermission[];
|
21
|
+
declare function requestPermissions(client: WalletClient, permissions: RequestPermissionsArgs): Promise<WalletPermission[]>;
|
22
|
+
|
23
|
+
type SignMessageArgs = {
|
24
|
+
from: Address;
|
25
|
+
data: Hex | ByteArray;
|
26
|
+
};
|
27
|
+
type SignMessageResponse = Hex;
|
28
|
+
declare function signMessage(client: WalletClient, { from, data: data_ }: SignMessageArgs): Promise<SignMessageResponse>;
|
29
|
+
|
30
|
+
type SwitchChainArgs = {
|
31
|
+
id: Chain['id'];
|
32
|
+
};
|
33
|
+
declare function switchChain(client: WalletClient, { id }: SwitchChainArgs): Promise<void>;
|
34
|
+
|
35
|
+
type WatchAssetArgs = WatchAssetParams;
|
36
|
+
type WatchAssetResponse = boolean;
|
37
|
+
declare function watchAsset(client: WalletClient, params: WatchAssetParams): Promise<WatchAssetResponse>;
|
38
|
+
|
39
|
+
export { GetPermissionsResponse as G, RequestPermissionsResponse as R, SignMessageArgs as S, WatchAssetArgs as W, SignMessageResponse as a, SwitchChainArgs as b, WatchAssetResponse as c, addChain as d, getPermissions as e, requestPermissions as f, getAccounts as g, switchChain as h, requestAccounts as r, signMessage as s, watchAsset as w };
|