Stream Protocol
  • Abstract
  • Introduction
    • Overview
    • Executive Summary
  • Market Analytics
    • Market Overview
      • Blockchain Technology and Industry
        • The adoption of blockchain technology
        • The e-commerce and global payment market
        • Opportunities
          • Evolving the Payment Industry
    • The Challenge
      • Inefficient Payment Solutions
      • Problem Statement and Solution
        • Problem Stream Protocol Solves
  • Stream Protocol
    • Ecosystem
      • Corporation
        • About Us
          • StreamPayments™
            • Revolutionizing the future of payments
            • Market Adoption
          • Business Model
          • Our Vision
          • Our Mission
            • Our Goals
      • StreamDAO
        • Governance
          • Community
            • The Governance Rules and Guidelines
              • Programs
    • The Solutions
    • Technical Overview
      • Core Features and Components
        • StreamPay™
          • StreamPay™ Mobile Application
          • StreamSwap
        • StreamPOS™
        • StreamPayments™ Platform
        • StreamFinance™
      • Key Competences
  • Products
    • Introduction
      • StreamPayments™
        • Overview
        • Use Cases, and Value
          • The payment processing solution
            • Checkout Payments API
            • Payment Gateway
              • System Architecture
                • Documentation - Merchants
                • Documentation - Users
          • Checkout Donation Platform
            • Definition A checkout donation
              • Features
      • StreamPay™ - The Future of Payments
        • Solving the Problem
          • Value Proposition
        • Use Cases
          • E-Commerce and Retail
          • DeFi, Fintech
        • Features
          • Payments
            • Web Wallet Extension
          • Wallet
          • Swap
          • Advantages
      • StreamPOS™
        • Exploring StreamPOS™
        • Payment Features
        • Checkout App
      • StreamFinance™
        • Corrateral Pay
          • Advantages
    • ICO/STO Token Sale & Management Dashboard
      • Investors Guide
        • Supported wallets for Stream Tokens
    • Security
  • Tokenomics
    • Stream Token (STRM) Overview
      • Emission Plan
      • The Purpose and Value of Tokens
        • Staking, governance, and voting
        • Usage and Value Variables
      • Token Distribution and Allocation
        • Vesting Schedule
      • Emission Plan
      • Burning Mechanism
      • Token Sales
    • Q&A
  • Staking
    • Consensus Mechanism
      • Staking
      • Yield Aggregator
      • APY Calculator
  • Roadmap
    • Roadmap and Milestones
      • Future Development
  • GUIDES
    • FAQ
    • Investment
      • How to participate token sale?
      • How to transfer tokens?
  • Media
    • Twitter
    • Discord
    • Blog
  • Developers
    • API & SDK
      • Checkout Donation Platform API
        • Summary
      • Merchants SDK and API
        • Merchant Integration
      • Wallet Integration
  • Documents
    • Disclaimer
    • Token Sale Terms
    • Privacy Policy
    • Terms of Use
  • Partnership
    • A Joint Venture
    • Backers
    • Companies
  • The Brand
    • Assets
  • Media
    • Media Kit
    • GitHub
    • Community
  • Resources
    • References
    • Documentation
Powered by GitBook
On this page
  • 1. Set up StreamPay​ Wallet
  • 2. Parse payment request link​
  • 3. Create transaction​
  • 4. Complete transaction​
  • Deep linking
  1. Developers
  2. API & SDK

Wallet Integration

StreamPay Wallet Providers

PreviousMerchant IntegrationNextDisclaimer

Last updated 1 year ago

This section describes how a wallet provider can support payment links in StreamPay app. It shows how to parse the payment URL and create a transaction from it.

This guide walks through an example implementation for wallet providers. The purpose of this is to make it easy for wallets to implement the protocol correctly.

1. Set up StreamPay Wallet

Install the packages and import them in your code.

npm

npm install @stream-pay-wallet @stream/web3.js --save

yarn

yarn add @stream-pay-wallet @stream/web3.js

2. Parse payment request link

As a wallet provider, you will have to parse the received URL to extract the parameters. For more information on the URL format, please see the .

3. Create transaction

Use the createTransaction function to create a transaction with the parameters from the parseURL function with an additional payer.

The payer should be the public key of the current users' wallet.

Create transaction reference implementation

This transaction should represent the original intent of the payment request link. The example implementation walks through the steps on how to construct the transaction:

Native STRM/SOL transfer

  1. Check that the payer and recipient accounts exist

  2. Check the payer and recipient are valid native accounts

  3. Check the payer has enough lamports for the transfer

  4. Create an instruction to transfer native STRM or SOL

  5. If references were included, add them to the instruction

  6. If a memo was included, create an instruction for the memo program

SPL token transfer

  1. Check that the payer and recipient accounts exist

  2. Check the token provided is an initialized mint

  3. Check the payer and recipient's Associated Token Account (ATA) exists

  4. Check the payer has enough lamports for the transfer

  5. Create an instruction to transfer SPL tokens

  6. If references were included, add them to the instruction

  7. If a memo was included, create an instruction for the memo program

With the transaction formed. The user must be prompted to approve the transaction.

The label and message should be shown to the user, as it gives added context to the user on the transaction.

Finally, use sendAndConfirmTransaction to complete the transaction.

Deep linking

Wallet providers building for mobile or wearable devices are encouraged to register their app as a handler for the StreamPay URL schemesolana:.

For example, when a payment request is presented as a QR code, the payer should ideally be able to read the code using the native scanning capability of their device and have the appropriate wallet open with the transaction prefilled.

URLs can be embedded in the environment in web pages, QR codes, NFC tags and potential new formats. To avoid inadvertent transfer of tokens, care must be taken when designing wallets to ensure that transactions cannot accidentally be triggered and sent.

4. Complete transaction

Deep linking

​
​
specification
​
​
​