@0xsequence/marketplace-sdk 0.3.1 → 0.3.3

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.
Files changed (43) hide show
  1. package/dist/{chunk-O7UQGT43.js → chunk-RJK7PUJE.js} +13 -5
  2. package/dist/{chunk-O7UQGT43.js.map → chunk-RJK7PUJE.js.map} +1 -1
  3. package/dist/{chunk-WA433WAJ.js → chunk-RZSZNVEH.js} +16 -2
  4. package/dist/chunk-RZSZNVEH.js.map +1 -0
  5. package/dist/{chunk-22NLQ3AS.js → chunk-ZZMM3IVS.js} +296 -197
  6. package/dist/chunk-ZZMM3IVS.js.map +1 -0
  7. package/dist/index.css +40 -0
  8. package/dist/index.js +71 -158
  9. package/dist/react/hooks/index.js +2 -2
  10. package/dist/react/index.js +4 -4
  11. package/dist/react/ui/components/index.d.ts +1 -1
  12. package/dist/react/ui/components/index.js +4 -4
  13. package/dist/react/ui/index.js +4 -4
  14. package/dist/styles/index.css +40 -0
  15. package/dist/styles/index.css.map +1 -1
  16. package/dist/styles/index.d.ts +8 -1
  17. package/dist/styles/index.js +13 -1
  18. package/package.json +5 -2
  19. package/src/react/_internal/transaction-machine/execute-transaction.ts +14 -3
  20. package/src/react/ui/components/_internals/custom-select/CustomSelect.tsx +2 -2
  21. package/src/react/ui/components/collectible-card/CollectibleCard.tsx +2 -2
  22. package/src/react/ui/components/collectible-card/Footer.tsx +33 -29
  23. package/src/react/ui/modals/BuyModal/_store.ts +4 -1
  24. package/src/react/ui/modals/BuyModal/index.tsx +77 -49
  25. package/src/react/ui/modals/CreateListingModal/index.tsx +10 -6
  26. package/src/react/ui/modals/MakeOfferModal/index.tsx +11 -3
  27. package/src/react/ui/modals/SellModal/index.tsx +14 -6
  28. package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx +2 -1
  29. package/src/react/ui/modals/TransferModal/_views/followWalletInstructions/index.tsx +1 -1
  30. package/src/react/ui/modals/_internal/components/alertMessage/index.tsx +1 -1
  31. package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +2 -7
  32. package/src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx +1 -0
  33. package/src/react/ui/modals/_internal/components/floorPriceText/index.tsx +1 -0
  34. package/src/react/ui/modals/_internal/components/transaction-footer/index.tsx +30 -9
  35. package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +2 -2
  36. package/src/react/ui/modals/_internal/components/transactionHeader/index.tsx +14 -2
  37. package/src/react/ui/modals/_internal/components/transactionPreview/index.tsx +16 -4
  38. package/src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx +12 -4
  39. package/src/styles/index.ts +3 -0
  40. package/tsup.config.ts +3 -0
  41. package/dist/chess-tile-6BS5MQT5.png +0 -0
  42. package/dist/chunk-22NLQ3AS.js.map +0 -1
  43. package/dist/chunk-WA433WAJ.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/react/hooks/useBalanceOfCollectible.tsx","../src/react/hooks/useConfig.tsx","../src/react/provider.tsx","../src/react/hooks/useCountOfCollectables.tsx","../src/react/_internal/api/zod-schema.ts","../src/react/hooks/useCollectible.tsx","../src/react/hooks/useCollection.tsx","../src/react/hooks/useCurrencies.tsx","../src/react/hooks/useCurrency.tsx","../src/react/hooks/useFilters.tsx","../src/react/hooks/useFloorOrder.tsx","../src/react/hooks/useHighestOffer.tsx","../src/react/hooks/useListBalances.tsx","../src/react/hooks/useListCollectibles.tsx","../src/react/hooks/useListOffersForCollectible.tsx","../src/react/hooks/useListListingsForCollectible.tsx","../src/react/hooks/useLowestListing.tsx","../src/react/hooks/useMarketplaceConfig.tsx","../src/react/hooks/options/marketplaceConfigOptions.ts","../src/react/hooks/useRoyaltyPercentage.tsx","../src/react/hooks/useGenerateListingTransaction.tsx","../src/react/hooks/useGenerateOfferTransaction.tsx","../src/react/hooks/useGenerateSellTransaction.tsx","../src/react/hooks/useGenerateCancelTransaction.tsx","../src/react/hooks/useTransferTokens.tsx","../src/react/hooks/useCheckoutOptions.tsx","../src/react/hooks/useListCollections.tsx","../src/react/hooks/useGenerateBuyTransaction.tsx","../src/react/_internal/transaction-machine/execute-transaction.ts","../src/react/_internal/transaction-machine/useTransactionMachine.ts","../src/react/ui/modals/_internal/components/switchChainModal/index.tsx","../src/react/ui/modals/_internal/components/alertMessage/index.tsx","../src/react/ui/modals/_internal/components/switchChainModal/store.ts","../src/react/hooks/useCancelOrder.tsx","../src/react/hooks/useBuyCollectable.tsx"],"sourcesContent":["import { queryOptions, skipToken, useQuery } from '@tanstack/react-query';\nimport type { Hex } from 'viem';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tCollectableIdSchema,\n\ttype QueryArgSchema,\n\tcollectableKeys,\n\tgetIndexerClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nconst fetchBalanceOfCollectibleSchema = z.object({\n\tcollectionAddress: AddressSchema,\n\tcollectableId: CollectableIdSchema.pipe(z.coerce.string()),\n\tuserAddress: AddressSchema,\n\tchainId: ChainIdSchema.pipe(z.coerce.number()),\n});\n\ntype FetchBalanceOfCollectibleArgs = z.input<\n\ttypeof fetchBalanceOfCollectibleSchema\n>;\n\nconst fetchBalanceOfCollectible = async (\n\targs: FetchBalanceOfCollectibleArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst parsedArgs = fetchBalanceOfCollectibleSchema.parse(args);\n\tconst indexerClient = getIndexerClient(parsedArgs.chainId, config);\n\treturn indexerClient\n\t\t.getTokenBalances({\n\t\t\taccountAddress: parsedArgs.userAddress,\n\t\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\t\ttokenID: parsedArgs.collectableId,\n\t\t\tincludeMetadata: false,\n\t\t\tmetadataOptions: {\n\t\t\t\tverifiedOnly: true,\n\t\t\t\tincludeContracts: [parsedArgs.collectionAddress],\n\t\t\t},\n\t\t})\n\t\t.then((res) => res.balances[0] || null);\n};\n\ninterface BalanceOfCollectibleOptions\n\textends Omit<FetchBalanceOfCollectibleArgs, 'userAddress'> {\n\tuserAddress: Hex | undefined;\n\tquery?: z.infer<typeof QueryArgSchema>;\n}\nexport const balanceOfCollectibleOptions = (\n\targs: BalanceOfCollectibleOptions,\n\tconfig: SdkConfig,\n) => {\n\tconst enabled = !!args.userAddress && (args.query?.enabled ?? true);\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.userBalances, args],\n\t\tqueryFn: enabled\n\t\t\t? () =>\n\t\t\t\t\tfetchBalanceOfCollectible(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...args,\n\t\t\t\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: this is guaranteed by the userAddress check above\n\t\t\t\t\t\t\tuserAddress: args.userAddress!,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tconfig,\n\t\t\t\t\t)\n\t\t\t: skipToken,\n\t\tenabled,\n\t});\n};\n\nexport const useBalanceOfCollectible = (args: BalanceOfCollectibleOptions) => {\n\tconst config = useConfig();\n\treturn useQuery(balanceOfCollectibleOptions(args, config));\n};\n","'use client';\n\nimport { useContext } from 'react';\n\nimport { MarketplaceSdkContext } from '../provider';\n\nexport function useConfig() {\n\tconst context = useContext(MarketplaceSdkContext);\n\tif (!context) {\n\t\tthrow new Error(\n\t\t\t'Marketplace SDK must be used within a MarketplaceSdkProvider',\n\t\t);\n\t}\n\treturn context;\n}\n","'use client';\n\nimport { createContext } from 'react';\nimport '@0xsequence/design-system/styles.css';\nimport type { SdkConfig } from '../types';\nimport { PROVIDER_ID } from './_internal/get-provider';\n\nexport const MarketplaceSdkContext = createContext({} as SdkConfig);\n\nexport type MarketplaceSdkProviderProps = {\n\tconfig: SdkConfig;\n\tchildren: React.ReactNode;\n};\n\nexport function MarketplaceProvider({\n\tconfig,\n\tchildren,\n}: MarketplaceSdkProviderProps) {\n\treturn (\n\t\t<MarketplaceSdkContext.Provider value={config}>\n\t\t\t<div id={PROVIDER_ID}>{children}</div>\n\t\t</MarketplaceSdkContext.Provider>\n\t);\n}\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tOrderSide,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { collectiblesFilterSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst BaseSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tquery: QueryArgSchema,\n});\n\nconst UseCountOfCollectableSchema = BaseSchema.extend({\n\tfilter: collectiblesFilterSchema,\n\tside: z.nativeEnum(OrderSide),\n}).or(\n\tBaseSchema.extend({\n\t\tfilter: z.undefined(),\n\t\tside: z.undefined(),\n\t}),\n);\n\nexport type UseCountOfCollectablesArgs = z.infer<\n\ttypeof UseCountOfCollectableSchema\n>;\n\nexport type UseContOfCollectableReturn = Awaited<\n\tReturnType<typeof fetchCountOfCollectables>\n>;\n\nconst fetchCountOfCollectables = async (\n\targs: UseCountOfCollectablesArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst parsedArgs = UseCountOfCollectableSchema.parse(args);\n\tconst marketplaceClient = getMarketplaceClient(parsedArgs.chainId, config);\n\tif (parsedArgs.filter) {\n\t\treturn marketplaceClient\n\t\t\t.getCountOfFilteredCollectibles({\n\t\t\t\t...parsedArgs,\n\t\t\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: safe to assert here, as it's validated\n\t\t\t\tside: parsedArgs.side!,\n\t\t\t})\n\t\t\t.then((resp) => resp.count);\n\t}\n\treturn marketplaceClient\n\t\t.getCountOfAllCollectibles({\n\t\t\t...parsedArgs,\n\t\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\t})\n\t\t.then((resp) => resp.count);\n};\n\nexport const countOfCollectablesOptions = (\n\targs: UseCountOfCollectablesArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.counts, args],\n\t\tqueryFn: () => fetchCountOfCollectables(args, config),\n\t});\n};\n\nexport const useCountOfCollectables = (args: UseCountOfCollectablesArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(countOfCollectablesOptions(args, config));\n};\n","// generated with https://transform.tools/typescript-to-zod\n//\n//\nimport { z } from 'zod';\nimport {\n\tCollectibleStatus,\n\tCollectionStatus,\n\tContractType,\n\tExecuteType,\n\tMarketplaceKind,\n\tOrderSide,\n\tOrderStatus,\n\tOrderbookKind,\n\tProjectStatus,\n\tPropertyType,\n\tSortOrder,\n\tSourceKind,\n\tStepType,\n\tTransactionCrypto,\n\tTransactionNFTCheckoutProvider,\n\tTransactionOnRampProvider,\n\tTransactionSwapProvider,\n\tWalletKind,\n} from './marketplace.gen';\n\nexport const assetSchema = z.object({\n\tid: z.number(),\n\tcollectionId: z.number(),\n\ttokenId: z.string(),\n\turl: z.string().optional(),\n\tmetadataField: z.string(),\n\tname: z.string().optional(),\n\tfilesize: z.number().optional(),\n\tmimeType: z.string().optional(),\n\twidth: z.number().optional(),\n\theight: z.number().optional(),\n\tupdatedAt: z.string().optional(),\n});\n\nexport const sortOrderSchema = z.nativeEnum(SortOrder);\n\nexport const propertyTypeSchema = z.nativeEnum(PropertyType);\n\nexport const marketplaceKindSchema = z.nativeEnum(MarketplaceKind);\n\nexport const orderbookKindSchema = z.nativeEnum(OrderbookKind);\n\nexport const sourceKindSchema = z.nativeEnum(SourceKind);\n\nexport const orderSideSchema = z.nativeEnum(OrderSide);\n\nexport const orderStatusSchema = z.nativeEnum(OrderStatus);\n\nexport const contractTypeSchema = z.nativeEnum(ContractType);\n\nexport const collectionStatusSchema = z.nativeEnum(CollectionStatus);\n\nexport const projectStatusSchema = z.nativeEnum(ProjectStatus);\n\nexport const collectibleStatusSchema = z.nativeEnum(CollectibleStatus);\n\nexport const walletKindSchema = z.nativeEnum(WalletKind);\n\nexport const stepTypeSchema = z.nativeEnum(StepType);\n\nexport const transactionCryptoSchema = z.nativeEnum(TransactionCrypto);\n\nexport const transactionNFTCheckoutProviderSchema = z.nativeEnum(\n\tTransactionNFTCheckoutProvider,\n);\n\nexport const transactionOnRampProviderSchema = z.nativeEnum(\n\tTransactionOnRampProvider,\n);\n\nexport const transactionSwapProviderSchema = z.nativeEnum(\n\tTransactionSwapProvider,\n);\n\nexport const executeTypeSchema = z.nativeEnum(ExecuteType);\n\nexport const sortBySchema = z.object({\n\tcolumn: z.string(),\n\torder: sortOrderSchema,\n});\n\nexport const propertyFilterSchema = z.object({\n\tname: z.string(),\n\ttype: propertyTypeSchema,\n\tmin: z.number().optional(),\n\tmax: z.number().optional(),\n\tvalues: z.array(z.any()).optional(),\n});\n\nexport const collectiblesFilterSchema = z.object({\n\tincludeEmpty: z.boolean(),\n\tsearchText: z.string().optional(),\n\tproperties: z.array(propertyFilterSchema).optional(),\n\tmarketplaces: z.array(marketplaceKindSchema).optional(),\n\tinAccounts: z.array(z.string()).optional(),\n\tnotInAccounts: z.array(z.string()).optional(),\n\tordersCreatedBy: z.array(z.string()).optional(),\n\tordersNotCreatedBy: z.array(z.string()).optional(),\n});\n\nexport const feeBreakdownSchema = z.object({\n\tkind: z.string(),\n\trecipientAddress: z.string(),\n\tbps: z.number(),\n});\n\nexport const orderFilterSchema = z.object({\n\tcreatedBy: z.array(z.string()).optional(),\n\tmarketplace: z.array(marketplaceKindSchema).optional(),\n\tcurrencies: z.array(z.string()).optional(),\n});\n\nexport const collectionLastSyncedSchema = z.object({\n\tallOrders: z.string(),\n\tnewOrders: z.string(),\n});\n\nexport const projectSchema = z.object({\n\tprojectId: z.number(),\n\tchainId: z.number(),\n\tcontractAddress: z.string(),\n\tstatus: projectStatusSchema,\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().optional(),\n});\n\nexport const collectibleSchema = z.object({\n\tchainId: z.number(),\n\tcontractAddress: z.string(),\n\tstatus: collectibleStatusSchema,\n\ttokenId: z.string(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().optional(),\n});\n\nexport const currencySchema = z.object({\n\tchainId: z.number(),\n\tcontractAddress: z.string(),\n\tname: z.string(),\n\tsymbol: z.string(),\n\tdecimals: z.number(),\n\timageUrl: z.string(),\n\texchangeRate: z.number(),\n\tdefaultChainCurrency: z.boolean(),\n\tnativeCurrency: z.boolean(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().optional(),\n});\n\nexport const orderDataSchema = z.object({\n\torderId: z.string(),\n\tquantity: z.string(),\n});\n\nexport const additionalFeeSchema = z.object({\n\tamount: z.string(),\n\treceiver: z.string(),\n});\n\nexport const postRequestSchema = z.object({\n\tendpoint: z.string(),\n\tmethod: z.string(),\n\tbody: z.any(),\n});\n\nexport const createReqSchema = z.object({\n\ttokenId: z.string(),\n\tquantity: z.string(),\n\texpiry: z.string(),\n\tcurrencyAddress: z.string(),\n\tpricePerToken: z.string(),\n});\n\nexport const getOrdersInputSchema = z.object({\n\tcontractAddress: z.string(),\n\torderId: z.string(),\n\tmarketplace: marketplaceKindSchema,\n});\n\nexport const domainSchema = z.object({\n\tname: z.string(),\n\tversion: z.string(),\n\tchainId: z.number(),\n\tverifyingContract: z.string(),\n});\n\nexport const checkoutOptionsMarketplaceOrderSchema = z.object({\n\tcontractAddress: z.string(),\n\torderId: z.string(),\n\tmarketplace: marketplaceKindSchema,\n});\n\nexport const checkoutOptionsItemSchema = z.object({\n\ttokenId: z.string(),\n\tquantity: z.string(),\n});\n\nexport const checkoutOptionsSchema = z.object({\n\tcrypto: transactionCryptoSchema,\n\tswap: z.array(transactionSwapProviderSchema),\n\tnftCheckout: z.array(transactionNFTCheckoutProviderSchema),\n\tonRamp: z.array(transactionOnRampProviderSchema),\n});\n\nexport const listCurrenciesArgsSchema = z.object({});\n\nexport const listCurrenciesReturnSchema = z.object({\n\tcurrencies: z.array(currencySchema),\n});\n\nexport const getCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n});\n\nexport const getLowestPriceOfferForCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const getHighestPriceOfferForCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const getLowestPriceListingForCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const getHighestPriceListingForCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const getCollectibleLowestOfferArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const getCollectibleHighestOfferArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const getCollectibleLowestListingArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilters: orderFilterSchema.optional(),\n});\n\nexport const getCollectibleHighestListingArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const generateBuyTransactionArgsSchema = z.object({\n\tcollectionAddress: z.string(),\n\tbuyer: z.string(),\n\tmarketplace: marketplaceKindSchema,\n\tordersData: z.array(orderDataSchema),\n\tadditionalFees: z.array(additionalFeeSchema),\n\twalletType: walletKindSchema.optional(),\n});\n\nexport const generateSellTransactionArgsSchema = z.object({\n\tcollectionAddress: z.string(),\n\tseller: z.string(),\n\tmarketplace: marketplaceKindSchema,\n\tordersData: z.array(orderDataSchema),\n\tadditionalFees: z.array(additionalFeeSchema),\n\twalletType: walletKindSchema.optional(),\n});\n\nexport const generateListingTransactionArgsSchema = z.object({\n\tcollectionAddress: z.string(),\n\towner: z.string(),\n\tcontractType: contractTypeSchema,\n\torderbook: orderbookKindSchema,\n\tlisting: createReqSchema,\n\twalletType: walletKindSchema.optional(),\n});\n\nexport const generateOfferTransactionArgsSchema = z.object({\n\tcollectionAddress: z.string(),\n\tmaker: z.string(),\n\tcontractType: contractTypeSchema,\n\torderbook: orderbookKindSchema,\n\toffer: createReqSchema,\n\twalletType: walletKindSchema.optional(),\n});\n\nexport const executeArgsSchema = z.object({\n\tsignature: z.string(),\n\texecuteType: executeTypeSchema,\n\tbody: z.any(),\n});\n\nexport const executeReturnSchema = z.object({\n\torderId: z.string(),\n});\n\nexport const getCountOfAllCollectiblesArgsSchema = z.object({\n\tcontractAddress: z.string(),\n});\n\nexport const getCountOfAllCollectiblesReturnSchema = z.object({\n\tcount: z.number(),\n});\n\nexport const getCountOfFilteredCollectiblesArgsSchema = z.object({\n\tside: orderSideSchema,\n\tcontractAddress: z.string(),\n\tfilter: collectiblesFilterSchema.optional(),\n});\n\nexport const getCountOfFilteredCollectiblesReturnSchema = z.object({\n\tcount: z.number(),\n});\n\nexport const getFloorOrderArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\tfilter: collectiblesFilterSchema.optional(),\n});\n\nexport const syncOrderReturnSchema = z.object({});\n\nexport const syncOrdersReturnSchema = z.object({});\n\nexport const checkoutOptionsMarketplaceArgsSchema = z.object({\n\twallet: z.string(),\n\torders: z.array(checkoutOptionsMarketplaceOrderSchema),\n\tadditionalFee: z.number(),\n});\n\nexport const checkoutOptionsMarketplaceReturnSchema = z.object({\n\toptions: checkoutOptionsSchema,\n});\n\nexport const checkoutOptionsSalesContractArgsSchema = z.object({\n\twallet: z.string(),\n\tcontractAddress: z.string(),\n\tcollectionAddress: z.string(),\n\titems: z.array(checkoutOptionsItemSchema),\n});\n\nexport const checkoutOptionsSalesContractReturnSchema = z.object({\n\toptions: checkoutOptionsSchema,\n});\n\nexport const tokenMetadataSchema = z.object({\n\ttokenId: z.string(),\n\tname: z.string(),\n\tdescription: z.string().optional(),\n\timage: z.string().optional(),\n\tvideo: z.string().optional(),\n\taudio: z.string().optional(),\n\tproperties: z.record(z.any()).optional(),\n\tattributes: z.array(z.record(z.any())),\n\timage_data: z.string().optional(),\n\texternal_url: z.string().optional(),\n\tbackground_color: z.string().optional(),\n\tanimation_url: z.string().optional(),\n\tdecimals: z.number().optional(),\n\tupdatedAt: z.string().optional(),\n\tassets: z.array(assetSchema).optional(),\n});\n\nexport const pageSchema = z.object({\n\tpage: z.number(),\n\tpageSize: z.number(),\n\tmore: z.boolean().optional(),\n\tsort: z.array(sortBySchema).optional(),\n});\n\nexport const filterSchema = z.object({\n\ttext: z.string().optional(),\n\tproperties: z.array(propertyFilterSchema).optional(),\n});\n\nexport const orderSchema = z.object({\n\torderId: z.string(),\n\tmarketplace: marketplaceKindSchema,\n\tside: orderSideSchema,\n\tstatus: orderStatusSchema,\n\tchainId: z.number(),\n\tcollectionContractAddress: z.string(),\n\ttokenId: z.string(),\n\tcreatedBy: z.string(),\n\tpriceAmount: z.string(),\n\tpriceAmountFormatted: z.string(),\n\tpriceAmountNet: z.string(),\n\tpriceAmountNetFormatted: z.string(),\n\tpriceCurrencyAddress: z.string(),\n\tpriceDecimals: z.number(),\n\tpriceUSD: z.number(),\n\tquantityInitial: z.string(),\n\tquantityInitialFormatted: z.string(),\n\tquantityRemaining: z.string(),\n\tquantityRemainingFormatted: z.string(),\n\tquantityAvailable: z.string(),\n\tquantityAvailableFormatted: z.string(),\n\tquantityDecimals: z.number(),\n\tfeeBps: z.number(),\n\tfeeBreakdown: z.array(feeBreakdownSchema),\n\tvalidFrom: z.string(),\n\tvalidUntil: z.string(),\n\tblockNumber: z.number(),\n\torderCreatedAt: z.string().optional(),\n\torderUpdatedAt: z.string().optional(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().optional(),\n});\n\nexport const collectibleOrderSchema = z.object({\n\tmetadata: tokenMetadataSchema,\n\torder: orderSchema.optional(),\n});\n\nexport const activitySchema = z.object({\n\ttype: z.string(),\n\tfromAddress: z.string(),\n\ttoAddress: z.string(),\n\ttxHash: z.string(),\n\ttimestamp: z.number(),\n\ttokenId: z.string(),\n\ttokenImage: z.string(),\n\ttokenName: z.string(),\n\tcurrency: currencySchema.optional(),\n});\n\nexport const collectionConfigSchema = z.object({\n\tlastSynced: z.record(collectionLastSyncedSchema),\n\tcollectiblesSynced: z.string(),\n});\n\nexport const signatureSchema = z.object({\n\tdomain: domainSchema,\n\ttypes: z.any(),\n\tprimaryType: z.string(),\n\tvalue: z.any(),\n});\n\nexport const getCollectibleReturnSchema = z.object({\n\tmetadata: tokenMetadataSchema,\n});\n\nexport const getLowestPriceOfferForCollectibleReturnSchema = z.object({\n\torder: orderSchema,\n});\n\nexport const getHighestPriceOfferForCollectibleReturnSchema = z.object({\n\torder: orderSchema,\n});\n\nexport const getLowestPriceListingForCollectibleReturnSchema = z.object({\n\torder: orderSchema,\n});\n\nexport const getHighestPriceListingForCollectibleReturnSchema = z.object({\n\torder: orderSchema,\n});\n\nexport const listListingsForCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listListingsForCollectibleReturnSchema = z.object({\n\tlistings: z.array(orderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const listOffersForCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listOffersForCollectibleReturnSchema = z.object({\n\toffers: z.array(orderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const getCollectibleLowestOfferReturnSchema = z.object({\n\torder: orderSchema.optional(),\n});\n\nexport const getCollectibleHighestOfferReturnSchema = z.object({\n\torder: orderSchema.optional(),\n});\n\nexport const getCollectibleLowestListingReturnSchema = z.object({\n\torder: orderSchema.optional(),\n});\n\nexport const getCollectibleHighestListingReturnSchema = z.object({\n\torder: orderSchema.optional(),\n});\n\nexport const listCollectibleListingsArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectibleListingsReturnSchema = z.object({\n\tlistings: z.array(orderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectibleOffersArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectibleOffersReturnSchema = z.object({\n\toffers: z.array(orderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectiblesArgsSchema = z.object({\n\tside: orderSideSchema,\n\tcontractAddress: z.string(),\n\tfilter: collectiblesFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectiblesReturnSchema = z.object({\n\tcollectibles: z.array(collectibleOrderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const getFloorOrderReturnSchema = z.object({\n\tcollectible: collectibleOrderSchema,\n});\n\nexport const listCollectiblesWithLowestListingArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\tfilter: collectiblesFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectiblesWithLowestListingReturnSchema = z.object({\n\tcollectibles: z.array(collectibleOrderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectiblesWithHighestOfferArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\tfilter: collectiblesFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectiblesWithHighestOfferReturnSchema = z.object({\n\tcollectibles: z.array(collectibleOrderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const syncOrderArgsSchema = z.object({\n\torder: orderSchema,\n});\n\nexport const syncOrdersArgsSchema = z.object({\n\torders: z.array(orderSchema),\n});\n\nexport const getOrdersArgsSchema = z.object({\n\tinput: z.array(getOrdersInputSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const getOrdersReturnSchema = z.object({\n\torders: z.array(orderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const collectionSchema = z.object({\n\tstatus: collectionStatusSchema,\n\tchainId: z.number(),\n\tcontractAddress: z.string(),\n\tcontractType: contractTypeSchema,\n\ttokenQuantityDecimals: z.number(),\n\tconfig: collectionConfigSchema,\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().optional(),\n});\n\nexport const stepSchema = z.object({\n\tid: stepTypeSchema,\n\tdata: z.string(),\n\tto: z.string(),\n\tvalue: z.string(),\n\tsignature: signatureSchema.optional(),\n\tpost: postRequestSchema.optional(),\n\texecuteType: executeTypeSchema.optional(),\n});\n\nexport const generateBuyTransactionReturnSchema = z.object({\n\tsteps: z.array(stepSchema),\n});\n\nexport const generateSellTransactionReturnSchema = z.object({\n\tsteps: z.array(stepSchema),\n});\n\nexport const generateListingTransactionReturnSchema = z.object({\n\tsteps: z.array(stepSchema),\n});\n\nexport const generateOfferTransactionReturnSchema = z.object({\n\tsteps: z.array(stepSchema),\n});\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMetadataClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nconst UseCollectibleSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tcollectibleId: z.string(),\n\tquery: QueryArgSchema,\n});\n\nexport type UseCollectibleArgs = z.infer<typeof UseCollectibleSchema>;\n\nexport type UseCollectibleReturn = Awaited<ReturnType<typeof fetchCollectible>>;\n\nconst fetchCollectible = async (\n\targs: UseCollectibleArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst parsedArgs = UseCollectibleSchema.parse(args);\n\tconst metadataClient = getMetadataClient(config);\n\treturn metadataClient\n\t\t.getTokenMetadata({\n\t\t\tchainID: parsedArgs.chainId,\n\t\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\t\ttokenIDs: [parsedArgs.collectibleId],\n\t\t})\n\t\t.then((resp) => resp.tokenMetadata[0]);\n};\n\nexport const collectibleOptions = (\n\targs: UseCollectibleArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.details, args, config],\n\t\tqueryFn: () => fetchCollectible(args, config),\n\t});\n};\n\nexport const useCollectible = (args: UseCollectibleArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(collectibleOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectionKeys,\n\tgetMetadataClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nconst UseCollectionSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tquery: QueryArgSchema,\n});\n\nexport type UseCollectionArgs = z.input<typeof UseCollectionSchema>;\n\nexport type UseCollectionReturn = Awaited<ReturnType<typeof fetchCollection>>;\n\nconst fetchCollection = async (args: UseCollectionArgs, config: SdkConfig) => {\n\tconst parsedArgs = UseCollectionSchema.parse(args);\n\tconst metadataClient = getMetadataClient(config);\n\treturn metadataClient\n\t\t.getContractInfo({\n\t\t\tchainID: parsedArgs.chainId,\n\t\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\t})\n\t\t.then((resp) => resp.contractInfo);\n};\n\nexport const collectionOptions = (\n\targs: UseCollectionArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectionKeys.detail, args, config],\n\t\tqueryFn: () => fetchCollection(args, config),\n\t});\n};\n\nexport const useCollection = (args: UseCollectionArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(collectionOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport { useConfig } from './useConfig';\nimport {\n\tChainIdSchema,\n\tAddressSchema,\n\tQueryArgSchema,\n\tgetMarketplaceClient,\n\ttype Currency,\n\tgetQueryClient,\n\tconfigKeys,\n\tcurrencyKeys,\n\ttype ChainId,\n} from '../_internal';\nimport type { SdkConfig, MarketplaceConfig } from '../../types';\n\nconst ChainIdCoerce = ChainIdSchema.transform((val) => val.toString());\n\nconst UseCurrenciesArgsSchema = z.object({\n\tchainId: ChainIdCoerce,\n\tcollectionAddress: AddressSchema.optional(),\n\tincludeNativeCurrency: z.boolean().optional(),\n\tquery: QueryArgSchema,\n});\n\ntype UseCurrenciesArgs = z.input<typeof UseCurrenciesArgsSchema>;\n\nexport type UseCurrenciesReturn = Awaited<ReturnType<typeof fetchCurrencies>>;\n\nconst fetchCurrencies = async (chainId: ChainId, config: SdkConfig) => {\n\tconst parsedChainId = ChainIdCoerce.parse(chainId);\n\tconst marketplaceClient = getMarketplaceClient(parsedChainId, config);\n\treturn marketplaceClient.listCurrencies().then((resp) => resp.currencies);\n};\n\nconst selectCurrencies = (data: Currency[], args: UseCurrenciesArgs) => {\n\tconst argsParsed = UseCurrenciesArgsSchema.parse(args);\n\t// if collectionAddress is passed, filter currencies based on collection currency options\n\tif (argsParsed.collectionAddress) {\n\t\tconst queryClient = getQueryClient();\n\t\tconst marketplaceConfigCache = queryClient.getQueriesData({\n\t\t\tqueryKey: configKeys.marketplace,\n\t\t})[0][1] as MarketplaceConfig;\n\n\t\tconst collection = marketplaceConfigCache?.collections.find(\n\t\t\t(collection) =>\n\t\t\t\tcollection.collectionAddress === argsParsed.collectionAddress,\n\t\t);\n\n\t\tif (!collection) {\n\t\t\tthrow new Error(\"Collection doesn't exist\");\n\t\t}\n\n\t\treturn data.filter(\n\t\t\t(currency) =>\n\t\t\t\tcollection.currencyOptions?.includes(currency.contractAddress) ||\n\t\t\t\t// biome-ignore lint/suspicious/noDoubleEquals: <explanation>\n\t\t\t\tcurrency.nativeCurrency == argsParsed.includeNativeCurrency ||\n\t\t\t\tcurrency.defaultChainCurrency,\n\t\t);\n\t}\n\t// if includeNativeCurrency is true, return all currencies\n\tif (argsParsed.includeNativeCurrency) {\n\t\treturn data;\n\t}\n\n\t// if includeNativeCurrency is false or undefined, filter out native currencies\n\treturn data.filter((currency) => !currency.nativeCurrency);\n};\n\nexport const currenciesOptions = (\n\targs: UseCurrenciesArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...currencyKeys.lists, args.chainId],\n\t\tqueryFn: () => fetchCurrencies(args.chainId, config),\n\t\tselect: (data) => selectCurrencies(data, args),\n\t\tenabled: args.query?.enabled,\n\t});\n};\n\nexport const useCurrencies = (args: UseCurrenciesArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(currenciesOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport { useConfig } from './useConfig';\nimport {\n\tChainIdSchema,\n\tAddressSchema,\n\tQueryArgSchema,\n\tgetMarketplaceClient,\n\ttype Currency,\n\tcurrencyKeys,\n\ttype ChainId,\n\tgetQueryClient,\n} from '../_internal';\nimport type { SdkConfig } from '../../types';\n\nconst ChainIdCoerce = ChainIdSchema.transform((val) => val.toString());\n\nconst UseCurrencyArgsSchema = z.object({\n\tchainId: ChainIdCoerce,\n\tcurrencyAddress: AddressSchema,\n\tquery: QueryArgSchema,\n});\n\ntype UseCurrencyArgs = z.input<typeof UseCurrencyArgsSchema>;\n\nexport type UseCurrencyReturn = Currency | undefined;\n\nconst fetchCurrency = async (\n\tchainId: ChainId,\n\tcurrencyAddress: string,\n\tconfig: SdkConfig,\n): Promise<Currency | undefined> => {\n\tconst parsedChainId = ChainIdCoerce.parse(chainId);\n\n\tconst queryClient = getQueryClient();\n\tlet currencies = queryClient.getQueryData([...currencyKeys.lists, chainId]) as\n\t\t| Currency[]\n\t\t| undefined;\n\n\tif (!currencies) {\n\t\tconst marketplaceClient = getMarketplaceClient(parsedChainId, config);\n\t\tcurrencies = await marketplaceClient\n\t\t\t.listCurrencies()\n\t\t\t.then((resp) => resp.currencies);\n\t}\n\n\treturn currencies?.find(\n\t\t(currency) =>\n\t\t\tcurrency.contractAddress.toLowerCase() === currencyAddress.toLowerCase(),\n\t);\n};\n\nexport const currencyOptions = (args: UseCurrencyArgs, config: SdkConfig) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...currencyKeys.details, args.chainId, args.currencyAddress],\n\t\tqueryFn: () => fetchCurrency(args.chainId, args.currencyAddress, config),\n\t});\n};\n\nexport const useCurrency = (args: UseCurrencyArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(currencyOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMetadataClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nconst UseFiltersSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tquery: QueryArgSchema,\n});\n\nexport type UseFiltersArgs = z.infer<typeof UseFiltersSchema>;\n\nexport type UseFilterReturn = Awaited<ReturnType<typeof fetchFilters>>;\n\nexport const fetchFilters = async (args: UseFiltersArgs, config: SdkConfig) => {\n\tconst parsedArgs = UseFiltersSchema.parse(args);\n\tconst metadataClient = getMetadataClient(config);\n\treturn metadataClient\n\t\t.tokenCollectionFilters({\n\t\t\tchainID: parsedArgs.chainId,\n\t\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\t})\n\t\t.then((resp) => resp.filters);\n};\n\nexport const filtersOptions = (args: UseFiltersArgs, config: SdkConfig) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.filter, args, config],\n\t\tqueryFn: () => fetchFilters(args, config),\n\t});\n};\n\nexport const useFilters = (args: UseFiltersArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(filtersOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nconst UseFloorOrderSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tquery: QueryArgSchema,\n});\n\nexport type UseFloorOrderArgs = z.infer<typeof UseFloorOrderSchema>;\n\nexport type UseFloorOrderReturn = Awaited<ReturnType<typeof fetchFloorOrder>>;\n\nconst fetchFloorOrder = async (args: UseFloorOrderArgs, config: SdkConfig) => {\n\tconst marketplaceClient = getMarketplaceClient(args.chainId, config);\n\treturn marketplaceClient\n\t\t.getFloorOrder({ contractAddress: args.collectionAddress })\n\t\t.then((data) => data.collectible);\n};\n\nexport const floorOrderOptions = (\n\targs: UseFloorOrderArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\tqueryKey: [...collectableKeys.floorOrders, args, config],\n\t\tqueryFn: () => fetchFloorOrder(args, config),\n\t});\n};\n\nexport const useFloorOrder = (args: UseFloorOrderArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(floorOrderOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { getCollectibleHighestOfferArgsSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UseHighestOfferArgsSchema = getCollectibleHighestOfferArgsSchema\n\t.omit({\n\t\tcontractAddress: true,\n\t})\n\t.extend({\n\t\tcollectionAddress: AddressSchema,\n\t\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\t\tquery: QueryArgSchema,\n\t});\n\nexport type UseHighestOfferArgs = z.infer<typeof UseHighestOfferArgsSchema>;\n\nexport type UseHighestOfferReturn = Awaited<\n\tReturnType<typeof fetchHighestOffer>\n>;\n\nconst fetchHighestOffer = async (\n\targs: UseHighestOfferArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst parsedArgs = UseHighestOfferArgsSchema.parse(args);\n\tconst marketplaceClient = getMarketplaceClient(parsedArgs.chainId, config);\n\treturn marketplaceClient.getCollectibleHighestOffer({\n\t\t...parsedArgs,\n\t\tcontractAddress: parsedArgs.collectionAddress,\n\t});\n};\n\nexport const highestOfferOptions = (\n\targs: UseHighestOfferArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.highestOffers, args, config],\n\t\tqueryFn: () => fetchHighestOffer(args, config),\n\t});\n};\n\nexport const useHighestOffer = (args: UseHighestOfferArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(highestOfferOptions(args, config));\n};\n","import { type Page, SortOrder } from '@0xsequence/indexer';\nimport { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tbalanceQueries,\n\tgetIndexerClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nexport const metadataOptionsSchema = z.object({\n\tverifiedOnly: z.boolean().optional(),\n\tunverifiedOnly: z.boolean().optional(),\n\tincludeContracts: z.array(z.string()).optional(),\n});\n\nconst sortOrderSchema = z.nativeEnum(SortOrder);\n\nconst sortBySchema = z.object({\n\tcolumn: z.string(),\n\torder: sortOrderSchema,\n});\n\nconst pageSchema = z.object({\n\tpage: z.number().optional(),\n\tcolumn: z.string().optional(),\n\tbefore: z.any().optional(),\n\tafter: z.any().optional(),\n\tsort: z.array(sortBySchema).optional(),\n\tpageSize: z.number().optional(),\n\tmore: z.boolean().optional(),\n});\n\nconst useListBalancesArgsSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.number()),\n\taccountAddress: AddressSchema.optional(),\n\tcontractAddress: AddressSchema.optional(),\n\ttokenId: z.string().optional(),\n\tincludeMetadata: z.boolean().optional(),\n\tmetadataOptions: metadataOptionsSchema.optional(),\n\tincludeCollectionTokens: z.boolean().optional(),\n\tpage: pageSchema.optional(),\n\tquery: QueryArgSchema,\n});\n\nexport type UseFetchTokenBalancesReturn = Awaited<\n\tReturnType<typeof fetchBalances>\n>;\n\nexport type UseListBalancesArgs = z.input<typeof useListBalancesArgsSchema>;\n\nconst fetchBalances = async (\n\targs: UseListBalancesArgs,\n\tconfig: SdkConfig,\n\tpage: Page,\n) => {\n\tconst parsedArgs = useListBalancesArgsSchema.parse(args);\n\tconst indexerClient = getIndexerClient(parsedArgs.chainId, config);\n\n\treturn indexerClient.getTokenBalances({\n\t\t...parsedArgs,\n\t\ttokenID: parsedArgs.tokenId,\n\t\tpage: page,\n\t});\n};\n\nexport const listBalancesOptions = (\n\targs: UseListBalancesArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn infiniteQueryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...balanceQueries.lists, args, config],\n\t\tqueryFn: ({ pageParam }) => fetchBalances(args, config, pageParam),\n\t\tinitialPageParam: { page: 1, pageSize: 30 } as Page,\n\t\tgetNextPageParam: (lastPage) => lastPage.page.after,\n\t});\n};\n\nexport const useListBalances = (args: UseListBalancesArgs) => {\n\tconst config = useConfig();\n\treturn useInfiniteQuery(listBalancesOptions(args, config));\n};\n","import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { Page, SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\ttype ListCollectiblesArgs,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { listCollectiblesArgsSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UseListCollectiblesArgsSchema = listCollectiblesArgsSchema\n\t.omit({\n\t\tcontractAddress: true,\n\t})\n\t.extend({\n\t\tcollectionAddress: AddressSchema,\n\t\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\t\tquery: QueryArgSchema,\n\t});\n\nexport type UseListCollectiblesArgs = z.infer<\n\ttypeof UseListCollectiblesArgsSchema\n>;\n\nexport type UseListCollectiblesReturn = Awaited<\n\tReturnType<typeof fetchCollectibles>\n>;\n\nconst fetchCollectibles = async (\n\targs: UseListCollectiblesArgs,\n\tmarketplaceClient: Awaited<ReturnType<typeof getMarketplaceClient>>,\n\tpage: Page,\n) => {\n\tconst parsedArgs = UseListCollectiblesArgsSchema.parse(args);\n\tconst arg = {\n\t\t...parsedArgs,\n\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\tpage: page,\n\t} satisfies ListCollectiblesArgs;\n\n\treturn marketplaceClient.listCollectibles(arg);\n};\n\nexport const listCollectiblesOptions = (\n\targs: UseListCollectiblesArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst marketplaceClient = getMarketplaceClient(args.chainId, config);\n\treturn infiniteQueryOptions({\n\t\tqueryKey: [...collectableKeys.lists, args],\n\t\tqueryFn: ({ pageParam }) =>\n\t\t\tfetchCollectibles(args, marketplaceClient, pageParam),\n\t\tinitialPageParam: { page: 1, pageSize: 30 },\n\t\tgetNextPageParam: (lastPage) =>\n\t\t\tlastPage.page?.more ? lastPage.page : undefined,\n\t});\n};\n\nexport const useListCollectibles = (args: UseListCollectiblesArgs) => {\n\tconst config = useConfig();\n\treturn useInfiniteQuery(listCollectiblesOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tChainIdSchema,\n\ttype ListOffersForCollectibleArgs,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { listOffersForCollectibleArgsSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UseListOffersForCollectibleArgsSchema = listOffersForCollectibleArgsSchema\n\t.extend({\n\t\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\t\tcollectionAddress: z.string(),\n\t\tcollectibleId: z.string(),\n\t})\n\t.omit({ contractAddress: true, tokenId: true });\n\ntype UseListOffersForCollectibleArgs = z.infer<\n\ttypeof UseListOffersForCollectibleArgsSchema\n>;\n\nexport type UseListOffersForCollectibleReturn = Awaited<\n\tReturnType<typeof fetchListOffersForCollectible>\n>;\n\nconst fetchListOffersForCollectible = async (\n\tconfig: SdkConfig,\n\targs: UseListOffersForCollectibleArgs,\n) => {\n\tconst arg = {\n\t\tcontractAddress: args.collectionAddress,\n\t\ttokenId: args.collectibleId,\n\t\tfilter: args.filter,\n\t\tpage: args.page,\n\t} satisfies ListOffersForCollectibleArgs;\n\n\tconst marketplaceClient = getMarketplaceClient(args.chainId, config);\n\treturn marketplaceClient.listCollectibleOffers(arg);\n};\n\nexport const listOffersForCollectibleOptions = (\n\targs: UseListOffersForCollectibleArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\tqueryKey: [...collectableKeys.offers, args, config],\n\t\tqueryFn: () => fetchListOffersForCollectible(config, args),\n\t});\n};\n\nexport const useListOffersForCollectible = (\n\targs: UseListOffersForCollectibleArgs,\n) => {\n\tconst config = useConfig();\n\n\treturn useQuery(listOffersForCollectibleOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tChainIdSchema,\n\ttype ListListingsForCollectibleArgs,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { listListingsForCollectibleArgsSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UseListListingsForCollectibleArgsSchema =\n\tlistListingsForCollectibleArgsSchema\n\t\t.extend({\n\t\t\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\t\t\tcollectionAddress: z.string(),\n\t\t\tcollectibleId: z.string(),\n\t\t})\n\t\t.omit({ contractAddress: true, tokenId: true });\n\ntype UseListListingsForCollectibleArgs = z.infer<\n\ttypeof UseListListingsForCollectibleArgsSchema\n>;\n\nexport type UseListListingsForCollectibleReturn = Awaited<\n\tReturnType<typeof fetchListListingsForCollectible>\n>;\n\nconst fetchListListingsForCollectible = async (\n\tconfig: SdkConfig,\n\targs: UseListListingsForCollectibleArgs,\n) => {\n\tconst arg = {\n\t\tcontractAddress: args.collectionAddress,\n\t\ttokenId: args.collectibleId,\n\t\tfilter: args.filter,\n\t\tpage: args.page,\n\t} satisfies ListListingsForCollectibleArgs;\n\n\tconst marketplaceClient = getMarketplaceClient(args.chainId, config);\n\treturn marketplaceClient.listCollectibleListings(arg);\n};\n\nexport const listListingsForCollectibleOptions = (\n\targs: UseListListingsForCollectibleArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\tqueryKey: [...collectableKeys.listings, args, config],\n\t\tqueryFn: () => fetchListListingsForCollectible(config, args),\n\t});\n};\n\nexport const useListListingsForCollectible = (\n\targs: UseListListingsForCollectibleArgs,\n) => {\n\tconst config = useConfig();\n\n\treturn useQuery(listListingsForCollectibleOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { getCollectibleLowestListingArgsSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UseLowestListingSchema = getCollectibleLowestListingArgsSchema\n\t.omit({\n\t\tcontractAddress: true,\n\t})\n\t.extend({\n\t\tcollectionAddress: AddressSchema,\n\t\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\t\tquery: QueryArgSchema,\n\t});\n\nexport type UseLowestListingArgs = z.infer<typeof UseLowestListingSchema>;\n\nexport type UseLowestListingReturn = Awaited<\n\tReturnType<typeof fetchLowestListing>\n>;\n\nconst fetchLowestListing = async (\n\targs: UseLowestListingArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst parsedArgs = UseLowestListingSchema.parse(args);\n\tconst marketplaceClient = getMarketplaceClient(parsedArgs.chainId, config);\n\treturn marketplaceClient.getCollectibleLowestListing({\n\t\t...parsedArgs,\n\t\tcontractAddress: parsedArgs.collectionAddress,\n\t});\n};\n\nexport const lowestListingOptions = (\n\targs: UseLowestListingArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.lowestListings, args, config],\n\t\tqueryFn: () => fetchLowestListing(args, config),\n\t});\n};\n\nexport const useLowestListing = (args: UseLowestListingArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(lowestListingOptions(args, config));\n};\n","import { useQuery } from '@tanstack/react-query';\nimport { marketplaceConfigOptions } from './options/marketplaceConfigOptions';\nimport { useConfig } from './useConfig';\n\nexport * from './options/marketplaceConfigOptions';\n\nexport const useMarketplaceConfig = () => {\n\tconst config = useConfig();\n\treturn useQuery(marketplaceConfigOptions(config));\n};\n","import { queryOptions } from '@tanstack/react-query';\nimport type { Env, MarketplaceConfig, SdkConfig } from '../../../types';\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 Error(`Project id: ${projectId} not found, ${url}`);\n\t\t\tdefault:\n\t\t\t\t//@ts-ignore\n\t\t\t\tthrow new Error(`Failed to fetch marketplace config: ${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 { queryOptions, useQuery } from '@tanstack/react-query';\nimport type { Hex } from 'viem';\nimport { getContract } from 'viem';\nimport { z } from 'zod';\nimport { getPublicRpcClient } from '../../utils/get-public-rpc-client';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectableKeys,\n} from '../_internal';\nimport { EIP2981_ABI } from '../../utils';\n\nconst UseRoyaletyPercentageSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tcollectibleId: z.string(),\n\tquery: QueryArgSchema,\n});\n\ntype UseRoyaletyPercentageArgs = z.infer<typeof UseRoyaletyPercentageSchema>;\n\nconst fetchRoyaletyPercentage = async (args: UseRoyaletyPercentageArgs) => {\n\tconst parsedArgs = UseRoyaletyPercentageSchema.parse(args);\n\tconst publicClient = getPublicRpcClient(parsedArgs.chainId);\n\n\tconst contract = getContract({\n\t\taddress: parsedArgs.collectionAddress as Hex,\n\t\tabi: EIP2981_ABI,\n\t\tclient: publicClient,\n\t});\n\n\ttry {\n\t\tconst [_, royaltyPercentage] = await contract.read.royaltyInfo([\n\t\t\tBigInt(args.collectibleId),\n\t\t\t100n,\n\t\t]);\n\n\t\treturn royaltyPercentage;\n\t} catch {\n\t\t//TODO: dont swallow errors\n\t\treturn 0n;\n\t}\n};\n\nexport const royaletyPercentageOptions = (args: UseRoyaletyPercentageArgs) =>\n\tqueryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.royaltyPercentage, args],\n\t\tqueryFn: () => fetchRoyaletyPercentage(args),\n\t});\n\nexport const useRoyaltyPercentage = (args: UseRoyaletyPercentageArgs) => {\n\treturn useQuery(royaletyPercentageOptions(args));\n};\n","import { useMutation } from '@tanstack/react-query';\nimport { useConfig } from './useConfig';\n\nexport type UseGenerateListingTransactionArgs = {\n\tchainId: ChainId;\n\tonSuccess?: (data?: Step[]) => void;\n};\n\nimport type { SdkConfig } from '../../types';\nimport {\n\ttype ChainId,\n\ttype CreateReq,\n\ttype GenerateListingTransactionArgs,\n\ttype Step,\n\tgetMarketplaceClient,\n} from '../_internal';\n\nexport type CreateReqWithDateExpiry = Omit<CreateReq, 'expiry'> & {\n\texpiry: Date;\n};\n\nexport type GenerateListingTransactionProps = Omit<\n\tGenerateListingTransactionArgs,\n\t'listing'\n> & {\n\tlisting: CreateReqWithDateExpiry;\n};\n\nconst dateToUnixTime = (date: Date) =>\n\tMath.floor(date.getTime() / 1000).toString();\n\nexport const generateListingTransaction = async (\n\tparams: GenerateListingTransactionProps,\n\tconfig: SdkConfig,\n\tchainId: ChainId,\n) => {\n\tconst args = {\n\t\t...params,\n\t\tlisting: {\n\t\t\t...params.listing,\n\t\t\texpiry: dateToUnixTime(params.listing.expiry),\n\t\t},\n\t} satisfies GenerateListingTransactionArgs;\n\tconst marketplaceClient = getMarketplaceClient(chainId, config);\n\treturn (await marketplaceClient.generateListingTransaction(args)).steps;\n};\n\nexport const useGenerateListingTransaction = (\n\tparams: UseGenerateListingTransactionArgs,\n) => {\n\tconst config = useConfig();\n\n\tconst { mutate, mutateAsync, ...result } = useMutation({\n\t\tonSuccess: params.onSuccess,\n\t\tmutationFn: (args: GenerateListingTransactionProps) =>\n\t\t\tgenerateListingTransaction(args, config, params.chainId),\n\t});\n\n\treturn {\n\t\t...result,\n\t\tgenerateListingTransaction: mutate,\n\t\tgenerateListingTransactionAsync: mutateAsync,\n\t};\n};\n","import { useMutation } from '@tanstack/react-query';\nimport type { SdkConfig } from '../../types';\nimport {\n\ttype ChainId,\n\ttype CreateReq,\n\ttype GenerateOfferTransactionArgs,\n\ttype Step,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nexport type UseGenerateOfferTransactionArgs = {\n\tchainId: ChainId;\n\tonSuccess?: (data?: Step[]) => void;\n};\n\ntype CreateReqWithDateExpiry = Omit<CreateReq, 'expiry'> & {\n\texpiry: Date;\n};\n\nexport type GenerateOfferTransactionProps = Omit<\n\tGenerateOfferTransactionArgs,\n\t'offer'\n> & {\n\toffer: CreateReqWithDateExpiry;\n};\n\nconst dateToUnixTime = (date: Date) =>\n\tMath.floor(date.getTime() / 1000).toString();\n\nexport const generateOfferTransaction = async (\n\tparams: GenerateOfferTransactionProps,\n\tconfig: SdkConfig,\n\tchainId: ChainId,\n) => {\n\tconst args = {\n\t\t...params,\n\t\toffer: { ...params.offer, expiry: dateToUnixTime(params.offer.expiry) },\n\t} satisfies GenerateOfferTransactionArgs;\n\tconst marketplaceClient = getMarketplaceClient(chainId, config);\n\treturn (await marketplaceClient.generateOfferTransaction(args)).steps;\n};\n\nexport const useGenerateOfferTransaction = (\n\tparams: UseGenerateOfferTransactionArgs,\n) => {\n\tconst config = useConfig();\n\n\tconst { mutate, mutateAsync, ...result } = useMutation({\n\t\tonSuccess: params.onSuccess,\n\t\tmutationFn: (args: GenerateOfferTransactionProps) =>\n\t\t\tgenerateOfferTransaction(args, config, params.chainId),\n\t});\n\n\treturn {\n\t\t...result,\n\t\tgenerateOfferTransaction: mutate,\n\t\tgenerateOfferTransactionAsync: mutateAsync,\n\t};\n};\n","import { useMutation } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\ttype ChainId,\n\tChainIdSchema,\n\ttype GenerateSellTransactionArgs,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { stepSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UserGeneratSellTransactionArgsSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tonSuccess: z.function().args(stepSchema.array().optional()).optional(),\n});\n\ntype UseGenerateSellTransactionArgs = z.infer<\n\ttypeof UserGeneratSellTransactionArgsSchema\n>;\n\nexport const generateSellTransaction = async (\n\targs: GenerateSellTransactionArgs,\n\tconfig: SdkConfig,\n\tchainId: ChainId,\n) => {\n\tconst parsedChainId = ChainIdSchema.pipe(z.coerce.string()).parse(chainId);\n\tconst marketplaceClient = getMarketplaceClient(parsedChainId, config);\n\treturn marketplaceClient\n\t\t.generateSellTransaction(args)\n\t\t.then((data) => data.steps);\n};\n\nexport const useGenerateSellTransaction = (\n\tparams: UseGenerateSellTransactionArgs,\n) => {\n\tconst config = useConfig();\n\n\tconst { mutate, mutateAsync, ...result } = useMutation({\n\t\tonSuccess: params.onSuccess,\n\t\tmutationFn: (args: GenerateSellTransactionArgs) =>\n\t\t\tgenerateSellTransaction(args, config, params.chainId),\n\t});\n\n\treturn {\n\t\t...result,\n\t\tgenerateSellTransaction: mutate,\n\t\tgenerateSellTransactionAsync: mutateAsync,\n\t};\n};\n","import { useMutation } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\ttype ChainId,\n\tChainIdSchema,\n\ttype GenerateCancelTransactionArgs,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { stepSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UserGenerateCancelTransactionArgsSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tonSuccess: z.function().args(stepSchema.array().optional()).optional(),\n});\n\ntype UseGenerateCancelTransactionArgs = z.infer<\n\ttypeof UserGenerateCancelTransactionArgsSchema\n>;\n\nexport const generateCancelTransaction = async (\n\targs: GenerateCancelTransactionArgs,\n\tconfig: SdkConfig,\n\tchainId: ChainId,\n) => {\n\tconst parsedChainId = ChainIdSchema.pipe(z.coerce.string()).parse(chainId);\n\tconst marketplaceClient = getMarketplaceClient(parsedChainId, config);\n\treturn marketplaceClient\n\t\t.generateCancelTransaction(args)\n\t\t.then((data) => data.steps);\n};\n\nexport const useGenerateCancelTransaction = (\n\tparams: UseGenerateCancelTransactionArgs,\n) => {\n\tconst config = useConfig();\n\n\tconst { mutate, mutateAsync, ...result } = useMutation({\n\t\tonSuccess: params.onSuccess,\n\t\tmutationFn: (args: GenerateCancelTransactionArgs) =>\n\t\t\tgenerateCancelTransaction(args, config, params.chainId),\n\t});\n\n\treturn {\n\t\t...result,\n\t\tgenerateCancelTransaction: mutate,\n\t\tgenerateCancelTransactionAsync: mutateAsync,\n\t};\n};\n","import { type Abi, type Address, type Hex, erc721Abi } from 'viem';\nimport { useAccount, useWriteContract } from 'wagmi';\nimport { ERC1155_ABI } from '../../utils';\nimport type { ChainId, ContractType } from '../_internal';\n\ninterface BaseTransferParams {\n\tchainId: ChainId;\n\tcollectionAddress: Hex;\n\ttokenId: string;\n\treceiverAddress: Address;\n}\n\ninterface ERC721TransferParams extends BaseTransferParams {\n\tcontractType: ContractType.ERC721;\n}\n\ninterface ERC1155TransferParams extends BaseTransferParams {\n\tcontractType: ContractType.ERC1155;\n\tquantity: string;\n}\n\nexport type TransferTokensParams = ERC721TransferParams | ERC1155TransferParams;\n\nconst prepareTransferConfig = (\n\tparams: TransferTokensParams,\n\taccountAddress: Address,\n) => {\n\tif (params.contractType === 'ERC721') {\n\t\treturn {\n\t\t\tabi: erc721Abi as Abi,\n\t\t\taddress: params.collectionAddress,\n\t\t\tfunctionName: 'safeTransferFrom',\n\t\t\targs: [\n\t\t\t\taccountAddress,\n\t\t\t\tparams.receiverAddress,\n\t\t\t\tBigInt(params.tokenId),\n\t\t\t] as const,\n\t\t} as const;\n\t}\n\n\treturn {\n\t\tabi: ERC1155_ABI as Abi,\n\t\taddress: params.collectionAddress,\n\t\tfunctionName: 'safeTransferFrom',\n\t\targs: [\n\t\t\taccountAddress,\n\t\t\tparams.receiverAddress,\n\t\t\tBigInt(params.tokenId),\n\t\t\tparams.quantity,\n\t\t\t'0x', // data\n\t\t] as const,\n\t};\n};\n\nexport const useTransferTokens = () => {\n\tconst { address: accountAddress } = useAccount();\n\tconst {\n\t\twriteContractAsync,\n\t\tdata: hash,\n\t\tisPending,\n\t\tisError,\n\t\tisSuccess,\n\t} = useWriteContract();\n\n\tconst transferTokensAsync = async (params: TransferTokensParams) => {\n\t\tif (!accountAddress) {\n\t\t\tthrow new Error('No wallet connected');\n\t\t}\n\n\t\tconst config = prepareTransferConfig(params, accountAddress);\n\t\treturn await writeContractAsync(config);\n\t};\n\n\treturn {\n\t\ttransferTokensAsync,\n\t\thash,\n\t\ttransferring: isPending,\n\t\ttransferFailed: isError,\n\t\ttransferSuccess: isSuccess,\n\t};\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tMarketplaceKind,\n\tQueryArgSchema,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\nimport { useAccount } from 'wagmi';\nimport type { Hex } from 'viem';\n\nconst UseCheckoutOptionsSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\torders: z.array(\n\t\tz.object({\n\t\t\tcollectionAddress: AddressSchema,\n\t\t\torderId: z.string(),\n\t\t\tmarketplace: z.nativeEnum(MarketplaceKind),\n\t\t}),\n\t),\n\tquery: QueryArgSchema,\n});\n\nexport type UseCheckoutOptionsArgs = z.infer<typeof UseCheckoutOptionsSchema>;\n\nexport type UseCheckoutOptionsReturn = Awaited<\n\tReturnType<typeof fetchCheckoutOptions>\n>;\n\nconst fetchCheckoutOptions = async (\n\targs: UseCheckoutOptionsArgs & { walletAddress: Hex },\n\tconfig: SdkConfig,\n) => {\n\tconst marketplaceClient = getMarketplaceClient(args.chainId, config);\n\treturn marketplaceClient.checkoutOptionsMarketplace({\n\t\twallet: args.walletAddress,\n\t\torders: args.orders.map((order) => ({\n\t\t\tcontractAddress: order.collectionAddress,\n\t\t\torderId: order.orderId,\n\t\t\tmarketplace: order.marketplace,\n\t\t})),\n\t\tadditionalFee: 0, //TODO: add additional fee\n\t});\n};\n\nexport const checkoutOptionsOptions = (\n\targs: UseCheckoutOptionsArgs & { walletAddress: Hex },\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\tqueryKey: ['checkoutOptions', args],\n\t\tqueryFn: () => fetchCheckoutOptions(args, config),\n\t});\n};\n\nexport const useCheckoutOptions = (args: UseCheckoutOptionsArgs) => {\n\tconst { address } = useAccount();\n\tconst config = useConfig();\n\treturn useQuery(\n\t\t// biome-ignore lint/style/noNonNullAssertion: <explanation>\n\t\tcheckoutOptionsOptions({ walletAddress: address!, ...args }, config),\n\t);\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { MarketplaceConfig, SdkConfig } from '../../types';\nimport {\n\tQueryArgSchema,\n\tcollectionKeys,\n\tgetMetadataClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\nimport { useMarketplaceConfig } from './useMarketplaceConfig';\n\nconst UseListCollectionsSchema = z.object({\n\tquery: QueryArgSchema.optional().default({}),\n});\n\nexport type UseListCollectionsArgs = z.input<typeof UseListCollectionsSchema>;\n\nexport type UseListCollectionsReturn = Awaited<\n\tReturnType<typeof fetchListCollections>\n>;\n\ntype FetchListCollectionsArgs = {\n\tmarketplaceConfig: MarketplaceConfig;\n\tquery?: z.infer<typeof QueryArgSchema>;\n};\n\nconst fetchListCollections = async (\n\t{ marketplaceConfig }: FetchListCollectionsArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst metadataClient = getMetadataClient(config);\n\n\tif (!marketplaceConfig?.collections?.length) {\n\t\treturn [];\n\t}\n\n\t// Group collections by chainId\n\tconst collectionsByChain = marketplaceConfig.collections.reduce<\n\t\tRecord<string, string[]>\n\t>((acc, curr) => {\n\t\tconst { chainId, collectionAddress } = curr;\n\t\tif (!acc[chainId]) {\n\t\t\tacc[chainId] = [];\n\t\t}\n\t\tacc[chainId].push(collectionAddress);\n\t\treturn acc;\n\t}, {});\n\n\t// Fetch collections for each chain\n\tconst promises = Object.entries(collectionsByChain).map(\n\t\t([chainId, addresses]) =>\n\t\t\tmetadataClient\n\t\t\t\t.getContractInfoBatch({\n\t\t\t\t\tchainID: chainId,\n\t\t\t\t\tcontractAddresses: addresses,\n\t\t\t\t})\n\t\t\t\t.then((resp) => Object.values(resp.contractInfoMap)),\n\t);\n\n\tconst results = await Promise.all(promises);\n\treturn results.flat();\n};\n\nexport const listCollectionsOptions = (\n\targs: FetchListCollectionsArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectionKeys.list],\n\t\tqueryFn: () => fetchListCollections(args, config),\n\t});\n};\n\nexport const useListCollections = (args: UseListCollectionsArgs = {}) => {\n\tconst config = useConfig();\n\tconst { data: marketplaceConfig, isLoading: isLoadingConfig } =\n\t\tuseMarketplaceConfig();\n\n\treturn useQuery({\n\t\t...listCollectionsOptions(\n\t\t\t// biome-ignore lint/style/noNonNullAssertion: <explanation>\n\t\t\t{ marketplaceConfig: marketplaceConfig!, query: args.query },\n\t\t\tconfig,\n\t\t),\n\t\tenabled: !isLoadingConfig && !!marketplaceConfig,\n\t});\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tgetMarketplaceClient,\n\tMarketplaceKind,\n\tQueryArgSchema,\n\tWalletKind,\n} from '../_internal';\nimport { useConfig } from './useConfig';\nimport { useAccount } from 'wagmi';\nimport type { Hex } from 'viem';\n\nexport const UseGenerateBuyTransactionArgsSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tmarketplace: z.nativeEnum(MarketplaceKind),\n\tordersData: z.array(\n\t\tz.object({\n\t\t\torderId: z.string(),\n\t\t\tquantity: z.string(),\n\t\t\tmarketplace: z.string(),\n\t\t}),\n\t),\n\twalletType: z.nativeEnum(WalletKind).optional(),\n\tquery: QueryArgSchema,\n});\n\ntype UseGenerateBuyTransactionArgs = z.infer<\n\ttypeof UseGenerateBuyTransactionArgsSchema\n>;\n\nexport const fetchGenerateBuyTransaction = async (\n\targs: UseGenerateBuyTransactionArgs & { buyer: Hex },\n\tconfig: SdkConfig,\n) => {\n\tconst parsedArgs = UseGenerateBuyTransactionArgsSchema.parse(args);\n\tconst marketplaceClient = getMarketplaceClient(parsedArgs.chainId, config);\n\n\treturn marketplaceClient\n\t\t.generateBuyTransaction({\n\t\t\t...parsedArgs,\n\t\t\tbuyer: args.buyer,\n\t\t\tadditionalFees: [], // TODO: Add additional fees\n\t\t})\n\t\t.then((data) => data.steps);\n};\n\nexport const generateBuyTransactionOptions = (\n\targs: UseGenerateBuyTransactionArgs & { buyer: Hex },\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\tqueryKey: ['generateBuyTransaction', args],\n\t\tqueryFn: () => fetchGenerateBuyTransaction(args, config),\n\t\t...args.query,\n\t});\n};\n\nexport const useGenerateBuyTransaction = (\n\targs: UseGenerateBuyTransactionArgs,\n) => {\n\tconst { address } = useAccount();\n\tconst config = useConfig();\n\treturn useQuery(\n\t\t// biome-ignore lint/style/noNonNullAssertion: <explanation>\n\t\tgenerateBuyTransactionOptions({ buyer: address!, ...args }, config),\n\t);\n};\n","import type { SelectPaymentSettings } from '@0xsequence/kit-checkout';\nimport type {\n\tChain,\n\tHash,\n\tHex,\n\tPublicClient,\n\tTypedDataDomain,\n\tWalletClient,\n} from 'viem';\nimport { avalanche } from 'viem/chains';\nimport {\n\ttype AdditionalFee,\n\ttype SequenceMarketplace,\n\tTransactionSwapProvider,\n\ttype WalletKind,\n\tgetMarketplaceClient,\n} from '..';\nimport {\n\ttype ContractType,\n\ttype CreateReq,\n\tExecuteType,\n\ttype MarketplaceConfig,\n\ttype MarketplaceKind,\n\tOrderbookKind,\n\ttype SdkConfig,\n\ttype Step,\n\tStepType,\n} from '../../../types';\n\nexport enum TransactionState {\n\tIDLE = 'IDLE',\n\tSWITCH_CHAIN = 'SWITCH_CHAIN',\n\tCHECKING_STEPS = 'CHECKING_STEPS',\n\tTOKEN_APPROVAL = 'TOKEN_APPROVAL',\n\tEXECUTING_TRANSACTION = 'EXECUTING_TRANSACTION',\n\tCONFIRMING = 'CONFIRMING',\n\tSUCCESS = 'SUCCESS',\n\tERROR = 'ERROR',\n}\n\nexport enum TransactionType {\n\tBUY = 'BUY',\n\tSELL = 'SELL',\n\tLISTING = 'LISTING',\n\tOFFER = 'OFFER',\n\tCANCEL = 'CANCEL',\n}\n\nexport interface TransactionConfig {\n\ttype: TransactionType;\n\twalletKind: WalletKind;\n\tchainId: string;\n\tchains: readonly Chain[];\n\tcollectionAddress: string;\n\tsdkConfig: SdkConfig;\n\tmarketplaceConfig: MarketplaceConfig;\n}\n\ninterface StateConfig {\n\tconfig: TransactionConfig;\n\tonTransactionSent?: (hash: Hash) => void;\n\tonSuccess?: (hash: Hash) => void;\n\tonError?: (error: Error) => void;\n}\n\nexport interface BuyInput {\n\torderId: string;\n\tcollectableDecimals: number;\n\tmarketplace: MarketplaceKind;\n\tquantity: string;\n}\n\nexport interface SellInput {\n\torderId: string;\n\tmarketplace: MarketplaceKind;\n\tquantity?: string;\n}\n\nexport interface ListingInput {\n\tcontractType: ContractType;\n\tlisting: CreateReq;\n}\n\nexport interface OfferInput {\n\tcontractType: ContractType;\n\toffer: CreateReq;\n}\n\nexport interface CancelInput {\n\torderId: string;\n\tmarketplace: MarketplaceKind;\n}\n\ntype TransactionInput =\n\t| {\n\t\t\ttype: TransactionType.BUY;\n\t\t\tprops: BuyInput;\n\t }\n\t| {\n\t\t\ttype: TransactionType.SELL;\n\t\t\tprops: SellInput;\n\t }\n\t| {\n\t\t\ttype: TransactionType.LISTING;\n\t\t\tprops: ListingInput;\n\t }\n\t| {\n\t\t\ttype: TransactionType.OFFER;\n\t\t\tprops: OfferInput;\n\t }\n\t| {\n\t\t\ttype: TransactionType.CANCEL;\n\t\t\tprops: CancelInput;\n\t };\n\ninterface StateConfig {\n\tconfig: TransactionConfig;\n\tonTransactionSent?: (hash: Hash) => void;\n\tonSuccess?: (hash: Hash) => void;\n\tonError?: (error: Error) => void;\n}\n\ninterface TransactionStep {\n\tisPending: boolean;\n\tisExecuting: boolean;\n}\n\nexport interface TransactionSteps {\n\tswitchChain: TransactionStep & {\n\t\texecute: () => Promise<void>;\n\t};\n\tapproval: TransactionStep & {\n\t\texecute: () =>\n\t\t\t| Promise<{ hash: Hash } | undefined>\n\t\t\t| Promise<void>\n\t\t\t| undefined;\n\t};\n\ttransaction: TransactionStep & {\n\t\texecute: () => Promise<{ hash: Hash } | undefined> | Promise<void>;\n\t};\n}\n\nconst debug = (message: string, data?: any) => {\n\tconsole.debug(`[TransactionMachine] ${message}`, data || '');\n};\n\nexport class TransactionMachine {\n\tprivate currentState: TransactionState;\n\tprivate marketplaceClient: SequenceMarketplace;\n\tprivate memoizedSteps: TransactionSteps | null = null;\n\tprivate lastProps: TransactionInput['props'] | null = null;\n\n\tconstructor(\n\t\tprivate readonly config: StateConfig,\n\t\tprivate readonly walletClient: WalletClient,\n\t\tprivate readonly publicClient: PublicClient,\n\t\tprivate readonly openSelectPaymentModal: (\n\t\t\tsettings: SelectPaymentSettings,\n\t\t) => void,\n\t\tprivate readonly switchChainFn: (chainId: string) => Promise<void>,\n\t) {\n\t\tthis.currentState = TransactionState.IDLE;\n\t\tthis.marketplaceClient = getMarketplaceClient(\n\t\t\tconfig.config.chainId,\n\t\t\tconfig.config.sdkConfig,\n\t\t);\n\t}\n\n\tprivate getAccount() {\n\t\tconst account = this.walletClient.account;\n\t\tif (!account) {\n\t\t\tthrow new Error('Account not connected');\n\t\t}\n\t\treturn account;\n\t}\n\n\tprivate getMarketplaceFee(collectionAddress: string) {\n\t\tconst defaultFee = 2.5;\n\t\tconst defaultPlatformFeeRecipient =\n\t\t\t'0x858dB1cbF6D09D447C96A11603189b49B2D1C219';\n\t\tconst avalancheAndOptimismPlatformFeeRecipient =\n\t\t\t'0x400cdab4676c17aec07e8ec748a5fc3b674bca41';\n\t\tconst collection = this.config.config.marketplaceConfig.collections.find(\n\t\t\t(collection) =>\n\t\t\t\tcollection.collectionAddress.toLowerCase() ===\n\t\t\t\t\tcollectionAddress.toLowerCase() &&\n\t\t\t\tthis.getChainId() === Number(collection.chainId),\n\t\t);\n\n\t\tconst receiver =\n\t\t\tthis.getChainId() === avalanche.id\n\t\t\t\t? avalancheAndOptimismPlatformFeeRecipient\n\t\t\t\t: defaultPlatformFeeRecipient;\n\n\t\tconst percentageToBPS = (percentage: string | number) =>\n\t\t\t(Number(percentage) * 10000) / 100;\n\n\t\treturn {\n\t\t\tamount: percentageToBPS(\n\t\t\t\tcollection?.marketplaceFeePercentage || defaultFee,\n\t\t\t).toString(),\n\t\t\treceiver,\n\t\t} satisfies AdditionalFee;\n\t}\n\n\tprivate getAccountAddress() {\n\t\treturn this.getAccount().address;\n\t}\n\n\tprivate async generateSteps({\n\t\ttype,\n\t\tprops,\n\t}: TransactionInput): Promise<Step[]> {\n\t\tdebug('Generating steps', { type, props });\n\t\tconst { collectionAddress } = this.config.config;\n\t\tconst address = this.getAccountAddress();\n\t\tswitch (type) {\n\t\t\tcase TransactionType.BUY:\n\t\t\t\treturn this.marketplaceClient\n\t\t\t\t\t.generateBuyTransaction({\n\t\t\t\t\t\tcollectionAddress,\n\t\t\t\t\t\tbuyer: address,\n\t\t\t\t\t\twalletType: this.config.config.walletKind,\n\t\t\t\t\t\tmarketplace: props.marketplace,\n\t\t\t\t\t\tordersData: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\torderId: props.orderId,\n\t\t\t\t\t\t\t\tquantity: props.quantity || '1',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tadditionalFees: [this.getMarketplaceFee(collectionAddress)],\n\t\t\t\t\t})\n\t\t\t\t\t.then((resp) => resp.steps);\n\n\t\t\tcase TransactionType.SELL:\n\t\t\t\treturn this.marketplaceClient\n\t\t\t\t\t.generateSellTransaction({\n\t\t\t\t\t\tcollectionAddress,\n\t\t\t\t\t\tseller: address,\n\t\t\t\t\t\twalletType: this.config.config.walletKind,\n\t\t\t\t\t\tmarketplace: props.marketplace,\n\t\t\t\t\t\tordersData: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\torderId: props.orderId,\n\t\t\t\t\t\t\t\tquantity: props.quantity || '1',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tadditionalFees: [],\n\t\t\t\t\t})\n\t\t\t\t\t.then((resp) => resp.steps);\n\n\t\t\tcase TransactionType.LISTING:\n\t\t\t\treturn this.marketplaceClient\n\t\t\t\t\t.generateListingTransaction({\n\t\t\t\t\t\tcollectionAddress,\n\t\t\t\t\t\towner: address,\n\t\t\t\t\t\twalletType: this.config.config.walletKind,\n\t\t\t\t\t\tcontractType: props.contractType,\n\t\t\t\t\t\torderbook: OrderbookKind.sequence_marketplace_v2,\n\t\t\t\t\t\tlisting: props.listing,\n\t\t\t\t\t})\n\t\t\t\t\t.then((resp) => resp.steps);\n\n\t\t\tcase TransactionType.OFFER:\n\t\t\t\treturn this.marketplaceClient\n\t\t\t\t\t.generateOfferTransaction({\n\t\t\t\t\t\tcollectionAddress,\n\t\t\t\t\t\tmaker: address,\n\t\t\t\t\t\twalletType: this.config.config.walletKind,\n\t\t\t\t\t\tcontractType: props.contractType,\n\t\t\t\t\t\torderbook: OrderbookKind.sequence_marketplace_v2,\n\t\t\t\t\t\toffer: props.offer,\n\t\t\t\t\t})\n\t\t\t\t\t.then((resp) => resp.steps);\n\n\t\t\tcase TransactionType.CANCEL:\n\t\t\t\treturn this.marketplaceClient\n\t\t\t\t\t.generateCancelTransaction({\n\t\t\t\t\t\tcollectionAddress,\n\t\t\t\t\t\tmaker: address,\n\t\t\t\t\t\tmarketplace: props.marketplace,\n\t\t\t\t\t\torderId: props.orderId,\n\t\t\t\t\t})\n\t\t\t\t\t.then((resp) => resp.steps);\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unknown transaction type: ${type}`);\n\t\t}\n\t}\n\n\tprivate clearMemoizedSteps() {\n\t\tdebug('Clearing memoized steps');\n\t\tthis.memoizedSteps = null;\n\t\tthis.lastProps = null;\n\t}\n\n\tprivate async transition(newState: TransactionState) {\n\t\tdebug(`State transition: ${this.currentState} -> ${newState}`);\n\t\tthis.currentState = newState;\n\t\tthis.clearMemoizedSteps();\n\t}\n\n\tprivate getChainId() {\n\t\treturn this.walletClient.chain?.id;\n\t}\n\n\tprivate getChainForTransaction() {\n\t\tconst chainId = this.config.config.chainId;\n\t\treturn this.config.config.chains.find(\n\t\t\t(chain) => chain.id === Number(chainId),\n\t\t);\n\t}\n\n\tprivate isOnCorrectChain() {\n\t\treturn this.getChainId() === Number(this.config.config.chainId);\n\t}\n\n\tprivate async switchChain(): Promise<void> {\n\t\tif (!this.isOnCorrectChain()) {\n\t\t\tawait this.transition(TransactionState.SWITCH_CHAIN);\n\t\t\tawait this.switchChainFn(this.config.config.chainId);\n\t\t\tawait this.walletClient.switchChain({\n\t\t\t\tid: Number(this.config.config.chainId),\n\t\t\t});\n\t\t\tdebug('Switched chain');\n\t\t}\n\t}\n\n\tasync start({ props }: { props: TransactionInput['props'] }) {\n\t\tdebug('Starting transaction', props);\n\t\ttry {\n\t\t\tawait this.transition(TransactionState.CHECKING_STEPS);\n\t\t\tconst { type } = this.config.config;\n\n\t\t\tconst steps = await this.generateSteps({\n\t\t\t\ttype,\n\t\t\t\tprops,\n\t\t\t} as TransactionInput);\n\n\t\t\tfor (const step of steps) {\n\t\t\t\ttry {\n\t\t\t\t\tawait this.executeStep({ step, props });\n\t\t\t\t} catch (error) {\n\t\t\t\t\tawait this.transition(TransactionState.ERROR);\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tawait this.transition(TransactionState.SUCCESS);\n\t\t} catch (error) {\n\t\t\tdebug('Transaction failed', error);\n\t\t\tawait this.transition(TransactionState.ERROR);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tprivate async handleTransactionSuccess(hash?: Hash) {\n\t\tif (!hash) {\n\t\t\t// TODO: This is to handle signature steps, but it's not ideal\n\t\t\tawait this.transition(TransactionState.SUCCESS);\n\t\t\treturn;\n\t\t}\n\t\tawait this.transition(TransactionState.CONFIRMING);\n\t\tthis.config.onTransactionSent?.(hash);\n\n\t\tconst receipt = await this.publicClient.waitForTransactionReceipt({ hash });\n\t\tdebug('Transaction confirmed', receipt);\n\n\t\tawait this.transition(TransactionState.SUCCESS);\n\t\tthis.config.onSuccess?.(hash);\n\t}\n\n\tprivate async executeTransaction(step: Step): Promise<Hash> {\n\t\tconst transactionData = {\n\t\t\taccount: this.getAccount(),\n\t\t\tchain: this.getChainForTransaction(),\n\t\t\tto: step.to as Hex,\n\t\t\tdata: step.data as Hex,\n\t\t\tvalue: BigInt(step.value || '0'),\n\t\t};\n\t\tdebug('Executing transaction', transactionData);\n\t\tconst hash = await this.walletClient.sendTransaction(transactionData);\n\t\tdebug('Transaction submitted', { hash });\n\t\tawait this.handleTransactionSuccess(hash);\n\t\treturn hash;\n\t}\n\n\tprivate async executeSignature(step: Step) {\n\t\tdebug('Executing signature', { stepId: step.id });\n\t\tlet signature: Hex;\n\t\tif (!step.post) {\n\t\t\tthrow new Error('Missing post step');\n\t\t}\n\t\tswitch (step.id) {\n\t\t\tcase StepType.signEIP712:\n\t\t\t\tif (!step.signature) {\n\t\t\t\t\tthrow new Error('Missing signature data');\n\t\t\t\t}\n\t\t\t\tsignature = await this.walletClient.signTypedData({\n\t\t\t\t\tdomain: step.signature.domain as TypedDataDomain,\n\t\t\t\t\ttypes: step.signature.types,\n\t\t\t\t\tprimaryType: step.signature.primaryType,\n\t\t\t\t\taccount: this.getAccountAddress(),\n\t\t\t\t\tmessage: step.signature.value,\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase StepType.signEIP191:\n\t\t\t\tsignature = await this.walletClient.signMessage({\n\t\t\t\t\tmessage: step.data,\n\t\t\t\t\taccount: step.to as Hex,\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Invalid signature step: ${step.id}`);\n\t\t}\n\n\t\tawait this.marketplaceClient.execute({\n\t\t\tsignature,\n\t\t\texecuteType: ExecuteType.order,\n\t\t\tbody: step.post,\n\t\t});\n\t\tawait this.handleTransactionSuccess();\n\t}\n\n\tprivate openPaymentModalWithPromise(\n\t\tsettings: Omit<SelectPaymentSettings, 'onSuccess' | 'onError'>,\n\t): Promise<void> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.openSelectPaymentModal({\n\t\t\t\t...settings,\n\t\t\t\tonSuccess: async (hash: string) => {\n\t\t\t\t\tawait this.handleTransactionSuccess(hash as Hash);\n\t\t\t\t\tresolve();\n\t\t\t\t},\n\t\t\t\tonError: (error: Error) => {\n\t\t\t\t\tthis.config.onError?.(error);\n\t\t\t\t\treject(error);\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t}\n\n\tprivate async executeBuyStep({\n\t\tstep,\n\t\tprops,\n\t}: {\n\t\tstep: Step;\n\t\tprops: BuyInput;\n\t}) {\n\t\tthis.transition(TransactionState.EXECUTING_TRANSACTION);\n\t\tconst [checkoutOptions, orders] = await Promise.all([\n\t\t\tthis.marketplaceClient.checkoutOptionsMarketplace({\n\t\t\t\twallet: this.getAccountAddress(),\n\t\t\t\torders: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcontractAddress: this.config.config.collectionAddress,\n\t\t\t\t\t\torderId: props.orderId,\n\t\t\t\t\t\tmarketplace: props.marketplace,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tadditionalFee: Number(\n\t\t\t\t\tthis.getMarketplaceFee(this.config.config.collectionAddress).amount,\n\t\t\t\t),\n\t\t\t}),\n\t\t\tthis.marketplaceClient.getOrders({\n\t\t\t\tinput: [\n\t\t\t\t\t{\n\t\t\t\t\t\torderId: props.orderId,\n\t\t\t\t\t\tmarketplace: props.marketplace,\n\t\t\t\t\t\tcontractAddress: this.config.config.collectionAddress,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}),\n\t\t]);\n\n\t\tconst order = orders.orders[0];\n\n\t\tawait this.openPaymentModalWithPromise({\n\t\t\t// biome-ignore lint/style/noNonNullAssertion: <explanation>\n\t\t\tchain: this.getChainId()!,\n\t\t\tcollectibles: [\n\t\t\t\t{\n\t\t\t\t\ttokenId: order.tokenId,\n\t\t\t\t\tquantity: props.quantity,\n\t\t\t\t\tdecimals: props.collectableDecimals,\n\t\t\t\t},\n\t\t\t],\n\t\t\tcurrencyAddress: order.priceCurrencyAddress,\n\t\t\tprice: order.priceAmount,\n\t\t\ttargetContractAddress: step.to,\n\t\t\ttxData: step.data as Hex,\n\t\t\tcollectionAddress: this.config.config.collectionAddress,\n\t\t\trecipientAddress: this.getAccountAddress(),\n\t\t\tenableMainCurrencyPayment: true,\n\t\t\tenableSwapPayments: !!checkoutOptions.options?.swap?.includes(\n\t\t\t\tTransactionSwapProvider.zerox,\n\t\t\t),\n\t\t\tcreditCardProviders: checkoutOptions?.options.nftCheckout || [],\n\t\t});\n\t}\n\n\tprivate async executeStep({\n\t\tstep,\n\t\tprops,\n\t}: {\n\t\tstep: Step;\n\t\tprops: TransactionInput['props'];\n\t}) {\n\t\tdebug('Executing step', { stepId: step.id });\n\t\tif (!step.to && !step.signature) {\n\t\t\tthrow new Error('Invalid step data');\n\t\t}\n\n\t\ttry {\n\t\t\tawait this.switchChain();\n\t\t\tif (step.id === StepType.buy) {\n\t\t\t\tawait this.executeBuyStep({ step, props: props as BuyInput });\n\t\t\t} else if (step.signature) {\n\t\t\t\tawait this.executeSignature(step);\n\t\t\t} else if (step.id === StepType.tokenApproval) {\n\t\t\t\t//TODO: Add some sort ofs callback heres\n\t\t\t\tconst hash = await this.executeTransaction(step);\n\t\t\t\treturn { hash }\n\t\t\t} else {\n\t\t\t\tconst hash = await this.executeTransaction(step);\n\t\t\t\tthis.config.onSuccess?.(hash);\n\t\t\t\treturn { hash };\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthis.config.onError?.(error as Error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tasync getTransactionSteps(\n\t\tprops: TransactionInput['props'],\n\t): Promise<TransactionSteps> {\n\t\tdebug('Getting transaction steps', props);\n\t\t// Return memoized value if props and state haven't changed\n\t\tif (\n\t\t\tthis.memoizedSteps &&\n\t\t\tthis.lastProps &&\n\t\t\tJSON.stringify(props) === JSON.stringify(this.lastProps)\n\t\t) {\n\t\t\tdebug('Returning memoized steps');\n\t\t\treturn this.memoizedSteps;\n\t\t}\n\n\t\tconst type = this.config.config.type;\n\t\tconst steps = await this.generateSteps({\n\t\t\ttype,\n\t\t\tprops,\n\t\t} as TransactionInput);\n\t\t// Extract execution step, it should always be the last step\n\t\tconst executionStep = steps.pop();\n\t\tif (!executionStep) {\n\t\t\tthrow new Error('No steps found');\n\t\t}\n\t\tif (executionStep.id === StepType.tokenApproval) {\n\t\t\tthrow new Error('No execution step found, only approval step');\n\t\t}\n\t\tconst approvalStep = steps.pop();\n\n\t\tif (steps.length > 0) {\n\t\t\tthrow new Error('Unexpected steps found');\n\t\t}\n\n\t\tthis.lastProps = props;\n\t\tthis.memoizedSteps = {\n\t\t\tswitchChain: {\n\t\t\t\tisPending: !this.isOnCorrectChain(),\n\t\t\t\tisExecuting: this.currentState === TransactionState.SWITCH_CHAIN,\n\t\t\t\texecute: () => this.switchChain(),\n\t\t\t},\n\t\t\tapproval: {\n\t\t\t\tisPending: Boolean(approvalStep),\n\t\t\t\tisExecuting: this.currentState === TransactionState.TOKEN_APPROVAL,\n\t\t\t\texecute: () =>\n\t\t\t\t\tapprovalStep && this.executeStep({ step: approvalStep, props }),\n\t\t\t},\n\t\t\ttransaction: {\n\t\t\t\tisPending: Boolean(executionStep),\n\t\t\t\tisExecuting:\n\t\t\t\t\tthis.currentState === TransactionState.EXECUTING_TRANSACTION,\n\t\t\t\texecute: () => this.executeStep({ step: executionStep, props }),\n\t\t\t},\n\t\t} as const;\n\n\t\tdebug('Generated new transaction steps', this.memoizedSteps);\n\t\treturn this.memoizedSteps;\n\t}\n}\n","import { useSelectPaymentModal } from '@0xsequence/kit-checkout';\nimport type { Hash } from 'viem';\nimport { useAccount, useSwitchChain, useWalletClient } from 'wagmi';\nimport { getPublicRpcClient } from '../../../utils';\nimport { useConfig, useMarketplaceConfig } from '../../hooks';\nimport { useSwitchChainModal } from '../../ui/modals/_internal/components/switchChainModal';\nimport { WalletKind } from '../api';\nimport {\n\ttype TransactionConfig,\n\tTransactionMachine,\n} from './execute-transaction';\n\nexport type UseTransactionMachineConfig = Omit<\n\tTransactionConfig,\n\t'sdkConfig' | 'marketplaceConfig' | 'walletKind' | 'chains'\n>;\n\nexport const useTransactionMachine = (\n\tconfig: UseTransactionMachineConfig,\n\tonSuccess?: (hash: Hash) => void,\n\tonError?: (error: Error) => void,\n\tonTransactionSent?: (hash: Hash) => void,\n) => {\n\tconst { data: walletClient } = useWalletClient();\n\tconst { show: showSwitchChainModal } = useSwitchChainModal();\n\tconst sdkConfig = useConfig();\n\tconst { data: marketplaceConfig, error: marketplaceError } =\n\t\tuseMarketplaceConfig();\n\tconst { openSelectPaymentModal } = useSelectPaymentModal();\n\tconst { chains } = useSwitchChain();\n\n\tconst { connector } = useAccount();\n\tconst walletKind =\n\t\tconnector?.id === 'sequence' ? WalletKind.sequence : WalletKind.unknown;\n\n\tif (marketplaceError) {\n\t\tthrow marketplaceError; //TODO: Add error handling\n\t}\n\n\tif (!walletClient || !marketplaceConfig) return null;\n\n\treturn new TransactionMachine(\n\t\t{\n\t\t\tconfig: { sdkConfig, marketplaceConfig, walletKind, chains, ...config },\n\t\t\tonSuccess,\n\t\t\tonError,\n\t\t\tonTransactionSent,\n\t\t},\n\t\twalletClient,\n\t\tgetPublicRpcClient(config.chainId),\n\t\topenSelectPaymentModal,\n\t\tasync (chainId) => {\n\t\t\treturn new Promise<void>((resolve, reject) => {\n\t\t\t\tshowSwitchChainModal({\n\t\t\t\t\tchainIdToSwitchTo: Number(chainId),\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t},\n\t\t\t\t\tonError: (error) => {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t});\n\t\t},\n\t);\n};\n","import {\n\tButton,\n\tCloseIcon,\n\tIconButton,\n\tSpinner,\n\tText,\n} from '@0xsequence/design-system';\nimport { observer } from '@legendapp/state/react';\nimport { Close, Content, Overlay, Portal, Root } from '@radix-ui/react-dialog';\nimport type { SwitchChainErrorType } from 'viem';\nimport { useSwitchChain } from 'wagmi';\nimport { getPresentableChainName } from '../../../../../../utils/network';\nimport type { ChainId } from '../../../../../_internal';\nimport AlertMessage from '../alertMessage';\nimport { switchChainModal$ } from './store';\nimport {\n\tcloseButton,\n\tdialogOverlay,\n\tswitchChainCta,\n\tswitchChainModalContent,\n} from './styles.css';\n\nexport type ShowSwitchChainModalArgs = {\n\tchainIdToSwitchTo: ChainId;\n\tonSuccess?: () => void;\n\tonError?: (error: SwitchChainErrorType) => void;\n};\n\nexport const useSwitchChainModal = () => {\n\treturn {\n\t\tshow: (args: ShowSwitchChainModalArgs) => switchChainModal$.open(args),\n\t\tclose: () => switchChainModal$.close(),\n\t\tisSwitching$: switchChainModal$.state.isSwitching,\n\t};\n};\n\nconst SwitchChainModal = observer(() => {\n\tconst chainIdToSwitchTo = switchChainModal$.state.chainIdToSwitchTo.get();\n\tconst isSwitching$ = switchChainModal$.state.isSwitching;\n\tconst chainName = getPresentableChainName(chainIdToSwitchTo!);\n\tconst { switchChainAsync } = useSwitchChain();\n\n\tasync function handleSwitchChain() {\n\t\tisSwitching$.set(true);\n\n\t\ttry {\n\t\t\tawait switchChainAsync({ chainId: Number(chainIdToSwitchTo!) });\n\n\t\t\tswitchChainModal$.state.onSuccess?.();\n\n\t\t\tswitchChainModal$.close();\n\t\t} catch (error) {\n\t\t\tswitchChainModal$.state.onError?.(error as SwitchChainErrorType);\n\t\t} finally {\n\t\t\tisSwitching$.set(false);\n\t\t}\n\t}\n\n\treturn (\n\t\t<Root open={switchChainModal$.isOpen.get()}>\n\t\t\t<Portal>\n\t\t\t\t<Overlay className={dialogOverlay} />\n\n\t\t\t\t<Content className={switchChainModalContent}>\n\t\t\t\t\t<Text fontSize=\"large\" fontWeight=\"bold\" color=\"text100\">\n\t\t\t\t\t\tWrong network\n\t\t\t\t\t</Text>\n\n\t\t\t\t\t<AlertMessage\n\t\t\t\t\t\ttype=\"warning\"\n\t\t\t\t\t\tmessage={`You need to switch to ${chainName} network before completing the transaction`}\n\t\t\t\t\t/>\n\n\t\t\t\t\t<Button\n\t\t\t\t\t\tname=\"switch-chain\"\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\tlabel={isSwitching$.get() ? <Spinner /> : 'Switch Network'}\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tpending={isSwitching$.get()}\n\t\t\t\t\t\tshape=\"square\"\n\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\tisSwitching$.get()\n\t\t\t\t\t\t\t\t? switchChainCta.pending\n\t\t\t\t\t\t\t\t: switchChainCta.default\n\t\t\t\t\t\t}\n\t\t\t\t\t\tjustifySelf=\"flex-end\"\n\t\t\t\t\t\tonClick={handleSwitchChain}\n\t\t\t\t\t/>\n\n\t\t\t\t\t<Close\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tswitchChainModal$.delete();\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tclassName={closeButton}\n\t\t\t\t\t\tasChild\n\t\t\t\t\t>\n\t\t\t\t\t\t<IconButton size=\"xs\" aria-label=\"Close modal\" icon={CloseIcon} />\n\t\t\t\t\t</Close>\n\t\t\t\t</Content>\n\t\t\t</Portal>\n\t\t</Root>\n\t);\n});\n\nexport default SwitchChainModal;\n","import SvgInfoIcon from '../../../../icons/InfoIcon';\nimport { alertMessageBox, alertMessageBoxVariants } from './styles.css';\nimport { Box, Text, WarningIcon } from '@0xsequence/design-system';\n\ntype AlertMessageProps = {\n\tmessage: string;\n\ttype: 'warning' | 'info';\n};\n\nexport default function AlertMessage({ message, type }: AlertMessageProps) {\n\treturn (\n\t\t<Box className={`${alertMessageBox} ${alertMessageBoxVariants[type]}`}>\n\t\t\t<Text color=\"white\" fontSize=\"normal\" fontWeight=\"medium\">\n\t\t\t\t{message}\n\t\t\t</Text>\n\n\t\t\t{type === 'warning' && <WarningIcon size=\"sm\" color=\"white\" />}\n\t\t\t{type === 'info' && <SvgInfoIcon size=\"sm\" color=\"white\" />}\n\t\t</Box>\n\t);\n}\n","import { observable } from '@legendapp/state';\nimport type { SwitchChainErrorType } from 'viem';\nimport type { ShowSwitchChainModalArgs } from '.';\nimport type { ChainId } from '../../../../../_internal';\n\nexport interface SwitchChainModalState {\n\tisOpen: boolean;\n\topen: (args: ShowSwitchChainModalArgs) => void;\n\tclose: () => void;\n\tstate: {\n\t\tchainIdToSwitchTo: ChainId | undefined;\n\t\tisSwitching: boolean;\n\t\tonSuccess: (() => void) | undefined;\n\t\tonError: undefined | ((error: SwitchChainErrorType) => void);\n\t};\n}\n\nexport const initialState: SwitchChainModalState = {\n\tisOpen: false,\n\topen: ({ chainIdToSwitchTo, onError, onSuccess }) => {\n\t\tswitchChainModal$.state.set({\n\t\t\t...switchChainModal$.state.get(),\n\t\t\tchainIdToSwitchTo,\n\t\t\tonError,\n\t\t\tonSuccess,\n\t\t});\n\t\tswitchChainModal$.isOpen.set(true);\n\t},\n\tclose: () => {\n\t\tswitchChainModal$.isOpen.set(false);\n\t\tswitchChainModal$.state.set({\n\t\t\t...initialState.state,\n\t\t});\n\t},\n\tstate: {\n\t\tchainIdToSwitchTo: undefined,\n\t\tonError: undefined,\n\t\tonSuccess: undefined,\n\t\tisSwitching: false,\n\t},\n};\n\nexport const switchChainModal$ = observable(initialState);\n","import {\n\ttype CancelInput,\n\tTransactionType,\n} from '../_internal/transaction-machine/execute-transaction';\nimport {\n\tuseTransactionMachine,\n\ttype UseTransactionMachineConfig,\n} from '../_internal/transaction-machine/useTransactionMachine';\n\ninterface UseCancelOrderArgs extends Omit<UseTransactionMachineConfig, 'type'> {\n\tonSuccess?: (hash: string) => void;\n\tonError?: (error: Error) => void;\n\tonTransactionSent?: (hash: string) => void;\n}\n\nexport const useCancelOrder = ({\n\tonSuccess,\n\tonError,\n\tonTransactionSent,\n\t...config\n}: UseCancelOrderArgs) => {\n\tconst machine = useTransactionMachine(\n\t\t{\n\t\t\t...config,\n\t\t\ttype: TransactionType.CANCEL,\n\t\t},\n\t\tonSuccess,\n\t\tonError,\n\t\tonTransactionSent,\n\t);\n\n\treturn {\n\t\tcancel: (props: CancelInput) => machine?.start({ props }),\n\t\tonError,\n\t\tonSuccess,\n\t\tonTransactionSent,\n\t};\n};\n","import {\n\ttype BuyInput,\n\tTransactionType,\n} from '../_internal/transaction-machine/execute-transaction';\nimport {\n\tuseTransactionMachine,\n\ttype UseTransactionMachineConfig,\n} from '../_internal/transaction-machine/useTransactionMachine';\n\ninterface UseBuyOrderArgs extends Omit<UseTransactionMachineConfig, 'type'> {\n\tonSuccess?: (hash: string) => void;\n\tonError?: (error: Error) => void;\n\tonTransactionSent?: (hash: string) => void;\n}\n\nexport const useBuyCollectable = ({\n\tonSuccess,\n\tonError,\n\tonTransactionSent,\n\t...config\n}: UseBuyOrderArgs) => {\n\tconst machine = useTransactionMachine(\n\t\t{\n\t\t\t...config,\n\t\t\ttype: TransactionType.BUY,\n\t\t},\n\t\tonSuccess,\n\t\tonError,\n\t\tonTransactionSent,\n\t);\n\n\treturn {\n\t\tbuy: (props: BuyInput) => machine?.start({ props }),\n\t\tonError,\n\t\tonSuccess,\n\t\tonTransactionSent,\n\t};\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,cAAc,WAAW,gBAAgB;AAElD,SAAS,SAAS;;;ACAlB,SAAS,kBAAkB;;;ACA3B,SAAS,qBAAqB;AAC9B,OAAO;AAiBJ;AAbI,IAAM,wBAAwB,cAAc,CAAC,CAAc;AAO3D,SAAS,oBAAoB;AAAA,EACnC;AAAA,EACA;AACD,GAAgC;AAC/B,SACC,oBAAC,sBAAsB,UAAtB,EAA+B,OAAO,QACtC,8BAAC,SAAI,IAAI,aAAc,UAAS,GACjC;AAEF;;;ADjBO,SAAS,YAAY;AAC3B,QAAM,UAAU,WAAW,qBAAqB;AAChD,MAAI,CAAC,SAAS;AACb,UAAM,IAAI;AAAA,MACT;AAAA,IACD;AAAA,EACD;AACA,SAAO;AACR;;;ADAA,IAAM,kCAAkC,EAAE,OAAO;AA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AA,EACA,GAAG;AACJ,MAA0B;AACzB,QAAM,UAAU;AAAA,IACf;AAAA,MACC,GAAG;AAAA,MACH;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,SAAO;AAAA,IACN,QAAQ,CAAC,UAAuB,SAAS,MAAM,EAAE,MAAM,CAAC;AAAA,IACxD;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;;;ACtBO,IAAM,oBAAoB,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,MAAuB;AACtB,QAAM,UAAU;AAAA,IACf;AAAA,MACC,GAAG;AAAA,MACH;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,SAAO;AAAA,IACN,KAAK,CAAC,UAAoB,SAAS,MAAM,EAAE,MAAM,CAAC;AAAA,IAClD;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;","names":["queryOptions","useQuery","z","z","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","collection","queryOptions","useQuery","queryOptions","useQuery","z","ChainIdCoerce","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","SortOrder","z","z","sortOrderSchema","SortOrder","sortBySchema","pageSchema","infiniteQueryOptions","useInfiniteQuery","z","z","infiniteQueryOptions","useInfiniteQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","useQuery","queryOptions","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","useMutation","dateToUnixTime","useMutation","useMutation","z","z","useMutation","useMutation","z","z","useMutation","queryOptions","useQuery","z","useAccount","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","useAccount","z","queryOptions","useQuery","collection","useAccount","useSwitchChain","Text","jsx","jsx","jsxs","Text","useSwitchChain","useAccount"]}
1
+ {"version":3,"sources":["../src/react/hooks/useBalanceOfCollectible.tsx","../src/react/hooks/useConfig.tsx","../src/react/provider.tsx","../src/react/hooks/useCountOfCollectables.tsx","../src/react/_internal/api/zod-schema.ts","../src/react/hooks/useCollectible.tsx","../src/react/hooks/useCollection.tsx","../src/react/hooks/useCurrencies.tsx","../src/react/hooks/useCurrency.tsx","../src/react/hooks/useFilters.tsx","../src/react/hooks/useFloorOrder.tsx","../src/react/hooks/useHighestOffer.tsx","../src/react/hooks/useListBalances.tsx","../src/react/hooks/useListCollectibles.tsx","../src/react/hooks/useListOffersForCollectible.tsx","../src/react/hooks/useListListingsForCollectible.tsx","../src/react/hooks/useLowestListing.tsx","../src/react/hooks/useMarketplaceConfig.tsx","../src/react/hooks/options/marketplaceConfigOptions.ts","../src/react/hooks/useRoyaltyPercentage.tsx","../src/react/hooks/useGenerateListingTransaction.tsx","../src/react/hooks/useGenerateOfferTransaction.tsx","../src/react/hooks/useGenerateSellTransaction.tsx","../src/react/hooks/useGenerateCancelTransaction.tsx","../src/react/hooks/useTransferTokens.tsx","../src/react/hooks/useCheckoutOptions.tsx","../src/react/hooks/useListCollections.tsx","../src/react/hooks/useGenerateBuyTransaction.tsx","../src/react/_internal/transaction-machine/execute-transaction.ts","../src/react/_internal/transaction-machine/useTransactionMachine.ts","../src/react/ui/modals/_internal/components/switchChainModal/index.tsx","../src/react/ui/modals/_internal/components/alertMessage/index.tsx","../src/react/ui/modals/_internal/components/switchChainModal/store.ts","../src/react/hooks/useCancelOrder.tsx","../src/react/hooks/useBuyCollectable.tsx"],"sourcesContent":["import { queryOptions, skipToken, useQuery } from '@tanstack/react-query';\nimport type { Hex } from 'viem';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tCollectableIdSchema,\n\ttype QueryArgSchema,\n\tcollectableKeys,\n\tgetIndexerClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nconst fetchBalanceOfCollectibleSchema = z.object({\n\tcollectionAddress: AddressSchema,\n\tcollectableId: CollectableIdSchema.pipe(z.coerce.string()),\n\tuserAddress: AddressSchema,\n\tchainId: ChainIdSchema.pipe(z.coerce.number()),\n});\n\ntype FetchBalanceOfCollectibleArgs = z.input<\n\ttypeof fetchBalanceOfCollectibleSchema\n>;\n\nconst fetchBalanceOfCollectible = async (\n\targs: FetchBalanceOfCollectibleArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst parsedArgs = fetchBalanceOfCollectibleSchema.parse(args);\n\tconst indexerClient = getIndexerClient(parsedArgs.chainId, config);\n\treturn indexerClient\n\t\t.getTokenBalances({\n\t\t\taccountAddress: parsedArgs.userAddress,\n\t\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\t\ttokenID: parsedArgs.collectableId,\n\t\t\tincludeMetadata: false,\n\t\t\tmetadataOptions: {\n\t\t\t\tverifiedOnly: true,\n\t\t\t\tincludeContracts: [parsedArgs.collectionAddress],\n\t\t\t},\n\t\t})\n\t\t.then((res) => res.balances[0] || null);\n};\n\ninterface BalanceOfCollectibleOptions\n\textends Omit<FetchBalanceOfCollectibleArgs, 'userAddress'> {\n\tuserAddress: Hex | undefined;\n\tquery?: z.infer<typeof QueryArgSchema>;\n}\nexport const balanceOfCollectibleOptions = (\n\targs: BalanceOfCollectibleOptions,\n\tconfig: SdkConfig,\n) => {\n\tconst enabled = !!args.userAddress && (args.query?.enabled ?? true);\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.userBalances, args],\n\t\tqueryFn: enabled\n\t\t\t? () =>\n\t\t\t\t\tfetchBalanceOfCollectible(\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t...args,\n\t\t\t\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: this is guaranteed by the userAddress check above\n\t\t\t\t\t\t\tuserAddress: args.userAddress!,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tconfig,\n\t\t\t\t\t)\n\t\t\t: skipToken,\n\t\tenabled,\n\t});\n};\n\nexport const useBalanceOfCollectible = (args: BalanceOfCollectibleOptions) => {\n\tconst config = useConfig();\n\treturn useQuery(balanceOfCollectibleOptions(args, config));\n};\n","'use client';\n\nimport { useContext } from 'react';\n\nimport { MarketplaceSdkContext } from '../provider';\n\nexport function useConfig() {\n\tconst context = useContext(MarketplaceSdkContext);\n\tif (!context) {\n\t\tthrow new Error(\n\t\t\t'Marketplace SDK must be used within a MarketplaceSdkProvider',\n\t\t);\n\t}\n\treturn context;\n}\n","'use client';\n\nimport { createContext } from 'react';\nimport '@0xsequence/design-system/styles.css';\nimport type { SdkConfig } from '../types';\nimport { PROVIDER_ID } from './_internal/get-provider';\n\nexport const MarketplaceSdkContext = createContext({} as SdkConfig);\n\nexport type MarketplaceSdkProviderProps = {\n\tconfig: SdkConfig;\n\tchildren: React.ReactNode;\n};\n\nexport function MarketplaceProvider({\n\tconfig,\n\tchildren,\n}: MarketplaceSdkProviderProps) {\n\treturn (\n\t\t<MarketplaceSdkContext.Provider value={config}>\n\t\t\t<div id={PROVIDER_ID}>{children}</div>\n\t\t</MarketplaceSdkContext.Provider>\n\t);\n}\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tOrderSide,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { collectiblesFilterSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst BaseSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tquery: QueryArgSchema,\n});\n\nconst UseCountOfCollectableSchema = BaseSchema.extend({\n\tfilter: collectiblesFilterSchema,\n\tside: z.nativeEnum(OrderSide),\n}).or(\n\tBaseSchema.extend({\n\t\tfilter: z.undefined(),\n\t\tside: z.undefined(),\n\t}),\n);\n\nexport type UseCountOfCollectablesArgs = z.infer<\n\ttypeof UseCountOfCollectableSchema\n>;\n\nexport type UseContOfCollectableReturn = Awaited<\n\tReturnType<typeof fetchCountOfCollectables>\n>;\n\nconst fetchCountOfCollectables = async (\n\targs: UseCountOfCollectablesArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst parsedArgs = UseCountOfCollectableSchema.parse(args);\n\tconst marketplaceClient = getMarketplaceClient(parsedArgs.chainId, config);\n\tif (parsedArgs.filter) {\n\t\treturn marketplaceClient\n\t\t\t.getCountOfFilteredCollectibles({\n\t\t\t\t...parsedArgs,\n\t\t\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\t\t\t// biome-ignore lint/style/noNonNullAssertion: safe to assert here, as it's validated\n\t\t\t\tside: parsedArgs.side!,\n\t\t\t})\n\t\t\t.then((resp) => resp.count);\n\t}\n\treturn marketplaceClient\n\t\t.getCountOfAllCollectibles({\n\t\t\t...parsedArgs,\n\t\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\t})\n\t\t.then((resp) => resp.count);\n};\n\nexport const countOfCollectablesOptions = (\n\targs: UseCountOfCollectablesArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.counts, args],\n\t\tqueryFn: () => fetchCountOfCollectables(args, config),\n\t});\n};\n\nexport const useCountOfCollectables = (args: UseCountOfCollectablesArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(countOfCollectablesOptions(args, config));\n};\n","// generated with https://transform.tools/typescript-to-zod\n//\n//\nimport { z } from 'zod';\nimport {\n\tCollectibleStatus,\n\tCollectionStatus,\n\tContractType,\n\tExecuteType,\n\tMarketplaceKind,\n\tOrderSide,\n\tOrderStatus,\n\tOrderbookKind,\n\tProjectStatus,\n\tPropertyType,\n\tSortOrder,\n\tSourceKind,\n\tStepType,\n\tTransactionCrypto,\n\tTransactionNFTCheckoutProvider,\n\tTransactionOnRampProvider,\n\tTransactionSwapProvider,\n\tWalletKind,\n} from './marketplace.gen';\n\nexport const assetSchema = z.object({\n\tid: z.number(),\n\tcollectionId: z.number(),\n\ttokenId: z.string(),\n\turl: z.string().optional(),\n\tmetadataField: z.string(),\n\tname: z.string().optional(),\n\tfilesize: z.number().optional(),\n\tmimeType: z.string().optional(),\n\twidth: z.number().optional(),\n\theight: z.number().optional(),\n\tupdatedAt: z.string().optional(),\n});\n\nexport const sortOrderSchema = z.nativeEnum(SortOrder);\n\nexport const propertyTypeSchema = z.nativeEnum(PropertyType);\n\nexport const marketplaceKindSchema = z.nativeEnum(MarketplaceKind);\n\nexport const orderbookKindSchema = z.nativeEnum(OrderbookKind);\n\nexport const sourceKindSchema = z.nativeEnum(SourceKind);\n\nexport const orderSideSchema = z.nativeEnum(OrderSide);\n\nexport const orderStatusSchema = z.nativeEnum(OrderStatus);\n\nexport const contractTypeSchema = z.nativeEnum(ContractType);\n\nexport const collectionStatusSchema = z.nativeEnum(CollectionStatus);\n\nexport const projectStatusSchema = z.nativeEnum(ProjectStatus);\n\nexport const collectibleStatusSchema = z.nativeEnum(CollectibleStatus);\n\nexport const walletKindSchema = z.nativeEnum(WalletKind);\n\nexport const stepTypeSchema = z.nativeEnum(StepType);\n\nexport const transactionCryptoSchema = z.nativeEnum(TransactionCrypto);\n\nexport const transactionNFTCheckoutProviderSchema = z.nativeEnum(\n\tTransactionNFTCheckoutProvider,\n);\n\nexport const transactionOnRampProviderSchema = z.nativeEnum(\n\tTransactionOnRampProvider,\n);\n\nexport const transactionSwapProviderSchema = z.nativeEnum(\n\tTransactionSwapProvider,\n);\n\nexport const executeTypeSchema = z.nativeEnum(ExecuteType);\n\nexport const sortBySchema = z.object({\n\tcolumn: z.string(),\n\torder: sortOrderSchema,\n});\n\nexport const propertyFilterSchema = z.object({\n\tname: z.string(),\n\ttype: propertyTypeSchema,\n\tmin: z.number().optional(),\n\tmax: z.number().optional(),\n\tvalues: z.array(z.any()).optional(),\n});\n\nexport const collectiblesFilterSchema = z.object({\n\tincludeEmpty: z.boolean(),\n\tsearchText: z.string().optional(),\n\tproperties: z.array(propertyFilterSchema).optional(),\n\tmarketplaces: z.array(marketplaceKindSchema).optional(),\n\tinAccounts: z.array(z.string()).optional(),\n\tnotInAccounts: z.array(z.string()).optional(),\n\tordersCreatedBy: z.array(z.string()).optional(),\n\tordersNotCreatedBy: z.array(z.string()).optional(),\n});\n\nexport const feeBreakdownSchema = z.object({\n\tkind: z.string(),\n\trecipientAddress: z.string(),\n\tbps: z.number(),\n});\n\nexport const orderFilterSchema = z.object({\n\tcreatedBy: z.array(z.string()).optional(),\n\tmarketplace: z.array(marketplaceKindSchema).optional(),\n\tcurrencies: z.array(z.string()).optional(),\n});\n\nexport const collectionLastSyncedSchema = z.object({\n\tallOrders: z.string(),\n\tnewOrders: z.string(),\n});\n\nexport const projectSchema = z.object({\n\tprojectId: z.number(),\n\tchainId: z.number(),\n\tcontractAddress: z.string(),\n\tstatus: projectStatusSchema,\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().optional(),\n});\n\nexport const collectibleSchema = z.object({\n\tchainId: z.number(),\n\tcontractAddress: z.string(),\n\tstatus: collectibleStatusSchema,\n\ttokenId: z.string(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().optional(),\n});\n\nexport const currencySchema = z.object({\n\tchainId: z.number(),\n\tcontractAddress: z.string(),\n\tname: z.string(),\n\tsymbol: z.string(),\n\tdecimals: z.number(),\n\timageUrl: z.string(),\n\texchangeRate: z.number(),\n\tdefaultChainCurrency: z.boolean(),\n\tnativeCurrency: z.boolean(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().optional(),\n});\n\nexport const orderDataSchema = z.object({\n\torderId: z.string(),\n\tquantity: z.string(),\n});\n\nexport const additionalFeeSchema = z.object({\n\tamount: z.string(),\n\treceiver: z.string(),\n});\n\nexport const postRequestSchema = z.object({\n\tendpoint: z.string(),\n\tmethod: z.string(),\n\tbody: z.any(),\n});\n\nexport const createReqSchema = z.object({\n\ttokenId: z.string(),\n\tquantity: z.string(),\n\texpiry: z.string(),\n\tcurrencyAddress: z.string(),\n\tpricePerToken: z.string(),\n});\n\nexport const getOrdersInputSchema = z.object({\n\tcontractAddress: z.string(),\n\torderId: z.string(),\n\tmarketplace: marketplaceKindSchema,\n});\n\nexport const domainSchema = z.object({\n\tname: z.string(),\n\tversion: z.string(),\n\tchainId: z.number(),\n\tverifyingContract: z.string(),\n});\n\nexport const checkoutOptionsMarketplaceOrderSchema = z.object({\n\tcontractAddress: z.string(),\n\torderId: z.string(),\n\tmarketplace: marketplaceKindSchema,\n});\n\nexport const checkoutOptionsItemSchema = z.object({\n\ttokenId: z.string(),\n\tquantity: z.string(),\n});\n\nexport const checkoutOptionsSchema = z.object({\n\tcrypto: transactionCryptoSchema,\n\tswap: z.array(transactionSwapProviderSchema),\n\tnftCheckout: z.array(transactionNFTCheckoutProviderSchema),\n\tonRamp: z.array(transactionOnRampProviderSchema),\n});\n\nexport const listCurrenciesArgsSchema = z.object({});\n\nexport const listCurrenciesReturnSchema = z.object({\n\tcurrencies: z.array(currencySchema),\n});\n\nexport const getCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n});\n\nexport const getLowestPriceOfferForCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const getHighestPriceOfferForCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const getLowestPriceListingForCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const getHighestPriceListingForCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const getCollectibleLowestOfferArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const getCollectibleHighestOfferArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const getCollectibleLowestListingArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilters: orderFilterSchema.optional(),\n});\n\nexport const getCollectibleHighestListingArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n});\n\nexport const generateBuyTransactionArgsSchema = z.object({\n\tcollectionAddress: z.string(),\n\tbuyer: z.string(),\n\tmarketplace: marketplaceKindSchema,\n\tordersData: z.array(orderDataSchema),\n\tadditionalFees: z.array(additionalFeeSchema),\n\twalletType: walletKindSchema.optional(),\n});\n\nexport const generateSellTransactionArgsSchema = z.object({\n\tcollectionAddress: z.string(),\n\tseller: z.string(),\n\tmarketplace: marketplaceKindSchema,\n\tordersData: z.array(orderDataSchema),\n\tadditionalFees: z.array(additionalFeeSchema),\n\twalletType: walletKindSchema.optional(),\n});\n\nexport const generateListingTransactionArgsSchema = z.object({\n\tcollectionAddress: z.string(),\n\towner: z.string(),\n\tcontractType: contractTypeSchema,\n\torderbook: orderbookKindSchema,\n\tlisting: createReqSchema,\n\twalletType: walletKindSchema.optional(),\n});\n\nexport const generateOfferTransactionArgsSchema = z.object({\n\tcollectionAddress: z.string(),\n\tmaker: z.string(),\n\tcontractType: contractTypeSchema,\n\torderbook: orderbookKindSchema,\n\toffer: createReqSchema,\n\twalletType: walletKindSchema.optional(),\n});\n\nexport const executeArgsSchema = z.object({\n\tsignature: z.string(),\n\texecuteType: executeTypeSchema,\n\tbody: z.any(),\n});\n\nexport const executeReturnSchema = z.object({\n\torderId: z.string(),\n});\n\nexport const getCountOfAllCollectiblesArgsSchema = z.object({\n\tcontractAddress: z.string(),\n});\n\nexport const getCountOfAllCollectiblesReturnSchema = z.object({\n\tcount: z.number(),\n});\n\nexport const getCountOfFilteredCollectiblesArgsSchema = z.object({\n\tside: orderSideSchema,\n\tcontractAddress: z.string(),\n\tfilter: collectiblesFilterSchema.optional(),\n});\n\nexport const getCountOfFilteredCollectiblesReturnSchema = z.object({\n\tcount: z.number(),\n});\n\nexport const getFloorOrderArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\tfilter: collectiblesFilterSchema.optional(),\n});\n\nexport const syncOrderReturnSchema = z.object({});\n\nexport const syncOrdersReturnSchema = z.object({});\n\nexport const checkoutOptionsMarketplaceArgsSchema = z.object({\n\twallet: z.string(),\n\torders: z.array(checkoutOptionsMarketplaceOrderSchema),\n\tadditionalFee: z.number(),\n});\n\nexport const checkoutOptionsMarketplaceReturnSchema = z.object({\n\toptions: checkoutOptionsSchema,\n});\n\nexport const checkoutOptionsSalesContractArgsSchema = z.object({\n\twallet: z.string(),\n\tcontractAddress: z.string(),\n\tcollectionAddress: z.string(),\n\titems: z.array(checkoutOptionsItemSchema),\n});\n\nexport const checkoutOptionsSalesContractReturnSchema = z.object({\n\toptions: checkoutOptionsSchema,\n});\n\nexport const tokenMetadataSchema = z.object({\n\ttokenId: z.string(),\n\tname: z.string(),\n\tdescription: z.string().optional(),\n\timage: z.string().optional(),\n\tvideo: z.string().optional(),\n\taudio: z.string().optional(),\n\tproperties: z.record(z.any()).optional(),\n\tattributes: z.array(z.record(z.any())),\n\timage_data: z.string().optional(),\n\texternal_url: z.string().optional(),\n\tbackground_color: z.string().optional(),\n\tanimation_url: z.string().optional(),\n\tdecimals: z.number().optional(),\n\tupdatedAt: z.string().optional(),\n\tassets: z.array(assetSchema).optional(),\n});\n\nexport const pageSchema = z.object({\n\tpage: z.number(),\n\tpageSize: z.number(),\n\tmore: z.boolean().optional(),\n\tsort: z.array(sortBySchema).optional(),\n});\n\nexport const filterSchema = z.object({\n\ttext: z.string().optional(),\n\tproperties: z.array(propertyFilterSchema).optional(),\n});\n\nexport const orderSchema = z.object({\n\torderId: z.string(),\n\tmarketplace: marketplaceKindSchema,\n\tside: orderSideSchema,\n\tstatus: orderStatusSchema,\n\tchainId: z.number(),\n\tcollectionContractAddress: z.string(),\n\ttokenId: z.string(),\n\tcreatedBy: z.string(),\n\tpriceAmount: z.string(),\n\tpriceAmountFormatted: z.string(),\n\tpriceAmountNet: z.string(),\n\tpriceAmountNetFormatted: z.string(),\n\tpriceCurrencyAddress: z.string(),\n\tpriceDecimals: z.number(),\n\tpriceUSD: z.number(),\n\tquantityInitial: z.string(),\n\tquantityInitialFormatted: z.string(),\n\tquantityRemaining: z.string(),\n\tquantityRemainingFormatted: z.string(),\n\tquantityAvailable: z.string(),\n\tquantityAvailableFormatted: z.string(),\n\tquantityDecimals: z.number(),\n\tfeeBps: z.number(),\n\tfeeBreakdown: z.array(feeBreakdownSchema),\n\tvalidFrom: z.string(),\n\tvalidUntil: z.string(),\n\tblockNumber: z.number(),\n\torderCreatedAt: z.string().optional(),\n\torderUpdatedAt: z.string().optional(),\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().optional(),\n});\n\nexport const collectibleOrderSchema = z.object({\n\tmetadata: tokenMetadataSchema,\n\torder: orderSchema.optional(),\n});\n\nexport const activitySchema = z.object({\n\ttype: z.string(),\n\tfromAddress: z.string(),\n\ttoAddress: z.string(),\n\ttxHash: z.string(),\n\ttimestamp: z.number(),\n\ttokenId: z.string(),\n\ttokenImage: z.string(),\n\ttokenName: z.string(),\n\tcurrency: currencySchema.optional(),\n});\n\nexport const collectionConfigSchema = z.object({\n\tlastSynced: z.record(collectionLastSyncedSchema),\n\tcollectiblesSynced: z.string(),\n});\n\nexport const signatureSchema = z.object({\n\tdomain: domainSchema,\n\ttypes: z.any(),\n\tprimaryType: z.string(),\n\tvalue: z.any(),\n});\n\nexport const getCollectibleReturnSchema = z.object({\n\tmetadata: tokenMetadataSchema,\n});\n\nexport const getLowestPriceOfferForCollectibleReturnSchema = z.object({\n\torder: orderSchema,\n});\n\nexport const getHighestPriceOfferForCollectibleReturnSchema = z.object({\n\torder: orderSchema,\n});\n\nexport const getLowestPriceListingForCollectibleReturnSchema = z.object({\n\torder: orderSchema,\n});\n\nexport const getHighestPriceListingForCollectibleReturnSchema = z.object({\n\torder: orderSchema,\n});\n\nexport const listListingsForCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listListingsForCollectibleReturnSchema = z.object({\n\tlistings: z.array(orderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const listOffersForCollectibleArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listOffersForCollectibleReturnSchema = z.object({\n\toffers: z.array(orderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const getCollectibleLowestOfferReturnSchema = z.object({\n\torder: orderSchema.optional(),\n});\n\nexport const getCollectibleHighestOfferReturnSchema = z.object({\n\torder: orderSchema.optional(),\n});\n\nexport const getCollectibleLowestListingReturnSchema = z.object({\n\torder: orderSchema.optional(),\n});\n\nexport const getCollectibleHighestListingReturnSchema = z.object({\n\torder: orderSchema.optional(),\n});\n\nexport const listCollectibleListingsArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectibleListingsReturnSchema = z.object({\n\tlistings: z.array(orderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectibleOffersArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\ttokenId: z.string(),\n\tfilter: orderFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectibleOffersReturnSchema = z.object({\n\toffers: z.array(orderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectiblesArgsSchema = z.object({\n\tside: orderSideSchema,\n\tcontractAddress: z.string(),\n\tfilter: collectiblesFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectiblesReturnSchema = z.object({\n\tcollectibles: z.array(collectibleOrderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const getFloorOrderReturnSchema = z.object({\n\tcollectible: collectibleOrderSchema,\n});\n\nexport const listCollectiblesWithLowestListingArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\tfilter: collectiblesFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectiblesWithLowestListingReturnSchema = z.object({\n\tcollectibles: z.array(collectibleOrderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectiblesWithHighestOfferArgsSchema = z.object({\n\tcontractAddress: z.string(),\n\tfilter: collectiblesFilterSchema.optional(),\n\tpage: pageSchema.optional(),\n});\n\nexport const listCollectiblesWithHighestOfferReturnSchema = z.object({\n\tcollectibles: z.array(collectibleOrderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const syncOrderArgsSchema = z.object({\n\torder: orderSchema,\n});\n\nexport const syncOrdersArgsSchema = z.object({\n\torders: z.array(orderSchema),\n});\n\nexport const getOrdersArgsSchema = z.object({\n\tinput: z.array(getOrdersInputSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const getOrdersReturnSchema = z.object({\n\torders: z.array(orderSchema),\n\tpage: pageSchema.optional(),\n});\n\nexport const collectionSchema = z.object({\n\tstatus: collectionStatusSchema,\n\tchainId: z.number(),\n\tcontractAddress: z.string(),\n\tcontractType: contractTypeSchema,\n\ttokenQuantityDecimals: z.number(),\n\tconfig: collectionConfigSchema,\n\tcreatedAt: z.string(),\n\tupdatedAt: z.string(),\n\tdeletedAt: z.string().optional(),\n});\n\nexport const stepSchema = z.object({\n\tid: stepTypeSchema,\n\tdata: z.string(),\n\tto: z.string(),\n\tvalue: z.string(),\n\tsignature: signatureSchema.optional(),\n\tpost: postRequestSchema.optional(),\n\texecuteType: executeTypeSchema.optional(),\n});\n\nexport const generateBuyTransactionReturnSchema = z.object({\n\tsteps: z.array(stepSchema),\n});\n\nexport const generateSellTransactionReturnSchema = z.object({\n\tsteps: z.array(stepSchema),\n});\n\nexport const generateListingTransactionReturnSchema = z.object({\n\tsteps: z.array(stepSchema),\n});\n\nexport const generateOfferTransactionReturnSchema = z.object({\n\tsteps: z.array(stepSchema),\n});\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMetadataClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nconst UseCollectibleSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tcollectibleId: z.string(),\n\tquery: QueryArgSchema,\n});\n\nexport type UseCollectibleArgs = z.infer<typeof UseCollectibleSchema>;\n\nexport type UseCollectibleReturn = Awaited<ReturnType<typeof fetchCollectible>>;\n\nconst fetchCollectible = async (\n\targs: UseCollectibleArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst parsedArgs = UseCollectibleSchema.parse(args);\n\tconst metadataClient = getMetadataClient(config);\n\treturn metadataClient\n\t\t.getTokenMetadata({\n\t\t\tchainID: parsedArgs.chainId,\n\t\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\t\ttokenIDs: [parsedArgs.collectibleId],\n\t\t})\n\t\t.then((resp) => resp.tokenMetadata[0]);\n};\n\nexport const collectibleOptions = (\n\targs: UseCollectibleArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.details, args, config],\n\t\tqueryFn: () => fetchCollectible(args, config),\n\t});\n};\n\nexport const useCollectible = (args: UseCollectibleArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(collectibleOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectionKeys,\n\tgetMetadataClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nconst UseCollectionSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tquery: QueryArgSchema,\n});\n\nexport type UseCollectionArgs = z.input<typeof UseCollectionSchema>;\n\nexport type UseCollectionReturn = Awaited<ReturnType<typeof fetchCollection>>;\n\nconst fetchCollection = async (args: UseCollectionArgs, config: SdkConfig) => {\n\tconst parsedArgs = UseCollectionSchema.parse(args);\n\tconst metadataClient = getMetadataClient(config);\n\treturn metadataClient\n\t\t.getContractInfo({\n\t\t\tchainID: parsedArgs.chainId,\n\t\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\t})\n\t\t.then((resp) => resp.contractInfo);\n};\n\nexport const collectionOptions = (\n\targs: UseCollectionArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectionKeys.detail, args, config],\n\t\tqueryFn: () => fetchCollection(args, config),\n\t});\n};\n\nexport const useCollection = (args: UseCollectionArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(collectionOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport { useConfig } from './useConfig';\nimport {\n\tChainIdSchema,\n\tAddressSchema,\n\tQueryArgSchema,\n\tgetMarketplaceClient,\n\ttype Currency,\n\tgetQueryClient,\n\tconfigKeys,\n\tcurrencyKeys,\n\ttype ChainId,\n} from '../_internal';\nimport type { SdkConfig, MarketplaceConfig } from '../../types';\n\nconst ChainIdCoerce = ChainIdSchema.transform((val) => val.toString());\n\nconst UseCurrenciesArgsSchema = z.object({\n\tchainId: ChainIdCoerce,\n\tcollectionAddress: AddressSchema.optional(),\n\tincludeNativeCurrency: z.boolean().optional(),\n\tquery: QueryArgSchema,\n});\n\ntype UseCurrenciesArgs = z.input<typeof UseCurrenciesArgsSchema>;\n\nexport type UseCurrenciesReturn = Awaited<ReturnType<typeof fetchCurrencies>>;\n\nconst fetchCurrencies = async (chainId: ChainId, config: SdkConfig) => {\n\tconst parsedChainId = ChainIdCoerce.parse(chainId);\n\tconst marketplaceClient = getMarketplaceClient(parsedChainId, config);\n\treturn marketplaceClient.listCurrencies().then((resp) => resp.currencies);\n};\n\nconst selectCurrencies = (data: Currency[], args: UseCurrenciesArgs) => {\n\tconst argsParsed = UseCurrenciesArgsSchema.parse(args);\n\t// if collectionAddress is passed, filter currencies based on collection currency options\n\tif (argsParsed.collectionAddress) {\n\t\tconst queryClient = getQueryClient();\n\t\tconst marketplaceConfigCache = queryClient.getQueriesData({\n\t\t\tqueryKey: configKeys.marketplace,\n\t\t})[0][1] as MarketplaceConfig;\n\n\t\tconst collection = marketplaceConfigCache?.collections.find(\n\t\t\t(collection) =>\n\t\t\t\tcollection.collectionAddress === argsParsed.collectionAddress,\n\t\t);\n\n\t\tif (!collection) {\n\t\t\tthrow new Error(\"Collection doesn't exist\");\n\t\t}\n\n\t\treturn data.filter(\n\t\t\t(currency) =>\n\t\t\t\tcollection.currencyOptions?.includes(currency.contractAddress) ||\n\t\t\t\t// biome-ignore lint/suspicious/noDoubleEquals: <explanation>\n\t\t\t\tcurrency.nativeCurrency == argsParsed.includeNativeCurrency ||\n\t\t\t\tcurrency.defaultChainCurrency,\n\t\t);\n\t}\n\t// if includeNativeCurrency is true, return all currencies\n\tif (argsParsed.includeNativeCurrency) {\n\t\treturn data;\n\t}\n\n\t// if includeNativeCurrency is false or undefined, filter out native currencies\n\treturn data.filter((currency) => !currency.nativeCurrency);\n};\n\nexport const currenciesOptions = (\n\targs: UseCurrenciesArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...currencyKeys.lists, args.chainId],\n\t\tqueryFn: () => fetchCurrencies(args.chainId, config),\n\t\tselect: (data) => selectCurrencies(data, args),\n\t\tenabled: args.query?.enabled,\n\t});\n};\n\nexport const useCurrencies = (args: UseCurrenciesArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(currenciesOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport { useConfig } from './useConfig';\nimport {\n\tChainIdSchema,\n\tAddressSchema,\n\tQueryArgSchema,\n\tgetMarketplaceClient,\n\ttype Currency,\n\tcurrencyKeys,\n\ttype ChainId,\n\tgetQueryClient,\n} from '../_internal';\nimport type { SdkConfig } from '../../types';\n\nconst ChainIdCoerce = ChainIdSchema.transform((val) => val.toString());\n\nconst UseCurrencyArgsSchema = z.object({\n\tchainId: ChainIdCoerce,\n\tcurrencyAddress: AddressSchema,\n\tquery: QueryArgSchema,\n});\n\ntype UseCurrencyArgs = z.input<typeof UseCurrencyArgsSchema>;\n\nexport type UseCurrencyReturn = Currency | undefined;\n\nconst fetchCurrency = async (\n\tchainId: ChainId,\n\tcurrencyAddress: string,\n\tconfig: SdkConfig,\n): Promise<Currency | undefined> => {\n\tconst parsedChainId = ChainIdCoerce.parse(chainId);\n\n\tconst queryClient = getQueryClient();\n\tlet currencies = queryClient.getQueryData([...currencyKeys.lists, chainId]) as\n\t\t| Currency[]\n\t\t| undefined;\n\n\tif (!currencies) {\n\t\tconst marketplaceClient = getMarketplaceClient(parsedChainId, config);\n\t\tcurrencies = await marketplaceClient\n\t\t\t.listCurrencies()\n\t\t\t.then((resp) => resp.currencies);\n\t}\n\n\treturn currencies?.find(\n\t\t(currency) =>\n\t\t\tcurrency.contractAddress.toLowerCase() === currencyAddress.toLowerCase(),\n\t);\n};\n\nexport const currencyOptions = (args: UseCurrencyArgs, config: SdkConfig) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...currencyKeys.details, args.chainId, args.currencyAddress],\n\t\tqueryFn: () => fetchCurrency(args.chainId, args.currencyAddress, config),\n\t});\n};\n\nexport const useCurrency = (args: UseCurrencyArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(currencyOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMetadataClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nconst UseFiltersSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tquery: QueryArgSchema,\n});\n\nexport type UseFiltersArgs = z.infer<typeof UseFiltersSchema>;\n\nexport type UseFilterReturn = Awaited<ReturnType<typeof fetchFilters>>;\n\nexport const fetchFilters = async (args: UseFiltersArgs, config: SdkConfig) => {\n\tconst parsedArgs = UseFiltersSchema.parse(args);\n\tconst metadataClient = getMetadataClient(config);\n\treturn metadataClient\n\t\t.tokenCollectionFilters({\n\t\t\tchainID: parsedArgs.chainId,\n\t\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\t})\n\t\t.then((resp) => resp.filters);\n};\n\nexport const filtersOptions = (args: UseFiltersArgs, config: SdkConfig) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.filter, args, config],\n\t\tqueryFn: () => fetchFilters(args, config),\n\t});\n};\n\nexport const useFilters = (args: UseFiltersArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(filtersOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nconst UseFloorOrderSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tquery: QueryArgSchema,\n});\n\nexport type UseFloorOrderArgs = z.infer<typeof UseFloorOrderSchema>;\n\nexport type UseFloorOrderReturn = Awaited<ReturnType<typeof fetchFloorOrder>>;\n\nconst fetchFloorOrder = async (args: UseFloorOrderArgs, config: SdkConfig) => {\n\tconst marketplaceClient = getMarketplaceClient(args.chainId, config);\n\treturn marketplaceClient\n\t\t.getFloorOrder({ contractAddress: args.collectionAddress })\n\t\t.then((data) => data.collectible);\n};\n\nexport const floorOrderOptions = (\n\targs: UseFloorOrderArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\tqueryKey: [...collectableKeys.floorOrders, args, config],\n\t\tqueryFn: () => fetchFloorOrder(args, config),\n\t});\n};\n\nexport const useFloorOrder = (args: UseFloorOrderArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(floorOrderOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { getCollectibleHighestOfferArgsSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UseHighestOfferArgsSchema = getCollectibleHighestOfferArgsSchema\n\t.omit({\n\t\tcontractAddress: true,\n\t})\n\t.extend({\n\t\tcollectionAddress: AddressSchema,\n\t\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\t\tquery: QueryArgSchema,\n\t});\n\nexport type UseHighestOfferArgs = z.infer<typeof UseHighestOfferArgsSchema>;\n\nexport type UseHighestOfferReturn = Awaited<\n\tReturnType<typeof fetchHighestOffer>\n>;\n\nconst fetchHighestOffer = async (\n\targs: UseHighestOfferArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst parsedArgs = UseHighestOfferArgsSchema.parse(args);\n\tconst marketplaceClient = getMarketplaceClient(parsedArgs.chainId, config);\n\treturn marketplaceClient.getCollectibleHighestOffer({\n\t\t...parsedArgs,\n\t\tcontractAddress: parsedArgs.collectionAddress,\n\t});\n};\n\nexport const highestOfferOptions = (\n\targs: UseHighestOfferArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.highestOffers, args, config],\n\t\tqueryFn: () => fetchHighestOffer(args, config),\n\t});\n};\n\nexport const useHighestOffer = (args: UseHighestOfferArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(highestOfferOptions(args, config));\n};\n","import { type Page, SortOrder } from '@0xsequence/indexer';\nimport { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tbalanceQueries,\n\tgetIndexerClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nexport const metadataOptionsSchema = z.object({\n\tverifiedOnly: z.boolean().optional(),\n\tunverifiedOnly: z.boolean().optional(),\n\tincludeContracts: z.array(z.string()).optional(),\n});\n\nconst sortOrderSchema = z.nativeEnum(SortOrder);\n\nconst sortBySchema = z.object({\n\tcolumn: z.string(),\n\torder: sortOrderSchema,\n});\n\nconst pageSchema = z.object({\n\tpage: z.number().optional(),\n\tcolumn: z.string().optional(),\n\tbefore: z.any().optional(),\n\tafter: z.any().optional(),\n\tsort: z.array(sortBySchema).optional(),\n\tpageSize: z.number().optional(),\n\tmore: z.boolean().optional(),\n});\n\nconst useListBalancesArgsSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.number()),\n\taccountAddress: AddressSchema.optional(),\n\tcontractAddress: AddressSchema.optional(),\n\ttokenId: z.string().optional(),\n\tincludeMetadata: z.boolean().optional(),\n\tmetadataOptions: metadataOptionsSchema.optional(),\n\tincludeCollectionTokens: z.boolean().optional(),\n\tpage: pageSchema.optional(),\n\tquery: QueryArgSchema,\n});\n\nexport type UseFetchTokenBalancesReturn = Awaited<\n\tReturnType<typeof fetchBalances>\n>;\n\nexport type UseListBalancesArgs = z.input<typeof useListBalancesArgsSchema>;\n\nconst fetchBalances = async (\n\targs: UseListBalancesArgs,\n\tconfig: SdkConfig,\n\tpage: Page,\n) => {\n\tconst parsedArgs = useListBalancesArgsSchema.parse(args);\n\tconst indexerClient = getIndexerClient(parsedArgs.chainId, config);\n\n\treturn indexerClient.getTokenBalances({\n\t\t...parsedArgs,\n\t\ttokenID: parsedArgs.tokenId,\n\t\tpage: page,\n\t});\n};\n\nexport const listBalancesOptions = (\n\targs: UseListBalancesArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn infiniteQueryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...balanceQueries.lists, args, config],\n\t\tqueryFn: ({ pageParam }) => fetchBalances(args, config, pageParam),\n\t\tinitialPageParam: { page: 1, pageSize: 30 } as Page,\n\t\tgetNextPageParam: (lastPage) => lastPage.page.after,\n\t});\n};\n\nexport const useListBalances = (args: UseListBalancesArgs) => {\n\tconst config = useConfig();\n\treturn useInfiniteQuery(listBalancesOptions(args, config));\n};\n","import { infiniteQueryOptions, useInfiniteQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { Page, SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\ttype ListCollectiblesArgs,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { listCollectiblesArgsSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UseListCollectiblesArgsSchema = listCollectiblesArgsSchema\n\t.omit({\n\t\tcontractAddress: true,\n\t})\n\t.extend({\n\t\tcollectionAddress: AddressSchema,\n\t\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\t\tquery: QueryArgSchema,\n\t});\n\nexport type UseListCollectiblesArgs = z.infer<\n\ttypeof UseListCollectiblesArgsSchema\n>;\n\nexport type UseListCollectiblesReturn = Awaited<\n\tReturnType<typeof fetchCollectibles>\n>;\n\nconst fetchCollectibles = async (\n\targs: UseListCollectiblesArgs,\n\tmarketplaceClient: Awaited<ReturnType<typeof getMarketplaceClient>>,\n\tpage: Page,\n) => {\n\tconst parsedArgs = UseListCollectiblesArgsSchema.parse(args);\n\tconst arg = {\n\t\t...parsedArgs,\n\t\tcontractAddress: parsedArgs.collectionAddress,\n\t\tpage: page,\n\t} satisfies ListCollectiblesArgs;\n\n\treturn marketplaceClient.listCollectibles(arg);\n};\n\nexport const listCollectiblesOptions = (\n\targs: UseListCollectiblesArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst marketplaceClient = getMarketplaceClient(args.chainId, config);\n\treturn infiniteQueryOptions({\n\t\tqueryKey: [...collectableKeys.lists, args],\n\t\tqueryFn: ({ pageParam }) =>\n\t\t\tfetchCollectibles(args, marketplaceClient, pageParam),\n\t\tinitialPageParam: { page: 1, pageSize: 30 },\n\t\tgetNextPageParam: (lastPage) =>\n\t\t\tlastPage.page?.more ? lastPage.page : undefined,\n\t});\n};\n\nexport const useListCollectibles = (args: UseListCollectiblesArgs) => {\n\tconst config = useConfig();\n\treturn useInfiniteQuery(listCollectiblesOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tChainIdSchema,\n\ttype ListOffersForCollectibleArgs,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { listOffersForCollectibleArgsSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UseListOffersForCollectibleArgsSchema = listOffersForCollectibleArgsSchema\n\t.extend({\n\t\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\t\tcollectionAddress: z.string(),\n\t\tcollectibleId: z.string(),\n\t})\n\t.omit({ contractAddress: true, tokenId: true });\n\ntype UseListOffersForCollectibleArgs = z.infer<\n\ttypeof UseListOffersForCollectibleArgsSchema\n>;\n\nexport type UseListOffersForCollectibleReturn = Awaited<\n\tReturnType<typeof fetchListOffersForCollectible>\n>;\n\nconst fetchListOffersForCollectible = async (\n\tconfig: SdkConfig,\n\targs: UseListOffersForCollectibleArgs,\n) => {\n\tconst arg = {\n\t\tcontractAddress: args.collectionAddress,\n\t\ttokenId: args.collectibleId,\n\t\tfilter: args.filter,\n\t\tpage: args.page,\n\t} satisfies ListOffersForCollectibleArgs;\n\n\tconst marketplaceClient = getMarketplaceClient(args.chainId, config);\n\treturn marketplaceClient.listCollectibleOffers(arg);\n};\n\nexport const listOffersForCollectibleOptions = (\n\targs: UseListOffersForCollectibleArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\tqueryKey: [...collectableKeys.offers, args, config],\n\t\tqueryFn: () => fetchListOffersForCollectible(config, args),\n\t});\n};\n\nexport const useListOffersForCollectible = (\n\targs: UseListOffersForCollectibleArgs,\n) => {\n\tconst config = useConfig();\n\n\treturn useQuery(listOffersForCollectibleOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tChainIdSchema,\n\ttype ListListingsForCollectibleArgs,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { listListingsForCollectibleArgsSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UseListListingsForCollectibleArgsSchema =\n\tlistListingsForCollectibleArgsSchema\n\t\t.extend({\n\t\t\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\t\t\tcollectionAddress: z.string(),\n\t\t\tcollectibleId: z.string(),\n\t\t})\n\t\t.omit({ contractAddress: true, tokenId: true });\n\ntype UseListListingsForCollectibleArgs = z.infer<\n\ttypeof UseListListingsForCollectibleArgsSchema\n>;\n\nexport type UseListListingsForCollectibleReturn = Awaited<\n\tReturnType<typeof fetchListListingsForCollectible>\n>;\n\nconst fetchListListingsForCollectible = async (\n\tconfig: SdkConfig,\n\targs: UseListListingsForCollectibleArgs,\n) => {\n\tconst arg = {\n\t\tcontractAddress: args.collectionAddress,\n\t\ttokenId: args.collectibleId,\n\t\tfilter: args.filter,\n\t\tpage: args.page,\n\t} satisfies ListListingsForCollectibleArgs;\n\n\tconst marketplaceClient = getMarketplaceClient(args.chainId, config);\n\treturn marketplaceClient.listCollectibleListings(arg);\n};\n\nexport const listListingsForCollectibleOptions = (\n\targs: UseListListingsForCollectibleArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\tqueryKey: [...collectableKeys.listings, args, config],\n\t\tqueryFn: () => fetchListListingsForCollectible(config, args),\n\t});\n};\n\nexport const useListListingsForCollectible = (\n\targs: UseListListingsForCollectibleArgs,\n) => {\n\tconst config = useConfig();\n\n\treturn useQuery(listListingsForCollectibleOptions(args, config));\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectableKeys,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { getCollectibleLowestListingArgsSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UseLowestListingSchema = getCollectibleLowestListingArgsSchema\n\t.omit({\n\t\tcontractAddress: true,\n\t})\n\t.extend({\n\t\tcollectionAddress: AddressSchema,\n\t\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\t\tquery: QueryArgSchema,\n\t});\n\nexport type UseLowestListingArgs = z.infer<typeof UseLowestListingSchema>;\n\nexport type UseLowestListingReturn = Awaited<\n\tReturnType<typeof fetchLowestListing>\n>;\n\nconst fetchLowestListing = async (\n\targs: UseLowestListingArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst parsedArgs = UseLowestListingSchema.parse(args);\n\tconst marketplaceClient = getMarketplaceClient(parsedArgs.chainId, config);\n\treturn marketplaceClient.getCollectibleLowestListing({\n\t\t...parsedArgs,\n\t\tcontractAddress: parsedArgs.collectionAddress,\n\t});\n};\n\nexport const lowestListingOptions = (\n\targs: UseLowestListingArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.lowestListings, args, config],\n\t\tqueryFn: () => fetchLowestListing(args, config),\n\t});\n};\n\nexport const useLowestListing = (args: UseLowestListingArgs) => {\n\tconst config = useConfig();\n\treturn useQuery(lowestListingOptions(args, config));\n};\n","import { useQuery } from '@tanstack/react-query';\nimport { marketplaceConfigOptions } from './options/marketplaceConfigOptions';\nimport { useConfig } from './useConfig';\n\nexport * from './options/marketplaceConfigOptions';\n\nexport const useMarketplaceConfig = () => {\n\tconst config = useConfig();\n\treturn useQuery(marketplaceConfigOptions(config));\n};\n","import { queryOptions } from '@tanstack/react-query';\nimport type { Env, MarketplaceConfig, SdkConfig } from '../../../types';\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 Error(`Project id: ${projectId} not found, ${url}`);\n\t\t\tdefault:\n\t\t\t\t//@ts-ignore\n\t\t\t\tthrow new Error(`Failed to fetch marketplace config: ${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 { queryOptions, useQuery } from '@tanstack/react-query';\nimport type { Hex } from 'viem';\nimport { getContract } from 'viem';\nimport { z } from 'zod';\nimport { getPublicRpcClient } from '../../utils/get-public-rpc-client';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tQueryArgSchema,\n\tcollectableKeys,\n} from '../_internal';\nimport { EIP2981_ABI } from '../../utils';\n\nconst UseRoyaletyPercentageSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tcollectibleId: z.string(),\n\tquery: QueryArgSchema,\n});\n\ntype UseRoyaletyPercentageArgs = z.infer<typeof UseRoyaletyPercentageSchema>;\n\nconst fetchRoyaletyPercentage = async (args: UseRoyaletyPercentageArgs) => {\n\tconst parsedArgs = UseRoyaletyPercentageSchema.parse(args);\n\tconst publicClient = getPublicRpcClient(parsedArgs.chainId);\n\n\tconst contract = getContract({\n\t\taddress: parsedArgs.collectionAddress as Hex,\n\t\tabi: EIP2981_ABI,\n\t\tclient: publicClient,\n\t});\n\n\ttry {\n\t\tconst [_, royaltyPercentage] = await contract.read.royaltyInfo([\n\t\t\tBigInt(args.collectibleId),\n\t\t\t100n,\n\t\t]);\n\n\t\treturn royaltyPercentage;\n\t} catch {\n\t\t//TODO: dont swallow errors\n\t\treturn 0n;\n\t}\n};\n\nexport const royaletyPercentageOptions = (args: UseRoyaletyPercentageArgs) =>\n\tqueryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectableKeys.royaltyPercentage, args],\n\t\tqueryFn: () => fetchRoyaletyPercentage(args),\n\t});\n\nexport const useRoyaltyPercentage = (args: UseRoyaletyPercentageArgs) => {\n\treturn useQuery(royaletyPercentageOptions(args));\n};\n","import { useMutation } from '@tanstack/react-query';\nimport { useConfig } from './useConfig';\n\nexport type UseGenerateListingTransactionArgs = {\n\tchainId: ChainId;\n\tonSuccess?: (data?: Step[]) => void;\n};\n\nimport type { SdkConfig } from '../../types';\nimport {\n\ttype ChainId,\n\ttype CreateReq,\n\ttype GenerateListingTransactionArgs,\n\ttype Step,\n\tgetMarketplaceClient,\n} from '../_internal';\n\nexport type CreateReqWithDateExpiry = Omit<CreateReq, 'expiry'> & {\n\texpiry: Date;\n};\n\nexport type GenerateListingTransactionProps = Omit<\n\tGenerateListingTransactionArgs,\n\t'listing'\n> & {\n\tlisting: CreateReqWithDateExpiry;\n};\n\nconst dateToUnixTime = (date: Date) =>\n\tMath.floor(date.getTime() / 1000).toString();\n\nexport const generateListingTransaction = async (\n\tparams: GenerateListingTransactionProps,\n\tconfig: SdkConfig,\n\tchainId: ChainId,\n) => {\n\tconst args = {\n\t\t...params,\n\t\tlisting: {\n\t\t\t...params.listing,\n\t\t\texpiry: dateToUnixTime(params.listing.expiry),\n\t\t},\n\t} satisfies GenerateListingTransactionArgs;\n\tconst marketplaceClient = getMarketplaceClient(chainId, config);\n\treturn (await marketplaceClient.generateListingTransaction(args)).steps;\n};\n\nexport const useGenerateListingTransaction = (\n\tparams: UseGenerateListingTransactionArgs,\n) => {\n\tconst config = useConfig();\n\n\tconst { mutate, mutateAsync, ...result } = useMutation({\n\t\tonSuccess: params.onSuccess,\n\t\tmutationFn: (args: GenerateListingTransactionProps) =>\n\t\t\tgenerateListingTransaction(args, config, params.chainId),\n\t});\n\n\treturn {\n\t\t...result,\n\t\tgenerateListingTransaction: mutate,\n\t\tgenerateListingTransactionAsync: mutateAsync,\n\t};\n};\n","import { useMutation } from '@tanstack/react-query';\nimport type { SdkConfig } from '../../types';\nimport {\n\ttype ChainId,\n\ttype CreateReq,\n\ttype GenerateOfferTransactionArgs,\n\ttype Step,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\n\nexport type UseGenerateOfferTransactionArgs = {\n\tchainId: ChainId;\n\tonSuccess?: (data?: Step[]) => void;\n};\n\ntype CreateReqWithDateExpiry = Omit<CreateReq, 'expiry'> & {\n\texpiry: Date;\n};\n\nexport type GenerateOfferTransactionProps = Omit<\n\tGenerateOfferTransactionArgs,\n\t'offer'\n> & {\n\toffer: CreateReqWithDateExpiry;\n};\n\nconst dateToUnixTime = (date: Date) =>\n\tMath.floor(date.getTime() / 1000).toString();\n\nexport const generateOfferTransaction = async (\n\tparams: GenerateOfferTransactionProps,\n\tconfig: SdkConfig,\n\tchainId: ChainId,\n) => {\n\tconst args = {\n\t\t...params,\n\t\toffer: { ...params.offer, expiry: dateToUnixTime(params.offer.expiry) },\n\t} satisfies GenerateOfferTransactionArgs;\n\tconst marketplaceClient = getMarketplaceClient(chainId, config);\n\treturn (await marketplaceClient.generateOfferTransaction(args)).steps;\n};\n\nexport const useGenerateOfferTransaction = (\n\tparams: UseGenerateOfferTransactionArgs,\n) => {\n\tconst config = useConfig();\n\n\tconst { mutate, mutateAsync, ...result } = useMutation({\n\t\tonSuccess: params.onSuccess,\n\t\tmutationFn: (args: GenerateOfferTransactionProps) =>\n\t\t\tgenerateOfferTransaction(args, config, params.chainId),\n\t});\n\n\treturn {\n\t\t...result,\n\t\tgenerateOfferTransaction: mutate,\n\t\tgenerateOfferTransactionAsync: mutateAsync,\n\t};\n};\n","import { useMutation } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\ttype ChainId,\n\tChainIdSchema,\n\ttype GenerateSellTransactionArgs,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { stepSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UserGeneratSellTransactionArgsSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tonSuccess: z.function().args(stepSchema.array().optional()).optional(),\n});\n\ntype UseGenerateSellTransactionArgs = z.infer<\n\ttypeof UserGeneratSellTransactionArgsSchema\n>;\n\nexport const generateSellTransaction = async (\n\targs: GenerateSellTransactionArgs,\n\tconfig: SdkConfig,\n\tchainId: ChainId,\n) => {\n\tconst parsedChainId = ChainIdSchema.pipe(z.coerce.string()).parse(chainId);\n\tconst marketplaceClient = getMarketplaceClient(parsedChainId, config);\n\treturn marketplaceClient\n\t\t.generateSellTransaction(args)\n\t\t.then((data) => data.steps);\n};\n\nexport const useGenerateSellTransaction = (\n\tparams: UseGenerateSellTransactionArgs,\n) => {\n\tconst config = useConfig();\n\n\tconst { mutate, mutateAsync, ...result } = useMutation({\n\t\tonSuccess: params.onSuccess,\n\t\tmutationFn: (args: GenerateSellTransactionArgs) =>\n\t\t\tgenerateSellTransaction(args, config, params.chainId),\n\t});\n\n\treturn {\n\t\t...result,\n\t\tgenerateSellTransaction: mutate,\n\t\tgenerateSellTransactionAsync: mutateAsync,\n\t};\n};\n","import { useMutation } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\ttype ChainId,\n\tChainIdSchema,\n\ttype GenerateCancelTransactionArgs,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { stepSchema } from '../_internal/api/zod-schema';\nimport { useConfig } from './useConfig';\n\nconst UserGenerateCancelTransactionArgsSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tonSuccess: z.function().args(stepSchema.array().optional()).optional(),\n});\n\ntype UseGenerateCancelTransactionArgs = z.infer<\n\ttypeof UserGenerateCancelTransactionArgsSchema\n>;\n\nexport const generateCancelTransaction = async (\n\targs: GenerateCancelTransactionArgs,\n\tconfig: SdkConfig,\n\tchainId: ChainId,\n) => {\n\tconst parsedChainId = ChainIdSchema.pipe(z.coerce.string()).parse(chainId);\n\tconst marketplaceClient = getMarketplaceClient(parsedChainId, config);\n\treturn marketplaceClient\n\t\t.generateCancelTransaction(args)\n\t\t.then((data) => data.steps);\n};\n\nexport const useGenerateCancelTransaction = (\n\tparams: UseGenerateCancelTransactionArgs,\n) => {\n\tconst config = useConfig();\n\n\tconst { mutate, mutateAsync, ...result } = useMutation({\n\t\tonSuccess: params.onSuccess,\n\t\tmutationFn: (args: GenerateCancelTransactionArgs) =>\n\t\t\tgenerateCancelTransaction(args, config, params.chainId),\n\t});\n\n\treturn {\n\t\t...result,\n\t\tgenerateCancelTransaction: mutate,\n\t\tgenerateCancelTransactionAsync: mutateAsync,\n\t};\n};\n","import { type Abi, type Address, type Hex, erc721Abi } from 'viem';\nimport { useAccount, useWriteContract } from 'wagmi';\nimport { ERC1155_ABI } from '../../utils';\nimport type { ChainId, ContractType } from '../_internal';\n\ninterface BaseTransferParams {\n\tchainId: ChainId;\n\tcollectionAddress: Hex;\n\ttokenId: string;\n\treceiverAddress: Address;\n}\n\ninterface ERC721TransferParams extends BaseTransferParams {\n\tcontractType: ContractType.ERC721;\n}\n\ninterface ERC1155TransferParams extends BaseTransferParams {\n\tcontractType: ContractType.ERC1155;\n\tquantity: string;\n}\n\nexport type TransferTokensParams = ERC721TransferParams | ERC1155TransferParams;\n\nconst prepareTransferConfig = (\n\tparams: TransferTokensParams,\n\taccountAddress: Address,\n) => {\n\tif (params.contractType === 'ERC721') {\n\t\treturn {\n\t\t\tabi: erc721Abi as Abi,\n\t\t\taddress: params.collectionAddress,\n\t\t\tfunctionName: 'safeTransferFrom',\n\t\t\targs: [\n\t\t\t\taccountAddress,\n\t\t\t\tparams.receiverAddress,\n\t\t\t\tBigInt(params.tokenId),\n\t\t\t] as const,\n\t\t} as const;\n\t}\n\n\treturn {\n\t\tabi: ERC1155_ABI as Abi,\n\t\taddress: params.collectionAddress,\n\t\tfunctionName: 'safeTransferFrom',\n\t\targs: [\n\t\t\taccountAddress,\n\t\t\tparams.receiverAddress,\n\t\t\tBigInt(params.tokenId),\n\t\t\tparams.quantity,\n\t\t\t'0x', // data\n\t\t] as const,\n\t};\n};\n\nexport const useTransferTokens = () => {\n\tconst { address: accountAddress } = useAccount();\n\tconst {\n\t\twriteContractAsync,\n\t\tdata: hash,\n\t\tisPending,\n\t\tisError,\n\t\tisSuccess,\n\t} = useWriteContract();\n\n\tconst transferTokensAsync = async (params: TransferTokensParams) => {\n\t\tif (!accountAddress) {\n\t\t\tthrow new Error('No wallet connected');\n\t\t}\n\n\t\tconst config = prepareTransferConfig(params, accountAddress);\n\t\treturn await writeContractAsync(config);\n\t};\n\n\treturn {\n\t\ttransferTokensAsync,\n\t\thash,\n\t\ttransferring: isPending,\n\t\ttransferFailed: isError,\n\t\ttransferSuccess: isSuccess,\n\t};\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tMarketplaceKind,\n\tQueryArgSchema,\n\tgetMarketplaceClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\nimport { useAccount } from 'wagmi';\nimport type { Hex } from 'viem';\n\nconst UseCheckoutOptionsSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\torders: z.array(\n\t\tz.object({\n\t\t\tcollectionAddress: AddressSchema,\n\t\t\torderId: z.string(),\n\t\t\tmarketplace: z.nativeEnum(MarketplaceKind),\n\t\t}),\n\t),\n\tquery: QueryArgSchema,\n});\n\nexport type UseCheckoutOptionsArgs = z.infer<typeof UseCheckoutOptionsSchema>;\n\nexport type UseCheckoutOptionsReturn = Awaited<\n\tReturnType<typeof fetchCheckoutOptions>\n>;\n\nconst fetchCheckoutOptions = async (\n\targs: UseCheckoutOptionsArgs & { walletAddress: Hex },\n\tconfig: SdkConfig,\n) => {\n\tconst marketplaceClient = getMarketplaceClient(args.chainId, config);\n\treturn marketplaceClient.checkoutOptionsMarketplace({\n\t\twallet: args.walletAddress,\n\t\torders: args.orders.map((order) => ({\n\t\t\tcontractAddress: order.collectionAddress,\n\t\t\torderId: order.orderId,\n\t\t\tmarketplace: order.marketplace,\n\t\t})),\n\t\tadditionalFee: 0, //TODO: add additional fee\n\t});\n};\n\nexport const checkoutOptionsOptions = (\n\targs: UseCheckoutOptionsArgs & { walletAddress: Hex },\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\tqueryKey: ['checkoutOptions', args],\n\t\tqueryFn: () => fetchCheckoutOptions(args, config),\n\t});\n};\n\nexport const useCheckoutOptions = (args: UseCheckoutOptionsArgs) => {\n\tconst { address } = useAccount();\n\tconst config = useConfig();\n\treturn useQuery(\n\t\t// biome-ignore lint/style/noNonNullAssertion: <explanation>\n\t\tcheckoutOptionsOptions({ walletAddress: address!, ...args }, config),\n\t);\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { MarketplaceConfig, SdkConfig } from '../../types';\nimport {\n\tQueryArgSchema,\n\tcollectionKeys,\n\tgetMetadataClient,\n} from '../_internal';\nimport { useConfig } from './useConfig';\nimport { useMarketplaceConfig } from './useMarketplaceConfig';\n\nconst UseListCollectionsSchema = z.object({\n\tquery: QueryArgSchema.optional().default({}),\n});\n\nexport type UseListCollectionsArgs = z.input<typeof UseListCollectionsSchema>;\n\nexport type UseListCollectionsReturn = Awaited<\n\tReturnType<typeof fetchListCollections>\n>;\n\ntype FetchListCollectionsArgs = {\n\tmarketplaceConfig: MarketplaceConfig;\n\tquery?: z.infer<typeof QueryArgSchema>;\n};\n\nconst fetchListCollections = async (\n\t{ marketplaceConfig }: FetchListCollectionsArgs,\n\tconfig: SdkConfig,\n) => {\n\tconst metadataClient = getMetadataClient(config);\n\n\tif (!marketplaceConfig?.collections?.length) {\n\t\treturn [];\n\t}\n\n\t// Group collections by chainId\n\tconst collectionsByChain = marketplaceConfig.collections.reduce<\n\t\tRecord<string, string[]>\n\t>((acc, curr) => {\n\t\tconst { chainId, collectionAddress } = curr;\n\t\tif (!acc[chainId]) {\n\t\t\tacc[chainId] = [];\n\t\t}\n\t\tacc[chainId].push(collectionAddress);\n\t\treturn acc;\n\t}, {});\n\n\t// Fetch collections for each chain\n\tconst promises = Object.entries(collectionsByChain).map(\n\t\t([chainId, addresses]) =>\n\t\t\tmetadataClient\n\t\t\t\t.getContractInfoBatch({\n\t\t\t\t\tchainID: chainId,\n\t\t\t\t\tcontractAddresses: addresses,\n\t\t\t\t})\n\t\t\t\t.then((resp) => Object.values(resp.contractInfoMap)),\n\t);\n\n\tconst results = await Promise.all(promises);\n\treturn results.flat();\n};\n\nexport const listCollectionsOptions = (\n\targs: FetchListCollectionsArgs,\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\t...args.query,\n\t\tqueryKey: [...collectionKeys.list],\n\t\tqueryFn: () => fetchListCollections(args, config),\n\t});\n};\n\nexport const useListCollections = (args: UseListCollectionsArgs = {}) => {\n\tconst config = useConfig();\n\tconst { data: marketplaceConfig, isLoading: isLoadingConfig } =\n\t\tuseMarketplaceConfig();\n\n\treturn useQuery({\n\t\t...listCollectionsOptions(\n\t\t\t// biome-ignore lint/style/noNonNullAssertion: <explanation>\n\t\t\t{ marketplaceConfig: marketplaceConfig!, query: args.query },\n\t\t\tconfig,\n\t\t),\n\t\tenabled: !isLoadingConfig && !!marketplaceConfig,\n\t});\n};\n","import { queryOptions, useQuery } from '@tanstack/react-query';\nimport { z } from 'zod';\nimport type { SdkConfig } from '../../types';\nimport {\n\tAddressSchema,\n\tChainIdSchema,\n\tgetMarketplaceClient,\n\tMarketplaceKind,\n\tQueryArgSchema,\n\tWalletKind,\n} from '../_internal';\nimport { useConfig } from './useConfig';\nimport { useAccount } from 'wagmi';\nimport type { Hex } from 'viem';\n\nexport const UseGenerateBuyTransactionArgsSchema = z.object({\n\tchainId: ChainIdSchema.pipe(z.coerce.string()),\n\tcollectionAddress: AddressSchema,\n\tmarketplace: z.nativeEnum(MarketplaceKind),\n\tordersData: z.array(\n\t\tz.object({\n\t\t\torderId: z.string(),\n\t\t\tquantity: z.string(),\n\t\t\tmarketplace: z.string(),\n\t\t}),\n\t),\n\twalletType: z.nativeEnum(WalletKind).optional(),\n\tquery: QueryArgSchema,\n});\n\ntype UseGenerateBuyTransactionArgs = z.infer<\n\ttypeof UseGenerateBuyTransactionArgsSchema\n>;\n\nexport const fetchGenerateBuyTransaction = async (\n\targs: UseGenerateBuyTransactionArgs & { buyer: Hex },\n\tconfig: SdkConfig,\n) => {\n\tconst parsedArgs = UseGenerateBuyTransactionArgsSchema.parse(args);\n\tconst marketplaceClient = getMarketplaceClient(parsedArgs.chainId, config);\n\n\treturn marketplaceClient\n\t\t.generateBuyTransaction({\n\t\t\t...parsedArgs,\n\t\t\tbuyer: args.buyer,\n\t\t\tadditionalFees: [], // TODO: Add additional fees\n\t\t})\n\t\t.then((data) => data.steps);\n};\n\nexport const generateBuyTransactionOptions = (\n\targs: UseGenerateBuyTransactionArgs & { buyer: Hex },\n\tconfig: SdkConfig,\n) => {\n\treturn queryOptions({\n\t\tqueryKey: ['generateBuyTransaction', args],\n\t\tqueryFn: () => fetchGenerateBuyTransaction(args, config),\n\t\t...args.query,\n\t});\n};\n\nexport const useGenerateBuyTransaction = (\n\targs: UseGenerateBuyTransactionArgs,\n) => {\n\tconst { address } = useAccount();\n\tconst config = useConfig();\n\treturn useQuery(\n\t\t// biome-ignore lint/style/noNonNullAssertion: <explanation>\n\t\tgenerateBuyTransactionOptions({ buyer: address!, ...args }, config),\n\t);\n};\n","import type { SelectPaymentSettings } from '@0xsequence/kit-checkout';\nimport type {\n\tChain,\n\tHash,\n\tHex,\n\tPublicClient,\n\tTypedDataDomain,\n\tWalletClient,\n} from 'viem';\nimport { avalanche } from 'viem/chains';\nimport {\n\ttype AdditionalFee,\n\ttype SequenceMarketplace,\n\tTransactionSwapProvider,\n\ttype WalletKind,\n\tgetMarketplaceClient,\n} from '..';\nimport {\n\ttype ContractType,\n\ttype CreateReq,\n\tExecuteType,\n\ttype MarketplaceConfig,\n\ttype MarketplaceKind,\n\tOrderbookKind,\n\ttype SdkConfig,\n\ttype Step,\n\tStepType,\n} from '../../../types';\n\nexport enum TransactionState {\n\tIDLE = 'IDLE',\n\tSWITCH_CHAIN = 'SWITCH_CHAIN',\n\tCHECKING_STEPS = 'CHECKING_STEPS',\n\tTOKEN_APPROVAL = 'TOKEN_APPROVAL',\n\tEXECUTING_TRANSACTION = 'EXECUTING_TRANSACTION',\n\tCONFIRMING = 'CONFIRMING',\n\tSUCCESS = 'SUCCESS',\n\tERROR = 'ERROR',\n}\n\nexport enum TransactionType {\n\tBUY = 'BUY',\n\tSELL = 'SELL',\n\tLISTING = 'LISTING',\n\tOFFER = 'OFFER',\n\tCANCEL = 'CANCEL',\n}\n\nexport interface TransactionConfig {\n\ttype: TransactionType;\n\twalletKind: WalletKind;\n\tchainId: string;\n\tchains: readonly Chain[];\n\tcollectionAddress: string;\n\tsdkConfig: SdkConfig;\n\tmarketplaceConfig: MarketplaceConfig;\n}\n\ninterface StateConfig {\n\tconfig: TransactionConfig;\n\tonTransactionSent?: (hash: Hash) => void;\n\tonSuccess?: (hash: Hash) => void;\n\tonError?: (error: Error) => void;\n}\n\nexport interface BuyInput {\n\torderId: string;\n\tcollectableDecimals: number;\n\tmarketplace: MarketplaceKind;\n\tquantity: string;\n}\n\nexport interface SellInput {\n\torderId: string;\n\tmarketplace: MarketplaceKind;\n\tquantity?: string;\n}\n\nexport interface ListingInput {\n\tcontractType: ContractType;\n\tlisting: CreateReq;\n}\n\nexport interface OfferInput {\n\tcontractType: ContractType;\n\toffer: CreateReq;\n}\n\nexport interface CancelInput {\n\torderId: string;\n\tmarketplace: MarketplaceKind;\n}\n\ntype TransactionInput =\n\t| {\n\t\t\ttype: TransactionType.BUY;\n\t\t\tprops: BuyInput;\n\t }\n\t| {\n\t\t\ttype: TransactionType.SELL;\n\t\t\tprops: SellInput;\n\t }\n\t| {\n\t\t\ttype: TransactionType.LISTING;\n\t\t\tprops: ListingInput;\n\t }\n\t| {\n\t\t\ttype: TransactionType.OFFER;\n\t\t\tprops: OfferInput;\n\t }\n\t| {\n\t\t\ttype: TransactionType.CANCEL;\n\t\t\tprops: CancelInput;\n\t };\n\ninterface StateConfig {\n\tconfig: TransactionConfig;\n\tonTransactionSent?: (hash: Hash) => void;\n\tonSuccess?: (hash: Hash) => void;\n\tonError?: (error: Error) => void;\n}\n\ninterface TransactionStep {\n\tisPending: boolean;\n\tisExecuting: boolean;\n}\n\nexport interface TransactionSteps {\n\tswitchChain: TransactionStep & {\n\t\texecute: () => Promise<void>;\n\t};\n\tapproval: TransactionStep & {\n\t\texecute: () =>\n\t\t\t| Promise<{ hash: Hash } | undefined>\n\t\t\t| Promise<void>\n\t\t\t| undefined;\n\t};\n\ttransaction: TransactionStep & {\n\t\texecute: () => Promise<{ hash: Hash } | undefined> | Promise<void>;\n\t};\n}\n\nconst debug = (message: string, data?: any) => {\n\tconsole.debug(`[TransactionMachine] ${message}`, data || '');\n};\n\nexport class TransactionMachine {\n\tprivate currentState: TransactionState;\n\tprivate marketplaceClient: SequenceMarketplace;\n\tprivate memoizedSteps: TransactionSteps | null = null;\n\tprivate lastProps: TransactionInput['props'] | null = null;\n\n\tconstructor(\n\t\tprivate readonly config: StateConfig,\n\t\tprivate readonly walletClient: WalletClient,\n\t\tprivate readonly publicClient: PublicClient,\n\t\tprivate readonly openSelectPaymentModal: (\n\t\t\tsettings: SelectPaymentSettings,\n\t\t) => void,\n\t\tprivate readonly switchChainFn: (chainId: string) => Promise<void>,\n\t) {\n\t\tthis.currentState = TransactionState.IDLE;\n\t\tthis.marketplaceClient = getMarketplaceClient(\n\t\t\tconfig.config.chainId,\n\t\t\tconfig.config.sdkConfig,\n\t\t);\n\t}\n\n\tprivate getAccount() {\n\t\tconst account = this.walletClient.account;\n\t\tif (!account) {\n\t\t\tthrow new Error('Account not connected');\n\t\t}\n\t\treturn account;\n\t}\n\n\tprivate getMarketplaceFee(collectionAddress: string) {\n\t\tconst defaultFee = 2.5;\n\t\tconst defaultPlatformFeeRecipient =\n\t\t\t'0x858dB1cbF6D09D447C96A11603189b49B2D1C219';\n\t\tconst avalancheAndOptimismPlatformFeeRecipient =\n\t\t\t'0x400cdab4676c17aec07e8ec748a5fc3b674bca41';\n\t\tconst collection = this.config.config.marketplaceConfig.collections.find(\n\t\t\t(collection) =>\n\t\t\t\tcollection.collectionAddress.toLowerCase() ===\n\t\t\t\t\tcollectionAddress.toLowerCase() &&\n\t\t\t\tthis.getChainId() === Number(collection.chainId),\n\t\t);\n\n\t\tconst receiver =\n\t\t\tthis.getChainId() === avalanche.id\n\t\t\t\t? avalancheAndOptimismPlatformFeeRecipient\n\t\t\t\t: defaultPlatformFeeRecipient;\n\n\t\tconst percentageToBPS = (percentage: string | number) =>\n\t\t\t(Number(percentage) * 10000) / 100;\n\n\t\treturn {\n\t\t\tamount: percentageToBPS(\n\t\t\t\tcollection?.marketplaceFeePercentage || defaultFee,\n\t\t\t).toString(),\n\t\t\treceiver,\n\t\t} satisfies AdditionalFee;\n\t}\n\n\tprivate getAccountAddress() {\n\t\treturn this.getAccount().address;\n\t}\n\n\tprivate async generateSteps({\n\t\ttype,\n\t\tprops,\n\t}: TransactionInput): Promise<Step[]> {\n\t\tdebug('Generating steps', { type, props });\n\t\tconst { collectionAddress } = this.config.config;\n\t\tconst address = this.getAccountAddress();\n\t\tswitch (type) {\n\t\t\tcase TransactionType.BUY:\n\t\t\t\treturn this.marketplaceClient\n\t\t\t\t\t.generateBuyTransaction({\n\t\t\t\t\t\tcollectionAddress,\n\t\t\t\t\t\tbuyer: address,\n\t\t\t\t\t\twalletType: this.config.config.walletKind,\n\t\t\t\t\t\tmarketplace: props.marketplace,\n\t\t\t\t\t\tordersData: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\torderId: props.orderId,\n\t\t\t\t\t\t\t\tquantity: props.quantity || '1',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tadditionalFees: [this.getMarketplaceFee(collectionAddress)],\n\t\t\t\t\t})\n\t\t\t\t\t.then((resp) => resp.steps);\n\n\t\t\tcase TransactionType.SELL:\n\t\t\t\treturn this.marketplaceClient\n\t\t\t\t\t.generateSellTransaction({\n\t\t\t\t\t\tcollectionAddress,\n\t\t\t\t\t\tseller: address,\n\t\t\t\t\t\twalletType: this.config.config.walletKind,\n\t\t\t\t\t\tmarketplace: props.marketplace,\n\t\t\t\t\t\tordersData: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\torderId: props.orderId,\n\t\t\t\t\t\t\t\tquantity: props.quantity || '1',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tadditionalFees: [],\n\t\t\t\t\t})\n\t\t\t\t\t.then((resp) => resp.steps);\n\n\t\t\tcase TransactionType.LISTING:\n\t\t\t\treturn this.marketplaceClient\n\t\t\t\t\t.generateListingTransaction({\n\t\t\t\t\t\tcollectionAddress,\n\t\t\t\t\t\towner: address,\n\t\t\t\t\t\twalletType: this.config.config.walletKind,\n\t\t\t\t\t\tcontractType: props.contractType,\n\t\t\t\t\t\torderbook: OrderbookKind.sequence_marketplace_v2,\n\t\t\t\t\t\tlisting: props.listing,\n\t\t\t\t\t})\n\t\t\t\t\t.then((resp) => resp.steps);\n\n\t\t\tcase TransactionType.OFFER:\n\t\t\t\treturn this.marketplaceClient\n\t\t\t\t\t.generateOfferTransaction({\n\t\t\t\t\t\tcollectionAddress,\n\t\t\t\t\t\tmaker: address,\n\t\t\t\t\t\twalletType: this.config.config.walletKind,\n\t\t\t\t\t\tcontractType: props.contractType,\n\t\t\t\t\t\torderbook: OrderbookKind.sequence_marketplace_v2,\n\t\t\t\t\t\toffer: props.offer,\n\t\t\t\t\t})\n\t\t\t\t\t.then((resp) => resp.steps);\n\n\t\t\tcase TransactionType.CANCEL:\n\t\t\t\treturn this.marketplaceClient\n\t\t\t\t\t.generateCancelTransaction({\n\t\t\t\t\t\tcollectionAddress,\n\t\t\t\t\t\tmaker: address,\n\t\t\t\t\t\tmarketplace: props.marketplace,\n\t\t\t\t\t\torderId: props.orderId,\n\t\t\t\t\t})\n\t\t\t\t\t.then((resp) => resp.steps);\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Unknown transaction type: ${type}`);\n\t\t}\n\t}\n\n\tprivate clearMemoizedSteps() {\n\t\tdebug('Clearing memoized steps');\n\t\tthis.memoizedSteps = null;\n\t\tthis.lastProps = null;\n\t}\n\n\tprivate async transition(newState: TransactionState) {\n\t\tdebug(`State transition: ${this.currentState} -> ${newState}`);\n\t\tthis.currentState = newState;\n\t\tthis.clearMemoizedSteps();\n\t}\n\n\tprivate getChainId() {\n\t\treturn this.walletClient.chain?.id;\n\t}\n\n\tprivate getChainForTransaction() {\n\t\tconst chainId = this.config.config.chainId;\n\t\treturn this.config.config.chains.find(\n\t\t\t(chain) => chain.id === Number(chainId),\n\t\t);\n\t}\n\n\tprivate isOnCorrectChain() {\n\t\treturn this.getChainId() === Number(this.config.config.chainId);\n\t}\n\n\tprivate async switchChain(): Promise<void> {\n\t\tdebug('Checking chain', {\n\t\t\tcurrentChain: this.getChainId(),\n\t\t\ttargetChain: Number(this.config.config.chainId),\n\t\t});\n\t\tif (!this.isOnCorrectChain()) {\n\t\t\tawait this.transition(TransactionState.SWITCH_CHAIN);\n\t\t\tawait this.switchChainFn(this.config.config.chainId);\n\t\t\tawait this.walletClient.switchChain({\n\t\t\t\tid: Number(this.config.config.chainId),\n\t\t\t});\n\t\t\tdebug('Switched chain');\n\t\t}\n\t}\n\n\tasync start({ props }: { props: TransactionInput['props'] }) {\n\t\tdebug('Starting transaction', props);\n\t\ttry {\n\t\t\tawait this.transition(TransactionState.CHECKING_STEPS);\n\t\t\tconst { type } = this.config.config;\n\n\t\t\tconst steps = await this.generateSteps({\n\t\t\t\ttype,\n\t\t\t\tprops,\n\t\t\t} as TransactionInput);\n\n\t\t\tfor (const step of steps) {\n\t\t\t\ttry {\n\t\t\t\t\tawait this.executeStep({ step, props });\n\t\t\t\t} catch (error) {\n\t\t\t\t\tawait this.transition(TransactionState.ERROR);\n\t\t\t\t\tthrow error;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tawait this.transition(TransactionState.SUCCESS);\n\t\t} catch (error) {\n\t\t\tdebug('Transaction failed', error);\n\t\t\tawait this.transition(TransactionState.ERROR);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tprivate async handleTransactionSuccess(hash?: Hash) {\n\t\tif (!hash) {\n\t\t\t// TODO: This is to handle signature steps, but it's not ideal\n\t\t\tawait this.transition(TransactionState.SUCCESS);\n\t\t\treturn;\n\t\t}\n\t\tawait this.transition(TransactionState.CONFIRMING);\n\t\tthis.config.onTransactionSent?.(hash);\n\n\t\tconst receipt = await this.publicClient.waitForTransactionReceipt({ hash });\n\t\tdebug('Transaction confirmed', receipt);\n\n\t\tawait this.transition(TransactionState.SUCCESS);\n\t\tthis.config.onSuccess?.(hash);\n\t}\n\n\tprivate async executeTransaction(step: Step): Promise<Hash> {\n\t\tconst transactionData = {\n\t\t\taccount: this.getAccount(),\n\t\t\tchain: this.getChainForTransaction(),\n\t\t\tto: step.to as Hex,\n\t\t\tdata: step.data as Hex,\n\t\t\tvalue: BigInt(step.value || '0'),\n\t\t};\n\t\tdebug('Executing transaction', transactionData);\n\t\tconst hash = await this.walletClient.sendTransaction(transactionData);\n\t\tdebug('Transaction submitted', { hash });\n\t\tawait this.handleTransactionSuccess(hash);\n\t\treturn hash;\n\t}\n\n\tprivate async executeSignature(step: Step) {\n\t\tdebug('Executing signature', { stepId: step.id });\n\t\tlet signature: Hex;\n\t\tif (!step.post) {\n\t\t\tthrow new Error('Missing post step');\n\t\t}\n\t\tswitch (step.id) {\n\t\t\tcase StepType.signEIP712:\n\t\t\t\tif (!step.signature) {\n\t\t\t\t\tthrow new Error('Missing signature data');\n\t\t\t\t}\n\t\t\t\tsignature = await this.walletClient.signTypedData({\n\t\t\t\t\tdomain: step.signature.domain as TypedDataDomain,\n\t\t\t\t\ttypes: step.signature.types,\n\t\t\t\t\tprimaryType: step.signature.primaryType,\n\t\t\t\t\taccount: this.getAccountAddress(),\n\t\t\t\t\tmessage: step.signature.value,\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tcase StepType.signEIP191:\n\t\t\t\tsignature = await this.walletClient.signMessage({\n\t\t\t\t\tmessage: step.data,\n\t\t\t\t\taccount: step.to as Hex,\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Error(`Invalid signature step: ${step.id}`);\n\t\t}\n\n\t\tawait this.marketplaceClient.execute({\n\t\t\tsignature,\n\t\t\texecuteType: ExecuteType.order,\n\t\t\tbody: step.post,\n\t\t});\n\t\tawait this.handleTransactionSuccess();\n\t}\n\n\tprivate openPaymentModalWithPromise(\n\t\tsettings: Omit<SelectPaymentSettings, 'onSuccess' | 'onError'>,\n\t): Promise<void> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.openSelectPaymentModal({\n\t\t\t\t...settings,\n\t\t\t\tonSuccess: async (hash: string) => {\n\t\t\t\t\tawait this.handleTransactionSuccess(hash as Hash);\n\t\t\t\t\tresolve();\n\t\t\t\t},\n\t\t\t\tonError: (error: Error) => {\n\t\t\t\t\tthis.config.onError?.(error);\n\t\t\t\t\treject(error);\n\t\t\t\t},\n\t\t\t});\n\t\t});\n\t}\n\n\tprivate async executeBuyStep({\n\t\tstep,\n\t\tprops,\n\t}: {\n\t\tstep: Step;\n\t\tprops: BuyInput;\n\t}) {\n\t\tthis.transition(TransactionState.EXECUTING_TRANSACTION);\n\t\tconst [checkoutOptions, orders] = await Promise.all([\n\t\t\tthis.marketplaceClient.checkoutOptionsMarketplace({\n\t\t\t\twallet: this.getAccountAddress(),\n\t\t\t\torders: [\n\t\t\t\t\t{\n\t\t\t\t\t\tcontractAddress: this.config.config.collectionAddress,\n\t\t\t\t\t\torderId: props.orderId,\n\t\t\t\t\t\tmarketplace: props.marketplace,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tadditionalFee: Number(\n\t\t\t\t\tthis.getMarketplaceFee(this.config.config.collectionAddress).amount,\n\t\t\t\t),\n\t\t\t}),\n\t\t\tthis.marketplaceClient.getOrders({\n\t\t\t\tinput: [\n\t\t\t\t\t{\n\t\t\t\t\t\torderId: props.orderId,\n\t\t\t\t\t\tmarketplace: props.marketplace,\n\t\t\t\t\t\tcontractAddress: this.config.config.collectionAddress,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t}),\n\t\t]);\n\n\t\tconst order = orders.orders[0];\n\n\t\tif (!order) {\n\t\t\tthrow new Error('Order not found');\n\t\t}\n\n\t\tconst paymentModalProps = {\n\t\t\tchain: this.getChainId()!,\n\t\t\tcollectibles: [\n\t\t\t\t{\n\t\t\t\t\ttokenId: order.tokenId,\n\t\t\t\t\tquantity: props.quantity,\n\t\t\t\t\tdecimals: props.collectableDecimals,\n\t\t\t\t},\n\t\t\t],\n\t\t\tcurrencyAddress: order.priceCurrencyAddress,\n\t\t\tprice: order.priceAmount,\n\t\t\ttargetContractAddress: step.to,\n\t\t\ttxData: step.data as Hex,\n\t\t\tcollectionAddress: this.config.config.collectionAddress,\n\t\t\trecipientAddress: this.getAccountAddress(),\n\t\t\tenableMainCurrencyPayment: true,\n\t\t\tenableSwapPayments: !!checkoutOptions.options?.swap?.includes(\n\t\t\t\tTransactionSwapProvider.zerox,\n\t\t\t),\n\t\t\tcreditCardProviders: checkoutOptions?.options.nftCheckout || [],\n\t\t} satisfies SelectPaymentSettings;\n\n\t\tdebug('Open Kit PaymentModal', { order, checkoutOptions });\n\n\t\tawait this.openPaymentModalWithPromise(paymentModalProps);\n\t}\n\n\tprivate async executeStep({\n\t\tstep,\n\t\tprops,\n\t}: {\n\t\tstep: Step;\n\t\tprops: TransactionInput['props'];\n\t}) {\n\t\tdebug('Executing step', { stepId: step.id });\n\t\tif (!step.to && !step.signature) {\n\t\t\tthrow new Error('Invalid step data');\n\t\t}\n\n\t\ttry {\n\t\t\tawait this.switchChain();\n\t\t\tif (step.id === StepType.buy) {\n\t\t\t\tawait this.executeBuyStep({ step, props: props as BuyInput });\n\t\t\t} else if (step.signature) {\n\t\t\t\tawait this.executeSignature(step);\n\t\t\t} else if (step.id === StepType.tokenApproval) {\n\t\t\t\t//TODO: Add some sort ofs callback heres\n\t\t\t\tconst hash = await this.executeTransaction(step);\n\t\t\t\treturn { hash }\n\t\t\t} else {\n\t\t\t\tconst hash = await this.executeTransaction(step);\n\t\t\t\tthis.config.onSuccess?.(hash);\n\t\t\t\treturn { hash };\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tthis.config.onError?.(error as Error);\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\tasync getTransactionSteps(\n\t\tprops: TransactionInput['props'],\n\t): Promise<TransactionSteps> {\n\t\tdebug('Getting transaction steps', props);\n\t\t// Return memoized value if props and state haven't changed\n\t\tif (\n\t\t\tthis.memoizedSteps &&\n\t\t\tthis.lastProps &&\n\t\t\tJSON.stringify(props) === JSON.stringify(this.lastProps)\n\t\t) {\n\t\t\tdebug('Returning memoized steps');\n\t\t\treturn this.memoizedSteps;\n\t\t}\n\n\t\tconst type = this.config.config.type;\n\t\tconst steps = await this.generateSteps({\n\t\t\ttype,\n\t\t\tprops,\n\t\t} as TransactionInput);\n\t\t// Extract execution step, it should always be the last step\n\t\tconst executionStep = steps.pop();\n\t\tif (!executionStep) {\n\t\t\tthrow new Error('No steps found');\n\t\t}\n\t\tif (executionStep.id === StepType.tokenApproval) {\n\t\t\tthrow new Error('No execution step found, only approval step');\n\t\t}\n\t\tconst approvalStep = steps.pop();\n\n\t\tif (steps.length > 0) {\n\t\t\tthrow new Error('Unexpected steps found');\n\t\t}\n\n\t\tthis.lastProps = props;\n\t\tthis.memoizedSteps = {\n\t\t\tswitchChain: {\n\t\t\t\tisPending: !this.isOnCorrectChain(),\n\t\t\t\tisExecuting: this.currentState === TransactionState.SWITCH_CHAIN,\n\t\t\t\texecute: () => this.switchChain(),\n\t\t\t},\n\t\t\tapproval: {\n\t\t\t\tisPending: Boolean(approvalStep),\n\t\t\t\tisExecuting: this.currentState === TransactionState.TOKEN_APPROVAL,\n\t\t\t\texecute: () =>\n\t\t\t\t\tapprovalStep && this.executeStep({ step: approvalStep, props }),\n\t\t\t},\n\t\t\ttransaction: {\n\t\t\t\tisPending: Boolean(executionStep),\n\t\t\t\tisExecuting:\n\t\t\t\t\tthis.currentState === TransactionState.EXECUTING_TRANSACTION,\n\t\t\t\texecute: () => this.executeStep({ step: executionStep, props }),\n\t\t\t},\n\t\t} as const;\n\n\t\tdebug('Generated new transaction steps', this.memoizedSteps);\n\t\treturn this.memoizedSteps;\n\t}\n}\n","import { useSelectPaymentModal } from '@0xsequence/kit-checkout';\nimport type { Hash } from 'viem';\nimport { useAccount, useSwitchChain, useWalletClient } from 'wagmi';\nimport { getPublicRpcClient } from '../../../utils';\nimport { useConfig, useMarketplaceConfig } from '../../hooks';\nimport { useSwitchChainModal } from '../../ui/modals/_internal/components/switchChainModal';\nimport { WalletKind } from '../api';\nimport {\n\ttype TransactionConfig,\n\tTransactionMachine,\n} from './execute-transaction';\n\nexport type UseTransactionMachineConfig = Omit<\n\tTransactionConfig,\n\t'sdkConfig' | 'marketplaceConfig' | 'walletKind' | 'chains'\n>;\n\nexport const useTransactionMachine = (\n\tconfig: UseTransactionMachineConfig,\n\tonSuccess?: (hash: Hash) => void,\n\tonError?: (error: Error) => void,\n\tonTransactionSent?: (hash: Hash) => void,\n) => {\n\tconst { data: walletClient } = useWalletClient();\n\tconst { show: showSwitchChainModal } = useSwitchChainModal();\n\tconst sdkConfig = useConfig();\n\tconst { data: marketplaceConfig, error: marketplaceError } =\n\t\tuseMarketplaceConfig();\n\tconst { openSelectPaymentModal } = useSelectPaymentModal();\n\tconst { chains } = useSwitchChain();\n\n\tconst { connector } = useAccount();\n\tconst walletKind =\n\t\tconnector?.id === 'sequence' ? WalletKind.sequence : WalletKind.unknown;\n\n\tif (marketplaceError) {\n\t\tthrow marketplaceError; //TODO: Add error handling\n\t}\n\n\tif (!walletClient || !marketplaceConfig) return null;\n\n\treturn new TransactionMachine(\n\t\t{\n\t\t\tconfig: { sdkConfig, marketplaceConfig, walletKind, chains, ...config },\n\t\t\tonSuccess,\n\t\t\tonError,\n\t\t\tonTransactionSent,\n\t\t},\n\t\twalletClient,\n\t\tgetPublicRpcClient(config.chainId),\n\t\topenSelectPaymentModal,\n\t\tasync (chainId) => {\n\t\t\treturn new Promise<void>((resolve, reject) => {\n\t\t\t\tshowSwitchChainModal({\n\t\t\t\t\tchainIdToSwitchTo: Number(chainId),\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\tresolve();\n\t\t\t\t\t},\n\t\t\t\t\tonError: (error) => {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t});\n\t\t},\n\t);\n};\n","import {\n\tButton,\n\tCloseIcon,\n\tIconButton,\n\tSpinner,\n\tText,\n} from '@0xsequence/design-system';\nimport { observer } from '@legendapp/state/react';\nimport { Close, Content, Overlay, Portal, Root } from '@radix-ui/react-dialog';\nimport type { SwitchChainErrorType } from 'viem';\nimport { useSwitchChain } from 'wagmi';\nimport { getPresentableChainName } from '../../../../../../utils/network';\nimport type { ChainId } from '../../../../../_internal';\nimport AlertMessage from '../alertMessage';\nimport { switchChainModal$ } from './store';\nimport {\n\tcloseButton,\n\tdialogOverlay,\n\tswitchChainCta,\n\tswitchChainModalContent,\n} from './styles.css';\n\nexport type ShowSwitchChainModalArgs = {\n\tchainIdToSwitchTo: ChainId;\n\tonSuccess?: () => void;\n\tonError?: (error: SwitchChainErrorType) => void;\n};\n\nexport const useSwitchChainModal = () => {\n\treturn {\n\t\tshow: (args: ShowSwitchChainModalArgs) => switchChainModal$.open(args),\n\t\tclose: () => switchChainModal$.close(),\n\t\tisSwitching$: switchChainModal$.state.isSwitching,\n\t};\n};\n\nconst SwitchChainModal = observer(() => {\n\tconst chainIdToSwitchTo = switchChainModal$.state.chainIdToSwitchTo.get();\n\tconst isSwitching$ = switchChainModal$.state.isSwitching;\n\tconst chainName = getPresentableChainName(chainIdToSwitchTo!);\n\tconst { switchChainAsync } = useSwitchChain();\n\n\tasync function handleSwitchChain() {\n\t\tisSwitching$.set(true);\n\n\t\ttry {\n\t\t\tawait switchChainAsync({ chainId: Number(chainIdToSwitchTo!) });\n\n\t\t\tswitchChainModal$.state.onSuccess?.();\n\n\t\t\tswitchChainModal$.close();\n\t\t} catch (error) {\n\t\t\tswitchChainModal$.state.onError?.(error as SwitchChainErrorType);\n\t\t} finally {\n\t\t\tisSwitching$.set(false);\n\t\t}\n\t}\n\n\treturn (\n\t\t<Root open={switchChainModal$.isOpen.get()}>\n\t\t\t<Portal>\n\t\t\t\t<Overlay className={dialogOverlay} />\n\n\t\t\t\t<Content className={switchChainModalContent}>\n\t\t\t\t\t<Text fontSize=\"large\" fontWeight=\"bold\" color=\"text100\">\n\t\t\t\t\t\tWrong network\n\t\t\t\t\t</Text>\n\n\t\t\t\t\t<AlertMessage\n\t\t\t\t\t\ttype=\"warning\"\n\t\t\t\t\t\tmessage={`You need to switch to ${chainName} network before completing the transaction`}\n\t\t\t\t\t/>\n\n\t\t\t\t\t<Button\n\t\t\t\t\t\tname=\"switch-chain\"\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\tlabel={isSwitching$.get() ? <Spinner /> : 'Switch Network'}\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tpending={isSwitching$.get()}\n\t\t\t\t\t\tshape=\"square\"\n\t\t\t\t\t\tclassName={\n\t\t\t\t\t\t\tisSwitching$.get()\n\t\t\t\t\t\t\t\t? switchChainCta.pending\n\t\t\t\t\t\t\t\t: switchChainCta.default\n\t\t\t\t\t\t}\n\t\t\t\t\t\tjustifySelf=\"flex-end\"\n\t\t\t\t\t\tonClick={handleSwitchChain}\n\t\t\t\t\t/>\n\n\t\t\t\t\t<Close\n\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\tswitchChainModal$.delete();\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tclassName={closeButton}\n\t\t\t\t\t\tasChild\n\t\t\t\t\t>\n\t\t\t\t\t\t<IconButton size=\"xs\" aria-label=\"Close modal\" icon={CloseIcon} />\n\t\t\t\t\t</Close>\n\t\t\t\t</Content>\n\t\t\t</Portal>\n\t\t</Root>\n\t);\n});\n\nexport default SwitchChainModal;\n","import SvgInfoIcon from '../../../../icons/InfoIcon';\nimport { alertMessageBox, alertMessageBoxVariants } from './styles.css';\nimport { Box, Text, WarningIcon } from '@0xsequence/design-system';\n\ntype AlertMessageProps = {\n\tmessage: string;\n\ttype: 'warning' | 'info';\n};\n\nexport default function AlertMessage({ message, type }: AlertMessageProps) {\n\treturn (\n\t\t<Box className={`${alertMessageBox} ${alertMessageBoxVariants[type]}`}>\n\t\t\t<Text color=\"white\" fontSize=\"normal\" fontWeight=\"medium\" fontFamily=\"body\">\n\t\t\t\t{message}\n\t\t\t</Text>\n\n\t\t\t{type === 'warning' && <WarningIcon size=\"sm\" color=\"white\" />}\n\t\t\t{type === 'info' && <SvgInfoIcon size=\"sm\" color=\"white\" />}\n\t\t</Box>\n\t);\n}\n","import { observable } from '@legendapp/state';\nimport type { SwitchChainErrorType } from 'viem';\nimport type { ShowSwitchChainModalArgs } from '.';\nimport type { ChainId } from '../../../../../_internal';\n\nexport interface SwitchChainModalState {\n\tisOpen: boolean;\n\topen: (args: ShowSwitchChainModalArgs) => void;\n\tclose: () => void;\n\tstate: {\n\t\tchainIdToSwitchTo: ChainId | undefined;\n\t\tisSwitching: boolean;\n\t\tonSuccess: (() => void) | undefined;\n\t\tonError: undefined | ((error: SwitchChainErrorType) => void);\n\t};\n}\n\nexport const initialState: SwitchChainModalState = {\n\tisOpen: false,\n\topen: ({ chainIdToSwitchTo, onError, onSuccess }) => {\n\t\tswitchChainModal$.state.set({\n\t\t\t...switchChainModal$.state.get(),\n\t\t\tchainIdToSwitchTo,\n\t\t\tonError,\n\t\t\tonSuccess,\n\t\t});\n\t\tswitchChainModal$.isOpen.set(true);\n\t},\n\tclose: () => {\n\t\tswitchChainModal$.isOpen.set(false);\n\t\tswitchChainModal$.state.set({\n\t\t\t...initialState.state,\n\t\t});\n\t},\n\tstate: {\n\t\tchainIdToSwitchTo: undefined,\n\t\tonError: undefined,\n\t\tonSuccess: undefined,\n\t\tisSwitching: false,\n\t},\n};\n\nexport const switchChainModal$ = observable(initialState);\n","import {\n\ttype CancelInput,\n\tTransactionType,\n} from '../_internal/transaction-machine/execute-transaction';\nimport {\n\tuseTransactionMachine,\n\ttype UseTransactionMachineConfig,\n} from '../_internal/transaction-machine/useTransactionMachine';\n\ninterface UseCancelOrderArgs extends Omit<UseTransactionMachineConfig, 'type'> {\n\tonSuccess?: (hash: string) => void;\n\tonError?: (error: Error) => void;\n\tonTransactionSent?: (hash: string) => void;\n}\n\nexport const useCancelOrder = ({\n\tonSuccess,\n\tonError,\n\tonTransactionSent,\n\t...config\n}: UseCancelOrderArgs) => {\n\tconst machine = useTransactionMachine(\n\t\t{\n\t\t\t...config,\n\t\t\ttype: TransactionType.CANCEL,\n\t\t},\n\t\tonSuccess,\n\t\tonError,\n\t\tonTransactionSent,\n\t);\n\n\treturn {\n\t\tcancel: (props: CancelInput) => machine?.start({ props }),\n\t\tonError,\n\t\tonSuccess,\n\t\tonTransactionSent,\n\t};\n};\n","import {\n\ttype BuyInput,\n\tTransactionType,\n} from '../_internal/transaction-machine/execute-transaction';\nimport {\n\tuseTransactionMachine,\n\ttype UseTransactionMachineConfig,\n} from '../_internal/transaction-machine/useTransactionMachine';\n\ninterface UseBuyOrderArgs extends Omit<UseTransactionMachineConfig, 'type'> {\n\tonSuccess?: (hash: string) => void;\n\tonError?: (error: Error) => void;\n\tonTransactionSent?: (hash: string) => void;\n}\n\nexport const useBuyCollectable = ({\n\tonSuccess,\n\tonError,\n\tonTransactionSent,\n\t...config\n}: UseBuyOrderArgs) => {\n\tconst machine = useTransactionMachine(\n\t\t{\n\t\t\t...config,\n\t\t\ttype: TransactionType.BUY,\n\t\t},\n\t\tonSuccess,\n\t\tonError,\n\t\tonTransactionSent,\n\t);\n\n\treturn {\n\t\tbuy: (props: BuyInput) => machine?.start({ props }),\n\t\tonError,\n\t\tonSuccess,\n\t\tonTransactionSent,\n\t};\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,cAAc,WAAW,gBAAgB;AAElD,SAAS,SAAS;;;ACAlB,SAAS,kBAAkB;;;ACA3B,SAAS,qBAAqB;AAC9B,OAAO;AAiBJ;AAbI,IAAM,wBAAwB,cAAc,CAAC,CAAc;AAO3D,SAAS,oBAAoB;AAAA,EACnC;AAAA,EACA;AACD,GAAgC;AAC/B,SACC,oBAAC,sBAAsB,UAAtB,EAA+B,OAAO,QACtC,8BAAC,SAAI,IAAI,aAAc,UAAS,GACjC;AAEF;;;ADjBO,SAAS,YAAY;AAC3B,QAAM,UAAU,WAAW,qBAAqB;AAChD,MAAI,CAAC,SAAS;AACb,UAAM,IAAI;AAAA,MACT;AAAA,IACD;AAAA,EACD;AACA,SAAO;AACR;;;ADAA,IAAM,kCAAkC,EAAE,OAAO;AAAA,EAChD,mBAAmB;AAAA,EACnB,eAAe,oBAAoB,KAAK,EAAE,OAAO,OAAO,CAAC;AAAA,EACzD,aAAa;AAAA,EACb,SAAS,cAAc,KAAK,EAAE,OAAO,OAAO,CAAC;AAC9C,CAAC;AAMD,IAAM,4BAA4B,OACjC,MACA,WACI;AACJ,QAAM,aAAa,gCAAgC,MAAM,IAAI;AAC7D,QAAM,gBAAgB,i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A;AAAA,EACA,GAAG;AACJ,MAA0B;AACzB,QAAM,UAAU;AAAA,IACf;AAAA,MACC,GAAG;AAAA,MACH;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,SAAO;AAAA,IACN,QAAQ,CAAC,UAAuB,SAAS,MAAM,EAAE,MAAM,CAAC;AAAA,IACxD;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;;;ACtBO,IAAM,oBAAoB,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACJ,MAAuB;AACtB,QAAM,UAAU;AAAA,IACf;AAAA,MACC,GAAG;AAAA,MACH;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAEA,SAAO;AAAA,IACN,KAAK,CAAC,UAAoB,SAAS,MAAM,EAAE,MAAM,CAAC;AAAA,IAClD;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;","names":["queryOptions","useQuery","z","z","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","collection","queryOptions","useQuery","queryOptions","useQuery","z","ChainIdCoerce","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","SortOrder","z","z","sortOrderSchema","SortOrder","sortBySchema","pageSchema","infiniteQueryOptions","useInfiniteQuery","z","z","infiniteQueryOptions","useInfiniteQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","useQuery","queryOptions","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","useMutation","dateToUnixTime","useMutation","useMutation","z","z","useMutation","useMutation","z","z","useMutation","queryOptions","useQuery","z","useAccount","z","queryOptions","useQuery","queryOptions","useQuery","z","z","queryOptions","useQuery","queryOptions","useQuery","z","useAccount","z","queryOptions","useQuery","collection","useAccount","useSwitchChain","Text","jsx","jsx","jsxs","Text","useSwitchChain","useAccount"]}