@gitmyabi/logic 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +107 -2
- package/contracts/Logic.d.ts +2256 -0
- package/contracts/Logic.js +1992 -0
- package/contracts/Logic.ts +2890 -0
- package/contracts/OwnedProxy.d.ts +168 -0
- package/contracts/OwnedProxy.js +185 -0
- package/contracts/OwnedProxy.ts +237 -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,168 @@
|
|
|
1
|
+
import type { Address, PublicClient, WalletClient } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* OwnedProxy ABI
|
|
4
|
+
*
|
|
5
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
6
|
+
*/
|
|
7
|
+
export declare const OwnedProxyAbi: readonly [{
|
|
8
|
+
readonly inputs: readonly [{
|
|
9
|
+
readonly internalType: "address";
|
|
10
|
+
readonly name: "owner_";
|
|
11
|
+
readonly type: "address";
|
|
12
|
+
}];
|
|
13
|
+
readonly stateMutability: "nonpayable";
|
|
14
|
+
readonly type: "constructor";
|
|
15
|
+
}, {
|
|
16
|
+
readonly stateMutability: "payable";
|
|
17
|
+
readonly type: "fallback";
|
|
18
|
+
}, {
|
|
19
|
+
readonly inputs: readonly [];
|
|
20
|
+
readonly name: "implementation_67SpLH";
|
|
21
|
+
readonly outputs: readonly [{
|
|
22
|
+
readonly internalType: "address";
|
|
23
|
+
readonly name: "impl";
|
|
24
|
+
readonly type: "address";
|
|
25
|
+
}];
|
|
26
|
+
readonly stateMutability: "view";
|
|
27
|
+
readonly type: "function";
|
|
28
|
+
}, {
|
|
29
|
+
readonly inputs: readonly [];
|
|
30
|
+
readonly name: "proxyOwner_13pCyi";
|
|
31
|
+
readonly outputs: readonly [{
|
|
32
|
+
readonly internalType: "address";
|
|
33
|
+
readonly name: "";
|
|
34
|
+
readonly type: "address";
|
|
35
|
+
}];
|
|
36
|
+
readonly stateMutability: "view";
|
|
37
|
+
readonly type: "function";
|
|
38
|
+
}, {
|
|
39
|
+
readonly inputs: readonly [{
|
|
40
|
+
readonly internalType: "address";
|
|
41
|
+
readonly name: "newImplementation";
|
|
42
|
+
readonly type: "address";
|
|
43
|
+
}];
|
|
44
|
+
readonly name: "upgradeTo_2v93DM";
|
|
45
|
+
readonly outputs: readonly [];
|
|
46
|
+
readonly stateMutability: "nonpayable";
|
|
47
|
+
readonly type: "function";
|
|
48
|
+
}, {
|
|
49
|
+
readonly stateMutability: "payable";
|
|
50
|
+
readonly type: "receive";
|
|
51
|
+
}];
|
|
52
|
+
/**
|
|
53
|
+
* Type-safe ABI for OwnedProxy
|
|
54
|
+
*/
|
|
55
|
+
export type OwnedProxyAbi = typeof OwnedProxyAbi;
|
|
56
|
+
/**
|
|
57
|
+
* Contract instance type for OwnedProxy
|
|
58
|
+
*/
|
|
59
|
+
export type OwnedProxyContract = any;
|
|
60
|
+
/**
|
|
61
|
+
* OwnedProxy Contract Class
|
|
62
|
+
*
|
|
63
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```typescript
|
|
67
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
68
|
+
* import { mainnet } from 'viem/chains';
|
|
69
|
+
* import { OwnedProxy } from 'OwnedProxy';
|
|
70
|
+
*
|
|
71
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
72
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
73
|
+
*
|
|
74
|
+
* const contract = new OwnedProxy('0x...', { publicClient, walletClient });
|
|
75
|
+
*
|
|
76
|
+
* // Read functions
|
|
77
|
+
* const result = await contract.balanceOf('0x...');
|
|
78
|
+
*
|
|
79
|
+
* // Write functions
|
|
80
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
81
|
+
*
|
|
82
|
+
* // Simulate transactions (dry-run)
|
|
83
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
84
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
85
|
+
*
|
|
86
|
+
* // Watch events
|
|
87
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
88
|
+
* console.log('Transfer event:', event);
|
|
89
|
+
* });
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export declare class OwnedProxy {
|
|
93
|
+
private contract;
|
|
94
|
+
private contractAddress;
|
|
95
|
+
private publicClient;
|
|
96
|
+
constructor(address: Address, clients: {
|
|
97
|
+
publicClient: PublicClient;
|
|
98
|
+
walletClient?: WalletClient;
|
|
99
|
+
});
|
|
100
|
+
/**
|
|
101
|
+
* Get the contract address
|
|
102
|
+
*/
|
|
103
|
+
get address(): Address;
|
|
104
|
+
/**
|
|
105
|
+
* Get the underlying viem contract instance.
|
|
106
|
+
*/
|
|
107
|
+
getContract(): OwnedProxyContract;
|
|
108
|
+
/**
|
|
109
|
+
* implementation_67SpLH
|
|
110
|
+
* view
|
|
111
|
+
*/
|
|
112
|
+
implementation_67SpLH(): Promise<`0x${string}`>;
|
|
113
|
+
/**
|
|
114
|
+
* proxyOwner_13pCyi
|
|
115
|
+
* view
|
|
116
|
+
*/
|
|
117
|
+
proxyOwner_13pCyi(): Promise<`0x${string}`>;
|
|
118
|
+
/**
|
|
119
|
+
* upgradeTo_2v93DM
|
|
120
|
+
* nonpayable
|
|
121
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
122
|
+
*/
|
|
123
|
+
upgradeTo_2v93DM(newImplementation: `0x${string}`, options?: {
|
|
124
|
+
accessList?: import('viem').AccessList;
|
|
125
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
126
|
+
chain?: import('viem').Chain | null;
|
|
127
|
+
dataSuffix?: `0x${string}`;
|
|
128
|
+
gas?: bigint;
|
|
129
|
+
gasPrice?: bigint;
|
|
130
|
+
maxFeePerGas?: bigint;
|
|
131
|
+
maxPriorityFeePerGas?: bigint;
|
|
132
|
+
nonce?: number;
|
|
133
|
+
value?: bigint;
|
|
134
|
+
}): Promise<`0x${string}`>;
|
|
135
|
+
/**
|
|
136
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
140
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
141
|
+
* console.log('Would succeed:', result.result);
|
|
142
|
+
*/
|
|
143
|
+
get simulate(): {
|
|
144
|
+
/**
|
|
145
|
+
* Simulate upgradeTo_2v93DM
|
|
146
|
+
* Returns gas estimate and result without sending transaction
|
|
147
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
148
|
+
*/
|
|
149
|
+
upgradeTo_2v93DM(newImplementation: `0x${string}`, options?: {
|
|
150
|
+
accessList?: import("viem").AccessList;
|
|
151
|
+
authorizationList?: import("viem").AuthorizationList;
|
|
152
|
+
chain?: import("viem").Chain | null;
|
|
153
|
+
dataSuffix?: `0x${string}`;
|
|
154
|
+
gas?: bigint;
|
|
155
|
+
gasPrice?: bigint;
|
|
156
|
+
maxFeePerGas?: bigint;
|
|
157
|
+
maxPriorityFeePerGas?: bigint;
|
|
158
|
+
nonce?: number;
|
|
159
|
+
value?: bigint;
|
|
160
|
+
}): Promise<void>;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Watch contract events
|
|
164
|
+
*
|
|
165
|
+
* Note: This contract has no events, so watch returns an empty object.
|
|
166
|
+
*/
|
|
167
|
+
get watch(): {};
|
|
168
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OwnedProxy = exports.OwnedProxyAbi = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
/**
|
|
6
|
+
* OwnedProxy ABI
|
|
7
|
+
*
|
|
8
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
9
|
+
*/
|
|
10
|
+
exports.OwnedProxyAbi = [
|
|
11
|
+
{
|
|
12
|
+
"inputs": [
|
|
13
|
+
{
|
|
14
|
+
"internalType": "address",
|
|
15
|
+
"name": "owner_",
|
|
16
|
+
"type": "address"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"stateMutability": "nonpayable",
|
|
20
|
+
"type": "constructor"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"stateMutability": "payable",
|
|
24
|
+
"type": "fallback"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"inputs": [],
|
|
28
|
+
"name": "implementation_67SpLH",
|
|
29
|
+
"outputs": [
|
|
30
|
+
{
|
|
31
|
+
"internalType": "address",
|
|
32
|
+
"name": "impl",
|
|
33
|
+
"type": "address"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"stateMutability": "view",
|
|
37
|
+
"type": "function"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"inputs": [],
|
|
41
|
+
"name": "proxyOwner_13pCyi",
|
|
42
|
+
"outputs": [
|
|
43
|
+
{
|
|
44
|
+
"internalType": "address",
|
|
45
|
+
"name": "",
|
|
46
|
+
"type": "address"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"stateMutability": "view",
|
|
50
|
+
"type": "function"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"inputs": [
|
|
54
|
+
{
|
|
55
|
+
"internalType": "address",
|
|
56
|
+
"name": "newImplementation",
|
|
57
|
+
"type": "address"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"name": "upgradeTo_2v93DM",
|
|
61
|
+
"outputs": [],
|
|
62
|
+
"stateMutability": "nonpayable",
|
|
63
|
+
"type": "function"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"stateMutability": "payable",
|
|
67
|
+
"type": "receive"
|
|
68
|
+
}
|
|
69
|
+
];
|
|
70
|
+
/**
|
|
71
|
+
* OwnedProxy Contract Class
|
|
72
|
+
*
|
|
73
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
78
|
+
* import { mainnet } from 'viem/chains';
|
|
79
|
+
* import { OwnedProxy } from 'OwnedProxy';
|
|
80
|
+
*
|
|
81
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
82
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
83
|
+
*
|
|
84
|
+
* const contract = new OwnedProxy('0x...', { publicClient, walletClient });
|
|
85
|
+
*
|
|
86
|
+
* // Read functions
|
|
87
|
+
* const result = await contract.balanceOf('0x...');
|
|
88
|
+
*
|
|
89
|
+
* // Write functions
|
|
90
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
91
|
+
*
|
|
92
|
+
* // Simulate transactions (dry-run)
|
|
93
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
94
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
95
|
+
*
|
|
96
|
+
* // Watch events
|
|
97
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
98
|
+
* console.log('Transfer event:', event);
|
|
99
|
+
* });
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
class OwnedProxy {
|
|
103
|
+
constructor(address, clients) {
|
|
104
|
+
this.contractAddress = address;
|
|
105
|
+
this.publicClient = clients.publicClient;
|
|
106
|
+
this.contract = (0, viem_1.getContract)({
|
|
107
|
+
address,
|
|
108
|
+
abi: exports.OwnedProxyAbi,
|
|
109
|
+
client: {
|
|
110
|
+
public: clients.publicClient,
|
|
111
|
+
wallet: clients.walletClient,
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Get the contract address
|
|
117
|
+
*/
|
|
118
|
+
get address() {
|
|
119
|
+
return this.contractAddress;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Get the underlying viem contract instance.
|
|
123
|
+
*/
|
|
124
|
+
getContract() {
|
|
125
|
+
return this.contract;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* implementation_67SpLH
|
|
129
|
+
* view
|
|
130
|
+
*/
|
|
131
|
+
async implementation_67SpLH() {
|
|
132
|
+
return this.contract.read.implementation_67SpLH();
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* proxyOwner_13pCyi
|
|
136
|
+
* view
|
|
137
|
+
*/
|
|
138
|
+
async proxyOwner_13pCyi() {
|
|
139
|
+
return this.contract.read.proxyOwner_13pCyi();
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* upgradeTo_2v93DM
|
|
143
|
+
* nonpayable
|
|
144
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
145
|
+
*/
|
|
146
|
+
async upgradeTo_2v93DM(newImplementation, options) {
|
|
147
|
+
if (!this.contract.write) {
|
|
148
|
+
throw new Error('Wallet client is required for write operations');
|
|
149
|
+
}
|
|
150
|
+
return this.contract.write.upgradeTo_2v93DM([newImplementation], options);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
154
|
+
*
|
|
155
|
+
* @example
|
|
156
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
157
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
158
|
+
* console.log('Would succeed:', result.result);
|
|
159
|
+
*/
|
|
160
|
+
get simulate() {
|
|
161
|
+
const contract = this.contract;
|
|
162
|
+
if (!contract.simulate) {
|
|
163
|
+
throw new Error('Public client is required for simulation');
|
|
164
|
+
}
|
|
165
|
+
return {
|
|
166
|
+
/**
|
|
167
|
+
* Simulate upgradeTo_2v93DM
|
|
168
|
+
* Returns gas estimate and result without sending transaction
|
|
169
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
170
|
+
*/
|
|
171
|
+
async upgradeTo_2v93DM(newImplementation, options) {
|
|
172
|
+
return contract.simulate.upgradeTo_2v93DM([newImplementation], options);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Watch contract events
|
|
178
|
+
*
|
|
179
|
+
* Note: This contract has no events, so watch returns an empty object.
|
|
180
|
+
*/
|
|
181
|
+
get watch() {
|
|
182
|
+
return {};
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
exports.OwnedProxy = OwnedProxy;
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
|
|
2
|
+
import { getContract } from 'viem';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* OwnedProxy ABI
|
|
6
|
+
*
|
|
7
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
8
|
+
*/
|
|
9
|
+
export const OwnedProxyAbi = [
|
|
10
|
+
{
|
|
11
|
+
"inputs": [
|
|
12
|
+
{
|
|
13
|
+
"internalType": "address",
|
|
14
|
+
"name": "owner_",
|
|
15
|
+
"type": "address"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"stateMutability": "nonpayable",
|
|
19
|
+
"type": "constructor"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"stateMutability": "payable",
|
|
23
|
+
"type": "fallback"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"inputs": [],
|
|
27
|
+
"name": "implementation_67SpLH",
|
|
28
|
+
"outputs": [
|
|
29
|
+
{
|
|
30
|
+
"internalType": "address",
|
|
31
|
+
"name": "impl",
|
|
32
|
+
"type": "address"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"stateMutability": "view",
|
|
36
|
+
"type": "function"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"inputs": [],
|
|
40
|
+
"name": "proxyOwner_13pCyi",
|
|
41
|
+
"outputs": [
|
|
42
|
+
{
|
|
43
|
+
"internalType": "address",
|
|
44
|
+
"name": "",
|
|
45
|
+
"type": "address"
|
|
46
|
+
}
|
|
47
|
+
],
|
|
48
|
+
"stateMutability": "view",
|
|
49
|
+
"type": "function"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"inputs": [
|
|
53
|
+
{
|
|
54
|
+
"internalType": "address",
|
|
55
|
+
"name": "newImplementation",
|
|
56
|
+
"type": "address"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"name": "upgradeTo_2v93DM",
|
|
60
|
+
"outputs": [],
|
|
61
|
+
"stateMutability": "nonpayable",
|
|
62
|
+
"type": "function"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"stateMutability": "payable",
|
|
66
|
+
"type": "receive"
|
|
67
|
+
}
|
|
68
|
+
] as const satisfies Abi;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Type-safe ABI for OwnedProxy
|
|
72
|
+
*/
|
|
73
|
+
export type OwnedProxyAbi = typeof OwnedProxyAbi;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Contract instance type for OwnedProxy
|
|
77
|
+
*/
|
|
78
|
+
// Use any for contract type to avoid complex viem type issues
|
|
79
|
+
// The runtime behavior is type-safe through viem's ABI typing
|
|
80
|
+
export type OwnedProxyContract = any;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* OwnedProxy 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 { OwnedProxy } from 'OwnedProxy';
|
|
92
|
+
*
|
|
93
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
94
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
95
|
+
*
|
|
96
|
+
* const contract = new OwnedProxy('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
|
+
export class OwnedProxy {
|
|
115
|
+
private contract: OwnedProxyContract;
|
|
116
|
+
private contractAddress: Address;
|
|
117
|
+
private publicClient: PublicClient;
|
|
118
|
+
|
|
119
|
+
constructor(
|
|
120
|
+
address: Address,
|
|
121
|
+
clients: {
|
|
122
|
+
publicClient: PublicClient;
|
|
123
|
+
walletClient?: WalletClient;
|
|
124
|
+
}
|
|
125
|
+
) {
|
|
126
|
+
this.contractAddress = address;
|
|
127
|
+
this.publicClient = clients.publicClient;
|
|
128
|
+
this.contract = getContract({
|
|
129
|
+
address,
|
|
130
|
+
abi: OwnedProxyAbi,
|
|
131
|
+
client: {
|
|
132
|
+
public: clients.publicClient,
|
|
133
|
+
wallet: clients.walletClient,
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Get the contract address
|
|
140
|
+
*/
|
|
141
|
+
get address(): Address {
|
|
142
|
+
return this.contractAddress;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Get the underlying viem contract instance.
|
|
147
|
+
*/
|
|
148
|
+
getContract(): OwnedProxyContract {
|
|
149
|
+
return this.contract;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* implementation_67SpLH
|
|
154
|
+
* view
|
|
155
|
+
*/
|
|
156
|
+
async implementation_67SpLH(): Promise<`0x${string}`> {
|
|
157
|
+
return this.contract.read.implementation_67SpLH() as Promise<`0x${string}`>;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* proxyOwner_13pCyi
|
|
162
|
+
* view
|
|
163
|
+
*/
|
|
164
|
+
async proxyOwner_13pCyi(): Promise<`0x${string}`> {
|
|
165
|
+
return this.contract.read.proxyOwner_13pCyi() as Promise<`0x${string}`>;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* upgradeTo_2v93DM
|
|
170
|
+
* nonpayable
|
|
171
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
172
|
+
*/
|
|
173
|
+
async upgradeTo_2v93DM(newImplementation: `0x${string}`, options?: {
|
|
174
|
+
accessList?: import('viem').AccessList;
|
|
175
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
176
|
+
chain?: import('viem').Chain | null;
|
|
177
|
+
dataSuffix?: `0x${string}`;
|
|
178
|
+
gas?: bigint;
|
|
179
|
+
gasPrice?: bigint;
|
|
180
|
+
maxFeePerGas?: bigint;
|
|
181
|
+
maxPriorityFeePerGas?: bigint;
|
|
182
|
+
nonce?: number;
|
|
183
|
+
value?: bigint;
|
|
184
|
+
}): Promise<`0x${string}`> {
|
|
185
|
+
if (!this.contract.write) {
|
|
186
|
+
throw new Error('Wallet client is required for write operations');
|
|
187
|
+
}
|
|
188
|
+
return this.contract.write.upgradeTo_2v93DM([newImplementation] as const, options) as Promise<`0x${string}`>;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
195
|
+
*
|
|
196
|
+
* @example
|
|
197
|
+
* const result = await contract.simulate.transfer('0x...', 1000n);
|
|
198
|
+
* console.log('Gas estimate:', result.request.gas);
|
|
199
|
+
* console.log('Would succeed:', result.result);
|
|
200
|
+
*/
|
|
201
|
+
get simulate() {
|
|
202
|
+
const contract = this.contract;
|
|
203
|
+
if (!contract.simulate) {
|
|
204
|
+
throw new Error('Public client is required for simulation');
|
|
205
|
+
}
|
|
206
|
+
return {
|
|
207
|
+
/**
|
|
208
|
+
* Simulate upgradeTo_2v93DM
|
|
209
|
+
* Returns gas estimate and result without sending transaction
|
|
210
|
+
* @param options Optional transaction parameters (value, gas, nonce, etc.)
|
|
211
|
+
*/
|
|
212
|
+
async upgradeTo_2v93DM(newImplementation: `0x${string}`, options?: {
|
|
213
|
+
accessList?: import('viem').AccessList;
|
|
214
|
+
authorizationList?: import('viem').AuthorizationList;
|
|
215
|
+
chain?: import('viem').Chain | null;
|
|
216
|
+
dataSuffix?: `0x${string}`;
|
|
217
|
+
gas?: bigint;
|
|
218
|
+
gasPrice?: bigint;
|
|
219
|
+
maxFeePerGas?: bigint;
|
|
220
|
+
maxPriorityFeePerGas?: bigint;
|
|
221
|
+
nonce?: number;
|
|
222
|
+
value?: bigint;
|
|
223
|
+
}): Promise<void> {
|
|
224
|
+
return contract.simulate.upgradeTo_2v93DM([newImplementation] as const, options) as Promise<void>;
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Watch contract events
|
|
231
|
+
*
|
|
232
|
+
* Note: This contract has no events, so watch returns an empty object.
|
|
233
|
+
*/
|
|
234
|
+
get watch() {
|
|
235
|
+
return {};
|
|
236
|
+
}
|
|
237
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OwnedProxy = exports.OwnedProxyAbi = exports.Logic = exports.LogicAbi = void 0;
|
|
4
|
+
// Auto-generated exports for all contracts
|
|
5
|
+
var Logic_1 = require("./Logic");
|
|
6
|
+
Object.defineProperty(exports, "LogicAbi", { enumerable: true, get: function () { return Logic_1.LogicAbi; } });
|
|
7
|
+
Object.defineProperty(exports, "Logic", { enumerable: true, get: function () { return Logic_1.Logic; } });
|
|
8
|
+
var OwnedProxy_1 = require("./OwnedProxy");
|
|
9
|
+
Object.defineProperty(exports, "OwnedProxyAbi", { enumerable: true, get: function () { return OwnedProxy_1.OwnedProxyAbi; } });
|
|
10
|
+
Object.defineProperty(exports, "OwnedProxy", { enumerable: true, get: function () { return OwnedProxy_1.OwnedProxy; } });
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Auto-generated exports for all contracts
|
|
2
|
+
export { LogicAbi, Logic } from './Logic';
|
|
3
|
+
export type { LogicAbi as LogicAbiType, LogicContract } from './Logic';
|
|
4
|
+
export { OwnedProxyAbi, OwnedProxy } from './OwnedProxy';
|
|
5
|
+
export type { OwnedProxyAbi as OwnedProxyAbiType, OwnedProxyContract } from './OwnedProxy';
|
package/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './contracts';
|
package/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Auto-generated TypeScript type bindings
|
|
3
|
+
// This file exports all generated contract types
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
__exportStar(require("./contracts"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitmyabi/logic",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Auto-generated TypeScript type bindings for Logic (build etherscan-logic-278d858f-1794198973555, commit 0298b2d, branch etherscan)",
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"types": "./index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./index.js",
|
|
10
|
+
"require": "./index.js",
|
|
11
|
+
"types": "./index.d.ts"
|
|
12
|
+
},
|
|
13
|
+
"./contracts": {
|
|
14
|
+
"import": "./contracts/index.js",
|
|
15
|
+
"require": "./contracts/index.js",
|
|
16
|
+
"types": "./contracts/index.d.ts"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"index.js",
|
|
21
|
+
"index.d.ts",
|
|
22
|
+
"contracts"
|
|
23
|
+
],
|
|
24
|
+
"keywords": [
|
|
25
|
+
"ethereum",
|
|
26
|
+
"smart-contracts",
|
|
27
|
+
"viem",
|
|
28
|
+
"wagmi",
|
|
29
|
+
"typescript",
|
|
30
|
+
"abi",
|
|
31
|
+
"ethers-v6"
|
|
32
|
+
],
|
|
33
|
+
"license": "Apache-2.0",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"viem": "^2.0.0"
|
|
36
|
+
},
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/etherscan/logic"
|
|
40
|
+
},
|
|
41
|
+
"branch": "etherscan",
|
|
42
|
+
"shortHash": "0298b2d"
|
|
6
43
|
}
|