@gitmyabi/feesplitterv2 0.0.0-stage → 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.
@@ -0,0 +1,490 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+ /**
5
+ * FeeSplitterV2_json ABI
6
+ *
7
+ * This ABI is typed using viem's type system for full type safety.
8
+ */
9
+ export const FeeSplitterV2_jsonAbi = [
10
+ {
11
+ "inputs": [
12
+ {
13
+ "internalType": "address payable",
14
+ "name": "_addr1",
15
+ "type": "address"
16
+ },
17
+ {
18
+ "internalType": "uint256",
19
+ "name": "_split1",
20
+ "type": "uint256"
21
+ },
22
+ {
23
+ "internalType": "address payable",
24
+ "name": "_addr2",
25
+ "type": "address"
26
+ }
27
+ ],
28
+ "stateMutability": "nonpayable",
29
+ "type": "constructor"
30
+ },
31
+ {
32
+ "stateMutability": "payable",
33
+ "type": "fallback"
34
+ },
35
+ {
36
+ "inputs": [
37
+ {
38
+ "internalType": "address payable",
39
+ "name": "_addr1",
40
+ "type": "address"
41
+ }
42
+ ],
43
+ "name": "ChangeAddress1",
44
+ "outputs": [],
45
+ "stateMutability": "nonpayable",
46
+ "type": "function"
47
+ },
48
+ {
49
+ "inputs": [
50
+ {
51
+ "internalType": "address payable",
52
+ "name": "_addr2",
53
+ "type": "address"
54
+ }
55
+ ],
56
+ "name": "ChangeAddress2",
57
+ "outputs": [],
58
+ "stateMutability": "nonpayable",
59
+ "type": "function"
60
+ },
61
+ {
62
+ "inputs": [],
63
+ "name": "GetSplitPct",
64
+ "outputs": [
65
+ {
66
+ "internalType": "uint256",
67
+ "name": "",
68
+ "type": "uint256"
69
+ },
70
+ {
71
+ "internalType": "uint256",
72
+ "name": "",
73
+ "type": "uint256"
74
+ }
75
+ ],
76
+ "stateMutability": "view",
77
+ "type": "function"
78
+ },
79
+ {
80
+ "inputs": [
81
+ {
82
+ "internalType": "address",
83
+ "name": "_ERC20Addr",
84
+ "type": "address"
85
+ }
86
+ ],
87
+ "name": "GetWithdrawableERC20",
88
+ "outputs": [
89
+ {
90
+ "internalType": "uint256",
91
+ "name": "v1",
92
+ "type": "uint256"
93
+ },
94
+ {
95
+ "internalType": "uint256",
96
+ "name": "v2",
97
+ "type": "uint256"
98
+ }
99
+ ],
100
+ "stateMutability": "view",
101
+ "type": "function"
102
+ },
103
+ {
104
+ "inputs": [],
105
+ "name": "GetWithdrawableETH",
106
+ "outputs": [
107
+ {
108
+ "internalType": "uint256",
109
+ "name": "v1",
110
+ "type": "uint256"
111
+ },
112
+ {
113
+ "internalType": "uint256",
114
+ "name": "v2",
115
+ "type": "uint256"
116
+ }
117
+ ],
118
+ "stateMutability": "view",
119
+ "type": "function"
120
+ },
121
+ {
122
+ "inputs": [
123
+ {
124
+ "internalType": "address",
125
+ "name": "_ERC20Addr",
126
+ "type": "address"
127
+ }
128
+ ],
129
+ "name": "WithdrawERC20",
130
+ "outputs": [],
131
+ "stateMutability": "nonpayable",
132
+ "type": "function"
133
+ },
134
+ {
135
+ "inputs": [],
136
+ "name": "WithdrawETH",
137
+ "outputs": [],
138
+ "stateMutability": "nonpayable",
139
+ "type": "function"
140
+ },
141
+ {
142
+ "inputs": [],
143
+ "name": "addr1",
144
+ "outputs": [
145
+ {
146
+ "internalType": "address payable",
147
+ "name": "",
148
+ "type": "address"
149
+ }
150
+ ],
151
+ "stateMutability": "view",
152
+ "type": "function"
153
+ },
154
+ {
155
+ "inputs": [],
156
+ "name": "addr2",
157
+ "outputs": [
158
+ {
159
+ "internalType": "address payable",
160
+ "name": "",
161
+ "type": "address"
162
+ }
163
+ ],
164
+ "stateMutability": "view",
165
+ "type": "function"
166
+ },
167
+ {
168
+ "stateMutability": "payable",
169
+ "type": "receive"
170
+ }
171
+ ] as const satisfies Abi;
172
+
173
+ /**
174
+ * Type-safe ABI for FeeSplitterV2_json
175
+ */
176
+ export type FeeSplitterV2_jsonAbi = typeof FeeSplitterV2_jsonAbi;
177
+
178
+ /**
179
+ * Contract instance type for FeeSplitterV2_json
180
+ */
181
+ // Use any for contract type to avoid complex viem type issues
182
+ // The runtime behavior is type-safe through viem's ABI typing
183
+ export type FeeSplitterV2_jsonContract = any;
184
+
185
+ /**
186
+ * FeeSplitterV2_json Contract Class
187
+ *
188
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
189
+ *
190
+ * @example
191
+ * ```typescript
192
+ * import { createPublicClient, createWalletClient, http } from 'viem';
193
+ * import { mainnet } from 'viem/chains';
194
+ * import { FeeSplitterV2_json } from 'FeeSplitterV2_json';
195
+ *
196
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
197
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
198
+ *
199
+ * const contract = new FeeSplitterV2_json('0x...', { publicClient, walletClient });
200
+ *
201
+ * // Read functions
202
+ * const result = await contract.balanceOf('0x...');
203
+ *
204
+ * // Write functions
205
+ * const hash = await contract.transfer('0x...', 1000n);
206
+ *
207
+ * // Simulate transactions (dry-run)
208
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
209
+ * console.log('Gas estimate:', simulation.request.gas);
210
+ *
211
+ * // Watch events
212
+ * const unwatch = contract.watch.Transfer((event) => {
213
+ * console.log('Transfer event:', event);
214
+ * });
215
+ * ```
216
+ */
217
+ export class FeeSplitterV2_json {
218
+ private contract: FeeSplitterV2_jsonContract;
219
+ private contractAddress: Address;
220
+ private publicClient: PublicClient;
221
+
222
+ constructor(
223
+ address: Address,
224
+ clients: {
225
+ publicClient: PublicClient;
226
+ walletClient?: WalletClient;
227
+ }
228
+ ) {
229
+ this.contractAddress = address;
230
+ this.publicClient = clients.publicClient;
231
+ this.contract = getContract({
232
+ address,
233
+ abi: FeeSplitterV2_jsonAbi,
234
+ client: {
235
+ public: clients.publicClient,
236
+ wallet: clients.walletClient,
237
+ },
238
+ });
239
+ }
240
+
241
+ /**
242
+ * Get the contract address
243
+ */
244
+ get address(): Address {
245
+ return this.contractAddress;
246
+ }
247
+
248
+ /**
249
+ * Get the underlying viem contract instance
250
+ */
251
+ getContract(): FeeSplitterV2_jsonContract {
252
+ return this.contract;
253
+ }
254
+
255
+ /**
256
+ * GetSplitPct
257
+ * view
258
+ */
259
+ async GetSplitPct(): Promise<[bigint, bigint]> {
260
+ return this.contract.read.GetSplitPct() as Promise<[bigint, bigint]>;
261
+ }
262
+
263
+ /**
264
+ * GetWithdrawableERC20
265
+ * view
266
+ */
267
+ async GetWithdrawableERC20(_ERC20Addr: `0x${string}`): Promise<[bigint, bigint]> {
268
+ return this.contract.read.GetWithdrawableERC20([_ERC20Addr] as const) as Promise<[bigint, bigint]>;
269
+ }
270
+
271
+ /**
272
+ * GetWithdrawableETH
273
+ * view
274
+ */
275
+ async GetWithdrawableETH(): Promise<[bigint, bigint]> {
276
+ return this.contract.read.GetWithdrawableETH() as Promise<[bigint, bigint]>;
277
+ }
278
+
279
+ /**
280
+ * addr1
281
+ * view
282
+ */
283
+ async addr1(): Promise<`0x${string}`> {
284
+ return this.contract.read.addr1() as Promise<`0x${string}`>;
285
+ }
286
+
287
+ /**
288
+ * addr2
289
+ * view
290
+ */
291
+ async addr2(): Promise<`0x${string}`> {
292
+ return this.contract.read.addr2() as Promise<`0x${string}`>;
293
+ }
294
+
295
+ /**
296
+ * ChangeAddress1
297
+ * nonpayable
298
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
299
+ */
300
+ async ChangeAddress1(_addr1: `0x${string}`, options?: {
301
+ accessList?: import('viem').AccessList;
302
+ authorizationList?: import('viem').AuthorizationList;
303
+ chain?: import('viem').Chain | null;
304
+ dataSuffix?: `0x${string}`;
305
+ gas?: bigint;
306
+ gasPrice?: bigint;
307
+ maxFeePerGas?: bigint;
308
+ maxPriorityFeePerGas?: bigint;
309
+ nonce?: number;
310
+ value?: bigint;
311
+ }): Promise<`0x${string}`> {
312
+ if (!this.contract.write) {
313
+ throw new Error('Wallet client is required for write operations');
314
+ }
315
+ return this.contract.write.ChangeAddress1([_addr1] as const, options) as Promise<`0x${string}`>;
316
+ }
317
+
318
+ /**
319
+ * ChangeAddress2
320
+ * nonpayable
321
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
322
+ */
323
+ async ChangeAddress2(_addr2: `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<`0x${string}`> {
335
+ if (!this.contract.write) {
336
+ throw new Error('Wallet client is required for write operations');
337
+ }
338
+ return this.contract.write.ChangeAddress2([_addr2] as const, options) as Promise<`0x${string}`>;
339
+ }
340
+
341
+ /**
342
+ * WithdrawERC20
343
+ * nonpayable
344
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
345
+ */
346
+ async WithdrawERC20(_ERC20Addr: `0x${string}`, options?: {
347
+ accessList?: import('viem').AccessList;
348
+ authorizationList?: import('viem').AuthorizationList;
349
+ chain?: import('viem').Chain | null;
350
+ dataSuffix?: `0x${string}`;
351
+ gas?: bigint;
352
+ gasPrice?: bigint;
353
+ maxFeePerGas?: bigint;
354
+ maxPriorityFeePerGas?: bigint;
355
+ nonce?: number;
356
+ value?: bigint;
357
+ }): Promise<`0x${string}`> {
358
+ if (!this.contract.write) {
359
+ throw new Error('Wallet client is required for write operations');
360
+ }
361
+ return this.contract.write.WithdrawERC20([_ERC20Addr] as const, options) as Promise<`0x${string}`>;
362
+ }
363
+
364
+ /**
365
+ * WithdrawETH
366
+ * nonpayable
367
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
368
+ */
369
+ async WithdrawETH(options?: {
370
+ accessList?: import('viem').AccessList;
371
+ authorizationList?: import('viem').AuthorizationList;
372
+ chain?: import('viem').Chain | null;
373
+ dataSuffix?: `0x${string}`;
374
+ gas?: bigint;
375
+ gasPrice?: bigint;
376
+ maxFeePerGas?: bigint;
377
+ maxPriorityFeePerGas?: bigint;
378
+ nonce?: number;
379
+ value?: bigint;
380
+ }): Promise<`0x${string}`> {
381
+ if (!this.contract.write) {
382
+ throw new Error('Wallet client is required for write operations');
383
+ }
384
+ return this.contract.write.WithdrawETH(options) as Promise<`0x${string}`>;
385
+ }
386
+
387
+
388
+
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
+ const contract = this.contract;
399
+ if (!contract.simulate) {
400
+ throw new Error('Public client is required for simulation');
401
+ }
402
+ return {
403
+ /**
404
+ * Simulate ChangeAddress1
405
+ * Returns gas estimate and result without sending transaction
406
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
407
+ */
408
+ async ChangeAddress1(_addr1: `0x${string}`, options?: {
409
+ accessList?: import('viem').AccessList;
410
+ authorizationList?: import('viem').AuthorizationList;
411
+ chain?: import('viem').Chain | null;
412
+ dataSuffix?: `0x${string}`;
413
+ gas?: bigint;
414
+ gasPrice?: bigint;
415
+ maxFeePerGas?: bigint;
416
+ maxPriorityFeePerGas?: bigint;
417
+ nonce?: number;
418
+ value?: bigint;
419
+ }): Promise<void> {
420
+ return contract.simulate.ChangeAddress1([_addr1] as const, options) as Promise<void>;
421
+ },
422
+ /**
423
+ * Simulate ChangeAddress2
424
+ * Returns gas estimate and result without sending transaction
425
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
426
+ */
427
+ async ChangeAddress2(_addr2: `0x${string}`, options?: {
428
+ accessList?: import('viem').AccessList;
429
+ authorizationList?: import('viem').AuthorizationList;
430
+ chain?: import('viem').Chain | null;
431
+ dataSuffix?: `0x${string}`;
432
+ gas?: bigint;
433
+ gasPrice?: bigint;
434
+ maxFeePerGas?: bigint;
435
+ maxPriorityFeePerGas?: bigint;
436
+ nonce?: number;
437
+ value?: bigint;
438
+ }): Promise<void> {
439
+ return contract.simulate.ChangeAddress2([_addr2] as const, options) as Promise<void>;
440
+ },
441
+ /**
442
+ * Simulate WithdrawERC20
443
+ * Returns gas estimate and result without sending transaction
444
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
445
+ */
446
+ async WithdrawERC20(_ERC20Addr: `0x${string}`, options?: {
447
+ accessList?: import('viem').AccessList;
448
+ authorizationList?: import('viem').AuthorizationList;
449
+ chain?: import('viem').Chain | null;
450
+ dataSuffix?: `0x${string}`;
451
+ gas?: bigint;
452
+ gasPrice?: bigint;
453
+ maxFeePerGas?: bigint;
454
+ maxPriorityFeePerGas?: bigint;
455
+ nonce?: number;
456
+ value?: bigint;
457
+ }): Promise<void> {
458
+ return contract.simulate.WithdrawERC20([_ERC20Addr] as const, options) as Promise<void>;
459
+ },
460
+ /**
461
+ * Simulate WithdrawETH
462
+ * Returns gas estimate and result without sending transaction
463
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
464
+ */
465
+ async WithdrawETH(options?: {
466
+ accessList?: import('viem').AccessList;
467
+ authorizationList?: import('viem').AuthorizationList;
468
+ chain?: import('viem').Chain | null;
469
+ dataSuffix?: `0x${string}`;
470
+ gas?: bigint;
471
+ gasPrice?: bigint;
472
+ maxFeePerGas?: bigint;
473
+ maxPriorityFeePerGas?: bigint;
474
+ nonce?: number;
475
+ value?: bigint;
476
+ }): Promise<void> {
477
+ return contract.simulate.WithdrawETH(options) as Promise<void>;
478
+ }
479
+ };
480
+ }
481
+
482
+ /**
483
+ * Watch contract events
484
+ *
485
+ * Note: This contract has no events, so watch returns an empty object.
486
+ */
487
+ get watch() {
488
+ return {};
489
+ }
490
+ }
@@ -0,0 +1,2 @@
1
+ export { FeeSplitterV2_jsonAbi, FeeSplitterV2_json } from './FeeSplitterV2_json';
2
+ export type { FeeSplitterV2_jsonAbi as FeeSplitterV2_jsonAbiType, FeeSplitterV2_jsonContract } from './FeeSplitterV2_json';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FeeSplitterV2_json = exports.FeeSplitterV2_jsonAbi = void 0;
4
+ // Auto-generated exports for all contracts
5
+ var FeeSplitterV2_json_1 = require("./FeeSplitterV2_json");
6
+ Object.defineProperty(exports, "FeeSplitterV2_jsonAbi", { enumerable: true, get: function () { return FeeSplitterV2_json_1.FeeSplitterV2_jsonAbi; } });
7
+ Object.defineProperty(exports, "FeeSplitterV2_json", { enumerable: true, get: function () { return FeeSplitterV2_json_1.FeeSplitterV2_json; } });
@@ -0,0 +1,3 @@
1
+ // Auto-generated exports for all contracts
2
+ export { FeeSplitterV2_jsonAbi, FeeSplitterV2_json } from './FeeSplitterV2_json';
3
+ export type { FeeSplitterV2_jsonAbi as FeeSplitterV2_jsonAbiType, FeeSplitterV2_jsonContract } from './FeeSplitterV2_json';
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './contracts';
package/index.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ // Auto-generated TypeScript type bindings
3
+ // This file exports all generated contract types
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ __exportStar(require("./contracts"), exports);
package/package.json CHANGED
@@ -1,6 +1,43 @@
1
1
  {
2
2
  "name": "@gitmyabi/feesplitterv2",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "1.0.0",
4
+ "description": "Auto-generated TypeScript type bindings for FeeSplitterV2 (build etherscan-feesplitterv2-48e1f3f5-1793448949378, commit a058c0e, branch etherscan)",
5
+ "main": "./index.js",
6
+ "types": "./index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./index.js",
10
+ "require": "./index.js",
11
+ "types": "./index.d.ts"
12
+ },
13
+ "./contracts": {
14
+ "import": "./contracts/index.js",
15
+ "require": "./contracts/index.js",
16
+ "types": "./contracts/index.d.ts"
17
+ }
18
+ },
19
+ "files": [
20
+ "index.js",
21
+ "index.d.ts",
22
+ "contracts"
23
+ ],
24
+ "keywords": [
25
+ "ethereum",
26
+ "smart-contracts",
27
+ "viem",
28
+ "wagmi",
29
+ "typescript",
30
+ "abi",
31
+ "ethers-v6"
32
+ ],
33
+ "license": "MIT",
34
+ "dependencies": {
35
+ "viem": "^2.0.0"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "https://github.com/etherscan/feesplitterv2"
40
+ },
41
+ "branch": "etherscan",
42
+ "shortHash": "a058c0e"
6
43
  }