@gitmyabi/lockedgoldoracle 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 ADDED
@@ -0,0 +1,108 @@
1
+ # @gitmyabi/lockedgoldoracle
2
+
3
+ Auto-generated TypeScript type bindings for **LockedGoldOracle**
4
+
5
+ - **Build ID**: `etherscan-lockedgoldoracle-5b7820e6-1789238735618`
6
+ - **Build Number**: 1
7
+ - **Commit**: `8566426`
8
+ - **Branch**: `etherscan`
9
+ - **Target**: `ethers-v6`
10
+ - **Contracts**: 1
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install @gitmyabi/lockedgoldoracle@1.0.0
16
+ ```
17
+
18
+ ## Usage
19
+
20
+ ### Class-based API (TypeChain-like)
21
+
22
+ ```typescript
23
+ import { createPublicClient, createWalletClient, http } from 'viem';
24
+ import { mainnet } from 'viem/chains';
25
+ import { YourContract } from '@gitmyabi/lockedgoldoracle';
26
+
27
+ const publicClient = createPublicClient({ chain: mainnet, transport: http() });
28
+ const walletClient = createWalletClient({ chain: mainnet, transport: http() });
29
+
30
+ // Create contract instance
31
+ const contract = new YourContract('0x...', { publicClient, walletClient });
32
+
33
+ // Read functions - call directly like TypeChain!
34
+ const result = await contract.yourMethod(param1, param2);
35
+
36
+ // Write functions - also call directly!
37
+ const hash = await contract.transfer('0x...', 1000n);
38
+ ```
39
+
40
+ ### With viem directly
41
+
42
+ ```typescript
43
+ import { createPublicClient, http } from 'viem';
44
+ import { mainnet } from 'viem/chains';
45
+ import { YourContractAbi } from '@gitmyabi/lockedgoldoracle';
46
+
47
+ const client = createPublicClient({
48
+ chain: mainnet,
49
+ transport: http(),
50
+ });
51
+
52
+ // Fully typed contract read
53
+ const result = await client.readContract({
54
+ address: '0x...',
55
+ abi: YourContractAbi,
56
+ functionName: 'yourMethod',
57
+ args: [param1, param2],
58
+ });
59
+
60
+ // Fully typed contract write
61
+ const hash = await client.writeContract({
62
+ address: '0x...',
63
+ abi: YourContractAbi,
64
+ functionName: 'yourMethod',
65
+ args: [param1, param2],
66
+ });
67
+ ```
68
+
69
+ ### With wagmi
70
+
71
+ ```typescript
72
+ import { useReadContract, useWriteContract } from 'wagmi';
73
+ import { YourContractAbi } from '@gitmyabi/lockedgoldoracle';
74
+
75
+ function MyComponent() {
76
+ const { data } = useReadContract({
77
+ address: '0x...',
78
+ abi: YourContractAbi,
79
+ functionName: 'yourMethod',
80
+ args: [param1, param2],
81
+ });
82
+
83
+ const { writeContract } = useWriteContract();
84
+
85
+ const handleWrite = () => {
86
+ writeContract({
87
+ address: '0x...',
88
+ abi: YourContractAbi,
89
+ functionName: 'yourMethod',
90
+ args: [param1, param2],
91
+ });
92
+ };
93
+
94
+ return <button onClick={handleWrite}>Call Contract</button>;
95
+ }
96
+ ```
97
+
98
+ ## Type Safety
99
+
100
+ This package provides full TypeScript type safety for all contract methods, events, and parameters using viem's type system. All ABIs are exported as `const` assertions for maximum type inference.
101
+
102
+ ## Generated Contracts
103
+
104
+ This package includes type bindings for 1 contract(s) generated from ABI artifacts.
105
+
106
+ ## License
107
+
108
+ MIT
@@ -0,0 +1,448 @@
1
+ import type { Address, PublicClient, WalletClient } from 'viem';
2
+ /**
3
+ * LockedGoldOracle_json ABI
4
+ *
5
+ * This ABI is typed using viem's type system for full type safety.
6
+ */
7
+ export declare const LockedGoldOracle_jsonAbi: readonly [{
8
+ readonly anonymous: false;
9
+ readonly inputs: readonly [{
10
+ readonly indexed: false;
11
+ readonly internalType: "uint256";
12
+ readonly name: "amount";
13
+ readonly type: "uint256";
14
+ }];
15
+ readonly name: "LockEvent";
16
+ readonly type: "event";
17
+ }, {
18
+ readonly anonymous: false;
19
+ readonly inputs: readonly [{
20
+ readonly indexed: true;
21
+ readonly internalType: "address";
22
+ readonly name: "previousOwner";
23
+ readonly type: "address";
24
+ }, {
25
+ readonly indexed: true;
26
+ readonly internalType: "address";
27
+ readonly name: "newOwner";
28
+ readonly type: "address";
29
+ }];
30
+ readonly name: "OwnershipTransferred";
31
+ readonly type: "event";
32
+ }, {
33
+ readonly anonymous: false;
34
+ readonly inputs: readonly [{
35
+ readonly indexed: false;
36
+ readonly internalType: "uint256";
37
+ readonly name: "amount";
38
+ readonly type: "uint256";
39
+ }];
40
+ readonly name: "UnlockEvent";
41
+ readonly type: "event";
42
+ }, {
43
+ readonly constant: true;
44
+ readonly inputs: readonly [];
45
+ readonly name: "cacheContract";
46
+ readonly outputs: readonly [{
47
+ readonly internalType: "address";
48
+ readonly name: "";
49
+ readonly type: "address";
50
+ }];
51
+ readonly payable: false;
52
+ readonly stateMutability: "view";
53
+ readonly type: "function";
54
+ }, {
55
+ readonly constant: true;
56
+ readonly inputs: readonly [];
57
+ readonly name: "isOwner";
58
+ readonly outputs: readonly [{
59
+ readonly internalType: "bool";
60
+ readonly name: "";
61
+ readonly type: "bool";
62
+ }];
63
+ readonly payable: false;
64
+ readonly stateMutability: "view";
65
+ readonly type: "function";
66
+ }, {
67
+ readonly constant: false;
68
+ readonly inputs: readonly [{
69
+ readonly internalType: "uint256";
70
+ readonly name: "amountGrams";
71
+ readonly type: "uint256";
72
+ }];
73
+ readonly name: "lockAmount";
74
+ readonly outputs: readonly [];
75
+ readonly payable: false;
76
+ readonly stateMutability: "nonpayable";
77
+ readonly type: "function";
78
+ }, {
79
+ readonly constant: true;
80
+ readonly inputs: readonly [];
81
+ readonly name: "lockedGold";
82
+ readonly outputs: readonly [{
83
+ readonly internalType: "uint256";
84
+ readonly name: "";
85
+ readonly type: "uint256";
86
+ }];
87
+ readonly payable: false;
88
+ readonly stateMutability: "view";
89
+ readonly type: "function";
90
+ }, {
91
+ readonly constant: true;
92
+ readonly inputs: readonly [];
93
+ readonly name: "owner";
94
+ readonly outputs: readonly [{
95
+ readonly internalType: "address";
96
+ readonly name: "";
97
+ readonly type: "address";
98
+ }];
99
+ readonly payable: false;
100
+ readonly stateMutability: "view";
101
+ readonly type: "function";
102
+ }, {
103
+ readonly constant: false;
104
+ readonly inputs: readonly [];
105
+ readonly name: "renounceOwnership";
106
+ readonly outputs: readonly [];
107
+ readonly payable: false;
108
+ readonly stateMutability: "nonpayable";
109
+ readonly type: "function";
110
+ }, {
111
+ readonly constant: false;
112
+ readonly inputs: readonly [{
113
+ readonly internalType: "address";
114
+ readonly name: "cacheContract";
115
+ readonly type: "address";
116
+ }];
117
+ readonly name: "setCacheContract";
118
+ readonly outputs: readonly [];
119
+ readonly payable: false;
120
+ readonly stateMutability: "nonpayable";
121
+ readonly type: "function";
122
+ }, {
123
+ readonly constant: false;
124
+ readonly inputs: readonly [{
125
+ readonly internalType: "address";
126
+ readonly name: "newOwner";
127
+ readonly type: "address";
128
+ }];
129
+ readonly name: "transferOwnership";
130
+ readonly outputs: readonly [];
131
+ readonly payable: false;
132
+ readonly stateMutability: "nonpayable";
133
+ readonly type: "function";
134
+ }, {
135
+ readonly constant: false;
136
+ readonly inputs: readonly [{
137
+ readonly internalType: "uint256";
138
+ readonly name: "amountGrams";
139
+ readonly type: "uint256";
140
+ }];
141
+ readonly name: "unlockAmount";
142
+ readonly outputs: readonly [];
143
+ readonly payable: false;
144
+ readonly stateMutability: "nonpayable";
145
+ readonly type: "function";
146
+ }];
147
+ /**
148
+ * Type-safe ABI for LockedGoldOracle_json
149
+ */
150
+ export type LockedGoldOracle_jsonAbi = typeof LockedGoldOracle_jsonAbi;
151
+ /**
152
+ * Contract instance type for LockedGoldOracle_json
153
+ */
154
+ export type LockedGoldOracle_jsonContract = any;
155
+ /**
156
+ * LockedGoldOracle_json Contract Class
157
+ *
158
+ * Provides a class-based API similar to TypeChain for interacting with the contract.
159
+ *
160
+ * @example
161
+ * ```typescript
162
+ * import { createPublicClient, createWalletClient, http } from 'viem';
163
+ * import { mainnet } from 'viem/chains';
164
+ * import { LockedGoldOracle_json } from 'LockedGoldOracle_json';
165
+ *
166
+ * const publicClient = createPublicClient({ chain: mainnet, transport: http() });
167
+ * const walletClient = createWalletClient({ chain: mainnet, transport: http() });
168
+ *
169
+ * const contract = new LockedGoldOracle_json('0x...', { publicClient, walletClient });
170
+ *
171
+ * // Read functions
172
+ * const result = await contract.balanceOf('0x...');
173
+ *
174
+ * // Write functions
175
+ * const hash = await contract.transfer('0x...', 1000n);
176
+ *
177
+ * // Simulate transactions (dry-run)
178
+ * const simulation = await contract.simulate.transfer('0x...', 1000n);
179
+ * console.log('Gas estimate:', simulation.request.gas);
180
+ *
181
+ * // Watch events
182
+ * const unwatch = contract.watch.Transfer((event) => {
183
+ * console.log('Transfer event:', event);
184
+ * });
185
+ * ```
186
+ */
187
+ export declare class LockedGoldOracle_json {
188
+ private contract;
189
+ private contractAddress;
190
+ private publicClient;
191
+ constructor(address: Address, clients: {
192
+ publicClient: PublicClient;
193
+ walletClient?: WalletClient;
194
+ });
195
+ /**
196
+ * Get the contract address
197
+ */
198
+ get address(): Address;
199
+ /**
200
+ * Get the underlying viem contract instance
201
+ */
202
+ getContract(): LockedGoldOracle_jsonContract;
203
+ /**
204
+ * cacheContract
205
+ * view
206
+ */
207
+ cacheContract(): Promise<`0x${string}`>;
208
+ /**
209
+ * isOwner
210
+ * view
211
+ */
212
+ isOwner(): Promise<boolean>;
213
+ /**
214
+ * lockedGold
215
+ * view
216
+ */
217
+ lockedGold(): Promise<bigint>;
218
+ /**
219
+ * owner
220
+ * view
221
+ */
222
+ owner(): Promise<`0x${string}`>;
223
+ /**
224
+ * lockAmount
225
+ * nonpayable
226
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
227
+ */
228
+ lockAmount(amountGrams: bigint, options?: {
229
+ accessList?: import('viem').AccessList;
230
+ authorizationList?: import('viem').AuthorizationList;
231
+ chain?: import('viem').Chain | null;
232
+ dataSuffix?: `0x${string}`;
233
+ gas?: bigint;
234
+ gasPrice?: bigint;
235
+ maxFeePerGas?: bigint;
236
+ maxPriorityFeePerGas?: bigint;
237
+ nonce?: number;
238
+ value?: bigint;
239
+ }): Promise<`0x${string}`>;
240
+ /**
241
+ * renounceOwnership
242
+ * nonpayable
243
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
244
+ */
245
+ renounceOwnership(options?: {
246
+ accessList?: import('viem').AccessList;
247
+ authorizationList?: import('viem').AuthorizationList;
248
+ chain?: import('viem').Chain | null;
249
+ dataSuffix?: `0x${string}`;
250
+ gas?: bigint;
251
+ gasPrice?: bigint;
252
+ maxFeePerGas?: bigint;
253
+ maxPriorityFeePerGas?: bigint;
254
+ nonce?: number;
255
+ value?: bigint;
256
+ }): Promise<`0x${string}`>;
257
+ /**
258
+ * setCacheContract
259
+ * nonpayable
260
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
261
+ */
262
+ setCacheContract(cacheContract: `0x${string}`, options?: {
263
+ accessList?: import('viem').AccessList;
264
+ authorizationList?: import('viem').AuthorizationList;
265
+ chain?: import('viem').Chain | null;
266
+ dataSuffix?: `0x${string}`;
267
+ gas?: bigint;
268
+ gasPrice?: bigint;
269
+ maxFeePerGas?: bigint;
270
+ maxPriorityFeePerGas?: bigint;
271
+ nonce?: number;
272
+ value?: bigint;
273
+ }): Promise<`0x${string}`>;
274
+ /**
275
+ * transferOwnership
276
+ * nonpayable
277
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
278
+ */
279
+ transferOwnership(newOwner: `0x${string}`, options?: {
280
+ accessList?: import('viem').AccessList;
281
+ authorizationList?: import('viem').AuthorizationList;
282
+ chain?: import('viem').Chain | null;
283
+ dataSuffix?: `0x${string}`;
284
+ gas?: bigint;
285
+ gasPrice?: bigint;
286
+ maxFeePerGas?: bigint;
287
+ maxPriorityFeePerGas?: bigint;
288
+ nonce?: number;
289
+ value?: bigint;
290
+ }): Promise<`0x${string}`>;
291
+ /**
292
+ * unlockAmount
293
+ * nonpayable
294
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
295
+ */
296
+ unlockAmount(amountGrams: bigint, options?: {
297
+ accessList?: import('viem').AccessList;
298
+ authorizationList?: import('viem').AuthorizationList;
299
+ chain?: import('viem').Chain | null;
300
+ dataSuffix?: `0x${string}`;
301
+ gas?: bigint;
302
+ gasPrice?: bigint;
303
+ maxFeePerGas?: bigint;
304
+ maxPriorityFeePerGas?: bigint;
305
+ nonce?: number;
306
+ value?: bigint;
307
+ }): Promise<`0x${string}`>;
308
+ /**
309
+ * Simulate contract write operations (dry-run without sending transaction)
310
+ *
311
+ * @example
312
+ * const result = await contract.simulate.transfer('0x...', 1000n);
313
+ * console.log('Gas estimate:', result.request.gas);
314
+ * console.log('Would succeed:', result.result);
315
+ */
316
+ get simulate(): {
317
+ /**
318
+ * Simulate lockAmount
319
+ * Returns gas estimate and result without sending transaction
320
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
321
+ */
322
+ lockAmount(amountGrams: bigint, options?: {
323
+ accessList?: import("viem").AccessList;
324
+ authorizationList?: import("viem").AuthorizationList;
325
+ chain?: import("viem").Chain | null;
326
+ dataSuffix?: `0x${string}`;
327
+ gas?: bigint;
328
+ gasPrice?: bigint;
329
+ maxFeePerGas?: bigint;
330
+ maxPriorityFeePerGas?: bigint;
331
+ nonce?: number;
332
+ value?: bigint;
333
+ }): Promise<void>;
334
+ /**
335
+ * Simulate renounceOwnership
336
+ * Returns gas estimate and result without sending transaction
337
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
338
+ */
339
+ renounceOwnership(options?: {
340
+ accessList?: import("viem").AccessList;
341
+ authorizationList?: import("viem").AuthorizationList;
342
+ chain?: import("viem").Chain | null;
343
+ dataSuffix?: `0x${string}`;
344
+ gas?: bigint;
345
+ gasPrice?: bigint;
346
+ maxFeePerGas?: bigint;
347
+ maxPriorityFeePerGas?: bigint;
348
+ nonce?: number;
349
+ value?: bigint;
350
+ }): Promise<void>;
351
+ /**
352
+ * Simulate setCacheContract
353
+ * Returns gas estimate and result without sending transaction
354
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
355
+ */
356
+ setCacheContract(cacheContract: `0x${string}`, options?: {
357
+ accessList?: import("viem").AccessList;
358
+ authorizationList?: import("viem").AuthorizationList;
359
+ chain?: import("viem").Chain | null;
360
+ dataSuffix?: `0x${string}`;
361
+ gas?: bigint;
362
+ gasPrice?: bigint;
363
+ maxFeePerGas?: bigint;
364
+ maxPriorityFeePerGas?: bigint;
365
+ nonce?: number;
366
+ value?: bigint;
367
+ }): Promise<void>;
368
+ /**
369
+ * Simulate transferOwnership
370
+ * Returns gas estimate and result without sending transaction
371
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
372
+ */
373
+ transferOwnership(newOwner: `0x${string}`, options?: {
374
+ accessList?: import("viem").AccessList;
375
+ authorizationList?: import("viem").AuthorizationList;
376
+ chain?: import("viem").Chain | null;
377
+ dataSuffix?: `0x${string}`;
378
+ gas?: bigint;
379
+ gasPrice?: bigint;
380
+ maxFeePerGas?: bigint;
381
+ maxPriorityFeePerGas?: bigint;
382
+ nonce?: number;
383
+ value?: bigint;
384
+ }): Promise<void>;
385
+ /**
386
+ * Simulate unlockAmount
387
+ * Returns gas estimate and result without sending transaction
388
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
389
+ */
390
+ unlockAmount(amountGrams: bigint, options?: {
391
+ accessList?: import("viem").AccessList;
392
+ authorizationList?: import("viem").AuthorizationList;
393
+ chain?: import("viem").Chain | null;
394
+ dataSuffix?: `0x${string}`;
395
+ gas?: bigint;
396
+ gasPrice?: bigint;
397
+ maxFeePerGas?: bigint;
398
+ maxPriorityFeePerGas?: bigint;
399
+ nonce?: number;
400
+ value?: bigint;
401
+ }): Promise<void>;
402
+ };
403
+ /**
404
+ * Watch contract events
405
+ *
406
+ * @example
407
+ * // Watch all Transfer events
408
+ * const unwatch = contract.watch.Transfer((event) => {
409
+ * console.log('Transfer:', event);
410
+ * });
411
+ *
412
+ * // Stop watching
413
+ * unwatch();
414
+ */
415
+ get watch(): {
416
+ /**
417
+ * Watch LockEvent events
418
+ * @param callback Function to call when event is emitted
419
+ * @param filter Optional filter for indexed parameters
420
+ * @returns Unwatch function to stop listening
421
+ */
422
+ LockEvent: (callback: (event: {
423
+ amount: bigint;
424
+ }) => void) => () => void;
425
+ /**
426
+ * Watch OwnershipTransferred events
427
+ * @param callback Function to call when event is emitted
428
+ * @param filter Optional filter for indexed parameters
429
+ * @returns Unwatch function to stop listening
430
+ */
431
+ OwnershipTransferred: (callback: (event: {
432
+ previousOwner: `0x${string}`;
433
+ newOwner: `0x${string}`;
434
+ }) => void, filter?: {
435
+ previousOwner: `0x${string}`;
436
+ newOwner: `0x${string}`;
437
+ }) => () => void;
438
+ /**
439
+ * Watch UnlockEvent events
440
+ * @param callback Function to call when event is emitted
441
+ * @param filter Optional filter for indexed parameters
442
+ * @returns Unwatch function to stop listening
443
+ */
444
+ UnlockEvent: (callback: (event: {
445
+ amount: bigint;
446
+ }) => void) => () => void;
447
+ };
448
+ }