balance
useDeposit
returns a balance
field which is equal to the current token balance of the wallet (ie balance not deposited). This balance
will refresh by fetching from the chain again if token
changes.
useDeposit
also has a fetchBalance()
method to get the wallet balance. This can be used in a token list, and can be used to trigger a balance fetch directly.
allowance
token
is changed.
approve
approve
function to authorize an allowance of the token that can be used by the Orderly smart contract. If the quantity
is not sent, the default will be ethers.MaxUint256
.
setQuantity
setQuantity
function is used to set the deposit quantity. This will trigger a recalculation of the deposit fee.
setQuantity
function is a React state dispatch function and must be called in a
rendering tick before the function call to deposit
happens.depositFee
depositFee
field is the fee that needs to be paid when depositing. This will refresh if the quantity
is updated.
deposit()
deposit
function from the response of useDeposit
to initiate a deposit.