@cedros/pay-react 1.1.22 → 1.1.24
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/{AISettingsSection-p3iikbSw.mjs → AISettingsSection-Dw0ZlxMf.mjs} +2 -2
- package/dist/{AISettingsSection-BtOxEweU.js → AISettingsSection-IXS1Wt_1.js} +1 -1
- package/dist/{AutosaveIndicator-CWbb-VXf.mjs → AutosaveIndicator-BJsg_kFZ.mjs} +1 -1
- package/dist/{AutosaveIndicator-C-CH-obR.js → AutosaveIndicator-CY_YHM1D.js} +1 -1
- package/dist/{CedrosContext-D-lnoEkR.js → CedrosContext-7dwmEeUY.js} +2 -2
- package/dist/{CedrosContext-BE6P5PQ0.mjs → CedrosContext-DQUbL8yP.mjs} +105 -88
- package/dist/{CryptoButton-Dy-g3bR0.js → CryptoButton-C1AAOOfj.js} +1 -1
- package/dist/{CryptoButton-CksMkZjL.mjs → CryptoButton-D1BCZBk4.mjs} +51 -51
- package/dist/{FAQSection-DQpF7hVx.js → FAQSection-BmgmzDN5.js} +1 -1
- package/dist/{FAQSection-byh7zfqI.mjs → FAQSection-C78MnK4k.mjs} +1 -1
- package/dist/{MessagingSection-B6EHvjDw.js → MessagingSection-CWLZcg11.js} +1 -1
- package/dist/{MessagingSection-CK208brx.mjs → MessagingSection-De3t8bSI.mjs} +2 -2
- package/dist/OrdersSection-BKOxsZw0.js +1 -0
- package/dist/OrdersSection-_xKVzjSZ.mjs +233 -0
- package/dist/{PaymentSettingsSection-Cmmuhmd4.js → PaymentSettingsSection-BTEn9Dxb.js} +1 -1
- package/dist/{PaymentSettingsSection-B9H253x1.mjs → PaymentSettingsSection-KjU_dN_d.mjs} +1 -1
- package/dist/{SettingsSection-DDLMaEPo.mjs → SettingsSection-8QHZB59k.mjs} +1 -1
- package/dist/{SettingsSection-DrzGdvHH.js → SettingsSection-cKF0tLnS.js} +1 -1
- package/dist/SingleCategorySettings--LK0TZW0.mjs +1006 -0
- package/dist/SingleCategorySettings-CRXTMTo5.js +3 -0
- package/dist/{StorefrontSection-DTpZ_GgO.js → StorefrontSection-C9DzCmOf.js} +1 -1
- package/dist/{StorefrontSection-Dr2ciBVg.mjs → StorefrontSection-CeCpr8hn.mjs} +2 -2
- package/dist/{SubscriptionsSection-CU3Ce8r9.mjs → SubscriptionsSection-C2xk8ApF.mjs} +1 -1
- package/dist/{SubscriptionsSection-CYJpArJ8.js → SubscriptionsSection-Dn5SY6S_.js} +1 -1
- package/dist/Token22Section-DUUl59dZ.js +1 -0
- package/dist/Token22Section-HygkDNtL.mjs +1685 -0
- package/dist/{WalletManager-QcfgQmap.js → WalletManager-Bwk3rgr1.js} +1 -1
- package/dist/{WalletManager-D78miaJ2.mjs → WalletManager-CXvQ0Zu9.mjs} +1 -1
- package/dist/bn-Bv2sKQMU.mjs +1185 -0
- package/dist/bn-CHyy7EgJ.js +1 -0
- package/dist/configApi-Ch0Rr7TD.mjs +554 -0
- package/dist/configApi-CxEbCAgG.js +1 -0
- package/dist/crypto-only.js +1 -1
- package/dist/crypto-only.mjs +54 -52
- package/dist/{index-CufXF9Yd.mjs → index-BHF82XBB.mjs} +6687 -5866
- package/dist/index-OaWkrl0G.js +84 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +34 -32
- package/dist/pay-react_false-CPX8Vyp9.mjs +5 -0
- package/dist/pay-react_false-DaeIe3_l.js +1 -0
- package/dist/{sections-CR7NRsjq.js → sections-8e5Y3ukY.js} +1 -1
- package/dist/sections-C1rb9YRh.mjs +9 -0
- package/dist/src/components/CreditsBalance.d.ts +24 -0
- package/dist/src/components/CreditsBalance.d.ts.map +1 -0
- package/dist/src/components/admin/AssetClassesTab.d.ts +20 -0
- package/dist/src/components/admin/AssetClassesTab.d.ts.map +1 -0
- package/dist/src/components/admin/AssetRedemptionManager.d.ts +21 -0
- package/dist/src/components/admin/AssetRedemptionManager.d.ts.map +1 -0
- package/dist/src/components/admin/CedrosPayAdminDashboard.d.ts +1 -1
- package/dist/src/components/admin/CedrosPayAdminDashboard.d.ts.map +1 -1
- package/dist/src/components/admin/GiftCardComplianceTab.d.ts +3 -0
- package/dist/src/components/admin/GiftCardComplianceTab.d.ts.map +1 -0
- package/dist/src/components/admin/LiquidityPoolTab.d.ts +11 -0
- package/dist/src/components/admin/LiquidityPoolTab.d.ts.map +1 -0
- package/dist/src/components/admin/OrdersSection.d.ts +3 -0
- package/dist/src/components/admin/OrdersSection.d.ts.map +1 -0
- package/dist/src/components/admin/ProductsSection.d.ts.map +1 -1
- package/dist/src/components/admin/RedemptionFormBuilder.d.ts +25 -0
- package/dist/src/components/admin/RedemptionFormBuilder.d.ts.map +1 -0
- package/dist/src/components/admin/Token22Section.d.ts +3 -0
- package/dist/src/components/admin/Token22Section.d.ts.map +1 -0
- package/dist/src/components/admin/configApi.d.ts.map +1 -1
- package/dist/src/components/admin/index.d.ts +3 -0
- package/dist/src/components/admin/index.d.ts.map +1 -1
- package/dist/src/ecommerce/adapters/mock/mockAdapter.d.ts.map +1 -1
- package/dist/src/ecommerce/adapters/paywall/paywallAdapter.d.ts.map +1 -1
- package/dist/src/ecommerce/components/catalog/AssetBadge.d.ts +13 -0
- package/dist/src/ecommerce/components/catalog/AssetBadge.d.ts.map +1 -0
- package/dist/src/ecommerce/components/catalog/ProductCard.d.ts.map +1 -1
- package/dist/src/ecommerce/components/checkout/CheckoutForm.d.ts.map +1 -1
- package/dist/src/ecommerce/components/checkout/CheckoutReceipt.d.ts +9 -2
- package/dist/src/ecommerce/components/checkout/CheckoutReceipt.d.ts.map +1 -1
- package/dist/src/ecommerce/components/checkout/CheckoutSuccessPage.d.ts +7 -1
- package/dist/src/ecommerce/components/checkout/CheckoutSuccessPage.d.ts.map +1 -1
- package/dist/src/ecommerce/components/checkout/RedemptionForm.d.ts +22 -0
- package/dist/src/ecommerce/components/checkout/RedemptionForm.d.ts.map +1 -0
- package/dist/src/ecommerce/components/gift-cards/GiftCardRedemptionPage.d.ts +36 -0
- package/dist/src/ecommerce/components/gift-cards/GiftCardRedemptionPage.d.ts.map +1 -0
- package/dist/src/ecommerce/components/orders/OrderCard.d.ts.map +1 -1
- package/dist/src/ecommerce/components/orders/OrderDetails.d.ts +5 -1
- package/dist/src/ecommerce/components/orders/OrderDetails.d.ts.map +1 -1
- package/dist/src/ecommerce/index.d.ts +6 -0
- package/dist/src/ecommerce/index.d.ts.map +1 -1
- package/dist/src/ecommerce/state/checkout/checkoutSchema.d.ts +1 -0
- package/dist/src/ecommerce/state/checkout/checkoutSchema.d.ts.map +1 -1
- package/dist/src/ecommerce/state/checkout/useCheckout.d.ts.map +1 -1
- package/dist/src/ecommerce/templates/ProductTemplate.d.ts.map +1 -1
- package/dist/src/ecommerce/templates/PurchaseHistoryTemplate.d.ts +5 -1
- package/dist/src/ecommerce/templates/PurchaseHistoryTemplate.d.ts.map +1 -1
- package/dist/src/ecommerce/types.d.ts +20 -0
- package/dist/src/ecommerce/types.d.ts.map +1 -1
- package/dist/src/ecommerce/utils/cartItemMetadata.d.ts.map +1 -1
- package/dist/src/ecommerce/utils/safeHref.d.ts +9 -0
- package/dist/src/ecommerce/utils/safeHref.d.ts.map +1 -0
- package/dist/src/hooks/useCreditsBalance.d.ts +32 -0
- package/dist/src/hooks/useCreditsBalance.d.ts.map +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/managers/CreditsManager.d.ts +15 -0
- package/dist/src/managers/CreditsManager.d.ts.map +1 -1
- package/dist/src/managers/MeteoraPoolManager.d.ts +86 -0
- package/dist/src/managers/MeteoraPoolManager.d.ts.map +1 -0
- package/dist/stripe-only.js +1 -1
- package/dist/stripe-only.mjs +2 -2
- package/dist/{styles-BWrLnaUW.js → styles-21F1-oqx.js} +1 -1
- package/dist/{styles--eKKnfdj.mjs → styles-Ag-7ZvAB.mjs} +46 -46
- package/dist/testing/index.js +1 -1
- package/dist/testing/index.mjs +1 -1
- package/dist/{walletPool-DShNjCQ6.mjs → walletPool-C_0P4mTw.mjs} +1 -1
- package/dist/{walletPool-BqNfOhB0.js → walletPool-Ddv33tej.js} +1 -1
- package/package.json +10 -1
- package/dist/SingleCategorySettings-BU98SRFV.mjs +0 -1418
- package/dist/SingleCategorySettings-DqcXe-q4.js +0 -3
- package/dist/index-IZ4WcMd7.js +0 -84
- package/dist/sections-Bc6ARlND.mjs +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@solana/web3.js"),w=require("@solana/spl-token"),t=require("./CedrosContext-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@solana/web3.js"),w=require("@solana/spl-token"),t=require("./CedrosContext-7dwmEeUY.js"),h=require("./index-WcOlBYZJ.js");class p{connection;cluster;endpoint;allowUnknownMint;rpcRateLimiter=t.createRateLimiter({maxRequests:50,windowMs:6e4});rpcCircuitBreaker=t.createCircuitBreaker({failureThreshold:5,timeout:1e4,name:"solana-rpc"});constructor(r="mainnet-beta",e,n=!1){this.cluster=r,this.endpoint=e,this.allowUnknownMint=n,this.connection=this.createConnection()}createConnection(){const r=this.endpoint??o.clusterApiUrl(this.cluster);return new o.Connection(r,"confirmed")}transformRpcError(r){const e=r instanceof Error?r.message:typeof r=="string"?r:String(r);return e.includes("403")||e.includes("Access forbidden")?new Error("Public Solana RPC access denied. Please configure a custom RPC endpoint (e.g., from Helius, QuickNode, or Alchemy) in your CedrosProvider config using the solanaEndpoint option."):e.includes("429")||e.includes("Too Many Requests")?new Error("Solana RPC rate limit exceeded. Please configure a custom RPC endpoint with higher limits in your CedrosProvider config using the solanaEndpoint option."):r instanceof Error?r:new Error(e)}async buildTransaction(r){const{requirement:e,payerPublicKey:n,blockhash:a}=r;if(!e||!e.payTo)throw new Error("Invalid requirement: missing payTo");t.getLogger().debug("[WalletManager] Building transaction for resource:",e.resource);const i=new o.Transaction,u=this.resolveAmountInMinorUnits(e),c=e.asset;if(!c)throw new Error("asset is required in x402 requirement");const l=t.validateX402Asset(c,e.resource,this.allowUnknownMint);if(!l.isValid&&l.error)throw new Error(l.error);l.warning&&t.getLogger().warn(l.warning);const y=new o.PublicKey(c),m=await w.getAssociatedTokenAddress(y,n);if(!this.rpcRateLimiter.tryConsume())throw new Error("RPC rate limit exceeded. Please try again in a moment.");let d;try{d=await this.rpcCircuitBreaker.execute(async()=>await t.retryWithBackoff(async()=>await this.connection.getAccountInfo(m),{...t.RETRY_PRESETS.QUICK,name:"rpc-get-account-info"}))}catch(s){throw s instanceof t.CircuitBreakerOpenError?new Error("Solana RPC service is temporarily unavailable. Please try again in a few moments."):this.transformRpcError(s)}if(!d)throw new Error("Payer is missing an associated token account for this mint");let f;try{f=e.extra?.recipientTokenAccount?new o.PublicKey(e.extra.recipientTokenAccount):new o.PublicKey(e.payTo)}catch(s){throw t.getLogger().warn("[WalletManager] Failed to resolve recipient address:",s),new Error("We are currently unable to process payment, please try again later")}if(i.add(w.createTransferInstruction(m,f,n,u)),e.extra?.memo){const s=new o.TransactionInstruction({keys:[],programId:new o.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),data:Buffer.from(e.extra.memo,"utf8")});i.add(s)}let g;if(a)g=a;else{if(!this.rpcRateLimiter.tryConsume())throw new Error("RPC rate limit exceeded. Please try again in a moment.");try{g=(await this.rpcCircuitBreaker.execute(async()=>await t.retryWithBackoff(async()=>await this.connection.getLatestBlockhash(),{...t.RETRY_PRESETS.QUICK,name:"rpc-get-blockhash"}))).blockhash}catch(s){throw s instanceof t.CircuitBreakerOpenError?new Error("Solana RPC service is temporarily unavailable. Please try again in a few moments."):this.transformRpcError(s)}}return i.recentBlockhash=g,e.extra?.feePayer?i.feePayer=new o.PublicKey(e.extra.feePayer):i.feePayer=n,i}resolveAmountInMinorUnits(r){const e=r.maxAmountRequired;if(!/^\d+$/.test(e))throw new Error("Invalid maxAmountRequired in requirement: must be a non-negative integer string");const n=BigInt(e);if(n<=0n)throw new Error("Invalid maxAmountRequired in requirement");return n}buildPaymentPayload(r){const{requirement:e,signedTx:n,payerPublicKey:a}=r;return{x402Version:0,scheme:e.scheme,network:e.network,payload:{signature:n.signature,transaction:n.serialized,payer:a.toString(),memo:e.extra?.memo,recipientTokenAccount:e.extra?.recipientTokenAccount}}}async signTransaction(r){const{transaction:e,signTransaction:n}=r;t.getLogger().debug("[WalletManager] Requesting wallet to sign transaction");const a=await n(e),i=a.serialize(),u=a.signatures[0]?.signature;if(!u)throw new Error("Signed transaction missing signature");const c=h.bs58.encode(u);return t.getLogger().debug("[WalletManager] Transaction signed with signature:",c.substring(0,20)+"..."),{serialized:t.gBase64.fromUint8Array(i),signature:c}}deserializeTransaction(r){try{const e=t.gBase64.toUint8Array(r);return o.Transaction.from(e)}catch(e){throw new Error(`Failed to deserialize transaction: ${t.formatError(e,"Unknown error")}`)}}async partiallySignTransaction(r){const{transaction:e,signTransaction:n,blockhash:a}=r;a&&e.recentBlockhash!==a&&(e.recentBlockhash=a);const i=await n(e),u=i.signatures[0]?.signature;if(u){const l=h.bs58.encode(u);t.getLogger().debug("[WalletManager] Partially signed with signature:",l.substring(0,20)+"...")}const c=i.serialize({requireAllSignatures:!1,verifySignatures:!1});return t.gBase64.fromUint8Array(c)}async getBalance(r){if(!this.rpcRateLimiter.tryConsume())throw new Error("RPC rate limit exceeded. Please try again in a moment.");try{return await this.rpcCircuitBreaker.execute(async()=>await t.retryWithBackoff(async()=>await this.connection.getBalance(r),{...t.RETRY_PRESETS.QUICK,name:"rpc-get-balance"}))/o.LAMPORTS_PER_SOL}catch(e){throw e instanceof t.CircuitBreakerOpenError?new Error("Solana RPC service is temporarily unavailable. Please try again in a few moments."):this.transformRpcError(e)}}async verifyTransaction(r){if(!this.rpcRateLimiter.tryConsume())throw new Error("RPC rate limit exceeded for transaction verification");try{return!!(await this.rpcCircuitBreaker.execute(async()=>await t.retryWithBackoff(async()=>await this.connection.getSignatureStatus(r),{...t.RETRY_PRESETS.QUICK,name:"rpc-verify-tx"}))).value?.confirmationStatus}catch(e){return e instanceof t.CircuitBreakerOpenError&&t.getLogger().warn("[WalletManager] Circuit breaker OPEN - cannot verify transaction"),!1}}}exports.WalletManager=p;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { clusterApiUrl as C, Connection as b, Transaction as P, PublicKey as l, TransactionInstruction as R, LAMPORTS_PER_SOL as x } from "@solana/web3.js";
|
|
2
2
|
import { getAssociatedTokenAddress as T, createTransferInstruction as A } from "@solana/spl-token";
|
|
3
|
-
import {
|
|
3
|
+
import { h as v, f as B, i as u, k as S, r as m, e as g, b as w, l as f, m as M } from "./CedrosContext-DQUbL8yP.mjs";
|
|
4
4
|
import { b as k } from "./index-BFt38o8Q.mjs";
|
|
5
5
|
class z {
|
|
6
6
|
connection;
|