-
Notifications
You must be signed in to change notification settings - Fork 139
docs: split Pay with Exchange & Self-custodial wallets into separate pages #754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
devin-ai-integration
wants to merge
3
commits into
main
Choose a base branch
from
devin/1772108019-split-pay-with-exchange-pages
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
4e096fc
docs: split Pay with Exchange & Self-custodial wallets into separate …
devin-ai-integration[bot] 0ce093b
docs: remove early access warnings from both payment pages
devin-ai-integration[bot] 6ad6ba4
docs: address review feedback - fix links, remove exchange content fr…
devin-ai-integration[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
145 changes: 145 additions & 0 deletions
145
appkit/javascript/payments/pay-with-self-custodial-wallets.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,145 @@ | ||
| --- | ||
| title: AppKit Pay with Self-Custodial Wallets - JavaScript | ||
| sidebarTitle: Pay with Self-Custodial Wallets | ||
| --- | ||
|
|
||
| **AppKit Pay with Self-Custodial Wallets** enables end users to make crypto payments directly from non-custodial wallets. This includes mobile wallets connected via WalletConnect as well as many browser wallets, giving users full control of their assets throughout the payment process. | ||
|
|
||
| ## Quick Start | ||
| Here you can find a simplify process to integrate AppKit Pay with Javascript SDK: | ||
|
|
||
| <Warning> | ||
| Projects first need to install and set up Reown AppKit before integrating AppKit Pay. If you haven't done so, please refer to the [Reown AppKit docs](/appkit/overview#quickstart). | ||
| </Warning> | ||
|
|
||
| ### Install the library | ||
|
|
||
| <Note> | ||
| Projects currently using Reown AppKit to enable self-custodial wallet payments in their own checkout flows are encouraged to switch to AppKit Pay for a simpler integration and significantly improved user experience. AppKit Pay can be found in `@reown/appkit-pay` npm package. | ||
| </Note> | ||
|
|
||
| <CodeGroup> | ||
|
|
||
| ```bash npm | ||
| npm install @reown/appkit-pay | ||
| ``` | ||
|
|
||
| ```bash Yarn | ||
| yarn add @reown/appkit-pay | ||
| ``` | ||
|
|
||
| ```bash Bun | ||
| bun a @reown/appkit-pay | ||
| ``` | ||
|
|
||
| ```bash pnpm | ||
| pnpm add @reown/appkit-pay | ||
| ``` | ||
| </CodeGroup> | ||
|
|
||
| ### `pay` - Full Payment Flow | ||
|
|
||
| #### Usage | ||
| ```ts | ||
| import { pay, baseSepoliaETH } from '@reown/appkit-pay' | ||
| ``` | ||
|
|
||
| This function handles the complete payment flow — it opens the payment UI *and* waits for the result (success, failure, cancel, timeout). This function receives three values: `recipient`, `amount`, and `paymentAsset`. | ||
|
|
||
| ```ts | ||
| // pay function returns a PaymentResult object | ||
| const result = await pay({ | ||
| recipient: addressRecipient, | ||
| amount: amount, | ||
| paymentAsset: baseSepoliaETH | ||
| }); | ||
|
|
||
| if (result.success) { | ||
| console.log("Payment successful: " + result.result); | ||
| } else { | ||
| console.error("Payment error: " + result.error); | ||
| } | ||
| ``` | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| ### Enable Payments Feature in Dashboard | ||
|
|
||
| The "Payments" feature **must be enabled** in the [Reown Dashboard](https://dashboard.reown.com) before you can use AppKit Pay, even for local testing. | ||
|
|
||
| 1. Go to your project in the Reown Dashboard | ||
| 2. Navigate to the Payments section | ||
| 3. Enable the Payments feature for your projectId | ||
|
|
||
|
|
||
| ## Test locally | ||
|
|
||
| In order to test locally use localhost and port 3000. This is the only port available for local testing. | ||
|
|
||
| Add the following to your package.json file in order to run the development server on port 3000: | ||
| ```json | ||
| "scripts": { | ||
| "dev": "vite --port 3000", | ||
| }, | ||
| ``` | ||
|
|
||
| ## Supported Networks and Assets | ||
|
|
||
| For a complete list of supported networks and assets across different exchanges (Coinbase, Binance), please refer to the [Networks and Assets Supported](/appkit/payments/pay-with-exchange#networks-and-assets-supported) section in our Pay with Exchange documentation. | ||
|
|
||
| ## Assets Configuration | ||
|
|
||
| For the moment, AppKit Pay has pre-configured these assets: | ||
| - baseETH, baseSepoliaETH, and baseUSDC | ||
| - ethereumUSDC, optimismUSDC, arbitrumUSDC, polygonUSDC and solanaUSDC | ||
| - ethereumUSDT, optimismUSDT, arbitrumUSDT, polygonUSDT and solanaUSDT | ||
|
|
||
| ```ts | ||
| import { baseETH } from '@reown/appkit-pay' | ||
| ``` | ||
|
|
||
| For custom assets, you can create a paymentAsset object with all the information: | ||
|
|
||
| ```ts | ||
| // Configure the paymentAsset | ||
| const paymentAssetDetails = { | ||
| network: 'eip155:8453', // Base Mainnet | ||
| asset: 'native', // Or USDC in Base: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913' | ||
| metadata: { | ||
| name: 'Ethereum', // Or 'USD Coin' | ||
| symbol: 'ETH', // Or 'USDC' | ||
| decimals: 18 // Or 6 for USDC | ||
| } | ||
| }; | ||
| ``` | ||
|
|
||
| ## Functions | ||
|
|
||
| ### pay | ||
| Opens the payment modal. Resolves when the modal is closed by the user or programmatically. | ||
|
|
||
| `pay(amount, addressRecipient, options: PaymentOptions): Promise<PaymentResult>` | ||
|
|
||
| ### getExchanges | ||
| Fetches available exchanges. | ||
|
|
||
| `getExchanges(page?: number): Promise<{ exchanges: Exchange[], total: number }>` | ||
|
|
||
| ### getPayResult | ||
| Use with caution regarding timing; subscriptions are preferred. | ||
|
|
||
| `getPayResult(): PayResult | null` | ||
|
|
||
| Returns the result of the last successful payment. | ||
|
|
||
| ### getPayError | ||
| Use with caution regarding timing; subscriptions are preferred. | ||
|
|
||
| `getPayError(): AppKitPayErrorMessage | null` | ||
|
|
||
| Returns the error object if the last payment failed. | ||
|
|
||
| ### getIsPaymentInProgress | ||
| Checks if a payment is currently processing. | ||
|
|
||
| `getIsPaymentInProgress(): boolean` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| title: AppKit Pay with Self-Custodial Wallets - Next.js | ||
| sidebarTitle: Pay with Self-Custodial Wallets | ||
| --- | ||
|
|
||
| import AppKitPay from "/snippets/appkit/shared/appkit-pay-react.mdx"; | ||
|
|
||
| <AppKitPay /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤖 Auto Review Issue: Exchange-specific content on JavaScript self-custodial wallets page
Severity: HIGH
Category: code_quality
Tool: Claude Auto Review
Context:
getExchangesfunction (line 123-126) — both are exchange-only conceptsgetExchangesis relevant to their use caseRecommendation: - Line 88: Replace with a general "Supported Networks and Assets" statement not tied to exchange networks
getExchangesfrom the functions list on the self-custodial page; it is exchange-only