Basic

Deposit & Withdraw from DSA

Instadapp SDK contains several connectors that are used for basic functions; such as depositing and withdrawing tokens DSA. Those connectors are described below:

Deposit

This is the basic connector for deposit

spells.add({
  connector: "basic",
  method: "deposit",
  args: [token, amount, getId, setId]
});

Parameter

Type

Description

token

address

The token address to deposit

amount

number

The amount of tokens to deposit. (use -1 or 'dsa.maxValue' to deposit entire available balance)

getId

number

ID fetches the amount of token to deposit

setId

number

ID stores the amount of token deposit

You can always also deposit by sending tokens directly to the DSA address. The DSA will accept ERC-20 tokens directly into its address.

The Instadapp GUI only displays DeFi related assets. Please also note that some exchanges do not allow withdrawals to smart contracts.

Withdraw

This is the basic connector for withdrawals

spells.add({
  connector: "basic",
  method: "withdraw",
  args: [token, amount, to, getId, setId]
});

Parameter

Type

Description

token

address

The token address to withdraw

amount

number

The amount of tokens to withdraw (use -1 or 'dsa.maxValue' to withdraw the entire available balance)

to

address

The 'to' address to withdraw. (DSA can only withdraw tokens to Authorities)

getId

number

ID fetches the amount of token to withdraw

setId

number

ID stores the amount of token withdraw

Withdrawals from the DSA can only be completed from and to authorities of the DSA; if you would like to withdraw to an second account you can make the second account an additional authority to the DSA.

Last updated