Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile Wallet #323

Merged
merged 62 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
0a2e4ff
chore: mobile build
sh-wallet Jul 25, 2023
6f23e1e
chore: react-native migration wip
sh-wallet Aug 6, 2023
87877e8
remove react-native-reanimated code
sh-wallet Aug 7, 2023
8e7abd3
chore: react-native styles fixes
sh-wallet Aug 8, 2023
1dd99d7
chore: react-native style, navigation and torus fixes
sh-wallet Aug 10, 2023
1d521b5
fix navigation issue
sh-wallet Aug 12, 2023
551b7e3
chore: fix mobile background communication and UI
sh-wallet Aug 14, 2023
09c2db6
chore: fix modal display issue wip
sh-wallet Aug 15, 2023
1880f6f
fix modal issue
sh-wallet Aug 16, 2023
72aa1c9
fix scroll and claim modal issue
sh-wallet Aug 18, 2023
0293095
fix account change issue
sh-wallet Aug 18, 2023
f773240
Rebranding and UI fixes
sh-wallet Aug 19, 2023
6197a7d
fix close modal issue
sh-wallet Aug 21, 2023
87f53f0
fix double-doughnut-chart
sh-wallet Aug 21, 2023
0e36592
fix: camera, UI issues, and Textual rebranding
sh-wallet Aug 21, 2023
0e40764
fix voting modal issue
sh-wallet Aug 23, 2023
d1dac25
fix background for extension and hide web tab mobile
sh-wallet Aug 25, 2023
4efa606
Android release build setup
sh-wallet Aug 27, 2023
634a1d0
Add buy and deposit button
sh-wallet Aug 29, 2023
baa38c2
added google/apple auth support
sh-wallet Aug 23, 2023
8a886e5
fix background for extension and hide web tab mobile
sh-wallet Aug 25, 2023
81493a8
fix issue
sh-wallet Sep 4, 2023
62cde72
added legacy dep script and camera permission
sh-wallet Sep 5, 2023
cc79e33
Merge branch 'mobile2' into mobile3
sh-wallet Sep 6, 2023
815a7ad
Added No fund view with buy, deposit option
sh-wallet Sep 6, 2023
fb60a25
fix modal back issues
sh-wallet Sep 6, 2023
f9dcf11
Merge branch 'mobile3' into mobile2
sh-wallet Sep 6, 2023
025a08e
Remove them option temporary
sh-wallet Sep 6, 2023
c568bee
Merge branch 'release_build' into mobile2
sh-wallet Sep 7, 2023
ddcfe26
change package name to com.fetchai.fetchwallet
sh-wallet Sep 7, 2023
2d82a76
fix google auth redirection issue
sh-wallet Sep 11, 2023
972aa9a
bug fixes
sh-wallet Sep 15, 2023
cfcd8be
back button on camera permission screen
sh-wallet Sep 15, 2023
1f79218
UI fixes and feature enhancement
sh-wallet Sep 17, 2023
571ac2f
Merge branch 'master' into mobile2
sh-wallet Sep 17, 2023
bdc481c
Added auto comment/uncomment script for extension and mobile
sh-wallet Sep 20, 2023
cb7563e
update readme and outputHash
sh-wallet Sep 20, 2023
42bc7bb
new register screen changes
sh-wallet Sep 21, 2023
64b9be9
splash screen updates
sh-wallet Sep 21, 2023
84b790a
color fixes
sh-wallet Sep 21, 2023
01b6b89
new onboarding design updates
sh-wallet Sep 21, 2023
d8a399e
android icon updates
sh-wallet Sep 22, 2023
c814d10
chore: bump internal android release version 2
sh-wallet Sep 26, 2023
df69d4c
chore: ios build (#333)
agent-dominatrix Sep 26, 2023
830e8e7
Merge branch 'master' into mobile2
sh-wallet Sep 26, 2023
a195e33
bug fixes, iOS app icons, and splash screen updates
sh-wallet Sep 28, 2023
20a8208
implement edit address book functionality
sh-wallet Oct 3, 2023
b49c680
implement edit account name functionality
sh-wallet Oct 3, 2023
9953e71
Added ledger mobile support via bluetooth
sh-wallet Oct 5, 2023
053b707
fix: location service issue in ledger modal
sh-wallet Oct 10, 2023
9e3f6b0
iOS UI and bug fixes
sh-wallet Oct 15, 2023
79aa33c
Change package name to com.fetchai.wallet
sh-wallet Oct 16, 2023
2cf380d
fix: iOS release build crash issue
sh-wallet Oct 23, 2023
0a41c99
chore: Added clean script for mobile
sh-wallet Oct 24, 2023
636b9ae
chore: bump new internal android release version 0.0.1 (1)
sh-wallet Oct 25, 2023
4554d75
fix: ledger sign model
sh-wallet Oct 26, 2023
0a4833e
fix: iOS keyboard issue in modal
sh-wallet Oct 30, 2023
9b68c17
fix: mobile improvements and UI fixes
sh-wallet Nov 1, 2023
776e99a
fix: iOS blur and script issue
sh-wallet Nov 5, 2023
86ea95e
chore: updated some deprecated methods and logbox warnings
sh-wallet Nov 6, 2023
facad72
Merge branch 'master' into mobile2
sh-wallet Dec 21, 2023
573191a
Fixed compatibility and yarn file issue
sh-wallet Dec 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ packages/proto-types/proto-types-gen/src
storybook-static
build-storybook.log
/.yarn/

.xcode.env
.xcode.env.local
cached-packages.json
26 changes: 24 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ You can find the latest versions of the official managed releases on these links
```sh
# This script is example for mac arm64 user. for other OS, replace URL(starts with https://..) to be matched with your OS from https://github.com/protocolbuffers/protobuf/releases/tag/v21.3
curl -Lo protoc-21.3.zip https://github.com/protocolbuffers/protobuf/releases/download/v21.3/protoc-21.3-osx-aarch_64.zip

#OR

# This script is example for linux x86_64 user
curl -Lo protoc-21.3.zip https://github.com/protocolbuffers/protobuf/releases/download/v21.3/protoc-21.3-linux-x86_64.zip

unzip protoc-21.3.zip -d $HOME/protoc
cp -r $HOME/protoc/include /usr/local
cp -r $HOME/protoc/bin /usr/local
Expand All @@ -44,15 +50,31 @@ npm install --global yarn lerna
Install and build packages:

```bash
yarn && yarn build
yarn && yarn build:libs
```

### Local dev server
### Local dev server for fetch-extension

```bash
yarn dev
```

### Local dev server for mobile

```bash
yarn android
```

```bash
yarn ios
```

In case of any error, try this and re-run the local dev server for mobile

```bash
yarn postinstall
```

## Author

👤 **Fetch.ai**
Expand Down
26 changes: 24 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,27 @@
"workspaces": {
"packages": [
"packages/*"
],
"nohoist": [
"**/@react-native-*/**",
"**/react-native",
"**/react-native/**",
"**/*-react-native",
"**/react-native-*",
"**/@react-navigation/**",
"**/expo-*",
"**/@unimodules/**",
"**/unimodules-*",
"**/native-base",
"**/@react-native-async-storage/async-storage",
"**/@ledgerhq/react-native-hw-transport-ble",
"**/jetifier",
"**/@bugsnag/**"
]
},
"installConfig": {
"hoistingLimits": "workspaces"
},
"scripts": {
"bootstrap": "lerna bootstrap",
"dev": "lerna run dev --parallel",
Expand Down Expand Up @@ -63,7 +82,9 @@
"@babel/preset-typescript": "^7.22.5",
"@octokit/core": "^3.5.1",
"@types/filesystem": "^0.0.32",
"@types/firefox-webext-browser": "^111.0.1",
"@types/jest": "^29.5.3",
"@types/long": "^4.0.1",
"@types/node": "^18.13.0",
"@types/react": "^16.14.4",
"@types/react-dom": "^16.9.11",
Expand All @@ -89,14 +110,15 @@
"node-gyp": "^9.3.1",
"pre-commit": "^1.2.2",
"prettier": "^2.8.4",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"semver": "^7.3.5",
"ts-jest": "^29.1.1",
"typescript": "^4.9.5",
"zx": "^4.2.0"
},
"resolutions": {
"react": "18.2.0",
"@types/react": "^16.14.4",
"@types/react-dom": "^16.9.11",
"@iov/crypto": "2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/background/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"curve25519-js": "0.0.4",
"delay": "^4.4.0",
"eciesjs": "^0.3.15",
"joi": "^17.5.0",
"joi": "^17.2.1",
"long": "^4.0.0",
"miscreant": "0.3.2",
"mobx": "^6.1.7",
Expand Down
11 changes: 5 additions & 6 deletions packages/background/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ import * as AutoLocker from "./auto-lock-account/internal";
import * as Analytics from "./analytics/internal";
import * as Umbral from "./umbral/internal";
import * as Messaging from "./messaging/internal";
import { KVStore } from "@keplr-wallet/common";
import { ChainInfo } from "@keplr-wallet/types";
import { CommonCrypto } from "./keyring";
import { Notification } from "./tx";
import { LedgerOptions } from "./ledger/options";

export * from "./persistent-memory";
export * from "./chains";
Expand All @@ -32,12 +37,6 @@ export * from "./phishing-list";
export * from "./auto-lock-account";
export * from "./analytics";

import { KVStore } from "@keplr-wallet/common";
import { ChainInfo } from "@keplr-wallet/types";
import { CommonCrypto } from "./keyring";
import { Notification } from "./tx";
import { LedgerOptions } from "./ledger/options";

export function init(
router: Router,
storeCreator: (prefix: string) => KVStore,
Expand Down
2 changes: 1 addition & 1 deletion packages/chain-validator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@keplr-wallet/cosmos": "0.12.12",
"@keplr-wallet/simple-fetch": "0.12.12",
"@keplr-wallet/types": "0.12.12",
"joi": "^17.5.0",
"joi": "^17.2.1",
"utility-types": "^3.10.0"
}
}
4 changes: 4 additions & 0 deletions packages/chain-validator/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ export const ChainInfoSchema = Joi.object<ChainInfo>({
return value;
}),
chainSymbolImageUrl: Joi.string().uri(),
txExplorer: Joi.object({
name: Joi.string().min(1).max(30).required(),
txUrl: Joi.string().uri(),
}),
}).custom((value: ChainInfo) => {
if (
value.alternativeBIP44s?.find(
Expand Down
1 change: 1 addition & 0 deletions packages/eth-migration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"lint-fix": "eslint --fix \"src/**/*\" && prettier --write \"src/**/*\""
},
"devDependencies": {
"@types/elliptic": "^6.4.12",
"@types/keccak": "^3.0.1"
},
"dependencies": {
Expand Down
8 changes: 5 additions & 3 deletions packages/fetch-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
"private": true,
"scripts": {
"clean": "rm -rf node_modules; rm -rf dist; rm -rf build",
"build": "cross-env NODE_ENV=production BUILD_OUTPUT=build/manifest-v3 webpack && cross-env NODE_ENV=production BUILD_MANIFEST_V2=true BUILD_OUTPUT=build/manifest-v2 webpack && zx ./scripts/post-build.mjs",
"build": "yarn build:background && cross-env NODE_ENV=production BUILD_OUTPUT=build/manifest-v3 webpack && cross-env NODE_ENV=production BUILD_MANIFEST_V2=true BUILD_OUTPUT=build/manifest-v2 webpack && zx ./scripts/post-build.mjs",
"build:noop": "tsc -p tsconfig.noop.json",
"dev": "cross-env NODE_ENV=development BUILD_MANIFEST_V2=true webpack",
"build:background": "echo 'Building build:background' && yarn fs:script && sh ./scripts/fix-background-module.sh && yarn workspace @keplr-wallet/background build",
"fs:script": "sh ./scripts/fix-fetchai-blst-js.sh && sh ./scripts/fix-fetchai-path-node-js.sh",
"dev:analyzer": "cross-env NODE_ENV=development ANALYZER=true webpack",
"analyzer": "cross-env NODE_ENV=production ANALYZER=true DISABLE_SPLIT_CHUNKS=true webpack",
"analyzer:chunks": "cross-env NODE_ENV=production ANALYZER=true webpack",
Expand Down Expand Up @@ -180,7 +182,7 @@
"mobx": "^6",
"mobx-react-lite": "^3",
"mobx-utils": "^6",
"react": "^16.8.0 || ^17 || ^18",
"react-dom": "^16.8.0 || ^17 || ^18"
"react": "^18",
"react-dom": "^18"
}
}
83 changes: 83 additions & 0 deletions packages/fetch-extension/scripts/fix-background-module.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
#!/usr/bin/env bash

# Comment unsupported background feat init

DIR="$( cd "$( dirname "$0" )" && pwd -P )"
file_path=${DIR}/../../background/src/index.ts

# Check if the file exists
if [ ! -f "$file_path" ]; then
echo "Background Module Error: File '$file_path' not found."
exit 1
fi

# Print the original file content
# echo "Original content of $file_path:"
# cat "$file_path"

###################################################################
# Auto lock account service
auto_lock='import \* as AutoLocker from "\./auto-lock-account/internal";'
auto_lock_replacement="\/\/ $auto_lock"
# Uncomment
sed -i'' -e "s|$auto_lock_replacement|$auto_lock|g" "$file_path"

###################################################################
# Define the start for the code block
auto_lock_service_upattern='// const autoLockAccountService = new AutoLocker.AutoLockAccountService('

# Use awk to uncomment the code block while preserving line breaks
awk -v start="$auto_lock_service_upattern" '
# If a line matches the commented start pattern, set a flag to begin uncommenting
index($0, start) {
uncomment_flag = 1
}
# If the uncomment flag is set, remove the comment characters
uncomment_flag {
sub("// ", "", $0)
}
# If a line ends the code block (contains ");"), unset the flag to stop uncommenting
index($0, ");") && uncomment_flag {
uncomment_flag = 0
}
# Print the line
1
' "$file_path" > tmpfile && mv tmpfile "$file_path"

###################################################################
auto_lock_sinit='AutoLocker.init(router, autoLockAccountService);'
auto_lock_sinit_replacement="\/\/ $auto_lock_sinit"
sed -i'' -e "s|$auto_lock_sinit_replacement|$auto_lock_sinit|g" "$file_path"

###################################################################
auto_lock_init='await autoLockAccountService.init(keyRingService);'
auto_lock_init_replacement="\/\/ $auto_lock_init"
sed -i'' -e "s|$auto_lock_init_replacement|$auto_lock_init|g" "$file_path"

###################################################################
# Umbral service
umbral='import \* as Umbral from "\./umbral/internal";'
umbral_replacement="\/\/ $umbral"
sed -i'' -e "s|$umbral_replacement|$umbral|g" "$file_path"

###################################################################
umbral_service='const umbralService = new Umbral.UmbralService(chainsService);'
umbral_service_replacement="\/\/ $umbral_service"
sed -i'' -e "s|$umbral_service_replacement|$umbral_service|g" "$file_path"

###################################################################
umbral_sinit='Umbral.init(router, umbralService);'
umbral_sinit_replacement="\/\/ $umbral_sinit"
sed -i'' -e "s|$umbral_sinit_replacement|$umbral_sinit|g" "$file_path"

###################################################################
umbral_init='await umbralService.init(keyRingService, permissionService);'
umbral_init_replacement="\/\/ $umbral_init"
sed -i'' -e "s|$umbral_init_replacement|$umbral_init|g" "$file_path"

# Check if the replacement was successful
if [ $? -eq 0 ]; then
echo "Supported feat updates completed successfully."
else
echo "Background Module Error: Supported feat updates failed."
fi
77 changes: 77 additions & 0 deletions packages/fetch-extension/scripts/fix-fetchai-blst-js.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/usr/bin/env bash

# Comment @fetchai/blst-ts/prebuild/emscripten

DIR="$( cd "$( dirname "$0" )" && pwd -P )"
file_path=${DIR}/../../../node_modules/@fetchai/blst-ts/prebuild/emscripten/blst.js

# Check if the file exists
if [ ! -f "$file_path" ]; then
echo "@fetchai blst.js Error: File '$file_path' not found."
exit 1
fi

###################################################################
# blst.js
fs='var fs;'
fs_replacement="\/\/ $fs"
# Uncomment
sed -i'' -e "s|$fs_replacement|$fs|g" "$file_path"

###################################################################
# fs = require('fs');
fs="fs = require('fs');"
fs_replacement="\/\/ $fs"
# Uncomment
sed -i'' -e "s|$fs_replacement|$fs|g" "$file_path"

###################################################################
# read_
read_uc='// read_ = function shell_read(filename, binary) {'

# Use awk to uncomment the code block while preserving line breaks
awk -v start="$read_uc" '
# If a line matches the commented start pattern, set a flag to begin uncommenting
index($0, start) {
uncomment_flag = 1
}
# If the uncomment flag is set, remove the comment characters
uncomment_flag {
sub("//", "", $0)
}
# If a line ends the code block (contains "};"), unset the flag to stop uncommenting
index($0, "};") && uncomment_flag {
uncomment_flag = 0
}
# Print the line
1
' "$file_path" > tmpfile && mv tmpfile "$file_path"

###################################################################
# readAsync
read_uc='// fs.readFile(filename, function(err, data) {'

# Use awk to uncomment the code block while preserving line breaks
awk -v start="$read_uc" '
# If a line matches the commented start pattern, set a flag to begin uncommenting
index($0, start) {
uncomment_flag = 1
}
# If the uncomment flag is set, remove the comment characters
uncomment_flag {
sub("//", "", $0)
}
# If a line ends the code block (contains "});"), unset the flag to stop uncommenting
index($0, "});") && uncomment_flag {
uncomment_flag = 0
}
# Print the line
1
' "$file_path" > tmpfile && mv tmpfile "$file_path"

# Check if the replacement was successful
if [ $? -eq 0 ]; then
echo "@fetchai blst.js updates completed successfully."
else
echo "@fetchai blst.js Error: updates failed."
fi
Loading
Loading