Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/polywrap/swift-client
https://github.com/polywrap/swift-client
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/polywrap/swift-client
- Owner: polywrap
- Created: 2023-03-13T23:14:35.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-20T15:05:04.000Z (over 1 year ago)
- Last Synced: 2024-10-18T19:28:58.231Z (3 months ago)
- Language: Swift
- Size: 10.9 MB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
- awesome-polywrap - Swift
README
![polywrap-banner](https://raw.githubusercontent.com/polywrap/branding/master/assets/banner.png)
# Swift Client [![codecov](https://codecov.io/gh/polywrap/swift-client/branch/main/graph/badge.svg?token=JvNaa0OHjc)](https://codecov.io/gh/polywrap/swift-client)
Implementation of the Polywrap client in Swift.
## Installation
PolywrapClient is available through Swift Package Manager and Cocoapods.
#### Via Cocoapods
Add pod to your Podfile:
```Ruby
pod 'PolywrapClient'
```#### Via Xcode Menu
To add Polywrap Client as an SPM package to your project in Xcode you must do: File -> Swift Packages -> Add Package Dependency. And then enter https://github.com/polywrap/swift-client
#### Via Package file
Add it as a dependency within your Package.swift manifest:
```swift
let package = Package(
...
dependencies: [
.package(url: "https://github.com/polywrap/swift-client.git", from: "0.0.3")
],
...
)
```## Getting started
Create a new Polywrap Client Config Builder instance, add the bundles you want to use, and then create a new Polywrap Client instance from the builder.
```swift
import PolywrapClientstruct CatArgs: Codable {
var cid: String
var ipfsProvider: String
}func main() throws {
let client = BuilderConfig()
.addSystemDefault()
.build()let catResult: Data = try client.invoke(
uri: try Uri("wrapscan.io/polywrap/[email protected]"),
method: "cat",
args: CatArgs(
cid: resolveResult.cid,
ipfsProvider: resolveResult.provider
)
)print(catResult)
}
```## Resources
- [Documentation](https://docs.polywrap.io/)
- [Examples](./Example)
- [Features supported](https://github.com/polywrap/client-readiness/tree/main/clients/swift/Sources/Readiness/Features)
- [Support](https://discord.polywrap.io)## Contributions
Please check out our [contributing guide](./CONTRIBUTING.md) for guidelines about how to proceed.