@anchor-protocol/anchor-earn
to your JavaScript project's package.json
as dependencies using preferred package manager:AnchorEarn({chain, network, privateKey?, MnemonicKey?, address?})
AnchorEarn
creates an instance of the AnchorEarn
object, used as the entry point to the Anchor Earn SDK.Account
instance.AnchorEarn
instance should be created by the pre-created account's address.CHAINS.TERRA
(Terra blockchain) is supported.privateKey
(Buffer | any) Optionalmnemonic
(string | any) Optionaladdress
(string) Optional customSigner
or customBroadcaster
.Account(chain)
Account
object generates a new blockchain account.Account
instance contains the information for the newly created account.privateKey
and mnemonic
constitute as your access key to your account, including the control of your assets.accAddress
(AccAddress)publicKey
(string)privateKey
(Buffer)mnemonic
(string)MnemonicKey({mnemonic})
MnemonicKey
object is borrowed from Terra.js, allowing integrators to access it without any dependencies on Terra.js.mnemonic
(string) RequiredanchorEarn.deposit({currency, amount})
amount
(string) RequiredCustomBroadcaster
(callback function => string) Optionalstring
format.Loggable
(callback function) Optional anchorEarn.deposit
will return a Promise
which resolves with either a OperationError
or TxOutput
object which implements the Output
interface.anchorEarn.withdraw({currency, amount})
amount
(string) RequiredCustomBroadcaster
(callback function => string) Optionalstring
format.Loggable
(callback function) Optional anchorEarn.withdraw
will return a Promise
which resolves with either a OperationError
or TxOutput
object which implements the Output
interface.anchorEarn.send({currency, recipient, amount})
anchorEarn.send
to send tokens (stablecoins or their aTerra counterpart) to a different account.recipient
(string) Requiredamount
(string) RequiredCustomSigner
(callback function => StdTx) OptionalCustomBroadcaster
(callback function => string) Optionalstring
format.Loggable
(callback function) Optional anchorEarn.send
will return a Promise
which resolves with either a OperationError
or TxOutput
object which implements the Output
interface.anchorEarn.balance({currencies})
anchorEarn.market({currencies})
CHAINS
enumerated type specifies blockchains that are supported by Anchor Earn. CHAINS.TERRA
NETWORKS
enumerated type specifies the network type to be used. COLUMBUS_5
columbus-5
BOMBAY_12
bombay-12
uusd
uusd
UNSUCCESSFUL
as the request encountered an error.deposit
: request is a transaction that deposits stablecoins to Anchor.withdraw
: request is a transaction that withdraws stablecoins from Anchor.send
: request is a transaction that sends tokens to a different account.error_msg
(string)chain
(string)network
(string)STATUS.INPROGRESS
: request is in flight.STATUS.SUCESSFUL
: request was successfully processed.STATUS.UNSUCESSFUL
: request failed.deposit
: request is a transaction that deposits stablecoins to Anchor.withdraw
: request is a transaction that withdraws stablecoins from Anchor.send
: request is a transaction that sends tokens to a different account.currency
(string)amount
(string)currency
tokens utilized in the request.txFee
(string)deductedTax
(string)INPROGRESS
SUCCESSFUL
UNSUCCESSFUL
DEPOSIT
WITHDRAW
SEND
chain
(string)height
(number)timestamp
(Date)txHash
(string)BalanceOutput
namespace represents your balance. chain
(string)
Blockchain that the account resides on.network
(string)height
(number)timestamp
(Date)address
(string)total_account_balance_in_ust
(string)total_deposit_balance_in_ust
(string)currency
(string)account_balance
(string)deposit_balance
(string)chain
(string)network
(string)height
(number)timestamp
(Date)currency
(string)liquidity
(string)APY
(string)customSigner
should throw an error if any step results in failures. T
(Argument)K
(Expected Output)customBroadcaster
should throw an error if any step results in failures. T
(Argument)K
(Expected Output)K
(Expected Output)