Skip to content

LF-Decentralized-Trust-labs/aries-uniffi-wrappers

Repository files navigation

Aries uniffi wrappers

This repository contains the wrappers for the following libraries:

The wrappers are generated using UniFFI. UniFFI can generate several language bindings including Swift, Kotlin, and Python. Kotlin wrappers are generated with Gobley.

Usage

Swift

The Swift wrappers are distributed as a Swift Package. To use the wrappers in your project, add the following dependency to your Package.swift:

    .package(url: "https://github.com/hyperledger/aries-uniffi-wrappers", from: "0.1.0"),

And add the following dependency to your target:

    .target(
        name: "MyTarget",
        dependencies: [
            .product(name: "AriesAskar", package: "aries-uniffi-wrappers"),
            .product(name: "AnonCreds", package: "aries-uniffi-wrappers"),
            .product(name: "IndyVdr", package: "aries-uniffi-wrappers"),
        ]
    ),

Take a look at the tests in swift/Tests directory for examples on how to use the wrappers.

Kotlin

The Kotlin wrappers are distributed as a Maven package hosted by GitHub Packages. To add a github packages repository in a seperate project you will have to have a github token with read:packages permissions. Then you will add the repository to your build.gradle.kts like so:

    repositories {
        mavenCentral()
        google()
        maven {
            setUrl("https://maven.pkg.github.com/LF-Decentralized-Trust-labs/aries-uniffi-wrappers")
            credentials {
                username = getExtraString("githubUsername")
                password = getExtraString("githubToken")
            }
        }
    }

Now you will add the libraries as a dependency in your build.gradle.kts like so:

    dependencies {
        implementation("org.hyperledger:anoncreds_uniffi:0.3.0-wrapper.0")
        implementation("org.hyperledger:indy_vdr_uniffi:0.3.0-wrapper.0")
        implementation("org.hyperledger:askar_uniffi:0.3.0-wrapper.0")
    }

If you would like to add desktop JVM targets you can do so by also adding them as a dependency like so:

// Main library
implementation("org.hyperledger:indy_vdr_uniffi:0.3.0-wrapper.0")

// Desktop targets
listOf(
    "win32-x86-64",
    "linux-x86-64",
    "linux-aarch64",
    "darwin-aarch64",
    "darwin-x86-64"
).forEach{
    implementation("org.hyperledger:indy_vdr_uniffi-jvm:0.3.0-wrapper.0:$it")
}

Take a look at the tests in kotlin/${library}/src/commonTest for usage examples.

Contributing

Pull requests are welcome! We enforce developer certificate of origin (DCO) commit signing. See guidance here.

Please see our Developer Guide for more information.

License

Aries uniffi wrappers are licensed under the Apache License 2.0.

About

aries-uniffi-wrappers

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 4

  •  
  •  
  •  
  •