sendTransaction

Sends VS from one address to another. Will create and broadcast the transaction if a private key is provided.

Usage

visionWeb.vs.sendTransaction(to, amount, privateKey);

Parameters

ParameterDescriptionTypeDefault
toAccount address to send VS to.string-
amountAmount of VS to send (units in VDT).number-
privateKeyOptionally provide a private key to sign the transaction. If left blank, will use the address associated with the private key.string-

Returns

Object

Example

visionWeb.vs.sendTransaction("VEoh3WDXviqcPZ1qVNCQpqLHYzigrQWTPL",1000,"private key");
> {
  result: true,
  txid: 'd9113ee5296a889a3422574a56225700aee9ee1c74c9c35c48b97a8f2f8bb3fa',
  transaction: {
    visible: false,
    txID: 'd9113ee5296a889a3422574a56225700aee9ee1c74c9c35c48b97a8f2f8bb3fa',
    raw_data: {
      contract: [Array],
      ref_block_bytes: '63f4',
      ref_block_hash: 'e189960318516b6f',
      expiration: 1608375864000,
      timestamp: 1608375806197
    },
    raw_data_hex: '0a0263f42208e189960318516b6f40c095b0d5e72e5a66080112620a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412310a1541401a8da8a7fc86f0087f8c62e630d10df10a963b121541934a8d6e5c47f83ae9742a1cdd94fd681fce3ef518e80770f5d1acd5e72e',
    signature: [
      '9afd23851facc4f93da59f1b140d33ef19d6c15f4d725e3dc8af2b0d0f4e374f55e8958265bcd5be5b6c189d5af4715cfc76d44869b7626f3e04e62af2582ddc01'
    ]
  }
}