cosmwasm: Query contract account by default in Cw3CosmWasmClient
This commit is contained in:
parent
db6e585206
commit
62f1410b92
@ -1,6 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { BroadcastMode, GasLimits, GasPrice, OfflineSigner } from "@cosmjs/launchpad";
|
||||
|
||||
import { Account } from "./cosmwasmclient";
|
||||
import { CosmWasmFeeTable, ExecuteResult, SigningCosmWasmClient } from "./signingcosmwasmclient";
|
||||
|
||||
export type Expiration =
|
||||
@ -75,17 +76,21 @@ export class Cw3CosmWasmClient extends SigningCosmWasmClient {
|
||||
|
||||
public constructor(
|
||||
apiUrl: string,
|
||||
senderAddress: string,
|
||||
signerAddress: string,
|
||||
signer: OfflineSigner,
|
||||
cw3ContractAddress: string,
|
||||
gasPrice?: GasPrice,
|
||||
gasLimits?: Partial<GasLimits<CosmWasmFeeTable>>,
|
||||
broadcastMode?: BroadcastMode,
|
||||
) {
|
||||
super(apiUrl, senderAddress, signer, gasPrice, gasLimits, broadcastMode);
|
||||
super(apiUrl, signerAddress, signer, gasPrice, gasLimits, broadcastMode);
|
||||
this.cw3ContractAddress = cw3ContractAddress;
|
||||
}
|
||||
|
||||
public getAccount(address?: string): Promise<Account | undefined> {
|
||||
return super.getAccount(address || this.cw3ContractAddress);
|
||||
}
|
||||
|
||||
public getThreshold(): Promise<ThresholdResult> {
|
||||
return this.queryContractSmart(this.cw3ContractAddress, { threshold: {} });
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import { BroadcastMode, GasLimits, GasPrice, OfflineSigner } from "@cosmjs/launchpad";
|
||||
import { Account } from "./cosmwasmclient";
|
||||
import { CosmWasmFeeTable, ExecuteResult, SigningCosmWasmClient } from "./signingcosmwasmclient";
|
||||
export declare type Expiration =
|
||||
| {
|
||||
@ -63,13 +64,14 @@ export declare class Cw3CosmWasmClient extends SigningCosmWasmClient {
|
||||
private readonly cw3ContractAddress;
|
||||
constructor(
|
||||
apiUrl: string,
|
||||
senderAddress: string,
|
||||
signerAddress: string,
|
||||
signer: OfflineSigner,
|
||||
cw3ContractAddress: string,
|
||||
gasPrice?: GasPrice,
|
||||
gasLimits?: Partial<GasLimits<CosmWasmFeeTable>>,
|
||||
broadcastMode?: BroadcastMode,
|
||||
);
|
||||
getAccount(address?: string): Promise<Account | undefined>;
|
||||
getThreshold(): Promise<ThresholdResult>;
|
||||
getProposal(proposalId: number): Promise<ProposalResult>;
|
||||
listProposals({ startAfter, limit }?: StartAfterNumberPaginationOptions): Promise<ProposalsResult>;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user