TonKit.Swift
is a native(Swift) toolkit for TON network. it's based on TonKeeper libraries. It's implemented and used by Unstoppable Wallet, a multi-currency crypto wallet.
- Local storage of account data (TON, JETTONS balances and transactions)
- Synchronization over HTTP/WebSocket
- Watch accounts. Restore with any address
First you need to initialize an TonKit.Kit
instance
import TonKit
//from TonSwift library
let address = try FriedlyAddress(string: "0x...")
let TonKit = try Kit.instance(
type: .watch(address),
network: .mainnet,
walletId: "unique_wallet_id",
minLogLevel: .error
)
TonKit.Kit
instance requires to be started with start
command. This start the process of synchronization with the blockchain state.
TonKit.start()
TonKit.stop()
Swift Package Manager is a dependency manager for Swift projects. You can install it with the following command:
dependencies: [
.package(url: "https://github.com/horizontalsystems/TonKit.Swift.git", .upToNextMajor(from: "1.0.0"))
]
- Xcode 10.0+
- Swift 5.5+
- iOS 15+
All features of the library are used in example project located in iOS Example
folder. It can be referred as a starting point for usage of the library.
The TonKit.Swift
toolkit is open source and available under the terms of the MIT License.