@0xsequence/marketplace-sdk 0.3.8 → 0.3.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/dist/{chunk-D3HRXVYJ.js → chunk-3LOJQCTV.js} +2 -2
- package/dist/{chunk-53Q7BNZH.js → chunk-4FC3IG7C.js} +2 -2
- package/dist/{chunk-T2AMWIKD.js → chunk-E3ZFT6WR.js} +7 -7
- package/dist/chunk-E3ZFT6WR.js.map +1 -0
- package/dist/{chunk-OUZ42I6B.js → chunk-KRMV6FJE.js} +2 -2
- package/dist/{chunk-G2FYRJMK.js → chunk-N5F6IEAK.js} +1 -1
- package/dist/chunk-N5F6IEAK.js.map +1 -0
- package/dist/{chunk-5BPDO2U3.js → chunk-NS5J356Z.js} +114 -107
- package/dist/chunk-NS5J356Z.js.map +1 -0
- package/dist/{chunk-PPSIO23Z.js → chunk-RJTMPFSZ.js} +317 -243
- package/dist/chunk-RJTMPFSZ.js.map +1 -0
- package/dist/{chunk-3CXEYH2I.js → chunk-Z7NLKEXF.js} +2 -2
- package/dist/index.js +9 -9
- package/dist/react/_internal/api/index.js +2 -2
- package/dist/react/_internal/index.js +3 -3
- package/dist/react/_internal/wagmi/index.js +2 -2
- package/dist/react/hooks/index.d.ts +10 -6
- package/dist/react/hooks/index.js +6 -6
- package/dist/react/index.js +7 -7
- package/dist/react/ssr/index.js.map +1 -1
- package/dist/react/ui/components/index.js +7 -7
- package/dist/react/ui/index.js +7 -7
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +3 -3
- package/dist/types/index.js +3 -3
- package/dist/utils/abi/index.js +5 -5
- package/dist/utils/index.js +7 -7
- package/package.json +1 -1
- package/src/react/_internal/transaction-machine/execute-transaction.ts +5 -3
- package/src/react/hooks/index.ts +1 -0
- package/src/react/hooks/useBuyCollectable.tsx +2 -1
- package/src/react/hooks/useCancelOrder.tsx +2 -1
- package/src/react/hooks/useCurrencies.tsx +16 -22
- package/src/react/hooks/useCurrencyOptions.tsx +16 -0
- package/src/react/hooks/useSell.tsx +2 -1
- package/src/react/ui/components/_internals/action-button/ActionButton.tsx +2 -2
- package/src/react/ui/components/collectible-card/CollectibleCard.tsx +4 -1
- package/src/react/ui/components/collectible-card/Footer.tsx +3 -1
- package/src/react/ui/modals/BuyModal/index.tsx +6 -3
- package/src/react/ui/modals/CreateListingModal/index.tsx +12 -2
- package/src/react/ui/modals/MakeOfferModal/index.tsx +15 -4
- package/src/react/ui/modals/SellModal/index.tsx +3 -2
- package/src/react/ui/modals/_internal/components/currencyImage/index.tsx +53 -0
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +14 -7
- package/src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx +1 -1
- package/src/react/ui/modals/_internal/components/priceInput/index.tsx +3 -3
- package/src/utils/_internal/error/transaction.ts +12 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/chunk-5BPDO2U3.js.map +0 -1
- package/dist/chunk-G2FYRJMK.js.map +0 -1
- package/dist/chunk-PPSIO23Z.js.map +0 -1
- package/dist/chunk-T2AMWIKD.js.map +0 -1
- /package/dist/{chunk-D3HRXVYJ.js.map → chunk-3LOJQCTV.js.map} +0 -0
- /package/dist/{chunk-53Q7BNZH.js.map → chunk-4FC3IG7C.js.map} +0 -0
- /package/dist/{chunk-OUZ42I6B.js.map → chunk-KRMV6FJE.js.map} +0 -0
- /package/dist/{chunk-3CXEYH2I.js.map → chunk-Z7NLKEXF.js.map} +0 -0
|
@@ -268,8 +268,8 @@ declare function useConfig(): SdkConfig;
|
|
|
268
268
|
|
|
269
269
|
declare const UseCurrenciesArgsSchema: z.ZodObject<{
|
|
270
270
|
chainId: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodNativeEnum<typeof _0xsequence_network.ChainId>]>, string, string | number>;
|
|
271
|
-
|
|
272
|
-
|
|
271
|
+
includeNativeCurrency: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
272
|
+
currencyOptions: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, `0x${string}`, string>, "many">>;
|
|
273
273
|
query: z.ZodOptional<z.ZodObject<{
|
|
274
274
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
275
275
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -279,18 +279,18 @@ declare const UseCurrenciesArgsSchema: z.ZodObject<{
|
|
|
279
279
|
}>>;
|
|
280
280
|
}, "strip", z.ZodTypeAny, {
|
|
281
281
|
chainId: string;
|
|
282
|
-
|
|
282
|
+
includeNativeCurrency: boolean;
|
|
283
283
|
query?: {
|
|
284
284
|
enabled?: boolean | undefined;
|
|
285
285
|
} | undefined;
|
|
286
|
-
|
|
286
|
+
currencyOptions?: `0x${string}`[] | undefined;
|
|
287
287
|
}, {
|
|
288
288
|
chainId: string | number;
|
|
289
|
-
collectionAddress?: string | undefined;
|
|
290
289
|
query?: {
|
|
291
290
|
enabled?: boolean | undefined;
|
|
292
291
|
} | undefined;
|
|
293
292
|
includeNativeCurrency?: boolean | undefined;
|
|
293
|
+
currencyOptions?: string[] | undefined;
|
|
294
294
|
}>;
|
|
295
295
|
type UseCurrenciesArgs = z.input<typeof UseCurrenciesArgsSchema>;
|
|
296
296
|
type UseCurrenciesReturn = Awaited<ReturnType<typeof fetchCurrencies>>;
|
|
@@ -2379,6 +2379,10 @@ declare class CollectionNotFoundError extends TransactionError {
|
|
|
2379
2379
|
name: string;
|
|
2380
2380
|
constructor(collectionAddress: string);
|
|
2381
2381
|
}
|
|
2382
|
+
declare class InvalidCurrencyOptionsError extends TransactionError {
|
|
2383
|
+
name: string;
|
|
2384
|
+
constructor(currencyOptions: Address[]);
|
|
2385
|
+
}
|
|
2382
2386
|
declare class ProjectNotFoundError extends TransactionError {
|
|
2383
2387
|
name: string;
|
|
2384
2388
|
constructor(projectId: string, url: string);
|
|
@@ -2415,7 +2419,7 @@ declare class OrdersFetchError extends TransactionError {
|
|
|
2415
2419
|
name: string;
|
|
2416
2420
|
constructor(orderId: string, cause?: Error);
|
|
2417
2421
|
}
|
|
2418
|
-
type TransactionErrorTypes = ChainIdUnavailableError | TransactionReceiptError | PaymentModalTransactionError | CheckoutOptionsError | OrdersFetchError | TransactionConfirmationError | TransactionValidationError | MissingConfigError | MarketplaceConfigFetchError | ProjectNotFoundError | CollectionNotFoundError | InvalidContractTypeError | UnknownTransactionTypeError | NoStepsFoundError | NoExecutionStepError | UnexpectedStepsError | MissingPostStepError | InvalidSignatureStepError | MissingSignatureDataError | MissingStepDataError | OrderNotFoundError | TransactionConfirmationError | InvalidStepError | PaymentModalError | StepGenerationError | StepExecutionError | UserRejectedRequestError | NoMarketplaceConfigError | InsufficientFundsError | ChainSwitchError | TransactionSignatureError | TransactionExecutionError | NoWalletConnectedError | TransactionError;
|
|
2422
|
+
type TransactionErrorTypes = ChainIdUnavailableError | TransactionReceiptError | PaymentModalTransactionError | CheckoutOptionsError | OrdersFetchError | TransactionConfirmationError | TransactionValidationError | MissingConfigError | MarketplaceConfigFetchError | ProjectNotFoundError | CollectionNotFoundError | InvalidCurrencyOptionsError | InvalidContractTypeError | UnknownTransactionTypeError | NoStepsFoundError | NoExecutionStepError | UnexpectedStepsError | MissingPostStepError | InvalidSignatureStepError | MissingSignatureDataError | MissingStepDataError | OrderNotFoundError | TransactionConfirmationError | InvalidStepError | PaymentModalError | StepGenerationError | StepExecutionError | UserRejectedRequestError | NoMarketplaceConfigError | InsufficientFundsError | ChainSwitchError | TransactionSignatureError | TransactionExecutionError | NoWalletConnectedError | TransactionError;
|
|
2419
2423
|
|
|
2420
2424
|
type UseTransactionMachineConfig = Omit<TransactionConfig, 'sdkConfig' | 'marketplaceConfig' | 'walletKind' | 'chains' | 'isWaaS'>;
|
|
2421
2425
|
|
|
@@ -58,20 +58,20 @@ import {
|
|
|
58
58
|
useMarketplaceConfig,
|
|
59
59
|
useRoyaltyPercentage,
|
|
60
60
|
useTransferTokens
|
|
61
|
-
} from "../../chunk-
|
|
61
|
+
} from "../../chunk-NS5J356Z.js";
|
|
62
62
|
import "../../chunk-Y7YO5TLE.js";
|
|
63
63
|
import "../../chunk-7NJETFMF.js";
|
|
64
64
|
import "../../chunk-SBVLWSRZ.js";
|
|
65
65
|
import "../../chunk-NJ2GXOPW.js";
|
|
66
66
|
import "../../chunk-MJ4YU7RW.js";
|
|
67
|
-
import "../../chunk-
|
|
67
|
+
import "../../chunk-KRMV6FJE.js";
|
|
68
68
|
import "../../chunk-MCI3KOSQ.js";
|
|
69
|
-
import "../../chunk-3OHM45R3.js";
|
|
70
69
|
import "../../chunk-WFE6OCYF.js";
|
|
70
|
+
import "../../chunk-3OHM45R3.js";
|
|
71
71
|
import "../../chunk-Q2BVDQ3G.js";
|
|
72
|
-
import "../../chunk-
|
|
73
|
-
import "../../chunk-
|
|
74
|
-
import "../../chunk-
|
|
72
|
+
import "../../chunk-3LOJQCTV.js";
|
|
73
|
+
import "../../chunk-Z7NLKEXF.js";
|
|
74
|
+
import "../../chunk-E3ZFT6WR.js";
|
|
75
75
|
export {
|
|
76
76
|
UseGenerateBuyTransactionArgsSchema,
|
|
77
77
|
balanceOfCollectibleOptions,
|
package/dist/react/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
useSellModal,
|
|
9
9
|
useSuccessfulPurchaseModal,
|
|
10
10
|
useTransferModal
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-RJTMPFSZ.js";
|
|
12
12
|
import "../chunk-NMCGA2TB.js";
|
|
13
13
|
import "../chunk-FFCNYF3S.js";
|
|
14
14
|
import "../chunk-L6GSYPCR.js";
|
|
@@ -74,24 +74,24 @@ import {
|
|
|
74
74
|
useMarketplaceConfig,
|
|
75
75
|
useRoyaltyPercentage,
|
|
76
76
|
useTransferTokens
|
|
77
|
-
} from "../chunk-
|
|
77
|
+
} from "../chunk-NS5J356Z.js";
|
|
78
78
|
import "../chunk-Y7YO5TLE.js";
|
|
79
79
|
import "../chunk-7NJETFMF.js";
|
|
80
80
|
import "../chunk-SBVLWSRZ.js";
|
|
81
81
|
import "../chunk-NJ2GXOPW.js";
|
|
82
82
|
import "../chunk-MJ4YU7RW.js";
|
|
83
|
-
import "../chunk-
|
|
83
|
+
import "../chunk-KRMV6FJE.js";
|
|
84
84
|
import "../chunk-MCI3KOSQ.js";
|
|
85
|
-
import "../chunk-3OHM45R3.js";
|
|
86
85
|
import "../chunk-WFE6OCYF.js";
|
|
86
|
+
import "../chunk-3OHM45R3.js";
|
|
87
87
|
import "../chunk-Q2BVDQ3G.js";
|
|
88
88
|
import {
|
|
89
89
|
getQueryClient
|
|
90
|
-
} from "../chunk-
|
|
90
|
+
} from "../chunk-3LOJQCTV.js";
|
|
91
91
|
import {
|
|
92
92
|
createWagmiConfig
|
|
93
|
-
} from "../chunk-
|
|
94
|
-
import "../chunk-
|
|
93
|
+
} from "../chunk-Z7NLKEXF.js";
|
|
94
|
+
import "../chunk-E3ZFT6WR.js";
|
|
95
95
|
export {
|
|
96
96
|
CollectibleCard,
|
|
97
97
|
MarketplaceProvider,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/react/ssr/create-ssr-client.ts","../../../src/react/_internal/api/get-query-client.ts","../../../src/react/_internal/wagmi/create-config.ts","../../../src/react/_internal/wagmi/embedded.ts","../../../src/utils/_internal/error/base.ts","../../../src/utils/_internal/error/transaction.ts","../../../src/react/_internal/consts.ts","../../../src/react/_internal/wagmi/universal.ts","../../../src/react/hooks/options/marketplaceConfigOptions.ts","../../../src/react/_internal/types.ts","../../../src/react/_internal/api/query-keys.ts","../../../src/react/_internal/api/services.ts"],"sourcesContent":["import { type State, cookieToInitialState } from 'wagmi';\nimport type { SdkConfig } from '../../types/sdk-config';\nimport { getQueryClient } from '../_internal/api/get-query-client';\nimport { createWagmiConfig } from '../_internal/wagmi/create-config';\nimport { marketplaceConfigOptions } from '../hooks/options/marketplaceConfigOptions';\n\ntype InitSSRClientArgs = {\n\tcookie: string;\n\tconfig: SdkConfig;\n};\n\ntype InitialState = { wagmi?: State };\n\nconst marketplaceConfig = async (config: SdkConfig) => {\n\tconst queryClient = getQueryClient();\n\tconst configOptions = marketplaceConfigOptions(config);\n\treturn queryClient.fetchQuery(configOptions);\n};\n\nconst initialState = async (args: InitSSRClientArgs): Promise<InitialState> => {\n\tconst marketConfig = await marketplaceConfig(args.config);\n\tconst wagmiConfig = createWagmiConfig(marketConfig, args.config, true);\n\treturn { wagmi: cookieToInitialState(wagmiConfig, args.cookie) };\n};\n\nexport const createSSRClient = (args: InitSSRClientArgs) => {\n\tconst getMarketplaceConfig = async () => marketplaceConfig(args.config);\n\tconst getInitialState = async () => initialState(args);\n\tconst config = args.config;\n\treturn { getInitialState, getMarketplaceConfig, config };\n};\n","import {\n\tQueryClient,\n\tdefaultShouldDehydrateQuery,\n} from '@tanstack/react-query';\nimport { hashFn } from 'wagmi/query';\n\nfunction makeQueryClient() {\n\treturn new QueryClient({\n\t\tdefaultOptions: {\n\t\t\tqueries: {\n\t\t\t\tstaleTime: 60 * 1000,\n\t\t\t\tqueryKeyHashFn: hashFn,\n\t\t\t},\n\t\t\tdehydrate: {\n\t\t\t\tshouldDehydrateQuery: (query) =>\n\t\t\t\t\tdefaultShouldDehydrateQuery(query) ||\n\t\t\t\t\tquery.state.status === 'pending',\n\t\t\t},\n\t\t},\n\t});\n}\n\nlet browserQueryClient: QueryClient | undefined = undefined;\n\nexport function getQueryClient() {\n\tif (typeof globalThis.document === 'undefined') {\n\t\treturn makeQueryClient();\n\t}\n\n\tif (!browserQueryClient) browserQueryClient = makeQueryClient();\n\treturn browserQueryClient;\n}\n","import { getDefaultChains } from '@0xsequence/kit';\nimport { allNetworks, findNetworkConfig } from '@0xsequence/network';\nimport type { Chain, Transport } from 'viem';\nimport { http, cookieStorage, createConfig, createStorage } from 'wagmi';\nimport type { MarketplaceConfig, SdkConfig } from '../../../types';\nimport { getWaasConnectors } from './embedded';\nimport { getUniversalConnectors } from './universal';\n\nexport const createWagmiConfig = (\n\tmarketplaceConfig: MarketplaceConfig,\n\tsdkConfig: SdkConfig,\n\tssr?: boolean,\n) => {\n\tconst chains = getChainConfigs(marketplaceConfig);\n\tconst transports = getTransportConfigs(chains, sdkConfig.projectAccessKey);\n\n\tconst walletType = sdkConfig.wallet?.embedded?.waasConfigKey\n\t\t? 'waas'\n\t\t: 'universal';\n\n\tconst connectors =\n\t\twalletType === 'universal'\n\t\t\t? getUniversalConnectors(marketplaceConfig, sdkConfig)\n\t\t\t: getWaasConnectors(marketplaceConfig, sdkConfig);\n\n\t// The old config did not support disabling EIP-6963 wallets\n\tconst includeEIP6963Wallets =\n\t\tmarketplaceConfig.walletOptionsNew?.includeEIP6963Wallets ?? true;\n\n\treturn createConfig({\n\t\tconnectors,\n\t\tchains,\n\t\tssr,\n\t\tmultiInjectedProviderDiscovery: includeEIP6963Wallets,\n\t\tstorage: ssr\n\t\t\t? createStorage({\n\t\t\t\t\tstorage: cookieStorage,\n\t\t\t\t})\n\t\t\t: undefined,\n\t\ttransports,\n\t});\n};\n\nfunction getChainConfigs(marketConfig: MarketplaceConfig): [Chain, ...Chain[]] {\n\tconst supportedChainIds = new Set(\n\t\tmarketConfig.collections.map((c) => c.chainId),\n\t);\n\treturn getDefaultChains([...supportedChainIds]);\n}\n\nfunction getTransportConfigs(\n\tchains: [Chain, ...Chain[]],\n\tprojectAccessKey: string,\n): Record<number, Transport> {\n\treturn chains.reduce(\n\t\t(acc, chain) => {\n\t\t\tconst network = findNetworkConfig(allNetworks, chain.id);\n\t\t\tif (network) {\n\t\t\t\tlet rpcUrl = network.rpcUrl;\n\t\t\t\tif (!network.rpcUrl.endsWith(projectAccessKey))\n\t\t\t\t\trpcUrl = `${rpcUrl}/${projectAccessKey}`;\n\t\t\t\tacc[chain.id] = http(rpcUrl);\n\t\t\t}\n\t\t\treturn acc;\n\t\t},\n\t\t{} as Record<number, Transport>,\n\t);\n}\n","import {\n\ttype Wallet,\n\tappleWaas,\n\tcoinbaseWallet,\n\temailWaas,\n\tgetKitConnectWallets,\n\tgoogleWaas,\n\twalletConnect,\n} from '@0xsequence/kit';\nimport type { CreateConnectorFn } from 'wagmi';\nimport type { MarketplaceConfig, SdkConfig } from '../../../types';\nimport { MissingConfigError } from '../../../utils/_internal/error/transaction';\nimport { DEFAULT_NETWORK } from '../consts';\n\nexport function getWaasConnectors(\n\tmarketplaceConfig: MarketplaceConfig,\n\tsdkConfig: SdkConfig,\n): CreateConnectorFn[] {\n\tconst { projectAccessKey } = sdkConfig;\n\n\tconst waasConfigKey = sdkConfig.wallet?.embedded?.waasConfigKey;\n\n\tif (!waasConfigKey) throw new MissingConfigError('waasConfigKey');\n\n\tconst walletConnectProjectId = sdkConfig.wallet?.walletConnectProjectId;\n\tconst { googleClientId, appleClientId, appleRedirectURI } =\n\t\tsdkConfig.wallet?.embedded || {};\n\n\tconst { title: appName } = marketplaceConfig;\n\n\t// Normalizing the wallet options, TODO: remove this after the marketplaceConfig is updated\n\tconst walletOptions = marketplaceConfig.walletOptionsNew || {\n\t\tconnectors: ['coinbase', 'walletconnect'],\n\t};\n\n\tconst wallets: Wallet[] = [\n\t\temailWaas({\n\t\t\tprojectAccessKey,\n\t\t\twaasConfigKey,\n\t\t\tnetwork: DEFAULT_NETWORK,\n\t\t}),\n\t];\n\n\tif (walletOptions.connectors.includes('coinbase')) {\n\t\twallets.push(\n\t\t\tcoinbaseWallet({\n\t\t\t\tappName,\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (\n\t\twalletConnectProjectId &&\n\t\twalletOptions.connectors.includes('walletconnect')\n\t) {\n\t\twallets.push(\n\t\t\twalletConnect({\n\t\t\t\tprojectId: walletConnectProjectId,\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (googleClientId) {\n\t\twallets.push(\n\t\t\tgoogleWaas({\n\t\t\t\tprojectAccessKey,\n\t\t\t\tgoogleClientId,\n\t\t\t\twaasConfigKey,\n\t\t\t\tnetwork: DEFAULT_NETWORK,\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (appleClientId) {\n\t\twallets.push(\n\t\t\tappleWaas({\n\t\t\t\tprojectAccessKey,\n\t\t\t\tappleClientId,\n\t\t\t\tappleRedirectURI,\n\t\t\t\twaasConfigKey,\n\t\t\t\tnetwork: DEFAULT_NETWORK,\n\t\t\t}),\n\t\t);\n\t}\n\n\treturn getKitConnectWallets(projectAccessKey, wallets);\n}\n","export type ErrorType<name extends string = 'Error'> = Error & { name: name };\n\nexport type Compute<type> = { [key in keyof type]: type[key] } & unknown;\n\ntype BaseErrorOptions = Compute<\n\t{ details?: string | undefined } | { cause: BaseError | Error }\n>;\n\nexport class BaseError extends Error {\n\tdetails: string;\n\tshortMessage: string;\n\n\tname = 'MarketplaceSdkBaseError';\n\n\tconstructor(shortMessage: string, options: BaseErrorOptions = {}) {\n\t\tsuper();\n\n\t\tconst details = 'details' in options ? options.details : '';\n\t\tthis.message = [\n\t\t\tshortMessage || 'An error occurred.',\n\t\t\t'',\n\t\t\t...(details ? [`Details: ${details}`] : []),\n\t\t].join('\\n');\n\n\t\tif ('cause' in options && options.cause) {\n\t\t\tthis.cause = options.cause;\n\t\t}\n\n\t\tthis.details = details || '';\n\t\tthis.shortMessage = shortMessage;\n\t}\n}\n","import { BaseError } from './base';\n\nexport type TransactionErrorType<name extends string = 'TransactionError'> =\n\tBaseError & { name: name };\n\nexport class TransactionError extends BaseError {\n\toverride name = 'TransactionError';\n}\n\nexport class ChainSwitchError extends TransactionError {\n\toverride name = 'ChainSwitchError';\n\tconstructor(currentChainId: number, targetChainId: number) {\n\t\tsuper(\n\t\t\t`Failed to switch network from ${currentChainId} to ${targetChainId}`,\n\t\t\t{\n\t\t\t\tdetails:\n\t\t\t\t\t'The user may have rejected the network switch or there might be a network connectivity issue.',\n\t\t\t},\n\t\t);\n\t}\n}\n\nexport class TransactionExecutionError extends TransactionError {\n\toverride name = 'TransactionExecutionError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to execute transaction step: ${stepId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction may have been rejected or failed during execution.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class TransactionSignatureError extends TransactionError {\n\toverride name = 'TransactionSignatureError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to sign transaction step: ${stepId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The signature request may have been rejected by the user.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class NoWalletConnectedError extends TransactionError {\n\toverride name = 'NoWalletConnectedError';\n\tconstructor() {\n\t\tsuper('No wallet connected', {\n\t\t\tdetails: 'Please connect your wallet before attempting this transaction.',\n\t\t});\n\t}\n}\n\nexport class NoMarketplaceConfigError extends TransactionError {\n\toverride name = 'NoMarketplaceConfigError';\n\tconstructor() {\n\t\tsuper('Marketplace configuration not found', {\n\t\t\tdetails:\n\t\t\t\t'The marketplace configuration is missing or invalid. This could be due to an initialization error.',\n\t\t});\n\t}\n}\n\nexport class UserRejectedRequestError extends TransactionError {\n\toverride name = 'UserRejectedRequestError';\n\tconstructor() {\n\t\tsuper('User rejected the request', {\n\t\t\tdetails: 'The user cancelled or rejected the transaction request.',\n\t\t});\n\t}\n}\n\nexport class InsufficientFundsError extends TransactionError {\n\toverride name = 'InsufficientFundsError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Insufficient funds for transaction', {\n\t\t\tdetails:\n\t\t\t\t'The wallet does not have enough funds to complete this transaction.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class StepExecutionError extends TransactionError {\n\toverride name = 'StepExecutionError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to execute step ${stepId})`, {\n\t\t\tdetails: cause?.message || 'The step execution failed unexpectedly.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class StepGenerationError extends TransactionError {\n\toverride name = 'StepGenerationError';\n\tconstructor(transactionType: string, cause?: Error) {\n\t\tsuper(`Failed to generate steps for ${transactionType}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message || 'Could not generate the required transaction steps.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class PaymentModalError extends TransactionError {\n\toverride name = 'PaymentModalError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Payment modal operation failed', {\n\t\t\tdetails:\n\t\t\t\tcause?.message || 'The payment modal operation was unsuccessful.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class InvalidStepError extends TransactionError {\n\toverride name = 'InvalidStepError';\n\tconstructor(stepId: string, reason: string) {\n\t\tsuper(`Invalid step configuration for ${stepId}`, {\n\t\t\tdetails: reason,\n\t\t});\n\t}\n}\n\nexport class TransactionConfirmationError extends TransactionError {\n\toverride name = 'TransactionConfirmationError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Failed to confirm transaction ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction could not be confirmed on the network.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class OrderNotFoundError extends TransactionError {\n\toverride name = 'OrderNotFoundError';\n\tconstructor(orderId: string) {\n\t\tsuper(`Order ${orderId} not found`, {\n\t\t\tdetails: 'The requested order could not be found in the marketplace.',\n\t\t});\n\t}\n}\n\nexport class MissingStepDataError extends TransactionError {\n\toverride name = 'MissingStepDataError';\n\tconstructor() {\n\t\tsuper('Step is missing required data', {\n\t\t\tdetails:\n\t\t\t\t'The transaction step is missing required \"to\" or \"signature\" data.',\n\t\t});\n\t}\n}\n\nexport class MissingSignatureDataError extends TransactionError {\n\toverride name = 'MissingSignatureDataError';\n\tconstructor() {\n\t\tsuper('Step is missing signature data', {\n\t\t\tdetails:\n\t\t\t\t'The signature step is missing required signature data configuration.',\n\t\t});\n\t}\n}\n\nexport class InvalidSignatureStepError extends TransactionError {\n\toverride name = 'InvalidSignatureStepError';\n\tconstructor(stepId: string) {\n\t\tsuper(`Invalid signature step type: ${stepId}`, {\n\t\t\tdetails: 'The signature step type is not supported.',\n\t\t});\n\t}\n}\n\nexport class MissingPostStepError extends TransactionError {\n\toverride name = 'MissingPostStepError';\n\tconstructor() {\n\t\tsuper('Missing post step configuration', {\n\t\t\tdetails:\n\t\t\t\t'The signature step is missing required post-step configuration.',\n\t\t});\n\t}\n}\n\nexport class UnexpectedStepsError extends TransactionError {\n\toverride name = 'UnexpectedStepsError';\n\tconstructor() {\n\t\tsuper('Unexpected steps found', {\n\t\t\tdetails: 'The transaction contains more steps than expected.',\n\t\t});\n\t}\n}\n\nexport class NoExecutionStepError extends TransactionError {\n\toverride name = 'NoExecutionStepError';\n\tconstructor() {\n\t\tsuper('No execution step found', {\n\t\t\tdetails: 'The transaction is missing the required execution step.',\n\t\t});\n\t}\n}\n\nexport class NoStepsFoundError extends TransactionError {\n\toverride name = 'NoStepsFoundError';\n\tconstructor() {\n\t\tsuper('No steps found', {\n\t\t\tdetails: 'The transaction contains no steps to execute.',\n\t\t});\n\t}\n}\n\nexport class UnknownTransactionTypeError extends TransactionError {\n\toverride name = 'UnknownTransactionTypeError';\n\tconstructor(type: string) {\n\t\tsuper(`Unknown transaction type: ${type}`, {\n\t\t\tdetails: 'The specified transaction type is not supported.',\n\t\t});\n\t}\n}\n\nexport class InvalidContractTypeError extends TransactionError {\n\toverride name = 'InvalidContractTypeError';\n\tconstructor(contractType: string | undefined) {\n\t\tsuper(`Invalid contract type: ${contractType}`, {\n\t\t\tdetails: 'The contract type must be either ERC721 or ERC1155.',\n\t\t});\n\t}\n}\n\nexport class CollectionNotFoundError extends TransactionError {\n\toverride name = 'CollectionNotFoundError';\n\tconstructor(collectionAddress: string) {\n\t\tsuper(`Collection not found: ${collectionAddress}`, {\n\t\t\tdetails:\n\t\t\t\t'The specified collection address could not be found in the marketplace configuration.',\n\t\t});\n\t}\n}\n\nexport class ProjectNotFoundError extends TransactionError {\n\toverride name = 'ProjectNotFoundError';\n\tconstructor(projectId: string, url: string) {\n\t\tsuper(`Project not found`, {\n\t\t\tdetails: `Project id: ${projectId} not found at ${url}`,\n\t\t});\n\t}\n}\n\nexport class MarketplaceConfigFetchError extends TransactionError {\n\toverride name = 'MarketplaceConfigFetchError';\n\tconstructor(message: string) {\n\t\tsuper('Failed to fetch marketplace config', {\n\t\t\tdetails: message,\n\t\t});\n\t}\n}\n\nexport class MissingConfigError extends TransactionError {\n\toverride name = 'MissingConfigError';\n\tconstructor(configName: string) {\n\t\tsuper(`Missing required config: ${configName}`, {\n\t\t\tdetails: 'A required configuration parameter is missing.',\n\t\t});\n\t}\n}\n\nexport class TransactionValidationError extends TransactionError {\n\toverride name = 'TransactionValidationError';\n\tconstructor(reason: string) {\n\t\tsuper('Transaction validation failed', {\n\t\t\tdetails: reason,\n\t\t});\n\t}\n}\n\nexport class ChainIdUnavailableError extends TransactionError {\n\toverride name = 'ChainIdUnavailableError';\n\tconstructor() {\n\t\tsuper('Chain ID is not available', {\n\t\t\tdetails: 'Could not determine the current chain ID from the wallet.',\n\t\t});\n\t}\n}\n\nexport class TransactionReceiptError extends TransactionError {\n\toverride name = 'TransactionReceiptError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Failed to get transaction receipt for ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the transaction receipt from the network.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class PaymentModalTransactionError extends TransactionError {\n\toverride name = 'PaymentModalTransactionError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Payment modal transaction failed for ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction initiated from the payment modal failed.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class CheckoutOptionsError extends TransactionError {\n\toverride name = 'CheckoutOptionsError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Failed to get checkout options', {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the checkout options from the marketplace.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class OrdersFetchError extends TransactionError {\n\toverride name = 'OrdersFetchError';\n\tconstructor(orderId: string, cause?: Error) {\n\t\tsuper(`Failed to fetch order ${orderId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the order details from the marketplace.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport type TransactionErrorTypes =\n\t| ChainIdUnavailableError\n\t| TransactionReceiptError\n\t| PaymentModalTransactionError\n\t| CheckoutOptionsError\n\t| OrdersFetchError\n\t| TransactionConfirmationError\n\t| TransactionValidationError\n\t| MissingConfigError\n\t| MarketplaceConfigFetchError\n\t| ProjectNotFoundError\n\t| CollectionNotFoundError\n\t| InvalidContractTypeError\n\t| UnknownTransactionTypeError\n\t| NoStepsFoundError\n\t| NoExecutionStepError\n\t| UnexpectedStepsError\n\t| MissingPostStepError\n\t| InvalidSignatureStepError\n\t| MissingSignatureDataError\n\t| MissingStepDataError\n\t| OrderNotFoundError\n\t| TransactionConfirmationError\n\t| InvalidStepError\n\t| PaymentModalError\n\t| StepGenerationError\n\t| StepExecutionError\n\t| UserRejectedRequestError\n\t| NoMarketplaceConfigError\n\t| InsufficientFundsError\n\t| ChainSwitchError\n\t| TransactionSignatureError\n\t| TransactionExecutionError\n\t| NoWalletConnectedError\n\t| TransactionError;\n","export const DEFAULT_NETWORK = 137;\n","import {\n\ttype SequenceOptions,\n\ttype Wallet,\n\tapple,\n\tcoinbaseWallet,\n\temail,\n\tfacebook,\n\tgetKitConnectWallets,\n\tgoogle,\n\tsequence,\n\ttwitch,\n\twalletConnect,\n} from '@0xsequence/kit';\nimport type { CreateConnectorFn } from 'wagmi';\nimport type { MarketplaceConfig, SdkConfig } from '../../../types';\nimport { DEFAULT_NETWORK } from '../consts';\n\nconst defaultNetwork = DEFAULT_NETWORK;\n\nexport function getUniversalConnectors(\n\tmarketplaceConfig: MarketplaceConfig,\n\tconfig: SdkConfig,\n): CreateConnectorFn[] {\n\tconst { projectAccessKey } = config;\n\tconst sequenceWalletOptions = {\n\t\tdefaultNetwork,\n\t\tconnect: {\n\t\t\tprojectAccessKey,\n\t\t\tapp: marketplaceConfig.title,\n\t\t\tsettings: {\n\t\t\t\tbannerUrl: marketplaceConfig.ogImage,\n\t\t\t},\n\t\t},\n\t};\n\tconst wallets = getWalletConfigs(\n\t\tmarketplaceConfig,\n\t\tsequenceWalletOptions,\n\t\tconfig.wallet?.walletConnectProjectId,\n\t);\n\tconst socialWallets = getSocialWalletConfigs(sequenceWalletOptions);\n\treturn getKitConnectWallets(projectAccessKey, [...socialWallets, ...wallets]);\n}\n\nfunction getWalletConfigs(\n\tmarketplaceConfig: MarketplaceConfig,\n\tsequenceWalletOptions: SequenceOptions,\n\twalletConnectProjectId?: string,\n): Wallet[] {\n\tconst wallets: Wallet[] = [];\n\n\t// Normalizing the wallet options, TODO: remove this after the marketplaceConfig is updated\n\tconst walletOptions = marketplaceConfig.walletOptionsNew || {\n\t\tconnectors: ['coinbase', 'walletconnect'],\n\t};\n\n\twallets.push(sequence(sequenceWalletOptions));\n\n\tif (walletOptions.connectors.includes('coinbase')) {\n\t\twallets.push(coinbaseWallet({ appName: marketplaceConfig.title }));\n\t}\n\n\tif (\n\t\twalletConnectProjectId &&\n\t\twalletOptions.connectors.includes('walletconnect')\n\t) {\n\t\twallets.push(walletConnect({ projectId: walletConnectProjectId }));\n\t}\n\n\treturn wallets;\n}\n\nfunction getSocialWalletConfigs(\n\tsequenceWalletOptions: SequenceOptions,\n): Wallet[] {\n\treturn [\n\t\temail(sequenceWalletOptions),\n\t\tfacebook(sequenceWalletOptions),\n\t\tgoogle(sequenceWalletOptions),\n\t\tapple(sequenceWalletOptions),\n\t\ttwitch(sequenceWalletOptions),\n\t] as const;\n}\n","import { queryOptions } from '@tanstack/react-query';\nimport type { Env, MarketplaceConfig, SdkConfig } from '../../../types';\nimport {\n\tMarketplaceConfigFetchError,\n\tProjectNotFoundError,\n} from '../../../utils/_internal/error/transaction';\nimport { builderMarketplaceApi, configKeys } from '../../_internal';\n\nconst fetchBuilderConfig = async (projectId: string, env: Env) => {\n\tconst url = `${builderMarketplaceApi(projectId, env)}`;\n\tconst response = await fetch(`${url}/config.json`);\n\n\tconst json = await response.json();\n\tif (!response.ok) {\n\t\tconsole.error('Failed to fetch marketplace config:', response.status, json);\n\t\t//@ts-ignore\n\t\tswitch (json.code) {\n\t\t\tcase 3000: // Throws 3000 if the project is not found\n\t\t\t\tthrow new ProjectNotFoundError(projectId, url);\n\t\t\tdefault:\n\t\t\t\t//@ts-ignore\n\t\t\t\tthrow new MarketplaceConfigFetchError(json.msg);\n\t\t}\n\t}\n\treturn json as MarketplaceConfig;\n};\n\nconst fetchStyles = async (projectId: string, env: Env) => {\n\tconst response = await fetch(\n\t\t`${builderMarketplaceApi(projectId, env)}/styles.css`,\n\t);\n\tconst styles = await response.text();\n\t// React sanitizes this string, so we need to remove all quotes, they are not needed anyway\n\treturn styles.replaceAll(/['\"]/g, '');\n};\n\nconst fetchMarketplaceConfig = async (\n\tenv: Env,\n\tprojectId: string,\n): Promise<MarketplaceConfig> => {\n\tconst [marketplaceConfig, cssString] = await Promise.all([\n\t\tfetchBuilderConfig(projectId, env),\n\t\tfetchStyles(projectId, env),\n\t]);\n\n\treturn {\n\t\t...marketplaceConfig,\n\t\tcssString,\n\t\tmanifestUrl: `${builderMarketplaceApi(projectId, env)}/manifest.json`,\n\t};\n};\n\nexport const marketplaceConfigOptions = (\n\tconfig: Pick<SdkConfig, 'projectId'> | SdkConfig,\n) => {\n\tlet env: Env = 'production';\n\tif ('_internal' in config && config._internal !== undefined) {\n\t\tenv = config._internal.builderEnv ?? env;\n\t}\n\n\tconst projectId = config.projectId;\n\treturn queryOptions({\n\t\tqueryKey: [...configKeys.marketplace, env, projectId],\n\t\tqueryFn: () => fetchMarketplaceConfig(env, projectId),\n\t});\n};\n","import { ChainId as NetworkChainId } from '@0xsequence/network';\nimport type { Address } from 'viem';\nimport { z } from 'zod';\nimport type { ContractType } from '../../types';\n\nexport const QueryArgSchema = z\n\t.object({\n\t\tenabled: z.boolean().optional(),\n\t})\n\t.optional();\n\nexport type QueryArg = z.infer<typeof QueryArgSchema>;\n\nexport const CollectableIdSchema = z.string().or(z.number());\n\nexport const ChainIdSchema = z.union([\n\tz.string(),\n\tz.number(),\n\tz.nativeEnum(NetworkChainId),\n]);\n\nexport const AddressSchema = z.string().transform((val, ctx) => {\n\tconst regex = /^0x[a-fA-F0-9]{40}$/;\n\n\tif (!regex.test(val)) {\n\t\tctx.addIssue({\n\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\tmessage: `Invalid Address ${val}`,\n\t\t});\n\t}\n\n\treturn val as Address;\n});\n\nexport type ChainId = z.infer<typeof ChainIdSchema>;\n\nexport type CollectionType = ContractType.ERC1155 | ContractType.ERC721;\n","// biome-ignore lint/complexity/noStaticOnlyClass:\nclass CollectableKeys {\n\tstatic all = ['collectable'] as const;\n\tstatic details = [...CollectableKeys.all, 'details'] as const;\n\tstatic lists = [...CollectableKeys.all, 'list'] as const;\n\tstatic floorOrders = [...CollectableKeys.all, 'floorOrders'] as const;\n\tstatic userBalances = [\n\t\t...CollectableKeys.all,\n\t\t...CollectableKeys.details,\n\t\t'userBalances',\n\t] as const;\n\tstatic royaltyPercentage = [\n\t\t...CollectableKeys.all,\n\t\t'royaltyPercentage',\n\t] as const;\n\tstatic highestOffers = [\n\t\t...CollectableKeys.all,\n\t\t...CollectableKeys.details,\n\t\t'highestOffers',\n\t] as const;\n\tstatic lowestListings = [\n\t\t...CollectableKeys.all,\n\t\t...CollectableKeys.details,\n\t\t'lowestListings',\n\t] as const;\n\tstatic offers = [...CollectableKeys.all, 'offers'] as const;\n\tstatic offersCount = [...CollectableKeys.all, 'offersCount'] as const;\n\tstatic listings = [...CollectableKeys.all, 'listings'] as const;\n\tstatic listingsCount = [...CollectableKeys.all, 'listingsCount'] as const;\n\tstatic filter = [...CollectableKeys.all, 'filter'] as const;\n\tstatic counts = [...CollectableKeys.all, 'counts'] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass:\nclass CollectionKeys {\n\tstatic all = ['collections'] as const;\n\tstatic list = [...CollectionKeys.all, 'list'] as const;\n\tstatic detail = [...CollectionKeys.all, 'detail'] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass:\nclass BalanceQueries {\n\tstatic all = ['balances'] as const;\n\tstatic lists = [...BalanceQueries.all, 'tokenBalances'] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass:\nclass CheckoutKeys {\n\tstatic all = ['checkouts'] as const;\n\tstatic options = [...CheckoutKeys.all, 'options'] as const;\n\tstatic cartItems = [...CheckoutKeys.all, 'cartItems'] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass:\nclass CurrencyKeys {\n\tstatic all = ['currencies'] as const;\n\tstatic lists = [...CurrencyKeys.all, 'list'] as const;\n\tstatic details = [...CurrencyKeys.all, 'details'] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass:\nclass ConfigKeys {\n\tstatic all = ['configs'] as const;\n\tstatic marketplace = [...ConfigKeys.all, 'marketplace'] as const;\n}\nexport const collectableKeys = CollectableKeys;\nexport const collectionKeys = CollectionKeys;\nexport const balanceQueries = BalanceQueries;\nexport const checkoutKeys = CheckoutKeys;\nexport const currencyKeys = CurrencyKeys;\nexport const configKeys = ConfigKeys;\n","import { SequenceIndexer } from '@0xsequence/indexer';\nimport { SequenceMetadata } from '@0xsequence/metadata';\nimport { networks, stringTemplate } from '@0xsequence/network';\nimport type { Env, SdkConfig } from '../../../types/sdk-config';\nimport { MissingConfigError } from '../../../utils/_internal/error/transaction';\nimport { SequenceMarketplace } from './marketplace-api';\n\nconst SERVICES = {\n\tsequenceApi: 'https://api.sequence.app',\n\tmetadata: 'https://${prefix}metadata.sequence.app',\n\tindexer: 'https://${prefix}${network}-indexer.sequence.app',\n\tmarketplaceApi: 'https://${prefix}marketplace-api.sequence.app/${network}',\n\timageProxy: 'https://imgproxy.sequence.xyz/',\n\tbuilderMarketplaceApi:\n\t\t'https://${prefix}api.sequence.build/marketplace/${projectId}',\n};\n\ntype ChainNameOrId = string | number;\n\nconst getNetwork = (nameOrId: ChainNameOrId) => {\n\tfor (const network of Object.values(networks)) {\n\t\tif (\n\t\t\tnetwork.name === String(nameOrId).toLowerCase() ||\n\t\t\tnetwork.chainId === Number(nameOrId)\n\t\t) {\n\t\t\treturn network;\n\t\t}\n\t}\n\tthrow new MissingConfigError(`Network configuration for chain ${nameOrId}`);\n};\n\nexport const imageProxy = stringTemplate(SERVICES.imageProxy, {});\nconst metadataURL = (env: Env = 'production') => {\n\tconst prefix = getPrefix(env);\n\treturn stringTemplate(SERVICES.metadata, { prefix });\n};\nconst indexerURL = (chain: ChainNameOrId, env: Env = 'production') => {\n\tconst prefix = getPrefix(env);\n\tconst network = getNetwork(chain).name;\n\treturn stringTemplate(SERVICES.indexer, { network: network, prefix });\n};\nconst marketplaceApiURL = (chain: ChainNameOrId, env: Env = 'production') => {\n\tconst prefix = getPrefix(env);\n\tconst network = getNetwork(chain).name;\n\treturn stringTemplate(SERVICES.marketplaceApi, { network: network, prefix });\n};\nexport const builderMarketplaceApi = (\n\tprojectId: string,\n\tenv: Env = 'production',\n) => {\n\tconst prefix = getPrefix(env);\n\treturn stringTemplate(SERVICES.builderMarketplaceApi, {\n\t\tprojectId,\n\t\tprefix,\n\t});\n};\nexport const getMetadataClient = (config: SdkConfig) => {\n\tconst env = config._internal?.metadataEnv || 'production';\n\tconst projectAccessKey = getAccessKey({ env, config });\n\treturn new SequenceMetadata(metadataURL(env), projectAccessKey);\n};\nexport const getIndexerClient = (chain: ChainNameOrId, config: SdkConfig) => {\n\tconst env = config._internal?.indexerEnv || 'production';\n\tconst projectAccessKey = getAccessKey({ env, config });\n\treturn new SequenceIndexer(indexerURL(chain, env), projectAccessKey);\n};\nexport const getMarketplaceClient = (\n\tchain: ChainNameOrId,\n\tconfig: SdkConfig,\n) => {\n\tconst env = config._internal?.marketplaceEnv || 'production';\n\tconst projectAccessKey = getAccessKey({ env, config });\n\treturn new SequenceMarketplace(\n\t\tmarketplaceApiURL(chain, env),\n\t\tprojectAccessKey,\n\t);\n};\nconst getAccessKey = ({ env, config }: { env: Env; config: SdkConfig }) => {\n\tswitch (env) {\n\t\tcase 'development':\n\t\t\tif (!config._internal?.devAccessKey)\n\t\t\t\tthrow new MissingConfigError('devAccessKey for development env');\n\t\t\treturn config._internal?.devAccessKey;\n\t\tcase 'production':\n\t\t\treturn config.projectAccessKey;\n\t\tcase 'next':\n\t\t\tif (!config._internal?.nextAccessKey)\n\t\t\t\tthrow new MissingConfigError('nextAccessKey for next env');\n\t\t\treturn config._internal?.nextAccessKey;\n\t}\n};\n\nconst getPrefix = (env: Env) => {\n\tswitch (env) {\n\t\tcase 'development':\n\t\t\treturn 'dev-';\n\t\tcase 'production':\n\t\t\treturn '';\n\t\tcase 'next':\n\t\t\treturn 'next-';\n\t}\n};\n"],"mappings":";AAAA,SAAqB,4BAA4B;;;ACAjD;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,SAAS,cAAc;AAEvB,SAAS,kBAAkB;AAC1B,SAAO,IAAI,YAAY;AAAA,IACtB,gBAAgB;AAAA,MACf,SAAS;AAAA,QACR,WAAW,KAAK;AAAA,QAChB,gBAAgB;AAAA,MACjB;AAAA,MACA,WAAW;AAAA,QACV,sBAAsB,CAAC,UACtB,4BAA4B,KAAK,KACjC,MAAM,MAAM,WAAW;AAAA,MACzB;AAAA,IACD;AAAA,EACD,CAAC;AACF;AAEA,IAAI,qBAA8C;AAE3C,SAAS,iBAAiB;AAChC,MAAI,OAAO,WAAW,aAAa,aAAa;AAC/C,WAAO,gBAAgB;AAAA,EACxB;AAEA,MAAI,CAAC,mBAAoB,sBAAqB,gBAAgB;AAC9D,SAAO;AACR;;;AC/BA,SAAS,wBAAwB;AACjC,SAAS,aAAa,yBAAyB;AAE/C,SAAS,MAAM,eAAe,cAA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AA,EACrD,CAAC;AACF;;;ARpDA,IAAM,oBAAoB,OAAO,WAAsB;AACtD,QAAM,cAAc,eAAe;AACnC,QAAM,gBAAgB,yBAAyB,MAAM;AACrD,SAAO,YAAY,WAAW,aAAa;AAC5C;AAEA,IAAM,eAAe,OAAO,SAAmD;AAC9E,QAAM,eAAe,MAAM,kBAAkB,KAAK,MAAM;AACxD,QAAM,cAAc,kBAAkB,cAAc,KAAK,QAAQ,IAAI;AACrE,SAAO,EAAE,OAAO,qBAAqB,aAAa,KAAK,MAAM,EAAE;AAChE;AAEO,IAAM,kBAAkB,CAAC,SAA4B;AAC3D,QAAM,uBAAuB,YAAY,kBAAkB,KAAK,MAAM;AACtE,QAAM,kBAAkB,YAAY,aAAa,IAAI;AACrD,QAAM,SAAS,KAAK;AACpB,SAAO,EAAE,iBAAiB,sBAAsB,OAAO;AACxD;","names":["marketplaceConfig","coinbaseWallet","getKitConnectWallets","walletConnect","marketplaceConfig","getKitConnectWallets","coinbaseWallet","walletConnect","marketplaceConfig","marketplaceConfig"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/react/ssr/create-ssr-client.ts","../../../src/react/_internal/api/get-query-client.ts","../../../src/react/_internal/wagmi/create-config.ts","../../../src/react/_internal/wagmi/embedded.ts","../../../src/utils/_internal/error/base.ts","../../../src/utils/_internal/error/transaction.ts","../../../src/react/_internal/consts.ts","../../../src/react/_internal/wagmi/universal.ts","../../../src/react/hooks/options/marketplaceConfigOptions.ts","../../../src/react/_internal/types.ts","../../../src/react/_internal/api/query-keys.ts","../../../src/react/_internal/api/services.ts"],"sourcesContent":["import { type State, cookieToInitialState } from 'wagmi';\nimport type { SdkConfig } from '../../types/sdk-config';\nimport { getQueryClient } from '../_internal/api/get-query-client';\nimport { createWagmiConfig } from '../_internal/wagmi/create-config';\nimport { marketplaceConfigOptions } from '../hooks/options/marketplaceConfigOptions';\n\ntype InitSSRClientArgs = {\n\tcookie: string;\n\tconfig: SdkConfig;\n};\n\ntype InitialState = { wagmi?: State };\n\nconst marketplaceConfig = async (config: SdkConfig) => {\n\tconst queryClient = getQueryClient();\n\tconst configOptions = marketplaceConfigOptions(config);\n\treturn queryClient.fetchQuery(configOptions);\n};\n\nconst initialState = async (args: InitSSRClientArgs): Promise<InitialState> => {\n\tconst marketConfig = await marketplaceConfig(args.config);\n\tconst wagmiConfig = createWagmiConfig(marketConfig, args.config, true);\n\treturn { wagmi: cookieToInitialState(wagmiConfig, args.cookie) };\n};\n\nexport const createSSRClient = (args: InitSSRClientArgs) => {\n\tconst getMarketplaceConfig = async () => marketplaceConfig(args.config);\n\tconst getInitialState = async () => initialState(args);\n\tconst config = args.config;\n\treturn { getInitialState, getMarketplaceConfig, config };\n};\n","import {\n\tQueryClient,\n\tdefaultShouldDehydrateQuery,\n} from '@tanstack/react-query';\nimport { hashFn } from 'wagmi/query';\n\nfunction makeQueryClient() {\n\treturn new QueryClient({\n\t\tdefaultOptions: {\n\t\t\tqueries: {\n\t\t\t\tstaleTime: 60 * 1000,\n\t\t\t\tqueryKeyHashFn: hashFn,\n\t\t\t},\n\t\t\tdehydrate: {\n\t\t\t\tshouldDehydrateQuery: (query) =>\n\t\t\t\t\tdefaultShouldDehydrateQuery(query) ||\n\t\t\t\t\tquery.state.status === 'pending',\n\t\t\t},\n\t\t},\n\t});\n}\n\nlet browserQueryClient: QueryClient | undefined = undefined;\n\nexport function getQueryClient() {\n\tif (typeof globalThis.document === 'undefined') {\n\t\treturn makeQueryClient();\n\t}\n\n\tif (!browserQueryClient) browserQueryClient = makeQueryClient();\n\treturn browserQueryClient;\n}\n","import { getDefaultChains } from '@0xsequence/kit';\nimport { allNetworks, findNetworkConfig } from '@0xsequence/network';\nimport type { Chain, Transport } from 'viem';\nimport { http, cookieStorage, createConfig, createStorage } from 'wagmi';\nimport type { MarketplaceConfig, SdkConfig } from '../../../types';\nimport { getWaasConnectors } from './embedded';\nimport { getUniversalConnectors } from './universal';\n\nexport const createWagmiConfig = (\n\tmarketplaceConfig: MarketplaceConfig,\n\tsdkConfig: SdkConfig,\n\tssr?: boolean,\n) => {\n\tconst chains = getChainConfigs(marketplaceConfig);\n\tconst transports = getTransportConfigs(chains, sdkConfig.projectAccessKey);\n\n\tconst walletType = sdkConfig.wallet?.embedded?.waasConfigKey\n\t\t? 'waas'\n\t\t: 'universal';\n\n\tconst connectors =\n\t\twalletType === 'universal'\n\t\t\t? getUniversalConnectors(marketplaceConfig, sdkConfig)\n\t\t\t: getWaasConnectors(marketplaceConfig, sdkConfig);\n\n\t// The old config did not support disabling EIP-6963 wallets\n\tconst includeEIP6963Wallets =\n\t\tmarketplaceConfig.walletOptionsNew?.includeEIP6963Wallets ?? true;\n\n\treturn createConfig({\n\t\tconnectors,\n\t\tchains,\n\t\tssr,\n\t\tmultiInjectedProviderDiscovery: includeEIP6963Wallets,\n\t\tstorage: ssr\n\t\t\t? createStorage({\n\t\t\t\t\tstorage: cookieStorage,\n\t\t\t\t})\n\t\t\t: undefined,\n\t\ttransports,\n\t});\n};\n\nfunction getChainConfigs(marketConfig: MarketplaceConfig): [Chain, ...Chain[]] {\n\tconst supportedChainIds = new Set(\n\t\tmarketConfig.collections.map((c) => c.chainId),\n\t);\n\treturn getDefaultChains([...supportedChainIds]);\n}\n\nfunction getTransportConfigs(\n\tchains: [Chain, ...Chain[]],\n\tprojectAccessKey: string,\n): Record<number, Transport> {\n\treturn chains.reduce(\n\t\t(acc, chain) => {\n\t\t\tconst network = findNetworkConfig(allNetworks, chain.id);\n\t\t\tif (network) {\n\t\t\t\tlet rpcUrl = network.rpcUrl;\n\t\t\t\tif (!network.rpcUrl.endsWith(projectAccessKey))\n\t\t\t\t\trpcUrl = `${rpcUrl}/${projectAccessKey}`;\n\t\t\t\tacc[chain.id] = http(rpcUrl);\n\t\t\t}\n\t\t\treturn acc;\n\t\t},\n\t\t{} as Record<number, Transport>,\n\t);\n}\n","import {\n\ttype Wallet,\n\tappleWaas,\n\tcoinbaseWallet,\n\temailWaas,\n\tgetKitConnectWallets,\n\tgoogleWaas,\n\twalletConnect,\n} from '@0xsequence/kit';\nimport type { CreateConnectorFn } from 'wagmi';\nimport type { MarketplaceConfig, SdkConfig } from '../../../types';\nimport { MissingConfigError } from '../../../utils/_internal/error/transaction';\nimport { DEFAULT_NETWORK } from '../consts';\n\nexport function getWaasConnectors(\n\tmarketplaceConfig: MarketplaceConfig,\n\tsdkConfig: SdkConfig,\n): CreateConnectorFn[] {\n\tconst { projectAccessKey } = sdkConfig;\n\n\tconst waasConfigKey = sdkConfig.wallet?.embedded?.waasConfigKey;\n\n\tif (!waasConfigKey) throw new MissingConfigError('waasConfigKey');\n\n\tconst walletConnectProjectId = sdkConfig.wallet?.walletConnectProjectId;\n\tconst { googleClientId, appleClientId, appleRedirectURI } =\n\t\tsdkConfig.wallet?.embedded || {};\n\n\tconst { title: appName } = marketplaceConfig;\n\n\t// Normalizing the wallet options, TODO: remove this after the marketplaceConfig is updated\n\tconst walletOptions = marketplaceConfig.walletOptionsNew || {\n\t\tconnectors: ['coinbase', 'walletconnect'],\n\t};\n\n\tconst wallets: Wallet[] = [\n\t\temailWaas({\n\t\t\tprojectAccessKey,\n\t\t\twaasConfigKey,\n\t\t\tnetwork: DEFAULT_NETWORK,\n\t\t}),\n\t];\n\n\tif (walletOptions.connectors.includes('coinbase')) {\n\t\twallets.push(\n\t\t\tcoinbaseWallet({\n\t\t\t\tappName,\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (\n\t\twalletConnectProjectId &&\n\t\twalletOptions.connectors.includes('walletconnect')\n\t) {\n\t\twallets.push(\n\t\t\twalletConnect({\n\t\t\t\tprojectId: walletConnectProjectId,\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (googleClientId) {\n\t\twallets.push(\n\t\t\tgoogleWaas({\n\t\t\t\tprojectAccessKey,\n\t\t\t\tgoogleClientId,\n\t\t\t\twaasConfigKey,\n\t\t\t\tnetwork: DEFAULT_NETWORK,\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (appleClientId) {\n\t\twallets.push(\n\t\t\tappleWaas({\n\t\t\t\tprojectAccessKey,\n\t\t\t\tappleClientId,\n\t\t\t\tappleRedirectURI,\n\t\t\t\twaasConfigKey,\n\t\t\t\tnetwork: DEFAULT_NETWORK,\n\t\t\t}),\n\t\t);\n\t}\n\n\treturn getKitConnectWallets(projectAccessKey, wallets);\n}\n","export type ErrorType<name extends string = 'Error'> = Error & { name: name };\n\nexport type Compute<type> = { [key in keyof type]: type[key] } & unknown;\n\ntype BaseErrorOptions = Compute<\n\t{ details?: string | undefined } | { cause: BaseError | Error }\n>;\n\nexport class BaseError extends Error {\n\tdetails: string;\n\tshortMessage: string;\n\n\tname = 'MarketplaceSdkBaseError';\n\n\tconstructor(shortMessage: string, options: BaseErrorOptions = {}) {\n\t\tsuper();\n\n\t\tconst details = 'details' in options ? options.details : '';\n\t\tthis.message = [\n\t\t\tshortMessage || 'An error occurred.',\n\t\t\t'',\n\t\t\t...(details ? [`Details: ${details}`] : []),\n\t\t].join('\\n');\n\n\t\tif ('cause' in options && options.cause) {\n\t\t\tthis.cause = options.cause;\n\t\t}\n\n\t\tthis.details = details || '';\n\t\tthis.shortMessage = shortMessage;\n\t}\n}\n","import { Address } from 'viem';\nimport { BaseError } from './base';\n\nexport type TransactionErrorType<name extends string = 'TransactionError'> =\n\tBaseError & { name: name };\n\nexport class TransactionError extends BaseError {\n\toverride name = 'TransactionError';\n}\n\nexport class ChainSwitchError extends TransactionError {\n\toverride name = 'ChainSwitchError';\n\tconstructor(currentChainId: number, targetChainId: number) {\n\t\tsuper(\n\t\t\t`Failed to switch network from ${currentChainId} to ${targetChainId}`,\n\t\t\t{\n\t\t\t\tdetails:\n\t\t\t\t\t'The user may have rejected the network switch or there might be a network connectivity issue.',\n\t\t\t},\n\t\t);\n\t}\n}\n\nexport class TransactionExecutionError extends TransactionError {\n\toverride name = 'TransactionExecutionError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to execute transaction step: ${stepId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction may have been rejected or failed during execution.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class TransactionSignatureError extends TransactionError {\n\toverride name = 'TransactionSignatureError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to sign transaction step: ${stepId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The signature request may have been rejected by the user.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class NoWalletConnectedError extends TransactionError {\n\toverride name = 'NoWalletConnectedError';\n\tconstructor() {\n\t\tsuper('No wallet connected', {\n\t\t\tdetails: 'Please connect your wallet before attempting this transaction.',\n\t\t});\n\t}\n}\n\nexport class NoMarketplaceConfigError extends TransactionError {\n\toverride name = 'NoMarketplaceConfigError';\n\tconstructor() {\n\t\tsuper('Marketplace configuration not found', {\n\t\t\tdetails:\n\t\t\t\t'The marketplace configuration is missing or invalid. This could be due to an initialization error.',\n\t\t});\n\t}\n}\n\nexport class UserRejectedRequestError extends TransactionError {\n\toverride name = 'UserRejectedRequestError';\n\tconstructor() {\n\t\tsuper('User rejected the request', {\n\t\t\tdetails: 'The user cancelled or rejected the transaction request.',\n\t\t});\n\t}\n}\n\nexport class InsufficientFundsError extends TransactionError {\n\toverride name = 'InsufficientFundsError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Insufficient funds for transaction', {\n\t\t\tdetails:\n\t\t\t\t'The wallet does not have enough funds to complete this transaction.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class StepExecutionError extends TransactionError {\n\toverride name = 'StepExecutionError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to execute step ${stepId})`, {\n\t\t\tdetails: cause?.message || 'The step execution failed unexpectedly.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class StepGenerationError extends TransactionError {\n\toverride name = 'StepGenerationError';\n\tconstructor(transactionType: string, cause?: Error) {\n\t\tsuper(`Failed to generate steps for ${transactionType}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message || 'Could not generate the required transaction steps.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class PaymentModalError extends TransactionError {\n\toverride name = 'PaymentModalError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Payment modal operation failed', {\n\t\t\tdetails:\n\t\t\t\tcause?.message || 'The payment modal operation was unsuccessful.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class InvalidStepError extends TransactionError {\n\toverride name = 'InvalidStepError';\n\tconstructor(stepId: string, reason: string) {\n\t\tsuper(`Invalid step configuration for ${stepId}`, {\n\t\t\tdetails: reason,\n\t\t});\n\t}\n}\n\nexport class TransactionConfirmationError extends TransactionError {\n\toverride name = 'TransactionConfirmationError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Failed to confirm transaction ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction could not be confirmed on the network.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class OrderNotFoundError extends TransactionError {\n\toverride name = 'OrderNotFoundError';\n\tconstructor(orderId: string) {\n\t\tsuper(`Order ${orderId} not found`, {\n\t\t\tdetails: 'The requested order could not be found in the marketplace.',\n\t\t});\n\t}\n}\n\nexport class MissingStepDataError extends TransactionError {\n\toverride name = 'MissingStepDataError';\n\tconstructor() {\n\t\tsuper('Step is missing required data', {\n\t\t\tdetails:\n\t\t\t\t'The transaction step is missing required \"to\" or \"signature\" data.',\n\t\t});\n\t}\n}\n\nexport class MissingSignatureDataError extends TransactionError {\n\toverride name = 'MissingSignatureDataError';\n\tconstructor() {\n\t\tsuper('Step is missing signature data', {\n\t\t\tdetails:\n\t\t\t\t'The signature step is missing required signature data configuration.',\n\t\t});\n\t}\n}\n\nexport class InvalidSignatureStepError extends TransactionError {\n\toverride name = 'InvalidSignatureStepError';\n\tconstructor(stepId: string) {\n\t\tsuper(`Invalid signature step type: ${stepId}`, {\n\t\t\tdetails: 'The signature step type is not supported.',\n\t\t});\n\t}\n}\n\nexport class MissingPostStepError extends TransactionError {\n\toverride name = 'MissingPostStepError';\n\tconstructor() {\n\t\tsuper('Missing post step configuration', {\n\t\t\tdetails:\n\t\t\t\t'The signature step is missing required post-step configuration.',\n\t\t});\n\t}\n}\n\nexport class UnexpectedStepsError extends TransactionError {\n\toverride name = 'UnexpectedStepsError';\n\tconstructor() {\n\t\tsuper('Unexpected steps found', {\n\t\t\tdetails: 'The transaction contains more steps than expected.',\n\t\t});\n\t}\n}\n\nexport class NoExecutionStepError extends TransactionError {\n\toverride name = 'NoExecutionStepError';\n\tconstructor() {\n\t\tsuper('No execution step found', {\n\t\t\tdetails: 'The transaction is missing the required execution step.',\n\t\t});\n\t}\n}\n\nexport class NoStepsFoundError extends TransactionError {\n\toverride name = 'NoStepsFoundError';\n\tconstructor() {\n\t\tsuper('No steps found', {\n\t\t\tdetails: 'The transaction contains no steps to execute.',\n\t\t});\n\t}\n}\n\nexport class UnknownTransactionTypeError extends TransactionError {\n\toverride name = 'UnknownTransactionTypeError';\n\tconstructor(type: string) {\n\t\tsuper(`Unknown transaction type: ${type}`, {\n\t\t\tdetails: 'The specified transaction type is not supported.',\n\t\t});\n\t}\n}\n\nexport class InvalidContractTypeError extends TransactionError {\n\toverride name = 'InvalidContractTypeError';\n\tconstructor(contractType: string | undefined) {\n\t\tsuper(`Invalid contract type: ${contractType}`, {\n\t\t\tdetails: 'The contract type must be either ERC721 or ERC1155.',\n\t\t});\n\t}\n}\n\nexport class CollectionNotFoundError extends TransactionError {\n\toverride name = 'CollectionNotFoundError';\n\tconstructor(collectionAddress: string) {\n\t\tsuper(`Collection not found: ${collectionAddress}`, {\n\t\t\tdetails:\n\t\t\t\t'The specified collection address could not be found in the marketplace configuration.',\n\t\t});\n\t}\n}\n\nexport class InvalidCurrencyOptionsError extends TransactionError {\n\toverride name = 'InvalidCurrencyOptionsError';\n\tconstructor(currencyOptions: Address[]) {\n\t\tsuper(`Invalid currency options: ${currencyOptions}`, {\n\t\t\tdetails:\n\t\t\t\t'The currency options must be an array of valid currency contract addresses.',\n\t\t});\n\t}\n}\n\nexport class ProjectNotFoundError extends TransactionError {\n\toverride name = 'ProjectNotFoundError';\n\tconstructor(projectId: string, url: string) {\n\t\tsuper(`Project not found`, {\n\t\t\tdetails: `Project id: ${projectId} not found at ${url}`,\n\t\t});\n\t}\n}\n\nexport class MarketplaceConfigFetchError extends TransactionError {\n\toverride name = 'MarketplaceConfigFetchError';\n\tconstructor(message: string) {\n\t\tsuper('Failed to fetch marketplace config', {\n\t\t\tdetails: message,\n\t\t});\n\t}\n}\n\nexport class MissingConfigError extends TransactionError {\n\toverride name = 'MissingConfigError';\n\tconstructor(configName: string) {\n\t\tsuper(`Missing required config: ${configName}`, {\n\t\t\tdetails: 'A required configuration parameter is missing.',\n\t\t});\n\t}\n}\n\nexport class TransactionValidationError extends TransactionError {\n\toverride name = 'TransactionValidationError';\n\tconstructor(reason: string) {\n\t\tsuper('Transaction validation failed', {\n\t\t\tdetails: reason,\n\t\t});\n\t}\n}\n\nexport class ChainIdUnavailableError extends TransactionError {\n\toverride name = 'ChainIdUnavailableError';\n\tconstructor() {\n\t\tsuper('Chain ID is not available', {\n\t\t\tdetails: 'Could not determine the current chain ID from the wallet.',\n\t\t});\n\t}\n}\n\nexport class TransactionReceiptError extends TransactionError {\n\toverride name = 'TransactionReceiptError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Failed to get transaction receipt for ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the transaction receipt from the network.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class PaymentModalTransactionError extends TransactionError {\n\toverride name = 'PaymentModalTransactionError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Payment modal transaction failed for ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction initiated from the payment modal failed.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class CheckoutOptionsError extends TransactionError {\n\toverride name = 'CheckoutOptionsError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Failed to get checkout options', {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the checkout options from the marketplace.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class OrdersFetchError extends TransactionError {\n\toverride name = 'OrdersFetchError';\n\tconstructor(orderId: string, cause?: Error) {\n\t\tsuper(`Failed to fetch order ${orderId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the order details from the marketplace.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport type TransactionErrorTypes =\n\t| ChainIdUnavailableError\n\t| TransactionReceiptError\n\t| PaymentModalTransactionError\n\t| CheckoutOptionsError\n\t| OrdersFetchError\n\t| TransactionConfirmationError\n\t| TransactionValidationError\n\t| MissingConfigError\n\t| MarketplaceConfigFetchError\n\t| ProjectNotFoundError\n\t| CollectionNotFoundError\n\t| InvalidCurrencyOptionsError\n\t| InvalidContractTypeError\n\t| UnknownTransactionTypeError\n\t| NoStepsFoundError\n\t| NoExecutionStepError\n\t| UnexpectedStepsError\n\t| MissingPostStepError\n\t| InvalidSignatureStepError\n\t| MissingSignatureDataError\n\t| MissingStepDataError\n\t| OrderNotFoundError\n\t| TransactionConfirmationError\n\t| InvalidStepError\n\t| PaymentModalError\n\t| StepGenerationError\n\t| StepExecutionError\n\t| UserRejectedRequestError\n\t| NoMarketplaceConfigError\n\t| InsufficientFundsError\n\t| ChainSwitchError\n\t| TransactionSignatureError\n\t| TransactionExecutionError\n\t| NoWalletConnectedError\n\t| TransactionError;\n","export const DEFAULT_NETWORK = 137;\n","import {\n\ttype SequenceOptions,\n\ttype Wallet,\n\tapple,\n\tcoinbaseWallet,\n\temail,\n\tfacebook,\n\tgetKitConnectWallets,\n\tgoogle,\n\tsequence,\n\ttwitch,\n\twalletConnect,\n} from '@0xsequence/kit';\nimport type { CreateConnectorFn } from 'wagmi';\nimport type { MarketplaceConfig, SdkConfig } from '../../../types';\nimport { DEFAULT_NETWORK } from '../consts';\n\nconst defaultNetwork = DEFAULT_NETWORK;\n\nexport function getUniversalConnectors(\n\tmarketplaceConfig: MarketplaceConfig,\n\tconfig: SdkConfig,\n): CreateConnectorFn[] {\n\tconst { projectAccessKey } = config;\n\tconst sequenceWalletOptions = {\n\t\tdefaultNetwork,\n\t\tconnect: {\n\t\t\tprojectAccessKey,\n\t\t\tapp: marketplaceConfig.title,\n\t\t\tsettings: {\n\t\t\t\tbannerUrl: marketplaceConfig.ogImage,\n\t\t\t},\n\t\t},\n\t};\n\tconst wallets = getWalletConfigs(\n\t\tmarketplaceConfig,\n\t\tsequenceWalletOptions,\n\t\tconfig.wallet?.walletConnectProjectId,\n\t);\n\tconst socialWallets = getSocialWalletConfigs(sequenceWalletOptions);\n\treturn getKitConnectWallets(projectAccessKey, [...socialWallets, ...wallets]);\n}\n\nfunction getWalletConfigs(\n\tmarketplaceConfig: MarketplaceConfig,\n\tsequenceWalletOptions: SequenceOptions,\n\twalletConnectProjectId?: string,\n): Wallet[] {\n\tconst wallets: Wallet[] = [];\n\n\t// Normalizing the wallet options, TODO: remove this after the marketplaceConfig is updated\n\tconst walletOptions = marketplaceConfig.walletOptionsNew || {\n\t\tconnectors: ['coinbase', 'walletconnect'],\n\t};\n\n\twallets.push(sequence(sequenceWalletOptions));\n\n\tif (walletOptions.connectors.includes('coinbase')) {\n\t\twallets.push(coinbaseWallet({ appName: marketplaceConfig.title }));\n\t}\n\n\tif (\n\t\twalletConnectProjectId &&\n\t\twalletOptions.connectors.includes('walletconnect')\n\t) {\n\t\twallets.push(walletConnect({ projectId: walletConnectProjectId }));\n\t}\n\n\treturn wallets;\n}\n\nfunction getSocialWalletConfigs(\n\tsequenceWalletOptions: SequenceOptions,\n): Wallet[] {\n\treturn [\n\t\temail(sequenceWalletOptions),\n\t\tfacebook(sequenceWalletOptions),\n\t\tgoogle(sequenceWalletOptions),\n\t\tapple(sequenceWalletOptions),\n\t\ttwitch(sequenceWalletOptions),\n\t] as const;\n}\n","import { queryOptions } from '@tanstack/react-query';\nimport type { Env, MarketplaceConfig, SdkConfig } from '../../../types';\nimport {\n\tMarketplaceConfigFetchError,\n\tProjectNotFoundError,\n} from '../../../utils/_internal/error/transaction';\nimport { builderMarketplaceApi, configKeys } from '../../_internal';\n\nconst fetchBuilderConfig = async (projectId: string, env: Env) => {\n\tconst url = `${builderMarketplaceApi(projectId, env)}`;\n\tconst response = await fetch(`${url}/config.json`);\n\n\tconst json = await response.json();\n\tif (!response.ok) {\n\t\tconsole.error('Failed to fetch marketplace config:', response.status, json);\n\t\t//@ts-ignore\n\t\tswitch (json.code) {\n\t\t\tcase 3000: // Throws 3000 if the project is not found\n\t\t\t\tthrow new ProjectNotFoundError(projectId, url);\n\t\t\tdefault:\n\t\t\t\t//@ts-ignore\n\t\t\t\tthrow new MarketplaceConfigFetchError(json.msg);\n\t\t}\n\t}\n\treturn json as MarketplaceConfig;\n};\n\nconst fetchStyles = async (projectId: string, env: Env) => {\n\tconst response = await fetch(\n\t\t`${builderMarketplaceApi(projectId, env)}/styles.css`,\n\t);\n\tconst styles = await response.text();\n\t// React sanitizes this string, so we need to remove all quotes, they are not needed anyway\n\treturn styles.replaceAll(/['\"]/g, '');\n};\n\nconst fetchMarketplaceConfig = async (\n\tenv: Env,\n\tprojectId: string,\n): Promise<MarketplaceConfig> => {\n\tconst [marketplaceConfig, cssString] = await Promise.all([\n\t\tfetchBuilderConfig(projectId, env),\n\t\tfetchStyles(projectId, env),\n\t]);\n\n\treturn {\n\t\t...marketplaceConfig,\n\t\tcssString,\n\t\tmanifestUrl: `${builderMarketplaceApi(projectId, env)}/manifest.json`,\n\t};\n};\n\nexport const marketplaceConfigOptions = (\n\tconfig: Pick<SdkConfig, 'projectId'> | SdkConfig,\n) => {\n\tlet env: Env = 'production';\n\tif ('_internal' in config && config._internal !== undefined) {\n\t\tenv = config._internal.builderEnv ?? env;\n\t}\n\n\tconst projectId = config.projectId;\n\treturn queryOptions({\n\t\tqueryKey: [...configKeys.marketplace, env, projectId],\n\t\tqueryFn: () => fetchMarketplaceConfig(env, projectId),\n\t});\n};\n","import { ChainId as NetworkChainId } from '@0xsequence/network';\nimport type { Address } from 'viem';\nimport { z } from 'zod';\nimport type { ContractType } from '../../types';\n\nexport const QueryArgSchema = z\n\t.object({\n\t\tenabled: z.boolean().optional(),\n\t})\n\t.optional();\n\nexport type QueryArg = z.infer<typeof QueryArgSchema>;\n\nexport const CollectableIdSchema = z.string().or(z.number());\n\nexport const ChainIdSchema = z.union([\n\tz.string(),\n\tz.number(),\n\tz.nativeEnum(NetworkChainId),\n]);\n\nexport const AddressSchema = z.string().transform((val, ctx) => {\n\tconst regex = /^0x[a-fA-F0-9]{40}$/;\n\n\tif (!regex.test(val)) {\n\t\tctx.addIssue({\n\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\tmessage: `Invalid Address ${val}`,\n\t\t});\n\t}\n\n\treturn val as Address;\n});\n\nexport type ChainId = z.infer<typeof ChainIdSchema>;\n\nexport type CollectionType = ContractType.ERC1155 | ContractType.ERC721;\n","// biome-ignore lint/complexity/noStaticOnlyClass:\nclass CollectableKeys {\n\tstatic all = ['collectable'] as const;\n\tstatic details = [...CollectableKeys.all, 'details'] as const;\n\tstatic lists = [...CollectableKeys.all, 'list'] as const;\n\tstatic floorOrders = [...CollectableKeys.all, 'floorOrders'] as const;\n\tstatic userBalances = [\n\t\t...CollectableKeys.all,\n\t\t...CollectableKeys.details,\n\t\t'userBalances',\n\t] as const;\n\tstatic royaltyPercentage = [\n\t\t...CollectableKeys.all,\n\t\t'royaltyPercentage',\n\t] as const;\n\tstatic highestOffers = [\n\t\t...CollectableKeys.all,\n\t\t...CollectableKeys.details,\n\t\t'highestOffers',\n\t] as const;\n\tstatic lowestListings = [\n\t\t...CollectableKeys.all,\n\t\t...CollectableKeys.details,\n\t\t'lowestListings',\n\t] as const;\n\tstatic offers = [...CollectableKeys.all, 'offers'] as const;\n\tstatic offersCount = [...CollectableKeys.all, 'offersCount'] as const;\n\tstatic listings = [...CollectableKeys.all, 'listings'] as const;\n\tstatic listingsCount = [...CollectableKeys.all, 'listingsCount'] as const;\n\tstatic filter = [...CollectableKeys.all, 'filter'] as const;\n\tstatic counts = [...CollectableKeys.all, 'counts'] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass:\nclass CollectionKeys {\n\tstatic all = ['collections'] as const;\n\tstatic list = [...CollectionKeys.all, 'list'] as const;\n\tstatic detail = [...CollectionKeys.all, 'detail'] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass:\nclass BalanceQueries {\n\tstatic all = ['balances'] as const;\n\tstatic lists = [...BalanceQueries.all, 'tokenBalances'] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass:\nclass CheckoutKeys {\n\tstatic all = ['checkouts'] as const;\n\tstatic options = [...CheckoutKeys.all, 'options'] as const;\n\tstatic cartItems = [...CheckoutKeys.all, 'cartItems'] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass:\nclass CurrencyKeys {\n\tstatic all = ['currencies'] as const;\n\tstatic lists = [...CurrencyKeys.all, 'list'] as const;\n\tstatic details = [...CurrencyKeys.all, 'details'] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass:\nclass ConfigKeys {\n\tstatic all = ['configs'] as const;\n\tstatic marketplace = [...ConfigKeys.all, 'marketplace'] as const;\n}\nexport const collectableKeys = CollectableKeys;\nexport const collectionKeys = CollectionKeys;\nexport const balanceQueries = BalanceQueries;\nexport const checkoutKeys = CheckoutKeys;\nexport const currencyKeys = CurrencyKeys;\nexport const configKeys = ConfigKeys;\n","import { SequenceIndexer } from '@0xsequence/indexer';\nimport { SequenceMetadata } from '@0xsequence/metadata';\nimport { networks, stringTemplate } from '@0xsequence/network';\nimport type { Env, SdkConfig } from '../../../types/sdk-config';\nimport { MissingConfigError } from '../../../utils/_internal/error/transaction';\nimport { SequenceMarketplace } from './marketplace-api';\n\nconst SERVICES = {\n\tsequenceApi: 'https://api.sequence.app',\n\tmetadata: 'https://${prefix}metadata.sequence.app',\n\tindexer: 'https://${prefix}${network}-indexer.sequence.app',\n\tmarketplaceApi: 'https://${prefix}marketplace-api.sequence.app/${network}',\n\timageProxy: 'https://imgproxy.sequence.xyz/',\n\tbuilderMarketplaceApi:\n\t\t'https://${prefix}api.sequence.build/marketplace/${projectId}',\n};\n\ntype ChainNameOrId = string | number;\n\nconst getNetwork = (nameOrId: ChainNameOrId) => {\n\tfor (const network of Object.values(networks)) {\n\t\tif (\n\t\t\tnetwork.name === String(nameOrId).toLowerCase() ||\n\t\t\tnetwork.chainId === Number(nameOrId)\n\t\t) {\n\t\t\treturn network;\n\t\t}\n\t}\n\tthrow new MissingConfigError(`Network configuration for chain ${nameOrId}`);\n};\n\nexport const imageProxy = stringTemplate(SERVICES.imageProxy, {});\nconst metadataURL = (env: Env = 'production') => {\n\tconst prefix = getPrefix(env);\n\treturn stringTemplate(SERVICES.metadata, { prefix });\n};\nconst indexerURL = (chain: ChainNameOrId, env: Env = 'production') => {\n\tconst prefix = getPrefix(env);\n\tconst network = getNetwork(chain).name;\n\treturn stringTemplate(SERVICES.indexer, { network: network, prefix });\n};\nconst marketplaceApiURL = (chain: ChainNameOrId, env: Env = 'production') => {\n\tconst prefix = getPrefix(env);\n\tconst network = getNetwork(chain).name;\n\treturn stringTemplate(SERVICES.marketplaceApi, { network: network, prefix });\n};\nexport const builderMarketplaceApi = (\n\tprojectId: string,\n\tenv: Env = 'production',\n) => {\n\tconst prefix = getPrefix(env);\n\treturn stringTemplate(SERVICES.builderMarketplaceApi, {\n\t\tprojectId,\n\t\tprefix,\n\t});\n};\nexport const getMetadataClient = (config: SdkConfig) => {\n\tconst env = config._internal?.metadataEnv || 'production';\n\tconst projectAccessKey = getAccessKey({ env, config });\n\treturn new SequenceMetadata(metadataURL(env), projectAccessKey);\n};\nexport const getIndexerClient = (chain: ChainNameOrId, config: SdkConfig) => {\n\tconst env = config._internal?.indexerEnv || 'production';\n\tconst projectAccessKey = getAccessKey({ env, config });\n\treturn new SequenceIndexer(indexerURL(chain, env), projectAccessKey);\n};\nexport const getMarketplaceClient = (\n\tchain: ChainNameOrId,\n\tconfig: SdkConfig,\n) => {\n\tconst env = config._internal?.marketplaceEnv || 'production';\n\tconst projectAccessKey = getAccessKey({ env, config });\n\treturn new SequenceMarketplace(\n\t\tmarketplaceApiURL(chain, env),\n\t\tprojectAccessKey,\n\t);\n};\nconst getAccessKey = ({ env, config }: { env: Env; config: SdkConfig }) => {\n\tswitch (env) {\n\t\tcase 'development':\n\t\t\tif (!config._internal?.devAccessKey)\n\t\t\t\tthrow new MissingConfigError('devAccessKey for development env');\n\t\t\treturn config._internal?.devAccessKey;\n\t\tcase 'production':\n\t\t\treturn config.projectAccessKey;\n\t\tcase 'next':\n\t\t\tif (!config._internal?.nextAccessKey)\n\t\t\t\tthrow new MissingConfigError('nextAccessKey for next env');\n\t\t\treturn config._internal?.nextAccessKey;\n\t}\n};\n\nconst getPrefix = (env: Env) => {\n\tswitch (env) {\n\t\tcase 'development':\n\t\t\treturn 'dev-';\n\t\tcase 'production':\n\t\t\treturn '';\n\t\tcase 'next':\n\t\t\treturn 'next-';\n\t}\n};\n"],"mappings":";AAAA,SAAqB,4BAA4B;;;ACAjD;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,SAAS,cAAc;AAEvB,SAAS,kBAAkB;AAC1B,SAAO,IAAI,YAAY;AAAA,IACtB,gBAAgB;AAAA,MACf,SAAS;AAAA,QACR,WAAW,KAAK;AAAA,QAChB,gBAAgB;AAAA,MACjB;AAAA,MACA,WAAW;AAAA,QACV,sBAAsB,CAAC,UACtB,4BAA4B,KAAK,KACjC,MAAM,MAAM,WAAW;AAAA,MACzB;AAAA,IACD;AAAA,EACD,CAAC;AACF;AAEA,IAAI,qBAA8C;AAE3C,SAAS,iBAAi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e,UAAU,OAAO,cAAc,QAAW;AAC5D,UAAM,OAAO,UAAU,cAAc;AAAA,EACtC;AAEA,QAAM,YAAY,OAAO;AACzB,SAAO,aAAa;AAAA,IACnB,UAAU,CAAC,GAAG,WAAW,aAAa,KAAK,SAAS;AAAA,IACpD,SAAS,MAAM,uBAAuB,KAAK,SAAS;AAAA,EACrD,CAAC;AACF;;;ARpDA,IAAM,oBAAoB,OAAO,WAAsB;AACtD,QAAM,cAAc,eAAe;AACnC,QAAM,gBAAgB,yBAAyB,MAAM;AACrD,SAAO,YAAY,WAAW,aAAa;AAC5C;AAEA,IAAM,eAAe,OAAO,SAAmD;AAC9E,QAAM,eAAe,MAAM,kBAAkB,KAAK,MAAM;AACxD,QAAM,cAAc,kBAAkB,cAAc,KAAK,QAAQ,IAAI;AACrE,SAAO,EAAE,OAAO,qBAAqB,aAAa,KAAK,MAAM,EAAE;AAChE;AAEO,IAAM,kBAAkB,CAAC,SAA4B;AAC3D,QAAM,uBAAuB,YAAY,kBAAkB,KAAK,MAAM;AACtE,QAAM,kBAAkB,YAAY,aAAa,IAAI;AACrD,QAAM,SAAS,KAAK;AACpB,SAAO,EAAE,iBAAiB,sBAAsB,OAAO;AACxD;","names":["marketplaceConfig","coinbaseWallet","getKitConnectWallets","walletConnect","marketplaceConfig","getKitConnectWallets","coinbaseWallet","walletConnect","marketplaceConfig","marketplaceConfig"]}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
CollectibleCard
|
|
4
|
-
} from "../../../chunk-
|
|
4
|
+
} from "../../../chunk-RJTMPFSZ.js";
|
|
5
5
|
import "../../../chunk-NMCGA2TB.js";
|
|
6
6
|
import "../../../chunk-FFCNYF3S.js";
|
|
7
7
|
import "../../../chunk-L6GSYPCR.js";
|
|
8
8
|
import "../../../chunk-O642NH7U.js";
|
|
9
|
-
import "../../../chunk-
|
|
9
|
+
import "../../../chunk-NS5J356Z.js";
|
|
10
10
|
import "../../../chunk-Y7YO5TLE.js";
|
|
11
11
|
import "../../../chunk-7NJETFMF.js";
|
|
12
12
|
import "../../../chunk-SBVLWSRZ.js";
|
|
13
13
|
import "../../../chunk-NJ2GXOPW.js";
|
|
14
14
|
import "../../../chunk-MJ4YU7RW.js";
|
|
15
|
-
import "../../../chunk-
|
|
15
|
+
import "../../../chunk-KRMV6FJE.js";
|
|
16
16
|
import "../../../chunk-MCI3KOSQ.js";
|
|
17
|
-
import "../../../chunk-3OHM45R3.js";
|
|
18
17
|
import "../../../chunk-WFE6OCYF.js";
|
|
18
|
+
import "../../../chunk-3OHM45R3.js";
|
|
19
19
|
import "../../../chunk-Q2BVDQ3G.js";
|
|
20
|
-
import "../../../chunk-
|
|
21
|
-
import "../../../chunk-
|
|
22
|
-
import "../../../chunk-
|
|
20
|
+
import "../../../chunk-3LOJQCTV.js";
|
|
21
|
+
import "../../../chunk-Z7NLKEXF.js";
|
|
22
|
+
import "../../../chunk-E3ZFT6WR.js";
|
|
23
23
|
export {
|
|
24
24
|
CollectibleCard
|
|
25
25
|
};
|
package/dist/react/ui/index.js
CHANGED
|
@@ -8,25 +8,25 @@ import {
|
|
|
8
8
|
useSellModal,
|
|
9
9
|
useSuccessfulPurchaseModal,
|
|
10
10
|
useTransferModal
|
|
11
|
-
} from "../../chunk-
|
|
11
|
+
} from "../../chunk-RJTMPFSZ.js";
|
|
12
12
|
import "../../chunk-NMCGA2TB.js";
|
|
13
13
|
import "../../chunk-FFCNYF3S.js";
|
|
14
14
|
import "../../chunk-L6GSYPCR.js";
|
|
15
15
|
import "../../chunk-O642NH7U.js";
|
|
16
|
-
import "../../chunk-
|
|
16
|
+
import "../../chunk-NS5J356Z.js";
|
|
17
17
|
import "../../chunk-Y7YO5TLE.js";
|
|
18
18
|
import "../../chunk-7NJETFMF.js";
|
|
19
19
|
import "../../chunk-SBVLWSRZ.js";
|
|
20
20
|
import "../../chunk-NJ2GXOPW.js";
|
|
21
21
|
import "../../chunk-MJ4YU7RW.js";
|
|
22
|
-
import "../../chunk-
|
|
22
|
+
import "../../chunk-KRMV6FJE.js";
|
|
23
23
|
import "../../chunk-MCI3KOSQ.js";
|
|
24
|
-
import "../../chunk-3OHM45R3.js";
|
|
25
24
|
import "../../chunk-WFE6OCYF.js";
|
|
25
|
+
import "../../chunk-3OHM45R3.js";
|
|
26
26
|
import "../../chunk-Q2BVDQ3G.js";
|
|
27
|
-
import "../../chunk-
|
|
28
|
-
import "../../chunk-
|
|
29
|
-
import "../../chunk-
|
|
27
|
+
import "../../chunk-3LOJQCTV.js";
|
|
28
|
+
import "../../chunk-Z7NLKEXF.js";
|
|
29
|
+
import "../../chunk-E3ZFT6WR.js";
|
|
30
30
|
export {
|
|
31
31
|
CollectibleCard,
|
|
32
32
|
ModalProvider,
|
|
@@ -13,9 +13,9 @@ import {
|
|
|
13
13
|
} from "../../../../../../chunk-O642NH7U.js";
|
|
14
14
|
import "../../../../../../chunk-NJ2GXOPW.js";
|
|
15
15
|
import "../../../../../../chunk-Q2BVDQ3G.js";
|
|
16
|
-
import "../../../../../../chunk-
|
|
17
|
-
import "../../../../../../chunk-
|
|
18
|
-
import "../../../../../../chunk-
|
|
16
|
+
import "../../../../../../chunk-3LOJQCTV.js";
|
|
17
|
+
import "../../../../../../chunk-Z7NLKEXF.js";
|
|
18
|
+
import "../../../../../../chunk-E3ZFT6WR.js";
|
|
19
19
|
export {
|
|
20
20
|
ActionModal,
|
|
21
21
|
closeButton,
|
package/dist/types/index.js
CHANGED
|
@@ -17,9 +17,9 @@ import {
|
|
|
17
17
|
StepType,
|
|
18
18
|
TransactionCrypto,
|
|
19
19
|
WalletKind
|
|
20
|
-
} from "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
20
|
+
} from "../chunk-3LOJQCTV.js";
|
|
21
|
+
import "../chunk-Z7NLKEXF.js";
|
|
22
|
+
import "../chunk-E3ZFT6WR.js";
|
|
23
23
|
export {
|
|
24
24
|
CollectibleStatus,
|
|
25
25
|
CollectionStatus,
|
package/dist/utils/abi/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import "../../chunk-MCI3KOSQ.js";
|
|
3
|
-
import {
|
|
4
|
-
EIP2981_ABI,
|
|
5
|
-
SequenceMarketplaceV1_ABI,
|
|
6
|
-
SequenceMarketplaceV2_ABI
|
|
7
|
-
} from "../../chunk-3OHM45R3.js";
|
|
8
3
|
import {
|
|
9
4
|
ERC1155_ABI,
|
|
10
5
|
ERC20_ABI,
|
|
11
6
|
ERC721_ABI
|
|
12
7
|
} from "../../chunk-WFE6OCYF.js";
|
|
8
|
+
import {
|
|
9
|
+
EIP2981_ABI,
|
|
10
|
+
SequenceMarketplaceV1_ABI,
|
|
11
|
+
SequenceMarketplaceV2_ABI
|
|
12
|
+
} from "../../chunk-3OHM45R3.js";
|
|
13
13
|
export {
|
|
14
14
|
EIP2981_ABI,
|
|
15
15
|
ERC1155_ABI,
|
package/dist/utils/index.js
CHANGED
|
@@ -6,19 +6,19 @@ import {
|
|
|
6
6
|
getPublicRpcClient,
|
|
7
7
|
truncateEnd,
|
|
8
8
|
truncateMiddle
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-KRMV6FJE.js";
|
|
10
10
|
import "../chunk-MCI3KOSQ.js";
|
|
11
|
-
import {
|
|
12
|
-
EIP2981_ABI,
|
|
13
|
-
SequenceMarketplaceV1_ABI,
|
|
14
|
-
SequenceMarketplaceV2_ABI
|
|
15
|
-
} from "../chunk-3OHM45R3.js";
|
|
16
11
|
import {
|
|
17
12
|
ERC1155_ABI,
|
|
18
13
|
ERC20_ABI,
|
|
19
14
|
ERC721_ABI
|
|
20
15
|
} from "../chunk-WFE6OCYF.js";
|
|
21
|
-
import
|
|
16
|
+
import {
|
|
17
|
+
EIP2981_ABI,
|
|
18
|
+
SequenceMarketplaceV1_ABI,
|
|
19
|
+
SequenceMarketplaceV2_ABI
|
|
20
|
+
} from "../chunk-3OHM45R3.js";
|
|
21
|
+
import "../chunk-E3ZFT6WR.js";
|
|
22
22
|
export {
|
|
23
23
|
EIP2981_ABI,
|
|
24
24
|
ERC1155_ABI,
|
package/package.json
CHANGED
|
@@ -278,7 +278,8 @@ export class TransactionMachine {
|
|
|
278
278
|
|
|
279
279
|
case TransactionType.LISTING:
|
|
280
280
|
if (!this.config.config.orderbookKind) {
|
|
281
|
-
this.config.config.orderbookKind =
|
|
281
|
+
this.config.config.orderbookKind =
|
|
282
|
+
OrderbookKind.sequence_marketplace_v2;
|
|
282
283
|
}
|
|
283
284
|
|
|
284
285
|
return await this.marketplaceClient
|
|
@@ -294,9 +295,10 @@ export class TransactionMachine {
|
|
|
294
295
|
|
|
295
296
|
case TransactionType.OFFER:
|
|
296
297
|
if (!this.config.config.orderbookKind) {
|
|
297
|
-
this.config.config.orderbookKind =
|
|
298
|
+
this.config.config.orderbookKind =
|
|
299
|
+
OrderbookKind.sequence_marketplace_v2;
|
|
298
300
|
}
|
|
299
|
-
|
|
301
|
+
|
|
300
302
|
return await this.marketplaceClient
|
|
301
303
|
.generateOfferTransaction({
|
|
302
304
|
collectionAddress,
|
package/src/react/hooks/index.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './useCollectible';
|
|
|
4
4
|
export * from './useCollection';
|
|
5
5
|
export * from './useConfig';
|
|
6
6
|
export * from './useCurrencies';
|
|
7
|
+
export * from './useCurrencyOptions';
|
|
7
8
|
export * from './useCurrency';
|
|
8
9
|
export * from './useFilters';
|
|
9
10
|
export * from './useFloorOrder';
|
|
@@ -11,7 +11,8 @@ import {
|
|
|
11
11
|
|
|
12
12
|
type UseBuyOrderError = TransactionErrorTypes;
|
|
13
13
|
|
|
14
|
-
interface UseBuyOrderArgs
|
|
14
|
+
interface UseBuyOrderArgs
|
|
15
|
+
extends Omit<UseTransactionMachineConfig, 'type' | 'orderbookKind'> {
|
|
15
16
|
onSuccess?: (hash: Hash) => void;
|
|
16
17
|
onError?: (error: UseBuyOrderError) => void;
|
|
17
18
|
onTransactionSent?: (hash: string) => void;
|
|
@@ -7,7 +7,8 @@ import {
|
|
|
7
7
|
useTransactionMachine,
|
|
8
8
|
} from '../_internal/transaction-machine/useTransactionMachine';
|
|
9
9
|
|
|
10
|
-
interface UseCancelOrderArgs
|
|
10
|
+
interface UseCancelOrderArgs
|
|
11
|
+
extends Omit<UseTransactionMachineConfig, 'type' | 'orderbookKind'> {
|
|
11
12
|
onSuccess?: (hash: string) => void;
|
|
12
13
|
onError?: (error: Error) => void;
|
|
13
14
|
onTransactionSent?: (hash: string) => void;
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
import { queryOptions, useQuery } from '@tanstack/react-query';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
import type {
|
|
4
|
-
import {
|
|
3
|
+
import type { SdkConfig } from '../../types';
|
|
4
|
+
import { InvalidCurrencyOptionsError } from '../../utils/_internal/error/transaction';
|
|
5
5
|
import {
|
|
6
6
|
AddressSchema,
|
|
7
7
|
type ChainId,
|
|
8
8
|
ChainIdSchema,
|
|
9
9
|
type Currency,
|
|
10
10
|
QueryArgSchema,
|
|
11
|
-
configKeys,
|
|
12
11
|
currencyKeys,
|
|
13
12
|
getMarketplaceClient,
|
|
14
|
-
getQueryClient,
|
|
15
13
|
} from '../_internal';
|
|
16
14
|
import { useConfig } from './useConfig';
|
|
17
|
-
import { zeroAddress } from 'viem';
|
|
15
|
+
import { toHex, zeroAddress } from 'viem';
|
|
18
16
|
|
|
19
17
|
const ChainIdCoerce = ChainIdSchema.transform((val) => val.toString());
|
|
20
18
|
|
|
21
19
|
const UseCurrenciesArgsSchema = z.object({
|
|
22
20
|
chainId: ChainIdCoerce,
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
includeNativeCurrency: z.boolean().optional().default(true),
|
|
22
|
+
currencyOptions: z.array(AddressSchema).optional(),
|
|
25
23
|
query: QueryArgSchema,
|
|
26
24
|
});
|
|
27
25
|
|
|
@@ -41,27 +39,22 @@ const fetchCurrencies = async (chainId: ChainId, config: SdkConfig) => {
|
|
|
41
39
|
);
|
|
42
40
|
};
|
|
43
41
|
|
|
44
|
-
const selectCurrencies = (
|
|
42
|
+
const selectCurrencies = (
|
|
43
|
+
data: Currency[],
|
|
44
|
+
args: UseCurrenciesArgs
|
|
45
|
+
) => {
|
|
46
|
+
console.debug('[selectCurrencies]: Select Currencies Input:', { data, args });
|
|
45
47
|
const argsParsed = UseCurrenciesArgsSchema.parse(args);
|
|
46
48
|
// if collectionAddress is passed, filter currencies based on collection currency options
|
|
47
|
-
if (argsParsed.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
queryKey: configKeys.marketplace,
|
|
51
|
-
})[0][1] as MarketplaceConfig;
|
|
52
|
-
|
|
53
|
-
const collection = marketplaceConfigCache?.collections.find(
|
|
54
|
-
(collection) =>
|
|
55
|
-
collection.collectionAddress === argsParsed.collectionAddress,
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
if (!collection) {
|
|
59
|
-
throw new CollectionNotFoundError(argsParsed.collectionAddress!);
|
|
49
|
+
if (argsParsed.currencyOptions) {
|
|
50
|
+
if (!argsParsed.currencyOptions) {
|
|
51
|
+
throw new InvalidCurrencyOptionsError(argsParsed.currencyOptions);
|
|
60
52
|
}
|
|
61
53
|
|
|
54
|
+
|
|
62
55
|
return data.filter(
|
|
63
56
|
(currency) =>
|
|
64
|
-
|
|
57
|
+
argsParsed.currencyOptions?.includes(toHex(currency.contractAddress)) ||
|
|
65
58
|
// biome-ignore lint/suspicious/noDoubleEquals: <explanation>
|
|
66
59
|
currency.nativeCurrency == argsParsed.includeNativeCurrency ||
|
|
67
60
|
currency.defaultChainCurrency,
|
|
@@ -91,5 +84,6 @@ export const currenciesOptions = (
|
|
|
91
84
|
|
|
92
85
|
export const useCurrencies = (args: UseCurrenciesArgs) => {
|
|
93
86
|
const config = useConfig();
|
|
87
|
+
|
|
94
88
|
return useQuery(currenciesOptions(args, config));
|
|
95
89
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { useMarketplaceConfig } from './useMarketplaceConfig';
|
|
3
|
+
|
|
4
|
+
export default function useCurrencyOptions({
|
|
5
|
+
collectionAddress,
|
|
6
|
+
}: {
|
|
7
|
+
collectionAddress: Address;
|
|
8
|
+
}) {
|
|
9
|
+
const { data: marketplaceConfig } = useMarketplaceConfig();
|
|
10
|
+
const collections = marketplaceConfig?.collections; // array
|
|
11
|
+
const currencyOptions = collections?.find(
|
|
12
|
+
(collection) => collection.collectionAddress === collectionAddress,
|
|
13
|
+
)?.currencyOptions;
|
|
14
|
+
|
|
15
|
+
return currencyOptions;
|
|
16
|
+
}
|