@b3dotfun/sdk 0.0.79-alpha.0 → 0.0.79-alpha.2
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/anyspend/react/components/AnySpendCollectorClubPurchase.js +9 -2
- package/dist/cjs/anyspend/react/components/AnySpendCustom.d.ts +2 -0
- package/dist/cjs/anyspend/react/components/AnySpendCustom.js +53 -13
- package/dist/cjs/anyspend/react/components/AnySpendNFT.js +6 -9
- package/dist/cjs/anyspend/react/components/common/CryptoReceiveSection.js +1 -3
- package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.d.ts +2 -1
- package/dist/cjs/anyspend/react/components/common/FiatPaymentMethod.js +32 -12
- package/dist/cjs/anyspend/react/components/common/PanelOnramp.js +6 -6
- package/dist/cjs/anyspend/react/components/common/PanelOnrampPayment.js +5 -3
- package/dist/cjs/anyspend/react/hooks/useGeoOnrampOptions.d.ts +2 -8
- package/dist/cjs/anyspend/react/hooks/useGeoOnrampOptions.js +4 -2
- package/dist/cjs/anyspend/react/hooks/useStripeSupport.d.ts +1 -0
- package/dist/cjs/anyspend/react/hooks/useStripeSupport.js +1 -0
- package/dist/cjs/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +5 -3
- package/dist/cjs/shared/utils/ipfs.d.ts +3 -3
- package/dist/cjs/shared/utils/ipfs.js +8 -8
- package/dist/esm/anyspend/react/components/AnySpendCollectorClubPurchase.js +9 -2
- package/dist/esm/anyspend/react/components/AnySpendCustom.d.ts +2 -0
- package/dist/esm/anyspend/react/components/AnySpendCustom.js +53 -13
- package/dist/esm/anyspend/react/components/AnySpendNFT.js +7 -10
- package/dist/esm/anyspend/react/components/common/CryptoReceiveSection.js +1 -3
- package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.d.ts +2 -1
- package/dist/esm/anyspend/react/components/common/FiatPaymentMethod.js +32 -12
- package/dist/esm/anyspend/react/components/common/PanelOnramp.js +6 -6
- package/dist/esm/anyspend/react/components/common/PanelOnrampPayment.js +5 -3
- package/dist/esm/anyspend/react/hooks/useGeoOnrampOptions.d.ts +2 -8
- package/dist/esm/anyspend/react/hooks/useGeoOnrampOptions.js +4 -2
- package/dist/esm/anyspend/react/hooks/useStripeSupport.d.ts +1 -0
- package/dist/esm/anyspend/react/hooks/useStripeSupport.js +1 -0
- package/dist/esm/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.js +5 -3
- package/dist/esm/shared/utils/ipfs.d.ts +3 -3
- package/dist/esm/shared/utils/ipfs.js +8 -8
- package/dist/styles/index.css +1 -1
- package/dist/types/anyspend/react/components/AnySpendCustom.d.ts +2 -0
- package/dist/types/anyspend/react/components/common/FiatPaymentMethod.d.ts +2 -1
- package/dist/types/anyspend/react/hooks/useGeoOnrampOptions.d.ts +2 -8
- package/dist/types/anyspend/react/hooks/useStripeSupport.d.ts +1 -0
- package/dist/types/shared/utils/ipfs.d.ts +3 -3
- package/package.json +1 -1
- package/src/anyspend/react/components/AnySpendCollectorClubPurchase.tsx +9 -1
- package/src/anyspend/react/components/AnySpendCustom.tsx +71 -26
- package/src/anyspend/react/components/AnySpendNFT.tsx +49 -48
- package/src/anyspend/react/components/common/CryptoReceiveSection.tsx +1 -4
- package/src/anyspend/react/components/common/FiatPaymentMethod.tsx +45 -21
- package/src/anyspend/react/components/common/PanelOnramp.tsx +13 -13
- package/src/anyspend/react/components/common/PanelOnrampPayment.tsx +53 -16
- package/src/anyspend/react/hooks/useGeoOnrampOptions.ts +5 -2
- package/src/anyspend/react/hooks/useStripeSupport.ts +1 -0
- package/src/global-account/react/components/IPFSMediaRenderer/IPFSMediaRenderer.tsx +5 -7
- package/src/shared/utils/ipfs.ts +8 -8
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
+
import { getIpfsUrl } from "@b3dotfun/sdk/shared/utils/ipfs";
|
|
3
4
|
import { client as defaultClient } from "@b3dotfun/sdk/shared/utils/thirdweb";
|
|
4
5
|
import type { ThirdwebClient } from "thirdweb";
|
|
5
6
|
import { MediaRenderer } from "thirdweb/react";
|
|
6
7
|
|
|
7
|
-
// Primary IPFS gateway URL - matches our allowed list in profileDisplay.ts
|
|
8
|
-
// Note: MediaRenderer expects the base gateway URL without /ipfs path
|
|
9
|
-
// const IPFS_GATEWAY_URL = "https://cloudflare-ipfs.com";
|
|
10
|
-
|
|
11
8
|
interface IPFSMediaRendererProps {
|
|
12
9
|
/** The source URL - can be IPFS URL (ipfs://...) or HTTP URL */
|
|
13
10
|
src: string | null | undefined;
|
|
@@ -66,12 +63,13 @@ export function IPFSMediaRenderer({
|
|
|
66
63
|
);
|
|
67
64
|
}
|
|
68
65
|
|
|
69
|
-
// Convert IPFS URLs to HTTP gateway URLs
|
|
70
|
-
// This
|
|
66
|
+
// Convert IPFS URLs to HTTP gateway URLs using our preferred gateway
|
|
67
|
+
// This avoids Thirdweb's default cloudflare-ipfs.com which can be unreliable
|
|
68
|
+
const resolvedSrc = src.startsWith("ipfs://") ? getIpfsUrl(src) : src;
|
|
71
69
|
|
|
72
70
|
return (
|
|
73
71
|
<MediaRenderer
|
|
74
|
-
src={
|
|
72
|
+
src={resolvedSrc}
|
|
75
73
|
client={client}
|
|
76
74
|
alt={alt}
|
|
77
75
|
className={className}
|
package/src/shared/utils/ipfs.ts
CHANGED
|
@@ -3,23 +3,23 @@
|
|
|
3
3
|
* These gateways must match the allowed list in profileDisplay.ts validateImageUrl()
|
|
4
4
|
*/
|
|
5
5
|
const IPFS_GATEWAYS = [
|
|
6
|
-
"https://
|
|
6
|
+
"https://dweb.link/ipfs", // Primary gateway - Protocol Labs maintained
|
|
7
|
+
"https://w3s.link/ipfs", // web3.storage gateway - reliable
|
|
8
|
+
"https://nftstorage.link/ipfs", // NFT.storage gateway
|
|
9
|
+
"https://gateway.pinata.cloud/ipfs", // Pinata gateway
|
|
7
10
|
"https://ipfs.io/ipfs", // Fallback gateway
|
|
8
|
-
"https://
|
|
9
|
-
"https://dweb.link/ipfs", // Additional option
|
|
10
|
-
"https://nftstorage.link/ipfs", // Additional option
|
|
11
|
-
"https://w3s.link/ipfs", // Additional option
|
|
11
|
+
"https://cloudflare-ipfs.com/ipfs", // Cloudflare gateway (can be slow/unreliable)
|
|
12
12
|
] as const;
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Converts an IPFS URL to a gateway URL
|
|
16
16
|
* @param ipfsUrl - URL in format ipfs://CID/path or just the CID
|
|
17
|
-
* @param gatewayIndex - Optional index to specify which gateway to use (0:
|
|
17
|
+
* @param gatewayIndex - Optional index to specify which gateway to use (0: dweb.link, 1: w3s.link, etc.)
|
|
18
18
|
* @returns HTTP URL using the specified IPFS gateway
|
|
19
19
|
* @example
|
|
20
|
-
* // returns 'https://
|
|
20
|
+
* // returns 'https://dweb.link/ipfs/QmUbJ4p.../2.png'
|
|
21
21
|
* getIpfsUrl('ipfs://QmUbJ4pnHMNXGeWWhBFFSEqCGuc6cEtDyz35wQfv7k2TXy/2.png')
|
|
22
|
-
* // returns 'https://
|
|
22
|
+
* // returns 'https://w3s.link/ipfs/QmUbJ4p.../2.png'
|
|
23
23
|
* getIpfsUrl('ipfs://QmUbJ4pnHMNXGeWWhBFFSEqCGuc6cEtDyz35wQfv7k2TXy/2.png', 1)
|
|
24
24
|
*/
|
|
25
25
|
export function getIpfsUrl(ipfsUrl: string, gatewayIndex = 0): string {
|