Skip to main content
Use these methods for sponsored, custom-wallet, or queue-backed transaction flows where your integration submits the transfer itself. Authenticate the same SDK instance with connectAccount() first. On a first deposit, call setup before you submit the transfer; after the transfer, call logDeposit with the transaction hash.

Complete lifecycle

  1. Authenticate with connectAccount() on the same SDK instance.
  2. Run ensureFirstDepositSetup() before a first-deposit transfer.
  3. Build ERC-20 calldata with buildDepositTransfer().
  4. Submit that calldata through your wallet, relayer, or transaction service, then wait for its on-chain receipt.
  5. Register the confirmed transaction with logDeposit().
  6. Use getDepositStatus() for a one-off lifecycle check, or waitForDepositCredit() 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.

Example

Lifecycle helpers