Skip to content

Commit 232bed8

Browse files
authored
Merge branch 'main' into fix/49-multi-currency-support
2 parents bb85c69 + 2b97b12 commit 232bed8

123 files changed

Lines changed: 5884 additions & 2747 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "npm"
4-
directory: "/"
3+
- package-ecosystem: 'npm'
4+
directory: '/'
55
schedule:
6-
interval: "daily"
6+
interval: 'daily'
77
open-pull-requests-limit: 10
88
reviewers:
9-
- "Smartdevs17" # Based on the repo URL found in package.json
9+
- 'Smartdevs17' # Based on the repo URL found in package.json
1010
groups:
1111
dependencies:
1212
patterns:
13-
- "*"
13+
- '*'
1414
update-types:
15-
- "patch"
16-
- "minor"
15+
- 'patch'
16+
- 'minor'
1717
commit-message:
18-
prefix: "fix(deps)"
19-
include: "scope"
18+
prefix: 'fix(deps)'
19+
include: 'scope'
2020
labels:
21-
- "dependencies"
22-
- "security"
21+
- 'dependencies'
22+
- 'security'
2323

24-
- package-ecosystem: "github-actions"
25-
directory: "/"
24+
- package-ecosystem: 'github-actions'
25+
directory: '/'
2626
schedule:
27-
interval: "weekly"
27+
interval: 'weekly'
2828
commit-message:
29-
prefix: "ci(actions)"
29+
prefix: 'ci(actions)'

.github/workflows/ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,25 @@ jobs:
5858
- name: Run ESLint
5959
run: npm run lint
6060

61+
npm-audit:
62+
name: NPM Audit (High/Critical)
63+
runs-on: ubuntu-latest
64+
steps:
65+
- name: Checkout code
66+
uses: actions/checkout@v4
67+
68+
- name: Setup Node.js
69+
uses: actions/setup-node@v4
70+
with:
71+
node-version: ${{ env.NODE_VERSION }}
72+
cache: 'npm'
73+
74+
- name: Install dependencies
75+
run: npm ci --legacy-peer-deps
76+
77+
- name: Run NPM Audit
78+
run: npx audit-ci --config audit-ci.json
79+
6180
typescript-typecheck:
6281
name: TypeScript Type Check
6382
runs-on: ubuntu-latest

.github/workflows/e2e-detox.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: E2E Detox Tests
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: ['main']
66

77
jobs:
88
test-ios:

.github/workflows/fuzz-test.yml

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,64 +2,69 @@ name: Subscription Contract Fuzzing Tests
22

33
on:
44
push:
5-
branches: [ main, develop ]
5+
branches: [main, develop]
66
paths:
77
- 'contracts/subscription/**'
8-
- '.github/workflows/fuzz-tests.yml'
8+
- '.github/workflows/fuzz-test.yml'
99
pull_request:
10-
branches: [ main, develop ]
10+
branches: [main, develop]
1111
paths:
1212
- 'contracts/subscription/**'
1313

1414
jobs:
1515
fuzz:
1616
runs-on: ubuntu-latest
1717
name: Run Fuzzing Tests
18-
18+
1919
steps:
2020
- name: Checkout code
2121
uses: actions/checkout@v3
22-
22+
2323
- name: Install Rust
2424
uses: actions-rs/toolchain@v1
2525
with:
2626
toolchain: stable
2727
override: true
2828
profile: minimal
29-
29+
3030
- name: Cache cargo registry
3131
uses: actions/cache@v3
3232
with:
3333
path: ~/.cargo/registry
3434
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
3535
restore-keys: |
3636
${{ runner.os }}-cargo-registry-
37-
37+
3838
- name: Cache cargo index
3939
uses: actions/cache@v3
4040
with:
4141
path: ~/.cargo/git
4242
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
4343
restore-keys: |
4444
${{ runner.os }}-cargo-git-
45-
45+
4646
- name: Cache cargo build
4747
uses: actions/cache@v3
4848
with:
4949
path: target
5050
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
5151
restore-keys: |
5252
${{ runner.os }}-cargo-build-target-
53-
54-
- name: Run fuzzing tests
53+
54+
- name: Run contract fuzz smoke suite
5555
run: |
56-
cd contracts/subscription
56+
cd contracts
5757
cargo test --lib
58-
cargo test --test fuzz_tests
59-
cargo test --test pricing_fuzz_tests
60-
cargo test --test rate_limit_fuzz_tests
61-
58+
for target in fuzz pricing_fuzz rate_limit_fuzz; do
59+
if cargo test --test "$target" --no-run >/dev/null 2>&1; then
60+
cargo test --test "$target"
61+
else
62+
echo "::warning::Cargo test target '$target' is not registered; running workspace tests instead."
63+
fi
64+
done
65+
cargo test --verbose
66+
6267
- name: Print test results
6368
if: always()
6469
run: |
65-
echo "Fuzzing tests completed!"
70+
echo "Fuzzing tests completed!"

.github/workflows/invariant-tests.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ jobs:
4343
env:
4444
PROPTEST_CASES: ${{ env.PROPTEST_CASES }}
4545
run: |
46-
cargo test --test invariants -- --nocapture 2>&1 | tee invariant-test-results.txt
46+
if cargo test --test invariants --no-run >/dev/null 2>&1; then
47+
cargo test --test invariants -- --nocapture 2>&1 | tee invariant-test-results.txt
48+
else
49+
echo "::warning::Cargo test target 'invariants' is not registered; running the full contract suite instead." | tee invariant-test-results.txt
50+
cargo test --verbose 2>&1 | tee -a invariant-test-results.txt
51+
fi
4752
4853
# ── Run all contract tests to ensure nothing regressed ─────────────
4954
- name: Run full contract test suite

.github/workflows/release.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,5 +123,3 @@ jobs:
123123
run: |
124124
npx expo login --token $EXPO_TOKEN
125125
npx expo publish --release-channel production
126-
127-

.github/workflows/security-scan.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,5 @@ jobs:
2525
- name: Install dependencies
2626
run: npm ci --legacy-peer-deps
2727

28-
- name: Run NPM Audit
29-
run: npm audit --audit-level=high
30-
31-
- name: Advanced Vulnerability Scan (audit-ci)
32-
run: |
33-
npx audit-ci --high --critical --package-manager npm
28+
- name: Run NPM audit baseline
29+
run: npx audit-ci --config audit-ci.json

App.tsx

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import { AppNavigator } from './src/navigation/AppNavigator';
66
import { useNotifications } from './src/hooks/useNotifications';
77
import { useTransactionQueue } from './src/hooks/useTransactionQueue';
88
import ErrorBoundary from './src/components/ErrorBoundary';
9+
import { initI18n } from './src/i18n/config';
10+
import i18n from './src/i18n/config';
11+
import { I18nextProvider } from 'react-i18next';
912

1013
// Import WalletConnect compatibility layer
1114
import '@walletconnect/react-native-compat';
@@ -87,13 +90,34 @@ function NotificationBootstrap() {
8790
}
8891

8992
export default function App() {
93+
const [i18nReady, setI18nReady] = React.useState(false);
94+
95+
React.useEffect(() => {
96+
let cancelled = false;
97+
const run = async () => {
98+
try {
99+
await initI18n();
100+
} finally {
101+
if (!cancelled) setI18nReady(true);
102+
}
103+
};
104+
void run();
105+
return () => {
106+
cancelled = true;
107+
};
108+
}, []);
109+
110+
if (!i18nReady) return null;
111+
90112
return (
91113
<GestureHandlerRootView style={{ flex: 1 }}>
92114
<View style={{ flex: 1 }} testID="app-root">
93115
<StatusBar style="light" />
94116
<ErrorBoundary>
95-
<NotificationBootstrap />
96-
<AppNavigator />
117+
<I18nextProvider i18n={i18n}>
118+
<NotificationBootstrap />
119+
<AppNavigator />
120+
</I18nextProvider>
97121
</ErrorBoundary>
98122
<AppKit />
99123
</View>

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ cp .env.example .env
125125

126126
> **Note**: If `.env.example` doesn't exist, create a new `.env` file with the following variables:
127127
128-
| Variable | Description | Example Value |
129-
| -------------------- | ----------------------------------------- | ----------------------------------------------------------------- |
130-
| `STELLAR_NETWORK` | `testnet` or `public` Stellar network | `testnet` |
131-
| `CONTRACT_ID` | Deployed SubTrackr proxy contract ID (stable) | `CB64...` (your deployed proxy contract address) |
132-
| `WEB3AUTH_CLIENT_ID` | Web3Auth client ID for social login | Get one from [Web3Auth Dashboard](https://dashboard.web3auth.io/) |
128+
| Variable | Description | Example Value |
129+
| -------------------- | --------------------------------------------- | ----------------------------------------------------------------- |
130+
| `STELLAR_NETWORK` | `testnet` or `public` Stellar network | `testnet` |
131+
| `CONTRACT_ID` | Deployed SubTrackr proxy contract ID (stable) | `CB64...` (your deployed proxy contract address) |
132+
| `WEB3AUTH_CLIENT_ID` | Web3Auth client ID for social login | Get one from [Web3Auth Dashboard](https://dashboard.web3auth.io/) |
133133

134134
### 4. Run the Mobile App
135135

@@ -243,6 +243,7 @@ SubTrackr prioritizes the security of your subscriptions and on-chain transactio
243243
- **Reporting**: Found a vulnerability? Please see our [Security Policy](docs/security.md) for reporting guidelines.
244244

245245
To run a manual security audit:
246+
246247
```bash
247248
npm run security:audit
248249
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default } from '../../src/screens/AccountingExportScreen';

0 commit comments

Comments
 (0)