Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
30bed5e
Merge pull request #147 from lightsparkdev/release/lightspark-sdk-v0.…
github-actions[bot] Jan 29, 2024
37cac03
lnurlp fallback
shreyav Feb 6, 2024
2b23e5e
annotation and tests
shreyav Feb 7, 2024
1fcc69a
Merge pull request #150 from lightsparkdev/fix/overloads
shreyav Feb 7, 2024
f93008d
Merge pull request #149 from lightsparkdev/feat/lnurlp-fallback
shreyav Feb 7, 2024
570790e
fallback sender side
shreyav Feb 6, 2024
3fdd4b7
fix serialization
shreyav Feb 8, 2024
18f9ff5
unused import
shreyav Feb 8, 2024
3acf947
comments
shreyav Feb 8, 2024
9dd1184
Merge pull request #151 from lightsparkdev/feat/fallback-lnurlp-sender
shreyav Feb 8, 2024
b7b8501
fixes
shreyav Feb 9, 2024
ebea915
Merge pull request #152 from lightsparkdev/fix/lnurl-sender
shreyav Feb 9, 2024
ba616af
Try to fix docs publish job my running on main
jklein24 Feb 13, 2024
561bbda
Merge pull request #153 from lightsparkdev/fix/docspublish
jklein24 Feb 13, 2024
d650245
[gha] Use environment for doc-publish
mgorven Feb 13, 2024
b3ab9b1
[gha] Use environment for doc-publish
mgorven Feb 13, 2024
3410b5e
Fix sender vasp utxo callback
shreyav Feb 15, 2024
d44c831
Merge pull request #155 from lightsparkdev/fix/sender-vasp
shreyav Feb 15, 2024
e88f6fe
Switch to a full 64bit nonce
jklein24 Feb 21, 2024
99d182f
Merge pull request #156 from lightsparkdev/fix/64bitnonce
jklein24 Feb 21, 2024
63b654b
Use json for parsing in demo vasp (#163)
shreyav Mar 19, 2024
9aef4ff
Update the demo VASP's SDK version to 0.8.0
jklein24 Mar 21, 2024
b6066e8
Merge pull request #165 from lightsparkdev/feat/updatevaspsdk
jklein24 Mar 21, 2024
f10605e
Update the demo VASP's SDK version to 0.8.1
jklein24 Mar 21, 2024
dee939d
Merge pull request #166 from lightsparkdev/feat/updatevaspsdk2
jklein24 Mar 23, 2024
7d9733e
Accept gzip responses, compress request with deflate (#172)
mgorven May 13, 2024
9a954d4
Regenerate SDK (#173)
shreyav Jun 22, 2024
b411657
Update macos environment version (#175)
shreyav Jun 25, 2024
59d4a35
Uma data visibility (#174)
shreyav Jun 25, 2024
3003ada
fix typo (#176)
shreyav Jun 26, 2024
ba09e4c
encode hex (#177)
shreyav Jun 28, 2024
4a254c3
Bump lightspark-sdk to version 0.14.0
Jul 9, 2024
ea71c6d
Merge pull request #178 from lightsparkdev/release/lightspark-sdk-v0.…
github-actions[bot] Jul 9, 2024
ba193a7
Merge branch 'main' into merge/main
jklein24 Jul 9, 2024
9904b3e
Load signing key
jklein24 Jul 9, 2024
dc7a477
Merge pull request #180 from lightsparkdev/merge/main
jklein24 Jul 9, 2024
fd7723e
Revert "Merge release/lightspark-sdk-v0.14.0 into develop" (#181)
shreyav Jul 9, 2024
65d0d91
Bump lightspark-sdk to version 0.14.0
Jul 9, 2024
566812a
Merge pull request #182 from lightsparkdev/release/lightspark-sdk-v0.…
github-actions[bot] Jul 9, 2024
b0adede
update readme (#184)
shreyav Jul 11, 2024
e8214a0
Update invoice creator (#185)
shreyav Jul 16, 2024
a16afdf
Bump lightspark-sdk to version 0.15.0
Jul 16, 2024
c3f92c4
Merge branch 'main' into release/lightspark-sdk-v0.15.0
shreyav Jul 16, 2024
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
4 changes: 2 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ For example, to cut a release branch for version `1.0.0` of the `wallet-sdk` mod
the following from the `develop` branch:

```bash
git checkout -b release/wallet-sdk-1.0.0
git push -u origin release/wallet-sdk-1.0.0
git checkout -b release/wallet-sdk-v1.0.0
git push -u origin release/wallet-sdk-v1.0.0
```

Alternatively, you can create the new branch from the github UI.
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ktlint = "11.3.1"
ktor = "2.3.7"
lightsparkCore = "0.6.0"
lightsparkCrypto = "0.6.0"
uma = "1.1.1"
uma = "1.2.1"
mavenPublish = "0.25.2"
mockitoCore = "5.5.0"
taskTree = "2.1.1"
Expand Down
4 changes: 2 additions & 2 deletions lightspark-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ Start by installing the SDK from maven:
**build.gradle:**
```groovy
dependencies {
implementation "com.lightspark:lightspark-sdk:0.14.0"
implementation "com.lightspark:lightspark-sdk:0.15.0"
}
```

or with **build.gradle.kts:**
```kotlin
dependencies {
implementation("com.lightspark:lightspark-sdk:0.14.0")
implementation("com.lightspark:lightspark-sdk:0.15.0")
}
```

Expand Down
2 changes: 1 addition & 1 deletion lightspark-sdk/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GROUP=com.lightspark
POM_ARTIFACT_ID=lightspark-sdk
# Don't bump this manually. Run `scripts/versions.main.kt <new_version>` to bump the version instead.
VERSION_NAME=0.14.0
VERSION_NAME=0.15.0

POM_DESCRIPTION=The Lightspark API SDK for Kotlin and Java.
POM_INCEPTION_YEAR=2023
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,54 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.future.future
import me.uma.UmaInvoiceCreator

class LightsparkClientUmaInvoiceCreator(
/**
* Creates UMA invoices using the Lightspark client.
*
* @constructor Creates an instance of [LightsparkClientUmaInvoiceCreator].
*
* @param client The [LightsparkCoroutinesClient] used to create invoices.
* @param nodeId The ID of the node for which to create the invoice.
* @param expirySecs The number of seconds before the invoice expires.
* @param enableUmaAnalytics A flag indicating whether UMA analytics should be enabled. If `true`,
* the receiver identifier will be hashed using a monthly-rotated seed and used for anonymized
* analysis.
* @param signingPrivateKey Optional, the receiver's signing private key. Used to hash the receiver
* identifier if UMA analytics is enabled.
*/
class LightsparkClientUmaInvoiceCreator @JvmOverloads constructor(
private val client: LightsparkCoroutinesClient,
private val nodeId: String,
private val expirySecs: Int,
private val enableUmaAnalytics: Boolean = false,
private val signingPrivateKey: ByteArray? = null,
) : UmaInvoiceCreator {
private val coroutineScope = CoroutineScope(Dispatchers.IO)

constructor(apiClientId: String, apiClientSecret: String, nodeId: String, expirySecs: Int) : this(
@JvmOverloads
constructor(
apiClientId: String,
apiClientSecret: String,
nodeId: String,
expirySecs: Int,
enableUmaAnalytics: Boolean = false,
signingPrivateKey: ByteArray? = null,
) : this(
LightsparkCoroutinesClient(
ClientConfig(
authProvider = AccountApiTokenAuthProvider(apiClientId, apiClientSecret),
),
),
nodeId,
expirySecs,
enableUmaAnalytics,
signingPrivateKey,
)

override fun createUmaInvoice(amountMsats: Long, metadata: String) = coroutineScope.future {
client.createUmaInvoice(nodeId, amountMsats, metadata, expirySecs).data.encodedPaymentRequest
override fun createUmaInvoice(amountMsats: Long, metadata: String, receiverIdentifier: String?) = coroutineScope.future {
if (enableUmaAnalytics && signingPrivateKey != null) {
client.createUmaInvoice(nodeId, amountMsats, metadata, expirySecs, signingPrivateKey, receiverIdentifier)
} else {
client.createUmaInvoice(nodeId, amountMsats, metadata, expirySecs)
}.data.encodedPaymentRequest
}
}
8 changes: 7 additions & 1 deletion umaserverdemo/src/main/kotlin/com/lightspark/Vasp2.kt
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,13 @@ class Vasp2(
val response = try {
uma.getPayReqResponse(
query = request,
invoiceCreator = LightsparkClientUmaInvoiceCreator(client, config.nodeID, expirySecs),
invoiceCreator = LightsparkClientUmaInvoiceCreator(
client = client,
nodeId = config.nodeID,
expirySecs = expirySecs,
enableUmaAnalytics = true,
signingPrivateKey = config.umaSigningPrivKey,
),
metadata = getEncodedMetadata(),
receivingCurrencyCode = receivingCurrency.code,
receivingCurrencyDecimals = receivingCurrency.decimals,
Expand Down