Skip to content

Commit

Permalink
add some instructions for using tx requests
Browse files Browse the repository at this point in the history
  • Loading branch information
jordaaash committed Apr 29, 2022
1 parent f4a0a38 commit 0075fbc
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions point-of-sale/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ open "https://localhost:3001?recipient=Your+Merchant+Address&label=Your+Store+Na
You may need to accept a locally signed SSL certificate to open the page.

## Accepting USDC on Mainnet
Import the Mainnet endpoint, along with USDC's mint address and icon in the `client/components/pages/App.tsx` file.
```jsx
Import the Mainnet endpoint, along with USDC's mint address and icon in the [`client/components/pages/App.tsx`](https://github.com/solana-labs/solana-pay/blob/master/point-of-sale/src/client/components/pages/App.tsx) file.
```tsx
import { MAINNET_ENDPOINT, MAINNET_USDC_MINT } from '../../utils/constants';
import { USDCIcon } from '../images/USDCIcon';
```
Expand All @@ -94,7 +94,7 @@ minDecimals={2}

When you're done, it should look like this:

```jsx
```tsx
<ConnectionProvider endpoint={MAINNET_ENDPOINT}>
<WalletProvider wallets={wallets} autoConnect={connectWallet}>
<WalletModalProvider>
Expand All @@ -117,7 +117,23 @@ When you're done, it should look like this:

[Transaction Requests](../SPEC.md#specification-transaction-request) are a new feature in Solana Pay.

**More details coming soon!** <!-- TODO -->
In the [`client/components/pages/App.tsx`](https://github.com/solana-labs/solana-pay/blob/master/point-of-sale/src/client/components/pages/App.tsx) file, toggle these lines:

```tsx
// Toggle comments on these lines to use transaction requests instead of transfer requests.
const link = undefined;
// const link = useMemo(() => new URL(`${baseURL}/api/`), [baseURL]);
```

When you're done, it should look like this:

```tsx
// Toggle comments on these lines to use transaction requests instead of transfer requests.
// const link = undefined;
const link = useMemo(() => new URL(`${baseURL}/api/`), [baseURL]);
```

The generated QR codes in the app should now use transaction requests. To see what's going on and customize it, check out the [`server/api/index.ts`](https://github.com/solana-labs/solana-pay/blob/master/point-of-sale/src/server/api/index.ts) file.

## Deploying to Vercel

Expand Down

0 comments on commit 0075fbc

Please sign in to comment.