diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 9fbc76dd..28345fdb 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -167,10 +167,10 @@ jobs: - name: Update ledgers run: | node bifold/scripts/make-blocks.js - + # the ledgers file should be about 344K ls -lah ledgers.json - + mv ledgers.json bifold/packages/legacy/core/configs/ledgers/indy/ledgers.json shasum bifold/packages/legacy/core/configs/ledgers/indy/ledgers.json @@ -250,7 +250,7 @@ jobs: -u "$LAMBDA_USERNAME:$LAMBDA_ACCESS_KEY" \ --location --request POST 'https://manual-api.lambdatest.com/app/upload/realDevice' \ --form 'appFile=@"export/AriesBifold.ipa"' \ - --form "name=AriesBifold-$GITHUB_RUN_NUMBER.ipa" \ + --form "name=QCWallet-$GITHUB_RUN_NUMBER.ipa" \ build-android: # if: ${{ false }} # disable for now @@ -368,7 +368,7 @@ jobs: -u "$LAMBDA_USERNAME:$LAMBDA_ACCESS_KEY" \ --location --request POST 'https://manual-api.lambdatest.com/app/upload/realDevice' \ --form 'appFile=@"app/build/outputs/bundle/release/app-release.aab"' \ - --form "name=AriesBifold-$GITHUB_RUN_NUMBER.aab" \ + --form "name=QCWallet-$GITHUB_RUN_NUMBER.aab" \ release: if: github.ref_name == 'main' && needs.check-android-secrets.outputs.isReleaseBuild == 'true'&& needs.check-ios-secrets.outputs.isReleaseBuild == 'true' diff --git a/app/ios/AriesBifold.xcodeproj/xcshareddata/xcschemes/AriesBifold.xcscheme b/app/ios/AriesBifold.xcodeproj/xcshareddata/xcschemes/AriesBifold.xcscheme index c4acecf8..bc517c67 100644 --- a/app/ios/AriesBifold.xcodeproj/xcshareddata/xcschemes/AriesBifold.xcscheme +++ b/app/ios/AriesBifold.xcodeproj/xcshareddata/xcschemes/AriesBifold.xcscheme @@ -15,7 +15,7 @@ @@ -55,7 +55,7 @@ @@ -72,7 +72,7 @@ diff --git a/app/package-lock.json b/app/package-lock.json index 90bd4149..307f3514 100644 --- a/app/package-lock.json +++ b/app/package-lock.json @@ -57992,4 +57992,4 @@ "devOptional": true } } -} +} \ No newline at end of file diff --git a/app/src/hooks/notifications.ts b/app/src/hooks/notifications.ts index c5ac4036..c57c46c8 100644 --- a/app/src/hooks/notifications.ts +++ b/app/src/hooks/notifications.ts @@ -8,6 +8,7 @@ import { import { useCredentialByState, useProofByState } from '@aries-framework/react-hooks' import { useStore } from 'aries-bifold' import { CredentialMetadata, customMetadata } from 'aries-bifold/App/types/metadata' +import { ProofCustomMetadata, ProofMetadata } from 'aries-bifold/verifier' import { getInvitationCredentialDate, showBCIDSelector } from '../helpers/BCIDHelper' import { BCState } from '../store' @@ -26,7 +27,15 @@ interface Notifications { export const useNotifications = (): Notifications => { const [store] = useStore() const offers = useCredentialByState(CredentialState.OfferReceived) - const proofs = useProofByState(ProofState.RequestReceived) + const proofsRequested = useProofByState(ProofState.RequestReceived) + const proofsDone = useProofByState([ProofState.Done, ProofState.PresentationReceived]).filter( + (proof: ProofExchangeRecord) => { + if (proof.isVerified === undefined) return false + + const metadata = proof.metadata.get(ProofMetadata.customMetadata) as ProofCustomMetadata + return !metadata?.details_seen + } + ) const revoked = useCredentialByState(CredentialState.Done).filter((cred: CredentialRecord) => { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const metadata = cred!.metadata.get(CredentialMetadata.customMetadata) as customMetadata @@ -50,7 +59,7 @@ export const useNotifications = (): Notifications => { ? [{ type: 'CustomNotification', createdAt: invitationDate, id: 'custom' }] : [] - const notifications = [...offers, ...proofs, ...revoked, ...custom].sort( + const notifications = [...offers, ...proofsRequested, ...proofsDone, ...revoked, ...custom].sort( (a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime() ) diff --git a/app/src/index.ts b/app/src/index.ts index d39641e7..469b12ac 100644 --- a/app/src/index.ts +++ b/app/src/index.ts @@ -18,6 +18,7 @@ import { useNotifications } from './hooks/notifications' import en from './localization/en' import fr from './localization/fr' import TermsStack from './navigators/TermsStack' +import { proofRequestTemplates } from './request-templates' import Developer from './screens/Developer' import { pages } from './screens/OnboardingPages' import PersonCredential from './screens/PersonCredential' @@ -66,6 +67,7 @@ const configuration: ConfigurationContext = { buttonTitle: 'PersonCredentialNotification.ButtonTitle', }, useCustomNotifications: useNotifications, + proofRequestTemplates, } export default { theme, localization, configuration } diff --git a/app/src/request-templates.ts b/app/src/request-templates.ts new file mode 100644 index 00000000..b3b164ee --- /dev/null +++ b/app/src/request-templates.ts @@ -0,0 +1,151 @@ +import { PredicateType } from '@aries-framework/core' +import { ProofRequestTemplate, ProofRequestType } from 'aries-bifold' + +export const proofRequestTemplates: Array = [ + { + id: 'BC:5:FullName:0.0.1:indy', + name: 'Full name', + description: 'Verify the full name of a person', + version: '0.0.1', + payload: { + type: ProofRequestType.Indy, + data: [ + { + schema: 'XUxBrVSALWHLeycAUhrNr9:2:Person:1.0', + requestedAttributes: [ + { + name: 'given_names', + restrictions: [{ schema_id: 'XUxBrVSALWHLeycAUhrNr9:2:Person:1.0' }], + }, + { + name: 'family_name', + restrictions: [{ schema_id: 'XUxBrVSALWHLeycAUhrNr9:2:Person:1.0' }], + }, + ], + }, + ], + }, + }, + { + id: 'BC:5:19+AndFullName:0.0.1:indy', + name: '19+ and Full name', + description: 'Verify if a person is 19 years end up and full name.', + version: '0.0.1', + payload: { + type: ProofRequestType.Indy, + data: [ + { + schema: 'XUxBrVSALWHLeycAUhrNr9:2:Person:1.0', + requestedAttributes: [ + { + names: ['given_names', 'family_name'], + restrictions: [{ schema_id: 'XUxBrVSALWHLeycAUhrNr9:2:Person:1.0' }], + }, + ], + requestedPredicates: [ + { + name: 'birthdate_dateint', + predicateType: PredicateType.GreaterThanOrEqualTo, + predicateValue: 18, + restrictions: [{ schema_id: 'XUxBrVSALWHLeycAUhrNr9:2:Person:1.0' }], + }, + ], + }, + ], + }, + }, + { + id: 'BC:5:Over19YearsOfAge:0.0.1:indy', + name: 'Over 19 years of age', + description: 'Verify if a person is 19 years end up.', + version: '0.0.1', + payload: { + type: ProofRequestType.Indy, + data: [ + { + schema: 'XUxBrVSALWHLeycAUhrNr9:2:Person:1.0', + requestedPredicates: [ + { + name: 'birthdate_dateint', + predicateType: PredicateType.GreaterThanOrEqualTo, + predicateValue: 18, + restrictions: [{ schema_id: 'XUxBrVSALWHLeycAUhrNr9:2:Person:1.0' }], + }, + ], + }, + ], + }, + }, + { + id: 'BC:5:PractisingLawyer:0.0.1:indy', + name: 'Practising lawyer', + description: 'Verify if a person`is a practicing lawyer.', + version: '0.0.1', + payload: { + type: ProofRequestType.Indy, + data: [ + { + schema: 'XUxBrVSALWHLeycAUhrNr9:2:Member Card:1.5.1', + requestedAttributes: [ + { + names: ['Given Name', 'Surname', 'PPID', 'Member Status'], + restrictions: [{ schema_id: 'XUxBrVSALWHLeycAUhrNr9:2:Member Card:1.5.1' }], + }, + ], + }, + ], + }, + }, + { + id: 'BC:5:PractisingLawyerAndFullName:0.0.1:indy', + name: 'Practising lawyer and full name', + description: 'Verify if a person`is a practicing lawyer using two different credentials for extra assurance', + version: '0.0.1', + payload: { + type: ProofRequestType.Indy, + data: [ + { + schema: 'XUxBrVSALWHLeycAUhrNr9:2:Person:1.0', + requestedAttributes: [ + { + names: ['given_names', 'family_name'], + restrictions: [{ schema_id: 'XUxBrVSALWHLeycAUhrNr9:2:Person:1.0' }], + }, + ], + }, + { + schema: 'XUxBrVSALWHLeycAUhrNr9:2:Member Card:1.5.1', + requestedAttributes: [ + { + names: ['Given Name', 'Surname', 'PPID', 'Member Status'], + restrictions: [{ schema_id: 'XUxBrVSALWHLeycAUhrNr9:2:Member Card:1.5.1' }], + }, + ], + }, + ], + }, + }, + { + id: 'BC:5:OverSomeYearsOfAge:0.0.1:indy', + name: 'Over some years of age', + description: 'Verify if a person is over some years ends up.', + version: '0.0.1', + payload: { + type: ProofRequestType.Indy, + data: [ + { + schema: 'XUxBrVSALWHLeycAUhrNr9:2:Person:1.0', + requestedPredicates: [ + { + name: 'birthdate_dateint', + predicateType: PredicateType.GreaterThanOrEqualTo, + predicateValue: 18, + parameterizable: true, + restrictions: [{ schema_id: 'XUxBrVSALWHLeycAUhrNr9:2:Person:1.0' }], + }, + ], + }, + ], + }, + }, +] diff --git a/app/src/screens/Developer.tsx b/app/src/screens/Developer.tsx index e34df9d1..f30d6037 100644 --- a/app/src/screens/Developer.tsx +++ b/app/src/screens/Developer.tsx @@ -31,6 +31,10 @@ const Settings: React.FC = () => { const { SettingsTheme, TextTheme, ColorPallet } = useTheme() const [environmentModalVisible, setEnvironmentModalVisible] = useState(false) const [devMode, setDevMode] = useState(true) + const [useVerifierCapability, setUseVerifierCapability] = useState(!!store.preferences.useVerifierCapability) + const [useConnectionInviterCapability, setConnectionInviterCapability] = useState( + !!store.preferences.useConnectionInviterCapability + ) const styles = StyleSheet.create({ container: { @@ -135,8 +139,10 @@ const Settings: React.FC = () => { style={styles.sectionRow} onPress={onPress} > - {title} - {value} + {title} + + {value} + {children} @@ -150,6 +156,22 @@ const Settings: React.FC = () => { setDevMode(!devMode) } + const toggleVerifierCapabilitySwitch = () => { + dispatch({ + type: DispatchAction.USE_VERIFIER_CAPABILITY, + payload: [!useVerifierCapability], + }) + setUseVerifierCapability((previousState) => !previousState) + } + + const toggleConnectionInviterCapabilitySwitch = () => { + dispatch({ + type: DispatchAction.USE_CONNECTION_INVITER_CAPABILITY, + payload: [!useConnectionInviterCapability], + }) + setConnectionInviterCapability((previousState) => !previousState) + } + return ( { sections={settingsSections} stickySectionHeadersEnabled={false} > + + + + + + ) diff --git a/app/src/theme.ts b/app/src/theme.ts index a6df663e..d5d0f6cc 100644 --- a/app/src/theme.ts +++ b/app/src/theme.ts @@ -51,6 +51,7 @@ interface BrandColors { primaryDisabled: string secondary: string secondaryDisabled: string + primaryLight: string highlight: string modalPrimaryBackground: string modalSecondaryBackground: string @@ -114,6 +115,7 @@ const BrandColors: BrandColors = { primaryDisabled: `rgba(9, 87, 151, ${lightOpacity})`, secondary: '#DAE6F0', secondaryDisabled: `rgba(218, 230, 240, ${heavyOpacity})`, + primaryLight: '#D9EAF7', highlight: '#E58271', primaryBackground: '#F1F1F2', secondaryBackground: '#FFFFFF', @@ -412,6 +414,29 @@ export const ListItems = StyleSheet.create({ emptyList: { ...TextTheme.normal, }, + requestTemplateBackground: { + backgroundColor: ColorPallet.grayscale.white, + }, + requestTemplateIconColor: { + color: ColorPallet.notification.infoText, + }, + requestTemplateTitle: { + color: ColorPallet.grayscale.black, + fontWeight: 'bold', + }, + requestTemplateDetails: { + color: ColorPallet.grayscale.black, + fontWeight: 'normal', + }, + requestTemplateZkpLabel: { + color: ColorPallet.grayscale.mediumGrey, + }, + requestTemplateIcon: { + color: ColorPallet.grayscale.black, + }, + requestTemplateDate: { + color: ColorPallet.grayscale.mediumGrey, + }, }) export const TabTheme = { @@ -495,25 +520,53 @@ export const SettingsTheme = { } export const ChatTheme = { + containerStyle: { + marginBottom: 16, + marginLeft: 16, + marginRight: 16, + flexDirection: 'column', + alignItems: 'flex-start', + alignSelf: 'flex-end', + }, leftBubble: { backgroundColor: ColorPallet.brand.secondaryBackground, - borderRadius: 20, - padding: 4, - marginLeft: -4, + borderRadius: 4, + padding: 16, + marginLeft: 16, }, rightBubble: { - backgroundColor: ColorPallet.brand.primary, - borderRadius: 20, - padding: 4, - marginRight: 4, + backgroundColor: ColorPallet.brand.primaryLight, + borderRadius: 4, + padding: 16, + marginRight: 16, + }, + timeStyleLeft: { + color: ColorPallet.grayscale.black, + fontSize: 12, + marginTop: 8, + }, + timeStyleRight: { + color: ColorPallet.grayscale.black, + fontSize: 12, + marginTop: 8, }, leftText: { - color: ColorPallet.brand.primary, + color: ColorPallet.grayscale.black, fontSize: TextTheme.normal.fontSize, }, + leftTextHighlighted: { + color: ColorPallet.grayscale.black, + fontSize: TextTheme.normal.fontSize, + fontWeight: 'bold', + }, rightText: { - color: ColorPallet.brand.secondary, + color: ColorPallet.grayscale.black, + fontSize: TextTheme.normal.fontSize, + }, + rightTextHighlighted: { + color: ColorPallet.grayscale.black, fontSize: TextTheme.normal.fontSize, + fontWeight: 'bold', }, inputToolbar: { backgroundColor: ColorPallet.brand.secondary, @@ -534,6 +587,33 @@ export const ChatTheme = { }, sendEnabled: ColorPallet.brand.primary, sendDisabled: ColorPallet.brand.primaryDisabled, + options: ColorPallet.brand.primary, + optionsText: ColorPallet.grayscale.black, + openButtonStyle: { + borderRadius: 32, + backgroundColor: ColorPallet.brand.primary, + paddingTop: 8, + paddingBottom: 8, + paddingLeft: 16, + paddingRight: 16, + marginTop: 16, + }, + openButtonTextStyle: { + color: ColorPallet.brand.secondary, + fontSize: TextTheme.normal.fontSize, + fontWeight: 'bold', + textAlign: 'center', + }, + documentIconContainer: { + backgroundColor: ColorPallet.brand.primary, + alignSelf: 'flex-start', + padding: 4, + borderRadius: 4, + marginBottom: 8, + }, + documentIcon: { + color: ColorPallet.grayscale.white, + }, } export const OnboardingTheme = { @@ -569,6 +649,24 @@ export const OnboardingTheme = { }, } +export const DialogTheme = { + modalView: { + backgroundColor: ColorPallet.brand.secondaryBackground, + }, + titleText: { + color: ColorPallet.grayscale.white, + }, + description: { + color: ColorPallet.grayscale.white, + }, + closeButtonIcon: { + color: ColorPallet.grayscale.white, + }, + carouselButtonText: { + color: ColorPallet.grayscale.white, + }, +} + const LoadingTheme = { backgroundColor: ColorPallet.brand.primary, } @@ -624,6 +722,7 @@ export const defaultTheme: Theme = { SettingsTheme, ChatTheme, OnboardingTheme, + DialogTheme, LoadingTheme, PINInputTheme, Assets, diff --git a/bifold b/bifold index f1fd5e49..f832a052 160000 --- a/bifold +++ b/bifold @@ -1 +1 @@ -Subproject commit f1fd5e4967a706154fb13cef605e9ea83431dad9 +Subproject commit f832a05206ac1597eb6c36eb919b09650d786ad5