feat: add account change notifications

This commit is contained in:
Michael Vines
2018-10-26 21:37:39 -07:00
parent 9839c087d7
commit e7097340f2
12 changed files with 552 additions and 25 deletions

View File

@ -41,6 +41,8 @@ declare module '@solana/web3.js' {
userdata: Buffer,
}
declare type AccountChangeCallback = (accountInfo: AccountInfo) => void;
declare export type SignatureStatus = 'Confirmed'
| 'AccountInUse'
| 'SignatureNotFound'
@ -58,6 +60,8 @@ declare module '@solana/web3.js' {
getFinality(): Promise<number>;
requestAirdrop(to: PublicKey, amount: number): Promise<TransactionSignature>;
sendTransaction(from: Account, transaction: Transaction): Promise<TransactionSignature>;
onAccountChange(publickey: PublicKey, callback: AccountChangeCallback): Promise<number>;
removeAccountListener(id: number): Promise<void>;
}
// === src/system-program.js ===