Skip to content

Commit

Permalink
Merge branch 'main' into ALTME
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkbee1 committed Oct 25, 2024
2 parents 67f6204 + 0c938a2 commit 10d24bd
Show file tree
Hide file tree
Showing 69 changed files with 1,326 additions and 1,466 deletions.
41 changes: 15 additions & 26 deletions lib/app/shared/constants/constants_json.dart
Original file line number Diff line number Diff line change
Expand Up @@ -303,21 +303,18 @@ abstract class ConstantsJson {
};

static const walletMetadataForIssuers = <String, dynamic>{
'client_name': Parameters.walletName,
'authorization_endpoint': Parameters.authorizationEndPoint,
'response_types_supported': ['vp_token', 'id_token'],
'vp_formats_supported': {
'jwt_vp': {
'alg': ['ES256', 'ES256K', 'EdDSA'],
},
'jwt_vc': {
'alg': ['ES256', 'ES256K', 'EdDSA'],
'jwt_vc_json': {
'alg_values_supported': ['ES256', 'ES256K', 'EdDSA'],
},
'jwt_vp_json': {
'alg': ['ES256', 'ES256K', 'EdDSA'],
},
'jwt_vc_json': {
'alg': ['ES256', 'ES256K', 'EdDSA'],
'alg_values_supported': ['ES256', 'ES256K', 'EdDSA'],
},
'vc+sd-jwt': {
'alg': ['ES256', 'ES256K', 'EdDSA'],
'alg_values_supported': ['ES256', 'ES256K', 'EdDSA'],
},
'ldp_vp': {
'proof_type': [
Expand All @@ -336,23 +333,15 @@ abstract class ConstantsJson {
],
},
},
'grant_types': ['authorization code', 'pre-authorized_code'],
'redirect_uris': [Parameters.authorizationEndPoint],
'subject_syntax_types_supported': ['did:key', 'did:jwk'],
'subject_syntax_types_discriminations': [
'did:key:jwk_jcs-pub',
'did:ebsi:v1',
],
'token_endpoint_auth_method_supported': [
'none',
'client_id',
'client_secret_post',
'client_secret_basic',
'client_secret_jwt',
'client_id_schemes_supported': [
'did',
'redirect_uri',
'x509_san_dns',
'verifier_attestation'
],
'credential_offer_endpoint': ['openid-credential-offer://', 'haip://'],
'client_name': '${Parameters.appName} wallet',
'contacts': ['contact@talao.io'],
'request_object_signing_alg_values_supported': ['ES256', 'ES256K', 'EdDSA'],
'presentation_definition_uri_supported': true,
'contacts': ['contact@talao.io']
};

static const walletMetadataForVerifiers = <String, dynamic>{
Expand Down
34 changes: 26 additions & 8 deletions lib/app/shared/constants/parameters.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import 'package:flutter/material.dart';
class Parameters {
static const int multipleCredentialsProcessDelay = 1;

// 'false' for talao
// 'true' for altme
static const bool walletHandlesCrypto = true;

static const AdvanceSettingsState defaultAdvanceSettingsState =
Expand Down Expand Up @@ -70,6 +72,7 @@ class Parameters {
chainChanged,
accountsChanged,
];

static const optionalEvents = ['message', 'disconnect', 'connect'];

static const allEvents = [...requiredEvents, ...optionalEvents];
Expand All @@ -78,28 +81,42 @@ class Parameters {
static const int maxEntries = 3;

// 'Talao'for talao
// 'Altme' for altme
static const String appName = 'Altme';

// 'false' for talao
// 'true' for altme
static const bool importAndRestoreAtOnboarding = true;

// false for talao
// 'true' for altme
static const bool supportDefiCompliance = true;

// false for talao
// 'true' for altme
static const bool supportCryptoAccountOwnershipInDiscoverForEnterpriseMode =
true;

// false for talao
static const bool showChainbornCard = false;
// false for talao
static const bool showTezotopiaCard = false;
// 'true' for altme
static const bool showChainbornCard = true;

//'https://app.talao.co/app/download/authorize' for Talao
static const String redirectUri =
'https://app.altme.io/app/download/authorize';
// false for talao
// true for altme
static const bool showTezotopiaCard = true;

//'https://app.talao.co/app/download/callback' for Talao
// 'https://app.altme.io/app/download/callback' for altme
static const String authorizationEndPoint =
'https://app.altme.io/app/download/callback';

// 'talao_wallet'for talao
static const String walletName = 'altme_wallet';
// 'Talao_wallet'for talao
// 'Altme_wallet' for altme
static const String walletName = 'Altme_wallet';

// 'https://app.talao.co/wallet_issuer'for talao
// 'https://app.altme.io/wallet_issuer' for altme
static const String walletIssuer = 'https://app.altme.io/wallet_issuer';

static const DidKeyType didKeyTypeForEbsiV3 = DidKeyType.ebsiv3;
static const DidKeyType didKeyTypeForEbsiV4 = DidKeyType.ebsiv4;
Expand All @@ -114,6 +131,7 @@ class Parameters {
// static const Color seedColor = Color(0xff1EAADC);

// ThemeMode.light for talao
// 'ThemeMode.dark' for altme
static const ThemeMode defaultTheme = ThemeMode.dark;

// Used to prevent display
Expand Down
5 changes: 4 additions & 1 deletion lib/app/shared/enum/status/app_status.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ enum AppStatus {
idle,
goBack,
revoked,
walletProviderApproval,
addEnterpriseAccount,
updateEnterpriseAccount,
replaceEnterpriseAccount,
restoreWallet,
}
18 changes: 18 additions & 0 deletions lib/app/shared/enum/type/profile/did_key_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,24 @@ extension DidKeyTypeX on DidKeyType {
}
}

String get didString {
switch (this) {
case DidKeyType.edDSA:
return 'did:key edDSA';
case DidKeyType.secp256k1:
return 'did:key secp256k1';
case DidKeyType.p256:
return 'did:key P-256';
case DidKeyType.ebsiv3:
case DidKeyType.ebsiv4:
return 'did:key EBSI P-256';
case DidKeyType.jwkP256:
return 'did:jwk P-256';
case DidKeyType.jwtClientAttestation:
return '';
}
}

String getTitle(AppLocalizations l10n) {
switch (this) {
case DidKeyType.edDSA:
Expand Down
2 changes: 2 additions & 0 deletions lib/app/shared/enum/type/profile/profile_type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ extension ProfileTypeX on ProfileType {
}
}

String get profileId => name;

bool get showSponseredBy {
switch (this) {
case ProfileType.custom:
Expand Down
1 change: 1 addition & 0 deletions lib/app/shared/enum/type/restore_type.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enum RestoreType { cryptoWallet, appBackup }
1 change: 1 addition & 0 deletions lib/app/shared/enum/type/type.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export 'message_type/message_type.dart';
export 'oidc4vc_type.dart';
export 'profile/did_key_type.dart';
export 'profile/profile.dart';
export 'restore_type.dart';
export 'wallet_protection_type.dart';
export 'wallet_provider_type.dart';
export 'wallet_route_type.dart';
Expand Down
33 changes: 33 additions & 0 deletions lib/app/shared/helper_functions/get_display.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
dynamic getDisplay(dynamic value, String languageCode) {
if (value is! Map<String, dynamic>) return null;

if (value.isEmpty) return null;

if (value.containsKey('display')) {
final displays = value['display'];
if (displays is! List<dynamic>) return null;
if (displays.isEmpty) return null;

final display = displays.firstWhere(
(element) =>
element is Map<String, dynamic> &&
element.containsKey('locale') &&
element['locale'].toString().contains(languageCode),
orElse: () => displays.firstWhere(
(element) =>
element is Map<String, dynamic> &&
element.containsKey('locale') &&
element['locale'].toString().contains('en'),
orElse: () => displays.firstWhere(
(element) =>
element is Map<String, dynamic> && element.containsKey('locale'),
orElse: () => null,
),
),
);

return display;
} else {
return null;
}
}
Loading

0 comments on commit 10d24bd

Please sign in to comment.