Swiftpack.co - kukai-wallet/kukai-core-swift as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by kukai-wallet.
kukai-wallet/kukai-core-swift 0.1.3
Kukai Core Swift is a native Swift library for interacting with the Tezos blockchain and other applications in the Tezos ecosystem
⭐️ 9
🕓 1 year ago
.package(url: "https://github.com/kukai-wallet/kukai-core-swift.git", from: "0.1.3")

Kukai Core Swift

Platforms Swift Package Manager License

Kukai Core Swift is a native Swift library for interacting with the Tezos blockchain and other applications in the Tezos ecosystem, such as the indexer TzKT and the smart contract explorer Better Call Dev. It leverages WalletCore the open source library built by TrustWallet, for key and wallet creation.

Feature set includes:

  • Create Linear or HD Wallets
  • A service to cache and retrieve encrypted wallet details from disk, using the secure enclave
  • Fetching a wallet's XTZ balance, all FA token balances, owned NFT's grouped together by type, all in a single function call
  • Fetching and caching token metadata
  • Fetching transaction history
  • Remote forging using a second node or Local forging via @taquito/local-forging
  • Estimating Gas, Storage and Fees for operations
  • Parsing Michelson JSON into a Swift object using Codable
  • Wait for an operation to be injected


Kukai Core Swift supports the Swift Package Manager. Either use the Xcode editor to add to your project by clicking File -> Swift Packages -> Add Package Dependency, search for the git repo https://github.com/kukai-wallet/kukai-core-swift.git and choose from version 0.1.0.

Or add it to your Package.swift dependencies like so:

dependencies: [
    .package(url: "https://github.com/kukai-wallet/kukai-core-swift", from: "0.1.0")

How to use

Wallets are created using dedicated classes for each type, conforming to the Wallet protocol.

  • LinearWallet
    • Created using a BIP 39 mnemonic and optional passphrase
  • HDWallet
    • Created using a BIP 39 mnemonic, optional passphrase, and a BIP 44 derivation path

The main functionality centres around client classes and a factory:

  • TezosNodeClient
    • Query details about the node
    • Estimate fees via the node RPC
    • Send operations
  • BetterCallDevClient
    • Fetching balances
    • Fetching metadata
    • Detailed operation errors
  • TzKTClient
    • Transaction history
    • Determining if an operation has been successfully injected
  • OperationFactory
    • Helper methods to create arrays of operations needed for common tasks

You can see some of this functionality inside the repo's example iOS-Example project. The app is a simple tableview, with the first section responsible for creating and caching wallets. The rest of the sections will load the cached wallet and use its details to fetch/display balances or estiamte/send operations.


Compiled Swift Doc's can be found here


Stars: 9
Last commit: Yesterday
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics