Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .github/workflows/bbmtlib-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,3 @@ jobs:
name: bbmtlib-coverage
fail_ci_if_error: false
continue-on-error: true

239 changes: 239 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,242 @@ build.log

# Local gradle properties with secrets (never commit)
android/gradle.properties.local

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# IDE - JetBrains
.idea/*
!.idea/runConfigurations/
!.idea/codeStyles/
*.iml
*.iws
*.ipr

# IDE - Xcode
*.xcworkspace
!*.xcworkspace/contents.xcworkspacedata
*.xcuserdata
*.xcscmblueprint
*.xcscheme
!*.xcscheme
project.xcworkspace/
xcuserdata/

# OS - Windows
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
*.stackdump
[Dd]esktop.ini
$RECYCLE.BIN/
*.cab
*.msi
*.msix
*.msm
*.msp
*.lnk

# OS - Linux
*~
.fuse_hidden*
.directory
.Trash-*
.nfs*

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Coverage directory used by tools like istanbul
coverage
*.lcov
.nyc_output

# Dependency directories
jspm_packages/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
public

# Storybook build outputs
.out
.storybook-out
storybook-static

# Temporary folders
tmp/
temp/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# React Native
.expo/
.expo-shared/
*.jks
*.p8
*.p12
*.key
*.mobileprovision
*.orig.*
web-build/

# Android
*.apk
*.ap_
*.aab
*.dex
*.class
bin/
gen/
out/
.gradle/
local.properties
proguard/
*.hprof
*.keystore
!debug.keystore
android/app/debug/
android/app/release/
android/app/profile/

# iOS
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
*.xccheckout
*.moved-aside
DerivedData/
*.hmap
*.ipa
*.xcuserstate
ios/Pods/
ios/build/
*.xcworkspace
!*.xcworkspace/contents.xcworkspacedata
*.xcuserdata
*.xcscmblueprint

# CocoaPods
Pods/
!Podfile.lock
vendor/bundle/

# Ruby
*.gem
*.rbc
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/spec/examples.txt
/test/tmp/
/test/version_tmp/
/tmp/

# Environment variables
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Backup files
*.bak
*.backup
*.old
*.orig
*.swp
*.swo
*~

# Archive files
*.zip
*.tar
*.tar.gz
*.rar
*.7z

# Database files
*.db
*.sqlite
*.sqlite3

# Certificate files
*.pem
*.crt
*.cer
*.der
*.p12
*.pfx
24 changes: 22 additions & 2 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {createNativeStackNavigator} from '@react-navigation/native-stack';
import {enableScreens} from 'react-native-screens';
import ShowcaseScreen from './screens/ShowcaseScreen';
import WalletHome from './screens/WalletHome';
import PSBTScreen from './screens/PSBTScreen';
import EncryptedStorage from 'react-native-encrypted-storage';
import LoadingScreen from './screens/LoadingScreen';
import Zeroconf, {ImplType} from 'react-native-zeroconf';
Expand Down Expand Up @@ -49,7 +50,12 @@ const App = () => {
// Re-check wallet state after reload to ensure correct initial route
try {
const keyshare = await EncryptedStorage.getItem('keyshare');
const route = keyshare && keyshare.length > 0 ? 'Home' : 'Welcome';
let route: string = 'Welcome';
if (keyshare && keyshare.length > 0) {
const walletMode =
(await EncryptedStorage.getItem('wallet_mode')) || 'full';
route = walletMode === 'psbt' ? 'PSBT' : 'Home';
}
setInitialRoute(route);
} catch {
setInitialRoute('Welcome');
Expand All @@ -64,7 +70,13 @@ const App = () => {
try {
const keyshare = await EncryptedStorage.getItem('keyshare');
dbg('initializeApp keyshare found', !!keyshare);
const route = keyshare && keyshare.length > 0 ? 'Home' : 'Welcome';
let route: string = 'Welcome';
if (keyshare && keyshare.length > 0) {
// Default to Home unless user explicitly chose PSBT mode
const walletMode =
(await EncryptedStorage.getItem('wallet_mode')) || 'full';
route = walletMode === 'psbt' ? 'PSBT' : 'Home';
}
dbg('Setting initial route to:', route);
setInitialRoute(route);
} catch (error) {
Expand Down Expand Up @@ -307,6 +319,14 @@ const App = () => {
screenOptions={{
headerShown: false,
}}>
<Stack.Screen
name="PSBT"
component={PSBTScreen}
options={{
headerShown: true,
headerLeft: () => null,
}}
/>
<Stack.Screen
name="Home"
component={WalletHome}
Expand Down
25 changes: 25 additions & 0 deletions BBMTLib/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
#!/bin/bash

# Check for --clear-cache flag
CLEAR_CACHE=false
for arg in "$@"; do
if [ "$arg" = "--clear-cache" ]; then
CLEAR_CACHE=true
break
fi
done

echo "building gomobile tss lib"
go mod tidy

# Clear module cache if --clear-cache flag is provided
if [ "$CLEAR_CACHE" = true ]; then
echo "Clearing module cache to force fresh download..."
go clean -modcache
fi

# Force download of all dependencies
echo "Downloading all dependencies..."
go mod download

# Install gomobile if not already installed
if ! command -v gomobile &> /dev/null; then
echo "gomobile not found, installing..."
Expand All @@ -16,6 +36,11 @@ gomobile bind -v -target=android -androidapi 21 github.com/BoldBitcoinWallet/BBM
cp tss.aar ../android/app/libs/tss.aar
cp tss-sources.jar ../android/app/libs/tss-sources.jar

gomobile bind -v -target=ios,iossimulator,macos github.com/BoldBitcoinWallet/BBMTLib/tss
# Remove old framework first (cp -r fails with symlinks when destination exists)
rm -rf ../ios/Tss.xcframework
cp -R ./Tss.xcframework ../ios/

# Run go mod tidy again at the end to ensure go.mod/go.sum are up to date
# This ensures any dependencies added during the build are included
echo "Updating go.mod/go.sum..."
Expand Down
3 changes: 2 additions & 1 deletion BBMTLib/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ require (
github.com/btcsuite/btcd v0.24.2
github.com/btcsuite/btcd/btcec/v2 v2.3.4
github.com/btcsuite/btcd/btcutil v1.1.5
github.com/btcsuite/btcd/btcutil/psbt v1.1.10
github.com/decred/dcrd/dcrec/edwards/v2 v2.0.3
github.com/gorilla/mux v1.8.1
github.com/ipfs/go-log/v2 v2.1.3
Expand Down Expand Up @@ -60,7 +61,7 @@ require (
go.uber.org/multierr v1.10.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/crypto v0.44.0 // indirect
golang.org/x/sys v0.38.0 // indirect
golang.org/x/sys v0.39.0 // indirect
google.golang.org/protobuf v1.36.2 // indirect
)

Expand Down
6 changes: 4 additions & 2 deletions BBMTLib/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9Ur
github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE=
github.com/btcsuite/btcd/btcutil v1.1.5 h1:+wER79R5670vs/ZusMTF1yTcRYE5GUsFbdjdisflzM8=
github.com/btcsuite/btcd/btcutil v1.1.5/go.mod h1:PSZZ4UitpLBWzxGd5VGOrLnmOjtPP/a6HaFo12zMs00=
github.com/btcsuite/btcd/btcutil/psbt v1.1.10 h1:TC1zhxhFfhnGqoPjsrlEpoqzh+9TPOHrCgnPR47Mj9I=
github.com/btcsuite/btcd/btcutil/psbt v1.1.10/go.mod h1:ehBEvU91lxSlXtA+zZz3iFYx7Yq9eqnKx4/kSrnsvMY=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc=
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 h1:59Kx4K6lzOW5w6nFlA0v5+lk/6sjybR934QNHSJZPTQ=
Expand Down Expand Up @@ -282,8 +284,8 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/sys v0.39.0 h1:CvCKL8MeisomCi6qNZ+wbb0DN9E5AATixKsvNtMoMFk=
golang.org/x/sys v0.39.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
Expand Down
Loading