A simple API to make (MULTICHAIN!) development faster
- [56] BSC
- [250] Fantom
import { getNativeBalance } from 'reblox-web3-utils';
getNativeBalance(56, "0xa000000000000000000000000000000000000000").then((balance) => {
// Your code
})
- getNativeBalance: returns
Promise<String>
- chainId: Number of the Chain to connect. See networks supported
- account: The account number of the user
- getTokenBalance: returns
Promise<String>
- chainId: Number of the Chain to connect. See networks supported
- account: The account number of the user
-
tokenAddress: Addres of the contract. I.e:
0xe9e7cea3dedca5984780bafc599bd69add087d56
forBUSD
onBSC (56)
Network
- getTokenAllowance: returns
Promise<String>
- chainId: Number of the Chain to connect. See networks supported
- account: The account number of the user
-
tokenAddress: Addres of the token. I.e:
0xe9e7cea3dedca5984780bafc599bd69add087d56
forBUSD
onBSC (56)
Network - spenderAddress: Addres of the contract that is going to use your tokens
- needsApproval: returns
Promise<Boolean>
- Same as
getTokenAllowance
but returns if the token needs funds approval or not..
- Same as
- approveContract
- library: Due to issues with web3, we need to send the library so we can get the signer for write methods
- spender: Address of the contract that is going to spend the tokens
- spent: Address of the token's contract that is going to be spent
- abi (optional): JSON Interface, if not any... ERC20 will be used by default
- deposit
- addressContract: Address of the contract that is going to receive the tokens
- library: Due to issues with web3, we need to send the library so we can get the signer for write methods
- params: Array of parameters that is defined by the ABI being used
- abi (optional): JSON Interface, if not any... ERC20 will be used by default
- withdraw
- addressContract: Address of the contract that is going to send the tokens
- library: Due to issues with web3, we need to send the library so we can get the signer for write methods
- params: Array of parameters that is defined by the ABI being used
- abi (optional): JSON Interface, if not any... ERC20 will be used by default
- callFunction
- addressContract: Contract address
- library: Due to issues with web3, we need to send the library so we can get the signer for write methods
- params: Array of parameters that is defined by the ABI being used
- fnToCall: ABI's function to be called
- abi (optional): JSON Interface, if not any... ERC20 will be used by default
- formatNumber: Receives a number and returns it formatted
- value: Number to format
- decimals: Number of decimals (default 18)
- fixedTo: Number of decimals to fix (default 5)