@gitmyabi/topup 1.0.0 → 1.0.2
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 +5 -5
- package/contracts/BeaconProxy_json.d.ts +152 -0
- package/contracts/BeaconProxy_json.js +191 -0
- package/contracts/BeaconProxy_json.ts +220 -0
- package/contracts/index.d.ts +2 -0
- package/contracts/index.js +4 -1
- package/contracts/index.ts +2 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
Auto-generated TypeScript type bindings for **TopUp**
|
|
4
4
|
|
|
5
|
-
- **Build ID**: `etherscan-topup-
|
|
5
|
+
- **Build ID**: `etherscan-topup-1535435c-1785591931731`
|
|
6
6
|
- **Build Number**: 1
|
|
7
|
-
- **Commit**: `
|
|
7
|
+
- **Commit**: `a450a33`
|
|
8
8
|
- **Branch**: `etherscan`
|
|
9
9
|
- **Target**: `ethers-v6`
|
|
10
|
-
- **Contracts**:
|
|
10
|
+
- **Contracts**: 2
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
-
npm install @gitmyabi/topup@1.0.
|
|
15
|
+
npm install @gitmyabi/topup@1.0.2
|
|
16
16
|
```
|
|
17
17
|
|
|
18
18
|
## Usage
|
|
@@ -101,7 +101,7 @@ This package provides full TypeScript type safety for all contract methods, even
|
|
|
101
101
|
|
|
102
102
|
## Generated Contracts
|
|
103
103
|
|
|
104
|
-
This package includes type bindings for
|
|
104
|
+
This package includes type bindings for 2 contract(s) generated from ABI artifacts.
|
|
105
105
|
|
|
106
106
|
## License
|
|
107
107
|
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import type { Address, PublicClient, WalletClient } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* BeaconProxy_json ABI
|
|
4
|
+
*
|
|
5
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
6
|
+
*/
|
|
7
|
+
export declare const BeaconProxy_jsonAbi: readonly [{
|
|
8
|
+
readonly inputs: readonly [{
|
|
9
|
+
readonly internalType: "address";
|
|
10
|
+
readonly name: "beacon";
|
|
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 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: "beacon";
|
|
31
|
+
readonly type: "address";
|
|
32
|
+
}];
|
|
33
|
+
readonly name: "ERC1967InvalidBeacon";
|
|
34
|
+
readonly type: "error";
|
|
35
|
+
}, {
|
|
36
|
+
readonly inputs: readonly [{
|
|
37
|
+
readonly internalType: "address";
|
|
38
|
+
readonly name: "implementation";
|
|
39
|
+
readonly type: "address";
|
|
40
|
+
}];
|
|
41
|
+
readonly name: "ERC1967InvalidImplementation";
|
|
42
|
+
readonly type: "error";
|
|
43
|
+
}, {
|
|
44
|
+
readonly inputs: readonly [];
|
|
45
|
+
readonly name: "ERC1967NonPayable";
|
|
46
|
+
readonly type: "error";
|
|
47
|
+
}, {
|
|
48
|
+
readonly inputs: readonly [];
|
|
49
|
+
readonly name: "FailedCall";
|
|
50
|
+
readonly type: "error";
|
|
51
|
+
}, {
|
|
52
|
+
readonly anonymous: false;
|
|
53
|
+
readonly inputs: readonly [{
|
|
54
|
+
readonly indexed: true;
|
|
55
|
+
readonly internalType: "address";
|
|
56
|
+
readonly name: "beacon";
|
|
57
|
+
readonly type: "address";
|
|
58
|
+
}];
|
|
59
|
+
readonly name: "BeaconUpgraded";
|
|
60
|
+
readonly type: "event";
|
|
61
|
+
}, {
|
|
62
|
+
readonly stateMutability: "payable";
|
|
63
|
+
readonly type: "fallback";
|
|
64
|
+
}];
|
|
65
|
+
/**
|
|
66
|
+
* Type-safe ABI for BeaconProxy_json
|
|
67
|
+
*/
|
|
68
|
+
export type BeaconProxy_jsonAbi = typeof BeaconProxy_jsonAbi;
|
|
69
|
+
/**
|
|
70
|
+
* Contract instance type for BeaconProxy_json
|
|
71
|
+
*/
|
|
72
|
+
export type BeaconProxy_jsonContract = any;
|
|
73
|
+
/**
|
|
74
|
+
* BeaconProxy_json Contract Class
|
|
75
|
+
*
|
|
76
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```typescript
|
|
80
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
81
|
+
* import { mainnet } from 'viem/chains';
|
|
82
|
+
* import { BeaconProxy_json } from 'BeaconProxy_json';
|
|
83
|
+
*
|
|
84
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
85
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
86
|
+
*
|
|
87
|
+
* const contract = new BeaconProxy_json('0x...', { publicClient, walletClient });
|
|
88
|
+
*
|
|
89
|
+
* // Read functions
|
|
90
|
+
* const result = await contract.balanceOf('0x...');
|
|
91
|
+
*
|
|
92
|
+
* // Write functions
|
|
93
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
94
|
+
*
|
|
95
|
+
* // Simulate transactions (dry-run)
|
|
96
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
97
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
98
|
+
*
|
|
99
|
+
* // Watch events
|
|
100
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
101
|
+
* console.log('Transfer event:', event);
|
|
102
|
+
* });
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
export declare class BeaconProxy_json {
|
|
106
|
+
private contract;
|
|
107
|
+
private contractAddress;
|
|
108
|
+
private publicClient;
|
|
109
|
+
constructor(address: Address, clients: {
|
|
110
|
+
publicClient: PublicClient;
|
|
111
|
+
walletClient?: WalletClient;
|
|
112
|
+
});
|
|
113
|
+
/**
|
|
114
|
+
* Get the contract address
|
|
115
|
+
*/
|
|
116
|
+
get address(): Address;
|
|
117
|
+
/**
|
|
118
|
+
* Get the underlying viem contract instance
|
|
119
|
+
*/
|
|
120
|
+
getContract(): BeaconProxy_jsonContract;
|
|
121
|
+
/**
|
|
122
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
123
|
+
*
|
|
124
|
+
* Note: This contract has no write functions, so simulate returns an empty object.
|
|
125
|
+
*/
|
|
126
|
+
get simulate(): {};
|
|
127
|
+
/**
|
|
128
|
+
* Watch contract events
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* // Watch all Transfer events
|
|
132
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
133
|
+
* console.log('Transfer:', event);
|
|
134
|
+
* });
|
|
135
|
+
*
|
|
136
|
+
* // Stop watching
|
|
137
|
+
* unwatch();
|
|
138
|
+
*/
|
|
139
|
+
get watch(): {
|
|
140
|
+
/**
|
|
141
|
+
* Watch BeaconUpgraded events
|
|
142
|
+
* @param callback Function to call when event is emitted
|
|
143
|
+
* @param filter Optional filter for indexed parameters
|
|
144
|
+
* @returns Unwatch function to stop listening
|
|
145
|
+
*/
|
|
146
|
+
BeaconUpgraded: (callback: (event: {
|
|
147
|
+
beacon: `0x${string}`;
|
|
148
|
+
}) => void, filter?: {
|
|
149
|
+
beacon: `0x${string}`;
|
|
150
|
+
}) => () => void;
|
|
151
|
+
};
|
|
152
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BeaconProxy_json = exports.BeaconProxy_jsonAbi = void 0;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
/**
|
|
6
|
+
* BeaconProxy_json ABI
|
|
7
|
+
*
|
|
8
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
9
|
+
*/
|
|
10
|
+
exports.BeaconProxy_jsonAbi = [
|
|
11
|
+
{
|
|
12
|
+
"inputs": [
|
|
13
|
+
{
|
|
14
|
+
"internalType": "address",
|
|
15
|
+
"name": "beacon",
|
|
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
|
+
"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": "beacon",
|
|
43
|
+
"type": "address"
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"name": "ERC1967InvalidBeacon",
|
|
47
|
+
"type": "error"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"inputs": [
|
|
51
|
+
{
|
|
52
|
+
"internalType": "address",
|
|
53
|
+
"name": "implementation",
|
|
54
|
+
"type": "address"
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
"name": "ERC1967InvalidImplementation",
|
|
58
|
+
"type": "error"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"inputs": [],
|
|
62
|
+
"name": "ERC1967NonPayable",
|
|
63
|
+
"type": "error"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"inputs": [],
|
|
67
|
+
"name": "FailedCall",
|
|
68
|
+
"type": "error"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"anonymous": false,
|
|
72
|
+
"inputs": [
|
|
73
|
+
{
|
|
74
|
+
"indexed": true,
|
|
75
|
+
"internalType": "address",
|
|
76
|
+
"name": "beacon",
|
|
77
|
+
"type": "address"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"name": "BeaconUpgraded",
|
|
81
|
+
"type": "event"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"stateMutability": "payable",
|
|
85
|
+
"type": "fallback"
|
|
86
|
+
}
|
|
87
|
+
];
|
|
88
|
+
/**
|
|
89
|
+
* BeaconProxy_json Contract Class
|
|
90
|
+
*
|
|
91
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
96
|
+
* import { mainnet } from 'viem/chains';
|
|
97
|
+
* import { BeaconProxy_json } from 'BeaconProxy_json';
|
|
98
|
+
*
|
|
99
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
100
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
101
|
+
*
|
|
102
|
+
* const contract = new BeaconProxy_json('0x...', { publicClient, walletClient });
|
|
103
|
+
*
|
|
104
|
+
* // Read functions
|
|
105
|
+
* const result = await contract.balanceOf('0x...');
|
|
106
|
+
*
|
|
107
|
+
* // Write functions
|
|
108
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
109
|
+
*
|
|
110
|
+
* // Simulate transactions (dry-run)
|
|
111
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
112
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
113
|
+
*
|
|
114
|
+
* // Watch events
|
|
115
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
116
|
+
* console.log('Transfer event:', event);
|
|
117
|
+
* });
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
class BeaconProxy_json {
|
|
121
|
+
constructor(address, clients) {
|
|
122
|
+
this.contractAddress = address;
|
|
123
|
+
this.publicClient = clients.publicClient;
|
|
124
|
+
this.contract = (0, viem_1.getContract)({
|
|
125
|
+
address,
|
|
126
|
+
abi: exports.BeaconProxy_jsonAbi,
|
|
127
|
+
client: {
|
|
128
|
+
public: clients.publicClient,
|
|
129
|
+
wallet: clients.walletClient,
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Get the contract address
|
|
135
|
+
*/
|
|
136
|
+
get address() {
|
|
137
|
+
return this.contractAddress;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Get the underlying viem contract instance
|
|
141
|
+
*/
|
|
142
|
+
getContract() {
|
|
143
|
+
return this.contract;
|
|
144
|
+
}
|
|
145
|
+
// No read functions
|
|
146
|
+
// No write functions
|
|
147
|
+
/**
|
|
148
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
149
|
+
*
|
|
150
|
+
* Note: This contract has no write functions, so simulate returns an empty object.
|
|
151
|
+
*/
|
|
152
|
+
get simulate() {
|
|
153
|
+
return {};
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Watch contract events
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* // Watch all Transfer events
|
|
160
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
161
|
+
* console.log('Transfer:', event);
|
|
162
|
+
* });
|
|
163
|
+
*
|
|
164
|
+
* // Stop watching
|
|
165
|
+
* unwatch();
|
|
166
|
+
*/
|
|
167
|
+
get watch() {
|
|
168
|
+
return {
|
|
169
|
+
/**
|
|
170
|
+
* Watch BeaconUpgraded events
|
|
171
|
+
* @param callback Function to call when event is emitted
|
|
172
|
+
* @param filter Optional filter for indexed parameters
|
|
173
|
+
* @returns Unwatch function to stop listening
|
|
174
|
+
*/
|
|
175
|
+
BeaconUpgraded: (callback, filter) => {
|
|
176
|
+
return this.publicClient.watchContractEvent({
|
|
177
|
+
address: this.contractAddress,
|
|
178
|
+
abi: exports.BeaconProxy_jsonAbi,
|
|
179
|
+
eventName: 'BeaconUpgraded',
|
|
180
|
+
args: filter,
|
|
181
|
+
onLogs: (logs) => {
|
|
182
|
+
logs.forEach((log) => {
|
|
183
|
+
callback(log.args);
|
|
184
|
+
});
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
exports.BeaconProxy_json = BeaconProxy_json;
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import type { Abi, Address, PublicClient, WalletClient, GetContractReturnType } from 'viem';
|
|
2
|
+
import { getContract } from 'viem';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* BeaconProxy_json ABI
|
|
6
|
+
*
|
|
7
|
+
* This ABI is typed using viem's type system for full type safety.
|
|
8
|
+
*/
|
|
9
|
+
export const BeaconProxy_jsonAbi = [
|
|
10
|
+
{
|
|
11
|
+
"inputs": [
|
|
12
|
+
{
|
|
13
|
+
"internalType": "address",
|
|
14
|
+
"name": "beacon",
|
|
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
|
+
"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": "beacon",
|
|
42
|
+
"type": "address"
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"name": "ERC1967InvalidBeacon",
|
|
46
|
+
"type": "error"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"inputs": [
|
|
50
|
+
{
|
|
51
|
+
"internalType": "address",
|
|
52
|
+
"name": "implementation",
|
|
53
|
+
"type": "address"
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
"name": "ERC1967InvalidImplementation",
|
|
57
|
+
"type": "error"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"inputs": [],
|
|
61
|
+
"name": "ERC1967NonPayable",
|
|
62
|
+
"type": "error"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"inputs": [],
|
|
66
|
+
"name": "FailedCall",
|
|
67
|
+
"type": "error"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"anonymous": false,
|
|
71
|
+
"inputs": [
|
|
72
|
+
{
|
|
73
|
+
"indexed": true,
|
|
74
|
+
"internalType": "address",
|
|
75
|
+
"name": "beacon",
|
|
76
|
+
"type": "address"
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
"name": "BeaconUpgraded",
|
|
80
|
+
"type": "event"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"stateMutability": "payable",
|
|
84
|
+
"type": "fallback"
|
|
85
|
+
}
|
|
86
|
+
] as const satisfies Abi;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Type-safe ABI for BeaconProxy_json
|
|
90
|
+
*/
|
|
91
|
+
export type BeaconProxy_jsonAbi = typeof BeaconProxy_jsonAbi;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Contract instance type for BeaconProxy_json
|
|
95
|
+
*/
|
|
96
|
+
// Use any for contract type to avoid complex viem type issues
|
|
97
|
+
// The runtime behavior is type-safe through viem's ABI typing
|
|
98
|
+
export type BeaconProxy_jsonContract = any;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* BeaconProxy_json Contract Class
|
|
102
|
+
*
|
|
103
|
+
* Provides a class-based API similar to TypeChain for interacting with the contract.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```typescript
|
|
107
|
+
* import { createPublicClient, createWalletClient, http } from 'viem';
|
|
108
|
+
* import { mainnet } from 'viem/chains';
|
|
109
|
+
* import { BeaconProxy_json } from 'BeaconProxy_json';
|
|
110
|
+
*
|
|
111
|
+
* const publicClient = createPublicClient({ chain: mainnet, transport: http() });
|
|
112
|
+
* const walletClient = createWalletClient({ chain: mainnet, transport: http() });
|
|
113
|
+
*
|
|
114
|
+
* const contract = new BeaconProxy_json('0x...', { publicClient, walletClient });
|
|
115
|
+
*
|
|
116
|
+
* // Read functions
|
|
117
|
+
* const result = await contract.balanceOf('0x...');
|
|
118
|
+
*
|
|
119
|
+
* // Write functions
|
|
120
|
+
* const hash = await contract.transfer('0x...', 1000n);
|
|
121
|
+
*
|
|
122
|
+
* // Simulate transactions (dry-run)
|
|
123
|
+
* const simulation = await contract.simulate.transfer('0x...', 1000n);
|
|
124
|
+
* console.log('Gas estimate:', simulation.request.gas);
|
|
125
|
+
*
|
|
126
|
+
* // Watch events
|
|
127
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
128
|
+
* console.log('Transfer event:', event);
|
|
129
|
+
* });
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
export class BeaconProxy_json {
|
|
133
|
+
private contract: BeaconProxy_jsonContract;
|
|
134
|
+
private contractAddress: Address;
|
|
135
|
+
private publicClient: PublicClient;
|
|
136
|
+
|
|
137
|
+
constructor(
|
|
138
|
+
address: Address,
|
|
139
|
+
clients: {
|
|
140
|
+
publicClient: PublicClient;
|
|
141
|
+
walletClient?: WalletClient;
|
|
142
|
+
}
|
|
143
|
+
) {
|
|
144
|
+
this.contractAddress = address;
|
|
145
|
+
this.publicClient = clients.publicClient;
|
|
146
|
+
this.contract = getContract({
|
|
147
|
+
address,
|
|
148
|
+
abi: BeaconProxy_jsonAbi,
|
|
149
|
+
client: {
|
|
150
|
+
public: clients.publicClient,
|
|
151
|
+
wallet: clients.walletClient,
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Get the contract address
|
|
158
|
+
*/
|
|
159
|
+
get address(): Address {
|
|
160
|
+
return this.contractAddress;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Get the underlying viem contract instance
|
|
165
|
+
*/
|
|
166
|
+
getContract(): BeaconProxy_jsonContract {
|
|
167
|
+
return this.contract;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// No read functions
|
|
171
|
+
|
|
172
|
+
// No write functions
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Simulate contract write operations (dry-run without sending transaction)
|
|
178
|
+
*
|
|
179
|
+
* Note: This contract has no write functions, so simulate returns an empty object.
|
|
180
|
+
*/
|
|
181
|
+
get simulate() {
|
|
182
|
+
return {};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Watch contract events
|
|
187
|
+
*
|
|
188
|
+
* @example
|
|
189
|
+
* // Watch all Transfer events
|
|
190
|
+
* const unwatch = contract.watch.Transfer((event) => {
|
|
191
|
+
* console.log('Transfer:', event);
|
|
192
|
+
* });
|
|
193
|
+
*
|
|
194
|
+
* // Stop watching
|
|
195
|
+
* unwatch();
|
|
196
|
+
*/
|
|
197
|
+
get watch() {
|
|
198
|
+
return {
|
|
199
|
+
/**
|
|
200
|
+
* Watch BeaconUpgraded 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
|
+
BeaconUpgraded: (callback: (event: { beacon: `0x${string}` }) => void, filter?: { beacon: `0x${string}` }) => {
|
|
206
|
+
return this.publicClient.watchContractEvent({
|
|
207
|
+
address: this.contractAddress,
|
|
208
|
+
abi: BeaconProxy_jsonAbi,
|
|
209
|
+
eventName: 'BeaconUpgraded',
|
|
210
|
+
args: filter,
|
|
211
|
+
onLogs: (logs: any[]) => {
|
|
212
|
+
logs.forEach((log: any) => {
|
|
213
|
+
callback(log.args as any);
|
|
214
|
+
});
|
|
215
|
+
},
|
|
216
|
+
}) as () => void;
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
}
|
package/contracts/index.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
export { BeaconProxy_jsonAbi, BeaconProxy_json } from './BeaconProxy_json';
|
|
2
|
+
export type { BeaconProxy_jsonAbi as BeaconProxy_jsonAbiType, BeaconProxy_jsonContract } from './BeaconProxy_json';
|
|
1
3
|
export { TopUp_jsonAbi, TopUp_json } from './TopUp_json';
|
|
2
4
|
export type { TopUp_jsonAbi as TopUp_jsonAbiType, TopUp_jsonContract } from './TopUp_json';
|
package/contracts/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TopUp_json = exports.TopUp_jsonAbi = void 0;
|
|
3
|
+
exports.TopUp_json = exports.TopUp_jsonAbi = exports.BeaconProxy_json = exports.BeaconProxy_jsonAbi = void 0;
|
|
4
4
|
// Auto-generated exports for all contracts
|
|
5
|
+
var BeaconProxy_json_1 = require("./BeaconProxy_json");
|
|
6
|
+
Object.defineProperty(exports, "BeaconProxy_jsonAbi", { enumerable: true, get: function () { return BeaconProxy_json_1.BeaconProxy_jsonAbi; } });
|
|
7
|
+
Object.defineProperty(exports, "BeaconProxy_json", { enumerable: true, get: function () { return BeaconProxy_json_1.BeaconProxy_json; } });
|
|
5
8
|
var TopUp_json_1 = require("./TopUp_json");
|
|
6
9
|
Object.defineProperty(exports, "TopUp_jsonAbi", { enumerable: true, get: function () { return TopUp_json_1.TopUp_jsonAbi; } });
|
|
7
10
|
Object.defineProperty(exports, "TopUp_json", { enumerable: true, get: function () { return TopUp_json_1.TopUp_json; } });
|
package/contracts/index.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
// Auto-generated exports for all contracts
|
|
2
|
+
export { BeaconProxy_jsonAbi, BeaconProxy_json } from './BeaconProxy_json';
|
|
3
|
+
export type { BeaconProxy_jsonAbi as BeaconProxy_jsonAbiType, BeaconProxy_jsonContract } from './BeaconProxy_json';
|
|
2
4
|
export { TopUp_jsonAbi, TopUp_json } from './TopUp_json';
|
|
3
5
|
export type { TopUp_jsonAbi as TopUp_jsonAbiType, TopUp_jsonContract } from './TopUp_json';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitmyabi/topup",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Auto-generated TypeScript type bindings for TopUp (build etherscan-topup-
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Auto-generated TypeScript type bindings for TopUp (build etherscan-topup-1535435c-1785591931731, commit a450a33, branch etherscan)",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"url": "https://github.com/etherscan/topup"
|
|
40
40
|
},
|
|
41
41
|
"branch": "etherscan",
|
|
42
|
-
"shortHash": "
|
|
42
|
+
"shortHash": "a450a33"
|
|
43
43
|
}
|