triggerSmartContract

Create TransactionExtention, which contains the unsigned Transaction.

Usage

visionWeb.transactionBuilder.triggerSmartContract(
  contractAddress,
  functions,
  options,
  parameter,
  issuerAddress
);

Parameters

ParameterDescriptionTypeDefault
contractAddressThe smart contract address.string-
functionsFunction call, must not leave a blank space.string-
optionsDescriptions are below.object-
parameterThe parameter passed to 'function'.string-
issuerAddressAddress that triggers the contract.string-

options parameters

ParameterDescriptionTypeDefault
feeLimitThe maximum VS burns for resource consumption.number-
callValueThe VS transfer to the contract for each call.number-
shouldPollResponseIf set to TRUE, this will wait until the transaction is confirmed on the solidity node before returning the result.booleanfalse
tokenIdThe id of vrc10 token transfer to the contract (Optional).string""
tokenValueThe amount of vrc10 token transfer to the contract for each call (Optional).number

Returns

Object.

Example

visionWeb.transactionBuilder.triggerSmartContract("46f151d2b560d0f0a983cdbfc85fff392bb8874258","withdraw(uint256)",{callValue: 0},[{type: 'uint256', value: 100}]);
> {
  result: { result: true },
  transaction: {
    visible: false,
    txID: 'b4d7dbb5530b964e2deddb8b98ca2888518dc622dc5018c25008bbfb62fd838f',
    raw_data: {
      contract: [Array],
      ref_block_bytes: 'e32e',
      ref_block_hash: '4822c0a5b74a319f',
      expiration: 1608475572000,
      fee_limit: 20000000,
      timestamp: 1608475513666
    },
    raw_data_hex: '0a02e32e22084822c0a5b74a319f40a0eef584e82e5a8e01081f1289010a31747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e54726967676572536d617274436f6e747261637412540a1541401a8da8a7fc86f0087f8c62e630d10df10a963b121541e032de6da4f2afa69ddcc4ada40f782c7b0f019e22242e1a7d4d000000000000000000000000000000000000000000000000000000000000006470c2a6f284e82e900180dac409'
  }
}