diff --git a/package.json b/package.json index 2d1b52d..ca66e97 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "dependencies": { "@analytics/google-analytics": "^0.5.3", "@google/model-viewer": "^1.12.0", - "@ramp-network/ramp-instant-sdk": "^2.5.0", + "@ramp-network/ramp-instant-sdk": "^4.0.4", "@xstate/react": "^1.5.1", "analytics": "^0.7.14", "analytics-plugin-do-not-track": "^0.1.5", diff --git a/src/libs/ramp.ts b/src/libs/ramp.ts index c48aa00..f68d4d6 100644 --- a/src/libs/ramp.ts +++ b/src/libs/ramp.ts @@ -33,8 +33,10 @@ export const showRampPromise = ({ ...(REACT_APP_RAMP_API_KEY && { hostApiKey: REACT_APP_RAMP_API_KEY, }), + defaultFlow: "ONRAMP", + enabledFlows: ["ONRAMP"], ...(networkId === 3 && { - url: "https://ri-widget-staging-ropsten.firebaseapp.com/", + url: "https://app.demo.ramp.network/", }), }) /** Possible Events (for more info see https://docs.ramp.network/events) @@ -55,10 +57,9 @@ export const showRampPromise = ({ ?.classList.remove("ramp--loading-overwrite") case "WIDGET_CLOSE": return res(false) - case "PURCHASE_FAILED": case "WIDGET_CONFIG_FAILED": return rej(event.type) - case "PURCHASE_SUCCESSFUL": + case "PURCHASE_CREATED": return res(true) } }) diff --git a/yarn.lock b/yarn.lock index 07e5af7..a3390c8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2425,12 +2425,12 @@ pocket-js-core "0.0.3" web3-provider-engine "16.0.1" -"@ramp-network/ramp-instant-sdk@^2.5.0": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@ramp-network/ramp-instant-sdk/-/ramp-instant-sdk-2.5.0.tgz#4d8a746cd5cf2dfd6ffb1451058cfe9126d85c10" - integrity sha512-KKow1w+G49a/zq4Vv659G+ZVWs6DwWglLJL2H7XxATbCSE+7QknNjId/RIwJ1sDfJv10rV4AqjELXcPsgKlgcw== +"@ramp-network/ramp-instant-sdk@^4.0.4": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@ramp-network/ramp-instant-sdk/-/ramp-instant-sdk-4.0.4.tgz#25e1327ff2aead8bbab3c1cb5257da9041867442" + integrity sha512-Kkn+xwc4EbD2YqXOOQChZCqRT8/DM8sh9Qnz1nI2+/ACdo3INc42FMubgw5aZlyBzuF32XL/xdZyWBGPF4vECg== dependencies: - body-scroll-lock "^2.6.4" + body-scroll-lock "^3.1.5" "@resolver-engine/core@^0.3.3": version "0.3.3" @@ -5317,10 +5317,10 @@ body-parser@1.20.1, body-parser@^1.16.0: type-is "~1.6.18" unpipe "1.0.0" -body-scroll-lock@^2.6.4: - version "2.7.1" - resolved "https://registry.yarnpkg.com/body-scroll-lock/-/body-scroll-lock-2.7.1.tgz#caf3f9c91773af1ffb684cd66ed9137b5b737014" - integrity sha512-hS53SQ8RhM0e4DsQ3PKz6Gr2O7Kpdh59TWU98GHjaQznL7y4dFycEPk7pFQAikqBaUSCArkc5E3pe7CWIt2fZA== +body-scroll-lock@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/body-scroll-lock/-/body-scroll-lock-3.1.5.tgz#c1392d9217ed2c3e237fee1e910f6cdd80b7aaec" + integrity sha512-Yi1Xaml0EvNA0OYWxXiYNqY24AfWkbA6w5vxE7GWxtKfzIbZM+Qw+aSmkgsbWzbHiy/RCSkUZBplVxTA+E4jJg== bonjour@^3.5.0: version "3.5.0"