Welcome to Circle’s modular wallets iOS SDK documentation. The SDK enables developers to integrate modular wallets to build secure, scalable Web3 applications by leveraging tools for key management, smart account interactions, gasless transactions, and blockchain communication.
Follow the steps provided in the GitHub repository to install and set up the modular wallets iOS SDK.
The following sections detail the SDK’s transport mechanisms, client interactions, account management, utility functions, model structures, and supported blockchain networks.
TransportrequestrpcRequest: RpcRequest - The RPC request to be sent.RpcResponseHttpTransportHttpTransport confirms the protocol Transport and
implements the required methods.ModularTransportModularTransport inherits HttpTransport and confirms
the protocol ModularRpcApi.HttpRpcClientOptionsheaders: [String: String] - Headers to include in the HTTP requests.toModularTransportModularTransport with the provided
client key and URL.clientKey: String - The client key for authorization.url: String - The URL for the HTTP transport.HttpTransport - The configured HTTP transport instance.toPasskeyTransportHttpTransport with the provided
client key and URL, setting the authorization header.clientKey: String - The client key for authorization.url: String - The URL of the transport endpoint. Defaults to
CIRCLE_BASE_URL.HttpTransport - The configured HTTP transport instance.httpurl: String - The URL for the HTTP transport.options: HttpRpcClientOptions? - Optional configuration options for the
HTTP transport.HttpTransport - The configured HTTP transport instance.ClientBundlerClientPaymasterClientchain: Chain - The blockchain that the client interacts with.transport: Transport - The transport mechanism used for making RPC
requests.BundlerClientBundlerClient is an interface to interact with ERC-4337 Bundlers and
provides the ability to send and retrieve User Operations through Bundler
Actions.Client.estimateUserOperationGasaccount: SmartAccount - The smart account to use for User Operation
execution.calls: [EncodeCallDataArg] - The calls to execute in the User Operation.paymaster: Paymaster? - Optional, sets Paymaster configuration for the
User Operation.estimateFeesPerGas:
((SmartAccount, BundlerClient, UserOperationV07) async -> EstimateFeesPerGasResult)? -
Optional, prepares fee properties for the User Operation request.EstimateUserOperationGasResult - The result of the gas
estimation.getChainIdInt - The current chain ID.getSupportedEntryPoints[String] - A list of supported EntryPoints.getUserOperationuserOpHash: String - The hash of the User Operation.GetUserOperationResult - User Operation information.getUserOperationReceiptuserOpHash: String - The hash of the User Operation.GetUserOperationReceiptResult - The User Operation receipt.prepareUserOperationaccount: SmartAccount - The smart account to use for User Operation
execution.calls: [EncodeCallDataArg]? - The calls to execute in the User
Operation.partialUserOp: UserOperationV07 - The partial User Operation to be
completed.paymaster: Paymaster? - Optional, sets Paymaster configuration for the
User Operation.estimateFeesPerGas:
((SmartAccount, BundlerClient, UserOperationV07) async -> EstimateFeesPerGasResult)? -
Optional, prepares fee properties for the User Operation request.UserOperationV07 - The prepared User Operation.sendUserOperationaccount: SmartAccount - The smart account to use for User Operation
execution.calls: [EncodeCallDataArg]? - The calls to execute in the User
Operation.partialUserOp: UserOperationV07 - The partial User Operation to be
completed.paymaster: Paymaster? - Optional, sets Paymaster configuration for the
User Operation.estimateFeesPerGas:
((SmartAccount, BundlerClient, UserOperationV07) async -> EstimateFeesPerGasResult)? -
Optional, prepares fee properties for the User Operation request.String? - Optional, the hash of the sent User Operation, or
null otherwise.waitForUserOperationReceiptuserOpHash: String - The User Operation hash.pollingInterval: Int (default: 4000) - The polling interval in
milliseconds.retryCount: Int (default: 6) - The number of retries.timeout: Int? - Optional timeout in milliseconds to wait before stopping
polling.GetUserOperationReceiptResult - The result of the User
Operation receipt retrieval.getBalanceaddress: String - The address to query the balance for. Only wallet
addresses registered with the client key can be retrieved.blockNumber: BlockNumber - The block number (default: .latest).BigInt - The balance of the address.getBlockNumberBigInt - The current block number.getGasPriceBigInt - The current gas price (in wei).callfrom: String? - Optional, the address to send the call from.to: String - The contract address or recipient.data: Data - A contract hashed method call with encoded arguments.String - The call data.getCodeaddress: String - The contract address.blockNumber: BlockNumber - The block number (default: .latest).String - The contract's bytecode.estimateMaxPriorityFeePerGaseth_maxPriorityFeePerGas (if supported) or manually calculate
the max priority fee per gas based on the current block base fee per gas + gas
price.BigInt - An estimate (in wei) for the max priority fee per gas.getBlockincludeTransactions: Boolean (default: false) - Whether or not to
include transactions (as a structured array of Transaction objects).blockNumber: BlockNumber - The block number (default: .latest).Block - The block information.getUserOperationGasPriceAvailable only for modular wallets.
GetUserOperationGasPriceResult - The gas price options in each
tier (low, medium, high) and verificationGasLimit (optional).PaymasterClientPaymasterClient is an interface to interact with
ERC-7677 compliant Paymasters and
provides the ability to sponsor User Operation gas fees.Client.getPaymasterDatauserOp: T - The User Operation to retrieve Paymaster data for. Type T
must be a subclass of UserOperation.entryPoint: EntryPoint - The EntryPoint address to target.context: [String: AnyEncodable]? - Optional, paymaster-specific fields.GetPaymasterDataResult - Paymaster-related User Operation
properties.getPaymasterStubDatauserOp: T - The User Operation to retrieve Paymaster data for. Type T
must be a subclass of UserOperation.entryPoint: EntryPoint - The EntryPoint address to target.context: [String: AnyEncodable]? - Optional, paymaster-specific fields.GetPaymasterStubDataResult - Paymaster-related User Operation
properties.toCircleSmartAccountclient: Client - The client used to interact with the blockchain.owner: Account<SignResult> - The owner account associated with the
Circle Passkey account.version: String (default: "circle_passkey_account_v1") - The version
of the Circle Passkey account.name: String? (optional, defaults to the format
passkey-yyyy-MM-dd'T'HH:mm:ss.SSS'Z') - The wallet name assigned to the
newly registered account.CircleSmartAccounttoWebAuthnAccountcredential: WebAuthnCredential - The WebAuthn credential associated with
the account.WebAuthnAccount - The created WebAuthn account.toWebAuthnCredentialWebAuthnCredential.transport: Transport - The transport used to communicate with the RP
API.userName: String? (optional, required for WebAuthnMode.Register) - The
username of the user.mode: WebAuthnMode - The mode of the WebAuthn credential.WebAuthnCredentialBaseError if userName is null for WebAuthnMode.Register.WebAuthnCredentialid: String - The unique identifier for the credential.publicKey: String (serialized hex) - The public key associated with the
credential.raw: PublicKeyCredential - The raw public key credential.rpId: String - The relying party identifier.AccountT - The type of the signed data.getAddressString - The account's address.signhex: String - The hex data to sign.T - The signed data.signMessagemessage: String - The message to sign.T - The signed message.signTypedDatatypedData: String - The typed data to sign.T - The signed typed data.WebAuthnAccountAccountgetAddressString - The associated public key.signhex: String - The hex string to sign.SignResult - The result of the signing operation.signMessagemessage: String - The message to sign.SignResult - The result of the signing operation.signTypedDatajsonData: String - The JSON data to sign.SignResult - The result of the signing operation.SmartAccountclient: Client - The client used to interact with the blockchain.entryPoint: EntryPoint - The entry point for the smart account.userOperation: UserOperationConfiguration? - Configuration for the User
Operation.getAddressString - The account address.encodeCallsargs: [EncodeCallDataArg] - The call data arguments to encode.String - The encoded call data.getFactoryArgs(String, String)? - A pair containing the factory address and
factory data.getNoncekey: BigInt? - Optional key to retrieve the nonce for.BigInt - The nonce value.getStubSignatureuserOp: T - The User Operation.String - The stub signature.signhex: String - The hex string to sign.String - The signed string.signMessagemessage: String - The message to sign.String - The signed message.signTypedDatatypedData: String - The typed data to sign.String - The signed typed data.signUserOperationchainId: Long - The chain ID for the user operation. Defaults to the
chain ID of the client.userOp: UserOperationV07 - The user operation to sign.String - The signed user operation.CircleSmartAccountclient: Client - The blockchain client.owner: Account<SignResult> - The associated owner account.entryPoint: EntryPoint - The entry point for the account.wallet: Wallet information.userOperation: UserOperationConfiguration? - Configuration for the User
Operation.SmartAccountgetAddressString - The account address.encodeCallsargs: [EncodeCallDataArg] - The call data arguments.String? - The encoded call data.getFactoryArgs(String, String)? - The factory arguments.BaseError if there is no initialization code.getNoncekey: BigInt? - Optional key.BigInt - The nonce value.getStubSignatureuserOp: T - The User Operation.String - The stub signature.signhex: String - The hex string to sign.String - The signature.BaseError if signing fails.signMessagemessage: String - The message to sign.String - The signature.BaseError if signing fails.signTypedDatajsonData: String - The JSON data to sign.String - The signature.BaseError if signing fails.signUserOperationchainId: Int - The chain ID.userOp: UserOperationV07 - The user operation.String - The signature.BaseError if signing fails.getInitCodeString? - The initialization code.encodeTransferto: String - The recipient address.token: String - The token contract address or the name of Token enum.
Supported tokens and their information are listed below.amount: BigInt - The amount to transfer.EncodeTransferResult - The encoded transfer ABI and contract
address.| Blockchain Network | Enum | Contract Address |
|---|---|---|
| Arbitrum | ArbitrumToken.USDC | 0xaf88d065e77c8cC2239327C5EDb3A432268e5831 |
| Avalanche | AvalancheToken.USDC | 0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E |
| Base | BaseToken.USDC | 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 |
| Optimism | OptimismToken.USDC | 0x0b2c639c533813f4aa9d7837caf62653d097ff85 |
| Polygon | PolygonToken.USDC | 0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359 |
| Unichain | UnichainToken.USDC | 0x078D782b760474a361dDA0AF3839290b0EF57AD6 |
| Blockchain Network | Token Name (Symbol) | Enum | Contract Address |
|---|---|---|---|
| Arbitrum | Arbitrum (ARB) | ArbitrumToken.ARB | 0x912CE59144191C1204E64559FE8253a0e49E6548 |
| Optimism | Optimism (OP) | OptimismToken.OP | 0x4200000000000000000000000000000000000042 |
| Blockchain Network | Enum | Contract Address |
|---|---|---|
| Arbitrum Sepolia | ArbitrumSepoliaToken.USDC | 0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d |
| Avalanche Fuji | AvalancheFujiToken.USDC | 0x5425890298aed601595a70AB815c96711a31Bc65 |
| Base Sepolia | BaseSepoliaToken.USDC | 0x036CbD53842c5426634e7929541eC2318f3dCF7e |
| Optimism Sepolia | OptimismSepoliaToken.USDC | 0x5fd84259d66Cd46123540766Be93DFE6D43130D7 |
| Polygon Amoy | PolygonAmoyToken.USDC | 0x41E94Eb019C0762f9Bfcf9Fb1E58725BfB0e7582 |
| Unichain Sepolia | UnichainSepoliaToken.USDC | 0x31d0220469e10c4E71834a79b1f276d740d3768F |
encodeCallDataarg: EncodeCallDataArg - A single call data argument.String - The encoded call data.args: [EncodeCallDataArg] - An array of call data arguments.String - The encoded call data.encodeFunctionDatafunctionName: String - The name of the ABI function.abiJson: String - The ABI JSON.args: [Any] - The input arguments for the ABI function.String? - Optional encoded ABI function data.encodeContractExecutionto: String - The target address.abiSignature: String - The ABI signature of the function.args: [Any] - The arguments for the function.value: BigInt - The value to send.String - The encoded contract execution function data.parseGweiToWeivalue: String - The Gwei value as a string.BigInt - The Wei value.parseEtherToWeivalue: String - The Ether value as a string.BigInt - The Wei value.SignResultsignature: String - The signature generated by the signing operation.webAuthn: WebAuthnData - The WebAuthn data associated with the signing
operation.raw: AuthenticationCredential - The raw authentication credential used
in the signing operation.WebAuthnDataauthenticatorData: String - The authenticator data in hexadecimal
format.challengeIndex: Int - The index of the challenge in the client data
JSON.clientDataJSON: String - The client data JSON.typeIndex: Int - The index of the type in the client data JSON.userVerificationRequired: Boolean - Indicates whether user verification
is required.EncodeCallDataArgto: String - The target address for the call (required).value: BigInt? - The amount of value to send with the call (optional,
defaults to 0).data: String? - The call data to be sent (optional, defaults to "0x"
if not provided).abiJson: String? - The ABI JSON of the smart contract function
(optional).args: [AnyEncodable]? - The arguments for the ABI function (optional).functionName: String? - The name of the function to be called
(optional).EstimateUserOperationGasResultCodablepreVerificationGas: BigInt? - The gas used for pre-verification.verificationGasLimit: BigInt? - The gas limit for verification.callGasLimit: BigInt? - The gas limit for the call.paymasterVerificationGasLimit: BigInt? - The gas limit for paymaster
verification.paymasterPostOpGasLimit: BigInt? - The gas limit for paymaster
post-operation.EstimateFeesPerGasResultmaxFeePerGas: BigInt? - Maximum fee per gas (EIP-1559).maxPriorityFeePerGas: BigInt? - Maximum priority fee per gas (EIP-1559).gasPrice: BigInt? - Legacy gas price.GetUserOperationReceiptResultuserOpHash: String? - The hash of the User Operation.sender: String? - The sender address.nonce: String? - The nonce value.actualGasCost: String? - The actual gas cost in hexadecimal format.actualGasUsed: String? - The actual gas used in hexadecimal format.success: Boolean? - Indicates whether the operation was successful.paymaster: String? - The paymaster address.logs: [Log]? - The list of logs.receipt: UserOperationReceipt - The User Operation receipt details.GetUserOperationResultCodableblockHash: String? - The hash of the block containing the operation.blockNumber: BigInt? - The number of the block containing the operation.transactionHash: String? - The hash of the transaction for the
operation.entryPoint: String? - The entry point of the operation.userOperation: UserOperationType? - The User Operation.UserOperationReceiptCodabletransactionHash: String? - The transaction hash.transactionIndex: String? - The transaction index.blockHash: String? - The block hash.blockNumber: String? - The block number.from: String? - The sender's address.to: String? - The recipient's address.cumulativeGasUsed: String? - The cumulative gas used.gasUsed: String? - The gas used.logs: [Log]? - The list of logs.logsBloom: String? - The bloom filter for logs.status: String? - The status of the operation.effectiveGasPrice: String? - The effective gas price.LogCodableremoved: Boolean? - Indicates whether the log was removed.logIndex: String? - The index of the log.transactionIndex: String? - The index of the transaction.transactionHash: String? - The transaction hash.blockHash: String? - The block hash.blockNumber: String? - The block number.address: String? - The address of the contract generating the log.data: String? - The log data.topics: [String]? - The list of topics.GetPaymasterDataResultCodablepaymaster: String? - The Paymaster address for entry point version 0.7.paymasterData: String? - The Paymaster data for entry point version 0.7.paymasterPostOpGasLimit: BigInt? - The gas limit for the Paymaster
post-operation for entry point version 0.7.paymasterVerificationGasLimit: BigInt? - The gas limit for the Paymaster
verification for entry point version 0.7.paymasterAndData: String? - The Paymaster and associated data for entry
point version 0.6.GetPaymasterStubDataResultCodablepaymaster: String? - The Paymaster address for entry point version 0.7.paymasterData: String? - The Paymaster data for entry point version 0.7.paymasterPostOpGasLimit: BigInt? - The gas limit for the Paymaster
post-operation for entry point version 0.7.paymasterVerificationGasLimit: BigInt? - The gas limit for the Paymaster
verification for entry point version 0.7.paymasterAndData: String? - The Paymaster and associated data for entry
point version 0.6.isFinal: Boolean? - Indicates whether the caller does not need to call
getPaymasterData.sponsor: SponsorInfo? - Sponsor information associated with the
Paymaster.BlockCodablenumber: BigUInt - The block number.hash: Data - The block hash.parentHash: Data - The parent block hash.nonce: Data? - The block nonce (optional).sha3Uncles: Data - The SHA3 hash of the uncles.logsBloom: EthereumBloomFilter? - The bloom filter for the logs
(optional).transactionsRoot: Data - The root of the transactions trie.stateRoot: Data - The root of the state trie.receiptsRoot: Data - The root of the receipts trie.miner: EthereumAddress? - The address of the miner.difficulty: BigUInt - The difficulty of the block.totalDifficulty: BigUInt? - The total difficulty of the chain up to this
block.extraData: Data - Extra data included in the block.size: BigUInt - The size of the block.gasLimit: BigUInt - The gas limit of the block.gasUsed: BigUInt - The gas used in the block.baseFeePerGas: BigUInt? - The base fee per gas (optional, present in
EIP-1559 blocks).timestamp: Date - The timestamp of the block.transactions: [TransactionInBlock] - The list of transactions in the
block.uncles: [Data] - The list of uncle blocks.GetUserOperationGasPriceResultgetUserOperationGasPrice
method.Decodablelow: GasPriceOption - The low-priority gas price option.medium: GasPriceOption - The medium-priority gas price option.high: GasPriceOption - The high-priority gas price option.deployed: BigInt? - The verification gas for a deployed smart account
(optional).notDeployed: BigInt? - The verification gas for a non-deployed smart
account (optional).GasPriceOptionDecodablemaxFeePerGas: BigInt - The maximum fee per gas.maxPriorityFeePerGas: BigInt - The maximum priority fee per gas.EncodeTransferResultencodeTransfer.data: String - The encoded data.to: String - The token address.EntryPointaddress: String - The address of the entry point.v07 - Represents the entry point version 0.7 with its respective address.PaymasterPaymasterClient, it uses the provided Paymaster
Client for sponsorship.true, it assumes that the Bundler Client supports
Paymaster RPC methods (e.g. getPaymasterData) and uses them for
sponsorship.TruepaymasterContext: [String: AnyEncodable]? - Optional context for the
Paymaster.Clientclient: PaymasterClient - The Paymaster Client used for sponsorship.paymasterContext: [String: AnyEncodable]? - Optional context for the
Paymaster.PublicKeyCredentialRegistrationCredentialAuthenticationCredentialid: String - The unique identifier for the credential.type: String - The type of the credential.authenticatorAttachment: String - The attachment type of the
authenticator.response: AuthenticatorResponse - The response from the authenticator.clientExtensionResults: AuthenticationExtensionsClientOutputs? -
Optional client extension results.RegistrationCredentialPublicKeyCredentialrawId: String - The raw identifier for the credential.authenticatorAttachment: String - The attachment type of the
authenticator.type: String - The type of the credential.id: String - The unique identifier for the credential.response: AuthenticatorAttestationResponse - The attestation response
from the authenticator.clientExtensionResults: AuthenticationExtensionsClientOutputs? -
Optional client extension results.AuthenticationCredentialPublicKeyCredentialrawId: String - The raw identifier for the credential.authenticatorAttachment: String - The attachment type of the
authenticator.type: String - The type of the credential.id: String - The unique identifier for the credential.response: AuthenticatorAssertionResponse - The assertion response from
the authenticator.clientExtensionResults: AuthenticationExtensionsClientOutputs? -
Optional client extension results.UserOperationUserOperationV07sender: String? - The address of the sender.nonce: BigInt? - The nonce of the operation.callData: String? - The data to be sent in the call.callGasLimit: BigInt? - The gas limit for the call.verificationGasLimit: BigInt? - The gas limit for verification.preVerificationGas: BigInt? - The gas used before verification.maxPriorityFeePerGas: BigInt? - The maximum priority fee per gas.maxFeePerGas: BigInt? - The maximum fee per gas.signature: String? - The signature of the operation.UserOperationV07UserOperationsender: String? - The address of the sender.nonce: BigInt? - The nonce of the operation.callData: String? - The data to be sent in the call.callGasLimit: BigInt? - The gas limit for the call.verificationGasLimit: BigInt? - The gas limit for verification.preVerificationGas: BigInt? - The gas used before verification.maxPriorityFeePerGas: BigInt? - The maximum priority fee per gas.maxFeePerGas: BigInt? - The maximum fee per gas.signature: String? - The signature of the operation.factory: String? - The factory address.factoryData: String? - The data for the factory.paymaster: String? - The Paymaster address.paymasterVerificationGasLimit: BigInt? - The gas limit for Paymaster
verification.paymasterPostOpGasLimit: BigInt? - The gas limit for Paymaster
post-operation.paymasterData: String? - The data for the Paymaster.WebAuthnModeRegister - Mode for registering a new credential.Login - Mode for logging in with an existing credential.ArbitrumTokenencodeTransfer. The format is {chain}_{symbol}.USDCARBArbitrumSepoliaTokenencodeTransfer. The format is {chain}_{symbol}.USDCAvalancheTokenencodeTransfer. The format is {chain}_{symbol}.USDCAvalancheFujiTokenencodeTransfer. The format is {chain}_{symbol}.USDCBaseTokenencodeTransfer. The format is {chain}_{symbol}.USDCBaseSepoliaTokenencodeTransfer. The format is {chain}_{symbol}.USDCOptimismTokenencodeTransfer. The format is {chain}_{symbol}.USDCOPOptimismSepoliaTokenencodeTransfer. The format is {chain}_{symbol}.USDCPolygonTokenencodeTransfer. The format is {chain}_{symbol}.USDCPolygonAmoyTokenencodeTransfer. The format is {chain}_{symbol}.USDCUnichainTokenencodeTransfer. The format is {chain}_{symbol}.USDCUnichainSepoliaTokenencodeTransfer. The format is {chain}_{symbol}.USDCModularWalletCodableid: String? - The unique identifier of the wallet.address: String? - The blockchain address of the wallet.blockchain: String? - The blockchain network the wallet is associated
with.state: String? - The current state of the wallet.name: String? - The name of the wallet.scaCore: String? - The SCA (Strong Customer Authentication) core
identifier.scaConfiguration: ScaConfiguration? - The SCA configuration associated
with the wallet.createDate: String? - The creation date of the wallet.updateDate: String? - The last update date of the wallet.getInitCodeString? - The initialization code from the SCA configuration,
if available.ChainArbitrumArbitrumSepoliaBaseBaseSepoliaOptimismOptimismSepoliaPolygonPolygonAmoyUnichainUnichainSepoliachainId: Int - The unique identifier for the blockchain.