@gitmyabi/rootsecuritycontroller 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.
- package/README.md +107 -2
- package/contracts/RootSecurityController.d.ts +316 -0
- package/contracts/RootSecurityController.js +327 -0
- package/contracts/RootSecurityController.ts +427 -0
- package/contracts/index.d.ts +2 -0
- package/contracts/index.js +7 -0
- package/contracts/index.ts +3 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/package.json +40 -3
package/README.md
CHANGED
|
@@ -1,3 +1,108 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @gitmyabi/rootsecuritycontroller
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Auto-generated TypeScript type bindings for **RootSecurityController**
|
|
4
|
+
|
|
5
|
+
- **Build ID**: `etherscan-rootsecuritycontroller-95123b1e-1796192477091`
|
|
6
|
+
- **Build Number**: 1
|
|
7
|
+
- **Commit**: `6695eca`
|
|
8
|
+
- **Branch**: `etherscan`
|
|
9
|
+
- **Target**: `ethers-v6`
|
|
10
|
+
- **Contracts**: 1
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @gitmyabi/rootsecuritycontroller@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/rootsecuritycontroller';
|
|
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/rootsecuritycontroller';
|
|
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/rootsecuritycontroller';
|
|
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
|
+
Apache License 2.0
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import type { Address, PublicClient, WalletClient } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* RootSecurityController ABI
|
|
4
|
+
*
|
|
5
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
6
|
+
*/
|
|
7
|
+
export declare const RootSecurityControllerAbi: readonly [{
|
|
8
|
+
readonly inputs: readonly [{
|
|
9
|
+
readonly internalType: "contract Root";
|
|
10
|
+
readonly name: "_root";
|
|
11
|
+
readonly type: "address";
|
|
12
|
+
}];
|
|
13
|
+
readonly stateMutability: "nonpayable";
|
|
14
|
+
readonly type: "constructor";
|
|
15
|
+
}, {
|
|
16
|
+
readonly anonymous: false;
|
|
17
|
+
readonly inputs: readonly [{
|
|
18
|
+
readonly indexed: true;
|
|
19
|
+
readonly internalType: "address";
|
|
20
|
+
readonly name: "previousOwner";
|
|
21
|
+
readonly type: "address";
|
|
22
|
+
}, {
|
|
23
|
+
readonly indexed: true;
|
|
24
|
+
readonly internalType: "address";
|
|
25
|
+
readonly name: "newOwner";
|
|
26
|
+
readonly type: "address";
|
|
27
|
+
}];
|
|
28
|
+
readonly name: "OwnershipTransferred";
|
|
29
|
+
readonly type: "event";
|
|
30
|
+
}, {
|
|
31
|
+
readonly inputs: readonly [{
|
|
32
|
+
readonly internalType: "bytes32";
|
|
33
|
+
readonly name: "label";
|
|
34
|
+
readonly type: "bytes32";
|
|
35
|
+
}];
|
|
36
|
+
readonly name: "disableTLD";
|
|
37
|
+
readonly outputs: readonly [];
|
|
38
|
+
readonly stateMutability: "nonpayable";
|
|
39
|
+
readonly type: "function";
|
|
40
|
+
}, {
|
|
41
|
+
readonly inputs: readonly [];
|
|
42
|
+
readonly name: "ens";
|
|
43
|
+
readonly outputs: readonly [{
|
|
44
|
+
readonly internalType: "contract ENS";
|
|
45
|
+
readonly name: "";
|
|
46
|
+
readonly type: "address";
|
|
47
|
+
}];
|
|
48
|
+
readonly stateMutability: "view";
|
|
49
|
+
readonly type: "function";
|
|
50
|
+
}, {
|
|
51
|
+
readonly inputs: readonly [];
|
|
52
|
+
readonly name: "owner";
|
|
53
|
+
readonly outputs: readonly [{
|
|
54
|
+
readonly internalType: "address";
|
|
55
|
+
readonly name: "";
|
|
56
|
+
readonly type: "address";
|
|
57
|
+
}];
|
|
58
|
+
readonly stateMutability: "view";
|
|
59
|
+
readonly type: "function";
|
|
60
|
+
}, {
|
|
61
|
+
readonly inputs: readonly [];
|
|
62
|
+
readonly name: "renounceOwnership";
|
|
63
|
+
readonly outputs: readonly [];
|
|
64
|
+
readonly stateMutability: "nonpayable";
|
|
65
|
+
readonly type: "function";
|
|
66
|
+
}, {
|
|
67
|
+
readonly inputs: readonly [];
|
|
68
|
+
readonly name: "root";
|
|
69
|
+
readonly outputs: readonly [{
|
|
70
|
+
readonly internalType: "contract Root";
|
|
71
|
+
readonly name: "";
|
|
72
|
+
readonly type: "address";
|
|
73
|
+
}];
|
|
74
|
+
readonly stateMutability: "view";
|
|
75
|
+
readonly type: "function";
|
|
76
|
+
}, {
|
|
77
|
+
readonly inputs: readonly [{
|
|
78
|
+
readonly internalType: "bytes4";
|
|
79
|
+
readonly name: "interfaceId";
|
|
80
|
+
readonly type: "bytes4";
|
|
81
|
+
}];
|
|
82
|
+
readonly name: "supportsInterface";
|
|
83
|
+
readonly outputs: readonly [{
|
|
84
|
+
readonly internalType: "bool";
|
|
85
|
+
readonly name: "";
|
|
86
|
+
readonly type: "bool";
|
|
87
|
+
}];
|
|
88
|
+
readonly stateMutability: "view";
|
|
89
|
+
readonly type: "function";
|
|
90
|
+
}, {
|
|
91
|
+
readonly inputs: readonly [{
|
|
92
|
+
readonly internalType: "address";
|
|
93
|
+
readonly name: "newOwner";
|
|
94
|
+
readonly type: "address";
|
|
95
|
+
}];
|
|
96
|
+
readonly name: "transferOwnership";
|
|
97
|
+
readonly outputs: readonly [];
|
|
98
|
+
readonly stateMutability: "nonpayable";
|
|
99
|
+
readonly type: "function";
|
|
100
|
+
}];
|
|
101
|
+
/**
|
|
102
|
+
* Type-safe ABI for RootSecurityController
|
|
103
|
+
*/
|
|
104
|
+
export type RootSecurityControllerAbi = typeof RootSecurityControllerAbi;
|
|
105
|
+
/**
|
|
106
|
+
* Contract instance type for RootSecurityController
|
|
107
|
+
*/
|
|
108
|
+
export type RootSecurityControllerContract = any;
|
|
109
|
+
/**
|
|
110
|
+
* RootSecurityController Contract Class
|
|
111
|
+
*
|
|
112
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```typescript
|
|
116
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
117
|
+
* import { mainnet } from 'viem/chains';
|
|
118
|
+
* import { RootSecurityController } from 'RootSecurityController';
|
|
119
|
+
*
|
|
120
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
121
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
122
|
+
*
|
|
123
|
+
* const contract = new RootSecurityController('0x...', { publicClient, walletClient });
|
|
124
|
+
*
|
|
125
|
+
* // Read functions
|
|
126
|
+
* const result = await contract.balanceOf('0x...');
|
|
127
|
+
*
|
|
128
|
+
* // Write functions
|
|
129
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
130
|
+
*
|
|
131
|
+
* // Simulate transactions (dry-run)
|
|
132
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
133
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
134
|
+
*
|
|
135
|
+
* // Watch events
|
|
136
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
137
|
+
* console.log('Transfer event:', event);
|
|
138
|
+
* });
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
export declare class RootSecurityController {
|
|
142
|
+
private contract;
|
|
143
|
+
private contractAddress;
|
|
144
|
+
private publicClient;
|
|
145
|
+
constructor(address: Address, clients: {
|
|
146
|
+
publicClient: PublicClient;
|
|
147
|
+
walletClient?: WalletClient;
|
|
148
|
+
});
|
|
149
|
+
/**
|
|
150
|
+
* Get the contract address
|
|
151
|
+
*/
|
|
152
|
+
get address(): Address;
|
|
153
|
+
/**
|
|
154
|
+
* Get the underlying viem contract instance.
|
|
155
|
+
*/
|
|
156
|
+
getContract(): RootSecurityControllerContract;
|
|
157
|
+
/**
|
|
158
|
+
* ens
|
|
159
|
+
* view
|
|
160
|
+
*/
|
|
161
|
+
ens(): Promise<`0x${string}`>;
|
|
162
|
+
/**
|
|
163
|
+
* owner
|
|
164
|
+
* view
|
|
165
|
+
*/
|
|
166
|
+
owner(): Promise<`0x${string}`>;
|
|
167
|
+
/**
|
|
168
|
+
* root
|
|
169
|
+
* view
|
|
170
|
+
*/
|
|
171
|
+
root(): Promise<`0x${string}`>;
|
|
172
|
+
/**
|
|
173
|
+
* supportsInterface
|
|
174
|
+
* view
|
|
175
|
+
*/
|
|
176
|
+
supportsInterface(interfaceId: `0x${string}`): Promise<boolean>;
|
|
177
|
+
/**
|
|
178
|
+
* disableTLD
|
|
179
|
+
* nonpayable
|
|
180
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
181
|
+
*/
|
|
182
|
+
disableTLD(label: `0x${string}`, options?: {
|
|
183
|
+
accessList?: import('viem').AccessList;
|
|
184
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
185
|
+
chain?: import('viem').Chain | null;
|
|
186
|
+
dataSuffix?: `0x${string}`;
|
|
187
|
+
gas?: bigint;
|
|
188
|
+
gasPrice?: bigint;
|
|
189
|
+
maxFeePerGas?: bigint;
|
|
190
|
+
maxPriorityFeePerGas?: bigint;
|
|
191
|
+
nonce?: number;
|
|
192
|
+
value?: bigint;
|
|
193
|
+
}): Promise<`0x${string}`>;
|
|
194
|
+
/**
|
|
195
|
+
* renounceOwnership
|
|
196
|
+
* nonpayable
|
|
197
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
198
|
+
*/
|
|
199
|
+
renounceOwnership(options?: {
|
|
200
|
+
accessList?: import('viem').AccessList;
|
|
201
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
202
|
+
chain?: import('viem').Chain | null;
|
|
203
|
+
dataSuffix?: `0x${string}`;
|
|
204
|
+
gas?: bigint;
|
|
205
|
+
gasPrice?: bigint;
|
|
206
|
+
maxFeePerGas?: bigint;
|
|
207
|
+
maxPriorityFeePerGas?: bigint;
|
|
208
|
+
nonce?: number;
|
|
209
|
+
value?: bigint;
|
|
210
|
+
}): Promise<`0x${string}`>;
|
|
211
|
+
/**
|
|
212
|
+
* transferOwnership
|
|
213
|
+
* nonpayable
|
|
214
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
215
|
+
*/
|
|
216
|
+
transferOwnership(newOwner: `0x${string}`, options?: {
|
|
217
|
+
accessList?: import('viem').AccessList;
|
|
218
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
219
|
+
chain?: import('viem').Chain | null;
|
|
220
|
+
dataSuffix?: `0x${string}`;
|
|
221
|
+
gas?: bigint;
|
|
222
|
+
gasPrice?: bigint;
|
|
223
|
+
maxFeePerGas?: bigint;
|
|
224
|
+
maxPriorityFeePerGas?: bigint;
|
|
225
|
+
nonce?: number;
|
|
226
|
+
value?: bigint;
|
|
227
|
+
}): Promise<`0x${string}`>;
|
|
228
|
+
/**
|
|
229
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
233
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
234
|
+
* console.log('Would succeed:', result.result);
|
|
235
|
+
*/
|
|
236
|
+
get simulate(): {
|
|
237
|
+
/**
|
|
238
|
+
* Simulate disableTLD
|
|
239
|
+
* Returns gas estimate and result without sending transaction
|
|
240
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
241
|
+
*/
|
|
242
|
+
disableTLD(label: `0x${string}`, options?: {
|
|
243
|
+
accessList?: import("viem").AccessList;
|
|
244
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
245
|
+
chain?: import("viem").Chain | null;
|
|
246
|
+
dataSuffix?: `0x${string}`;
|
|
247
|
+
gas?: bigint;
|
|
248
|
+
gasPrice?: bigint;
|
|
249
|
+
maxFeePerGas?: bigint;
|
|
250
|
+
maxPriorityFeePerGas?: bigint;
|
|
251
|
+
nonce?: number;
|
|
252
|
+
value?: bigint;
|
|
253
|
+
}): Promise<void>;
|
|
254
|
+
/**
|
|
255
|
+
* Simulate renounceOwnership
|
|
256
|
+
* Returns gas estimate and result without sending transaction
|
|
257
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
258
|
+
*/
|
|
259
|
+
renounceOwnership(options?: {
|
|
260
|
+
accessList?: import("viem").AccessList;
|
|
261
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
262
|
+
chain?: import("viem").Chain | null;
|
|
263
|
+
dataSuffix?: `0x${string}`;
|
|
264
|
+
gas?: bigint;
|
|
265
|
+
gasPrice?: bigint;
|
|
266
|
+
maxFeePerGas?: bigint;
|
|
267
|
+
maxPriorityFeePerGas?: bigint;
|
|
268
|
+
nonce?: number;
|
|
269
|
+
value?: bigint;
|
|
270
|
+
}): Promise<void>;
|
|
271
|
+
/**
|
|
272
|
+
* Simulate transferOwnership
|
|
273
|
+
* Returns gas estimate and result without sending transaction
|
|
274
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
275
|
+
*/
|
|
276
|
+
transferOwnership(newOwner: `0x${string}`, options?: {
|
|
277
|
+
accessList?: import("viem").AccessList;
|
|
278
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
279
|
+
chain?: import("viem").Chain | null;
|
|
280
|
+
dataSuffix?: `0x${string}`;
|
|
281
|
+
gas?: bigint;
|
|
282
|
+
gasPrice?: bigint;
|
|
283
|
+
maxFeePerGas?: bigint;
|
|
284
|
+
maxPriorityFeePerGas?: bigint;
|
|
285
|
+
nonce?: number;
|
|
286
|
+
value?: bigint;
|
|
287
|
+
}): Promise<void>;
|
|
288
|
+
};
|
|
289
|
+
/**
|
|
290
|
+
* Watch contract events
|
|
291
|
+
*
|
|
292
|
+
* @example
|
|
293
|
+
* // Watch all Transfer events
|
|
294
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
295
|
+
* console.log('Transfer:', event);
|
|
296
|
+
* });
|
|
297
|
+
*
|
|
298
|
+
* // Stop watching
|
|
299
|
+
* unwatch();
|
|
300
|
+
*/
|
|
301
|
+
get watch(): {
|
|
302
|
+
/**
|
|
303
|
+
* Watch OwnershipTransferred events
|
|
304
|
+
* @param callback Function to call when event is emitted
|
|
305
|
+
* @param filter Optional filter for indexed parameters
|
|
306
|
+
* @returns Unwatch function to stop listening
|
|
307
|
+
*/
|
|
308
|
+
OwnershipTransferred: (callback: (event: {
|
|
309
|
+
previousOwner: `0x${string}`;
|
|
310
|
+
newOwner: `0x${string}`;
|
|
311
|
+
}) => void, filter?: {
|
|
312
|
+
previousOwner?: `0x${string}` | `0x${string}`[] | null;
|
|
313
|
+
newOwner?: `0x${string}` | `0x${string}`[] | null;
|
|
314
|
+
}) => () => void;
|
|
315
|
+
};
|
|
316
|
+
}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RootSecurityController = exports.RootSecurityControllerAbi = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
/**
|
|
6
|
+
* RootSecurityController ABI
|
|
7
|
+
*
|
|
8
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
9
|
+
*/
|
|
10
|
+
exports.RootSecurityControllerAbi = [
|
|
11
|
+
{
|
|
12
|
+
"inputs": [
|
|
13
|
+
{
|
|
14
|
+
"internalType": "contract Root",
|
|
15
|
+
"name": "_root",
|
|
16
|
+
"type": "address"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"stateMutability": "nonpayable",
|
|
20
|
+
"type": "constructor"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"anonymous": false,
|
|
24
|
+
"inputs": [
|
|
25
|
+
{
|
|
26
|
+
"indexed": true,
|
|
27
|
+
"internalType": "address",
|
|
28
|
+
"name": "previousOwner",
|
|
29
|
+
"type": "address"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"indexed": true,
|
|
33
|
+
"internalType": "address",
|
|
34
|
+
"name": "newOwner",
|
|
35
|
+
"type": "address"
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
"name": "OwnershipTransferred",
|
|
39
|
+
"type": "event"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"inputs": [
|
|
43
|
+
{
|
|
44
|
+
"internalType": "bytes32",
|
|
45
|
+
"name": "label",
|
|
46
|
+
"type": "bytes32"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"name": "disableTLD",
|
|
50
|
+
"outputs": [],
|
|
51
|
+
"stateMutability": "nonpayable",
|
|
52
|
+
"type": "function"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"inputs": [],
|
|
56
|
+
"name": "ens",
|
|
57
|
+
"outputs": [
|
|
58
|
+
{
|
|
59
|
+
"internalType": "contract ENS",
|
|
60
|
+
"name": "",
|
|
61
|
+
"type": "address"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"stateMutability": "view",
|
|
65
|
+
"type": "function"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"inputs": [],
|
|
69
|
+
"name": "owner",
|
|
70
|
+
"outputs": [
|
|
71
|
+
{
|
|
72
|
+
"internalType": "address",
|
|
73
|
+
"name": "",
|
|
74
|
+
"type": "address"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"stateMutability": "view",
|
|
78
|
+
"type": "function"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"inputs": [],
|
|
82
|
+
"name": "renounceOwnership",
|
|
83
|
+
"outputs": [],
|
|
84
|
+
"stateMutability": "nonpayable",
|
|
85
|
+
"type": "function"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
"inputs": [],
|
|
89
|
+
"name": "root",
|
|
90
|
+
"outputs": [
|
|
91
|
+
{
|
|
92
|
+
"internalType": "contract Root",
|
|
93
|
+
"name": "",
|
|
94
|
+
"type": "address"
|
|
95
|
+
}
|
|
96
|
+
],
|
|
97
|
+
"stateMutability": "view",
|
|
98
|
+
"type": "function"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"inputs": [
|
|
102
|
+
{
|
|
103
|
+
"internalType": "bytes4",
|
|
104
|
+
"name": "interfaceId",
|
|
105
|
+
"type": "bytes4"
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
"name": "supportsInterface",
|
|
109
|
+
"outputs": [
|
|
110
|
+
{
|
|
111
|
+
"internalType": "bool",
|
|
112
|
+
"name": "",
|
|
113
|
+
"type": "bool"
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
"stateMutability": "view",
|
|
117
|
+
"type": "function"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"inputs": [
|
|
121
|
+
{
|
|
122
|
+
"internalType": "address",
|
|
123
|
+
"name": "newOwner",
|
|
124
|
+
"type": "address"
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
"name": "transferOwnership",
|
|
128
|
+
"outputs": [],
|
|
129
|
+
"stateMutability": "nonpayable",
|
|
130
|
+
"type": "function"
|
|
131
|
+
}
|
|
132
|
+
];
|
|
133
|
+
/**
|
|
134
|
+
* RootSecurityController Contract Class
|
|
135
|
+
*
|
|
136
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```typescript
|
|
140
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
141
|
+
* import { mainnet } from 'viem/chains';
|
|
142
|
+
* import { RootSecurityController } from 'RootSecurityController';
|
|
143
|
+
*
|
|
144
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
145
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
146
|
+
*
|
|
147
|
+
* const contract = new RootSecurityController('0x...', { publicClient, walletClient });
|
|
148
|
+
*
|
|
149
|
+
* // Read functions
|
|
150
|
+
* const result = await contract.balanceOf('0x...');
|
|
151
|
+
*
|
|
152
|
+
* // Write functions
|
|
153
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
154
|
+
*
|
|
155
|
+
* // Simulate transactions (dry-run)
|
|
156
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
157
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
158
|
+
*
|
|
159
|
+
* // Watch events
|
|
160
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
161
|
+
* console.log('Transfer event:', event);
|
|
162
|
+
* });
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
class RootSecurityController {
|
|
166
|
+
constructor(address, clients) {
|
|
167
|
+
this.contractAddress = address;
|
|
168
|
+
this.publicClient = clients.publicClient;
|
|
169
|
+
this.contract = (0, viem_1.getContract)({
|
|
170
|
+
address,
|
|
171
|
+
abi: exports.RootSecurityControllerAbi,
|
|
172
|
+
client: {
|
|
173
|
+
public: clients.publicClient,
|
|
174
|
+
wallet: clients.walletClient,
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Get the contract address
|
|
180
|
+
*/
|
|
181
|
+
get address() {
|
|
182
|
+
return this.contractAddress;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Get the underlying viem contract instance.
|
|
186
|
+
*/
|
|
187
|
+
getContract() {
|
|
188
|
+
return this.contract;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* ens
|
|
192
|
+
* view
|
|
193
|
+
*/
|
|
194
|
+
async ens() {
|
|
195
|
+
return this.contract.read.ens();
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* owner
|
|
199
|
+
* view
|
|
200
|
+
*/
|
|
201
|
+
async owner() {
|
|
202
|
+
return this.contract.read.owner();
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* root
|
|
206
|
+
* view
|
|
207
|
+
*/
|
|
208
|
+
async root() {
|
|
209
|
+
return this.contract.read.root();
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* supportsInterface
|
|
213
|
+
* view
|
|
214
|
+
*/
|
|
215
|
+
async supportsInterface(interfaceId) {
|
|
216
|
+
return this.contract.read.supportsInterface([interfaceId]);
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* disableTLD
|
|
220
|
+
* nonpayable
|
|
221
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
222
|
+
*/
|
|
223
|
+
async disableTLD(label, options) {
|
|
224
|
+
if (!this.contract.write) {
|
|
225
|
+
throw new Error('Wallet client is required for write operations');
|
|
226
|
+
}
|
|
227
|
+
return this.contract.write.disableTLD([label], options);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* renounceOwnership
|
|
231
|
+
* nonpayable
|
|
232
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
233
|
+
*/
|
|
234
|
+
async renounceOwnership(options) {
|
|
235
|
+
if (!this.contract.write) {
|
|
236
|
+
throw new Error('Wallet client is required for write operations');
|
|
237
|
+
}
|
|
238
|
+
return this.contract.write.renounceOwnership(options);
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* transferOwnership
|
|
242
|
+
* nonpayable
|
|
243
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
244
|
+
*/
|
|
245
|
+
async transferOwnership(newOwner, options) {
|
|
246
|
+
if (!this.contract.write) {
|
|
247
|
+
throw new Error('Wallet client is required for write operations');
|
|
248
|
+
}
|
|
249
|
+
return this.contract.write.transferOwnership([newOwner], options);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
253
|
+
*
|
|
254
|
+
* @example
|
|
255
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
256
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
257
|
+
* console.log('Would succeed:', result.result);
|
|
258
|
+
*/
|
|
259
|
+
get simulate() {
|
|
260
|
+
const contract = this.contract;
|
|
261
|
+
if (!contract.simulate) {
|
|
262
|
+
throw new Error('Public client is required for simulation');
|
|
263
|
+
}
|
|
264
|
+
return {
|
|
265
|
+
/**
|
|
266
|
+
* Simulate disableTLD
|
|
267
|
+
* Returns gas estimate and result without sending transaction
|
|
268
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
269
|
+
*/
|
|
270
|
+
async disableTLD(label, options) {
|
|
271
|
+
return contract.simulate.disableTLD([label], options);
|
|
272
|
+
},
|
|
273
|
+
/**
|
|
274
|
+
* Simulate renounceOwnership
|
|
275
|
+
* Returns gas estimate and result without sending transaction
|
|
276
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
277
|
+
*/
|
|
278
|
+
async renounceOwnership(options) {
|
|
279
|
+
return contract.simulate.renounceOwnership(options);
|
|
280
|
+
},
|
|
281
|
+
/**
|
|
282
|
+
* Simulate transferOwnership
|
|
283
|
+
* Returns gas estimate and result without sending transaction
|
|
284
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
285
|
+
*/
|
|
286
|
+
async transferOwnership(newOwner, options) {
|
|
287
|
+
return contract.simulate.transferOwnership([newOwner], options);
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Watch contract events
|
|
293
|
+
*
|
|
294
|
+
* @example
|
|
295
|
+
* // Watch all Transfer events
|
|
296
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
297
|
+
* console.log('Transfer:', event);
|
|
298
|
+
* });
|
|
299
|
+
*
|
|
300
|
+
* // Stop watching
|
|
301
|
+
* unwatch();
|
|
302
|
+
*/
|
|
303
|
+
get watch() {
|
|
304
|
+
return {
|
|
305
|
+
/**
|
|
306
|
+
* Watch OwnershipTransferred events
|
|
307
|
+
* @param callback Function to call when event is emitted
|
|
308
|
+
* @param filter Optional filter for indexed parameters
|
|
309
|
+
* @returns Unwatch function to stop listening
|
|
310
|
+
*/
|
|
311
|
+
OwnershipTransferred: (callback, filter) => {
|
|
312
|
+
return this.publicClient.watchContractEvent({
|
|
313
|
+
address: this.contractAddress,
|
|
314
|
+
abi: exports.RootSecurityControllerAbi,
|
|
315
|
+
eventName: 'OwnershipTransferred',
|
|
316
|
+
args: filter,
|
|
317
|
+
onLogs: (logs) => {
|
|
318
|
+
logs.forEach((log) => {
|
|
319
|
+
callback(log.args);
|
|
320
|
+
});
|
|
321
|
+
},
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
exports.RootSecurityController = RootSecurityController;
|
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
|
|
2
|
+
import { getContract } from 'viem';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* RootSecurityController ABI
|
|
6
|
+
*
|
|
7
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
8
|
+
*/
|
|
9
|
+
export const RootSecurityControllerAbi = [
|
|
10
|
+
{
|
|
11
|
+
"inputs": [
|
|
12
|
+
{
|
|
13
|
+
"internalType": "contract Root",
|
|
14
|
+
"name": "_root",
|
|
15
|
+
"type": "address"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"stateMutability": "nonpayable",
|
|
19
|
+
"type": "constructor"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"anonymous": false,
|
|
23
|
+
"inputs": [
|
|
24
|
+
{
|
|
25
|
+
"indexed": true,
|
|
26
|
+
"internalType": "address",
|
|
27
|
+
"name": "previousOwner",
|
|
28
|
+
"type": "address"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"indexed": true,
|
|
32
|
+
"internalType": "address",
|
|
33
|
+
"name": "newOwner",
|
|
34
|
+
"type": "address"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"name": "OwnershipTransferred",
|
|
38
|
+
"type": "event"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"inputs": [
|
|
42
|
+
{
|
|
43
|
+
"internalType": "bytes32",
|
|
44
|
+
"name": "label",
|
|
45
|
+
"type": "bytes32"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"name": "disableTLD",
|
|
49
|
+
"outputs": [],
|
|
50
|
+
"stateMutability": "nonpayable",
|
|
51
|
+
"type": "function"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"inputs": [],
|
|
55
|
+
"name": "ens",
|
|
56
|
+
"outputs": [
|
|
57
|
+
{
|
|
58
|
+
"internalType": "contract ENS",
|
|
59
|
+
"name": "",
|
|
60
|
+
"type": "address"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"stateMutability": "view",
|
|
64
|
+
"type": "function"
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"inputs": [],
|
|
68
|
+
"name": "owner",
|
|
69
|
+
"outputs": [
|
|
70
|
+
{
|
|
71
|
+
"internalType": "address",
|
|
72
|
+
"name": "",
|
|
73
|
+
"type": "address"
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"stateMutability": "view",
|
|
77
|
+
"type": "function"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"inputs": [],
|
|
81
|
+
"name": "renounceOwnership",
|
|
82
|
+
"outputs": [],
|
|
83
|
+
"stateMutability": "nonpayable",
|
|
84
|
+
"type": "function"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"inputs": [],
|
|
88
|
+
"name": "root",
|
|
89
|
+
"outputs": [
|
|
90
|
+
{
|
|
91
|
+
"internalType": "contract Root",
|
|
92
|
+
"name": "",
|
|
93
|
+
"type": "address"
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"stateMutability": "view",
|
|
97
|
+
"type": "function"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"inputs": [
|
|
101
|
+
{
|
|
102
|
+
"internalType": "bytes4",
|
|
103
|
+
"name": "interfaceId",
|
|
104
|
+
"type": "bytes4"
|
|
105
|
+
}
|
|
106
|
+
],
|
|
107
|
+
"name": "supportsInterface",
|
|
108
|
+
"outputs": [
|
|
109
|
+
{
|
|
110
|
+
"internalType": "bool",
|
|
111
|
+
"name": "",
|
|
112
|
+
"type": "bool"
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
"stateMutability": "view",
|
|
116
|
+
"type": "function"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"inputs": [
|
|
120
|
+
{
|
|
121
|
+
"internalType": "address",
|
|
122
|
+
"name": "newOwner",
|
|
123
|
+
"type": "address"
|
|
124
|
+
}
|
|
125
|
+
],
|
|
126
|
+
"name": "transferOwnership",
|
|
127
|
+
"outputs": [],
|
|
128
|
+
"stateMutability": "nonpayable",
|
|
129
|
+
"type": "function"
|
|
130
|
+
}
|
|
131
|
+
] as const satisfies Abi;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Type-safe ABI for RootSecurityController
|
|
135
|
+
*/
|
|
136
|
+
export type RootSecurityControllerAbi = typeof RootSecurityControllerAbi;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Contract instance type for RootSecurityController
|
|
140
|
+
*/
|
|
141
|
+
// Use any for contract type to avoid complex viem type issues
|
|
142
|
+
// The runtime behavior is type-safe through viem's ABI typing
|
|
143
|
+
export type RootSecurityControllerContract = any;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* RootSecurityController Contract Class
|
|
147
|
+
*
|
|
148
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```typescript
|
|
152
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
153
|
+
* import { mainnet } from 'viem/chains';
|
|
154
|
+
* import { RootSecurityController } from 'RootSecurityController';
|
|
155
|
+
*
|
|
156
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
157
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
158
|
+
*
|
|
159
|
+
* const contract = new RootSecurityController('0x...', { publicClient, walletClient });
|
|
160
|
+
*
|
|
161
|
+
* // Read functions
|
|
162
|
+
* const result = await contract.balanceOf('0x...');
|
|
163
|
+
*
|
|
164
|
+
* // Write functions
|
|
165
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
166
|
+
*
|
|
167
|
+
* // Simulate transactions (dry-run)
|
|
168
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
169
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
170
|
+
*
|
|
171
|
+
* // Watch events
|
|
172
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
173
|
+
* console.log('Transfer event:', event);
|
|
174
|
+
* });
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
export class RootSecurityController {
|
|
178
|
+
private contract: RootSecurityControllerContract;
|
|
179
|
+
private contractAddress: Address;
|
|
180
|
+
private publicClient: PublicClient;
|
|
181
|
+
|
|
182
|
+
constructor(
|
|
183
|
+
address: Address,
|
|
184
|
+
clients: {
|
|
185
|
+
publicClient: PublicClient;
|
|
186
|
+
walletClient?: WalletClient;
|
|
187
|
+
}
|
|
188
|
+
) {
|
|
189
|
+
this.contractAddress = address;
|
|
190
|
+
this.publicClient = clients.publicClient;
|
|
191
|
+
this.contract = getContract({
|
|
192
|
+
address,
|
|
193
|
+
abi: RootSecurityControllerAbi,
|
|
194
|
+
client: {
|
|
195
|
+
public: clients.publicClient,
|
|
196
|
+
wallet: clients.walletClient,
|
|
197
|
+
},
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Get the contract address
|
|
203
|
+
*/
|
|
204
|
+
get address(): Address {
|
|
205
|
+
return this.contractAddress;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Get the underlying viem contract instance.
|
|
210
|
+
*/
|
|
211
|
+
getContract(): RootSecurityControllerContract {
|
|
212
|
+
return this.contract;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* ens
|
|
217
|
+
* view
|
|
218
|
+
*/
|
|
219
|
+
async ens(): Promise<`0x${string}`> {
|
|
220
|
+
return this.contract.read.ens() as Promise<`0x${string}`>;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* owner
|
|
225
|
+
* view
|
|
226
|
+
*/
|
|
227
|
+
async owner(): Promise<`0x${string}`> {
|
|
228
|
+
return this.contract.read.owner() as Promise<`0x${string}`>;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* root
|
|
233
|
+
* view
|
|
234
|
+
*/
|
|
235
|
+
async root(): Promise<`0x${string}`> {
|
|
236
|
+
return this.contract.read.root() as Promise<`0x${string}`>;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* supportsInterface
|
|
241
|
+
* view
|
|
242
|
+
*/
|
|
243
|
+
async supportsInterface(interfaceId: `0x${string}`): Promise<boolean> {
|
|
244
|
+
return this.contract.read.supportsInterface([interfaceId] as const) as Promise<boolean>;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* disableTLD
|
|
249
|
+
* nonpayable
|
|
250
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
251
|
+
*/
|
|
252
|
+
async disableTLD(label: `0x${string}`, options?: {
|
|
253
|
+
accessList?: import('viem').AccessList;
|
|
254
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
255
|
+
chain?: import('viem').Chain | null;
|
|
256
|
+
dataSuffix?: `0x${string}`;
|
|
257
|
+
gas?: bigint;
|
|
258
|
+
gasPrice?: bigint;
|
|
259
|
+
maxFeePerGas?: bigint;
|
|
260
|
+
maxPriorityFeePerGas?: bigint;
|
|
261
|
+
nonce?: number;
|
|
262
|
+
value?: bigint;
|
|
263
|
+
}): Promise<`0x${string}`> {
|
|
264
|
+
if (!this.contract.write) {
|
|
265
|
+
throw new Error('Wallet client is required for write operations');
|
|
266
|
+
}
|
|
267
|
+
return this.contract.write.disableTLD([label] as const, options) as Promise<`0x${string}`>;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* renounceOwnership
|
|
272
|
+
* nonpayable
|
|
273
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
274
|
+
*/
|
|
275
|
+
async renounceOwnership(options?: {
|
|
276
|
+
accessList?: import('viem').AccessList;
|
|
277
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
278
|
+
chain?: import('viem').Chain | null;
|
|
279
|
+
dataSuffix?: `0x${string}`;
|
|
280
|
+
gas?: bigint;
|
|
281
|
+
gasPrice?: bigint;
|
|
282
|
+
maxFeePerGas?: bigint;
|
|
283
|
+
maxPriorityFeePerGas?: bigint;
|
|
284
|
+
nonce?: number;
|
|
285
|
+
value?: bigint;
|
|
286
|
+
}): Promise<`0x${string}`> {
|
|
287
|
+
if (!this.contract.write) {
|
|
288
|
+
throw new Error('Wallet client is required for write operations');
|
|
289
|
+
}
|
|
290
|
+
return this.contract.write.renounceOwnership(options) as Promise<`0x${string}`>;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* transferOwnership
|
|
295
|
+
* nonpayable
|
|
296
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
297
|
+
*/
|
|
298
|
+
async transferOwnership(newOwner: `0x${string}`, options?: {
|
|
299
|
+
accessList?: import('viem').AccessList;
|
|
300
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
301
|
+
chain?: import('viem').Chain | null;
|
|
302
|
+
dataSuffix?: `0x${string}`;
|
|
303
|
+
gas?: bigint;
|
|
304
|
+
gasPrice?: bigint;
|
|
305
|
+
maxFeePerGas?: bigint;
|
|
306
|
+
maxPriorityFeePerGas?: bigint;
|
|
307
|
+
nonce?: number;
|
|
308
|
+
value?: bigint;
|
|
309
|
+
}): Promise<`0x${string}`> {
|
|
310
|
+
if (!this.contract.write) {
|
|
311
|
+
throw new Error('Wallet client is required for write operations');
|
|
312
|
+
}
|
|
313
|
+
return this.contract.write.transferOwnership([newOwner] as const, options) as Promise<`0x${string}`>;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
320
|
+
*
|
|
321
|
+
* @example
|
|
322
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
323
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
324
|
+
* console.log('Would succeed:', result.result);
|
|
325
|
+
*/
|
|
326
|
+
get simulate() {
|
|
327
|
+
const contract = this.contract;
|
|
328
|
+
if (!contract.simulate) {
|
|
329
|
+
throw new Error('Public client is required for simulation');
|
|
330
|
+
}
|
|
331
|
+
return {
|
|
332
|
+
/**
|
|
333
|
+
* Simulate disableTLD
|
|
334
|
+
* Returns gas estimate and result without sending transaction
|
|
335
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
336
|
+
*/
|
|
337
|
+
async disableTLD(label: `0x${string}`, 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<void> {
|
|
349
|
+
return contract.simulate.disableTLD([label] as const, options) as Promise<void>;
|
|
350
|
+
},
|
|
351
|
+
/**
|
|
352
|
+
* Simulate renounceOwnership
|
|
353
|
+
* Returns gas estimate and result without sending transaction
|
|
354
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
355
|
+
*/
|
|
356
|
+
async renounceOwnership(options?: {
|
|
357
|
+
accessList?: import('viem').AccessList;
|
|
358
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
359
|
+
chain?: import('viem').Chain | null;
|
|
360
|
+
dataSuffix?: `0x${string}`;
|
|
361
|
+
gas?: bigint;
|
|
362
|
+
gasPrice?: bigint;
|
|
363
|
+
maxFeePerGas?: bigint;
|
|
364
|
+
maxPriorityFeePerGas?: bigint;
|
|
365
|
+
nonce?: number;
|
|
366
|
+
value?: bigint;
|
|
367
|
+
}): Promise<void> {
|
|
368
|
+
return contract.simulate.renounceOwnership(options) as Promise<void>;
|
|
369
|
+
},
|
|
370
|
+
/**
|
|
371
|
+
* Simulate transferOwnership
|
|
372
|
+
* Returns gas estimate and result without sending transaction
|
|
373
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
374
|
+
*/
|
|
375
|
+
async transferOwnership(newOwner: `0x${string}`, options?: {
|
|
376
|
+
accessList?: import('viem').AccessList;
|
|
377
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
378
|
+
chain?: import('viem').Chain | null;
|
|
379
|
+
dataSuffix?: `0x${string}`;
|
|
380
|
+
gas?: bigint;
|
|
381
|
+
gasPrice?: bigint;
|
|
382
|
+
maxFeePerGas?: bigint;
|
|
383
|
+
maxPriorityFeePerGas?: bigint;
|
|
384
|
+
nonce?: number;
|
|
385
|
+
value?: bigint;
|
|
386
|
+
}): Promise<void> {
|
|
387
|
+
return contract.simulate.transferOwnership([newOwner] as const, options) as Promise<void>;
|
|
388
|
+
}
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Watch contract events
|
|
394
|
+
*
|
|
395
|
+
* @example
|
|
396
|
+
* // Watch all Transfer events
|
|
397
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
398
|
+
* console.log('Transfer:', event);
|
|
399
|
+
* });
|
|
400
|
+
*
|
|
401
|
+
* // Stop watching
|
|
402
|
+
* unwatch();
|
|
403
|
+
*/
|
|
404
|
+
get watch() {
|
|
405
|
+
return {
|
|
406
|
+
/**
|
|
407
|
+
* Watch OwnershipTransferred events
|
|
408
|
+
* @param callback Function to call when event is emitted
|
|
409
|
+
* @param filter Optional filter for indexed parameters
|
|
410
|
+
* @returns Unwatch function to stop listening
|
|
411
|
+
*/
|
|
412
|
+
OwnershipTransferred: (callback: (event: { previousOwner: `0x${string}`; newOwner: `0x${string}` }) => void, filter?: { previousOwner?: `0x${string}` | `0x${string}`[] | null; newOwner?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
413
|
+
return this.publicClient.watchContractEvent({
|
|
414
|
+
address: this.contractAddress,
|
|
415
|
+
abi: RootSecurityControllerAbi,
|
|
416
|
+
eventName: 'OwnershipTransferred',
|
|
417
|
+
args: filter as any,
|
|
418
|
+
onLogs: (logs: any[]) => {
|
|
419
|
+
logs.forEach((log: any) => {
|
|
420
|
+
callback(log.args as any);
|
|
421
|
+
});
|
|
422
|
+
},
|
|
423
|
+
}) as () => void;
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RootSecurityController = exports.RootSecurityControllerAbi = void 0;
|
|
4
|
+
// Auto-generated exports for all contracts
|
|
5
|
+
var RootSecurityController_1 = require("./RootSecurityController");
|
|
6
|
+
Object.defineProperty(exports, "RootSecurityControllerAbi", { enumerable: true, get: function () { return RootSecurityController_1.RootSecurityControllerAbi; } });
|
|
7
|
+
Object.defineProperty(exports, "RootSecurityController", { enumerable: true, get: function () { return RootSecurityController_1.RootSecurityController; } });
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// Auto-generated exports for all contracts
|
|
2
|
+
export { RootSecurityControllerAbi, RootSecurityController } from './RootSecurityController';
|
|
3
|
+
export type { RootSecurityControllerAbi as RootSecurityControllerAbiType, RootSecurityControllerContract } from './RootSecurityController';
|
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/rootsecuritycontroller",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Auto-generated TypeScript type bindings for RootSecurityController (build etherscan-rootsecuritycontroller-95123b1e-1796192477091, commit 6695eca, 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": "Apache-2.0",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"viem": "^2.0.0"
|
|
36
|
+
},
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/etherscan/rootsecuritycontroller"
|
|
40
|
+
},
|
|
41
|
+
"branch": "etherscan",
|
|
42
|
+
"shortHash": "6695eca"
|
|
6
43
|
}
|