@gitmyabi/storage 1.0.2 → 1.0.4

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 CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Auto-generated TypeScript type bindings for **Storage**
4
4
 
5
- - **Build ID**: `etherscan-storage-d49edad6-1787334000666`
5
+ - **Build ID**: `etherscan-storage-f3345338-1793237320805`
6
6
  - **Build Number**: 1
7
- - **Commit**: `85d568f`
7
+ - **Commit**: `b11b953`
8
8
  - **Branch**: `etherscan`
9
9
  - **Target**: `ethers-v6`
10
10
  - **Contracts**: 1
@@ -12,7 +12,7 @@ Auto-generated TypeScript type bindings for **Storage**
12
12
  ## Installation
13
13
 
14
14
  ```bash
15
- npm install @gitmyabi/storage@1.0.2
15
+ npm install @gitmyabi/storage@1.0.4
16
16
  ```
17
17
 
18
18
  ## Usage
@@ -6,7 +6,58 @@ import type { Address, PublicClient, WalletClient } from 'viem';
6
6
  */
7
7
  export declare const Storage_jsonAbi: readonly [{
8
8
  readonly inputs: readonly [];
9
- readonly name: "retrieve";
9
+ readonly name: "InvalidOwner";
10
+ readonly type: "error";
11
+ }, {
12
+ readonly inputs: readonly [];
13
+ readonly name: "InvalidSessionId";
14
+ readonly type: "error";
15
+ }, {
16
+ readonly inputs: readonly [{
17
+ readonly internalType: "address";
18
+ readonly name: "validator";
19
+ readonly type: "address";
20
+ }];
21
+ readonly name: "InvalidValidator";
22
+ readonly type: "error";
23
+ }, {
24
+ readonly anonymous: false;
25
+ readonly inputs: readonly [{
26
+ readonly indexed: false;
27
+ readonly internalType: "uint256";
28
+ readonly name: "utilisedNonce";
29
+ readonly type: "uint256";
30
+ }];
31
+ readonly name: "NonceConsumed";
32
+ readonly type: "event";
33
+ }, {
34
+ readonly anonymous: false;
35
+ readonly inputs: readonly [{
36
+ readonly indexed: false;
37
+ readonly internalType: "uint256";
38
+ readonly name: "id";
39
+ readonly type: "uint256";
40
+ }];
41
+ readonly name: "SessionRevoked";
42
+ readonly type: "event";
43
+ }, {
44
+ readonly anonymous: false;
45
+ readonly inputs: readonly [{
46
+ readonly indexed: false;
47
+ readonly internalType: "address";
48
+ readonly name: "validator";
49
+ readonly type: "address";
50
+ }, {
51
+ readonly indexed: false;
52
+ readonly internalType: "bool";
53
+ readonly name: "status";
54
+ readonly type: "bool";
55
+ }];
56
+ readonly name: "ValidatorStatusUpdated";
57
+ readonly type: "event";
58
+ }, {
59
+ readonly inputs: readonly [];
60
+ readonly name: "getNonce";
10
61
  readonly outputs: readonly [{
11
62
  readonly internalType: "uint256";
12
63
  readonly name: "";
@@ -14,16 +65,78 @@ export declare const Storage_jsonAbi: readonly [{
14
65
  }];
15
66
  readonly stateMutability: "view";
16
67
  readonly type: "function";
68
+ }, {
69
+ readonly inputs: readonly [];
70
+ readonly name: "getOwner";
71
+ readonly outputs: readonly [{
72
+ readonly internalType: "address";
73
+ readonly name: "";
74
+ readonly type: "address";
75
+ }];
76
+ readonly stateMutability: "view";
77
+ readonly type: "function";
17
78
  }, {
18
79
  readonly inputs: readonly [{
80
+ readonly internalType: "address";
81
+ readonly name: "validator";
82
+ readonly type: "address";
83
+ }];
84
+ readonly name: "readAndUpdateNonce";
85
+ readonly outputs: readonly [{
19
86
  readonly internalType: "uint256";
20
- readonly name: "num";
87
+ readonly name: "";
21
88
  readonly type: "uint256";
22
89
  }];
23
- readonly name: "store";
90
+ readonly stateMutability: "nonpayable";
91
+ readonly type: "function";
92
+ }, {
93
+ readonly inputs: readonly [{
94
+ readonly internalType: "uint256";
95
+ readonly name: "id";
96
+ readonly type: "uint256";
97
+ }];
98
+ readonly name: "revokeSession";
99
+ readonly outputs: readonly [];
100
+ readonly stateMutability: "nonpayable";
101
+ readonly type: "function";
102
+ }, {
103
+ readonly inputs: readonly [{
104
+ readonly internalType: "address";
105
+ readonly name: "validator";
106
+ readonly type: "address";
107
+ }, {
108
+ readonly internalType: "bool";
109
+ readonly name: "isValid";
110
+ readonly type: "bool";
111
+ }];
112
+ readonly name: "setValidatorStatus";
24
113
  readonly outputs: readonly [];
25
114
  readonly stateMutability: "nonpayable";
26
115
  readonly type: "function";
116
+ }, {
117
+ readonly inputs: readonly [{
118
+ readonly internalType: "uint256";
119
+ readonly name: "id";
120
+ readonly type: "uint256";
121
+ }, {
122
+ readonly internalType: "address";
123
+ readonly name: "validator";
124
+ readonly type: "address";
125
+ }];
126
+ readonly name: "validateSession";
127
+ readonly outputs: readonly [];
128
+ readonly stateMutability: "view";
129
+ readonly type: "function";
130
+ }, {
131
+ readonly inputs: readonly [{
132
+ readonly internalType: "address";
133
+ readonly name: "validator";
134
+ readonly type: "address";
135
+ }];
136
+ readonly name: "validateValidator";
137
+ readonly outputs: readonly [];
138
+ readonly stateMutability: "view";
139
+ readonly type: "function";
27
140
  }];
28
141
  /**
29
142
  * Type-safe ABI for Storage_json
@@ -82,16 +195,65 @@ export declare class Storage_json {
82
195
  */
83
196
  getContract(): Storage_jsonContract;
84
197
  /**
85
- * retrieve
198
+ * getNonce
199
+ * view
200
+ */
201
+ getNonce(): Promise<bigint>;
202
+ /**
203
+ * getOwner
204
+ * view
205
+ */
206
+ getOwner(): Promise<`0x${string}`>;
207
+ /**
208
+ * validateSession
86
209
  * view
87
210
  */
88
- retrieve(): Promise<bigint>;
211
+ validateSession(id: bigint, validator: `0x${string}`): Promise<void>;
212
+ /**
213
+ * validateValidator
214
+ * view
215
+ */
216
+ validateValidator(validator: `0x${string}`): Promise<void>;
217
+ /**
218
+ * readAndUpdateNonce
219
+ * nonpayable
220
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
221
+ */
222
+ readAndUpdateNonce(validator: `0x${string}`, options?: {
223
+ accessList?: import('viem').AccessList;
224
+ authorizationList?: import('viem').AuthorizationList;
225
+ chain?: import('viem').Chain | null;
226
+ dataSuffix?: `0x${string}`;
227
+ gas?: bigint;
228
+ gasPrice?: bigint;
229
+ maxFeePerGas?: bigint;
230
+ maxPriorityFeePerGas?: bigint;
231
+ nonce?: number;
232
+ value?: bigint;
233
+ }): Promise<`0x${string}`>;
234
+ /**
235
+ * revokeSession
236
+ * nonpayable
237
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
238
+ */
239
+ revokeSession(id: bigint, options?: {
240
+ accessList?: import('viem').AccessList;
241
+ authorizationList?: import('viem').AuthorizationList;
242
+ chain?: import('viem').Chain | null;
243
+ dataSuffix?: `0x${string}`;
244
+ gas?: bigint;
245
+ gasPrice?: bigint;
246
+ maxFeePerGas?: bigint;
247
+ maxPriorityFeePerGas?: bigint;
248
+ nonce?: number;
249
+ value?: bigint;
250
+ }): Promise<`0x${string}`>;
89
251
  /**
90
- * store
252
+ * setValidatorStatus
91
253
  * nonpayable
92
254
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
93
255
  */
94
- store(num: bigint, options?: {
256
+ setValidatorStatus(validator: `0x${string}`, isValid: boolean, options?: {
95
257
  accessList?: import('viem').AccessList;
96
258
  authorizationList?: import('viem').AuthorizationList;
97
259
  chain?: import('viem').Chain | null;
@@ -113,11 +275,45 @@ export declare class Storage_json {
113
275
  */
114
276
  get simulate(): {
115
277
  /**
116
- * Simulate store
278
+ * Simulate readAndUpdateNonce
117
279
  * Returns gas estimate and result without sending transaction
118
280
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
119
281
  */
120
- store(num: bigint, options?: {
282
+ readAndUpdateNonce(validator: `0x${string}`, options?: {
283
+ accessList?: import("viem").AccessList;
284
+ authorizationList?: import("viem").AuthorizationList;
285
+ chain?: import("viem").Chain | null;
286
+ dataSuffix?: `0x${string}`;
287
+ gas?: bigint;
288
+ gasPrice?: bigint;
289
+ maxFeePerGas?: bigint;
290
+ maxPriorityFeePerGas?: bigint;
291
+ nonce?: number;
292
+ value?: bigint;
293
+ }): Promise<bigint>;
294
+ /**
295
+ * Simulate revokeSession
296
+ * Returns gas estimate and result without sending transaction
297
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
298
+ */
299
+ revokeSession(id: bigint, options?: {
300
+ accessList?: import("viem").AccessList;
301
+ authorizationList?: import("viem").AuthorizationList;
302
+ chain?: import("viem").Chain | null;
303
+ dataSuffix?: `0x${string}`;
304
+ gas?: bigint;
305
+ gasPrice?: bigint;
306
+ maxFeePerGas?: bigint;
307
+ maxPriorityFeePerGas?: bigint;
308
+ nonce?: number;
309
+ value?: bigint;
310
+ }): Promise<void>;
311
+ /**
312
+ * Simulate setValidatorStatus
313
+ * Returns gas estimate and result without sending transaction
314
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
315
+ */
316
+ setValidatorStatus(validator: `0x${string}`, isValid: boolean, options?: {
121
317
  accessList?: import("viem").AccessList;
122
318
  authorizationList?: import("viem").AuthorizationList;
123
319
  chain?: import("viem").Chain | null;
@@ -133,7 +329,43 @@ export declare class Storage_json {
133
329
  /**
134
330
  * Watch contract events
135
331
  *
136
- * Note: This contract has no events, so watch returns an empty object.
332
+ * @example
333
+ * // Watch all Transfer events
334
+ * const unwatch = contract.watch.Transfer((event) => {
335
+ * console.log('Transfer:', event);
336
+ * });
337
+ *
338
+ * // Stop watching
339
+ * unwatch();
137
340
  */
138
- get watch(): {};
341
+ get watch(): {
342
+ /**
343
+ * Watch NonceConsumed events
344
+ * @param callback Function to call when event is emitted
345
+ * @param filter Optional filter for indexed parameters
346
+ * @returns Unwatch function to stop listening
347
+ */
348
+ NonceConsumed: (callback: (event: {
349
+ utilisedNonce: bigint;
350
+ }) => void) => () => void;
351
+ /**
352
+ * Watch SessionRevoked events
353
+ * @param callback Function to call when event is emitted
354
+ * @param filter Optional filter for indexed parameters
355
+ * @returns Unwatch function to stop listening
356
+ */
357
+ SessionRevoked: (callback: (event: {
358
+ id: bigint;
359
+ }) => void) => () => void;
360
+ /**
361
+ * Watch ValidatorStatusUpdated events
362
+ * @param callback Function to call when event is emitted
363
+ * @param filter Optional filter for indexed parameters
364
+ * @returns Unwatch function to stop listening
365
+ */
366
+ ValidatorStatusUpdated: (callback: (event: {
367
+ validator: `0x${string}`;
368
+ status: boolean;
369
+ }) => void) => () => void;
370
+ };
139
371
  }
@@ -10,7 +10,73 @@ const viem_1 = require("viem");
10
10
  exports.Storage_jsonAbi = [
11
11
  {
12
12
  "inputs": [],
13
- "name": "retrieve",
13
+ "name": "InvalidOwner",
14
+ "type": "error"
15
+ },
16
+ {
17
+ "inputs": [],
18
+ "name": "InvalidSessionId",
19
+ "type": "error"
20
+ },
21
+ {
22
+ "inputs": [
23
+ {
24
+ "internalType": "address",
25
+ "name": "validator",
26
+ "type": "address"
27
+ }
28
+ ],
29
+ "name": "InvalidValidator",
30
+ "type": "error"
31
+ },
32
+ {
33
+ "anonymous": false,
34
+ "inputs": [
35
+ {
36
+ "indexed": false,
37
+ "internalType": "uint256",
38
+ "name": "utilisedNonce",
39
+ "type": "uint256"
40
+ }
41
+ ],
42
+ "name": "NonceConsumed",
43
+ "type": "event"
44
+ },
45
+ {
46
+ "anonymous": false,
47
+ "inputs": [
48
+ {
49
+ "indexed": false,
50
+ "internalType": "uint256",
51
+ "name": "id",
52
+ "type": "uint256"
53
+ }
54
+ ],
55
+ "name": "SessionRevoked",
56
+ "type": "event"
57
+ },
58
+ {
59
+ "anonymous": false,
60
+ "inputs": [
61
+ {
62
+ "indexed": false,
63
+ "internalType": "address",
64
+ "name": "validator",
65
+ "type": "address"
66
+ },
67
+ {
68
+ "indexed": false,
69
+ "internalType": "bool",
70
+ "name": "status",
71
+ "type": "bool"
72
+ }
73
+ ],
74
+ "name": "ValidatorStatusUpdated",
75
+ "type": "event"
76
+ },
77
+ {
78
+ "inputs": [],
79
+ "name": "getNonce",
14
80
  "outputs": [
15
81
  {
16
82
  "internalType": "uint256",
@@ -21,18 +87,99 @@ exports.Storage_jsonAbi = [
21
87
  "stateMutability": "view",
22
88
  "type": "function"
23
89
  },
90
+ {
91
+ "inputs": [],
92
+ "name": "getOwner",
93
+ "outputs": [
94
+ {
95
+ "internalType": "address",
96
+ "name": "",
97
+ "type": "address"
98
+ }
99
+ ],
100
+ "stateMutability": "view",
101
+ "type": "function"
102
+ },
103
+ {
104
+ "inputs": [
105
+ {
106
+ "internalType": "address",
107
+ "name": "validator",
108
+ "type": "address"
109
+ }
110
+ ],
111
+ "name": "readAndUpdateNonce",
112
+ "outputs": [
113
+ {
114
+ "internalType": "uint256",
115
+ "name": "",
116
+ "type": "uint256"
117
+ }
118
+ ],
119
+ "stateMutability": "nonpayable",
120
+ "type": "function"
121
+ },
24
122
  {
25
123
  "inputs": [
26
124
  {
27
125
  "internalType": "uint256",
28
- "name": "num",
126
+ "name": "id",
29
127
  "type": "uint256"
30
128
  }
31
129
  ],
32
- "name": "store",
130
+ "name": "revokeSession",
131
+ "outputs": [],
132
+ "stateMutability": "nonpayable",
133
+ "type": "function"
134
+ },
135
+ {
136
+ "inputs": [
137
+ {
138
+ "internalType": "address",
139
+ "name": "validator",
140
+ "type": "address"
141
+ },
142
+ {
143
+ "internalType": "bool",
144
+ "name": "isValid",
145
+ "type": "bool"
146
+ }
147
+ ],
148
+ "name": "setValidatorStatus",
33
149
  "outputs": [],
34
150
  "stateMutability": "nonpayable",
35
151
  "type": "function"
152
+ },
153
+ {
154
+ "inputs": [
155
+ {
156
+ "internalType": "uint256",
157
+ "name": "id",
158
+ "type": "uint256"
159
+ },
160
+ {
161
+ "internalType": "address",
162
+ "name": "validator",
163
+ "type": "address"
164
+ }
165
+ ],
166
+ "name": "validateSession",
167
+ "outputs": [],
168
+ "stateMutability": "view",
169
+ "type": "function"
170
+ },
171
+ {
172
+ "inputs": [
173
+ {
174
+ "internalType": "address",
175
+ "name": "validator",
176
+ "type": "address"
177
+ }
178
+ ],
179
+ "name": "validateValidator",
180
+ "outputs": [],
181
+ "stateMutability": "view",
182
+ "type": "function"
36
183
  }
37
184
  ];
38
185
  /**
@@ -93,22 +240,65 @@ class Storage_json {
93
240
  return this.contract;
94
241
  }
95
242
  /**
96
- * retrieve
243
+ * getNonce
244
+ * view
245
+ */
246
+ async getNonce() {
247
+ return this.contract.read.getNonce();
248
+ }
249
+ /**
250
+ * getOwner
251
+ * view
252
+ */
253
+ async getOwner() {
254
+ return this.contract.read.getOwner();
255
+ }
256
+ /**
257
+ * validateSession
97
258
  * view
98
259
  */
99
- async retrieve() {
100
- return this.contract.read.retrieve();
260
+ async validateSession(id, validator) {
261
+ return this.contract.read.validateSession([id, validator]);
262
+ }
263
+ /**
264
+ * validateValidator
265
+ * view
266
+ */
267
+ async validateValidator(validator) {
268
+ return this.contract.read.validateValidator([validator]);
269
+ }
270
+ /**
271
+ * readAndUpdateNonce
272
+ * nonpayable
273
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
274
+ */
275
+ async readAndUpdateNonce(validator, options) {
276
+ if (!this.contract.write) {
277
+ throw new Error('Wallet client is required for write operations');
278
+ }
279
+ return this.contract.write.readAndUpdateNonce([validator], options);
280
+ }
281
+ /**
282
+ * revokeSession
283
+ * nonpayable
284
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
285
+ */
286
+ async revokeSession(id, options) {
287
+ if (!this.contract.write) {
288
+ throw new Error('Wallet client is required for write operations');
289
+ }
290
+ return this.contract.write.revokeSession([id], options);
101
291
  }
102
292
  /**
103
- * store
293
+ * setValidatorStatus
104
294
  * nonpayable
105
295
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
106
296
  */
107
- async store(num, options) {
297
+ async setValidatorStatus(validator, isValid, options) {
108
298
  if (!this.contract.write) {
109
299
  throw new Error('Wallet client is required for write operations');
110
300
  }
111
- return this.contract.write.store([num], options);
301
+ return this.contract.write.setValidatorStatus([validator, isValid], options);
112
302
  }
113
303
  /**
114
304
  * Simulate contract write operations (dry-run without sending transaction)
@@ -125,22 +315,100 @@ class Storage_json {
125
315
  }
126
316
  return {
127
317
  /**
128
- * Simulate store
318
+ * Simulate readAndUpdateNonce
319
+ * Returns gas estimate and result without sending transaction
320
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
321
+ */
322
+ async readAndUpdateNonce(validator, options) {
323
+ return contract.simulate.readAndUpdateNonce([validator], options);
324
+ },
325
+ /**
326
+ * Simulate revokeSession
129
327
  * Returns gas estimate and result without sending transaction
130
328
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
131
329
  */
132
- async store(num, options) {
133
- return contract.simulate.store([num], options);
330
+ async revokeSession(id, options) {
331
+ return contract.simulate.revokeSession([id], options);
332
+ },
333
+ /**
334
+ * Simulate setValidatorStatus
335
+ * Returns gas estimate and result without sending transaction
336
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
337
+ */
338
+ async setValidatorStatus(validator, isValid, options) {
339
+ return contract.simulate.setValidatorStatus([validator, isValid], options);
134
340
  }
135
341
  };
136
342
  }
137
343
  /**
138
344
  * Watch contract events
139
345
  *
140
- * Note: This contract has no events, so watch returns an empty object.
346
+ * @example
347
+ * // Watch all Transfer events
348
+ * const unwatch = contract.watch.Transfer((event) => {
349
+ * console.log('Transfer:', event);
350
+ * });
351
+ *
352
+ * // Stop watching
353
+ * unwatch();
141
354
  */
142
355
  get watch() {
143
- return {};
356
+ return {
357
+ /**
358
+ * Watch NonceConsumed events
359
+ * @param callback Function to call when event is emitted
360
+ * @param filter Optional filter for indexed parameters
361
+ * @returns Unwatch function to stop listening
362
+ */
363
+ NonceConsumed: (callback) => {
364
+ return this.publicClient.watchContractEvent({
365
+ address: this.contractAddress,
366
+ abi: exports.Storage_jsonAbi,
367
+ eventName: 'NonceConsumed',
368
+ onLogs: (logs) => {
369
+ logs.forEach((log) => {
370
+ callback(log.args);
371
+ });
372
+ },
373
+ });
374
+ },
375
+ /**
376
+ * Watch SessionRevoked events
377
+ * @param callback Function to call when event is emitted
378
+ * @param filter Optional filter for indexed parameters
379
+ * @returns Unwatch function to stop listening
380
+ */
381
+ SessionRevoked: (callback) => {
382
+ return this.publicClient.watchContractEvent({
383
+ address: this.contractAddress,
384
+ abi: exports.Storage_jsonAbi,
385
+ eventName: 'SessionRevoked',
386
+ onLogs: (logs) => {
387
+ logs.forEach((log) => {
388
+ callback(log.args);
389
+ });
390
+ },
391
+ });
392
+ },
393
+ /**
394
+ * Watch ValidatorStatusUpdated events
395
+ * @param callback Function to call when event is emitted
396
+ * @param filter Optional filter for indexed parameters
397
+ * @returns Unwatch function to stop listening
398
+ */
399
+ ValidatorStatusUpdated: (callback) => {
400
+ return this.publicClient.watchContractEvent({
401
+ address: this.contractAddress,
402
+ abi: exports.Storage_jsonAbi,
403
+ eventName: 'ValidatorStatusUpdated',
404
+ onLogs: (logs) => {
405
+ logs.forEach((log) => {
406
+ callback(log.args);
407
+ });
408
+ },
409
+ });
410
+ }
411
+ };
144
412
  }
145
413
  }
146
414
  exports.Storage_json = Storage_json;
@@ -9,7 +9,73 @@ import { getContract } from 'viem';
9
9
  export const Storage_jsonAbi = [
10
10
  {
11
11
  "inputs": [],
12
- "name": "retrieve",
12
+ "name": "InvalidOwner",
13
+ "type": "error"
14
+ },
15
+ {
16
+ "inputs": [],
17
+ "name": "InvalidSessionId",
18
+ "type": "error"
19
+ },
20
+ {
21
+ "inputs": [
22
+ {
23
+ "internalType": "address",
24
+ "name": "validator",
25
+ "type": "address"
26
+ }
27
+ ],
28
+ "name": "InvalidValidator",
29
+ "type": "error"
30
+ },
31
+ {
32
+ "anonymous": false,
33
+ "inputs": [
34
+ {
35
+ "indexed": false,
36
+ "internalType": "uint256",
37
+ "name": "utilisedNonce",
38
+ "type": "uint256"
39
+ }
40
+ ],
41
+ "name": "NonceConsumed",
42
+ "type": "event"
43
+ },
44
+ {
45
+ "anonymous": false,
46
+ "inputs": [
47
+ {
48
+ "indexed": false,
49
+ "internalType": "uint256",
50
+ "name": "id",
51
+ "type": "uint256"
52
+ }
53
+ ],
54
+ "name": "SessionRevoked",
55
+ "type": "event"
56
+ },
57
+ {
58
+ "anonymous": false,
59
+ "inputs": [
60
+ {
61
+ "indexed": false,
62
+ "internalType": "address",
63
+ "name": "validator",
64
+ "type": "address"
65
+ },
66
+ {
67
+ "indexed": false,
68
+ "internalType": "bool",
69
+ "name": "status",
70
+ "type": "bool"
71
+ }
72
+ ],
73
+ "name": "ValidatorStatusUpdated",
74
+ "type": "event"
75
+ },
76
+ {
77
+ "inputs": [],
78
+ "name": "getNonce",
13
79
  "outputs": [
14
80
  {
15
81
  "internalType": "uint256",
@@ -20,18 +86,99 @@ export const Storage_jsonAbi = [
20
86
  "stateMutability": "view",
21
87
  "type": "function"
22
88
  },
89
+ {
90
+ "inputs": [],
91
+ "name": "getOwner",
92
+ "outputs": [
93
+ {
94
+ "internalType": "address",
95
+ "name": "",
96
+ "type": "address"
97
+ }
98
+ ],
99
+ "stateMutability": "view",
100
+ "type": "function"
101
+ },
102
+ {
103
+ "inputs": [
104
+ {
105
+ "internalType": "address",
106
+ "name": "validator",
107
+ "type": "address"
108
+ }
109
+ ],
110
+ "name": "readAndUpdateNonce",
111
+ "outputs": [
112
+ {
113
+ "internalType": "uint256",
114
+ "name": "",
115
+ "type": "uint256"
116
+ }
117
+ ],
118
+ "stateMutability": "nonpayable",
119
+ "type": "function"
120
+ },
23
121
  {
24
122
  "inputs": [
25
123
  {
26
124
  "internalType": "uint256",
27
- "name": "num",
125
+ "name": "id",
28
126
  "type": "uint256"
29
127
  }
30
128
  ],
31
- "name": "store",
129
+ "name": "revokeSession",
32
130
  "outputs": [],
33
131
  "stateMutability": "nonpayable",
34
132
  "type": "function"
133
+ },
134
+ {
135
+ "inputs": [
136
+ {
137
+ "internalType": "address",
138
+ "name": "validator",
139
+ "type": "address"
140
+ },
141
+ {
142
+ "internalType": "bool",
143
+ "name": "isValid",
144
+ "type": "bool"
145
+ }
146
+ ],
147
+ "name": "setValidatorStatus",
148
+ "outputs": [],
149
+ "stateMutability": "nonpayable",
150
+ "type": "function"
151
+ },
152
+ {
153
+ "inputs": [
154
+ {
155
+ "internalType": "uint256",
156
+ "name": "id",
157
+ "type": "uint256"
158
+ },
159
+ {
160
+ "internalType": "address",
161
+ "name": "validator",
162
+ "type": "address"
163
+ }
164
+ ],
165
+ "name": "validateSession",
166
+ "outputs": [],
167
+ "stateMutability": "view",
168
+ "type": "function"
169
+ },
170
+ {
171
+ "inputs": [
172
+ {
173
+ "internalType": "address",
174
+ "name": "validator",
175
+ "type": "address"
176
+ }
177
+ ],
178
+ "name": "validateValidator",
179
+ "outputs": [],
180
+ "stateMutability": "view",
181
+ "type": "function"
35
182
  }
36
183
  ] as const satisfies Abi;
37
184
 
@@ -118,19 +265,89 @@ export class Storage_json {
118
265
  }
119
266
 
120
267
  /**
121
- * retrieve
268
+ * getNonce
122
269
  * view
123
270
  */
124
- async retrieve(): Promise<bigint> {
125
- return this.contract.read.retrieve() as Promise<bigint>;
271
+ async getNonce(): Promise<bigint> {
272
+ return this.contract.read.getNonce() as Promise<bigint>;
126
273
  }
127
274
 
128
275
  /**
129
- * store
276
+ * getOwner
277
+ * view
278
+ */
279
+ async getOwner(): Promise<`0x${string}`> {
280
+ return this.contract.read.getOwner() as Promise<`0x${string}`>;
281
+ }
282
+
283
+ /**
284
+ * validateSession
285
+ * view
286
+ */
287
+ async validateSession(id: bigint, validator: `0x${string}`): Promise<void> {
288
+ return this.contract.read.validateSession([id, validator] as const) as Promise<void>;
289
+ }
290
+
291
+ /**
292
+ * validateValidator
293
+ * view
294
+ */
295
+ async validateValidator(validator: `0x${string}`): Promise<void> {
296
+ return this.contract.read.validateValidator([validator] as const) as Promise<void>;
297
+ }
298
+
299
+ /**
300
+ * readAndUpdateNonce
301
+ * nonpayable
302
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
303
+ */
304
+ async readAndUpdateNonce(validator: `0x${string}`, options?: {
305
+ accessList?: import('viem').AccessList;
306
+ authorizationList?: import('viem').AuthorizationList;
307
+ chain?: import('viem').Chain | null;
308
+ dataSuffix?: `0x${string}`;
309
+ gas?: bigint;
310
+ gasPrice?: bigint;
311
+ maxFeePerGas?: bigint;
312
+ maxPriorityFeePerGas?: bigint;
313
+ nonce?: number;
314
+ value?: bigint;
315
+ }): Promise<`0x${string}`> {
316
+ if (!this.contract.write) {
317
+ throw new Error('Wallet client is required for write operations');
318
+ }
319
+ return this.contract.write.readAndUpdateNonce([validator] as const, options) as Promise<`0x${string}`>;
320
+ }
321
+
322
+ /**
323
+ * revokeSession
324
+ * nonpayable
325
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
326
+ */
327
+ async revokeSession(id: bigint, options?: {
328
+ accessList?: import('viem').AccessList;
329
+ authorizationList?: import('viem').AuthorizationList;
330
+ chain?: import('viem').Chain | null;
331
+ dataSuffix?: `0x${string}`;
332
+ gas?: bigint;
333
+ gasPrice?: bigint;
334
+ maxFeePerGas?: bigint;
335
+ maxPriorityFeePerGas?: bigint;
336
+ nonce?: number;
337
+ value?: bigint;
338
+ }): Promise<`0x${string}`> {
339
+ if (!this.contract.write) {
340
+ throw new Error('Wallet client is required for write operations');
341
+ }
342
+ return this.contract.write.revokeSession([id] as const, options) as Promise<`0x${string}`>;
343
+ }
344
+
345
+ /**
346
+ * setValidatorStatus
130
347
  * nonpayable
131
348
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
132
349
  */
133
- async store(num: bigint, options?: {
350
+ async setValidatorStatus(validator: `0x${string}`, isValid: boolean, options?: {
134
351
  accessList?: import('viem').AccessList;
135
352
  authorizationList?: import('viem').AuthorizationList;
136
353
  chain?: import('viem').Chain | null;
@@ -145,7 +362,7 @@ export class Storage_json {
145
362
  if (!this.contract.write) {
146
363
  throw new Error('Wallet client is required for write operations');
147
364
  }
148
- return this.contract.write.store([num] as const, options) as Promise<`0x${string}`>;
365
+ return this.contract.write.setValidatorStatus([validator, isValid] as const, options) as Promise<`0x${string}`>;
149
366
  }
150
367
 
151
368
 
@@ -165,11 +382,49 @@ export class Storage_json {
165
382
  }
166
383
  return {
167
384
  /**
168
- * Simulate store
385
+ * Simulate readAndUpdateNonce
386
+ * Returns gas estimate and result without sending transaction
387
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
388
+ */
389
+ async readAndUpdateNonce(validator: `0x${string}`, options?: {
390
+ accessList?: import('viem').AccessList;
391
+ authorizationList?: import('viem').AuthorizationList;
392
+ chain?: import('viem').Chain | null;
393
+ dataSuffix?: `0x${string}`;
394
+ gas?: bigint;
395
+ gasPrice?: bigint;
396
+ maxFeePerGas?: bigint;
397
+ maxPriorityFeePerGas?: bigint;
398
+ nonce?: number;
399
+ value?: bigint;
400
+ }): Promise<bigint> {
401
+ return contract.simulate.readAndUpdateNonce([validator] as const, options) as Promise<bigint>;
402
+ },
403
+ /**
404
+ * Simulate revokeSession
405
+ * Returns gas estimate and result without sending transaction
406
+ * @param options Optional transaction parameters (value, gas, nonce, etc.)
407
+ */
408
+ async revokeSession(id: bigint, options?: {
409
+ accessList?: import('viem').AccessList;
410
+ authorizationList?: import('viem').AuthorizationList;
411
+ chain?: import('viem').Chain | null;
412
+ dataSuffix?: `0x${string}`;
413
+ gas?: bigint;
414
+ gasPrice?: bigint;
415
+ maxFeePerGas?: bigint;
416
+ maxPriorityFeePerGas?: bigint;
417
+ nonce?: number;
418
+ value?: bigint;
419
+ }): Promise<void> {
420
+ return contract.simulate.revokeSession([id] as const, options) as Promise<void>;
421
+ },
422
+ /**
423
+ * Simulate setValidatorStatus
169
424
  * Returns gas estimate and result without sending transaction
170
425
  * @param options Optional transaction parameters (value, gas, nonce, etc.)
171
426
  */
172
- async store(num: bigint, options?: {
427
+ async setValidatorStatus(validator: `0x${string}`, isValid: boolean, options?: {
173
428
  accessList?: import('viem').AccessList;
174
429
  authorizationList?: import('viem').AuthorizationList;
175
430
  chain?: import('viem').Chain | null;
@@ -181,7 +436,7 @@ export class Storage_json {
181
436
  nonce?: number;
182
437
  value?: bigint;
183
438
  }): Promise<void> {
184
- return contract.simulate.store([num] as const, options) as Promise<void>;
439
+ return contract.simulate.setValidatorStatus([validator, isValid] as const, options) as Promise<void>;
185
440
  }
186
441
  };
187
442
  }
@@ -189,9 +444,74 @@ export class Storage_json {
189
444
  /**
190
445
  * Watch contract events
191
446
  *
192
- * Note: This contract has no events, so watch returns an empty object.
447
+ * @example
448
+ * // Watch all Transfer events
449
+ * const unwatch = contract.watch.Transfer((event) => {
450
+ * console.log('Transfer:', event);
451
+ * });
452
+ *
453
+ * // Stop watching
454
+ * unwatch();
193
455
  */
194
456
  get watch() {
195
- return {};
457
+ return {
458
+ /**
459
+ * Watch NonceConsumed events
460
+ * @param callback Function to call when event is emitted
461
+ * @param filter Optional filter for indexed parameters
462
+ * @returns Unwatch function to stop listening
463
+ */
464
+ NonceConsumed: (callback: (event: { utilisedNonce: bigint }) => void) => {
465
+ return this.publicClient.watchContractEvent({
466
+ address: this.contractAddress,
467
+ abi: Storage_jsonAbi,
468
+ eventName: 'NonceConsumed',
469
+
470
+ onLogs: (logs: any[]) => {
471
+ logs.forEach((log: any) => {
472
+ callback(log.args as any);
473
+ });
474
+ },
475
+ }) as () => void;
476
+ },
477
+ /**
478
+ * Watch SessionRevoked events
479
+ * @param callback Function to call when event is emitted
480
+ * @param filter Optional filter for indexed parameters
481
+ * @returns Unwatch function to stop listening
482
+ */
483
+ SessionRevoked: (callback: (event: { id: bigint }) => void) => {
484
+ return this.publicClient.watchContractEvent({
485
+ address: this.contractAddress,
486
+ abi: Storage_jsonAbi,
487
+ eventName: 'SessionRevoked',
488
+
489
+ onLogs: (logs: any[]) => {
490
+ logs.forEach((log: any) => {
491
+ callback(log.args as any);
492
+ });
493
+ },
494
+ }) as () => void;
495
+ },
496
+ /**
497
+ * Watch ValidatorStatusUpdated events
498
+ * @param callback Function to call when event is emitted
499
+ * @param filter Optional filter for indexed parameters
500
+ * @returns Unwatch function to stop listening
501
+ */
502
+ ValidatorStatusUpdated: (callback: (event: { validator: `0x${string}`; status: boolean }) => void) => {
503
+ return this.publicClient.watchContractEvent({
504
+ address: this.contractAddress,
505
+ abi: Storage_jsonAbi,
506
+ eventName: 'ValidatorStatusUpdated',
507
+
508
+ onLogs: (logs: any[]) => {
509
+ logs.forEach((log: any) => {
510
+ callback(log.args as any);
511
+ });
512
+ },
513
+ }) as () => void;
514
+ }
515
+ };
196
516
  }
197
517
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gitmyabi/storage",
3
- "version": "1.0.2",
4
- "description": "Auto-generated TypeScript type bindings for Storage (build etherscan-storage-d49edad6-1787334000666, commit 85d568f, branch etherscan)",
3
+ "version": "1.0.4",
4
+ "description": "Auto-generated TypeScript type bindings for Storage (build etherscan-storage-f3345338-1793237320805, commit b11b953, 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/storage"
40
40
  },
41
41
  "branch": "etherscan",
42
- "shortHash": "85d568f"
42
+ "shortHash": "b11b953"
43
43
  }