polymath.js_v2
v0.2.12
Published
TODO Update
Downloads
4
Readme
Introducing Polymath.js v2.0
TODO Update
await SecurityTokenRegistry.createSecurityToken(token)
This is all you need to create new security token using Polymath.js v2.0. It will:
- Format data into the blockchain types (e.g. add decimals for token values).
- Properly estimate gas via Web3 1.0.
- Make dry run to validate inputs before transaction sending.
- Notify callbacks with transaction hash and receipt.
- Check whether the transaction was mined without errors or not.
- Send necessary requests to the
polymath-api
.
Key advantages
- Web3 1.0. It means that we don't need truffle-contract package anymore and we can use async-await, websockets for events (there was bug with disconnection from them, but now it's fixed), proper auto gas estimation.
- No need to wrap each contract function since v2.0 uses JavaScript Proxy API, which in a simplified manner calls original method if it's not overridden.
await PolyToken.symbol()
There is no symbol
entry within the PolyToken
class, but string above will return you ticker of the Polymath token.
This is how it works.
No excess wrappers means no excess documentation and tests.
Needs from polymath-core
- Versioned npm package (with changelog for each new version) with built-in contracts artifacts, which should contain contracts addresses for each network.
- Complete and up-to-date documentation since Polymath.js will inherit it in many ways.