stargate: Add getTmClient and getQueryClient methods to StargateClient

This commit is contained in:
willclarktech 2021-03-25 14:57:51 +01:00
parent 203c811eb7
commit a973cbb69d
No known key found for this signature in database
GPG Key ID: 551A86E2E398ADF7

View File

@ -130,6 +130,10 @@ export class StargateClient {
}
}
protected getTmClient(): Tendermint34Client | undefined {
return this.tmClient;
}
protected forceGetTmClient(): Tendermint34Client {
if (!this.tmClient) {
throw new Error(
@ -139,6 +143,10 @@ export class StargateClient {
return this.tmClient;
}
protected getQueryClient(): (QueryClient & AuthExtension & BankExtension) | undefined {
return this.queryClient;
}
protected forceGetQueryClient(): QueryClient & AuthExtension & BankExtension {
if (!this.queryClient) {
throw new Error("Query client not available. You cannot use online functionality in offline mode.");