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