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
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export class LightningAddressService {
const lightningQuote = await sparkReceiveQuoteService.getLightningQuote({
wallet: account.wallet,
amount: amountToReceive,
receiverIdentityPubkey: user.sparkIdentityPublicKey,
receiverIdentityPublicKey: user.sparkIdentityPublicKey,
descriptionHash,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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).
*/
Expand Down Expand Up @@ -231,7 +231,7 @@ export type RepositoryCreateQuoteParams = {
export async function getLightningQuote({
wallet,
amount,
receiverIdentityPubkey,
receiverIdentityPublicKey,
description,
descriptionHash,
}: GetLightningQuoteParams): Promise<SparkReceiveLightningQuote> {
Expand All @@ -241,7 +241,7 @@ export async function getLightningQuote({
type: 'bolt11Invoice',
description: description ?? '',
amountSats: amount.toNumber('sat'),
receiverIdentityPubkey,
receiverIdentityPublicKey,
descriptionHash,
},
}),
Expand Down Expand Up @@ -277,7 +277,7 @@ export async function getLightningQuote({
memo: description,
},
status,
receiverIdentityPublicKey: receiverIdentityPubkey,
receiverIdentityPublicKey,
};
}

Expand Down
4 changes: 2 additions & 2 deletions apps/web-wallet/app/features/send/spark-send-quote-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export class SparkSendQuoteService {
'BreezSdk.prepareSendPayment',
() =>
account.wallet.prepareSendPayment({
paymentRequest,
paymentRequest: { type: 'input', input: paymentRequest },
amount: BigInt(amountRequestedInBtc.toNumber('sat')),
}),
);
Expand Down Expand Up @@ -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')),
});

Expand Down
2 changes: 1 addition & 1 deletion apps/web-wallet/app/features/shared/spark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
13 changes: 8 additions & 5 deletions apps/web-wallet/app/lib/spark/utils.ts
Original file line number Diff line number Diff line change
@@ -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';

/**
Expand All @@ -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<string> {
const signers = defaultExternalSigners(mnemonic, null, network);
const publicKey = await signers.sparkSigner.getIdentityPublicKey();
return bytesToHex(new Uint8Array(publicKey.bytes));
}

Expand Down
2 changes: 1 addition & 1 deletion apps/web-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading