@apibara/starknet 0.1.1 → 0.2.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.
Files changed (48) hide show
  1. package/dist/cursor.d.ts +19 -0
  2. package/dist/cursor.js +30 -0
  3. package/dist/cursor.js.map +1 -0
  4. package/dist/felt.d.ts +19 -0
  5. package/dist/felt.js +60 -0
  6. package/dist/felt.js.map +1 -0
  7. package/dist/felt.test.d.ts +1 -0
  8. package/dist/felt.test.js +22 -0
  9. package/dist/felt.test.js.map +1 -0
  10. package/dist/filter.d.ts +285 -0
  11. package/dist/filter.js +490 -0
  12. package/dist/filter.js.map +1 -0
  13. package/dist/filter.test.d.ts +1 -0
  14. package/dist/filter.test.js +54 -0
  15. package/dist/filter.test.js.map +1 -0
  16. package/dist/index.d.ts +4 -1
  17. package/dist/index.js +18 -18
  18. package/dist/index.js.map +1 -1
  19. package/dist/proto/filter.proto +154 -0
  20. package/dist/proto/generated.d.ts +4499 -0
  21. package/dist/proto/generated.js +10973 -0
  22. package/dist/proto/generated.js.map +1 -0
  23. package/dist/proto/index.d.ts +2 -0
  24. package/dist/proto/index.js +7 -0
  25. package/dist/proto/index.js.map +1 -0
  26. package/dist/proto/starknet.proto +220 -86
  27. package/dist/proto/types.proto +13 -0
  28. package/package.json +16 -7
  29. package/src/cursor.ts +26 -0
  30. package/src/felt.test.ts +24 -0
  31. package/src/felt.ts +61 -0
  32. package/src/filter.test.ts +63 -0
  33. package/src/filter.ts +620 -0
  34. package/src/index.ts +4 -18
  35. package/src/proto/filter.proto +154 -0
  36. package/src/proto/generated.d.ts +4499 -0
  37. package/src/proto/generated.js +11684 -0
  38. package/src/proto/index.ts +4 -0
  39. package/src/proto/starknet.proto +220 -86
  40. package/src/proto/types.proto +13 -0
  41. package/dist/proto/google/protobuf/timestamp.d.ts +0 -132
  42. package/dist/proto/google/protobuf/timestamp.js +0 -92
  43. package/dist/proto/google/protobuf/timestamp.js.map +0 -1
  44. package/dist/proto/starknet.d.ts +0 -1428
  45. package/dist/proto/starknet.js +0 -1506
  46. package/dist/proto/starknet.js.map +0 -1
  47. package/src/proto/google/protobuf/timestamp.ts +0 -216
  48. package/src/proto/starknet.ts +0 -1725
@@ -0,0 +1,19 @@
1
+ /// <reference types="node" />
2
+ import Long from 'long';
3
+ import { v1alpha2 } from './proto';
4
+ export declare const StarkNetCursor: {
5
+ /**
6
+ * Creates a cursor pointing at the canonical block at the given height.
7
+ */
8
+ createWithBlockNumber: (number: string | number | Long) => {
9
+ orderKey: Long;
10
+ uniqueKey: Uint8Array;
11
+ };
12
+ /**
13
+ * Creates a cursor pointing at the block with the given height and hash.
14
+ */
15
+ createWithBlockNumberAndHash: (number: string | number | Long, hash: v1alpha2.IFieldElement) => {
16
+ orderKey: Long;
17
+ uniqueKey: Buffer;
18
+ };
19
+ };
package/dist/cursor.js ADDED
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.StarkNetCursor = void 0;
7
+ const long_1 = __importDefault(require("long"));
8
+ const felt_1 = require("./felt");
9
+ exports.StarkNetCursor = {
10
+ /**
11
+ * Creates a cursor pointing at the canonical block at the given height.
12
+ */
13
+ createWithBlockNumber: (number) => {
14
+ return {
15
+ orderKey: long_1.default.fromValue(number),
16
+ uniqueKey: new Uint8Array(),
17
+ };
18
+ },
19
+ /**
20
+ * Creates a cursor pointing at the block with the given height and hash.
21
+ */
22
+ createWithBlockNumberAndHash: (number, hash) => {
23
+ const uniqueKey = Buffer.from(felt_1.FieldElement.toHex(hash).replace('0x', ''), 'hex');
24
+ return {
25
+ orderKey: long_1.default.fromValue(number),
26
+ uniqueKey,
27
+ };
28
+ },
29
+ };
30
+ //# sourceMappingURL=cursor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cursor.js","sourceRoot":"","sources":["../src/cursor.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAuB;AACvB,iCAAqC;AAGxB,QAAA,cAAc,GAAG;IAC5B;;OAEG;IACH,qBAAqB,EAAE,CAAC,MAA8B,EAAE,EAAE;QACxD,OAAO;YACL,QAAQ,EAAE,cAAI,CAAC,SAAS,CAAC,MAAM,CAAC;YAChC,SAAS,EAAE,IAAI,UAAU,EAAE;SAC5B,CAAA;IACH,CAAC;IAED;;OAEG;IACH,4BAA4B,EAAE,CAAC,MAA8B,EAAE,IAA4B,EAAE,EAAE;QAC7F,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,mBAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,KAAK,CAAC,CAAA;QAChF,OAAO;YACL,QAAQ,EAAE,cAAI,CAAC,SAAS,CAAC,MAAM,CAAC;YAChC,SAAS;SACV,CAAA;IACH,CAAC;CACF,CAAA"}
package/dist/felt.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ import { v1alpha2 } from './proto';
2
+ export declare const FieldElement: {
3
+ encode: typeof v1alpha2.FieldElement.encode;
4
+ decode: typeof v1alpha2.FieldElement.decode;
5
+ fromObject: typeof v1alpha2.FieldElement.fromObject;
6
+ toObject: typeof v1alpha2.FieldElement.toObject;
7
+ /**
8
+ * Converts from the wire representation to a bigint.
9
+ */
10
+ toBigInt(message: v1alpha2.IFieldElement): bigint;
11
+ /**
12
+ * Returns the wire representation of the given bigint.
13
+ */
14
+ fromBigInt(number: string | number | bigint): v1alpha2.IFieldElement;
15
+ /**
16
+ * Returns the hex value of the field element.
17
+ */
18
+ toHex(message: v1alpha2.IFieldElement): string;
19
+ };
package/dist/felt.js ADDED
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FieldElement = void 0;
7
+ const long_1 = __importDefault(require("long"));
8
+ const proto_1 = require("./proto");
9
+ const MAX_FELT = 2n ** 251n + 17n * 2n ** 192n;
10
+ exports.FieldElement = {
11
+ encode: proto_1.v1alpha2.FieldElement.encode,
12
+ decode: proto_1.v1alpha2.FieldElement.decode,
13
+ fromObject: proto_1.v1alpha2.FieldElement.fromObject,
14
+ toObject: proto_1.v1alpha2.FieldElement.toObject,
15
+ /**
16
+ * Converts from the wire representation to a bigint.
17
+ */
18
+ toBigInt(message) {
19
+ const hiHi = hexEncodedU64(message.hiHi);
20
+ const hiLo = hexEncodedU64(message.hiLo);
21
+ const loHi = hexEncodedU64(message.loHi);
22
+ const loLo = hexEncodedU64(message.loLo);
23
+ return BigInt(`0x${loLo}${loHi}${hiLo}${hiHi}`);
24
+ },
25
+ /**
26
+ * Returns the wire representation of the given bigint.
27
+ */
28
+ fromBigInt(number) {
29
+ if (number < 0 || number > MAX_FELT) {
30
+ throw new Error('FieldElement outside of range');
31
+ }
32
+ const bn = BigInt(number);
33
+ // bit-shifting of a big int doesn't make much sense.
34
+ // convert to hex and from there breakup in pieces
35
+ const hex = bn.toString(16).padStart(64, '0');
36
+ const s = hex.length;
37
+ const hiHi = long_1.default.fromString(hex.slice(s - 16, s), true, 16);
38
+ const hiLo = long_1.default.fromString(hex.slice(s - 32, s - 16), true, 16);
39
+ const loHi = long_1.default.fromString(hex.slice(s - 48, s - 32), true, 16);
40
+ const loLo = long_1.default.fromString(hex.slice(s - 64, s - 48), true, 16);
41
+ return {
42
+ hiHi,
43
+ hiLo,
44
+ loHi,
45
+ loLo,
46
+ };
47
+ },
48
+ /**
49
+ * Returns the hex value of the field element.
50
+ */
51
+ toHex(message) {
52
+ const num = this.toBigInt(message);
53
+ return `0x${num.toString(16).padStart(64, '0')}`;
54
+ },
55
+ };
56
+ function hexEncodedU64(n) {
57
+ const s = n?.toString(16) ?? '';
58
+ return s.padStart(16, '0');
59
+ }
60
+ //# sourceMappingURL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
+ const felt_1 = require("./felt");
4
+ describe('FieldElement', () => {
5
+ describe('encoding', () => {
6
+ it('can be encoded to and from the wire format', () => {
7
+ const original = BigInt('0x00da114221cb83fa859dbdb4c44beeaa0bb37c7537ad5ae66fe5e0efd20e6eb3');
8
+ const encoded = felt_1.FieldElement.fromBigInt(original);
9
+ const back = felt_1.FieldElement.toBigInt(encoded);
10
+ expect(back).toBe(original);
11
+ });
12
+ it('encodes the value as big endian', () => {
13
+ const prime = 2n ** 251n + 17n * 2n ** 192n;
14
+ const encoded = felt_1.FieldElement.fromBigInt(prime);
15
+ expect(encoded.hiHi?.toString()).toEqual('0');
16
+ expect(encoded.hiLo?.toString()).toEqual('0');
17
+ expect(encoded.loHi?.toString()).toEqual('0');
18
+ expect(encoded.loLo?.toString()).toEqual('576460752303423505');
19
+ });
20
+ });
21
+ });
22
+ //# sourceMappingURL=felt.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"felt.test.js","sourceRoot":"","sources":["../src/felt.test.ts"],"names":[],"mappings":";;AAAA,iCAAqC;AAErC,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;QACxB,EAAE,CAAC,4CAA4C,EAAE,GAAG,EAAE;YACpD,MAAM,QAAQ,GAAG,MAAM,CAAC,oEAAoE,CAAC,CAAA;YAE7F,MAAM,OAAO,GAAG,mBAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;YAEjD,MAAM,IAAI,GAAG,mBAAY,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;YAE3C,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC7B,CAAC,CAAC,CAAA;QAEF,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;YACzC,MAAM,KAAK,GAAG,EAAE,IAAI,IAAI,GAAG,GAAG,GAAG,EAAE,IAAI,IAAI,CAAA;YAC3C,MAAM,OAAO,GAAG,mBAAY,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;YAC9C,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YAC7C,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YAC7C,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YAC7C,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAA;QAChE,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -0,0 +1,285 @@
1
+ import { v1alpha2 } from './proto';
2
+ /**
3
+ * Helper functions to create StarkNet data filters.
4
+ */
5
+ export declare const Filter: {
6
+ /**
7
+ * Creates the root filter object.
8
+ */
9
+ create: () => FilterBuilder;
10
+ /**
11
+ * Creates a transaction filter.
12
+ */
13
+ transaction: () => TransactionFilter;
14
+ /**
15
+ * Creates an event filter.
16
+ */
17
+ event: () => EventFilter;
18
+ /**
19
+ * Creates an L2 to L1 message filter.
20
+ */
21
+ message: () => L2ToL1MessageFilter;
22
+ /**
23
+ * Creates a new state update filter.
24
+ */
25
+ stateUpdate: () => StateUpdateFilter;
26
+ };
27
+ export declare class FilterBuilder {
28
+ private inner;
29
+ constructor();
30
+ /**
31
+ * Include header in the returned data.
32
+ */
33
+ withHeader(): this;
34
+ /**
35
+ * Include transaction data. Use an empty filter to return all transactions.
36
+ */
37
+ addTransaction(filterOrBuilder: IEncodableTransactionFilter | ((builder: TransactionFilter) => IEncodableTransactionFilter)): this;
38
+ /**
39
+ * Include event data. Use an empty filter to include all events.
40
+ */
41
+ addEvent(filterOrBuilder: IEncodable<v1alpha2.IEventFilter> | ((builder: EventFilter) => IEncodable<v1alpha2.IEventFilter>)): this;
42
+ /**
43
+ * Include messages from L2 to L1. Use an empty filter to include all messages.
44
+ */
45
+ addMessage(filterOrBuilder: IEncodable<v1alpha2.IL2ToL1MessageFilter> | ((builder: L2ToL1MessageFilter) => IEncodable<v1alpha2.IL2ToL1MessageFilter>)): this;
46
+ /**
47
+ * Include state updates.
48
+ */
49
+ withStateUpdate(filterOrBuilder: IEncodable<v1alpha2.IStateUpdateFilter> | ((filter: StateUpdateFilter) => IEncodable<v1alpha2.IStateUpdateFilter>)): this;
50
+ /**
51
+ * Returns the filter in encoded form, ready to be added to a request.
52
+ */
53
+ encode(): Uint8Array;
54
+ /**
55
+ * Returns the filter as a plain object.
56
+ */
57
+ toObject(): v1alpha2.IFilter;
58
+ }
59
+ export declare class TransactionFilter {
60
+ /**
61
+ * Includes any transaction type.
62
+ */
63
+ any(): AnyTransactionFilter;
64
+ /**
65
+ * Include invoke transactions, V0
66
+ */
67
+ invokeV0(): InvokeV0TransactionFilter;
68
+ /**
69
+ * Include invoke transactions, V1
70
+ */
71
+ invokeV1(): InvokeV1TransactionFilter;
72
+ /**
73
+ * Include deploy transactions
74
+ */
75
+ deploy(): DeployTransactionFilter;
76
+ /**
77
+ * Include declare transactions
78
+ */
79
+ declare(): DeclareTransactionFilter;
80
+ /**
81
+ * Include l1 handler transactions
82
+ */
83
+ l1Handler(): L1HandlerTransactionFilter;
84
+ /**
85
+ * Include deploy account transactions
86
+ */
87
+ deployAccount(): DeployAccountTransactionFilter;
88
+ }
89
+ export interface IEncodable<T> {
90
+ encode(): T;
91
+ }
92
+ export declare class AnyTransactionFilter implements IEncodable<v1alpha2.ITransactionFilter> {
93
+ encode(): v1alpha2.ITransactionFilter;
94
+ }
95
+ declare type IEncodableTransactionFilter = IEncodable<v1alpha2.ITransactionFilter>;
96
+ export declare class InvokeV0TransactionFilter implements IEncodableTransactionFilter {
97
+ private inner;
98
+ constructor();
99
+ /**
100
+ * Filter by contract address.
101
+ */
102
+ withContractAddress(address: v1alpha2.IFieldElement): this;
103
+ /**
104
+ * Filter by entry point selector.
105
+ */
106
+ withEntryPointSelector(selector: v1alpha2.IFieldElement): this;
107
+ /**
108
+ * Filter by calldata prefix.
109
+ */
110
+ withCalldata(calldata: v1alpha2.IFieldElement[]): this;
111
+ encode(): v1alpha2.ITransactionFilter;
112
+ }
113
+ export declare class InvokeV1TransactionFilter implements IEncodableTransactionFilter {
114
+ private inner;
115
+ constructor();
116
+ /**
117
+ * Filter by sender address.
118
+ */
119
+ withSenderAddress(address: v1alpha2.IFieldElement): this;
120
+ /**
121
+ * Filter by calldata prefix.
122
+ */
123
+ withCalldata(calldata: v1alpha2.IFieldElement[]): this;
124
+ encode(): v1alpha2.ITransactionFilter;
125
+ }
126
+ export declare class DeployTransactionFilter implements IEncodableTransactionFilter {
127
+ private inner;
128
+ constructor();
129
+ /**
130
+ * Filter by contract address salt.
131
+ */
132
+ withContractAddressSalt(salt: v1alpha2.IFieldElement): this;
133
+ /**
134
+ * Filter by class hash.
135
+ */
136
+ withClassHash(hash: v1alpha2.IFieldElement): this;
137
+ /**
138
+ * Filter by constructor calldata prefix.
139
+ */
140
+ withConstructorCalldata(calldata: v1alpha2.IFieldElement[]): this;
141
+ encode(): v1alpha2.ITransactionFilter;
142
+ }
143
+ export declare class DeclareTransactionFilter implements IEncodableTransactionFilter {
144
+ private inner;
145
+ constructor();
146
+ /**
147
+ * Filter by sender address.
148
+ */
149
+ withSenderAddress(address: v1alpha2.IFieldElement): this;
150
+ /**
151
+ * Filter by class hash.
152
+ */
153
+ withClassHash(hash: v1alpha2.IFieldElement): this;
154
+ encode(): v1alpha2.ITransactionFilter;
155
+ }
156
+ export declare class L1HandlerTransactionFilter implements IEncodableTransactionFilter {
157
+ private inner;
158
+ constructor();
159
+ /**
160
+ * Filter by contract address.
161
+ */
162
+ withContractAddress(address: v1alpha2.IFieldElement): this;
163
+ /**
164
+ * Filter by entry point selector.
165
+ */
166
+ withEntryPointSelector(selector: v1alpha2.IFieldElement): this;
167
+ /**
168
+ * Filter by calldata prefix.
169
+ */
170
+ withCalldata(calldata: v1alpha2.IFieldElement[]): this;
171
+ encode(): v1alpha2.ITransactionFilter;
172
+ }
173
+ export declare class DeployAccountTransactionFilter implements IEncodableTransactionFilter {
174
+ private inner;
175
+ constructor();
176
+ /**
177
+ * Filter by contract address salt.
178
+ */
179
+ withContractAddressSalt(salt: v1alpha2.IFieldElement): this;
180
+ /**
181
+ * Filter by class hash.
182
+ */
183
+ withClassHash(hash: v1alpha2.IFieldElement): this;
184
+ /**
185
+ * Filter by constructor calldata prefix.
186
+ */
187
+ withConstructorCalldata(calldata: v1alpha2.IFieldElement[]): this;
188
+ encode(): v1alpha2.ITransactionFilter;
189
+ }
190
+ export declare class EventFilter implements IEncodable<v1alpha2.IEventFilter> {
191
+ private inner;
192
+ constructor();
193
+ /**
194
+ * Filter by address emitting the event.
195
+ */
196
+ withFromAddress(address: v1alpha2.IFieldElement): this;
197
+ /**
198
+ * Filter by keys prefix.
199
+ */
200
+ withKeys(keys: v1alpha2.IFieldElement[]): this;
201
+ /**
202
+ * Filter by data prefix.
203
+ */
204
+ withData(data: v1alpha2.IFieldElement[]): this;
205
+ encode(): v1alpha2.IEventFilter;
206
+ }
207
+ export declare class L2ToL1MessageFilter implements IEncodable<v1alpha2.IL2ToL1MessageFilter> {
208
+ private inner;
209
+ constructor();
210
+ /**
211
+ * Filter by destination address.
212
+ */
213
+ withToAddress(address: v1alpha2.IFieldElement): this;
214
+ /**
215
+ * Filter by payload prefix.
216
+ */
217
+ withPayload(payload: v1alpha2.IFieldElement[]): this;
218
+ encode(): v1alpha2.IL2ToL1MessageFilter;
219
+ }
220
+ export declare class StateUpdateFilter implements IEncodable<v1alpha2.IStateUpdateFilter> {
221
+ private inner;
222
+ constructor();
223
+ /**
224
+ * Includes all storage changes that match the filter.
225
+ */
226
+ addStorageDiff(filterOrBuilder: IEncodable<v1alpha2.IStorageDiffFilter> | ((builder: StorageDiffFilter) => IEncodable<v1alpha2.IStorageDiffFilter>)): this;
227
+ /**
228
+ * Includes all declared contracts that match the filter.
229
+ */
230
+ addDeclaredContract(filterOrBuilder: IEncodable<v1alpha2.IDeclaredContractFilter> | ((builder: DeclaredContractFilter) => IEncodable<v1alpha2.IDeclaredContractFilter>)): this;
231
+ /**
232
+ * Includes all deployed contracts that match the filter.
233
+ */
234
+ addDeployedContract(filterOrBuilder: IEncodable<v1alpha2.IDeployedContractFilter> | ((builder: DeployedContractFilter) => IEncodable<v1alpha2.IDeployedContractFilter>)): this;
235
+ /**
236
+ * Includes all nonce updates that match the filter.
237
+ */
238
+ addNonceUpdate(filterOrBuilder: IEncodable<v1alpha2.INonceUpdateFilter> | ((builder: NonceUpdateFilter) => IEncodable<v1alpha2.INonceUpdateFilter>)): this;
239
+ encode(): v1alpha2.IStateUpdateFilter;
240
+ }
241
+ export declare class StorageDiffFilter implements IEncodable<v1alpha2.IStorageDiffFilter> {
242
+ private inner;
243
+ constructor();
244
+ /**
245
+ * Filter by contract address.
246
+ */
247
+ withContractAddress(address: v1alpha2.IFieldElement): this;
248
+ encode(): v1alpha2.IStorageDiffFilter;
249
+ }
250
+ export declare class DeclaredContractFilter implements IEncodable<v1alpha2.IDeclaredContractFilter> {
251
+ private inner;
252
+ constructor();
253
+ /**
254
+ * Filter by class hash.
255
+ */
256
+ withClassHash(hash: v1alpha2.IFieldElement): this;
257
+ encode(): v1alpha2.IDeclaredContractFilter;
258
+ }
259
+ export declare class DeployedContractFilter implements IEncodable<v1alpha2.IDeployedContractFilter> {
260
+ private inner;
261
+ constructor();
262
+ /**
263
+ * Filter by contract address.
264
+ */
265
+ withContractAddress(address: v1alpha2.IFieldElement): this;
266
+ /**
267
+ * Filter by class hash.
268
+ */
269
+ withClassHash(hash: v1alpha2.IFieldElement): this;
270
+ encode(): v1alpha2.IDeployedContractFilter;
271
+ }
272
+ export declare class NonceUpdateFilter implements IEncodable<v1alpha2.INonceUpdateFilter> {
273
+ private inner;
274
+ constructor();
275
+ /**
276
+ * Filter by contract address.
277
+ */
278
+ withContractAddress(address: v1alpha2.IFieldElement): this;
279
+ /**
280
+ * Filter by nonce.
281
+ */
282
+ withNonce(nonce: v1alpha2.IFieldElement): this;
283
+ encode(): v1alpha2.INonceUpdateFilter;
284
+ }
285
+ export {};