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 5 forks source link

Add DataEntry Type and Converter #33

Closed SheldonYS closed 3 years ago

SheldonYS commented 3 years ago

Please follow https://github.com/virtualeconomy/v-systems/blob/master/src/main/scala/vsys/blockchain/contract/DataType.scala and add missing type.

For example, when I want to send NFT with the following code:

let function_data = [{ type: constants.ACCOUNT_ADDR_TYPE, value: "AU59JztgHbxxxxxxBakzQN2e6tr"}, { type: constants.INT32, value: 0}, ]
tra.buildExecuteContractTx(public_key, nft_contract_id, 2, function_data, Date.now() * 1e6, "");

It shows result:

{ error: 123, message: 'Invalid DataEntry' }

Because there is no constants.INT32 type and corresponding converter in SDK.