From 94f2b05f8bb2d0f15b9deecd1ae575bc3129316d Mon Sep 17 00:00:00 2001 From: brad Date: Wed, 9 Mar 2022 18:49:39 -0500 Subject: [PATCH 1/3] [FIX] JSON.stringify contract output Right now, some contract calls (like `gov staker
`), will output nested objects that don't correctly render. This ensures that all values are correctly rendered to the end user. Tested locally. --- package.json | 2 +- src/util/contract-menu.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 4324a75..dce5c20 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@anchor-protocol/anchorcli", - "version": "1.0.9", + "version": "1.0.10", "author": "Anchor Protocol", "license": "Apache-2.0", "main": "./dist/index.js", diff --git a/src/util/contract-menu.ts b/src/util/contract-menu.ts index f20c4eb..d681ae5 100644 --- a/src/util/contract-menu.ts +++ b/src/util/contract-menu.ts @@ -118,13 +118,13 @@ export async function handleExecCommand( const lcd = getLCDClient(exec.chainId); let key = new CLIKey({ keyName: exec.from, home: exec.home }); - + const keyType = JSON.parse( execSync( (`terrad keys show ${exec.from} --output json`) ).toString() ).type - + const wallet = lcd.wallet(key); const chainId: string = exec.chainId ? exec.chainId : lcd.config.chainID; @@ -232,7 +232,7 @@ export async function handleExecCommand( const signedTx = await key.signTx(unsignedTx, signOptions); let result; - + switch (exec.broadcastMode) { case 'sync': result = await lcd.tx.broadcastSync(signedTx); @@ -260,6 +260,6 @@ export async function handleQueryCommand(query: commander.Command, T: any) { if (query.yaml) { console.log(yaml.stringify(T)); } else { - console.log(T); + console.log(JSON.stringify(T, null, 2)); } } From fc5680408391eac0c2cad84e6d9d8cce96b54091 Mon Sep 17 00:00:00 2001 From: brad Date: Thu, 10 Mar 2022 09:22:44 -0500 Subject: [PATCH 2/3] [FIX] yarn build works now - Updated various calls so that the app compiles - Updated `rootDir` so that I can pull the version from package.json - `anchorcli -V` now returns a useful version --- src/addresses/from-json.ts | 4 ++++ src/index.ts | 3 ++- src/util/contract-menu.ts | 4 +--- tsconfig.json | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/addresses/from-json.ts b/src/addresses/from-json.ts index 34aa40d..3863187 100644 --- a/src/addresses/from-json.ts +++ b/src/addresses/from-json.ts @@ -90,6 +90,10 @@ export class AddressProviderFromJSON implements AddressProvider { return this.addressesMap.mmLiquidation; } + liquidationQueue(): string { + return this.addressesMap.mmLiquidation; + } + terraswapblunaLunaPair(): string { return this.addressesMap.terraswapblunaLunaPair; } diff --git a/src/index.ts b/src/index.ts index d948383..0e6bbd6 100755 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,6 @@ import { program, Command } from 'commander'; import * as _ from 'lodash'; +import { version } from '../package.json' import commands from './commands'; import * as logger from './util/logger'; @@ -17,7 +18,7 @@ export function run(argv: string[]): void { try { program .name('anchorcli') - .version('0.0.1') + .version(version) .option('-v,--verbose', 'Show verbose error logs') .description( 'Command-line interface for interacting with Anchor Protocol on Terra', diff --git a/src/util/contract-menu.ts b/src/util/contract-menu.ts index d681ae5..7d7dafe 100644 --- a/src/util/contract-menu.ts +++ b/src/util/contract-menu.ts @@ -157,10 +157,8 @@ export async function handleExecCommand( if (exec.gas === 'auto') { // estimate gas const estimatedFee = ( - await lcd.tx.create(key.accAddress, { + await lcd.tx.create([{address: key.accAddress, sequenceNumber: sequence}], { msgs, - accountNumber: accountNumber, - sequence, gasPrices: exec.gasPrices, gasAdjustment: exec.gasAdjustment, memo, diff --git a/tsconfig.json b/tsconfig.json index 87182b4..066809e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,7 +23,7 @@ "noUnusedLocals": false, "noUnusedParameters": true, "outDir": "dist", - "rootDir": "src", + "rootDir": ".", "sourceMap": false, "strict": false, "target": "esnext", From cad29c5adc49db7d17824c0b14cdf6e7803290ef Mon Sep 17 00:00:00 2001 From: brad Date: Thu, 10 Mar 2022 09:25:50 -0500 Subject: [PATCH 3/3] [FORMATTING] Add formatting changes These files were automatically changed during a pre-commit hook --- src/__tests__/queryTest.ts | 732 ++++++++++++------ src/addresses/from-json.ts | 14 +- src/commands/contracts/beth-reward.ts | 12 +- src/commands/contracts/beth-token.ts | 5 +- src/commands/contracts/gov.ts | 2 +- .../contracts/money-market-overseer.ts | 1 - src/data/anchorcli-default-testnet.ts | 4 +- src/index.ts | 2 +- src/util/contract-menu.ts | 38 +- yarn.lock | 141 +++- 10 files changed, 675 insertions(+), 276 deletions(-) diff --git a/src/__tests__/queryTest.ts b/src/__tests__/queryTest.ts index 0edf32a..983c413 100644 --- a/src/__tests__/queryTest.ts +++ b/src/__tests__/queryTest.ts @@ -1,495 +1,769 @@ -import * as path from 'path' -import { exec, ExecException } from 'child_process' - +import * as path from 'path'; +import { exec, ExecException } from 'child_process'; interface CliResult { - error: ExecException - stdout: string - stderr: string + error: ExecException; + stdout: string; + stderr: string; } -const testAddress = 'terra1us9cs88cxhcqclusvs4lxw0pfesc8y6f44hr3u' -const anchorPair = 'terra1gm5p3ner9x9xpwugn9sp6gvhd0lwrtkyrecdn3' -const bLunaPair = 'terra1jxazgm67et0ce260kvrpfv50acuushpjsz2y0p' -const bLuna = 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp' -const bEth = 'terra1dzhzukyezv0etz22ud940z7adyv7xgcjkahuun' +const testAddress = 'terra1us9cs88cxhcqclusvs4lxw0pfesc8y6f44hr3u'; +const anchorPair = 'terra1gm5p3ner9x9xpwugn9sp6gvhd0lwrtkyrecdn3'; +const bLunaPair = 'terra1jxazgm67et0ce260kvrpfv50acuushpjsz2y0p'; +const bLuna = 'terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp'; +const bEth = 'terra1dzhzukyezv0etz22ud940z7adyv7xgcjkahuun'; //query test is for mainnet, before test do $export ANCHORCLI_NETWORK=columbus-5 (mainnet) //airdrop describe('airdrop queries', () => { test('airdrop query claimed', async () => { - const result = await cli(['q','airdrop','is-claimed', testAddress, '1']) - expect(result.stdout).toContain('is_claimed') + const result = await cli(['q', 'airdrop', 'is-claimed', testAddress, '1']); + expect(result.stdout).toContain('is_claimed'); }); - }); //anc describe('anc queries', () => { test('anc token-info', async () => { - const result = await cli(['q', 'anc', 'token-info']) - expect(result.stdout).toContain('Anchor Token') + const result = await cli(['q', 'anc', 'token-info']); + expect(result.stdout).toContain('Anchor Token'); }); test('anc balance', async () => { - const result = await cli(['q', 'anc', 'balance', '--address', testAddress]) - expect(result.stdout).toContain('balance') + const result = await cli(['q', 'anc', 'balance', '--address', testAddress]); + expect(result.stdout).toContain('balance'); }); test('anc minter', async () => { - const result = await cli(['q', 'anc', 'minter']) - expect(result.stdout).toContain('terra1f32xyep306hhcxxxf7mlyh0ucggc00rm2s9da5') + const result = await cli(['q', 'anc', 'minter']); + expect(result.stdout).toContain( + 'terra1f32xyep306hhcxxxf7mlyh0ucggc00rm2s9da5', + ); }); test('anc allowance', async () => { - const result = await cli(['q', 'anc', 'allowance', '--owner', testAddress, '--spender', anchorPair]) - expect(result.stdout).toContain('allowance') + const result = await cli([ + 'q', + 'anc', + 'allowance', + '--owner', + testAddress, + '--spender', + anchorPair, + ]); + expect(result.stdout).toContain('allowance'); }); test('anc all allowances', async () => { - const result = await cli(['q', 'anc', 'all-allowances', '--owner', testAddress]) - expect(result.stdout).toContain('allowances') + const result = await cli([ + 'q', + 'anc', + 'all-allowances', + '--owner', + testAddress, + ]); + expect(result.stdout).toContain('allowances'); }); test('anc all accounts', async () => { - const result = await cli(['q', 'anc', 'all-accounts', '--start-after', testAddress]) - expect(result.stdout).toContain('accounts') + const result = await cli([ + 'q', + 'anc', + 'all-accounts', + '--start-after', + testAddress, + ]); + expect(result.stdout).toContain('accounts'); }); -}) +}); //aterra describe('aterra queries', () => { test('aterra token-info', async () => { - const result = await cli(['q', 'aust', 'token-info']) - expect(result.stdout).toContain('Anchor Terra USD') + const result = await cli(['q', 'aust', 'token-info']); + expect(result.stdout).toContain('Anchor Terra USD'); }); test('aterra balance', async () => { - const result = await cli(['q', 'aust', 'balance', '--address', testAddress]) - expect(result.stdout).toContain('balance') + const result = await cli([ + 'q', + 'aust', + 'balance', + '--address', + testAddress, + ]); + expect(result.stdout).toContain('balance'); }); test('aterra balance', async () => { - const result = await cli(['q', 'aust', 'minter']) - expect(result.stdout).toContain('terra1sepfj7s0aeg5967uxnfk4thzlerrsktkpelm5s') + const result = await cli(['q', 'aust', 'minter']); + expect(result.stdout).toContain( + 'terra1sepfj7s0aeg5967uxnfk4thzlerrsktkpelm5s', + ); }); test('aterra allowance', async () => { - const result = await cli(['q', 'aust', 'allowance', '--owner', testAddress, '--spender', anchorPair]) - expect(result.stdout).toContain('allowance') + const result = await cli([ + 'q', + 'aust', + 'allowance', + '--owner', + testAddress, + '--spender', + anchorPair, + ]); + expect(result.stdout).toContain('allowance'); }); test('aterra all allowances', async () => { - const result = await cli(['q', 'aust', 'all-allowances', '--owner', testAddress]) - expect(result.stdout).toContain('allowances') + const result = await cli([ + 'q', + 'aust', + 'all-allowances', + '--owner', + testAddress, + ]); + expect(result.stdout).toContain('allowances'); }); test('aterra all accounts', async () => { - const result = await cli(['q', 'aust', 'all-accounts', '--start-after', testAddress]) - expect(result.stdout).toContain('accounts') + const result = await cli([ + 'q', + 'aust', + 'all-accounts', + '--start-after', + testAddress, + ]); + expect(result.stdout).toContain('accounts'); }); }); //basset hub describe('basset hub queries', () => { test('basset hub current-batch', async () => { - const result = await cli(['q', 'basset-hub', 'current-batch']) - expect(result.stdout).toContain('requested_with_fee') + const result = await cli(['q', 'basset-hub', 'current-batch']); + expect(result.stdout).toContain('requested_with_fee'); }); test('basset hub all history', async () => { - const result = await cli(['q', 'basset-hub', 'all-history']) - expect(result.stdout).toContain('applied_exchange_rate') + const result = await cli(['q', 'basset-hub', 'all-history']); + expect(result.stdout).toContain('applied_exchange_rate'); }); test('basset hub params', async () => { - const result = await cli(['q', 'basset-hub', 'whitelisted-validators']) - expect(result.stdout).toContain('terravaloper') + const result = await cli(['q', 'basset-hub', 'whitelisted-validators']); + expect(result.stdout).toContain('terravaloper'); }); test('basset hub unbond requests', async () => { - const result = await cli(['q', 'basset-hub', 'unbond-requests', '--address', testAddress]) - expect(result.stdout).toContain('requests') + const result = await cli([ + 'q', + 'basset-hub', + 'unbond-requests', + '--address', + testAddress, + ]); + expect(result.stdout).toContain('requests'); }); test('basset hub withdrawable unbonded', async () => { - const result = await cli(['q', 'basset-hub', 'withdrawable-unbonded', '--address', testAddress, '--block-time', '3000000']) - expect(result.stdout).toContain('withdrawable') + const result = await cli([ + 'q', + 'basset-hub', + 'withdrawable-unbonded', + '--address', + testAddress, + '--block-time', + '3000000', + ]); + expect(result.stdout).toContain('withdrawable'); }); test('basset hub state', async () => { - const result = await cli(['q', 'basset-hub', 'state']) - expect(result.stdout).toContain('exchange_rate') + const result = await cli(['q', 'basset-hub', 'state']); + expect(result.stdout).toContain('exchange_rate'); }); }); //basset reward describe('basset reward queries', () => { test('basset reward config', async () => { - const result = await cli(['q', 'basset-reward', 'config']) - expect(result.stdout).toContain('hub_contract') + const result = await cli(['q', 'basset-reward', 'config']); + expect(result.stdout).toContain('hub_contract'); }); test('basset reward state', async () => { - const result = await cli(['q', 'basset-reward', 'state']) - expect(result.stdout).toContain('global_index') + const result = await cli(['q', 'basset-reward', 'state']); + expect(result.stdout).toContain('global_index'); }); test('basset reward accrued rewards', async () => { - const result = await cli(['q', 'basset-reward', 'accrued-rewards', '--address', testAddress]) - expect(result.stdout).toContain('rewards') + const result = await cli([ + 'q', + 'basset-reward', + 'accrued-rewards', + '--address', + testAddress, + ]); + expect(result.stdout).toContain('rewards'); }); test('basset reward holder', async () => { - const result = await cli(['q', 'basset-reward', 'holders', '--start-after', testAddress]) - expect(result.stdout).toContain('holders') + const result = await cli([ + 'q', + 'basset-reward', + 'holders', + '--start-after', + testAddress, + ]); + expect(result.stdout).toContain('holders'); }); }); - //basset token describe('basset token queries', () => { test('basset token token info', async () => { - const result = await cli(['q', 'basset-token', 'token-info']) - expect(result.stdout).toContain('Bonded Luna') + const result = await cli(['q', 'basset-token', 'token-info']); + expect(result.stdout).toContain('Bonded Luna'); }); test('basset token balance', async () => { - const result = await cli(['q', 'basset-token', 'balance', '--address', testAddress]) - expect(result.stdout).toContain('balance') + const result = await cli([ + 'q', + 'basset-token', + 'balance', + '--address', + testAddress, + ]); + expect(result.stdout).toContain('balance'); }); test('basset token minter', async () => { - const result = await cli(['q', 'basset-token', 'minter']) - expect(result.stdout).toContain('terra1mtwph2juhj0rvjz7dy92gvl6xvukaxu8rfv8ts') + const result = await cli(['q', 'basset-token', 'minter']); + expect(result.stdout).toContain( + 'terra1mtwph2juhj0rvjz7dy92gvl6xvukaxu8rfv8ts', + ); }); test('basset token allowance', async () => { - const result = await cli(['q', 'basset-token', 'allowance', '--owner', testAddress, '--spender', bLunaPair]) - expect(result.stdout).toContain('allowance') + const result = await cli([ + 'q', + 'basset-token', + 'allowance', + '--owner', + testAddress, + '--spender', + bLunaPair, + ]); + expect(result.stdout).toContain('allowance'); }); test('basset token all allowances', async () => { - const result = await cli(['q', 'basset-token', 'all-allowances', '--owner', testAddress]) - expect(result.stdout).toContain('allowances') + const result = await cli([ + 'q', + 'basset-token', + 'all-allowances', + '--owner', + testAddress, + ]); + expect(result.stdout).toContain('allowances'); }); test('basset token all accounts', async () => { - const result = await cli(['q', 'basset-token', 'all-accounts', '--start-after', testAddress]) - expect(result.stdout).toContain('accounts') + const result = await cli([ + 'q', + 'basset-token', + 'all-accounts', + '--start-after', + testAddress, + ]); + expect(result.stdout).toContain('accounts'); }); }); //beth reward describe('beth reward queries', () => { test('beth reward config', async () => { - const result = await cli(['q', 'beth-reward', 'config']) - expect(result.stdout).toContain('token_contract') + const result = await cli(['q', 'beth-reward', 'config']); + expect(result.stdout).toContain('token_contract'); }); test('beth reward state', async () => { - const result = await cli(['q', 'beth-reward', 'state']) - expect(result.stdout).toContain('global_index') + const result = await cli(['q', 'beth-reward', 'state']); + expect(result.stdout).toContain('global_index'); }); test('beth reward accrued rewards', async () => { - const result = await cli(['q', 'beth-reward', 'accrued-rewards', '--address', testAddress]) - expect(result.stdout).toContain('rewards') + const result = await cli([ + 'q', + 'beth-reward', + 'accrued-rewards', + '--address', + testAddress, + ]); + expect(result.stdout).toContain('rewards'); }); test('beth reward holder', async () => { - const result = await cli(['q', 'beth-reward', 'holders', '--start-after', testAddress]) - expect(result.stdout).toContain('holders') + const result = await cli([ + 'q', + 'beth-reward', + 'holders', + '--start-after', + testAddress, + ]); + expect(result.stdout).toContain('holders'); }); }); //beth token describe('beth token queries', () => { test('beth token token info', async () => { - const result = await cli(['q', 'beth-token', 'token-info']) - expect(result.stdout).toContain('Bonded ETH') + const result = await cli(['q', 'beth-token', 'token-info']); + expect(result.stdout).toContain('Bonded ETH'); }); test('beth token balance', async () => { - const result = await cli(['q', 'beth-token', 'balance', '--address', testAddress]) - expect(result.stdout).toContain('balance') + const result = await cli([ + 'q', + 'beth-token', + 'balance', + '--address', + testAddress, + ]); + expect(result.stdout).toContain('balance'); }); test('beth token minter', async () => { - const result = await cli(['q', 'beth-token', 'minter']) - expect(result.stdout).toContain('terra13yxhrk08qvdf5zdc9ss5mwsg5sf7zva9xrgwgc') + const result = await cli(['q', 'beth-token', 'minter']); + expect(result.stdout).toContain( + 'terra13yxhrk08qvdf5zdc9ss5mwsg5sf7zva9xrgwgc', + ); }); test('beth token allowance', async () => { - const result = await cli(['q', 'beth-token', 'allowance', '--owner', testAddress, '--spender', bLunaPair]) - expect(result.stdout).toContain('allowance') + const result = await cli([ + 'q', + 'beth-token', + 'allowance', + '--owner', + testAddress, + '--spender', + bLunaPair, + ]); + expect(result.stdout).toContain('allowance'); }); test('beth token all allowances', async () => { - const result = await cli(['q', 'beth-token', 'all-allowances', '--owner', testAddress]) - expect(result.stdout).toContain('allowances') + const result = await cli([ + 'q', + 'beth-token', + 'all-allowances', + '--owner', + testAddress, + ]); + expect(result.stdout).toContain('allowances'); }); test('beth token all accounts', async () => { - const result = await cli(['q', 'beth-token', 'all-accounts', '--start-after', testAddress]) - expect(result.stdout).toContain('accounts') + const result = await cli([ + 'q', + 'beth-token', + 'all-accounts', + '--start-after', + testAddress, + ]); + expect(result.stdout).toContain('accounts'); }); }); //collector describe('colletor queries', () => { test('collector config', async () => { - const result = await cli(['q', 'collector', 'config']) - expect(result.stdout).toContain('gov_contract') - }) + const result = await cli(['q', 'collector', 'config']); + expect(result.stdout).toContain('gov_contract'); + }); }); //community describe('community queries', () => { test('community config', async () => { - const result = await cli(['q', 'community', 'config']) - expect(result.stdout).toContain('spend_limit') - }) + const result = await cli(['q', 'community', 'config']); + expect(result.stdout).toContain('spend_limit'); + }); }); //distributor describe('distributor queries', () => { test('distributor config', async () => { - const result = await cli(['q', 'distributor', 'config']) - expect(result.stdout).toContain('spend_limit') - }) + const result = await cli(['q', 'distributor', 'config']); + expect(result.stdout).toContain('spend_limit'); + }); }); //gov describe('gov queries', () => { test('gov config', async () => { - const result = await cli(['q', 'gov', 'config']) - expect(result.stdout).toContain('proposal_deposit') - }) + const result = await cli(['q', 'gov', 'config']); + expect(result.stdout).toContain('proposal_deposit'); + }); test('gov poll', async () => { - const result = await cli(['q', 'gov', 'poll', '1']) - expect(result.stdout).toContain('yes_votes') - }) + const result = await cli(['q', 'gov', 'poll', '1']); + expect(result.stdout).toContain('yes_votes'); + }); test('gov polls', async () => { - const result = await cli(['q', 'gov', 'polls', '--filter', 'executed', '--start-after', '4', 'limit', '1']) - expect(result.stdout).toContain('yes_votes') - }) + const result = await cli([ + 'q', + 'gov', + 'polls', + '--filter', + 'executed', + '--start-after', + '4', + 'limit', + '1', + ]); + expect(result.stdout).toContain('yes_votes'); + }); test('gov state', async () => { - const result = await cli(['q', 'gov', 'state']) - expect(result.stdout).toContain('poll_count') - }) + const result = await cli(['q', 'gov', 'state']); + expect(result.stdout).toContain('poll_count'); + }); test('gov voters', async () => { - const result = await cli(['q', 'gov', 'voters', '1']) - expect(result.stdout).toContain('voters') - }) + const result = await cli(['q', 'gov', 'voters', '1']); + expect(result.stdout).toContain('voters'); + }); }); //bluna custody describe('money market custody queries', () => { test('bluna custody borrower', async () => { - const result = await cli(['q', 'custody-bluna', 'borrower', '--address', testAddress]) - expect(result.stdout).toContain('spendable') - }) + const result = await cli([ + 'q', + 'custody-bluna', + 'borrower', + '--address', + testAddress, + ]); + expect(result.stdout).toContain('spendable'); + }); test('bluna custody borrowers', async () => { - const result = await cli(['q', 'custody-bluna', 'borrowers', '--start-after', testAddress, '--limit', '5']) - expect(result.stdout).toContain('spendable') - }) + const result = await cli([ + 'q', + 'custody-bluna', + 'borrowers', + '--start-after', + testAddress, + '--limit', + '5', + ]); + expect(result.stdout).toContain('spendable'); + }); test('bluna custody config', async () => { - const result = await cli(['q', 'custody-bluna', 'config']) - expect(result.stdout).toContain('BLUNA') - }) + const result = await cli(['q', 'custody-bluna', 'config']); + expect(result.stdout).toContain('BLUNA'); + }); }); //beth custody describe('money market beth custody queries', () => { test('beth custody borrower', async () => { - const result = await cli(['q', 'custody-beth', 'borrower', '--address', testAddress]) - expect(result.stdout).toContain('spendable') - }) + const result = await cli([ + 'q', + 'custody-beth', + 'borrower', + '--address', + testAddress, + ]); + expect(result.stdout).toContain('spendable'); + }); test('beth custody borrowers', async () => { - const result = await cli(['q', 'custody-beth', 'borrowers', '--start-after', testAddress, '--limit', '5']) - expect(result.stdout).toContain('spendable') - }) + const result = await cli([ + 'q', + 'custody-beth', + 'borrowers', + '--start-after', + testAddress, + '--limit', + '5', + ]); + expect(result.stdout).toContain('spendable'); + }); test('beth custody config', async () => { - const result = await cli(['q', 'custody-beth', 'config']) - expect(result.stdout).toContain('BETH') - }) + const result = await cli(['q', 'custody-beth', 'config']); + expect(result.stdout).toContain('BETH'); + }); }); //interest describe('money market interest queries', () => { test('interest borrow-rate', async () => { - const result = await cli(['q', 'interest', 'borrow-rate', '--market-balance', '100', '--total-liabilities', '100', '--total-reserves', '10']) - expect(result.stdout).toContain('rate') - }) + const result = await cli([ + 'q', + 'interest', + 'borrow-rate', + '--market-balance', + '100', + '--total-liabilities', + '100', + '--total-reserves', + '10', + ]); + expect(result.stdout).toContain('rate'); + }); test('interest config', async () => { - const result = await cli(['q', 'interest', 'config']) - expect(result.stdout).toContain('interest_multiplier') - }) + const result = await cli(['q', 'interest', 'config']); + expect(result.stdout).toContain('interest_multiplier'); + }); }); //liquidation describe('money market liquidation queries', () => { test('liquidation bid', async () => { - const result = await cli(['q', 'liquidation', 'bid', '--collateral-token', bLuna, '--bidder', 'terra18kgwjqrm7mcnlzcy7l8h7awnn7fs2pvdl2tpm9']) - expect(result.stdout).toContain('premium_rate') - }) + const result = await cli([ + 'q', + 'liquidation', + 'bid', + '--collateral-token', + bLuna, + '--bidder', + 'terra18kgwjqrm7mcnlzcy7l8h7awnn7fs2pvdl2tpm9', + ]); + expect(result.stdout).toContain('premium_rate'); + }); test('liquidation bids by user', async () => { - const result = await cli(['q', 'liquidation', 'bids-by-user', '--bidder', testAddress, '--start-after', bEth, '--limit', '1']) - expect(result.stdout).toContain('bids') - }) + const result = await cli([ + 'q', + 'liquidation', + 'bids-by-user', + '--bidder', + testAddress, + '--start-after', + bEth, + '--limit', + '1', + ]); + expect(result.stdout).toContain('bids'); + }); test('liquidation bids by collateral', async () => { - const result = await cli(['q', 'liquidation', 'bids-by-collateral', '--collateral-token', bEth, '--start-after', testAddress, '--limit', '3']) - expect(result.stdout).toContain('bids') - }) + const result = await cli([ + 'q', + 'liquidation', + 'bids-by-collateral', + '--collateral-token', + bEth, + '--start-after', + testAddress, + '--limit', + '3', + ]); + expect(result.stdout).toContain('bids'); + }); test('liquidation config', async () => { - const result = await cli(['q', 'liquidation', 'config']) - expect(result.stdout).toContain('safe_ratio') - }) + const result = await cli(['q', 'liquidation', 'config']); + expect(result.stdout).toContain('safe_ratio'); + }); }); //market describe('money market market queries', () => { test('market config', async () => { - const result = await cli(['q', 'market', 'config']) - expect(result.stdout).toContain('max_borrow_factor') - }) + const result = await cli(['q', 'market', 'config']); + expect(result.stdout).toContain('max_borrow_factor'); + }); test('market epoch-state', async () => { - const result = await cli(['q', 'market', 'epoch-state']) - expect(result.stdout).toContain('exchange_rate') - }) + const result = await cli(['q', 'market', 'epoch-state']); + expect(result.stdout).toContain('exchange_rate'); + }); test('market liabilities', async () => { - const result = await cli(['q', 'market', 'liabilities', '--start-after', testAddress, '--limit', '3']) - expect(result.stdout).toContain('pending_rewards') - }) + const result = await cli([ + 'q', + 'market', + 'liabilities', + '--start-after', + testAddress, + '--limit', + '3', + ]); + expect(result.stdout).toContain('pending_rewards'); + }); test('liquidation liability', async () => { - const result = await cli(['q', 'market', 'state']) - expect(result.stdout).toContain('prev_exchange_rate') - }) + const result = await cli(['q', 'market', 'state']); + expect(result.stdout).toContain('prev_exchange_rate'); + }); }); describe('money market oracle queries', () => { test('oracle config', async () => { - const result = await cli(['q', 'oracle', 'config']) - expect(result.stdout).toContain('base_asset') - }) + const result = await cli(['q', 'oracle', 'config']); + expect(result.stdout).toContain('base_asset'); + }); test('oracle price', async () => { - const result = await cli(['q', 'oracle', 'price', '--base', bLuna, '--quote', 'uusd']) - expect(result.stdout).toContain('last_updated_base') - }) + const result = await cli([ + 'q', + 'oracle', + 'price', + '--base', + bLuna, + '--quote', + 'uusd', + ]); + expect(result.stdout).toContain('last_updated_base'); + }); test('oracle prices', async () => { - const result = await cli(['q', 'oracle', 'prices', '--start-after', bEth, '--limit', '1']) - expect(result.stdout).toContain('last_updated_time') - }) + const result = await cli([ + 'q', + 'oracle', + 'prices', + '--start-after', + bEth, + '--limit', + '1', + ]); + expect(result.stdout).toContain('last_updated_time'); + }); }); describe('money market overseer queries', () => { test('overseer all collaterals', async () => { - const result = await cli(['q', 'overseer', 'all-collaterals', '--start-after', testAddress, '--limit', '5']) - expect(result.stdout).toContain('all_collaterals') - }) + const result = await cli([ + 'q', + 'overseer', + 'all-collaterals', + '--start-after', + testAddress, + '--limit', + '5', + ]); + expect(result.stdout).toContain('all_collaterals'); + }); test('overseer borrow limit', async () => { - const result = await cli(['q', 'overseer', 'borrow-limit', '--borrower', testAddress, '--block-time', '50000000']) - expect(result.stdout).toContain('borrow_limit') - }) + const result = await cli([ + 'q', + 'overseer', + 'borrow-limit', + '--borrower', + testAddress, + '--block-time', + '50000000', + ]); + expect(result.stdout).toContain('borrow_limit'); + }); test('overseer collaterals', async () => { - const result = await cli(['q', 'overseer', 'collaterals', '--borrower', testAddress]) - expect(result.stdout).toContain('collaterals') - }) + const result = await cli([ + 'q', + 'overseer', + 'collaterals', + '--borrower', + testAddress, + ]); + expect(result.stdout).toContain('collaterals'); + }); test('overseer config', async () => { - const result = await cli(['q', 'overseer', 'config']) - expect(result.stdout).toContain('target_deposit_rate') - }) + const result = await cli(['q', 'overseer', 'config']); + expect(result.stdout).toContain('target_deposit_rate'); + }); test('overseer epoch state', async () => { - const result = await cli(['q', 'overseer', 'epoch-state']) - expect(result.stdout).toContain('prev_interest_buffer') - }) + const result = await cli(['q', 'overseer', 'epoch-state']); + expect(result.stdout).toContain('prev_interest_buffer'); + }); test('overseer whitelist select collateral', async () => { - const result = await cli(['q', 'overseer', 'whitelist', '--collateral-token', bEth]) - expect(result.stdout).toContain('Bonded ETH') - }) + const result = await cli([ + 'q', + 'overseer', + 'whitelist', + '--collateral-token', + bEth, + ]); + expect(result.stdout).toContain('Bonded ETH'); + }); test('overseer whitelist start-after', async () => { - const result = await cli(['q', 'overseer', 'whitelist', '--start-after', bEth, '--limit', '1']) - expect(result.stdout).toContain('Bonded Luna') - }) + const result = await cli([ + 'q', + 'overseer', + 'whitelist', + '--start-after', + bEth, + '--limit', + '1', + ]); + expect(result.stdout).toContain('Bonded Luna'); + }); }); describe('staking queries', () => { test('staking config', async () => { - const result = await cli(['q', 'staking', 'config']) - expect(result.stdout).toContain('distribution_schedule') - }) + const result = await cli(['q', 'staking', 'config']); + expect(result.stdout).toContain('distribution_schedule'); + }); test('staking state', async () => { - const result = await cli(['q', 'staking', 'state']) - expect(result.stdout).toContain('global_reward_index') - }) + const result = await cli(['q', 'staking', 'state']); + expect(result.stdout).toContain('global_reward_index'); + }); test('staking reward info', async () => { - const result = await cli(['q', 'staking', 'reward-info', testAddress]) - expect(result.stdout).toContain('reward_index') - }) -}) + const result = await cli(['q', 'staking', 'reward-info', testAddress]); + expect(result.stdout).toContain('reward_index'); + }); +}); describe('terraswap queries', () => { test('terraswap pool anc-ust', async () => { - const result = await cli(['q', 'terraswap', 'pool', '--anc-ust']) - expect(result.stdout).toContain('assets') - }) + const result = await cli(['q', 'terraswap', 'pool', '--anc-ust']); + expect(result.stdout).toContain('assets'); + }); test('terraswap pool bluna-luna', async () => { - const result = await cli(['q', 'terraswap', 'pool', '--bluna-luna']) - expect(result.stdout).toContain('assets') - }) + const result = await cli(['q', 'terraswap', 'pool', '--bluna-luna']); + expect(result.stdout).toContain('assets'); + }); test('terraswap pair anc-ust', async () => { - const result = await cli(['q', 'terraswap', 'pair', '--anc-ust']) - expect(result.stdout).toContain('asset_infos') - }) + const result = await cli(['q', 'terraswap', 'pair', '--anc-ust']); + expect(result.stdout).toContain('asset_infos'); + }); test('terraswap pool bluna-luna', async () => { - const result = await cli(['q', 'terraswap', 'pair', '--bluna-luna']) - expect(result.stdout).toContain('asset_infos') - }) -}) + const result = await cli(['q', 'terraswap', 'pair', '--bluna-luna']); + expect(result.stdout).toContain('asset_infos'); + }); +}); -const cliPath = path.resolve('./bin/anchorcli') +const cliPath = path.resolve('./bin/anchorcli'); async function cli(args: string[]): Promise { - - return new Promise(resolve => { - exec( - `${cliPath} ${args.join(' ')}`, - {}, - (error, stdout, stderr) => {resolve({ + return new Promise((resolve) => { + exec(`${cliPath} ${args.join(' ')}`, {}, (error, stdout, stderr) => { + resolve({ error, stdout, - stderr - }) - }) - }) -} \ No newline at end of file + stderr, + }); + }); + }); +} diff --git a/src/addresses/from-json.ts b/src/addresses/from-json.ts index 3863187..8369bd7 100644 --- a/src/addresses/from-json.ts +++ b/src/addresses/from-json.ts @@ -1,7 +1,11 @@ /* eslint-disable */ import { Contracts } from './types'; import { activeNetwork, loadConfig } from '../util/config'; -import { AddressProvider, COLLATERAL_DENOMS, MARKET_DENOMS } from '@anchor-protocol/anchor.js'; +import { + AddressProvider, + COLLATERAL_DENOMS, + MARKET_DENOMS, +} from '@anchor-protocol/anchor.js'; export enum NETWORKS { COLUMBUS5, @@ -62,10 +66,10 @@ export class AddressProviderFromJSON implements AddressProvider { custody(_denom: MARKET_DENOMS, collateral: COLLATERAL_DENOMS): string { switch (collateral) { case COLLATERAL_DENOMS.UBLUNA: { - return this.addressesMap.mmCustody + return this.addressesMap.mmCustody; } case COLLATERAL_DENOMS.UBETH: { - return this.addressesMap.mmCustodyBEth + return this.addressesMap.mmCustodyBEth; } } } @@ -90,10 +94,6 @@ export class AddressProviderFromJSON implements AddressProvider { return this.addressesMap.mmLiquidation; } - liquidationQueue(): string { - return this.addressesMap.mmLiquidation; - } - terraswapblunaLunaPair(): string { return this.addressesMap.terraswapblunaLunaPair; } diff --git a/src/commands/contracts/beth-reward.ts b/src/commands/contracts/beth-reward.ts index e5c5f85..ed97150 100644 --- a/src/commands/contracts/beth-reward.ts +++ b/src/commands/contracts/beth-reward.ts @@ -61,7 +61,9 @@ const getConfig = query const addressProvider = new AddressProviderFromJSON( resolveChainIDToNetworkName(query.chainId), ); - const config_query = await querybEthRewardConfig({ lcd: lcd })(addressProvider); + const config_query = await querybEthRewardConfig({ lcd: lcd })( + addressProvider, + ); await handleQueryCommand(query, config_query); }); @@ -73,7 +75,9 @@ const getState = query const addressProvider = new AddressProviderFromJSON( resolveChainIDToNetworkName(query.chainId), ); - const config_query = await querybEthRewardState({ lcd: lcd })(addressProvider); + const config_query = await querybEthRewardState({ lcd: lcd })( + addressProvider, + ); await handleQueryCommand(query, config_query); }); @@ -83,9 +87,7 @@ interface AccruedRewards { const getAccruedRewards = query .command('accrued-rewards') - .description( - 'Get the amount of rewards accrued to the specified bEth holder', - ) + .description('Get the amount of rewards accrued to the specified bEth holder') .requiredOption('--address ', 'Address of user') .action(async ({ address }: AccruedRewards) => { const lcd = getLCDClient(query.chainId); diff --git a/src/commands/contracts/beth-token.ts b/src/commands/contracts/beth-token.ts index 2e8e125..85d5cd5 100644 --- a/src/commands/contracts/beth-token.ts +++ b/src/commands/contracts/beth-token.ts @@ -432,10 +432,7 @@ interface AllAccounts { const getAccounts = query .command('all-accounts') .description('Get all accounts that have balances') - .option( - '--start-after ', - 'Address of bEth holder to start query', - ) + .option('--start-after ', 'Address of bEth holder to start query') .option('--limit ', 'Maximum number of query entries') .action(async ({ startAfter, limit }: AllAccounts) => { const lcd = getLCDClient(query.chainId); diff --git a/src/commands/contracts/gov.ts b/src/commands/contracts/gov.ts index d1e5cbc..acac866 100644 --- a/src/commands/contracts/gov.ts +++ b/src/commands/contracts/gov.ts @@ -328,7 +328,7 @@ const getPolls = query if ( getPolls.filter && !['in_progress', 'passed', 'rejected', 'executed'].find( - filter => filter === getPolls.filter, + (filter) => filter === getPolls.filter, ) ) { throw new Error( diff --git a/src/commands/contracts/money-market-overseer.ts b/src/commands/contracts/money-market-overseer.ts index d7bb625..ff5b798 100644 --- a/src/commands/contracts/money-market-overseer.ts +++ b/src/commands/contracts/money-market-overseer.ts @@ -376,7 +376,6 @@ const getConfig = query await handleQueryCommand(query, queryConfig); }); - const getEpochState = query .command('epoch-state') .description('Get information related to the current epoch') diff --git a/src/data/anchorcli-default-testnet.ts b/src/data/anchorcli-default-testnet.ts index 98f19ca..b627b61 100644 --- a/src/data/anchorcli-default-testnet.ts +++ b/src/data/anchorcli-default-testnet.ts @@ -18,8 +18,8 @@ const testnetDefaultConfig: AnchorConfig = { bLunaToken: 'terra1u0t35drzyy0mujj8rkdyzhe264uls4ug3wdp3x', bLunaReward: 'terra1ac24j6pdxh53czqyrkr6ygphdeftg7u3958tl2', bLunaAirdrop: 'terra1334h20c9ewxguw9p9vdxzmr8994qj4qu77ux6q', - bEthReward:'terra1ja3snkedk4t0zp7z3ljd064hcln8dsv5x004na', - bEthToken:'terra19mkj9nec6e3y5754tlnuz4vem7lzh4n0lc2s3l', + bEthReward: 'terra1ja3snkedk4t0zp7z3ljd064hcln8dsv5x004na', + bEthToken: 'terra19mkj9nec6e3y5754tlnuz4vem7lzh4n0lc2s3l', mmInterestModel: 'terra1m25aqupscdw2kw4tnq5ql6hexgr34mr76azh5x', mmOracle: 'terra1p4gg3p2ue6qy2qfuxtrmgv2ec3f4jmgqtazum8', mmMarket: 'terra15dwd5mj8v59wpj0wvt233mf5efdff808c5tkal', diff --git a/src/index.ts b/src/index.ts index 0e6bbd6..2dde448 100755 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,6 @@ import { program, Command } from 'commander'; import * as _ from 'lodash'; -import { version } from '../package.json' +import { version } from '../package.json'; import commands from './commands'; import * as logger from './util/logger'; diff --git a/src/util/contract-menu.ts b/src/util/contract-menu.ts index 7d7dafe..173fcc8 100644 --- a/src/util/contract-menu.ts +++ b/src/util/contract-menu.ts @@ -11,7 +11,7 @@ import { Tx, TxBody, SignOptions, - Fee + Fee, } from '@terra-money/terra.js'; import { CLIKey } from '@terra-money/terra.js/dist/key/CLIKey'; import { loadConfig } from './config'; @@ -120,10 +120,8 @@ export async function handleExecCommand( let key = new CLIKey({ keyName: exec.from, home: exec.home }); const keyType = JSON.parse( - execSync( - (`terrad keys show ${exec.from} --output json`) - ).toString() - ).type + execSync(`terrad keys show ${exec.from} --output json`).toString(), + ).type; const wallet = lcd.wallet(key); @@ -157,12 +155,15 @@ export async function handleExecCommand( if (exec.gas === 'auto') { // estimate gas const estimatedFee = ( - await lcd.tx.create([{address: key.accAddress, sequenceNumber: sequence}], { - msgs, - gasPrices: exec.gasPrices, - gasAdjustment: exec.gasAdjustment, - memo, - }) + await lcd.tx.create( + [{ address: key.accAddress, sequenceNumber: sequence }], + { + msgs, + gasPrices: exec.gasPrices, + gasAdjustment: exec.gasAdjustment, + memo, + }, + ) ).auth_info.fee; gas = Number(estimatedFee.toAmino().gas); @@ -185,15 +186,18 @@ export async function handleExecCommand( const unsignedTx = new Tx( new TxBody(msgs, memo), new AuthInfo([], new Fee(gas, feeAmount)), - [] + [], ); const signOptions: SignOptions = { accountNumber, sequence, - signMode: keyType === 'ledger' ? SignMode.SIGN_MODE_LEGACY_AMINO_JSON : SignMode.SIGN_MODE_DIRECT, - chainID: chainId - } + signMode: + keyType === 'ledger' + ? SignMode.SIGN_MODE_LEGACY_AMINO_JSON + : SignMode.SIGN_MODE_DIRECT, + chainID: chainId, + }; if (exec.generateOnly) { if (exec.yaml) { @@ -204,8 +208,8 @@ export async function handleExecCommand( } else { if (!exec.yes) { let msg = unsignedTx.body.messages[0].toData() as any; - msg.execute_msg = (unsignedTx - .body.messages[0] as MsgExecuteContract).execute_msg; + msg.execute_msg = (unsignedTx.body + .messages[0] as MsgExecuteContract).execute_msg; console.log( yaml.stringify({ diff --git a/yarn.lock b/yarn.lock index 3f42a5a..f66e535 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,12 +2,12 @@ # yarn lockfile v1 -"@anchor-protocol/anchor.js@1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@anchor-protocol/anchor.js/-/anchor.js-1.0.2.tgz#6c28a97587b9aee5f68f76171b49c311ff660416" - integrity sha512-ZnP3Plh3WSu+fp4+I37oJ/YRJ2+OB0Jf5+6si75EPZsuY1sFybScVRaV4IbXr+oa2vGRq4Kk+XwQklRea9MfjQ== +"@anchor-protocol/anchor.js@^1.2.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@anchor-protocol/anchor.js/-/anchor.js-1.4.0.tgz#bde6d75727bd88b1151ee84d03665545bff273fc" + integrity sha512-VQVKQicb3QK+N1ExmRcyhrZEh+Thki7f5sYe3zncBkwSFErHoRINtQJnVWkwP9v87xFQAQvh5BYJ6LCeoA1sxQ== dependencies: - "@terra-money/terra.js" "^1.8.3" + "@terra-money/terra.js" "^2.0.14" "@babel/code-frame@7.12.11": version "7.12.11" @@ -548,6 +548,59 @@ "@nodelib/fs.scandir" "2.1.4" fastq "^1.6.0" +"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" + integrity sha1-m4sMxmPWaafY9vXQiToU00jzD78= + +"@protobufjs/base64@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" + integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== + +"@protobufjs/codegen@^2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" + integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== + +"@protobufjs/eventemitter@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" + integrity sha1-NVy8mLr61ZePntCV85diHx0Ga3A= + +"@protobufjs/fetch@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" + integrity sha1-upn7WYYUr2VwDBYZ/wbUVLDYTEU= + dependencies: + "@protobufjs/aspromise" "^1.1.1" + "@protobufjs/inquire" "^1.1.0" + +"@protobufjs/float@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" + integrity sha1-Xp4avctz/Ap8uLKR33jIy9l7h9E= + +"@protobufjs/inquire@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" + integrity sha1-/yAOPnzyQp4tyvwRQIKOjMY48Ik= + +"@protobufjs/path@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" + integrity sha1-bMKyDFya1q0NzP0hynZz2Nf79o0= + +"@protobufjs/pool@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" + integrity sha1-Cf0V8tbTq/qbZbw2ZQbWrXhG/1Q= + +"@protobufjs/utf8@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" + integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA= + "@sinonjs/commons@^1.7.0": version "1.8.2" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.2.tgz" @@ -584,22 +637,34 @@ resolved "https://registry.yarnpkg.com/@ssen/prettier-config/-/prettier-config-1.2.0.tgz" integrity sha512-htPV587msywvNOBkZG4lYN0NwUArqfNRHDP5KKn9N4bBQzM1o1IZS1jTZCvCAnwOPXagoApsEIJwvtw/lmQ8BA== -"@terra-money/terra.js@^1.8.3": - version "1.8.4" - resolved "https://registry.yarnpkg.com/@terra-money/terra.js/-/terra.js-1.8.4.tgz#3e85cd7f90f3752411676c445205a2ad5461dbf5" - integrity sha512-OrQc/FnaCBG5XkkAbPqZCyuJjmUDUNUVVLGQZ0Si5KItTUl2EX8k2BBfMYNGP/zTrvB3Mi8ksvYnt2QFZAR66A== +"@terra-money/terra.js@^2.0.14", "@terra-money/terra.js@^2.1.4": + version "2.1.23" + resolved "https://registry.yarnpkg.com/@terra-money/terra.js/-/terra.js-2.1.23.tgz#6e7ee7477b8cc5895ddcb2e4eb0446e71bb0e575" + integrity sha512-nSAR35zqjKUn1Jzqevf30s47XRlW/VXU01YgK3n9ndmX15lkdlgFvqaV7UezK0xAmCpm+7xWIrtBTMmZpVBkMQ== dependencies: + "@terra-money/terra.proto" "^0.1.7" axios "^0.21.1" bech32 "^2.0.0" bip32 "^2.0.6" bip39 "^3.0.3" + bufferutil "^4.0.3" decimal.js "^10.2.1" jscrypto "^1.0.1" readable-stream "^3.6.0" secp256k1 "^4.0.2" tmp "^0.2.1" + utf-8-validate "^5.0.5" ws "^7.4.2" +"@terra-money/terra.proto@^0.1.6", "@terra-money/terra.proto@^0.1.7": + version "0.1.7" + resolved "https://registry.yarnpkg.com/@terra-money/terra.proto/-/terra.proto-0.1.7.tgz#59c18f30da10d43200bab3ba8feb5b17e43a365f" + integrity sha512-NXD7f6pQCulvo6+mv6MAPzhOkUzRjgYVuHZE/apih+lVnPG5hDBU0rRYnOGGofwvKT5/jQoOENnFn/gioWWnyQ== + dependencies: + google-protobuf "^3.17.3" + long "^4.0.0" + protobufjs "~6.11.2" + "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.7": version "7.1.14" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.14.tgz" @@ -707,6 +772,11 @@ resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.168.tgz" integrity sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q== +"@types/long@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.1.tgz#459c65fa1867dafe6a8f322c4c51695663cc55e9" + integrity sha512-5tXH6Bx/kNGd3MgffdmP4dy2Z+G4eaXw0SE81Tq3BNadtnMR5/ySMzX4SLEzHJzSmPNn4HIdpQsBvXMUykr58w== + "@types/node@*": version "14.14.37" resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.37.tgz" @@ -722,6 +792,11 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.6.tgz" integrity sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ== +"@types/node@>=13.7.0": + version "17.0.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.21.tgz#864b987c0c68d07b4345845c3e63b75edd143644" + integrity sha512-DBZCJbhII3r90XbQxI8Y9IjjiiOGlZ0Hr32omXIZvwwZ7p4DMMXGrKXVyPfuoBOri9XNtL0UK69jYIBIsRX3QQ== + "@types/normalize-package-data@^2.4.0": version "2.4.0" resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz" @@ -1377,6 +1452,13 @@ buffer-from@1.x, buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== +bufferutil@^4.0.3: + version "4.0.6" + resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.6.tgz#ebd6c67c7922a0e902f053e5d8be5ec850e48433" + integrity sha512-jduaYOYtnio4aIAyc6UbvPCVcgq7nYpVnucyxr6eCYg/Woad9Hf/oxxBRDnGGjPfjUm6j5O/uBWhIu4iLebFaw== + dependencies: + node-gyp-build "^4.3.0" + cache-base@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz" @@ -2560,6 +2642,11 @@ globby@^11.0.1: merge2 "^1.3.0" slash "^3.0.0" +google-protobuf@^3.17.3: + version "3.19.4" + resolved "https://registry.yarnpkg.com/google-protobuf/-/google-protobuf-3.19.4.tgz#8d32c3e34be9250956f28c0fb90955d13f311888" + integrity sha512-OIPNCxsG2lkIvf+P5FNfJ/Km95CsXOBecS9ZcAU6m2Rq3svc0Apl9nB3GMDNKfQ9asNv4KjyAqGwPQFrVle3Yg== + graceful-fs@^4.1.2, graceful-fs@^4.2.4: version "4.2.6" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz" @@ -3711,6 +3798,11 @@ lodash@4.x, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== +long@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" + integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== + loose-envify@^1.1.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz" @@ -3932,6 +4024,11 @@ node-gyp-build@^4.2.0: resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.2.3.tgz" integrity sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg== +node-gyp-build@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.3.0.tgz#9f256b03e5826150be39c764bf51e993946d71a3" + integrity sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q== + node-int64@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz" @@ -4408,6 +4505,25 @@ prop-types@^15.7.2: object-assign "^4.1.1" react-is "^16.8.1" +protobufjs@~6.11.2: + version "6.11.2" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.2.tgz#de39fabd4ed32beaa08e9bb1e30d08544c1edf8b" + integrity sha512-4BQJoPooKJl2G9j3XftkIXjoC9C0Av2NOrWmbLWT1vH32GcSUHjM0Arra6UfTsVyfMAuFzaLucXn1sadxJydAw== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/long" "^4.0.1" + "@types/node" ">=13.7.0" + long "^4.0.0" + psl@^1.1.28, psl@^1.1.33: version "1.8.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz" @@ -5428,6 +5544,13 @@ use@^3.1.0: resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz" integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== +utf-8-validate@^5.0.5: + version "5.0.9" + resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.9.tgz#ba16a822fbeedff1a58918f2a6a6b36387493ea3" + integrity sha512-Yek7dAy0v3Kl0orwMlvi7TPtiCNrdfHNd7Gcc/pLq4BLXqfAmd0J7OWMizUQnTTJsyjKn02mU7anqwfmUP4J8Q== + dependencies: + node-gyp-build "^4.3.0" + util-deprecate@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz"