| 813 | } |
| 814 | |
| 815 | async function getApprovals() { |
| 816 | function ApprovalDetail(_from, _to, _allowance, _expiryTime, _description) { |
| 817 | this.from = _from; |
| 818 | this.to = _to; |
| 819 | this.allowance = _allowance; |
| 820 | this.expiryTime = _expiryTime; |
| 821 | this.description = _description; |
| 822 | } |
| 823 | |
| 824 | let results = []; |
| 825 | let approvalDetails = await currentTransferManager.methods.getAllApprovals().call(); |
| 826 | for (let i = 0; i < approvalDetails[0].length; i++) { |
| 827 | results.push(new ApprovalDetail(approvalDetails[0][i], approvalDetails[1][i], approvalDetails[2][i], approvalDetails[3][i], approvalDetails[4][i])); |
| 828 | } |
| 829 | return results; |
| 830 | } |
| 831 | |
| 832 | async function getApprovalsToAnAddress(address) { |
| 833 | function ApprovalDetail(_from, _to, _allowance, _expiryTime, _description) { |