@gitmyabi/basewallet 1.0.0

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 ADDED
@@ -0,0 +1,108 @@
1
+ # @gitmyabi/basewallet
2
+
3
+ Auto-generated TypeScript type bindings for **BaseWallet**
4
+
5
+ - **Build ID**: `etherscan-basewallet-3f396521-1786067444929`
6
+ - **Build Number**: 1
7
+ - **Commit**: `db5aee1`
8
+ - **Branch**: `etherscan`
9
+ - **Target**: `ethers-v6`
10
+ - **Contracts**: 2
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install @gitmyabi/basewallet@1.0.0
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ### Class-based API (TypeChain-like)
21
+
22
+ ```typescript
23
+ import { createPublicClient, createWalletClient, http } from 'viem';
24
+ import { mainnet } from 'viem/chains';
25
+ import { YourContract } from '@gitmyabi/basewallet';
26
+
27
+ const publicClient = createPublicClient({ chain: mainnet, transport: http() });
28
+ const walletClient = createWalletClient({ chain: mainnet, transport: http() });
29
+
30
+ // Create contract instance
31
+ const contract = new YourContract('0x...', { publicClient, walletClient });
32
+
33
+ // Read functions - call directly like TypeChain!
34
+ const result = await contract.yourMethod(param1, param2);
35
+
36
+ // Write functions - also call directly!
37
+ const hash = await contract.transfer('0x...', 1000n);
38
+ ```
39
+
40
+ ### With viem directly
41
+
42
+ ```typescript
43
+ import { createPublicClient, http } from 'viem';
44
+ import { mainnet } from 'viem/chains';
45
+ import { YourContractAbi } from '@gitmyabi/basewallet';
46
+
47
+ const client = createPublicClient({
48
+ chain: mainnet,
49
+ transport: http(),
50
+ });
51
+
52
+ // Fully typed contract read
53
+ const result = await client.readContract({
54
+ address: '0x...',
55
+ abi: YourContractAbi,
56
+ functionName: 'yourMethod',
57
+ args: [param1, param2],
58
+ });
59
+
60
+ // Fully typed contract write
61
+ const hash = await client.writeContract({
62
+ address: '0x...',
63
+ abi: YourContractAbi,
64
+ functionName: 'yourMethod',
65
+ args: [param1, param2],
66
+ });
67
+ ```
68
+
69
+ ### With wagmi
70
+
71
+ ```typescript
72
+ import { useReadContract, useWriteContract } from 'wagmi';
73
+ import { YourContractAbi } from '@gitmyabi/basewallet';
74
+
75
+ function MyComponent() {
76
+ const { data } = useReadContract({
77
+ address: '0x...',
78
+ abi: YourContractAbi,
79
+ functionName: 'yourMethod',
80
+ args: [param1, param2],
81
+ });
82
+
83
+ const { writeContract } = useWriteContract();
84
+
85
+ const handleWrite = () => {
86
+ writeContract({
87
+ address: '0x...',
88
+ abi: YourContractAbi,
89
+ functionName: 'yourMethod',
90
+ args: [param1, param2],
91
+ });
92
+ };
93
+
94
+ return <button onClick={handleWrite}>Call Contract</button>;
95
+ }
96
+ ```
97
+
98
+ ## Type Safety
99
+
100
+ This package provides full TypeScript type safety for all contract methods, events, and parameters using viem's type system. All ABIs are exported as `const` assertions for maximum type inference.
101
+
102
+ ## Generated Contracts
103
+
104
+ This package includes type bindings for 2 contract(s) generated from ABI artifacts.
105
+
106
+ ## License
107
+
108
+ MIT
@@ -0,0 +1,555 @@
1
+ import type { Address, PublicClient, WalletClient } from 'viem';
2
+ /**
3
+ * BaseWallet_json ABI
4
+ *
5
+ * This ABI is typed using viem's type system for full type safety.
6
+ */
7
+ export declare const BaseWallet_jsonAbi: readonly [{
8
+ readonly constant: false;
9
+ readonly inputs: readonly [{
10
+ readonly name: "_newOwner";
11
+ readonly type: "address";
12
+ }];
13
+ readonly name: "setOwner";
14
+ readonly outputs: readonly [];
15
+ readonly payable: false;
16
+ readonly stateMutability: "nonpayable";
17
+ readonly type: "function";
18
+ }, {
19
+ readonly constant: false;
20
+ readonly inputs: readonly [{
21
+ readonly name: "_module";
22
+ readonly type: "address";
23
+ }, {
24
+ readonly name: "_method";
25
+ readonly type: "bytes4";
26
+ }];
27
+ readonly name: "enableStaticCall";
28
+ readonly outputs: readonly [];
29
+ readonly payable: false;
30
+ readonly stateMutability: "nonpayable";
31
+ readonly type: "function";
32
+ }, {
33
+ readonly constant: false;
34
+ readonly inputs: readonly [{
35
+ readonly name: "_module";
36
+ readonly type: "address";
37
+ }, {
38
+ readonly name: "_value";
39
+ readonly type: "bool";
40
+ }];
41
+ readonly name: "authoriseModule";
42
+ readonly outputs: readonly [];
43
+ readonly payable: false;
44
+ readonly stateMutability: "nonpayable";
45
+ readonly type: "function";
46
+ }, {
47
+ readonly constant: false;
48
+ readonly inputs: readonly [{
49
+ readonly name: "_owner";
50
+ readonly type: "address";
51
+ }, {
52
+ readonly name: "_modules";
53
+ readonly type: "address[]";
54
+ }];
55
+ readonly name: "init";
56
+ readonly outputs: readonly [];
57
+ readonly payable: false;
58
+ readonly stateMutability: "nonpayable";
59
+ readonly type: "function";
60
+ }, {
61
+ readonly constant: true;
62
+ readonly inputs: readonly [];
63
+ readonly name: "implementation";
64
+ readonly outputs: readonly [{
65
+ readonly name: "";
66
+ readonly type: "address";
67
+ }];
68
+ readonly payable: false;
69
+ readonly stateMutability: "view";
70
+ readonly type: "function";
71
+ }, {
72
+ readonly constant: true;
73
+ readonly inputs: readonly [{
74
+ readonly name: "";
75
+ readonly type: "bytes4";
76
+ }];
77
+ readonly name: "enabled";
78
+ readonly outputs: readonly [{
79
+ readonly name: "";
80
+ readonly type: "address";
81
+ }];
82
+ readonly payable: false;
83
+ readonly stateMutability: "view";
84
+ readonly type: "function";
85
+ }, {
86
+ readonly constant: true;
87
+ readonly inputs: readonly [];
88
+ readonly name: "owner";
89
+ readonly outputs: readonly [{
90
+ readonly name: "";
91
+ readonly type: "address";
92
+ }];
93
+ readonly payable: false;
94
+ readonly stateMutability: "view";
95
+ readonly type: "function";
96
+ }, {
97
+ readonly constant: false;
98
+ readonly inputs: readonly [{
99
+ readonly name: "_target";
100
+ readonly type: "address";
101
+ }, {
102
+ readonly name: "_value";
103
+ readonly type: "uint256";
104
+ }, {
105
+ readonly name: "_data";
106
+ readonly type: "bytes";
107
+ }];
108
+ readonly name: "invoke";
109
+ readonly outputs: readonly [];
110
+ readonly payable: false;
111
+ readonly stateMutability: "nonpayable";
112
+ readonly type: "function";
113
+ }, {
114
+ readonly constant: true;
115
+ readonly inputs: readonly [{
116
+ readonly name: "";
117
+ readonly type: "address";
118
+ }];
119
+ readonly name: "authorised";
120
+ readonly outputs: readonly [{
121
+ readonly name: "";
122
+ readonly type: "bool";
123
+ }];
124
+ readonly payable: false;
125
+ readonly stateMutability: "view";
126
+ readonly type: "function";
127
+ }, {
128
+ readonly constant: true;
129
+ readonly inputs: readonly [];
130
+ readonly name: "modules";
131
+ readonly outputs: readonly [{
132
+ readonly name: "";
133
+ readonly type: "uint256";
134
+ }];
135
+ readonly payable: false;
136
+ readonly stateMutability: "view";
137
+ readonly type: "function";
138
+ }, {
139
+ readonly payable: true;
140
+ readonly stateMutability: "payable";
141
+ readonly type: "fallback";
142
+ }, {
143
+ readonly anonymous: false;
144
+ readonly inputs: readonly [{
145
+ readonly indexed: true;
146
+ readonly name: "module";
147
+ readonly type: "address";
148
+ }, {
149
+ readonly indexed: false;
150
+ readonly name: "value";
151
+ readonly type: "bool";
152
+ }];
153
+ readonly name: "AuthorisedModule";
154
+ readonly type: "event";
155
+ }, {
156
+ readonly anonymous: false;
157
+ readonly inputs: readonly [{
158
+ readonly indexed: true;
159
+ readonly name: "module";
160
+ readonly type: "address";
161
+ }, {
162
+ readonly indexed: true;
163
+ readonly name: "method";
164
+ readonly type: "bytes4";
165
+ }];
166
+ readonly name: "EnabledStaticCall";
167
+ readonly type: "event";
168
+ }, {
169
+ readonly anonymous: false;
170
+ readonly inputs: readonly [{
171
+ readonly indexed: true;
172
+ readonly name: "module";
173
+ readonly type: "address";
174
+ }, {
175
+ readonly indexed: true;
176
+ readonly name: "target";
177
+ readonly type: "address";
178
+ }, {
179
+ readonly indexed: true;
180
+ readonly name: "value";
181
+ readonly type: "uint256";
182
+ }, {
183
+ readonly indexed: false;
184
+ readonly name: "data";
185
+ readonly type: "bytes";
186
+ }];
187
+ readonly name: "Invoked";
188
+ readonly type: "event";
189
+ }, {
190
+ readonly anonymous: false;
191
+ readonly inputs: readonly [{
192
+ readonly indexed: true;
193
+ readonly name: "value";
194
+ readonly type: "uint256";
195
+ }, {
196
+ readonly indexed: true;
197
+ readonly name: "sender";
198
+ readonly type: "address";
199
+ }, {
200
+ readonly indexed: false;
201
+ readonly name: "data";
202
+ readonly type: "bytes";
203
+ }];
204
+ readonly name: "Received";
205
+ readonly type: "event";
206
+ }, {
207
+ readonly anonymous: false;
208
+ readonly inputs: readonly [{
209
+ readonly indexed: false;
210
+ readonly name: "owner";
211
+ readonly type: "address";
212
+ }];
213
+ readonly name: "OwnerChanged";
214
+ readonly type: "event";
215
+ }];
216
+ /**
217
+ * Type-safe ABI for BaseWallet_json
218
+ */
219
+ export type BaseWallet_jsonAbi = typeof BaseWallet_jsonAbi;
220
+ /**
221
+ * Contract instance type for BaseWallet_json
222
+ */
223
+ export type BaseWallet_jsonContract = any;
224
+ /**
225
+ * BaseWallet_json Contract Class
226
+ *
227
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
228
+ *
229
+ * @example
230
+ * ```typescript
231
+ * import { createPublicClient, createWalletClient, http } from 'viem';
232
+ * import { mainnet } from 'viem/chains';
233
+ * import { BaseWallet_json } from 'BaseWallet_json';
234
+ *
235
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
236
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
237
+ *
238
+ * const contract = new BaseWallet_json('0x...', { publicClient, walletClient });
239
+ *
240
+ * // Read functions
241
+ * const result = await contract.balanceOf('0x...');
242
+ *
243
+ * // Write functions
244
+ * const hash = await contract.transfer('0x...', 1000n);
245
+ *
246
+ * // Simulate transactions (dry-run)
247
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
248
+ * console.log('Gas estimate:', simulation.request.gas);
249
+ *
250
+ * // Watch events
251
+ * const unwatch = contract.watch.Transfer((event) => {
252
+ * console.log('Transfer event:', event);
253
+ * });
254
+ * ```
255
+ */
256
+ export declare class BaseWallet_json {
257
+ private contract;
258
+ private contractAddress;
259
+ private publicClient;
260
+ constructor(address: Address, clients: {
261
+ publicClient: PublicClient;
262
+ walletClient?: WalletClient;
263
+ });
264
+ /**
265
+ * Get the contract address
266
+ */
267
+ get address(): Address;
268
+ /**
269
+ * Get the underlying viem contract instance
270
+ */
271
+ getContract(): BaseWallet_jsonContract;
272
+ /**
273
+ * implementation
274
+ * view
275
+ */
276
+ implementation(): Promise<`0x${string}`>;
277
+ /**
278
+ * enabled
279
+ * view
280
+ */
281
+ enabled(arg0: `0x${string}`): Promise<`0x${string}`>;
282
+ /**
283
+ * owner
284
+ * view
285
+ */
286
+ owner(): Promise<`0x${string}`>;
287
+ /**
288
+ * authorised
289
+ * view
290
+ */
291
+ authorised(arg0: `0x${string}`): Promise<boolean>;
292
+ /**
293
+ * modules
294
+ * view
295
+ */
296
+ modules(): Promise<bigint>;
297
+ /**
298
+ * setOwner
299
+ * nonpayable
300
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
301
+ */
302
+ setOwner(_newOwner: `0x${string}`, options?: {
303
+ accessList?: import('viem').AccessList;
304
+ authorizationList?: import('viem').AuthorizationList;
305
+ chain?: import('viem').Chain | null;
306
+ dataSuffix?: `0x${string}`;
307
+ gas?: bigint;
308
+ gasPrice?: bigint;
309
+ maxFeePerGas?: bigint;
310
+ maxPriorityFeePerGas?: bigint;
311
+ nonce?: number;
312
+ value?: bigint;
313
+ }): Promise<`0x${string}`>;
314
+ /**
315
+ * enableStaticCall
316
+ * nonpayable
317
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
318
+ */
319
+ enableStaticCall(_module: `0x${string}`, _method: `0x${string}`, options?: {
320
+ accessList?: import('viem').AccessList;
321
+ authorizationList?: import('viem').AuthorizationList;
322
+ chain?: import('viem').Chain | null;
323
+ dataSuffix?: `0x${string}`;
324
+ gas?: bigint;
325
+ gasPrice?: bigint;
326
+ maxFeePerGas?: bigint;
327
+ maxPriorityFeePerGas?: bigint;
328
+ nonce?: number;
329
+ value?: bigint;
330
+ }): Promise<`0x${string}`>;
331
+ /**
332
+ * authoriseModule
333
+ * nonpayable
334
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
335
+ */
336
+ authoriseModule(_module: `0x${string}`, _value: boolean, options?: {
337
+ accessList?: import('viem').AccessList;
338
+ authorizationList?: import('viem').AuthorizationList;
339
+ chain?: import('viem').Chain | null;
340
+ dataSuffix?: `0x${string}`;
341
+ gas?: bigint;
342
+ gasPrice?: bigint;
343
+ maxFeePerGas?: bigint;
344
+ maxPriorityFeePerGas?: bigint;
345
+ nonce?: number;
346
+ value?: bigint;
347
+ }): Promise<`0x${string}`>;
348
+ /**
349
+ * init
350
+ * nonpayable
351
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
352
+ */
353
+ init(_owner: `0x${string}`, _modules: `0x${string}`[], options?: {
354
+ accessList?: import('viem').AccessList;
355
+ authorizationList?: import('viem').AuthorizationList;
356
+ chain?: import('viem').Chain | null;
357
+ dataSuffix?: `0x${string}`;
358
+ gas?: bigint;
359
+ gasPrice?: bigint;
360
+ maxFeePerGas?: bigint;
361
+ maxPriorityFeePerGas?: bigint;
362
+ nonce?: number;
363
+ value?: bigint;
364
+ }): Promise<`0x${string}`>;
365
+ /**
366
+ * invoke
367
+ * nonpayable
368
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
369
+ */
370
+ invoke(_target: `0x${string}`, _value: bigint, _data: `0x${string}`, options?: {
371
+ accessList?: import('viem').AccessList;
372
+ authorizationList?: import('viem').AuthorizationList;
373
+ chain?: import('viem').Chain | null;
374
+ dataSuffix?: `0x${string}`;
375
+ gas?: bigint;
376
+ gasPrice?: bigint;
377
+ maxFeePerGas?: bigint;
378
+ maxPriorityFeePerGas?: bigint;
379
+ nonce?: number;
380
+ value?: bigint;
381
+ }): Promise<`0x${string}`>;
382
+ /**
383
+ * Simulate contract write operations (dry-run without sending transaction)
384
+ *
385
+ * @example
386
+ * const result = await contract.simulate.transfer('0x...', 1000n);
387
+ * console.log('Gas estimate:', result.request.gas);
388
+ * console.log('Would succeed:', result.result);
389
+ */
390
+ get simulate(): {
391
+ /**
392
+ * Simulate setOwner
393
+ * Returns gas estimate and result without sending transaction
394
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
395
+ */
396
+ setOwner(_newOwner: `0x${string}`, options?: {
397
+ accessList?: import("viem").AccessList;
398
+ authorizationList?: import("viem").AuthorizationList;
399
+ chain?: import("viem").Chain | null;
400
+ dataSuffix?: `0x${string}`;
401
+ gas?: bigint;
402
+ gasPrice?: bigint;
403
+ maxFeePerGas?: bigint;
404
+ maxPriorityFeePerGas?: bigint;
405
+ nonce?: number;
406
+ value?: bigint;
407
+ }): Promise<void>;
408
+ /**
409
+ * Simulate enableStaticCall
410
+ * Returns gas estimate and result without sending transaction
411
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
412
+ */
413
+ enableStaticCall(_module: `0x${string}`, _method: `0x${string}`, options?: {
414
+ accessList?: import("viem").AccessList;
415
+ authorizationList?: import("viem").AuthorizationList;
416
+ chain?: import("viem").Chain | null;
417
+ dataSuffix?: `0x${string}`;
418
+ gas?: bigint;
419
+ gasPrice?: bigint;
420
+ maxFeePerGas?: bigint;
421
+ maxPriorityFeePerGas?: bigint;
422
+ nonce?: number;
423
+ value?: bigint;
424
+ }): Promise<void>;
425
+ /**
426
+ * Simulate authoriseModule
427
+ * Returns gas estimate and result without sending transaction
428
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
429
+ */
430
+ authoriseModule(_module: `0x${string}`, _value: boolean, options?: {
431
+ accessList?: import("viem").AccessList;
432
+ authorizationList?: import("viem").AuthorizationList;
433
+ chain?: import("viem").Chain | null;
434
+ dataSuffix?: `0x${string}`;
435
+ gas?: bigint;
436
+ gasPrice?: bigint;
437
+ maxFeePerGas?: bigint;
438
+ maxPriorityFeePerGas?: bigint;
439
+ nonce?: number;
440
+ value?: bigint;
441
+ }): Promise<void>;
442
+ /**
443
+ * Simulate init
444
+ * Returns gas estimate and result without sending transaction
445
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
446
+ */
447
+ init(_owner: `0x${string}`, _modules: `0x${string}`[], options?: {
448
+ accessList?: import("viem").AccessList;
449
+ authorizationList?: import("viem").AuthorizationList;
450
+ chain?: import("viem").Chain | null;
451
+ dataSuffix?: `0x${string}`;
452
+ gas?: bigint;
453
+ gasPrice?: bigint;
454
+ maxFeePerGas?: bigint;
455
+ maxPriorityFeePerGas?: bigint;
456
+ nonce?: number;
457
+ value?: bigint;
458
+ }): Promise<void>;
459
+ /**
460
+ * Simulate invoke
461
+ * Returns gas estimate and result without sending transaction
462
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
463
+ */
464
+ invoke(_target: `0x${string}`, _value: bigint, _data: `0x${string}`, options?: {
465
+ accessList?: import("viem").AccessList;
466
+ authorizationList?: import("viem").AuthorizationList;
467
+ chain?: import("viem").Chain | null;
468
+ dataSuffix?: `0x${string}`;
469
+ gas?: bigint;
470
+ gasPrice?: bigint;
471
+ maxFeePerGas?: bigint;
472
+ maxPriorityFeePerGas?: bigint;
473
+ nonce?: number;
474
+ value?: bigint;
475
+ }): Promise<void>;
476
+ };
477
+ /**
478
+ * Watch contract events
479
+ *
480
+ * @example
481
+ * // Watch all Transfer events
482
+ * const unwatch = contract.watch.Transfer((event) => {
483
+ * console.log('Transfer:', event);
484
+ * });
485
+ *
486
+ * // Stop watching
487
+ * unwatch();
488
+ */
489
+ get watch(): {
490
+ /**
491
+ * Watch AuthorisedModule events
492
+ * @param callback Function to call when event is emitted
493
+ * @param filter Optional filter for indexed parameters
494
+ * @returns Unwatch function to stop listening
495
+ */
496
+ AuthorisedModule: (callback: (event: {
497
+ module: `0x${string}`;
498
+ value: boolean;
499
+ }) => void, filter?: {
500
+ module: `0x${string}`;
501
+ }) => () => void;
502
+ /**
503
+ * Watch EnabledStaticCall events
504
+ * @param callback Function to call when event is emitted
505
+ * @param filter Optional filter for indexed parameters
506
+ * @returns Unwatch function to stop listening
507
+ */
508
+ EnabledStaticCall: (callback: (event: {
509
+ module: `0x${string}`;
510
+ method: `0x${string}`;
511
+ }) => void, filter?: {
512
+ module: `0x${string}`;
513
+ method: `0x${string}`;
514
+ }) => () => void;
515
+ /**
516
+ * Watch Invoked events
517
+ * @param callback Function to call when event is emitted
518
+ * @param filter Optional filter for indexed parameters
519
+ * @returns Unwatch function to stop listening
520
+ */
521
+ Invoked: (callback: (event: {
522
+ module: `0x${string}`;
523
+ target: `0x${string}`;
524
+ value: bigint;
525
+ data: `0x${string}`;
526
+ }) => void, filter?: {
527
+ module: `0x${string}`;
528
+ target: `0x${string}`;
529
+ value: bigint;
530
+ }) => () => void;
531
+ /**
532
+ * Watch Received events
533
+ * @param callback Function to call when event is emitted
534
+ * @param filter Optional filter for indexed parameters
535
+ * @returns Unwatch function to stop listening
536
+ */
537
+ Received: (callback: (event: {
538
+ value: bigint;
539
+ sender: `0x${string}`;
540
+ data: `0x${string}`;
541
+ }) => void, filter?: {
542
+ value: bigint;
543
+ sender: `0x${string}`;
544
+ }) => () => void;
545
+ /**
546
+ * Watch OwnerChanged events
547
+ * @param callback Function to call when event is emitted
548
+ * @param filter Optional filter for indexed parameters
549
+ * @returns Unwatch function to stop listening
550
+ */
551
+ OwnerChanged: (callback: (event: {
552
+ owner: `0x${string}`;
553
+ }) => void) => () => void;
554
+ };
555
+ }