fix State type (#88)

This commit is contained in:
NorbertBodziony 2021-02-17 17:02:48 +01:00 committed by GitHub
parent 53f0e4673c
commit 1ae8b52760
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 4 deletions

View File

@ -130,10 +130,15 @@ type RpcAccounts = {
[key: string]: PublicKey | RpcAccounts;
};
export type State = {
address: () => Promise<PublicKey>;
rpc: Rpcs;
};
export type State = () =>
| Promise<any>
| {
address: () => Promise<PublicKey>;
rpc: Rpcs;
instruction: Ixs;
subscribe: (address: PublicKey, commitment?: Commitment) => EventEmitter;
unsubscribe: (address: PublicKey) => void;
};
// Tracks all subscriptions.
const subscriptions: Map<string, Subscription> = new Map();