client.ensureRegistered() once before depositing. A deposit’s amount, token, and source wallet are public; see How Unlink works.
The recommended path is depositWithApproval(). It runs the Permit2 approval
when needed, waits for confirmation, and then runs the deposit in one call. It
requires an EVM provider. See EVM provider setup.
Use deposit() directly only when the token is already approved or when you
want raw control over the approval flow.
Parameters (depositWithApproval)
Required fields:
token: ERC-20 token address.amount: amount in wei.
deadline: Permit2 deadline. Defaults to one hour from now.nonce: override Permit2 nonce. The SDK manages this by default.evm: override the EVM provider for this call.waitForApproval: override the approval-confirmation wait.
TransactionHandle. See Transaction status.
Advanced: separate approval + deposit
If you’ve already arranged Permit2 approval out of band, or you want to integrate the approval into a custom receipt-polling pipeline, use the lower-level helpers:Approval methods require an EVM provider with
getErc20Allowance.
ensureErc20Approval and depositWithApproval also require
sendTransaction. See Quickstart for a compact
browser setup.