How to Buy NFTs Without a Wallet or Crypto
In this guide, I'm going to show you how to buy an NFT with a credit card and email. No crypto required. No wallet required.
In case you missed it, Paper just announced the launch of Embedded Wallet Service. This means that anyone with an email can now use your web3 game, app, or marketplace. It works like any account system except it's on the blockchain!
It’s no longer necessary to onboard your users to crypto wallets and cryptocurrency just so they can use your game, app, or marketplace.
In this guide, I'm going to show you how to set up Paper's Embedded Wallet Service so that you can buy an NFT with a credit card and email. No crypto required. No wallet required.
Here’s what some folks on twitter are saying:
Setting up Embedded Wallet Service
To get started, head to withpaper.com and click “Dashboard”.
After signing in, click on “Auth Settings” under Wallet. You'll need to specify an app name and a domain. Specifying a domain ensures that you aren't putting your credentials at risk if someone were you steal your API key / client ID.
From here, you can call LoginWithPaperModal()
to create a crypto wallet using your email and/or social login like Google.
import { PaperEmbeddedWalletSdk } from "@paperxyz/embedded-wallet-service-sdk";
const sdk = new PaperEmbeddedWalletSdk({
clientId: "MY_CLIENT_ID",
chain: "Mumbai",
});
// Call when the user clicks your "Connect with Paper" button.
<button onClick={() => sdk.auth.loginWithPaperModal()}>
Connect with Paper
</button>
Your modal will look like the image below! You can customize your app name and logo in your Paper Developer Dashboard.
Setting up NFT payments with credit card
At this point, just by typing in your email or clicking the "Continue with Google" button, you've created a crypto wallet! It was that easy.
In this next step, we're going to read the wallet address that was created and create an NFT checkout to purchase an NFT with a credit card.
If the user is logged in, we can get their wallet address using the code snippet below:
import { UserStatus } from "@paperxyz/embedded-wallet-service-sdk";
const result = await sdk.getUser();
switch (result.status) {
case UserStatus.LOGGED_OUT: {
// User is logged out.
// Call `sdk.auth.loginWithPaperModal()` to log the user in.
break;
}
case UserStatus.LOGGED_IN_WALLET_INITIALIZED: {
// User is logged in.
const { authDetails, walletAddress, wallet } = result.user;
break;
}
}
With the wallet address, you can create custom NFT checkouts that allow your buyers to purchase NFT with a credit card. You can render the checkout by embedding it using a button like the code sample blow. Get checkoutLinkUrl
by calling this API endpoint.
import { renderPaperCheckoutLink } from "@paperxyz/js-client-sdk"
const openCheckout = () => renderPaperCheckoutLink({
checkoutLinkUrl: "https://withpaper.com/checkout-link-intent/eyJh...",
});
<button onClick={openCheckout}>Buy with Paper</button>
And now you can officially buy NFTs without having a crypto wallet or cryptocurrency - all you need is an email and a credit card!
If this was helpful, let me know in the discord!
Or if you'd like to explore more ways to create crypto wallets using just an email, see our docs here :)