Skip to content

Commit

Permalink
Added support for guildnet
Browse files Browse the repository at this point in the history
  • Loading branch information
TrevorJTClarke committed Oct 17, 2021
1 parent b2cc250 commit e2b6397
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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`)

Expand Down
2 changes: 1 addition & 1 deletion src/configuration.js
Original file line number Diff line number Diff line change
@@ -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`,
Expand Down
12 changes: 12 additions & 0 deletions src/contract_abi.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down

0 comments on commit e2b6397

Please sign in to comment.