iexec / IExecVoucherModule
module exposing voucher methods
new IExecVoucherModule(
configOrArgs,options?):IExecVoucherModule
Create an IExecModule instance
IExecVoucherModule
config:
IExecConfig
current IExecConfig
authorizeRequester(
requester):Promise<string>
SIGNER REQUIRED
authorize a requester to use the voucher
example:
const txHash = await authorizeRequester(requesterAddress);
console.log('tx:', txHash);string
Promise<string>
getVoucherAddress(
owner):Promise<string|null>
returns the address of the voucher contract for the specified address if the address owns a voucher
example:
const voucherAddress = await getVoucherAddress(ownerAddress);
console.log('voucher contract address:', voucherAddress);string
Promise<string | null>
revokeRequesterAuthorization(
requester):Promise<string>
string
Promise<string>
showUserVoucher(
owner):Promise<VoucherInfo>
returns the user voucher information
example:
const userVoucher = await showUserVoucher(userAddress);
console.log('address:', userVoucher.address);
console.log('balance:', userVoucher.balance);
console.log('expiration:', userVoucher.expirationTimestamp);
console.log('sponsored apps:', userVoucher.sponsoredApps);
console.log('sponsored datasets:', userVoucher.sponsoredDatasets);
console.log('sponsored workerpools:', userVoucher.sponsoredWorkerpools);
console.log('allowance on user account:', userVoucher.allowanceAmount);
console.log('authorized accounts:', userVoucher.authorizedAccounts);string
Promise<VoucherInfo>
staticfromConfig(config):IExecVoucherModule
Create an IExecVoucherModule instance using an IExecConfig instance
IExecVoucherModule