From e2b63972ef65f5e845826985195011d6f0596e46 Mon Sep 17 00:00:00 2001 From: trevorjtclarke Date: Sun, 17 Oct 2021 14:57:18 -0700 Subject: [PATCH] Added support for guildnet --- package.json | 2 +- src/actions.js | 4 ++-- src/configuration.js | 2 +- src/contract_abi.json | 12 ++++++++++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index bb39992..b6eeafa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "croncat", - "version": "1.5.0", + "version": "1.5.1", "description": "cron.cat CLI and Agent Runner", "main": "src/index.js", "scripts": { diff --git a/src/actions.js b/src/actions.js index 1c47a57..a503215 100644 --- a/src/actions.js +++ b/src/actions.js @@ -227,7 +227,7 @@ export async function runAgentTick(options = {}) { agentSettings = {} } // Check agent is active & able to run tasks - if (agentSettings.status !== 'Active') { + if (!agentSettings || !agentSettings.status || agentSettings.status !== 'Active') { log(`Agent Status: ${chalk.white(agentSettings.status)}`) skipThisIteration = true } @@ -326,7 +326,7 @@ export async function agentFunction(method, args, isView, gas = BASE_GAS_FEE, am const balance = await Near.getAccountBalance() // ALERT USER is their balance is lower than they should be - if (!balance || balance < 1e25) { + if (!balance || balance < 3e24) { log(`${chalk.bold.red('Attention!')}: ${chalk.redBright('Please add more funds to your account to continue sending transactions')}`) log(`${chalk.bold.red('Current Account Balance:')}: ${chalk.redBright(utils.format.formatNearAmount(balance))}\n`) diff --git a/src/configuration.js b/src/configuration.js index bc233ed..2c776f4 100644 --- a/src/configuration.js +++ b/src/configuration.js @@ -1,7 +1,7 @@ function getConfigByType(networkId, config) { return { networkId, - nodeUrl: `https://rpc.${networkId}.near.org`, + nodeUrl: networkId !== 'guildnet' ? `https://rpc.${networkId}.near.org` : 'https://rpc.openshards.io', explorerUrl: `https://explorer.${networkId === 'mainnet' ? '' : networkId + '.'}near.org`, walletUrl: `https://wallet.${networkId === 'mainnet' ? '' : networkId + '.'}near.org`, helperUrl: `https://helper.${networkId}.near.org`, diff --git a/src/contract_abi.json b/src/contract_abi.json index 53b4be9..dca1647 100644 --- a/src/contract_abi.json +++ b/src/contract_abi.json @@ -2,9 +2,21 @@ "development": { "manager": "manager_v1.cron.testnet" }, + "testnet": { + "manager": "manager_v1.cron.testnet" + }, + "guildnet": { + "manager": "manager_v1.croncat.guildnet" + }, + "betanet": { + "manager": "manager_v1.croncat.betanet" + }, "production": { "manager": "manager_v1.croncat.near" }, + "mainnet": { + "manager": "manager_v1.croncat.near" + }, "abis": { "manager": { "viewMethods": [