@w3payments/react 0.0.1
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/README.md +488 -0
- package/dist/appearance.d.ts +30 -0
- package/dist/appearance.d.ts.map +1 -0
- package/dist/assets/3.svg +1 -0
- package/dist/assets/io.svg +1 -0
- package/dist/assets/main.css +1 -0
- package/dist/assets/vite.svg +1 -0
- package/dist/assets/w.svg +1 -0
- package/dist/components/CurrencyIcon.d.ts +71 -0
- package/dist/components/CurrencyIcon.d.ts.map +1 -0
- package/dist/components/ExchangeIcon.d.ts +8 -0
- package/dist/components/ExchangeIcon.d.ts.map +1 -0
- package/dist/components/PaymentMethodRow.d.ts +24 -0
- package/dist/components/PaymentMethodRow.d.ts.map +1 -0
- package/dist/components/W3PaymentFooter.d.ts +8 -0
- package/dist/components/W3PaymentFooter.d.ts.map +1 -0
- package/dist/components/W3PaymentWidget.d.ts +46 -0
- package/dist/components/W3PaymentWidget.d.ts.map +1 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +25 -0
- package/dist/index.mjs +10636 -0
- package/dist/main.d.ts +9 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/types.d.ts +48 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/qr.d.ts +41 -0
- package/dist/utils/qr.d.ts.map +1 -0
- package/package.json +114 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"W3PaymentFooter.d.ts","sourceRoot":"","sources":["../../src/components/W3PaymentFooter.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,MAAM,WAAW,oBAAoB;IACnC,6CAA6C;IAC7C,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAuE1D,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { PaymentIntent } from '@w3payments/core';
|
|
3
|
+
export interface Destination {
|
|
4
|
+
address: string;
|
|
5
|
+
currency: string;
|
|
6
|
+
network: string;
|
|
7
|
+
}
|
|
8
|
+
export interface W3PaymentWidgetProps {
|
|
9
|
+
/** API endpoint for W3 Payments backend */
|
|
10
|
+
endpoint: string;
|
|
11
|
+
/** Target currency to receive (e.g., 'USDC', 'BTC') */
|
|
12
|
+
currency: string;
|
|
13
|
+
/** Target network (e.g., 'ethereum', 'solana') */
|
|
14
|
+
network: string;
|
|
15
|
+
/** Destination addresses where payments will be sent */
|
|
16
|
+
destinations: Destination[];
|
|
17
|
+
/** Amount in target currency (optional, if not provided shows input) */
|
|
18
|
+
amount?: string;
|
|
19
|
+
/** Widget title (displayed in header) */
|
|
20
|
+
title?: string;
|
|
21
|
+
/** Widget subtitle */
|
|
22
|
+
subtitle?: string;
|
|
23
|
+
/** Widget logo URL (displayed in header) */
|
|
24
|
+
logo?: string;
|
|
25
|
+
/** Theme preset name */
|
|
26
|
+
theme?: 'default' | 'night';
|
|
27
|
+
/** Enable direct payment option with QR code */
|
|
28
|
+
enableDirect?: boolean;
|
|
29
|
+
/** Transaction/Order ID from merchant system */
|
|
30
|
+
transactionId?: string | number;
|
|
31
|
+
/** Customer ID from merchant system */
|
|
32
|
+
customerId?: string | number;
|
|
33
|
+
/** Idempotency key to prevent duplicate charges */
|
|
34
|
+
idempotencyKey?: string;
|
|
35
|
+
/** URL to redirect after payment completion */
|
|
36
|
+
callbackUrl?: string;
|
|
37
|
+
/** Called when payment is initiated */
|
|
38
|
+
onInitiate?: (intent: PaymentIntent) => void | Promise<void>;
|
|
39
|
+
/** Called when payment completes successfully */
|
|
40
|
+
onComplete?: (response: any) => void;
|
|
41
|
+
/** Called when payment fails */
|
|
42
|
+
onError?: (error: Error) => void;
|
|
43
|
+
}
|
|
44
|
+
export declare const W3PaymentWidget: React.FC<W3PaymentWidgetProps>;
|
|
45
|
+
export default W3PaymentWidget;
|
|
46
|
+
//# sourceMappingURL=W3PaymentWidget.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"W3PaymentWidget.d.ts","sourceRoot":"","sources":["../../src/components/W3PaymentWidget.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAA8B,MAAM,OAAO,CAAC;AAmBnD,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,kBAAkB,CAAC;AAErE,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAC;IACjB,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,wDAAwD;IACxD,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,wEAAwE;IACxE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wBAAwB;IACxB,KAAK,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IAC5B,gDAAgD;IAChD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gDAAgD;IAChD,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAChC,uCAAuC;IACvC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,mDAAmD;IACnD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uCAAuC;IACvC,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7D,iDAAiD;IACjD,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC,gCAAgC;IAChC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAkrB1D,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component Exports
|
|
3
|
+
*
|
|
4
|
+
* Central export point for React components in the W3 Payments React library.
|
|
5
|
+
*/
|
|
6
|
+
export { W3PaymentWidget } from './W3PaymentWidget';
|
|
7
|
+
export { PaymentMethodRow } from './PaymentMethodRow';
|
|
8
|
+
export { W3PaymentFooter } from './W3PaymentFooter';
|
|
9
|
+
export type { W3PaymentWidgetProps } from './W3PaymentWidget';
|
|
10
|
+
export type { PaymentMethodRowProps } from './PaymentMethodRow';
|
|
11
|
+
export type { W3PaymentFooterProps } from './W3PaymentFooter';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
|