virtualeconomy / js-v-sdk

[DEPRECATED and please use https://github.com/virtualeconomy/js-vsys instead] Java Script library for V Systems
https://www.npmjs.com/package/@virtualeconomy/js-v-sdk
MIT License
10 stars 4 forks source link

New contract type support #19

Closed SheldonYS closed 4 years ago

SheldonYS commented 4 years ago

As VSYS node new version (0.3.0) is released https://github.com/virtualeconomy/v-systems/releases/tag/v0.3.0 , there are 3 kinds of new contracts support in chain. Some code in js-v-sdk need change to avoid bug, for example, in https://github.com/virtualeconomy/js-v-sdk/blob/105841e62cf3c261f280f6d8fcc34451ed33140b/src/transaction.js#L181 The contract type could be now not only Contract.TOKEN_CONTRACT and Contract.TOKEN_CONTRACT_WITH_SPLIT, but also 3 new contracts (lock contract, non-fungible token contract, payment channel contract). So avoid to write if and else. The logic should be check contract type is Contract.TOKEN_CONTRACT or Contract.TOKEN_CONTRACT_WITH_SPLIT at first. If neither Contract.TOKEN_CONTRACT or Contract.TOKEN_CONTRACT_WITH_SPLIT, no explain for current SDK version (The explain for new contracts will be supported in later version).

SheldonYS commented 4 years ago

implement in #20