Direct Deposits
External transactions to the privacy pool
Direct deposits allow other dApps and partners to make direct zkBob deposits by knowing the receiver's zk-address, without dealing with zk-cryptography. This greatly simplifies integration with other dApps and smart contracts
Sending Direct Deposit
You can deposit to your account via the direct deposit scheme.
Direct deposit processing can take up to 20 minutes.
Parameters
type
- direct deposit type (token or native)
For DD with DirectDepositType.Token
type you must ensure the direct deposit contract address has the allowance to spend your tokens. Before sending the direct deposit you must approve the required amount of tokens (do not forget the fee).
DirectDepositType.Native
is only available for pools which serve native wrapped tokens like WETH. Such pools must have isNative = true
in the Client Configuration
fromAddress
- the 0x
-address which will be used to deposit funds
amount
- token amount to deposit into an account (in pool dimension)
The direct deposit fee will be fetched and added to the amount
under the hood. Do not include it yourself.
sendTxCallback
- a callback with transaction data (of type PreparedTransaction
) which should be sent by the user. After sending the user should return a transaction hash.
blockNumber
- the client will wait until the internal provider becomes synced with that block before input account balance validation. The waiting interval is hardcoded to 60 seconds. If the provider doesn't become synced within that interval the transaction will be sent anyway.
Example
Getting Pending Direct Deposits
Until sent direct deposits are processed and included in the privacy pool you can fetch the queued DD transactions belonging to your account.
Direct deposit processing can take up to 20 minutes.
Returns
Promise
returns array of pending DirectDeposits.
Example
Getting Direct Deposit Fee
Use the associated accountless mode routine directDepositFee
Getting Direct Deposit Contract
The DD contract is a part of the privacy pool solution - so each pool has own direct deposit queue contract.
Returns
Promise
returns the direct deposit queue contract address.
Example
Last updated