connectAccount() first. On a first
deposit, call setup before you submit the transfer; after the transfer, call
logDeposit with the transaction hash.
Complete lifecycle
- Authenticate with
connectAccount()on the same SDK instance. - Run
ensureFirstDepositSetup()before a first-deposit transfer. - Build ERC-20 calldata with
buildDepositTransfer(). - Submit that calldata through your wallet, relayer, or transaction service, then wait for its on-chain receipt.
- Register the confirmed transaction with
logDeposit(). - Use
getDepositStatus()for a one-off lifecycle check, orwaitForDepositCredit()to wait until it is credited and investable.
logDeposit() can return handover_pending. Do not treat the deposit as
investable until its status is credited and balanceCredited is true. A
recovered_to_eoa status is terminal: the funds were returned to the EOA and
must not be registered or transferred again without checking the transaction
and lifecycle state first.
ensureFirstDepositSetup
Idempotently configures protocols and chains for a first deposit. It does
nothing after the USDC profile has chains configured.
When setup runs, it throws if protocol configuration cannot be persisted (for
example API or pool lookup failures). Treat errors as blocking: do not submit
a transfer until setup succeeds or returns { applied: false } because the
account was already configured.
buildDepositTransfer
Resolves the user’s Safe and returns standard ERC-20 transfer calldata.