From 0ed711c9e2324b5c3078c3e1ad23756f0fed44a0 Mon Sep 17 00:00:00 2001 From: Ditto Date: Thu, 27 Aug 2026 14:43:29 +0200 Subject: [PATCH] chore(deps): update @agicash/breez-sdk-spark to 0.23.0-1 (live) Same change as #1181 (master commits 003d3ae4 + 64d6878d), applied to the pre-SDK-extraction layout on live: - defaultExternalSigner -> defaultExternalSigners; identity key now comes from the async sparkSigner.getIdentityPublicKey(), so getSparkIdentityPublicKeyFromMnemonic is now async - Config.optimizationConfig -> Config.leafOptimizationConfig - prepareSendPayment paymentRequest is now a tagged union; wrap the bolt11 string as { type: 'input', input } - rename getLightningQuote param to receiverIdentityPublicKey to match the SDK field The dep stays declared in apps/web-wallet only: on live no second package uses it, so the catalog move from master does not apply. Co-Authored-By: Claude Fable 5 --- .../features/receive/lightning-address-service.ts | 2 +- .../features/receive/spark-receive-quote-core.ts | 8 ++++---- .../app/features/send/spark-send-quote-service.ts | 4 ++-- apps/web-wallet/app/features/shared/spark.ts | 2 +- apps/web-wallet/app/lib/spark/utils.ts | 13 ++++++++----- apps/web-wallet/package.json | 2 +- bun.lock | 4 ++-- 7 files changed, 19 insertions(+), 16 deletions(-) diff --git a/apps/web-wallet/app/features/receive/lightning-address-service.ts b/apps/web-wallet/app/features/receive/lightning-address-service.ts index a660d8af2..78f0d4d13 100644 --- a/apps/web-wallet/app/features/receive/lightning-address-service.ts +++ b/apps/web-wallet/app/features/receive/lightning-address-service.ts @@ -234,7 +234,7 @@ export class LightningAddressService { const lightningQuote = await sparkReceiveQuoteService.getLightningQuote({ wallet: account.wallet, amount: amountToReceive, - receiverIdentityPubkey: user.sparkIdentityPublicKey, + receiverIdentityPublicKey: user.sparkIdentityPublicKey, descriptionHash, }); diff --git a/apps/web-wallet/app/features/receive/spark-receive-quote-core.ts b/apps/web-wallet/app/features/receive/spark-receive-quote-core.ts index aa8049b0f..a4db9c6c5 100644 --- a/apps/web-wallet/app/features/receive/spark-receive-quote-core.ts +++ b/apps/web-wallet/app/features/receive/spark-receive-quote-core.ts @@ -48,7 +48,7 @@ export type GetLightningQuoteParams = { * If provided, the incoming payment can only be claimed by the Spark wallet that controls the specified public key. * If not provided, the invoice will be created for the user that owns the Spark wallet. */ - receiverIdentityPubkey?: string; + receiverIdentityPublicKey?: string; /** * The description of the receive request (BOLT11 `d` tag). */ @@ -231,7 +231,7 @@ export type RepositoryCreateQuoteParams = { export async function getLightningQuote({ wallet, amount, - receiverIdentityPubkey, + receiverIdentityPublicKey, description, descriptionHash, }: GetLightningQuoteParams): Promise { @@ -241,7 +241,7 @@ export async function getLightningQuote({ type: 'bolt11Invoice', description: description ?? '', amountSats: amount.toNumber('sat'), - receiverIdentityPubkey, + receiverIdentityPublicKey, descriptionHash, }, }), @@ -277,7 +277,7 @@ export async function getLightningQuote({ memo: description, }, status, - receiverIdentityPublicKey: receiverIdentityPubkey, + receiverIdentityPublicKey, }; } diff --git a/apps/web-wallet/app/features/send/spark-send-quote-service.ts b/apps/web-wallet/app/features/send/spark-send-quote-service.ts index c0f01c32c..9cda09255 100644 --- a/apps/web-wallet/app/features/send/spark-send-quote-service.ts +++ b/apps/web-wallet/app/features/send/spark-send-quote-service.ts @@ -152,7 +152,7 @@ export class SparkSendQuoteService { 'BreezSdk.prepareSendPayment', () => account.wallet.prepareSendPayment({ - paymentRequest, + paymentRequest: { type: 'input', input: paymentRequest }, amount: BigInt(amountRequestedInBtc.toNumber('sat')), }), ); @@ -264,7 +264,7 @@ export class SparkSendQuoteService { } const prepareResponse = await account.wallet.prepareSendPayment({ - paymentRequest: sendQuote.paymentRequest, + paymentRequest: { type: 'input', input: sendQuote.paymentRequest }, amount: BigInt(sendQuote.amount.toNumber('sat')), }); diff --git a/apps/web-wallet/app/features/shared/spark.ts b/apps/web-wallet/app/features/shared/spark.ts index 93cb8d7fc..28f6124be 100644 --- a/apps/web-wallet/app/features/shared/spark.ts +++ b/apps/web-wallet/app/features/shared/spark.ts @@ -110,7 +110,7 @@ export const sparkWalletQueryOptions = ({ apiKey, lnurlDomain: undefined, // Disables Breez's built-in lightning address recovery — we use our own ln address system privateEnabledDefault: true, - optimizationConfig: { + leafOptimizationConfig: { autoEnabled: true, multiplicity: 2, }, diff --git a/apps/web-wallet/app/lib/spark/utils.ts b/apps/web-wallet/app/lib/spark/utils.ts index c4ac55459..c8b476c14 100644 --- a/apps/web-wallet/app/lib/spark/utils.ts +++ b/apps/web-wallet/app/lib/spark/utils.ts @@ -1,4 +1,7 @@ -import { type BreezSdk, defaultExternalSigner } from '@agicash/breez-sdk-spark'; +import { + type BreezSdk, + defaultExternalSigners, +} from '@agicash/breez-sdk-spark'; import { bytesToHex } from '@noble/hashes/utils'; /** @@ -7,12 +10,12 @@ import { bytesToHex } from '@noble/hashes/utils'; * @param network - The Breez SDK network ('mainnet' or 'regtest'). * @returns Hex-encoded compressed public key. */ -export function getSparkIdentityPublicKeyFromMnemonic( +export async function getSparkIdentityPublicKeyFromMnemonic( mnemonic: string, network: 'mainnet' | 'regtest', -): string { - const signer = defaultExternalSigner(mnemonic, null, network); - const publicKey = signer.identityPublicKey(); +): Promise { + const signers = defaultExternalSigners(mnemonic, null, network); + const publicKey = await signers.sparkSigner.getIdentityPublicKey(); return bytesToHex(new Uint8Array(publicKey.bytes)); } diff --git a/apps/web-wallet/package.json b/apps/web-wallet/package.json index c537c2620..39102d4bb 100644 --- a/apps/web-wallet/package.json +++ b/apps/web-wallet/package.json @@ -18,7 +18,7 @@ }, "dependencies": { "@agicash/bc-ur": "0.1.0", - "@agicash/breez-sdk-spark": "0.13.5-1", + "@agicash/breez-sdk-spark": "0.23.0-1", "@agicash/opensecret": "catalog:", "@agicash/qr-scanner": "0.1.2", "@cashu/cashu-ts": "3.6.1", diff --git a/bun.lock b/bun.lock index a67c97264..b7cb7c31b 100644 --- a/bun.lock +++ b/bun.lock @@ -15,7 +15,7 @@ "name": "web-wallet", "dependencies": { "@agicash/bc-ur": "0.1.0", - "@agicash/breez-sdk-spark": "0.13.5-1", + "@agicash/breez-sdk-spark": "0.23.0-1", "@agicash/opensecret": "catalog:", "@agicash/qr-scanner": "0.1.2", "@cashu/cashu-ts": "3.6.1", @@ -129,7 +129,7 @@ "packages": { "@agicash/bc-ur": ["@agicash/bc-ur@0.1.0", "", { "dependencies": { "@apocentre/alias-sampling": "^0.5.3", "@noble/hashes": "^1.3.3", "big.js": "^6.2.2", "buffer": "^6.0.3", "cbor-sync": "^1.0.4", "cborg": "^4.0.9", "jsbi": "3.1.5" } }, "sha512-B2Hh7dSqdeVZuMCwdNR0MXUr4fUU5n+gTWd0b0m9HpV6/mAXRMnAfuJbeax/krvHf8A3qMxFLAkTBKcSxUSPuw=="], - "@agicash/breez-sdk-spark": ["@agicash/breez-sdk-spark@0.13.5-1", "", { "optionalDependencies": { "better-sqlite3": "^12.2.0", "pg": "^8.18.0" } }, "sha512-Sa8Re7nnT3U2sxxJ77FB1aYcsGSi1yJpBB9mOtE4/F5/WX9+De4eXr6zH/LgMphwrq/Gany3OEmJrvoAaIMqLA=="], + "@agicash/breez-sdk-spark": ["@agicash/breez-sdk-spark@0.23.0-1", "", { "optionalDependencies": { "better-sqlite3": "^12.2.0", "pg": "^8.18.0" } }, "sha512-vCX0daoeVaHmDafLhZKWKK07tlRx+SwWyDdGy/7sSZ8fGuX7IH9W12htYRW3J+DM3UCfDELyPm8sOWr+pXNSZQ=="], "@agicash/opensecret": ["@agicash/opensecret@0.1.0", "", { "dependencies": { "@peculiar/x509": "^1.12.2", "@stablelib/base64": "^2.0.0", "@stablelib/chacha20poly1305": "^2.0.0", "@stablelib/random": "^2.0.0", "cbor2": "^1.7.0", "tweetnacl": "^1.0.3", "zod": "^3.23.8" }, "peerDependencies": { "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" } }, "sha512-5cbr7hgKlrY3aLm2RPrk9+xfserhEgG60V+zxtABcD0ZG7Gw6AgeMUuijWyp8mAqZ7G+bZr4Us0ZvGq63ISzog=="],