feat: expose feeCalculator

This commit is contained in:
Michael Vines
2019-06-12 14:36:05 -07:00
parent 9fde1eb404
commit 10e3a26338
7 changed files with 91 additions and 20 deletions

View File

@ -32,6 +32,13 @@ declare module '@solana/web3.js' {
secretKey: Buffer;
}
// === src/fee-calculator.js ===
declare export type FeeCalculator = {
lamportsPerSignature: number,
targetSignaturesPerSlot: number,
targetLamportsPerSignature: number,
};
// === src/budget-program.js ===
/* TODO */
@ -55,6 +62,13 @@ declare module '@solana/web3.js' {
accountInfo: AccountInfo,
};
declare export type VoteAccountInfo = {
votePubkey: string,
nodePubkey: string,
stake: number,
commission: number,
};
declare type AccountChangeCallback = (accountInfo: AccountInfo) => void;
declare type ProgramAccountChangeCallback = (
keyedAccountInfo: KeyedAccountInfo,
@ -72,13 +86,14 @@ declare module '@solana/web3.js' {
getAccountInfo(publicKey: PublicKey): Promise<AccountInfo>;
getBalance(publicKey: PublicKey): Promise<number>;
getClusterNodes(): Promise<Array<ContactInfo>>;
getEpochVoteAccounts(): Promise<Array<VoteAccountInfo>>;
confirmTransaction(signature: TransactionSignature): Promise<boolean>;
getSlotLeader(): Promise<string>;
getSignatureStatus(
signature: TransactionSignature,
): Promise<SignatureSuccess | TransactionError | null>;
getTransactionCount(): Promise<number>;
getRecentBlockhash(): Promise<Blockhash>;
getRecentBlockhash(): Promise<[Blockhash, FeeCalculator]>;
requestAirdrop(
to: PublicKey,
amount: number,