Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
121cae4
feat: add mock document generator demo
transphorm Aug 31, 2025
64b6d74
feat: add mock document generator
transphorm Aug 31, 2025
e8a92b6
fixes
transphorm Aug 31, 2025
fd65a2c
chore: refresh workflow cache
transphorm Aug 31, 2025
373330b
update lock
transphorm Aug 31, 2025
9458b00
build
transphorm Aug 31, 2025
838467f
updates
transphorm Aug 31, 2025
53c7983
more fixes
transphorm Aug 31, 2025
b60f4ca
code rabbit feedback
transphorm Aug 31, 2025
a9b3869
compiles
transphorm Aug 31, 2025
b1f42db
save wip
transphorm Sep 1, 2025
9a05151
Merge branch 'dev' into codex/ideate-mock-document-screen-for-demo-app
transphorm Sep 3, 2025
3d50569
updates
transphorm Sep 3, 2025
13745d2
Merge branch 'dev' into codex/ideate-mock-document-screen-for-demo-app
transphorm Sep 4, 2025
583092c
Merge branch 'dev' into codex/ideate-mock-document-screen-for-demo-app
transphorm Sep 8, 2025
28cd19b
merge with dev and fixes
transphorm Sep 8, 2025
eb6c3c4
fix: align hoisting and demo Jest resolver (#1003)
transphorm Sep 8, 2025
f83f57b
fix pipeline issues
transphorm Sep 8, 2025
4ccd499
chore: decouple demo app build (#1013)
transphorm Sep 8, 2025
7d920b3
Merge branch 'dev' into codex/ideate-mock-document-screen-for-demo-app
transphorm Sep 11, 2025
435d7b4
Merge branch 'dev' into codex/ideate-mock-document-screen-for-demo-app
transphorm Sep 11, 2025
f1d727e
updates
transphorm Sep 11, 2025
ae9ccde
Merge branch 'dev' into codex/ideate-mock-document-screen-for-demo-app
transphorm Sep 11, 2025
d5fbc11
Merge branch 'dev' into codex/ideate-mock-document-screen-for-demo-app
transphorm Sep 11, 2025
2194aad
remove polyfills
transphorm Sep 11, 2025
05407e8
Merge branch 'dev' into codex/ideate-mock-document-screen-for-demo-app
transphorm Sep 12, 2025
4a63f55
update merge
transphorm Sep 12, 2025
a56067f
Merge branch 'dev' into codex/ideate-mock-document-screen-for-demo-app
transphorm Sep 18, 2025
bd14eb3
update resolutions
transphorm Sep 18, 2025
8a360d0
update resolutions
transphorm Sep 18, 2025
dd8be49
Merge branch 'dev' into codex/ideate-mock-document-screen-for-demo-app
transphorm Sep 19, 2025
2e3f6e7
fix merge
transphorm Sep 19, 2025
ddb5a1d
fix paths
transphorm Sep 19, 2025
c956036
save wip
transphorm Sep 19, 2025
9759064
save wip fixes rd2
transphorm Sep 19, 2025
c4a74bb
working android
transphorm Sep 19, 2025
0845890
update lock
transphorm Sep 19, 2025
7b53e42
save wip ios building
transphorm Sep 19, 2025
3d681e0
Merge branch 'dev' into codex/ideate-mock-document-screen-for-demo-app
transphorm Sep 19, 2025
2205c3f
Merge branch 'dev' into codex/ideate-mock-document-screen-for-demo-app
transphorm Sep 20, 2025
7235716
fix merge
transphorm Sep 20, 2025
777fa3c
Merge branch 'dev' into codex/ideate-mock-document-screen-for-demo-app
transphorm Sep 20, 2025
aeff621
Merge branch 'dev' into codex/ideate-mock-document-screen-for-demo-app
transphorm Sep 20, 2025
8c6ec95
readd public key
transphorm Sep 20, 2025
e634ca6
fixes
transphorm Sep 20, 2025
84adb83
Merge branch 'dev' into codex/ideate-mock-document-screen-for-demo-app
transphorm Sep 23, 2025
9fd0260
ci fixes
transphorm Sep 23, 2025
da2fa0a
fixes
transphorm Sep 23, 2025
7c48df6
fix web building
transphorm Sep 23, 2025
5b2e922
fix ci
transphorm Sep 23, 2025
7009db0
fix tests
transphorm Sep 23, 2025
19c541b
Merge branch 'dev' into codex/ideate-mock-document-screen-for-demo-app
transphorm Sep 23, 2025
2d1994b
update lock
transphorm Sep 23, 2025
583d48f
fix ci rd2
transphorm Sep 24, 2025
a9b3869
formatting and fix ci
transphorm Sep 24, 2025
4083909
fix
transphorm Sep 24, 2025
91b57b7
finalize ci fixes
transphorm Sep 24, 2025
b73b64d
fix tests and metro config paths for building
transphorm Sep 25, 2025
09220ed
save wip
transphorm Sep 25, 2025
76ef3a1
install missing package for pipeline
transphorm Sep 25, 2025
0205d59
Merge branch 'dev' into codex/ideate-mock-document-screen-for-demo-app
transphorm Sep 25, 2025
6d15c19
fix wip app building
transphorm Sep 25, 2025
51c657c
wip react config
transphorm Sep 25, 2025
a202cba
save working emulator compile
transphorm Sep 25, 2025
834e29c
Merge branch 'dev' into codex/ideate-mock-document-screen-for-demo-app
transphorm Sep 25, 2025
45871f8
first round of pr fixes and feedback
transphorm Sep 26, 2025
a12f62f
clean up demo app artifacts from sdk
transphorm Sep 26, 2025
9032caf
Add Gradle wrapper files for mobile-sdk-demo Android build
transphorm Sep 26, 2025
a36113d
codex feedback and fixes
transphorm Sep 26, 2025
cfc1d06
fix tests
transphorm Sep 26, 2025
f541535
file renames
transphorm Sep 26, 2025
77c7a42
revert back to dev
transphorm Sep 26, 2025
7063a33
add types
transphorm Sep 26, 2025
c2476cf
coderabbit fixes
transphorm Sep 26, 2025
4e24a56
fix tests
transphorm Sep 26, 2025
60e276b
fix tests
transphorm Sep 26, 2025
b97ea22
fix test
transphorm Sep 26, 2025
13c7b31
fixes
transphorm Sep 26, 2025
b68833c
fix wip coderabbit issues
transphorm Sep 26, 2025
259b5ac
coderabbit suggestions rd 2
transphorm Sep 26, 2025
af9ae80
Merge branch 'dev' into codex/ideate-mock-document-screen-for-demo-app
transphorm Sep 27, 2025
3832304
fix ci pipelines and addresss warnings
transphorm Sep 27, 2025
3225217
cr fixes
transphorm Sep 27, 2025
1550f1a
convert kebab to camelCase
transphorm Sep 27, 2025
3e336a3
save wip fixes
transphorm Sep 27, 2025
506fc03
update reinstall and lock files
transphorm Sep 27, 2025
9662f35
fixes
transphorm Sep 27, 2025
dc7232d
remove file
transphorm Sep 27, 2025
ee0e0f9
fix lint
transphorm Sep 27, 2025
083f741
fix polyfill fallback issues
transphorm Sep 27, 2025
1a90a75
ensure that mock document is not on ofac list
transphorm Sep 27, 2025
6797d47
prettier
transphorm Sep 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/mobile-sdk-demo-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ jobs:
node-version-file: .nvmrc
- name: Install Dependencies
uses: ./.github/actions/yarn-install
- name: Build dependencies (topological)
shell: bash
run: |
# Build demo-app and all its transitive workspace deps in the correct order
yarn workspaces foreach -At --from demo-app run build
- name: Run demo app tests
run: |
yarn workspace demo-app test
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ showcase
output/*
*.tsbuildinfo
.yarnrc.yml
.giga/tasks/*

# PR Action Items - prevent accidental commits
PR-*-ACTION*.md
25 changes: 24 additions & 1 deletion .watchmanconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
{

"ignore_dirs": [
"node_modules",
"dist",
"build",
"vendor",
"Pods",
"ios/build",
"android/build",
"app/android/build",
"app/ios/build",
"app/ios/Pods",
"contracts/artifacts",
"contracts/cache",
"circuits/build",
"common/node_modules",
"contracts/node_modules",
"circuits/node_modules",
"sdk/node_modules",
"packages/mobile-sdk-alpha/node_modules",
"packages/mobile-sdk-alpha/demo-app/node_modules",
"packages/mobile-sdk-alpha/demo-app/android/build",
"packages/mobile-sdk-alpha/demo-app/ios/build",
"registry/node_modules"
]
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,4 @@ We are actively looking for contributors. Please check the [open issues](https:/
Thanks [Rémi](https://github.com/remicolin), [Florent](https://github.com/0xturboblitz), [Ayman](https://github.com/Nesopie), [Justin](https://github.com/transphorm), [Seshanth](https://github.com/seshanthS), [Nico](https://github.com/motemotech) and all other contributors for building Self.

Thanks [Aayush](https://twitter.com/yush_g), [Vivek](https://twitter.com/viv_boop), [Andy](https://twitter.com/AndyGuzmanEth) and [Vitalik](https://github.com/vbuterin) for contributing ideas and inspiring us to build this technology, and [PSE](https://pse.dev/) for supporting the initial work through grants!
# Cache refresh Sat Aug 30 22:47:05 PDT 2025
4 changes: 2 additions & 2 deletions app/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ GEM
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.4.0)
aws-partitions (1.1152.0)
aws-sdk-core (3.231.0)
aws-partitions (1.1153.0)
aws-sdk-core (3.232.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
aws-sigv4 (~> 1.9)
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@
"sort-package-jsons": "find . -name 'package.json' -not -path './node_modules/*' -not -path './*/node_modules/*' | xargs npx sort-package-json",
"test": "yarn workspaces foreach --parallel -i --all run test",
"test:license-headers": "cd scripts/tests && node check-license-headers.test.mjs",
"types": "yarn workspaces foreach --topological-dev --parallel --exclude @selfxyz/contracts -i --all run types "
"types": "yarn workspaces foreach --topological-dev --parallel --exclude @selfxyz/contracts -i --all run types ",
"build:mobile-sdk": "yarn workspace @selfxyz/mobile-sdk-alpha build && yarn workspace demo-app build",
"demo:mobile": "yarn build:mobile-sdk && yarn workspace demo-app start"
},
"resolutions": {
"@typescript-eslint/eslint-plugin": "^8.39.0",
"@typescript-eslint/parser": "^8.39.0",
"@babel/core": "^7.28.3",
"@babel/runtime": "^7.28.3",
"@typescript-eslint/eslint-plugin": "^8.39.0",
"@typescript-eslint/parser": "^8.39.0",
"react": "^18.3.1",
"react-native": "0.76.9"
},
Expand Down
192 changes: 178 additions & 14 deletions packages/mobile-sdk-alpha/demo-app/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,199 @@
// SPDX-License-Identifier: BUSL-1.1
// NOTE: Converts to Apache-2.0 on 2029-06-11 per LICENSE.

import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import React, { useState } from 'react';
import { Button, ScrollView, StyleSheet, Text, TouchableOpacity, View } from 'react-native';

type Screen = 'home' | 'register' | 'generate' | 'prove' | 'camera' | 'nfc' | 'onboarding' | 'qr';
type GenerateMockCmp = typeof import('./src/GenerateMock').default;
type RegisterDocumentCmp = typeof import('./src/RegisterDocument').default;
type ProveQRCodeCmp = typeof import('./src/ProveQRCode').default;

function App() {
const [screen, setScreen] = useState<Screen>('home');
const [mockDocument, setMockDocument] = useState<Record<string, unknown> | null>(null);

const navigate = (next: Screen) => setScreen(next);

if (screen === 'generate') {
const GenerateMock = require('./src/GenerateMock').default as GenerateMockCmp;
return <GenerateMock onGenerate={setMockDocument} onNavigate={navigate} onBack={() => navigate('home')} />;
}

if (screen === 'register') {
const RegisterDocument = require('./src/RegisterDocument').default as RegisterDocumentCmp;
return <RegisterDocument document={mockDocument} onBack={() => navigate('home')} />;
}

if (screen === 'prove') {
const ProveQRCode = require('./src/ProveQRCode').default as ProveQRCodeCmp;
return <ProveQRCode document={mockDocument} onBack={() => navigate('home')} />;
}

if (screen === 'camera') {
const DocumentCamera = require('./src/DocumentCamera').default;
return <DocumentCamera onBack={() => navigate('home')} />;
}

if (screen === 'nfc') {
const DocumentNFCScan = require('./src/DocumentNFCScan').default;
return <DocumentNFCScan onBack={() => navigate('home')} />;
}

if (screen === 'onboarding') {
const DocumentOnboarding = require('./src/DocumentOnboarding').default;
return <DocumentOnboarding onBack={() => navigate('home')} />;
}

if (screen === 'qr') {
const QRCodeViewFinder = require('./src/QRCodeViewFinder').default;
return <QRCodeViewFinder onBack={() => navigate('home')} />;
}

const MenuButton = ({
title,
onPress,
isWorking = false,
}: {
title: string;
onPress: () => void;
isWorking?: boolean;
}) => (
<TouchableOpacity
style={[styles.menuButton, isWorking ? styles.workingButton : styles.placeholderButton]}
onPress={onPress}
activeOpacity={0.7}
>
<Text style={[styles.menuButtonText, isWorking ? styles.workingButtonText : styles.placeholderButtonText]}>
{title}
</Text>
</TouchableOpacity>
);

return (
<View style={styles.container}>
<Text style={styles.title}>Self Demo App</Text>
<Text style={styles.item}>Register Document</Text>
<Text style={styles.item}>Generate Mock</Text>
<Text style={styles.item}>Prove QR Code</Text>
</View>
<ScrollView contentContainerStyle={styles.container}>
<View style={styles.header}>
<Text style={styles.title}>Self Demo App</Text>
<Text style={styles.subtitle}>Mobile SDK Alpha - Available Screens</Text>
</View>

<View style={styles.section}>
<Text style={styles.sectionTitle}>🎯 Core Features</Text>
<MenuButton title="✅ Generate Mock Data" onPress={() => navigate('generate')} isWorking={true} />
<MenuButton
title="⏳ Register Document"
onPress={() => navigate('register')}
isWorking={Boolean(mockDocument)}
/>
<MenuButton title="⏳ Prove QR Code" onPress={() => navigate('prove')} isWorking={Boolean(mockDocument)} />
</View>

<View style={styles.section}>
<Text style={styles.sectionTitle}>📷 Document Scanning</Text>
<MenuButton title="⏳ Document Camera" onPress={() => navigate('camera')} />
<MenuButton title="⏳ Document NFC Scan" onPress={() => navigate('nfc')} />
<MenuButton title="⏳ Document Onboarding" onPress={() => navigate('onboarding')} />
</View>

<View style={styles.section}>
<Text style={styles.sectionTitle}>📱 QR Code Features</Text>
<MenuButton title="⏳ QR Code View Finder" onPress={() => navigate('qr')} />
</View>

<View style={styles.footer}>
<Text style={styles.footerText}>✅ Working | ⏳ Placeholder (Not Implemented)</Text>
<Text style={styles.footerSubtext}>Tap any screen to explore the demo interface</Text>
</View>
</ScrollView>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
flexGrow: 1,
backgroundColor: '#f8f9fa',
padding: 20,
},
header: {
alignItems: 'center',
backgroundColor: '#fff',
marginBottom: 32,
paddingTop: 20,
},
title: {
fontSize: 28,
fontWeight: 'bold',
textAlign: 'center',
color: '#1a1a1a',
marginBottom: 8,
},
subtitle: {
fontSize: 16,
color: '#666',
textAlign: 'center',
},
section: {
marginBottom: 32,
},
sectionTitle: {
fontSize: 20,
marginBottom: 12,
fontWeight: 'bold',
marginBottom: 16,
color: '#333',
textAlign: 'center',
},
menuButton: {
width: '100%',
paddingVertical: 16,
paddingHorizontal: 20,
borderRadius: 12,
marginBottom: 12,
shadowColor: '#000',
shadowOffset: {
width: 0,
height: 2,
},
shadowOpacity: 0.1,
shadowRadius: 3.84,
elevation: 5,
},
workingButton: {
backgroundColor: '#007AFF',
},
item: {
placeholderButton: {
backgroundColor: '#fff',
borderWidth: 1,
borderColor: '#e1e5e9',
},
menuButtonText: {
fontSize: 16,
marginVertical: 4,
fontWeight: '600',
textAlign: 'center',
},
workingButtonText: {
color: '#fff',
},
placeholderButtonText: {
color: '#666',
},
footer: {
marginTop: 20,
padding: 20,
backgroundColor: '#fff',
borderRadius: 12,
borderWidth: 1,
borderColor: '#e1e5e9',
},
footerText: {
textAlign: 'center',
color: '#666',
fontSize: 14,
fontWeight: '500',
marginBottom: 8,
},
footerSubtext: {
textAlign: 'center',
color: '#999',
fontSize: 12,
},
});

Expand Down
45 changes: 45 additions & 0 deletions packages/mobile-sdk-alpha/demo-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Self Demo App

This is a demo application for testing the Self mobile SDK.

## Configuration

### New Architecture
The new architecture (Fabric + TurboModules) can be toggled on/off:

**Android**: Set `newArchEnabled` in `android/gradle.properties`
- `newArchEnabled=true` - Enable new architecture
- `newArchEnabled=false` - Disable new architecture (default)

**iOS**: Set `:fabric_enabled` in `ios/Podfile`
- `:fabric_enabled => true` - Enable new architecture
- `:fabric_enabled => false` - Disable new architecture (default)

### Hermes Engine
Hermes JavaScript engine can be toggled on/off:

**Android**: Set `hermesEnabled` in `android/gradle.properties`
- `hermesEnabled=true` - Enable Hermes (default)
- `hermesEnabled=false` - Use JSC instead

**iOS**: Set `:hermes_enabled` in `ios/Podfile`
- `:hermes_enabled => true` - Enable Hermes (default)
- `:hermes_enabled => false` - Use JSC instead

## Current Settings
- **New Architecture**: Disabled
- **Hermes**: Enabled

## Build Commands

After changing configuration:
```bash
# Clean and rebuild
yarn clean

# Run on Android
yarn android

# Run on iOS
yarn ios
```
13 changes: 7 additions & 6 deletions packages/mobile-sdk-alpha/demo-app/__tests__/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

import React from 'react';
import renderer from 'react-test-renderer';
import { Text } from 'react-native';
import { Button, Text } from 'react-native';
import App from '../App';

test('renders menu items', () => {
test('renders menu buttons', () => {
const rendered = renderer.create(<App />);
const texts = rendered.root.findAllByType(Text).map(node => React.Children.toArray(node.props.children).join(''));
const expected = ['Self Demo App', 'Register Document', 'Generate Mock', 'Prove QR Code'];
expect(texts).toEqual(expect.arrayContaining(expected));
expect(texts).toHaveLength(expected.length);
const titleNode = rendered.root.findAllByType(Text).find(node => node.props.children === 'Self Demo App');
expect(titleNode).toBeTruthy();
const buttons = rendered.root.findAllByType(Button);
const titles = buttons.map(b => b.props.title);
expect(titles).toEqual(['Register Document', 'Generate Mock', 'Prove QR Code']);
rendered.unmount();
});
Loading
Loading