Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tesseract-one/tesseract.swift
Tesseract dApps Platform SDK for iOS and OSX
https://github.com/tesseract-one/tesseract.swift
blockchain dapps-development ethereum swift
Last synced: 28 days ago
JSON representation
Tesseract dApps Platform SDK for iOS and OSX
- Host: GitHub
- URL: https://github.com/tesseract-one/tesseract.swift
- Owner: tesseract-one
- License: apache-2.0
- Created: 2019-05-03T16:36:51.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-30T17:50:30.000Z (10 months ago)
- Last Synced: 2024-10-09T16:29:49.421Z (about 1 month ago)
- Topics: blockchain, dapps-development, ethereum, swift
- Language: Swift
- Homepage:
- Size: 357 KB
- Stars: 14
- Watchers: 5
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Tesseract Swift
**Tesseract.swift** provides Swift APIs for [Tesseract](https://github.com/tesseract-one/), 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:
* [General info](https://github.com/tesseract-one/)
* [Tesseract for Android](https://github.com/tesseract-one/Tesseract.android)
* [Tesseract shared Core (Rust)](https://github.com/tesseract-one/Tesseract.rs)## 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```swift
//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)
``````swift
//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:
* [Tesseract for dApp developers](./DAPP.MD)
* [Tesseract for Wallet developers](./WALLET.MD)## Examples
If you'd like to see examples of Tesseract integration, please, check:
* [dev-wallet.swift](https://github.com/tesseract-one/dev-wallet.swift) - for wallets
* [polkachat.swift](https://github.com/tesseract-one/polkachat.swift) - for dApps## 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:
* [Using Tesseract on iOS in Rust](./RUST.MD)
* [Polka Chat in Rust](https://github.com/tesseract-one/polkachat.rs)
* [Developer Wallet in Rust](https://github.com/tesseract-one/dev-wallet)## Roadmap
* [x] v0.1 - IPC transport for iOS - connect dApp/Wallet on the same device
* [x] v0.2 - demo dApp and Wallet
* [x] v0.3 - Susbtrate protocol support
* [x] v0.4 - [dev-wallet.swift](https://github.com/tesseract-one/dev-wallet.swift) test implementation
* [x] 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](LICENSE).