UNPKG

@algofi/lend

Version:

The official JavaScript SDK for the Algofi Lending Protocol

66 lines (65 loc) 4.22 kB
import { SuggestedParams } from "algosdk"; import { TransactionGroup } from "../utils"; /** * Returns a transaction group object representing a staking contract opt in * group transaction. The sender and storage account opt in to the staking application * and the storage account is rekeyed to the manager account address, rendering it * unable to be transacted against by the sender and therefore immutable. * * @param managerAppId - id of the manager application * @param marketAppId - id of the market application * @param sender - account address of the sender * @param storageAddress - address of the storage account * @param suggestedParams - suggested transaction params * @returns transaction group object representing a manger opt in group transaction */ export declare function prepareStakingContractOptinTransactions(managerAppId: number, marketAppId: number, sender: string, storageAddress: string, suggestedParams: SuggestedParams): TransactionGroup; /** * Returns a transaction group object representing a stake * transaction against the algofi protocol. The sender sends assets to the * staking account and is credited with a stake. * * @param sender - account address for the sender * @param suggestedParams - suggested transaction params * @param storageAccount - storage account address for sender * @param amount - amount of asset to supply for minting collateral * @param managerAppId - id of the manager application * @param marketAppId - id of the asset market application * @param marketAddress - account address for the market application * @param oracleAppId - id of the aset market application * @param assetId - asset id of the asset being supplied, defaults to algo * @returns transaction group object representing a mint to collateral group transaction */ export declare function prepareStakeTransactions(sender: string, suggestedParams: SuggestedParams, storageAccount: string, amount: number, managerAppId: number, marketAppId: number, marketAddress: string, oracleAppId: number, assetId?: number): TransactionGroup; /** * Returns a :class:`TransactionGroup` object representing a remove stake * group transaction against the algofi protocol. The sender requests to remove stake * from a stake acount and if successful, the stake is removed. * * @param sender - account addres for the sender * @param suggestedParams - suggested transaction params * @param storageAccount - storage account address for sender * @param amount - amount of collateral to remove from the market * @param managerAppId - id of the manager application * @param marketAppId - id of the market application of the collateral * @param oracleAppId - id of the oracle application of the collateral * @param assetId - id of the asset to unstake * @returns transaction group object representing a unstake group transaction */ export declare function prepareUnstakeTransactions(sender: string, suggestedParams: SuggestedParams, storageAccount: string, amount: number, managerAppId: number, marketAppId: number, oracleAppId: number, assetId?: number): TransactionGroup; /** * Returns a transaction group object representing a claim rewards * underlying group transaction against the algofi protocol. The sender requests * to claim rewards from the manager acount. If not, the account sends * back the user the amount of asset underlying their posted collateral. * * @param sender - account address for the sender * @param suggestedParams - suggested transaction params * @param storageAccount - astorage account address for sender * @param managerAppId - id of the manager application * @param marketAppId - id of the market application of the collateral * @param oracleAppId - id of the oracle application * @param foreignAssets - list of reward assets in the staking contract * @returns transaction group obejct representing a claim rewards transaction */ export declare function prepareClaimStakingRewardsTransactions(sender: string, suggestedParams: SuggestedParams, storageAccount: string, managerAppId: number, marketAppId: number, oracleAppId: number, foreignAssets: number[]): TransactionGroup;