import IOTA from ' iota.lib.js ' ; import iotap from ' iotap ' ; const { IOTA_SOURCE_SEED , IOTA_PROTOCOL , IOTA_HOST , IOTA_PORT , IOTA_DESTINATION_ADDRESS , IOTA_DESTINATION_SEED } = process . env ; console . log ( ` Using node ${ IOTA_PROTOCOL } :// ${ IOTA_HOST } : ${ IOTA_PORT } ` ) const iota = new IOTA ( { ' host ' : ` ${ IOTA_PROTOCOL } :// ${ IOTA_HOST } ` , ' port ' : IOTA_PORT } ) ; const getSourceBalance = iotap ( iota , ' getAccountData ' ) ( IOTA_SOURCE_SEED ) ; const getDestinationBalance = iotap ( iota , ' getAccountData ' ) ( IOTA_DESTINATION_SEED ) ; Promise . all ( [ getSourceBalance , getDestinationBalance ] ) . then ( ( [ sourceAccountData , destinationAccountData ] ) => console . log ( sourceAccountData . balance , destinationAccountData . balance ) ) . catch ( e => console . error ( e ) ) ;