From 30446807b95ce6afc571bc1d4a5e9a2a22695c3b Mon Sep 17 00:00:00 2001 From: Justin Starry Date: Wed, 29 Jan 2020 14:29:18 +0800 Subject: [PATCH] fix: update outdated module.flow.js --- web3.js/module.flow.js | 48 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/web3.js/module.flow.js b/web3.js/module.flow.js index 2bbe84dc67..5a86d6693b 100644 --- a/web3.js/module.flow.js +++ b/web3.js/module.flow.js @@ -10,7 +10,7 @@ * */ -import BN from 'bn.js'; +import * as BufferLayout from 'buffer-layout'; declare module '@solana/web3.js' { // === src/publickey.js === @@ -56,6 +56,21 @@ declare module '@solana/web3.js' { declare export type Commitment = 'max' | 'recent'; + declare export type SignatureStatusResult = + | SignatureSuccess + | TransactionError + | null; + + declare export type BlockhashAndFeeCalculator = { + blockhash: Blockhash, + feeCalculator: FeeCalculator, + }; + + declare export type PublicKeyAndAccount = { + pubkey: PublicKey, + account: AccountInfo, + }; + declare export type AccountInfo = { executable: boolean, owner: PublicKey, @@ -138,6 +153,11 @@ declare module '@solana/web3.js' { firstNormalSlot: number, }; + declare export type VoteAccountStatus = { + current: Array, + delinquent: Array, + }; + declare export class Connection { constructor(endpoint: string, commitment: ?Commitment): Connection; getAccountInfoAndContext( @@ -217,6 +237,27 @@ declare module '@solana/web3.js' { } // === src/stake-program.js === + 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; + } + declare export class StakeProgram { static programId: PublicKey; static space: number; @@ -444,7 +485,10 @@ declare module '@solana/web3.js' { ): Promise; // === src/util/testnet.js === - declare export function testnetChannelEndpoint(channel?: string): string; + declare export function testnetChannelEndpoint( + channel?: string, + tls?: boolean, + ): string; declare export var LAMPORTS_PER_SOL: number; }