Skip to content

Commit 251912f

Browse files
authored
Merge pull request #5836 from EdgeApp/sam/remote-ramp-constraints
Sam/remote ramp constraints
2 parents 18dff14 + b839865 commit 251912f

File tree

5 files changed

+84
-11
lines changed

5 files changed

+84
-11
lines changed

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@jsr:registry=https://npm.jsr.io

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
## 4.39.0 (staging)
66

77
- added: BitsOfGold and LibertyX ramp plugins.
8+
- added: Added remote ramp plugin filtering from info-server rollup.
89
- fixed: Fixed broken `logEvent` tracking calls by adding the needed `dispatch`.
910
- fixed: Localized display names for payment types in new buy/sell feature.
1011
- removed: Remove change quote tracking.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
},
6969
"dependencies": {
7070
"@brigad/react-native-adservices": "^0.1.3",
71+
"@edge.app/drupe": "^0.0.6",
7172
"@ethersproject/shims": "^5.6.0",
7273
"@noble/curves": "^1.9.7",
7374
"@noble/hashes": "^1.8.0",
@@ -109,7 +110,7 @@
109110
"edge-currency-monero": "^2.0.0",
110111
"edge-currency-plugins": "^3.8.8",
111112
"edge-exchange-plugins": "^2.39.0",
112-
"edge-info-server": "^3.9.0",
113+
"edge-info-server": "^3.10.0",
113114
"edge-login-ui-rn": "^3.34.1",
114115
"ethers": "^5.7.2",
115116
"expo": "^53.0.0",

src/plugins/ramps/rampConstraints.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import { drupe } from '@edge.app/drupe'
2+
3+
import { infoServerData } from '../../util/network'
14
import type {
25
FiatPaymentType,
36
FiatPluginRegionCode
@@ -16,6 +19,18 @@ export interface RampConstraintParams {
1619
export function validateRampConstraintParams(
1720
params: RampConstraintParams
1821
): boolean {
22+
try {
23+
const rampQuoteFilter = infoServerData.rollup?.rampQuoteFilter
24+
const isRemotePassing =
25+
rampQuoteFilter == null ? true : drupe(rampQuoteFilter)(params)
26+
27+
if (!isRemotePassing) {
28+
return false
29+
}
30+
} catch (error) {
31+
console.error('Error validating ramp constraint params: ', String(error))
32+
}
33+
1934
for (const constraint of constraintGenerator(params)) {
2035
if (!constraint) {
2136
return false

yarn.lock

Lines changed: 65 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,6 +1287,20 @@
12871287
resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70"
12881288
integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==
12891289

1290+
"@edge.app/drupe@^0.0.6":
1291+
version "0.0.6"
1292+
resolved "https://registry.yarnpkg.com/@edge.app/drupe/-/drupe-0.0.6.tgz#2dc8589ffb77f45a63585be6501956a8b7cf0eac"
1293+
integrity sha512-0wemuWGMeVj1fv8dd+w2uUh7/xFgW+fZgtrvuSxd8i4U6KDwBh9n6ZY1IcU2t8fTVgAL+Pnt0ccxvCqOuu0uvg==
1294+
dependencies:
1295+
pouchdb-selector-core "^9.0.0"
1296+
1297+
"@edge.app/drupe@^0.0.8":
1298+
version "0.0.8"
1299+
resolved "https://registry.yarnpkg.com/@edge.app/drupe/-/drupe-0.0.8.tgz#1bd42545702559fb2389a06fae98625bbcb1bedd"
1300+
integrity sha512-oRGHVJf6rBoIipGY+fbxr3VceUt4EKrjjwgl4jXpk2th20WMI8I2RXMHcEceGNSuwUBsZPq7C8Rkjsl2gf2pSA==
1301+
dependencies:
1302+
pouchdb-selector-core "^9.0.0"
1303+
12901304
"@egjs/hammerjs@^2.0.17":
12911305
version "2.0.17"
12921306
resolved "https://registry.yarnpkg.com/@egjs/hammerjs/-/hammerjs-2.0.17.tgz#5dc02af75a6a06e4c2db0202cae38c9263895124"
@@ -9554,11 +9568,12 @@ edge-exchange-plugins@^2.39.0:
95549568
regenerator-runtime "0.13.11"
95559569
xrpl "^2.10.0"
95569570

9557-
edge-info-server@^3.9.0:
9558-
version "3.9.0"
9559-
resolved "https://registry.yarnpkg.com/edge-info-server/-/edge-info-server-3.9.0.tgz#4e51151bb540476e2e221611740ae732684ccfb4"
9560-
integrity sha512-6gkitSvQ7gOUn0HfjVyQQS42StZNjKranpiAw+4hwejDqTIll6ANkyParWOgrlIqqLXdsfBzoKnJ1Ta8YqD1wQ==
9571+
edge-info-server@^3.10.0:
9572+
version "3.10.0"
9573+
resolved "https://registry.yarnpkg.com/edge-info-server/-/edge-info-server-3.10.0.tgz#76ba0a513e2a44b27f94a24070cc87dfa358e3fb"
9574+
integrity sha512-JsG4QaR+36u/ZVpyEAk3Lzw6FOA7HY250eGfG4WPtvZB14621cgM0o9FJGuHuAFUOnuh0M9TRMAiGUZ41q/CKw==
95619575
dependencies:
9576+
"@edge.app/drupe" "^0.0.8"
95629577
"@orbs-network/ton-access" "^2.3.3"
95639578
cleaners "^0.3.16"
95649579
git-refresher "^0.1.1"
@@ -15346,6 +15361,46 @@ posthog-react-native@^2.8.1:
1534615361
resolved "https://registry.yarnpkg.com/posthog-react-native/-/posthog-react-native-2.8.1.tgz#ed29b25a8ef473f49cf5f31396e88de4b9103da7"
1534715362
integrity sha512-ozaqyn2eaAwb0Wza+bFsVpEuv1vVFjtVF17m4lHN7b8RO9FGBdBPiHA6LAD+ESAB59H16y+J9SxDVmmq23ATDw==
1534815363

15364+
pouchdb-binary-utils@9.0.0:
15365+
version "9.0.0"
15366+
resolved "https://registry.yarnpkg.com/pouchdb-binary-utils/-/pouchdb-binary-utils-9.0.0.tgz#eafed32c21e92ef4b253456f9e53c4cf2cfd99fd"
15367+
integrity sha512-2OMtgDZi82vqs+zNDE0YiYjOaWkYCUcZJZKK3WkRr+XYRu+2B7umJrnygJFhUwoGedBbHSrlQBLhdNV3F1AX1A==
15368+
15369+
pouchdb-collate@9.0.0:
15370+
version "9.0.0"
15371+
resolved "https://registry.yarnpkg.com/pouchdb-collate/-/pouchdb-collate-9.0.0.tgz#654f6766927ada60603ba25b6b2ae533564fa302"
15372+
integrity sha512-TrnEDNZEmIIl+W3xKUO8h+geqVLQ90oZe5ujPkl8myUzpREULWXWQBnV5EzPXVEKDBpJlb8T3I6oy/zdWGQpdA==
15373+
15374+
pouchdb-errors@9.0.0:
15375+
version "9.0.0"
15376+
resolved "https://registry.yarnpkg.com/pouchdb-errors/-/pouchdb-errors-9.0.0.tgz#f84269ce3327abef9455c0a90a51c26d7dca20c6"
15377+
integrity sha512-961PSMLhW0UqqdJ566g+CdLZ5pkBJRd6l4WWpCDdD0USvE4xYfYGzv43w7nZZBw1k3Xdy092yqPge7yX/tfnyw==
15378+
15379+
pouchdb-md5@9.0.0:
15380+
version "9.0.0"
15381+
resolved "https://registry.yarnpkg.com/pouchdb-md5/-/pouchdb-md5-9.0.0.tgz#f67a2ba627309e65f8d1ce4d4baf6a5f29164617"
15382+
integrity sha512-58xUYBvW3/s+aH0j4uOhhN8yCk0LQ254cxBzI/gbKA9PrfwHpe4zrr0L/ia5ml3A30oH1f8aTnuVMwWDkFcuww==
15383+
dependencies:
15384+
pouchdb-binary-utils "9.0.0"
15385+
spark-md5 "3.0.2"
15386+
15387+
pouchdb-selector-core@^9.0.0:
15388+
version "9.0.0"
15389+
resolved "https://registry.yarnpkg.com/pouchdb-selector-core/-/pouchdb-selector-core-9.0.0.tgz#6fee1df82cd5ecdbd0a034b38e6c604557d2e22a"
15390+
integrity sha512-ZYHYsdoedwm8j5tYofz+3+uUSK8i+7tRCBb01T0OuqDQb17+w5mzjHF8Ppi160xdPUPaWCo1Un+nLWGJzkmA3g==
15391+
dependencies:
15392+
pouchdb-collate "9.0.0"
15393+
pouchdb-utils "9.0.0"
15394+
15395+
pouchdb-utils@9.0.0:
15396+
version "9.0.0"
15397+
resolved "https://registry.yarnpkg.com/pouchdb-utils/-/pouchdb-utils-9.0.0.tgz#b68f3259add50163998201d1a6d16e6a35d5d57f"
15398+
integrity sha512-xWZE5c+nAslgmLC8JBZbky8AYgdz7pKtv7KTSi6CD2tuQD0WyNKib0YnhZndeE84dksTeZlqlg56RQHsHoB2LQ==
15399+
dependencies:
15400+
pouchdb-errors "9.0.0"
15401+
pouchdb-md5 "9.0.0"
15402+
uuid "8.3.2"
15403+
1534915404
prebuild-install@^7.1.1:
1535015405
version "7.1.3"
1535115406
resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-7.1.3.tgz#d630abad2b147443f20a212917beae68b8092eec"
@@ -17347,7 +17402,7 @@ source-map@^0.6.0, source-map@^0.6.1:
1734717402
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
1734817403
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
1734917404

17350-
spark-md5@^3.0.2:
17405+
spark-md5@3.0.2, spark-md5@^3.0.2:
1735117406
version "3.0.2"
1735217407
resolved "https://registry.yarnpkg.com/spark-md5/-/spark-md5-3.0.2.tgz#7952c4a30784347abcee73268e473b9c0167e3fc"
1735317408
integrity sha512-wcFzz9cDfbuqe0FZzfi2or1sgyIrsDwmPwfZC4hiNidPdPINjeUwNfv5kldczoEAcjl9Y1L3SM7Uz2PUEQzxQw==
@@ -18746,6 +18801,11 @@ uuid@3.3.2:
1874618801
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.3.2.tgz#1b4af4955eb3077c501c23872fc6513811587131"
1874718802
integrity sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==
1874818803

18804+
uuid@8.3.2, uuid@^8.3.2:
18805+
version "8.3.2"
18806+
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
18807+
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
18808+
1874918809
uuid@^3.3.2:
1875018810
version "3.4.0"
1875118811
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
@@ -18756,11 +18816,6 @@ uuid@^7.0.3:
1875618816
resolved "https://registry.yarnpkg.com/uuid/-/uuid-7.0.3.tgz#c5c9f2c8cf25dc0a372c4df1441c41f5bd0c680b"
1875718817
integrity sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==
1875818818

18759-
uuid@^8.3.2:
18760-
version "8.3.2"
18761-
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
18762-
integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==
18763-
1876418819
v8-to-istanbul@^9.0.1:
1876518820
version "9.1.0"
1876618821
resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz#1b83ed4e397f58c85c266a570fc2558b5feb9265"

0 commit comments

Comments
 (0)