Design guides

User wallet interactions

This guide is aimed at providing clarity on the minimum requirements when implementing user wallet connections and interactions.

Previously, applications using the Link SDK did not have to worry about this because the Link SDK provided an opinionated UI that implemented our best practices. Now, when using the Core SDK with the Wallet SDK, applications may need to implement their own design. Other than the must-haves outlined in this guide, the rest is up the application.

Interactions:​

  • Connect wallet

  • Disconnect wallet

  • List asset

  • Buy asset

  • L1 to L2 deposit

  • L2 to L1 withdrawals

  • Fiat onramp

  • Crypto to fiat offramp

  • Error states

  • Transaction history

Connect wallet​

Flow
Link UI /XpansionChain marketplace example
Requirements

Provider list

Provider List

  • Provide a mechanism to surface the wallet options

  • Include user acceptance statement of XpansionChain’s T&C and privacy policy

Email login

Email Login

If an application chooses to provide the email wallet (provided by Magic) as an option, it must:

  • Provide a field for the user to enter their email address

  • Include Magic’s T&C and privacy policy

MetaMask + GameStop

Signature Request

Not mandatory, but useful to include:

  • An explanation of why there are multiple signature requests from the non-custodial wallet for:

    • Connecting to a user wallet

    • Requesting for the user's signature

    • Setting up an XpansionChain layer 2 wallet key (only needed the first time a user connects with XpansionChain - this is user registration)

  • If MetaMask and GameStop are both provided as wallet options, explain that having both plugins at the same time can create wallet connection issues (more information available here)

Wallet connected

Not mandatory, but useful to include:

  • User feedback that wallet is successfully connected

Disconnect wallet​

Flow
Link UI / XpansionChain marketplace example
Requirements

Disconnect wallet

Disconnect Wallet

  • Provide an way for users to disconnect their wallets from the application

List asset​

Flow
Link UI / XpansionChain marketplace example
Requirements

Listing screen

List asset 1 List asset 2

  • Enable the user to input their listing price

  • Enable the user to select their listing currency (if multiple options are provided)

  • Provide breakdown of any maker and taker fees that apply

Not mandatory, but useful to have:

  • Processing indicator when the user has initiated listing an asset and the transaction has not yet completed

  • Feedback when an asset has successfully been listed

Buy asset​

Flow
Link UI /XpansionChain marketplace example
Requirements

Asset screen

Buy Asset Screen

  • Display the purchase price

  • Display the purchase currency

  • Provide breakdown of any maker and taker fees that apply

Not mandatory, but useful to have:

  • User feedback that purchase was successful

  • Send users to an "add funds" flow if they have insufficient funds

L1 to L2 deposit​

Flow
Link UI /XpansionChain marketplace example
Requirements

Add funds flow

Add Funds

  • Provide an "add funds" flow

Deposit flow

Deposit Screen

  • Provide a field for the user to input the currency type

  • Provide a field for the user to input the amount they want to deposit

Not mandatory, but useful to have:

  • Icons representing different currency types

  • Available L1 balance to be deposited

  • Feedback when a deposit is successful

L2 to L1 withdrawals​

Flow
Link UI / XpansionChain marketplace example
Requirements

Withdraw flow

withdraw screen

Partner must

  • Surface withdrawal flow

  • Collect currency type (assuming multiple currencies available to be withdrawn)

  • Collect amount to be withdrawn

Useful to have:

  • Icon for different currency types

  • Available L2 balance to be deposited

  • Notice that withdrawal will require L1 gas to be paid

  • Notice that withdrawal has 2 stage: preparation & execution of withdrawal (more information available here)

Fiat onramp​

NOTE

Fiat onramp is still under development and not available in the SDK yet.

Flow
Link UI / XpansionChain marketplace example
Requirements

Fiat onramp

Add Funds

  • Trigger the onramp flow (the MoonPay widget will take care of the rest)

Crypto to fiat offramp​

NOTE

Crypto to fiat offramp is still under development and not available in the SDK yet.

Flow
Link UI / XpansionChain marketplace example
Requirements

Crypto offramp

Withdraw to bank account

  • Trigger the offramp flow (the MoonPay widget will take care of the rest)

Not mandatory, but useful to have:

  • A note informing the user that the MoonPay offramp is only available to users in the US, UK, and EU.

Error states​

Flow
Link UI / IXpansionChain marketplace example
Requirements

Error states

Error screens

  • Provide user feedback about specific errors (full list of errors can be found here)

Not mandatory, but useful to have:

  • Link to XpansionChain support page

Transaction history​

NOTE

Transaction history is still under development and not available in the SDK yet.

Flow
Link UI / XpansionChain marketplace example
Requirements

Transaction history

Transaction history screen

  • Provide users with the ability to view their transaction history

  • For each transaction, they must provide information about the transaction ID, asset details, type of transaction and the costs involved.

Last updated