How It Works

The following represents the process for transaction requests using mtnAPI, enabling arbitrary transactions via Solana Pay.
mtnAPI provides a seamless user experience by bundling necessary instructions and returning the desired Solana transaction. It then allows the wallet to simulate the transaction and displays it to the user
This is executed in a quick and simple display while saving merchants and developers time on the back-end.

Step by Step Overview: How mtnAPI Works Using QR Code Generation

  1. 1.
    The user opens a Solana Pay compatible wallet and scans the generated QR Code
    • The wallet generates a data string from the QR code that represents the encoded transaction request URL
  2. 2.
    The wallet provides a public key (wallet address) and transaction request URL to mtnAPI
  3. 3.
    mtnAPI collects the public key and URL to build the desired Solana transaction and UI elements in two actions
    • Action 1: The user’s wallet sends a GET request to the mtnAPI server resulting in the return of a name string (merchant name) and an image string (merchant logo) which is displayed to the user
    • Action 2: The user’s wallet sends a POST request that includes the user's public key (user’s wallet address), and the desired Solana transaction is returned to the wallet
  4. 4.
    The transaction is returned to the user's wallet from the mtnAPI server
  5. 5.
    The user’s wallet will simulate the transaction and identify the fees associated with the transaction
    • mtnAPI provides 'gasless' transactions as a service for project teams that want to give their users a low friction transaction experience by removing gas fees (mtnAPI will coordinate and pay for gas fees on behalf of the dApp/project)
    • Within the returned transaction, mtnAPI will include instructions to create new associated token accounts where necessary (if a user or merchant does not have an existing balance for tokens they’re receiving)
  6. 6.
    The user is then able to review the transaction details and sign & send the transaction for execution on the Solana Blockchain
  7. 7.
    If the transaction is successful, a transaction signature is returned to the user’s wallet, and the user can confirm the transaction

Disclaimer / Considerations

The performance of mtnAPI is dependent on support technologies such as Jupiter Aggregator, The Metaplex Protocol, and Solana Network.
Last modified 6mo ago