Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
292 changes: 177 additions & 115 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "vss-rust-client-ffi"
version = "0.1.0"
version = "0.2.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -15,7 +15,11 @@ serde = { version = "^1.0.209", features = ["derive"] }
tokio = "1.40.0"
once_cell = "1.19.0"
thiserror = "2.0.12"
vss-client = { version = "0.1.0" }
vss-client = "0.3"
bitcoin = "0.32.0"
bip39 = "2.0.0"
prost = "0.11.6"
rand = "0.8.5"

[dev-dependencies]
tokio = { version = "1.40.0", features = ["full"] }
Expand Down
39 changes: 28 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,13 @@ cargo build --release
```swift
import vss_rust_client_ffi

// Initialize VSS client
try await vssNewClient(
// Initialize VSS client with LNURL-auth
try await vssNewClientWithLnurlAuth(
baseUrl: "https://vss.example.com",
storeId: "my-app-store"
storeId: "my-app-store",
mnemonic: "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about",
passphrase: nil,
lnurlAuthServerUrl: "https://auth.example.com/lnurl"
)

// Store data
Expand Down Expand Up @@ -70,11 +73,13 @@ vssShutdownClient()
```python
from vss_rust_client_ffi import *

# Initialize VSS client
await vss_new_client(
# Initialize VSS client with LNURL-auth
await vss_new_client_with_lnurl_auth(
"https://vss.example.com",
"my-app-store",
None
"my-app-store",
"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about",
None, # passphrase
"https://auth.example.com/lnurl"
)

# Store data
Expand Down Expand Up @@ -112,10 +117,13 @@ vss_shutdown_client()
```kotlin
import uniffi.vss_rust_client_ffi.*

// Initialize VSS client
vssNewClient(
// Initialize VSS client with LNURL-auth
vssNewClientWithLnurlAuth(
baseUrl = "https://vss.example.com",
storeId = "my-app-store"
storeId = "my-app-store",
mnemonic = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about",
passphrase = null,
lnurlAuthServerUrl = "https://auth.example.com/lnurl"
)

// Store data
Expand Down Expand Up @@ -146,11 +154,20 @@ vssShutdownClient()
### Client Management

#### `vssNewClient(baseUrl: String, storeId: String) -> Void`
Initialize the global VSS client connection.
Initialize the global VSS client connection without authentication.

- `baseUrl`: VSS server URL (e.g., "https://vss.example.com")
- `storeId`: Unique identifier for your storage namespace

#### `vssNewClientWithLnurlAuth(baseUrl: String, storeId: String, mnemonic: String, passphrase: String?, lnurlAuthServerUrl: String) -> Void`
Initialize the global VSS client connection with LNURL-auth authentication. Provides automatic JWT token management and data encryption.

- `baseUrl`: VSS server URL (e.g., "https://vss.example.com")
- `storeId`: Unique identifier for your storage namespace
- `mnemonic`: BIP39 mnemonic phrase (12 or 24 words)
- `passphrase`: Optional BIP39 passphrase (pass `null` if none)
- `lnurlAuthServerUrl`: LNURL-auth server URL for authentication

#### `vssShutdownClient() -> Void`
Shutdown the VSS client and clean up resources. Optional but recommended for clean application shutdown.

Expand Down
2 changes: 1 addition & 1 deletion bindings/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ android.useAndroidX=true
android.nonTransitiveRClass=true
kotlin.code.style=official
# project settings:
version=0.1.0
version=0.2.0
Binary file not shown.
Binary file not shown.
Binary file modified bindings/android/src/main/jniLibs/x86/libvss_rust_client_ffi.so
Binary file not shown.
Binary file not shown.
Loading