@solana/web3.js 1.37.3 → 1.38.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.
Files changed (3) hide show
  1. package/README.md +4 -3
  2. package/package.json +2 -7
  3. package/module.flow.js +0 -4412
package/module.flow.js DELETED
@@ -1,4412 +0,0 @@
1
- /**
2
- * Flowtype definitions for index
3
- * Generated by Flowgen from a Typescript Definition
4
- * Flowgen v1.17.0
5
- */
6
-
7
- declare module "@solana/web3.js" {
8
- import type { Buffer } from "buffer";
9
-
10
- declare export class Struct {
11
- constructor(properties: any): this;
12
- encode(): Buffer;
13
- static decode(data: Buffer): any;
14
- static decodeUnchecked(data: Buffer): any;
15
- }
16
- declare export class Enum mixins Struct {
17
- enum: string;
18
- constructor(properties: any): this;
19
- }
20
- declare export var SOLANA_SCHEMA: Map<Function, any>;
21
-
22
- /**
23
- * Maximum length of derived pubkey seed
24
- */
25
- declare export var MAX_SEED_LENGTH: 32;
26
-
27
- /**
28
- * Value to be converted into public key
29
- */
30
- declare export type PublicKeyInitData =
31
- | number
32
- | string
33
- | Buffer
34
- | Uint8Array
35
- | Array<number>
36
- | PublicKeyData;
37
-
38
- /**
39
- * JSON object representation of PublicKey class
40
- */
41
- declare export type PublicKeyData = { ... };
42
-
43
- /**
44
- * A public key
45
- */
46
- declare export class PublicKey mixins Struct {
47
- /**
48
- * Create a new PublicKey object
49
- * @param value ed25519 public key as buffer or base-58 encoded string
50
- */
51
- constructor(value: PublicKeyInitData): this;
52
-
53
- /**
54
- * Default public key value. (All zeros)
55
- */
56
- static default: PublicKey;
57
-
58
- /**
59
- * Checks if two publicKeys are equal
60
- */
61
- equals(publicKey: PublicKey): boolean;
62
-
63
- /**
64
- * Return the base-58 representation of the public key
65
- */
66
- toBase58(): string;
67
- toJSON(): string;
68
-
69
- /**
70
- * Return the byte array representation of the public key
71
- */
72
- toBytes(): Uint8Array;
73
-
74
- /**
75
- * Return the Buffer representation of the public key
76
- */
77
- toBuffer(): Buffer;
78
-
79
- /**
80
- * Return the base-58 representation of the public key
81
- */
82
- toString(): string;
83
-
84
- /**
85
- * Derive a public key from another key, a seed, and a program ID.
86
- * The program ID will also serve as the owner of the public key, giving
87
- * it permission to write data to the account.
88
- */
89
- static createWithSeed(
90
- fromPublicKey: PublicKey,
91
- seed: string,
92
- programId: PublicKey
93
- ): Promise<PublicKey>;
94
-
95
- /**
96
- * Derive a program address from seeds and a program ID.
97
- */
98
- static createProgramAddress(
99
- seeds: Array<Buffer | Uint8Array>,
100
- programId: PublicKey
101
- ): Promise<PublicKey>;
102
-
103
- /**
104
- * Find a valid program address
105
- *
106
- * Valid program addresses must fall off the ed25519 curve. This function
107
- * iterates a nonce until it finds one that when combined with the seeds
108
- * results in a valid program address.
109
- */
110
- static findProgramAddress(
111
- seeds: Array<Buffer | Uint8Array>,
112
- programId: PublicKey
113
- ): Promise<[PublicKey, number]>;
114
-
115
- /**
116
- * Check that a pubkey is on the ed25519 curve.
117
- */
118
- static isOnCurve(pubkey: Uint8Array): boolean;
119
- }
120
-
121
- /**
122
- * An account key pair (public and secret keys).
123
- * @deprecated [object Object],[object Object],[object Object]
124
- */
125
- declare export class Account {
126
- /**
127
- * Create a new Account object
128
- *
129
- * If the secretKey parameter is not provided a new key pair is randomly
130
- * created for the account
131
- * @param secretKey Secret key for the account
132
- */
133
- constructor(secretKey?: Buffer | Uint8Array | Array<number>): this;
134
-
135
- /**
136
- * The public key for this account
137
- */
138
- publicKey: PublicKey;
139
-
140
- /**
141
- * The **unencrypted** secret key for this account
142
- */
143
- secretKey: Buffer;
144
- }
145
-
146
- /**
147
- * Blockhash as Base58 string.
148
- */
149
- declare export type Blockhash = string;
150
- declare export var BPF_LOADER_DEPRECATED_PROGRAM_ID: PublicKey;
151
-
152
- /**
153
- * [object Object],[object Object],[object Object]
154
- */
155
- declare export class EpochSchedule {
156
- /**
157
- * The maximum number of slots in each epoch
158
- */
159
- slotsPerEpoch: number;
160
-
161
- /**
162
- * The number of slots before beginning of an epoch to calculate a leader schedule for that epoch
163
- */
164
- leaderScheduleSlotOffset: number;
165
-
166
- /**
167
- * Indicates whether epochs start short and grow
168
- */
169
- warmup: boolean;
170
-
171
- /**
172
- * The first epoch with `slotsPerEpoch` slots
173
- */
174
- firstNormalEpoch: number;
175
-
176
- /**
177
- * The first slot of `firstNormalEpoch`
178
- */
179
- firstNormalSlot: number;
180
- constructor(
181
- slotsPerEpoch: number,
182
- leaderScheduleSlotOffset: number,
183
- warmup: boolean,
184
- firstNormalEpoch: number,
185
- firstNormalSlot: number
186
- ): this;
187
- getEpoch(slot: number): number;
188
- getEpochAndSlotIndex(slot: number): [number, number];
189
- getFirstSlotInEpoch(epoch: number): number;
190
- getLastSlotInEpoch(epoch: number): number;
191
- getSlotsInEpoch(epoch: number): number;
192
- }
193
-
194
- /**
195
- * Calculator for transaction fees.
196
- */
197
- declare interface FeeCalculator {
198
- /**
199
- * Cost in lamports to validate a signature.
200
- */
201
- lamportsPerSignature: number;
202
- }
203
- declare export var NONCE_ACCOUNT_LENGTH: number;
204
-
205
- /**
206
- * NonceAccount class
207
- */
208
- declare export class NonceAccount {
209
- authorizedPubkey: PublicKey;
210
- nonce: Blockhash;
211
- feeCalculator: FeeCalculator;
212
-
213
- /**
214
- * Deserialize NonceAccount from the account data.
215
- * @param buffer account data
216
- * @return NonceAccount
217
- */
218
- static fromAccountData(
219
- buffer: Buffer | Uint8Array | Array<number>
220
- ): NonceAccount;
221
- }
222
-
223
- /**
224
- * Keypair signer interface
225
- */
226
- declare interface Signer {
227
- publicKey: PublicKey;
228
- secretKey: Uint8Array;
229
- }
230
-
231
- /**
232
- * Ed25519 Keypair
233
- */
234
- declare interface Ed25519Keypair {
235
- publicKey: Uint8Array;
236
- secretKey: Uint8Array;
237
- }
238
-
239
- /**
240
- * An account keypair used for signing transactions.
241
- */
242
- declare export class Keypair {
243
- /**
244
- * [object Object],[object Object],[object Object]
245
- * @param keypair ed25519 keypair
246
- */
247
- constructor(keypair?: Ed25519Keypair): this;
248
-
249
- /**
250
- * Generate a new random keypair
251
- */
252
- static generate(): Keypair;
253
-
254
- /**
255
- * [object Object],[object Object],[object Object]
256
- * @throws error if the provided secret key is invalid and validation is not skipped.
257
- * @param secretKey secret key byte array
258
- * @param options : skip secret key validation
259
- */
260
- static fromSecretKey(
261
- secretKey: Uint8Array,
262
- options?: {
263
- skipValidation?: boolean,
264
- ...
265
- }
266
- ): Keypair;
267
-
268
- /**
269
- * Generate a keypair from a 32 byte seed.
270
- * @param seed seed byte array
271
- */
272
- static fromSeed(seed: Uint8Array): Keypair;
273
-
274
- /**
275
- * The public key for this keypair
276
- */
277
- publicKey: PublicKey;
278
-
279
- /**
280
- * The raw secret key for this keypair
281
- */
282
- secretKey: Uint8Array;
283
- }
284
-
285
- /**
286
- * The message header, identifying signed and read-only account
287
- */
288
- declare export type MessageHeader = {
289
- /**
290
- * The number of signatures required for this message to be considered valid. The
291
- * signatures must match the first `numRequiredSignatures` of `accountKeys`.
292
- */
293
- numRequiredSignatures: number,
294
-
295
- /**
296
- * The last `numReadonlySignedAccounts` of the signed keys are read-only accounts
297
- */
298
- numReadonlySignedAccounts: number,
299
-
300
- /**
301
- * The last `numReadonlySignedAccounts` of the unsigned keys are read-only accounts
302
- */
303
- numReadonlyUnsignedAccounts: number,
304
- ...
305
- };
306
-
307
- /**
308
- * An instruction to execute by a program
309
- * @property {number} programIdIndex
310
- * @property {number[]} accounts
311
- * @property {string} data
312
- */
313
- declare export type CompiledInstruction = {
314
- /**
315
- * Index into the transaction keys array indicating the program account that executes this instruction
316
- */
317
- programIdIndex: number,
318
-
319
- /**
320
- * Ordered indices into the transaction keys array indicating which accounts to pass to the program
321
- */
322
- accounts: number[],
323
-
324
- /**
325
- * The program input data encoded as base 58
326
- */
327
- data: string,
328
- ...
329
- };
330
-
331
- /**
332
- * Message constructor arguments
333
- */
334
- declare export type MessageArgs = {
335
- /**
336
- * The message header, identifying signed and read-only `accountKeys`
337
- */
338
- header: MessageHeader,
339
-
340
- /**
341
- * All the account keys used by this transaction
342
- */
343
- accountKeys: string[],
344
-
345
- /**
346
- * The hash of a recent ledger block
347
- */
348
- recentBlockhash: Blockhash,
349
-
350
- /**
351
- * Instructions that will be executed in sequence and committed in one atomic transaction if all succeed.
352
- */
353
- instructions: CompiledInstruction[],
354
- ...
355
- };
356
-
357
- /**
358
- * List of instructions to be processed atomically
359
- */
360
- declare export class Message {
361
- header: MessageHeader;
362
- accountKeys: PublicKey[];
363
- recentBlockhash: Blockhash;
364
- instructions: CompiledInstruction[];
365
- constructor(args: MessageArgs): this;
366
- isAccountSigner(index: number): boolean;
367
- isAccountWritable(index: number): boolean;
368
- isProgramId(index: number): boolean;
369
- programIds(): PublicKey[];
370
- nonProgramIds(): PublicKey[];
371
- serialize(): Buffer;
372
-
373
- /**
374
- * Decode a compiled message into a Message object.
375
- */
376
- static from(buffer: Buffer | Uint8Array | Array<number>): Message;
377
- }
378
-
379
- /**
380
- * Transaction signature as base-58 encoded string
381
- */
382
- declare export type TransactionSignature = string;
383
-
384
- /**
385
- * Maximum over-the-wire size of a Transaction
386
- *
387
- * 1280 is IPv6 minimum MTU
388
- * 40 bytes is the size of the IPv6 header
389
- * 8 bytes is the size of the fragment header
390
- */
391
- declare export var PACKET_DATA_SIZE: number;
392
-
393
- /**
394
- * Account metadata used to define instructions
395
- */
396
- declare export type AccountMeta = {
397
- /**
398
- * An account's public key
399
- */
400
- pubkey: PublicKey,
401
-
402
- /**
403
- * True if an instruction requires a transaction signature matching `pubkey`
404
- */
405
- isSigner: boolean,
406
-
407
- /**
408
- * True if the `pubkey` can be loaded as a read-write account.
409
- */
410
- isWritable: boolean,
411
- ...
412
- };
413
-
414
- /**
415
- * List of TransactionInstruction object fields that may be initialized at construction
416
- */
417
- declare export type TransactionInstructionCtorFields = {
418
- keys: Array<AccountMeta>,
419
- programId: PublicKey,
420
- data?: Buffer,
421
- ...
422
- };
423
-
424
- /**
425
- * Configuration object for Transaction.serialize()
426
- */
427
- declare export type SerializeConfig = {
428
- /**
429
- * Require all transaction signatures be present (default: true)
430
- */
431
- requireAllSignatures?: boolean,
432
-
433
- /**
434
- * Verify provided signatures (default: true)
435
- */
436
- verifySignatures?: boolean,
437
- ...
438
- };
439
-
440
- /**
441
- * Transaction Instruction class
442
- */
443
- declare export class TransactionInstruction {
444
- /**
445
- * Public keys to include in this transaction
446
- * Boolean represents whether this pubkey needs to sign the transaction
447
- */
448
- keys: Array<AccountMeta>;
449
-
450
- /**
451
- * Program Id to execute
452
- */
453
- programId: PublicKey;
454
-
455
- /**
456
- * Program input
457
- */
458
- data: Buffer;
459
- constructor(opts: TransactionInstructionCtorFields): this;
460
- }
461
-
462
- /**
463
- * Pair of signature and corresponding public key
464
- */
465
- declare export type SignaturePubkeyPair = {
466
- signature: Buffer | null,
467
- publicKey: PublicKey,
468
- ...
469
- };
470
-
471
- /**
472
- * List of Transaction object fields that may be initialized at construction
473
- */
474
- declare export type TransactionCtorFields = {
475
- /**
476
- * A recent blockhash
477
- */
478
- recentBlockhash?: Blockhash | null,
479
-
480
- /**
481
- * Optional nonce information used for offline nonce'd transactions
482
- */
483
- nonceInfo?: NonceInformation | null,
484
-
485
- /**
486
- * The transaction fee payer
487
- */
488
- feePayer?: PublicKey | null,
489
-
490
- /**
491
- * One or more signatures
492
- */
493
- signatures?: Array<SignaturePubkeyPair>,
494
- ...
495
- };
496
-
497
- /**
498
- * Nonce information to be used to build an offline Transaction.
499
- */
500
- declare export type NonceInformation = {
501
- /**
502
- * The current blockhash stored in the nonce
503
- */
504
- nonce: Blockhash,
505
-
506
- /**
507
- * AdvanceNonceAccount Instruction
508
- */
509
- nonceInstruction: TransactionInstruction,
510
- ...
511
- };
512
-
513
- /**
514
- * Transaction class
515
- */
516
- declare export class Transaction {
517
- /**
518
- * Signatures for the transaction. Typically created by invoking the
519
- * `sign()` method
520
- */
521
- signatures: Array<SignaturePubkeyPair>;
522
-
523
- /**
524
- * The first (payer) Transaction signature
525
- */
526
- signature: Buffer | null;
527
-
528
- /**
529
- * The transaction fee payer
530
- */
531
- feePayer?: PublicKey;
532
-
533
- /**
534
- * The instructions to atomically execute
535
- */
536
- instructions: Array<TransactionInstruction>;
537
-
538
- /**
539
- * A recent transaction id. Must be populated by the caller
540
- */
541
- recentBlockhash?: Blockhash;
542
-
543
- /**
544
- * Optional Nonce information. If populated, transaction will use a durable
545
- * Nonce hash instead of a recentBlockhash. Must be populated by the caller
546
- */
547
- nonceInfo?: NonceInformation;
548
-
549
- /**
550
- * Construct an empty Transaction
551
- */
552
- constructor(opts?: TransactionCtorFields): this;
553
-
554
- /**
555
- * Add one or more instructions to this Transaction
556
- */
557
- add(
558
- ...items: Array<
559
- Transaction | TransactionInstruction | TransactionInstructionCtorFields
560
- >
561
- ): Transaction;
562
-
563
- /**
564
- * Compile transaction data
565
- */
566
- compileMessage(): Message;
567
-
568
- /**
569
- * Get a buffer of the Transaction data that need to be covered by signatures
570
- */
571
- serializeMessage(): Buffer;
572
-
573
- /**
574
- * Get the estimated fee associated with a transaction
575
- */
576
- getEstimatedFee(connection: Connection): Promise<number>;
577
-
578
- /**
579
- * Specify the public keys which will be used to sign the Transaction.
580
- * The first signer will be used as the transaction fee payer account.
581
- *
582
- * Signatures can be added with either `partialSign` or `addSignature`
583
- * @deprecated Deprecated since v0.84.0. Only the fee payer needs to be
584
- * specified and it can be set in the Transaction constructor or with the
585
- * `feePayer` property.
586
- */
587
- setSigners(...signers: Array<PublicKey>): void;
588
-
589
- /**
590
- * Sign the Transaction with the specified signers. Multiple signatures may
591
- * be applied to a Transaction. The first signature is considered "primary"
592
- * and is used identify and confirm transactions.
593
- *
594
- * If the Transaction `feePayer` is not set, the first signer will be used
595
- * as the transaction fee payer account.
596
- *
597
- * Transaction fields should not be modified after the first call to `sign`,
598
- * as doing so may invalidate the signature and cause the Transaction to be
599
- * rejected.
600
- *
601
- * The Transaction must be assigned a valid `recentBlockhash` before invoking this method
602
- */
603
- sign(...signers: Array<Signer>): void;
604
-
605
- /**
606
- * Partially sign a transaction with the specified accounts. All accounts must
607
- * correspond to either the fee payer or a signer account in the transaction
608
- * instructions.
609
- *
610
- * All the caveats from the `sign` method apply to `partialSign`
611
- */
612
- partialSign(...signers: Array<Signer>): void;
613
-
614
- /**
615
- * Add an externally created signature to a transaction. The public key
616
- * must correspond to either the fee payer or a signer account in the transaction
617
- * instructions.
618
- */
619
- addSignature(pubkey: PublicKey, signature: Buffer): void;
620
-
621
- /**
622
- * Verify signatures of a complete, signed Transaction
623
- */
624
- verifySignatures(): boolean;
625
-
626
- /**
627
- * Serialize the Transaction in the wire format.
628
- */
629
- serialize(config?: SerializeConfig): Buffer;
630
-
631
- /**
632
- * Parse a wire transaction into a Transaction object.
633
- */
634
- static from(buffer: Buffer | Uint8Array | Array<number>): Transaction;
635
-
636
- /**
637
- * Populate Transaction object from message and signatures
638
- */
639
- static populate(message: Message, signatures?: Array<string>): Transaction;
640
- }
641
- declare export type TokenAccountsFilter =
642
- | {
643
- mint: PublicKey,
644
- ...
645
- }
646
- | {
647
- programId: PublicKey,
648
- ...
649
- };
650
-
651
- /**
652
- * Extra contextual information for RPC responses
653
- */
654
- declare export type Context = {
655
- slot: number,
656
- ...
657
- };
658
-
659
- /**
660
- * Options for sending transactions
661
- */
662
- declare export type SendOptions = {
663
- /**
664
- * disable transaction verification step
665
- */
666
- skipPreflight?: boolean,
667
-
668
- /**
669
- * preflight commitment level
670
- */
671
- preflightCommitment?: Commitment,
672
-
673
- /**
674
- * Maximum number of times for the RPC node to retry sending the transaction to the leader.
675
- */
676
- maxRetries?: number,
677
- ...
678
- };
679
-
680
- /**
681
- * Options for confirming transactions
682
- */
683
- declare export type ConfirmOptions = {
684
- /**
685
- * disable transaction verification step
686
- */
687
- skipPreflight?: boolean,
688
-
689
- /**
690
- * desired commitment level
691
- */
692
- commitment?: Commitment,
693
-
694
- /**
695
- * preflight commitment level
696
- */
697
- preflightCommitment?: Commitment,
698
-
699
- /**
700
- * Maximum number of times for the RPC node to retry sending the transaction to the leader.
701
- */
702
- maxRetries?: number,
703
- ...
704
- };
705
-
706
- /**
707
- * Options for getConfirmedSignaturesForAddress2
708
- */
709
- declare export type ConfirmedSignaturesForAddress2Options = {
710
- /**
711
- * Start searching backwards from this transaction signature.
712
- * @remark If not provided the search starts from the highest max confirmed block.
713
- */
714
- before?: TransactionSignature,
715
-
716
- /**
717
- * Search until this transaction signature is reached, if found before `limit`.
718
- */
719
- until?: TransactionSignature,
720
-
721
- /**
722
- * Maximum transaction signatures to return (between 1 and 1,000, default: 1,000).
723
- */
724
- limit?: number,
725
- ...
726
- };
727
-
728
- /**
729
- * Options for getSignaturesForAddress
730
- */
731
- declare export type SignaturesForAddressOptions = {
732
- /**
733
- * Start searching backwards from this transaction signature.
734
- * @remark If not provided the search starts from the highest max confirmed block.
735
- */
736
- before?: TransactionSignature,
737
-
738
- /**
739
- * Search until this transaction signature is reached, if found before `limit`.
740
- */
741
- until?: TransactionSignature,
742
-
743
- /**
744
- * Maximum transaction signatures to return (between 1 and 1,000, default: 1,000).
745
- */
746
- limit?: number,
747
- ...
748
- };
749
-
750
- /**
751
- * RPC Response with extra contextual information
752
- */
753
- declare export type RpcResponseAndContext<T> = {
754
- /**
755
- * response context
756
- */
757
- context: Context,
758
-
759
- /**
760
- * response value
761
- */
762
- value: T,
763
- ...
764
- };
765
-
766
- /**
767
- * The level of commitment desired when querying state
768
- * <pre>
769
- * 'processed': Query the most recent block which has reached 1 confirmation by the connected node
770
- * 'confirmed': Query the most recent block which has reached 1 confirmation by the cluster
771
- * 'finalized': Query the most recent block which has been finalized by the cluster
772
- * </pre>
773
- */
774
- declare export type Commitment =
775
- | "processed"
776
- | "confirmed"
777
- | "finalized"
778
- | "recent"
779
- | "single"
780
- | "singleGossip"
781
- | "root"
782
- | "max";
783
-
784
- /**
785
- * A subset of Commitment levels, which are at least optimistically confirmed
786
- * <pre>
787
- * 'confirmed': Query the most recent block which has reached 1 confirmation by the cluster
788
- * 'finalized': Query the most recent block which has been finalized by the cluster
789
- * </pre>
790
- */
791
- declare export type Finality = "confirmed" | "finalized";
792
-
793
- /**
794
- * Filter for largest accounts query
795
- * <pre>
796
- * 'circulating': Return the largest accounts that are part of the circulating supply
797
- * 'nonCirculating': Return the largest accounts that are not part of the circulating supply
798
- * </pre>
799
- */
800
- declare export type LargestAccountsFilter = "circulating" | "nonCirculating";
801
-
802
- /**
803
- * Configuration object for changing `getLargestAccounts` query behavior
804
- */
805
- declare export type GetLargestAccountsConfig = {
806
- /**
807
- * The level of commitment desired
808
- */
809
- commitment?: Commitment,
810
-
811
- /**
812
- * Filter largest accounts by whether they are part of the circulating supply
813
- */
814
- filter?: LargestAccountsFilter,
815
- ...
816
- };
817
-
818
- /**
819
- * Configuration object for changing `getSupply` request behavior
820
- */
821
- declare export type GetSupplyConfig = {
822
- /**
823
- * The level of commitment desired
824
- */
825
- commitment?: Commitment,
826
-
827
- /**
828
- * Exclude non circulating accounts list from response
829
- */
830
- excludeNonCirculatingAccountsList?: boolean,
831
- ...
832
- };
833
-
834
- /**
835
- * Configuration object for changing query behavior
836
- */
837
- declare export type SignatureStatusConfig = {
838
- /**
839
- * enable searching status history, not needed for recent transactions
840
- */
841
- searchTransactionHistory: boolean,
842
- ...
843
- };
844
-
845
- /**
846
- * Information describing a cluster node
847
- */
848
- declare export type ContactInfo = {
849
- /**
850
- * Identity public key of the node
851
- */
852
- pubkey: string,
853
-
854
- /**
855
- * Gossip network address for the node
856
- */
857
- gossip: string | null,
858
-
859
- /**
860
- * TPU network address for the node (null if not available)
861
- */
862
- tpu: string | null,
863
-
864
- /**
865
- * JSON RPC network address for the node (null if not available)
866
- */
867
- rpc: string | null,
868
-
869
- /**
870
- * Software version of the node (null if not available)
871
- */
872
- version: string | null,
873
- ...
874
- };
875
-
876
- /**
877
- * Information describing a vote account
878
- */
879
- declare export type VoteAccountInfo = {
880
- /**
881
- * Public key of the vote account
882
- */
883
- votePubkey: string,
884
-
885
- /**
886
- * Identity public key of the node voting with this account
887
- */
888
- nodePubkey: string,
889
-
890
- /**
891
- * The stake, in lamports, delegated to this vote account and activated
892
- */
893
- activatedStake: number,
894
-
895
- /**
896
- * Whether the vote account is staked for this epoch
897
- */
898
- epochVoteAccount: boolean,
899
-
900
- /**
901
- * Recent epoch voting credit history for this voter
902
- */
903
- epochCredits: Array<[number, number, number]>,
904
-
905
- /**
906
- * A percentage (0-100) of rewards payout owed to the voter
907
- */
908
- commission: number,
909
-
910
- /**
911
- * Most recent slot voted on by this vote account
912
- */
913
- lastVote: number,
914
- ...
915
- };
916
-
917
- /**
918
- * A collection of cluster vote accounts
919
- */
920
- declare export type VoteAccountStatus = {
921
- /**
922
- * Active vote accounts
923
- */
924
- current: Array<VoteAccountInfo>,
925
-
926
- /**
927
- * Inactive vote accounts
928
- */
929
- delinquent: Array<VoteAccountInfo>,
930
- ...
931
- };
932
-
933
- /**
934
- * Network Inflation
935
- * (see https://docs.solana.com/implemented-proposals/ed_overview)
936
- */
937
- declare export type InflationGovernor = {
938
- foundation: number,
939
- foundationTerm: number,
940
- initial: number,
941
- taper: number,
942
- terminal: number,
943
- ...
944
- };
945
-
946
- /**
947
- * The inflation reward for an epoch
948
- */
949
- declare export type InflationReward = {
950
- /**
951
- * epoch for which the reward occurs
952
- */
953
- epoch: number,
954
-
955
- /**
956
- * the slot in which the rewards are effective
957
- */
958
- effectiveSlot: number,
959
-
960
- /**
961
- * reward amount in lamports
962
- */
963
- amount: number,
964
-
965
- /**
966
- * post balance of the account in lamports
967
- */
968
- postBalance: number,
969
- ...
970
- };
971
-
972
- /**
973
- * Information about the current epoch
974
- */
975
- declare export type EpochInfo = {
976
- epoch: number,
977
- slotIndex: number,
978
- slotsInEpoch: number,
979
- absoluteSlot: number,
980
- blockHeight?: number,
981
- transactionCount?: number,
982
- ...
983
- };
984
-
985
- /**
986
- * Leader schedule
987
- * (see https://docs.solana.com/terminology#leader-schedule)
988
- */
989
- declare export type LeaderSchedule = {
990
- [address: string]: number[],
991
- ...
992
- };
993
-
994
- /**
995
- * Version info for a node
996
- */
997
- declare export type Version = {
998
- /**
999
- * Version of solana-core
1000
- */
1001
- "solana-core": string,
1002
- "feature-set"?: number,
1003
- ...
1004
- };
1005
- declare export type SimulatedTransactionAccountInfo = {
1006
- /**
1007
- * `true` if this account's data contains a loaded program
1008
- */
1009
- executable: boolean,
1010
-
1011
- /**
1012
- * Identifier of the program that owns the account
1013
- */
1014
- owner: string,
1015
-
1016
- /**
1017
- * Number of lamports assigned to the account
1018
- */
1019
- lamports: number,
1020
-
1021
- /**
1022
- * Optional data assigned to the account
1023
- */
1024
- data: string[],
1025
-
1026
- /**
1027
- * Optional rent epoch info for account
1028
- */
1029
- rentEpoch?: number,
1030
- ...
1031
- };
1032
- declare export type SimulatedTransactionResponse = {
1033
- err: TransactionError | string | null,
1034
- logs: Array<string> | null,
1035
- accounts?: (SimulatedTransactionAccountInfo | null)[] | null,
1036
- unitsConsumed?: number,
1037
- ...
1038
- };
1039
- declare export type ParsedInnerInstruction = {
1040
- index: number,
1041
- instructions: (ParsedInstruction | PartiallyDecodedInstruction)[],
1042
- ...
1043
- };
1044
- declare export type TokenBalance = {
1045
- accountIndex: number,
1046
- mint: string,
1047
- owner?: string,
1048
- uiTokenAmount: TokenAmount,
1049
- ...
1050
- };
1051
-
1052
- /**
1053
- * Metadata for a parsed confirmed transaction on the ledger
1054
- * @deprecated [object Object],[object Object],[object Object]
1055
- */
1056
- declare export type ParsedConfirmedTransactionMeta = ParsedTransactionMeta;
1057
-
1058
- /**
1059
- * Metadata for a parsed transaction on the ledger
1060
- */
1061
- declare export type ParsedTransactionMeta = {
1062
- /**
1063
- * The fee charged for processing the transaction
1064
- */
1065
- fee: number,
1066
-
1067
- /**
1068
- * An array of cross program invoked parsed instructions
1069
- */
1070
- innerInstructions?: ParsedInnerInstruction[] | null,
1071
-
1072
- /**
1073
- * The balances of the transaction accounts before processing
1074
- */
1075
- preBalances: Array<number>,
1076
-
1077
- /**
1078
- * The balances of the transaction accounts after processing
1079
- */
1080
- postBalances: Array<number>,
1081
-
1082
- /**
1083
- * An array of program log messages emitted during a transaction
1084
- */
1085
- logMessages?: Array<string> | null,
1086
-
1087
- /**
1088
- * The token balances of the transaction accounts before processing
1089
- */
1090
- preTokenBalances?: Array<TokenBalance> | null,
1091
-
1092
- /**
1093
- * The token balances of the transaction accounts after processing
1094
- */
1095
- postTokenBalances?: Array<TokenBalance> | null,
1096
-
1097
- /**
1098
- * The error result of transaction processing
1099
- */
1100
- err: TransactionError | null,
1101
- ...
1102
- };
1103
- declare export type CompiledInnerInstruction = {
1104
- index: number,
1105
- instructions: CompiledInstruction[],
1106
- ...
1107
- };
1108
-
1109
- /**
1110
- * Metadata for a confirmed transaction on the ledger
1111
- */
1112
- declare export type ConfirmedTransactionMeta = {
1113
- /**
1114
- * The fee charged for processing the transaction
1115
- */
1116
- fee: number,
1117
-
1118
- /**
1119
- * An array of cross program invoked instructions
1120
- */
1121
- innerInstructions?: CompiledInnerInstruction[] | null,
1122
-
1123
- /**
1124
- * The balances of the transaction accounts before processing
1125
- */
1126
- preBalances: Array<number>,
1127
-
1128
- /**
1129
- * The balances of the transaction accounts after processing
1130
- */
1131
- postBalances: Array<number>,
1132
-
1133
- /**
1134
- * An array of program log messages emitted during a transaction
1135
- */
1136
- logMessages?: Array<string> | null,
1137
-
1138
- /**
1139
- * The token balances of the transaction accounts before processing
1140
- */
1141
- preTokenBalances?: Array<TokenBalance> | null,
1142
-
1143
- /**
1144
- * The token balances of the transaction accounts after processing
1145
- */
1146
- postTokenBalances?: Array<TokenBalance> | null,
1147
-
1148
- /**
1149
- * The error result of transaction processing
1150
- */
1151
- err: TransactionError | null,
1152
- ...
1153
- };
1154
-
1155
- /**
1156
- * A processed transaction from the RPC API
1157
- */
1158
- declare export type TransactionResponse = {
1159
- /**
1160
- * The slot during which the transaction was processed
1161
- */
1162
- slot: number,
1163
-
1164
- /**
1165
- * The transaction
1166
- */
1167
- transaction: {
1168
- /**
1169
- * The transaction message
1170
- */
1171
- message: Message,
1172
-
1173
- /**
1174
- * The transaction signatures
1175
- */
1176
- signatures: string[],
1177
- ...
1178
- },
1179
-
1180
- /**
1181
- * Metadata produced from the transaction
1182
- */
1183
- meta: ConfirmedTransactionMeta | null,
1184
-
1185
- /**
1186
- * The unix timestamp of when the transaction was processed
1187
- */
1188
- blockTime?: number | null,
1189
- ...
1190
- };
1191
-
1192
- /**
1193
- * A confirmed transaction on the ledger
1194
- */
1195
- declare export type ConfirmedTransaction = {
1196
- /**
1197
- * The slot during which the transaction was processed
1198
- */
1199
- slot: number,
1200
-
1201
- /**
1202
- * The details of the transaction
1203
- */
1204
- transaction: Transaction,
1205
-
1206
- /**
1207
- * Metadata produced from the transaction
1208
- */
1209
- meta: ConfirmedTransactionMeta | null,
1210
-
1211
- /**
1212
- * The unix timestamp of when the transaction was processed
1213
- */
1214
- blockTime?: number | null,
1215
- ...
1216
- };
1217
-
1218
- /**
1219
- * A partially decoded transaction instruction
1220
- */
1221
- declare export type PartiallyDecodedInstruction = {
1222
- /**
1223
- * Program id called by this instruction
1224
- */
1225
- programId: PublicKey,
1226
-
1227
- /**
1228
- * Public keys of accounts passed to this instruction
1229
- */
1230
- accounts: Array<PublicKey>,
1231
-
1232
- /**
1233
- * Raw base-58 instruction data
1234
- */
1235
- data: string,
1236
- ...
1237
- };
1238
-
1239
- /**
1240
- * A parsed transaction message account
1241
- */
1242
- declare export type ParsedMessageAccount = {
1243
- /**
1244
- * Public key of the account
1245
- */
1246
- pubkey: PublicKey,
1247
-
1248
- /**
1249
- * Indicates if the account signed the transaction
1250
- */
1251
- signer: boolean,
1252
-
1253
- /**
1254
- * Indicates if the account is writable for this transaction
1255
- */
1256
- writable: boolean,
1257
- ...
1258
- };
1259
-
1260
- /**
1261
- * A parsed transaction instruction
1262
- */
1263
- declare export type ParsedInstruction = {
1264
- /**
1265
- * Name of the program for this instruction
1266
- */
1267
- program: string,
1268
-
1269
- /**
1270
- * ID of the program for this instruction
1271
- */
1272
- programId: PublicKey,
1273
-
1274
- /**
1275
- * Parsed instruction info
1276
- */
1277
- parsed: any,
1278
- ...
1279
- };
1280
-
1281
- /**
1282
- * A parsed transaction message
1283
- */
1284
- declare export type ParsedMessage = {
1285
- /**
1286
- * Accounts used in the instructions
1287
- */
1288
- accountKeys: ParsedMessageAccount[],
1289
-
1290
- /**
1291
- * The atomically executed instructions for the transaction
1292
- */
1293
- instructions: (ParsedInstruction | PartiallyDecodedInstruction)[],
1294
-
1295
- /**
1296
- * Recent blockhash
1297
- */
1298
- recentBlockhash: string,
1299
- ...
1300
- };
1301
-
1302
- /**
1303
- * A parsed transaction
1304
- */
1305
- declare export type ParsedTransaction = {
1306
- /**
1307
- * Signatures for the transaction
1308
- */
1309
- signatures: Array<string>,
1310
-
1311
- /**
1312
- * Message of the transaction
1313
- */
1314
- message: ParsedMessage,
1315
- ...
1316
- };
1317
-
1318
- /**
1319
- * A parsed and confirmed transaction on the ledger
1320
- * @deprecated [object Object],[object Object],[object Object]
1321
- */
1322
- declare export type ParsedConfirmedTransaction = ParsedTransactionWithMeta;
1323
-
1324
- /**
1325
- * A parsed transaction on the ledger with meta
1326
- */
1327
- declare export type ParsedTransactionWithMeta = {
1328
- /**
1329
- * The slot during which the transaction was processed
1330
- */
1331
- slot: number,
1332
-
1333
- /**
1334
- * The details of the transaction
1335
- */
1336
- transaction: ParsedTransaction,
1337
-
1338
- /**
1339
- * Metadata produced from the transaction
1340
- */
1341
- meta: ParsedTransactionMeta | null,
1342
-
1343
- /**
1344
- * The unix timestamp of when the transaction was processed
1345
- */
1346
- blockTime?: number | null,
1347
- ...
1348
- };
1349
-
1350
- /**
1351
- * A processed block fetched from the RPC API
1352
- */
1353
- declare export type BlockResponse = {
1354
- /**
1355
- * Blockhash of this block
1356
- */
1357
- blockhash: Blockhash,
1358
-
1359
- /**
1360
- * Blockhash of this block's parent
1361
- */
1362
- previousBlockhash: Blockhash,
1363
-
1364
- /**
1365
- * Slot index of this block's parent
1366
- */
1367
- parentSlot: number,
1368
-
1369
- /**
1370
- * Vector of transactions with status meta and original message
1371
- */
1372
- transactions: Array<{
1373
- /**
1374
- * The transaction
1375
- */
1376
- transaction: {
1377
- /**
1378
- * The transaction message
1379
- */
1380
- message: Message,
1381
-
1382
- /**
1383
- * The transaction signatures
1384
- */
1385
- signatures: string[],
1386
- ...
1387
- },
1388
-
1389
- /**
1390
- * Metadata produced from the transaction
1391
- */
1392
- meta: ConfirmedTransactionMeta | null,
1393
- ...
1394
- }>,
1395
-
1396
- /**
1397
- * Vector of block rewards
1398
- */
1399
- rewards?: Array<{
1400
- /**
1401
- * Public key of reward recipient
1402
- */
1403
- pubkey: string,
1404
-
1405
- /**
1406
- * Reward value in lamports
1407
- */
1408
- lamports: number,
1409
-
1410
- /**
1411
- * Account balance after reward is applied
1412
- */
1413
- postBalance: number | null,
1414
-
1415
- /**
1416
- * Type of reward received
1417
- */
1418
- rewardType: string | null,
1419
- ...
1420
- }>,
1421
-
1422
- /**
1423
- * The unix timestamp of when the block was processed
1424
- */
1425
- blockTime: number | null,
1426
- ...
1427
- };
1428
-
1429
- /**
1430
- * A ConfirmedBlock on the ledger
1431
- */
1432
- declare export type ConfirmedBlock = {
1433
- /**
1434
- * Blockhash of this block
1435
- */
1436
- blockhash: Blockhash,
1437
-
1438
- /**
1439
- * Blockhash of this block's parent
1440
- */
1441
- previousBlockhash: Blockhash,
1442
-
1443
- /**
1444
- * Slot index of this block's parent
1445
- */
1446
- parentSlot: number,
1447
-
1448
- /**
1449
- * Vector of transactions and status metas
1450
- */
1451
- transactions: Array<{
1452
- transaction: Transaction,
1453
- meta: ConfirmedTransactionMeta | null,
1454
- ...
1455
- }>,
1456
-
1457
- /**
1458
- * Vector of block rewards
1459
- */
1460
- rewards?: Array<{
1461
- pubkey: string,
1462
- lamports: number,
1463
- postBalance: number | null,
1464
- rewardType: string | null,
1465
- ...
1466
- }>,
1467
-
1468
- /**
1469
- * The unix timestamp of when the block was processed
1470
- */
1471
- blockTime: number | null,
1472
- ...
1473
- };
1474
-
1475
- /**
1476
- * A Block on the ledger with signatures only
1477
- */
1478
- declare export type BlockSignatures = {
1479
- /**
1480
- * Blockhash of this block
1481
- */
1482
- blockhash: Blockhash,
1483
-
1484
- /**
1485
- * Blockhash of this block's parent
1486
- */
1487
- previousBlockhash: Blockhash,
1488
-
1489
- /**
1490
- * Slot index of this block's parent
1491
- */
1492
- parentSlot: number,
1493
-
1494
- /**
1495
- * Vector of signatures
1496
- */
1497
- signatures: Array<string>,
1498
-
1499
- /**
1500
- * The unix timestamp of when the block was processed
1501
- */
1502
- blockTime: number | null,
1503
- ...
1504
- };
1505
-
1506
- /**
1507
- * recent block production information
1508
- */
1509
- declare export type BlockProduction = $ReadOnly<{
1510
- /**
1511
- * a dictionary of validator identities, as base-58 encoded strings. Value is a two element array containing the number of leader slots and the number of blocks produced
1512
- */
1513
- byIdentity: $ReadOnly<{ [key: string]: $ReadOnlyArray<number>, ... }>,
1514
-
1515
- /**
1516
- * Block production slot range
1517
- */
1518
- range: $ReadOnly<{
1519
- /**
1520
- * first slot of the block production information (inclusive)
1521
- */
1522
- firstSlot: number,
1523
-
1524
- /**
1525
- * last slot of block production information (inclusive)
1526
- */
1527
- lastSlot: number,
1528
- ...
1529
- }>,
1530
- ...
1531
- }>;
1532
- declare export type GetBlockProductionConfig = {
1533
- /**
1534
- * Optional commitment level
1535
- */
1536
- commitment?: Commitment,
1537
-
1538
- /**
1539
- * Slot range to return block production for. If parameter not provided, defaults to current epoch.
1540
- */
1541
- range?: {
1542
- /**
1543
- * first slot to return block production information for (inclusive)
1544
- */
1545
- firstSlot: number,
1546
-
1547
- /**
1548
- * last slot to return block production information for (inclusive). If parameter not provided, defaults to the highest slot
1549
- */
1550
- lastSlot?: number,
1551
- ...
1552
- },
1553
-
1554
- /**
1555
- * Only return results for this validator identity (base-58 encoded)
1556
- */
1557
- identity?: string,
1558
- ...
1559
- };
1560
-
1561
- /**
1562
- * A performance sample
1563
- */
1564
- declare export type PerfSample = {
1565
- /**
1566
- * Slot number of sample
1567
- */
1568
- slot: number,
1569
-
1570
- /**
1571
- * Number of transactions in a sample window
1572
- */
1573
- numTransactions: number,
1574
-
1575
- /**
1576
- * Number of slots in a sample window
1577
- */
1578
- numSlots: number,
1579
-
1580
- /**
1581
- * Sample window in seconds
1582
- */
1583
- samplePeriodSecs: number,
1584
- ...
1585
- };
1586
-
1587
- /**
1588
- * Supply
1589
- */
1590
- declare export type Supply = {
1591
- /**
1592
- * Total supply in lamports
1593
- */
1594
- total: number,
1595
-
1596
- /**
1597
- * Circulating supply in lamports
1598
- */
1599
- circulating: number,
1600
-
1601
- /**
1602
- * Non-circulating supply in lamports
1603
- */
1604
- nonCirculating: number,
1605
-
1606
- /**
1607
- * List of non-circulating account addresses
1608
- */
1609
- nonCirculatingAccounts: Array<PublicKey>,
1610
- ...
1611
- };
1612
-
1613
- /**
1614
- * Token amount object which returns a token amount in different formats
1615
- * for various client use cases.
1616
- */
1617
- declare export type TokenAmount = {
1618
- /**
1619
- * Raw amount of tokens as string ignoring decimals
1620
- */
1621
- amount: string,
1622
-
1623
- /**
1624
- * Number of decimals configured for token's mint
1625
- */
1626
- decimals: number,
1627
-
1628
- /**
1629
- * Token amount as float, accounts for decimals
1630
- */
1631
- uiAmount: number | null,
1632
-
1633
- /**
1634
- * Token amount as string, accounts for decimals
1635
- */
1636
- uiAmountString?: string,
1637
- ...
1638
- };
1639
-
1640
- /**
1641
- * Token address and balance.
1642
- */
1643
- declare export type TokenAccountBalancePair = {
1644
- /**
1645
- * Address of the token account
1646
- */
1647
- address: PublicKey,
1648
-
1649
- /**
1650
- * Raw amount of tokens as string ignoring decimals
1651
- */
1652
- amount: string,
1653
-
1654
- /**
1655
- * Number of decimals configured for token's mint
1656
- */
1657
- decimals: number,
1658
-
1659
- /**
1660
- * Token amount as float, accounts for decimals
1661
- */
1662
- uiAmount: number | null,
1663
-
1664
- /**
1665
- * Token amount as string, accounts for decimals
1666
- */
1667
- uiAmountString?: string,
1668
- ...
1669
- };
1670
-
1671
- /**
1672
- * Pair of an account address and its balance
1673
- */
1674
- declare export type AccountBalancePair = {
1675
- address: PublicKey,
1676
- lamports: number,
1677
- ...
1678
- };
1679
-
1680
- /**
1681
- * Slot updates which can be used for tracking the live progress of a cluster.
1682
- * - `"firstShredReceived"`: connected node received the first shred of a block.
1683
- * Indicates that a new block that is being produced.
1684
- * - `"completed"`: connected node has received all shreds of a block. Indicates
1685
- * a block was recently produced.
1686
- * - `"optimisticConfirmation"`: block was optimistically confirmed by the
1687
- * cluster. It is not guaranteed that an optimistic confirmation notification
1688
- * will be sent for every finalized blocks.
1689
- * - `"root"`: the connected node rooted this block.
1690
- * - `"createdBank"`: the connected node has started validating this block.
1691
- * - `"frozen"`: the connected node has validated this block.
1692
- * - `"dead"`: the connected node failed to validate this block.
1693
- */
1694
- declare export type SlotUpdate =
1695
- | {
1696
- type: "firstShredReceived",
1697
- slot: number,
1698
- timestamp: number,
1699
- ...
1700
- }
1701
- | {
1702
- type: "completed",
1703
- slot: number,
1704
- timestamp: number,
1705
- ...
1706
- }
1707
- | {
1708
- type: "createdBank",
1709
- slot: number,
1710
- timestamp: number,
1711
- parent: number,
1712
- ...
1713
- }
1714
- | {
1715
- type: "frozen",
1716
- slot: number,
1717
- timestamp: number,
1718
- stats: {
1719
- numTransactionEntries: number,
1720
- numSuccessfulTransactions: number,
1721
- numFailedTransactions: number,
1722
- maxTransactionsPerEntry: number,
1723
- ...
1724
- },
1725
- ...
1726
- }
1727
- | {
1728
- type: "dead",
1729
- slot: number,
1730
- timestamp: number,
1731
- err: string,
1732
- ...
1733
- }
1734
- | {
1735
- type: "optimisticConfirmation",
1736
- slot: number,
1737
- timestamp: number,
1738
- ...
1739
- }
1740
- | {
1741
- type: "root",
1742
- slot: number,
1743
- timestamp: number,
1744
- ...
1745
- };
1746
-
1747
- /**
1748
- * Information about the latest slot being processed by a node
1749
- */
1750
- declare export type SlotInfo = {
1751
- /**
1752
- * Currently processing slot
1753
- */
1754
- slot: number,
1755
-
1756
- /**
1757
- * Parent of the current slot
1758
- */
1759
- parent: number,
1760
-
1761
- /**
1762
- * The root block of the current slot's fork
1763
- */
1764
- root: number,
1765
- ...
1766
- };
1767
-
1768
- /**
1769
- * Parsed account data
1770
- */
1771
- declare export type ParsedAccountData = {
1772
- /**
1773
- * Name of the program that owns this account
1774
- */
1775
- program: string,
1776
-
1777
- /**
1778
- * Parsed account data
1779
- */
1780
- parsed: any,
1781
-
1782
- /**
1783
- * Space used by account data
1784
- */
1785
- space: number,
1786
- ...
1787
- };
1788
-
1789
- /**
1790
- * Stake Activation data
1791
- */
1792
- declare export type StakeActivationData = {
1793
- /**
1794
- * the stake account's activation state
1795
- */
1796
- state: "active" | "inactive" | "activating" | "deactivating",
1797
-
1798
- /**
1799
- * stake active during the epoch
1800
- */
1801
- active: number,
1802
-
1803
- /**
1804
- * stake inactive during the epoch
1805
- */
1806
- inactive: number,
1807
- ...
1808
- };
1809
-
1810
- /**
1811
- * Data slice argument for getProgramAccounts
1812
- */
1813
- declare export type DataSlice = {
1814
- /**
1815
- * offset of data slice
1816
- */
1817
- offset: number,
1818
-
1819
- /**
1820
- * length of data slice
1821
- */
1822
- length: number,
1823
- ...
1824
- };
1825
-
1826
- /**
1827
- * Memory comparison filter for getProgramAccounts
1828
- */
1829
- declare export type MemcmpFilter = {
1830
- memcmp: {
1831
- /**
1832
- * offset into program account data to start comparison
1833
- */
1834
- offset: number,
1835
-
1836
- /**
1837
- * data to match, as base-58 encoded string and limited to less than 129 bytes
1838
- */
1839
- bytes: string,
1840
- ...
1841
- },
1842
- ...
1843
- };
1844
-
1845
- /**
1846
- * Data size comparison filter for getProgramAccounts
1847
- */
1848
- declare export type DataSizeFilter = {
1849
- /**
1850
- * Size of data for program account data length comparison
1851
- */
1852
- dataSize: number,
1853
- ...
1854
- };
1855
-
1856
- /**
1857
- * A filter object for getProgramAccounts
1858
- */
1859
- declare export type GetProgramAccountsFilter = MemcmpFilter | DataSizeFilter;
1860
-
1861
- /**
1862
- * Configuration object for getProgramAccounts requests
1863
- */
1864
- declare export type GetProgramAccountsConfig = {
1865
- /**
1866
- * Optional commitment level
1867
- */
1868
- commitment?: Commitment,
1869
-
1870
- /**
1871
- * Optional encoding for account data (default base64)
1872
- * To use "jsonParsed" encoding, please refer to `getParsedProgramAccounts` in connection.ts
1873
- */
1874
- encoding?: "base64",
1875
-
1876
- /**
1877
- * Optional data slice to limit the returned account data
1878
- */
1879
- dataSlice?: DataSlice,
1880
-
1881
- /**
1882
- * Optional array of filters to apply to accounts
1883
- */
1884
- filters?: GetProgramAccountsFilter[],
1885
- ...
1886
- };
1887
-
1888
- /**
1889
- * Configuration object for getParsedProgramAccounts
1890
- */
1891
- declare export type GetParsedProgramAccountsConfig = {
1892
- /**
1893
- * Optional commitment level
1894
- */
1895
- commitment?: Commitment,
1896
-
1897
- /**
1898
- * Optional array of filters to apply to accounts
1899
- */
1900
- filters?: GetProgramAccountsFilter[],
1901
- ...
1902
- };
1903
-
1904
- /**
1905
- * Configuration object for getMultipleAccounts
1906
- */
1907
- declare export type GetMultipleAccountsConfig = {
1908
- /**
1909
- * Optional commitment level
1910
- */
1911
- commitment?: Commitment,
1912
-
1913
- /**
1914
- * Optional encoding for account data (default base64)
1915
- */
1916
- encoding?: "base64" | "jsonParsed",
1917
- ...
1918
- };
1919
-
1920
- /**
1921
- * Information describing an account
1922
- */
1923
- declare export type AccountInfo<T> = {
1924
- /**
1925
- * `true` if this account's data contains a loaded program
1926
- */
1927
- executable: boolean,
1928
-
1929
- /**
1930
- * Identifier of the program that owns the account
1931
- */
1932
- owner: PublicKey,
1933
-
1934
- /**
1935
- * Number of lamports assigned to the account
1936
- */
1937
- lamports: number,
1938
-
1939
- /**
1940
- * Optional data assigned to the account
1941
- */
1942
- data: T,
1943
-
1944
- /**
1945
- * Optional rent epoch info for account
1946
- */
1947
- rentEpoch?: number,
1948
- ...
1949
- };
1950
-
1951
- /**
1952
- * Account information identified by pubkey
1953
- */
1954
- declare export type KeyedAccountInfo = {
1955
- accountId: PublicKey,
1956
- accountInfo: AccountInfo<Buffer>,
1957
- ...
1958
- };
1959
-
1960
- /**
1961
- * Callback function for account change notifications
1962
- */
1963
- declare export type AccountChangeCallback = (
1964
- accountInfo: AccountInfo<Buffer>,
1965
- context: Context
1966
- ) => void;
1967
-
1968
- /**
1969
- * Callback function for program account change notifications
1970
- */
1971
- declare export type ProgramAccountChangeCallback = (
1972
- keyedAccountInfo: KeyedAccountInfo,
1973
- context: Context
1974
- ) => void;
1975
-
1976
- /**
1977
- * Callback function for slot change notifications
1978
- */
1979
- declare export type SlotChangeCallback = (slotInfo: SlotInfo) => void;
1980
-
1981
- /**
1982
- * Callback function for slot update notifications
1983
- */
1984
- declare export type SlotUpdateCallback = (slotUpdate: SlotUpdate) => void;
1985
-
1986
- /**
1987
- * Callback function for signature status notifications
1988
- */
1989
- declare export type SignatureResultCallback = (
1990
- signatureResult: SignatureResult,
1991
- context: Context
1992
- ) => void;
1993
-
1994
- /**
1995
- * Signature status notification with transaction result
1996
- */
1997
- declare export type SignatureStatusNotification = {
1998
- type: "status",
1999
- result: SignatureResult,
2000
- ...
2001
- };
2002
-
2003
- /**
2004
- * Signature received notification
2005
- */
2006
- declare export type SignatureReceivedNotification = {
2007
- type: "received",
2008
- ...
2009
- };
2010
-
2011
- /**
2012
- * Callback function for signature notifications
2013
- */
2014
- declare export type SignatureSubscriptionCallback = (
2015
- notification: SignatureStatusNotification | SignatureReceivedNotification,
2016
- context: Context
2017
- ) => void;
2018
-
2019
- /**
2020
- * Signature subscription options
2021
- */
2022
- declare export type SignatureSubscriptionOptions = {
2023
- commitment?: Commitment,
2024
- enableReceivedNotification?: boolean,
2025
- ...
2026
- };
2027
-
2028
- /**
2029
- * Callback function for root change notifications
2030
- */
2031
- declare export type RootChangeCallback = (root: number) => void;
2032
-
2033
- /**
2034
- * Logs result.
2035
- */
2036
- declare export type Logs = {
2037
- err: TransactionError | null,
2038
- logs: string[],
2039
- signature: string,
2040
- ...
2041
- };
2042
-
2043
- /**
2044
- * Filter for log subscriptions.
2045
- */
2046
- declare export type LogsFilter = PublicKey | "all" | "allWithVotes";
2047
-
2048
- /**
2049
- * Callback function for log notifications.
2050
- */
2051
- declare export type LogsCallback = (logs: Logs, ctx: Context) => void;
2052
-
2053
- /**
2054
- * Signature result
2055
- */
2056
- declare export type SignatureResult = {
2057
- err: TransactionError | null,
2058
- ...
2059
- };
2060
-
2061
- /**
2062
- * Transaction error
2063
- */
2064
- declare export type TransactionError = { ... } | string;
2065
-
2066
- /**
2067
- * Transaction confirmation status
2068
- * <pre>
2069
- * 'processed': Transaction landed in a block which has reached 1 confirmation by the connected node
2070
- * 'confirmed': Transaction landed in a block which has reached 1 confirmation by the cluster
2071
- * 'finalized': Transaction landed in a block which has been finalized by the cluster
2072
- * </pre>
2073
- */
2074
- declare export type TransactionConfirmationStatus =
2075
- | "processed"
2076
- | "confirmed"
2077
- | "finalized";
2078
-
2079
- /**
2080
- * Signature status
2081
- */
2082
- declare export type SignatureStatus = {
2083
- /**
2084
- * when the transaction was processed
2085
- */
2086
- slot: number,
2087
-
2088
- /**
2089
- * the number of blocks that have been confirmed and voted on in the fork containing `slot`
2090
- */
2091
- confirmations: number | null,
2092
-
2093
- /**
2094
- * transaction error, if any
2095
- */
2096
- err: TransactionError | null,
2097
-
2098
- /**
2099
- * cluster confirmation status, if data available. Possible responses: `processed`, `confirmed`, `finalized`
2100
- */
2101
- confirmationStatus?: TransactionConfirmationStatus,
2102
- ...
2103
- };
2104
-
2105
- /**
2106
- * A confirmed signature with its status
2107
- */
2108
- declare export type ConfirmedSignatureInfo = {
2109
- /**
2110
- * the transaction signature
2111
- */
2112
- signature: string,
2113
-
2114
- /**
2115
- * when the transaction was processed
2116
- */
2117
- slot: number,
2118
-
2119
- /**
2120
- * error, if any
2121
- */
2122
- err: TransactionError | null,
2123
-
2124
- /**
2125
- * memo associated with the transaction, if any
2126
- */
2127
- memo: string | null,
2128
-
2129
- /**
2130
- * The unix timestamp of when the transaction was processed
2131
- */
2132
- blockTime?: number | null,
2133
- ...
2134
- };
2135
-
2136
- /**
2137
- * An object defining headers to be passed to the RPC server
2138
- */
2139
- declare export type HttpHeaders = {
2140
- [header: string]: string,
2141
- ...
2142
- };
2143
-
2144
- /**
2145
- * A callback used to augment the outgoing HTTP request
2146
- */
2147
- declare export type FetchMiddleware = (
2148
- url: string,
2149
- options: any,
2150
- fetch: (modifiedUrl: string, modifiedOptions: any) => void
2151
- ) => void;
2152
-
2153
- /**
2154
- * Configuration for instantiating a Connection
2155
- */
2156
- declare export type ConnectionConfig = {
2157
- /**
2158
- * Optional commitment level
2159
- */
2160
- commitment?: Commitment,
2161
-
2162
- /**
2163
- * Optional endpoint URL to the fullnode JSON RPC PubSub WebSocket Endpoint
2164
- */
2165
- wsEndpoint?: string,
2166
-
2167
- /**
2168
- * Optional HTTP headers object
2169
- */
2170
- httpHeaders?: HttpHeaders,
2171
-
2172
- /**
2173
- * Optional fetch middleware callback
2174
- */
2175
- fetchMiddleware?: FetchMiddleware,
2176
-
2177
- /**
2178
- * Optional Disable retrying calls when server responds with HTTP 429 (Too Many Requests)
2179
- */
2180
- disableRetryOnRateLimit?: boolean,
2181
-
2182
- /**
2183
- * time to allow for the server to initially process a transaction (in milliseconds)
2184
- */
2185
- confirmTransactionInitialTimeout?: number,
2186
- ...
2187
- };
2188
-
2189
- /**
2190
- * A connection to a fullnode JSON RPC endpoint
2191
- */
2192
- declare export class Connection {
2193
- /**
2194
- * Establish a JSON RPC connection
2195
- * @param endpoint URL to the fullnode JSON RPC endpoint
2196
- * @param commitmentOrConfig optional default commitment level or optional ConnectionConfig configuration object
2197
- */
2198
- constructor(
2199
- endpoint: string,
2200
- commitmentOrConfig?: Commitment | ConnectionConfig
2201
- ): this;
2202
-
2203
- /**
2204
- * The default commitment used for requests
2205
- */
2206
- commitment: Commitment | void;
2207
-
2208
- /**
2209
- * The RPC endpoint
2210
- */
2211
- rpcEndpoint: string;
2212
-
2213
- /**
2214
- * Fetch the balance for the specified public key, return with context
2215
- */
2216
- getBalanceAndContext(
2217
- publicKey: PublicKey,
2218
- commitment?: Commitment
2219
- ): Promise<RpcResponseAndContext<number>>;
2220
-
2221
- /**
2222
- * Fetch the balance for the specified public key
2223
- */
2224
- getBalance(publicKey: PublicKey, commitment?: Commitment): Promise<number>;
2225
-
2226
- /**
2227
- * Fetch the estimated production time of a block
2228
- */
2229
- getBlockTime(slot: number): Promise<number | null>;
2230
-
2231
- /**
2232
- * Fetch the lowest slot that the node has information about in its ledger.
2233
- * This value may increase over time if the node is configured to purge older ledger data
2234
- */
2235
- getMinimumLedgerSlot(): Promise<number>;
2236
-
2237
- /**
2238
- * Fetch the slot of the lowest confirmed block that has not been purged from the ledger
2239
- */
2240
- getFirstAvailableBlock(): Promise<number>;
2241
-
2242
- /**
2243
- * Fetch information about the current supply
2244
- */
2245
- getSupply(
2246
- config?: GetSupplyConfig | Commitment
2247
- ): Promise<RpcResponseAndContext<Supply>>;
2248
-
2249
- /**
2250
- * Fetch the current supply of a token mint
2251
- */
2252
- getTokenSupply(
2253
- tokenMintAddress: PublicKey,
2254
- commitment?: Commitment
2255
- ): Promise<RpcResponseAndContext<TokenAmount>>;
2256
-
2257
- /**
2258
- * Fetch the current balance of a token account
2259
- */
2260
- getTokenAccountBalance(
2261
- tokenAddress: PublicKey,
2262
- commitment?: Commitment
2263
- ): Promise<RpcResponseAndContext<TokenAmount>>;
2264
-
2265
- /**
2266
- * Fetch all the token accounts owned by the specified account
2267
- * @return {Promise<RpcResponseAndContext<Array<{
2268
- pubkey: PublicKey,
2269
- account: AccountInfo<Buffer>,...
2270
- }>>>}
2271
- */
2272
- getTokenAccountsByOwner(
2273
- ownerAddress: PublicKey,
2274
- filter: TokenAccountsFilter,
2275
- commitment?: Commitment
2276
- ): Promise<
2277
- RpcResponseAndContext<
2278
- Array<{
2279
- pubkey: PublicKey,
2280
- account: AccountInfo<Buffer>,
2281
- ...
2282
- }>
2283
- >
2284
- >;
2285
-
2286
- /**
2287
- * Fetch parsed token accounts owned by the specified account
2288
- * @return {Promise<RpcResponseAndContext<Array<{
2289
- pubkey: PublicKey,
2290
- account: AccountInfo<ParsedAccountData>,...
2291
- }>>>}
2292
- */
2293
- getParsedTokenAccountsByOwner(
2294
- ownerAddress: PublicKey,
2295
- filter: TokenAccountsFilter,
2296
- commitment?: Commitment
2297
- ): Promise<
2298
- RpcResponseAndContext<
2299
- Array<{
2300
- pubkey: PublicKey,
2301
- account: AccountInfo<ParsedAccountData>,
2302
- ...
2303
- }>
2304
- >
2305
- >;
2306
-
2307
- /**
2308
- * Fetch the 20 largest accounts with their current balances
2309
- */
2310
- getLargestAccounts(
2311
- config?: GetLargestAccountsConfig
2312
- ): Promise<RpcResponseAndContext<Array<AccountBalancePair>>>;
2313
-
2314
- /**
2315
- * Fetch the 20 largest token accounts with their current balances
2316
- * for a given mint.
2317
- */
2318
- getTokenLargestAccounts(
2319
- mintAddress: PublicKey,
2320
- commitment?: Commitment
2321
- ): Promise<RpcResponseAndContext<Array<TokenAccountBalancePair>>>;
2322
-
2323
- /**
2324
- * Fetch all the account info for the specified public key, return with context
2325
- */
2326
- getAccountInfoAndContext(
2327
- publicKey: PublicKey,
2328
- commitment?: Commitment
2329
- ): Promise<RpcResponseAndContext<AccountInfo<Buffer> | null>>;
2330
-
2331
- /**
2332
- * Fetch parsed account info for the specified public key
2333
- */
2334
- getParsedAccountInfo(
2335
- publicKey: PublicKey,
2336
- commitment?: Commitment
2337
- ): Promise<
2338
- RpcResponseAndContext<AccountInfo<Buffer | ParsedAccountData> | null>
2339
- >;
2340
-
2341
- /**
2342
- * Fetch all the account info for the specified public key
2343
- */
2344
- getAccountInfo(
2345
- publicKey: PublicKey,
2346
- commitment?: Commitment
2347
- ): Promise<AccountInfo<Buffer> | null>;
2348
-
2349
- /**
2350
- * Fetch all the account info for multiple accounts specified by an array of public keys, return with context
2351
- */
2352
- getMultipleAccountsInfoAndContext(
2353
- publicKeys: PublicKey[],
2354
- commitment?: Commitment
2355
- ): Promise<RpcResponseAndContext<(AccountInfo<Buffer> | null)[]>>;
2356
-
2357
- /**
2358
- * Fetch all the account info for multiple accounts specified by an array of public keys
2359
- */
2360
- getMultipleAccountsInfo(
2361
- publicKeys: PublicKey[],
2362
- commitment?: Commitment
2363
- ): Promise<(AccountInfo<Buffer> | null)[]>;
2364
-
2365
- /**
2366
- * Returns epoch activation information for a stake account that has been delegated
2367
- */
2368
- getStakeActivation(
2369
- publicKey: PublicKey,
2370
- commitment?: Commitment,
2371
- epoch?: number
2372
- ): Promise<StakeActivationData>;
2373
-
2374
- /**
2375
- * Fetch all the accounts owned by the specified program id
2376
- * @return {Promise<Array<{
2377
- pubkey: PublicKey,
2378
- account: AccountInfo<Buffer>,...
2379
- }>>}
2380
- */
2381
- getProgramAccounts(
2382
- programId: PublicKey,
2383
- configOrCommitment?: GetProgramAccountsConfig | Commitment
2384
- ): Promise<
2385
- Array<{
2386
- pubkey: PublicKey,
2387
- account: AccountInfo<Buffer>,
2388
- ...
2389
- }>
2390
- >;
2391
-
2392
- /**
2393
- * Fetch and parse all the accounts owned by the specified program id
2394
- * @return {Promise<Array<{
2395
- pubkey: PublicKey,
2396
- account: AccountInfo<Buffer | ParsedAccountData>,...
2397
- }>>}
2398
- */
2399
- getParsedProgramAccounts(
2400
- programId: PublicKey,
2401
- configOrCommitment?: GetParsedProgramAccountsConfig | Commitment
2402
- ): Promise<
2403
- Array<{
2404
- pubkey: PublicKey,
2405
- account: AccountInfo<Buffer | ParsedAccountData>,
2406
- ...
2407
- }>
2408
- >;
2409
-
2410
- /**
2411
- * Confirm the transaction identified by the specified signature.
2412
- */
2413
- confirmTransaction(
2414
- signature: TransactionSignature,
2415
- commitment?: Commitment
2416
- ): Promise<RpcResponseAndContext<SignatureResult>>;
2417
-
2418
- /**
2419
- * Return the list of nodes that are currently participating in the cluster
2420
- */
2421
- getClusterNodes(): Promise<Array<ContactInfo>>;
2422
-
2423
- /**
2424
- * Return the list of nodes that are currently participating in the cluster
2425
- */
2426
- getVoteAccounts(commitment?: Commitment): Promise<VoteAccountStatus>;
2427
-
2428
- /**
2429
- * Fetch the current slot that the node is processing
2430
- */
2431
- getSlot(commitment?: Commitment): Promise<number>;
2432
-
2433
- /**
2434
- * Fetch the current slot leader of the cluster
2435
- */
2436
- getSlotLeader(commitment?: Commitment): Promise<string>;
2437
-
2438
- /**
2439
- * Fetch `limit` number of slot leaders starting from `startSlot`
2440
- * @param startSlot fetch slot leaders starting from this slot
2441
- * @param limit number of slot leaders to return
2442
- */
2443
- getSlotLeaders(startSlot: number, limit: number): Promise<Array<PublicKey>>;
2444
-
2445
- /**
2446
- * Fetch the current status of a signature
2447
- */
2448
- getSignatureStatus(
2449
- signature: TransactionSignature,
2450
- config?: SignatureStatusConfig
2451
- ): Promise<RpcResponseAndContext<SignatureStatus | null>>;
2452
-
2453
- /**
2454
- * Fetch the current statuses of a batch of signatures
2455
- */
2456
- getSignatureStatuses(
2457
- signatures: Array<TransactionSignature>,
2458
- config?: SignatureStatusConfig
2459
- ): Promise<RpcResponseAndContext<Array<SignatureStatus | null>>>;
2460
-
2461
- /**
2462
- * Fetch the current transaction count of the cluster
2463
- */
2464
- getTransactionCount(commitment?: Commitment): Promise<number>;
2465
-
2466
- /**
2467
- * Fetch the current total currency supply of the cluster in lamports
2468
- * @deprecated [object Object],[object Object],[object Object]
2469
- */
2470
- getTotalSupply(commitment?: Commitment): Promise<number>;
2471
-
2472
- /**
2473
- * Fetch the cluster InflationGovernor parameters
2474
- */
2475
- getInflationGovernor(commitment?: Commitment): Promise<InflationGovernor>;
2476
-
2477
- /**
2478
- * Fetch the inflation reward for a list of addresses for an epoch
2479
- */
2480
- getInflationReward(
2481
- addresses: PublicKey[],
2482
- epoch?: number,
2483
- commitment?: Commitment
2484
- ): Promise<(InflationReward | null)[]>;
2485
-
2486
- /**
2487
- * Fetch the Epoch Info parameters
2488
- */
2489
- getEpochInfo(commitment?: Commitment): Promise<EpochInfo>;
2490
-
2491
- /**
2492
- * Fetch the Epoch Schedule parameters
2493
- */
2494
- getEpochSchedule(): Promise<EpochSchedule>;
2495
-
2496
- /**
2497
- * Fetch the leader schedule for the current epoch
2498
- * @return {Promise<RpcResponseAndContext<LeaderSchedule>>}
2499
- */
2500
- getLeaderSchedule(): Promise<LeaderSchedule>;
2501
-
2502
- /**
2503
- * Fetch the minimum balance needed to exempt an account of `dataLength`
2504
- * size from rent
2505
- */
2506
- getMinimumBalanceForRentExemption(
2507
- dataLength: number,
2508
- commitment?: Commitment
2509
- ): Promise<number>;
2510
-
2511
- /**
2512
- * Fetch a recent blockhash from the cluster, return with context
2513
- * @return {Promise<RpcResponseAndContext<{
2514
- blockhash: Blockhash,
2515
- feeCalculator: FeeCalculator,...
2516
- }>>}
2517
- * @deprecated [object Object],[object Object],[object Object]
2518
- */
2519
- getRecentBlockhashAndContext(commitment?: Commitment): Promise<
2520
- RpcResponseAndContext<{
2521
- blockhash: Blockhash,
2522
- feeCalculator: FeeCalculator,
2523
- ...
2524
- }>
2525
- >;
2526
-
2527
- /**
2528
- * Fetch recent performance samples
2529
- * @return {Promise<Array<PerfSample>>}
2530
- */
2531
- getRecentPerformanceSamples(limit?: number): Promise<Array<PerfSample>>;
2532
-
2533
- /**
2534
- * Fetch the fee calculator for a recent blockhash from the cluster, return with context
2535
- * @deprecated [object Object],[object Object],[object Object]
2536
- */
2537
- getFeeCalculatorForBlockhash(
2538
- blockhash: Blockhash,
2539
- commitment?: Commitment
2540
- ): Promise<RpcResponseAndContext<FeeCalculator | null>>;
2541
-
2542
- /**
2543
- * Fetch the fee for a message from the cluster, return with context
2544
- */
2545
- getFeeForMessage(
2546
- message: Message,
2547
- commitment?: Commitment
2548
- ): Promise<RpcResponseAndContext<number>>;
2549
-
2550
- /**
2551
- * Fetch a recent blockhash from the cluster
2552
- * @return {Promise<{
2553
- blockhash: Blockhash,
2554
- feeCalculator: FeeCalculator,...
2555
- }>}
2556
- * @deprecated [object Object],[object Object],[object Object]
2557
- */
2558
- getRecentBlockhash(commitment?: Commitment): Promise<{
2559
- blockhash: Blockhash,
2560
- feeCalculator: FeeCalculator,
2561
- ...
2562
- }>;
2563
-
2564
- /**
2565
- * Fetch the latest blockhash from the cluster
2566
- * @return {Promise<{
2567
- blockhash: Blockhash,
2568
- lastValidBlockHeight: number,...
2569
- }>}
2570
- */
2571
- getLatestBlockhash(commitment?: Commitment): Promise<{
2572
- blockhash: Blockhash,
2573
- lastValidBlockHeight: number,
2574
- ...
2575
- }>;
2576
-
2577
- /**
2578
- * Fetch the latest blockhash from the cluster
2579
- * @return {Promise<{
2580
- blockhash: Blockhash,
2581
- lastValidBlockHeight: number,...
2582
- }>}
2583
- */
2584
- getLatestBlockhashAndContext(commitment?: Commitment): Promise<
2585
- RpcResponseAndContext<{
2586
- blockhash: Blockhash,
2587
- lastValidBlockHeight: number,
2588
- ...
2589
- }>
2590
- >;
2591
-
2592
- /**
2593
- * Fetch the node version
2594
- */
2595
- getVersion(): Promise<Version>;
2596
-
2597
- /**
2598
- * Fetch the genesis hash
2599
- */
2600
- getGenesisHash(): Promise<string>;
2601
-
2602
- /**
2603
- * Fetch a processed block from the cluster.
2604
- */
2605
- getBlock(
2606
- slot: number,
2607
- opts?: {
2608
- commitment?: Finality,
2609
- ...
2610
- }
2611
- ): Promise<BlockResponse | null>;
2612
- getBlockHeight(commitment?: Commitment): Promise<number>;
2613
- getBlockProduction(
2614
- configOrCommitment?: GetBlockProductionConfig | Commitment
2615
- ): Promise<RpcResponseAndContext<BlockProduction>>;
2616
-
2617
- /**
2618
- * Fetch a confirmed or finalized transaction from the cluster.
2619
- */
2620
- getTransaction(
2621
- signature: string,
2622
- opts?: {
2623
- commitment?: Finality,
2624
- ...
2625
- }
2626
- ): Promise<TransactionResponse | null>;
2627
-
2628
- /**
2629
- * Fetch parsed transaction details for a confirmed or finalized transaction
2630
- */
2631
- getParsedTransaction(
2632
- signature: TransactionSignature,
2633
- commitment?: Finality
2634
- ): Promise<ParsedConfirmedTransaction | null>;
2635
-
2636
- /**
2637
- * Fetch parsed transaction details for a batch of confirmed transactions
2638
- */
2639
- getParsedTransactions(
2640
- signatures: TransactionSignature[],
2641
- commitment?: Finality
2642
- ): Promise<(ParsedConfirmedTransaction | null)[]>;
2643
-
2644
- /**
2645
- * Fetch a list of Transactions and transaction statuses from the cluster
2646
- * for a confirmed block.
2647
- * @deprecated [object Object],[object Object],[object Object]
2648
- */
2649
- getConfirmedBlock(
2650
- slot: number,
2651
- commitment?: Finality
2652
- ): Promise<ConfirmedBlock>;
2653
-
2654
- /**
2655
- * Fetch confirmed blocks between two slots
2656
- */
2657
- getBlocks(
2658
- startSlot: number,
2659
- endSlot?: number,
2660
- commitment?: Finality
2661
- ): Promise<Array<number>>;
2662
-
2663
- /**
2664
- * Fetch a list of Signatures from the cluster for a block, excluding rewards
2665
- */
2666
- getBlockSignatures(
2667
- slot: number,
2668
- commitment?: Finality
2669
- ): Promise<BlockSignatures>;
2670
-
2671
- /**
2672
- * Fetch a list of Signatures from the cluster for a confirmed block, excluding rewards
2673
- * @deprecated [object Object],[object Object],[object Object]
2674
- */
2675
- getConfirmedBlockSignatures(
2676
- slot: number,
2677
- commitment?: Finality
2678
- ): Promise<BlockSignatures>;
2679
-
2680
- /**
2681
- * Fetch a transaction details for a confirmed transaction
2682
- * @deprecated [object Object],[object Object],[object Object]
2683
- */
2684
- getConfirmedTransaction(
2685
- signature: TransactionSignature,
2686
- commitment?: Finality
2687
- ): Promise<ConfirmedTransaction | null>;
2688
-
2689
- /**
2690
- * Fetch parsed transaction details for a confirmed transaction
2691
- * @deprecated [object Object],[object Object],[object Object]
2692
- */
2693
- getParsedConfirmedTransaction(
2694
- signature: TransactionSignature,
2695
- commitment?: Finality
2696
- ): Promise<ParsedConfirmedTransaction | null>;
2697
-
2698
- /**
2699
- * Fetch parsed transaction details for a batch of confirmed transactions
2700
- * @deprecated [object Object],[object Object],[object Object]
2701
- */
2702
- getParsedConfirmedTransactions(
2703
- signatures: TransactionSignature[],
2704
- commitment?: Finality
2705
- ): Promise<(ParsedConfirmedTransaction | null)[]>;
2706
-
2707
- /**
2708
- * Fetch a list of all the confirmed signatures for transactions involving an address
2709
- * within a specified slot range. Max range allowed is 10,000 slots.
2710
- * @deprecated [object Object],[object Object],[object Object]
2711
- * @param address queried address
2712
- * @param startSlot start slot, inclusive
2713
- * @param endSlot end slot, inclusive
2714
- */
2715
- getConfirmedSignaturesForAddress(
2716
- address: PublicKey,
2717
- startSlot: number,
2718
- endSlot: number
2719
- ): Promise<Array<TransactionSignature>>;
2720
-
2721
- /**
2722
- * Returns confirmed signatures for transactions involving an
2723
- * address backwards in time from the provided signature or most recent confirmed block
2724
- * @param address queried address
2725
- * @param options
2726
- */
2727
- getConfirmedSignaturesForAddress2(
2728
- address: PublicKey,
2729
- options?: ConfirmedSignaturesForAddress2Options,
2730
- commitment?: Finality
2731
- ): Promise<Array<ConfirmedSignatureInfo>>;
2732
-
2733
- /**
2734
- * Returns confirmed signatures for transactions involving an
2735
- * address backwards in time from the provided signature or most recent confirmed block
2736
- * @param address queried address
2737
- * @param options
2738
- */
2739
- getSignaturesForAddress(
2740
- address: PublicKey,
2741
- options?: SignaturesForAddressOptions,
2742
- commitment?: Finality
2743
- ): Promise<Array<ConfirmedSignatureInfo>>;
2744
-
2745
- /**
2746
- * Fetch the contents of a Nonce account from the cluster, return with context
2747
- */
2748
- getNonceAndContext(
2749
- nonceAccount: PublicKey,
2750
- commitment?: Commitment
2751
- ): Promise<RpcResponseAndContext<NonceAccount | null>>;
2752
-
2753
- /**
2754
- * Fetch the contents of a Nonce account from the cluster
2755
- */
2756
- getNonce(
2757
- nonceAccount: PublicKey,
2758
- commitment?: Commitment
2759
- ): Promise<NonceAccount | null>;
2760
-
2761
- /**
2762
- * Request an allocation of lamports to the specified address
2763
- *
2764
- * ```typescript
2765
- * import { Connection, PublicKey, LAMPORTS_PER_SOL } from "@solana/web3.js";
2766
- *
2767
- * (async () => {
2768
- * const connection = new Connection("https://api.testnet.solana.com", "confirmed");
2769
- * const myAddress = new PublicKey("2nr1bHFT86W9tGnyvmYW4vcHKsQB3sVQfnddasz4kExM");
2770
- * const signature = await connection.requestAirdrop(myAddress, LAMPORTS_PER_SOL);
2771
- * await connection.confirmTransaction(signature);
2772
- * })();
2773
- * ```
2774
- */
2775
- requestAirdrop(
2776
- to: PublicKey,
2777
- lamports: number
2778
- ): Promise<TransactionSignature>;
2779
-
2780
- /**
2781
- * Simulate a transaction
2782
- */
2783
- simulateTransaction(
2784
- transactionOrMessage: Transaction | Message,
2785
- signers?: Array<Signer>,
2786
- includeAccounts?: boolean | Array<PublicKey>
2787
- ): Promise<RpcResponseAndContext<SimulatedTransactionResponse>>;
2788
-
2789
- /**
2790
- * Sign and send a transaction
2791
- */
2792
- sendTransaction(
2793
- transaction: Transaction,
2794
- signers: Array<Signer>,
2795
- options?: SendOptions
2796
- ): Promise<TransactionSignature>;
2797
-
2798
- /**
2799
- * Send a transaction that has already been signed and serialized into the
2800
- * wire format
2801
- */
2802
- sendRawTransaction(
2803
- rawTransaction: Buffer | Uint8Array | Array<number>,
2804
- options?: SendOptions
2805
- ): Promise<TransactionSignature>;
2806
-
2807
- /**
2808
- * Send a transaction that has already been signed, serialized into the
2809
- * wire format, and encoded as a base64 string
2810
- */
2811
- sendEncodedTransaction(
2812
- encodedTransaction: string,
2813
- options?: SendOptions
2814
- ): Promise<TransactionSignature>;
2815
-
2816
- /**
2817
- * Register a callback to be invoked whenever the specified account changes
2818
- * @param publicKey Public key of the account to monitor
2819
- * @param callback Function to invoke whenever the account is changed
2820
- * @param commitment Specify the commitment level account changes must reach before notification
2821
- * @return subscription id
2822
- */
2823
- onAccountChange(
2824
- publicKey: PublicKey,
2825
- callback: AccountChangeCallback,
2826
- commitment?: Commitment
2827
- ): number;
2828
-
2829
- /**
2830
- * Deregister an account notification callback
2831
- * @param id subscription id to deregister
2832
- */
2833
- removeAccountChangeListener(id: number): Promise<void>;
2834
-
2835
- /**
2836
- * Register a callback to be invoked whenever accounts owned by the
2837
- * specified program change
2838
- * @param programId Public key of the program to monitor
2839
- * @param callback Function to invoke whenever the account is changed
2840
- * @param commitment Specify the commitment level account changes must reach before notification
2841
- * @param filters The program account filters to pass into the RPC method
2842
- * @return subscription id
2843
- */
2844
- onProgramAccountChange(
2845
- programId: PublicKey,
2846
- callback: ProgramAccountChangeCallback,
2847
- commitment?: Commitment,
2848
- filters?: GetProgramAccountsFilter[]
2849
- ): number;
2850
-
2851
- /**
2852
- * Deregister an account notification callback
2853
- * @param id subscription id to deregister
2854
- */
2855
- removeProgramAccountChangeListener(id: number): Promise<void>;
2856
-
2857
- /**
2858
- * Registers a callback to be invoked whenever logs are emitted.
2859
- */
2860
- onLogs(
2861
- filter: LogsFilter,
2862
- callback: LogsCallback,
2863
- commitment?: Commitment
2864
- ): number;
2865
-
2866
- /**
2867
- * Deregister a logs callback.
2868
- * @param id subscription id to deregister.
2869
- */
2870
- removeOnLogsListener(id: number): Promise<void>;
2871
-
2872
- /**
2873
- * Register a callback to be invoked upon slot changes
2874
- * @param callback Function to invoke whenever the slot changes
2875
- * @return subscription id
2876
- */
2877
- onSlotChange(callback: SlotChangeCallback): number;
2878
-
2879
- /**
2880
- * Deregister a slot notification callback
2881
- * @param id subscription id to deregister
2882
- */
2883
- removeSlotChangeListener(id: number): Promise<void>;
2884
-
2885
- /**
2886
- * [object Object],[object Object],[object Object]
2887
- * @param callback Function to invoke whenever the slot updates
2888
- * @return subscription id
2889
- */
2890
- onSlotUpdate(callback: SlotUpdateCallback): number;
2891
-
2892
- /**
2893
- * Deregister a slot update notification callback
2894
- * @param id subscription id to deregister
2895
- */
2896
- removeSlotUpdateListener(id: number): Promise<void>;
2897
- _buildArgs(
2898
- args: Array<any>,
2899
- override?: Commitment,
2900
- encoding?: "jsonParsed" | "base64",
2901
- extra?: any
2902
- ): Array<any>;
2903
-
2904
- /**
2905
- * Register a callback to be invoked upon signature updates
2906
- * @param signature Transaction signature string in base 58
2907
- * @param callback Function to invoke on signature notifications
2908
- * @param commitment Specify the commitment level signature must reach before notification
2909
- * @return subscription id
2910
- */
2911
- onSignature(
2912
- signature: TransactionSignature,
2913
- callback: SignatureResultCallback,
2914
- commitment?: Commitment
2915
- ): number;
2916
-
2917
- /**
2918
- * Register a callback to be invoked when a transaction is
2919
- * received and/or processed.
2920
- * @param signature Transaction signature string in base 58
2921
- * @param callback Function to invoke on signature notifications
2922
- * @param options Enable received notifications and set the commitment
2923
- * level that signature must reach before notification
2924
- * @return subscription id
2925
- */
2926
- onSignatureWithOptions(
2927
- signature: TransactionSignature,
2928
- callback: SignatureSubscriptionCallback,
2929
- options?: SignatureSubscriptionOptions
2930
- ): number;
2931
-
2932
- /**
2933
- * Deregister a signature notification callback
2934
- * @param id subscription id to deregister
2935
- */
2936
- removeSignatureListener(id: number): Promise<void>;
2937
-
2938
- /**
2939
- * Register a callback to be invoked upon root changes
2940
- * @param callback Function to invoke whenever the root changes
2941
- * @return subscription id
2942
- */
2943
- onRootChange(callback: RootChangeCallback): number;
2944
-
2945
- /**
2946
- * Deregister a root notification callback
2947
- * @param id subscription id to deregister
2948
- */
2949
- removeRootChangeListener(id: number): Promise<void>;
2950
- }
2951
- declare export var BPF_LOADER_PROGRAM_ID: PublicKey;
2952
-
2953
- /**
2954
- * Factory class for transactions to interact with a program loader
2955
- */
2956
- declare export class BpfLoader {
2957
- /**
2958
- * Minimum number of signatures required to load a program not including
2959
- * retries
2960
- *
2961
- * Can be used to calculate transaction fees
2962
- */
2963
- static getMinNumSignatures(dataLength: number): number;
2964
-
2965
- /**
2966
- * Load a BPF program
2967
- * @param connection The connection to use
2968
- * @param payer Account that will pay program loading fees
2969
- * @param program Account to load the program into
2970
- * @param elf The entire ELF containing the BPF program
2971
- * @param loaderProgramId The program id of the BPF loader to use
2972
- * @return true if program was loaded successfully, false if program was already loaded
2973
- */
2974
- static load(
2975
- connection: Connection,
2976
- payer: Signer,
2977
- program: Signer,
2978
- elf: Buffer | Uint8Array | Array<number>,
2979
- loaderProgramId: PublicKey
2980
- ): Promise<boolean>;
2981
- }
2982
-
2983
- /**
2984
- * Params for creating an ed25519 instruction using a public key
2985
- */
2986
- declare export type CreateEd25519InstructionWithPublicKeyParams = {
2987
- publicKey: Uint8Array,
2988
- message: Uint8Array,
2989
- signature: Uint8Array,
2990
- instructionIndex?: number,
2991
- ...
2992
- };
2993
-
2994
- /**
2995
- * Params for creating an ed25519 instruction using a private key
2996
- */
2997
- declare export type CreateEd25519InstructionWithPrivateKeyParams = {
2998
- privateKey: Uint8Array,
2999
- message: Uint8Array,
3000
- instructionIndex?: number,
3001
- ...
3002
- };
3003
- declare export class Ed25519Program {
3004
- /**
3005
- * Public key that identifies the ed25519 program
3006
- */
3007
- static programId: PublicKey;
3008
-
3009
- /**
3010
- * Create an ed25519 instruction with a public key and signature. The
3011
- * public key must be a buffer that is 32 bytes long, and the signature
3012
- * must be a buffer of 64 bytes.
3013
- */
3014
- static createInstructionWithPublicKey(
3015
- params: CreateEd25519InstructionWithPublicKeyParams
3016
- ): TransactionInstruction;
3017
-
3018
- /**
3019
- * Create an ed25519 instruction with a private key. The private key
3020
- * must be a buffer that is 64 bytes long.
3021
- */
3022
- static createInstructionWithPrivateKey(
3023
- params: CreateEd25519InstructionWithPrivateKeyParams
3024
- ): TransactionInstruction;
3025
- }
3026
-
3027
- /**
3028
- * Program loader interface
3029
- */
3030
- declare export class Loader {
3031
- /**
3032
- * Amount of program data placed in each load Transaction
3033
- */
3034
- static chunkSize: number;
3035
-
3036
- /**
3037
- * Minimum number of signatures required to load a program not including
3038
- * retries
3039
- *
3040
- * Can be used to calculate transaction fees
3041
- */
3042
- static getMinNumSignatures(dataLength: number): number;
3043
-
3044
- /**
3045
- * Loads a generic program
3046
- * @param connection The connection to use
3047
- * @param payer System account that pays to load the program
3048
- * @param program Account to load the program into
3049
- * @param programId Public key that identifies the loader
3050
- * @param data Program octets
3051
- * @return true if program was loaded successfully, false if program was already loaded
3052
- */
3053
- static load(
3054
- connection: Connection,
3055
- payer: Signer,
3056
- program: Signer,
3057
- programId: PublicKey,
3058
- data: Buffer | Uint8Array | Array<number>
3059
- ): Promise<boolean>;
3060
- }
3061
-
3062
- /**
3063
- * Address of the stake config account which configures the rate
3064
- * of stake warmup and cooldown as well as the slashing penalty.
3065
- */
3066
- declare export var STAKE_CONFIG_ID: PublicKey;
3067
-
3068
- /**
3069
- * Stake account authority info
3070
- */
3071
- declare export class Authorized {
3072
- /**
3073
- * stake authority
3074
- */
3075
- staker: PublicKey;
3076
-
3077
- /**
3078
- * withdraw authority
3079
- */
3080
- withdrawer: PublicKey;
3081
-
3082
- /**
3083
- * Create a new Authorized object
3084
- * @param staker the stake authority
3085
- * @param withdrawer the withdraw authority
3086
- */
3087
- constructor(staker: PublicKey, withdrawer: PublicKey): this;
3088
- }
3089
-
3090
- /**
3091
- * Stake account lockup info
3092
- */
3093
- declare export class Lockup {
3094
- /**
3095
- * Unix timestamp of lockup expiration
3096
- */
3097
- unixTimestamp: number;
3098
-
3099
- /**
3100
- * Epoch of lockup expiration
3101
- */
3102
- epoch: number;
3103
-
3104
- /**
3105
- * Lockup custodian authority
3106
- */
3107
- custodian: PublicKey;
3108
-
3109
- /**
3110
- * Create a new Lockup object
3111
- */
3112
- constructor(
3113
- unixTimestamp: number,
3114
- epoch: number,
3115
- custodian: PublicKey
3116
- ): this;
3117
-
3118
- /**
3119
- * Default, inactive Lockup value
3120
- */
3121
- static default: Lockup;
3122
- }
3123
-
3124
- /**
3125
- * Create stake account transaction params
3126
- */
3127
- declare export type CreateStakeAccountParams = {
3128
- /**
3129
- * Address of the account which will fund creation
3130
- */
3131
- fromPubkey: PublicKey,
3132
-
3133
- /**
3134
- * Address of the new stake account
3135
- */
3136
- stakePubkey: PublicKey,
3137
-
3138
- /**
3139
- * Authorities of the new stake account
3140
- */
3141
- authorized: Authorized,
3142
-
3143
- /**
3144
- * Lockup of the new stake account
3145
- */
3146
- lockup?: Lockup,
3147
-
3148
- /**
3149
- * Funding amount
3150
- */
3151
- lamports: number,
3152
- ...
3153
- };
3154
-
3155
- /**
3156
- * Create stake account with seed transaction params
3157
- */
3158
- declare export type CreateStakeAccountWithSeedParams = {
3159
- fromPubkey: PublicKey,
3160
- stakePubkey: PublicKey,
3161
- basePubkey: PublicKey,
3162
- seed: string,
3163
- authorized: Authorized,
3164
- lockup?: Lockup,
3165
- lamports: number,
3166
- ...
3167
- };
3168
-
3169
- /**
3170
- * Initialize stake instruction params
3171
- */
3172
- declare export type InitializeStakeParams = {
3173
- stakePubkey: PublicKey,
3174
- authorized: Authorized,
3175
- lockup?: Lockup,
3176
- ...
3177
- };
3178
-
3179
- /**
3180
- * Delegate stake instruction params
3181
- */
3182
- declare export type DelegateStakeParams = {
3183
- stakePubkey: PublicKey,
3184
- authorizedPubkey: PublicKey,
3185
- votePubkey: PublicKey,
3186
- ...
3187
- };
3188
-
3189
- /**
3190
- * Authorize stake instruction params
3191
- */
3192
- declare export type AuthorizeStakeParams = {
3193
- stakePubkey: PublicKey,
3194
- authorizedPubkey: PublicKey,
3195
- newAuthorizedPubkey: PublicKey,
3196
- stakeAuthorizationType: StakeAuthorizationType,
3197
- custodianPubkey?: PublicKey,
3198
- ...
3199
- };
3200
-
3201
- /**
3202
- * Authorize stake instruction params using a derived key
3203
- */
3204
- declare export type AuthorizeWithSeedStakeParams = {
3205
- stakePubkey: PublicKey,
3206
- authorityBase: PublicKey,
3207
- authoritySeed: string,
3208
- authorityOwner: PublicKey,
3209
- newAuthorizedPubkey: PublicKey,
3210
- stakeAuthorizationType: StakeAuthorizationType,
3211
- custodianPubkey?: PublicKey,
3212
- ...
3213
- };
3214
-
3215
- /**
3216
- * Split stake instruction params
3217
- */
3218
- declare export type SplitStakeParams = {
3219
- stakePubkey: PublicKey,
3220
- authorizedPubkey: PublicKey,
3221
- splitStakePubkey: PublicKey,
3222
- lamports: number,
3223
- ...
3224
- };
3225
-
3226
- /**
3227
- * Split with seed transaction params
3228
- */
3229
- declare export type SplitStakeWithSeedParams = {
3230
- stakePubkey: PublicKey,
3231
- authorizedPubkey: PublicKey,
3232
- splitStakePubkey: PublicKey,
3233
- basePubkey: PublicKey,
3234
- seed: string,
3235
- lamports: number,
3236
- ...
3237
- };
3238
-
3239
- /**
3240
- * Withdraw stake instruction params
3241
- */
3242
- declare export type WithdrawStakeParams = {
3243
- stakePubkey: PublicKey,
3244
- authorizedPubkey: PublicKey,
3245
- toPubkey: PublicKey,
3246
- lamports: number,
3247
- custodianPubkey?: PublicKey,
3248
- ...
3249
- };
3250
-
3251
- /**
3252
- * Deactivate stake instruction params
3253
- */
3254
- declare export type DeactivateStakeParams = {
3255
- stakePubkey: PublicKey,
3256
- authorizedPubkey: PublicKey,
3257
- ...
3258
- };
3259
-
3260
- /**
3261
- * Merge stake instruction params
3262
- */
3263
- declare export type MergeStakeParams = {
3264
- stakePubkey: PublicKey,
3265
- sourceStakePubKey: PublicKey,
3266
- authorizedPubkey: PublicKey,
3267
- ...
3268
- };
3269
-
3270
- /**
3271
- * Stake Instruction class
3272
- */
3273
- declare export class StakeInstruction {
3274
- /**
3275
- * Decode a stake instruction and retrieve the instruction type.
3276
- */
3277
- static decodeInstructionType(
3278
- instruction: TransactionInstruction
3279
- ): StakeInstructionType;
3280
-
3281
- /**
3282
- * Decode a initialize stake instruction and retrieve the instruction params.
3283
- */
3284
- static decodeInitialize(
3285
- instruction: TransactionInstruction
3286
- ): InitializeStakeParams;
3287
-
3288
- /**
3289
- * Decode a delegate stake instruction and retrieve the instruction params.
3290
- */
3291
- static decodeDelegate(
3292
- instruction: TransactionInstruction
3293
- ): DelegateStakeParams;
3294
-
3295
- /**
3296
- * Decode an authorize stake instruction and retrieve the instruction params.
3297
- */
3298
- static decodeAuthorize(
3299
- instruction: TransactionInstruction
3300
- ): AuthorizeStakeParams;
3301
-
3302
- /**
3303
- * Decode an authorize-with-seed stake instruction and retrieve the instruction params.
3304
- */
3305
- static decodeAuthorizeWithSeed(
3306
- instruction: TransactionInstruction
3307
- ): AuthorizeWithSeedStakeParams;
3308
-
3309
- /**
3310
- * Decode a split stake instruction and retrieve the instruction params.
3311
- */
3312
- static decodeSplit(instruction: TransactionInstruction): SplitStakeParams;
3313
-
3314
- /**
3315
- * Decode a merge stake instruction and retrieve the instruction params.
3316
- */
3317
- static decodeMerge(instruction: TransactionInstruction): MergeStakeParams;
3318
-
3319
- /**
3320
- * Decode a withdraw stake instruction and retrieve the instruction params.
3321
- */
3322
- static decodeWithdraw(
3323
- instruction: TransactionInstruction
3324
- ): WithdrawStakeParams;
3325
-
3326
- /**
3327
- * Decode a deactivate stake instruction and retrieve the instruction params.
3328
- */
3329
- static decodeDeactivate(
3330
- instruction: TransactionInstruction
3331
- ): DeactivateStakeParams;
3332
- }
3333
-
3334
- /**
3335
- * An enumeration of valid StakeInstructionType's
3336
- */
3337
- declare export type StakeInstructionType =
3338
- | "Authorize"
3339
- | "AuthorizeWithSeed"
3340
- | "Deactivate"
3341
- | "Delegate"
3342
- | "Initialize"
3343
- | "Merge"
3344
- | "Split"
3345
- | "Withdraw";
3346
-
3347
- /**
3348
- * Stake authorization type
3349
- */
3350
- declare export type StakeAuthorizationType = {
3351
- /**
3352
- * The Stake Authorization index (from solana-stake-program)
3353
- */
3354
- index: number,
3355
- ...
3356
- };
3357
-
3358
- /**
3359
- * An enumeration of valid StakeAuthorizationLayout's
3360
- */
3361
- declare export var StakeAuthorizationLayout: $ReadOnly<{
3362
- Staker: {
3363
- index: number,
3364
- ...
3365
- },
3366
- Withdrawer: {
3367
- index: number,
3368
- ...
3369
- },
3370
- ...
3371
- }>;
3372
-
3373
- /**
3374
- * Factory class for transactions to interact with the Stake program
3375
- */
3376
- declare export class StakeProgram {
3377
- /**
3378
- * Public key that identifies the Stake program
3379
- */
3380
- static programId: PublicKey;
3381
-
3382
- /**
3383
- * Max space of a Stake account
3384
- *
3385
- * This is generated from the solana-stake-program StakeState struct as
3386
- * `std::mem::size_of::<StakeState>()`:
3387
- * https://docs.rs/solana-stake-program/1.4.4/solana_stake_program/stake_state/enum.StakeState.html
3388
- */
3389
- static space: number;
3390
-
3391
- /**
3392
- * Generate an Initialize instruction to add to a Stake Create transaction
3393
- */
3394
- static initialize(params: InitializeStakeParams): TransactionInstruction;
3395
-
3396
- /**
3397
- * Generate a Transaction that creates a new Stake account at
3398
- * an address generated with `from`, a seed, and the Stake programId
3399
- */
3400
- static createAccountWithSeed(
3401
- params: CreateStakeAccountWithSeedParams
3402
- ): Transaction;
3403
-
3404
- /**
3405
- * Generate a Transaction that creates a new Stake account
3406
- */
3407
- static createAccount(params: CreateStakeAccountParams): Transaction;
3408
-
3409
- /**
3410
- * Generate a Transaction that delegates Stake tokens to a validator
3411
- * Vote PublicKey. This transaction can also be used to redelegate Stake
3412
- * to a new validator Vote PublicKey.
3413
- */
3414
- static delegate(params: DelegateStakeParams): Transaction;
3415
-
3416
- /**
3417
- * Generate a Transaction that authorizes a new PublicKey as Staker
3418
- * or Withdrawer on the Stake account.
3419
- */
3420
- static authorize(params: AuthorizeStakeParams): Transaction;
3421
-
3422
- /**
3423
- * Generate a Transaction that authorizes a new PublicKey as Staker
3424
- * or Withdrawer on the Stake account.
3425
- */
3426
- static authorizeWithSeed(params: AuthorizeWithSeedStakeParams): Transaction;
3427
-
3428
- /**
3429
- * Generate a Transaction that splits Stake tokens into another stake account
3430
- */
3431
- static split(params: SplitStakeParams): Transaction;
3432
-
3433
- /**
3434
- * Generate a Transaction that splits Stake tokens into another account
3435
- * derived from a base public key and seed
3436
- */
3437
- static splitWithSeed(params: SplitStakeWithSeedParams): Transaction;
3438
-
3439
- /**
3440
- * Generate a Transaction that merges Stake accounts.
3441
- */
3442
- static merge(params: MergeStakeParams): Transaction;
3443
-
3444
- /**
3445
- * Generate a Transaction that withdraws deactivated Stake tokens.
3446
- */
3447
- static withdraw(params: WithdrawStakeParams): Transaction;
3448
-
3449
- /**
3450
- * Generate a Transaction that deactivates Stake tokens.
3451
- */
3452
- static deactivate(params: DeactivateStakeParams): Transaction;
3453
- }
3454
-
3455
- /**
3456
- * Create account system transaction params
3457
- */
3458
- declare export type CreateAccountParams = {
3459
- /**
3460
- * The account that will transfer lamports to the created account
3461
- */
3462
- fromPubkey: PublicKey,
3463
-
3464
- /**
3465
- * Public key of the created account
3466
- */
3467
- newAccountPubkey: PublicKey,
3468
-
3469
- /**
3470
- * Amount of lamports to transfer to the created account
3471
- */
3472
- lamports: number,
3473
-
3474
- /**
3475
- * Amount of space in bytes to allocate to the created account
3476
- */
3477
- space: number,
3478
-
3479
- /**
3480
- * Public key of the program to assign as the owner of the created account
3481
- */
3482
- programId: PublicKey,
3483
- ...
3484
- };
3485
-
3486
- /**
3487
- * Transfer system transaction params
3488
- */
3489
- declare export type TransferParams = {
3490
- /**
3491
- * Account that will transfer lamports
3492
- */
3493
- fromPubkey: PublicKey,
3494
-
3495
- /**
3496
- * Account that will receive transferred lamports
3497
- */
3498
- toPubkey: PublicKey,
3499
-
3500
- /**
3501
- * Amount of lamports to transfer
3502
- */
3503
- lamports: number,
3504
- ...
3505
- };
3506
-
3507
- /**
3508
- * Assign system transaction params
3509
- */
3510
- declare export type AssignParams = {
3511
- /**
3512
- * Public key of the account which will be assigned a new owner
3513
- */
3514
- accountPubkey: PublicKey,
3515
-
3516
- /**
3517
- * Public key of the program to assign as the owner
3518
- */
3519
- programId: PublicKey,
3520
- ...
3521
- };
3522
-
3523
- /**
3524
- * Create account with seed system transaction params
3525
- */
3526
- declare export type CreateAccountWithSeedParams = {
3527
- /**
3528
- * The account that will transfer lamports to the created account
3529
- */
3530
- fromPubkey: PublicKey,
3531
-
3532
- /**
3533
- * Public key of the created account. Must be pre-calculated with PublicKey.createWithSeed()
3534
- */
3535
- newAccountPubkey: PublicKey,
3536
-
3537
- /**
3538
- * Base public key to use to derive the address of the created account. Must be the same as the base key used to create `newAccountPubkey`
3539
- */
3540
- basePubkey: PublicKey,
3541
-
3542
- /**
3543
- * Seed to use to derive the address of the created account. Must be the same as the seed used to create `newAccountPubkey`
3544
- */
3545
- seed: string,
3546
-
3547
- /**
3548
- * Amount of lamports to transfer to the created account
3549
- */
3550
- lamports: number,
3551
-
3552
- /**
3553
- * Amount of space in bytes to allocate to the created account
3554
- */
3555
- space: number,
3556
-
3557
- /**
3558
- * Public key of the program to assign as the owner of the created account
3559
- */
3560
- programId: PublicKey,
3561
- ...
3562
- };
3563
-
3564
- /**
3565
- * Create nonce account system transaction params
3566
- */
3567
- declare export type CreateNonceAccountParams = {
3568
- /**
3569
- * The account that will transfer lamports to the created nonce account
3570
- */
3571
- fromPubkey: PublicKey,
3572
-
3573
- /**
3574
- * Public key of the created nonce account
3575
- */
3576
- noncePubkey: PublicKey,
3577
-
3578
- /**
3579
- * Public key to set as authority of the created nonce account
3580
- */
3581
- authorizedPubkey: PublicKey,
3582
-
3583
- /**
3584
- * Amount of lamports to transfer to the created nonce account
3585
- */
3586
- lamports: number,
3587
- ...
3588
- };
3589
-
3590
- /**
3591
- * Create nonce account with seed system transaction params
3592
- */
3593
- declare export type CreateNonceAccountWithSeedParams = {
3594
- /**
3595
- * The account that will transfer lamports to the created nonce account
3596
- */
3597
- fromPubkey: PublicKey,
3598
-
3599
- /**
3600
- * Public key of the created nonce account
3601
- */
3602
- noncePubkey: PublicKey,
3603
-
3604
- /**
3605
- * Public key to set as authority of the created nonce account
3606
- */
3607
- authorizedPubkey: PublicKey,
3608
-
3609
- /**
3610
- * Amount of lamports to transfer to the created nonce account
3611
- */
3612
- lamports: number,
3613
-
3614
- /**
3615
- * Base public key to use to derive the address of the nonce account
3616
- */
3617
- basePubkey: PublicKey,
3618
-
3619
- /**
3620
- * Seed to use to derive the address of the nonce account
3621
- */
3622
- seed: string,
3623
- ...
3624
- };
3625
-
3626
- /**
3627
- * Initialize nonce account system instruction params
3628
- */
3629
- declare export type InitializeNonceParams = {
3630
- /**
3631
- * Nonce account which will be initialized
3632
- */
3633
- noncePubkey: PublicKey,
3634
-
3635
- /**
3636
- * Public key to set as authority of the initialized nonce account
3637
- */
3638
- authorizedPubkey: PublicKey,
3639
- ...
3640
- };
3641
-
3642
- /**
3643
- * Advance nonce account system instruction params
3644
- */
3645
- declare export type AdvanceNonceParams = {
3646
- /**
3647
- * Nonce account
3648
- */
3649
- noncePubkey: PublicKey,
3650
-
3651
- /**
3652
- * Public key of the nonce authority
3653
- */
3654
- authorizedPubkey: PublicKey,
3655
- ...
3656
- };
3657
-
3658
- /**
3659
- * Withdraw nonce account system transaction params
3660
- */
3661
- declare export type WithdrawNonceParams = {
3662
- /**
3663
- * Nonce account
3664
- */
3665
- noncePubkey: PublicKey,
3666
-
3667
- /**
3668
- * Public key of the nonce authority
3669
- */
3670
- authorizedPubkey: PublicKey,
3671
-
3672
- /**
3673
- * Public key of the account which will receive the withdrawn nonce account balance
3674
- */
3675
- toPubkey: PublicKey,
3676
-
3677
- /**
3678
- * Amount of lamports to withdraw from the nonce account
3679
- */
3680
- lamports: number,
3681
- ...
3682
- };
3683
-
3684
- /**
3685
- * Authorize nonce account system transaction params
3686
- */
3687
- declare export type AuthorizeNonceParams = {
3688
- /**
3689
- * Nonce account
3690
- */
3691
- noncePubkey: PublicKey,
3692
-
3693
- /**
3694
- * Public key of the current nonce authority
3695
- */
3696
- authorizedPubkey: PublicKey,
3697
-
3698
- /**
3699
- * Public key to set as the new nonce authority
3700
- */
3701
- newAuthorizedPubkey: PublicKey,
3702
- ...
3703
- };
3704
-
3705
- /**
3706
- * Allocate account system transaction params
3707
- */
3708
- declare export type AllocateParams = {
3709
- /**
3710
- * Account to allocate
3711
- */
3712
- accountPubkey: PublicKey,
3713
-
3714
- /**
3715
- * Amount of space in bytes to allocate
3716
- */
3717
- space: number,
3718
- ...
3719
- };
3720
-
3721
- /**
3722
- * Allocate account with seed system transaction params
3723
- */
3724
- declare export type AllocateWithSeedParams = {
3725
- /**
3726
- * Account to allocate
3727
- */
3728
- accountPubkey: PublicKey,
3729
-
3730
- /**
3731
- * Base public key to use to derive the address of the allocated account
3732
- */
3733
- basePubkey: PublicKey,
3734
-
3735
- /**
3736
- * Seed to use to derive the address of the allocated account
3737
- */
3738
- seed: string,
3739
-
3740
- /**
3741
- * Amount of space in bytes to allocate
3742
- */
3743
- space: number,
3744
-
3745
- /**
3746
- * Public key of the program to assign as the owner of the allocated account
3747
- */
3748
- programId: PublicKey,
3749
- ...
3750
- };
3751
-
3752
- /**
3753
- * Assign account with seed system transaction params
3754
- */
3755
- declare export type AssignWithSeedParams = {
3756
- /**
3757
- * Public key of the account which will be assigned a new owner
3758
- */
3759
- accountPubkey: PublicKey,
3760
-
3761
- /**
3762
- * Base public key to use to derive the address of the assigned account
3763
- */
3764
- basePubkey: PublicKey,
3765
-
3766
- /**
3767
- * Seed to use to derive the address of the assigned account
3768
- */
3769
- seed: string,
3770
-
3771
- /**
3772
- * Public key of the program to assign as the owner
3773
- */
3774
- programId: PublicKey,
3775
- ...
3776
- };
3777
-
3778
- /**
3779
- * Transfer with seed system transaction params
3780
- */
3781
- declare export type TransferWithSeedParams = {
3782
- /**
3783
- * Account that will transfer lamports
3784
- */
3785
- fromPubkey: PublicKey,
3786
-
3787
- /**
3788
- * Base public key to use to derive the funding account address
3789
- */
3790
- basePubkey: PublicKey,
3791
-
3792
- /**
3793
- * Account that will receive transferred lamports
3794
- */
3795
- toPubkey: PublicKey,
3796
-
3797
- /**
3798
- * Amount of lamports to transfer
3799
- */
3800
- lamports: number,
3801
-
3802
- /**
3803
- * Seed to use to derive the funding account address
3804
- */
3805
- seed: string,
3806
-
3807
- /**
3808
- * Program id to use to derive the funding account address
3809
- */
3810
- programId: PublicKey,
3811
- ...
3812
- };
3813
-
3814
- /**
3815
- * System Instruction class
3816
- */
3817
- declare export class SystemInstruction {
3818
- /**
3819
- * Decode a system instruction and retrieve the instruction type.
3820
- */
3821
- static decodeInstructionType(
3822
- instruction: TransactionInstruction
3823
- ): SystemInstructionType;
3824
-
3825
- /**
3826
- * Decode a create account system instruction and retrieve the instruction params.
3827
- */
3828
- static decodeCreateAccount(
3829
- instruction: TransactionInstruction
3830
- ): CreateAccountParams;
3831
-
3832
- /**
3833
- * Decode a transfer system instruction and retrieve the instruction params.
3834
- */
3835
- static decodeTransfer(instruction: TransactionInstruction): TransferParams;
3836
-
3837
- /**
3838
- * Decode a transfer with seed system instruction and retrieve the instruction params.
3839
- */
3840
- static decodeTransferWithSeed(
3841
- instruction: TransactionInstruction
3842
- ): TransferWithSeedParams;
3843
-
3844
- /**
3845
- * Decode an allocate system instruction and retrieve the instruction params.
3846
- */
3847
- static decodeAllocate(instruction: TransactionInstruction): AllocateParams;
3848
-
3849
- /**
3850
- * Decode an allocate with seed system instruction and retrieve the instruction params.
3851
- */
3852
- static decodeAllocateWithSeed(
3853
- instruction: TransactionInstruction
3854
- ): AllocateWithSeedParams;
3855
-
3856
- /**
3857
- * Decode an assign system instruction and retrieve the instruction params.
3858
- */
3859
- static decodeAssign(instruction: TransactionInstruction): AssignParams;
3860
-
3861
- /**
3862
- * Decode an assign with seed system instruction and retrieve the instruction params.
3863
- */
3864
- static decodeAssignWithSeed(
3865
- instruction: TransactionInstruction
3866
- ): AssignWithSeedParams;
3867
-
3868
- /**
3869
- * Decode a create account with seed system instruction and retrieve the instruction params.
3870
- */
3871
- static decodeCreateWithSeed(
3872
- instruction: TransactionInstruction
3873
- ): CreateAccountWithSeedParams;
3874
-
3875
- /**
3876
- * Decode a nonce initialize system instruction and retrieve the instruction params.
3877
- */
3878
- static decodeNonceInitialize(
3879
- instruction: TransactionInstruction
3880
- ): InitializeNonceParams;
3881
-
3882
- /**
3883
- * Decode a nonce advance system instruction and retrieve the instruction params.
3884
- */
3885
- static decodeNonceAdvance(
3886
- instruction: TransactionInstruction
3887
- ): AdvanceNonceParams;
3888
-
3889
- /**
3890
- * Decode a nonce withdraw system instruction and retrieve the instruction params.
3891
- */
3892
- static decodeNonceWithdraw(
3893
- instruction: TransactionInstruction
3894
- ): WithdrawNonceParams;
3895
-
3896
- /**
3897
- * Decode a nonce authorize system instruction and retrieve the instruction params.
3898
- */
3899
- static decodeNonceAuthorize(
3900
- instruction: TransactionInstruction
3901
- ): AuthorizeNonceParams;
3902
- }
3903
-
3904
- /**
3905
- * An enumeration of valid SystemInstructionType's
3906
- */
3907
- declare export type SystemInstructionType =
3908
- | "AdvanceNonceAccount"
3909
- | "Allocate"
3910
- | "AllocateWithSeed"
3911
- | "Assign"
3912
- | "AssignWithSeed"
3913
- | "AuthorizeNonceAccount"
3914
- | "Create"
3915
- | "CreateWithSeed"
3916
- | "InitializeNonceAccount"
3917
- | "Transfer"
3918
- | "TransferWithSeed"
3919
- | "WithdrawNonceAccount";
3920
-
3921
- /**
3922
- * Factory class for transactions to interact with the System program
3923
- */
3924
- declare export class SystemProgram {
3925
- /**
3926
- * Public key that identifies the System program
3927
- */
3928
- static programId: PublicKey;
3929
-
3930
- /**
3931
- * Generate a transaction instruction that creates a new account
3932
- */
3933
- static createAccount(params: CreateAccountParams): TransactionInstruction;
3934
-
3935
- /**
3936
- * Generate a transaction instruction that transfers lamports from one account to another
3937
- */
3938
- static transfer(
3939
- params: TransferParams | TransferWithSeedParams
3940
- ): TransactionInstruction;
3941
-
3942
- /**
3943
- * Generate a transaction instruction that assigns an account to a program
3944
- */
3945
- static assign(
3946
- params: AssignParams | AssignWithSeedParams
3947
- ): TransactionInstruction;
3948
-
3949
- /**
3950
- * Generate a transaction instruction that creates a new account at
3951
- * an address generated with `from`, a seed, and programId
3952
- */
3953
- static createAccountWithSeed(
3954
- params: CreateAccountWithSeedParams
3955
- ): TransactionInstruction;
3956
-
3957
- /**
3958
- * Generate a transaction that creates a new Nonce account
3959
- */
3960
- static createNonceAccount(
3961
- params: CreateNonceAccountParams | CreateNonceAccountWithSeedParams
3962
- ): Transaction;
3963
-
3964
- /**
3965
- * Generate an instruction to initialize a Nonce account
3966
- */
3967
- static nonceInitialize(
3968
- params: InitializeNonceParams
3969
- ): TransactionInstruction;
3970
-
3971
- /**
3972
- * Generate an instruction to advance the nonce in a Nonce account
3973
- */
3974
- static nonceAdvance(params: AdvanceNonceParams): TransactionInstruction;
3975
-
3976
- /**
3977
- * Generate a transaction instruction that withdraws lamports from a Nonce account
3978
- */
3979
- static nonceWithdraw(params: WithdrawNonceParams): TransactionInstruction;
3980
-
3981
- /**
3982
- * Generate a transaction instruction that authorizes a new PublicKey as the authority
3983
- * on a Nonce account.
3984
- */
3985
- static nonceAuthorize(params: AuthorizeNonceParams): TransactionInstruction;
3986
-
3987
- /**
3988
- * Generate a transaction instruction that allocates space in an account without funding
3989
- */
3990
- static allocate(
3991
- params: AllocateParams | AllocateWithSeedParams
3992
- ): TransactionInstruction;
3993
- }
3994
-
3995
- /**
3996
- * Params for creating an secp256k1 instruction using a public key
3997
- */
3998
- declare export type CreateSecp256k1InstructionWithPublicKeyParams = {
3999
- publicKey: Buffer | Uint8Array | Array<number>,
4000
- message: Buffer | Uint8Array | Array<number>,
4001
- signature: Buffer | Uint8Array | Array<number>,
4002
- recoveryId: number,
4003
- instructionIndex?: number,
4004
- ...
4005
- };
4006
-
4007
- /**
4008
- * Params for creating an secp256k1 instruction using an Ethereum address
4009
- */
4010
- declare export type CreateSecp256k1InstructionWithEthAddressParams = {
4011
- ethAddress: Buffer | Uint8Array | Array<number> | string,
4012
- message: Buffer | Uint8Array | Array<number>,
4013
- signature: Buffer | Uint8Array | Array<number>,
4014
- recoveryId: number,
4015
- instructionIndex?: number,
4016
- ...
4017
- };
4018
-
4019
- /**
4020
- * Params for creating an secp256k1 instruction using a private key
4021
- */
4022
- declare export type CreateSecp256k1InstructionWithPrivateKeyParams = {
4023
- privateKey: Buffer | Uint8Array | Array<number>,
4024
- message: Buffer | Uint8Array | Array<number>,
4025
- instructionIndex?: number,
4026
- ...
4027
- };
4028
- declare export class Secp256k1Program {
4029
- /**
4030
- * Public key that identifies the secp256k1 program
4031
- */
4032
- static programId: PublicKey;
4033
-
4034
- /**
4035
- * Construct an Ethereum address from a secp256k1 public key buffer.
4036
- * @param {Buffer} publicKey a 64 byte secp256k1 public key buffer
4037
- */
4038
- static publicKeyToEthAddress(
4039
- publicKey: Buffer | Uint8Array | Array<number>
4040
- ): Buffer;
4041
-
4042
- /**
4043
- * Create an secp256k1 instruction with a public key. The public key
4044
- * must be a buffer that is 64 bytes long.
4045
- */
4046
- static createInstructionWithPublicKey(
4047
- params: CreateSecp256k1InstructionWithPublicKeyParams
4048
- ): TransactionInstruction;
4049
-
4050
- /**
4051
- * Create an secp256k1 instruction with an Ethereum address. The address
4052
- * must be a hex string or a buffer that is 20 bytes long.
4053
- */
4054
- static createInstructionWithEthAddress(
4055
- params: CreateSecp256k1InstructionWithEthAddressParams
4056
- ): TransactionInstruction;
4057
-
4058
- /**
4059
- * Create an secp256k1 instruction with a private key. The private key
4060
- * must be a buffer that is 32 bytes long.
4061
- */
4062
- static createInstructionWithPrivateKey(
4063
- params: CreateSecp256k1InstructionWithPrivateKeyParams
4064
- ): TransactionInstruction;
4065
- }
4066
- declare export var VALIDATOR_INFO_KEY: PublicKey;
4067
-
4068
- /**
4069
- * Info used to identity validators.
4070
- */
4071
- declare export type Info = {
4072
- /**
4073
- * validator name
4074
- */
4075
- name: string,
4076
-
4077
- /**
4078
- * optional, validator website
4079
- */
4080
- website?: string,
4081
-
4082
- /**
4083
- * optional, extra information the validator chose to share
4084
- */
4085
- details?: string,
4086
-
4087
- /**
4088
- * optional, used to identify validators on keybase.io
4089
- */
4090
- keybaseUsername?: string,
4091
- ...
4092
- };
4093
-
4094
- /**
4095
- * ValidatorInfo class
4096
- */
4097
- declare export class ValidatorInfo {
4098
- /**
4099
- * validator public key
4100
- */
4101
- key: PublicKey;
4102
-
4103
- /**
4104
- * validator information
4105
- */
4106
- info: Info;
4107
-
4108
- /**
4109
- * Construct a valid ValidatorInfo
4110
- * @param key validator public key
4111
- * @param info validator information
4112
- */
4113
- constructor(key: PublicKey, info: Info): this;
4114
-
4115
- /**
4116
- * Deserialize ValidatorInfo from the config account data. Exactly two config
4117
- * keys are required in the data.
4118
- * @param buffer config account data
4119
- * @return null if info was not found
4120
- */
4121
- static fromConfigData(
4122
- buffer: Buffer | Uint8Array | Array<number>
4123
- ): ValidatorInfo | null;
4124
- }
4125
- declare export var VOTE_PROGRAM_ID: PublicKey;
4126
- declare export type Lockout = {
4127
- slot: number,
4128
- confirmationCount: number,
4129
- ...
4130
- };
4131
-
4132
- /**
4133
- * History of how many credits earned by the end of each epoch
4134
- */
4135
- declare export type EpochCredits = $ReadOnly<{
4136
- epoch: number,
4137
- credits: number,
4138
- prevCredits: number,
4139
- ...
4140
- }>;
4141
- declare export type AuthorizedVoter = $ReadOnly<{
4142
- epoch: number,
4143
- authorizedVoter: PublicKey,
4144
- ...
4145
- }>;
4146
- declare export type PriorVoter = $ReadOnly<{
4147
- authorizedPubkey: PublicKey,
4148
- epochOfLastAuthorizedSwitch: number,
4149
- targetEpoch: number,
4150
- ...
4151
- }>;
4152
- declare export type BlockTimestamp = $ReadOnly<{
4153
- slot: number,
4154
- timestamp: number,
4155
- ...
4156
- }>;
4157
-
4158
- /**
4159
- * VoteAccount class
4160
- */
4161
- declare export class VoteAccount {
4162
- nodePubkey: PublicKey;
4163
- authorizedWithdrawer: PublicKey;
4164
- commission: number;
4165
- rootSlot: number | null;
4166
- votes: Lockout[];
4167
- authorizedVoters: AuthorizedVoter[];
4168
- priorVoters: PriorVoter[];
4169
- epochCredits: EpochCredits[];
4170
- lastTimestamp: BlockTimestamp;
4171
-
4172
- /**
4173
- * Deserialize VoteAccount from the account data.
4174
- * @param buffer account data
4175
- * @return VoteAccount
4176
- */
4177
- static fromAccountData(
4178
- buffer: Buffer | Uint8Array | Array<number>
4179
- ): VoteAccount;
4180
- }
4181
-
4182
- /**
4183
- * Vote account info
4184
- */
4185
- declare export class VoteInit {
4186
- nodePubkey: PublicKey;
4187
- authorizedVoter: PublicKey;
4188
- authorizedWithdrawer: PublicKey;
4189
- commission: number;
4190
- constructor(
4191
- nodePubkey: PublicKey,
4192
- authorizedVoter: PublicKey,
4193
- authorizedWithdrawer: PublicKey,
4194
- commission: number
4195
- ): this;
4196
- }
4197
-
4198
- /**
4199
- * Create vote account transaction params
4200
- */
4201
- declare export type CreateVoteAccountParams = {
4202
- fromPubkey: PublicKey,
4203
- votePubkey: PublicKey,
4204
- voteInit: VoteInit,
4205
- lamports: number,
4206
- ...
4207
- };
4208
-
4209
- /**
4210
- * InitializeAccount instruction params
4211
- */
4212
- declare export type InitializeAccountParams = {
4213
- votePubkey: PublicKey,
4214
- nodePubkey: PublicKey,
4215
- voteInit: VoteInit,
4216
- ...
4217
- };
4218
-
4219
- /**
4220
- * Authorize instruction params
4221
- */
4222
- declare export type AuthorizeVoteParams = {
4223
- votePubkey: PublicKey,
4224
-
4225
- /**
4226
- * Current vote or withdraw authority, depending on `voteAuthorizationType`
4227
- */
4228
- authorizedPubkey: PublicKey,
4229
- newAuthorizedPubkey: PublicKey,
4230
- voteAuthorizationType: VoteAuthorizationType,
4231
- ...
4232
- };
4233
-
4234
- /**
4235
- * Withdraw from vote account transaction params
4236
- */
4237
- declare export type WithdrawFromVoteAccountParams = {
4238
- votePubkey: PublicKey,
4239
- authorizedWithdrawerPubkey: PublicKey,
4240
- lamports: number,
4241
- toPubkey: PublicKey,
4242
- ...
4243
- };
4244
-
4245
- /**
4246
- * Vote Instruction class
4247
- */
4248
- declare export class VoteInstruction {
4249
- /**
4250
- * Decode a vote instruction and retrieve the instruction type.
4251
- */
4252
- static decodeInstructionType(
4253
- instruction: TransactionInstruction
4254
- ): VoteInstructionType;
4255
-
4256
- /**
4257
- * Decode an initialize vote instruction and retrieve the instruction params.
4258
- */
4259
- static decodeInitializeAccount(
4260
- instruction: TransactionInstruction
4261
- ): InitializeAccountParams;
4262
-
4263
- /**
4264
- * Decode an authorize instruction and retrieve the instruction params.
4265
- */
4266
- static decodeAuthorize(
4267
- instruction: TransactionInstruction
4268
- ): AuthorizeVoteParams;
4269
-
4270
- /**
4271
- * Decode a withdraw instruction and retrieve the instruction params.
4272
- */
4273
- static decodeWithdraw(
4274
- instruction: TransactionInstruction
4275
- ): WithdrawFromVoteAccountParams;
4276
- }
4277
-
4278
- /**
4279
- * An enumeration of valid VoteInstructionType's
4280
- */
4281
- declare export type VoteInstructionType =
4282
- | "Authorize"
4283
- | "InitializeAccount"
4284
- | "Withdraw";
4285
-
4286
- /**
4287
- * VoteAuthorize type
4288
- */
4289
- declare export type VoteAuthorizationType = {
4290
- /**
4291
- * The VoteAuthorize index (from solana-vote-program)
4292
- */
4293
- index: number,
4294
- ...
4295
- };
4296
-
4297
- /**
4298
- * An enumeration of valid VoteAuthorization layouts.
4299
- */
4300
- declare export var VoteAuthorizationLayout: $ReadOnly<{
4301
- Voter: {
4302
- index: number,
4303
- ...
4304
- },
4305
- Withdrawer: {
4306
- index: number,
4307
- ...
4308
- },
4309
- ...
4310
- }>;
4311
-
4312
- /**
4313
- * Factory class for transactions to interact with the Vote program
4314
- */
4315
- declare export class VoteProgram {
4316
- /**
4317
- * Public key that identifies the Vote program
4318
- */
4319
- static programId: PublicKey;
4320
-
4321
- /**
4322
- * Max space of a Vote account
4323
- *
4324
- * This is generated from the solana-vote-program VoteState struct as
4325
- * `VoteState::size_of()`:
4326
- * https://docs.rs/solana-vote-program/1.9.5/solana_vote_program/vote_state/struct.VoteState.html#method.size_of
4327
- */
4328
- static space: number;
4329
-
4330
- /**
4331
- * Generate an Initialize instruction.
4332
- */
4333
- static initializeAccount(
4334
- params: InitializeAccountParams
4335
- ): TransactionInstruction;
4336
-
4337
- /**
4338
- * Generate a transaction that creates a new Vote account.
4339
- */
4340
- static createAccount(params: CreateVoteAccountParams): Transaction;
4341
-
4342
- /**
4343
- * Generate a transaction that authorizes a new Voter or Withdrawer on the Vote account.
4344
- */
4345
- static authorize(params: AuthorizeVoteParams): Transaction;
4346
-
4347
- /**
4348
- * Generate a transaction to withdraw from a Vote account.
4349
- */
4350
- static withdraw(params: WithdrawFromVoteAccountParams): Transaction;
4351
- }
4352
- declare export var SYSVAR_CLOCK_PUBKEY: PublicKey;
4353
- declare export var SYSVAR_EPOCH_SCHEDULE_PUBKEY: PublicKey;
4354
- declare export var SYSVAR_INSTRUCTIONS_PUBKEY: PublicKey;
4355
- declare export var SYSVAR_RECENT_BLOCKHASHES_PUBKEY: PublicKey;
4356
- declare export var SYSVAR_RENT_PUBKEY: PublicKey;
4357
- declare export var SYSVAR_REWARDS_PUBKEY: PublicKey;
4358
- declare export var SYSVAR_SLOT_HASHES_PUBKEY: PublicKey;
4359
- declare export var SYSVAR_SLOT_HISTORY_PUBKEY: PublicKey;
4360
- declare export var SYSVAR_STAKE_HISTORY_PUBKEY: PublicKey;
4361
- declare export class SendTransactionError mixins Error {
4362
- logs: string[] | void;
4363
- constructor(message: string, logs?: string[]): this;
4364
- }
4365
-
4366
- /**
4367
- * Sign, send and confirm a transaction.
4368
- *
4369
- * If `commitment` option is not specified, defaults to 'max' commitment.
4370
- * @param {Connection} connection
4371
- * @param {Transaction} transaction
4372
- * @param {Array<Signer>} signers
4373
- * @param {ConfirmOptions} [options]
4374
- * @returns {Promise<TransactionSignature>}
4375
- */
4376
- declare export function sendAndConfirmTransaction(
4377
- connection: Connection,
4378
- transaction: Transaction,
4379
- signers: Array<Signer>,
4380
- options?: ConfirmOptions
4381
- ): Promise<TransactionSignature>;
4382
-
4383
- /**
4384
- * Send and confirm a raw transaction
4385
- *
4386
- * If `commitment` option is not specified, defaults to 'max' commitment.
4387
- * @param {Connection} connection
4388
- * @param {Buffer} rawTransaction
4389
- * @param {ConfirmOptions} [options]
4390
- * @returns {Promise<TransactionSignature>}
4391
- */
4392
- declare export function sendAndConfirmRawTransaction(
4393
- connection: Connection,
4394
- rawTransaction: Buffer,
4395
- options?: ConfirmOptions
4396
- ): Promise<TransactionSignature>;
4397
-
4398
- declare export type Cluster = "devnet" | "testnet" | "mainnet-beta";
4399
-
4400
- /**
4401
- * Retrieves the RPC API URL for the specified cluster
4402
- */
4403
- declare export function clusterApiUrl(
4404
- cluster?: Cluster,
4405
- tls?: boolean
4406
- ): string;
4407
-
4408
- /**
4409
- * There are 1-billion lamports in one SOL
4410
- */
4411
- declare export var LAMPORTS_PER_SOL: 1000000000;
4412
- }