@0xsequence/marketplace-sdk 0.8.8 → 0.8.10
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/CHANGELOG.md +36 -0
- package/dist/{chunk-FMEEJFAF.js → chunk-5C6ZZ6WX.js} +1 -1
- package/dist/{chunk-YEGD7PWE.js → chunk-5O44EPXZ.js} +2 -2
- package/dist/chunk-6CTFVBKU.js +1 -0
- package/dist/{chunk-KGM2WLSP.js → chunk-7F27CJZW.js} +14 -2
- package/dist/{chunk-KGM2WLSP.js.map → chunk-7F27CJZW.js.map} +1 -1
- package/dist/{chunk-MAD64DLJ.js → chunk-A7BVFBWB.js} +2 -2
- package/dist/{chunk-YBOFRP65.js → chunk-FGM57QUU.js} +2 -2
- package/dist/{chunk-HHYNOPPI.js → chunk-KTST7ORH.js} +2 -2
- package/dist/{chunk-35WWD5V6.js → chunk-M6NJ73Y5.js} +3 -3
- package/dist/chunk-Q3ECVC4F.js +811 -0
- package/dist/chunk-Q3ECVC4F.js.map +1 -0
- package/dist/{chunk-EODKQL6Y.js → chunk-RVIUUJTP.js} +2 -2
- package/dist/{chunk-G3447GIP.js → chunk-SXVUTSMT.js} +24 -9
- package/dist/chunk-SXVUTSMT.js.map +1 -0
- package/dist/{chunk-7IYKUVC3.js → chunk-UJSF7PSC.js} +251 -107
- package/dist/chunk-UJSF7PSC.js.map +1 -0
- package/dist/{chunk-YALXP2PW.js → chunk-WH5BZC7W.js} +2 -2
- package/dist/{chunk-4XLXOEXQ.js → chunk-Y2HJO2VY.js} +25 -4
- package/dist/chunk-Y2HJO2VY.js.map +1 -0
- package/dist/{create-config-DwrnzwpM.d.ts → create-config-CAQcvjl6.d.ts} +2 -2
- package/dist/{index-DGsVBflk.d.ts → index-MlUK9AQE.d.ts} +2 -2
- package/dist/index.css +74 -28
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.js +10 -4
- package/dist/{lowestListing-BQHIuvNF.d.ts → listTokenMetadata-DO4ChDjn.d.ts} +20 -2
- package/dist/{marketplaceConfig-B4Fdsmxu.d.ts → marketplaceConfig-D0MXemEl.d.ts} +1 -1
- package/dist/react/_internal/api/index.d.ts +3 -2
- package/dist/react/_internal/api/index.js +5 -1
- package/dist/react/_internal/databeat/index.js +11 -10
- package/dist/react/_internal/index.d.ts +6 -5
- package/dist/react/_internal/index.js +5 -1
- package/dist/react/_internal/wagmi/index.d.ts +3 -3
- package/dist/react/hooks/index.d.ts +11 -8
- package/dist/react/hooks/index.js +12 -9
- package/dist/react/hooks/options/index.d.ts +3 -3
- package/dist/react/hooks/options/index.js +3 -3
- package/dist/react/index.css +74 -28
- package/dist/react/index.css.map +1 -1
- package/dist/react/index.d.ts +11 -10
- package/dist/react/index.js +18 -13
- package/dist/react/queries/index.d.ts +3 -2
- package/dist/react/queries/index.js +6 -4
- package/dist/react/ssr/index.d.ts +2 -2
- package/dist/react/ssr/index.js +2 -2
- package/dist/react/ui/components/collectible-card/index.css +74 -28
- package/dist/react/ui/components/collectible-card/index.css.map +1 -1
- package/dist/react/ui/components/collectible-card/index.d.ts +24 -1
- package/dist/react/ui/components/collectible-card/index.js +18 -15
- package/dist/react/ui/components/marketplace-logos/index.js +1 -1
- package/dist/react/ui/icons/index.js +7 -6
- package/dist/react/ui/index.css +74 -28
- package/dist/react/ui/index.css.map +1 -1
- package/dist/react/ui/index.d.ts +1 -1
- package/dist/react/ui/index.js +16 -13
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +11 -10
- package/dist/{sdk-config-txlivEKe.d.ts → sdk-config-onSPBxJj.d.ts} +1 -0
- package/dist/{services-BI_w8Eq4.d.ts → services-CMSb9ipU.d.ts} +5 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +1 -1
- package/dist/{types-isjvwapz.d.ts → types-B8xzPEKX.d.ts} +2 -2
- package/dist/utils/abi/index.d.ts +1 -0
- package/dist/utils/abi/index.js +7 -1
- package/dist/utils/abi/primary-sale/index.d.ts +1054 -0
- package/dist/utils/abi/primary-sale/index.js +9 -0
- package/dist/utils/abi/primary-sale/index.js.map +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +10 -4
- package/package.json +32 -31
- package/src/react/_internal/api/services.ts +12 -1
- package/src/react/hooks/index.ts +1 -0
- package/src/react/hooks/useList1155SaleSupplies.tsx +62 -0
- package/src/react/hooks/useListTokenMetadata.ts +19 -0
- package/src/react/queries/index.ts +1 -0
- package/src/react/queries/listTokenMetadata.ts +38 -0
- package/src/react/ui/components/ModelViewer.tsx +54 -0
- package/src/react/ui/components/_internals/custom-select/CustomSelect.tsx +0 -1
- package/src/react/ui/components/collectible-card/CollectibleCard.tsx +7 -3
- package/src/react/ui/components/collectible-card/__tests__/{CollectibleAsset.test.tsx → Media.test.tsx} +9 -15
- package/src/react/ui/components/collectible-card/index.ts +1 -0
- package/src/react/ui/components/collectible-card/media/Media.tsx +206 -0
- package/src/react/ui/components/collectible-card/{collectible-asset/CollectibleAssetSkeleton.tsx → media/MediaSkeleton.tsx} +1 -1
- package/src/react/ui/components/collectible-card/media/types.ts +17 -0
- package/src/react/ui/components/collectible-card/{collectible-asset → media}/utils.ts +16 -7
- package/src/react/ui/index.ts +1 -0
- package/src/react/ui/modals/BuyModal/hooks/usePaymentModalParams.ts +28 -3
- package/src/react/ui/modals/SuccessfulPurchaseModal/index.tsx +9 -7
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/_components/TokenQuantityInput.tsx +1 -1
- package/src/react/ui/modals/_internal/components/actionModal/ActionModal.test.tsx +0 -1
- package/src/react/ui/modals/_internal/components/priceInput/index.tsx +1 -1
- package/src/react/ui/modals/_internal/components/quantityInput/index.tsx +1 -2
- package/src/react/ui/modals/_internal/components/waasFeeOptionsSelect/WaasFeeOptionsSelect.tsx +0 -1
- package/src/types/sdk-config.ts +1 -0
- package/src/utils/abi/index.ts +1 -0
- package/src/utils/abi/primary-sale/index.ts +2 -0
- package/src/utils/abi/primary-sale/sequence-1155-sales-contract.ts +450 -0
- package/src/utils/abi/primary-sale/sequence-721-sales-contract.ts +352 -0
- package/src/utils/abi/token/sequence-erc1155-items.ts +454 -0
- package/src/utils/fetchContentType.ts +11 -4
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/chunk-4XLXOEXQ.js.map +0 -1
- package/dist/chunk-7IYKUVC3.js.map +0 -1
- package/dist/chunk-G3447GIP.js.map +0 -1
- package/dist/chunk-UISBTKFF.js +0 -1
- package/src/react/ui/components/collectible-card/collectible-asset/CollectibleAsset.tsx +0 -139
- /package/dist/{chunk-FMEEJFAF.js.map → chunk-5C6ZZ6WX.js.map} +0 -0
- /package/dist/{chunk-YEGD7PWE.js.map → chunk-5O44EPXZ.js.map} +0 -0
- /package/dist/{chunk-UISBTKFF.js.map → chunk-6CTFVBKU.js.map} +0 -0
- /package/dist/{chunk-MAD64DLJ.js.map → chunk-A7BVFBWB.js.map} +0 -0
- /package/dist/{chunk-YBOFRP65.js.map → chunk-FGM57QUU.js.map} +0 -0
- /package/dist/{chunk-HHYNOPPI.js.map → chunk-KTST7ORH.js.map} +0 -0
- /package/dist/{chunk-35WWD5V6.js.map → chunk-M6NJ73Y5.js.map} +0 -0
- /package/dist/{chunk-EODKQL6Y.js.map → chunk-RVIUUJTP.js.map} +0 -0
- /package/dist/{chunk-YALXP2PW.js.map → chunk-WH5BZC7W.js.map} +0 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef, useState } from 'react';
|
|
4
|
+
import { cn } from '../../../../../utils';
|
|
5
|
+
import { fetchContentType } from '../../../../../utils/fetchContentType';
|
|
6
|
+
import ChessTileImage from '../../../images/chess-tile.png';
|
|
7
|
+
import ModelViewer from '../../ModelViewer';
|
|
8
|
+
import MediaSkeleton from './MediaSkeleton';
|
|
9
|
+
import type { ContentTypeState, MediaProps } from './types';
|
|
10
|
+
import { getContentType } from './utils';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @description This component is used to display a collectible asset.
|
|
14
|
+
* It will display the first valid asset from the assets array.
|
|
15
|
+
* If no valid asset is found, it will display the placeholder image.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* <Media
|
|
19
|
+
* name="Collectible"
|
|
20
|
+
* assets={[undefined, "some-image-url", undefined]} // undefined assets will be ignored, "some-image-url" will be rendered
|
|
21
|
+
* assetSrcPrefixUrl="https://example.com/"
|
|
22
|
+
* className="w-full h-full"
|
|
23
|
+
* />
|
|
24
|
+
*/
|
|
25
|
+
export function Media({
|
|
26
|
+
name,
|
|
27
|
+
assets,
|
|
28
|
+
assetSrcPrefixUrl,
|
|
29
|
+
className,
|
|
30
|
+
supply,
|
|
31
|
+
}: MediaProps) {
|
|
32
|
+
const [assetLoadFailed, setAssetLoadFailed] = useState(false);
|
|
33
|
+
const [assetLoading, setAssetLoading] = useState(true);
|
|
34
|
+
const [contentType, setContentType] = useState<ContentTypeState>({
|
|
35
|
+
type: null,
|
|
36
|
+
loading: true,
|
|
37
|
+
failed: false,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const videoRef = useRef<HTMLVideoElement>(null);
|
|
41
|
+
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
|
|
42
|
+
|
|
43
|
+
const placeholderImage = ChessTileImage;
|
|
44
|
+
const assetUrl = assets.find((asset): asset is string => !!asset);
|
|
45
|
+
const proxiedAssetUrl = assetUrl
|
|
46
|
+
? assetSrcPrefixUrl
|
|
47
|
+
? `${assetSrcPrefixUrl}${assetUrl}`
|
|
48
|
+
: assetUrl
|
|
49
|
+
: '';
|
|
50
|
+
|
|
51
|
+
const classNames = cn(
|
|
52
|
+
'relative aspect-square overflow-hidden bg-background-secondary',
|
|
53
|
+
supply !== undefined && supply === 0 && 'opacity-50',
|
|
54
|
+
className,
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (!assetUrl) {
|
|
59
|
+
setContentType({ type: null, loading: false, failed: true });
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const determineContentType = async () => {
|
|
64
|
+
try {
|
|
65
|
+
const type = await getContentType(proxiedAssetUrl);
|
|
66
|
+
setContentType({ type, loading: false, failed: false });
|
|
67
|
+
} catch {
|
|
68
|
+
try {
|
|
69
|
+
const type = await fetchContentType(proxiedAssetUrl);
|
|
70
|
+
setContentType({ type, loading: false, failed: false });
|
|
71
|
+
} catch {
|
|
72
|
+
setContentType({ type: null, loading: false, failed: true });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
determineContentType();
|
|
78
|
+
}, [proxiedAssetUrl, assetUrl]);
|
|
79
|
+
|
|
80
|
+
const handleAssetError = () => {
|
|
81
|
+
setAssetLoadFailed(true);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const handleAssetLoad = () => {
|
|
85
|
+
setAssetLoading(false);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// Display placeholder if asset fails to load or doesn't exist
|
|
89
|
+
if ((contentType.failed && !assetLoadFailed) || !assetUrl) {
|
|
90
|
+
return (
|
|
91
|
+
<div className={cn('h-full w-full', classNames)}>
|
|
92
|
+
<img
|
|
93
|
+
src={placeholderImage}
|
|
94
|
+
alt={name || 'Collectible'}
|
|
95
|
+
className="h-full w-full object-cover"
|
|
96
|
+
onError={(e) => {
|
|
97
|
+
console.error('Failed to load placeholder image');
|
|
98
|
+
e.currentTarget.style.display = 'none';
|
|
99
|
+
}}
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Render based on content type
|
|
106
|
+
if (contentType.type === 'html' && !assetLoadFailed) {
|
|
107
|
+
return (
|
|
108
|
+
<div
|
|
109
|
+
className={cn(
|
|
110
|
+
'flex w-full items-center justify-center rounded-lg',
|
|
111
|
+
classNames,
|
|
112
|
+
)}
|
|
113
|
+
>
|
|
114
|
+
{(assetLoading || contentType.loading) && <MediaSkeleton />}
|
|
115
|
+
|
|
116
|
+
<iframe
|
|
117
|
+
title={name || 'Collectible'}
|
|
118
|
+
className="aspect-square w-full"
|
|
119
|
+
src={proxiedAssetUrl}
|
|
120
|
+
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
|
|
121
|
+
sandbox="allow-scripts"
|
|
122
|
+
style={{ border: '0px' }}
|
|
123
|
+
onError={handleAssetError}
|
|
124
|
+
onLoad={handleAssetLoad}
|
|
125
|
+
/>
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (contentType.type === '3d-model' && !assetLoadFailed) {
|
|
131
|
+
return (
|
|
132
|
+
<div className={cn('h-full w-full', classNames)}>
|
|
133
|
+
<ModelViewer
|
|
134
|
+
src={proxiedAssetUrl}
|
|
135
|
+
posterSrc={placeholderImage}
|
|
136
|
+
onLoad={handleAssetLoad}
|
|
137
|
+
onError={handleAssetError}
|
|
138
|
+
/>
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (contentType.type === 'video' && !assetLoadFailed) {
|
|
144
|
+
const videoClassNames = cn(
|
|
145
|
+
'absolute inset-0 h-full w-full object-cover transition-transform duration-200 ease-in-out group-hover:scale-hover',
|
|
146
|
+
assetLoading ? 'invisible' : 'visible',
|
|
147
|
+
// we can't hide the video controls in safari, when user hovers over the video they show up.
|
|
148
|
+
// `pointer-events-none` is the only way to hide them on hover
|
|
149
|
+
isSafari && 'pointer-events-none',
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<div className={classNames}>
|
|
154
|
+
{(assetLoading || contentType.loading) && <MediaSkeleton />}
|
|
155
|
+
|
|
156
|
+
<video
|
|
157
|
+
ref={videoRef}
|
|
158
|
+
className={videoClassNames}
|
|
159
|
+
autoPlay
|
|
160
|
+
loop
|
|
161
|
+
controls
|
|
162
|
+
playsInline
|
|
163
|
+
muted
|
|
164
|
+
controlsList="nodownload noremoteplayback nofullscreen"
|
|
165
|
+
onError={handleAssetError}
|
|
166
|
+
onLoadedMetadata={handleAssetLoad}
|
|
167
|
+
data-testid="collectible-asset-video"
|
|
168
|
+
>
|
|
169
|
+
<source src={proxiedAssetUrl} />
|
|
170
|
+
</video>
|
|
171
|
+
</div>
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Default to image renderer
|
|
176
|
+
const imgSrc =
|
|
177
|
+
assetLoadFailed || contentType.failed ? placeholderImage : proxiedAssetUrl;
|
|
178
|
+
|
|
179
|
+
const imgClassNames = cn(
|
|
180
|
+
'absolute inset-0 h-full w-full object-cover transition-transform duration-200 ease-in-out group-hover:scale-hover',
|
|
181
|
+
assetLoading || contentType.loading ? 'invisible' : 'visible',
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
return (
|
|
185
|
+
<div className={classNames}>
|
|
186
|
+
{(assetLoading || contentType.loading) && <MediaSkeleton />}
|
|
187
|
+
|
|
188
|
+
<img
|
|
189
|
+
src={imgSrc}
|
|
190
|
+
alt={name || 'Collectible'}
|
|
191
|
+
className={imgClassNames}
|
|
192
|
+
onError={(e) => {
|
|
193
|
+
if (contentType.type === 'image') {
|
|
194
|
+
setAssetLoadFailed(true);
|
|
195
|
+
}
|
|
196
|
+
// If this is the placeholder image that failed
|
|
197
|
+
if (e.currentTarget.src === placeholderImage) {
|
|
198
|
+
console.error('Failed to load placeholder image');
|
|
199
|
+
e.currentTarget.style.display = 'none';
|
|
200
|
+
}
|
|
201
|
+
}}
|
|
202
|
+
onLoad={handleAssetLoad}
|
|
203
|
+
/>
|
|
204
|
+
</div>
|
|
205
|
+
);
|
|
206
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type ContentType = 'image' | 'video' | 'html' | '3d-model' | null;
|
|
2
|
+
|
|
3
|
+
type ContentTypeState = {
|
|
4
|
+
type: ContentType;
|
|
5
|
+
loading: boolean;
|
|
6
|
+
failed: boolean;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type MediaProps = {
|
|
10
|
+
name?: string;
|
|
11
|
+
assets: (string | undefined)[];
|
|
12
|
+
assetSrcPrefixUrl?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
supply?: number;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type { ContentType, ContentTypeState, MediaProps };
|
|
@@ -16,21 +16,30 @@ export const isVideo = (fileName: string | undefined) => {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
export const is3dModel = (fileName: string | undefined) => {
|
|
19
|
-
const
|
|
20
|
-
|
|
19
|
+
const is3dFile = /.*\.(gltf|glb|obj|fbx|stl|usdz)$/.test(
|
|
20
|
+
fileName?.toLowerCase() || '',
|
|
21
|
+
);
|
|
22
|
+
return is3dFile;
|
|
21
23
|
};
|
|
22
24
|
|
|
23
25
|
export const getContentType = (
|
|
24
|
-
url: string,
|
|
25
|
-
): Promise<'image' | 'video' | 'html' | null> => {
|
|
26
|
-
return new Promise((resolve) => {
|
|
26
|
+
url: string | undefined,
|
|
27
|
+
): Promise<'image' | 'video' | 'html' | '3d-model' | null> => {
|
|
28
|
+
return new Promise((resolve, reject) => {
|
|
27
29
|
const type = isHtml(url)
|
|
28
30
|
? 'html'
|
|
29
31
|
: isVideo(url)
|
|
30
32
|
? 'video'
|
|
31
33
|
: isImage(url)
|
|
32
34
|
? 'image'
|
|
33
|
-
:
|
|
34
|
-
|
|
35
|
+
: is3dModel(url)
|
|
36
|
+
? '3d-model'
|
|
37
|
+
: null;
|
|
38
|
+
|
|
39
|
+
if (type) {
|
|
40
|
+
resolve(type);
|
|
41
|
+
} else {
|
|
42
|
+
reject(new Error('Unsupported file type'));
|
|
43
|
+
}
|
|
35
44
|
});
|
|
36
45
|
};
|
package/src/react/ui/index.ts
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
WalletKind,
|
|
13
13
|
getMarketplaceClient,
|
|
14
14
|
getQueryClient,
|
|
15
|
+
getSequenceApiClient,
|
|
15
16
|
} from '../../../../_internal';
|
|
16
17
|
import type { WalletInstance } from '../../../../_internal/wallet/wallet';
|
|
17
18
|
import { useConfig } from '../../../../hooks';
|
|
@@ -88,6 +89,27 @@ export const getBuyCollectableParams = async ({
|
|
|
88
89
|
throw new Error('Buy step not found');
|
|
89
90
|
}
|
|
90
91
|
|
|
92
|
+
const creditCardProviders = customCreditCardProviderCallback
|
|
93
|
+
? ['custom']
|
|
94
|
+
: checkoutOptions.nftCheckout || [];
|
|
95
|
+
|
|
96
|
+
const isTransakSupported = creditCardProviders.includes('transak');
|
|
97
|
+
|
|
98
|
+
let transakContractId: string | undefined;
|
|
99
|
+
|
|
100
|
+
if (isTransakSupported) {
|
|
101
|
+
const sequenceApiClient = getSequenceApiClient(config);
|
|
102
|
+
const transakContractIdResponse =
|
|
103
|
+
await sequenceApiClient.checkoutOptionsGetTransakContractID({
|
|
104
|
+
chainId,
|
|
105
|
+
contractAddress: buyStep.to,
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
if (transakContractIdResponse.contractId !== '') {
|
|
109
|
+
transakContractId = transakContractIdResponse.contractId;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
91
113
|
return {
|
|
92
114
|
chain: chainId,
|
|
93
115
|
collectibles: [
|
|
@@ -106,9 +128,7 @@ export const getBuyCollectableParams = async ({
|
|
|
106
128
|
recipientAddress: await wallet.address(),
|
|
107
129
|
enableMainCurrencyPayment: true,
|
|
108
130
|
enableSwapPayments: !!checkoutOptions.swap,
|
|
109
|
-
creditCardProviders
|
|
110
|
-
? ['custom']
|
|
111
|
-
: checkoutOptions.nftCheckout || [],
|
|
131
|
+
creditCardProviders,
|
|
112
132
|
onSuccess: (hash: string) => {
|
|
113
133
|
callbacks?.onSuccess?.({ hash: hash as Hash });
|
|
114
134
|
},
|
|
@@ -130,6 +150,11 @@ export const getBuyCollectableParams = async ({
|
|
|
130
150
|
buyModalStore.send({ type: 'close' });
|
|
131
151
|
},
|
|
132
152
|
}),
|
|
153
|
+
...(transakContractId && {
|
|
154
|
+
transakConfig: {
|
|
155
|
+
contractId: transakContractId,
|
|
156
|
+
},
|
|
157
|
+
}),
|
|
133
158
|
} satisfies SelectPaymentSettings;
|
|
134
159
|
};
|
|
135
160
|
|
|
@@ -92,16 +92,18 @@ function SuccessfulPurchaseActions() {
|
|
|
92
92
|
}
|
|
93
93
|
/>
|
|
94
94
|
)}
|
|
95
|
-
<
|
|
96
|
-
className="w-full"
|
|
97
|
-
as={'a'}
|
|
95
|
+
<a
|
|
98
96
|
href={successfulPurchaseModal$.state.explorerUrl.get()}
|
|
99
97
|
target="_blank"
|
|
100
98
|
rel="noopener noreferrer"
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
99
|
+
className="w-full"
|
|
100
|
+
>
|
|
101
|
+
<Button
|
|
102
|
+
shape="square"
|
|
103
|
+
leftIcon={ExternalLinkIcon}
|
|
104
|
+
label={`View on ${successfulPurchaseModal$.state.explorerName.get()}`}
|
|
105
|
+
/>
|
|
106
|
+
</a>
|
|
105
107
|
</div>
|
|
106
108
|
);
|
|
107
109
|
}
|
|
@@ -40,7 +40,7 @@ const TokenQuantityInput = observer(
|
|
|
40
40
|
$invalidQuantity={$invalidQuantity}
|
|
41
41
|
decimals={collection?.decimals || 0}
|
|
42
42
|
maxQuantity={balanceAmount ? String(balanceAmount) : '0'}
|
|
43
|
-
className="[&>label>div>div]:h-13 [&>label>div>div]:rounded-xl [&>label>div>span]:text-sm [&>label>div>span]:text-text-80 [&>label]:gap-1"
|
|
43
|
+
className="[&>label>div>div>div>input]:text-sm [&>label>div>div>div]:h-13 [&>label>div>div>div]:rounded-xl [&>label>div>div>span]:text-sm [&>label>div>div>span]:text-text-80 [&>label]:gap-1"
|
|
44
44
|
/>
|
|
45
45
|
|
|
46
46
|
<Text
|
|
@@ -113,7 +113,7 @@ export default function PriceInput({
|
|
|
113
113
|
<CurrencyImage price$={$price} />
|
|
114
114
|
</div>
|
|
115
115
|
|
|
116
|
-
<div className="[&>label>div>.rounded-xl]:h-9 [&>label>div>.rounded-xl]:rounded-sm [&>label>div>.rounded-xl]:px-2 [&>label]:gap-1">
|
|
116
|
+
<div className="[&>label>div>div>.rounded-xl]:h-9 [&>label>div>div>.rounded-xl]:rounded-sm [&>label>div>div>.rounded-xl]:px-2 [&>label]:gap-1">
|
|
117
117
|
<NumericInput
|
|
118
118
|
ref={inputRef}
|
|
119
119
|
className="ml-5 w-full text-xs"
|
|
@@ -124,7 +124,7 @@ export default observer(function QuantityInput({
|
|
|
124
124
|
return (
|
|
125
125
|
<div
|
|
126
126
|
className={cn(
|
|
127
|
-
'flex w-full flex-col [&>label>div>div:has(:disabled):hover]:opacity-100 [&>label>div>div:has(:disabled)]:opacity-100 [&>label>div>div>input]:text-xs [&>label>div>div]:h-9 [&>label>div>div]:rounded [&>label>div>div]:pr-0 [&>label>div>div]:pl-3 [&>label>div>div]:text-xs [&>label]:gap-[2px]',
|
|
127
|
+
'flex w-full flex-col [&>label>div>div>div:has(:disabled):hover]:opacity-100 [&>label>div>div>div:has(:disabled)]:opacity-100 [&>label>div>div>div>input]:text-xs [&>label>div>div>div]:h-9 [&>label>div>div>div]:rounded [&>label>div>div>div]:pr-0 [&>label>div>div>div]:pl-3 [&>label>div>div>div]:text-xs [&>label]:gap-[2px]',
|
|
128
128
|
className,
|
|
129
129
|
disabled && 'pointer-events-none opacity-50',
|
|
130
130
|
)}
|
|
@@ -152,7 +152,6 @@ export default observer(function QuantityInput({
|
|
|
152
152
|
/>
|
|
153
153
|
</div>
|
|
154
154
|
}
|
|
155
|
-
numeric={true}
|
|
156
155
|
value={localQuantity}
|
|
157
156
|
onChange={(e: React.ChangeEvent<HTMLInputElement>) =>
|
|
158
157
|
handleChangeQuantity(e.target.value)
|
package/src/types/sdk-config.ts
CHANGED
package/src/utils/abi/index.ts
CHANGED