Skip to main content

Build a Payment App with Swift

SwiftBasicPay

SwiftBasicPay is an open-source example iOS payment application that showcases how to integrate Stellar's powerful payment infrastructure into native Swift apps using the Stellar Wallet SDK for Swift and the Stellar iOS SDK.

SwiftBasicPay is maintained by a dedicated community developer, Soneso.

Features

Wallet Functionality

  • Authentication: PIN-based security
  • Account Management: Stellar account creation and management
  • Management of Assets: Add/remove trust lines, asset overview
  • Payments: Send and receive Stellar assets
  • Path Payments: Cross-asset payments with automatic routing

Anchor Integration

  • Programatic deposits and withdrawals via anchors
  • KYC compliance
  • Interactive deposits/withdrawals with web integration

SwiftBasicPay integrates multiple Stellar Ecosystem Proposals (SEPs) through the wallet SDK:

  • SEP-1: Stellar TOML - Provides anchor metadata and service endpoints
  • SEP-10: Web Authentication - Proves account ownership to anchors
  • SEP-6: Deposit/Withdrawal API - Interacts with anchors programmatically
  • SEP-9: Standard KYC Fields - Defines standard customer information fields
  • SEP-12: KYC API - Customer information collection and verification
  • SEP-24: Hosted Deposit/Withdrawal - Interactive web-based transfers

Learning Topics

This app demonstrates how to:

  1. Create Stellar Wallets: Account generation, key management
  2. Implement Management of Assets: Add and remove trustlines to Stellar assets
  3. Implement Payments: Simple and path payments
  4. Interact with Anchors: SEP-1/10/6/12/24 integration

Tutorial

A comprehensive tutorial walking through the development of this Stellar payment app is available in the tutorial directory of the repository.

The tutorial covers secure data storage, authentication, account creation, assets management, payments, path payments, and anchor integration with step-by-step explanations of how the Stellar SDKs are used.

Resources

Contributing

Contributions to SwiftBasicPay are welcome! Please create a pull request with a clear description of your changes in the SwiftBasicPay GitHub Repository.