Overview of deposit and withdrawal flow
Determine necessary deposit fee in WEI
Example code
Call the `deposit` function of the smart contract
Name | Type | Required | Description |
---|---|---|---|
accountId | bytes | Y | The account id of the user in bytes. |
brokerHash | bytes | Y | The keccak256 hash of the builder id (eg “woofi_dex”) |
tokenHash | bytes | Y | The keccak256 hash of the token string (eg “USDC“) |
tokenAmount | int | Y | Amount of tokens to be deposited |
Example code
Code generation via ABI file
web3j generate solidity -a <./path/to/Vault.json> -o <./out-path/to/Vault.java> -p <package-name>
Choose a valid chain to withdraw your funds to
Check if the chain has sufficient liquidity
Obtain a withdrawal nonce
Obtain a signature from EIP-712
Withdraw
:Name | Type | Required | Description |
---|---|---|---|
brokerId | string | Y | Builder ID, the valid list can be found [here] |
chainId | int | Y | Chain ID of the chain that the funds should be withdrawn to (within those that are supported by the Network) |
receiver | string | Y | Address of the receiver, which should be equal to the address of the account. |
token | string | Y | The string representation of the token that is being withdrawn (eg “USDC”) |
amount | int | Y | Amount of tokens to be withdrawn |
withdrawNonce | int | Y | Valid withdrawal nonce from Get Withdrawal Nonce API |
timestamp | timestamp | Y | current timestamp in UNIX milliseconds |
Make a withdraw request