MCPcopy Create free account
hub / github.com/PolymathNetwork/polymath-core / getApprovalsArray

Function getApprovalsArray

CLI/commands/transfer_manager.js:792–809  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

790}
791
792async function getApprovalsArray() {
793 let address = readlineSync.question('Enter an address to filter or leave empty to get all the approvals: ', {
794 limit: function (input) {
795 return web3.utils.isAddress(input);
796 },
797 limitMessage: "Must be a valid address",
798 defaultInput: gbl.constants.ADDRESS_ZERO
799 });
800 if (address == gbl.constants.ADDRESS_ZERO) {
801 return await getApprovals();
802 } else {
803 let approvals = await getApprovalsToAnAddress(address);
804 if (!approvals.length) {
805 console.log(chalk.red(`\nThe address is not listed\n`))
806 }
807 return approvals;
808 }
809}
810
811function printMatmRow(from, to, allowance, time, description) {
812 console.log(`\nDescription: ${web3.utils.toAscii(description)}\nFrom ${from} to ${to}\nAllowance: ${web3.utils.fromWei(allowance)}\nExpiry time: ${moment.unix(time).format('MMMM Do YYYY HH:mm')}\n`);

Callers 2

matmManageFunction · 0.85
matmExploreFunction · 0.85

Calls 2

getApprovalsFunction · 0.85
getApprovalsToAnAddressFunction · 0.85

Tested by

no test coverage detected