From 56a9f006441b3a4bf36f269b15cc0cbf363ffa9c Mon Sep 17 00:00:00 2001 From: Blake Kaufman Date: Tue, 19 May 2026 12:18:17 -0400 Subject: [PATCH] bump branta version --- .../sendBitcoin/functions/decodeSendAdress.js | 12 ++++++------ app/functions/branta/index.js | 8 +++++--- package.json | 3 ++- pollyfills.js | 3 +++ yarn.lock | 13 +++++++------ 5 files changed, 23 insertions(+), 16 deletions(-) diff --git a/app/components/admin/homeComponents/sendBitcoin/functions/decodeSendAdress.js b/app/components/admin/homeComponents/sendBitcoin/functions/decodeSendAdress.js index 86d58837..0add6d9f 100644 --- a/app/components/admin/homeComponents/sendBitcoin/functions/decodeSendAdress.js +++ b/app/components/admin/homeComponents/sendBitcoin/functions/decodeSendAdress.js @@ -256,8 +256,8 @@ export default async function decodeSendAddress(props) { if (shouldRunBrantaVerification) { brantaVerificationPromise.then(brantaResult => { - if (brantaResult && brantaResult.length) { - const [details] = brantaResult; + if (brantaResult && brantaResult.payments?.length) { + const [details] = brantaResult.payments; if (details.platformLogoUrl) { ExpoImage.prefetch(details.platformLogoUrl).catch(err => console.log('Error prefetching branta merchant logo', err), @@ -314,8 +314,8 @@ export default async function decodeSendAddress(props) { }; } - if (brantaVerification && brantaVerification.length) { - const [details] = brantaVerification; + if (brantaVerification && brantaVerification.payments?.length) { + const [details] = brantaVerification.payments; const isHttpsUrl = val => typeof val === 'string' && val.startsWith('https://'); processedPaymentInfo = { @@ -325,8 +325,8 @@ export default async function decodeSendAddress(props) { brantaMerchantLogo: isHttpsUrl(details.platformLogoUrl) ? details.platformLogoUrl : undefined, - verificationURL: isHttpsUrl(details.verifyUrl) - ? details.verifyUrl + verificationURL: isHttpsUrl(brantaVerification.verifyUrl) + ? brantaVerification.verifyUrl : undefined, }; } diff --git a/app/functions/branta/index.js b/app/functions/branta/index.js index ea095254..0d7b7049 100644 --- a/app/functions/branta/index.js +++ b/app/functions/branta/index.js @@ -1,13 +1,15 @@ -import { BrantaServerBaseUrl, V2BrantaClient } from '@branta-ops/branta'; +import { BrantaServerBaseUrl } from '@branta-ops/branta'; +import { BrantaService } from '@branta-ops/branta/v2'; -const brantaClient = new V2BrantaClient({ +const service = new BrantaService({ baseUrl: BrantaServerBaseUrl.Production, privacy: 'strict', }); export async function handleBrantaVerification(qrCode) { try { - const brantaResponse = await brantaClient.getPaymentsByQRCode(qrCode ?? ''); + const brantaResponse = await service.getPaymentsByQrCode(qrCode ?? ''); + console.log(brantaResponse); return brantaResponse; } catch (err) { console.log('Error retriving branta verification', err); diff --git a/package.json b/package.json index 36057afe..0e06ae8e 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ }, "dependencies": { "@azure/core-asynciterator-polyfill": "^1.0.2", - "@branta-ops/branta": "2.0.0", + "@branta-ops/branta": "^3.1.2", "@breeztech/react-native-breez-sdk-liquid": "^0.11.9", "@buildonspark/spark-sdk": "^0.8.0", "@craftzdog/react-native-buffer": "^6.1.0", @@ -103,6 +103,7 @@ "react-native-safe-area-context": "~5.6.0", "react-native-screens": "~4.16.0", "react-native-svg": "15.12.1", + "react-native-url-polyfill": "^3.0.0", "react-native-view-shot": "^4.0.3", "react-native-vision-camera": "^5.0.9", "react-native-vision-camera-barcode-scanner": "^5.0.9", diff --git a/pollyfills.js b/pollyfills.js index a08df10c..0be3a716 100644 --- a/pollyfills.js +++ b/pollyfills.js @@ -6,6 +6,9 @@ import '@azure/core-asynciterator-polyfill'; //neeed for encription + spark import 'react-native-quick-base64'; +// needed for branta ops +import 'react-native-url-polyfill/auto'; + import { Buffer } from '@craftzdog/react-native-buffer'; import QuickCrypto, { pbkdf2Sync, diff --git a/yarn.lock b/yarn.lock index 2957931f..a6cc5383 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1776,10 +1776,10 @@ __metadata: languageName: node linkType: hard -"@branta-ops/branta@npm:2.0.0": - version: 2.0.0 - resolution: "@branta-ops/branta@npm:2.0.0" - checksum: 6966c87c85ee8547541849aa5b5499c8927b5808f79ab4f96f3ad38c0ff21f1162f381c1f4c196adf4ee6b9378e09463e0c2fe81a03d4c58f724ae4a0adce4e0 +"@branta-ops/branta@npm:^3.1.2": + version: 3.1.2 + resolution: "@branta-ops/branta@npm:3.1.2" + checksum: f9e5947ad8e812e296c4a5bf41da1919101bdd3dc5501095f74605d398b30c6b4528f35dfebf4b9480b3ed36edcdad0e701df415d4c712c640d8e4f507bf77a2 languageName: node linkType: hard @@ -4919,7 +4919,7 @@ __metadata: "@babel/plugin-transform-class-static-block": ^7.28.3 "@babel/preset-env": ^7.28.3 "@babel/runtime": ^7.25.0 - "@branta-ops/branta": 2.0.0 + "@branta-ops/branta": ^3.1.2 "@breeztech/react-native-breez-sdk-liquid": ^0.11.9 "@buildonspark/spark-sdk": ^0.8.0 "@craftzdog/react-native-buffer": ^6.1.0 @@ -5022,6 +5022,7 @@ __metadata: react-native-safe-area-context: ~5.6.0 react-native-screens: ~4.16.0 react-native-svg: 15.12.1 + react-native-url-polyfill: ^3.0.0 react-native-view-shot: ^4.0.3 react-native-vision-camera: ^5.0.9 react-native-vision-camera-barcode-scanner: ^5.0.9 @@ -13329,7 +13330,7 @@ __metadata: languageName: node linkType: hard -"react-native-url-polyfill@npm:3.0.0": +"react-native-url-polyfill@npm:3.0.0, react-native-url-polyfill@npm:^3.0.0": version: 3.0.0 resolution: "react-native-url-polyfill@npm:3.0.0" dependencies: