@thru/token-program 0.2.1

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.
@@ -0,0 +1,1144 @@
1
+ import { Account } from '@thru/thru-sdk';
2
+
3
+ type AccountLookupContext = {
4
+ getAccountIndex: (pubkey: Uint8Array) => number;
5
+ };
6
+ type InstructionData = (context: AccountLookupContext) => Promise<Uint8Array>;
7
+ interface MintAccountInfo {
8
+ decimals: number;
9
+ supply: bigint;
10
+ creator: string;
11
+ mintAuthority: string;
12
+ freezeAuthority: string | null;
13
+ hasFreezeAuthority: boolean;
14
+ ticker: string;
15
+ }
16
+ interface TokenAccountInfo {
17
+ mint: string;
18
+ owner: string;
19
+ amount: bigint;
20
+ isFrozen: boolean;
21
+ }
22
+ interface InitializeMintArgs {
23
+ mintAccountBytes: Uint8Array;
24
+ decimals: number;
25
+ creatorBytes?: Uint8Array;
26
+ mintAuthorityBytes: Uint8Array;
27
+ freezeAuthorityBytes?: Uint8Array;
28
+ ticker: string;
29
+ seedHex: string;
30
+ stateProof: Uint8Array;
31
+ }
32
+ interface InitializeAccountArgs {
33
+ tokenAccountBytes: Uint8Array;
34
+ mintAccountBytes: Uint8Array;
35
+ ownerAccountBytes: Uint8Array;
36
+ seedBytes: Uint8Array;
37
+ stateProof: Uint8Array;
38
+ }
39
+ interface MintToArgs {
40
+ mintAccountBytes: Uint8Array;
41
+ destinationAccountBytes: Uint8Array;
42
+ authorityAccountBytes: Uint8Array;
43
+ amount: bigint;
44
+ }
45
+ interface TransferArgs {
46
+ sourceAccountBytes: Uint8Array;
47
+ destinationAccountBytes: Uint8Array;
48
+ amount: bigint;
49
+ }
50
+
51
+ declare const PUBKEY_LENGTH = 32;
52
+ declare const TICKER_MAX_LENGTH = 8;
53
+ declare const ZERO_PUBKEY: Uint8Array<ArrayBuffer>;
54
+
55
+ declare function createInitializeMintInstruction({ mintAccountBytes, decimals, mintAuthorityBytes, freezeAuthorityBytes, ticker, seedHex, stateProof, creatorBytes, }: InitializeMintArgs): InstructionData;
56
+
57
+ declare function createInitializeAccountInstruction(args: InitializeAccountArgs): InstructionData;
58
+
59
+ declare function createMintToInstruction(args: MintToArgs): InstructionData;
60
+
61
+ declare function createTransferInstruction(args: TransferArgs): InstructionData;
62
+
63
+ type __TnValidateResult$2 = {
64
+ ok: boolean;
65
+ code?: string;
66
+ consumed?: bigint;
67
+ };
68
+ declare class Hash {
69
+ private buffer;
70
+ private view;
71
+ private constructor();
72
+ static __tnCreateView(buffer: Uint8Array, opts?: {
73
+ fieldContext?: Record<string, number | bigint>;
74
+ }): Hash;
75
+ static builder(): HashBuilder;
76
+ static fromBuilder(builder: HashBuilder): Hash | null;
77
+ get_bytes(): number[];
78
+ set_bytes(value: number[]): void;
79
+ get bytes(): number[];
80
+ set bytes(value: number[]);
81
+ private static __tnFootprintInternal;
82
+ private static __tnValidateInternal;
83
+ static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
84
+ static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult$2;
85
+ static footprintIr(): bigint;
86
+ static footprint(): number;
87
+ static validate(buffer: Uint8Array, _opts?: {
88
+ params?: never;
89
+ }): {
90
+ ok: boolean;
91
+ code?: string;
92
+ consumed?: number;
93
+ };
94
+ static from_array(buffer: Uint8Array): Hash | null;
95
+ }
96
+ declare class HashBuilder {
97
+ private buffer;
98
+ private view;
99
+ constructor();
100
+ set_bytes(values: number[]): this;
101
+ build(): Uint8Array;
102
+ buildInto(target: Uint8Array, offset?: number): Uint8Array;
103
+ finish(): Hash;
104
+ }
105
+ declare class Pubkey {
106
+ private buffer;
107
+ private view;
108
+ private constructor();
109
+ static __tnCreateView(buffer: Uint8Array, opts?: {
110
+ fieldContext?: Record<string, number | bigint>;
111
+ }): Pubkey;
112
+ static builder(): PubkeyBuilder;
113
+ static fromBuilder(builder: PubkeyBuilder): Pubkey | null;
114
+ get_bytes(): number[];
115
+ set_bytes(value: number[]): void;
116
+ get bytes(): number[];
117
+ set bytes(value: number[]);
118
+ private static __tnFootprintInternal;
119
+ private static __tnValidateInternal;
120
+ static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
121
+ static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult$2;
122
+ static footprintIr(): bigint;
123
+ static footprint(): number;
124
+ static validate(buffer: Uint8Array, _opts?: {
125
+ params?: never;
126
+ }): {
127
+ ok: boolean;
128
+ code?: string;
129
+ consumed?: number;
130
+ };
131
+ static from_array(buffer: Uint8Array): Pubkey | null;
132
+ }
133
+ declare class PubkeyBuilder {
134
+ private buffer;
135
+ private view;
136
+ constructor();
137
+ set_bytes(values: number[]): this;
138
+ build(): Uint8Array;
139
+ buildInto(target: Uint8Array, offset?: number): Uint8Array;
140
+ finish(): Pubkey;
141
+ }
142
+
143
+ type __TnValidateResult$1 = {
144
+ ok: boolean;
145
+ code?: string;
146
+ consumed?: bigint;
147
+ };
148
+ type __TnBuilderLike$1 = {
149
+ build(): Uint8Array;
150
+ };
151
+ type __TnVariantDescriptor$1 = {
152
+ readonly name: string;
153
+ readonly tag: number;
154
+ readonly payloadSize: number | null;
155
+ readonly payloadType?: string;
156
+ readonly createPayloadBuilder?: () => unknown | null;
157
+ };
158
+ type __TnVariantSelectorResult$1<Parent> = {
159
+ select(name: string): {
160
+ writePayload(payload: Uint8Array | __TnBuilderLike$1): {
161
+ finish(): Parent;
162
+ };
163
+ };
164
+ finish(): Parent;
165
+ };
166
+ declare class StateProofHeader {
167
+ private buffer;
168
+ private view;
169
+ private constructor();
170
+ static __tnCreateView(buffer: Uint8Array, opts?: {
171
+ fieldContext?: Record<string, number | bigint>;
172
+ }): StateProofHeader;
173
+ static builder(): StateProofHeaderBuilder;
174
+ static fromBuilder(builder: StateProofHeaderBuilder): StateProofHeader | null;
175
+ get_type_slot(): bigint;
176
+ set_type_slot(value: bigint): void;
177
+ get type_slot(): bigint;
178
+ set type_slot(value: bigint);
179
+ get_path_bitset(): Hash;
180
+ set_path_bitset(value: Hash): void;
181
+ get path_bitset(): Hash;
182
+ set path_bitset(value: Hash);
183
+ private static __tnFootprintInternal;
184
+ private static __tnValidateInternal;
185
+ static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
186
+ static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult$1;
187
+ static footprintIr(): bigint;
188
+ static footprint(): number;
189
+ static validate(buffer: Uint8Array, _opts?: {
190
+ params?: never;
191
+ }): {
192
+ ok: boolean;
193
+ code?: string;
194
+ consumed?: number;
195
+ };
196
+ static from_array(buffer: Uint8Array): StateProofHeader | null;
197
+ }
198
+ declare class StateProofHeaderBuilder {
199
+ private buffer;
200
+ private view;
201
+ constructor();
202
+ set_type_slot(value: number): this;
203
+ set_path_bitset(value: Uint8Array): this;
204
+ build(): Uint8Array;
205
+ buildInto(target: Uint8Array, offset?: number): Uint8Array;
206
+ finish(): StateProofHeader;
207
+ }
208
+ declare class StateProof_proof_body_existing_Inner {
209
+ private buffer;
210
+ private view;
211
+ private __tnFieldContext;
212
+ private constructor();
213
+ static __tnCreateView(buffer: Uint8Array, opts?: {
214
+ fieldContext?: Record<string, number | bigint>;
215
+ }): StateProof_proof_body_existing_Inner;
216
+ withFieldContext(context: Record<string, number | bigint>): this;
217
+ private __tnResolveFieldRef;
218
+ get_sibling_hashes_length(): number;
219
+ get_sibling_hashes_at(index: number): Hash;
220
+ get_sibling_hashes(): Hash[];
221
+ set_sibling_hashes_at(index: number, value: Hash): void;
222
+ set_sibling_hashes(value: Hash[]): void;
223
+ get sibling_hashes(): Hash[];
224
+ set sibling_hashes(value: Hash[]);
225
+ }
226
+ declare class StateProof_proof_body_updating_Inner {
227
+ private buffer;
228
+ private view;
229
+ private __tnFieldContext;
230
+ private constructor();
231
+ static __tnCreateView(buffer: Uint8Array, opts?: {
232
+ fieldContext?: Record<string, number | bigint>;
233
+ }): StateProof_proof_body_updating_Inner;
234
+ withFieldContext(context: Record<string, number | bigint>): this;
235
+ private __tnResolveFieldRef;
236
+ get_existing_leaf_hash(): Hash;
237
+ set_existing_leaf_hash(value: Hash): void;
238
+ get existing_leaf_hash(): Hash;
239
+ set existing_leaf_hash(value: Hash);
240
+ get_sibling_hashes_length(): number;
241
+ get_sibling_hashes_at(index: number): Hash;
242
+ get_sibling_hashes(): Hash[];
243
+ set_sibling_hashes_at(index: number, value: Hash): void;
244
+ set_sibling_hashes(value: Hash[]): void;
245
+ get sibling_hashes(): Hash[];
246
+ set sibling_hashes(value: Hash[]);
247
+ }
248
+ declare class StateProof_proof_body_creation_Inner {
249
+ private buffer;
250
+ private view;
251
+ private __tnFieldContext;
252
+ private constructor();
253
+ static __tnCreateView(buffer: Uint8Array, opts?: {
254
+ fieldContext?: Record<string, number | bigint>;
255
+ }): StateProof_proof_body_creation_Inner;
256
+ withFieldContext(context: Record<string, number | bigint>): this;
257
+ private __tnResolveFieldRef;
258
+ get_existing_leaf_pubkey(): Pubkey;
259
+ set_existing_leaf_pubkey(value: Pubkey): void;
260
+ get existing_leaf_pubkey(): Pubkey;
261
+ set existing_leaf_pubkey(value: Pubkey);
262
+ get_existing_leaf_hash(): Hash;
263
+ set_existing_leaf_hash(value: Hash): void;
264
+ get existing_leaf_hash(): Hash;
265
+ set existing_leaf_hash(value: Hash);
266
+ get_sibling_hashes_length(): number;
267
+ get_sibling_hashes_at(index: number): Hash;
268
+ get_sibling_hashes(): Hash[];
269
+ set_sibling_hashes_at(index: number, value: Hash): void;
270
+ set_sibling_hashes(value: Hash[]): void;
271
+ get sibling_hashes(): Hash[];
272
+ set sibling_hashes(value: Hash[]);
273
+ }
274
+ declare class StateProof_proof_body_Inner {
275
+ private buffer;
276
+ private descriptor;
277
+ private view;
278
+ private __tnFieldContext;
279
+ private constructor();
280
+ static __tnCreate(payload: Uint8Array, descriptor: __TnVariantDescriptor$1 | null, fieldContext?: Record<string, number | bigint>): StateProof_proof_body_Inner;
281
+ bytes(): Uint8Array;
282
+ variant(): __TnVariantDescriptor$1 | null;
283
+ asExisting(): StateProof_proof_body_existing_Inner | null;
284
+ asUpdating(): StateProof_proof_body_updating_Inner | null;
285
+ asCreation(): StateProof_proof_body_creation_Inner | null;
286
+ }
287
+ declare class StateProof {
288
+ private buffer;
289
+ private view;
290
+ private __tnFieldContext;
291
+ private static readonly __tnFieldOffset_proof_body;
292
+ private __tnParams;
293
+ private __tnDerivedParams;
294
+ private constructor();
295
+ static __tnCreateView(buffer: Uint8Array, opts?: {
296
+ params?: StateProof.Params;
297
+ fieldContext?: Record<string, number | bigint>;
298
+ }): StateProof;
299
+ dynamicParams(): StateProof.Params;
300
+ withFieldContext(context: Record<string, number | bigint>): this;
301
+ private __tnResolveFieldRef;
302
+ static builder(): StateProofBuilder;
303
+ static fromBuilder(builder: StateProofBuilder): StateProof | null;
304
+ static readonly proof_bodyVariantDescriptors: readonly [{
305
+ readonly name: "existing";
306
+ readonly tag: 0;
307
+ readonly payloadSize: null;
308
+ readonly payloadType: "StateProof::proof_body::existing";
309
+ readonly createPayloadBuilder: () => null;
310
+ }, {
311
+ readonly name: "updating";
312
+ readonly tag: 1;
313
+ readonly payloadSize: null;
314
+ readonly payloadType: "StateProof::proof_body::updating";
315
+ readonly createPayloadBuilder: () => null;
316
+ }, {
317
+ readonly name: "creation";
318
+ readonly tag: 2;
319
+ readonly payloadSize: null;
320
+ readonly payloadType: "StateProof::proof_body::creation";
321
+ readonly createPayloadBuilder: () => null;
322
+ }];
323
+ static __tnComputeSequentialLayout(view: DataView, buffer: Uint8Array): {
324
+ params: Record<string, bigint> | null;
325
+ offsets: Record<string, number> | null;
326
+ derived: Record<string, bigint> | null;
327
+ } | null;
328
+ private static __tnExtractParams;
329
+ private __tnEnsureDerivedParams;
330
+ private __tnReadDerivedParam;
331
+ get_hdr(): StateProofHeader;
332
+ set_hdr(value: StateProofHeader): void;
333
+ get hdr(): StateProofHeader;
334
+ set hdr(value: StateProofHeader);
335
+ get_proof_body_computed_tag(): number;
336
+ proofBodyVariant(): typeof StateProof.proof_bodyVariantDescriptors[number] | null;
337
+ proof_body(): StateProof_proof_body_Inner;
338
+ private static __tnFootprintInternal;
339
+ private static __tnValidateInternal;
340
+ static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
341
+ static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult$1;
342
+ static footprintIr(proof_body_hdr_type_slot: number | bigint, proof_body_payload_size: number | bigint): bigint;
343
+ private static __tnPackParams;
344
+ static footprintIrFromParams(params: StateProof.Params): bigint;
345
+ static footprintFromParams(params: StateProof.Params): number;
346
+ static footprintFromValues(input: {
347
+ proof_body_hdr_type_slot: number | bigint;
348
+ proof_body_payload_size: number | bigint;
349
+ }): number;
350
+ static footprint(params: StateProof.Params): number;
351
+ static validate(buffer: Uint8Array, opts?: {
352
+ params?: StateProof.Params;
353
+ }): {
354
+ ok: boolean;
355
+ code?: string;
356
+ consumed?: number;
357
+ params?: StateProof.Params;
358
+ };
359
+ static from_array(buffer: Uint8Array, opts?: {
360
+ params?: StateProof.Params;
361
+ }): StateProof | null;
362
+ }
363
+ declare namespace StateProof {
364
+ type Params = {
365
+ /** ABI path: proof_body.hdr.type_slot */
366
+ readonly proof_body_hdr_type_slot: bigint;
367
+ /** ABI path: proof_body.payload_size */
368
+ readonly proof_body_payload_size: bigint;
369
+ };
370
+ const ParamKeys: Readonly<{
371
+ readonly proof_body_hdr_type_slot: "proof_body.hdr.type_slot";
372
+ readonly proof_body_payload_size: "proof_body.payload_size";
373
+ }>;
374
+ const Params: {
375
+ fromValues(input: {
376
+ proof_body_hdr_type_slot: number | bigint;
377
+ proof_body_payload_size: number | bigint;
378
+ }): Params;
379
+ fromBuilder(source: {
380
+ dynamicParams(): Params;
381
+ } | {
382
+ params: Params;
383
+ } | Params): Params;
384
+ };
385
+ function params(input: {
386
+ proof_body_hdr_type_slot: number | bigint;
387
+ proof_body_payload_size: number | bigint;
388
+ }): Params;
389
+ }
390
+ declare class StateProofBuilder {
391
+ private __tnPrefixBuffer;
392
+ private __tnPrefixView;
393
+ private __tnPayload_proof_body;
394
+ private __tnCachedParams;
395
+ private __tnLastBuffer;
396
+ private __tnLastParams;
397
+ private __tnVariantSelector_proof_body?;
398
+ constructor();
399
+ set_hdr(value: Uint8Array): this;
400
+ private __tnInvalidate;
401
+ proof_body(): __TnVariantSelectorResult$1<StateProofBuilder>;
402
+ build(): Uint8Array;
403
+ buildInto(target: Uint8Array, offset?: number): Uint8Array;
404
+ finish(): StateProof;
405
+ finishView(): StateProof;
406
+ dynamicParams(): StateProof.Params;
407
+ private __tnComputeParams;
408
+ private __tnWriteInto;
409
+ private __tnValidateOrThrow;
410
+ }
411
+
412
+ type __TnValidateResult = {
413
+ ok: boolean;
414
+ code?: string;
415
+ consumed?: bigint;
416
+ };
417
+ type __TnBuilderLike = {
418
+ build(): Uint8Array;
419
+ };
420
+ type __TnStructFieldInput = Uint8Array | __TnBuilderLike | {
421
+ buffer?: Uint8Array;
422
+ } | {
423
+ asUint8Array?: () => Uint8Array;
424
+ } | {
425
+ bytes?: () => Uint8Array;
426
+ };
427
+ type __TnVariantDescriptor = {
428
+ readonly name: string;
429
+ readonly tag: number;
430
+ readonly payloadSize: number | null;
431
+ readonly payloadType?: string;
432
+ readonly createPayloadBuilder?: () => unknown | null;
433
+ };
434
+ type __TnVariantSelectorResult<Parent> = {
435
+ select(name: string): {
436
+ writePayload(payload: Uint8Array | __TnBuilderLike): {
437
+ finish(): Parent;
438
+ };
439
+ };
440
+ finish(): Parent;
441
+ };
442
+ declare class BurnInstruction {
443
+ private buffer;
444
+ private view;
445
+ private constructor();
446
+ static __tnCreateView(buffer: Uint8Array, opts?: {
447
+ fieldContext?: Record<string, number | bigint>;
448
+ }): BurnInstruction;
449
+ static builder(): BurnInstructionBuilder;
450
+ static fromBuilder(builder: BurnInstructionBuilder): BurnInstruction | null;
451
+ get_token_account_index(): number;
452
+ set_token_account_index(value: number): void;
453
+ get token_account_index(): number;
454
+ set token_account_index(value: number);
455
+ get_mint_account_index(): number;
456
+ set_mint_account_index(value: number): void;
457
+ get mint_account_index(): number;
458
+ set mint_account_index(value: number);
459
+ get_authority_account_index(): number;
460
+ set_authority_account_index(value: number): void;
461
+ get authority_account_index(): number;
462
+ set authority_account_index(value: number);
463
+ get_amount(): bigint;
464
+ set_amount(value: bigint): void;
465
+ get amount(): bigint;
466
+ set amount(value: bigint);
467
+ private static __tnFootprintInternal;
468
+ private static __tnValidateInternal;
469
+ static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
470
+ static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
471
+ static footprintIr(): bigint;
472
+ static footprint(): number;
473
+ static validate(buffer: Uint8Array, _opts?: {
474
+ params?: never;
475
+ }): {
476
+ ok: boolean;
477
+ code?: string;
478
+ consumed?: number;
479
+ };
480
+ static new(token_account_index: number, mint_account_index: number, authority_account_index: number, amount: bigint): BurnInstruction;
481
+ static from_array(buffer: Uint8Array): BurnInstruction | null;
482
+ }
483
+ declare class BurnInstructionBuilder {
484
+ private buffer;
485
+ private view;
486
+ constructor();
487
+ set_token_account_index(value: number): this;
488
+ set_mint_account_index(value: number): this;
489
+ set_authority_account_index(value: number): this;
490
+ set_amount(value: number): this;
491
+ build(): Uint8Array;
492
+ buildInto(target: Uint8Array, offset?: number): Uint8Array;
493
+ finish(): BurnInstruction;
494
+ }
495
+ declare class CloseAccountInstruction {
496
+ private buffer;
497
+ private view;
498
+ private constructor();
499
+ static __tnCreateView(buffer: Uint8Array, opts?: {
500
+ fieldContext?: Record<string, number | bigint>;
501
+ }): CloseAccountInstruction;
502
+ static builder(): CloseAccountInstructionBuilder;
503
+ static fromBuilder(builder: CloseAccountInstructionBuilder): CloseAccountInstruction | null;
504
+ get_token_account_index(): number;
505
+ set_token_account_index(value: number): void;
506
+ get token_account_index(): number;
507
+ set token_account_index(value: number);
508
+ get_dest_account_index(): number;
509
+ set_dest_account_index(value: number): void;
510
+ get dest_account_index(): number;
511
+ set dest_account_index(value: number);
512
+ get_authority_account_index(): number;
513
+ set_authority_account_index(value: number): void;
514
+ get authority_account_index(): number;
515
+ set authority_account_index(value: number);
516
+ private static __tnFootprintInternal;
517
+ private static __tnValidateInternal;
518
+ static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
519
+ static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
520
+ static footprintIr(): bigint;
521
+ static footprint(): number;
522
+ static validate(buffer: Uint8Array, _opts?: {
523
+ params?: never;
524
+ }): {
525
+ ok: boolean;
526
+ code?: string;
527
+ consumed?: number;
528
+ };
529
+ static new(token_account_index: number, dest_account_index: number, authority_account_index: number): CloseAccountInstruction;
530
+ static from_array(buffer: Uint8Array): CloseAccountInstruction | null;
531
+ }
532
+ declare class CloseAccountInstructionBuilder {
533
+ private buffer;
534
+ private view;
535
+ constructor();
536
+ set_token_account_index(value: number): this;
537
+ set_dest_account_index(value: number): this;
538
+ set_authority_account_index(value: number): this;
539
+ build(): Uint8Array;
540
+ buildInto(target: Uint8Array, offset?: number): Uint8Array;
541
+ finish(): CloseAccountInstruction;
542
+ }
543
+ declare class FreezeAccountInstruction {
544
+ private buffer;
545
+ private view;
546
+ private constructor();
547
+ static __tnCreateView(buffer: Uint8Array, opts?: {
548
+ fieldContext?: Record<string, number | bigint>;
549
+ }): FreezeAccountInstruction;
550
+ static builder(): FreezeAccountInstructionBuilder;
551
+ static fromBuilder(builder: FreezeAccountInstructionBuilder): FreezeAccountInstruction | null;
552
+ get_token_account_index(): number;
553
+ set_token_account_index(value: number): void;
554
+ get token_account_index(): number;
555
+ set token_account_index(value: number);
556
+ get_mint_account_index(): number;
557
+ set_mint_account_index(value: number): void;
558
+ get mint_account_index(): number;
559
+ set mint_account_index(value: number);
560
+ get_authority_account_index(): number;
561
+ set_authority_account_index(value: number): void;
562
+ get authority_account_index(): number;
563
+ set authority_account_index(value: number);
564
+ private static __tnFootprintInternal;
565
+ private static __tnValidateInternal;
566
+ static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
567
+ static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
568
+ static footprintIr(): bigint;
569
+ static footprint(): number;
570
+ static validate(buffer: Uint8Array, _opts?: {
571
+ params?: never;
572
+ }): {
573
+ ok: boolean;
574
+ code?: string;
575
+ consumed?: number;
576
+ };
577
+ static new(token_account_index: number, mint_account_index: number, authority_account_index: number): FreezeAccountInstruction;
578
+ static from_array(buffer: Uint8Array): FreezeAccountInstruction | null;
579
+ }
580
+ declare class FreezeAccountInstructionBuilder {
581
+ private buffer;
582
+ private view;
583
+ constructor();
584
+ set_token_account_index(value: number): this;
585
+ set_mint_account_index(value: number): this;
586
+ set_authority_account_index(value: number): this;
587
+ build(): Uint8Array;
588
+ buildInto(target: Uint8Array, offset?: number): Uint8Array;
589
+ finish(): FreezeAccountInstruction;
590
+ }
591
+ declare class MintToInstruction {
592
+ private buffer;
593
+ private view;
594
+ private constructor();
595
+ static __tnCreateView(buffer: Uint8Array, opts?: {
596
+ fieldContext?: Record<string, number | bigint>;
597
+ }): MintToInstruction;
598
+ static builder(): MintToInstructionBuilder;
599
+ static fromBuilder(builder: MintToInstructionBuilder): MintToInstruction | null;
600
+ get_mint_account_index(): number;
601
+ set_mint_account_index(value: number): void;
602
+ get mint_account_index(): number;
603
+ set mint_account_index(value: number);
604
+ get_dest_account_index(): number;
605
+ set_dest_account_index(value: number): void;
606
+ get dest_account_index(): number;
607
+ set dest_account_index(value: number);
608
+ get_authority_account_index(): number;
609
+ set_authority_account_index(value: number): void;
610
+ get authority_account_index(): number;
611
+ set authority_account_index(value: number);
612
+ get_amount(): bigint;
613
+ set_amount(value: bigint): void;
614
+ get amount(): bigint;
615
+ set amount(value: bigint);
616
+ private static __tnFootprintInternal;
617
+ private static __tnValidateInternal;
618
+ static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
619
+ static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
620
+ static footprintIr(): bigint;
621
+ static footprint(): number;
622
+ static validate(buffer: Uint8Array, _opts?: {
623
+ params?: never;
624
+ }): {
625
+ ok: boolean;
626
+ code?: string;
627
+ consumed?: number;
628
+ };
629
+ static new(mint_account_index: number, dest_account_index: number, authority_account_index: number, amount: bigint): MintToInstruction;
630
+ static from_array(buffer: Uint8Array): MintToInstruction | null;
631
+ }
632
+ declare class MintToInstructionBuilder {
633
+ private buffer;
634
+ private view;
635
+ constructor();
636
+ set_mint_account_index(value: number): this;
637
+ set_dest_account_index(value: number): this;
638
+ set_authority_account_index(value: number): this;
639
+ set_amount(value: number): this;
640
+ build(): Uint8Array;
641
+ buildInto(target: Uint8Array, offset?: number): Uint8Array;
642
+ finish(): MintToInstruction;
643
+ }
644
+ declare class Seed32 {
645
+ private buffer;
646
+ private view;
647
+ private constructor();
648
+ private static readonly __tnElementSize;
649
+ private static readonly __tnElementCount;
650
+ get length(): number;
651
+ getElementBytes(index: number): Uint8Array;
652
+ static from_array(buffer: Uint8Array): Seed32 | null;
653
+ asUint8Array(): Uint8Array;
654
+ private static __tnFootprintInternal;
655
+ private static __tnValidateInternal;
656
+ static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
657
+ static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
658
+ static footprintIr(): bigint;
659
+ static footprint(): number;
660
+ static validate(buffer: Uint8Array, _opts?: {
661
+ params?: never;
662
+ }): {
663
+ ok: boolean;
664
+ code?: string;
665
+ consumed?: number;
666
+ };
667
+ }
668
+ declare class ThawAccountInstruction {
669
+ private buffer;
670
+ private view;
671
+ private constructor();
672
+ static __tnCreateView(buffer: Uint8Array, opts?: {
673
+ fieldContext?: Record<string, number | bigint>;
674
+ }): ThawAccountInstruction;
675
+ static builder(): ThawAccountInstructionBuilder;
676
+ static fromBuilder(builder: ThawAccountInstructionBuilder): ThawAccountInstruction | null;
677
+ get_token_account_index(): number;
678
+ set_token_account_index(value: number): void;
679
+ get token_account_index(): number;
680
+ set token_account_index(value: number);
681
+ get_mint_account_index(): number;
682
+ set_mint_account_index(value: number): void;
683
+ get mint_account_index(): number;
684
+ set mint_account_index(value: number);
685
+ get_authority_account_index(): number;
686
+ set_authority_account_index(value: number): void;
687
+ get authority_account_index(): number;
688
+ set authority_account_index(value: number);
689
+ private static __tnFootprintInternal;
690
+ private static __tnValidateInternal;
691
+ static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
692
+ static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
693
+ static footprintIr(): bigint;
694
+ static footprint(): number;
695
+ static validate(buffer: Uint8Array, _opts?: {
696
+ params?: never;
697
+ }): {
698
+ ok: boolean;
699
+ code?: string;
700
+ consumed?: number;
701
+ };
702
+ static new(token_account_index: number, mint_account_index: number, authority_account_index: number): ThawAccountInstruction;
703
+ static from_array(buffer: Uint8Array): ThawAccountInstruction | null;
704
+ }
705
+ declare class ThawAccountInstructionBuilder {
706
+ private buffer;
707
+ private view;
708
+ constructor();
709
+ set_token_account_index(value: number): this;
710
+ set_mint_account_index(value: number): this;
711
+ set_authority_account_index(value: number): this;
712
+ build(): Uint8Array;
713
+ buildInto(target: Uint8Array, offset?: number): Uint8Array;
714
+ finish(): ThawAccountInstruction;
715
+ }
716
+ declare class TickerField {
717
+ private buffer;
718
+ private view;
719
+ private constructor();
720
+ static __tnCreateView(buffer: Uint8Array, opts?: {
721
+ fieldContext?: Record<string, number | bigint>;
722
+ }): TickerField;
723
+ static builder(): TickerFieldBuilder;
724
+ static fromBuilder(builder: TickerFieldBuilder): TickerField | null;
725
+ get_length(): number;
726
+ set_length(value: number): void;
727
+ get length(): number;
728
+ set length(value: number);
729
+ get_bytes(): number[];
730
+ set_bytes(value: number[]): void;
731
+ get bytes(): number[];
732
+ set bytes(value: number[]);
733
+ private static __tnFootprintInternal;
734
+ private static __tnValidateInternal;
735
+ static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
736
+ static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
737
+ static footprintIr(): bigint;
738
+ static footprint(): number;
739
+ static validate(buffer: Uint8Array, _opts?: {
740
+ params?: never;
741
+ }): {
742
+ ok: boolean;
743
+ code?: string;
744
+ consumed?: number;
745
+ };
746
+ static from_array(buffer: Uint8Array): TickerField | null;
747
+ }
748
+ declare class TickerFieldBuilder {
749
+ private buffer;
750
+ private view;
751
+ constructor();
752
+ set_length(value: number): this;
753
+ set_bytes(values: number[]): this;
754
+ build(): Uint8Array;
755
+ buildInto(target: Uint8Array, offset?: number): Uint8Array;
756
+ finish(): TickerField;
757
+ }
758
+ declare class TransferInstruction {
759
+ private buffer;
760
+ private view;
761
+ private constructor();
762
+ static __tnCreateView(buffer: Uint8Array, opts?: {
763
+ fieldContext?: Record<string, number | bigint>;
764
+ }): TransferInstruction;
765
+ static builder(): TransferInstructionBuilder;
766
+ static fromBuilder(builder: TransferInstructionBuilder): TransferInstruction | null;
767
+ get_source_account_index(): number;
768
+ set_source_account_index(value: number): void;
769
+ get source_account_index(): number;
770
+ set source_account_index(value: number);
771
+ get_dest_account_index(): number;
772
+ set_dest_account_index(value: number): void;
773
+ get dest_account_index(): number;
774
+ set dest_account_index(value: number);
775
+ get_amount(): bigint;
776
+ set_amount(value: bigint): void;
777
+ get amount(): bigint;
778
+ set amount(value: bigint);
779
+ private static __tnFootprintInternal;
780
+ private static __tnValidateInternal;
781
+ static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
782
+ static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
783
+ static footprintIr(): bigint;
784
+ static footprint(): number;
785
+ static validate(buffer: Uint8Array, _opts?: {
786
+ params?: never;
787
+ }): {
788
+ ok: boolean;
789
+ code?: string;
790
+ consumed?: number;
791
+ };
792
+ static new(source_account_index: number, dest_account_index: number, amount: bigint): TransferInstruction;
793
+ static from_array(buffer: Uint8Array): TransferInstruction | null;
794
+ }
795
+ declare class TransferInstructionBuilder {
796
+ private buffer;
797
+ private view;
798
+ constructor();
799
+ set_source_account_index(value: number): this;
800
+ set_dest_account_index(value: number): this;
801
+ set_amount(value: number): this;
802
+ build(): Uint8Array;
803
+ buildInto(target: Uint8Array, offset?: number): Uint8Array;
804
+ finish(): TransferInstruction;
805
+ }
806
+ declare class InitializeAccountInstruction {
807
+ private buffer;
808
+ private view;
809
+ private constructor();
810
+ static __tnCreateView(buffer: Uint8Array, opts?: {
811
+ fieldContext?: Record<string, number | bigint>;
812
+ }): InitializeAccountInstruction;
813
+ static builder(): InitializeAccountInstructionBuilder;
814
+ static fromBuilder(builder: InitializeAccountInstructionBuilder): InitializeAccountInstruction | null;
815
+ get_token_account_index(): number;
816
+ set_token_account_index(value: number): void;
817
+ get token_account_index(): number;
818
+ set token_account_index(value: number);
819
+ get_mint_account_index(): number;
820
+ set_mint_account_index(value: number): void;
821
+ get mint_account_index(): number;
822
+ set mint_account_index(value: number);
823
+ get_owner_account_index(): number;
824
+ set_owner_account_index(value: number): void;
825
+ get owner_account_index(): number;
826
+ set owner_account_index(value: number);
827
+ get_new_account_seed(): Seed32;
828
+ set_new_account_seed(value: Seed32): void;
829
+ get new_account_seed(): Seed32;
830
+ set new_account_seed(value: Seed32);
831
+ get_state_proof(): StateProof;
832
+ set_state_proof(value: StateProof): void;
833
+ get state_proof(): StateProof;
834
+ set state_proof(value: StateProof);
835
+ private static __tnFootprintInternal;
836
+ private static __tnValidateInternal;
837
+ static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
838
+ static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
839
+ static footprintIr(): bigint;
840
+ static footprint(): number;
841
+ static validate(_buffer: Uint8Array, _opts?: {
842
+ params?: never;
843
+ }): {
844
+ ok: boolean;
845
+ code?: string;
846
+ consumed?: number;
847
+ };
848
+ static from_array(buffer: Uint8Array): InitializeAccountInstruction | null;
849
+ }
850
+ declare class InitializeAccountInstructionBuilder {
851
+ private buffer;
852
+ private view;
853
+ private __tnTail_state_proof;
854
+ constructor();
855
+ private __tnInvalidate;
856
+ set_token_account_index(value: number): this;
857
+ set_mint_account_index(value: number): this;
858
+ set_owner_account_index(value: number): this;
859
+ set_new_account_seed(value: Uint8Array): this;
860
+ set_state_proof(value: StateProof | __TnStructFieldInput): this;
861
+ build(): Uint8Array;
862
+ buildInto(target: Uint8Array, offset?: number): Uint8Array;
863
+ finish(): InitializeAccountInstruction;
864
+ finishView(): InitializeAccountInstruction;
865
+ private __tnCollectTailFragments;
866
+ private __tnComputeSize;
867
+ private __tnWriteInto;
868
+ private __tnValidateOrThrow;
869
+ }
870
+ declare class InitializeMintInstruction {
871
+ private buffer;
872
+ private view;
873
+ private constructor();
874
+ static __tnCreateView(buffer: Uint8Array, opts?: {
875
+ fieldContext?: Record<string, number | bigint>;
876
+ }): InitializeMintInstruction;
877
+ static builder(): InitializeMintInstructionBuilder;
878
+ static fromBuilder(builder: InitializeMintInstructionBuilder): InitializeMintInstruction | null;
879
+ get_mint_account_index(): number;
880
+ set_mint_account_index(value: number): void;
881
+ get mint_account_index(): number;
882
+ set mint_account_index(value: number);
883
+ get_decimals(): number;
884
+ set_decimals(value: number): void;
885
+ get decimals(): number;
886
+ set decimals(value: number);
887
+ get_creator(): Pubkey;
888
+ set_creator(value: Pubkey): void;
889
+ get creator(): Pubkey;
890
+ set creator(value: Pubkey);
891
+ get_mint_authority(): Pubkey;
892
+ set_mint_authority(value: Pubkey): void;
893
+ get mint_authority(): Pubkey;
894
+ set mint_authority(value: Pubkey);
895
+ get_freeze_authority(): Pubkey;
896
+ set_freeze_authority(value: Pubkey): void;
897
+ get freeze_authority(): Pubkey;
898
+ set freeze_authority(value: Pubkey);
899
+ get_has_freeze_authority(): number;
900
+ set_has_freeze_authority(value: number): void;
901
+ get has_freeze_authority(): number;
902
+ set has_freeze_authority(value: number);
903
+ get_ticker(): TickerField;
904
+ set_ticker(value: TickerField): void;
905
+ get ticker(): TickerField;
906
+ set ticker(value: TickerField);
907
+ get_seed(): Seed32;
908
+ set_seed(value: Seed32): void;
909
+ get seed(): Seed32;
910
+ set seed(value: Seed32);
911
+ get_state_proof(): StateProof;
912
+ set_state_proof(value: StateProof): void;
913
+ get state_proof(): StateProof;
914
+ set state_proof(value: StateProof);
915
+ private static __tnFootprintInternal;
916
+ private static __tnValidateInternal;
917
+ static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
918
+ static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
919
+ static footprintIr(): bigint;
920
+ static footprint(): number;
921
+ static validate(_buffer: Uint8Array, _opts?: {
922
+ params?: never;
923
+ }): {
924
+ ok: boolean;
925
+ code?: string;
926
+ consumed?: number;
927
+ };
928
+ static from_array(buffer: Uint8Array): InitializeMintInstruction | null;
929
+ }
930
+ declare class InitializeMintInstructionBuilder {
931
+ private buffer;
932
+ private view;
933
+ private __tnTail_state_proof;
934
+ constructor();
935
+ private __tnInvalidate;
936
+ set_mint_account_index(value: number): this;
937
+ set_decimals(value: number): this;
938
+ set_creator(value: Uint8Array): this;
939
+ set_mint_authority(value: Uint8Array): this;
940
+ set_freeze_authority(value: Uint8Array): this;
941
+ set_has_freeze_authority(value: number): this;
942
+ set_ticker(value: Uint8Array): this;
943
+ set_seed(value: Uint8Array): this;
944
+ set_state_proof(value: StateProof | __TnStructFieldInput): this;
945
+ build(): Uint8Array;
946
+ buildInto(target: Uint8Array, offset?: number): Uint8Array;
947
+ finish(): InitializeMintInstruction;
948
+ finishView(): InitializeMintInstruction;
949
+ private __tnCollectTailFragments;
950
+ private __tnComputeSize;
951
+ private __tnWriteInto;
952
+ private __tnValidateOrThrow;
953
+ }
954
+ declare class TokenInstruction_payload_Inner {
955
+ private buffer;
956
+ private descriptor;
957
+ private view;
958
+ private __tnFieldContext;
959
+ private constructor();
960
+ static __tnCreate(payload: Uint8Array, descriptor: __TnVariantDescriptor | null, fieldContext?: Record<string, number | bigint>): TokenInstruction_payload_Inner;
961
+ bytes(): Uint8Array;
962
+ variant(): __TnVariantDescriptor | null;
963
+ asInitializeMint(): InitializeMintInstruction | null;
964
+ asInitializeAccount(): InitializeAccountInstruction | null;
965
+ asTransfer(): TransferInstruction | null;
966
+ asMintTo(): MintToInstruction | null;
967
+ asBurn(): BurnInstruction | null;
968
+ asCloseAccount(): CloseAccountInstruction | null;
969
+ asFreezeAccount(): FreezeAccountInstruction | null;
970
+ asThawAccount(): ThawAccountInstruction | null;
971
+ }
972
+ declare class TokenInstruction {
973
+ private buffer;
974
+ private view;
975
+ private static readonly __tnFieldOffset_payload;
976
+ private __tnParams;
977
+ private constructor();
978
+ static __tnCreateView(buffer: Uint8Array, opts?: {
979
+ params?: TokenInstruction.Params;
980
+ }): TokenInstruction;
981
+ dynamicParams(): TokenInstruction.Params;
982
+ static builder(): TokenInstructionBuilder;
983
+ static fromBuilder(builder: TokenInstructionBuilder): TokenInstruction | null;
984
+ static readonly payloadVariantDescriptors: readonly [{
985
+ readonly name: "initialize_mint";
986
+ readonly tag: 0;
987
+ readonly payloadSize: null;
988
+ readonly payloadType: "TokenInstruction::payload::initialize_mint";
989
+ readonly createPayloadBuilder: () => unknown;
990
+ }, {
991
+ readonly name: "initialize_account";
992
+ readonly tag: 1;
993
+ readonly payloadSize: null;
994
+ readonly payloadType: "TokenInstruction::payload::initialize_account";
995
+ readonly createPayloadBuilder: () => unknown;
996
+ }, {
997
+ readonly name: "transfer";
998
+ readonly tag: 2;
999
+ readonly payloadSize: 12;
1000
+ readonly payloadType: "TokenInstruction::payload::transfer";
1001
+ readonly createPayloadBuilder: () => unknown;
1002
+ }, {
1003
+ readonly name: "mint_to";
1004
+ readonly tag: 3;
1005
+ readonly payloadSize: 14;
1006
+ readonly payloadType: "TokenInstruction::payload::mint_to";
1007
+ readonly createPayloadBuilder: () => unknown;
1008
+ }, {
1009
+ readonly name: "burn";
1010
+ readonly tag: 4;
1011
+ readonly payloadSize: 14;
1012
+ readonly payloadType: "TokenInstruction::payload::burn";
1013
+ readonly createPayloadBuilder: () => unknown;
1014
+ }, {
1015
+ readonly name: "close_account";
1016
+ readonly tag: 5;
1017
+ readonly payloadSize: 6;
1018
+ readonly payloadType: "TokenInstruction::payload::close_account";
1019
+ readonly createPayloadBuilder: () => unknown;
1020
+ }, {
1021
+ readonly name: "freeze_account";
1022
+ readonly tag: 6;
1023
+ readonly payloadSize: 6;
1024
+ readonly payloadType: "TokenInstruction::payload::freeze_account";
1025
+ readonly createPayloadBuilder: () => unknown;
1026
+ }, {
1027
+ readonly name: "thaw_account";
1028
+ readonly tag: 7;
1029
+ readonly payloadSize: 6;
1030
+ readonly payloadType: "TokenInstruction::payload::thaw_account";
1031
+ readonly createPayloadBuilder: () => unknown;
1032
+ }];
1033
+ static __tnComputeSequentialLayout(view: DataView, buffer: Uint8Array): {
1034
+ params: Record<string, bigint> | null;
1035
+ offsets: Record<string, number> | null;
1036
+ derived: Record<string, bigint> | null;
1037
+ } | null;
1038
+ private static __tnExtractParams;
1039
+ get_tag(): number;
1040
+ set_tag(value: number): void;
1041
+ get tag(): number;
1042
+ set tag(value: number);
1043
+ payloadVariant(): typeof TokenInstruction.payloadVariantDescriptors[number] | null;
1044
+ payload(): TokenInstruction_payload_Inner;
1045
+ private static __tnFootprintInternal;
1046
+ private static __tnValidateInternal;
1047
+ static __tnInvokeFootprint(__tnParams: Record<string, bigint>): bigint;
1048
+ static __tnInvokeValidate(buffer: Uint8Array, __tnParams: Record<string, bigint>): __TnValidateResult;
1049
+ static footprintIr(payload_payload_size: number | bigint, payload_tag: number | bigint): bigint;
1050
+ private static __tnPackParams;
1051
+ static footprintIrFromParams(params: TokenInstruction.Params): bigint;
1052
+ static footprintFromParams(params: TokenInstruction.Params): number;
1053
+ static footprintFromValues(input: {
1054
+ payload_payload_size: number | bigint;
1055
+ payload_tag: number | bigint;
1056
+ }): number;
1057
+ static footprint(params: TokenInstruction.Params): number;
1058
+ static validate(buffer: Uint8Array, opts?: {
1059
+ params?: TokenInstruction.Params;
1060
+ }): {
1061
+ ok: boolean;
1062
+ code?: string;
1063
+ consumed?: number;
1064
+ params?: TokenInstruction.Params;
1065
+ };
1066
+ static from_array(buffer: Uint8Array, opts?: {
1067
+ params?: TokenInstruction.Params;
1068
+ }): TokenInstruction | null;
1069
+ }
1070
+ declare namespace TokenInstruction {
1071
+ type Params = {
1072
+ /** ABI path: payload.payload_size */
1073
+ readonly payload_payload_size: bigint;
1074
+ /** ABI path: payload.tag */
1075
+ readonly payload_tag: bigint;
1076
+ };
1077
+ const ParamKeys: Readonly<{
1078
+ readonly payload_payload_size: "payload.payload_size";
1079
+ readonly payload_tag: "payload.tag";
1080
+ }>;
1081
+ const Params: {
1082
+ fromValues(input: {
1083
+ payload_payload_size: number | bigint;
1084
+ payload_tag: number | bigint;
1085
+ }): Params;
1086
+ fromBuilder(source: {
1087
+ dynamicParams(): Params;
1088
+ } | {
1089
+ params: Params;
1090
+ } | Params): Params;
1091
+ };
1092
+ function params(input: {
1093
+ payload_payload_size: number | bigint;
1094
+ payload_tag: number | bigint;
1095
+ }): Params;
1096
+ }
1097
+ declare class TokenInstructionBuilder {
1098
+ private __tnPrefixBuffer;
1099
+ private __tnPrefixView;
1100
+ private __tnField_tag;
1101
+ private __tnPayload_payload;
1102
+ private __tnCachedParams;
1103
+ private __tnLastBuffer;
1104
+ private __tnLastParams;
1105
+ private __tnVariantSelector_payload?;
1106
+ constructor();
1107
+ private __tnInvalidate;
1108
+ private __tnAssign_tag;
1109
+ set_tag(value: number): this;
1110
+ payload(): __TnVariantSelectorResult<TokenInstructionBuilder>;
1111
+ build(): Uint8Array;
1112
+ buildInto(target: Uint8Array, offset?: number): Uint8Array;
1113
+ finish(): TokenInstruction;
1114
+ finishView(): TokenInstruction;
1115
+ dynamicParams(): TokenInstruction.Params;
1116
+ private __tnComputeParams;
1117
+ private __tnWriteInto;
1118
+ private __tnValidateOrThrow;
1119
+ }
1120
+
1121
+ type TokenInstructionVariantName = (typeof TokenInstruction.payloadVariantDescriptors)[number]['name'];
1122
+ declare function buildTokenInstructionBytes(variant: TokenInstructionVariantName, payload: Uint8Array): Uint8Array;
1123
+
1124
+ declare function deriveMintAddress(mintAuthorityAddress: string, seed: string, tokenProgramAddress: string): {
1125
+ address: string;
1126
+ bytes: Uint8Array;
1127
+ derivedSeed: Uint8Array;
1128
+ };
1129
+ declare function deriveTokenAccountAddress(ownerAddress: string, mintAddress: string, tokenProgramAddress: string, seed?: Uint8Array): {
1130
+ address: string;
1131
+ bytes: Uint8Array;
1132
+ derivedSeed: Uint8Array;
1133
+ };
1134
+ declare function deriveWalletSeed(walletAddress: string, extraSeeds?: Uint8Array[]): Uint8Array;
1135
+
1136
+ declare function parseMintAccountData(account: Account): MintAccountInfo;
1137
+ declare function parseTokenAccountData(account: Account): TokenAccountInfo;
1138
+ declare function isAccountNotFoundError(err: unknown): boolean;
1139
+
1140
+ declare function formatRawAmount(amount: bigint, decimals: number): string;
1141
+ declare function bytesToHex(bytes: Uint8Array): string;
1142
+ declare function hexToBytes(hex: string): Uint8Array;
1143
+
1144
+ export { type AccountLookupContext, type InitializeAccountArgs, type InitializeMintArgs, type InstructionData, type MintAccountInfo, type MintToArgs, PUBKEY_LENGTH, TICKER_MAX_LENGTH, type TokenAccountInfo, type TransferArgs, ZERO_PUBKEY, buildTokenInstructionBytes, bytesToHex, createInitializeAccountInstruction, createInitializeMintInstruction, createMintToInstruction, createTransferInstruction, deriveMintAddress, deriveTokenAccountAddress, deriveWalletSeed, formatRawAmount, hexToBytes, isAccountNotFoundError, parseMintAccountData, parseTokenAccountData };