
Solana-Swift

Solana Swift SDK (Based off https://docs.solana.com/developing/clients/jsonrpc-api).
This is actively WIP at the moment. PR’s welcome! Development happening in the demo app repo
Getting Started
Swift Package Manager (Xcode 11 and above)
- Select
File
/Swift Packages
/Add Package Dependency
from 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 Solana
Create 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
getFeeRateGovernor
Feel free to say hi on Discord: crewshin#3286
Solana-Swift
Solana Swift SDK (Based off https://docs.solana.com/developing/clients/jsonrpc-api).
This is actively WIP at the moment. PR’s welcome! Development happening in the demo app repo
Getting Started
Swift Package Manager (Xcode 11 and above)
File
/Swift Packages
/Add Package Dependency
from the menu.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
Create an instance of Solana:
or (not functional yet)
Then:
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:
Feel free to say hi on Discord:
crewshin#3286