Web3 & MetaMask - Bubble plugin
Get PluginAll our plugins
  • Overview
  • Quick Start Example
  • Elements details
    • Web3 & MetaMask
      • Connect To MetaMask
      • Disconnect MetaMask
      • Send token With MetaMask
      • Get Balance of a Token
      • Get Balance of Multiple Tokens
      • Get Token Symbol
      • Sign
      • Check signature
      • Sign Typed Data
      • Check signature-Typed Data
      • Smart Contract - Read
        • Example - CAKE/BUSD rate on Pancaksewap
      • Smart Contract - Write
        • Example - Write a function
      • Trigger Switch Chain
      • Approve - Set Allowance
      • Revoke Allowance
      • Deploy Contract
      • Add Chain to MetaMask
      • Get NFT Metadata
      • Check NFT Balance
      • Smart Contract - Read
      • Smart Contract - Write
    • Web3 Utils
      • Get Transaction confirmations
      • Get Transaction Details
      • To Wei
      • From Wei
      • Add Token to MetaMask
      • Get ENS data
      • Get ENS Domain from Address
  • Use with other Wallets & Plugins
  • Sign up a user with signature
  • How to use on Mobile
Powered by GitBook
On this page
  • Parameters
  • States (result)
  1. Elements details
  2. Web3 Utils

To Wei

Converts any number value value into WEI

PreviousGet Transaction DetailsNextFrom Wei

Last updated 2 years ago

WEI is often used when interacting with smart contracts.

Avoid doing the WEI calculation directly in the input fields, doing so may result in errors because of big numbers. Use To Wei or From Wei action instead.

Parameters

Parameter name
Type
Description

Number

Number

The amount to be converted

Decimals

Number

Optional. Token decimals. Useful for correct calculation when the token has different decimals than the standard 18

States (result)

State name
Type
Description

To WEI result

Text

Result of the conversion. Note that the result isn't instantly available, so when using the result in the same workflow where the action is run, add a small pause (200 ms) between this action and the next one where the result is used

Demo for how to use To Wei and From Wei features:

https://web3-demo.bubbleapps.io/version-test/wei