Skip to content

Commit

Permalink
issue-1005, issue-950] Support fiat on-ramp with Coinbase Pay, Banxa …
Browse files Browse the repository at this point in the history
…on mobile app
  • Loading branch information
nguyenduythuc committed Sep 18, 2023
1 parent fc38d09 commit e4a2765
Show file tree
Hide file tree
Showing 706 changed files with 1,782 additions and 1,398 deletions.
8 changes: 8 additions & 0 deletions .env.development.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
TRANSAK_URL="https://global.transak.com"
TRANSAK_API_KEY="4b767e2c-2e01-45c9-978e-d32c6f0c8900"
BANXA_URL="https://subwallet.banxa.com"
COINBASE_PAY_ID="1dbd2a0b94"

# Development
DEV_TRANSAK_URL="https://global-stg.transak.com"
DEV_BANXA_URL="https://subwallet.banxa-sandbox.com"
13 changes: 13 additions & 0 deletions .github/workflows/push-koni-dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
COMMIT_MESSAGE: ${{ github.event.pull_request.title }}
REF_NAME: ${{ github.ref_name }}
TRANSAK_API_KEY: ${{ secrets.TRANSAK_API_KEY }}
COINBASE_PAY_ID: ${{ secrets.COINBASE_PAY_ID }}
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -31,6 +33,17 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- name: Add APP ENV
run: |
cp .env.development.example .env.production
if [ -f .env.production ]; then
sed -i '' "s/^TRANSAK_API_KEY=.*/TRANSAK_API_KEY=$TRANSAK_API_KEY/" .env.production
sed -i '' "s/^COINBASE_PAY_ID=.*/COINBASE_PAY_ID=$COINBASE_PAY_ID/" .env.production
else
echo "TRANSAK_API_KEY=$TRANSAK_API_KEY" >> .env.production
echo "COINBASE_PAY_ID=$COINBASE_PAY_ID" >> .env.production
fi
- name: Install Dependencies
run: yarn install --immutable | grep -v 'YN0013'

Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ yarn-error.log

# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*
.env
.env.development
.env.production
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
apply plugin: "com.android.application"
apply plugin: "com.facebook.react"
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"

import com.android.build.OutputFile

Expand Down
1 change: 0 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ module.exports = {
},
],
'react-native-reanimated/plugin',
['module:react-native-dotenv'],
['@babel/plugin-transform-flow-strip-types'],
['@babel/plugin-transform-private-methods', { loose: true }],
],
Expand Down
8 changes: 8 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,10 @@ PODS:
- React-Core
- react-native-cameraroll (5.7.2):
- React-Core
- react-native-config (1.5.1):
- react-native-config/App (= 1.5.1)
- react-native-config/App (1.5.1):
- React-Core
- react-native-document-picker (8.2.1):
- React-Core
- react-native-image-picker (5.6.0):
Expand Down Expand Up @@ -603,6 +607,7 @@ DEPENDENCIES:
- React-logger (from `../node_modules/react-native/ReactCommon/logger`)
- react-native-camera (from `../node_modules/react-native-camera`)
- "react-native-cameraroll (from `../node_modules/@react-native-camera-roll/camera-roll`)"
- react-native-config (from `../node_modules/react-native-config`)
- react-native-document-picker (from `../node_modules/react-native-document-picker`)
- react-native-image-picker (from `../node_modules/react-native-image-picker`)
- react-native-mmkv (from `../node_modules/react-native-mmkv`)
Expand Down Expand Up @@ -723,6 +728,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-camera"
react-native-cameraroll:
:path: "../node_modules/@react-native-camera-roll/camera-roll"
react-native-config:
:path: "../node_modules/react-native-config"
react-native-document-picker:
:path: "../node_modules/react-native-document-picker"
react-native-image-picker:
Expand Down Expand Up @@ -859,6 +866,7 @@ SPEC CHECKSUMS:
React-logger: 35538accacf2583693fbc3ee8b53e69a1776fcee
react-native-camera: 3eae183c1d111103963f3dd913b65d01aef8110f
react-native-cameraroll: 134805127580aed23403b8c2cb1548920dd77b3a
react-native-config: 86038147314e2e6d10ea9972022aa171e6b1d4d8
react-native-document-picker: 69ca2094d8780cfc1e7e613894d15290fdc54bba
react-native-image-picker: db60857e03d63721f19b6f4027de20429ddd9cba
react-native-mmkv: dea675cf9697ad35940f1687e98e133e1358ef9f
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1210"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<PreActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "# Type a script or drag a script file from your workspace to insert its path.&#10;cp &quot;${PROJECT_DIR}/../.env.production&quot; &quot;${PROJECT_DIR}/../.env&quot;&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "SubWalletMobile.app"
BlueprintName = "SubWalletMobile"
ReferencedContainer = "container:SubWalletMobile.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PreActions>
<PostActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "# Type a script or drag a script file from your workspace to insert its path.&#10;rm -f &quot;${PROJECT_DIR}/../.env&quot;&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "SubWalletMobile.app"
BlueprintName = "SubWalletMobile"
ReferencedContainer = "container:SubWalletMobile.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PostActions>
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "SubWalletMobile.app"
BlueprintName = "SubWalletMobile"
ReferencedContainer = "container:SubWalletMobile.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "SubWalletMobileTests.xctest"
BlueprintName = "SubWalletMobileTests"
ReferencedContainer = "container:SubWalletMobile.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "SubWalletMobile.app"
BlueprintName = "SubWalletMobile"
ReferencedContainer = "container:SubWalletMobile.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "SubWalletMobile.app"
BlueprintName = "SubWalletMobile"
ReferencedContainer = "container:SubWalletMobile.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1210"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<PreActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "# Type a script or drag a script file from your workspace to insert its path.&#10;cp &quot;${PROJECT_DIR}/../.env.development&quot; &quot;${PROJECT_DIR}/../.env&quot;&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "SubWalletMobile.app"
BlueprintName = "SubWalletMobile"
ReferencedContainer = "container:SubWalletMobile.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PreActions>
<PostActions>
<ExecutionAction
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
<ActionContent
title = "Run Script"
scriptText = "# Type a script or drag a script file from your workspace to insert its path.&#10;rm -f &quot;${PROJECT_DIR}/../.env&quot;&#10;">
<EnvironmentBuildable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "SubWalletMobile.app"
BlueprintName = "SubWalletMobile"
ReferencedContainer = "container:SubWalletMobile.xcodeproj">
</BuildableReference>
</EnvironmentBuildable>
</ActionContent>
</ExecutionAction>
</PostActions>
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "SubWalletMobile.app"
BlueprintName = "SubWalletMobile"
ReferencedContainer = "container:SubWalletMobile.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "00E356ED1AD99517003FC87E"
BuildableName = "SubWalletMobileTests.xctest"
BlueprintName = "SubWalletMobileTests"
ReferencedContainer = "container:SubWalletMobile.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "SubWalletMobile.app"
BlueprintName = "SubWalletMobile"
ReferencedContainer = "container:SubWalletMobile.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
BuildableName = "SubWalletMobile.app"
BlueprintName = "SubWalletMobile"
ReferencedContainer = "container:SubWalletMobile.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
],
"scripts": {
"postinstall": "patch-package && rm -rf node_modules/react-native-qrcode-scanner/node_modules/react-native-permissions && npx react-native setup-ios-permissions",
"android": "react-native run-android",
"ios": "react-native run-ios",
"android": "ENVFILE=.env.development react-native run-android",
"ios": "ENVFILE=.env.development react-native run-ios",
"android:production": "cd android && export ENVFILE=.env.production && ./gradlew bundleRelease && open app/build/outputs/bundle/release/",
"ios:production": "scripts/build-ios.sh",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"@coinbase/cbpay-js": "^1.7.0",
"@fortawesome/fontawesome-svg-core": "^6.2.1",
"@fortawesome/free-brands-svg-icons": "^6.2.1",
"@fortawesome/free-regular-svg-icons": "^6.2.1",
Expand Down Expand Up @@ -76,6 +79,7 @@
"react-native-bcrypt": "^2.4.0",
"react-native-boring-avatars": "^1.0.1",
"react-native-camera": "^4.2.1",
"react-native-config": "^1.5.1",
"react-native-confirmation-code-field": "^7.3.1",
"react-native-device-info": "^10.3.0",
"react-native-document-picker": "^8.1.3",
Expand Down Expand Up @@ -111,6 +115,7 @@
"react-native-svg-transformer": "^1.0.0",
"react-native-tab-view": "^3.5.2",
"react-native-toast-notifications": "^3.3.1",
"react-native-url-polyfill": "^2.0.0",
"react-native-vector-icons": "^9.2.0",
"react-native-version-number": "^0.3.6",
"react-native-video": "^5.2.1",
Expand Down Expand Up @@ -140,7 +145,6 @@
"@types/react": "^18.0.25",
"@types/react-native": "^0.70.6",
"@types/react-native-bcrypt": "^2.4.2",
"@types/react-native-dotenv": "^0.2.0",
"@types/react-native-vector-icons": "^6.4.12",
"@types/react-native-video": "^5.0.14",
"@types/react-redux": "^7.1.24",
Expand All @@ -166,7 +170,6 @@
"os-browserify": "^0.3.0",
"path-browserify": "^1.0.1",
"react-devtools": "^4.27.0",
"react-native-dotenv": "^3.4.8",
"react-test-renderer": "^18.2.0",
"readable-stream": "^4.2.0",
"stream-browserify": "^3.0.0",
Expand Down
Loading

0 comments on commit e4a2765

Please sign in to comment.