import { Signer, TransactionRequest } from 'ethers'; import { AbiItem, ReceiptOrEstimate, ValidationResponse } from '../@types'; import { Config } from '../config'; import { SmartContractWithAddress } from './SmartContractWithAddress'; export declare class EscrowContract extends SmartContractWithAddress { abiEnterprise: AbiItem[]; getDefaultAbi(): AbiItem[]; /** * Instantiate AccessList class * @param {string} address The contract address. * @param {Signer} signer The signer object. * @param {string | number} [network] Network id or name * @param {Config} [config] The configuration object. * @param {AbiItem[]} [abi] ABI array of the smart contract */ constructor(address: string, signer: Signer, network?: string | number, config?: Config, abi?: AbiItem[]); /** * Get Funds * @return {Promise} Funds */ getFunds(token: string): Promise; /** * Get User Funds * @return {Promise} User funds */ getUserFunds(payer: string, token: string): Promise; /** * Get User Tokens * @return {Promise} Array of tokens */ getUserTokens(payer: string): Promise; /** * Get Locks * @return {Promise<[]>} Locks */ getLocks(token: string, payer: string, payee: string): Promise; /** * Get Authorizations * @return {Promise<[]>} Authorizations */ getAuthorizations(token: string, payer: string, payee: string): Promise; /** * Checks funds for escrow payment. * Does authorization when needed. * Does deposit when needed. * @param {String} token as payment token for escrow * @param {String} consumerAddress as consumerAddress for that environment * @param {String} amountToDeposit wanted amount for escrow lock deposit. If this is * not provided and funds for escrow are 0 -> fallback to maxLockedAmount, else * use balance of payment token. * @param {String} maxLockedAmount amount necessary to be paid for starting compute job, * returned from initialize compute payment and used for authorize if needed. * @param {String} maxLockSeconds max seconds to lock the payment, * returned from initialize compute payment and used for authorize if needed. * @param {String} maxLockCounts max lock counts, * returned from initialize compute payment and used for authorize if needed. * @param {number} [tokenDecimals] optional number of decimals of the token * @return {Promise} validation response */ verifyFundsForEscrowPayment(token: string, consumerAddress: string, amountToDeposit?: string, maxLockedAmount?: string, maxLockSeconds?: string, maxLockCounts?: string, tokenDecimals?: number): Promise; /** * Deposit funds * @param {String} token Token address * @param {String} amount amount * @param {number} [tokenDecimals] optional number of decimals of the token * @param {Boolean} estimateGas if True, return gas estimate * @return {Promise} returns the transaction receipt or the estimateGas value */ deposit(token: string, amount: string, tokenDecimals?: number, estimateGas?: G): Promise>; depositTx(token: string, amount: string, tokenDecimals?: number): Promise; /** * Withdraw funds * @param {String[]} tokens Array of token addresses * @param {String[]} amounts Array of token amounts * @param {number} [tokenDecimals] optional number of decimals of the token * @param {Boolean} estimateGas if True, return gas estimate * @return {Promise} returns the transaction receipt or the estimateGas value */ withdraw(tokens: string[], amounts: string[], tokenDecimals?: number, estimateGas?: G): Promise>; withdrawTx(tokens: string[], amounts: string[], tokenDecimals?: number): Promise; private prepareWithdrawInputs; /** * Authorize locks * @param {String} token Token address * @param {String} payee, * @param {String} maxLockedAmount, * @param {String} maxLockSeconds, * @param {String} maxLockCounts, * @param {number} [tokenDecimals] optional number of decimals of the token * @param {Boolean} estimateGas if True, return gas estimate * @return {Promise} returns the transaction receipt or the estimateGas value */ authorize(token: string, payee: string, maxLockedAmount: string, maxLockSeconds: string, maxLockCounts: string, tokenDecimals?: number, estimateGas?: G): Promise>; authorizeTx(token: string, payee: string, maxLockedAmount: string, maxLockSeconds: string, maxLockCounts: string, tokenDecimals?: number): Promise; private prepareAuthorizeInputs; /** * Cancel expired locks * @param {String[]} jobIds Job IDs with hash * @param {String[]} tokens Token addresses * @param {String[]} payers, Payer addresses for the compute job * @param {String[]} payees, Payee addresses for the compute job, * @param {Boolean} estimateGas if True, return gas estimate * @return {Promise} returns the transaction receipt or the estimateGas value */ cancelExpiredLocks(jobIds: string[], tokens: string[], payers: string[], payees: string[], estimateGas?: G): Promise>; cancelExpiredLocksTx(jobIds: string[], tokens: string[], payers: string[], payees: string[]): Promise; }