Anchor-Protocol / anchor-earn

The Earn JavaScript SDK for Anchor Protocol.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: Cannot read property 'chainID' of undefined

jelilat opened this issue · comments

const { Wallet, MnemonicKey, AnchorEarn } = require('@anchor-protocol/anchor-earn');
require('dotenv').config();

const account = new MnemonicKey({
  mnemonic: process.env.MNEMONIC,
});

const anchorEarn = new AnchorEarn({
    chain: "terra",
    network: "columbus-5",
    privateKey: process.env.PRIVATE_KEY,
    mnemonic: process.env.MNEMONIC,
    address: process.env.ADDRESS,
  });

Here is my code. What am I doing wrong?

const { CHAINS, NETWORKS, DENOMS, MnemonicKey, AnchorEarn } = require('@anchor-protocol/anchor-earn');
require('dotenv').config();

const account = new MnemonicKey({
  mnemonic: process.env.MNEMONIC,
});

const anchorEarn = new AnchorEarn({
    chain: CHAINS.TERRA,
    network: NETWORKS.COLUMBUS_5,
    // privateKey: process.env.PRIVATE_KEY,
    mnemonic: process.env.MNEMONIC,
    address: process.env.ADDRESS
  });

I've fixed this. Just needed to import CHAINS and NETWORKS