cyb/src/generated/lithium/LitiumRefer.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, CommunityPoolBalanceResponse, ConfigResponse, ExecuteMsg, TestingOverrides, InstantiateMsg, QueryMsg, ReferralInfoResponse, ReferrerOfResponse, TotalPendingRewardsResponse } from "./LitiumRefer.types";
export interface LitiumReferReadOnlyInterface {
  contractAddress: string;
  config: () => Promise<ConfigResponse>;
  referrerOf: ({
    miner
  }: {
    miner: string;
  }) => Promise<ReferrerOfResponse>;
  referralInfo: ({
    address
  }: {
    address: string;
  }) => Promise<ReferralInfoResponse>;
  communityPoolBalance: () => Promise<CommunityPoolBalanceResponse>;
  totalPendingRewards: () => Promise<TotalPendingRewardsResponse>;
}
export class LitiumReferQueryClient implements LitiumReferReadOnlyInterface {
  client: ICosmWasmClient;
  contractAddress: string;
  constructor(client: ICosmWasmClient, contractAddress: string) {
    this.client = client;
    this.contractAddress = contractAddress;
    this.config = this.config.bind(this);
    this.referrerOf = this.referrerOf.bind(this);
    this.referralInfo = this.referralInfo.bind(this);
    this.communityPoolBalance = this.communityPoolBalance.bind(this);
    this.totalPendingRewards = this.totalPendingRewards.bind(this);
  }
  config = async (): Promise<ConfigResponse> => {
    return this.client.queryContractSmart(this.contractAddress, {
      config: {}
    });
  };
  referrerOf = async ({
    miner
  }: {
    miner: string;
  }): Promise<ReferrerOfResponse> => {
    return this.client.queryContractSmart(this.contractAddress, {
      referrer_of: {
        miner
      }
    });
  };
  referralInfo = async ({
    address
  }: {
    address: string;
  }): Promise<ReferralInfoResponse> => {
    return this.client.queryContractSmart(this.contractAddress, {
      referral_info: {
        address
      }
    });
  };
  communityPoolBalance = async (): Promise<CommunityPoolBalanceResponse> => {
    return this.client.queryContractSmart(this.contractAddress, {
      community_pool_balance: {}
    });
  };
  totalPendingRewards = async (): Promise<TotalPendingRewardsResponse> => {
    return this.client.queryContractSmart(this.contractAddress, {
      total_pending_rewards: {}
    });
  };
}
export interface LitiumReferInterface extends LitiumReferReadOnlyInterface {
  contractAddress: string;
  sender: string;
  bindReferrer: ({
    miner,
    referrer
  }: {
    miner: string;
    referrer: string;
  }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
  accrueReward: ({
    amount,
    miner
  }: {
    amount: Uint128;
    miner: string;
  }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
  claimRewards: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
  claimCommunityPool: ({
    to
  }: {
    to: string;
  }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
  updateConfig: ({
    admin,
    communityPoolAddr,
    coreContract,
    mineContract
  }: {
    admin?: string;
    communityPoolAddr?: string;
    coreContract?: string;
    mineContract?: 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>;
  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 LitiumReferClient extends LitiumReferQueryClient implements LitiumReferInterface {
  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.bindReferrer = this.bindReferrer.bind(this);
    this.accrueReward = this.accrueReward.bind(this);
    this.claimRewards = this.claimRewards.bind(this);
    this.claimCommunityPool = this.claimCommunityPool.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);
  }
  bindReferrer = async ({
    miner,
    referrer
  }: {
    miner: string;
    referrer: string;
  }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
    return await this.client.execute(this.sender, this.contractAddress, {
      bind_referrer: {
        miner,
        referrer
      }
    }, fee_, memo_, funds_);
  };
  accrueReward = async ({
    amount,
    miner
  }: {
    amount: Uint128;
    miner: string;
  }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
    return await this.client.execute(this.sender, this.contractAddress, {
      accrue_reward: {
        amount,
        miner
      }
    }, fee_, memo_, funds_);
  };
  claimRewards = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
    return await this.client.execute(this.sender, this.contractAddress, {
      claim_rewards: {}
    }, fee_, memo_, funds_);
  };
  claimCommunityPool = async ({
    to
  }: {
    to: string;
  }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
    return await this.client.execute(this.sender, this.contractAddress, {
      claim_community_pool: {
        to
      }
    }, fee_, memo_, funds_);
  };
  updateConfig = async ({
    admin,
    communityPoolAddr,
    coreContract,
    mineContract
  }: {
    admin?: string;
    communityPoolAddr?: string;
    coreContract?: string;
    mineContract?: string;
  }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
    return await this.client.execute(this.sender, this.contractAddress, {
      update_config: {
        admin,
        community_pool_addr: communityPoolAddr,
        core_contract: coreContract,
        mine_contract: mineContract
      }
    }, 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