2018-09-28 20:18:57 -07:00
|
|
|
/**
|
|
|
|
* Flow Library definition for @solana/web3.js
|
|
|
|
*
|
|
|
|
* This file is manually generated from the contents of src/
|
|
|
|
*
|
|
|
|
* Usage: add the following line under the [libs] section of your project's
|
|
|
|
* .flowconfig:
|
|
|
|
* [libs]
|
|
|
|
* node_modules/@solana/web3.js/module.flow.js
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-01-29 14:29:18 +08:00
|
|
|
import * as BufferLayout from 'buffer-layout';
|
2018-10-16 13:51:04 -07:00
|
|
|
|
2018-09-28 20:18:57 -07:00
|
|
|
declare module '@solana/web3.js' {
|
2018-09-30 18:42:45 -07:00
|
|
|
// === src/publickey.js ===
|
|
|
|
declare export class PublicKey {
|
2019-09-29 13:12:01 -04:00
|
|
|
constructor(value: number | string | Buffer | Array<number>): PublicKey;
|
2018-09-30 18:42:45 -07:00
|
|
|
static isPublicKey(o: Object): boolean;
|
|
|
|
equals(publickey: PublicKey): boolean;
|
|
|
|
toBase58(): string;
|
|
|
|
toBuffer(): Buffer;
|
2019-09-29 13:12:01 -04:00
|
|
|
toString(): string;
|
2018-09-30 18:42:45 -07:00
|
|
|
}
|
|
|
|
|
2019-03-04 08:06:33 -08:00
|
|
|
// === src/blockhash.js ===
|
|
|
|
declare export type Blockhash = string;
|
|
|
|
|
2018-09-28 20:18:57 -07:00
|
|
|
// === src/account.js ===
|
|
|
|
declare export class Account {
|
|
|
|
constructor(secretKey: ?Buffer): Account;
|
|
|
|
publicKey: PublicKey;
|
2018-09-30 18:42:45 -07:00
|
|
|
secretKey: Buffer;
|
2018-09-28 20:18:57 -07:00
|
|
|
}
|
|
|
|
|
2019-06-12 14:36:05 -07:00
|
|
|
// === src/fee-calculator.js ===
|
|
|
|
declare export type FeeCalculator = {
|
2019-06-26 13:49:29 -07:00
|
|
|
burnPercent: number,
|
2019-06-12 14:36:05 -07:00
|
|
|
lamportsPerSignature: number,
|
2019-06-26 13:49:29 -07:00
|
|
|
maxLamportsPerSignature: number,
|
|
|
|
minLamportsPerSignature: number,
|
2019-06-12 14:36:05 -07:00
|
|
|
targetLamportsPerSignature: number,
|
2019-06-26 13:49:29 -07:00
|
|
|
targetSignaturesPerSlot: number,
|
2019-06-12 14:36:05 -07:00
|
|
|
};
|
|
|
|
|
2018-09-28 20:18:57 -07:00
|
|
|
// === src/budget-program.js ===
|
|
|
|
/* TODO */
|
|
|
|
|
|
|
|
// === src/connection.js ===
|
2019-11-13 17:31:31 -05:00
|
|
|
declare export type RpcResponseAndContext<T> = {
|
|
|
|
context: {
|
|
|
|
slot: number,
|
|
|
|
},
|
|
|
|
value: T,
|
|
|
|
};
|
|
|
|
|
2019-11-11 13:01:10 -05:00
|
|
|
declare export type Commitment = 'max' | 'recent';
|
|
|
|
|
2020-01-29 14:29:18 +08:00
|
|
|
declare export type SignatureStatusResult =
|
|
|
|
| SignatureSuccess
|
|
|
|
| TransactionError
|
|
|
|
| null;
|
|
|
|
|
|
|
|
declare export type BlockhashAndFeeCalculator = {
|
|
|
|
blockhash: Blockhash,
|
|
|
|
feeCalculator: FeeCalculator,
|
|
|
|
};
|
|
|
|
|
|
|
|
declare export type PublicKeyAndAccount = {
|
|
|
|
pubkey: PublicKey,
|
|
|
|
account: AccountInfo,
|
|
|
|
};
|
|
|
|
|
2018-09-28 21:45:04 -07:00
|
|
|
declare export type AccountInfo = {
|
2018-11-04 11:41:21 -08:00
|
|
|
executable: boolean,
|
2018-11-14 10:06:13 -08:00
|
|
|
owner: PublicKey,
|
2019-03-05 17:52:13 -08:00
|
|
|
lamports: number,
|
2019-03-14 13:27:47 -07:00
|
|
|
data: Buffer,
|
2020-01-16 12:21:08 -07:00
|
|
|
rentEpoch: number | null,
|
2018-11-04 11:41:21 -08:00
|
|
|
};
|
2018-09-28 20:18:57 -07:00
|
|
|
|
2019-04-23 09:53:26 -07:00
|
|
|
declare export type ContactInfo = {
|
|
|
|
id: string,
|
|
|
|
gossip: string,
|
|
|
|
tpu: string | null,
|
|
|
|
rpc: string | null,
|
|
|
|
};
|
|
|
|
|
2019-11-19 15:38:06 -07:00
|
|
|
declare export type ConfirmedBlock = {
|
|
|
|
blockhash: Blockhash,
|
|
|
|
previousBlockhash: Blockhash,
|
|
|
|
parentSlot: number,
|
2020-01-16 12:21:08 -07:00
|
|
|
transactions: Array<{
|
|
|
|
transaction: Transaction,
|
|
|
|
meta: {
|
|
|
|
fee: number,
|
|
|
|
preBalances: Array<number>,
|
|
|
|
postBalances: Array<number>,
|
|
|
|
status: SignatureStatusResult,
|
|
|
|
},
|
|
|
|
}>,
|
2019-11-19 15:38:06 -07:00
|
|
|
};
|
|
|
|
|
2019-03-14 15:59:25 -07:00
|
|
|
declare export type KeyedAccountInfo = {
|
|
|
|
accountId: PublicKey,
|
|
|
|
accountInfo: AccountInfo,
|
|
|
|
};
|
|
|
|
|
2019-11-11 20:09:00 -05:00
|
|
|
declare export type Version = {
|
|
|
|
'solana-core': string,
|
|
|
|
};
|
|
|
|
|
2019-06-12 14:36:05 -07:00
|
|
|
declare export type VoteAccountInfo = {
|
|
|
|
votePubkey: string,
|
|
|
|
nodePubkey: string,
|
|
|
|
stake: number,
|
|
|
|
commission: number,
|
|
|
|
};
|
|
|
|
|
2019-11-25 11:04:35 -05:00
|
|
|
declare export type SlotInfo = {
|
|
|
|
parent: 'number',
|
|
|
|
slot: 'number',
|
|
|
|
root: 'number',
|
|
|
|
};
|
|
|
|
|
2018-10-26 21:37:39 -07:00
|
|
|
declare type AccountChangeCallback = (accountInfo: AccountInfo) => void;
|
2019-03-19 12:54:47 -07:00
|
|
|
declare type ProgramAccountChangeCallback = (
|
|
|
|
keyedAccountInfo: KeyedAccountInfo,
|
|
|
|
) => void;
|
2019-11-25 11:04:35 -05:00
|
|
|
declare type SlotChangeCallback = (slotInfo: SlotInfo) => void;
|
2018-10-26 21:37:39 -07:00
|
|
|
|
2019-04-10 14:40:49 -07:00
|
|
|
declare export type SignatureSuccess = {|
|
|
|
|
Ok: null,
|
|
|
|
|};
|
|
|
|
declare export type TransactionError = {|
|
|
|
|
Err: Object,
|
|
|
|
|};
|
2018-09-28 20:18:57 -07:00
|
|
|
|
2019-10-23 09:48:24 -04:00
|
|
|
declare export type Inflation = {
|
|
|
|
foundation: number,
|
2020-01-16 12:21:08 -07:00
|
|
|
foundationTerm: number,
|
2019-10-23 09:48:24 -04:00
|
|
|
initial: number,
|
|
|
|
storage: number,
|
|
|
|
taper: number,
|
|
|
|
terminal: number,
|
|
|
|
};
|
|
|
|
|
|
|
|
declare export type EpochSchedule = {
|
2020-01-16 12:21:08 -07:00
|
|
|
slotsPerEpoch: number,
|
|
|
|
leaderScheduleSlotOffset: number,
|
2019-10-23 09:48:24 -04:00
|
|
|
warmup: boolean,
|
2020-01-16 12:21:08 -07:00
|
|
|
firstNormalEpoch: number,
|
|
|
|
firstNormalSlot: number,
|
2019-10-23 09:48:24 -04:00
|
|
|
};
|
|
|
|
|
2020-01-29 14:29:18 +08:00
|
|
|
declare export type VoteAccountStatus = {
|
|
|
|
current: Array<VoteAccountInfo>,
|
|
|
|
delinquent: Array<VoteAccountInfo>,
|
|
|
|
};
|
|
|
|
|
2018-09-28 20:18:57 -07:00
|
|
|
declare export class Connection {
|
2019-11-11 13:01:10 -05:00
|
|
|
constructor(endpoint: string, commitment: ?Commitment): Connection;
|
2019-11-13 17:31:31 -05:00
|
|
|
getAccountInfoAndContext(
|
|
|
|
publicKey: PublicKey,
|
|
|
|
commitment: ?Commitment,
|
|
|
|
): Promise<RpcResponseAndContext<AccountInfo>>;
|
2019-11-11 13:01:10 -05:00
|
|
|
getAccountInfo(
|
|
|
|
publicKey: PublicKey,
|
|
|
|
commitment: ?Commitment,
|
|
|
|
): Promise<AccountInfo>;
|
2019-06-28 19:28:06 -06:00
|
|
|
getProgramAccounts(
|
|
|
|
programId: PublicKey,
|
2019-11-11 13:01:10 -05:00
|
|
|
commitment: ?Commitment,
|
2020-01-16 12:21:08 -07:00
|
|
|
): Promise<Array<PublicKeyAndAccount>>;
|
2019-11-13 17:31:31 -05:00
|
|
|
getBalanceAndContext(
|
|
|
|
publicKey: PublicKey,
|
|
|
|
commitment: ?Commitment,
|
|
|
|
): Promise<RpcResponseAndContext<number>>;
|
2019-11-11 13:01:10 -05:00
|
|
|
getBalance(publicKey: PublicKey, commitment: ?Commitment): Promise<number>;
|
2019-04-23 09:53:26 -07:00
|
|
|
getClusterNodes(): Promise<Array<ContactInfo>>;
|
2019-11-19 15:38:06 -07:00
|
|
|
getConfirmedBlock(): Promise<ConfirmedBlock>;
|
2019-11-11 13:01:10 -05:00
|
|
|
getVoteAccounts(commitment: ?Commitment): Promise<VoteAccountStatus>;
|
2019-11-13 17:31:31 -05:00
|
|
|
confirmTransactionAndContext(
|
|
|
|
signature: TransactionSignature,
|
|
|
|
commitment: ?Commitment,
|
|
|
|
): Promise<RpcResponseAndContext<boolean>>;
|
2019-11-11 13:01:10 -05:00
|
|
|
confirmTransaction(
|
|
|
|
signature: TransactionSignature,
|
|
|
|
commitment: ?Commitment,
|
|
|
|
): Promise<boolean>;
|
|
|
|
getSlot(commitment: ?Commitment): Promise<number>;
|
|
|
|
getSlotLeader(commitment: ?Commitment): Promise<string>;
|
2018-11-04 11:41:21 -08:00
|
|
|
getSignatureStatus(
|
|
|
|
signature: TransactionSignature,
|
2019-11-11 13:01:10 -05:00
|
|
|
commitment: ?Commitment,
|
2019-04-10 14:40:49 -07:00
|
|
|
): Promise<SignatureSuccess | TransactionError | null>;
|
2019-11-11 13:01:10 -05:00
|
|
|
getTransactionCount(commitment: ?Commitment): Promise<number>;
|
|
|
|
getTotalSupply(commitment: ?Commitment): Promise<number>;
|
2019-11-11 20:09:00 -05:00
|
|
|
getVersion(): Promise<Version>;
|
2019-11-11 13:01:10 -05:00
|
|
|
getInflation(commitment: ?Commitment): Promise<Inflation>;
|
2019-10-23 09:48:24 -04:00
|
|
|
getEpochSchedule(): Promise<EpochSchedule>;
|
2019-11-13 17:31:31 -05:00
|
|
|
getRecentBlockhashAndContext(
|
|
|
|
commitment: ?Commitment,
|
2020-01-16 12:21:08 -07:00
|
|
|
): Promise<RpcResponseAndContext<BlockhashAndFeeCalculator>>;
|
2019-11-11 13:01:10 -05:00
|
|
|
getRecentBlockhash(
|
|
|
|
commitment: ?Commitment,
|
2020-01-16 12:21:08 -07:00
|
|
|
): Promise<BlockhashAndFeeCalculator>;
|
2018-11-04 11:41:21 -08:00
|
|
|
requestAirdrop(
|
|
|
|
to: PublicKey,
|
|
|
|
amount: number,
|
2019-11-11 13:01:10 -05:00
|
|
|
commitment: ?Commitment,
|
2018-11-04 11:41:21 -08:00
|
|
|
): Promise<TransactionSignature>;
|
|
|
|
sendTransaction(
|
|
|
|
transaction: Transaction,
|
2018-11-18 08:48:14 -08:00
|
|
|
...signers: Array<Account>
|
2018-11-04 11:41:21 -08:00
|
|
|
): Promise<TransactionSignature>;
|
2020-01-21 22:16:56 -07:00
|
|
|
sendEncodedTransaction(
|
|
|
|
encodedTransaction: string,
|
|
|
|
): Promise<TransactionSignature>;
|
2018-11-28 10:06:17 -08:00
|
|
|
sendRawTransaction(wireTransaction: Buffer): Promise<TransactionSignature>;
|
2018-11-04 11:41:21 -08:00
|
|
|
onAccountChange(
|
|
|
|
publickey: PublicKey,
|
|
|
|
callback: AccountChangeCallback,
|
|
|
|
): number;
|
2018-10-27 19:48:37 -07:00
|
|
|
removeAccountChangeListener(id: number): Promise<void>;
|
2019-03-08 17:02:39 -07:00
|
|
|
onProgramAccountChange(
|
|
|
|
programId: PublicKey,
|
|
|
|
callback: ProgramAccountChangeCallback,
|
|
|
|
): number;
|
2019-11-25 11:04:35 -05:00
|
|
|
onSlotChange(callback: SlotChangeCallback): number;
|
2019-03-08 17:02:39 -07:00
|
|
|
removeProgramAccountChangeListener(id: number): Promise<void>;
|
2019-10-11 11:55:08 -06:00
|
|
|
validatorExit(): Promise<boolean>;
|
2020-01-03 11:30:16 -08:00
|
|
|
getMinimumBalanceForRentExemption(
|
|
|
|
dataLength: number,
|
|
|
|
commitment: ?Commitment,
|
|
|
|
): Promise<number>;
|
2018-09-28 20:18:57 -07:00
|
|
|
}
|
|
|
|
|
2019-12-23 11:46:49 -07:00
|
|
|
// === src/stake-program.js ===
|
2020-01-29 14:29:18 +08:00
|
|
|
declare export type StakeAuthorizationType = {|
|
|
|
|
index: number,
|
|
|
|
|};
|
|
|
|
|
|
|
|
declare export class Authorized {
|
|
|
|
staker: PublicKey;
|
|
|
|
withdrawer: PublicKey;
|
|
|
|
constructor(staker: PublicKey, withdrawer: PublicKey): Authorized;
|
|
|
|
}
|
|
|
|
|
|
|
|
declare export class Lockup {
|
|
|
|
unixTimestamp: number;
|
|
|
|
epoch: number;
|
|
|
|
custodian: PublicKey;
|
|
|
|
constructor(
|
|
|
|
unixTimestamp: number,
|
|
|
|
epoch: number,
|
|
|
|
custodian: PublicKey,
|
|
|
|
): Lockup;
|
|
|
|
}
|
|
|
|
|
2019-12-23 11:46:49 -07:00
|
|
|
declare export class StakeProgram {
|
|
|
|
static programId: PublicKey;
|
|
|
|
static space: number;
|
|
|
|
|
|
|
|
static createAccount(
|
|
|
|
from: PublicKey,
|
|
|
|
stakeAccount: PublicKey,
|
|
|
|
authorized: Authorized,
|
|
|
|
lockup: Lockup,
|
|
|
|
lamports: number,
|
|
|
|
): Transaction;
|
|
|
|
static createAccountWithSeed(
|
|
|
|
from: PublicKey,
|
|
|
|
stakeAccount: PublicKey,
|
|
|
|
seed: string,
|
|
|
|
authorized: Authorized,
|
|
|
|
lockup: Lockup,
|
|
|
|
lamports: number,
|
|
|
|
): Transaction;
|
|
|
|
static delegate(
|
|
|
|
stakeAccount: PublicKey,
|
|
|
|
authorizedPubkey: PublicKey,
|
|
|
|
votePubkey: PublicKey,
|
|
|
|
): Transaction;
|
|
|
|
static authorize(
|
|
|
|
stakeAccount: PublicKey,
|
|
|
|
authorizedPubkey: PublicKey,
|
|
|
|
newAuthorized: PublicKey,
|
|
|
|
stakeAuthorizationType: StakeAuthorizationType,
|
|
|
|
): Transaction;
|
|
|
|
static split(
|
|
|
|
stakeAccount: PublicKey,
|
|
|
|
authorizedPubkey: PublicKey,
|
|
|
|
lamports: number,
|
|
|
|
splitStakePubkey: PublicKey,
|
|
|
|
): Transaction;
|
|
|
|
static withdraw(
|
|
|
|
stakeAccount: PublicKey,
|
|
|
|
withdrawerPubkey: PublicKey,
|
|
|
|
to: PublicKey,
|
|
|
|
lamports: number,
|
|
|
|
): Transaction;
|
|
|
|
static deactivate(
|
|
|
|
stakeAccount: PublicKey,
|
|
|
|
authorizedPubkey: PublicKey,
|
|
|
|
): Transaction;
|
|
|
|
}
|
|
|
|
|
2018-09-28 20:18:57 -07:00
|
|
|
// === src/system-program.js ===
|
|
|
|
declare export class SystemProgram {
|
|
|
|
static programId: PublicKey;
|
|
|
|
|
|
|
|
static createAccount(
|
|
|
|
from: PublicKey,
|
|
|
|
newAccount: PublicKey,
|
2019-03-05 17:52:13 -08:00
|
|
|
lamports: number,
|
2018-09-28 20:18:57 -07:00
|
|
|
space: number,
|
2018-11-04 11:41:21 -08:00
|
|
|
programId: PublicKey,
|
2018-09-28 20:18:57 -07:00
|
|
|
): Transaction;
|
2019-04-23 09:53:26 -07:00
|
|
|
static transfer(
|
|
|
|
from: PublicKey,
|
|
|
|
to: PublicKey,
|
|
|
|
amount: number,
|
|
|
|
): Transaction;
|
2018-09-28 20:18:57 -07:00
|
|
|
static assign(from: PublicKey, programId: PublicKey): Transaction;
|
2019-12-09 19:50:01 -08:00
|
|
|
static createAccountWithSeed(
|
|
|
|
from: PublicKey,
|
|
|
|
newAccount: PublicKey,
|
2019-12-29 14:16:32 -08:00
|
|
|
base: PublicKey,
|
2019-12-09 19:50:01 -08:00
|
|
|
seed: string,
|
|
|
|
lamports: number,
|
|
|
|
space: number,
|
|
|
|
programId: PublicKey,
|
|
|
|
): Transaction;
|
2018-09-28 20:18:57 -07:00
|
|
|
}
|
|
|
|
|
2019-07-15 21:59:19 -04:00
|
|
|
// === src/validator-info.js ===
|
2019-07-24 16:01:07 -07:00
|
|
|
declare export var VALIDATOR_INFO_KEY;
|
2019-07-15 21:59:19 -04:00
|
|
|
declare export type Info = {|
|
|
|
|
name: string,
|
|
|
|
website?: string,
|
|
|
|
details?: string,
|
2019-07-18 09:40:34 -06:00
|
|
|
keybaseUsername?: string,
|
2019-07-15 21:59:19 -04:00
|
|
|
|};
|
|
|
|
|
|
|
|
declare export class ValidatorInfo {
|
|
|
|
key: PublicKey;
|
|
|
|
info: Info;
|
|
|
|
|
|
|
|
constructor(key: PublicKey, info: Info): ValidatorInfo;
|
|
|
|
static fromConfigData(buffer: Buffer): ?ValidatorInfo;
|
|
|
|
}
|
|
|
|
|
2019-12-23 11:46:49 -07:00
|
|
|
// === src/sysvar.js ===
|
|
|
|
declare export var SYSVAR_CLOCK_PUBKEY;
|
2019-10-04 02:51:24 +05:30
|
|
|
declare export var SYSVAR_RENT_PUBKEY;
|
2019-12-23 11:46:49 -07:00
|
|
|
declare export var SYSVAR_REWARDS_PUBKEY;
|
|
|
|
declare export var SYSVAR_STAKE_HISTORY_PUBKEY;
|
2019-10-04 02:51:24 +05:30
|
|
|
|
2019-07-23 18:06:55 -07:00
|
|
|
// === src/vote-account.js ===
|
2019-12-23 11:46:49 -07:00
|
|
|
declare export var VOTE_PROGRAM_ID;
|
2019-07-23 18:06:55 -07:00
|
|
|
declare export type Lockout = {|
|
|
|
|
slot: number,
|
|
|
|
confirmationCount: number,
|
|
|
|
|};
|
|
|
|
|
|
|
|
declare export type EpochCredits = {|
|
|
|
|
epoch: number,
|
|
|
|
credits: number,
|
|
|
|
prevCredits: number,
|
|
|
|
|};
|
|
|
|
|
|
|
|
declare export class VoteAccount {
|
|
|
|
votes: Array<Lockout>;
|
|
|
|
nodePubkey: PublicKey;
|
|
|
|
authorizedVoterPubkey: PublicKey;
|
|
|
|
commission: number;
|
|
|
|
rootSlot: number | null;
|
|
|
|
epoch: number;
|
|
|
|
credits: number;
|
|
|
|
lastEpochCredits: number;
|
|
|
|
epochCredits: Array<EpochCredits>;
|
|
|
|
static fromAccountData(buffer: Buffer): VoteAccount;
|
|
|
|
}
|
|
|
|
|
2019-12-23 11:46:49 -07:00
|
|
|
// === src/instruction.js ===
|
|
|
|
declare export type InstructionType = {|
|
|
|
|
index: number,
|
|
|
|
layout: typeof BufferLayout,
|
|
|
|
|};
|
|
|
|
|
|
|
|
declare export function encodeData(
|
|
|
|
type: InstructionType,
|
|
|
|
fields: Object,
|
|
|
|
): Buffer;
|
|
|
|
|
2018-09-28 20:18:57 -07:00
|
|
|
// === src/transaction.js ===
|
2018-09-28 21:45:04 -07:00
|
|
|
declare export type TransactionSignature = string;
|
2018-09-28 20:18:57 -07:00
|
|
|
|
2018-10-23 15:17:43 -07:00
|
|
|
declare type TransactionInstructionCtorFields = {|
|
2019-11-06 10:42:01 -07:00
|
|
|
keys: ?Array<{pubkey: PublicKey, isSigner: boolean, isWritable: boolean}>,
|
2018-11-04 11:41:21 -08:00
|
|
|
programId?: PublicKey,
|
2019-03-14 13:27:47 -07:00
|
|
|
data?: Buffer,
|
2018-09-28 20:18:57 -07:00
|
|
|
|};
|
|
|
|
|
2018-10-23 15:17:43 -07:00
|
|
|
declare export class TransactionInstruction {
|
2019-11-06 10:42:01 -07:00
|
|
|
keys: Array<{pubkey: PublicKey, isSigner: boolean, isWritable: boolean}>;
|
2018-11-03 18:13:13 -07:00
|
|
|
programId: PublicKey;
|
2019-03-14 13:27:47 -07:00
|
|
|
data: Buffer;
|
2019-07-26 15:13:56 -04:00
|
|
|
|
|
|
|
constructor(
|
|
|
|
opts?: TransactionInstructionCtorFields,
|
|
|
|
): TransactionInstruction;
|
2018-10-23 15:17:43 -07:00
|
|
|
}
|
|
|
|
|
2018-11-28 10:46:09 -08:00
|
|
|
declare type SignaturePubkeyPair = {|
|
|
|
|
signature: Buffer | null,
|
|
|
|
publicKey: PublicKey,
|
|
|
|
|};
|
|
|
|
|
2018-10-23 15:17:43 -07:00
|
|
|
declare type TransactionCtorFields = {|
|
2019-03-04 08:06:33 -08:00
|
|
|
recentBlockhash?: Blockhash,
|
2018-11-28 10:06:17 -08:00
|
|
|
signatures?: Array<SignaturePubkeyPair>,
|
2018-10-23 15:17:43 -07:00
|
|
|
|};
|
2018-09-28 20:18:57 -07:00
|
|
|
|
|
|
|
declare export class Transaction {
|
2018-11-28 12:19:08 -08:00
|
|
|
signatures: Array<SignaturePubkeyPair>;
|
2018-09-28 20:18:57 -07:00
|
|
|
signature: ?Buffer;
|
2018-11-03 18:13:13 -07:00
|
|
|
instructions: Array<TransactionInstruction>;
|
2019-03-04 08:06:33 -08:00
|
|
|
recentBlockhash: ?Blockhash;
|
2018-09-28 20:18:57 -07:00
|
|
|
|
|
|
|
constructor(opts?: TransactionCtorFields): Transaction;
|
2018-11-04 11:41:21 -08:00
|
|
|
add(
|
2019-10-19 11:36:06 -07:00
|
|
|
...items: Array<
|
|
|
|
Transaction | TransactionInstruction | TransactionInstructionCtorFields,
|
|
|
|
>
|
2018-11-04 11:41:21 -08:00
|
|
|
): Transaction;
|
2018-11-28 10:06:17 -08:00
|
|
|
sign(...signers: Array<Account>): void;
|
|
|
|
signPartial(...partialSigners: Array<PublicKey | Account>): void;
|
|
|
|
addSigner(signer: Account): void;
|
2018-09-28 20:18:57 -07:00
|
|
|
serialize(): Buffer;
|
|
|
|
}
|
2018-10-06 11:23:18 -07:00
|
|
|
|
2018-10-17 09:35:24 -07:00
|
|
|
// === src/loader.js ===
|
|
|
|
declare export class Loader {
|
2019-10-22 16:10:21 -07:00
|
|
|
static getMinNumSignatures(dataLength: number): number;
|
2019-05-08 09:33:04 -07:00
|
|
|
static load(
|
|
|
|
connection: Connection,
|
|
|
|
payer: Account,
|
|
|
|
program: Account,
|
|
|
|
programId: PublicKey,
|
|
|
|
data: Array<number>,
|
|
|
|
): Promise<PublicKey>;
|
2018-10-17 09:35:24 -07:00
|
|
|
}
|
|
|
|
|
2018-10-30 08:00:11 -07:00
|
|
|
// === src/bpf-loader.js ===
|
|
|
|
declare export class BpfLoader {
|
|
|
|
static programId: PublicKey;
|
2019-10-22 16:10:21 -07:00
|
|
|
static getMinNumSignatures(dataLength: number): number;
|
2018-10-30 08:00:11 -07:00
|
|
|
static load(
|
|
|
|
connection: Connection,
|
2019-05-08 09:33:04 -07:00
|
|
|
payer: Account,
|
2018-10-30 08:00:11 -07:00
|
|
|
elfBytes: Array<number>,
|
|
|
|
): Promise<PublicKey>;
|
|
|
|
}
|
|
|
|
|
2018-10-22 22:30:48 -07:00
|
|
|
// === src/util/send-and-confirm-transaction.js ===
|
|
|
|
declare export function sendAndConfirmTransaction(
|
|
|
|
connection: Connection,
|
|
|
|
transaction: Transaction,
|
2018-11-18 08:48:14 -08:00
|
|
|
...signers: Array<Account>
|
2018-11-03 19:02:12 -07:00
|
|
|
): Promise<TransactionSignature>;
|
2018-11-28 11:56:50 -08:00
|
|
|
|
2019-11-11 13:01:10 -05:00
|
|
|
declare export function sendAndConfirmRecentTransaction(
|
|
|
|
connection: Connection,
|
|
|
|
transaction: Transaction,
|
|
|
|
...signers: Array<Account>
|
|
|
|
): Promise<TransactionSignature>;
|
|
|
|
|
2018-11-28 11:56:50 -08:00
|
|
|
// === src/util/send-and-confirm-raw-transaction.js ===
|
|
|
|
declare export function sendAndConfirmRawTransaction(
|
|
|
|
connection: Connection,
|
|
|
|
wireTransaction: Buffer,
|
2019-11-11 13:01:10 -05:00
|
|
|
commitment: ?Commitment,
|
2018-11-28 11:56:50 -08:00
|
|
|
): Promise<TransactionSignature>;
|
2018-12-19 19:28:28 -08:00
|
|
|
|
|
|
|
// === src/util/testnet.js ===
|
2020-01-29 14:29:18 +08:00
|
|
|
declare export function testnetChannelEndpoint(
|
|
|
|
channel?: string,
|
|
|
|
tls?: boolean,
|
|
|
|
): string;
|
2019-10-19 11:36:06 -07:00
|
|
|
|
2019-12-30 11:36:12 -07:00
|
|
|
declare export var LAMPORTS_PER_SOL: number;
|
2018-09-28 20:18:57 -07:00
|
|
|
}
|