Skip to content

Commit

Permalink
Add Venmo GUI Plugin for buy and sell
Browse files Browse the repository at this point in the history
  • Loading branch information
samholmes committed Dec 2, 2024
1 parent 877093c commit 5a0576f
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

- added: Support for LLD & LLM transaction history
- added: Close button (X) for `EdgeModals,` specifically if a desktop platform is detected.
- added: Venmo GUI plugin via Moonpay.
- changed: Auto-enable required tokens when navigating to `Stake*` scenes
- fixed: Incorrect `SwapInput` amounts on `SwapCreateScene` after changing wallet.
- fixed: Backing up a light account while on the `FiatPluginEnterAmountScene` retains light account-related quote errors
Expand Down
28 changes: 28 additions & 0 deletions src/__tests__/__snapshots__/GuiPlugins.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,20 @@ Settlement: 5 min - 24 hours",
"pluginId": "paypal",
"title": "Paypal",
},
{
"cryptoCodes": [],
"deepPath": "",
"deepQuery": {},
"description": "Fee: ~5%
Settlement: 5 min - 24 hours",
"paymentType": "venmo",
"paymentTypeLogoKey": "venmo",
"paymentTypes": [
"venmo",
],
"pluginId": "venmo",
"title": "Venmo",
},
{
"cryptoCodes": [],
"customTitleKey": "applepay",
Expand Down Expand Up @@ -317,6 +331,20 @@ Settlement: 5 min - 24 hours",
"pluginId": "paypal",
"title": "Paypal",
},
{
"cryptoCodes": [],
"deepPath": "",
"deepQuery": {},
"description": "Fee: ~5%
Settlement: 5 min - 24 hours",
"paymentType": "venmo",
"paymentTypeLogoKey": "venmo",
"paymentTypes": [
"venmo",
],
"pluginId": "venmo",
"title": "Venmo",
},
{
"cryptoCodes": [],
"deepPath": "",
Expand Down
1 change: 1 addition & 0 deletions src/components/scenes/GuiPluginListScene.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const paymentTypeLogosById = {
revolut: 'paymentTypeLogoRevolut',
sofort: 'paymentTypeLogoSofort',
upi: 'paymentTypeLogoUpi',
venmo: 'paymentTypeVenmo',
visa: 'paymentTypeVisa'
}
const pluginPartnerLogos: { [key: string]: 'guiPluginLogoMoonpay' } = {
Expand Down
8 changes: 8 additions & 0 deletions src/constants/plugins/GuiPlugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,14 @@ export const guiPlugins: { [pluginId: string]: GuiPlugin } = {
lockUriPath: true,
displayName: 'Bitrefill'
},
venmo: {
pluginId: 'amountquote',
storeId: '',
baseUri: '',
lockUriPath: true,
nativePlugin: amountQuoteFiatPlugin,
displayName: ''
},
wire: {
pluginId: 'amountquote',
storeId: '',
Expand Down
15 changes: 15 additions & 0 deletions src/constants/plugins/buyPluginList.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,17 @@
"cryptoCodes": [],
"paymentTypeLogoKey": "bank"
},
{
"id": "venmo",
"pluginId": "venmo",
"paymentType": "venmo",
"paymentTypes": ["venmo"],
"title": "Venmo",
"description": "Fee: ~5%\nSettlement: 5 min - 24 hours",
"forCountries": ["US"],
"cryptoCodes": [],
"paymentTypeLogoKey": "venmo"
},
{
"id": "wire",
"pluginId": "wire",
Expand Down Expand Up @@ -307,6 +318,10 @@
"id": "libertyx",
"sortIndex": 50
},
{
"id": "venmo",
"sortIndex": 15
},
{
"id": "wire",
"sortIndex": 40
Expand Down
15 changes: 15 additions & 0 deletions src/constants/plugins/sellPluginList.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,17 @@
"type": "sell"
}
},
{
"id": "venmo",
"pluginId": "venmo",
"paymentType": "venmo",
"paymentTypes": ["venmo"],
"title": "Venmo",
"description": "Fee: ~5%\nSettlement: 5 min - 24 hours",
"forCountries": ["US"],
"cryptoCodes": [],
"paymentTypeLogoKey": "venmo"
},
{
"id": "xanpool",
"pluginId": "xanpool",
Expand Down Expand Up @@ -320,6 +331,10 @@
"id": "bitrefill",
"sortIndex": 70
},
{
"id": "venmo",
"sortIndex": 15
},
"----- iOS specifics -----",
"----- Country Specifics -----"
]
1 change: 1 addition & 0 deletions src/plugins/gui/fiatPluginTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const asFiatPaymentType = asValue(
'sepa',
'spei',
'turkishbank',
'venmo',
'wire'
)
export type FiatPaymentType = ReturnType<typeof asFiatPaymentType>
Expand Down
17 changes: 12 additions & 5 deletions src/plugins/gui/providers/moonpayProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,15 @@ const pluginDisplayName = 'Moonpay'
const supportEmail = '[email protected]'

const allowedCurrencyCodes: Record<FiatDirection, { [F in FiatPaymentType]?: FiatProviderAssetMap }> = {
buy: { credit: { providerId, fiat: {}, crypto: {} }, paypal: { providerId, fiat: {}, crypto: {} } },
buy: {
credit: { providerId, fiat: {}, crypto: {} },
paypal: { providerId, fiat: {}, crypto: {} },
venmo: { providerId, fiat: {}, crypto: {} }
},
sell: {
credit: { providerId, fiat: {}, crypto: {}, requiredAmountType: 'crypto' },
paypal: { providerId, fiat: {}, crypto: {}, requiredAmountType: 'crypto' }
paypal: { providerId, fiat: {}, crypto: {}, requiredAmountType: 'crypto' },
venmo: { providerId, fiat: {}, crypto: {}, requiredAmountType: 'crypto' }
}
}
const allowedCountryCodes: Record<FiatDirection, FiatProviderExactRegions> = { buy: {}, sell: {} }
Expand Down Expand Up @@ -108,7 +113,7 @@ const asApiKeys = asString

const asMoonpayCountries = asArray(asMoonpayCountry)

type MoonpayPaymentMethod = 'ach_bank_transfer' | 'credit_debit_card' | 'paypal'
type MoonpayPaymentMethod = 'ach_bank_transfer' | 'credit_debit_card' | 'paypal' | 'venmo'

interface MoonpayWidgetQueryParams {
apiKey: string
Expand Down Expand Up @@ -154,7 +159,8 @@ const MOONPAY_PAYMENT_TYPE_MAP: Partial<Record<FiatPaymentType, MoonpayPaymentMe
credit: 'credit_debit_card',
googlepay: 'credit_debit_card',
iach: 'ach_bank_transfer',
paypal: 'paypal'
paypal: 'paypal',
venmo: 'venmo'
}

const NETWORK_CODE_PLUGINID_MAP: StringMap = {
Expand Down Expand Up @@ -184,7 +190,8 @@ const PAYMENT_TYPE_MAP: Partial<Record<FiatPaymentType, FiatPaymentType | undefi
applepay: 'credit',
credit: 'credit',
googlepay: 'credit',
paypal: 'paypal'
paypal: 'paypal',
venmo: 'venmo'
}

let lastChecked = 0
Expand Down

0 comments on commit 5a0576f

Please sign in to comment.