@gitmyabi/treasury 1.0.2 → 1.0.3

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,17 +2,17 @@
2
2
 
3
3
  Auto-generated TypeScript type bindings for **Treasury**
4
4
 
5
- - **Build ID**: `etherscan-treasury-0bd99639-1788208435901`
5
+ - **Build ID**: `etherscan-treasury-f1da938c-1789010682080`
6
6
  - **Build Number**: 1
7
- - **Commit**: `666b5cd`
7
+ - **Commit**: `6828721`
8
8
  - **Branch**: `etherscan`
9
9
  - **Target**: `ethers-v6`
10
- - **Contracts**: 1
10
+ - **Contracts**: 2
11
11
 
12
12
  ## Installation
13
13
 
14
14
  ```bash
15
- npm install @gitmyabi/treasury@1.0.2
15
+ npm install @gitmyabi/treasury@1.0.3
16
16
  ```
17
17
 
18
18
  ## Usage
@@ -101,7 +101,7 @@ This package provides full TypeScript type safety for all contract methods, even
101
101
 
102
102
  ## Generated Contracts
103
103
 
104
- This package includes type bindings for 1 contract(s) generated from ABI artifacts.
104
+ This package includes type bindings for 2 contract(s) generated from ABI artifacts.
105
105
 
106
106
  ## License
107
107
 
@@ -0,0 +1,145 @@
1
+ import type { Address, PublicClient, WalletClient } from 'viem';
2
+ /**
3
+ * ERC1967Proxy_json ABI
4
+ *
5
+ * This ABI is typed using viem's type system for full type safety.
6
+ */
7
+ export declare const ERC1967Proxy_jsonAbi: readonly [{
8
+ readonly inputs: readonly [{
9
+ readonly internalType: "address";
10
+ readonly name: "_logic";
11
+ readonly type: "address";
12
+ }, {
13
+ readonly internalType: "bytes";
14
+ readonly name: "_data";
15
+ readonly type: "bytes";
16
+ }];
17
+ readonly stateMutability: "payable";
18
+ readonly type: "constructor";
19
+ }, {
20
+ readonly inputs: readonly [];
21
+ readonly name: "DELEGATE_CALL_FAILED";
22
+ readonly type: "error";
23
+ }, {
24
+ readonly inputs: readonly [];
25
+ readonly name: "INVALID_TARGET";
26
+ readonly type: "error";
27
+ }, {
28
+ readonly inputs: readonly [{
29
+ readonly internalType: "address";
30
+ readonly name: "impl";
31
+ readonly type: "address";
32
+ }];
33
+ readonly name: "INVALID_UPGRADE";
34
+ readonly type: "error";
35
+ }, {
36
+ readonly inputs: readonly [];
37
+ readonly name: "ONLY_UUPS";
38
+ readonly type: "error";
39
+ }, {
40
+ readonly inputs: readonly [];
41
+ readonly name: "UNSUPPORTED_UUID";
42
+ readonly type: "error";
43
+ }, {
44
+ readonly anonymous: false;
45
+ readonly inputs: readonly [{
46
+ readonly indexed: false;
47
+ readonly internalType: "address";
48
+ readonly name: "impl";
49
+ readonly type: "address";
50
+ }];
51
+ readonly name: "Upgraded";
52
+ readonly type: "event";
53
+ }, {
54
+ readonly stateMutability: "payable";
55
+ readonly type: "fallback";
56
+ }, {
57
+ readonly stateMutability: "payable";
58
+ readonly type: "receive";
59
+ }];
60
+ /**
61
+ * Type-safe ABI for ERC1967Proxy_json
62
+ */
63
+ export type ERC1967Proxy_jsonAbi = typeof ERC1967Proxy_jsonAbi;
64
+ /**
65
+ * Contract instance type for ERC1967Proxy_json
66
+ */
67
+ export type ERC1967Proxy_jsonContract = any;
68
+ /**
69
+ * ERC1967Proxy_json Contract Class
70
+ *
71
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
72
+ *
73
+ * @example
74
+ * ```typescript
75
+ * import { createPublicClient, createWalletClient, http } from 'viem';
76
+ * import { mainnet } from 'viem/chains';
77
+ * import { ERC1967Proxy_json } from 'ERC1967Proxy_json';
78
+ *
79
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
80
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
81
+ *
82
+ * const contract = new ERC1967Proxy_json('0x...', { publicClient, walletClient });
83
+ *
84
+ * // Read functions
85
+ * const result = await contract.balanceOf('0x...');
86
+ *
87
+ * // Write functions
88
+ * const hash = await contract.transfer('0x...', 1000n);
89
+ *
90
+ * // Simulate transactions (dry-run)
91
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
92
+ * console.log('Gas estimate:', simulation.request.gas);
93
+ *
94
+ * // Watch events
95
+ * const unwatch = contract.watch.Transfer((event) => {
96
+ * console.log('Transfer event:', event);
97
+ * });
98
+ * ```
99
+ */
100
+ export declare class ERC1967Proxy_json {
101
+ private contract;
102
+ private contractAddress;
103
+ private publicClient;
104
+ constructor(address: Address, clients: {
105
+ publicClient: PublicClient;
106
+ walletClient?: WalletClient;
107
+ });
108
+ /**
109
+ * Get the contract address
110
+ */
111
+ get address(): Address;
112
+ /**
113
+ * Get the underlying viem contract instance
114
+ */
115
+ getContract(): ERC1967Proxy_jsonContract;
116
+ /**
117
+ * Simulate contract write operations (dry-run without sending transaction)
118
+ *
119
+ * Note: This contract has no write functions, so simulate returns an empty object.
120
+ */
121
+ get simulate(): {};
122
+ /**
123
+ * Watch contract events
124
+ *
125
+ * @example
126
+ * // Watch all Transfer events
127
+ * const unwatch = contract.watch.Transfer((event) => {
128
+ * console.log('Transfer:', event);
129
+ * });
130
+ *
131
+ * // Stop watching
132
+ * unwatch();
133
+ */
134
+ get watch(): {
135
+ /**
136
+ * Watch Upgraded events
137
+ * @param callback Function to call when event is emitted
138
+ * @param filter Optional filter for indexed parameters
139
+ * @returns Unwatch function to stop listening
140
+ */
141
+ Upgraded: (callback: (event: {
142
+ impl: `0x${string}`;
143
+ }) => void) => () => void;
144
+ };
145
+ }
@@ -0,0 +1,182 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ERC1967Proxy_json = exports.ERC1967Proxy_jsonAbi = void 0;
4
+ const viem_1 = require("viem");
5
+ /**
6
+ * ERC1967Proxy_json ABI
7
+ *
8
+ * This ABI is typed using viem's type system for full type safety.
9
+ */
10
+ exports.ERC1967Proxy_jsonAbi = [
11
+ {
12
+ "inputs": [
13
+ {
14
+ "internalType": "address",
15
+ "name": "_logic",
16
+ "type": "address"
17
+ },
18
+ {
19
+ "internalType": "bytes",
20
+ "name": "_data",
21
+ "type": "bytes"
22
+ }
23
+ ],
24
+ "stateMutability": "payable",
25
+ "type": "constructor"
26
+ },
27
+ {
28
+ "inputs": [],
29
+ "name": "DELEGATE_CALL_FAILED",
30
+ "type": "error"
31
+ },
32
+ {
33
+ "inputs": [],
34
+ "name": "INVALID_TARGET",
35
+ "type": "error"
36
+ },
37
+ {
38
+ "inputs": [
39
+ {
40
+ "internalType": "address",
41
+ "name": "impl",
42
+ "type": "address"
43
+ }
44
+ ],
45
+ "name": "INVALID_UPGRADE",
46
+ "type": "error"
47
+ },
48
+ {
49
+ "inputs": [],
50
+ "name": "ONLY_UUPS",
51
+ "type": "error"
52
+ },
53
+ {
54
+ "inputs": [],
55
+ "name": "UNSUPPORTED_UUID",
56
+ "type": "error"
57
+ },
58
+ {
59
+ "anonymous": false,
60
+ "inputs": [
61
+ {
62
+ "indexed": false,
63
+ "internalType": "address",
64
+ "name": "impl",
65
+ "type": "address"
66
+ }
67
+ ],
68
+ "name": "Upgraded",
69
+ "type": "event"
70
+ },
71
+ {
72
+ "stateMutability": "payable",
73
+ "type": "fallback"
74
+ },
75
+ {
76
+ "stateMutability": "payable",
77
+ "type": "receive"
78
+ }
79
+ ];
80
+ /**
81
+ * ERC1967Proxy_json Contract Class
82
+ *
83
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
84
+ *
85
+ * @example
86
+ * ```typescript
87
+ * import { createPublicClient, createWalletClient, http } from 'viem';
88
+ * import { mainnet } from 'viem/chains';
89
+ * import { ERC1967Proxy_json } from 'ERC1967Proxy_json';
90
+ *
91
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
92
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
93
+ *
94
+ * const contract = new ERC1967Proxy_json('0x...', { publicClient, walletClient });
95
+ *
96
+ * // Read functions
97
+ * const result = await contract.balanceOf('0x...');
98
+ *
99
+ * // Write functions
100
+ * const hash = await contract.transfer('0x...', 1000n);
101
+ *
102
+ * // Simulate transactions (dry-run)
103
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
104
+ * console.log('Gas estimate:', simulation.request.gas);
105
+ *
106
+ * // Watch events
107
+ * const unwatch = contract.watch.Transfer((event) => {
108
+ * console.log('Transfer event:', event);
109
+ * });
110
+ * ```
111
+ */
112
+ class ERC1967Proxy_json {
113
+ constructor(address, clients) {
114
+ this.contractAddress = address;
115
+ this.publicClient = clients.publicClient;
116
+ this.contract = (0, viem_1.getContract)({
117
+ address,
118
+ abi: exports.ERC1967Proxy_jsonAbi,
119
+ client: {
120
+ public: clients.publicClient,
121
+ wallet: clients.walletClient,
122
+ },
123
+ });
124
+ }
125
+ /**
126
+ * Get the contract address
127
+ */
128
+ get address() {
129
+ return this.contractAddress;
130
+ }
131
+ /**
132
+ * Get the underlying viem contract instance
133
+ */
134
+ getContract() {
135
+ return this.contract;
136
+ }
137
+ // No read functions
138
+ // No write functions
139
+ /**
140
+ * Simulate contract write operations (dry-run without sending transaction)
141
+ *
142
+ * Note: This contract has no write functions, so simulate returns an empty object.
143
+ */
144
+ get simulate() {
145
+ return {};
146
+ }
147
+ /**
148
+ * Watch contract events
149
+ *
150
+ * @example
151
+ * // Watch all Transfer events
152
+ * const unwatch = contract.watch.Transfer((event) => {
153
+ * console.log('Transfer:', event);
154
+ * });
155
+ *
156
+ * // Stop watching
157
+ * unwatch();
158
+ */
159
+ get watch() {
160
+ return {
161
+ /**
162
+ * Watch Upgraded events
163
+ * @param callback Function to call when event is emitted
164
+ * @param filter Optional filter for indexed parameters
165
+ * @returns Unwatch function to stop listening
166
+ */
167
+ Upgraded: (callback) => {
168
+ return this.publicClient.watchContractEvent({
169
+ address: this.contractAddress,
170
+ abi: exports.ERC1967Proxy_jsonAbi,
171
+ eventName: 'Upgraded',
172
+ onLogs: (logs) => {
173
+ logs.forEach((log) => {
174
+ callback(log.args);
175
+ });
176
+ },
177
+ });
178
+ }
179
+ };
180
+ }
181
+ }
182
+ exports.ERC1967Proxy_json = ERC1967Proxy_json;
@@ -0,0 +1,212 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+ /**
5
+ * ERC1967Proxy_json ABI
6
+ *
7
+ * This ABI is typed using viem's type system for full type safety.
8
+ */
9
+ export const ERC1967Proxy_jsonAbi = [
10
+ {
11
+ "inputs": [
12
+ {
13
+ "internalType": "address",
14
+ "name": "_logic",
15
+ "type": "address"
16
+ },
17
+ {
18
+ "internalType": "bytes",
19
+ "name": "_data",
20
+ "type": "bytes"
21
+ }
22
+ ],
23
+ "stateMutability": "payable",
24
+ "type": "constructor"
25
+ },
26
+ {
27
+ "inputs": [],
28
+ "name": "DELEGATE_CALL_FAILED",
29
+ "type": "error"
30
+ },
31
+ {
32
+ "inputs": [],
33
+ "name": "INVALID_TARGET",
34
+ "type": "error"
35
+ },
36
+ {
37
+ "inputs": [
38
+ {
39
+ "internalType": "address",
40
+ "name": "impl",
41
+ "type": "address"
42
+ }
43
+ ],
44
+ "name": "INVALID_UPGRADE",
45
+ "type": "error"
46
+ },
47
+ {
48
+ "inputs": [],
49
+ "name": "ONLY_UUPS",
50
+ "type": "error"
51
+ },
52
+ {
53
+ "inputs": [],
54
+ "name": "UNSUPPORTED_UUID",
55
+ "type": "error"
56
+ },
57
+ {
58
+ "anonymous": false,
59
+ "inputs": [
60
+ {
61
+ "indexed": false,
62
+ "internalType": "address",
63
+ "name": "impl",
64
+ "type": "address"
65
+ }
66
+ ],
67
+ "name": "Upgraded",
68
+ "type": "event"
69
+ },
70
+ {
71
+ "stateMutability": "payable",
72
+ "type": "fallback"
73
+ },
74
+ {
75
+ "stateMutability": "payable",
76
+ "type": "receive"
77
+ }
78
+ ] as const satisfies Abi;
79
+
80
+ /**
81
+ * Type-safe ABI for ERC1967Proxy_json
82
+ */
83
+ export type ERC1967Proxy_jsonAbi = typeof ERC1967Proxy_jsonAbi;
84
+
85
+ /**
86
+ * Contract instance type for ERC1967Proxy_json
87
+ */
88
+ // Use any for contract type to avoid complex viem type issues
89
+ // The runtime behavior is type-safe through viem's ABI typing
90
+ export type ERC1967Proxy_jsonContract = any;
91
+
92
+ /**
93
+ * ERC1967Proxy_json Contract Class
94
+ *
95
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
96
+ *
97
+ * @example
98
+ * ```typescript
99
+ * import { createPublicClient, createWalletClient, http } from 'viem';
100
+ * import { mainnet } from 'viem/chains';
101
+ * import { ERC1967Proxy_json } from 'ERC1967Proxy_json';
102
+ *
103
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
104
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
105
+ *
106
+ * const contract = new ERC1967Proxy_json('0x...', { publicClient, walletClient });
107
+ *
108
+ * // Read functions
109
+ * const result = await contract.balanceOf('0x...');
110
+ *
111
+ * // Write functions
112
+ * const hash = await contract.transfer('0x...', 1000n);
113
+ *
114
+ * // Simulate transactions (dry-run)
115
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
116
+ * console.log('Gas estimate:', simulation.request.gas);
117
+ *
118
+ * // Watch events
119
+ * const unwatch = contract.watch.Transfer((event) => {
120
+ * console.log('Transfer event:', event);
121
+ * });
122
+ * ```
123
+ */
124
+ export class ERC1967Proxy_json {
125
+ private contract: ERC1967Proxy_jsonContract;
126
+ private contractAddress: Address;
127
+ private publicClient: PublicClient;
128
+
129
+ constructor(
130
+ address: Address,
131
+ clients: {
132
+ publicClient: PublicClient;
133
+ walletClient?: WalletClient;
134
+ }
135
+ ) {
136
+ this.contractAddress = address;
137
+ this.publicClient = clients.publicClient;
138
+ this.contract = getContract({
139
+ address,
140
+ abi: ERC1967Proxy_jsonAbi,
141
+ client: {
142
+ public: clients.publicClient,
143
+ wallet: clients.walletClient,
144
+ },
145
+ });
146
+ }
147
+
148
+ /**
149
+ * Get the contract address
150
+ */
151
+ get address(): Address {
152
+ return this.contractAddress;
153
+ }
154
+
155
+ /**
156
+ * Get the underlying viem contract instance
157
+ */
158
+ getContract(): ERC1967Proxy_jsonContract {
159
+ return this.contract;
160
+ }
161
+
162
+ // No read functions
163
+
164
+ // No write functions
165
+
166
+
167
+
168
+ /**
169
+ * Simulate contract write operations (dry-run without sending transaction)
170
+ *
171
+ * Note: This contract has no write functions, so simulate returns an empty object.
172
+ */
173
+ get simulate() {
174
+ return {};
175
+ }
176
+
177
+ /**
178
+ * Watch contract events
179
+ *
180
+ * @example
181
+ * // Watch all Transfer events
182
+ * const unwatch = contract.watch.Transfer((event) => {
183
+ * console.log('Transfer:', event);
184
+ * });
185
+ *
186
+ * // Stop watching
187
+ * unwatch();
188
+ */
189
+ get watch() {
190
+ return {
191
+ /**
192
+ * Watch Upgraded events
193
+ * @param callback Function to call when event is emitted
194
+ * @param filter Optional filter for indexed parameters
195
+ * @returns Unwatch function to stop listening
196
+ */
197
+ Upgraded: (callback: (event: { impl: `0x${string}` }) => void) => {
198
+ return this.publicClient.watchContractEvent({
199
+ address: this.contractAddress,
200
+ abi: ERC1967Proxy_jsonAbi,
201
+ eventName: 'Upgraded',
202
+
203
+ onLogs: (logs: any[]) => {
204
+ logs.forEach((log: any) => {
205
+ callback(log.args as any);
206
+ });
207
+ },
208
+ }) as () => void;
209
+ }
210
+ };
211
+ }
212
+ }