@gitmyabi/erc20 1.0.0 → 1.0.2

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/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Auto-generated TypeScript type bindings for **ERC20**
4
4
 
5
- - **Build ID**: `etherscan-erc20-cdd981ef-1787662240317`
5
+ - **Build ID**: `etherscan-erc20-3335733c-1793997005446`
6
6
  - **Build Number**: 1
7
- - **Commit**: `0b5abf6`
7
+ - **Commit**: `fb0e79e`
8
8
  - **Branch**: `etherscan`
9
9
  - **Target**: `ethers-v6`
10
10
  - **Contracts**: 1
@@ -12,7 +12,7 @@ Auto-generated TypeScript type bindings for **ERC20**
12
12
  ## Installation
13
13
 
14
14
  ```bash
15
- npm install @gitmyabi/erc20@1.0.0
15
+ npm install @gitmyabi/erc20@1.0.2
16
16
  ```
17
17
 
18
18
  ## Usage
@@ -105,4 +105,4 @@ This package includes type bindings for 1 contract(s) generated from ABI artifac
105
105
 
106
106
  ## License
107
107
 
108
- MIT
108
+ Apache License 2.0
@@ -0,0 +1,389 @@
1
+ import type { Address, PublicClient, WalletClient } from 'viem';
2
+ /**
3
+ * ERC20Proxy ABI
4
+ *
5
+ * This ABI is typed using viem's type system for full type safety.
6
+ */
7
+ export declare const ERC20ProxyAbi: readonly [{
8
+ readonly inputs: readonly [{
9
+ readonly internalType: "address";
10
+ readonly name: "_owner";
11
+ readonly type: "address";
12
+ }, {
13
+ readonly internalType: "address";
14
+ readonly name: "_diamond";
15
+ readonly type: "address";
16
+ }];
17
+ readonly stateMutability: "nonpayable";
18
+ readonly type: "constructor";
19
+ }, {
20
+ readonly inputs: readonly [];
21
+ readonly name: "InvalidAmount";
22
+ readonly type: "error";
23
+ }, {
24
+ readonly inputs: readonly [];
25
+ readonly name: "LengthMissmatch";
26
+ readonly type: "error";
27
+ }, {
28
+ readonly inputs: readonly [];
29
+ readonly name: "NoTransferToNullAddress";
30
+ readonly type: "error";
31
+ }, {
32
+ readonly inputs: readonly [];
33
+ readonly name: "NotInitialized";
34
+ readonly type: "error";
35
+ }, {
36
+ readonly inputs: readonly [];
37
+ readonly name: "NullAddrIsNotAnERC20Token";
38
+ readonly type: "error";
39
+ }, {
40
+ readonly inputs: readonly [];
41
+ readonly name: "SliceOutOfBounds";
42
+ readonly type: "error";
43
+ }, {
44
+ readonly inputs: readonly [];
45
+ readonly name: "SliceOverflow";
46
+ readonly type: "error";
47
+ }, {
48
+ readonly inputs: readonly [];
49
+ readonly name: "ZeroAddress";
50
+ readonly type: "error";
51
+ }, {
52
+ readonly anonymous: false;
53
+ readonly inputs: readonly [{
54
+ readonly indexed: false;
55
+ readonly internalType: "address";
56
+ readonly name: "diamond";
57
+ readonly type: "address";
58
+ }];
59
+ readonly name: "DiamondSet";
60
+ readonly type: "event";
61
+ }, {
62
+ readonly anonymous: false;
63
+ readonly inputs: readonly [{
64
+ readonly indexed: true;
65
+ readonly internalType: "address";
66
+ readonly name: "previousOwner";
67
+ readonly type: "address";
68
+ }, {
69
+ readonly indexed: true;
70
+ readonly internalType: "address";
71
+ readonly name: "newOwner";
72
+ readonly type: "address";
73
+ }];
74
+ readonly name: "OwnershipTransferred";
75
+ readonly type: "event";
76
+ }, {
77
+ readonly inputs: readonly [];
78
+ readonly name: "diamond";
79
+ readonly outputs: readonly [{
80
+ readonly internalType: "address";
81
+ readonly name: "";
82
+ readonly type: "address";
83
+ }];
84
+ readonly stateMutability: "view";
85
+ readonly type: "function";
86
+ }, {
87
+ readonly inputs: readonly [];
88
+ readonly name: "owner";
89
+ readonly outputs: readonly [{
90
+ readonly internalType: "address";
91
+ readonly name: "";
92
+ readonly type: "address";
93
+ }];
94
+ readonly stateMutability: "view";
95
+ readonly type: "function";
96
+ }, {
97
+ readonly inputs: readonly [];
98
+ readonly name: "renounceOwnership";
99
+ readonly outputs: readonly [];
100
+ readonly stateMutability: "nonpayable";
101
+ readonly type: "function";
102
+ }, {
103
+ readonly inputs: readonly [{
104
+ readonly internalType: "address";
105
+ readonly name: "_diamond";
106
+ readonly type: "address";
107
+ }];
108
+ readonly name: "setDiamond";
109
+ readonly outputs: readonly [];
110
+ readonly stateMutability: "nonpayable";
111
+ readonly type: "function";
112
+ }, {
113
+ readonly inputs: readonly [{
114
+ readonly internalType: "address[]";
115
+ readonly name: "tokens";
116
+ readonly type: "address[]";
117
+ }, {
118
+ readonly internalType: "uint256[]";
119
+ readonly name: "amounts";
120
+ readonly type: "uint256[]";
121
+ }, {
122
+ readonly internalType: "bytes";
123
+ readonly name: "facetCallData";
124
+ readonly type: "bytes";
125
+ }];
126
+ readonly name: "startViaRubic";
127
+ readonly outputs: readonly [];
128
+ readonly stateMutability: "payable";
129
+ readonly type: "function";
130
+ }, {
131
+ readonly inputs: readonly [{
132
+ readonly internalType: "address";
133
+ readonly name: "newOwner";
134
+ readonly type: "address";
135
+ }];
136
+ readonly name: "transferOwnership";
137
+ readonly outputs: readonly [];
138
+ readonly stateMutability: "nonpayable";
139
+ readonly type: "function";
140
+ }];
141
+ /**
142
+ * Type-safe ABI for ERC20Proxy
143
+ */
144
+ export type ERC20ProxyAbi = typeof ERC20ProxyAbi;
145
+ /**
146
+ * Contract instance type for ERC20Proxy
147
+ */
148
+ export type ERC20ProxyContract = any;
149
+ /**
150
+ * ERC20Proxy Contract Class
151
+ *
152
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
153
+ *
154
+ * @example
155
+ * ```typescript
156
+ * import { createPublicClient, createWalletClient, http } from 'viem';
157
+ * import { mainnet } from 'viem/chains';
158
+ * import { ERC20Proxy } from 'ERC20Proxy';
159
+ *
160
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
161
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
162
+ *
163
+ * const contract = new ERC20Proxy('0x...', { publicClient, walletClient });
164
+ *
165
+ * // Read functions
166
+ * const result = await contract.balanceOf('0x...');
167
+ *
168
+ * // Write functions
169
+ * const hash = await contract.transfer('0x...', 1000n);
170
+ *
171
+ * // Simulate transactions (dry-run)
172
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
173
+ * console.log('Gas estimate:', simulation.request.gas);
174
+ *
175
+ * // Watch events
176
+ * const unwatch = contract.watch.Transfer((event) => {
177
+ * console.log('Transfer event:', event);
178
+ * });
179
+ * ```
180
+ */
181
+ export declare class ERC20Proxy {
182
+ private contract;
183
+ private contractAddress;
184
+ private publicClient;
185
+ constructor(address: Address, clients: {
186
+ publicClient: PublicClient;
187
+ walletClient?: WalletClient;
188
+ });
189
+ /**
190
+ * Get the contract address
191
+ */
192
+ get address(): Address;
193
+ /**
194
+ * Get the underlying viem contract instance.
195
+ */
196
+ getContract(): ERC20ProxyContract;
197
+ /**
198
+ * diamond
199
+ * view
200
+ */
201
+ diamond(): Promise<`0x${string}`>;
202
+ /**
203
+ * owner
204
+ * view
205
+ */
206
+ owner(): Promise<`0x${string}`>;
207
+ /**
208
+ * renounceOwnership
209
+ * nonpayable
210
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
211
+ */
212
+ renounceOwnership(options?: {
213
+ accessList?: import('viem').AccessList;
214
+ authorizationList?: import('viem').AuthorizationList;
215
+ chain?: import('viem').Chain | null;
216
+ dataSuffix?: `0x${string}`;
217
+ gas?: bigint;
218
+ gasPrice?: bigint;
219
+ maxFeePerGas?: bigint;
220
+ maxPriorityFeePerGas?: bigint;
221
+ nonce?: number;
222
+ value?: bigint;
223
+ }): Promise<`0x${string}`>;
224
+ /**
225
+ * setDiamond
226
+ * nonpayable
227
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
228
+ */
229
+ setDiamond(_diamond: `0x${string}`, options?: {
230
+ accessList?: import('viem').AccessList;
231
+ authorizationList?: import('viem').AuthorizationList;
232
+ chain?: import('viem').Chain | null;
233
+ dataSuffix?: `0x${string}`;
234
+ gas?: bigint;
235
+ gasPrice?: bigint;
236
+ maxFeePerGas?: bigint;
237
+ maxPriorityFeePerGas?: bigint;
238
+ nonce?: number;
239
+ value?: bigint;
240
+ }): Promise<`0x${string}`>;
241
+ /**
242
+ * startViaRubic
243
+ * payable
244
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
245
+ */
246
+ startViaRubic(tokens: `0x${string}`[], amounts: bigint[], facetCallData: `0x${string}`, options?: {
247
+ accessList?: import('viem').AccessList;
248
+ authorizationList?: import('viem').AuthorizationList;
249
+ chain?: import('viem').Chain | null;
250
+ dataSuffix?: `0x${string}`;
251
+ gas?: bigint;
252
+ gasPrice?: bigint;
253
+ maxFeePerGas?: bigint;
254
+ maxPriorityFeePerGas?: bigint;
255
+ nonce?: number;
256
+ value?: bigint;
257
+ }): Promise<`0x${string}`>;
258
+ /**
259
+ * transferOwnership
260
+ * nonpayable
261
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
262
+ */
263
+ transferOwnership(newOwner: `0x${string}`, options?: {
264
+ accessList?: import('viem').AccessList;
265
+ authorizationList?: import('viem').AuthorizationList;
266
+ chain?: import('viem').Chain | null;
267
+ dataSuffix?: `0x${string}`;
268
+ gas?: bigint;
269
+ gasPrice?: bigint;
270
+ maxFeePerGas?: bigint;
271
+ maxPriorityFeePerGas?: bigint;
272
+ nonce?: number;
273
+ value?: bigint;
274
+ }): Promise<`0x${string}`>;
275
+ /**
276
+ * Simulate contract write operations (dry-run without sending transaction)
277
+ *
278
+ * @example
279
+ * const result = await contract.simulate.transfer('0x...', 1000n);
280
+ * console.log('Gas estimate:', result.request.gas);
281
+ * console.log('Would succeed:', result.result);
282
+ */
283
+ get simulate(): {
284
+ /**
285
+ * Simulate renounceOwnership
286
+ * Returns gas estimate and result without sending transaction
287
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
288
+ */
289
+ renounceOwnership(options?: {
290
+ accessList?: import("viem").AccessList;
291
+ authorizationList?: import("viem").AuthorizationList;
292
+ chain?: import("viem").Chain | null;
293
+ dataSuffix?: `0x${string}`;
294
+ gas?: bigint;
295
+ gasPrice?: bigint;
296
+ maxFeePerGas?: bigint;
297
+ maxPriorityFeePerGas?: bigint;
298
+ nonce?: number;
299
+ value?: bigint;
300
+ }): Promise<void>;
301
+ /**
302
+ * Simulate setDiamond
303
+ * Returns gas estimate and result without sending transaction
304
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
305
+ */
306
+ setDiamond(_diamond: `0x${string}`, options?: {
307
+ accessList?: import("viem").AccessList;
308
+ authorizationList?: import("viem").AuthorizationList;
309
+ chain?: import("viem").Chain | null;
310
+ dataSuffix?: `0x${string}`;
311
+ gas?: bigint;
312
+ gasPrice?: bigint;
313
+ maxFeePerGas?: bigint;
314
+ maxPriorityFeePerGas?: bigint;
315
+ nonce?: number;
316
+ value?: bigint;
317
+ }): Promise<void>;
318
+ /**
319
+ * Simulate startViaRubic
320
+ * Returns gas estimate and result without sending transaction
321
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
322
+ */
323
+ startViaRubic(tokens: `0x${string}`[], amounts: bigint[], facetCallData: `0x${string}`, options?: {
324
+ accessList?: import("viem").AccessList;
325
+ authorizationList?: import("viem").AuthorizationList;
326
+ chain?: import("viem").Chain | null;
327
+ dataSuffix?: `0x${string}`;
328
+ gas?: bigint;
329
+ gasPrice?: bigint;
330
+ maxFeePerGas?: bigint;
331
+ maxPriorityFeePerGas?: bigint;
332
+ nonce?: number;
333
+ value?: bigint;
334
+ }): Promise<void>;
335
+ /**
336
+ * Simulate transferOwnership
337
+ * Returns gas estimate and result without sending transaction
338
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
339
+ */
340
+ transferOwnership(newOwner: `0x${string}`, options?: {
341
+ accessList?: import("viem").AccessList;
342
+ authorizationList?: import("viem").AuthorizationList;
343
+ chain?: import("viem").Chain | null;
344
+ dataSuffix?: `0x${string}`;
345
+ gas?: bigint;
346
+ gasPrice?: bigint;
347
+ maxFeePerGas?: bigint;
348
+ maxPriorityFeePerGas?: bigint;
349
+ nonce?: number;
350
+ value?: bigint;
351
+ }): Promise<void>;
352
+ };
353
+ /**
354
+ * Watch contract events
355
+ *
356
+ * @example
357
+ * // Watch all Transfer events
358
+ * const unwatch = contract.watch.Transfer((event) => {
359
+ * console.log('Transfer:', event);
360
+ * });
361
+ *
362
+ * // Stop watching
363
+ * unwatch();
364
+ */
365
+ get watch(): {
366
+ /**
367
+ * Watch DiamondSet events
368
+ * @param callback Function to call when event is emitted
369
+ * @param filter Optional filter for indexed parameters
370
+ * @returns Unwatch function to stop listening
371
+ */
372
+ DiamondSet: (callback: (event: {
373
+ diamond: `0x${string}`;
374
+ }) => void) => () => void;
375
+ /**
376
+ * Watch OwnershipTransferred events
377
+ * @param callback Function to call when event is emitted
378
+ * @param filter Optional filter for indexed parameters
379
+ * @returns Unwatch function to stop listening
380
+ */
381
+ OwnershipTransferred: (callback: (event: {
382
+ previousOwner: `0x${string}`;
383
+ newOwner: `0x${string}`;
384
+ }) => void, filter?: {
385
+ previousOwner?: `0x${string}` | `0x${string}`[] | null;
386
+ newOwner?: `0x${string}` | `0x${string}`[] | null;
387
+ }) => () => void;
388
+ };
389
+ }