I'm making a node app that writes contracts with the Arbitrum api, I have successfully accessed the api, I'm new to node and basically I need to access the Arbitrum website with code and write some contracts, if there's anything unclear ask me to edit the post. my current code:
var Web3 = require('web3');
var web3 = new Web3(new Web3.providers.HttpProvider());
var version = web3.version.api;
var getJSON = require('get-json');
getJSON(
'https://api.arbiscan.io/api?module=contract&action=getabi&address=0x0000000000000000000000000000000000001004&apikey=YourApiKeyToken',
function (error, data) {
var contractABI = '';
contractABI = JSON.parse(data);
if (contractABI != '') {
var MyContract = web3.eth.contract(contractABI);
var myContractInstance = MyContract.at(
'0x604cd9df9e73a792feef9877aa53fc25d1b9baa5'
);
var result = myContractInstance.memberId(
'0xfe8ad7dd2f564a877cc23feea6c0a9cc2e783715'
);
console.log('result1 : ' + result);
var result = myContractInstance.members(1);
console.log('result2 : ' + result);
} else {
console.log('Error');
}
}
);