branta 4.2.0
branta: ^4.2.0 copied to clipboard
A Branta SDK for Dart.
4.2.0 #
- Added:
DestinationType.usdtPolygonfor Polygon USDT.addPaymentencrypts the recipient with a random secret (same pattern as bitcoin).verify()parsespol:URIs withbranta_id/branta_secret; other query params (value,currency,user) are ignored for binding. A bare0xaddress isunknown. EVM address compare is case-insensitive. - Added:
DestinationType.usdcPolygonfor Polygon USDC. Same secret-key encrypt /pol:verify path asusdt_polygon. Token is the destination type on the payment;pol:remains the Polygon EVM scheme for both. - Added:
verify()matchincludesmatchedDestinations: the rails this scan bound (plaintext +type). Wallets should send from that list instead of filteringpayments[].destinations. - Changed:
polygonEvmDestinationTypesis{usdt_polygon, usdc_polygon}.verify()of apol:URI binds any family member whose decrypted address matches (match-if-any). - Changed:
pol:parsing no longer stamps a tokenDestinationTypeon the QR address. The scheme maps to the Polygon EVM family for verify; the token still comes from the matched payment destination. - Fixed:
verify()swap-checks only the secret-key rail family for the QR scheme, so a payment with both bitcoin and a Polygon rail no longer returnstamperedfor a valid single-rail QR.
4.0.1 #
- Fixed: malformed percent-encoded QR query params (
%ZZ, truncated1%) no longer throwArgumentErrorout ofverify(); bad params are skipped as intended
4.0.0 #
- Breaking:
verifyreplacesgetPaymentsAsyncandgetPaymentsByQrCodeAsync. It returnsmatch,unknown,tampered, orincomplete. A swapped address istampered. A 404, a bare address, and a bolt11 / Ark / silent-payment lookup that does not decrypt areunknown. 5xx, 429, and no network areincomplete. - Breaking: removed
PrivacyMode. Every destination is encrypted.BrantaClientOptionsandBrantaServerBaseUrlare nowBrantaApiOptionsandBrantaEnvironment. - Breaking:
Destination.idis the public name for the wire fieldzk_id.addPaymentencrypts a copy and leaves the caller'sPaymentunchanged. Description is stored in encrypted metadata. An unset TTL is omitted.DestinationTypeisbitcoin_address,bolt11,ark_address, andsilent_payment. - The public library no longer exports the HTTP client, QR parser, AES helpers, or
QRParseException. - Breaking: removed
Payment.getDefaultValue.
3.2.4 #
- Fixed:
getPaymentsByQrCodeAsyncnow requires every payment instruction in a scanned QR code to match a decrypted destination. A swapped address with a rewrittenbranta_secret, an added lightning/ark/silent-payment leg that does not match the registered record, or a conflictingbc=/tb=address no longer comes back as verified. QR codes carryingbolt12,lno=,pay=, or LNURL instructions return no payments (ported frombranta-js) - Added: BIP-321
bc,tb,sp, andlnoquery parameters are parsed byQRParser;QRParser.hasUnverifiableInstructionflags instructions the SDK cannot bind to a decrypted destination
3.2.3 #
- Added: recognize signet and regtest Ark addresses (
tark1) asarkAddress, alongside mainnetark1. Strict-mode hash-ZK lookup and registration treat them the same way asark1.
3.2.2 #
- Fixed: a same-origin validation gap: if the first payment in a
getPaymentsresponse had noplatformLogoUrl, validation silently stopped checking every later payment's logo URLs entirely. Logo-URL checks now run independently per payment, and now also coverplatformLogoLightUrl,parentPlatform.logoUrl/logoLightUrl, andchildPlatform.logoUrl/logoLightUrl(previously onlyplatformLogoUrlwas checked)
3.2.1 #
- Fixed:
getPaymentsByQrCodeAsyncnow verifies that the plaintext Bitcoin address parsed from a scanned QR code matches the address decrypted viabranta_id/branta_secret, throwingBrantaPaymentExceptionwithreason: BrantaPaymentExceptionReason.tamperedon mismatch. Closes a gap where an attacker could swap the visible address in abitcoin:URI while leaving a legitimate, verifiedbranta_id/branta_secretpair untouched (ported frombranta-js3.2.1)
3.2.0 #
- Added
silentPayment(sp1/tsp1) toDestinationType, with hash-based ZK support and QR parsing (silent_paymentparam, plain-text detection) - Added encrypted metadata support:
addPaymentAsyncencryptsPayment.metadatawith a per-payment DEK that is itself encrypted per-destination (Destination.encryptedDek); metadata is decrypted automatically alongside destinations on retrieval - Added
Payment.childPlatformandPaymentBuilder.setChildPlatform()for the child platform flow, mirroring the existingparentPlatformsupport
3.1.1 #
- Sync README with sibling SDKs
3.1.0 #
- Complete rewrite to achieve feature parity with
branta-dotnetandbranta-jsv3.1.0 - Replaced
BrantaConfigwithBrantaClientOptions(addsprivacy,hmacSecret,defaultApiKey) - Added
PrivacyModeenum (strict/loose); strict is the default - Split HTTP layer into
BrantaClient(raw HTTP) andBrantaService(orchestration) getPaymentsAsyncandgetPaymentsByQrCodeAsyncnow returnPaymentsResult(payments +verifyUrl)addPaymentAsyncnow returnsAddPaymentResult(payment + secret +verifyUrl)- Added ZK support: hash-based deterministic encryption for bolt11 and ark addresses; secret-based for bitcoin addresses
QRParserrewritten to support combined QR codes (bitcoin:+lightning=/ark=params),branta_id/branta_secret, and plain-text address detectionPaymentBuilder.setZk()marks the last destination as ZK and assigns a UUIDzkIdverifyUrlincludes#k-{zkId}={key}fragments for each decrypted ZK destination- Removed
json_serializable/build_runnerin favour of hand-writtenfromJson/toJson - Added
Platformmodel andparentPlatform/btcPayServerPluginVersionfields onPayment
1.0.0 #
- SDK parity with
branta-core:getPaymentsAsync,getZKPaymentsAsync,addPaymentAsyncnow return/throwBrantaPaymentExceptionon errors instead of silently returning empty lists addPaymentAsyncthrowsBrantaPaymentException('Unauthorized')when no API key is configuredgetPaymentsAsyncvalidatesplatformLogoUrldomain against configuredbaseUrlto prevent open redirect attacks- Payments returned from all fetch methods now include a
verifyUrlbuilt from the configured base URL - Address parameter in
getPaymentsAsyncis now URL-encoded - Added
DestinationTypeenum andtypefield onDestination - Added CI/CD workflow via GitHub Actions
0.0.3 #
- #10 Add
.pubignoreto exclude development files (tests, Makefile, CLAUDE.md) from the published package
0.0.2 #
0.0.1 #
- Initial version.