@thru/thru-sdk 0.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 +7 -0
- package/buf.gen.yaml +12 -0
- package/buf.lock +9 -0
- package/buf.yaml +15 -0
- package/dist/sdk.d.ts +1354 -0
- package/dist/sdk.js +1130 -0
- package/dist/sdk.js.map +1 -0
- package/package.json +39 -0
- package/proto/thru/common/v1/consensus.proto +75 -0
- package/proto/thru/common/v1/errors.proto +67 -0
- package/proto/thru/common/v1/filters.proto +50 -0
- package/proto/thru/common/v1/pagination.proto +47 -0
- package/proto/thru/core/v1/account.proto +138 -0
- package/proto/thru/core/v1/block.proto +82 -0
- package/proto/thru/core/v1/state.proto +37 -0
- package/proto/thru/core/v1/transaction.proto +95 -0
- package/proto/thru/core/v1/types.proto +52 -0
- package/proto/thru/services/v1/command_service.proto +45 -0
- package/proto/thru/services/v1/query_service.proto +344 -0
- package/proto/thru/services/v1/streaming_service.proto +128 -0
- package/thru-ts-client-sdk/core/bound-client.ts +129 -0
- package/thru-ts-client-sdk/core/client.ts +38 -0
- package/thru-ts-client-sdk/counter.ts +216 -0
- package/thru-ts-client-sdk/create-account.ts +78 -0
- package/thru-ts-client-sdk/defaults.ts +17 -0
- package/thru-ts-client-sdk/get-height.ts +52 -0
- package/thru-ts-client-sdk/modules/accounts.ts +137 -0
- package/thru-ts-client-sdk/modules/blocks.ts +75 -0
- package/thru-ts-client-sdk/modules/events.ts +20 -0
- package/thru-ts-client-sdk/modules/height.ts +9 -0
- package/thru-ts-client-sdk/modules/helpers.ts +340 -0
- package/thru-ts-client-sdk/modules/proofs.ts +20 -0
- package/thru-ts-client-sdk/modules/streaming.ts +34 -0
- package/thru-ts-client-sdk/modules/transactions.ts +274 -0
- package/thru-ts-client-sdk/proto/buf/validate/validate_pb.ts +4761 -0
- package/thru-ts-client-sdk/proto/google/api/annotations_pb.ts +39 -0
- package/thru-ts-client-sdk/proto/google/api/client_pb.ts +953 -0
- package/thru-ts-client-sdk/proto/google/api/field_behavior_pb.ts +157 -0
- package/thru-ts-client-sdk/proto/google/api/http_pb.ts +474 -0
- package/thru-ts-client-sdk/proto/google/api/launch_stage_pb.ts +118 -0
- package/thru-ts-client-sdk/proto/thru/common/v1/consensus_pb.ts +163 -0
- package/thru-ts-client-sdk/proto/thru/common/v1/errors_pb.ts +130 -0
- package/thru-ts-client-sdk/proto/thru/common/v1/filters_pb.ts +81 -0
- package/thru-ts-client-sdk/proto/thru/common/v1/pagination_pb.ts +80 -0
- package/thru-ts-client-sdk/proto/thru/core/v1/account_pb.ts +358 -0
- package/thru-ts-client-sdk/proto/thru/core/v1/block_pb.ts +260 -0
- package/thru-ts-client-sdk/proto/thru/core/v1/state_pb.ts +104 -0
- package/thru-ts-client-sdk/proto/thru/core/v1/transaction_pb.ts +327 -0
- package/thru-ts-client-sdk/proto/thru/core/v1/types_pb.ts +101 -0
- package/thru-ts-client-sdk/proto/thru/services/v1/command_service_pb.ts +81 -0
- package/thru-ts-client-sdk/proto/thru/services/v1/query_service_pb.ts +813 -0
- package/thru-ts-client-sdk/proto/thru/services/v1/streaming_service_pb.ts +391 -0
- package/thru-ts-client-sdk/sdk.ts +58 -0
- package/thru-ts-client-sdk/transactions/Transaction.ts +240 -0
- package/thru-ts-client-sdk/transactions/TransactionBuilder.ts +48 -0
- package/thru-ts-client-sdk/transactions/__tests__/transaction.test.ts +95 -0
- package/thru-ts-client-sdk/transactions/index.ts +3 -0
- package/thru-ts-client-sdk/transactions/types.ts +64 -0
- package/thru-ts-client-sdk/transactions/utils.ts +134 -0
- package/thru-ts-client-sdk/types/types.ts +8 -0
- package/thru-ts-client-sdk/utils/utils.ts +70 -0
- package/tsconfig.json +9 -0
- package/tsup.config.ts +10 -0
package/dist/sdk.d.ts
ADDED
|
@@ -0,0 +1,1354 @@
|
|
|
1
|
+
import { createClient } from '@connectrpc/connect';
|
|
2
|
+
import { createGrpcWebTransport } from '@connectrpc/connect-web';
|
|
3
|
+
import { Timestamp } from '@bufbuild/protobuf/wkt';
|
|
4
|
+
import { Message } from '@bufbuild/protobuf';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Pubkey represents a 32-byte public key value.
|
|
8
|
+
*
|
|
9
|
+
* @generated from message thru.core.v1.Pubkey
|
|
10
|
+
*/
|
|
11
|
+
type Pubkey = Message<"thru.core.v1.Pubkey"> & {
|
|
12
|
+
/**
|
|
13
|
+
* 32-byte public key buffer.
|
|
14
|
+
*
|
|
15
|
+
* @generated from field: bytes value = 1;
|
|
16
|
+
*/
|
|
17
|
+
value: Uint8Array;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* BlockHash represents a 64-byte hash for block identifiers.
|
|
21
|
+
*
|
|
22
|
+
* @generated from message thru.core.v1.BlockHash
|
|
23
|
+
*/
|
|
24
|
+
type BlockHash = Message<"thru.core.v1.BlockHash"> & {
|
|
25
|
+
/**
|
|
26
|
+
* 64-byte block hash buffer.
|
|
27
|
+
*
|
|
28
|
+
* @generated from field: bytes value = 1;
|
|
29
|
+
*/
|
|
30
|
+
value: Uint8Array;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Signature represents a 64-byte signature value.
|
|
34
|
+
*
|
|
35
|
+
* @generated from message thru.core.v1.Signature
|
|
36
|
+
*/
|
|
37
|
+
type Signature = Message<"thru.core.v1.Signature"> & {
|
|
38
|
+
/**
|
|
39
|
+
* 64-byte signature buffer.
|
|
40
|
+
*
|
|
41
|
+
* @generated from field: bytes value = 1;
|
|
42
|
+
*/
|
|
43
|
+
value: Uint8Array;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* VersionContext selects which logical version of a resource should be
|
|
48
|
+
* returned. At least one field must be set.
|
|
49
|
+
*
|
|
50
|
+
* @generated from message thru.common.v1.VersionContext
|
|
51
|
+
*/
|
|
52
|
+
type VersionContext = Message<"thru.common.v1.VersionContext"> & {
|
|
53
|
+
/**
|
|
54
|
+
* Specifies the desired version semantics.
|
|
55
|
+
*
|
|
56
|
+
* @generated from oneof thru.common.v1.VersionContext.version
|
|
57
|
+
*/
|
|
58
|
+
version: {
|
|
59
|
+
/**
|
|
60
|
+
* Request the latest version available at request time.
|
|
61
|
+
*
|
|
62
|
+
* @generated from field: thru.common.v1.CurrentVersion current = 1;
|
|
63
|
+
*/
|
|
64
|
+
value: CurrentVersion;
|
|
65
|
+
case: "current";
|
|
66
|
+
} | {
|
|
67
|
+
/**
|
|
68
|
+
* Request the latest version, or historical on.
|
|
69
|
+
*
|
|
70
|
+
* @generated from field: thru.common.v1.CurrentOrHistoricalVersion currentOrHistorical = 2;
|
|
71
|
+
*/
|
|
72
|
+
value: CurrentOrHistoricalVersion;
|
|
73
|
+
case: "currentOrHistorical";
|
|
74
|
+
} | {
|
|
75
|
+
/**
|
|
76
|
+
* Request the version for a specific slot number.
|
|
77
|
+
*
|
|
78
|
+
* @generated from field: uint64 slot = 3;
|
|
79
|
+
*/
|
|
80
|
+
value: bigint;
|
|
81
|
+
case: "slot";
|
|
82
|
+
} | {
|
|
83
|
+
/**
|
|
84
|
+
* Request the version nearest to the provided block timestamp.
|
|
85
|
+
*
|
|
86
|
+
* @generated from field: google.protobuf.Timestamp timestamp = 4;
|
|
87
|
+
*/
|
|
88
|
+
value: Timestamp;
|
|
89
|
+
case: "timestamp";
|
|
90
|
+
} | {
|
|
91
|
+
case: undefined;
|
|
92
|
+
value?: undefined;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* CurrentVersion is an empty marker message for VersionContext.current.
|
|
97
|
+
*
|
|
98
|
+
* @generated from message thru.common.v1.CurrentVersion
|
|
99
|
+
*/
|
|
100
|
+
type CurrentVersion = Message<"thru.common.v1.CurrentVersion"> & {};
|
|
101
|
+
/**
|
|
102
|
+
* CurrentOrHistoricalVersion is an empty marker message for VersionContext.current.
|
|
103
|
+
*
|
|
104
|
+
* @generated from message thru.common.v1.CurrentOrHistoricalVersion
|
|
105
|
+
*/
|
|
106
|
+
type CurrentOrHistoricalVersion = Message<"thru.common.v1.CurrentOrHistoricalVersion"> & {};
|
|
107
|
+
/**
|
|
108
|
+
* ConsensusStatus represents the minimum consensus level a resource has
|
|
109
|
+
* achieved when returned by the service.
|
|
110
|
+
*
|
|
111
|
+
* @generated from enum thru.common.v1.ConsensusStatus
|
|
112
|
+
*/
|
|
113
|
+
declare enum ConsensusStatus {
|
|
114
|
+
/**
|
|
115
|
+
* CONSENSUS_STATUS_UNSPECIFIED indicates the consensus status is unknown.
|
|
116
|
+
*
|
|
117
|
+
* @generated from enum value: CONSENSUS_STATUS_UNSPECIFIED = 0;
|
|
118
|
+
*/
|
|
119
|
+
UNSPECIFIED = 0,
|
|
120
|
+
/**
|
|
121
|
+
* CONSENSUS_STATUS_OBSERVED indicates the resource has been observed but
|
|
122
|
+
* not yet confirmed in a finalized block.
|
|
123
|
+
*
|
|
124
|
+
* @generated from enum value: CONSENSUS_STATUS_OBSERVED = 1;
|
|
125
|
+
*/
|
|
126
|
+
OBSERVED = 1,
|
|
127
|
+
/**
|
|
128
|
+
* CONSENSUS_STATUS_INCLUDED indicates the resource has been included in the
|
|
129
|
+
* ledger but may not be finalized.
|
|
130
|
+
*
|
|
131
|
+
* @generated from enum value: CONSENSUS_STATUS_INCLUDED = 2;
|
|
132
|
+
*/
|
|
133
|
+
INCLUDED = 2,
|
|
134
|
+
/**
|
|
135
|
+
* CONSENSUS_STATUS_FINALIZED indicates the resource is finalized for a slot.
|
|
136
|
+
*
|
|
137
|
+
* @generated from enum value: CONSENSUS_STATUS_FINALIZED = 3;
|
|
138
|
+
*/
|
|
139
|
+
FINALIZED = 3,
|
|
140
|
+
/**
|
|
141
|
+
* CONSENSUS_STATUS_LOCALLY_EXECUTED indicates the local node executed the
|
|
142
|
+
* resource but broader cluster finality may not have been achieved.
|
|
143
|
+
*
|
|
144
|
+
* @generated from enum value: CONSENSUS_STATUS_LOCALLY_EXECUTED = 4;
|
|
145
|
+
*/
|
|
146
|
+
LOCALLY_EXECUTED = 4,
|
|
147
|
+
/**
|
|
148
|
+
* CONSENSUS_STATUS_CLUSTER_EXECUTED indicates the entire cluster has
|
|
149
|
+
* executed and agreed on the resource.
|
|
150
|
+
*
|
|
151
|
+
* @generated from enum value: CONSENSUS_STATUS_CLUSTER_EXECUTED = 5;
|
|
152
|
+
*/
|
|
153
|
+
CLUSTER_EXECUTED = 5
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Filter represents a CEL-based expression applied to query or stream results.
|
|
158
|
+
*
|
|
159
|
+
* @generated from message thru.common.v1.Filter
|
|
160
|
+
*/
|
|
161
|
+
type Filter = Message<"thru.common.v1.Filter"> & {
|
|
162
|
+
/**
|
|
163
|
+
* CEL expression applied server-side. Empty expressions are treated as no-op.
|
|
164
|
+
*
|
|
165
|
+
* @generated from field: string expression = 1;
|
|
166
|
+
*/
|
|
167
|
+
expression: string;
|
|
168
|
+
/**
|
|
169
|
+
* Named parameter bindings for expression parameterization.
|
|
170
|
+
*
|
|
171
|
+
* @generated from field: map<string, string> params = 2;
|
|
172
|
+
*/
|
|
173
|
+
params: {
|
|
174
|
+
[key: string]: string;
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* PageRequest contains pagination parameters for listing RPCs.
|
|
180
|
+
*
|
|
181
|
+
* @generated from message thru.common.v1.PageRequest
|
|
182
|
+
*/
|
|
183
|
+
type PageRequest = Message<"thru.common.v1.PageRequest"> & {
|
|
184
|
+
/**
|
|
185
|
+
* Maximum number of items to return in a single response.
|
|
186
|
+
*
|
|
187
|
+
* @generated from field: uint32 page_size = 1;
|
|
188
|
+
*/
|
|
189
|
+
pageSize: number;
|
|
190
|
+
/**
|
|
191
|
+
* Token identifying the position to resume from.
|
|
192
|
+
*
|
|
193
|
+
* @generated from field: string page_token = 2;
|
|
194
|
+
*/
|
|
195
|
+
pageToken: string;
|
|
196
|
+
/**
|
|
197
|
+
* Optional ordering specification in "field [asc|desc]" form.
|
|
198
|
+
*
|
|
199
|
+
* @generated from field: string order_by = 3;
|
|
200
|
+
*/
|
|
201
|
+
orderBy: string;
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* PageResponse captures pagination metadata returned with list results.
|
|
205
|
+
*
|
|
206
|
+
* @generated from message thru.common.v1.PageResponse
|
|
207
|
+
*/
|
|
208
|
+
type PageResponse = Message<"thru.common.v1.PageResponse"> & {
|
|
209
|
+
/**
|
|
210
|
+
* Token to retrieve the next page of results, if any.
|
|
211
|
+
*
|
|
212
|
+
* @generated from field: string next_page_token = 1;
|
|
213
|
+
*/
|
|
214
|
+
nextPageToken: string;
|
|
215
|
+
/**
|
|
216
|
+
* Total number of items available when known.
|
|
217
|
+
*
|
|
218
|
+
* @generated from field: uint64 total_size = 2;
|
|
219
|
+
*/
|
|
220
|
+
totalSize: bigint;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* AccountFlags enumerates boolean account capability flags.
|
|
225
|
+
*
|
|
226
|
+
* @generated from message thru.core.v1.AccountFlags
|
|
227
|
+
*/
|
|
228
|
+
type AccountFlags = Message<"thru.core.v1.AccountFlags"> & {
|
|
229
|
+
/**
|
|
230
|
+
* @generated from field: bool is_program = 1;
|
|
231
|
+
*/
|
|
232
|
+
isProgram: boolean;
|
|
233
|
+
/**
|
|
234
|
+
* @generated from field: bool is_privileged = 2;
|
|
235
|
+
*/
|
|
236
|
+
isPrivileged: boolean;
|
|
237
|
+
/**
|
|
238
|
+
* @generated from field: bool is_uncompressable = 3;
|
|
239
|
+
*/
|
|
240
|
+
isUncompressable: boolean;
|
|
241
|
+
/**
|
|
242
|
+
* @generated from field: bool is_ephemeral = 4;
|
|
243
|
+
*/
|
|
244
|
+
isEphemeral: boolean;
|
|
245
|
+
/**
|
|
246
|
+
* @generated from field: bool is_deleted = 5;
|
|
247
|
+
*/
|
|
248
|
+
isDeleted: boolean;
|
|
249
|
+
/**
|
|
250
|
+
* @generated from field: bool is_new = 6;
|
|
251
|
+
*/
|
|
252
|
+
isNew: boolean;
|
|
253
|
+
/**
|
|
254
|
+
* @generated from field: bool is_compressed = 7;
|
|
255
|
+
*/
|
|
256
|
+
isCompressed: boolean;
|
|
257
|
+
};
|
|
258
|
+
/**
|
|
259
|
+
* AccountMeta captures metadata associated with an account.
|
|
260
|
+
*
|
|
261
|
+
* @generated from message thru.core.v1.AccountMeta
|
|
262
|
+
*/
|
|
263
|
+
type AccountMeta = Message<"thru.core.v1.AccountMeta"> & {
|
|
264
|
+
/**
|
|
265
|
+
* @generated from field: uint32 version = 1;
|
|
266
|
+
*/
|
|
267
|
+
version: number;
|
|
268
|
+
/**
|
|
269
|
+
* @generated from field: thru.core.v1.AccountFlags flags = 2;
|
|
270
|
+
*/
|
|
271
|
+
flags?: AccountFlags;
|
|
272
|
+
/**
|
|
273
|
+
* @generated from field: uint32 data_size = 3;
|
|
274
|
+
*/
|
|
275
|
+
dataSize: number;
|
|
276
|
+
/**
|
|
277
|
+
* @generated from field: uint64 state_counter = 4;
|
|
278
|
+
*/
|
|
279
|
+
stateCounter: bigint;
|
|
280
|
+
/**
|
|
281
|
+
* @generated from field: thru.core.v1.Pubkey owner = 5;
|
|
282
|
+
*/
|
|
283
|
+
owner?: Pubkey;
|
|
284
|
+
/**
|
|
285
|
+
* @generated from field: uint64 balance = 6;
|
|
286
|
+
*/
|
|
287
|
+
balance: bigint;
|
|
288
|
+
/**
|
|
289
|
+
* @generated from field: uint64 nonce = 7;
|
|
290
|
+
*/
|
|
291
|
+
nonce: bigint;
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* AccountData contains account data payloads.
|
|
295
|
+
*
|
|
296
|
+
* @generated from message thru.core.v1.AccountData
|
|
297
|
+
*/
|
|
298
|
+
type AccountData = Message<"thru.core.v1.AccountData"> & {
|
|
299
|
+
/**
|
|
300
|
+
* @generated from field: bytes data = 1;
|
|
301
|
+
*/
|
|
302
|
+
data: Uint8Array;
|
|
303
|
+
/**
|
|
304
|
+
* @generated from field: bool compressed = 2;
|
|
305
|
+
*/
|
|
306
|
+
compressed: boolean;
|
|
307
|
+
/**
|
|
308
|
+
* @generated from field: string compression_algorithm = 3;
|
|
309
|
+
*/
|
|
310
|
+
compressionAlgorithm: string;
|
|
311
|
+
};
|
|
312
|
+
/**
|
|
313
|
+
* DataSlice describes a contiguous range of account data to return.
|
|
314
|
+
*
|
|
315
|
+
* @generated from message thru.core.v1.DataSlice
|
|
316
|
+
*/
|
|
317
|
+
type DataSlice = Message<"thru.core.v1.DataSlice"> & {
|
|
318
|
+
/**
|
|
319
|
+
* @generated from field: uint32 offset = 1;
|
|
320
|
+
*/
|
|
321
|
+
offset: number;
|
|
322
|
+
/**
|
|
323
|
+
* @generated from field: uint32 length = 2;
|
|
324
|
+
*/
|
|
325
|
+
length: number;
|
|
326
|
+
};
|
|
327
|
+
/**
|
|
328
|
+
* VersionContextMetadata captures context for a returned account state.
|
|
329
|
+
*
|
|
330
|
+
* @generated from message thru.core.v1.VersionContextMetadata
|
|
331
|
+
*/
|
|
332
|
+
type VersionContextMetadata = Message<"thru.core.v1.VersionContextMetadata"> & {
|
|
333
|
+
/**
|
|
334
|
+
* @generated from field: uint64 slot = 1;
|
|
335
|
+
*/
|
|
336
|
+
slot: bigint;
|
|
337
|
+
/**
|
|
338
|
+
* @generated from field: google.protobuf.Timestamp block_timestamp = 2;
|
|
339
|
+
*/
|
|
340
|
+
blockTimestamp?: Timestamp;
|
|
341
|
+
};
|
|
342
|
+
/**
|
|
343
|
+
* Account models a fully decoded account resource.
|
|
344
|
+
*
|
|
345
|
+
* @generated from message thru.core.v1.Account
|
|
346
|
+
*/
|
|
347
|
+
type Account = Message<"thru.core.v1.Account"> & {
|
|
348
|
+
/**
|
|
349
|
+
* @generated from field: thru.core.v1.Pubkey address = 1;
|
|
350
|
+
*/
|
|
351
|
+
address?: Pubkey;
|
|
352
|
+
/**
|
|
353
|
+
* @generated from field: thru.core.v1.AccountMeta meta = 2;
|
|
354
|
+
*/
|
|
355
|
+
meta?: AccountMeta;
|
|
356
|
+
/**
|
|
357
|
+
* @generated from field: thru.core.v1.AccountData data = 3;
|
|
358
|
+
*/
|
|
359
|
+
data?: AccountData;
|
|
360
|
+
/**
|
|
361
|
+
* @generated from field: thru.core.v1.VersionContextMetadata version_context = 4;
|
|
362
|
+
*/
|
|
363
|
+
versionContext?: VersionContextMetadata;
|
|
364
|
+
/**
|
|
365
|
+
* @generated from field: thru.common.v1.ConsensusStatus consensus_status = 5;
|
|
366
|
+
*/
|
|
367
|
+
consensusStatus: ConsensusStatus;
|
|
368
|
+
};
|
|
369
|
+
/**
|
|
370
|
+
* RawAccount captures raw serialized account bytes.
|
|
371
|
+
*
|
|
372
|
+
* @generated from message thru.core.v1.RawAccount
|
|
373
|
+
*/
|
|
374
|
+
type RawAccount = Message<"thru.core.v1.RawAccount"> & {
|
|
375
|
+
/**
|
|
376
|
+
* @generated from field: thru.core.v1.Pubkey address = 1;
|
|
377
|
+
*/
|
|
378
|
+
address?: Pubkey;
|
|
379
|
+
/**
|
|
380
|
+
* @generated from field: bytes raw_meta = 2;
|
|
381
|
+
*/
|
|
382
|
+
rawMeta: Uint8Array;
|
|
383
|
+
/**
|
|
384
|
+
* @generated from field: bytes raw_data = 3;
|
|
385
|
+
*/
|
|
386
|
+
rawData: Uint8Array;
|
|
387
|
+
/**
|
|
388
|
+
* @generated from field: thru.core.v1.VersionContextMetadata version_context = 4;
|
|
389
|
+
*/
|
|
390
|
+
versionContext?: VersionContextMetadata;
|
|
391
|
+
};
|
|
392
|
+
/**
|
|
393
|
+
* AccountView controls which sections of account resources are returned.
|
|
394
|
+
*
|
|
395
|
+
* @generated from enum thru.core.v1.AccountView
|
|
396
|
+
*/
|
|
397
|
+
declare enum AccountView {
|
|
398
|
+
/**
|
|
399
|
+
* ACCOUNT_VIEW_UNSPECIFIED uses service defaults.
|
|
400
|
+
*
|
|
401
|
+
* @generated from enum value: ACCOUNT_VIEW_UNSPECIFIED = 0;
|
|
402
|
+
*/
|
|
403
|
+
UNSPECIFIED = 0,
|
|
404
|
+
/**
|
|
405
|
+
* ACCOUNT_VIEW_PUBKEY_ONLY returns only the account address.
|
|
406
|
+
*
|
|
407
|
+
* @generated from enum value: ACCOUNT_VIEW_PUBKEY_ONLY = 1;
|
|
408
|
+
*/
|
|
409
|
+
PUBKEY_ONLY = 1,
|
|
410
|
+
/**
|
|
411
|
+
* ACCOUNT_VIEW_META_ONLY returns only account metadata.
|
|
412
|
+
*
|
|
413
|
+
* @generated from enum value: ACCOUNT_VIEW_META_ONLY = 2;
|
|
414
|
+
*/
|
|
415
|
+
META_ONLY = 2,
|
|
416
|
+
/**
|
|
417
|
+
* ACCOUNT_VIEW_DATA_ONLY returns only account data.
|
|
418
|
+
*
|
|
419
|
+
* @generated from enum value: ACCOUNT_VIEW_DATA_ONLY = 3;
|
|
420
|
+
*/
|
|
421
|
+
DATA_ONLY = 3,
|
|
422
|
+
/**
|
|
423
|
+
* ACCOUNT_VIEW_FULL returns address, metadata, and data.
|
|
424
|
+
*
|
|
425
|
+
* @generated from enum value: ACCOUNT_VIEW_FULL = 4;
|
|
426
|
+
*/
|
|
427
|
+
FULL = 4
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
/**
|
|
431
|
+
* BlockHeader describes metadata about a block.
|
|
432
|
+
*
|
|
433
|
+
* @generated from message thru.core.v1.BlockHeader
|
|
434
|
+
*/
|
|
435
|
+
type BlockHeader = Message<"thru.core.v1.BlockHeader"> & {
|
|
436
|
+
/**
|
|
437
|
+
* @generated from field: uint64 slot = 1;
|
|
438
|
+
*/
|
|
439
|
+
slot: bigint;
|
|
440
|
+
/**
|
|
441
|
+
* @generated from field: thru.core.v1.BlockHash block_hash = 2;
|
|
442
|
+
*/
|
|
443
|
+
blockHash?: BlockHash;
|
|
444
|
+
/**
|
|
445
|
+
* @generated from field: thru.core.v1.Signature header_signature = 3;
|
|
446
|
+
*/
|
|
447
|
+
headerSignature?: Signature;
|
|
448
|
+
/**
|
|
449
|
+
* @generated from field: uint32 version = 4;
|
|
450
|
+
*/
|
|
451
|
+
version: number;
|
|
452
|
+
/**
|
|
453
|
+
* @generated from field: thru.core.v1.Pubkey producer = 5;
|
|
454
|
+
*/
|
|
455
|
+
producer?: Pubkey;
|
|
456
|
+
/**
|
|
457
|
+
* @generated from field: google.protobuf.Timestamp expiry_timestamp = 6;
|
|
458
|
+
*/
|
|
459
|
+
expiryTimestamp?: Timestamp;
|
|
460
|
+
/**
|
|
461
|
+
* @generated from field: uint64 start_slot = 7;
|
|
462
|
+
*/
|
|
463
|
+
startSlot: bigint;
|
|
464
|
+
/**
|
|
465
|
+
* @generated from field: uint32 expiry_after = 8;
|
|
466
|
+
*/
|
|
467
|
+
expiryAfter: number;
|
|
468
|
+
/**
|
|
469
|
+
* @generated from field: uint32 max_block_size = 9;
|
|
470
|
+
*/
|
|
471
|
+
maxBlockSize: number;
|
|
472
|
+
/**
|
|
473
|
+
* @generated from field: uint64 max_compute_units = 10;
|
|
474
|
+
*/
|
|
475
|
+
maxComputeUnits: bigint;
|
|
476
|
+
/**
|
|
477
|
+
* @generated from field: uint32 max_state_units = 11;
|
|
478
|
+
*/
|
|
479
|
+
maxStateUnits: number;
|
|
480
|
+
/**
|
|
481
|
+
* @generated from field: uint64 price = 12;
|
|
482
|
+
*/
|
|
483
|
+
price: bigint;
|
|
484
|
+
};
|
|
485
|
+
/**
|
|
486
|
+
* BlockFooter captures execution result metadata for a block.
|
|
487
|
+
*
|
|
488
|
+
* @generated from message thru.core.v1.BlockFooter
|
|
489
|
+
*/
|
|
490
|
+
type BlockFooter = Message<"thru.core.v1.BlockFooter"> & {
|
|
491
|
+
/**
|
|
492
|
+
* @generated from field: thru.core.v1.Signature signature = 1;
|
|
493
|
+
*/
|
|
494
|
+
signature?: Signature;
|
|
495
|
+
/**
|
|
496
|
+
* @generated from field: thru.core.v1.ExecutionStatus status = 2;
|
|
497
|
+
*/
|
|
498
|
+
status: ExecutionStatus;
|
|
499
|
+
/**
|
|
500
|
+
* @generated from field: uint64 consumed_compute_units = 3;
|
|
501
|
+
*/
|
|
502
|
+
consumedComputeUnits: bigint;
|
|
503
|
+
/**
|
|
504
|
+
* @generated from field: uint32 consumed_state_units = 4;
|
|
505
|
+
*/
|
|
506
|
+
consumedStateUnits: number;
|
|
507
|
+
};
|
|
508
|
+
/**
|
|
509
|
+
* Block represents a fully decoded block resource.
|
|
510
|
+
*
|
|
511
|
+
* @generated from message thru.core.v1.Block
|
|
512
|
+
*/
|
|
513
|
+
type Block = Message<"thru.core.v1.Block"> & {
|
|
514
|
+
/**
|
|
515
|
+
* @generated from field: thru.core.v1.BlockHeader header = 1;
|
|
516
|
+
*/
|
|
517
|
+
header?: BlockHeader;
|
|
518
|
+
/**
|
|
519
|
+
* @generated from field: thru.core.v1.BlockFooter footer = 2;
|
|
520
|
+
*/
|
|
521
|
+
footer?: BlockFooter;
|
|
522
|
+
/**
|
|
523
|
+
* @generated from field: bytes body = 3;
|
|
524
|
+
*/
|
|
525
|
+
body: Uint8Array;
|
|
526
|
+
/**
|
|
527
|
+
* @generated from field: thru.common.v1.ConsensusStatus consensus_status = 4;
|
|
528
|
+
*/
|
|
529
|
+
consensusStatus: ConsensusStatus;
|
|
530
|
+
};
|
|
531
|
+
/**
|
|
532
|
+
* RawBlock captures raw block bytes for direct access.
|
|
533
|
+
*
|
|
534
|
+
* @generated from message thru.core.v1.RawBlock
|
|
535
|
+
*/
|
|
536
|
+
type RawBlock = Message<"thru.core.v1.RawBlock"> & {
|
|
537
|
+
/**
|
|
538
|
+
* @generated from field: uint64 slot = 1;
|
|
539
|
+
*/
|
|
540
|
+
slot: bigint;
|
|
541
|
+
/**
|
|
542
|
+
* @generated from field: bytes raw_block = 2;
|
|
543
|
+
*/
|
|
544
|
+
rawBlock: Uint8Array;
|
|
545
|
+
};
|
|
546
|
+
/**
|
|
547
|
+
* BlockView controls how much of a block resource is returned.
|
|
548
|
+
*
|
|
549
|
+
* @generated from enum thru.core.v1.BlockView
|
|
550
|
+
*/
|
|
551
|
+
declare enum BlockView {
|
|
552
|
+
/**
|
|
553
|
+
* @generated from enum value: BLOCK_VIEW_UNSPECIFIED = 0;
|
|
554
|
+
*/
|
|
555
|
+
UNSPECIFIED = 0,
|
|
556
|
+
/**
|
|
557
|
+
* @generated from enum value: BLOCK_VIEW_HEADER_ONLY = 1;
|
|
558
|
+
*/
|
|
559
|
+
HEADER_ONLY = 1,
|
|
560
|
+
/**
|
|
561
|
+
* @generated from enum value: BLOCK_VIEW_HEADER_AND_FOOTER = 2;
|
|
562
|
+
*/
|
|
563
|
+
HEADER_AND_FOOTER = 2,
|
|
564
|
+
/**
|
|
565
|
+
* @generated from enum value: BLOCK_VIEW_BODY_ONLY = 3;
|
|
566
|
+
*/
|
|
567
|
+
BODY_ONLY = 3,
|
|
568
|
+
/**
|
|
569
|
+
* @generated from enum value: BLOCK_VIEW_FULL = 4;
|
|
570
|
+
*/
|
|
571
|
+
FULL = 4
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* ExecutionStatus enumerates block execution results.
|
|
575
|
+
*
|
|
576
|
+
* @generated from enum thru.core.v1.ExecutionStatus
|
|
577
|
+
*/
|
|
578
|
+
declare enum ExecutionStatus {
|
|
579
|
+
/**
|
|
580
|
+
* @generated from enum value: EXECUTION_STATUS_UNSPECIFIED = 0;
|
|
581
|
+
*/
|
|
582
|
+
UNSPECIFIED = 0,
|
|
583
|
+
/**
|
|
584
|
+
* @generated from enum value: EXECUTION_STATUS_PENDING = 1;
|
|
585
|
+
*/
|
|
586
|
+
PENDING = 1,
|
|
587
|
+
/**
|
|
588
|
+
* @generated from enum value: EXECUTION_STATUS_EXECUTED = 2;
|
|
589
|
+
*/
|
|
590
|
+
EXECUTED = 2,
|
|
591
|
+
/**
|
|
592
|
+
* @generated from enum value: EXECUTION_STATUS_FAILED = 3;
|
|
593
|
+
*/
|
|
594
|
+
FAILED = 3
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* StateProof returns binary proof data along with context.
|
|
599
|
+
*
|
|
600
|
+
* @generated from message thru.core.v1.StateProof
|
|
601
|
+
*/
|
|
602
|
+
type StateProof = Message<"thru.core.v1.StateProof"> & {
|
|
603
|
+
/**
|
|
604
|
+
* @generated from field: bytes proof = 1;
|
|
605
|
+
*/
|
|
606
|
+
proof: Uint8Array;
|
|
607
|
+
/**
|
|
608
|
+
* @generated from field: uint64 slot = 2;
|
|
609
|
+
*/
|
|
610
|
+
slot: bigint;
|
|
611
|
+
};
|
|
612
|
+
/**
|
|
613
|
+
* StateProofType selects the type of state proof to generate.
|
|
614
|
+
*
|
|
615
|
+
* @generated from enum thru.core.v1.StateProofType
|
|
616
|
+
*/
|
|
617
|
+
declare enum StateProofType {
|
|
618
|
+
/**
|
|
619
|
+
* @generated from enum value: STATE_PROOF_TYPE_UNSPECIFIED = 0;
|
|
620
|
+
*/
|
|
621
|
+
UNSPECIFIED = 0,
|
|
622
|
+
/**
|
|
623
|
+
* @generated from enum value: STATE_PROOF_TYPE_CREATING = 1;
|
|
624
|
+
*/
|
|
625
|
+
CREATING = 1,
|
|
626
|
+
/**
|
|
627
|
+
* @generated from enum value: STATE_PROOF_TYPE_UPDATING = 2;
|
|
628
|
+
*/
|
|
629
|
+
UPDATING = 2,
|
|
630
|
+
/**
|
|
631
|
+
* @generated from enum value: STATE_PROOF_TYPE_EXISTING = 3;
|
|
632
|
+
*/
|
|
633
|
+
EXISTING = 3
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* TransactionHeader carries structured metadata for a transaction.
|
|
638
|
+
*
|
|
639
|
+
* @generated from message thru.core.v1.TransactionHeader
|
|
640
|
+
*/
|
|
641
|
+
type TransactionHeader = Message<"thru.core.v1.TransactionHeader"> & {
|
|
642
|
+
/**
|
|
643
|
+
* @generated from field: thru.core.v1.Signature fee_payer_signature = 1;
|
|
644
|
+
*/
|
|
645
|
+
feePayerSignature?: Signature;
|
|
646
|
+
/**
|
|
647
|
+
* @generated from field: uint32 version = 2;
|
|
648
|
+
*/
|
|
649
|
+
version: number;
|
|
650
|
+
/**
|
|
651
|
+
* @generated from field: uint32 flags = 3;
|
|
652
|
+
*/
|
|
653
|
+
flags: number;
|
|
654
|
+
/**
|
|
655
|
+
* @generated from field: uint32 readwrite_accounts_count = 4;
|
|
656
|
+
*/
|
|
657
|
+
readwriteAccountsCount: number;
|
|
658
|
+
/**
|
|
659
|
+
* @generated from field: uint32 readonly_accounts_count = 5;
|
|
660
|
+
*/
|
|
661
|
+
readonlyAccountsCount: number;
|
|
662
|
+
/**
|
|
663
|
+
* @generated from field: uint32 instruction_data_size = 6;
|
|
664
|
+
*/
|
|
665
|
+
instructionDataSize: number;
|
|
666
|
+
/**
|
|
667
|
+
* @generated from field: uint32 requested_compute_units = 7;
|
|
668
|
+
*/
|
|
669
|
+
requestedComputeUnits: number;
|
|
670
|
+
/**
|
|
671
|
+
* @generated from field: uint32 requested_state_units = 8;
|
|
672
|
+
*/
|
|
673
|
+
requestedStateUnits: number;
|
|
674
|
+
/**
|
|
675
|
+
* @generated from field: uint32 requested_memory_units = 9;
|
|
676
|
+
*/
|
|
677
|
+
requestedMemoryUnits: number;
|
|
678
|
+
/**
|
|
679
|
+
* @generated from field: uint32 expiry_after = 10;
|
|
680
|
+
*/
|
|
681
|
+
expiryAfter: number;
|
|
682
|
+
/**
|
|
683
|
+
* @generated from field: uint64 fee = 11;
|
|
684
|
+
*/
|
|
685
|
+
fee: bigint;
|
|
686
|
+
/**
|
|
687
|
+
* @generated from field: uint64 nonce = 12;
|
|
688
|
+
*/
|
|
689
|
+
nonce: bigint;
|
|
690
|
+
/**
|
|
691
|
+
* @generated from field: uint64 start_slot = 13;
|
|
692
|
+
*/
|
|
693
|
+
startSlot: bigint;
|
|
694
|
+
/**
|
|
695
|
+
* @generated from field: thru.core.v1.Pubkey fee_payer_pubkey = 14;
|
|
696
|
+
*/
|
|
697
|
+
feePayerPubkey?: Pubkey;
|
|
698
|
+
/**
|
|
699
|
+
* @generated from field: thru.core.v1.Pubkey program_pubkey = 15;
|
|
700
|
+
*/
|
|
701
|
+
programPubkey?: Pubkey;
|
|
702
|
+
};
|
|
703
|
+
/**
|
|
704
|
+
* TransactionExecutionResult captures execution outcomes.
|
|
705
|
+
*
|
|
706
|
+
* @generated from message thru.core.v1.TransactionExecutionResult
|
|
707
|
+
*/
|
|
708
|
+
type TransactionExecutionResult = Message<"thru.core.v1.TransactionExecutionResult"> & {
|
|
709
|
+
/**
|
|
710
|
+
* @generated from field: uint32 consumed_compute_units = 1;
|
|
711
|
+
*/
|
|
712
|
+
consumedComputeUnits: number;
|
|
713
|
+
/**
|
|
714
|
+
* @generated from field: uint32 consumed_memory_units = 2;
|
|
715
|
+
*/
|
|
716
|
+
consumedMemoryUnits: number;
|
|
717
|
+
/**
|
|
718
|
+
* @generated from field: uint32 consumed_state_units = 3;
|
|
719
|
+
*/
|
|
720
|
+
consumedStateUnits: number;
|
|
721
|
+
/**
|
|
722
|
+
* @generated from field: uint64 user_error_code = 4;
|
|
723
|
+
*/
|
|
724
|
+
userErrorCode: bigint;
|
|
725
|
+
/**
|
|
726
|
+
* @generated from field: uint32 vm_error = 5;
|
|
727
|
+
*/
|
|
728
|
+
vmError: number;
|
|
729
|
+
/**
|
|
730
|
+
* @generated from field: uint64 execution_result = 6;
|
|
731
|
+
*/
|
|
732
|
+
executionResult: bigint;
|
|
733
|
+
/**
|
|
734
|
+
* @generated from field: uint32 pages_used = 7;
|
|
735
|
+
*/
|
|
736
|
+
pagesUsed: number;
|
|
737
|
+
/**
|
|
738
|
+
* @generated from field: uint32 events_count = 8;
|
|
739
|
+
*/
|
|
740
|
+
eventsCount: number;
|
|
741
|
+
/**
|
|
742
|
+
* @generated from field: uint32 events_size = 9;
|
|
743
|
+
*/
|
|
744
|
+
eventsSize: number;
|
|
745
|
+
/**
|
|
746
|
+
* @generated from field: repeated thru.core.v1.Pubkey readwrite_accounts = 10;
|
|
747
|
+
*/
|
|
748
|
+
readwriteAccounts: Pubkey[];
|
|
749
|
+
/**
|
|
750
|
+
* @generated from field: repeated thru.core.v1.Pubkey readonly_accounts = 11;
|
|
751
|
+
*/
|
|
752
|
+
readonlyAccounts: Pubkey[];
|
|
753
|
+
/**
|
|
754
|
+
* @generated from field: repeated thru.core.v1.TransactionEvent events = 12;
|
|
755
|
+
*/
|
|
756
|
+
events: TransactionEvent[];
|
|
757
|
+
};
|
|
758
|
+
/**
|
|
759
|
+
* TransactionEvent describes an event emitted during transaction execution.
|
|
760
|
+
*
|
|
761
|
+
* @generated from message thru.core.v1.TransactionEvent
|
|
762
|
+
*/
|
|
763
|
+
type TransactionEvent = Message<"thru.core.v1.TransactionEvent"> & {
|
|
764
|
+
/**
|
|
765
|
+
* @generated from field: string event_id = 1;
|
|
766
|
+
*/
|
|
767
|
+
eventId: string;
|
|
768
|
+
/**
|
|
769
|
+
* @generated from field: uint32 call_idx = 2;
|
|
770
|
+
*/
|
|
771
|
+
callIdx: number;
|
|
772
|
+
/**
|
|
773
|
+
* @generated from field: uint32 program_idx = 3;
|
|
774
|
+
*/
|
|
775
|
+
programIdx: number;
|
|
776
|
+
/**
|
|
777
|
+
* @generated from field: thru.core.v1.Pubkey program = 4;
|
|
778
|
+
*/
|
|
779
|
+
program?: Pubkey;
|
|
780
|
+
/**
|
|
781
|
+
* @generated from field: bytes payload = 5;
|
|
782
|
+
*/
|
|
783
|
+
payload: Uint8Array;
|
|
784
|
+
};
|
|
785
|
+
/**
|
|
786
|
+
* Transaction describes a fully decoded transaction resource.
|
|
787
|
+
*
|
|
788
|
+
* @generated from message thru.core.v1.Transaction
|
|
789
|
+
*/
|
|
790
|
+
type Transaction$1 = Message<"thru.core.v1.Transaction"> & {
|
|
791
|
+
/**
|
|
792
|
+
* @generated from field: thru.core.v1.Signature signature = 1;
|
|
793
|
+
*/
|
|
794
|
+
signature?: Signature;
|
|
795
|
+
/**
|
|
796
|
+
* @generated from field: thru.core.v1.TransactionHeader header = 2;
|
|
797
|
+
*/
|
|
798
|
+
header?: TransactionHeader;
|
|
799
|
+
/**
|
|
800
|
+
* @generated from field: bytes body = 3;
|
|
801
|
+
*/
|
|
802
|
+
body: Uint8Array;
|
|
803
|
+
/**
|
|
804
|
+
* @generated from field: thru.core.v1.TransactionExecutionResult execution_result = 4;
|
|
805
|
+
*/
|
|
806
|
+
executionResult?: TransactionExecutionResult;
|
|
807
|
+
/**
|
|
808
|
+
* @generated from field: uint64 slot = 5;
|
|
809
|
+
*/
|
|
810
|
+
slot: bigint;
|
|
811
|
+
/**
|
|
812
|
+
* @generated from field: uint32 block_offset = 6;
|
|
813
|
+
*/
|
|
814
|
+
blockOffset: number;
|
|
815
|
+
};
|
|
816
|
+
/**
|
|
817
|
+
* RawTransaction provides direct access to serialized transaction bytes.
|
|
818
|
+
*
|
|
819
|
+
* @generated from message thru.core.v1.RawTransaction
|
|
820
|
+
*/
|
|
821
|
+
type RawTransaction = Message<"thru.core.v1.RawTransaction"> & {
|
|
822
|
+
/**
|
|
823
|
+
* @generated from field: thru.core.v1.Signature signature = 1;
|
|
824
|
+
*/
|
|
825
|
+
signature?: Signature;
|
|
826
|
+
/**
|
|
827
|
+
* @generated from field: bytes raw_transaction = 2;
|
|
828
|
+
*/
|
|
829
|
+
rawTransaction: Uint8Array;
|
|
830
|
+
};
|
|
831
|
+
/**
|
|
832
|
+
* TransactionView controls how transactions are materialized in responses.
|
|
833
|
+
*
|
|
834
|
+
* @generated from enum thru.core.v1.TransactionView
|
|
835
|
+
*/
|
|
836
|
+
declare enum TransactionView {
|
|
837
|
+
/**
|
|
838
|
+
* @generated from enum value: TRANSACTION_VIEW_UNSPECIFIED = 0;
|
|
839
|
+
*/
|
|
840
|
+
UNSPECIFIED = 0,
|
|
841
|
+
/**
|
|
842
|
+
* @generated from enum value: TRANSACTION_VIEW_SIGNATURE_ONLY = 1;
|
|
843
|
+
*/
|
|
844
|
+
SIGNATURE_ONLY = 1,
|
|
845
|
+
/**
|
|
846
|
+
* @generated from enum value: TRANSACTION_VIEW_HEADER_ONLY = 2;
|
|
847
|
+
*/
|
|
848
|
+
HEADER_ONLY = 2,
|
|
849
|
+
/**
|
|
850
|
+
* @generated from enum value: TRANSACTION_VIEW_HEADER_AND_BODY = 3;
|
|
851
|
+
*/
|
|
852
|
+
HEADER_AND_BODY = 3,
|
|
853
|
+
/**
|
|
854
|
+
* @generated from enum value: TRANSACTION_VIEW_FULL = 4;
|
|
855
|
+
*/
|
|
856
|
+
FULL = 4
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
* GenerateStateProofResponse contains the generated proof.
|
|
861
|
+
*
|
|
862
|
+
* @generated from message thru.services.v1.GenerateStateProofResponse
|
|
863
|
+
*/
|
|
864
|
+
type GenerateStateProofResponse = Message<"thru.services.v1.GenerateStateProofResponse"> & {
|
|
865
|
+
/**
|
|
866
|
+
* @generated from field: thru.core.v1.StateProof proof = 1;
|
|
867
|
+
*/
|
|
868
|
+
proof?: StateProof;
|
|
869
|
+
};
|
|
870
|
+
/**
|
|
871
|
+
* ListOwnedAccountsResponse contains paginated accounts.
|
|
872
|
+
*
|
|
873
|
+
* @generated from message thru.services.v1.ListOwnedAccountsResponse
|
|
874
|
+
*/
|
|
875
|
+
type ListOwnedAccountsResponse = Message<"thru.services.v1.ListOwnedAccountsResponse"> & {
|
|
876
|
+
/**
|
|
877
|
+
* @generated from field: repeated thru.core.v1.Account accounts = 1;
|
|
878
|
+
*/
|
|
879
|
+
accounts: Account[];
|
|
880
|
+
/**
|
|
881
|
+
* @generated from field: thru.common.v1.PageResponse page = 2;
|
|
882
|
+
*/
|
|
883
|
+
page?: PageResponse;
|
|
884
|
+
};
|
|
885
|
+
/**
|
|
886
|
+
* ListBlocksResponse returns a page of blocks.
|
|
887
|
+
*
|
|
888
|
+
* @generated from message thru.services.v1.ListBlocksResponse
|
|
889
|
+
*/
|
|
890
|
+
type ListBlocksResponse = Message<"thru.services.v1.ListBlocksResponse"> & {
|
|
891
|
+
/**
|
|
892
|
+
* @generated from field: repeated thru.core.v1.Block blocks = 1;
|
|
893
|
+
*/
|
|
894
|
+
blocks: Block[];
|
|
895
|
+
/**
|
|
896
|
+
* @generated from field: thru.common.v1.PageResponse page = 2;
|
|
897
|
+
*/
|
|
898
|
+
page?: PageResponse;
|
|
899
|
+
};
|
|
900
|
+
/**
|
|
901
|
+
* Event represents a transaction event emitted by the chain.
|
|
902
|
+
*
|
|
903
|
+
* @generated from message thru.services.v1.Event
|
|
904
|
+
*/
|
|
905
|
+
type Event = Message<"thru.services.v1.Event"> & {
|
|
906
|
+
/**
|
|
907
|
+
* @generated from field: string event_id = 1;
|
|
908
|
+
*/
|
|
909
|
+
eventId: string;
|
|
910
|
+
/**
|
|
911
|
+
* @generated from field: thru.core.v1.Signature transaction_signature = 2;
|
|
912
|
+
*/
|
|
913
|
+
transactionSignature?: Signature;
|
|
914
|
+
/**
|
|
915
|
+
* @generated from field: thru.core.v1.Pubkey program = 3;
|
|
916
|
+
*/
|
|
917
|
+
program?: Pubkey;
|
|
918
|
+
/**
|
|
919
|
+
* @generated from field: bytes payload = 4;
|
|
920
|
+
*/
|
|
921
|
+
payload: Uint8Array;
|
|
922
|
+
/**
|
|
923
|
+
* @generated from field: uint64 slot = 5;
|
|
924
|
+
*/
|
|
925
|
+
slot: bigint;
|
|
926
|
+
/**
|
|
927
|
+
* @generated from field: uint32 call_idx = 6;
|
|
928
|
+
*/
|
|
929
|
+
callIdx: number;
|
|
930
|
+
/**
|
|
931
|
+
* @generated from field: uint32 program_idx = 7;
|
|
932
|
+
*/
|
|
933
|
+
programIdx: number;
|
|
934
|
+
/**
|
|
935
|
+
* @generated from field: uint32 payload_size = 8;
|
|
936
|
+
*/
|
|
937
|
+
payloadSize: number;
|
|
938
|
+
};
|
|
939
|
+
/**
|
|
940
|
+
* TransactionStatus captures status metadata for a transaction.
|
|
941
|
+
*
|
|
942
|
+
* @generated from message thru.services.v1.TransactionStatus
|
|
943
|
+
*/
|
|
944
|
+
type TransactionStatus = Message<"thru.services.v1.TransactionStatus"> & {
|
|
945
|
+
/**
|
|
946
|
+
* @generated from field: thru.core.v1.Signature signature = 1;
|
|
947
|
+
*/
|
|
948
|
+
signature?: Signature;
|
|
949
|
+
/**
|
|
950
|
+
* @generated from field: thru.common.v1.ConsensusStatus consensus_status = 2;
|
|
951
|
+
*/
|
|
952
|
+
consensusStatus: ConsensusStatus;
|
|
953
|
+
/**
|
|
954
|
+
* @generated from field: thru.core.v1.TransactionExecutionResult execution_result = 3;
|
|
955
|
+
*/
|
|
956
|
+
executionResult?: TransactionExecutionResult;
|
|
957
|
+
};
|
|
958
|
+
/**
|
|
959
|
+
* GetHeightResponse
|
|
960
|
+
*
|
|
961
|
+
* @generated from message thru.services.v1.GetHeightResponse
|
|
962
|
+
*/
|
|
963
|
+
type GetHeightResponse = Message<"thru.services.v1.GetHeightResponse"> & {
|
|
964
|
+
/**
|
|
965
|
+
* @generated from field: uint64 finalized = 1;
|
|
966
|
+
*/
|
|
967
|
+
finalized: bigint;
|
|
968
|
+
/**
|
|
969
|
+
* @generated from field: uint64 locally_executed = 2;
|
|
970
|
+
*/
|
|
971
|
+
locallyExecuted: bigint;
|
|
972
|
+
/**
|
|
973
|
+
* @generated from field: uint64 cluster_executed = 3;
|
|
974
|
+
*/
|
|
975
|
+
clusterExecuted: bigint;
|
|
976
|
+
};
|
|
977
|
+
|
|
978
|
+
/**
|
|
979
|
+
* TrackTransactionResponse reports status transitions for a transaction.
|
|
980
|
+
*
|
|
981
|
+
* @generated from message thru.services.v1.TrackTransactionResponse
|
|
982
|
+
*/
|
|
983
|
+
type TrackTransactionResponse = Message<"thru.services.v1.TrackTransactionResponse"> & {
|
|
984
|
+
/**
|
|
985
|
+
* @generated from field: thru.core.v1.Signature signature = 1;
|
|
986
|
+
*/
|
|
987
|
+
signature?: Signature;
|
|
988
|
+
/**
|
|
989
|
+
* @generated from field: thru.common.v1.ConsensusStatus consensus_status = 2;
|
|
990
|
+
*/
|
|
991
|
+
consensusStatus: ConsensusStatus;
|
|
992
|
+
/**
|
|
993
|
+
* @generated from field: thru.core.v1.TransactionExecutionResult execution_result = 3;
|
|
994
|
+
*/
|
|
995
|
+
executionResult?: TransactionExecutionResult;
|
|
996
|
+
};
|
|
997
|
+
|
|
998
|
+
interface ThruClientConfig {
|
|
999
|
+
baseUrl?: string;
|
|
1000
|
+
}
|
|
1001
|
+
type QueryClient = ReturnType<typeof createClient<typeof QueryService>>;
|
|
1002
|
+
type CommandClient = ReturnType<typeof createClient<typeof CommandService>>;
|
|
1003
|
+
type StreamingClient = ReturnType<typeof createClient<typeof StreamingService>>;
|
|
1004
|
+
interface ThruClientContext {
|
|
1005
|
+
baseUrl: string;
|
|
1006
|
+
transport: ReturnType<typeof createGrpcWebTransport>;
|
|
1007
|
+
query: QueryClient;
|
|
1008
|
+
command: CommandClient;
|
|
1009
|
+
streaming: StreamingClient;
|
|
1010
|
+
}
|
|
1011
|
+
declare function createThruClientContext(config?: ThruClientConfig): ThruClientContext;
|
|
1012
|
+
|
|
1013
|
+
type BytesLike = string | Uint8Array;
|
|
1014
|
+
type BlockSelector = {
|
|
1015
|
+
slot: number | bigint;
|
|
1016
|
+
} | {
|
|
1017
|
+
blockHash: BytesLike;
|
|
1018
|
+
};
|
|
1019
|
+
declare function toPubkey(value: BytesLike, field: string): Pubkey;
|
|
1020
|
+
declare function encodeSignature(bytes: Uint8Array): string;
|
|
1021
|
+
declare function decodeSignature(value: string): Uint8Array;
|
|
1022
|
+
declare function encodeAddress(bytes: Uint8Array): string;
|
|
1023
|
+
declare function decodeAddress(value: string): Uint8Array;
|
|
1024
|
+
interface DeriveProgramAddressOptions {
|
|
1025
|
+
programAddress: BytesLike;
|
|
1026
|
+
seed: BytesLike;
|
|
1027
|
+
ephemeral?: boolean;
|
|
1028
|
+
}
|
|
1029
|
+
interface DeriveProgramAddressResult {
|
|
1030
|
+
bytes: Uint8Array;
|
|
1031
|
+
address: string;
|
|
1032
|
+
}
|
|
1033
|
+
declare function deriveProgramAddress(options: DeriveProgramAddressOptions): DeriveProgramAddressResult;
|
|
1034
|
+
|
|
1035
|
+
type Bytes32 = Uint8Array;
|
|
1036
|
+
type Bytes64 = Uint8Array;
|
|
1037
|
+
type AccountAddress = Bytes32;
|
|
1038
|
+
type ProgramIdentifier = BytesLike;
|
|
1039
|
+
interface ResourceLimits {
|
|
1040
|
+
computeUnits?: number;
|
|
1041
|
+
stateUnits?: number;
|
|
1042
|
+
memoryUnits?: number;
|
|
1043
|
+
}
|
|
1044
|
+
interface OptionalProofs {
|
|
1045
|
+
feePayerStateProof?: Uint8Array;
|
|
1046
|
+
feePayerAccountMetaRaw?: Uint8Array;
|
|
1047
|
+
}
|
|
1048
|
+
interface TransactionHeaderInput extends ResourceLimits {
|
|
1049
|
+
fee: bigint;
|
|
1050
|
+
nonce: bigint;
|
|
1051
|
+
startSlot: bigint;
|
|
1052
|
+
expiryAfter?: number;
|
|
1053
|
+
flags?: number;
|
|
1054
|
+
}
|
|
1055
|
+
interface TransactionAccountsInput {
|
|
1056
|
+
readWriteAccounts?: AccountAddress[];
|
|
1057
|
+
readOnlyAccounts?: AccountAddress[];
|
|
1058
|
+
}
|
|
1059
|
+
interface TransactionContentInput {
|
|
1060
|
+
instructions?: Uint8Array;
|
|
1061
|
+
proofs?: OptionalProofs;
|
|
1062
|
+
}
|
|
1063
|
+
interface FeePayerInput {
|
|
1064
|
+
publicKey: AccountAddress;
|
|
1065
|
+
privateKey?: Bytes32;
|
|
1066
|
+
}
|
|
1067
|
+
interface BuildTransactionParams {
|
|
1068
|
+
feePayer: FeePayerInput;
|
|
1069
|
+
program: ProgramIdentifier;
|
|
1070
|
+
header: TransactionHeaderInput;
|
|
1071
|
+
accounts?: TransactionAccountsInput;
|
|
1072
|
+
content?: TransactionContentInput;
|
|
1073
|
+
}
|
|
1074
|
+
interface BuiltTransactionResult {
|
|
1075
|
+
transaction: TransactionLike;
|
|
1076
|
+
}
|
|
1077
|
+
interface SignedTransactionResult extends BuiltTransactionResult {
|
|
1078
|
+
signature: Bytes64;
|
|
1079
|
+
rawTransaction: Uint8Array;
|
|
1080
|
+
}
|
|
1081
|
+
interface TransactionLike {
|
|
1082
|
+
toWire(): Uint8Array;
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
declare class Transaction {
|
|
1086
|
+
readonly feePayer: AccountAddress;
|
|
1087
|
+
readonly program: AccountAddress;
|
|
1088
|
+
readonly fee: bigint;
|
|
1089
|
+
readonly nonce: bigint;
|
|
1090
|
+
readonly startSlot: bigint;
|
|
1091
|
+
readonly expiryAfter: number;
|
|
1092
|
+
readonly requestedComputeUnits: number;
|
|
1093
|
+
readonly requestedStateUnits: number;
|
|
1094
|
+
readonly requestedMemoryUnits: number;
|
|
1095
|
+
readonly flags: number;
|
|
1096
|
+
readonly readWriteAccounts: AccountAddress[];
|
|
1097
|
+
readonly readOnlyAccounts: AccountAddress[];
|
|
1098
|
+
readonly instructions?: Uint8Array;
|
|
1099
|
+
readonly feePayerStateProof?: Uint8Array;
|
|
1100
|
+
readonly feePayerAccountMetaRaw?: Uint8Array;
|
|
1101
|
+
private signature?;
|
|
1102
|
+
constructor(params: {
|
|
1103
|
+
feePayer: AccountAddress;
|
|
1104
|
+
program: AccountAddress;
|
|
1105
|
+
header: TransactionHeaderInput;
|
|
1106
|
+
accounts?: TransactionAccountsInput;
|
|
1107
|
+
instructions?: Uint8Array;
|
|
1108
|
+
proofs?: OptionalProofs;
|
|
1109
|
+
});
|
|
1110
|
+
getSignature(): Bytes64 | undefined;
|
|
1111
|
+
setSignature(signature: Bytes64): void;
|
|
1112
|
+
sign(privateKey: Uint8Array): Promise<Bytes64>;
|
|
1113
|
+
toWireForSigning(): Uint8Array;
|
|
1114
|
+
toWire(): Uint8Array;
|
|
1115
|
+
private createHeader;
|
|
1116
|
+
private buildWirePayload;
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
interface CreateAccountOptions {
|
|
1120
|
+
/** The new account's public key (fee payer). */
|
|
1121
|
+
publicKey: BytesLike;
|
|
1122
|
+
}
|
|
1123
|
+
interface AccountQueryOptions {
|
|
1124
|
+
view?: AccountView;
|
|
1125
|
+
versionContext?: VersionContext;
|
|
1126
|
+
minConsensus?: ConsensusStatus;
|
|
1127
|
+
dataSlice?: DataSlice;
|
|
1128
|
+
}
|
|
1129
|
+
interface RawAccountQueryOptions {
|
|
1130
|
+
view?: AccountView;
|
|
1131
|
+
versionContext?: VersionContext;
|
|
1132
|
+
minConsensus?: ConsensusStatus;
|
|
1133
|
+
}
|
|
1134
|
+
interface ListOwnedAccountsOptions {
|
|
1135
|
+
view?: AccountView;
|
|
1136
|
+
versionContext?: VersionContext;
|
|
1137
|
+
filter?: Filter;
|
|
1138
|
+
page?: PageRequest;
|
|
1139
|
+
minConsensus?: ConsensusStatus;
|
|
1140
|
+
}
|
|
1141
|
+
declare function getAccount(ctx: ThruClientContext, address: BytesLike, options?: AccountQueryOptions): Promise<Account>;
|
|
1142
|
+
declare function getRawAccount(ctx: ThruClientContext, address: BytesLike, options?: RawAccountQueryOptions): Promise<RawAccount>;
|
|
1143
|
+
declare function listOwnedAccounts(ctx: ThruClientContext, owner: BytesLike, options?: ListOwnedAccountsOptions): Promise<ListOwnedAccountsResponse>;
|
|
1144
|
+
declare function createAccount(ctx: ThruClientContext, options: CreateAccountOptions): Promise<Transaction>;
|
|
1145
|
+
|
|
1146
|
+
type accounts_AccountQueryOptions = AccountQueryOptions;
|
|
1147
|
+
type accounts_CreateAccountOptions = CreateAccountOptions;
|
|
1148
|
+
type accounts_ListOwnedAccountsOptions = ListOwnedAccountsOptions;
|
|
1149
|
+
type accounts_RawAccountQueryOptions = RawAccountQueryOptions;
|
|
1150
|
+
declare const accounts_createAccount: typeof createAccount;
|
|
1151
|
+
declare const accounts_getAccount: typeof getAccount;
|
|
1152
|
+
declare const accounts_getRawAccount: typeof getRawAccount;
|
|
1153
|
+
declare const accounts_listOwnedAccounts: typeof listOwnedAccounts;
|
|
1154
|
+
declare namespace accounts {
|
|
1155
|
+
export { type accounts_AccountQueryOptions as AccountQueryOptions, type accounts_CreateAccountOptions as CreateAccountOptions, type accounts_ListOwnedAccountsOptions as ListOwnedAccountsOptions, type accounts_RawAccountQueryOptions as RawAccountQueryOptions, accounts_createAccount as createAccount, accounts_getAccount as getAccount, accounts_getRawAccount as getRawAccount, accounts_listOwnedAccounts as listOwnedAccounts };
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
interface BlockQueryOptions {
|
|
1159
|
+
view?: BlockView;
|
|
1160
|
+
minConsensus?: ConsensusStatus;
|
|
1161
|
+
}
|
|
1162
|
+
interface RawBlockQueryOptions {
|
|
1163
|
+
minConsensus?: ConsensusStatus;
|
|
1164
|
+
}
|
|
1165
|
+
interface ListBlocksOptions {
|
|
1166
|
+
filter?: Filter;
|
|
1167
|
+
page?: PageRequest;
|
|
1168
|
+
view?: BlockView;
|
|
1169
|
+
minConsensus?: ConsensusStatus;
|
|
1170
|
+
}
|
|
1171
|
+
declare function getBlock(ctx: ThruClientContext, selector: BlockSelector, options?: BlockQueryOptions): Promise<Block>;
|
|
1172
|
+
declare function getRawBlock(ctx: ThruClientContext, selector: BlockSelector, options?: RawBlockQueryOptions): Promise<RawBlock>;
|
|
1173
|
+
declare function listBlocks(ctx: ThruClientContext, options?: ListBlocksOptions): Promise<ListBlocksResponse>;
|
|
1174
|
+
|
|
1175
|
+
type blocks_BlockQueryOptions = BlockQueryOptions;
|
|
1176
|
+
type blocks_ListBlocksOptions = ListBlocksOptions;
|
|
1177
|
+
type blocks_RawBlockQueryOptions = RawBlockQueryOptions;
|
|
1178
|
+
declare const blocks_getBlock: typeof getBlock;
|
|
1179
|
+
declare const blocks_getRawBlock: typeof getRawBlock;
|
|
1180
|
+
declare const blocks_listBlocks: typeof listBlocks;
|
|
1181
|
+
declare namespace blocks {
|
|
1182
|
+
export { type blocks_BlockQueryOptions as BlockQueryOptions, type blocks_ListBlocksOptions as ListBlocksOptions, type blocks_RawBlockQueryOptions as RawBlockQueryOptions, blocks_getBlock as getBlock, blocks_getRawBlock as getRawBlock, blocks_listBlocks as listBlocks };
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1185
|
+
interface GetEventOptions {
|
|
1186
|
+
versionContext?: VersionContext;
|
|
1187
|
+
}
|
|
1188
|
+
declare function getEvent(ctx: ThruClientContext, eventId: string, options?: GetEventOptions): Promise<Event>;
|
|
1189
|
+
|
|
1190
|
+
type events_GetEventOptions = GetEventOptions;
|
|
1191
|
+
declare const events_getEvent: typeof getEvent;
|
|
1192
|
+
declare namespace events {
|
|
1193
|
+
export { type events_GetEventOptions as GetEventOptions, events_getEvent as getEvent };
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
declare function getBlockHeight(ctx: ThruClientContext): Promise<GetHeightResponse>;
|
|
1197
|
+
|
|
1198
|
+
declare const height_getBlockHeight: typeof getBlockHeight;
|
|
1199
|
+
declare namespace height {
|
|
1200
|
+
export { height_getBlockHeight as getBlockHeight };
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
type GenerateStateProofOptions = {
|
|
1204
|
+
address?: BytesLike;
|
|
1205
|
+
proofType: StateProofType;
|
|
1206
|
+
targetSlot: bigint;
|
|
1207
|
+
};
|
|
1208
|
+
|
|
1209
|
+
declare function generateStateProof(ctx: ThruClientContext, options: GenerateStateProofOptions): Promise<GenerateStateProofResponse>;
|
|
1210
|
+
|
|
1211
|
+
declare const proofs_generateStateProof: typeof generateStateProof;
|
|
1212
|
+
declare namespace proofs {
|
|
1213
|
+
export { proofs_generateStateProof as generateStateProof };
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
interface TrackTransactionOptions {
|
|
1217
|
+
timeoutMs?: number;
|
|
1218
|
+
signal?: AbortSignal;
|
|
1219
|
+
}
|
|
1220
|
+
declare function trackTransaction(ctx: ThruClientContext, signature: BytesLike, options?: TrackTransactionOptions): AsyncIterable<TrackTransactionResponse>;
|
|
1221
|
+
|
|
1222
|
+
type streaming_TrackTransactionOptions = TrackTransactionOptions;
|
|
1223
|
+
declare const streaming_trackTransaction: typeof trackTransaction;
|
|
1224
|
+
declare namespace streaming {
|
|
1225
|
+
export { type streaming_TrackTransactionOptions as TrackTransactionOptions, streaming_trackTransaction as trackTransaction };
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
declare class TransactionBuilder {
|
|
1229
|
+
build(params: BuildTransactionParams): Transaction;
|
|
1230
|
+
buildAndSign(params: BuildTransactionParams): Promise<SignedTransactionResult>;
|
|
1231
|
+
private normalizeAccounts;
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1234
|
+
interface TransactionFeePayerConfig {
|
|
1235
|
+
publicKey: BytesLike;
|
|
1236
|
+
privateKey?: Uint8Array;
|
|
1237
|
+
}
|
|
1238
|
+
interface TransactionAccountsConfig {
|
|
1239
|
+
readWrite?: BytesLike[];
|
|
1240
|
+
readOnly?: BytesLike[];
|
|
1241
|
+
}
|
|
1242
|
+
interface TransactionContentConfig {
|
|
1243
|
+
instructions?: BytesLike;
|
|
1244
|
+
feePayerStateProof?: Uint8Array;
|
|
1245
|
+
feePayerAccountMetaRaw?: Uint8Array;
|
|
1246
|
+
}
|
|
1247
|
+
interface TransactionHeaderConfig {
|
|
1248
|
+
fee?: bigint;
|
|
1249
|
+
nonce?: bigint;
|
|
1250
|
+
startSlot?: bigint;
|
|
1251
|
+
expiryAfter?: number;
|
|
1252
|
+
computeUnits?: number;
|
|
1253
|
+
stateUnits?: number;
|
|
1254
|
+
memoryUnits?: number;
|
|
1255
|
+
flags?: number;
|
|
1256
|
+
}
|
|
1257
|
+
interface BuildTransactionOptions {
|
|
1258
|
+
feePayer: TransactionFeePayerConfig;
|
|
1259
|
+
program: ProgramIdentifier;
|
|
1260
|
+
header?: TransactionHeaderConfig;
|
|
1261
|
+
accounts?: TransactionAccountsConfig;
|
|
1262
|
+
content?: TransactionContentConfig;
|
|
1263
|
+
}
|
|
1264
|
+
interface BuildAndSignTransactionOptions extends BuildTransactionOptions {
|
|
1265
|
+
feePayer: TransactionFeePayerConfig & {
|
|
1266
|
+
privateKey: Uint8Array;
|
|
1267
|
+
};
|
|
1268
|
+
}
|
|
1269
|
+
interface TransactionQueryOptions {
|
|
1270
|
+
view?: TransactionView;
|
|
1271
|
+
versionContext?: VersionContext;
|
|
1272
|
+
minConsensus?: ConsensusStatus;
|
|
1273
|
+
}
|
|
1274
|
+
interface RawTransactionQueryOptions {
|
|
1275
|
+
versionContext?: VersionContext;
|
|
1276
|
+
minConsensus?: ConsensusStatus;
|
|
1277
|
+
}
|
|
1278
|
+
declare function getTransaction(ctx: ThruClientContext, signature: BytesLike, options?: TransactionQueryOptions): Promise<Transaction$1>;
|
|
1279
|
+
declare function getRawTransaction(ctx: ThruClientContext, signature: BytesLike, options?: RawTransactionQueryOptions): Promise<RawTransaction>;
|
|
1280
|
+
declare function getTransactionStatus(ctx: ThruClientContext, signature: BytesLike): Promise<TransactionStatus>;
|
|
1281
|
+
declare function buildTransaction(ctx: ThruClientContext, options: BuildTransactionOptions): Promise<Transaction>;
|
|
1282
|
+
declare function buildAndSignTransaction(ctx: ThruClientContext, options: BuildAndSignTransactionOptions): Promise<SignedTransactionResult>;
|
|
1283
|
+
declare function sendTransaction(ctx: ThruClientContext, transaction: Transaction | Uint8Array): Promise<string>;
|
|
1284
|
+
|
|
1285
|
+
type transactions_BuildAndSignTransactionOptions = BuildAndSignTransactionOptions;
|
|
1286
|
+
type transactions_BuildTransactionOptions = BuildTransactionOptions;
|
|
1287
|
+
type transactions_RawTransactionQueryOptions = RawTransactionQueryOptions;
|
|
1288
|
+
type transactions_TransactionAccountsConfig = TransactionAccountsConfig;
|
|
1289
|
+
type transactions_TransactionContentConfig = TransactionContentConfig;
|
|
1290
|
+
type transactions_TransactionFeePayerConfig = TransactionFeePayerConfig;
|
|
1291
|
+
type transactions_TransactionHeaderConfig = TransactionHeaderConfig;
|
|
1292
|
+
type transactions_TransactionQueryOptions = TransactionQueryOptions;
|
|
1293
|
+
declare const transactions_buildAndSignTransaction: typeof buildAndSignTransaction;
|
|
1294
|
+
declare const transactions_buildTransaction: typeof buildTransaction;
|
|
1295
|
+
declare const transactions_getRawTransaction: typeof getRawTransaction;
|
|
1296
|
+
declare const transactions_getTransaction: typeof getTransaction;
|
|
1297
|
+
declare const transactions_getTransactionStatus: typeof getTransactionStatus;
|
|
1298
|
+
declare const transactions_sendTransaction: typeof sendTransaction;
|
|
1299
|
+
declare namespace transactions {
|
|
1300
|
+
export { type transactions_BuildAndSignTransactionOptions as BuildAndSignTransactionOptions, type transactions_BuildTransactionOptions as BuildTransactionOptions, type transactions_RawTransactionQueryOptions as RawTransactionQueryOptions, type transactions_TransactionAccountsConfig as TransactionAccountsConfig, type transactions_TransactionContentConfig as TransactionContentConfig, type transactions_TransactionFeePayerConfig as TransactionFeePayerConfig, type transactions_TransactionHeaderConfig as TransactionHeaderConfig, type transactions_TransactionQueryOptions as TransactionQueryOptions, transactions_buildAndSignTransaction as buildAndSignTransaction, transactions_buildTransaction as buildTransaction, transactions_getRawTransaction as getRawTransaction, transactions_getTransaction as getTransaction, transactions_getTransactionStatus as getTransactionStatus, transactions_sendTransaction as sendTransaction };
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
type BoundFunction<F> = F extends (ctx: ThruClientContext, ...args: infer P) => infer R ? (...args: P) => R : never;
|
|
1304
|
+
interface BoundBlocks {
|
|
1305
|
+
get: BoundFunction<typeof getBlock>;
|
|
1306
|
+
getRaw: BoundFunction<typeof getRawBlock>;
|
|
1307
|
+
list: BoundFunction<typeof listBlocks>;
|
|
1308
|
+
getBlockHeight: BoundFunction<typeof getBlockHeight>;
|
|
1309
|
+
}
|
|
1310
|
+
interface BoundAccounts {
|
|
1311
|
+
get: BoundFunction<typeof getAccount>;
|
|
1312
|
+
getRaw: BoundFunction<typeof getRawAccount>;
|
|
1313
|
+
listOwned: BoundFunction<typeof listOwnedAccounts>;
|
|
1314
|
+
create: BoundFunction<typeof createAccount>;
|
|
1315
|
+
}
|
|
1316
|
+
interface BoundTransactions {
|
|
1317
|
+
get: BoundFunction<typeof getTransaction>;
|
|
1318
|
+
getRaw: BoundFunction<typeof getRawTransaction>;
|
|
1319
|
+
getStatus: BoundFunction<typeof getTransactionStatus>;
|
|
1320
|
+
build: BoundFunction<typeof buildTransaction>;
|
|
1321
|
+
buildAndSign: BoundFunction<typeof buildAndSignTransaction>;
|
|
1322
|
+
send: BoundFunction<typeof sendTransaction>;
|
|
1323
|
+
track: BoundFunction<typeof trackTransaction>;
|
|
1324
|
+
}
|
|
1325
|
+
interface BoundEvents {
|
|
1326
|
+
get: BoundFunction<typeof getEvent>;
|
|
1327
|
+
}
|
|
1328
|
+
interface BoundProofs {
|
|
1329
|
+
generate: BoundFunction<typeof generateStateProof>;
|
|
1330
|
+
}
|
|
1331
|
+
interface Helpers {
|
|
1332
|
+
toSignature(value: Uint8Array | string): Signature;
|
|
1333
|
+
toPubkey(value: Uint8Array | string, field: string): Pubkey;
|
|
1334
|
+
toBlockHash(value: Uint8Array | string): BlockHash;
|
|
1335
|
+
encodeSignature(bytes: Uint8Array): string;
|
|
1336
|
+
decodeSignature(value: string): Uint8Array;
|
|
1337
|
+
encodeAddress(bytes: Uint8Array): string;
|
|
1338
|
+
decodeAddress(value: string): Uint8Array;
|
|
1339
|
+
deriveProgramAddress(options: DeriveProgramAddressOptions): DeriveProgramAddressResult;
|
|
1340
|
+
}
|
|
1341
|
+
interface Thru {
|
|
1342
|
+
ctx: ThruClientContext;
|
|
1343
|
+
blocks: BoundBlocks;
|
|
1344
|
+
accounts: BoundAccounts;
|
|
1345
|
+
transactions: BoundTransactions;
|
|
1346
|
+
events: BoundEvents;
|
|
1347
|
+
proofs: BoundProofs;
|
|
1348
|
+
helpers: Helpers;
|
|
1349
|
+
}
|
|
1350
|
+
declare function createBoundThruClient(ctx: ThruClientContext): Thru;
|
|
1351
|
+
|
|
1352
|
+
declare function createThruClient(config?: ThruClientConfig): Thru;
|
|
1353
|
+
|
|
1354
|
+
export { type AccountQueryOptions, type BlockQueryOptions, type BlockSelector, type BuildAndSignTransactionOptions, type BuildTransactionOptions, type BytesLike, ConsensusStatus, type CreateAccountOptions, type DeriveProgramAddressOptions, type DeriveProgramAddressResult, type GenerateStateProofOptions, type GetEventOptions, type ListBlocksOptions, type ListOwnedAccountsOptions, type RawAccountQueryOptions, type RawBlockQueryOptions, type RawTransactionQueryOptions, Transaction as SdkTransaction, type SignedTransactionResult, type Thru, type ThruClientConfig, type ThruClientContext, type TrackTransactionOptions, type TransactionAccountsConfig, TransactionBuilder, type TransactionContentConfig, type TransactionFeePayerConfig, type TransactionHeaderConfig, type TransactionQueryOptions, accounts, blocks, createBoundThruClient, createThruClient, createThruClientContext, decodeAddress, decodeSignature, deriveProgramAddress, encodeAddress, encodeSignature, events, height, proofs, streaming, toPubkey, transactions };
|