import { QueriesSetBase } from "../queries" ; import { ChainGetter } from "../../common" ; import { KVStore } from "@keplr-wallet/common" ; import { ObservableQuerySecretContractCodeHash } from "./contract-hash" ; import { ObservableQuerySecret20ContractInfo } from "./secret20-contract-info" ; import { DeepReadonly } from "utility-types" ; import { ObservableQuerySecret20BalanceRegistry } from "./secret20-balance" ; import { QueriesWithCosmos } from "../cosmos" ; import { Keplr } from "@keplr-wallet/types" ; export interface HasSecretQueries { secret : SecretQueries ; } export class QueriesWithCosmosAndSecret extends QueriesWithCosmos implements HasSecretQueries { public secret : SecretQueries ; constructor ( kvStore , chainId , chainGetter , apiGetter ) { super ( kvStore , chainId , chainGetter ) ; this . secret = new SecretQueries ( this , kvStore , chainId , chainGetter , apiGetter ) ; } } export class SecretQueries { public readonly querySecretContractCodeHash : DeepReadonly < ObservableQuerySecretContractCodeHash > ; public readonly querySecret20ContractInfo : DeepReadonly < ObservableQuerySecret20ContractInfo > ; constructor ( base , kvStore , chainId , chainGetter , apiGetter ) { this . querySecretContractCodeHash = new ObservableQuerySecretContractCodeHash ( kvStore , chainId , chainGetter ) ; base . queryBalances . addBalanceRegistry ( new ObservableQuerySecret20BalanceRegistry ( kvStore , apiGetter , this . querySecretContractCodeHash ) ) ; this . querySecret20ContractInfo = new ObservableQuerySecret20ContractInfo ( kvStore , chainId , chainGetter , apiGetter , this . querySecretContractCodeHash ) ; } }