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