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