| 830 | } |
| 831 | |
| 832 | async function getApprovalsToAnAddress(address) { |
| 833 | function ApprovalDetail(_from, _to, _allowance, _expiryTime, _description) { |
| 834 | this.from = _from; |
| 835 | this.to = _to; |
| 836 | this.allowance = _allowance; |
| 837 | this.expiryTime = _expiryTime; |
| 838 | this.description = _description; |
| 839 | } |
| 840 | |
| 841 | let results = []; |
| 842 | let approvals = await currentTransferManager.methods.getActiveApprovalsToUser(address).call(); |
| 843 | for (let i = 0; i < approvals[0].length; i++) { |
| 844 | results.push(new ApprovalDetail(approvals[0][i], approvals[1][i], approvals[2][i], approvals[3][i], approvals[4][i])); |
| 845 | } |
| 846 | return results; |
| 847 | } |
| 848 | |
| 849 | async function getManualApproval(_from, _to) { |
| 850 | let result = null; |