1.0.12 • Published 2 years ago
@stader-labs/ethx-contract v1.0.12
@stader-labs/ethx-contract
This package provides all the contract addresses and ABI files for Stader Labs' ETHx projects.
Installation
Use the package manager npm to install @stader-labs/ethx-contract.
npm install @stader-labs/ethx-contract
# or
yarn add @stader-labs/ethx-contract
Usage
Import the desired contract and ABI as follows:
import {
CONTRACT_NAME,
ADDRESS_NAME,
MAINNET_CONTRACT,
TESTNET_CONTRACT,
MAINNET_ADDRESS,
TESTNET_ADDRESS,
getAbi,
} from '@stader-labs/ethx-contract';
// Get the ABI of the contract
const abi = await getAbi(CONTRACT_NAME.ETHx);
// Get the address of the contract on the mainnet
const address = MAINNET_CONTRACT[CONTRACT_NAME.ETHx];
Exports
Table with details of the exported variables:
Variable | Description |
---|---|
CONTRACT_NAME | Available contract names. |
ADDRESS_NAME | Available address names (MANAGER, ADMIN & TIMELOCK_OWNER). |
MAINNET_ADDRESS | ADDRESS_NAME address on the mainnet. |
TESTNET_ADDRESS | ADDRESS_NAME address on the testnet. |
MAINNET_CONTRACT | All contract addresses on the mainnet. |
TESTNET_CONTRACT | All contract addresses on the testnet. |
getAbi(CONTRACT_NAME.$) | A function that returns the ABI of the contract. |
Reporting Issues
Email us at hamid@staderlabs.com with any issues or questions.