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