Skip to content

Commit

Permalink
Remove ramp from App (#767)
Browse files Browse the repository at this point in the history
* Remove and comment out Ramp from TypeScript code

* Remove ramp from ios and android.
  • Loading branch information
jessgusclark authored Oct 6, 2023
1 parent 7832cc7 commit c5b6f8e
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 70 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ dependencies {
implementation "com.facebook.react:react-native:+" // From node_modules

implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
implementation 'com.github.RampNetwork:ramp-sdk-android:1.+'
// implementation 'com.github.RampNetwork:ramp-sdk-android:1.+'

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
Expand Down
4 changes: 2 additions & 2 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ platform :ios, '12.4'
inhibit_all_warnings!

# Dependecies required for Ramp.network:
source 'https://github.com/CocoaPods/Specs.git'
# source 'https://github.com/CocoaPods/Specs.git'

target 'rifWallet' do
config = use_native_modules!
Expand All @@ -32,7 +32,7 @@ target 'rifWallet' do

pod 'react-native-config', :path => '../node_modules/react-native-config'
pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'
pod 'Ramp', :git => 'https://github.com/RampNetwork/ramp-sdk-ios', :tag => '4.0.1'
# pod 'Ramp', :git => 'https://github.com/RampNetwork/ramp-sdk-ios', :tag => '4.0.1'

target 'rifWalletTests' do
inherit! :complete
Expand Down
20 changes: 1 addition & 19 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,6 @@ PODS:
- OpenSSL-Universal (1.1.1100)
- PromisesObjC (2.1.1)
- Protobuf (3.21.12)
- Ramp (4.0.1)
- ramp-network-react-native-sdk (1.0.1):
- Ramp
- React-Core
- RCT-Folly (2021.07.22.00):
- boost
- DoubleConversion
Expand Down Expand Up @@ -552,8 +548,6 @@ DEPENDENCIES:
- jail-monkey (from `../node_modules/jail-monkey`)
- libevent (~> 2.1.12)
- OpenSSL-Universal (= 1.1.1100)
- Ramp (from `https://github.com/RampNetwork/ramp-sdk-ios`, tag `4.0.1`)
- "ramp-network-react-native-sdk (from `../node_modules/@ramp-network/react-native-sdk`)"
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
- RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`)
Expand Down Expand Up @@ -656,11 +650,6 @@ EXTERNAL SOURCES:
:podspec: "../node_modules/react-native/sdks/hermes/hermes-engine.podspec"
jail-monkey:
:path: "../node_modules/jail-monkey"
Ramp:
:git: https://github.com/RampNetwork/ramp-sdk-ios
:tag: 4.0.1
ramp-network-react-native-sdk:
:path: "../node_modules/@ramp-network/react-native-sdk"
RCT-Folly:
:podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
RCTRequired:
Expand Down Expand Up @@ -758,11 +747,6 @@ EXTERNAL SOURCES:
Yoga:
:path: "../node_modules/react-native/ReactCommon/yoga"

CHECKOUT OPTIONS:
Ramp:
:git: https://github.com/RampNetwork/ramp-sdk-ios
:tag: 4.0.1

SPEC CHECKSUMS:
boost: a7c83b31436843459a1961bfd74b96033dc77234
BVLinearGradient: 34a999fda29036898a09c6a6b728b0b4189e1a44
Expand Down Expand Up @@ -800,8 +784,6 @@ SPEC CHECKSUMS:
OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c
PromisesObjC: ab77feca74fa2823e7af4249b8326368e61014cb
Protobuf: 120350fc38646e2dedc26f49ecba778184ea1de2
Ramp: 3f843fb75cac12ad40842afa3226bae36dc93521
ramp-network-react-native-sdk: dabb00cff767616c6c50c1964eea3c0fcad7bee9
RCT-Folly: 0080d0a6ebf2577475bda044aa59e2ca1f909cda
RCTRequired: e1866f61af7049eb3d8e08e8b133abd38bc1ca7a
RCTTypeSafety: 27c2ac1b00609a432ced1ae701247593f07f901e
Expand Down Expand Up @@ -854,6 +836,6 @@ SPEC CHECKSUMS:
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb

PODFILE CHECKSUM: 8b2b9ce9f5d51b70a31f8e58224ff082d614339e
PODFILE CHECKSUM: e1b020c087aad27de326c92dd99568820885b80b

COCOAPODS: 1.11.3
64 changes: 32 additions & 32 deletions ios/rifWallet.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"@ethersproject/shims": "^5.7.0",
"@hookform/resolvers": "^2.9.11",
"@json-rpc-tools/utils": "^1.7.6",
"@ramp-network/react-native-sdk": "^1.0.1",
"@react-native-async-storage/async-storage": "^1.19.0",
"@react-native-community/clipboard": "^1.5.1",
"@react-native-community/hooks": "^2.8.1",
Expand Down
2 changes: 2 additions & 0 deletions src/lib/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ const resources = {
dapps_uri_not_valid_title: 'Invalid URI',
dapps_uri_not_valid_message:
'URI is not valid. Please try with a new URI.',
ramp_error_title: 'Not Available',
ramp_error: 'Adding funds is not available yet.',
},
},
es: {
Expand Down
21 changes: 11 additions & 10 deletions src/screens/home/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import RampSdk from '@ramp-network/react-native-sdk'
import { useCallback, useEffect, useMemo, useState } from 'react'
import { StyleSheet, View, ScrollView } from 'react-native'
import { StyleSheet, View, ScrollView, Alert } from 'react-native'
import { BitcoinNetwork } from '@rsksmart/rif-wallet-bitcoin'
import { useTranslation } from 'react-i18next'
import { useIsFocused } from '@react-navigation/native'

import { getChainIdByType } from 'lib/utils'

import { toChecksumAddress } from 'components/address/lib'
import { Typography } from 'components/typography'
import {
homeStackRouteNames,
Expand Down Expand Up @@ -52,7 +48,7 @@ export const HomeScreen = ({
const { t } = useTranslation()
const isFocused = useIsFocused()
const dispatch = useAppDispatch()
const { wallet, chainType } = useAppSelector(selectWalletState)
const { wallet } = useAppSelector(selectWalletState)
const tokenBalances = useAppSelector(selectBalances)
const transactions = useAppSelector(selectTransactions)
const totalUsdBalance = useAppSelector(selectTotalUsdValue)
Expand Down Expand Up @@ -82,7 +78,7 @@ export const HomeScreen = ({
backgroundColor: selectedAddress ? selectedColor : sharedColors.borderColor,
}

const rampConfig = useMemo(
/*const rampConfig = useMemo(
() => ({
// for testnet:
url: 'https://app.demo.ramp.network',
Expand All @@ -109,7 +105,7 @@ export const HomeScreen = ({
const addBalance = useCallback(() => {
ramp.on('*', console.log)
ramp.show(rampConfig)
}, [ramp, rampConfig])
}, [ramp, rampConfig])*/

const handleBitcoinSendReceive = useCallback(
(
Expand Down Expand Up @@ -148,10 +144,15 @@ export const HomeScreen = ({
token: selected,
})
case 'FAUCET':
return addBalance()
return Alert.alert(t('ramp_error_title'), t('ramp_error'), [
{
text: t('confirm_key_button'),
},
])
// return addBalance()
}
},
[handleBitcoinSendReceive, navigation, selected, addBalance],
[handleBitcoinSendReceive, navigation, selected, t],
)

useEffect(() => {
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1712,11 +1712,6 @@
tiny-glob "^0.2.9"
tslib "^2.4.0"

"@ramp-network/react-native-sdk@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@ramp-network/react-native-sdk/-/react-native-sdk-1.0.1.tgz#0a3047cf345514dd66995573ba805c4777b4f8ea"
integrity sha512-Jo4Bd+KDHgTwD5KFzxEVCkOpCB2y2WrJckLgKU91m0WM5UC9g+aGPle2/5Jddfoe3d7CapVrh15J1bsAuoadxw==

"@react-native-async-storage/async-storage@^1.19.0":
version "1.19.0"
resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.19.0.tgz#594aca9c20924b7955d62cf43797b4187e1e6cf8"
Expand Down

0 comments on commit c5b6f8e

Please sign in to comment.