algod client
indexer client
indexer client
account address of user
specified chain we want the client to run on
Returns the active asset ids
list of active asset ids
Returns a dictionary of the asset objects for each active market
dictionary of asset objects
Returns the active bank asset ids
list of active bank asset ids
Returns the list of the active market addresses
list of active market addresses
Returns the list of the active market app ids
list of active market app ids
Returns a dictionary of active markets by symbol
markets dictionary
Returns the list of active oracle app ids
list of acdtive oracle app ids
Returns the list of symbols of the active assets
list of symbols for active assets
Returns the asset object for the requested symbol
symbol of the asset
asset object with the provided symbol
Initializes the transactions parameters for the client.
default parameters for transactions
Returns the manager object representing the manager of this client.
manager
Returns the market object for the given symbol.
market symbol
market
Returns the max opt in market application ids
list of max opt in market application ids
Returns a dictionary of dollarized float prices of the assets pulled from their oracles
dictionary of int prices
Returns a dictionary of raw oracle prices of the active assets pulled from their oracles
dictionary of int prices
Returns a staking contract with the given title
staking contract name
staking contract with the given name
Returns a ditionary of all staking contracts
staking contracts dictionary
Returns a list of storage accounts for the given manager app id
name of staking contract
list of storage accounts
Returns a dictionary witht he lending market state for a given storage address.
address to get info for; if null will use address supplied when creating client
dictionary that represents the storage state of a user
Returns amount of asset in user's balance with asset id assetId.
id of the asset,
address to get info for
amount of asset that the user has
Returns a dictionary of user balances by assetid.
address to get info for
amount of asset
Returns a dictionary of information about the user.
address to get info for
a dictionary of information about the user
Returns a dictionary with the staking contract state for the named staking contract and selected address
name of the staking contract to query
address to get info for; if null will use address supplied when creating client
state representing staking contract info of user
Returns a dictionary with the lending market state for a given address (must be opted in).
address to get info for; if null, will use address supplied when creating client
dictionary that represents the state of user
Returns a boolean if the user address is opted into an application with id appId.
id of the application
address to get information for
boolean if user is opted into application with id appId
Returns a boolean if the user is opted into an asset with id assetId.
id of the asset
address to get info for
boolean if user is opted into an asset
Returns an add collateral transaction group
symbol to add collateral with
amount of collateral to add
address to send add collateral transaction group from; defaults to clint user address
Returns a borrow transaction group
symbol to borrow
amount to borrow
address to send borrow transaction group from; defaults to client user address
borrow transaction group
Returns a burn transaction group
symbol to burn
amount of bAsset to burn
address to send burn transaction group from; defaults to client user address
burn transaction group
Returns a claim rewards transaction group
address to send claim rewards from; defaults to client user address
claim rewards transaction group
Returns a staking contract claim rewards transaction group
name of staking contract to unstake on
address to send claim rewards transaction group from; defaults to client user address
unstake transaction group
Returns a liquidate transaction group
storage address to liquidate
symbol to repay
amount to repay
symbol to seize collateral from
address to send liquidate transaction group from; defaults to client user address
liquidate transaction group
Returns a mint to collateral transaction group
symbol to mint
amount to mint to collateral
address to send mint to collateral transaction group from; defaults to client user address
mint to collateral transaction group
Returns a mint transaction group
symbol to mint
amount of mint
address to send mint transacdtion group from; defaults to client user address
mint transaction group
Returns an opt in transaction group
storage address to fund and rekey
address to send add collateral transaction group from; defulats to client user address
Returns a remove collateral transaction group
symbol to remove collateral from
amount of collateral to remove
address to send remove collateral transaction group from; defaults to client user address
remove collateral transaction group
Returns a remove collateral undrlying transaction group
symbol to remove collateral from
amount of collateral to remove
address to send remove collateral underlying transaction group from; defaults to client user address
remove collateral underlying transaction group
Returns a repay borrow transaction group
symbol to repay
amount of repay
address to send repay borrow transaction group from; defaults to client user address
Returns a staking contract stake transaction group
name of staking contract to stake on
amount of stake
address to send stake transaction group from; defaults to client user address
stake transacdtion group
Returns a staking contract optin transaction group
name of staking contract to opt into
storage address to fund and rekey
address to create optin transaction group for; defaults to client user address
staking contract opt in transaction group
Returns a staking contract unstake transactiong group
name of staking contract to unstake on
amount of unstake
address to send unstake transaction group from; defaults to client user address
unstake transaction group
Submits and waits for a transaction group to finish if specified
signed transaction group
boolean to tell whether you want to wait or not
a dictionary with the txid of the group transaction
This is the function that should be called when creating a new client. You pass everything you would to the constructor, but to this function instead and this returns the new and created client.
//Correct way to instantiate new client
const client = await Client.init(algodClient, indexerClient, historicalIndexerClient, userAddress, chain)
//Incorrect way to instantiate new client
const client = new Client(algodClient, indexerClient, historicalIndexerClient, userAddress, chain)
algod client
indexer client
indexer client
account address of user
specified chain we want the client to run on
an instance of the client class fully constructed
Generated using TypeDoc
This is the constructor for the Client class.
Note, do not call this to create a new client. Instead call the static method init as there are asynchronous set up steps in creating an client and a constructor can only return an instance of the class and not a promise.
Example