@walletconnect/pay 0.0.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +95 -0
- package/README.md +281 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.umd.js +17 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/client.d.ts +15 -0
- package/dist/types/client.d.ts.map +1 -0
- package/dist/types/constants/client.d.ts +6 -0
- package/dist/types/constants/client.d.ts.map +1 -0
- package/dist/types/constants/index.d.ts +2 -0
- package/dist/types/constants/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/providers/index.d.ts +6 -0
- package/dist/types/providers/index.d.ts.map +1 -0
- package/dist/types/providers/native.d.ts +20 -0
- package/dist/types/providers/native.d.ts.map +1 -0
- package/dist/types/types/api.d.ts +84 -0
- package/dist/types/types/api.d.ts.map +1 -0
- package/dist/types/types/client.d.ts +16 -0
- package/dist/types/types/client.d.ts.map +1 -0
- package/dist/types/types/errors.d.ts +20 -0
- package/dist/types/types/errors.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +5 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/provider.d.ts +18 -0
- package/dist/types/types/provider.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/platform.d.ts +2 -0
- package/dist/types/utils/platform.d.ts.map +1 -0
- package/package.json +59 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
**WALLETCONNECT COMMUNITY LICENSE AGREEMENT**
|
|
2
|
+
|
|
3
|
+
**Release Date: 20 August 2025**
|
|
4
|
+
|
|
5
|
+
You, or the company or organization of which you are an employee, agent, or contractor (“**You**”, “**Your**”), desire a license from Reown, Inc. (“**We**”, “**Us**”, “**Our**”) to use the WalletKit software development kit, documentation and related materials (collectively, “**WalletKit Items**”). Before You access the WalletKit Items, We need to establish what you can expect from Us, and what We expect from You. By accessing and using the WalletKit Items, You confirm that You reviewed and You agree to this License Agreement (“**License**”), and that You are authorized to bind the company or organization you represent to this License. **_By downloading, installing, integrating and/or using the_** \*WalletKit **Items, you or the organization you represent, as applicable, agree to be bound by and become a party to this License as a "Licensee". If you do not agree to all of the terms of this License, you are not a Licensee and you may not download, install, or use (or must cease using) the WalletKit Items.\***
|
|
6
|
+
|
|
7
|
+
**1\. LICENSE**
|
|
8
|
+
|
|
9
|
+
**a. Grant of Rights.** Subject to the terms and conditions of this License We grant You (and not Your affiliates or related persons), and You accept, a perpetual (subject to Section 8(b) Termination), non-exclusive, non-transferable (subject to Section 11(c) Assignment), non-sublicensable, and worldwide license under Our intellectual property rights to use, display, copy, transmit, distribute, modify, adapt, and create derivative works of the WalletKit Items.
|
|
10
|
+
|
|
11
|
+
**b. Educational, Research and New Application Uses.** If You are using the WalletKit Items for educational or non-commercial research purposes, the License We grant You is royalty-free. In addition, Your use of WalletKit Items for development, maintenance and enhancement of Your applications and wallets is royalty-free, subject to Section 3\.
|
|
12
|
+
|
|
13
|
+
**c. Modification of WalletKit Items.** We own all right, title and interest to the intellectual property rights (including, but not limited to patent, copyright, and trademark rights) to any modification to or derivative work of the WalletKit Items that You may develop, and you hereby assign any and all such rights to such modifications and derivative works to Us, subject to the following:
|
|
14
|
+
|
|
15
|
+
(i) We hereby grant back to You a perpetual, non-exclusive, non-transferable, royalty-free, worldwide right and license to use these modifications and derivative works solely in conjunction with the WalletKit Items and only while this License remains in effect. You must cause any modified files to carry prominent notices stating that You changed the files. We and our assignees and Our and their licensees may use such modifications and derivative works without any approval from You and without compensation or attribution to You. You also agree to provide the source and binary code of any such modifications and derivative works to Us at the email address We may designate from time to time.
|
|
16
|
+
|
|
17
|
+
(ii) For the avoidance of doubt, Your applications and wallets that you develop using the WalletKit Items are not modifications or derivative works of the WalletKit Items. You retain all rights to your applications and wallets, and you have no obligation to share or license Your applications or wallets with Us or with any third parties; provided, however, We retain all rights to the WalletKit Items and any modifications or derivative works thereof that may be incorporated into your applications and wallets.
|
|
18
|
+
|
|
19
|
+
**2\. REDISTRIBUTION AND USE**
|
|
20
|
+
|
|
21
|
+
**a. Distribution Requirements.** If You distribute or make available the WalletKit Items (including any modifications to or derivative works thereof) or any product or service that uses them (including Your applications and wallets), You must (i) include the following copyright notice in the notices or readme.txt of the product, or the about section of the website for the services: “Portions © 2025 Reown, Inc. All Rights Reserved” ; (ii) provide a copy of this License Agreement with any applications or wallets containing such WalletKit Items or that are required for the use thereof; and (iii) applicable logo and branding.
|
|
22
|
+
|
|
23
|
+
**b. Network Connection.** As a material condition of this License, all use, distribution or derivatives works of the WalletKit Items must connect to the proprietary Reown gateway infrastructure, or its successor, and its related WalletConnect messaging protocol (collectively, the “**Network**”) unless we explicitly approve you doing otherwise. You further agree not to circumvent this requirement, or instruct or suggest to Your end users to do so.
|
|
24
|
+
|
|
25
|
+
**c. Compliance with Law.** We are not in a position to monitor and assess the legality and regulatory treatment of your business and operations. Your use of the WalletKit Items must comply with all applicable laws and regulations and Our Terms of Service and Acceptable Use Policy, as amended from time to time, the terms of which are incorporated herein by reference.
|
|
26
|
+
|
|
27
|
+
**d. Use of Marks.** This License does not grant permission to use Our trade names, trademarks, service marks, or product names (collectively, the “**Marks**”), except as permitted by Our Marks usage guidelines or as required for disclosure of the development of Your applications or wallets, reproducing the attribution notice in the readme.txt file, or Your redistribution of WalletKit Items. We reserve all rights not expressly granted to you under this License. Unless explicitly approved by Us, in no event will You use Our name, trademarks, or logos to endorse or imply Our endorsement of products derived from WalletKit Items or any products or services that use WalletKit Items. Where You are permitted to use the Marks, You must comply with Our then-current trademark and logo usage guidelines, as may be updated from time to time without notice from Us. All goodwill arising out of Your use of any Mark will inure solely to Us.
|
|
28
|
+
|
|
29
|
+
**e. Export Controls.** You and We acknowledge that the WalletKit Items and all related technical information, documents and materials are subject to export controls under the U.S. Export Administration Regulations. You and We will (i) comply strictly with all legal requirements established under these controls, (ii) cooperate fully with each other in any official or unofficial audit or inspection that relates to these controls and (iii) not export, re-export, divert or transfer, directly or indirectly, any such item or direct products thereof to Cuba, Iran, North Korea, Sudan, and the Crimea, Donetsk, Luhansk, Kherson and Zaporizhzhia region not controlled by the government of Ukraine, or any national thereof or to any country or national thereof that is embargoed by Executive order, unless such party has obtained the prior written authorization of the other party and U.S. Commerce Department. We may modify this list to conform to changes in the U.S. Export Administration Regulations.
|
|
30
|
+
|
|
31
|
+
**3\. LIMITED COMMERCIAL USE**
|
|
32
|
+
|
|
33
|
+
If the number of remote processing calls (RPCs) made by, or monthly active users of (MAUs), associated with Your application or wallet developed using WalletKit Items, or your product or service that uses WalletKit Items exceed the thresholds set forth below, determined in our sole discretion, You must enter into and pay applicable fees and charges for a commercial license. You may contact Reown for these purposes using [this form](https://share.hsforms.com/1_oWa8QkwRXi6oR0nZ_SIxQnxw6s).
|
|
34
|
+
|
|
35
|
+
- Monthly RPC limit of 2,500,000
|
|
36
|
+
|
|
37
|
+
- Monthly MAU limit of 500
|
|
38
|
+
|
|
39
|
+
MAU means, as applicable: (1) a unique externally owned account that authenticates and connects to your app in a 30 day period; or (2) a unique embedded wallet that is created on, and authenticates and connects, to your app in a 30 day period
|
|
40
|
+
|
|
41
|
+
We reserve the right to change the RPC and/or MAU limit thresholds and/or set different or additional triggers or thresholds for requiring a commercial license. The current thresholds or triggers for a commercial license may be published on Our [Terms of Service](https://reown.com/terms-of-service).
|
|
42
|
+
|
|
43
|
+
**4\. DISCLAIMER OF WARRANTY**
|
|
44
|
+
|
|
45
|
+
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THE WALLETKIT ITEMS ARE PROVIDED “AS IS” WITHOUT WARRANTIES OF ANY KIND. ALL WARRANTIES, CONDITIONS, REPRESENTATIONS, INDEMNITIES AND GUARANTEES WITH RESPECT TO THE WALLETKIT ITEMS, WHETHER EXPRESS OR IMPLIED, ARISING BY LAW, CUSTOM, PRIOR ORAL OR WRITTEN STATEMENTS BY US OR OTHERWISE (INCLUDING, BUT NOT LIMITED TO ANY WARRANTY OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR PARTICULAR PURPOSE AND NON-INFRINGEMENT) ARE HEREBY OVERRIDDEN, EXCLUDED AND DISCLAIMED. SOME JURISDICTIONS DO NOT PERMIT THE DISCLAIMER OF ALL WARRANTIES SO YOU MAY HAVE ADDITIONAL RIGHTS PROVIDED BY LAW.
|
|
46
|
+
|
|
47
|
+
**5\. LIMITATION OF LIABILITY**
|
|
48
|
+
|
|
49
|
+
IN NO EVENT AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, UNLESS REQUIRED BY APPLICABLE LAW DESPITE THIS LIMITATION OR AGREED TO IN WRITING BY US, WILL WE BE LIABLE TO YOU OR YOUR LICENSEES OR SUBLICENSEES FOR ANY DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING AS A RESULT OF THIS LICENSE OR OUT OF THE USE OR INABILITY TO USE THE WALLETKIT ITEMS OR ANY PORTION THEREOF (INCLUDING BUT NOT LIMITED TO DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES), EVEN IF WE OR OUR AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME JURISDICTIONS DO NOT PERMIT THE EXCLUSION OF ALL DAMAGES SO YOU MAY HAVE ADDITIONAL RIGHTS PROVIDED BY LAW.
|
|
50
|
+
|
|
51
|
+
**6\. INTELLECTUAL PROPERTY**
|
|
52
|
+
|
|
53
|
+
All trademarks, service marks, patents, copyrights, trade secrets, or other proprietary rights in or related to the WalletKit Items are and will remain Our exclusive property (or that of Our licensors). You will not take any action that jeopardizes those rights, nor will you acquire any right in the WalletKit Items, except the limited use rights specified in this License. You acknowledge that We (or Our licensors) will own all rights in any copy, translation, modification, adaptation or derivative works of the WalletKit Items (whether or not authorized by Us), and You will provide any instrument We reasonably request that you obtain to give full legal effect to Our rights under this Section.
|
|
54
|
+
|
|
55
|
+
**7\. CONFIDENTIALITY**
|
|
56
|
+
|
|
57
|
+
You acknowledge that the WalletKit Items incorporate nonpublic confidential and proprietary information We have developed or acquired or licensed ("**Confidential Information**"). You will keep the Confidential Information in the strictest confidence and will not use or copy any Confidential Information, or disclose it to any other person. You will not permit removal or defacing of any confidentiality or proprietary notice placed on or in the WalletKit Items, and any copyright notices on or in these items does not constitute publication or make them non-confidential.
|
|
58
|
+
|
|
59
|
+
**8\. TERM AND TERMINATION**
|
|
60
|
+
|
|
61
|
+
**a. Term.** The term of this Agreement will commence upon Your accessing the WalletKit Items and will continue in full force and effect until terminated in accordance with the terms and conditions of this License. As this License is updated for future releases of the WalletKit Items, You must abide by and meet all requirements of future updates of this License for those future releases of WalletKit Items, and such future updates of this License will apply to such future applications and wallets that may be developed with that future release of WalletKit Items or any portion thereof. You may not use older versions of the SDK to circumvent the terms applicable to new versions you choose to download or use.
|
|
62
|
+
|
|
63
|
+
**b. Termination.** This License terminates (i) 30 days after either We notify you in writing that You have breached a material term of this License, if that breach is not cured before then, or (ii) immediately and automatically if You are declared bankrupt or become insolvent. Your right to access the Network ceases, if this License terminates, and We may disable Your access to the Network upon such termination. You may terminate this License at any time by disintegrating WalletKit Items from your products and services and disabling access to the Network. If this License terminates, You must immediately cease all use of and delete the WalletKit Items, in whole or in part, as well as any Confidential Information, in Your possession or control. At Our request, You will certify Your compliance with these obligations in writing. Sections 2, 4 through 7, 8(b), and 9 through 11 will survive any termination of this Agreement.
|
|
64
|
+
|
|
65
|
+
**9\. GOVERNING LAW**
|
|
66
|
+
|
|
67
|
+
This Agreement will be governed and construed under the laws of the State of Delaware, U.S.A., without regard to choice of law principles, and the UN Convention on Contracts for the International Sale of Goods does not apply to this Agreement.
|
|
68
|
+
|
|
69
|
+
**10\. DISPUTE RESOLUTION**
|
|
70
|
+
|
|
71
|
+
PLEASE READ THE FOLLOWING SECTION CAREFULLY BECAUSE IT REQUIRES YOU TO SUBMIT TO BINDING ARBITRATION (JURY TRIAL WAIVER) OF ANY AND ALL DISPUTES (OTHER THAN SPECIFIED SMALL CLAIMS) WITH REOWN, INC. AND LIMITS THE MANNER IN WHICH YOU CAN SEEK RELIEF FROM REOWN, INC. (NO CLASS ARBITRATIONS, CLASS ACTIONS OR REPRESENTATIVE ACTIONS OR ARBITRATIONS).
|
|
72
|
+
|
|
73
|
+
**a. Binding Arbitration; Disputes; Small Claims.** **You and We waive any right to a jury trial, or the right to have any Dispute resolved in any court, and instead accept the use of binding arbitration (which is the referral of a Dispute to one or more impartial persons for a final and binding determination); provided, however, that you have the right to litigate any Dispute in small claims court, if all the requirements of the small claims court, including any limitations on jurisdiction and the amount at issue in the Dispute, are satisfied. You agree to bring a Dispute in small claims court in the State of Delaware**. “**Dispute**” **as used in this Section 10 means any dispute, cause of action, claim, or controversy arising out of or in any way related to Us, this License, the subject matter of this License, or access to and use of the WalletKit Items, in whole or in part, or the Network, including but not limited to personal injury disputes and disputes that involve third parties (such as developers of applications or wallets).**
|
|
74
|
+
|
|
75
|
+
**b. No Class Arbitrations, Class Actions or Representative Actions.** **You and We agree that any Dispute is personal to You and Us, and that any Dispute must only be resolved by an individual arbitration and may not be brought as a class arbitration, a class action, or any other representative proceeding. Neither party agrees to class arbitration, or an arbitration where a person brings a Dispute as a representative of any other person or persons. Neither You nor We agree that a Dispute can be brought as a class or representative action whether inside or outside of arbitration, or on behalf of any other person or persons**.
|
|
76
|
+
|
|
77
|
+
**c. Federal Arbitration Act.** You and We agree that the terms of this License affect interstate commerce and that the enforceability of Section 10 is governed by, construed, and enforced, both substantively and procedurally, by the Federal Arbitration Act, 9 U.S.C. § 1 et seq. (“**FAA**”) to the maximum extent permitted by applicable law.
|
|
78
|
+
|
|
79
|
+
**d. Confidentiality.** The arbitrator, You and We must maintain the confidentiality of any proceedings, including but not limited to, any and all information gathered, prepared, and presented for purposes of the arbitration or related to the Dispute(s) therein. The arbitrator has the authority to make appropriate rulings to safeguard that confidentiality, unless the law provides to the contrary.
|
|
80
|
+
|
|
81
|
+
**e. Process.** Our goal is to resolve claims fairly and quickly. Accordingly, for any Dispute that you have against Us, you must first contact Us and attempt to resolve the claim informally by sending a written notice of your claim (“**Notice**”) to Us. The Notice to Us must be sent by certified mail addressed to: Reown Inc., 200 Continental Drive, 401, Newark, DE 19713 USA and a copy must be sent on the same day via email to Legal@walletconnect.com. The Notice must (a) include Your name, residence address, projectID and the email address and/or mobile telephone number associated with your account; (b) describe the nature and basis of the claim; and (c) set forth the specific relief sought. If You and We cannot reach an agreement to resolve the claim within 30 days after such Notice is received, then either party may, as appropriate in accordance with this Section 10, commence an arbitration proceeding or file a claim in small claims court.
|
|
82
|
+
|
|
83
|
+
**f. Binding Arbitration.** In the event that You and We cannot resolve a Dispute and do not pursue the matter through small claims court, You or We must promptly submit the Dispute to binding arbitration before the American Arbitration Association (“**AAA**”). In the event AAA declines or is unable to administer the arbitration, You and We agree to use an arbitration forum or arbitrator that You and We mutually agree upon. If, after making a reasonable effort, You and We are not able to agree upon an arbitration forum or arbitrator, AAA or a court having proper jurisdiction will appoint an arbitration forum or arbitrator. The arbitration will be conducted in accordance with the AAA Consumer Arbitration Rules (“**AAA Rules**”) then in effect. The AAA Rules and other information about AAA and arbitration are readily available at [http://www.adr.org](http://www.adr.org/), by calling 1-800-778-7879, or by mail at 120 Broadway, Floor 21, New York, NY 10271\. By entering into this License, you either (1) acknowledge that you have read and understand the AAA Rules or (2) waive reading the AAA Rules and waive any claim that the AAA Rules are unfair in any way. You and We agree that the terms of this License govern the arbitration, and that the applicable AAA Rules are subject to changes in procedures that AAA may make from time to time.
|
|
84
|
+
|
|
85
|
+
**g. Arbitrator Empowered.** As limited by the FAA, the terms of this License, and the applicable AAA Rules, the arbitrator will have the exclusive power and jurisdiction to make all procedural and substantive decisions concerning the Dispute; provided, however, that this power does not include: (i) the power to determine the question of arbitrability, which power You and We agree is vested solely in a court of competent jurisdiction; or (ii) the power to conduct a class arbitration or a representative action, which is prohibited by the terms of this License (as stated above). The arbitrator may only conduct an individual arbitration, and may not consolidate more than one person’s claims and may not preside over any form of representative or class proceeding, or any proceeding on behalf of or involving more than one person or persons.
|
|
86
|
+
|
|
87
|
+
**11\. MISCELLANEOUS**
|
|
88
|
+
|
|
89
|
+
**a. Amendment.** This License may be amended by Us on a prospective basis, and your usage of the License after such amendments or changes signifies your consent to and acceptance of any such amendments or changes on a going forward basis.
|
|
90
|
+
|
|
91
|
+
**b. Severability.** In the event any provision of this License is determined to be invalid, prohibited or unenforceable by a court or other body of competent jurisdiction, this License must be construed as if such invalid, prohibited or unenforceable provision has been more narrowly drawn so as not to be invalid, prohibited or unenforceable.
|
|
92
|
+
|
|
93
|
+
**c. Assignment.** You may not assign any rights or obligations under this License, including by operation of law, without Our prior written consent, which may be withheld in its sole discretion. We may assign Our rights or obligations under this License in Our sole discretion.
|
|
94
|
+
|
|
95
|
+
**d. Waiver.** Failure of either party at any time to enforce any of the provisions of this License will not be construed as a waiver of such provisions or in any way affect the validity of this License or parts thereof.
|
package/README.md
ADDED
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
# WalletConnect Pay SDK
|
|
2
|
+
|
|
3
|
+
TypeScript SDK for WalletConnect Pay - a payment solution for React Native and web applications.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @walletconnect/pay
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
### React Native Setup
|
|
12
|
+
|
|
13
|
+
This SDK requires the WalletConnect React Native native module. Make sure you have `@walletconnect/react-native-compat` installed and linked in your React Native project.
|
|
14
|
+
|
|
15
|
+
### Web Setup (Coming Soon)
|
|
16
|
+
|
|
17
|
+
WASM provider support for web browsers is coming in a future release.
|
|
18
|
+
|
|
19
|
+
## Architecture
|
|
20
|
+
|
|
21
|
+
The SDK uses a provider abstraction that allows different implementations:
|
|
22
|
+
|
|
23
|
+
- **NativeProvider**: Uses React Native uniffi module (current)
|
|
24
|
+
- **WasmProvider**: Uses WebAssembly module (coming soon)
|
|
25
|
+
|
|
26
|
+
The SDK auto-detects the best available provider for your environment.
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
### Initialize the Client
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import { PayClient } from "@walletconnect/pay";
|
|
34
|
+
|
|
35
|
+
const client = new PayClient({
|
|
36
|
+
projectId: "your-project-id",
|
|
37
|
+
apiKey: "your-api-key",
|
|
38
|
+
metadata: {
|
|
39
|
+
name: "Your App Name",
|
|
40
|
+
bundleId: "com.your.app",
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Get Payment Options
|
|
46
|
+
|
|
47
|
+
Retrieve available payment options for a payment link:
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
const options = await client.getPaymentOptions({
|
|
51
|
+
paymentLink: "https://pay.walletconnect.com/pay_123",
|
|
52
|
+
accounts: ["eip155:8453:0xYourAddress"], // CAIP-10 accounts
|
|
53
|
+
includePaymentInfo: true,
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
console.log("Payment ID:", options.paymentId);
|
|
57
|
+
console.log("Options:", options.options);
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Get Required Actions
|
|
61
|
+
|
|
62
|
+
Get the wallet RPC actions required to complete a payment option:
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
const actions = await client.getRequiredPaymentActions({
|
|
66
|
+
paymentId: options.paymentId,
|
|
67
|
+
optionId: options.options[0].id,
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// Each action contains wallet RPC data to sign
|
|
71
|
+
for (const action of actions) {
|
|
72
|
+
console.log("Chain:", action.walletRpc.chainId);
|
|
73
|
+
console.log("Method:", action.walletRpc.method);
|
|
74
|
+
console.log("Params:", action.walletRpc.params);
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Sign and Confirm Payment
|
|
79
|
+
|
|
80
|
+
Sign the actions with your wallet and confirm the payment:
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
// Sign each action with your wallet (implementation depends on your wallet SDK)
|
|
84
|
+
const signatures = await Promise.all(
|
|
85
|
+
actions.map((action) =>
|
|
86
|
+
wallet.signTypedData(action.walletRpc.chainId, JSON.parse(action.walletRpc.params)),
|
|
87
|
+
),
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
// Confirm the payment
|
|
91
|
+
const result = await client.confirmPayment({
|
|
92
|
+
paymentId: options.paymentId,
|
|
93
|
+
optionId: options.options[0].id,
|
|
94
|
+
signatures,
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
if (result.status === "succeeded") {
|
|
98
|
+
console.log("Payment successful!");
|
|
99
|
+
} else if (result.status === "processing") {
|
|
100
|
+
console.log("Payment is processing...");
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Collected Data
|
|
105
|
+
|
|
106
|
+
Some payments may require additional user data:
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
const options = await client.getPaymentOptions({
|
|
110
|
+
paymentLink,
|
|
111
|
+
accounts,
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
if (options.collectData) {
|
|
115
|
+
// Show UI to collect required fields
|
|
116
|
+
const collectedData = options.collectData.fields.map((field) => ({
|
|
117
|
+
id: field.id,
|
|
118
|
+
value: getUserInput(field.name, field.fieldType),
|
|
119
|
+
}));
|
|
120
|
+
|
|
121
|
+
// Include collected data when confirming
|
|
122
|
+
const result = await client.confirmPayment({
|
|
123
|
+
paymentId: options.paymentId,
|
|
124
|
+
optionId: selectedOptionId,
|
|
125
|
+
signatures,
|
|
126
|
+
collectedData,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## API Reference
|
|
132
|
+
|
|
133
|
+
### PayClient
|
|
134
|
+
|
|
135
|
+
#### Constructor
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
new PayClient(options: PayClientOptions)
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
| Option | Type | Required | Description |
|
|
142
|
+
| --------- | ----------- | -------- | ------------------------------- |
|
|
143
|
+
| projectId | string | Yes | WalletConnect Project ID |
|
|
144
|
+
| apiKey | string | Yes | Pay API key |
|
|
145
|
+
| metadata | AppMetadata | Yes | Application metadata |
|
|
146
|
+
| baseUrl | string | No | Custom API base URL |
|
|
147
|
+
| logger | Logger | No | Custom logger instance or level |
|
|
148
|
+
|
|
149
|
+
#### Methods
|
|
150
|
+
|
|
151
|
+
##### `getPaymentOptions(params)`
|
|
152
|
+
|
|
153
|
+
Get available payment options for a payment link.
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
interface GetPaymentOptionsParams {
|
|
157
|
+
paymentLink: string; // Payment link or ID
|
|
158
|
+
accounts: string[]; // CAIP-10 accounts
|
|
159
|
+
includePaymentInfo?: boolean; // Include payment info in response
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
##### `getRequiredPaymentActions(params)`
|
|
164
|
+
|
|
165
|
+
Get the wallet RPC actions required to complete a payment.
|
|
166
|
+
|
|
167
|
+
```typescript
|
|
168
|
+
interface GetRequiredPaymentActionsParams {
|
|
169
|
+
paymentId: string; // Payment ID
|
|
170
|
+
optionId: string; // Selected option ID
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
##### `confirmPayment(params)`
|
|
175
|
+
|
|
176
|
+
Submit signatures and confirm the payment.
|
|
177
|
+
|
|
178
|
+
```typescript
|
|
179
|
+
interface ConfirmPaymentParams {
|
|
180
|
+
paymentId: string; // Payment ID
|
|
181
|
+
optionId: string; // Selected option ID
|
|
182
|
+
signatures: string[]; // Wallet RPC signatures
|
|
183
|
+
collectedData?: CollectDataFieldResult[]; // Collected data fields
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
##### `static isAvailable()`
|
|
188
|
+
|
|
189
|
+
Check if a provider is available on the current platform.
|
|
190
|
+
|
|
191
|
+
### Provider Utilities
|
|
192
|
+
|
|
193
|
+
```typescript
|
|
194
|
+
import {
|
|
195
|
+
isProviderAvailable,
|
|
196
|
+
detectProviderType,
|
|
197
|
+
isNativeProviderAvailable,
|
|
198
|
+
setNativeModule,
|
|
199
|
+
} from "@walletconnect/pay";
|
|
200
|
+
|
|
201
|
+
// Check if any provider is available
|
|
202
|
+
if (isProviderAvailable()) {
|
|
203
|
+
// SDK can be used
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Detect which provider type is available
|
|
207
|
+
const providerType = detectProviderType(); // 'native' | 'wasm' | null
|
|
208
|
+
|
|
209
|
+
// Check specifically for native provider
|
|
210
|
+
if (isNativeProviderAvailable()) {
|
|
211
|
+
// React Native native module is available
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// Manually inject native module (if auto-discovery fails)
|
|
215
|
+
import { NativeModules } from "react-native";
|
|
216
|
+
setNativeModule(NativeModules.RNWalletConnectPay);
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
## Types
|
|
220
|
+
|
|
221
|
+
### PaymentStatus
|
|
222
|
+
|
|
223
|
+
```typescript
|
|
224
|
+
type PaymentStatus = "requires_action" | "processing" | "succeeded" | "failed" | "expired";
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### PaymentOption
|
|
228
|
+
|
|
229
|
+
```typescript
|
|
230
|
+
interface PaymentOption {
|
|
231
|
+
id: string;
|
|
232
|
+
amount: PayAmount;
|
|
233
|
+
etaS: number;
|
|
234
|
+
actions: Action[];
|
|
235
|
+
}
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Action
|
|
239
|
+
|
|
240
|
+
```typescript
|
|
241
|
+
interface Action {
|
|
242
|
+
walletRpc: WalletRpcAction;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
interface WalletRpcAction {
|
|
246
|
+
chainId: string;
|
|
247
|
+
method: string;
|
|
248
|
+
params: string; // JSON string
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### PayProviderType
|
|
253
|
+
|
|
254
|
+
```typescript
|
|
255
|
+
type PayProviderType = "native" | "wasm";
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## Error Handling
|
|
259
|
+
|
|
260
|
+
The SDK throws typed errors for different failure scenarios:
|
|
261
|
+
|
|
262
|
+
```typescript
|
|
263
|
+
import { PayError, PaymentOptionsError, ConfirmPaymentError } from "@walletconnect/pay";
|
|
264
|
+
|
|
265
|
+
try {
|
|
266
|
+
const options = await client.getPaymentOptions({
|
|
267
|
+
paymentLink: link,
|
|
268
|
+
accounts,
|
|
269
|
+
});
|
|
270
|
+
} catch (error) {
|
|
271
|
+
if (error instanceof PaymentOptionsError) {
|
|
272
|
+
console.error("Failed to get options:", error.originalMessage);
|
|
273
|
+
} else if (error instanceof PayError) {
|
|
274
|
+
console.error("Pay error:", error.code, error.message);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
## License
|
|
280
|
+
|
|
281
|
+
Apache-2.0
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var c=require("@walletconnect/logger"),u=require("@walletconnect/utils");const v="https://api.pay.walletconnect.com",P="@walletconnect/pay",f="js-0.0.0-canary.0",R="pay",i="WalletConnectPay";function T(){return u.isIos()?"rn-ios":u.isAndroid()?"rn-android":u.isBrowser()?"browser":u.isNode()?"node":"unknown"}var M=Object.defineProperty,C=(r,e,t)=>e in r?M(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,N=(r,e,t)=>C(r,typeof e!="symbol"?e+"":e,t);class o extends Error{constructor(e,t,n){super(t),N(this,"code"),N(this,"originalMessage"),this.name="PayError",this.code=e,this.originalMessage=n??t,Object.setPrototypeOf(this,o.prototype)}static fromNativeError(e){if(e instanceof o)return e;const t=e instanceof Error?e.message:String(e);return t.includes("JSON parse error")?new o("JSON_PARSE",t):t.includes("JSON serialize error")?new o("JSON_SERIALIZE",t):t.includes("Payment options error")?new o("PAYMENT_OPTIONS",t):t.includes("Payment request error")?new o("PAYMENT_REQUEST",t):t.includes("Confirm payment error")?new o("CONFIRM_PAYMENT",t):new o("UNKNOWN",t)}}class y extends o{constructor(){super("NATIVE_MODULE_NOT_FOUND","WalletConnect Pay native module not found. Make sure @walletconnect/react-native-compat is installed and linked."),this.name="NativeModuleNotFoundError",Object.setPrototypeOf(this,y.prototype)}}class p extends o{constructor(e){super("PAYMENT_OPTIONS",`Failed to get payment options: ${e}`,e),this.name="PaymentOptionsError",Object.setPrototypeOf(this,p.prototype)}}class m extends o{constructor(e){super("PAYMENT_REQUEST",`Failed to get payment actions: ${e}`,e),this.name="PaymentActionsError",Object.setPrototypeOf(this,m.prototype)}}class g extends o{constructor(e){super("CONFIRM_PAYMENT",`Failed to confirm payment: ${e}`,e),this.name="ConfirmPaymentError",Object.setPrototypeOf(this,g.prototype)}}var $=Object.defineProperty,_=(r,e,t)=>e in r?$(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,j=(r,e,t)=>_(r,typeof e!="symbol"?e+"":e,t);let a,d=null;function O(){var r,e;if(d)return d;if(a!==void 0)return a;try{const t=globalThis.ReactNative;if((r=t?.NativeModules)!=null&&r.RNWalletConnectPay)return a=t.NativeModules.RNWalletConnectPay,a;const n=(e=globalThis.expo)==null?void 0:e.modules;return n!=null&&n.RNWalletConnectPay?(a=n.RNWalletConnectPay,a):(a=null,null)}catch{return a=null,null}}function L(r){d=r,a=r}function I(){return O()!==null}function k(){d=null,a=void 0}class w{constructor(e){j(this,"module");const t=O();if(!t)throw new y;if(t.initialize)try{const n=JSON.stringify(e);t.initialize(n)}catch(n){throw new o("INITIALIZATION_ERROR",`Failed to initialize native Pay module: ${n instanceof Error?n.message:String(n)}`)}this.module=t}async getPaymentOptions(e){var t;const n={paymentLink:e.paymentLink,accounts:e.accounts,includePaymentInfo:(t=e.includePaymentInfo)!=null?t:!1};try{const l=await this.module.getPaymentOptions(JSON.stringify(n));return JSON.parse(l)}catch(l){throw o.fromNativeError(l)}}async getRequiredPaymentActions(e){const t={paymentId:e.paymentId,optionId:e.optionId};try{const n=await this.module.getRequiredPaymentActions(JSON.stringify(t));return JSON.parse(n)}catch(n){throw o.fromNativeError(n)}}async confirmPayment(e){const t={paymentId:e.paymentId,optionId:e.optionId,signatures:e.signatures,collectedData:e.collectedData};try{const n=await this.module.confirmPayment(JSON.stringify(t));return JSON.parse(n)}catch(n){throw o.fromNativeError(n)}}}function b(r){return new w(r)}function h(){return I()?"native":null}function E(r){const e=h();if(!e)throw new Error("No Pay provider available. Make sure you are running in React Native with the native module installed, or in a browser with WASM support.");switch(e){case"native":return b(r);case"wasm":throw new Error("WASM provider not yet implemented");default:throw new Error(`Unknown provider type: ${e}`)}}function A(){return h()!==null}var U=Object.defineProperty,D=(r,e,t)=>e in r?U(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,s=(r,e,t)=>D(r,typeof e!="symbol"?e+"":e,t);class S{constructor(e){s(this,"projectId"),s(this,"apiKey"),s(this,"metadata"),s(this,"baseUrl"),s(this,"logger"),s(this,"provider");var t,n;this.projectId=e.projectId,this.apiKey=e.apiKey,this.metadata=e.metadata,this.baseUrl=(t=e.baseUrl)!=null?t:v,this.logger=typeof e.logger=="string"?c.pino(c.getDefaultLoggerOptions({level:e.logger})):(n=e.logger)!=null?n:c.pino(c.getDefaultLoggerOptions({level:"error"})),this.logger.trace(`${i} initialized`);const l={baseUrl:this.baseUrl,projectId:this.projectId,apiKey:this.apiKey,sdkName:P,sdkVersion:f,sdkPlatform:T(),bundleId:this.metadata.bundleId};this.provider=E(l),this.logger.debug(`${i} provider initialized`)}static isAvailable(){return A()}async getPaymentOptions(e){this.logger.debug({paymentLink:e.paymentLink,accounts:e.accounts,includePaymentInfo:e.includePaymentInfo},`${i} getPaymentOptions`);try{const t=await this.provider.getPaymentOptions(e);return this.logger.debug({paymentId:t.paymentId,optionsCount:t.options.length},`${i} getPaymentOptions response`),t}catch(t){throw this.logger.error({error:t},`${i} getPaymentOptions error`),t instanceof o?t:new p(String(t))}}async getRequiredPaymentActions(e){this.logger.debug({paymentId:e.paymentId,optionId:e.optionId},`${i} getRequiredPaymentActions`);try{const t=await this.provider.getRequiredPaymentActions(e);return this.logger.debug({actionsCount:t.length},`${i} getRequiredPaymentActions response`),t}catch(t){throw this.logger.error({error:t},`${i} getRequiredPaymentActions error`),t instanceof o?t:new m(String(t))}}async confirmPayment(e){this.logger.debug({paymentId:e.paymentId,optionId:e.optionId,signaturesCount:e.signatures.length,hasCollectedData:!!e.collectedData},`${i} confirmPayment`);try{const t=await this.provider.confirmPayment(e);return this.logger.debug({status:t.status,isFinal:t.isFinal},`${i} confirmPayment response`),t}catch(t){throw this.logger.error({error:t},`${i} confirmPayment error`),t instanceof o?t:new g(String(t))}}}const F=S;exports.CLIENT_CONTEXT=R,exports.ConfirmPaymentError=g,exports.LOGGER_CONTEXT=i,exports.NativeModuleNotFoundError=y,exports.NativeProvider=w,exports.PAY_API_BASE_URL=v,exports.PayClient=F,exports.PayError=o,exports.PaymentActionsError=m,exports.PaymentOptionsError=p,exports.SDK_NAME=P,exports.SDK_VERSION=f,exports.createNativeProvider=b,exports.createProvider=E,exports.default=S,exports.detectProviderType=h,exports.isNativeProviderAvailable=I,exports.isProviderAvailable=A,exports.resetNativeModule=k,exports.setNativeModule=L;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/constants/client.ts","../src/utils/platform.ts","../src/types/errors.ts","../src/providers/native.ts","../src/providers/index.ts","../src/client.ts","../src/index.ts"],"sourcesContent":["/**\n * Client constants for WalletConnect Pay SDK\n */\n\n/** Default Pay API base URL */\nexport const PAY_API_BASE_URL = \"https://api.pay.walletconnect.com\";\n\n/** SDK name for tracking */\nexport const SDK_NAME = \"@walletconnect/pay\";\n\n/** SDK version (from package.json) */\nexport const SDK_VERSION = `js-0.0.0-canary.0`;\n\n/** Client context name */\nexport const CLIENT_CONTEXT = \"pay\";\n\n/** Logger context */\nexport const LOGGER_CONTEXT = \"WalletConnectPay\";\n","/**\n * Platform detection utilities for WalletConnect Pay SDK\n */\n\nimport { isIos, isAndroid, isBrowser, isNode } from \"@walletconnect/utils\";\n\n/**\n * Get the SDK platform based on the current environment\n * @returns Platform string: rn-ios, rn-android, browser, node, or unknown\n */\nexport function getSdkPlatform(): string {\n if (isIos()) return \"rn-ios\";\n if (isAndroid()) return \"rn-android\";\n if (isBrowser()) return \"browser\";\n if (isNode()) return \"node\";\n return \"unknown\";\n}\n","/**\n * Error types for WalletConnect Pay SDK\n */\n\n/**\n * Error codes from the native module\n */\nexport type PayErrorCode =\n | \"JSON_PARSE\"\n | \"JSON_SERIALIZE\"\n | \"PAYMENT_OPTIONS\"\n | \"PAYMENT_REQUEST\"\n | \"CONFIRM_PAYMENT\"\n | \"NATIVE_MODULE_NOT_FOUND\"\n | \"INITIALIZATION_ERROR\"\n | \"UNKNOWN\";\n\n/**\n * Base error class for Pay SDK\n */\nexport class PayError extends Error {\n public readonly code: PayErrorCode;\n public readonly originalMessage: string;\n\n constructor(code: PayErrorCode, message: string, originalMessage?: string) {\n super(message);\n this.name = \"PayError\";\n this.code = code;\n this.originalMessage = originalMessage ?? message;\n Object.setPrototypeOf(this, PayError.prototype);\n }\n\n static fromNativeError(error: unknown): PayError {\n if (error instanceof PayError) {\n return error;\n }\n\n const message = error instanceof Error ? error.message : String(error);\n\n // Try to parse error code from message\n if (message.includes(\"JSON parse error\")) {\n return new PayError(\"JSON_PARSE\", message);\n }\n if (message.includes(\"JSON serialize error\")) {\n return new PayError(\"JSON_SERIALIZE\", message);\n }\n if (message.includes(\"Payment options error\")) {\n return new PayError(\"PAYMENT_OPTIONS\", message);\n }\n if (message.includes(\"Payment request error\")) {\n return new PayError(\"PAYMENT_REQUEST\", message);\n }\n if (message.includes(\"Confirm payment error\")) {\n return new PayError(\"CONFIRM_PAYMENT\", message);\n }\n\n return new PayError(\"UNKNOWN\", message);\n }\n}\n\n/**\n * Error thrown when native module is not available\n */\nexport class NativeModuleNotFoundError extends PayError {\n constructor() {\n super(\n \"NATIVE_MODULE_NOT_FOUND\",\n \"WalletConnect Pay native module not found. Make sure @walletconnect/react-native-compat is installed and linked.\",\n );\n this.name = \"NativeModuleNotFoundError\";\n Object.setPrototypeOf(this, NativeModuleNotFoundError.prototype);\n }\n}\n\n/**\n * Error thrown when payment options request fails\n */\nexport class PaymentOptionsError extends PayError {\n constructor(message: string) {\n super(\"PAYMENT_OPTIONS\", `Failed to get payment options: ${message}`, message);\n this.name = \"PaymentOptionsError\";\n Object.setPrototypeOf(this, PaymentOptionsError.prototype);\n }\n}\n\n/**\n * Error thrown when payment actions request fails\n */\nexport class PaymentActionsError extends PayError {\n constructor(message: string) {\n super(\"PAYMENT_REQUEST\", `Failed to get payment actions: ${message}`, message);\n this.name = \"PaymentActionsError\";\n Object.setPrototypeOf(this, PaymentActionsError.prototype);\n }\n}\n\n/**\n * Error thrown when payment confirmation fails\n */\nexport class ConfirmPaymentError extends PayError {\n constructor(message: string) {\n super(\"CONFIRM_PAYMENT\", `Failed to confirm payment: ${message}`, message);\n this.name = \"ConfirmPaymentError\";\n Object.setPrototypeOf(this, ConfirmPaymentError.prototype);\n }\n}\n","/**\n * Native Provider for WalletConnect Pay SDK\n *\n * Uses the React Native uniffi module for payment operations.\n */\n\nimport type {\n PaymentOptionsResponse,\n ConfirmPaymentResponse,\n Action,\n PayProvider,\n PayProviderConfig,\n GetPaymentOptionsParams,\n GetRequiredPaymentActionsParams,\n ConfirmPaymentParams,\n} from \"../types/index.js\";\nimport { NativeModuleNotFoundError, PayError } from \"../types/index.js\";\n\n/**\n * Native module interface expected from React Native\n */\ninterface NativePayModule {\n getPaymentOptions(requestJson: string): Promise<string>;\n getRequiredPaymentActions(requestJson: string): Promise<string>;\n confirmPayment(requestJson: string): Promise<string>;\n initialize?(configJson: string): void;\n}\n\n// Cached native module reference\nlet cachedNativeModule: NativePayModule | null | undefined;\n\n// Manually injected module reference\nlet injectedModule: NativePayModule | null = null;\n\n/**\n * Try to get the native module from React Native\n */\nfunction getNativeModule(): NativePayModule | null {\n // Return injected module if available\n if (injectedModule) {\n return injectedModule;\n }\n\n // Return cached result if already attempted\n if (cachedNativeModule !== undefined) {\n return cachedNativeModule;\n }\n\n try {\n // Access React Native's NativeModules via globalThis\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const reactNative = (globalThis as any).ReactNative;\n if (reactNative?.NativeModules?.RNWalletConnectPay) {\n cachedNativeModule = reactNative.NativeModules.RNWalletConnectPay as NativePayModule;\n return cachedNativeModule;\n }\n\n // Fallback: Try accessing via expo modules pattern\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const expoModules = (globalThis as any).expo?.modules;\n if (expoModules?.RNWalletConnectPay) {\n cachedNativeModule = expoModules.RNWalletConnectPay as NativePayModule;\n return cachedNativeModule;\n }\n\n cachedNativeModule = null;\n return null;\n } catch {\n cachedNativeModule = null;\n return null;\n }\n}\n\n/**\n * Set a custom native module instance\n * Use this to manually inject the native module if auto-discovery doesn't work\n */\nexport function setNativeModule(module: NativePayModule): void {\n injectedModule = module;\n cachedNativeModule = module;\n}\n\n/**\n * Check if native provider is available\n */\nexport function isNativeProviderAvailable(): boolean {\n return getNativeModule() !== null;\n}\n\n/**\n * Reset the native module (for testing)\n */\nexport function resetNativeModule(): void {\n injectedModule = null;\n cachedNativeModule = undefined;\n}\n\n/**\n * Native provider implementation using React Native uniffi module\n */\nexport class NativeProvider implements PayProvider {\n private readonly module: NativePayModule;\n\n constructor(config: PayProviderConfig) {\n const module = getNativeModule();\n\n if (!module) {\n throw new NativeModuleNotFoundError();\n }\n\n // Initialize the module with config\n if (module.initialize) {\n try {\n const configJson = JSON.stringify(config);\n module.initialize(configJson);\n } catch (error) {\n throw new PayError(\n \"INITIALIZATION_ERROR\",\n `Failed to initialize native Pay module: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n }\n\n this.module = module;\n }\n\n async getPaymentOptions(params: GetPaymentOptionsParams): Promise<PaymentOptionsResponse> {\n const request = {\n paymentLink: params.paymentLink,\n accounts: params.accounts,\n includePaymentInfo: params.includePaymentInfo ?? false,\n };\n\n try {\n const responseJson = await this.module.getPaymentOptions(JSON.stringify(request));\n return JSON.parse(responseJson) as PaymentOptionsResponse;\n } catch (error) {\n throw PayError.fromNativeError(error);\n }\n }\n\n async getRequiredPaymentActions(params: GetRequiredPaymentActionsParams): Promise<Action[]> {\n const request = {\n paymentId: params.paymentId,\n optionId: params.optionId,\n };\n\n try {\n const responseJson = await this.module.getRequiredPaymentActions(JSON.stringify(request));\n return JSON.parse(responseJson) as Action[];\n } catch (error) {\n throw PayError.fromNativeError(error);\n }\n }\n\n async confirmPayment(params: ConfirmPaymentParams): Promise<ConfirmPaymentResponse> {\n const request = {\n paymentId: params.paymentId,\n optionId: params.optionId,\n signatures: params.signatures,\n collectedData: params.collectedData,\n };\n\n try {\n const responseJson = await this.module.confirmPayment(JSON.stringify(request));\n return JSON.parse(responseJson) as ConfirmPaymentResponse;\n } catch (error) {\n throw PayError.fromNativeError(error);\n }\n }\n}\n\n/**\n * Create a native provider instance\n */\nexport function createNativeProvider(config: PayProviderConfig): PayProvider {\n return new NativeProvider(config);\n}\n","/**\n * Provider exports for WalletConnect Pay SDK\n */\n\nimport type { PayProvider, PayProviderConfig, PayProviderType } from \"../types/index.js\";\nimport { createNativeProvider, isNativeProviderAvailable } from \"./native.js\";\n\nexport * from \"./native.js\";\n\n/**\n * Detect the best available provider type for the current environment\n */\nexport function detectProviderType(): PayProviderType | null {\n // Check for native module (React Native)\n if (isNativeProviderAvailable()) {\n return \"native\";\n }\n\n // Future: Check for WASM support\n // if (isWasmProviderAvailable()) {\n // return \"wasm\";\n // }\n\n return null;\n}\n\n/**\n * Create a provider based on auto-detection\n * @param config - Provider configuration\n */\nexport function createProvider(config: PayProviderConfig): PayProvider {\n const providerType = detectProviderType();\n\n if (!providerType) {\n throw new Error(\n \"No Pay provider available. Make sure you are running in React Native with the native module installed, or in a browser with WASM support.\",\n );\n }\n\n switch (providerType) {\n case \"native\":\n return createNativeProvider(config);\n case \"wasm\":\n // Future: return createWasmProvider(config);\n throw new Error(\"WASM provider not yet implemented\");\n default:\n throw new Error(`Unknown provider type: ${providerType}`);\n }\n}\n\n/**\n * Check if any provider is available\n */\nexport function isProviderAvailable(): boolean {\n return detectProviderType() !== null;\n}\n","/**\n * WalletConnect Pay Client\n *\n * TypeScript wrapper around the Pay provider for payment processing.\n */\n\nimport { getDefaultLoggerOptions, pino } from \"@walletconnect/logger\";\nimport type { Logger } from \"@walletconnect/logger\";\n\nimport { PAY_API_BASE_URL, SDK_NAME, SDK_VERSION, LOGGER_CONTEXT } from \"./constants/index.js\";\nimport { getSdkPlatform } from \"./utils/index.js\";\nimport type {\n PayClientOptions,\n PaymentOptionsResponse,\n ConfirmPaymentResponse,\n Action,\n PayProvider,\n PayProviderConfig,\n GetPaymentOptionsParams,\n GetRequiredPaymentActionsParams,\n ConfirmPaymentParams,\n} from \"./types/index.js\";\nimport {\n PayError,\n PaymentOptionsError,\n PaymentActionsError,\n ConfirmPaymentError,\n} from \"./types/index.js\";\nimport { createProvider, isProviderAvailable } from \"./providers/index.js\";\n\nexport class PayClient {\n public readonly projectId: string;\n public readonly apiKey: string;\n public readonly metadata: PayClientOptions[\"metadata\"];\n public readonly baseUrl: string;\n\n private readonly logger: Logger;\n private readonly provider: PayProvider;\n\n /**\n * Initialize a new Pay client\n * @param opts - Client options\n */\n constructor(opts: PayClientOptions) {\n this.projectId = opts.projectId;\n this.apiKey = opts.apiKey;\n this.metadata = opts.metadata;\n this.baseUrl = opts.baseUrl ?? PAY_API_BASE_URL;\n\n // Initialize logger\n this.logger =\n typeof opts.logger === \"string\"\n ? pino(getDefaultLoggerOptions({ level: opts.logger }))\n : (opts.logger ?? pino(getDefaultLoggerOptions({ level: \"error\" })));\n\n this.logger.trace(`${LOGGER_CONTEXT} initialized`);\n\n // Build provider config\n const providerConfig: PayProviderConfig = {\n baseUrl: this.baseUrl,\n projectId: this.projectId,\n apiKey: this.apiKey,\n sdkName: SDK_NAME,\n sdkVersion: SDK_VERSION,\n sdkPlatform: getSdkPlatform(),\n bundleId: this.metadata.bundleId,\n };\n\n // Create provider (auto-detects available provider)\n this.provider = createProvider(providerConfig);\n this.logger.debug(`${LOGGER_CONTEXT} provider initialized`);\n }\n\n /**\n * Check if the Pay SDK is available on this platform\n */\n static isAvailable(): boolean {\n return isProviderAvailable();\n }\n\n /**\n * Get payment options for a payment link\n *\n * @param params - Payment options parameters\n * @param params.paymentLink - Payment link or payment ID\n * @param params.accounts - List of CAIP-10 account addresses\n * @param params.includePaymentInfo - Whether to include payment info in response\n * @returns Payment options response\n * @throws PaymentOptionsError if the request fails\n */\n async getPaymentOptions(params: GetPaymentOptionsParams): Promise<PaymentOptionsResponse> {\n this.logger.debug(\n {\n paymentLink: params.paymentLink,\n accounts: params.accounts,\n includePaymentInfo: params.includePaymentInfo,\n },\n `${LOGGER_CONTEXT} getPaymentOptions`,\n );\n\n try {\n const response = await this.provider.getPaymentOptions(params);\n\n this.logger.debug(\n { paymentId: response.paymentId, optionsCount: response.options.length },\n `${LOGGER_CONTEXT} getPaymentOptions response`,\n );\n\n return response;\n } catch (error) {\n this.logger.error({ error }, `${LOGGER_CONTEXT} getPaymentOptions error`);\n throw error instanceof PayError ? error : new PaymentOptionsError(String(error));\n }\n }\n\n /**\n * Get required payment actions for a selected option\n *\n * @param params - Required actions parameters\n * @param params.paymentId - Payment ID\n * @param params.optionId - Selected option ID\n * @returns Array of actions to be signed\n * @throws PaymentActionsError if the request fails\n */\n async getRequiredPaymentActions(params: GetRequiredPaymentActionsParams): Promise<Action[]> {\n this.logger.debug(\n { paymentId: params.paymentId, optionId: params.optionId },\n `${LOGGER_CONTEXT} getRequiredPaymentActions`,\n );\n\n try {\n const actions = await this.provider.getRequiredPaymentActions(params);\n\n this.logger.debug(\n { actionsCount: actions.length },\n `${LOGGER_CONTEXT} getRequiredPaymentActions response`,\n );\n\n return actions;\n } catch (error) {\n this.logger.error({ error }, `${LOGGER_CONTEXT} getRequiredPaymentActions error`);\n throw error instanceof PayError ? error : new PaymentActionsError(String(error));\n }\n }\n\n /**\n * Confirm a payment with wallet signatures\n *\n * @param params - Confirm payment parameters\n * @param params.paymentId - Payment ID\n * @param params.optionId - Selected option ID\n * @param params.signatures - Array of signatures from wallet RPC calls\n * @param params.collectedData - Optional collected data fields\n * @returns Confirm payment response with final status\n * @throws ConfirmPaymentError if the request fails\n */\n async confirmPayment(params: ConfirmPaymentParams): Promise<ConfirmPaymentResponse> {\n this.logger.debug(\n {\n paymentId: params.paymentId,\n optionId: params.optionId,\n signaturesCount: params.signatures.length,\n hasCollectedData: !!params.collectedData,\n },\n `${LOGGER_CONTEXT} confirmPayment`,\n );\n\n try {\n const response = await this.provider.confirmPayment(params);\n\n this.logger.debug(\n { status: response.status, isFinal: response.isFinal },\n `${LOGGER_CONTEXT} confirmPayment response`,\n );\n\n return response;\n } catch (error) {\n this.logger.error({ error }, `${LOGGER_CONTEXT} confirmPayment error`);\n throw error instanceof PayError ? error : new ConfirmPaymentError(String(error));\n }\n }\n}\n","import { PayClient as Client } from \"./client.js\";\n\nexport * from \"./constants/index.js\";\nexport * from \"./types/index.js\";\nexport * from \"./providers/index.js\";\n\nexport const PayClient = Client;\nexport default Client;\n"],"names":["isIos","isAndroid","isBrowser","isNode","code","message","originalMessage","__publicField","error","y","cachedNativeModule","injectedModule","getNativeModule","_a","_b","reactNative","expoModules","e","module","config","NativeModuleNotFoundError","configJson","PayError","params","request","responseJson","isNativeProviderAvailable","providerType","createNativeProvider","PayClient","opts","PAY_API_BASE_URL","pino","getDefaultLoggerOptions","LOGGER_CONTEXT","providerConfig","SDK_NAME","SDK_VERSION","getSdkPlatform","createProvider","isProviderAvailable","response","PaymentOptionsError","actions","PaymentActionsError","ConfirmPaymentError","Client"],"mappings":";;;;;;;AAKa,MAAA,gBAAA,CAAmB,oCAGnB,QAAW,CAAA,oBAAA,CAGX,YAAc,mBAGd,CAAA,cAAA,CAAiB,MAGjB,cAAiB,CAAA;;ACPvB,SAAS,cAAyB,EAAA,CACvC,OAAIA,WAAM,EAAA,CAAU,QAChBC,CAAAA,eAAAA,EAAoB,CAAA,YAAA,CACpBC,eAAU,EAAA,CAAU,SACpBC,CAAAA,YAAAA,EAAiB,CAAA,MAAA,CACd,SACT;;4KCIa,MAAA,QAAA,SAAiB,KAAM,CAIlC,WAAA,CAAYC,EAAoBC,CAAiBC,CAAAA,CAAAA,CAA0B,CACzE,KAAMD,CAAAA,CAAO,EAJfE,CAAA,CAAA,IAAA,CAAgB,QAChBA,CAAA,CAAA,IAAA,CAAgB,mBAId,IAAK,CAAA,IAAA,CAAO,UACZ,CAAA,IAAA,CAAK,IAAOH,CAAAA,CAAAA,CACZ,KAAK,eAAkBE,CAAAA,CAAAA,EAAA,KAAAA,CAAmBD,CAAAA,CAAAA,CAC1C,OAAO,cAAe,CAAA,IAAA,CAAM,QAAS,CAAA,SAAS,EAChD,CAEA,OAAO,eAAgBG,CAAAA,CAAAA,CAA0B,CAC/C,GAAIA,CAAAA,YAAiB,SACnB,OAAOA,CAAAA,CAGT,MAAMH,CAAAA,CAAUG,CAAiB,YAAA,KAAA,CAAQA,EAAM,OAAU,CAAA,MAAA,CAAOA,CAAK,CAGrE,CA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,KAAA,CAAAA,CAAM,CAAG,CAAA,CAAA,EAAG0B,cAAc,CAAuB,qBAAA,CAAA,CAAA,CAC/D1B,aAAiBc,QAAWd,CAAAA,CAAAA,CAAQ,IAAIqC,mBAAoB,CAAA,MAAA,CAAOrC,CAAK,CAAC,CACjF,CACF,CACF;;AC/KO,MAAM,SAAYsC,CAAAA;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{pino as g,getDefaultLoggerOptions as h}from"@walletconnect/logger";import{isIos as R,isAndroid as T,isBrowser as M,isNode as $}from"@walletconnect/utils";const f="https://api.pay.walletconnect.com",P="@walletconnect/pay",v="js-0.0.0-canary.0",C="pay",i="WalletConnectPay";function j(){return R()?"rn-ios":T()?"rn-android":M()?"browser":$()?"node":"unknown"}var k=Object.defineProperty,U=(n,e,t)=>e in n?k(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,N=(n,e,t)=>U(n,typeof e!="symbol"?e+"":e,t);class o extends Error{constructor(e,t,r){super(t),N(this,"code"),N(this,"originalMessage"),this.name="PayError",this.code=e,this.originalMessage=r??t,Object.setPrototypeOf(this,o.prototype)}static fromNativeError(e){if(e instanceof o)return e;const t=e instanceof Error?e.message:String(e);return t.includes("JSON parse error")?new o("JSON_PARSE",t):t.includes("JSON serialize error")?new o("JSON_SERIALIZE",t):t.includes("Payment options error")?new o("PAYMENT_OPTIONS",t):t.includes("Payment request error")?new o("PAYMENT_REQUEST",t):t.includes("Confirm payment error")?new o("CONFIRM_PAYMENT",t):new o("UNKNOWN",t)}}class u extends o{constructor(){super("NATIVE_MODULE_NOT_FOUND","WalletConnect Pay native module not found. Make sure @walletconnect/react-native-compat is installed and linked."),this.name="NativeModuleNotFoundError",Object.setPrototypeOf(this,u.prototype)}}class d extends o{constructor(e){super("PAYMENT_OPTIONS",`Failed to get payment options: ${e}`,e),this.name="PaymentOptionsError",Object.setPrototypeOf(this,d.prototype)}}class p extends o{constructor(e){super("PAYMENT_REQUEST",`Failed to get payment actions: ${e}`,e),this.name="PaymentActionsError",Object.setPrototypeOf(this,p.prototype)}}class y extends o{constructor(e){super("CONFIRM_PAYMENT",`Failed to confirm payment: ${e}`,e),this.name="ConfirmPaymentError",Object.setPrototypeOf(this,y.prototype)}}var J=Object.defineProperty,L=(n,e,t)=>e in n?J(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,F=(n,e,t)=>L(n,typeof e!="symbol"?e+"":e,t);let a,c=null;function O(){var n,e;if(c)return c;if(a!==void 0)return a;try{const t=globalThis.ReactNative;if((n=t?.NativeModules)!=null&&n.RNWalletConnectPay)return a=t.NativeModules.RNWalletConnectPay,a;const r=(e=globalThis.expo)==null?void 0:e.modules;return r!=null&&r.RNWalletConnectPay?(a=r.RNWalletConnectPay,a):(a=null,null)}catch{return a=null,null}}function D(n){c=n,a=n}function w(){return O()!==null}function W(){c=null,a=void 0}class I{constructor(e){F(this,"module");const t=O();if(!t)throw new u;if(t.initialize)try{const r=JSON.stringify(e);t.initialize(r)}catch(r){throw new o("INITIALIZATION_ERROR",`Failed to initialize native Pay module: ${r instanceof Error?r.message:String(r)}`)}this.module=t}async getPaymentOptions(e){var t;const r={paymentLink:e.paymentLink,accounts:e.accounts,includePaymentInfo:(t=e.includePaymentInfo)!=null?t:!1};try{const l=await this.module.getPaymentOptions(JSON.stringify(r));return JSON.parse(l)}catch(l){throw o.fromNativeError(l)}}async getRequiredPaymentActions(e){const t={paymentId:e.paymentId,optionId:e.optionId};try{const r=await this.module.getRequiredPaymentActions(JSON.stringify(t));return JSON.parse(r)}catch(r){throw o.fromNativeError(r)}}async confirmPayment(e){const t={paymentId:e.paymentId,optionId:e.optionId,signatures:e.signatures,collectedData:e.collectedData};try{const r=await this.module.confirmPayment(JSON.stringify(t));return JSON.parse(r)}catch(r){throw o.fromNativeError(r)}}}function b(n){return new I(n)}function m(){return w()?"native":null}function E(n){const e=m();if(!e)throw new Error("No Pay provider available. Make sure you are running in React Native with the native module installed, or in a browser with WASM support.");switch(e){case"native":return b(n);case"wasm":throw new Error("WASM provider not yet implemented");default:throw new Error(`Unknown provider type: ${e}`)}}function A(){return m()!==null}var q=Object.defineProperty,K=(n,e,t)=>e in n?q(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,s=(n,e,t)=>K(n,typeof e!="symbol"?e+"":e,t);class S{constructor(e){s(this,"projectId"),s(this,"apiKey"),s(this,"metadata"),s(this,"baseUrl"),s(this,"logger"),s(this,"provider");var t,r;this.projectId=e.projectId,this.apiKey=e.apiKey,this.metadata=e.metadata,this.baseUrl=(t=e.baseUrl)!=null?t:f,this.logger=typeof e.logger=="string"?g(h({level:e.logger})):(r=e.logger)!=null?r:g(h({level:"error"})),this.logger.trace(`${i} initialized`);const l={baseUrl:this.baseUrl,projectId:this.projectId,apiKey:this.apiKey,sdkName:P,sdkVersion:v,sdkPlatform:j(),bundleId:this.metadata.bundleId};this.provider=E(l),this.logger.debug(`${i} provider initialized`)}static isAvailable(){return A()}async getPaymentOptions(e){this.logger.debug({paymentLink:e.paymentLink,accounts:e.accounts,includePaymentInfo:e.includePaymentInfo},`${i} getPaymentOptions`);try{const t=await this.provider.getPaymentOptions(e);return this.logger.debug({paymentId:t.paymentId,optionsCount:t.options.length},`${i} getPaymentOptions response`),t}catch(t){throw this.logger.error({error:t},`${i} getPaymentOptions error`),t instanceof o?t:new d(String(t))}}async getRequiredPaymentActions(e){this.logger.debug({paymentId:e.paymentId,optionId:e.optionId},`${i} getRequiredPaymentActions`);try{const t=await this.provider.getRequiredPaymentActions(e);return this.logger.debug({actionsCount:t.length},`${i} getRequiredPaymentActions response`),t}catch(t){throw this.logger.error({error:t},`${i} getRequiredPaymentActions error`),t instanceof o?t:new p(String(t))}}async confirmPayment(e){this.logger.debug({paymentId:e.paymentId,optionId:e.optionId,signaturesCount:e.signatures.length,hasCollectedData:!!e.collectedData},`${i} confirmPayment`);try{const t=await this.provider.confirmPayment(e);return this.logger.debug({status:t.status,isFinal:t.isFinal},`${i} confirmPayment response`),t}catch(t){throw this.logger.error({error:t},`${i} confirmPayment error`),t instanceof o?t:new y(String(t))}}}const x=S;export{C as CLIENT_CONTEXT,y as ConfirmPaymentError,i as LOGGER_CONTEXT,u as NativeModuleNotFoundError,I as NativeProvider,f as PAY_API_BASE_URL,x as PayClient,o as PayError,p as PaymentActionsError,d as PaymentOptionsError,P as SDK_NAME,v as SDK_VERSION,b as createNativeProvider,E as createProvider,S as default,m as detectProviderType,w as isNativeProviderAvailable,A as isProviderAvailable,W as resetNativeModule,D as setNativeModule};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/constants/client.ts","../src/utils/platform.ts","../src/types/errors.ts","../src/providers/native.ts","../src/providers/index.ts","../src/client.ts","../src/index.ts"],"sourcesContent":["/**\n * Client constants for WalletConnect Pay SDK\n */\n\n/** Default Pay API base URL */\nexport const PAY_API_BASE_URL = \"https://api.pay.walletconnect.com\";\n\n/** SDK name for tracking */\nexport const SDK_NAME = \"@walletconnect/pay\";\n\n/** SDK version (from package.json) */\nexport const SDK_VERSION = `js-0.0.0-canary.0`;\n\n/** Client context name */\nexport const CLIENT_CONTEXT = \"pay\";\n\n/** Logger context */\nexport const LOGGER_CONTEXT = \"WalletConnectPay\";\n","/**\n * Platform detection utilities for WalletConnect Pay SDK\n */\n\nimport { isIos, isAndroid, isBrowser, isNode } from \"@walletconnect/utils\";\n\n/**\n * Get the SDK platform based on the current environment\n * @returns Platform string: rn-ios, rn-android, browser, node, or unknown\n */\nexport function getSdkPlatform(): string {\n if (isIos()) return \"rn-ios\";\n if (isAndroid()) return \"rn-android\";\n if (isBrowser()) return \"browser\";\n if (isNode()) return \"node\";\n return \"unknown\";\n}\n","/**\n * Error types for WalletConnect Pay SDK\n */\n\n/**\n * Error codes from the native module\n */\nexport type PayErrorCode =\n | \"JSON_PARSE\"\n | \"JSON_SERIALIZE\"\n | \"PAYMENT_OPTIONS\"\n | \"PAYMENT_REQUEST\"\n | \"CONFIRM_PAYMENT\"\n | \"NATIVE_MODULE_NOT_FOUND\"\n | \"INITIALIZATION_ERROR\"\n | \"UNKNOWN\";\n\n/**\n * Base error class for Pay SDK\n */\nexport class PayError extends Error {\n public readonly code: PayErrorCode;\n public readonly originalMessage: string;\n\n constructor(code: PayErrorCode, message: string, originalMessage?: string) {\n super(message);\n this.name = \"PayError\";\n this.code = code;\n this.originalMessage = originalMessage ?? message;\n Object.setPrototypeOf(this, PayError.prototype);\n }\n\n static fromNativeError(error: unknown): PayError {\n if (error instanceof PayError) {\n return error;\n }\n\n const message = error instanceof Error ? error.message : String(error);\n\n // Try to parse error code from message\n if (message.includes(\"JSON parse error\")) {\n return new PayError(\"JSON_PARSE\", message);\n }\n if (message.includes(\"JSON serialize error\")) {\n return new PayError(\"JSON_SERIALIZE\", message);\n }\n if (message.includes(\"Payment options error\")) {\n return new PayError(\"PAYMENT_OPTIONS\", message);\n }\n if (message.includes(\"Payment request error\")) {\n return new PayError(\"PAYMENT_REQUEST\", message);\n }\n if (message.includes(\"Confirm payment error\")) {\n return new PayError(\"CONFIRM_PAYMENT\", message);\n }\n\n return new PayError(\"UNKNOWN\", message);\n }\n}\n\n/**\n * Error thrown when native module is not available\n */\nexport class NativeModuleNotFoundError extends PayError {\n constructor() {\n super(\n \"NATIVE_MODULE_NOT_FOUND\",\n \"WalletConnect Pay native module not found. Make sure @walletconnect/react-native-compat is installed and linked.\",\n );\n this.name = \"NativeModuleNotFoundError\";\n Object.setPrototypeOf(this, NativeModuleNotFoundError.prototype);\n }\n}\n\n/**\n * Error thrown when payment options request fails\n */\nexport class PaymentOptionsError extends PayError {\n constructor(message: string) {\n super(\"PAYMENT_OPTIONS\", `Failed to get payment options: ${message}`, message);\n this.name = \"PaymentOptionsError\";\n Object.setPrototypeOf(this, PaymentOptionsError.prototype);\n }\n}\n\n/**\n * Error thrown when payment actions request fails\n */\nexport class PaymentActionsError extends PayError {\n constructor(message: string) {\n super(\"PAYMENT_REQUEST\", `Failed to get payment actions: ${message}`, message);\n this.name = \"PaymentActionsError\";\n Object.setPrototypeOf(this, PaymentActionsError.prototype);\n }\n}\n\n/**\n * Error thrown when payment confirmation fails\n */\nexport class ConfirmPaymentError extends PayError {\n constructor(message: string) {\n super(\"CONFIRM_PAYMENT\", `Failed to confirm payment: ${message}`, message);\n this.name = \"ConfirmPaymentError\";\n Object.setPrototypeOf(this, ConfirmPaymentError.prototype);\n }\n}\n","/**\n * Native Provider for WalletConnect Pay SDK\n *\n * Uses the React Native uniffi module for payment operations.\n */\n\nimport type {\n PaymentOptionsResponse,\n ConfirmPaymentResponse,\n Action,\n PayProvider,\n PayProviderConfig,\n GetPaymentOptionsParams,\n GetRequiredPaymentActionsParams,\n ConfirmPaymentParams,\n} from \"../types/index.js\";\nimport { NativeModuleNotFoundError, PayError } from \"../types/index.js\";\n\n/**\n * Native module interface expected from React Native\n */\ninterface NativePayModule {\n getPaymentOptions(requestJson: string): Promise<string>;\n getRequiredPaymentActions(requestJson: string): Promise<string>;\n confirmPayment(requestJson: string): Promise<string>;\n initialize?(configJson: string): void;\n}\n\n// Cached native module reference\nlet cachedNativeModule: NativePayModule | null | undefined;\n\n// Manually injected module reference\nlet injectedModule: NativePayModule | null = null;\n\n/**\n * Try to get the native module from React Native\n */\nfunction getNativeModule(): NativePayModule | null {\n // Return injected module if available\n if (injectedModule) {\n return injectedModule;\n }\n\n // Return cached result if already attempted\n if (cachedNativeModule !== undefined) {\n return cachedNativeModule;\n }\n\n try {\n // Access React Native's NativeModules via globalThis\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const reactNative = (globalThis as any).ReactNative;\n if (reactNative?.NativeModules?.RNWalletConnectPay) {\n cachedNativeModule = reactNative.NativeModules.RNWalletConnectPay as NativePayModule;\n return cachedNativeModule;\n }\n\n // Fallback: Try accessing via expo modules pattern\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const expoModules = (globalThis as any).expo?.modules;\n if (expoModules?.RNWalletConnectPay) {\n cachedNativeModule = expoModules.RNWalletConnectPay as NativePayModule;\n return cachedNativeModule;\n }\n\n cachedNativeModule = null;\n return null;\n } catch {\n cachedNativeModule = null;\n return null;\n }\n}\n\n/**\n * Set a custom native module instance\n * Use this to manually inject the native module if auto-discovery doesn't work\n */\nexport function setNativeModule(module: NativePayModule): void {\n injectedModule = module;\n cachedNativeModule = module;\n}\n\n/**\n * Check if native provider is available\n */\nexport function isNativeProviderAvailable(): boolean {\n return getNativeModule() !== null;\n}\n\n/**\n * Reset the native module (for testing)\n */\nexport function resetNativeModule(): void {\n injectedModule = null;\n cachedNativeModule = undefined;\n}\n\n/**\n * Native provider implementation using React Native uniffi module\n */\nexport class NativeProvider implements PayProvider {\n private readonly module: NativePayModule;\n\n constructor(config: PayProviderConfig) {\n const module = getNativeModule();\n\n if (!module) {\n throw new NativeModuleNotFoundError();\n }\n\n // Initialize the module with config\n if (module.initialize) {\n try {\n const configJson = JSON.stringify(config);\n module.initialize(configJson);\n } catch (error) {\n throw new PayError(\n \"INITIALIZATION_ERROR\",\n `Failed to initialize native Pay module: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n }\n\n this.module = module;\n }\n\n async getPaymentOptions(params: GetPaymentOptionsParams): Promise<PaymentOptionsResponse> {\n const request = {\n paymentLink: params.paymentLink,\n accounts: params.accounts,\n includePaymentInfo: params.includePaymentInfo ?? false,\n };\n\n try {\n const responseJson = await this.module.getPaymentOptions(JSON.stringify(request));\n return JSON.parse(responseJson) as PaymentOptionsResponse;\n } catch (error) {\n throw PayError.fromNativeError(error);\n }\n }\n\n async getRequiredPaymentActions(params: GetRequiredPaymentActionsParams): Promise<Action[]> {\n const request = {\n paymentId: params.paymentId,\n optionId: params.optionId,\n };\n\n try {\n const responseJson = await this.module.getRequiredPaymentActions(JSON.stringify(request));\n return JSON.parse(responseJson) as Action[];\n } catch (error) {\n throw PayError.fromNativeError(error);\n }\n }\n\n async confirmPayment(params: ConfirmPaymentParams): Promise<ConfirmPaymentResponse> {\n const request = {\n paymentId: params.paymentId,\n optionId: params.optionId,\n signatures: params.signatures,\n collectedData: params.collectedData,\n };\n\n try {\n const responseJson = await this.module.confirmPayment(JSON.stringify(request));\n return JSON.parse(responseJson) as ConfirmPaymentResponse;\n } catch (error) {\n throw PayError.fromNativeError(error);\n }\n }\n}\n\n/**\n * Create a native provider instance\n */\nexport function createNativeProvider(config: PayProviderConfig): PayProvider {\n return new NativeProvider(config);\n}\n","/**\n * Provider exports for WalletConnect Pay SDK\n */\n\nimport type { PayProvider, PayProviderConfig, PayProviderType } from \"../types/index.js\";\nimport { createNativeProvider, isNativeProviderAvailable } from \"./native.js\";\n\nexport * from \"./native.js\";\n\n/**\n * Detect the best available provider type for the current environment\n */\nexport function detectProviderType(): PayProviderType | null {\n // Check for native module (React Native)\n if (isNativeProviderAvailable()) {\n return \"native\";\n }\n\n // Future: Check for WASM support\n // if (isWasmProviderAvailable()) {\n // return \"wasm\";\n // }\n\n return null;\n}\n\n/**\n * Create a provider based on auto-detection\n * @param config - Provider configuration\n */\nexport function createProvider(config: PayProviderConfig): PayProvider {\n const providerType = detectProviderType();\n\n if (!providerType) {\n throw new Error(\n \"No Pay provider available. Make sure you are running in React Native with the native module installed, or in a browser with WASM support.\",\n );\n }\n\n switch (providerType) {\n case \"native\":\n return createNativeProvider(config);\n case \"wasm\":\n // Future: return createWasmProvider(config);\n throw new Error(\"WASM provider not yet implemented\");\n default:\n throw new Error(`Unknown provider type: ${providerType}`);\n }\n}\n\n/**\n * Check if any provider is available\n */\nexport function isProviderAvailable(): boolean {\n return detectProviderType() !== null;\n}\n","/**\n * WalletConnect Pay Client\n *\n * TypeScript wrapper around the Pay provider for payment processing.\n */\n\nimport { getDefaultLoggerOptions, pino } from \"@walletconnect/logger\";\nimport type { Logger } from \"@walletconnect/logger\";\n\nimport { PAY_API_BASE_URL, SDK_NAME, SDK_VERSION, LOGGER_CONTEXT } from \"./constants/index.js\";\nimport { getSdkPlatform } from \"./utils/index.js\";\nimport type {\n PayClientOptions,\n PaymentOptionsResponse,\n ConfirmPaymentResponse,\n Action,\n PayProvider,\n PayProviderConfig,\n GetPaymentOptionsParams,\n GetRequiredPaymentActionsParams,\n ConfirmPaymentParams,\n} from \"./types/index.js\";\nimport {\n PayError,\n PaymentOptionsError,\n PaymentActionsError,\n ConfirmPaymentError,\n} from \"./types/index.js\";\nimport { createProvider, isProviderAvailable } from \"./providers/index.js\";\n\nexport class PayClient {\n public readonly projectId: string;\n public readonly apiKey: string;\n public readonly metadata: PayClientOptions[\"metadata\"];\n public readonly baseUrl: string;\n\n private readonly logger: Logger;\n private readonly provider: PayProvider;\n\n /**\n * Initialize a new Pay client\n * @param opts - Client options\n */\n constructor(opts: PayClientOptions) {\n this.projectId = opts.projectId;\n this.apiKey = opts.apiKey;\n this.metadata = opts.metadata;\n this.baseUrl = opts.baseUrl ?? PAY_API_BASE_URL;\n\n // Initialize logger\n this.logger =\n typeof opts.logger === \"string\"\n ? pino(getDefaultLoggerOptions({ level: opts.logger }))\n : (opts.logger ?? pino(getDefaultLoggerOptions({ level: \"error\" })));\n\n this.logger.trace(`${LOGGER_CONTEXT} initialized`);\n\n // Build provider config\n const providerConfig: PayProviderConfig = {\n baseUrl: this.baseUrl,\n projectId: this.projectId,\n apiKey: this.apiKey,\n sdkName: SDK_NAME,\n sdkVersion: SDK_VERSION,\n sdkPlatform: getSdkPlatform(),\n bundleId: this.metadata.bundleId,\n };\n\n // Create provider (auto-detects available provider)\n this.provider = createProvider(providerConfig);\n this.logger.debug(`${LOGGER_CONTEXT} provider initialized`);\n }\n\n /**\n * Check if the Pay SDK is available on this platform\n */\n static isAvailable(): boolean {\n return isProviderAvailable();\n }\n\n /**\n * Get payment options for a payment link\n *\n * @param params - Payment options parameters\n * @param params.paymentLink - Payment link or payment ID\n * @param params.accounts - List of CAIP-10 account addresses\n * @param params.includePaymentInfo - Whether to include payment info in response\n * @returns Payment options response\n * @throws PaymentOptionsError if the request fails\n */\n async getPaymentOptions(params: GetPaymentOptionsParams): Promise<PaymentOptionsResponse> {\n this.logger.debug(\n {\n paymentLink: params.paymentLink,\n accounts: params.accounts,\n includePaymentInfo: params.includePaymentInfo,\n },\n `${LOGGER_CONTEXT} getPaymentOptions`,\n );\n\n try {\n const response = await this.provider.getPaymentOptions(params);\n\n this.logger.debug(\n { paymentId: response.paymentId, optionsCount: response.options.length },\n `${LOGGER_CONTEXT} getPaymentOptions response`,\n );\n\n return response;\n } catch (error) {\n this.logger.error({ error }, `${LOGGER_CONTEXT} getPaymentOptions error`);\n throw error instanceof PayError ? error : new PaymentOptionsError(String(error));\n }\n }\n\n /**\n * Get required payment actions for a selected option\n *\n * @param params - Required actions parameters\n * @param params.paymentId - Payment ID\n * @param params.optionId - Selected option ID\n * @returns Array of actions to be signed\n * @throws PaymentActionsError if the request fails\n */\n async getRequiredPaymentActions(params: GetRequiredPaymentActionsParams): Promise<Action[]> {\n this.logger.debug(\n { paymentId: params.paymentId, optionId: params.optionId },\n `${LOGGER_CONTEXT} getRequiredPaymentActions`,\n );\n\n try {\n const actions = await this.provider.getRequiredPaymentActions(params);\n\n this.logger.debug(\n { actionsCount: actions.length },\n `${LOGGER_CONTEXT} getRequiredPaymentActions response`,\n );\n\n return actions;\n } catch (error) {\n this.logger.error({ error }, `${LOGGER_CONTEXT} getRequiredPaymentActions error`);\n throw error instanceof PayError ? error : new PaymentActionsError(String(error));\n }\n }\n\n /**\n * Confirm a payment with wallet signatures\n *\n * @param params - Confirm payment parameters\n * @param params.paymentId - Payment ID\n * @param params.optionId - Selected option ID\n * @param params.signatures - Array of signatures from wallet RPC calls\n * @param params.collectedData - Optional collected data fields\n * @returns Confirm payment response with final status\n * @throws ConfirmPaymentError if the request fails\n */\n async confirmPayment(params: ConfirmPaymentParams): Promise<ConfirmPaymentResponse> {\n this.logger.debug(\n {\n paymentId: params.paymentId,\n optionId: params.optionId,\n signaturesCount: params.signatures.length,\n hasCollectedData: !!params.collectedData,\n },\n `${LOGGER_CONTEXT} confirmPayment`,\n );\n\n try {\n const response = await this.provider.confirmPayment(params);\n\n this.logger.debug(\n { status: response.status, isFinal: response.isFinal },\n `${LOGGER_CONTEXT} confirmPayment response`,\n );\n\n return response;\n } catch (error) {\n this.logger.error({ error }, `${LOGGER_CONTEXT} confirmPayment error`);\n throw error instanceof PayError ? error : new ConfirmPaymentError(String(error));\n }\n }\n}\n","import { PayClient as Client } from \"./client.js\";\n\nexport * from \"./constants/index.js\";\nexport * from \"./types/index.js\";\nexport * from \"./providers/index.js\";\n\nexport const PayClient = Client;\nexport default Client;\n"],"names":["isIos","isAndroid","isBrowser","isNode","code","message","originalMessage","__publicField","error","y","cachedNativeModule","injectedModule","getNativeModule","_a","_b","reactNative","expoModules","e","module","config","NativeModuleNotFoundError","configJson","PayError","params","request","responseJson","isNativeProviderAvailable","providerType","createNativeProvider","PayClient","opts","PAY_API_BASE_URL","pino","getDefaultLoggerOptions","LOGGER_CONTEXT","providerConfig","SDK_NAME","SDK_VERSION","getSdkPlatform","createProvider","isProviderAvailable","response","PaymentOptionsError","actions","PaymentActionsError","ConfirmPaymentError","Client"],"mappings":";;;AAKa,MAAA,gBAAA,CAAmB,oCAGnB,QAAW,CAAA,oBAAA,CAGX,YAAc,mBAGd,CAAA,cAAA,CAAiB,MAGjB,cAAiB,CAAA;;ACPvB,SAAS,cAAyB,EAAA,CACvC,OAAIA,KAAM,EAAA,CAAU,QAChBC,CAAAA,SAAAA,EAAoB,CAAA,YAAA,CACpBC,SAAU,EAAA,CAAU,SACpBC,CAAAA,MAAAA,EAAiB,CAAA,MAAA,CACd,SACT;;4KCIa,MAAA,QAAA,SAAiB,KAAM,CAIlC,WAAA,CAAYC,EAAoBC,CAAiBC,CAAAA,CAAAA,CAA0B,CACzE,KAAMD,CAAAA,CAAO,EAJfE,CAAA,CAAA,IAAA,CAAgB,QAChBA,CAAA,CAAA,IAAA,CAAgB,mBAId,IAAK,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