import { Harmony } from '@harmony-js/core' ; import { ChainType } from '@harmony-js/utils' ; import { Account } from '@harmony-js/account' ; const CHAIN_ID = parseInt ( process . env . CHAIN_ID as string , 10 ) ; const CHAIN_TYPE = process . env . CHAIN_TYPE as string ; const HTTP_PROVIDER = process . env . HTTP_PROVIDER as string ; const GENESIS_PRIV_KEY = process . env . GENESIS_PRIV_KEY as string ; let chainType = ChainType . Harmony ; if ( CHAIN_TYPE === 'hmy' ) { chainType = ChainType . Harmony ; } else if ( CHAIN_TYPE === 'eth' ) { chainType = ChainType . Ethereum ; } export const harmony = new Harmony ( HTTP_PROVIDER , { chainId : CHAIN_ID , chainType , chainUrl : HTTP_PROVIDER , } ) ; export const myAccount = harmony . wallet . addByPrivateKey ( GENESIS_PRIV_KEY ) ;