Skip to main content

UserProfile

Represents an authenticated user in the Dynamic system.

Properties

  • userId (String) — User’s unique identifier
  • email (String?) — User’s email address (optional)
  • phoneNumber (String?) — User’s phone number (optional)

Example

toJsonString

Convert user profile to JSON string.

BaseWallet

Represents a user’s wallet.

Properties

  • address (String) — Wallet address (0x… for EVM, base58 for Solana)
  • chain (String) — Blockchain type (“EVM” or “SOL”)
  • walletName (String?) — Name of the wallet (e.g., “dynamicWaas”)
  • id (String?) — Wallet ID for API operations

Example

PhoneData

Phone number data for SMS authentication.

Properties

  • dialCode (String) — Country dial code (e.g., “+1”)
  • iso2 (String) — ISO country code (e.g., “US”)
  • phone (String) — Phone number without country code

Example

GenericNetwork

Represents a blockchain network.

Properties

  • name (String) — Human-readable network name
  • chainId (ChainIdValue) — Chain ID (for EVM networks)
  • networkId (NetworkIdValue) — Network ID (for Solana networks)

Example

EthereumTransaction

Transaction object for sending EVM transactions.

Properties

  • to (String) — Recipient address
  • value (Int) — Amount to send in Wei
  • gasLimit (Int) — Gas limit
  • maxFeePerGas (Int) — Maximum fee per gas unit
  • maxPriorityFeePerGas (Int) — Priority fee per gas unit
  • data (String?) — Transaction data (optional, for contract calls)

Example

WriteContractInput

Input for writing to smart contracts.

Properties

  • contractAddress (String) — Contract address
  • functionName (String) — Name of the function to call
  • args ([Any]) — Arguments to pass to the function
  • abi (String) — Contract ABI JSON string

Example

SignInWithExternalJwtParams

Parameters for external JWT authentication.

Properties

  • jwt (String) — The external JWT token

Example

Erc20

ERC20 token utilities.

Properties

  • abi (String) — Standard ERC20 ABI JSON

Example

GasPrice

Gas price information.

Example

DeletePasskeyRequest

Request to delete a passkey.

Example

EarnVaultSummary

A yield vault available to the environment, returned by sdk.earn.getVaults.

Properties

  • vaultId (String) — Opaque vault identifier passed to every Earn call
  • curator (String) — Organization curating the vault
  • assetSymbol (String) — Ticker of the underlying asset (e.g. USDC)
  • assetAddress (String) — Contract address of the underlying asset token
  • chainId (Int) — Chain the vault is deployed on (Solana vaults report 101)
  • chainName (ChainEnum) — Chain family, .evm or .sol
  • netApy (Double?) — Net APY as a decimal, nil when market data is unavailable
  • tvlUsd (Double?) — Total value locked in USD, nil when unavailable

EarnVaultDetails

Full vault details from sdk.earn.getVaultDetails, extending the summary fields.

Properties

  • assetDecimals (Int) — Decimals of the underlying asset, needed to convert raw amounts
  • contractAddress (String) — Vault contract address
  • Other fields match EarnVaultSummary

EarnVaultPosition

A wallet’s position in a vault, in raw token units.

Properties

  • shares (String) — Internal accounting balance; not meaningful to show a user
  • assets (String) — Current position value in the underlying token; grows as yield accrues

EarnVaultReward

A reward a wallet accrued in a vault.

Properties

  • accrued (String) — Claimable amount in raw units of the reward token
  • tokenDecimals (Int) — Decimals of the reward token; use this, not assetDecimals, to convert accrued

EarnVaultPerformance

Morpho-indexed performance of a wallet’s position in a vault.

Properties

  • netEarningsAssets (String) — Net earnings in raw units of the vault asset
  • returnOnCapital (Double?) — Time-weighted, non-annualized return as a decimal; nil with too little history

EarnEarnings

Aggregate USD earnings for a wallet on one EVM chain.

Properties

  • totalAssetsUsd (Double) — Total position value in USD
  • totalPnlUsd (Double) — Total profit or loss in USD, over positions whose provider reports it
  • vaults ([EarnVaultEarnings]) — Per-vault breakdown

EarnVaultEarnings

Per-vault earnings entry in EarnEarnings.

Properties

  • assets (String) — Position size in raw units of the vault asset
  • pnl, pnlUsd, roe — Earnings figures; nil when the provider reports no cost basis
  • vaultId (String?) — nil for vaults the environment does not offer

EarnVaultActionResponse

Response of deposit, withdraw, and claim, carrying the payload for execute.

EarnSigningPayload

The unsigned payload for a vault action.

Properties

  • chainName (ChainEnum) — Selects the executor: .evm payloads carry evmTransaction/evmApproval, .sol payloads carry transactions
  • transactions ([EarnTransactionStep]?) — Ordered Solana transaction sequence, contiguous from ordinal zero

EarnTransactionStep

One transaction in an ordered Solana vault-action sequence.

Properties

  • ordinal (Int) — Zero-based execution order
  • payload (String) — Base64-encoded unsigned transaction
  • expiryBlockHeight (UInt64?) — Block height after which the transaction can no longer land

EarnTransactionStepChange

Progress reported through execute’s onTransactionStepChange for multi-transaction actions.

EarnExecutionStep

The stage a vault action reached, reported through onStepChange.

EarnError

Thrown by Earn API calls and execution. Carries statusCode (the HTTP status when the failure came from the API) and nothingToClaim (true for HTTP 422 on claim).

EarnSolanaStepError

Thrown when a Solana transaction in a sequence cannot complete, with code (expired, failed, sendFailed), ordinal, and total.

EarnSponsorError

Thrown when sponsored: true was required but sponsorship was unavailable or the sponsored transaction failed.

Error Handling

All SDK async functions can throw errors. Use Swift’s native error handling:

Common Error Patterns

Last modified on October 23, 2026