Skip to content

tesseract-one/Tesseract.swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f37b6e2 · Jan 30, 2024
Jan 30, 2024
Jan 29, 2024
Jan 29, 2024
Jan 29, 2024
Sep 27, 2023
Jan 29, 2024
Nov 23, 2023
May 3, 2019
Dec 14, 2022
Jan 30, 2024
Nov 23, 2023
Jan 29, 2024
Nov 28, 2023
Oct 12, 2023
Nov 19, 2023
Oct 12, 2023
Oct 13, 2023
Nov 23, 2023
Mar 1, 2023

Repository files navigation

Tesseract

Tesseract Swift

Tesseract.swift provides Swift APIs for Tesseract, a dApp-Wallet bridge designed to make dApp/wallet communication on mobile devices simple and natural without compromising decentralization and security

If you are looking for Tesseract docs for another language/OS, please, consider one of the following:

Getting started

Tesseract provides two sets of APIs, one for a dApp that wants to connect to the wallets and one for the wallets that want to serve the dApps.

Here is how a typical Tesseract workflow looks like:

dApp Wallet
//initialize Tesseract with default config
let tesseract = Tesseract.default()

//indicate what blockchain are we gonna use
let substrateService = tesseract.service(SubstrateService.self)

//at this point Tesseract connects to the
//wallet and the wallet presents the user
//with its screen, asking if the user
//wants to share their public key to a dApp
let account = try await substrateService.getAccount(type: .sr25519)
//Inside the Wallet Tesseract serves requests
//from the dApps as long as the reference is kept alive
//save it somewhere in the Extension instance
let tesseract = Tesseract()
    .transport(IPCTransportIOS(self)) //add iOS IPC transport
    .service(MySubstrateService())
//MySubstrateService instance methods
//will be called when a dApp asks for something

Details

Because using Tesseract in Tesseract in a dApp and in a wallet is very different by nature (essentially communicating as a client and a service), the detailed documentation is split into two documents:

Examples

If you'd like to see examples of Tesseract integration, please, check:

More

Just in case, you'd like to use Tesseract on iOS via Rust APIs. It's also possible. Consider checking one of the following:

Roadmap

  • v0.1 - IPC transport for iOS - connect dApp/Wallet on the same device
  • v0.2 - demo dApp and Wallet
  • v0.3 - Susbtrate protocol support
  • v0.4 - dev-wallet.swift test implementation
  • v0.5 - first Swift libraries release version
  • v1.0 - support of everything mobile dApps need

License

Tesseract.swift can be used, distributed and modified under the Apache 2.0 license.