@gitmyabi-stg/ens--gateway-contracts 0.0.1

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