Skip to content

Commit e20a2ea

Browse files
beguenefbwoolf
authored andcommitted
feat: add moonpay fiat onramp
closes #2068
1 parent 13000c9 commit e20a2ea

File tree

8 files changed

+22
-4
lines changed

8 files changed

+22
-4
lines changed

config/wallet-config.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
"global": []
44
},
55
"activeFiatProviders": {
6-
"transak": { "name": "transak", "enabled": true },
7-
"okcoin": { "name": "okcoin", "enabled": true }
6+
"moonpay": { "name": "moonpay", "enabled": true },
7+
"okcoin": { "name": "okcoin", "enabled": true },
8+
"transak": { "name": "transak", "enabled": true }
89
},
910
"feeEstimations": {
1011
"maxValues": [500000, 750000, 2000000],

config/wallet-config.schema.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@
5858
"additionalProperties": false,
5959
"properties": {
6060
"transak": { "$ref": "#/$defs/provider" },
61-
"okcoin": { "$ref": "#/$defs/provider" }
61+
"okcoin": { "$ref": "#/$defs/provider" },
62+
"moonpay": { "$ref": "#/$defs/provider" }
6263
}
6364
},
6465
"feeEstimations": {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { MOONPAY_API_KEY_PRODUCTION } from '@shared/constants';
2+
3+
export function makeMoonPayUrl(address: string) {
4+
return `https://buy.moonpay.com?apiKey=${MOONPAY_API_KEY_PRODUCTION}&currencyCode=stx&walletAddress=${address}`;
5+
}

src/app/pages/buy/components/onramp-provider-layout.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ const providersInfo = {
1919
cta: 'Buy on Okcoin',
2020
test_id: 'BtnOkCoin',
2121
},
22+
moonpay: {
23+
title: 'MoonPay',
24+
body: 'US and Non-US residents can purchase STX with credit card, debit card, bank transfer, Apple pay or Google pay via MoonPay.',
25+
cta: 'Buy on MoonPay',
26+
test_id: 'BtnMoonPay',
27+
},
2228
};
2329

2430
export interface ProvidersUrl {

src/app/pages/buy/components/onramp-provider.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { makeMoonPayUrl } from '@app/features/fiat-onramp-providers/moonpay-helper';
12
import { makeOkcoinUrl } from '@app/features/fiat-onramp-providers/okcoin-helper';
23
import { makeTransakUrl } from '@app/features/fiat-onramp-providers/transak-helper';
34
import {
@@ -18,6 +19,7 @@ export const OnrampProviders = (props: OnrampProvidersProps) => {
1819
const providersUrl = {
1920
transak: makeTransakUrl(address),
2021
okcoin: makeOkcoinUrl(address),
22+
moonpay: makeMoonPayUrl(address),
2123
};
2224

2325
return (

src/app/pages/home/components/onboarding-steps-list.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const onboardingSteps = [
5858
title: OnboardingSteps.ExploreApps,
5959
},
6060
{
61-
action: 'Buy an NFT',
61+
action: 'Find NFT',
6262
body: 'Collect and trade NFTs secured by Bitcoin',
6363
event: 'buy_nft',
6464
imageFull: BuyNftFull,

src/shared/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,5 @@ export const DEFAULT_LIST_LIMIT = 50;
6565

6666
export const TRANSAK_API_KEY_PRODUCTION = '7300ebf7-c657-46b1-9c72-c0d91bbed0a8';
6767
export const TRANSAK_API_KEY_STAGING = '4055d318-9d41-4b74-9253-e73e3ca13602';
68+
69+
export const MOONPAY_API_KEY_PRODUCTION = 'pk_live_Bctok4Wp6KZHX0YfS4Ie7dFOYnNw8lqv';

tests/page-objects/buy-tokens-selectors.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export enum BuyTokensSelectors {
22
BtnBuyTokens = 'btn-buy-tokens',
33
BtnTransak = 'btn-transak',
44
BtnOkCoin = 'btn-okcoin',
5+
BtnMoonPay = 'btn-moonpay',
56
}

0 commit comments

Comments
 (0)