SwiftCardanoCore is a Swift implementation of Cardano Data Types with CBOR (and JSON) serialization.
To add SwiftCardanoCore as dependency to your Xcode project, select File
> Swift Packages
> Add Package Dependency
, enter its repository URL: https://github.com/Kingpin-Apps/swift-cardano-core.git
and import SwiftCardanoCore
.
Then, to use it in your source code, add:
import SwiftCardanoCore
let paymentSKey = try PaymentSigningKey.generate()
paymentSKey.save(to: "payment.skey")
let paymentVKey: PaymentVerificationKey = try PaymentVerificationKey.fromSigningKey(sk)
paymentVKey.save(to: "payment.vkey")
let stakeSKey = try StakeSigningKey.generate()
stakeSKey.save(to: "stake.skey")
let stakeVKey: StakeVerificationKey = try StakeVerificationKey.fromSigningKey(sk)
stakeVKey.save(to: "stake.vkey")
let address = try Address(paymentPart: .verificationKeyHash(try paymentVKey.hash()), stakePart: .verificationKeyHash(try stakeVKey.hash()), network: .testnet)
address.save(to: "address.addr")
- Addresses
- Certificate
- Config Files
- Governance
- Keys
- Metadata
- Native Scripts
- Parameters
- Plutus
- Stake Pools
- Transactions
- Credentials
- Hashing
- Network
- Signatures
- And more...