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