API Reference

Session object

Attributes


sessionId string
Unique identifier for the session.


orderId string
Unique identifier for the transaction.


successURL string
Upon completing transaction in the native browser, the user will be redirected to this URL to return to your app.


cancelURL string
Upon cancelling transaction in the native browser, the user will be redirected to this URL to return to your app.


userEmail string
Email address of the ThirdFi user.


type string, value is "deposit", "withdraw", "dex_swap", "dex_liquidity", "aave_supply", "venus_supply", "aave_withdraw", "venus_withdraw", "aave_borrow", "venus_borrow", "aave_repay", "venus_repay", "aave_repayAndWithdraw", "venus_repayAndWithdraw", "aave_claimRewards", "venus_claimRewards", "aave_swapBorrowRateMode"
API action type of the transaction.


status string, value is "open", "expired", "completed"
Session status of the transaction.


livemode boolean
Has the value true if the object exists in live mode or the value false if the object exists in test mode.


createdDate string
Date of transaction session created in ISO-8601 format.


expiredDate string
Date of transaction session is going to expire in ISO-8601 format.


amount string
Transaction amount of the session. The amount unit is used as shares (token) in product.


publicSessionId string
Session ID used to retrieve the session details.


chainId number
Unique identifier of blockchain network. See blockchain list for more information.


product object
Product details in the transaction.

Child attributes

    id number
Unique identifier of the product.


    shortDesc string
Description of the product.


    name string
Name of the product.


    symbol string
Symbol of the product.


transactionHashes array in string
Transaction hash of the transactions executed via the session.


value number
USD value of the transaction executed.


url string
Gateway URL to complete the transaction. It is a webview used for transaction execution in native browser.


additionalParams object
Additional details in the session.

Child attributes

    chainId number
Unique identifier of blockchain network. See blockchain list for more information. (This is used for dex_swap and dex_liquidity session)


    isNative string
The token used in this transaction session is either a native token of the blockchain network or not. (This is used for dex_swap and dex_liquidity session)


    exactIn string
Determine either token input or token output is used for amount swap in calculating the amount output. (This is used for dex_swap session)


    pair string
Symbol of pair used for manage liquidity. (This is used for dex_liquidity session)


    amount0 string
Amount of pool token0. (This is used for dex_liquidity session)


    amount1 string
Amount of pool token1. (This is used for dex_liquidity session)


    addLiquidity boolean
Indicate whether to add or remove liquidity. (This is used for dex_liquidity session)


    version number
Indicate the AAVE version. 2 or 3 are supported. (This is used for aave_supply, aave_withdraw, aave_borrow, aave_repay, aave_repayAndWithdraw, aave_claimRewards, aave_swapBorrowRateMode, aave_supplyAndBorrow session)


    asset string
Smart contract address of the token used. (This is used for aave_supply, venus_supply, aave_withdraw, venus_withdraw, aave_borrow, venus_borrow, aave_repay, venus_repay, aave_swapBorrowRateMode session)


    decimals number
Decimal of the token used. (This is used for aave_supply, venus_supply, aave_withdraw, venus_withdraw, aave_borrow, venus_borrow, aave_repay, venus_repay session)


    symbol string
Symbol of the token used. (This is used for aave_supply, venus_supply, aave_withdraw, aave_borrow, venus_borrow, aave_repay, venus_repay, aave_swapBorrowRateMode session)


    amount number
Amount of the token used. (This is used for aave_supply, venus_supply, aave_withdraw, aave_borrow, venus_borrow, aave_repay, venus_repay session)


    price object
Details of the price. (This is used for aave_supply, venus_supply, aave_withdraw, venus_withdraw, aave_borrow, venus_borrow, aave_repay, venus_repay, aave_repayAndWithdraw, venus_repayAndWithdraw, venus_claimRewards, aave_supplyAndBorrow session)

Child attributes

        assets array in string
Smart contract address of the token used.


        prices array in number
Price in USD of the token used.


        decimals array in number
Decimal of the token used. (This is used for venus_claimRewards session)


    vTokenAddress string
Smart contract address of the vToken used. (This is used for venus_supply, venus_withdraw, venus_borrow, venus_repay session)


    vTokenDecimals number
Decimal of the vToken used. (This is used for venus_supply, venus_withdraw session)


    comptrollerAddress string
Smart contract address of the comptroller. (This is used for venus_supply session)


    aTokenAddress string
Smart contract address of the aToken used. (This is used for aave_withdraw session)


    vTokenSymbol string
Symbol of the vToken used. (This is used for venus_withdraw session)


    vTokenAmount number
Amount of the vToken used. (This is used for venus_withdraw session)


    interestRateMode number
Interest rate mode. 1 for stable rate, 2 for variable rate. (This is used for aave_borrow, aave_repay session)


    stableDebtTokenAddress string
Address of the stable debt token contract. (This is used for aave_borrow, aave_repay, aave_swapBorrowRateMode session)


    variableDebtTokenAddress string
Address of the variable debt token contract. (This is used for aave_borrow, aave_repay, aave_swapBorrowRateMode session)


    repayDecimals number
Decimal of the repay token asset. (This is used for aave_repayAndWithdraw, venus_repayAndWithdraw session)


    repayAsset string
Address of the repay token asset. (This is used for aave_repayAndWithdraw, venus_repayAndWithdraw session)


    repaySymbol string
Symbol of the repay token asset. (This is used for aave_repayAndWithdraw, venus_repayAndWithdraw session)


    repayAmount number
Amount of the repay token asset. (This is used for aave_repayAndWithdraw, venus_repayAndWithdraw session)


    repayInterestRateMode number
Repay interest rate mode. 1 for stable rate, 2 for variable rate. (This is used for aave_repayAndWithdraw session)


    repayStableDebtTokenAddress string
Address of the repay stable debt token contract. (This is used for aave_repayAndWithdraw session)


    repayVariableDebtTokenAddress string
Address of the repay variable debt token contract. (This is used for aave_repayAndWithdraw session)


    withdrawalAsset string
Address of the token withdraw. (This is used for aave_repayAndWithdraw, venus_repayAndWithdraw session)


    withdrawalDecimals number
Decimal of the token withdraw. (This is used for aave_repayAndWithdraw session)


    withdrawalSymbol string
Symbol of the token withdraw. (This is used for aave_repayAndWithdraw session)


    withdrawalAmount number
Amount of the token withdraw. (This is used for aave_repayAndWithdraw session)


    withdrawalATokenAddress string
Address of the aToken withdraw. (This is used for aave_repayAndWithdraw session)


    repayVTokenAddress string
Address of the repay vToken contract. (This is used for venus_repayAndWithdraw session)


    withdrawaldecimals number
Decimal of the token withdraw. (This is used for venus_repayAndWithdraw session)


    withdrawalVTokenAddress string
Address of the vToken withdraw. (This is used for venus_repayAndWithdraw session)


    withdrawalVTokenDecimals number
Decimal of the vToken withdraw. (This is used for venus_repayAndWithdraw session)


    withdrawalVTokenSymbol string
Symbol of the vToken withdraw. (This is used for venus_repayAndWithdraw session)


    withdrawalVTokenAmount number
Amount of the vToken withdraw. (This is used for venus_repayAndWithdraw session)


    rateMode number
Interest rate mode. 1 for stable rate, 2 for variable rate. (This is used for aave_swapBorrowRateMode session)


    supplyAsset string
Address of the token supplied. (This is used for aave_supplyAndBorrow session)


    supplyDecimals number
Decimal of the token supplied. (This is used for aave_supplyAndBorrow session)


    supplySymbol string
Symbol of the token supplied. (This is used for aave_supplyAndBorrow session)


    supplyAmount number
Amount of the token supplied. (This is used for aave_supplyAndBorrow session)


    borrowAsset string
Amount of the token borrowed. (This is used for aave_supplyAndBorrow session)


    borrowDecimals number
Decimal of the token borrowed. (This is used for aave_supplyAndBorrow session)


    borrowSymbol string
Symbol of the token borrowed. (This is used for aave_supplyAndBorrow session)


    borrowAmount number
Amount of the token borrowed. (This is used for aave_supplyAndBorrow session)


    borrowInterestRateMode number
Borrow interest rate mode. 1 for stable rate, 2 for variable rate. (This is used for aave_supplyAndBorrow session)


    borrowStableDebtTokenAddress string
Address of stable debt token contract. (This is used for aave_supplyAndBorrow session)


    borrowVariableDebtTokenAddress string
Address of variable debt token contract. (This is used for aave_supplyAndBorrow session)


transactions array of objects
Transaction details in this transaction session. It will be shown when retrieving the session details. Multiple blockchain transactions are carried out in bulk at the same session.

Child attributes

    id number
Unique identifier of transaction.


    createAt string
Date of transaction created in ISO-8601 format.


    lastUpdatedAt string
Date of last updated in the transaction in ISO-8601 format.


    timestamp string
Transaction created in the timestamp milliseconds unit.


    lastUpdatedBy string
Person to update the transaction.


    actionType string, value is "DEPOSIT", "WITHDRAW", "APPROVE", "SWAP"
Action Type of the transaction.