Coder Social home page Coder Social logo

anchorcli's Introduction

anchorcli

Command-line interface for Anchor Protocol on Terra.

Table of Contents

Setup

Requirements

  • Node.js 12+
  • NPM,
  • terrad in your path.

anchorcli can be installed off NPM.


$ npm install -g @anchor-protocol/anchorcli

The entrypoint anchorcli should then be available in your path:

         
$ anchorcli Usage: anchorcli [options] [command] Command-line interface for interacting with Anchor Protocol on Terra Options: -V, --version output the version number -v,--verbose Show verbose error logs -h, --help display help for command Commands: exec|x Execute a function on a smart contract query|q Run a smart contract query function help [command] display help for command

Configuration

By default, anchorcli works with the default configuration which is set for the contracts on the bombay-12 environment. This setting provides the address of contracts and specifies the settings for LCD provider and fee estimation gas prices. anchorcli will create two configuration files in your home directory: $HOME/anchorcliTestnet.json and $HOME/anchorcliMainnet.json.

Specifying LCD settings

Each network configuration should define how to connect to the Terra blockchain via LCD parameters.

  • columbus-5:
"lcd": {
    "chainID": "columbus-5",
    "URL": "https://lcd.terra.dev",
    "gasPrices": {
      "uluna": 0.15,
      "usdr": 0.1018,
      "uusd": 0.15,
      "ukrw": 178.05,
      "umnt": 431.6259
    },
    "gasAdjustment": 1.2
  },
  • bombay-12:
{
"lcd": {
    "chainID": "bomabay-12",
    "URL": "https://bombay-lcd.terra.dev",
    "gasPrices": {
      "uluna": 0.15,
      "usdr": 0.1018,
      "uusd": 0.15,
      "ukrw": 178.05,
      "umnt": 431.6259
    },
    "gasAdjustment": 1.2
  }
}

Specifying Contracts

Each address configuration should point to the correct Anchor core contract addresses.

  • columbus-5:
"contracts": {
    "bLunaHub": "terra1mtwph2juhj0rvjz7dy92gvl6xvukaxu8rfv8ts",
    "bLunaToken": "terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp",
    "bLunaReward": "terra17yap3mhph35pcwvhza38c2lkj7gzywzy05h7l0",
    "bLunaAirdrop": "terra199t7hg7w5vymehhg834r6799pju2q3a0ya7ae9",
    "bEthReward": "terra1939tzfn4hn960ychpcsjshu8jds3zdwlp8jed9",
    "bEthToken": "terra1dzhzukyezv0etz22ud940z7adyv7xgcjkahuun",
    "mmInterestModel": "terra1kq8zzq5hufas9t0kjsjc62t2kucfnx8txf547n",
    "mmOracle": "terra1cgg6yef7qcdm070qftghfulaxmllgmvk77nc7t",
    "mmMarket": "terra1sepfj7s0aeg5967uxnfk4thzlerrsktkpelm5s",
    "mmOverseer": "terra1tmnqgvg567ypvsvk6rwsga3srp7e3lg6u0elp8",
    "mmCustody": "terra1ptjp2vfjrwh0j0faj9r6katm640kgjxnwwq9kn",
    "mmCustodyBEth": "terra10cxuzggyvvv44magvrh3thpdnk9cmlgk93gmx2",
    "mmLiquidation": "terra1w9ky73v4g7v98zzdqpqgf3kjmusnx4d4mvnac6",
    "mmDistributionModel": "terra14mufqpr5mevdfn92p4jchpkxp7xr46uyknqjwq",
    "aTerra": "terra1hzh9vpxhsk8253se0vv5jj6etdvxu3nv8z07zu",
    "terraswapblunaLunaPair": "terra1jxazgm67et0ce260kvrpfv50acuushpjsz2y0p",
    "terraswapblunaLunaLPToken": "terra1nuy34nwnsh53ygpc4xprlj263cztw7vc99leh2",
    "terraswapAncUstPair": "terra1gm5p3ner9x9xpwugn9sp6gvhd0lwrtkyrecdn3",
    "terraswapAncUstLPToken": "terra1gecs98vcuktyfkrve9czrpgtg0m3aq586x6gzm",
    "gov": "terra1f32xyep306hhcxxxf7mlyh0ucggc00rm2s9da5",
    "distributor": "terra1mxf7d5updqxfgvchd7lv6575ehhm8qfdttuqzz",
    "collector": "terra14ku9pgw5ld90dexlyju02u4rn6frheexr5f96h",
    "community": "terra12wk8dey0kffwp27l5ucfumczlsc9aned8rqueg",
    "staking": "terra1897an2xux840p9lrh6py3ryankc6mspw49xse3",
    "ANC": "terra14z56l0fp2lsf86zy3hty2z47ezkhnthtr9yq76",
    "airdrop": "terra146ahqn6d3qgdvmj8cj96hh03dzmeedhsf0kxqm",
    "investor_vesting": "terra1pm54pmw3ej0vfwn3gtn6cdmaqxt0x37e9jt0za",
    "team_vesting": "terra10evq9zxk2m86n3n3xnpw28jpqwp628c6dzuq42"
  }
  • bombay-12:
"contracts": {
    "bLunaHub": "terra1fflas6wv4snv8lsda9knvq2w0cyt493r8puh2e",
    "bLunaToken": "terra1u0t35drzyy0mujj8rkdyzhe264uls4ug3wdp3x",
    "bLunaReward": "terra1ac24j6pdxh53czqyrkr6ygphdeftg7u3958tl2",
    "bLunaAirdrop": "terra1334h20c9ewxguw9p9vdxzmr8994qj4qu77ux6q",
    "bEthReward": "terra1ja3snkedk4t0zp7z3ljd064hcln8dsv5x004na",
    "bEthToken": "terra19mkj9nec6e3y5754tlnuz4vem7lzh4n0lc2s3l",
    "mmInterestModel": "terra1m25aqupscdw2kw4tnq5ql6hexgr34mr76azh5x",
    "mmOracle": "terra1p4gg3p2ue6qy2qfuxtrmgv2ec3f4jmgqtazum8",
    "mmMarket": "terra15dwd5mj8v59wpj0wvt233mf5efdff808c5tkal",
    "mmOverseer": "terra1qljxd0y3j3gk97025qvl3lgq8ygup4gsksvaxv",
    "mmCustody": "terra1ltnkx0mv7lf2rca9f8w740ashu93ujughy4s7p",
    "mmCustodyBEth": "terra1j6fey5tl70k9fvrv7mea7ahfr8u2yv7l23w5e6",
    "mmLiquidation": "terra16vc4v9hhntswzkuunqhncs9yy30mqql3gxlqfe",
    "mmDistributionModel": "terra1u64cezah94sq3ye8y0ung28x3pxc37tv8fth7h",
    "aTerra": "terra1ajt556dpzvjwl0kl5tzku3fc3p3knkg9mkv8jl",
    "terraswapblunaLunaPair": "terra13e4jmcjnwrauvl2fnjdwex0exuzd8zrh5xk29v",
    "terraswapblunaLunaLPToken": "terra1tj4pavqjqjfm0wh73sh7yy9m4uq3m2cpmgva6n",
    "terraswapAncUstPair": "terra1wfvczps2865j0awnurk9m04u7wdmd6qv3fdnvz",
    "terraswapAncUstLPToken": "terra1vg0qyq92ky9z9dp0j9fv5rmr2s80sg605dah6f",
    "gov": "terra16ckeuu7c6ggu52a8se005mg5c0kd2kmuun63cu",
    "distributor": "terra1z7nxemcnm8kp7fs33cs7ge4wfuld307v80gypj",
    "collector": "terra1hlctcrrhcl2azxzcsns467le876cfuzam6jty4",
    "community": "terra17g577z0pqt6tejhceh06y3lyeudfs3v90mzduy",
    "staking": "terra19nxz35c8f7t3ghdxrxherym20tux8eccar0c3k",
    "ANC": "terra1747mad58h0w4y589y3sk84r5efqdev9q4r02pc",
    "airdrop": "terra1u5ywhlve3wugzqslqvm8ks2j0nsvrqjx0mgxpk",
    "investor_vesting": "not available in testnet",
    "team_vesting": "not available in testnet"
  }

Specify the Network [IMPORTANT]

By default, anchorcli will use the network setting for columbus-5 configured in $HOME/anchorcliMainnet.json. You can direct anchorcli to use a different network configuration by changing the value of the ANCHORCLI_NETWORK environment variable.

Example

ANCHORCLI_NETWORK=bombay-12 anchorcli x basset-hub bond ...

OR

export ANCHORCLI_NETWORK=bombay-12
anchorcli x basset-hub bond ...

Usage

anchorcli allows you to:

  • execute state-changing functions on Anchor smart contracts
  • query readonly data endpoints on Anchor smart contracts

Execute

USAGE: anchorcli exec|x [options] [command]

Execute a function on a smart contract

Options:
  --yaml                         Encode result as YAML instead of JSON
  -y,--yes                       Sign transaction without confirming (yes)
  --home <string>                Directory for config of terrad
  --from <key-name>              *Name of key in terrad keyring
  --generate-only                Build an unsigned transaction and write it to stdout
  -G,--generate-msg              Build an ExecuteMsg (good for including in poll)
  --base64                       For --generate-msg: returns msg as base64
  -b,--broadcast-mode <string>   Transaction broadcasting mode (sync|async|block) (default: sync) (default: "sync")
  --chain-id <string>            Chain ID of Terra node
  -a,--account-number <int>      The account number of the signing account (offline mode)
  -s,--sequence <int>            The sequence number of the signing account (offline mode)
  --memo <string>                Memo to send along with transaction
  --fees <coins>                 Fees to pay along with transaction
  --gas <int|auto>               *Gas limit to set per-transaction; set to "auto" to calculate required gas automatically
  --gas-adjustment <float>       Adjustment factor to be multiplied against the estimate returned by the tx simulation
  --gas-prices <coins>           Gas prices to determine the transaction fee (e.g. 10uluna,12.5ukrw)
  -h, --help                     display help for command

Commands:
  basset-hub [options]        Anchor bAsset Hub contract functions
  basset-reward [options]     Anchor bAsset reward contract functions
  basset-token [options]      Anchor bAsset token contract functions
  liquidation [options]       Anchor Money Market Liquidation contract functions
  oracle [options]            Anchor Money Market Liquidation contract functions
  market [options]            Anchor Money Market Market contract functions
  custody-bluna [options]     Anchor Money Market Custody contract functions
  overseer [options]          Anchor Money Market Overseer contract functions
  interest [options]          Anchor Money Market Interest contract functions
  terraswap [options]         terraswap, anchor related contract functions
  gov [options]               ANC Gov contract functions
  airdrop [options]           Anchor Airdrop contract functions [mainnet only]
  collector [options]         Anchor Collector contract functions
  investor-vesting [options]  Anchor Investor Vesting contract functions
  team-vesting [options]      Anchor Team Vesting contract functions
  staking [options]           Anchor Staking contract functions
  anc [options]               Anchor ANC token contract functions
  aust [options]              Anchor aUST token contract functions
  help [command]              display help for command

Query

USAGE: anchorcli query|q [options] [command]

Run a smart contract query function

Options:
  -h, --help               display help for command

Commands:
  basset-hub [options]     Anchor bAsset hub contract queries
  basset-reward [options]  Anchor bAsset reward contract queries
  basset-token [options]   Anchor bAsset token  contract queries
  liquidation [options]    Anchor Money Market Liquidation contract queries
  oracle [options]         Anchor Money Market Oracle contract queries
  market [options]         Anchor Money Market Market contract queries
  custody-bluna [options]  Anchor Money Market Custody contract queries
  overseer [options]       Anchor Money Market Overseer contract queries
  interest [options]       Anchor Money Market Interest contract queries
  terraswap [options]      Terraswap contract queries
  gov [options]            Anchor Gov contract queries
  airdrop [options]        Anchor Airdrop contract queries [mainnet only]
  collector [options]      Anchor Collector contract queries
  community [options]      Anchor Community contract queries
  distributor [options]    Anchor Distributor contract queries
  staking [options]        Anchor Staking contract queries
  anc [options]            Anchor ANC token contract queries
  aust [options]           Anchor aUST token contract queries
  help [command]           display help for command


Examples

This section illustrates the usage of anchorcli through some use cases. All examples assume you have a key in terrad keychain called test1.

Bond bLuna

The Anchor protocol requires providing collaterals to be able to borrow. bLuna (bonded Luna) is an accepted type of collateral. The following example illustrates how the user can attempt to bond Luna (in response to which the contract will issue bLuna for the user):

anchorcli x basset-hub bond --amount $BOND_AMOUNT --validator $VALIDATOR_ADDRESS --from test1 --gas auto --fees 100000uluna --b block

Query bLuna Balance

After bonding Luna, the user can get their bLuna balance using the following query:

anchorcli q basset-token balance --address $USER_ADDRESS

License

This software is licensed under the Apache 2.0 license. Read more about it here.

© 2021 Anchor Protocol

anchorcli's People

Contributors

alpac-4 avatar ggomma avatar kjessec avatar msntcs avatar r-amiri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

anchorcli's Issues

Adding bEth

The current version of anchorcli does not support beth functionalities. The following contract must be supported:

  • bEth reward contracts
  • bEth token contracts
  • bEth custody contracts

Needs specific explanation for 'distribution-params'

When I use following command I got an error due to it's invalid option

  • request
    $ anchorcli q overseer distribution-params

  • response
    Error: Request failed with status code 500
    at createError (/Users/ggomma/.nvm/versions/node/v12.15.0/lib/node_modules/@anchor-protocol/anchorcli/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/Users/ggomma/.nvm/versions/node/v12.15.0/lib/node_modules/@anchor-protocol/anchorcli/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/Users/ggomma/.nvm/versions/node/v12.15.0/lib/node_modules/@anchor-protocol/anchorcli/node_modules/axios/lib/adapters/http.js:260:11)
    at IncomingMessage.emit (events.js:228:7)
    at endReadableNT (_stream_readable.js:1185:12)
    at processTicksAndRejections (internal/process/task_queues.js:81:21) {
    config: {
    url: '/wasm/contracts/terra1tmnqgvg567ypvsvk6rwsga3srp7e3lg6u0elp8/store',
    method: 'get',
    headers: { Accept: 'application/json', 'User-Agent': 'axios/0.21.1' },
    params: { query_msg: '{"distribution_params":{}}' },
    baseURL: 'https://lcd.terra.dev',
    transformRequest: [ [Function: transformRequest] ],
    transformResponse: [ [Function: transformResponse] ],
    timeout: 0,
    adapter: [Function: httpAdapter],
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    validateStatus: [Function: validateStatus],
    data: undefined
    },
    request: ClientRequest {
    _events: [Object: null prototype] {
    socket: [Function],
    abort: [Function],
    aborted: [Function],
    connect: [Function],
    error: [Function],
    timeout: [Function],
    prefinish: [Function: requestOnPrefinish]
    },
    _eventsCount: 7,
    _maxListeners: undefined,
    outputData: [],
    outputSize: 0,
    writable: true,
    _last: true,
    chunkedEncoding: false,
    shouldKeepAlive: false,
    useChunkedEncodingByDefault: false,
    sendDate: false,
    _removedConnection: false,
    _removedContLen: false,
    _removedTE: false,
    _contentLength: 0,
    _hasBody: true,
    _trailer: '',
    finished: true,
    _headerSent: true,
    socket: TLSSocket {
    _tlsOptions: [Object],
    _secureEstablished: true,
    _securePending: false,
    _newSessionPending: false,
    _controlReleased: true,
    _SNICallback: null,
    servername: 'lcd.terra.dev',
    alpnProtocol: false,
    authorized: true,
    authorizationError: null,
    encrypted: true,
    _events: [Object: null prototype],
    _eventsCount: 9,
    connecting: false,
    _hadError: false,
    _parent: null,
    _host: 'lcd.terra.dev',
    _readableState: [ReadableState],
    readable: true,
    _maxListeners: undefined,
    _writableState: [WritableState],
    writable: false,
    allowHalfOpen: false,
    _sockname: null,
    _pendingData: null,
    _pendingEncoding: '',
    server: undefined,
    _server: null,
    ssl: [TLSWrap],
    _requestCert: true,
    _rejectUnauthorized: true,
    parser: null,
    _httpMessage: [Circular],
    [Symbol(res)]: [TLSWrap],
    [Symbol(asyncId)]: 3,
    [Symbol(kHandle)]: [TLSWrap],
    [Symbol(lastWriteQueueSize)]: 0,
    [Symbol(timeout)]: null,
    [Symbol(kBuffer)]: null,
    [Symbol(kBufferCb)]: null,
    [Symbol(kBufferGen)]: null,
    [Symbol(kBytesRead)]: 0,
    [Symbol(kBytesWritten)]: 0,
    [Symbol(connect-options)]: [Object]
    },
    connection: TLSSocket {
    _tlsOptions: [Object],
    _secureEstablished: true,
    _securePending: false,
    _newSessionPending: false,
    _controlReleased: true,
    _SNICallback: null,
    servername: 'lcd.terra.dev',
    alpnProtocol: false,
    authorized: true,
    authorizationError: null,
    encrypted: true,
    _events: [Object: null prototype],
    _eventsCount: 9,
    connecting: false,
    _hadError: false,
    _parent: null,
    _host: 'lcd.terra.dev',
    _readableState: [ReadableState],
    readable: true,
    _maxListeners: undefined,
    _writableState: [WritableState],
    writable: false,
    allowHalfOpen: false,
    _sockname: null,
    _pendingData: null,
    _pendingEncoding: '',
    server: undefined,
    _server: null,
    ssl: [TLSWrap],
    _requestCert: true,
    _rejectUnauthorized: true,
    parser: null,
    _httpMessage: [Circular],
    [Symbol(res)]: [TLSWrap],
    [Symbol(asyncId)]: 3,
    [Symbol(kHandle)]: [TLSWrap],
    [Symbol(lastWriteQueueSize)]: 0,
    [Symbol(timeout)]: null,
    [Symbol(kBuffer)]: null,
    [Symbol(kBufferCb)]: null,
    [Symbol(kBufferGen)]: null,
    [Symbol(kBytesRead)]: 0,
    [Symbol(kBytesWritten)]: 0,
    [Symbol(connect-options)]: [Object]
    },
    _header: 'GET /wasm/contracts/terra1tmnqgvg567ypvsvk6rwsga3srp7e3lg6u0elp8/store?query_msg=%7B%22distribution_params%22:%7B%7D%7D HTTP/1.1\r\n' +
    'Accept: application/json\r\n' +
    'User-Agent: axios/0.21.1\r\n' +
    'Host: lcd.terra.dev\r\n' +
    'Connection: close\r\n' +
    '\r\n',
    _onPendingData: [Function: noopPendingOutput],
    agent: Agent {
    _events: [Object: null prototype],
    _eventsCount: 1,
    _maxListeners: undefined,
    defaultPort: 443,
    protocol: 'https:',
    options: [Object],
    requests: {},
    sockets: [Object],
    freeSockets: {},
    keepAliveMsecs: 1000,
    keepAlive: false,
    maxSockets: Infinity,
    maxFreeSockets: 256,
    maxCachedSessions: 100,
    _sessionCache: [Object]
    },
    socketPath: undefined,
    method: 'GET',
    insecureHTTPParser: undefined,
    path: '/wasm/contracts/terra1tmnqgvg567ypvsvk6rwsga3srp7e3lg6u0elp8/store?query_msg=%7B%22distribution_params%22:%7B%7D%7D',
    _ended: true,
    res: IncomingMessage {
    _readableState: [ReadableState],
    readable: false,
    _events: [Object: null prototype],
    _eventsCount: 3,
    _maxListeners: undefined,
    socket: [TLSSocket],
    connection: [TLSSocket],
    httpVersionMajor: 1,
    httpVersionMinor: 1,
    httpVersion: '1.1',
    complete: true,
    headers: [Object],
    rawHeaders: [Array],
    trailers: {},
    rawTrailers: [],
    aborted: false,
    upgrade: false,
    url: '',
    method: null,
    statusCode: 500,
    statusMessage: 'Internal Server Error',
    client: [TLSSocket],
    _consuming: false,
    _dumped: false,
    req: [Circular],
    responseUrl: 'https://lcd.terra.dev/wasm/contracts/terra1tmnqgvg567ypvsvk6rwsga3srp7e3lg6u0elp8/store?query_msg=%7B%22distribution_params%22:%7B%7D%7D',
    redirects: []
    },
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    _redirectable: Writable {
    _writableState: [WritableState],
    writable: true,
    _events: [Object: null prototype],
    _eventsCount: 2,
    _maxListeners: undefined,
    _options: [Object],
    _ended: true,
    _ending: true,
    _redirectCount: 0,
    _redirects: [],
    _requestBodyLength: 0,
    _requestBodyBuffers: [],
    _onNativeResponse: [Function],
    _currentRequest: [Circular],
    _currentUrl: 'https://lcd.terra.dev/wasm/contracts/terra1tmnqgvg567ypvsvk6rwsga3srp7e3lg6u0elp8/store?query_msg=%7B%22distribution_params%22:%7B%7D%7D'
    },
    [Symbol(kNeedDrain)]: false,
    [Symbol(isCorked)]: false,
    [Symbol(kOutHeaders)]: [Object: null prototype] {
    accept: [Array],
    'user-agent': [Array],
    host: [Array]
    }
    },
    response: {
    status: 500,
    statusText: 'Internal Server Error',
    headers: {
    date: 'Wed, 21 Apr 2021 04:16:57 GMT',
    'content-type': 'application/json',
    'content-length': '217',
    connection: 'close',
    'set-cookie': [Array],
    'access-control-allow-origin': '*',
    'access-control-allow-methods': 'GET, POST, OPTIONS',
    'access-control-allow-headers': 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range',
    'access-control-expose-headers': 'Content-Length,Content-Range',
    'cf-cache-status': 'DYNAMIC',
    'cf-request-id': '09943e5125000012d6a0bb0000000001',
    'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
    server: 'cloudflare',
    'cf-ray': '6433ccc83e1b12d6-ICN'
    },
    config: {
    url: '/wasm/contracts/terra1tmnqgvg567ypvsvk6rwsga3srp7e3lg6u0elp8/store',
    method: 'get',
    headers: [Object],
    params: [Object],
    baseURL: 'https://lcd.terra.dev',
    transformRequest: [Array],
    transformResponse: [Array],
    timeout: 0,
    adapter: [Function: httpAdapter],
    xsrfCookieName: 'XSRF-TOKEN',
    xsrfHeaderName: 'X-XSRF-TOKEN',
    maxContentLength: -1,
    maxBodyLength: -1,
    validateStatus: [Function: validateStatus],
    data: undefined
    },
    request: ClientRequest {
    _events: [Object: null prototype],
    _eventsCount: 7,
    _maxListeners: undefined,
    outputData: [],
    outputSize: 0,
    writable: true,
    _last: true,
    chunkedEncoding: false,
    shouldKeepAlive: false,
    useChunkedEncodingByDefault: false,
    sendDate: false,
    _removedConnection: false,
    _removedContLen: false,
    _removedTE: false,
    _contentLength: 0,
    _hasBody: true,
    _trailer: '',
    finished: true,
    _headerSent: true,
    socket: [TLSSocket],
    connection: [TLSSocket],
    _header: 'GET /wasm/contracts/terra1tmnqgvg567ypvsvk6rwsga3srp7e3lg6u0elp8/store?query_msg=%7B%22distribution_params%22:%7B%7D%7D HTTP/1.1\r\n' +
    'Accept: application/json\r\n' +
    'User-Agent: axios/0.21.1\r\n' +
    'Host: lcd.terra.dev\r\n' +
    'Connection: close\r\n' +
    '\r\n',
    _onPendingData: [Function: noopPendingOutput],
    agent: [Agent],
    socketPath: undefined,
    method: 'GET',
    insecureHTTPParser: undefined,
    path: '/wasm/contracts/terra1tmnqgvg567ypvsvk6rwsga3srp7e3lg6u0elp8/store?query_msg=%7B%22distribution_params%22:%7B%7D%7D',
    _ended: true,
    res: [IncomingMessage],
    aborted: false,
    timeoutCb: null,
    upgradeOrConnect: false,
    parser: null,
    maxHeadersCount: null,
    _redirectable: [Writable],
    [Symbol(kNeedDrain)]: false,
    [Symbol(isCorked)]: false,
    [Symbol(kOutHeaders)]: [Object: null prototype]
    },
    data: {
    error: 'contract query failed: parsing moneymarket::overseer::QueryMsg: unknown variant distribution_params, expected one of config, epoch_state, whitelist, collaterals, all_collaterals, borrow_limit'
    }
    },
    isAxiosError: true,
    toJSON: [Function: toJSON]
    }

If this error occurs due to lack of anchorcli help text.

Liquidation contract submit bid requires coin as "uusd" but processes the value in "usd".

When submitting a bit to the liquidation contract, the coin denomination must be uusd:

$ ANCHORCLI_NETWORK=tequila-0004 anchorcli x \
>   liquidation submit-bid \
>   --collateral-token terra1u0t35drzyy0mujj8rkdyzhe264uls4ug3wdp3x \
>   --premium-rate 0.25 \
>   --coin 100usd \
>   --from playground \
>   --gas auto \
>   --fees=1000000uusd
 ERROR  Error: invalid coin 'usd', MUST be uusd; use --verbose for more details

But when uusd is specified, the number is parsed as usd equivalent. In the example below, --coin 100uusd becomes 100000000uusd:

$ ANCHORCLI_NETWORK=tequila-0004 anchorcli x \
>   liquidation submit-bid \
>   --collateral-token terra1u0t35drzyy0mujj8rkdyzhe264uls4ug3wdp3x \
>   --premium-rate 0.25 \
>   --coin 100uusd \
>   --from playground \
>   --gas auto \
>   --fees=1000000uusd
chainId: tequila-0004
msg:
  type: wasm/MsgExecuteContract
  value:
    sender: SENDER_ADDRESS
    contract: terra16vc4v9hhntswzkuunqhncs9yy30mqql3gxlqfe
    execute_msg:
      submit_bid:
        collateral_token: terra1u0t35drzyy0mujj8rkdyzhe264uls4ug3wdp3x
        premium_rate: "0.250000000000000000"
    coins:
      - denom: uusd
        amount: "100000000"
fee:
  gas: "138288"
  amount:
    - denom: uusd
      amount: "1000000"
memo: ""

Or perhaps I'm missing something?

Columbus 5 Support

Anchorcli needs to support Columbus 5 contracts and functionality, the following issues need to be addressed:

  • Update terra.js dependency and its required changes.
  • Update terracli dependency to terrad.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.