cyb/src/generated/lithium/LitiumStake.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, Uint256, Cw20ReceiveMsg, TestingOverrides, InstantiateMsg, QueryMsg, StakeInfoResponse, StakingStatsResponse, TotalPendingRewardsResponse, TotalStakedResponse } from "./LitiumStake.types";
export interface LitiumStakeReadOnlyInterface {
  contractAddress: string;
  config: () => Promise<ConfigResponse>;
  totalStaked: () => Promise<TotalStakedResponse>;
  stakeInfo: ({
    address
  }: {
    address: string;
  }) => Promise<StakeInfoResponse>;
  stakingStats: () => Promise<StakingStatsResponse>;
  totalPendingRewards: () => Promise<TotalPendingRewardsResponse>;
}
export class LitiumStakeQueryClient implements LitiumStakeReadOnlyInterface {
  client: ICosmWasmClient;
  contractAddress: string;
  constructor(client: ICosmWasmClient, contractAddress: string) {
    this.client = client;
    this.contractAddress = contractAddress;
    this.config = this.config.bind(this);
    this.totalStaked = this.totalStaked.bind(this);
    this.stakeInfo = this.stakeInfo.bind(this);
    this.stakingStats = this.stakingStats.bind(this);
    this.totalPendingRewards = this.totalPendingRewards.bind(this);
  }
  config = async (): Promise<ConfigResponse> => {
    return this.client.queryContractSmart(this.contractAddress, {
      config: {}
    });
  };
  totalStaked = async (): Promise<TotalStakedResponse> => {
    return this.client.queryContractSmart(this.contractAddress, {
      total_staked: {}
    });
  };
  stakeInfo = async ({
    address
  }: {
    address: string;
  }): Promise<StakeInfoResponse> => {
    return this.client.queryContractSmart(this.contractAddress, {
      stake_info: {
        address
      }
    });
  };
  stakingStats = async (): Promise<StakingStatsResponse> => {
    return this.client.queryContractSmart(this.contractAddress, {
      staking_stats: {}
    });
  };
  totalPendingRewards = async (): Promise<TotalPendingRewardsResponse> => {
    return this.client.queryContractSmart(this.contractAddress, {
      total_pending_rewards: {}
    });
  };
}
export interface LitiumStakeInterface extends LitiumStakeReadOnlyInterface {
  contractAddress: string;
  sender: string;
  accrueReward: ({
    amount
  }: {
    amount: Uint128;
  }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
  receive: ({
    amount,
    msg,
    sender
  }: {
    amount: Uint128;
    msg: Binary;
    sender: string;
  }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
  unstake: ({
    amount
  }: {
    amount: Uint128;
  }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
  claimUnbonding: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
  claimStakingRewards: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
  updateConfig: ({
    admin,
    coreContract,
    mineContract,
    tokenContract,
    unbondingPeriodSeconds
  }: {
    admin?: string;
    coreContract?: string;
    mineContract?: string;
    tokenContract?: string;
    unbondingPeriodSeconds?: number;
  }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
  applyTestingOverrides: ({
    overrides
  }: {
    overrides: TestingOverrides;
  }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
  resetState: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
  pause: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
  unpause: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
}
export class LitiumStakeClient extends LitiumStakeQueryClient implements LitiumStakeInterface {
  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.accrueReward = this.accrueReward.bind(this);
    this.receive = this.receive.bind(this);
    this.unstake = this.unstake.bind(this);
    this.claimUnbonding = this.claimUnbonding.bind(this);
    this.claimStakingRewards = this.claimStakingRewards.bind(this);
    this.updateConfig = this.updateConfig.bind(this);
    this.applyTestingOverrides = this.applyTestingOverrides.bind(this);
    this.resetState = this.resetState.bind(this);
    this.pause = this.pause.bind(this);
    this.unpause = this.unpause.bind(this);
  }
  accrueReward = async ({
    amount
  }: {
    amount: Uint128;
  }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
    return await this.client.execute(this.sender, this.contractAddress, {
      accrue_reward: {
        amount
      }
    }, fee_, memo_, funds_);
  };
  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_);
  };
  unstake = async ({
    amount
  }: {
    amount: Uint128;
  }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
    return await this.client.execute(this.sender, this.contractAddress, {
      unstake: {
        amount
      }
    }, fee_, memo_, funds_);
  };
  claimUnbonding = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
    return await this.client.execute(this.sender, this.contractAddress, {
      claim_unbonding: {}
    }, fee_, memo_, funds_);
  };
  claimStakingRewards = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
    return await this.client.execute(this.sender, this.contractAddress, {
      claim_staking_rewards: {}
    }, fee_, memo_, funds_);
  };
  updateConfig = async ({
    admin,
    coreContract,
    mineContract,
    tokenContract,
    unbondingPeriodSeconds
  }: {
    admin?: string;
    coreContract?: string;
    mineContract?: string;
    tokenContract?: string;
    unbondingPeriodSeconds?: number;
  }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
    return await this.client.execute(this.sender, this.contractAddress, {
      update_config: {
        admin,
        core_contract: coreContract,
        mine_contract: mineContract,
        token_contract: tokenContract,
        unbonding_period_seconds: unbondingPeriodSeconds
      }
    }, 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_);
  };
  resetState = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
    return await this.client.execute(this.sender, this.contractAddress, {
      reset_state: {}
    }, fee_, memo_, funds_);
  };
  pause = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
    return await this.client.execute(this.sender, this.contractAddress, {
      pause: {}
    }, fee_, memo_, funds_);
  };
  unpause = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
    return await this.client.execute(this.sender, this.contractAddress, {
      unpause: {}
    }, fee_, memo_, funds_);
  };
}

Neighbours