Expose senderAddress()

This commit is contained in:
Ethan Frey 2020-02-16 19:24:30 +01:00 committed by Simon Warta
parent 28a85a5e6e
commit b6b29562cb
3 changed files with 12 additions and 6 deletions

View File

@ -122,11 +122,6 @@ export class CosmWasmClient {
private readonly signingData: SigningData | undefined;
private readonly fees: FeeTable;
private get senderAddress(): string {
if (!this.signingData) throw new Error("Signing data not set in this client");
return this.signingData.senderAddress;
}
private get signCallback(): SigningCallback {
if (!this.signingData) throw new Error("Signing data not set in this client");
return this.signingData.signCallback;
@ -143,6 +138,11 @@ export class CosmWasmClient {
return response.node_info.network;
}
public get senderAddress(): string {
if (!this.signingData) throw new Error("Signing data not set in this client");
return this.signingData.senderAddress;
}
/**
* Returns a 32 byte upper-case hex transaction hash (typically used as the transaction ID)
*/

View File

@ -10,6 +10,10 @@ export interface FeeTable {
export interface SigningCallback {
(signBytes: Uint8Array): Promise<StdSignature>;
}
export interface SigningData {
readonly senderAddress: string;
readonly signCallback: SigningCallback;
}
export interface GetNonceResult {
readonly accountNumber: number;
readonly sequence: number;
@ -44,10 +48,10 @@ export declare class CosmWasmClient {
private readonly restClient;
private readonly signingData;
private readonly fees;
private get senderAddress();
private get signCallback();
private constructor();
chainId(): Promise<string>;
get senderAddress(): string;
/**
* Returns a 32 byte upper-case hex transaction hash (typically used as the transaction ID)
*/

View File

@ -14,6 +14,8 @@ export {
SearchByIdQuery,
SearchBySentFromOrToQuery,
SearchTxQuery,
SigningCallback,
SigningData,
} from "./cosmwasmclient";
export { makeCosmoshubPath, Pen, PrehashType, Secp256k1Pen } from "./pen";
export {