From 78d87e6efdeeca8267d628eb8f22a74a7b83fccb Mon Sep 17 00:00:00 2001 From: Ethan Lee <125412902+ethan-tbd@users.noreply.github.com> Date: Wed, 30 Oct 2024 11:36:21 -0700 Subject: [PATCH] feat: add KBC offering tag (#327) --- lib/shared/modal/modal_select_currency.dart | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/shared/modal/modal_select_currency.dart b/lib/shared/modal/modal_select_currency.dart index 3c72194a..9ce1a030 100644 --- a/lib/shared/modal/modal_select_currency.dart +++ b/lib/shared/modal/modal_select_currency.dart @@ -88,7 +88,7 @@ class ModalSelectCurrency { Offering offering, ) => Text( - '${offering.data.payin.currencyCode} → ${offering.data.payout.currencyCode}', + '${offering.data.payin.currencyCode} → ${offering.data.payout.currencyCode} ${_isKbc(offering) ? '(KBC)' : ''}', style: Theme.of(context).textTheme.titleMedium, ); @@ -102,4 +102,12 @@ class ModalSelectCurrency { color: Theme.of(context).colorScheme.onSurface, ), ); + + static bool _isKbc(Offering offering) => + offering.data.requiredClaims?.inputDescriptors[0].constraints.fields?.any( + (field) => + field.filter?.constValue == + 'https://vc.schemas.host/kbc.schema.json', + ) ?? + false; }