Whitelabel Token Manager
Example of a token manager
As a developer, you have now discovered a good chunk of the Polymesh Typescript SDK. If you wanted to create your own Token Studio, you are now equipped for that. Of course the Token Studio already exists and is usable. However if you wanted to design another one, what would you need to do? This is the purpose of this chapter. We have a bare-bone example of such a manager.
How it works
It is a single-page Web app without any server component. Or rather the only server component is a Polymesh node accessed via the Polymesh Wallet.
At the top of the page, you enter the ticker you want to manage. This activates the other parts:
- Ticker reservation: reserve / view / transfer ownership / create asset
- Asset: transfer ownership / change primary issuance agent / issue / redeem
- Compliance requirements:
- add / remove requirements, then for each requirement: add / remove conditions, and so on for all parameters.
- Pause / resume compliance.
- Check possibility of settlement.
- Checkpoints: list / create / create scheduled / check balance of any account.
Additionally, the page lets you handle secondary concerns:
- Authorisations: list / accept / reject them. Both incoming and outgoing from your account.
- Attestations: list yours / list those of another account / revoke / publish new.
- Portfolios: list yours / list your custodied portfolios / list portfolios of another account.
You can type either a known ticker, or a new one that does not exist. Alternatively, you can load those whose reservation or token you own.
If the ticker reservation does not exist, you can reserve it.
If your ticker is only reserved:
When the feature is implemented, you will be able to transfer the ownership. As of now, you can create the token proper with the parameters of your choice.
If your ticker is already created:
When you have created the token, it loads and shows as:
You can transfer the ownership, change the primary issuance agent, or remove it. And if you are the PIA, you can issue or redeem tokens in your default portfolio.
If the token exists, they are loaded and show as:
The list can be long...
If you own the token and change any of the requirements, conditions, types and so on, you can save the whole list. You can also pause compliance and resume it. And to assist users, you can simulate whether a transfer would complete.
If you have sent an authorisation out, for instance to change the PIA on your token, you can load that:
Which you can reject.
Now, if you are the recipient, the same pending authorisation will appear, although with a possibility to accept.
Here, you can load your own, or those of someone else, for instance if you are the KYC provider and want to see what you already issued.
And if you are the issuer, then you can revoke it.
To add an attestation, just enter the right parameters:
The investor uniqueness attestation is different and requires a special treatment. Also, at the moment, for the Testnet, it relies on a mocked uID that may cause issues. Also note how
@polymathnetwork/confidential-identity are loaded asynchronously. This is necessary because it contains WebAssembly modules.
You can load your own, or that of someone else. The list includes your portfolios which have a custodian. If you want to make someone your custodian, you can enter a new value and do it.
You can also load the portfolios for which you are the custodian. If you are the custodian of a portfolio, you are the only one who can relinquish custody.
When choosing a ticker, the existing checkpoints will load. In each, you can check the balance of any account.
Of course, you can also create one immediately, or create a schedule.
This token manager does not pretend to have a good interface, but it shows you how you could start when building your own.
Keep posted for updates when the SDK changes.