/**
* 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, BurnStatsResponse, ConfigResponse, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, TestingOverrides, Cw20ReceiveMsg, InstantiateMsg, IsAuthorizedCallerResponse, QueryMsg, TotalMintedResponse } from "./LitiumCore.types";
export interface LitiumCoreReadOnlyInterface {
contractAddress: string;
config: () => Promise<ConfigResponse>;
burnStats: () => Promise<BurnStatsResponse>;
totalMinted: () => Promise<TotalMintedResponse>;
isAuthorizedCaller: ({
address
}: {
address: string;
}) => Promise<IsAuthorizedCallerResponse>;
balance: ({
address
}: {
address: string;
}) => Promise<BalanceResponse>;
tokenInfo: () => Promise<TokenInfoResponse>;
minter: () => Promise<MinterResponse>;
allowance: ({
owner,
spender
}: {
owner: string;
spender: string;
}) => Promise<AllowanceResponse>;
allAllowances: ({
limit,
owner,
startAfter
}: {
limit?: number;
owner: string;
startAfter?: string;
}) => Promise<AllAllowancesResponse>;
allSpenderAllowances: ({
limit,
spender,
startAfter
}: {
limit?: number;
spender: string;
startAfter?: string;
}) => Promise<AllSpenderAllowancesResponse>;
allAccounts: ({
limit,
startAfter
}: {
limit?: number;
startAfter?: string;
}) => Promise<AllAccountsResponse>;
}
export class LitiumCoreQueryClient implements LitiumCoreReadOnlyInterface {
client: ICosmWasmClient;
contractAddress: string;
constructor(client: ICosmWasmClient, contractAddress: string) {
this.client = client;
this.contractAddress = contractAddress;
this.config = this.config.bind(this);
this.burnStats = this.burnStats.bind(this);
this.totalMinted = this.totalMinted.bind(this);
this.isAuthorizedCaller = this.isAuthorizedCaller.bind(this);
this.balance = this.balance.bind(this);
this.tokenInfo = this.tokenInfo.bind(this);
this.minter = this.minter.bind(this);
this.allowance = this.allowance.bind(this);
this.allAllowances = this.allAllowances.bind(this);
this.allSpenderAllowances = this.allSpenderAllowances.bind(this);
this.allAccounts = this.allAccounts.bind(this);
}
config = async (): Promise<ConfigResponse> => {
return this.client.queryContractSmart(this.contractAddress, {
config: {}
});
};
burnStats = async (): Promise<BurnStatsResponse> => {
return this.client.queryContractSmart(this.contractAddress, {
burn_stats: {}
});
};
totalMinted = async (): Promise<TotalMintedResponse> => {
return this.client.queryContractSmart(this.contractAddress, {
total_minted: {}
});
};
isAuthorizedCaller = async ({
address
}: {
address: string;
}): Promise<IsAuthorizedCallerResponse> => {
return this.client.queryContractSmart(this.contractAddress, {
is_authorized_caller: {
address
}
});
};
balance = async ({
address
}: {
address: string;
}): Promise<BalanceResponse> => {
return this.client.queryContractSmart(this.contractAddress, {
balance: {
address
}
});
};
tokenInfo = async (): Promise<TokenInfoResponse> => {
return this.client.queryContractSmart(this.contractAddress, {
token_info: {}
});
};
minter = async (): Promise<MinterResponse> => {
return this.client.queryContractSmart(this.contractAddress, {
minter: {}
});
};
allowance = async ({
owner,
spender
}: {
owner: string;
spender: string;
}): Promise<AllowanceResponse> => {
return this.client.queryContractSmart(this.contractAddress, {
allowance: {
owner,
spender
}
});
};
allAllowances = async ({
limit,
owner,
startAfter
}: {
limit?: number;
owner: string;
startAfter?: string;
}): Promise<AllAllowancesResponse> => {
return this.client.queryContractSmart(this.contractAddress, {
all_allowances: {
limit,
owner,
start_after: startAfter
}
});
};
allSpenderAllowances = async ({
limit,
spender,
startAfter
}: {
limit?: number;
spender: string;
startAfter?: string;
}): Promise<AllSpenderAllowancesResponse> => {
return this.client.queryContractSmart(this.contractAddress, {
all_spender_allowances: {
limit,
spender,
start_after: startAfter
}
});
};
allAccounts = async ({
limit,
startAfter
}: {
limit?: number;
startAfter?: string;
}): Promise<AllAccountsResponse> => {
return this.client.queryContractSmart(this.contractAddress, {
all_accounts: {
limit,
start_after: startAfter
}
});
};
}
export interface LitiumCoreInterface extends LitiumCoreReadOnlyInterface {
contractAddress: string;
sender: string;
transfer: ({
amount,
recipient
}: {
amount: Uint128;
recipient: string;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
transferFrom: ({
amount,
owner,
recipient
}: {
amount: Uint128;
owner: string;
recipient: string;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
send: ({
amount,
contract,
msg
}: {
amount: Uint128;
contract: string;
msg: Binary;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
sendFrom: ({
amount,
contract,
msg,
owner
}: {
amount: Uint128;
contract: string;
msg: Binary;
owner: string;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
burn: ({
amount
}: {
amount: Uint128;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
burnFrom: ({
amount,
owner
}: {
amount: Uint128;
owner: string;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
increaseAllowance: ({
amount,
expires,
spender
}: {
amount: Uint128;
expires?: Expiration;
spender: string;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
decreaseAllowance: ({
amount,
expires,
spender
}: {
amount: Uint128;
expires?: Expiration;
spender: string;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
mint: ({
amount,
to
}: {
amount: Uint128;
to: string;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
registerAuthorizedCaller: ({
contractAddr
}: {
contractAddr: string;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
removeAuthorizedCaller: ({
contractAddr
}: {
contractAddr: string;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
updateConfig: ({
admin,
mineContract,
referContract,
stakeContract,
wrapContract
}: {
admin?: string;
mineContract?: string;
referContract?: string;
stakeContract?: string;
wrapContract?: 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>;
receive: ({
amount,
msg,
sender
}: {
amount: Uint128;
msg: Binary;
sender: string;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<any>;
}
export class LitiumCoreClient extends LitiumCoreQueryClient implements LitiumCoreInterface {
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.transfer = this.transfer.bind(this);
this.transferFrom = this.transferFrom.bind(this);
this.send = this.send.bind(this);
this.sendFrom = this.sendFrom.bind(this);
this.burn = this.burn.bind(this);
this.burnFrom = this.burnFrom.bind(this);
this.increaseAllowance = this.increaseAllowance.bind(this);
this.decreaseAllowance = this.decreaseAllowance.bind(this);
this.mint = this.mint.bind(this);
this.registerAuthorizedCaller = this.registerAuthorizedCaller.bind(this);
this.removeAuthorizedCaller = this.removeAuthorizedCaller.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);
this.receive = this.receive.bind(this);
}
transfer = async ({
amount,
recipient
}: {
amount: Uint128;
recipient: string;
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
return await this.client.execute(this.sender, this.contractAddress, {
transfer: {
amount,
recipient
}
}, fee_, memo_, funds_);
};
transferFrom = async ({
amount,
owner,
recipient
}: {
amount: Uint128;
owner: string;
recipient: string;
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
return await this.client.execute(this.sender, this.contractAddress, {
transfer_from: {
amount,
owner,
recipient
}
}, fee_, memo_, funds_);
};
send = async ({
amount,
contract,
msg
}: {
amount: Uint128;
contract: string;
msg: Binary;
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
return await this.client.execute(this.sender, this.contractAddress, {
send: {
amount,
contract,
msg
}
}, fee_, memo_, funds_);
};
sendFrom = async ({
amount,
contract,
msg,
owner
}: {
amount: Uint128;
contract: string;
msg: Binary;
owner: string;
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
return await this.client.execute(this.sender, this.contractAddress, {
send_from: {
amount,
contract,
msg,
owner
}
}, fee_, memo_, funds_);
};
burn = async ({
amount
}: {
amount: Uint128;
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
return await this.client.execute(this.sender, this.contractAddress, {
burn: {
amount
}
}, fee_, memo_, funds_);
};
burnFrom = async ({
amount,
owner
}: {
amount: Uint128;
owner: string;
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
return await this.client.execute(this.sender, this.contractAddress, {
burn_from: {
amount,
owner
}
}, fee_, memo_, funds_);
};
increaseAllowance = async ({
amount,
expires,
spender
}: {
amount: Uint128;
expires?: Expiration;
spender: string;
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
return await this.client.execute(this.sender, this.contractAddress, {
increase_allowance: {
amount,
expires,
spender
}
}, fee_, memo_, funds_);
};
decreaseAllowance = async ({
amount,
expires,
spender
}: {
amount: Uint128;
expires?: Expiration;
spender: string;
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
return await this.client.execute(this.sender, this.contractAddress, {
decrease_allowance: {
amount,
expires,
spender
}
}, fee_, memo_, funds_);
};
mint = async ({
amount,
to
}: {
amount: Uint128;
to: string;
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
return await this.client.execute(this.sender, this.contractAddress, {
mint: {
amount,
to
}
}, fee_, memo_, funds_);
};
registerAuthorizedCaller = async ({
contractAddr
}: {
contractAddr: string;
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
return await this.client.execute(this.sender, this.contractAddress, {
register_authorized_caller: {
contract_addr: contractAddr
}
}, fee_, memo_, funds_);
};
removeAuthorizedCaller = async ({
contractAddr
}: {
contractAddr: string;
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
return await this.client.execute(this.sender, this.contractAddress, {
remove_authorized_caller: {
contract_addr: contractAddr
}
}, fee_, memo_, funds_);
};
updateConfig = async ({
admin,
mineContract,
referContract,
stakeContract,
wrapContract
}: {
admin?: string;
mineContract?: string;
referContract?: string;
stakeContract?: string;
wrapContract?: string;
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<any> => {
return await this.client.execute(this.sender, this.contractAddress, {
update_config: {
admin,
mine_contract: mineContract,
refer_contract: referContract,
stake_contract: stakeContract,
wrap_contract: wrapContract
}
}, 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_);
};
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_);
};
}