Skip to main content

Transfer LYX

Transfering 0.5 LYXt between two Universal Profiles
Transfering 0.5 LYXt between two Universal Profiles.

info

The full code of this example can be found in the ðŸ‘ū lukso-playground repository.

The 🆙 Universal Profile Extension makes it easy to send LYX transaction without having to interact with the smart contract of the Universal Profile. If you are building a service or backend, you can also ðŸ‘ū execute transfers by directly calling the profile contract.

Setup​

npm install web3@v1

Transfer LYX from a Universal Profile​

The Universal Profile browser extension will magically wrap all the calls internally so you don't have to worry about crafting custom transactions. Simply use eth_sendTransaction as you always did while working with EOA.

import Web3 from 'web3';

const web3 = new Web3(window.lukso);

await web3.eth.requestAccounts();
const accounts = await web3.eth.getAccounts();

await web3.eth.sendTransaction({
from: accounts[0], // The Universal Profile address
to: '0x...', // receiving address, can be a UP or EOA
value: web3.utils.toWei('0.5', 'ether') // 0.5 amount in ETH, in wei unit
})