Skip to content

Commit

Permalink
feat: adding more requirements to polymath main api file
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Wiebe committed Feb 8, 2020
1 parent 5d61fa4 commit a715ff8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Polymath.ts
Expand Up @@ -300,14 +300,26 @@ export class Polymath {
contractWrappers.securityTokenRegistry.getTokensByDelegate(walletAddress),
]);

const ownedTickersNotLaunchedYet = await P.map(delegatedAddresses, async address => {
const details = await contractWrappers.securityTokenRegistry.getSecurityTokenData({
securityTokenAddress: address,
});
// If the ticker is not deployed, then we should include it.
if (!details.deployedAt) {
return details.ticker;
}
});

const delegateTickers = await P.map(delegatedAddresses, async address => {
const details = await contractWrappers.securityTokenRegistry.getSecurityTokenData({
securityTokenAddress: address,
});
// If a Security Token has the current wallet is a delegate, then we should include it.
return details.ticker;
});

return union(ownedTickers, delegateTickers);
// TODO - only pass owned tickers to the user that are ST owned by user and are not ST yet
return union(ownedTickersNotLaunchedYet, delegateTickers);
};

/**
Expand Down

0 comments on commit a715ff8

Please sign in to comment.