iexec / Exports / IExecVoucherModule
module exposing voucher methods
-
↳
IExecVoucherModule
• new IExecVoucherModule(configOrArgs
, options?
): IExecVoucherModule
Create an IExecModule instance
Name | Type |
---|---|
configOrArgs |
IExecConfig | IExecConfigArgs |
options? |
IExecConfigOptions |
• 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);
Name | Type |
---|---|
requester |
string |
Promise
<string
>
▸ getVoucherAddress(owner
): Promise
<null
| string
>
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);
Name | Type |
---|---|
owner |
string |
Promise
<null
| string
>
▸ revokeRequesterAuthorization(requester
): Promise
<string
>
Name | Type |
---|---|
requester |
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);
Name | Type |
---|---|
owner |
string |
Promise
<VoucherInfo
>
▸ fromConfig(config
): IExecVoucherModule
Create an IExecVoucherModule instance using an IExecConfig instance
Name | Type |
---|---|
config |
IExecConfig |