cyb/src/generated/lithium/LitiumMine.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 { Uint128, ConfigResponse, EmissionInfoResponse, ExecuteMsg, TestingOverrides, InstantiateMsg, MinerStatsResponse, QueryMsg, RewardCalculationResponse, StatsResponse, WindowStatusResponse } from "./LitiumMine.types";
export interface LitiumMineReadOnlyInterface {
  contractAddress: string;
  config: () => Promise<ConfigResponse>;
  windowStatus: () => Promise<WindowStatusResponse>;
  stats: () => Promise<StatsResponse>;
  minerStats: ({
    address
  }: {
    address: string;
  }) => Promise<MinerStatsResponse>;
  calculateReward: ({
    difficultyBits
  }: {
    difficultyBits: number;
  }) => Promise<CalculateRewardResponse>;
  emissionInfo: () => Promise<EmissionInfoResponse>;
}
export class LitiumMineQueryClient implements LitiumMineReadOnlyInterface {
  client: ICosmWasmClient;
  contractAddress: string;
  constructor(client: ICosmWasmClient, contractAddress: string) {
    this.client = client;
    this.contractAddress = contractAddress;
    this.config = this.config.bind(this);
    this.windowStatus = this.windowStatus.bind(this);
    this.stats = this.stats.bind(this);
    this.minerStats = this.minerStats.bind(this);
    this.calculateReward = this.calculateReward.bind(this);
    this.emissionInfo = this.emissionInfo.bind(this);
  }
  config = async (): Promise<ConfigResponse> => {
    return this.client.queryContractSmart(this.contractAddress, {
      config: {}
    });
  };
  windowStatus = async (): Promise<WindowStatusResponse> => {
    return this.client.queryContractSmart(this.contractAddress, {
      window_status: {}
    });
  };
  stats = async (): Promise<StatsResponse> => {
    return this.client.queryContractSmart(this.contractAddress, {
      stats: {}
    });
  };
  minerStats = async ({
    address
  }: {
    address: string;
  }): Promise<MinerStatsResponse> => {
    return this.client.queryContractSmart(this.contractAddress, {
      miner_stats: {
        address
      }
    });
  };
  calculateReward = async ({
    difficultyBits
  }: {
    difficultyBits: number;
  }): Promise<CalculateRewardResponse> => {
    return this.client.queryContractSmart(this.contractAddress, {
      calculate_reward: {
        difficulty_bits: difficultyBits
      }
    });
  };
  emissionInfo = async (): Promise<EmissionInfoResponse> => {
    return this.client.queryContractSmart(this.contractAddress, {
      emission_info: {}
    });
  };
}
export interface LitiumMineInterface extends LitiumMineReadOnlyInterface {
  contractAddress: string;
  sender: string;
  submitProof: ({
    challenge,
    difficulty,
    hash,
    minerAddress,
    nonce,
    referrer,
    timestamp
  }: {
    challenge: string;
    difficulty: number;
    hash: string;
    minerAddress: string;
    nonce: number;
    referrer?: string;
    timestamp: number;
  }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
  accrueFees: ({
    amount
  }: {
    amount: Uint128;
  }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
  updateConfig: ({
    admin,
    coreContract,
    estimatedGasCostUboot,
    genesisTime,
    maxProofAge,
    minDifficulty,
    pidInterval,
    referContract,
    stakeContract,
    warmupBaseRate
  }: {
    admin?: string;
    coreContract?: string;
    estimatedGasCostUboot?: Uint128;
    genesisTime?: number;
    maxProofAge?: number;
    minDifficulty?: number;
    pidInterval?: number;
    referContract?: string;
    stakeContract?: string;
    warmupBaseRate?: Uint128;
  }, 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: ({
    genesisTime
  }: {
    genesisTime?: number;
  }, 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 LitiumMineClient extends LitiumMineQueryClient implements LitiumMineInterface {
  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.submitProof = this.submitProof.bind(this);
    this.accrueFees = this.accrueFees.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);
  }
  submitProof = async ({
    challenge,
    difficulty,
    hash,
    minerAddress,
    nonce,
    referrer,
    timestamp
  }: {
    challenge: string;
    difficulty: number;
    hash: string;
    minerAddress: string;
    nonce: number;
    referrer?: string;
    timestamp: number;
  }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
    return await this.client.execute(this.sender, this.contractAddress, {
      submit_proof: {
        challenge,
        difficulty,
        hash,
        miner_address: minerAddress,
        nonce,
        referrer,
        timestamp
      }
    }, fee_, memo_, funds_);
  };
  accrueFees = 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_fees: {
        amount
      }
    }, fee_, memo_, funds_);
  };
  updateConfig = async ({
    admin,
    coreContract,
    estimatedGasCostUboot,
    genesisTime,
    maxProofAge,
    minDifficulty,
    pidInterval,
    referContract,
    stakeContract,
    warmupBaseRate
  }: {
    admin?: string;
    coreContract?: string;
    estimatedGasCostUboot?: Uint128;
    genesisTime?: number;
    maxProofAge?: number;
    minDifficulty?: number;
    pidInterval?: number;
    referContract?: string;
    stakeContract?: string;
    warmupBaseRate?: Uint128;
  }, 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,
        estimated_gas_cost_uboot: estimatedGasCostUboot,
        genesis_time: genesisTime,
        max_proof_age: maxProofAge,
        min_difficulty: minDifficulty,
        pid_interval: pidInterval,
        refer_contract: referContract,
        stake_contract: stakeContract,
        warmup_base_rate: warmupBaseRate
      }
    }, 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 ({
    genesisTime
  }: {
    genesisTime?: number;
  }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
    return await this.client.execute(this.sender, this.contractAddress, {
      reset_state: {
        genesis_time: genesisTime
      }
    }, 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