A Swift library to enable lightweight interaction with the Algorand blockchain.

Embed this library to easily create and share Algorand Payment Prompt URIs and stylized QR codes.



  • Xcode 12.0 or higher.
  • iOS 13.0 or higher.


The Swift Package Manager is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies.

To integrate AlgorandKit into your Xcode project using Xcode 12, specify it in File > Swift Packages > Add Package Dependency...:

Or, manually add the dependency to your Package.swift:

.package(url:, from: "1.1.0")


A utility for constructing Algorand Payment Prompt URIs, as defined by the specification:

Per the spec, this URI represents "a standardized way for applications and websites
to send requests and information through deeplinks, QR codes, etc." On iOS, these URIs
can be handled by the official Algorand Wallet app to delegate transaction processing on Algorand:

AlgorandURI is an immutable Swift struct which enforces business logic rules through its
interface definition upon initialization. All URIs constructed via AlgorandURI should be
semantically valid. (AlgorandURI does not validate addresses or transaction validity.)

The object definition lends itself to quick visual inspection in the debugger -- for instance:

▿ AlgorandURI
  - uriScheme : "algorand"
  ▿ receiver : Receiver
    ▿ label : Optional<String>
      - some : "Bob"
  ▿ assetAmount : AssetAmount
    ▿ algo : 1 element
      - microAlgos : 50
  ▿ note : Optional<note>
    ▿ some : note
      ▿ readonly : 1 element
        - xnote : "Transfer"

A suite of test cases is included for regression verification.

Usage Examples

let algoURI = AlgorandURI(
      receiver: AlgorandURI.Receiver(address: "4AOJ5QITUBWZGO4K5AF77H5GED5A4QDBB6DOQGI63QE2GU6KD2XNETBBJE", label: "Barclay"),
      assetAmount: .algo(microAlgos: 100),
      note: .readonly(xnote: "Transporter Insurance"))
let asaURI = AlgorandURI(
      receiver: AlgorandURI.Receiver(address: "4AOJ5QITUBWZGO4K5AF77H5GED5A4QDBB6DOQGI63QE2GU6KD2XNETBBJE", label: "Lanel"),
      assetAmount: .ASA(assetID: 1000000, amount: 150),
      note: .readonly(xnote: "Spaceship"))

if let url = algoURI.url() {
  if UIApplication.shared.canOpenURL(url) {, options: [:], completionHandler: nil)


Utilities for generating raw and stylized Algorand QR codes from AlgorandURI instances:

  • AlgorandURI (extension)
    -- Generate a raw QR code UIImage from an AlgorandURI
  • AlgorandQRCodeBadge
    -- Create a scalable, (optionally) stylized and branded Algorand QR code badge in SwiftUI

Although not explicitly provided as part of this library, see AlgorandQRCodeTests for examples of detecting
Algorand QR Codes using Apple's Vision framework.

Usage Examples

// Create an AlgorandURI to receiver Barclay for 100 microAlgos, with the readonly note "Transporter Insurance"
let algoURI = AlgorandURI(
  receiver: AlgorandURI.Receiver(address: "4AOJ5QITUBWZGO4K5AF77H5GED5A4QDBB6DOQGI63QE2GU6KD2XNETBBJE", label: "Barclay"),
  assetAmount: .algo(microAlgos: 100),
  note: .readonly(xnote: "Transporter Insurance"))

// Generate a raw QR code UIImage for this transaction URI
let qrCodeImage = algoURI.generateQRCode()

// Instantiate a stylized SwiftUI QR code badge
  uri:AlgorandURI(receiver: AlgorandURI.Receiver(address: "4AOJ5QITUBWZGO4K5AF77H5GED5A4QDBB6DOQGI63QE2GU6KD2XNETBBJE", label: nil), assetAmount: nil, note: nil),
  qrCodeColor: UIColor.systemTeal,
  frameConfiguration: .framed(color: UIColor.darkGray),
  includeLogo: true)

Sample Screenshots




UIActivityViewController / AirDrop

Support for sharing AlgorandURIs with other devices or services via UIActivityViewController.
Defaults to a set of sharing destinations including AirDrop, SMS, Mail, Copy/Paste; configurable to other sharing destinations by the caller.

Usage Examples

// Create an AlgorandURI to receiver Data for 400 microAlgos.
let algoURI = AlgorandURI(
  receiver: AlgorandURI.Receiver(address: "4AOJ5QITUBWZGO4K5AF77H5GED5A4QDBB6DOQGI63QE2GU6KD2XNETBBJE", label: "Data"),
  assetAmount: .algo(microAlgos: 400),
  note: .readonly(xnote: "Cat food."))

// Present UIActivityViewController to share AlgorandURI via AirDrop, SMS, etc. (SwiftUI)
if let av = algoURI.activityViewController(excludedActivityTypes: nil) {, animated: true, completion: nil)

Sample Screenshots





AlgoSampleApp is a standalone iOS Application project which demonstrates importing AlgorandKit, and specifically demos AlgorandURI's UIActivityViewController / AirDrop support. This can also serve as a test harness for exploring other AlgorandKit functionality.

To build, simply open AlgoSampleApp.xcodeproj included in the AlgoSampleApp directory.