@gitmyabi/teikhosbounty 1.0.4 → 1.0.5

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.
@@ -1,362 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TeikhosBounty_json = exports.TeikhosBounty_jsonAbi = void 0;
4
- const viem_1 = require("viem");
5
- /**
6
- * TeikhosBounty_json ABI
7
- *
8
- * This ABI is typed using viem's type system for full type safety.
9
- */
10
- exports.TeikhosBounty_jsonAbi = [
11
- {
12
- "constant": false,
13
- "inputs": [],
14
- "name": "reward",
15
- "outputs": [],
16
- "payable": false,
17
- "stateMutability": "nonpayable",
18
- "type": "function"
19
- },
20
- {
21
- "constant": true,
22
- "inputs": [],
23
- "name": "isSolved",
24
- "outputs": [
25
- {
26
- "name": "timestamp",
27
- "type": "uint256"
28
- },
29
- {
30
- "name": "publicKey",
31
- "type": "bytes"
32
- },
33
- {
34
- "name": "msgHash",
35
- "type": "bytes32"
36
- }
37
- ],
38
- "payable": false,
39
- "stateMutability": "view",
40
- "type": "function"
41
- },
42
- {
43
- "constant": false,
44
- "inputs": [
45
- {
46
- "name": "_signature",
47
- "type": "bytes"
48
- }
49
- ],
50
- "name": "commit",
51
- "outputs": [],
52
- "payable": false,
53
- "stateMutability": "nonpayable",
54
- "type": "function"
55
- },
56
- {
57
- "constant": true,
58
- "inputs": [],
59
- "name": "sha3_512",
60
- "outputs": [
61
- {
62
- "name": "",
63
- "type": "address"
64
- }
65
- ],
66
- "payable": false,
67
- "stateMutability": "view",
68
- "type": "function"
69
- },
70
- {
71
- "constant": false,
72
- "inputs": [],
73
- "name": "reveal",
74
- "outputs": [
75
- {
76
- "name": "success",
77
- "type": "bool"
78
- }
79
- ],
80
- "payable": false,
81
- "stateMutability": "nonpayable",
82
- "type": "function"
83
- },
84
- {
85
- "constant": true,
86
- "inputs": [],
87
- "name": "proof_of_public_key",
88
- "outputs": [
89
- {
90
- "name": "half1",
91
- "type": "bytes32"
92
- },
93
- {
94
- "name": "half2",
95
- "type": "bytes32"
96
- }
97
- ],
98
- "payable": false,
99
- "stateMutability": "view",
100
- "type": "function"
101
- },
102
- {
103
- "constant": true,
104
- "inputs": [
105
- {
106
- "name": "",
107
- "type": "address"
108
- }
109
- ],
110
- "name": "commitment",
111
- "outputs": [
112
- {
113
- "name": "timestamp",
114
- "type": "uint256"
115
- },
116
- {
117
- "name": "signature",
118
- "type": "bytes"
119
- }
120
- ],
121
- "payable": false,
122
- "stateMutability": "view",
123
- "type": "function"
124
- },
125
- {
126
- "constant": true,
127
- "inputs": [],
128
- "name": "winner",
129
- "outputs": [
130
- {
131
- "name": "timestamp",
132
- "type": "uint256"
133
- },
134
- {
135
- "name": "winner",
136
- "type": "address"
137
- }
138
- ],
139
- "payable": false,
140
- "stateMutability": "view",
141
- "type": "function"
142
- },
143
- {
144
- "constant": false,
145
- "inputs": [
146
- {
147
- "name": "_publicKey",
148
- "type": "bytes"
149
- }
150
- ],
151
- "name": "authenticate",
152
- "outputs": [],
153
- "payable": false,
154
- "stateMutability": "nonpayable",
155
- "type": "function"
156
- },
157
- {
158
- "inputs": [],
159
- "payable": false,
160
- "stateMutability": "nonpayable",
161
- "type": "constructor"
162
- },
163
- {
164
- "payable": true,
165
- "stateMutability": "payable",
166
- "type": "fallback"
167
- }
168
- ];
169
- /**
170
- * TeikhosBounty_json Contract Class
171
- *
172
- * Provides a class-based API similar to TypeChain for interacting with the contract.
173
- *
174
- * @example
175
- * ```typescript
176
- * import { createPublicClient, createWalletClient, http } from 'viem';
177
- * import { mainnet } from 'viem/chains';
178
- * import { TeikhosBounty_json } from 'TeikhosBounty_json';
179
- *
180
- * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
181
- * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
182
- *
183
- * const contract = new TeikhosBounty_json('0x...', { publicClient, walletClient });
184
- *
185
- * // Read functions
186
- * const result = await contract.balanceOf('0x...');
187
- *
188
- * // Write functions
189
- * const hash = await contract.transfer('0x...', 1000n);
190
- *
191
- * // Simulate transactions (dry-run)
192
- * const simulation = await contract.simulate.transfer('0x...', 1000n);
193
- * console.log('Gas estimate:', simulation.request.gas);
194
- *
195
- * // Watch events
196
- * const unwatch = contract.watch.Transfer((event) => {
197
- * console.log('Transfer event:', event);
198
- * });
199
- * ```
200
- */
201
- class TeikhosBounty_json {
202
- constructor(address, clients) {
203
- this.contractAddress = address;
204
- this.publicClient = clients.publicClient;
205
- this.contract = (0, viem_1.getContract)({
206
- address,
207
- abi: exports.TeikhosBounty_jsonAbi,
208
- client: {
209
- public: clients.publicClient,
210
- wallet: clients.walletClient,
211
- },
212
- });
213
- }
214
- /**
215
- * Get the contract address
216
- */
217
- get address() {
218
- return this.contractAddress;
219
- }
220
- /**
221
- * Get the underlying viem contract instance
222
- */
223
- getContract() {
224
- return this.contract;
225
- }
226
- /**
227
- * isSolved
228
- * view
229
- */
230
- async isSolved() {
231
- return this.contract.read.isSolved();
232
- }
233
- /**
234
- * sha3_512
235
- * view
236
- */
237
- async sha3_512() {
238
- return this.contract.read.sha3_512();
239
- }
240
- /**
241
- * proof_of_public_key
242
- * view
243
- */
244
- async proof_of_public_key() {
245
- return this.contract.read.proof_of_public_key();
246
- }
247
- /**
248
- * commitment
249
- * view
250
- */
251
- async commitment(arg0) {
252
- return this.contract.read.commitment([arg0]);
253
- }
254
- /**
255
- * winner
256
- * view
257
- */
258
- async winner() {
259
- return this.contract.read.winner();
260
- }
261
- /**
262
- * reward
263
- * nonpayable
264
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
265
- */
266
- async reward(options) {
267
- if (!this.contract.write) {
268
- throw new Error('Wallet client is required for write operations');
269
- }
270
- return this.contract.write.reward(options);
271
- }
272
- /**
273
- * commit
274
- * nonpayable
275
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
276
- */
277
- async commit(_signature, options) {
278
- if (!this.contract.write) {
279
- throw new Error('Wallet client is required for write operations');
280
- }
281
- return this.contract.write.commit([_signature], options);
282
- }
283
- /**
284
- * reveal
285
- * nonpayable
286
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
287
- */
288
- async reveal(options) {
289
- if (!this.contract.write) {
290
- throw new Error('Wallet client is required for write operations');
291
- }
292
- return this.contract.write.reveal(options);
293
- }
294
- /**
295
- * authenticate
296
- * nonpayable
297
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
298
- */
299
- async authenticate(_publicKey, options) {
300
- if (!this.contract.write) {
301
- throw new Error('Wallet client is required for write operations');
302
- }
303
- return this.contract.write.authenticate([_publicKey], options);
304
- }
305
- /**
306
- * Simulate contract write operations (dry-run without sending transaction)
307
- *
308
- * @example
309
- * const result = await contract.simulate.transfer('0x...', 1000n);
310
- * console.log('Gas estimate:', result.request.gas);
311
- * console.log('Would succeed:', result.result);
312
- */
313
- get simulate() {
314
- const contract = this.contract;
315
- if (!contract.simulate) {
316
- throw new Error('Public client is required for simulation');
317
- }
318
- return {
319
- /**
320
- * Simulate reward
321
- * Returns gas estimate and result without sending transaction
322
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
323
- */
324
- async reward(options) {
325
- return contract.simulate.reward(options);
326
- },
327
- /**
328
- * Simulate commit
329
- * Returns gas estimate and result without sending transaction
330
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
331
- */
332
- async commit(_signature, options) {
333
- return contract.simulate.commit([_signature], options);
334
- },
335
- /**
336
- * Simulate reveal
337
- * Returns gas estimate and result without sending transaction
338
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
339
- */
340
- async reveal(options) {
341
- return contract.simulate.reveal(options);
342
- },
343
- /**
344
- * Simulate authenticate
345
- * Returns gas estimate and result without sending transaction
346
- * @param options Optional transaction parameters (value, gas, nonce, etc.)
347
- */
348
- async authenticate(_publicKey, options) {
349
- return contract.simulate.authenticate([_publicKey], options);
350
- }
351
- };
352
- }
353
- /**
354
- * Watch contract events
355
- *
356
- * Note: This contract has no events, so watch returns an empty object.
357
- */
358
- get watch() {
359
- return {};
360
- }
361
- }
362
- exports.TeikhosBounty_json = TeikhosBounty_json;