Wallet Connector

Sodium is compatible with all standard Ethereum libraries and connectors. If your developed dApp works with MetaMask, it will automatically work with Sodium as well

web3.js

import Web3 from 'web3';

web3 = new Web3();
const provider = wallet.getProvider();
web3.setProvider(provider);

const walletAddress = await web3.eth.getCoinbase();

// sign
web3.eth.sign("Hello world", walletAddress);

// send transaction
web3.eth.sendTransaction({
    from: walletAddress,
    to: "0x812D3C67d283F3b9d1F1E347DF37F0C7fbD6a0B0",
    value: "1000000000000000000"
});

web3-react-v8

Last updated