@gitmyabi/land 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,510 @@
1
+ import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
2
+ import { getContract } from 'viem';
3
+
4
+ /**
5
+ * TransparentUpgradeableProxy_json ABI
6
+ *
7
+ * This ABI is typed using viem's type system for full type safety.
8
+ */
9
+ export const TransparentUpgradeableProxy_jsonAbi = [
10
+ {
11
+ "inputs": [
12
+ {
13
+ "internalType": "address",
14
+ "name": "initialLogic",
15
+ "type": "address"
16
+ },
17
+ {
18
+ "internalType": "address",
19
+ "name": "initialAdmin",
20
+ "type": "address"
21
+ },
22
+ {
23
+ "internalType": "bytes",
24
+ "name": "_data",
25
+ "type": "bytes"
26
+ }
27
+ ],
28
+ "stateMutability": "payable",
29
+ "type": "constructor"
30
+ },
31
+ {
32
+ "anonymous": false,
33
+ "inputs": [
34
+ {
35
+ "indexed": false,
36
+ "internalType": "address",
37
+ "name": "previousAdmin",
38
+ "type": "address"
39
+ },
40
+ {
41
+ "indexed": false,
42
+ "internalType": "address",
43
+ "name": "newAdmin",
44
+ "type": "address"
45
+ }
46
+ ],
47
+ "name": "AdminChanged",
48
+ "type": "event"
49
+ },
50
+ {
51
+ "anonymous": false,
52
+ "inputs": [
53
+ {
54
+ "indexed": true,
55
+ "internalType": "address",
56
+ "name": "implementation",
57
+ "type": "address"
58
+ }
59
+ ],
60
+ "name": "Upgraded",
61
+ "type": "event"
62
+ },
63
+ {
64
+ "stateMutability": "payable",
65
+ "type": "fallback"
66
+ },
67
+ {
68
+ "inputs": [],
69
+ "name": "admin",
70
+ "outputs": [
71
+ {
72
+ "internalType": "address",
73
+ "name": "",
74
+ "type": "address"
75
+ }
76
+ ],
77
+ "stateMutability": "nonpayable",
78
+ "type": "function"
79
+ },
80
+ {
81
+ "inputs": [
82
+ {
83
+ "internalType": "address",
84
+ "name": "newAdmin",
85
+ "type": "address"
86
+ }
87
+ ],
88
+ "name": "changeAdmin",
89
+ "outputs": [],
90
+ "stateMutability": "nonpayable",
91
+ "type": "function"
92
+ },
93
+ {
94
+ "inputs": [],
95
+ "name": "implementation",
96
+ "outputs": [
97
+ {
98
+ "internalType": "address",
99
+ "name": "",
100
+ "type": "address"
101
+ }
102
+ ],
103
+ "stateMutability": "nonpayable",
104
+ "type": "function"
105
+ },
106
+ {
107
+ "inputs": [
108
+ {
109
+ "internalType": "address",
110
+ "name": "newImplementation",
111
+ "type": "address"
112
+ }
113
+ ],
114
+ "name": "upgradeTo",
115
+ "outputs": [],
116
+ "stateMutability": "nonpayable",
117
+ "type": "function"
118
+ },
119
+ {
120
+ "inputs": [
121
+ {
122
+ "internalType": "address",
123
+ "name": "newImplementation",
124
+ "type": "address"
125
+ },
126
+ {
127
+ "internalType": "bytes",
128
+ "name": "data",
129
+ "type": "bytes"
130
+ }
131
+ ],
132
+ "name": "upgradeToAndCall",
133
+ "outputs": [],
134
+ "stateMutability": "payable",
135
+ "type": "function"
136
+ },
137
+ {
138
+ "stateMutability": "payable",
139
+ "type": "receive"
140
+ }
141
+ ] as const satisfies Abi;
142
+
143
+ /**
144
+ * Type-safe ABI for TransparentUpgradeableProxy_json
145
+ */
146
+ export type TransparentUpgradeableProxy_jsonAbi = typeof TransparentUpgradeableProxy_jsonAbi;
147
+
148
+ /**
149
+ * Contract instance type for TransparentUpgradeableProxy_json
150
+ */
151
+ // Use any for contract type to avoid complex viem type issues
152
+ // The runtime behavior is type-safe through viem's ABI typing
153
+ export type TransparentUpgradeableProxy_jsonContract = any;
154
+
155
+ /**
156
+ * TransparentUpgradeableProxy_json Contract Class
157
+ *
158
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
159
+ *
160
+ * @example
161
+ * ```typescript
162
+ * import { createPublicClient, createWalletClient, http } from 'viem';
163
+ * import { mainnet } from 'viem/chains';
164
+ * import { TransparentUpgradeableProxy_json } from 'TransparentUpgradeableProxy_json';
165
+ *
166
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
167
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
168
+ *
169
+ * const contract = new TransparentUpgradeableProxy_json('0x...', { publicClient, walletClient });
170
+ *
171
+ * // Read functions
172
+ * const result = await contract.balanceOf('0x...');
173
+ *
174
+ * // Write functions
175
+ * const hash = await contract.transfer('0x...', 1000n);
176
+ *
177
+ * // Simulate transactions (dry-run)
178
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
179
+ * console.log('Gas estimate:', simulation.request.gas);
180
+ *
181
+ * // Watch events
182
+ * const unwatch = contract.watch.Transfer((event) => {
183
+ * console.log('Transfer event:', event);
184
+ * });
185
+ * ```
186
+ */
187
+ export class TransparentUpgradeableProxy_json {
188
+ private contract: TransparentUpgradeableProxy_jsonContract;
189
+ private contractAddress: Address;
190
+ private publicClient: PublicClient;
191
+
192
+ constructor(
193
+ address: Address,
194
+ clients: {
195
+ publicClient: PublicClient;
196
+ walletClient?: WalletClient;
197
+ }
198
+ ) {
199
+ this.contractAddress = address;
200
+ this.publicClient = clients.publicClient;
201
+ this.contract = getContract({
202
+ address,
203
+ abi: TransparentUpgradeableProxy_jsonAbi,
204
+ client: {
205
+ public: clients.publicClient,
206
+ wallet: clients.walletClient,
207
+ },
208
+ });
209
+ }
210
+
211
+ /**
212
+ * Get the contract address
213
+ */
214
+ get address(): Address {
215
+ return this.contractAddress;
216
+ }
217
+
218
+ /**
219
+ * Get the underlying viem contract instance
220
+ */
221
+ getContract(): TransparentUpgradeableProxy_jsonContract {
222
+ return this.contract;
223
+ }
224
+
225
+ // No read functions
226
+
227
+ /**
228
+ * admin
229
+ * nonpayable
230
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
231
+ */
232
+ async admin(options?: {
233
+ accessList?: import('viem').AccessList;
234
+ authorizationList?: import('viem').AuthorizationList;
235
+ chain?: import('viem').Chain | null;
236
+ dataSuffix?: `0x${string}`;
237
+ gas?: bigint;
238
+ gasPrice?: bigint;
239
+ maxFeePerGas?: bigint;
240
+ maxPriorityFeePerGas?: bigint;
241
+ nonce?: number;
242
+ value?: bigint;
243
+ }): Promise<`0x${string}`> {
244
+ if (!this.contract.write) {
245
+ throw new Error('Wallet client is required for write operations');
246
+ }
247
+ return this.contract.write.admin(options) as Promise<`0x${string}`>;
248
+ }
249
+
250
+ /**
251
+ * changeAdmin
252
+ * nonpayable
253
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
254
+ */
255
+ async changeAdmin(newAdmin: `0x${string}`, options?: {
256
+ accessList?: import('viem').AccessList;
257
+ authorizationList?: import('viem').AuthorizationList;
258
+ chain?: import('viem').Chain | null;
259
+ dataSuffix?: `0x${string}`;
260
+ gas?: bigint;
261
+ gasPrice?: bigint;
262
+ maxFeePerGas?: bigint;
263
+ maxPriorityFeePerGas?: bigint;
264
+ nonce?: number;
265
+ value?: bigint;
266
+ }): Promise<`0x${string}`> {
267
+ if (!this.contract.write) {
268
+ throw new Error('Wallet client is required for write operations');
269
+ }
270
+ return this.contract.write.changeAdmin([newAdmin] as const, options) as Promise<`0x${string}`>;
271
+ }
272
+
273
+ /**
274
+ * implementation
275
+ * nonpayable
276
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
277
+ */
278
+ async implementation(options?: {
279
+ accessList?: import('viem').AccessList;
280
+ authorizationList?: import('viem').AuthorizationList;
281
+ chain?: import('viem').Chain | null;
282
+ dataSuffix?: `0x${string}`;
283
+ gas?: bigint;
284
+ gasPrice?: bigint;
285
+ maxFeePerGas?: bigint;
286
+ maxPriorityFeePerGas?: bigint;
287
+ nonce?: number;
288
+ value?: bigint;
289
+ }): Promise<`0x${string}`> {
290
+ if (!this.contract.write) {
291
+ throw new Error('Wallet client is required for write operations');
292
+ }
293
+ return this.contract.write.implementation(options) as Promise<`0x${string}`>;
294
+ }
295
+
296
+ /**
297
+ * upgradeTo
298
+ * nonpayable
299
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
300
+ */
301
+ async upgradeTo(newImplementation: `0x${string}`, options?: {
302
+ accessList?: import('viem').AccessList;
303
+ authorizationList?: import('viem').AuthorizationList;
304
+ chain?: import('viem').Chain | null;
305
+ dataSuffix?: `0x${string}`;
306
+ gas?: bigint;
307
+ gasPrice?: bigint;
308
+ maxFeePerGas?: bigint;
309
+ maxPriorityFeePerGas?: bigint;
310
+ nonce?: number;
311
+ value?: bigint;
312
+ }): Promise<`0x${string}`> {
313
+ if (!this.contract.write) {
314
+ throw new Error('Wallet client is required for write operations');
315
+ }
316
+ return this.contract.write.upgradeTo([newImplementation] as const, options) as Promise<`0x${string}`>;
317
+ }
318
+
319
+ /**
320
+ * upgradeToAndCall
321
+ * payable
322
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
323
+ */
324
+ async upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
325
+ accessList?: import('viem').AccessList;
326
+ authorizationList?: import('viem').AuthorizationList;
327
+ chain?: import('viem').Chain | null;
328
+ dataSuffix?: `0x${string}`;
329
+ gas?: bigint;
330
+ gasPrice?: bigint;
331
+ maxFeePerGas?: bigint;
332
+ maxPriorityFeePerGas?: bigint;
333
+ nonce?: number;
334
+ value?: bigint;
335
+ }): Promise<`0x${string}`> {
336
+ if (!this.contract.write) {
337
+ throw new Error('Wallet client is required for write operations');
338
+ }
339
+ return this.contract.write.upgradeToAndCall([newImplementation, data] as const, options) as Promise<`0x${string}`>;
340
+ }
341
+
342
+
343
+
344
+ /**
345
+ * Simulate contract write operations (dry-run without sending transaction)
346
+ *
347
+ * @example
348
+ * const result = await contract.simulate.transfer('0x...', 1000n);
349
+ * console.log('Gas estimate:', result.request.gas);
350
+ * console.log('Would succeed:', result.result);
351
+ */
352
+ get simulate() {
353
+ const contract = this.contract;
354
+ if (!contract.simulate) {
355
+ throw new Error('Public client is required for simulation');
356
+ }
357
+ return {
358
+ /**
359
+ * Simulate admin
360
+ * Returns gas estimate and result without sending transaction
361
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
362
+ */
363
+ async admin(options?: {
364
+ accessList?: import('viem').AccessList;
365
+ authorizationList?: import('viem').AuthorizationList;
366
+ chain?: import('viem').Chain | null;
367
+ dataSuffix?: `0x${string}`;
368
+ gas?: bigint;
369
+ gasPrice?: bigint;
370
+ maxFeePerGas?: bigint;
371
+ maxPriorityFeePerGas?: bigint;
372
+ nonce?: number;
373
+ value?: bigint;
374
+ }): Promise<`0x${string}`> {
375
+ return contract.simulate.admin(options) as Promise<`0x${string}`>;
376
+ },
377
+ /**
378
+ * Simulate changeAdmin
379
+ * Returns gas estimate and result without sending transaction
380
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
381
+ */
382
+ async changeAdmin(newAdmin: `0x${string}`, options?: {
383
+ accessList?: import('viem').AccessList;
384
+ authorizationList?: import('viem').AuthorizationList;
385
+ chain?: import('viem').Chain | null;
386
+ dataSuffix?: `0x${string}`;
387
+ gas?: bigint;
388
+ gasPrice?: bigint;
389
+ maxFeePerGas?: bigint;
390
+ maxPriorityFeePerGas?: bigint;
391
+ nonce?: number;
392
+ value?: bigint;
393
+ }): Promise<void> {
394
+ return contract.simulate.changeAdmin([newAdmin] as const, options) as Promise<void>;
395
+ },
396
+ /**
397
+ * Simulate implementation
398
+ * Returns gas estimate and result without sending transaction
399
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
400
+ */
401
+ async implementation(options?: {
402
+ accessList?: import('viem').AccessList;
403
+ authorizationList?: import('viem').AuthorizationList;
404
+ chain?: import('viem').Chain | null;
405
+ dataSuffix?: `0x${string}`;
406
+ gas?: bigint;
407
+ gasPrice?: bigint;
408
+ maxFeePerGas?: bigint;
409
+ maxPriorityFeePerGas?: bigint;
410
+ nonce?: number;
411
+ value?: bigint;
412
+ }): Promise<`0x${string}`> {
413
+ return contract.simulate.implementation(options) as Promise<`0x${string}`>;
414
+ },
415
+ /**
416
+ * Simulate upgradeTo
417
+ * Returns gas estimate and result without sending transaction
418
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
419
+ */
420
+ async upgradeTo(newImplementation: `0x${string}`, options?: {
421
+ accessList?: import('viem').AccessList;
422
+ authorizationList?: import('viem').AuthorizationList;
423
+ chain?: import('viem').Chain | null;
424
+ dataSuffix?: `0x${string}`;
425
+ gas?: bigint;
426
+ gasPrice?: bigint;
427
+ maxFeePerGas?: bigint;
428
+ maxPriorityFeePerGas?: bigint;
429
+ nonce?: number;
430
+ value?: bigint;
431
+ }): Promise<void> {
432
+ return contract.simulate.upgradeTo([newImplementation] as const, options) as Promise<void>;
433
+ },
434
+ /**
435
+ * Simulate upgradeToAndCall
436
+ * Returns gas estimate and result without sending transaction
437
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
438
+ */
439
+ async upgradeToAndCall(newImplementation: `0x${string}`, data: `0x${string}`, options?: {
440
+ accessList?: import('viem').AccessList;
441
+ authorizationList?: import('viem').AuthorizationList;
442
+ chain?: import('viem').Chain | null;
443
+ dataSuffix?: `0x${string}`;
444
+ gas?: bigint;
445
+ gasPrice?: bigint;
446
+ maxFeePerGas?: bigint;
447
+ maxPriorityFeePerGas?: bigint;
448
+ nonce?: number;
449
+ value?: bigint;
450
+ }): Promise<void> {
451
+ return contract.simulate.upgradeToAndCall([newImplementation, data] as const, options) as Promise<void>;
452
+ }
453
+ };
454
+ }
455
+
456
+ /**
457
+ * Watch contract events
458
+ *
459
+ * @example
460
+ * // Watch all Transfer events
461
+ * const unwatch = contract.watch.Transfer((event) => {
462
+ * console.log('Transfer:', event);
463
+ * });
464
+ *
465
+ * // Stop watching
466
+ * unwatch();
467
+ */
468
+ get watch() {
469
+ return {
470
+ /**
471
+ * Watch AdminChanged events
472
+ * @param callback Function to call when event is emitted
473
+ * @param filter Optional filter for indexed parameters
474
+ * @returns Unwatch function to stop listening
475
+ */
476
+ AdminChanged: (callback: (event: { previousAdmin: `0x${string}`; newAdmin: `0x${string}` }) => void) => {
477
+ return this.publicClient.watchContractEvent({
478
+ address: this.contractAddress,
479
+ abi: TransparentUpgradeableProxy_jsonAbi,
480
+ eventName: 'AdminChanged',
481
+
482
+ onLogs: (logs: any[]) => {
483
+ logs.forEach((log: any) => {
484
+ callback(log.args as any);
485
+ });
486
+ },
487
+ }) as () => void;
488
+ },
489
+ /**
490
+ * Watch Upgraded events
491
+ * @param callback Function to call when event is emitted
492
+ * @param filter Optional filter for indexed parameters
493
+ * @returns Unwatch function to stop listening
494
+ */
495
+ Upgraded: (callback: (event: { implementation: `0x${string}` }) => void, filter?: { implementation: `0x${string}` }) => {
496
+ return this.publicClient.watchContractEvent({
497
+ address: this.contractAddress,
498
+ abi: TransparentUpgradeableProxy_jsonAbi,
499
+ eventName: 'Upgraded',
500
+ args: filter,
501
+ onLogs: (logs: any[]) => {
502
+ logs.forEach((log: any) => {
503
+ callback(log.args as any);
504
+ });
505
+ },
506
+ }) as () => void;
507
+ }
508
+ };
509
+ }
510
+ }
@@ -0,0 +1,4 @@
1
+ export { TransparentUpgradeableProxy_jsonAbi, TransparentUpgradeableProxy_json } from './TransparentUpgradeableProxy_json';
2
+ export type { TransparentUpgradeableProxy_jsonAbi as TransparentUpgradeableProxy_jsonAbiType, TransparentUpgradeableProxy_jsonContract } from './TransparentUpgradeableProxy_json';
3
+ export { Land_jsonAbi, Land_json } from './Land_json';
4
+ export type { Land_jsonAbi as Land_jsonAbiType, Land_jsonContract } from './Land_json';
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Land_json = exports.Land_jsonAbi = exports.TransparentUpgradeableProxy_json = exports.TransparentUpgradeableProxy_jsonAbi = void 0;
4
+ // Auto-generated exports for all contracts
5
+ var TransparentUpgradeableProxy_json_1 = require("./TransparentUpgradeableProxy_json");
6
+ Object.defineProperty(exports, "TransparentUpgradeableProxy_jsonAbi", { enumerable: true, get: function () { return TransparentUpgradeableProxy_json_1.TransparentUpgradeableProxy_jsonAbi; } });
7
+ Object.defineProperty(exports, "TransparentUpgradeableProxy_json", { enumerable: true, get: function () { return TransparentUpgradeableProxy_json_1.TransparentUpgradeableProxy_json; } });
8
+ var Land_json_1 = require("./Land_json");
9
+ Object.defineProperty(exports, "Land_jsonAbi", { enumerable: true, get: function () { return Land_json_1.Land_jsonAbi; } });
10
+ Object.defineProperty(exports, "Land_json", { enumerable: true, get: function () { return Land_json_1.Land_json; } });
@@ -0,0 +1,5 @@
1
+ // Auto-generated exports for all contracts
2
+ export { TransparentUpgradeableProxy_jsonAbi, TransparentUpgradeableProxy_json } from './TransparentUpgradeableProxy_json';
3
+ export type { TransparentUpgradeableProxy_jsonAbi as TransparentUpgradeableProxy_jsonAbiType, TransparentUpgradeableProxy_jsonContract } from './TransparentUpgradeableProxy_json';
4
+ export { Land_jsonAbi, Land_json } from './Land_json';
5
+ export type { Land_jsonAbi as Land_jsonAbiType, Land_jsonContract } from './Land_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/land",
3
+ "version": "1.0.0",
4
+ "description": "Auto-generated TypeScript type bindings for LAND (build etherscan-land-5cc5b05a-1788075103112, commit 8517b2c, branch etherscan)",
5
+ "main": "./index.js",
6
+ "types": "./index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./index.js",
10
+ "require": "./index.js",
11
+ "types": "./index.d.ts"
12
+ },
13
+ "./contracts": {
14
+ "import": "./contracts/index.js",
15
+ "require": "./contracts/index.js",
16
+ "types": "./contracts/index.d.ts"
17
+ }
18
+ },
19
+ "files": [
20
+ "index.js",
21
+ "index.d.ts",
22
+ "contracts"
23
+ ],
24
+ "keywords": [
25
+ "ethereum",
26
+ "smart-contracts",
27
+ "viem",
28
+ "wagmi",
29
+ "typescript",
30
+ "abi",
31
+ "ethers-v6"
32
+ ],
33
+ "license": "MIT",
34
+ "dependencies": {
35
+ "viem": "^2.0.0"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "https://github.com/etherscan/land"
40
+ },
41
+ "branch": "etherscan",
42
+ "shortHash": "8517b2c"
43
+ }