48min

Web3js for blockchains

ÔĽŅ

Link to plugin page: 

ÔĽŅ

Introduction

Web3.js is a collection of libraries that allow you to interact with a local or remote Ethereum node using HTTP, IPC, or WebSocket. This plugin enables easily interact with Web3.js library. It comes with two elements: the first one is -web3.utils which converts various encoding types (Wei. hex, decimal etc), and the second one is web3.eth which contains actions o interact with Ethereum nodes

How to setup

The web3 plugin contains two elements (so far). Web3.eth and web3.utils.

Place the web.eth element on the page, and paste the URL received from the provider (eg Alchemy, Infura, Quicknode, etc.) into the property filed - "Provider URL" . 

ÔĽŅ

Document image

In the two other fields, you should enter the actions from this plugin that was created only for parsing the response and for easy use it.

ÔĽŅ

Document image

Then use its actions to interact with Ethereum nodes.

ÔĽŅ

Place the web.utils element on the page and use its actions to convert various encoding types (wei. hex, decimal etc)

ÔĽŅ

Element fields

Web3.ETH

  1. Provider URL - URL received from the provider.  -= Five popular node providers that offer access to the nodes of the most popular cryptocurrencies: Infura - https://infura.io  GetBlock - https://getblock.io  Alchemy - https://www.alchemy.com  QuikNode - https://www.quicknode.com  Blockdaemon - https://blockdaemon.com  =-
  2. Block info parser - An App type field for sorting the response and output as an object. 

Please use the "Block info parser" action in this field.

  1. Transaction info parser - An App type field for sorting the response and output as an object

Please use the "Transaction info parser" action in this field.

Web3.Utils

No fields

Actions

Web3.eth:

  1. Web3.ETH: Create Wallet - Generates one or more accounts in the wallet. If wallets already exist they will not be overridden Params: Number of Accounts- Number of accounts to create. Leave empty to create an empty wallet.
Document image
  1. Web3.ETH: Balance - Get Ethereum balance for any address. (Take any account address from the top of accounts for example: https://etherscan.io/accounts) Params: Account address- The address to get the balance.
Document image
  1. Web3.ETH: Get Encoded ABI Transaction - Encodes the ABI for transaction method Params: Token contract address - The contact address of the token you want to use Receiver Address - Valid recipient address value Value - Amount value in number
Document image
  1. Web3.ETH: Get Block Number - Returns the current block number Params: -
Document image
  1. Web3.ETH: Get Block info by ID - Get all info about a block by ID Params: Block number - The block number or block hash. Or the string "earliest"
Document image
  1. Web3.ETH: Get transaction - Returns a transaction matching the given transaction hash Params: Transaction Hash - The transaction hash
Document image
  1. Web3.ETH: Get Chain ID - Returns the chain ID of the currently connected node as described in the EIP-695 Params: -
Document image
  1. Web3.ETH: Send Transaction - Sends a transaction to the network Params: From - The address for the sending account. Uses the web3.eth.default Account property, if not specified. Or an address or index of a local wallet in web3.eth.accounts.wallet To - (optional) The destination address of the message, left undefined for a contract-creation transaction Data - (optional) Either a ABI byte string containing the data of the function call on a contract, or in the case of a contract-creation transaction the initialization code Value - (optional) The value transferred for the transaction in wei, also the endowment if it’s a contract-creation transactions Gas - (optional) The amount of gas to use for the transactions Gas price - (optional) The price of gas for this transaction in Wei, defaults to web3.eth.gasPrice Max Fee Per Gas - (optional) The maximum fee per gas that the transaction is willing to pay in total Type - (optional) A positive unsigned 8-bit number between 0 and 0x7f that represents the type of the transaction Chain - (optional) Chain ID. Defaults to mainnet
Document image
  1. Web3.ETH: Create New Account - Creates a new account Params: New password - The password to encrypt this account with
Document image
  1. Web3.ETH: Check address - Check if the entered address is a smart contract Params: Address - Valid address to check
Document image

ÔĽŅ

Web3.utils:

  1. Web3: Random Hex - To generate cryptographically strong pseudo-random HEX strings from a given byte size Params: Size -¬†The byte size for the HEX string, e.g.¬†32¬†will result in a 32 bytes HEX string with 64 characters prefixed with ‚Äú0x‚ÄĚ
Document image
  1. Web3: sha3 - Will calculate the sha3 of the input Params: Data to convert - A string to hash
Document image
  1. Web3: Is Ethereum address? - Checks if a given string is a valid Ethereum address Params: Address - An address string
Document image
  1. Web3: Convert to Hex - Convert any data to Hex Params: Data - Any data to convert
Document image
  1. Web3: Hex To Number - Returns the number representation of a given HEX value Params: HEX - HEX to convert
Document image
  1. Web3: Hex To Utf8 - Returns the UTF-8 string representation of a given HEX value Params: HEX - HEX to convert
Document image
  1. Web3: Hex To ASCII - Returns the ASCII string representation of a given HEX value Params: HEX - HEX to convert
Document image
  1. Web3: Number To Wei - Converts any ether value into Wei Params: Number - The number value Unit - (optional)The ether to convert from. (defaults to "ether")
Document image
  1. Web3: Padding - Adds padding on the left or right of a string, Useful for adding paddings to HEX strings Params: String - The string to add padding on the left Number - The number of characters the total string should have. Direction - paddings direction. Dropdown (left, right)
Document image
  1. Web3: Utf8 To HEX - Returns the HEX representation of a given UTF-8 string Params: UTF8 string - Any string in the UTF8 format
Document image

ÔĽŅ

Exposed states

Web3.ETH

  1. Balance -  Data from the "Balance" action
  2. Encoded ABI - Data from the "Get Encoded ABI Transaction" action
  3. New wallet address - Data from the "Create Wallet" action
  4. New wallet privateKey - Data from the "Create Wallet" action
  5. Block info - Data from the "Get Block Info" action
  6. Transaction info - Data from the "Get Transaction Info" action
  7. Block number - Data from the "Get Block Number" action
  8. Send Transaction Hash - Data from the "Send Transaction" action
  9. Receipt - Data from the "Send Transaction" action
  10. Confirmation Number - Data from the "Send Transaction" action
  11. New Account Address - Data from the "Create new Account" action
  12. Is This Smart Contract? - Data from the "Check Address" action
  13. Chain ID - Data from the "Get Chain ID" action

ÔĽŅ

Web3.utils

  1. Web3 Version - Data about Web3 version
  2. Random HEX - Data from the "Random HEX" action
  3. sha3 - Data from the "sha3" action
  4. isAddress - Data from the "Is Ethereum Address?" action
  5. String to HEX - Data from the "Convert to HEX" action
  6. HEX to Number - Data from the "HEX to Number" action
  7. HEX to UTF8 - Data from the "HEX to Utf8" action
  8. HEX to Ascii - Data from the "HEX to Aschii" action
  9. Number to Wei - Data from the "Number to WEI" action
  10. Padding left - Data from the "Padding" action
  11. UTF8 to HEX - Data from the "Utf8 to HEX" action

ÔĽŅ

ÔĽŅ

Changelogs

ÔĽŅ

ÔĽŅ

Live Demo: 

ÔĽŅ

Demo Editor: 

ÔĽŅ

Updated 19 May 2022
Did this page help?
Yes
No