LAST UPDATED:

January 19, 2022, 1:47:15 PM

BUY function

MNEMONIC:

-

Buy an asset, by spending another asset you own

TABLE OF CONTENTS

  1. SUMMARY
  2. DISAMBIGUATION
  3. SYNTAX
  4. USAGE
  5. CHAINING
  6. RELATED FUNCTIONS

1. SUMMARY

The BUY function is used to buy an asset using the balance of another asset held on a labelled address. The BUY function can only be used to buy assets using the balance of another asset on an address in your custody. The BUY function is compatible with hardware wallets only.

2. DISAMBIGUATION

  • BUY is not used to move assets from one address to another. (see MOVE)
  • BUY is not used to sell assets. (see SELL)

3. SYNTAX

BUY     (receive_amount: decimal, receive_asset: asset, spend_asset: asset, spend_label: string)

4. USAGE

BUY is most commonly used without subfunctions.

Composing a BUY Transaction

BUY (800,DAI,ETH,TESTNET1)

This command will prepare a transaction to sign which will buy 800 DAI using the balance of ETH on the labelled address TESTNET1.

If the command submitted to the Command Line has not been formatted correctly, Vektor will open the BUY Function Form to help build and execute the intended command.

screenshot

Once the amount, the receive asset, the spend asset and the reciever address have been inputted, the Function Form gives a correctly formatted command.

Pressing INSERT pastes the command to the Command Line, ready for execution.

Signing a BUY Transaction

The Signing Request Modal gives you the opportunity to review your transaction details.

In the top right corner, you can check the connection status of your hardware wallet.

screenshot

Press CONNECT and select a signing device from the list.

screenshot

When your device is connected, the device connection status will say 'CONNECTED' and the SIGN button will appear.

screenshot

Click SIGN and follow the instructions on your device.

screenshot

Once your command has been successfully submitted the notification of the transaction broadcast will appear. Click VIEW to check the confirmation status on the associated public blockchain explorer.

5. CHAINING

-