iOS

Wallet SDK - iOS

The Wallet SDK provides an easy way to connect to user wallets and manage user sessions.

πŸ’‘ROLLUPS THIS SDK SUPPORTS

  • XpansionChain

⚠️THIS SDK IS UNSTABLEThis SDK is not yet at v1.0 so its public interface should not be considered final. Future releases may include breaking changes without further notice. We will do our best to keep this documentation updated providing visibility on breaking changes planned.CONTENTS

  • Installation

    • Supported wallet providers

    • Prerequisites

    • Cocoapods

  • Connect wallet

    • Connect via WalletConnect

    • Restart existing session

  • Disconnect wallet

  • Handle callbacks

    • Set callback

    • Pending states

    • Remove callback

  • Usage with the Core SDK

  • Further documentation


πŸ“šSDK LINKS

  • SDK reference

  • Github repository

Installation​

This SDK is closed source and only available as a XCTFramework through Cocoapods.

Supported wallet providers​

  • Any wallet that supports WalletConnect v1.0

Prerequisites​

  • iOS 13.0

  • Swift 5.7

Cocoapods​

In your Podfile:

Connect wallet​

Connect via WalletConnect​

NOTE: the async methods that require user actions with the chosen wallet app will only complete when the requested action has been performed (i.e. accepted or denied).

If you want to use your own bridge server instead of the default provide it via bridgeServer when connecting. For more info on how WalletConnect and the bridge works see here.

Restart existing session​

The user's previous wallet sessions will be automatically restored when the app is launched, however it can also be manually triggered.

Disconnect wallet​

Handle callbacks​

All the XpansionChainWallet methods (connect, disconnect, etc.) are asynchronous, and will only return when they've completed the operation. If a user is taken to a wallet app for a connection or signature and does not perform the required operation, the request will not complete, leading to a pending state that is communicated via the callback.

Status callbacks are also useful for listening to status updates triggered from different screens.

Set callback​

Pending states​

If a wallet app has been launched to connect or sign and your app has resumed but no result has arrived, .pendingConnection or .pendingSignature will be sent to the callback.

This allows you to handle this scenario flexibly; you could re-launch their wallet and complete the flow, show a popup or continue showing a waiting state, for example.

Remove callback​

You may unregister from all callbacks

or remove a specific one

Usage with the Core SDK​

This Wallet SDK is designed to be used in tandem with the XpansionChain Core SDK for Swift.

Once you connect a user's wallet with the Wallet SDK you can provide the Signer and StarkSigner instances to Core SDK workflows.

Further documentation​

Check out the UI guide for implementing user wallet interactions.

  • See the Developer homepage for general information on building on XpansionChain.

  • Build on XpansionChain zkEVM:

    • Documentation

    • API reference

    • Support

  • Build on XpansionChain:

    • Documentation

    • API reference

    • Support

Last updated