feat: add root subscription api

This commit is contained in:
Justin Starry
2020-03-27 22:22:53 +08:00
committed by Michael Vines
parent 3379e8cd46
commit a2c6c991b8
4 changed files with 154 additions and 19 deletions

3
web3.js/module.d.ts vendored
View File

@ -129,6 +129,7 @@ declare module '@solana/web3.js' {
signatureResult: SignatureSuccess | TransactionError,
context: Context,
) => void;
export type RootChangeCallback = (root: number) => void;
export type SignatureSuccess = {
Ok: null;
@ -242,6 +243,8 @@ declare module '@solana/web3.js' {
callback: SignatureResultCallback,
): number;
removeSignatureListener(id: number): Promise<void>;
onRootChange(callback: RootChangeCallback): number;
removeRootChangeListener(id: number): Promise<void>;
validatorExit(): Promise<boolean>;
getMinimumBalanceForRentExemption(
dataLength: number,