UNPKG

@daimo/pay

Version:

Seamless crypto payments. Onboard users from any chain, any coin into your app with one click.

191 lines (188 loc) 6.31 kB
import { jsx } from 'react/jsx-runtime'; import Logos from '../assets/logos.js'; let daimoPayHost = "https://pay.daimo.com"; function setInWalletPaymentUrlFromApiUrl(apiUrl) { if (apiUrl.startsWith("http://localhost")) { daimoPayHost = "http://localhost:3001"; } else if (apiUrl.startsWith("https://pay-api-stage.daimo.xyz")) { daimoPayHost = "https://pay.stage.daimo.xyz"; } else { daimoPayHost = "https://pay.daimo.com"; } } function getDaimoPayUrl(payId) { return daimoPayHost + "/pay?id=" + payId; } const walletConfigs = { baseAccount: { id: "baseAccount", name: "Base App", shortName: "Base", icon: /* @__PURE__ */ jsx(Logos.Base, {}), iconConnector: /* @__PURE__ */ jsx(Logos.Base, {}), iconShape: "squircle", showInMobileConnectors: false, deeplinkScheme: "cbwallet://", showOnAndroid: true, showOnIOS: true, getDaimoPayDeeplink: (payId) => { return "https://go.cb-w.com/dapp?cb_url=" + encodeURIComponent(getDaimoPayUrl(payId)); } }, bitget: { id: "bitget", name: "Bitget", icon: /* @__PURE__ */ jsx(Logos.Bitget, {}), iconConnector: /* @__PURE__ */ jsx(Logos.Bitget, {}), iconShape: "squircle", showInMobileConnectors: true, showOnAndroid: true, showOnIOS: true, deeplinkScheme: "bitkeep://", getDaimoPayDeeplink: (payId) => { return "https://bkcode.vip?action=dapp&url=" + getDaimoPayUrl(payId); } }, "metaMask, metaMask-io, io.metamask, io.metamask.mobile, metaMaskSDK": { id: "metaMask", name: "MetaMask", shortName: "MetaMask", icon: /* @__PURE__ */ jsx(Logos.MetaMask, {}), iconConnector: /* @__PURE__ */ jsx(Logos.MetaMask, {}), iconShouldShrink: true, showOnAndroid: true, showOnIOS: true, showInMobileConnectors: false, deeplinkScheme: "metamask://", getDaimoPayDeeplink: (payId) => { const daimoPayUrl = getDaimoPayUrl(payId); return "https://link.metamask.io/dapp/" + daimoPayUrl.replace("https://", ""); } }, "app.phantom": { id: "app.phantom", name: "Phantom", icon: /* @__PURE__ */ jsx(Logos.Phantom, {}), iconConnector: /* @__PURE__ */ jsx(Logos.Phantom, {}), iconShape: "squircle", showInMobileConnectors: true, deeplinkScheme: "phantom://", showOnAndroid: true, showOnIOS: true, getDaimoPayDeeplink: (payId) => { const url = encodeURIComponent(getDaimoPayUrl(payId)); const ref = encodeURIComponent(window.location.origin); return `https://phantom.app/ul/browse/${url}?ref=${ref}`; } }, minipay: { id: "minipay", name: "MiniPay", shortName: "MiniPay", icon: /* @__PURE__ */ jsx(Logos.MiniPay, {}), iconConnector: /* @__PURE__ */ jsx(Logos.MiniPay, {}), iconShape: "squircle", showInMobileConnectors: true, showOnAndroid: true, showOnIOS: true, getDaimoPayDeeplink: (payId) => { return "https://cash.minipay.xyz/browse?url=" + encodeURIComponent(getDaimoPayUrl(payId)); } }, "me.rainbow": { id: "me.rainbow", name: "Rainbow Wallet", shortName: "Rainbow", icon: /* @__PURE__ */ jsx(Logos.Rainbow, {}), iconConnector: /* @__PURE__ */ jsx(Logos.Rainbow, {}), iconShape: "squircle", showInMobileConnectors: true, deeplinkScheme: "rainbow://", showOnAndroid: true, showOnIOS: true, getDaimoPayDeeplink: (payId) => { return "https://rnbwapp.com/dapp?url=" + getDaimoPayUrl(payId); } }, // "io.rabby": { // name: "Rabby Wallet", // shortName: "Rabby", // showInMobileConnectors: false, // //TODO: add wallet deep link // // edit rabby scheme to deeplink URL: https://github.com/RabbyHub/rabby-mobile/blob/999d60f49c5254e4aa8e6aa8bb80ad46e267845c/apps/mobile/src/LinkingConfig.ts#L25 // }, "com.trustwallet.app": { id: "com.trustwallet.app", name: "Trust Wallet", shortName: "Trust", icon: /* @__PURE__ */ jsx(Logos.Trust, {}), iconConnector: /* @__PURE__ */ jsx(Logos.Trust, {}), showInMobileConnectors: false, deeplinkScheme: "trust://", showOnAndroid: true, showOnIOS: true, getDaimoPayDeeplink: (payId) => { return "https://link.trustwallet.com/open_url?coin_id=60&url=" + getDaimoPayUrl(payId); } }, okx: { id: "okx", name: "OKX", icon: /* @__PURE__ */ jsx(Logos.OKX, {}), iconConnector: /* @__PURE__ */ jsx(Logos.OKX, {}), showInMobileConnectors: true, deeplinkScheme: "okx://", showOnAndroid: true, showOnIOS: true, getDaimoPayDeeplink: (payId) => { return "https://web3.okx.com/download?deeplink=" + encodeURIComponent( "okx://wallet/dapp/url?dappUrl=" + getDaimoPayUrl(payId) ); } }, // ledger: { // name: "Ledger Live", // shortName: "Ledger", // icon: <Logos.Ledger />, // showInMobileConnectors: true, // deeplinkScheme: "ledgerlive://", // // getDaimoPayDeeplink: (payId: string) => { // // return "ledgerlive://discover/" + daimoPayUrl + payId; // // }, // // TODO: Add Daimo Pay to Ledger Live's Discover section https://developers.ledger.com/docs/ledger-live/discover/getting-started // shouldDeeplinkDesktop: true, // }, world: { id: "world", name: "World", shortName: "World", icon: /* @__PURE__ */ jsx(Logos.World, {}), iconConnector: /* @__PURE__ */ jsx(Logos.World, {}), showInMobileConnectors: true, iconShape: "squircle", deeplinkScheme: "world", showOnAndroid: true, showOnIOS: true, getDaimoPayDeeplink: (payId) => { const path = "/pay?id=" + payId; const url = "https://worldcoin.org/mini-app?app_id=app_e7d27c5ce2234e00558776f227f791ef&path=" + encodeURIComponent(path); return url; } }, zerion: { id: "zerion", name: "Zerion", icon: /* @__PURE__ */ jsx(Logos.Zerion, {}), iconConnector: /* @__PURE__ */ jsx(Logos.Zerion, {}), showInMobileConnectors: true, deeplinkScheme: "zerion://", showOnAndroid: true, showOnIOS: true, getDaimoPayDeeplink: (payId) => { const payUrl = getDaimoPayUrl(payId); return "https://link.zerion.io/?url=" + encodeURIComponent(payUrl); } } }; export { setInWalletPaymentUrlFromApiUrl, walletConfigs }; //# sourceMappingURL=walletConfigs.js.map