1.0.12 • Published 2 years ago

@stader-labs/ethx-contract v1.0.12

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

@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:

VariableDescription
CONTRACT_NAMEAvailable contract names.
ADDRESS_NAMEAvailable address names (MANAGER, ADMIN & TIMELOCK_OWNER).
MAINNET_ADDRESSADDRESS_NAME address on the mainnet.
TESTNET_ADDRESSADDRESS_NAME address on the testnet.
MAINNET_CONTRACTAll contract addresses on the mainnet.
TESTNET_CONTRACTAll 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.