cyb/src/generated/lithium/LitiumWrap.client.ts

/**
* This file was automatically generated by @cosmwasm/ts-codegen@1.14.0.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run the @cosmwasm/ts-codegen generate command to regenerate this file.
*/

import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient";
import { Coin, StdFee } from "@interchainjs/types";
import { ConfigResponse, ExecuteMsg, Uint128, Binary, Cw20ReceiveMsg, TestingOverrides, InstantiateMsg, QueryMsg, WrappedSupplyResponse } from "./LitiumWrap.types";
export interface LitiumWrapReadOnlyInterface {
  contractAddress: string;
  config: () => Promise<ConfigResponse>;
  wrappedSupply: () => Promise<WrappedSupplyResponse>;
}
export class LitiumWrapQueryClient implements LitiumWrapReadOnlyInterface {
  client: ICosmWasmClient;
  contractAddress: string;
  constructor(client: ICosmWasmClient, contractAddress: string) {
    this.client = client;
    this.contractAddress = contractAddress;
    this.config = this.config.bind(this);
    this.wrappedSupply = this.wrappedSupply.bind(this);
  }
  config = async (): Promise<ConfigResponse> => {
    return this.client.queryContractSmart(this.contractAddress, {
      config: {}
    });
  };
  wrappedSupply = async (): Promise<WrappedSupplyResponse> => {
    return this.client.queryContractSmart(this.contractAddress, {
      wrapped_supply: {}
    });
  };
}
export interface LitiumWrapInterface extends LitiumWrapReadOnlyInterface {
  contractAddress: string;
  sender: string;
  receive: ({
    amount,
    msg,
    sender
  }: {
    amount: Uint128;
    msg: Binary;
    sender: string;
  }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
  unwrapNative: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
  updateConfig: ({
    admin,
    cw20Contract
  }: {
    admin?: string;
    cw20Contract?: string;
  }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
  applyTestingOverrides: ({
    overrides
  }: {
    overrides: TestingOverrides;
  }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
}
export class LitiumWrapClient extends LitiumWrapQueryClient implements LitiumWrapInterface {
  client: ISigningCosmWasmClient;
  sender: string;
  contractAddress: string;
  constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) {
    super(client, contractAddress);
    this.client = client;
    this.sender = sender;
    this.contractAddress = contractAddress;
    this.receive = this.receive.bind(this);
    this.unwrapNative = this.unwrapNative.bind(this);
    this.updateConfig = this.updateConfig.bind(this);
    this.applyTestingOverrides = this.applyTestingOverrides.bind(this);
  }
  receive = async ({
    amount,
    msg,
    sender
  }: {
    amount: Uint128;
    msg: Binary;
    sender: string;
  }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
    return await this.client.execute(this.sender, this.contractAddress, {
      receive: {
        amount,
        msg,
        sender
      }
    }, fee_, memo_, funds_);
  };
  unwrapNative = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
    return await this.client.execute(this.sender, this.contractAddress, {
      unwrap_native: {}
    }, fee_, memo_, funds_);
  };
  updateConfig = async ({
    admin,
    cw20Contract
  }: {
    admin?: string;
    cw20Contract?: string;
  }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
    return await this.client.execute(this.sender, this.contractAddress, {
      update_config: {
        admin,
        cw20_contract: cw20Contract
      }
    }, fee_, memo_, funds_);
  };
  applyTestingOverrides = async ({
    overrides
  }: {
    overrides: TestingOverrides;
  }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
    return await this.client.execute(this.sender, this.contractAddress, {
      apply_testing_overrides: {
        overrides
      }
    }, fee_, memo_, funds_);
  };
}

Neighbours