crewshin/solana-swift

Getting Started
Swift Package Manager (Xcode 11 and above)
- Select
File/Swift Packages/Add Package Dependencyfrom the menu. - Paste
https://github.com/crewshin/solana-swift.git.
Why not CocoaPods, or Carthage?
Supporting multiple dependency managers makes maintaining a library exponentially more complicated and time consuming. Furthermore, with the integration of the Swift Package Manager in Xcode 11 and greater, I expect the need for alternative solutions to fade quickly.
Usage
import SolanaCreate an instance of Solana:
let solana = Solana(network: .main)or (not functional yet)
let solana = SolanaSockets(network: .main)Then:
solana.getAccountInfo(pubkey: pubkey) { (result) in
switch result {
case .failure(let error):
if case let SolanaAPIError.getAccountInfoError(message) = error {
print(message)
}
case .success(let response):
if let value = response.value {
print(value)
}
}
}
WIP Status
I'm basically going down the list of methods from the JSON RPC
Right now I've implemented the foundational stuff and am n this commit, I've done a first pass on:
getAccountInfo
getBalance
getBlockCommitment
getBlockTime
getClusterNodes
getConfirmedBlock
getBlockProduction
getConfirmedBlocks
getConfirmedBlocksWithLimit
getConfirmedSignaturesForAddress
getConfirmedSignaturesForAddress2
getConfirmedTransaction
getEpochInfo
getEpochSchedule
getFeeCalculatorForBlockhash
getFeeRateGovernorFeel free to say hi on Discord: crewshin#3286
Package Metadata
Repository: crewshin/solana-swift
Stars: 12
Forks: 2
Open issues: 0
Default branch: main
Primary language: swift
License: MIT
Topics: hacktoberfest, solana, swift
README: README.md