Skip to content

Commit

Permalink
mobile deposit: add ramp network (#488)
Browse files Browse the repository at this point in the history
  • Loading branch information
nalinbhardwaj authored Feb 16, 2024
1 parent 40f4044 commit 28625af
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Binary file added apps/daimo-web/public/assets/icon-ramp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions packages/daimo-api/src/api/getAccountHistory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@ function getSuggestedActions(eAcc: EAccount, hist: AccountHistoryResult) {
return ret;
}

function getRampNetworkURL(account: EAccount) {
const hostApikey = "kkkkdu9jsw3dbc3qnf8o2bvmzoxkp63mrz27hrma";
const hostAppName = "Daimo";
const hostLogoUrl = "https://daimo.com/assets/icon-ramp.png";
const swapAsset = "BASE_USDC";
return `https://app.ramp.network?hostApiKey=${hostApikey}&hostAppName=${hostAppName}&hostLogoUrl=${hostLogoUrl}&swapAsset=${swapAsset}&userAddress=${account.addr}`;
}

function fetchRecommendedExchanges(account: EAccount): RecommendedExchange[] {
const cbUrl = generateOnRampURL({
appId: "2be3ccd9-6ee4-4dba-aba8-d4b458fe476d",
Expand All @@ -190,5 +198,6 @@ function fetchRecommendedExchanges(account: EAccount): RecommendedExchange[] {
url: `https://daimo.com/bridge/${account.name}`,
},
{ cta: "Deposit from Coinbase", url: cbUrl },
{ cta: "Deposit from Ramp", url: getRampNetworkURL(account) },
];
}

0 comments on commit 28625af

Please sign in to comment.