Aquarius Documentation
  • Aquarius Loan Documentation
  • Getting Started
    • Networks
    • Protocol Math
      • aToken and Underlying Decimals
      • Interpreting Exchange Rates
      • Calculating Accrued Interest
      • Calculating the APY Using Rate Per Block
    • Gas Costs
  • ATokens
    • Mint
    • Redeem
    • Redeem Underlying
    • Borrow
    • Repay Borrow
    • Repay Borrow Behalf
    • Transfer
    • Liquidate Borrow
    • Key Events
    • Error Codes
    • Failure Info
    • Exchange Rate
    • Get Cash
    • Total Borrow
    • Borrow Balance
    • Borrow Rate
    • Total Supply
    • Underlying Balance
    • Supply Rate
    • Total Reserves
    • Reserve Factor
  • Comptroller
    • Enter Markets
    • Exit Market
    • Get Assets In
    • Collateral Factor
    • Get Account Liquidity
    • Close Factor
    • Liquidation Incentive
    • Key Events
    • Error Codes
    • Failure Info
    • ARS Distribution Speeds
    • Claim ARS
    • Market Metadata
  • Governance
    • Delegate
    • Delegate By Signature
    • Get Current Votes
    • Get Prior Votes
    • Key Events
    • Governor Bravo
    • Quorum Votes
    • Proposal Threshold
    • Proposal Max Operations
    • Voting Delay
    • Voting Period
    • Propose
    • Queue
    • Execute
    • Cancel
    • Get Actions
    • Get Receipt
    • State
    • Cast Vote
    • Cast Vote With Reason
    • Cast Vote By Signature
    • Timelock
    • Pause Guardian
  • Reward Vesting and Staking
    • Reward Vesting
    • ARS Staking
    • Explainer Video
  • LP Staking
    • LP Utility
    • LP Staking Options
    • Zapping LP
    • Maintaining Eligibility Status
    • Explainer Video
  • API
    • ATokenService
      • GET: /atoken
    • MarketHistoryService
      • GET: /market_history/graph
    • ProposalService
      • GET: /proposals
      • GET: /proposals/:id
      • GET: /proposals/statistics
    • VoterService
      • GET: /voters/accounts
      • GET: /voters/accounts/:address
      • GET: /voters/history/:address
      • GET: /voters/:proposalId
    • GovernanceService
      • GET: /governance/aquarius
      • GET: /governance/proposals
      • GET: /governance/proposal_vote_receipts
      • GET: /governance/accounts
    • Shared Data Types
  • Aquarius.js
    • Aquarius Constructor
    • API Methods
      • Account
      • aToken
      • Market History
      • Governance
    • aToken Methods
      • Supply
      • Redeem
      • Borrow
      • Repay Borrow
    • ARS Methods
      • To Checksum Address
      • Get ARS Balance
      • Get ARS Accrued
      • Claim ARS
      • Delegate
      • Delegate By Sig
      • Create Delegate Signature
    • Comptroller Methods
      • Enter Markets
      • Exit Market
    • Ethereum Methods
      • Read
      • Trx
      • Get Balance
    • Governance Methods
      • Cast Vote
      • Cast Vote By Sig
      • Create Vote Signature
    • Price Feed Methods
      • Get Price
    • Utility Methods
      • Get Address
      • Get ABI
      • Get Network Name With Chain ID
  • Security
    • Formal Verification
    • Bug Bounty Program
  • Terms of Service
Powered by GitBook
On this page
  1. Aquarius.js
  2. Ethereum Methods

Read

This is a generic method for invoking JSON RPC's eth_call with Ethers.js. Use this method to execute a smart contract's constant or non-constant member without using gas. This is a read-only method intended to read a value or test a transaction for valid parameters. It does not create a transaction on the block chain.

  • address (string) The Ethereum address the transaction is directed to.

  • method (string) The smart contract member in which to invoke.

  • [parameters] (any[]) Parameters of the method to invoke.

  • [options] (CallOptions) Options to set for eth_call, optional ABI (as JSON object), and Ethers.js method overrides. The ABI can be a string of the single intended method, an array of many methods, or a JSON object of the ABI generated by a Solidity compiler.

  • RETURN (Promise<any>) Return value of the invoked smart contract member or an error object if the call failed.

const sEthAddress = Aquarius.util.getAddress(Aquarius.aBNB);

(async function() {

  const srpb = await Aquarius.eth.read(
    sEthAddress,
    'function supplyRatePerBlock() returns (uint256)',
    // [], // [optional] parameters
    // {}  // [optional] call options, provider, network, plus Ethers.js "overrides"
  );

  console.log('aBNB market supply rate per block:', srpb.toString());

})().catch(console.error);
PreviousEthereum MethodsNextTrx

Last updated 1 year ago