viem 0.0.1-alpha.3 → 0.0.1-alpha.30

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.
Files changed (101) hide show
  1. package/chains/package.json +1 -1
  2. package/contract/package.json +4 -0
  3. package/dist/chain-00b37e4e.d.ts +543 -0
  4. package/dist/chain-38182d92.d.ts +5 -0
  5. package/dist/chains.d.ts +1305 -74
  6. package/dist/chains.js +125 -130
  7. package/dist/chains.js.map +1 -0
  8. package/dist/chains.mjs +129 -0
  9. package/dist/chains.mjs.map +1 -0
  10. package/dist/chunk-23UHN6UC.mjs +210 -0
  11. package/dist/chunk-23UHN6UC.mjs.map +1 -0
  12. package/dist/chunk-25AJVKAT.mjs +3436 -0
  13. package/dist/chunk-25AJVKAT.mjs.map +1 -0
  14. package/dist/chunk-AO7KQBK3.mjs +265 -0
  15. package/dist/chunk-AO7KQBK3.mjs.map +1 -0
  16. package/dist/chunk-BHMSFL4W.js +265 -0
  17. package/dist/chunk-BHMSFL4W.js.map +1 -0
  18. package/dist/chunk-EAD66IDC.js +3436 -0
  19. package/dist/chunk-EAD66IDC.js.map +1 -0
  20. package/dist/{chunk-YZEQFYZ3.js → chunk-EYRMK2SV.mjs} +725 -556
  21. package/dist/chunk-EYRMK2SV.mjs.map +1 -0
  22. package/dist/chunk-IP3NSE7H.mjs +197 -0
  23. package/dist/chunk-IP3NSE7H.mjs.map +1 -0
  24. package/dist/chunk-NPFW67BV.js +210 -0
  25. package/dist/chunk-NPFW67BV.js.map +1 -0
  26. package/dist/chunk-VOK5ALIT.js +197 -0
  27. package/dist/chunk-VOK5ALIT.js.map +1 -0
  28. package/dist/chunk-ZX4U6QKQ.js +1216 -0
  29. package/dist/chunk-ZX4U6QKQ.js.map +1 -0
  30. package/dist/contract.d.ts +11 -0
  31. package/dist/contract.js +57 -0
  32. package/dist/contract.js.map +1 -0
  33. package/dist/contract.mjs +57 -0
  34. package/dist/contract.mjs.map +1 -0
  35. package/dist/createClient-5258d590.d.ts +70 -0
  36. package/dist/createPublicClient-99be385b.d.ts +650 -0
  37. package/dist/{eip1193-8b4d90ce.d.ts → eip1193-fcdeee04.d.ts} +13 -10
  38. package/dist/ens.d.ts +22 -0
  39. package/dist/ens.js +22 -0
  40. package/dist/ens.js.map +1 -0
  41. package/dist/ens.mjs +22 -0
  42. package/dist/ens.mjs.map +1 -0
  43. package/dist/formatAbiItem-50cb39d8.d.ts +14 -0
  44. package/dist/getAbiItem-6d4f64d2.d.ts +97 -0
  45. package/dist/index.d.ts +245 -66
  46. package/dist/index.js +767 -344
  47. package/dist/index.js.map +1 -0
  48. package/dist/index.mjs +767 -0
  49. package/dist/index.mjs.map +1 -0
  50. package/dist/namehash-88f4639d.d.ts +22 -0
  51. package/dist/parseGwei-e299cf13.d.ts +506 -0
  52. package/dist/public.d.ts +29 -0
  53. package/dist/public.js +60 -0
  54. package/dist/public.js.map +1 -0
  55. package/dist/public.mjs +60 -0
  56. package/dist/public.mjs.map +1 -0
  57. package/dist/test-79ec416c.d.ts +213 -0
  58. package/dist/test.d.ts +20 -0
  59. package/dist/test.js +62 -0
  60. package/dist/test.js.map +1 -0
  61. package/dist/test.mjs +62 -0
  62. package/dist/test.mjs.map +1 -0
  63. package/dist/utils/index.d.ts +52 -7
  64. package/dist/utils/index.js +185 -126
  65. package/dist/utils/index.js.map +1 -0
  66. package/dist/utils/index.mjs +185 -0
  67. package/dist/utils/index.mjs.map +1 -0
  68. package/dist/wallet-cf5c8351.d.ts +115 -0
  69. package/dist/wallet.d.ts +7 -0
  70. package/dist/wallet.js +24 -0
  71. package/dist/wallet.js.map +1 -0
  72. package/dist/wallet.mjs +24 -0
  73. package/dist/wallet.mjs.map +1 -0
  74. package/dist/window.d.ts +5 -2
  75. package/dist/window.js +1 -0
  76. package/dist/window.js.map +1 -0
  77. package/dist/window.mjs +1 -0
  78. package/dist/window.mjs.map +1 -0
  79. package/ens/package.json +4 -0
  80. package/package.json +46 -73
  81. package/public/package.json +4 -0
  82. package/test/package.json +4 -0
  83. package/utils/package.json +1 -1
  84. package/wallet/package.json +4 -0
  85. package/window/package.json +1 -1
  86. package/actions/package.json +0 -4
  87. package/clients/package.json +0 -4
  88. package/dist/actions/index.d.ts +0 -7
  89. package/dist/actions/index.js +0 -124
  90. package/dist/chunk-SRDTRROA.js +0 -1214
  91. package/dist/chunk-TLEMV4T3.js +0 -258
  92. package/dist/chunk-WZITKXV3.js +0 -996
  93. package/dist/clients/index.d.ts +0 -7
  94. package/dist/clients/index.js +0 -23
  95. package/dist/createWalletClient-15ad1601.d.ts +0 -130
  96. package/dist/parseGwei-0f85e8ca.d.ts +0 -248
  97. package/dist/rpc-15b85963.d.ts +0 -292
  98. package/dist/rpc-26932bae.d.ts +0 -61
  99. package/dist/transactionRequest-f538ea86.d.ts +0 -44
  100. package/dist/watchAsset-0c9d01e2.d.ts +0 -522
  101. package/dist/webSocket-b55b0951.d.ts +0 -83
@@ -1,126 +1,185 @@
1
- import {
2
- boolToBytes,
3
- boolToHex,
4
- bytesToBigint,
5
- bytesToBool,
6
- bytesToHex,
7
- bytesToNumber,
8
- bytesToString,
9
- decodeAbi,
10
- decodeBytes,
11
- decodeFunctionData,
12
- decodeHex,
13
- decodeRlp,
14
- encodeAbi,
15
- encodeBytes,
16
- encodeFunctionData,
17
- encodeHex,
18
- encodeRlp,
19
- extractFunctionName,
20
- extractFunctionParams,
21
- extractFunctionType,
22
- format,
23
- formatBlock,
24
- formatEther,
25
- formatGwei,
26
- formatTransaction,
27
- formatTransactionRequest,
28
- formatUnit,
29
- getAddress,
30
- getContractAddress,
31
- getCreate2Address,
32
- getCreateAddress,
33
- getEventSignature,
34
- getFunctionSignature,
35
- hexToBigInt,
36
- hexToBool,
37
- hexToBytes,
38
- hexToNumber,
39
- hexToString,
40
- isAddress,
41
- isAddressEqual,
42
- isBytes,
43
- isHex,
44
- keccak256,
45
- numberToBytes,
46
- numberToHex,
47
- pad,
48
- padBytes,
49
- padHex,
50
- parseEther,
51
- parseGwei,
52
- parseUnit,
53
- size,
54
- slice,
55
- sliceBytes,
56
- sliceHex,
57
- stringToBytes,
58
- stringToHex,
59
- trim
60
- } from "../chunk-SRDTRROA.js";
61
- import {
62
- buildRequest,
63
- rpc
64
- } from "../chunk-WZITKXV3.js";
65
- export {
66
- boolToBytes,
67
- boolToHex,
68
- buildRequest,
69
- bytesToBigint,
70
- bytesToBool,
71
- bytesToHex,
72
- bytesToNumber,
73
- bytesToString,
74
- decodeAbi,
75
- decodeBytes,
76
- decodeFunctionData,
77
- decodeHex,
78
- decodeRlp,
79
- encodeAbi,
80
- encodeBytes,
81
- encodeFunctionData,
82
- encodeHex,
83
- encodeRlp,
84
- extractFunctionName,
85
- extractFunctionParams,
86
- extractFunctionType,
87
- format,
88
- formatBlock,
89
- formatEther,
90
- formatGwei,
91
- formatTransaction,
92
- formatTransactionRequest,
93
- formatUnit,
94
- getAddress,
95
- getContractAddress,
96
- getCreate2Address,
97
- getCreateAddress,
98
- getEventSignature,
99
- getFunctionSignature,
100
- hexToBigInt,
101
- hexToBool,
102
- hexToBytes,
103
- hexToNumber,
104
- hexToString,
105
- isAddress,
106
- isAddressEqual,
107
- isBytes,
108
- isHex,
109
- keccak256,
110
- numberToBytes,
111
- numberToHex,
112
- pad,
113
- padBytes,
114
- padHex,
115
- parseEther,
116
- parseGwei,
117
- parseUnit,
118
- rpc,
119
- size,
120
- slice,
121
- sliceBytes,
122
- sliceHex,
123
- stringToBytes,
124
- stringToHex,
125
- trim
126
- };
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
+
30
+
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
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+ var _chunkEAD66IDCjs = require('../chunk-EAD66IDC.js');
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+ exports.assertRequest = _chunkEAD66IDCjs.assertRequest; exports.boolToBytes = _chunkEAD66IDCjs.boolToBytes; exports.boolToHex = _chunkEAD66IDCjs.boolToHex; exports.buildRequest = _chunkEAD66IDCjs.buildRequest; exports.bytesToBigint = _chunkEAD66IDCjs.bytesToBigint; exports.bytesToBool = _chunkEAD66IDCjs.bytesToBool; exports.bytesToHex = _chunkEAD66IDCjs.bytesToHex; exports.bytesToNumber = _chunkEAD66IDCjs.bytesToNumber; exports.bytesToString = _chunkEAD66IDCjs.bytesToString; exports.containsNodeError = _chunkEAD66IDCjs.containsNodeError; exports.decodeAbi = _chunkEAD66IDCjs.decodeAbi; exports.decodeErrorResult = _chunkEAD66IDCjs.decodeErrorResult; exports.decodeEventLog = _chunkEAD66IDCjs.decodeEventLog; exports.decodeFunctionData = _chunkEAD66IDCjs.decodeFunctionData; exports.decodeFunctionResult = _chunkEAD66IDCjs.decodeFunctionResult; exports.defineBlock = _chunkEAD66IDCjs.defineBlock; exports.defineChain = _chunkEAD66IDCjs.defineChain; exports.defineFormatter = _chunkEAD66IDCjs.defineFormatter; exports.defineTransaction = _chunkEAD66IDCjs.defineTransaction; exports.defineTransactionReceipt = _chunkEAD66IDCjs.defineTransactionReceipt; exports.defineTransactionRequest = _chunkEAD66IDCjs.defineTransactionRequest; exports.encodeAbi = _chunkEAD66IDCjs.encodeAbi; exports.encodeDeployData = _chunkEAD66IDCjs.encodeDeployData; exports.encodeErrorResult = _chunkEAD66IDCjs.encodeErrorResult; exports.encodeEventTopics = _chunkEAD66IDCjs.encodeEventTopics; exports.encodeFunctionData = _chunkEAD66IDCjs.encodeFunctionData; exports.encodeFunctionResult = _chunkEAD66IDCjs.encodeFunctionResult; exports.etherUnits = _chunkEAD66IDCjs.etherUnits; exports.extract = _chunkEAD66IDCjs.extract; exports.extractFunctionName = _chunkEAD66IDCjs.extractFunctionName; exports.extractFunctionParams = _chunkEAD66IDCjs.extractFunctionParams; exports.extractFunctionParts = _chunkEAD66IDCjs.extractFunctionParts; exports.extractFunctionType = _chunkEAD66IDCjs.extractFunctionType; exports.format = _chunkEAD66IDCjs.format; exports.formatAbiItem = _chunkEAD66IDCjs.formatAbiItem; exports.formatAbiItemWithArgs = _chunkEAD66IDCjs.formatAbiItemWithArgs; exports.formatBlock = _chunkEAD66IDCjs.formatBlock; exports.formatEther = _chunkEAD66IDCjs.formatEther; exports.formatGwei = _chunkEAD66IDCjs.formatGwei; exports.formatTransaction = _chunkEAD66IDCjs.formatTransaction; exports.formatTransactionRequest = _chunkEAD66IDCjs.formatTransactionRequest; exports.formatUnit = _chunkEAD66IDCjs.formatUnit; exports.fromBytes = _chunkEAD66IDCjs.fromBytes; exports.fromHex = _chunkEAD66IDCjs.fromHex; exports.fromRlp = _chunkEAD66IDCjs.fromRlp; exports.getAbiItem = _chunkEAD66IDCjs.getAbiItem; exports.getAddress = _chunkEAD66IDCjs.getAddress; exports.getCallError = _chunkEAD66IDCjs.getCallError; exports.getContractAddress = _chunkEAD66IDCjs.getContractAddress; exports.getContractError = _chunkEAD66IDCjs.getContractError; exports.getCreate2Address = _chunkEAD66IDCjs.getCreate2Address; exports.getCreateAddress = _chunkEAD66IDCjs.getCreateAddress; exports.getEstimateGasError = _chunkEAD66IDCjs.getEstimateGasError; exports.getEventSignature = _chunkEAD66IDCjs.getEventSignature; exports.getFunctionSignature = _chunkEAD66IDCjs.getFunctionSignature; exports.getNodeError = _chunkEAD66IDCjs.getNodeError; exports.getTransactionError = _chunkEAD66IDCjs.getTransactionError; exports.gweiUnits = _chunkEAD66IDCjs.gweiUnits; exports.hexToBigInt = _chunkEAD66IDCjs.hexToBigInt; exports.hexToBool = _chunkEAD66IDCjs.hexToBool; exports.hexToBytes = _chunkEAD66IDCjs.hexToBytes; exports.hexToNumber = _chunkEAD66IDCjs.hexToNumber; exports.hexToString = _chunkEAD66IDCjs.hexToString; exports.isAddress = _chunkEAD66IDCjs.isAddress; exports.isAddressEqual = _chunkEAD66IDCjs.isAddressEqual; exports.isBytes = _chunkEAD66IDCjs.isBytes; exports.isHex = _chunkEAD66IDCjs.isHex; exports.keccak256 = _chunkEAD66IDCjs.keccak256; exports.numberToBytes = _chunkEAD66IDCjs.numberToBytes; exports.numberToHex = _chunkEAD66IDCjs.numberToHex; exports.pad = _chunkEAD66IDCjs.pad; exports.padBytes = _chunkEAD66IDCjs.padBytes; exports.padHex = _chunkEAD66IDCjs.padHex; exports.parseEther = _chunkEAD66IDCjs.parseEther; exports.parseGwei = _chunkEAD66IDCjs.parseGwei; exports.parseUnit = _chunkEAD66IDCjs.parseUnit; exports.rpc = _chunkEAD66IDCjs.rpc; exports.size = _chunkEAD66IDCjs.size; exports.slice = _chunkEAD66IDCjs.slice; exports.sliceBytes = _chunkEAD66IDCjs.sliceBytes; exports.sliceHex = _chunkEAD66IDCjs.sliceHex; exports.stringToBytes = _chunkEAD66IDCjs.stringToBytes; exports.stringToHex = _chunkEAD66IDCjs.stringToHex; exports.stringify = _chunkEAD66IDCjs.stringify; exports.toBytes = _chunkEAD66IDCjs.toBytes; exports.toHex = _chunkEAD66IDCjs.toHex; exports.toRlp = _chunkEAD66IDCjs.toRlp; exports.transactionType = _chunkEAD66IDCjs.transactionType; exports.trim = _chunkEAD66IDCjs.trim; exports.weiUnits = _chunkEAD66IDCjs.weiUnits;
185
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,185 @@
1
+ import {
2
+ assertRequest,
3
+ boolToBytes,
4
+ boolToHex,
5
+ buildRequest,
6
+ bytesToBigint,
7
+ bytesToBool,
8
+ bytesToHex,
9
+ bytesToNumber,
10
+ bytesToString,
11
+ containsNodeError,
12
+ decodeAbi,
13
+ decodeErrorResult,
14
+ decodeEventLog,
15
+ decodeFunctionData,
16
+ decodeFunctionResult,
17
+ defineBlock,
18
+ defineChain,
19
+ defineFormatter,
20
+ defineTransaction,
21
+ defineTransactionReceipt,
22
+ defineTransactionRequest,
23
+ encodeAbi,
24
+ encodeDeployData,
25
+ encodeErrorResult,
26
+ encodeEventTopics,
27
+ encodeFunctionData,
28
+ encodeFunctionResult,
29
+ etherUnits,
30
+ extract,
31
+ extractFunctionName,
32
+ extractFunctionParams,
33
+ extractFunctionParts,
34
+ extractFunctionType,
35
+ format,
36
+ formatAbiItem,
37
+ formatAbiItemWithArgs,
38
+ formatBlock,
39
+ formatEther,
40
+ formatGwei,
41
+ formatTransaction,
42
+ formatTransactionRequest,
43
+ formatUnit,
44
+ fromBytes,
45
+ fromHex,
46
+ fromRlp,
47
+ getAbiItem,
48
+ getAddress,
49
+ getCallError,
50
+ getContractAddress,
51
+ getContractError,
52
+ getCreate2Address,
53
+ getCreateAddress,
54
+ getEstimateGasError,
55
+ getEventSignature,
56
+ getFunctionSignature,
57
+ getNodeError,
58
+ getTransactionError,
59
+ gweiUnits,
60
+ hexToBigInt,
61
+ hexToBool,
62
+ hexToBytes,
63
+ hexToNumber,
64
+ hexToString,
65
+ isAddress,
66
+ isAddressEqual,
67
+ isBytes,
68
+ isHex,
69
+ keccak256,
70
+ numberToBytes,
71
+ numberToHex,
72
+ pad,
73
+ padBytes,
74
+ padHex,
75
+ parseEther,
76
+ parseGwei,
77
+ parseUnit,
78
+ rpc,
79
+ size,
80
+ slice,
81
+ sliceBytes,
82
+ sliceHex,
83
+ stringToBytes,
84
+ stringToHex,
85
+ stringify,
86
+ toBytes,
87
+ toHex,
88
+ toRlp,
89
+ transactionType,
90
+ trim,
91
+ weiUnits
92
+ } from "../chunk-25AJVKAT.mjs";
93
+ export {
94
+ assertRequest,
95
+ boolToBytes,
96
+ boolToHex,
97
+ buildRequest,
98
+ bytesToBigint,
99
+ bytesToBool,
100
+ bytesToHex,
101
+ bytesToNumber,
102
+ bytesToString,
103
+ containsNodeError,
104
+ decodeAbi,
105
+ decodeErrorResult,
106
+ decodeEventLog,
107
+ decodeFunctionData,
108
+ decodeFunctionResult,
109
+ defineBlock,
110
+ defineChain,
111
+ defineFormatter,
112
+ defineTransaction,
113
+ defineTransactionReceipt,
114
+ defineTransactionRequest,
115
+ encodeAbi,
116
+ encodeDeployData,
117
+ encodeErrorResult,
118
+ encodeEventTopics,
119
+ encodeFunctionData,
120
+ encodeFunctionResult,
121
+ etherUnits,
122
+ extract,
123
+ extractFunctionName,
124
+ extractFunctionParams,
125
+ extractFunctionParts,
126
+ extractFunctionType,
127
+ format,
128
+ formatAbiItem,
129
+ formatAbiItemWithArgs,
130
+ formatBlock,
131
+ formatEther,
132
+ formatGwei,
133
+ formatTransaction,
134
+ formatTransactionRequest,
135
+ formatUnit,
136
+ fromBytes,
137
+ fromHex,
138
+ fromRlp,
139
+ getAbiItem,
140
+ getAddress,
141
+ getCallError,
142
+ getContractAddress,
143
+ getContractError,
144
+ getCreate2Address,
145
+ getCreateAddress,
146
+ getEstimateGasError,
147
+ getEventSignature,
148
+ getFunctionSignature,
149
+ getNodeError,
150
+ getTransactionError,
151
+ gweiUnits,
152
+ hexToBigInt,
153
+ hexToBool,
154
+ hexToBytes,
155
+ hexToNumber,
156
+ hexToString,
157
+ isAddress,
158
+ isAddressEqual,
159
+ isBytes,
160
+ isHex,
161
+ keccak256,
162
+ numberToBytes,
163
+ numberToHex,
164
+ pad,
165
+ padBytes,
166
+ padHex,
167
+ parseEther,
168
+ parseGwei,
169
+ parseUnit,
170
+ rpc,
171
+ size,
172
+ slice,
173
+ sliceBytes,
174
+ sliceHex,
175
+ stringToBytes,
176
+ stringToHex,
177
+ stringify,
178
+ toBytes,
179
+ toHex,
180
+ toRlp,
181
+ transactionType,
182
+ trim,
183
+ weiUnits
184
+ };
185
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,115 @@
1
+ import { Abi, Narrow, Address } from 'abitype';
2
+ import { C as Chain, J as ExtractFormatter, S as Formatters, V as Formatter, K as Formatted, s as RpcTransactionRequest, u as TransactionRequest, H as Hex, a4 as ExtractConstructorArgsFromAbi, X as MergeIntersectionProperties, a as Hash, A as Address$1, B as ByteArray, Y as GetValue, h as ContractConfig } from './chain-00b37e4e.js';
3
+ import { W as WalletPermission, a as WatchAssetParams, S as SignableRequests, b as WalletRequests } from './eip1193-fcdeee04.js';
4
+ import { a as Transport, b as ClientConfig, C as Client } from './createClient-5258d590.js';
5
+
6
+ type TransactionRequestFormatter<TChain extends Chain = Chain> = ExtractFormatter<TChain, 'transactionRequest', NonNullable<Formatters['transactionRequest']>>;
7
+ type FormattedTransactionRequest$1<TFormatter extends Formatter | undefined = Formatter> = Formatted<TFormatter, RpcTransactionRequest>;
8
+ declare function formatTransactionRequest(transactionRequest: Partial<TransactionRequest>): RpcTransactionRequest;
9
+ declare const defineTransactionRequest: <TFormat extends Formatter<Partial<TransactionRequest<bigint, number>>, Partial<RpcTransactionRequest> & {
10
+ [key: string]: unknown;
11
+ }>, TExclude extends ("gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" | "data" | "from" | "gas" | "nonce" | "to" | "value" | "accessList")[] = []>({ exclude, format: formatOverride, }: {
12
+ exclude?: TExclude | undefined;
13
+ format?: TFormat | undefined;
14
+ }) => (data: Partial<TransactionRequest<bigint, number>> & {
15
+ [key: string]: unknown;
16
+ }) => RpcTransactionRequest & ReturnType<TFormat> & { [K in TExclude[number]]: never; };
17
+
18
+ type AddChainArgs = {
19
+ chain: Chain;
20
+ };
21
+ declare function addChain(client: WalletClient, { chain }: AddChainArgs): Promise<void>;
22
+
23
+ type DeployContractArgs<TChain extends Chain = Chain, TAbi extends Abi | readonly unknown[] = Abi> = Omit<SendTransactionArgs<TChain>, 'accessList' | 'to' | 'data' | 'value'> & {
24
+ abi: Narrow<TAbi>;
25
+ bytecode: Hex;
26
+ } & ExtractConstructorArgsFromAbi<TAbi>;
27
+ type DeployContractResponse = SendTransactionResponse;
28
+ declare function deployContract<TChain extends Chain, TAbi extends Abi | readonly unknown[]>(walletClient: WalletClient, { abi, args, bytecode, ...request }: DeployContractArgs<TChain, TAbi>): Promise<DeployContractResponse>;
29
+
30
+ type GetAccountsResponse = Address[];
31
+ declare function getAccounts(client: WalletClient): Promise<GetAccountsResponse>;
32
+
33
+ type GetPermissionsResponse = WalletPermission[];
34
+ declare function getPermissions(client: WalletClient): Promise<WalletPermission[]>;
35
+
36
+ type RequestAccountsResponse = Address[];
37
+ declare function requestAccounts(client: WalletClient): Promise<RequestAccountsResponse>;
38
+
39
+ type RequestPermissionsArgs = {
40
+ eth_accounts: Record<string, any>;
41
+ } & {
42
+ [key: string]: Record<string, any>;
43
+ };
44
+ type RequestPermissionsResponse = WalletPermission[];
45
+ declare function requestPermissions(client: WalletClient, permissions: RequestPermissionsArgs): Promise<WalletPermission[]>;
46
+
47
+ type FormattedTransactionRequest<TFormatter extends Formatter | undefined = Formatter> = MergeIntersectionProperties<Formatted<TFormatter, TransactionRequest, true>, TransactionRequest>;
48
+ type SendTransactionArgs<TChain extends Chain = Chain> = FormattedTransactionRequest<TransactionRequestFormatter<TChain>> & {
49
+ chain?: TChain;
50
+ };
51
+ type SendTransactionResponse = Hash;
52
+ declare function sendTransaction<TChain extends Chain>(client: WalletClient, args: SendTransactionArgs<TChain>): Promise<SendTransactionResponse>;
53
+
54
+ type SignMessageArgs = {
55
+ from: Address$1;
56
+ data: Hex | ByteArray;
57
+ };
58
+ type SignMessageResponse = Hex;
59
+ declare function signMessage(client: WalletClient, { from, data: data_ }: SignMessageArgs): Promise<SignMessageResponse>;
60
+
61
+ type SwitchChainArgs = {
62
+ id: Chain['id'];
63
+ };
64
+ declare function switchChain(client: WalletClient, { id }: SwitchChainArgs): Promise<void>;
65
+
66
+ type WatchAssetArgs = WatchAssetParams;
67
+ type WatchAssetResponse = boolean;
68
+ declare function watchAsset(client: WalletClient, params: WatchAssetParams): Promise<WatchAssetResponse>;
69
+
70
+ type WriteContractArgs<TChain extends Chain = Chain, TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = Omit<SendTransactionArgs<TChain>, 'to' | 'data' | 'value'> & {
71
+ value?: GetValue<TAbi, TFunctionName, SendTransactionArgs<TChain>['value']>;
72
+ } & ContractConfig<TAbi, TFunctionName, 'payable' | 'nonpayable'>;
73
+ type WriteContractResponse = SendTransactionResponse;
74
+ declare function writeContract<TChain extends Chain, TAbi extends Abi | readonly unknown[], TFunctionName extends string>(client: WalletClient, { abi, address, args, functionName, ...request }: WriteContractArgs<TChain, TAbi, TFunctionName>): Promise<WriteContractResponse>;
75
+
76
+ type WalletClientConfig<TTransport extends Transport = Transport, TChain extends Chain = Chain> = {
77
+ chain?: ClientConfig<TTransport, TChain>['chain'];
78
+ /** The key of the Wallet Client. */
79
+ key?: ClientConfig['key'];
80
+ /** The name of the Wallet Client. */
81
+ name?: ClientConfig['name'];
82
+ /** Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. */
83
+ pollingInterval?: ClientConfig['pollingInterval'];
84
+ transport: ClientConfig<TTransport, TChain>['transport'];
85
+ };
86
+ type WalletClient<TTransport extends Transport = Transport, TChain extends Chain = Chain, TIncludeActions extends boolean = true> = Client<TTransport, TChain, SignableRequests & WalletRequests> & (TIncludeActions extends true ? WalletActions<TChain> : {});
87
+ /**
88
+ * @description Creates a wallet client with a given transport.
89
+ *
90
+ * - Only has access to "wallet" & "signable" EIP-1474 RPC methods
91
+ * (ie. `eth_sendTransaction`, `eth_requestAccounts`, etc).
92
+ *
93
+ * @example
94
+ * import { createWalletClient, custom } from 'viem'
95
+ * const client = createWalletClient(
96
+ * custom(window.ethereum)
97
+ * )
98
+ */
99
+ declare function createWalletClient<TTransport extends Transport, TChain extends Chain>({ transport, key, name, pollingInterval, }: WalletClientConfig<TTransport, TChain>): WalletClient<TTransport, TChain, true>;
100
+
101
+ type WalletActions<TChain extends Chain = Chain> = {
102
+ addChain: (args: AddChainArgs) => Promise<void>;
103
+ deployContract: <TAbi extends Abi | readonly unknown[]>(args: DeployContractArgs<TChain, TAbi>) => Promise<DeployContractResponse>;
104
+ getAccounts: () => Promise<GetAccountsResponse>;
105
+ getPermissions: () => Promise<GetPermissionsResponse>;
106
+ requestAccounts: () => Promise<RequestAccountsResponse>;
107
+ requestPermissions: (args: RequestPermissionsArgs) => Promise<RequestPermissionsResponse>;
108
+ sendTransaction: (args: SendTransactionArgs<TChain>) => Promise<SendTransactionResponse>;
109
+ signMessage: (args: SignMessageArgs) => Promise<SignMessageResponse>;
110
+ switchChain: (args: SwitchChainArgs) => Promise<void>;
111
+ watchAsset: (args: WatchAssetArgs) => Promise<WatchAssetResponse>;
112
+ writeContract: <TAbi extends Abi | readonly unknown[], TFunctionName extends string>(args: WriteContractArgs<TChain, TAbi, TFunctionName>) => Promise<WriteContractResponse>;
113
+ };
114
+
115
+ export { AddChainArgs as A, WatchAssetResponse as B, DeployContractArgs as D, FormattedTransactionRequest$1 as F, GetPermissionsResponse as G, RequestAccountsResponse as R, SendTransactionArgs as S, TransactionRequestFormatter as T, WalletClient as W, WalletClientConfig as a, WriteContractArgs as b, createWalletClient as c, defineTransactionRequest as d, DeployContractResponse as e, formatTransactionRequest as f, WriteContractResponse as g, deployContract as h, addChain as i, getAccounts as j, getPermissions as k, requestPermissions as l, signMessage as m, switchChain as n, watchAsset as o, FormattedTransactionRequest as p, GetAccountsResponse as q, requestAccounts as r, sendTransaction as s, RequestPermissionsResponse as t, SendTransactionResponse as u, SignMessageArgs as v, writeContract as w, SignMessageResponse as x, SwitchChainArgs as y, WatchAssetArgs as z };
@@ -0,0 +1,7 @@
1
+ export { A as AddChainArgs, p as FormattedTransactionRequest, q as GetAccountsResponse, G as GetPermissionsResponse, R as RequestAccountsResponse, t as RequestPermissionsResponse, S as SendTransactionArgs, u as SendTransactionResponse, v as SignMessageArgs, x as SignMessageResponse, y as SwitchChainArgs, z as WatchAssetArgs, B as WatchAssetResponse, i as addChain, j as getAccounts, k as getPermissions, r as requestAccounts, l as requestPermissions, s as sendTransaction, m as signMessage, n as switchChain, o as watchAsset } from './wallet-cf5c8351.js';
2
+ import 'abitype';
3
+ import './chain-00b37e4e.js';
4
+ import '@wagmi/chains';
5
+ import 'ethers@6/types/providers';
6
+ import './eip1193-fcdeee04.js';
7
+ import './createClient-5258d590.js';
package/dist/wallet.js ADDED
@@ -0,0 +1,24 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+ var _chunkVOK5ALITjs = require('./chunk-VOK5ALIT.js');
12
+ require('./chunk-EAD66IDC.js');
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+ exports.addChain = _chunkVOK5ALITjs.addChain; exports.getAccounts = _chunkVOK5ALITjs.getAccounts; exports.getPermissions = _chunkVOK5ALITjs.getPermissions; exports.requestAccounts = _chunkVOK5ALITjs.requestAccounts; exports.requestPermissions = _chunkVOK5ALITjs.requestPermissions; exports.sendTransaction = _chunkVOK5ALITjs.sendTransaction; exports.signMessage = _chunkVOK5ALITjs.signMessage; exports.switchChain = _chunkVOK5ALITjs.switchChain; exports.watchAsset = _chunkVOK5ALITjs.watchAsset;
24
+ //# sourceMappingURL=wallet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ import {
2
+ addChain,
3
+ getAccounts,
4
+ getPermissions,
5
+ requestAccounts,
6
+ requestPermissions,
7
+ sendTransaction,
8
+ signMessage,
9
+ switchChain,
10
+ watchAsset
11
+ } from "./chunk-IP3NSE7H.mjs";
12
+ import "./chunk-25AJVKAT.mjs";
13
+ export {
14
+ addChain,
15
+ getAccounts,
16
+ getPermissions,
17
+ requestAccounts,
18
+ requestPermissions,
19
+ sendTransaction,
20
+ signMessage,
21
+ switchChain,
22
+ watchAsset
23
+ };
24
+ //# sourceMappingURL=wallet.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}