1.3.7 • Published 2 years ago
reblox-web3-utils v1.3.7
Reblox Web3 Utils
A simple API to make (MULTICHAIN!) development faster
Networks Supported
Example
import { getNativeBalance } from 'reblox-web3-utils';
getNativeBalance(56, "0xa000000000000000000000000000000000000000").then((balance) => {
// Your code
})
Documentation
- 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)
1.3.7
2 years ago
1.3.6
2 years ago
1.3.5
2 years ago
1.3.4
2 years ago
1.3.3
2 years ago
1.3.2
2 years ago
1.3.1
2 years ago
1.3.0
2 years ago
1.2.9
2 years ago
1.2.8
2 years ago
1.2.7
2 years ago
1.2.6
2 years ago
1.2.5
2 years ago
1.2.4
2 years ago
1.2.3
2 years ago
1.2.2
2 years ago
1.2.1
2 years ago
1.1.1
2 years ago
1.1.0
2 years ago
1.0.0
2 years ago