@gitmyabi/checks 0.0.0-stage → 1.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 +107 -2
- package/contracts/ERC721Drop.d.ts +2673 -0
- package/contracts/ERC721Drop.js +2844 -0
- package/contracts/ERC721Drop.ts +3493 -0
- package/contracts/ERC721DropProxy.d.ts +169 -0
- package/contracts/ERC721DropProxy.js +221 -0
- package/contracts/ERC721DropProxy.ts +251 -0
- package/contracts/index.d.ts +4 -0
- package/contracts/index.js +10 -0
- package/contracts/index.ts +5 -0
- package/index.d.ts +1 -0
- package/index.js +19 -0
- package/package.json +40 -3
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import type { Address, PublicClient, WalletClient } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* ERC721DropProxy ABI
|
|
4
|
+
*
|
|
5
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ERC721DropProxyAbi: readonly [{
|
|
8
|
+
readonly inputs: readonly [{
|
|
9
|
+
readonly internalType: "address";
|
|
10
|
+
readonly name: "_logic";
|
|
11
|
+
readonly type: "address";
|
|
12
|
+
}, {
|
|
13
|
+
readonly internalType: "bytes";
|
|
14
|
+
readonly name: "_data";
|
|
15
|
+
readonly type: "bytes";
|
|
16
|
+
}];
|
|
17
|
+
readonly stateMutability: "payable";
|
|
18
|
+
readonly type: "constructor";
|
|
19
|
+
}, {
|
|
20
|
+
readonly anonymous: false;
|
|
21
|
+
readonly inputs: readonly [{
|
|
22
|
+
readonly indexed: false;
|
|
23
|
+
readonly internalType: "address";
|
|
24
|
+
readonly name: "previousAdmin";
|
|
25
|
+
readonly type: "address";
|
|
26
|
+
}, {
|
|
27
|
+
readonly indexed: false;
|
|
28
|
+
readonly internalType: "address";
|
|
29
|
+
readonly name: "newAdmin";
|
|
30
|
+
readonly type: "address";
|
|
31
|
+
}];
|
|
32
|
+
readonly name: "AdminChanged";
|
|
33
|
+
readonly type: "event";
|
|
34
|
+
}, {
|
|
35
|
+
readonly anonymous: false;
|
|
36
|
+
readonly inputs: readonly [{
|
|
37
|
+
readonly indexed: true;
|
|
38
|
+
readonly internalType: "address";
|
|
39
|
+
readonly name: "beacon";
|
|
40
|
+
readonly type: "address";
|
|
41
|
+
}];
|
|
42
|
+
readonly name: "BeaconUpgraded";
|
|
43
|
+
readonly type: "event";
|
|
44
|
+
}, {
|
|
45
|
+
readonly anonymous: false;
|
|
46
|
+
readonly inputs: readonly [{
|
|
47
|
+
readonly indexed: true;
|
|
48
|
+
readonly internalType: "address";
|
|
49
|
+
readonly name: "implementation";
|
|
50
|
+
readonly type: "address";
|
|
51
|
+
}];
|
|
52
|
+
readonly name: "Upgraded";
|
|
53
|
+
readonly type: "event";
|
|
54
|
+
}, {
|
|
55
|
+
readonly stateMutability: "payable";
|
|
56
|
+
readonly type: "fallback";
|
|
57
|
+
}, {
|
|
58
|
+
readonly stateMutability: "payable";
|
|
59
|
+
readonly type: "receive";
|
|
60
|
+
}];
|
|
61
|
+
/**
|
|
62
|
+
* Type-safe ABI for ERC721DropProxy
|
|
63
|
+
*/
|
|
64
|
+
export type ERC721DropProxyAbi = typeof ERC721DropProxyAbi;
|
|
65
|
+
/**
|
|
66
|
+
* Contract instance type for ERC721DropProxy
|
|
67
|
+
*/
|
|
68
|
+
export type ERC721DropProxyContract = any;
|
|
69
|
+
/**
|
|
70
|
+
* ERC721DropProxy Contract Class
|
|
71
|
+
*
|
|
72
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
77
|
+
* import { mainnet } from 'viem/chains';
|
|
78
|
+
* import { ERC721DropProxy } from 'ERC721DropProxy';
|
|
79
|
+
*
|
|
80
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
81
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
82
|
+
*
|
|
83
|
+
* const contract = new ERC721DropProxy('0x...', { publicClient, walletClient });
|
|
84
|
+
*
|
|
85
|
+
* // Read functions
|
|
86
|
+
* const result = await contract.balanceOf('0x...');
|
|
87
|
+
*
|
|
88
|
+
* // Write functions
|
|
89
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
90
|
+
*
|
|
91
|
+
* // Simulate transactions (dry-run)
|
|
92
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
93
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
94
|
+
*
|
|
95
|
+
* // Watch events
|
|
96
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
97
|
+
* console.log('Transfer event:', event);
|
|
98
|
+
* });
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
export declare class ERC721DropProxy {
|
|
102
|
+
private contract;
|
|
103
|
+
private contractAddress;
|
|
104
|
+
private publicClient;
|
|
105
|
+
constructor(address: Address, clients: {
|
|
106
|
+
publicClient: PublicClient;
|
|
107
|
+
walletClient?: WalletClient;
|
|
108
|
+
});
|
|
109
|
+
/**
|
|
110
|
+
* Get the contract address
|
|
111
|
+
*/
|
|
112
|
+
get address(): Address;
|
|
113
|
+
/**
|
|
114
|
+
* Get the underlying viem contract instance.
|
|
115
|
+
*/
|
|
116
|
+
getContract(): ERC721DropProxyContract;
|
|
117
|
+
/**
|
|
118
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
119
|
+
*
|
|
120
|
+
* Note: This contract has no write functions, so simulate returns an empty object.
|
|
121
|
+
*/
|
|
122
|
+
get simulate(): {};
|
|
123
|
+
/**
|
|
124
|
+
* Watch contract events
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* // Watch all Transfer events
|
|
128
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
129
|
+
* console.log('Transfer:', event);
|
|
130
|
+
* });
|
|
131
|
+
*
|
|
132
|
+
* // Stop watching
|
|
133
|
+
* unwatch();
|
|
134
|
+
*/
|
|
135
|
+
get watch(): {
|
|
136
|
+
/**
|
|
137
|
+
* Watch AdminChanged events
|
|
138
|
+
* @param callback Function to call when event is emitted
|
|
139
|
+
* @param filter Optional filter for indexed parameters
|
|
140
|
+
* @returns Unwatch function to stop listening
|
|
141
|
+
*/
|
|
142
|
+
AdminChanged: (callback: (event: {
|
|
143
|
+
previousAdmin: `0x${string}`;
|
|
144
|
+
newAdmin: `0x${string}`;
|
|
145
|
+
}) => void) => () => void;
|
|
146
|
+
/**
|
|
147
|
+
* Watch BeaconUpgraded events
|
|
148
|
+
* @param callback Function to call when event is emitted
|
|
149
|
+
* @param filter Optional filter for indexed parameters
|
|
150
|
+
* @returns Unwatch function to stop listening
|
|
151
|
+
*/
|
|
152
|
+
BeaconUpgraded: (callback: (event: {
|
|
153
|
+
beacon: `0x${string}`;
|
|
154
|
+
}) => void, filter?: {
|
|
155
|
+
beacon?: `0x${string}` | `0x${string}`[] | null;
|
|
156
|
+
}) => () => void;
|
|
157
|
+
/**
|
|
158
|
+
* Watch Upgraded events
|
|
159
|
+
* @param callback Function to call when event is emitted
|
|
160
|
+
* @param filter Optional filter for indexed parameters
|
|
161
|
+
* @returns Unwatch function to stop listening
|
|
162
|
+
*/
|
|
163
|
+
Upgraded: (callback: (event: {
|
|
164
|
+
implementation: `0x${string}`;
|
|
165
|
+
}) => void, filter?: {
|
|
166
|
+
implementation?: `0x${string}` | `0x${string}`[] | null;
|
|
167
|
+
}) => () => void;
|
|
168
|
+
};
|
|
169
|
+
}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ERC721DropProxy = exports.ERC721DropProxyAbi = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
/**
|
|
6
|
+
* ERC721DropProxy ABI
|
|
7
|
+
*
|
|
8
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
9
|
+
*/
|
|
10
|
+
exports.ERC721DropProxyAbi = [
|
|
11
|
+
{
|
|
12
|
+
"inputs": [
|
|
13
|
+
{
|
|
14
|
+
"internalType": "address",
|
|
15
|
+
"name": "_logic",
|
|
16
|
+
"type": "address"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"internalType": "bytes",
|
|
20
|
+
"name": "_data",
|
|
21
|
+
"type": "bytes"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"stateMutability": "payable",
|
|
25
|
+
"type": "constructor"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"anonymous": false,
|
|
29
|
+
"inputs": [
|
|
30
|
+
{
|
|
31
|
+
"indexed": false,
|
|
32
|
+
"internalType": "address",
|
|
33
|
+
"name": "previousAdmin",
|
|
34
|
+
"type": "address"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"indexed": false,
|
|
38
|
+
"internalType": "address",
|
|
39
|
+
"name": "newAdmin",
|
|
40
|
+
"type": "address"
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
"name": "AdminChanged",
|
|
44
|
+
"type": "event"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"anonymous": false,
|
|
48
|
+
"inputs": [
|
|
49
|
+
{
|
|
50
|
+
"indexed": true,
|
|
51
|
+
"internalType": "address",
|
|
52
|
+
"name": "beacon",
|
|
53
|
+
"type": "address"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"name": "BeaconUpgraded",
|
|
57
|
+
"type": "event"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"anonymous": false,
|
|
61
|
+
"inputs": [
|
|
62
|
+
{
|
|
63
|
+
"indexed": true,
|
|
64
|
+
"internalType": "address",
|
|
65
|
+
"name": "implementation",
|
|
66
|
+
"type": "address"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"name": "Upgraded",
|
|
70
|
+
"type": "event"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
"stateMutability": "payable",
|
|
74
|
+
"type": "fallback"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"stateMutability": "payable",
|
|
78
|
+
"type": "receive"
|
|
79
|
+
}
|
|
80
|
+
];
|
|
81
|
+
/**
|
|
82
|
+
* ERC721DropProxy Contract Class
|
|
83
|
+
*
|
|
84
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
89
|
+
* import { mainnet } from 'viem/chains';
|
|
90
|
+
* import { ERC721DropProxy } from 'ERC721DropProxy';
|
|
91
|
+
*
|
|
92
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
93
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
94
|
+
*
|
|
95
|
+
* const contract = new ERC721DropProxy('0x...', { publicClient, walletClient });
|
|
96
|
+
*
|
|
97
|
+
* // Read functions
|
|
98
|
+
* const result = await contract.balanceOf('0x...');
|
|
99
|
+
*
|
|
100
|
+
* // Write functions
|
|
101
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
102
|
+
*
|
|
103
|
+
* // Simulate transactions (dry-run)
|
|
104
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
105
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
106
|
+
*
|
|
107
|
+
* // Watch events
|
|
108
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
109
|
+
* console.log('Transfer event:', event);
|
|
110
|
+
* });
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
class ERC721DropProxy {
|
|
114
|
+
constructor(address, clients) {
|
|
115
|
+
this.contractAddress = address;
|
|
116
|
+
this.publicClient = clients.publicClient;
|
|
117
|
+
this.contract = (0, viem_1.getContract)({
|
|
118
|
+
address,
|
|
119
|
+
abi: exports.ERC721DropProxyAbi,
|
|
120
|
+
client: {
|
|
121
|
+
public: clients.publicClient,
|
|
122
|
+
wallet: clients.walletClient,
|
|
123
|
+
},
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Get the contract address
|
|
128
|
+
*/
|
|
129
|
+
get address() {
|
|
130
|
+
return this.contractAddress;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Get the underlying viem contract instance.
|
|
134
|
+
*/
|
|
135
|
+
getContract() {
|
|
136
|
+
return this.contract;
|
|
137
|
+
}
|
|
138
|
+
// No read functions
|
|
139
|
+
// No write functions
|
|
140
|
+
/**
|
|
141
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
142
|
+
*
|
|
143
|
+
* Note: This contract has no write functions, so simulate returns an empty object.
|
|
144
|
+
*/
|
|
145
|
+
get simulate() {
|
|
146
|
+
return {};
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Watch contract events
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* // Watch all Transfer events
|
|
153
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
154
|
+
* console.log('Transfer:', event);
|
|
155
|
+
* });
|
|
156
|
+
*
|
|
157
|
+
* // Stop watching
|
|
158
|
+
* unwatch();
|
|
159
|
+
*/
|
|
160
|
+
get watch() {
|
|
161
|
+
return {
|
|
162
|
+
/**
|
|
163
|
+
* Watch AdminChanged events
|
|
164
|
+
* @param callback Function to call when event is emitted
|
|
165
|
+
* @param filter Optional filter for indexed parameters
|
|
166
|
+
* @returns Unwatch function to stop listening
|
|
167
|
+
*/
|
|
168
|
+
AdminChanged: (callback) => {
|
|
169
|
+
return this.publicClient.watchContractEvent({
|
|
170
|
+
address: this.contractAddress,
|
|
171
|
+
abi: exports.ERC721DropProxyAbi,
|
|
172
|
+
eventName: 'AdminChanged',
|
|
173
|
+
onLogs: (logs) => {
|
|
174
|
+
logs.forEach((log) => {
|
|
175
|
+
callback(log.args);
|
|
176
|
+
});
|
|
177
|
+
},
|
|
178
|
+
});
|
|
179
|
+
},
|
|
180
|
+
/**
|
|
181
|
+
* Watch BeaconUpgraded events
|
|
182
|
+
* @param callback Function to call when event is emitted
|
|
183
|
+
* @param filter Optional filter for indexed parameters
|
|
184
|
+
* @returns Unwatch function to stop listening
|
|
185
|
+
*/
|
|
186
|
+
BeaconUpgraded: (callback, filter) => {
|
|
187
|
+
return this.publicClient.watchContractEvent({
|
|
188
|
+
address: this.contractAddress,
|
|
189
|
+
abi: exports.ERC721DropProxyAbi,
|
|
190
|
+
eventName: 'BeaconUpgraded',
|
|
191
|
+
args: filter,
|
|
192
|
+
onLogs: (logs) => {
|
|
193
|
+
logs.forEach((log) => {
|
|
194
|
+
callback(log.args);
|
|
195
|
+
});
|
|
196
|
+
},
|
|
197
|
+
});
|
|
198
|
+
},
|
|
199
|
+
/**
|
|
200
|
+
* Watch Upgraded events
|
|
201
|
+
* @param callback Function to call when event is emitted
|
|
202
|
+
* @param filter Optional filter for indexed parameters
|
|
203
|
+
* @returns Unwatch function to stop listening
|
|
204
|
+
*/
|
|
205
|
+
Upgraded: (callback, filter) => {
|
|
206
|
+
return this.publicClient.watchContractEvent({
|
|
207
|
+
address: this.contractAddress,
|
|
208
|
+
abi: exports.ERC721DropProxyAbi,
|
|
209
|
+
eventName: 'Upgraded',
|
|
210
|
+
args: filter,
|
|
211
|
+
onLogs: (logs) => {
|
|
212
|
+
logs.forEach((log) => {
|
|
213
|
+
callback(log.args);
|
|
214
|
+
});
|
|
215
|
+
},
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
exports.ERC721DropProxy = ERC721DropProxy;
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
|
|
2
|
+
import { getContract } from 'viem';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* ERC721DropProxy ABI
|
|
6
|
+
*
|
|
7
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
8
|
+
*/
|
|
9
|
+
export const ERC721DropProxyAbi = [
|
|
10
|
+
{
|
|
11
|
+
"inputs": [
|
|
12
|
+
{
|
|
13
|
+
"internalType": "address",
|
|
14
|
+
"name": "_logic",
|
|
15
|
+
"type": "address"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"internalType": "bytes",
|
|
19
|
+
"name": "_data",
|
|
20
|
+
"type": "bytes"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"stateMutability": "payable",
|
|
24
|
+
"type": "constructor"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"anonymous": false,
|
|
28
|
+
"inputs": [
|
|
29
|
+
{
|
|
30
|
+
"indexed": false,
|
|
31
|
+
"internalType": "address",
|
|
32
|
+
"name": "previousAdmin",
|
|
33
|
+
"type": "address"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"indexed": false,
|
|
37
|
+
"internalType": "address",
|
|
38
|
+
"name": "newAdmin",
|
|
39
|
+
"type": "address"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"name": "AdminChanged",
|
|
43
|
+
"type": "event"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"anonymous": false,
|
|
47
|
+
"inputs": [
|
|
48
|
+
{
|
|
49
|
+
"indexed": true,
|
|
50
|
+
"internalType": "address",
|
|
51
|
+
"name": "beacon",
|
|
52
|
+
"type": "address"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"name": "BeaconUpgraded",
|
|
56
|
+
"type": "event"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"anonymous": false,
|
|
60
|
+
"inputs": [
|
|
61
|
+
{
|
|
62
|
+
"indexed": true,
|
|
63
|
+
"internalType": "address",
|
|
64
|
+
"name": "implementation",
|
|
65
|
+
"type": "address"
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"name": "Upgraded",
|
|
69
|
+
"type": "event"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"stateMutability": "payable",
|
|
73
|
+
"type": "fallback"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"stateMutability": "payable",
|
|
77
|
+
"type": "receive"
|
|
78
|
+
}
|
|
79
|
+
] as const satisfies Abi;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Type-safe ABI for ERC721DropProxy
|
|
83
|
+
*/
|
|
84
|
+
export type ERC721DropProxyAbi = typeof ERC721DropProxyAbi;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Contract instance type for ERC721DropProxy
|
|
88
|
+
*/
|
|
89
|
+
// Use any for contract type to avoid complex viem type issues
|
|
90
|
+
// The runtime behavior is type-safe through viem's ABI typing
|
|
91
|
+
export type ERC721DropProxyContract = any;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* ERC721DropProxy Contract Class
|
|
95
|
+
*
|
|
96
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```typescript
|
|
100
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
101
|
+
* import { mainnet } from 'viem/chains';
|
|
102
|
+
* import { ERC721DropProxy } from 'ERC721DropProxy';
|
|
103
|
+
*
|
|
104
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
105
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
106
|
+
*
|
|
107
|
+
* const contract = new ERC721DropProxy('0x...', { publicClient, walletClient });
|
|
108
|
+
*
|
|
109
|
+
* // Read functions
|
|
110
|
+
* const result = await contract.balanceOf('0x...');
|
|
111
|
+
*
|
|
112
|
+
* // Write functions
|
|
113
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
114
|
+
*
|
|
115
|
+
* // Simulate transactions (dry-run)
|
|
116
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
117
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
118
|
+
*
|
|
119
|
+
* // Watch events
|
|
120
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
121
|
+
* console.log('Transfer event:', event);
|
|
122
|
+
* });
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
export class ERC721DropProxy {
|
|
126
|
+
private contract: ERC721DropProxyContract;
|
|
127
|
+
private contractAddress: Address;
|
|
128
|
+
private publicClient: PublicClient;
|
|
129
|
+
|
|
130
|
+
constructor(
|
|
131
|
+
address: Address,
|
|
132
|
+
clients: {
|
|
133
|
+
publicClient: PublicClient;
|
|
134
|
+
walletClient?: WalletClient;
|
|
135
|
+
}
|
|
136
|
+
) {
|
|
137
|
+
this.contractAddress = address;
|
|
138
|
+
this.publicClient = clients.publicClient;
|
|
139
|
+
this.contract = getContract({
|
|
140
|
+
address,
|
|
141
|
+
abi: ERC721DropProxyAbi,
|
|
142
|
+
client: {
|
|
143
|
+
public: clients.publicClient,
|
|
144
|
+
wallet: clients.walletClient,
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Get the contract address
|
|
151
|
+
*/
|
|
152
|
+
get address(): Address {
|
|
153
|
+
return this.contractAddress;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Get the underlying viem contract instance.
|
|
158
|
+
*/
|
|
159
|
+
getContract(): ERC721DropProxyContract {
|
|
160
|
+
return this.contract;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// No read functions
|
|
164
|
+
|
|
165
|
+
// No write functions
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
171
|
+
*
|
|
172
|
+
* Note: This contract has no write functions, so simulate returns an empty object.
|
|
173
|
+
*/
|
|
174
|
+
get simulate() {
|
|
175
|
+
return {};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Watch contract events
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* // Watch all Transfer events
|
|
183
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
184
|
+
* console.log('Transfer:', event);
|
|
185
|
+
* });
|
|
186
|
+
*
|
|
187
|
+
* // Stop watching
|
|
188
|
+
* unwatch();
|
|
189
|
+
*/
|
|
190
|
+
get watch() {
|
|
191
|
+
return {
|
|
192
|
+
/**
|
|
193
|
+
* Watch AdminChanged events
|
|
194
|
+
* @param callback Function to call when event is emitted
|
|
195
|
+
* @param filter Optional filter for indexed parameters
|
|
196
|
+
* @returns Unwatch function to stop listening
|
|
197
|
+
*/
|
|
198
|
+
AdminChanged: (callback: (event: { previousAdmin: `0x${string}`; newAdmin: `0x${string}` }) => void) => {
|
|
199
|
+
return this.publicClient.watchContractEvent({
|
|
200
|
+
address: this.contractAddress,
|
|
201
|
+
abi: ERC721DropProxyAbi,
|
|
202
|
+
eventName: 'AdminChanged',
|
|
203
|
+
|
|
204
|
+
onLogs: (logs: any[]) => {
|
|
205
|
+
logs.forEach((log: any) => {
|
|
206
|
+
callback(log.args as any);
|
|
207
|
+
});
|
|
208
|
+
},
|
|
209
|
+
}) as () => void;
|
|
210
|
+
},
|
|
211
|
+
/**
|
|
212
|
+
* Watch BeaconUpgraded events
|
|
213
|
+
* @param callback Function to call when event is emitted
|
|
214
|
+
* @param filter Optional filter for indexed parameters
|
|
215
|
+
* @returns Unwatch function to stop listening
|
|
216
|
+
*/
|
|
217
|
+
BeaconUpgraded: (callback: (event: { beacon: `0x${string}` }) => void, filter?: { beacon?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
218
|
+
return this.publicClient.watchContractEvent({
|
|
219
|
+
address: this.contractAddress,
|
|
220
|
+
abi: ERC721DropProxyAbi,
|
|
221
|
+
eventName: 'BeaconUpgraded',
|
|
222
|
+
args: filter as any,
|
|
223
|
+
onLogs: (logs: any[]) => {
|
|
224
|
+
logs.forEach((log: any) => {
|
|
225
|
+
callback(log.args as any);
|
|
226
|
+
});
|
|
227
|
+
},
|
|
228
|
+
}) as () => void;
|
|
229
|
+
},
|
|
230
|
+
/**
|
|
231
|
+
* Watch Upgraded events
|
|
232
|
+
* @param callback Function to call when event is emitted
|
|
233
|
+
* @param filter Optional filter for indexed parameters
|
|
234
|
+
* @returns Unwatch function to stop listening
|
|
235
|
+
*/
|
|
236
|
+
Upgraded: (callback: (event: { implementation: `0x${string}` }) => void, filter?: { implementation?: `0x${string}` | `0x${string}`[] | null }) => {
|
|
237
|
+
return this.publicClient.watchContractEvent({
|
|
238
|
+
address: this.contractAddress,
|
|
239
|
+
abi: ERC721DropProxyAbi,
|
|
240
|
+
eventName: 'Upgraded',
|
|
241
|
+
args: filter as any,
|
|
242
|
+
onLogs: (logs: any[]) => {
|
|
243
|
+
logs.forEach((log: any) => {
|
|
244
|
+
callback(log.args as any);
|
|
245
|
+
});
|
|
246
|
+
},
|
|
247
|
+
}) as () => void;
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ERC721DropAbi, ERC721Drop } from './ERC721Drop';
|
|
2
|
+
export type { ERC721DropAbi as ERC721DropAbiType, ERC721DropContract } from './ERC721Drop';
|
|
3
|
+
export { ERC721DropProxyAbi, ERC721DropProxy } from './ERC721DropProxy';
|
|
4
|
+
export type { ERC721DropProxyAbi as ERC721DropProxyAbiType, ERC721DropProxyContract } from './ERC721DropProxy';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ERC721DropProxy = exports.ERC721DropProxyAbi = exports.ERC721Drop = exports.ERC721DropAbi = void 0;
|
|
4
|
+
// Auto-generated exports for all contracts
|
|
5
|
+
var ERC721Drop_1 = require("./ERC721Drop");
|
|
6
|
+
Object.defineProperty(exports, "ERC721DropAbi", { enumerable: true, get: function () { return ERC721Drop_1.ERC721DropAbi; } });
|
|
7
|
+
Object.defineProperty(exports, "ERC721Drop", { enumerable: true, get: function () { return ERC721Drop_1.ERC721Drop; } });
|
|
8
|
+
var ERC721DropProxy_1 = require("./ERC721DropProxy");
|
|
9
|
+
Object.defineProperty(exports, "ERC721DropProxyAbi", { enumerable: true, get: function () { return ERC721DropProxy_1.ERC721DropProxyAbi; } });
|
|
10
|
+
Object.defineProperty(exports, "ERC721DropProxy", { enumerable: true, get: function () { return ERC721DropProxy_1.ERC721DropProxy; } });
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Auto-generated exports for all contracts
|
|
2
|
+
export { ERC721DropAbi, ERC721Drop } from './ERC721Drop';
|
|
3
|
+
export type { ERC721DropAbi as ERC721DropAbiType, ERC721DropContract } from './ERC721Drop';
|
|
4
|
+
export { ERC721DropProxyAbi, ERC721DropProxy } from './ERC721DropProxy';
|
|
5
|
+
export type { ERC721DropProxyAbi as ERC721DropProxyAbiType, ERC721DropProxyContract } from './ERC721DropProxy';
|
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);
|