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 magically wraps all the calls internally so you don't have to craft custom transactions.

This makes it easy to send transaction like LYX transfer (= native token transfers). Simply use eth_sendTransaction as you always did while working with wallets and smart accounts that used EOAs.

No need to make contract calls to instruct the smart contract of the Universal Profile what to do. The Browser Extension handles all of that behind the scene for you!

Setup Dependencies

npm install web3@v1

Code Examples

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
})