Skip to main content

branta 4.0.0 copy "branta: ^4.0.0" to clipboard
branta: ^4.0.0 copied to clipboard

A Branta SDK for Dart.

4.0.0 #

  • Breaking: verify replaces getPaymentsAsync and getPaymentsByQrCodeAsync. It returns match, unknown, tampered, or incomplete. A swapped address is tampered. A 404, a bare address, and a bolt11 / Ark / silent-payment lookup that does not decrypt are unknown. 5xx, 429, and no network are incomplete.
  • Breaking: removed PrivacyMode. Every destination is encrypted. BrantaClientOptions and BrantaServerBaseUrl are now BrantaApiOptions and BrantaEnvironment.
  • Breaking: Destination.id is the public name for the wire field zk_id. addPayment encrypts a copy and leaves the caller's Payment unchanged. Description is stored in encrypted metadata. An unset TTL is omitted. DestinationType is bitcoin_address, bolt11, ark_address, and silent_payment.
  • The public library no longer exports the HTTP client, QR parser, AES helpers, or QRParseException.
  • Breaking: removed Payment.getDefaultValue.

3.2.4 #

  • Fixed: getPaymentsByQrCodeAsync now requires every payment instruction in a scanned QR code to match a decrypted destination. A swapped address with a rewritten branta_secret, an added lightning/ark/silent-payment leg that does not match the registered record, or a conflicting bc=/tb= address no longer comes back as verified. QR codes carrying bolt12, lno=, pay=, or LNURL instructions return no payments (ported from branta-js)
  • Added: BIP-321 bc, tb, sp, and lno query parameters are parsed by QRParser; QRParser.hasUnverifiableInstruction flags instructions the SDK cannot bind to a decrypted destination

3.2.3 #

  • Added: recognize signet and regtest Ark addresses (tark1) as arkAddress, alongside mainnet ark1. Strict-mode hash-ZK lookup and registration treat them the same way as ark1.

3.2.2 #

  • Fixed: a same-origin validation gap: if the first payment in a getPayments response had no platformLogoUrl, validation silently stopped checking every later payment's logo URLs entirely. Logo-URL checks now run independently per payment, and now also cover platformLogoLightUrl, parentPlatform.logoUrl/logoLightUrl, and childPlatform.logoUrl/logoLightUrl (previously only platformLogoUrl was checked)

3.2.1 #

  • Fixed: getPaymentsByQrCodeAsync now verifies that the plaintext Bitcoin address parsed from a scanned QR code matches the address decrypted via branta_id/branta_secret, throwing BrantaPaymentException with reason: BrantaPaymentExceptionReason.tampered on mismatch. Closes a gap where an attacker could swap the visible address in a bitcoin: URI while leaving a legitimate, verified branta_id/branta_secret pair untouched (ported from branta-js 3.2.1)

3.2.0 #

  • Added silentPayment (sp1/tsp1) to DestinationType, with hash-based ZK support and QR parsing (silent_payment param, plain-text detection)
  • Added encrypted metadata support: addPaymentAsync encrypts Payment.metadata with a per-payment DEK that is itself encrypted per-destination (Destination.encryptedDek); metadata is decrypted automatically alongside destinations on retrieval
  • Added Payment.childPlatform and PaymentBuilder.setChildPlatform() for the child platform flow, mirroring the existing parentPlatform support

3.1.1 #

  • Sync README with sibling SDKs

3.1.0 #

  • Complete rewrite to achieve feature parity with branta-dotnet and branta-js v3.1.0
  • Replaced BrantaConfig with BrantaClientOptions (adds privacy, hmacSecret, defaultApiKey)
  • Added PrivacyMode enum (strict / loose); strict is the default
  • Split HTTP layer into BrantaClient (raw HTTP) and BrantaService (orchestration)
  • getPaymentsAsync and getPaymentsByQrCodeAsync now return PaymentsResult (payments + verifyUrl)
  • addPaymentAsync now returns AddPaymentResult (payment + secret + verifyUrl)
  • Added ZK support: hash-based deterministic encryption for bolt11 and ark addresses; secret-based for bitcoin addresses
  • QRParser rewritten to support combined QR codes (bitcoin: + lightning= / ark= params), branta_id/branta_secret, and plain-text address detection
  • PaymentBuilder.setZk() marks the last destination as ZK and assigns a UUID zkId
  • verifyUrl includes #k-{zkId}={key} fragments for each decrypted ZK destination
  • Removed json_serializable / build_runner in favour of hand-written fromJson/toJson
  • Added Platform model and parentPlatform / btcPayServerPluginVersion fields on Payment

1.0.2 #

  • #18 Add platform_logo_light_url to payment

1.0.1 #

  • #15 Added ark and ln_address destination types to DestinationType enum

1.0.0 #

  • SDK parity with branta-core: getPaymentsAsync, getZKPaymentsAsync, addPaymentAsync now return/throw BrantaPaymentException on errors instead of silently returning empty lists
  • addPaymentAsync throws BrantaPaymentException('Unauthorized') when no API key is configured
  • getPaymentsAsync validates platformLogoUrl domain against configured baseUrl to prevent open redirect attacks
  • Payments returned from all fetch methods now include a verifyUrl built from the configured base URL
  • Address parameter in getPaymentsAsync is now URL-encoded
  • Added DestinationType enum and type field on Destination
  • Added CI/CD workflow via GitHub Actions

0.0.3 #

  • #10 Add .pubignore to exclude development files (tests, Makefile, CLAUDE.md) from the published package

0.0.2 #

  • #2 Allow configuration per environment via BrantaConfig
  • #3 V2 Get Payment by QR Code — parse QR text directly to retrieve a payment
  • #4 V2 Payment by Parent Platform with HMAC — authenticate requests using an HMAC signature
  • #5 Add CLAUDE.md with project architecture and development guidelines

0.0.1 #

  • Initial version.
1
likes
0
points
1.51k
downloads

Publisher

unverified uploader

Weekly Downloads

A Branta SDK for Dart.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

crypto, cryptography, http, uuid

More

Packages that depend on branta