Skip to content

Commit

Permalink
feat: add KBC offering tag (#327)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan-tbd authored Oct 30, 2024
1 parent 7830d82 commit 78d87e6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/shared/modal/modal_select_currency.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);

Expand All @@ -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;
}

0 comments on commit 78d87e6

Please sign in to comment.