thirdweb 5.112.3 → 5.113.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/dist/cjs/exports/react.js +4 -1
- package/dist/cjs/exports/react.js.map +1 -1
- package/dist/cjs/exports/react.native.js +4 -1
- package/dist/cjs/exports/react.native.js.map +1 -1
- package/dist/cjs/react/core/hooks/x402/useFetchWithPaymentCore.js +110 -0
- package/dist/cjs/react/core/hooks/x402/useFetchWithPaymentCore.js.map +1 -0
- package/dist/cjs/react/native/hooks/x402/useFetchWithPayment.js +89 -0
- package/dist/cjs/react/native/hooks/x402/useFetchWithPayment.js.map +1 -0
- package/dist/cjs/react/web/hooks/x402/useFetchWithPayment.js +168 -0
- package/dist/cjs/react/web/hooks/x402/useFetchWithPayment.js.map +1 -0
- package/dist/cjs/react/web/ui/components/basic.js +1 -1
- package/dist/cjs/react/web/ui/x402/PaymentErrorModal.js +107 -0
- package/dist/cjs/react/web/ui/x402/PaymentErrorModal.js.map +1 -0
- package/dist/cjs/react/web/ui/x402/SignInRequiredModal.js +28 -0
- package/dist/cjs/react/web/ui/x402/SignInRequiredModal.js.map +1 -0
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/wallets/coinbase/coinbase-web.js +9 -0
- package/dist/cjs/wallets/coinbase/coinbase-web.js.map +1 -1
- package/dist/cjs/x402/facilitator.js +1 -1
- package/dist/cjs/x402/fetchWithPayment.js +9 -7
- package/dist/cjs/x402/fetchWithPayment.js.map +1 -1
- package/dist/cjs/x402/schemas.js +2 -0
- package/dist/cjs/x402/schemas.js.map +1 -1
- package/dist/cjs/x402/settle-payment.js +2 -1
- package/dist/cjs/x402/settle-payment.js.map +1 -1
- package/dist/cjs/x402/verify-payment.js +2 -1
- package/dist/cjs/x402/verify-payment.js.map +1 -1
- package/dist/esm/exports/react.js +2 -0
- package/dist/esm/exports/react.js.map +1 -1
- package/dist/esm/exports/react.native.js +2 -0
- package/dist/esm/exports/react.native.js.map +1 -1
- package/dist/esm/react/core/hooks/x402/useFetchWithPaymentCore.js +107 -0
- package/dist/esm/react/core/hooks/x402/useFetchWithPaymentCore.js.map +1 -0
- package/dist/esm/react/native/hooks/x402/useFetchWithPayment.js +86 -0
- package/dist/esm/react/native/hooks/x402/useFetchWithPayment.js.map +1 -0
- package/dist/esm/react/web/hooks/x402/useFetchWithPayment.js +165 -0
- package/dist/esm/react/web/hooks/x402/useFetchWithPayment.js.map +1 -0
- package/dist/esm/react/web/ui/components/basic.js +1 -1
- package/dist/esm/react/web/ui/x402/PaymentErrorModal.js +104 -0
- package/dist/esm/react/web/ui/x402/PaymentErrorModal.js.map +1 -0
- package/dist/esm/react/web/ui/x402/SignInRequiredModal.js +25 -0
- package/dist/esm/react/web/ui/x402/SignInRequiredModal.js.map +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/esm/wallets/coinbase/coinbase-web.js +9 -0
- package/dist/esm/wallets/coinbase/coinbase-web.js.map +1 -1
- package/dist/esm/x402/facilitator.js +1 -1
- package/dist/esm/x402/fetchWithPayment.js +9 -7
- package/dist/esm/x402/fetchWithPayment.js.map +1 -1
- package/dist/esm/x402/schemas.js +2 -0
- package/dist/esm/x402/schemas.js.map +1 -1
- package/dist/esm/x402/settle-payment.js +2 -1
- package/dist/esm/x402/settle-payment.js.map +1 -1
- package/dist/esm/x402/verify-payment.js +2 -1
- package/dist/esm/x402/verify-payment.js.map +1 -1
- package/dist/scripts/bridge-widget.js +50 -50
- package/dist/types/exports/react.d.ts +1 -0
- package/dist/types/exports/react.d.ts.map +1 -1
- package/dist/types/exports/react.native.d.ts +1 -0
- package/dist/types/exports/react.native.d.ts.map +1 -1
- package/dist/types/react/core/hooks/x402/useFetchWithPaymentCore.d.ts +131 -0
- package/dist/types/react/core/hooks/x402/useFetchWithPaymentCore.d.ts.map +1 -0
- package/dist/types/react/native/hooks/x402/useFetchWithPayment.d.ts +189 -0
- package/dist/types/react/native/hooks/x402/useFetchWithPayment.d.ts.map +1 -0
- package/dist/types/react/web/hooks/x402/useFetchWithPayment.d.ts +248 -0
- package/dist/types/react/web/hooks/x402/useFetchWithPayment.d.ts.map +1 -0
- package/dist/types/react/web/ui/x402/PaymentErrorModal.d.ts +20 -0
- package/dist/types/react/web/ui/x402/PaymentErrorModal.d.ts.map +1 -0
- package/dist/types/react/web/ui/x402/SignInRequiredModal.d.ts +12 -0
- package/dist/types/react/web/ui/x402/SignInRequiredModal.d.ts.map +1 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/types/x402/facilitator.d.ts +1 -1
- package/dist/types/x402/fetchWithPayment.d.ts +7 -3
- package/dist/types/x402/fetchWithPayment.d.ts.map +1 -1
- package/dist/types/x402/schemas.d.ts +8 -2
- package/dist/types/x402/schemas.d.ts.map +1 -1
- package/dist/types/x402/settle-payment.d.ts +1 -1
- package/dist/types/x402/settle-payment.d.ts.map +1 -1
- package/dist/types/x402/types.d.ts +2 -0
- package/dist/types/x402/types.d.ts.map +1 -1
- package/dist/types/x402/verify-payment.d.ts +1 -1
- package/dist/types/x402/verify-payment.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/exports/react.native.ts +5 -0
- package/src/exports/react.ts +5 -0
- package/src/react/core/hooks/x402/useFetchWithPaymentCore.ts +160 -0
- package/src/react/native/hooks/x402/useFetchWithPayment.ts +96 -0
- package/src/react/web/hooks/x402/useFetchWithPayment.tsx +238 -0
- package/src/react/web/ui/components/basic.tsx +1 -1
- package/src/react/web/ui/x402/PaymentErrorModal.tsx +261 -0
- package/src/react/web/ui/x402/SignInRequiredModal.tsx +75 -0
- package/src/version.ts +1 -1
- package/src/wallets/coinbase/coinbase-web.ts +10 -0
- package/src/x402/facilitator.ts +1 -1
- package/src/x402/fetchWithPayment.ts +19 -12
- package/src/x402/schemas.ts +2 -0
- package/src/x402/settle-payment.ts +2 -1
- package/src/x402/types.ts +2 -0
- package/src/x402/verify-payment.ts +2 -1
|
@@ -122,7 +122,7 @@ import {
|
|
|
122
122
|
*
|
|
123
123
|
* @public
|
|
124
124
|
* @beta
|
|
125
|
-
* @
|
|
125
|
+
* @x402
|
|
126
126
|
*/
|
|
127
127
|
export async function settlePayment(
|
|
128
128
|
args: SettlePaymentArgs,
|
|
@@ -167,6 +167,7 @@ export async function settlePayment(
|
|
|
167
167
|
error,
|
|
168
168
|
errorMessage:
|
|
169
169
|
errorMessages?.settlementFailed || settlement.errorMessage,
|
|
170
|
+
fundWalletLink: settlement.fundWalletLink,
|
|
170
171
|
accepts: paymentRequirements,
|
|
171
172
|
},
|
|
172
173
|
};
|
package/src/x402/types.ts
CHANGED
|
@@ -58,6 +58,8 @@ export type PaymentRequiredResult = {
|
|
|
58
58
|
accepts: RequestedPaymentRequirements[];
|
|
59
59
|
/** Optional payer address if verification partially succeeded */
|
|
60
60
|
payer?: string;
|
|
61
|
+
/** Optional link to a wallet to fund the wallet of the payer */
|
|
62
|
+
fundWalletLink?: string;
|
|
61
63
|
};
|
|
62
64
|
/** Response headers for the error response */
|
|
63
65
|
responseHeaders: Record<string, string>;
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
*
|
|
71
71
|
* @public
|
|
72
72
|
* @beta
|
|
73
|
-
* @
|
|
73
|
+
* @x402
|
|
74
74
|
*/
|
|
75
75
|
export async function verifyPayment(
|
|
76
76
|
args: PaymentArgs,
|
|
@@ -112,6 +112,7 @@ export async function verifyPayment(
|
|
|
112
112
|
error: error,
|
|
113
113
|
errorMessage:
|
|
114
114
|
errorMessages?.verificationFailed || verification.errorMessage,
|
|
115
|
+
fundWalletLink: verification.fundWalletLink,
|
|
115
116
|
accepts: paymentRequirements,
|
|
116
117
|
},
|
|
117
118
|
};
|