iOS
Portal provides MPC wallets and dApp connections for organizations and their users. To integrate Portal, an organization adds a client library to their mobile app and a few server API endpoints.

Installation
We support Cocoa Pods and Swift Package Manager as distribution methods for our swift package.
Setup
Add the PortalSwift
package through Xcode:
In Xcode, right-click on your project in the Project Navigator
Select "Add Packages..."
In the search field, enter either:
Package name:
PortalSwift
Repository URL:
https://github.com/portal-hq/PortalSwift
Select your desired version
Click "Add Package"
You can read more on adding SPM packages here.
Initializing Portal
To initialize Portal
in your application, create a new instance of the Portal
class included in the package dependency you added. You can provide your Client API Key as the apiKey
argument during initialization. rpcConfig
is a map of CAIP-2 Chain IDs to their respective RPC URLs.
We can now create an instance of the Portal
class. Below is an example of how you can do this:
import PortalSwift
let portal = try Portal(
"CLIENT_API_KEY_OR_CLIENT_SESSION_TOKEN",
withRpcConfig: [
"eip155:1": "https://eth-mainnet.g.alchemy.com/v2/\(alchemyApiKey)",
"eip155:11155111": "https://eth-sepolia.g.alchemy.com/v2/\(alchemyApiKey)",
"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp": "https://api.mainnet-beta.solana.com",
"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1": "https://api.devnet.solana.com",
]
)
Now that we have our Portal instance, the next step is to generate wallets for your user. Let's create them!
Last updated
Was this helpful?