@0xsequence/marketplace-sdk 0.4.5 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-SEISACMH.js → chunk-2FOUCP2R.js} +119 -123
- package/dist/chunk-2FOUCP2R.js.map +1 -0
- package/dist/{chunk-KZGDOIZY.js → chunk-36NGHJH5.js} +38 -47
- package/dist/chunk-36NGHJH5.js.map +1 -0
- package/dist/{chunk-KL5JPUPS.js → chunk-3C2MT5TM.js} +9 -9
- package/dist/chunk-3C2MT5TM.js.map +1 -0
- package/dist/{chunk-PAZ4MQXZ.js → chunk-5D3ARFFZ.js} +1 -1
- package/dist/chunk-5D3ARFFZ.js.map +1 -0
- package/dist/{chunk-ZEKRTFBU.js → chunk-DNVERQ5J.js} +12 -2
- package/dist/chunk-DNVERQ5J.js.map +1 -0
- package/dist/{chunk-FT3J32ZV.js → chunk-LTHX6RXH.js} +2 -2
- package/dist/{chunk-KILOCWY2.js → chunk-QVOUL555.js} +2 -2
- package/dist/{chunk-CKOWM2ZR.js → chunk-RD7HPANB.js} +4 -4
- package/dist/chunk-RD7HPANB.js.map +1 -0
- package/dist/{chunk-YUETNNZQ.js → chunk-WM4RGBFQ.js} +1 -10
- package/dist/{chunk-YUETNNZQ.js.map → chunk-WM4RGBFQ.js.map} +1 -1
- package/dist/{chunk-HTFBQVLV.js → chunk-ZEH4JI2U.js} +2 -2
- package/dist/{create-config-DMBOGsJp.d.ts → create-config-BBTTSJyp.d.ts} +2 -2
- package/dist/index.d.ts +3 -4
- package/dist/index.js +5 -5
- package/dist/{marketplace-config-0Rft6_Hv.d.ts → marketplace-config-vioKvBQe.d.ts} +1 -1
- package/dist/react/_internal/api/index.d.ts +2 -3
- package/dist/react/_internal/api/index.js +2 -2
- package/dist/react/_internal/index.d.ts +6 -7
- package/dist/react/_internal/index.js +6 -4
- package/dist/react/_internal/wagmi/index.d.ts +3 -4
- package/dist/react/_internal/wagmi/index.js +2 -2
- package/dist/react/hooks/index.d.ts +104 -104
- package/dist/react/hooks/index.js +7 -7
- package/dist/react/index.d.ts +5 -6
- package/dist/react/index.js +9 -9
- package/dist/react/ssr/index.js.map +1 -1
- package/dist/react/ui/components/index.d.ts +4 -3
- package/dist/react/ui/components/index.js +9 -9
- package/dist/react/ui/index.d.ts +5 -4
- package/dist/react/ui/index.js +9 -9
- package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +3 -2
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +7 -7
- package/dist/{marketplace.gen-jdKqutnd.d.ts → sdk-config-CasNGLz4.d.ts} +24 -1
- package/dist/{services-C2O-7p_M.d.ts → services-CbsurKYr.d.ts} +1 -2
- package/dist/types/index.d.ts +3 -4
- package/dist/types/index.js +4 -4
- package/dist/types-rupsBCjv.d.ts +70 -0
- package/dist/utils/index.d.ts +3 -2
- package/dist/utils/index.js +2 -2
- package/package.json +1 -1
- package/src/react/_internal/types.ts +51 -1
- package/src/react/_internal/{transaction-machine/utils.ts → utils.ts} +1 -1
- package/src/react/_internal/{transaction-machine → wallet}/wallet.ts +2 -2
- package/src/react/hooks/useCancelOrder.tsx +22 -3
- package/src/react/hooks/useCancelTransactionSteps.tsx +3 -5
- package/src/react/hooks/useCurrencies.tsx +16 -18
- package/src/react/ui/components/_internals/action-button/ActionButton.tsx +1 -1
- package/src/react/ui/components/collectible-card/CollectibleCard.tsx +1 -1
- package/src/react/ui/modals/BuyModal/hooks/useBuyCollectable.ts +7 -7
- package/src/react/ui/modals/BuyModal/hooks/useCheckoutOptions.ts +1 -1
- package/src/react/ui/modals/BuyModal/modals/CheckoutModal.tsx +12 -3
- package/src/react/ui/modals/CreateListingModal/hooks/useCreateListing.tsx +11 -2
- package/src/react/ui/modals/CreateListingModal/hooks/useGetTokenApproval.ts +1 -1
- package/src/react/ui/modals/CreateListingModal/hooks/useTransactionSteps.tsx +8 -22
- package/src/react/ui/modals/CreateListingModal/store.ts +3 -3
- package/src/react/ui/modals/MakeOfferModal/Modal.tsx +17 -24
- package/src/react/ui/modals/MakeOfferModal/hooks/useGetTokenApproval.tsx +2 -2
- package/src/react/ui/modals/MakeOfferModal/hooks/useMakeOffer.tsx +19 -3
- package/src/react/ui/modals/MakeOfferModal/hooks/useTransactionSteps.tsx +9 -23
- package/src/react/ui/modals/MakeOfferModal/store.ts +4 -4
- package/src/react/ui/modals/SellModal/hooks/useGetTokenApproval.tsx +1 -1
- package/src/react/ui/modals/SellModal/hooks/useTransactionSteps.tsx +7 -19
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/useHandleTransfer.tsx +1 -1
- package/src/react/ui/modals/_internal/components/actionModal/ActionModal.tsx +1 -1
- package/src/react/ui/modals/_internal/components/actionModal/ErrorModal.tsx +3 -1
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +4 -0
- package/src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx +11 -1
- package/src/react/ui/modals/_internal/components/priceInput/index.tsx +3 -0
- package/src/react/ui/modals/_internal/components/transactionPreview/useTransactionPreviewTitle.tsx +1 -1
- package/src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx +1 -1
- package/src/react/ui/modals/_internal/components/transactionStatusModal/store.ts +1 -1
- package/src/react/ui/modals/_internal/components/transactionStatusModal/util/getFormattedType.ts +1 -1
- package/src/react/ui/modals/_internal/components/transactionStatusModal/util/getMessage.ts +2 -2
- package/src/react/ui/modals/_internal/components/transactionStatusModal/util/getTitle.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/chunk-CKOWM2ZR.js.map +0 -1
- package/dist/chunk-KL5JPUPS.js.map +0 -1
- package/dist/chunk-KZGDOIZY.js.map +0 -1
- package/dist/chunk-PAZ4MQXZ.js.map +0 -1
- package/dist/chunk-SEISACMH.js.map +0 -1
- package/dist/chunk-ZEKRTFBU.js.map +0 -1
- package/dist/sdk-config-xWkdBdrL.d.ts +0 -24
- package/dist/types-DZb7GsfL.d.ts +0 -28
- package/src/react/_internal/transaction-machine/execute-transaction.ts +0 -676
- package/src/react/_internal/transaction-machine/useTransactionMachine.ts +0 -140
- /package/dist/{chunk-FT3J32ZV.js.map → chunk-LTHX6RXH.js.map} +0 -0
- /package/dist/{chunk-KILOCWY2.js.map → chunk-QVOUL555.js.map} +0 -0
- /package/dist/{chunk-HTFBQVLV.js.map → chunk-ZEH4JI2U.js.map} +0 -0
- /package/src/react/_internal/{transaction-machine/logger.ts → logger.ts} +0 -0
- /package/src/react/_internal/{transaction-machine → wallet}/useWallet.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react/_internal/types.ts","../src/react/_internal/api/get-query-client.ts","../src/react/_internal/api/marketplace.gen.ts","../src/react/_internal/api/query-keys.ts","../src/react/_internal/api/services.ts","../src/react/_internal/wagmi/create-config.ts","../src/react/_internal/wagmi/embedded.ts","../src/react/_internal/wagmi/universal.ts"],"sourcesContent":["import { ChainId as NetworkChainId } from '@0xsequence/network';\nimport type { Address } from 'viem';\nimport { z } from 'zod';\nimport type { ContractType, CreateReq } from '../../types';\nimport { Chain } from 'viem';\nimport { MarketplaceKind, OrderbookKind } from './api';\nimport { SdkConfig, MarketplaceConfig } from '../../types';\n\nexport const QueryArgSchema = z\n\t.object({\n\t\tenabled: z.boolean().optional(),\n\t})\n\t.optional();\n\nexport type QueryArg = z.infer<typeof QueryArgSchema>;\n\nexport const CollectableIdSchema = z.string().or(z.number());\n\nexport const ChainIdSchema = z.union([\n\tz.string(),\n\tz.number(),\n\tz.nativeEnum(NetworkChainId),\n]);\n\nexport const AddressSchema = z.string().transform((val, ctx) => {\n\tconst regex = /^0x[a-fA-F0-9]{40}$/;\n\n\tif (!regex.test(val)) {\n\t\tctx.addIssue({\n\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\tmessage: `Invalid Address ${val}`,\n\t\t});\n\t}\n\n\treturn val as Address;\n});\n\nexport type ChainId = z.infer<typeof ChainIdSchema>;\n\nexport type CollectionType = ContractType.ERC1155 | ContractType.ERC721;\n\ntype TransactionStep = {\n\texist: boolean;\n\tisExecuting: boolean;\n\texecute: () => Promise<void>;\n};\n\nexport type TransactionSteps = {\n\tapproval: TransactionStep;\n\ttransaction: TransactionStep;\n};\n\nexport enum TransactionType {\n\tBUY = 'BUY',\n\tSELL = 'SELL',\n\tLISTING = 'LISTING',\n\tOFFER = 'OFFER',\n\tTRANSFER = 'TRANSFER',\n\tCANCEL = 'CANCEL',\n}\n\nexport interface TransactionConfig {\n\ttype: TransactionType;\n\tchainId: string;\n\tchains: readonly Chain[];\n\tcollectionAddress: string;\n\tsdkConfig: SdkConfig;\n\tmarketplaceConfig: MarketplaceConfig;\n\torderbookKind?: OrderbookKind;\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","import {\n\tQueryClient,\n\tdefaultShouldDehydrateQuery,\n} from '@tanstack/react-query';\nimport { hashFn } from 'wagmi/query';\n\nfunction makeQueryClient() {\n\treturn new QueryClient({\n\t\tdefaultOptions: {\n\t\t\tqueries: {\n\t\t\t\tstaleTime: 60 * 1000,\n\t\t\t\tqueryKeyHashFn: hashFn,\n\t\t\t},\n\t\t\tdehydrate: {\n\t\t\t\tshouldDehydrateQuery: (query) =>\n\t\t\t\t\tdefaultShouldDehydrateQuery(query) ||\n\t\t\t\t\tquery.state.status === 'pending',\n\t\t\t},\n\t\t},\n\t});\n}\n\nlet browserQueryClient: QueryClient | undefined = undefined;\n\nexport function getQueryClient() {\n\tif (typeof globalThis.document === 'undefined') {\n\t\treturn makeQueryClient();\n\t}\n\n\tif (!browserQueryClient) browserQueryClient = makeQueryClient();\n\treturn browserQueryClient;\n}\n","/* eslint-disable */\n// marketplace-api adb7df6925a327f91a704b4118be9c6f15656768\n// --\n// Code generated by webrpc-gen@v0.22.0 with typescript generator. DO NOT EDIT.\n//\n// webrpc-gen -schema=marketplace.ridl -target=typescript -client -out=./clients/marketplace.gen.ts\n\nexport const WebrpcHeader = \"Webrpc\"\n\nexport const WebrpcHeaderValue = \"webrpc@v0.22.0;gen-typescript@v0.16.1;marketplace-api@v0.0.0-adb7df6925a327f91a704b4118be9c6f15656768\"\n\n// WebRPC description and code-gen version\nexport const WebRPCVersion = \"v1\"\n\n// Schema version of your RIDL schema\nexport const WebRPCSchemaVersion = \"\"\n\n// Schema hash generated from your RIDL schema\nexport const WebRPCSchemaHash = \"adb7df6925a327f91a704b4118be9c6f15656768\"\n\ntype WebrpcGenVersions = {\n webrpcGenVersion: string;\n codeGenName: string;\n codeGenVersion: string;\n schemaName: string;\n schemaVersion: string;\n};\n\nexport function VersionFromHeader(headers: Headers): WebrpcGenVersions {\n const headerValue = headers.get(WebrpcHeader);\n if (!headerValue) {\n return {\n webrpcGenVersion: \"\",\n codeGenName: \"\",\n codeGenVersion: \"\",\n schemaName: \"\",\n schemaVersion: \"\",\n };\n }\n\n return parseWebrpcGenVersions(headerValue);\n}\n\nfunction parseWebrpcGenVersions(header: string): WebrpcGenVersions {\n const versions = header.split(\";\");\n if (versions.length < 3) {\n return {\n webrpcGenVersion: \"\",\n codeGenName: \"\",\n codeGenVersion: \"\",\n schemaName: \"\",\n schemaVersion: \"\",\n };\n }\n\n const [_, webrpcGenVersion] = versions[0].split(\"@\");\n const [codeGenName, codeGenVersion] = versions[1].split(\"@\");\n const [schemaName, schemaVersion] = versions[2].split(\"@\");\n\n return {\n webrpcGenVersion,\n codeGenName,\n codeGenVersion,\n schemaName,\n schemaVersion,\n };\n}\n\n//\n// Types\n//\n\n\nexport interface TokenMetadata {\n tokenId: string\n name: string\n description?: string\n image?: string\n video?: string\n audio?: string\n properties?: {[key: string]: any}\n attributes: Array<{[key: string]: any}>\n image_data?: string\n external_url?: string\n background_color?: string\n animation_url?: string\n decimals?: number\n updatedAt?: string\n assets?: Array<Asset>\n}\n\nexport interface Asset {\n id: number\n collectionId: number\n tokenId: string\n url?: string\n metadataField: string\n name?: string\n filesize?: number\n mimeType?: string\n width?: number\n height?: number\n updatedAt?: string\n}\n\nexport enum SortOrder {\n DESC = 'DESC',\n ASC = 'ASC'\n}\n\nexport enum PropertyType {\n INT = 'INT',\n STRING = 'STRING',\n ARRAY = 'ARRAY',\n GENERIC = 'GENERIC'\n}\n\nexport enum MarketplaceKind {\n unknown = 'unknown',\n sequence_marketplace_v1 = 'sequence_marketplace_v1',\n sequence_marketplace_v2 = 'sequence_marketplace_v2',\n blur = 'blur',\n zerox = 'zerox',\n opensea = 'opensea',\n looks_rare = 'looks_rare',\n x2y2 = 'x2y2',\n alienswap = 'alienswap',\n payment_processor = 'payment_processor',\n mintify = 'mintify'\n}\n\nexport enum OrderbookKind {\n unknown = 'unknown',\n sequence_marketplace_v1 = 'sequence_marketplace_v1',\n sequence_marketplace_v2 = 'sequence_marketplace_v2',\n blur = 'blur',\n opensea = 'opensea',\n looks_rare = 'looks_rare',\n reservoir = 'reservoir',\n x2y2 = 'x2y2'\n}\n\nexport enum SourceKind {\n unknown = 'unknown',\n external = 'external',\n sequence_marketplace_v1 = 'sequence_marketplace_v1',\n sequence_marketplace_v2 = 'sequence_marketplace_v2'\n}\n\nexport enum OrderSide {\n unknown = 'unknown',\n listing = 'listing',\n offer = 'offer'\n}\n\nexport enum OrderStatus {\n unknown = 'unknown',\n active = 'active',\n inactive = 'inactive',\n expired = 'expired',\n cancelled = 'cancelled',\n filled = 'filled'\n}\n\nexport enum ContractType {\n UNKNOWN = 'UNKNOWN',\n ERC20 = 'ERC20',\n ERC721 = 'ERC721',\n ERC1155 = 'ERC1155'\n}\n\nexport enum CollectionStatus {\n unknown = 'unknown',\n created = 'created',\n syncing_metadata = 'syncing_metadata',\n synced_metadata = 'synced_metadata',\n syncing_tokens = 'syncing_tokens',\n synced_tokens = 'synced_tokens',\n syncing_orders = 'syncing_orders',\n active = 'active',\n failed = 'failed',\n inactive = 'inactive'\n}\n\nexport enum ProjectStatus {\n unknown = 'unknown',\n active = 'active',\n inactive = 'inactive'\n}\n\nexport enum CollectibleStatus {\n unknown = 'unknown',\n active = 'active',\n inactive = 'inactive'\n}\n\nexport enum WalletKind {\n unknown = 'unknown',\n sequence = 'sequence'\n}\n\nexport enum StepType {\n unknown = 'unknown',\n tokenApproval = 'tokenApproval',\n buy = 'buy',\n sell = 'sell',\n createListing = 'createListing',\n createOffer = 'createOffer',\n signEIP712 = 'signEIP712',\n signEIP191 = 'signEIP191',\n cancel = 'cancel'\n}\n\nexport enum TransactionCrypto {\n none = 'none',\n partially = 'partially',\n all = 'all'\n}\n\nexport enum TransactionNFTCheckoutProvider {\n unknown = 'unknown',\n sardine = 'sardine',\n transak = 'transak'\n}\n\nexport enum TransactionOnRampProvider {\n unknown = 'unknown',\n sardine = 'sardine',\n transak = 'transak'\n}\n\nexport enum TransactionSwapProvider {\n unknown = 'unknown',\n zerox = 'zerox'\n}\n\nexport enum ExecuteType {\n unknown = 'unknown',\n order = 'order'\n}\n\nexport interface Page {\n page: number\n pageSize: number\n more?: boolean\n sort?: Array<SortBy>\n}\n\nexport interface SortBy {\n column: string\n order: SortOrder\n}\n\nexport interface Filter {\n text?: string\n properties?: Array<PropertyFilter>\n}\n\nexport interface PropertyFilter {\n name: string\n type: PropertyType\n min?: number\n max?: number\n values?: Array<any>\n}\n\nexport interface CollectiblesFilter {\n includeEmpty: boolean\n searchText?: string\n properties?: Array<PropertyFilter>\n marketplaces?: Array<MarketplaceKind>\n inAccounts?: Array<string>\n notInAccounts?: Array<string>\n ordersCreatedBy?: Array<string>\n ordersNotCreatedBy?: Array<string>\n}\n\nexport interface Order {\n orderId: string\n marketplace: MarketplaceKind\n side: OrderSide\n status: OrderStatus\n chainId: number\n originName: string\n collectionContractAddress: string\n tokenId: string\n createdBy: string\n priceAmount: string\n priceAmountFormatted: string\n priceAmountNet: string\n priceAmountNetFormatted: string\n priceCurrencyAddress: string\n priceDecimals: number\n priceUSD: number\n quantityInitial: string\n quantityInitialFormatted: string\n quantityRemaining: string\n quantityRemainingFormatted: string\n quantityAvailable: string\n quantityAvailableFormatted: string\n quantityDecimals: number\n feeBps: number\n feeBreakdown: Array<FeeBreakdown>\n validFrom: string\n validUntil: string\n blockNumber: number\n orderCreatedAt?: string\n orderUpdatedAt?: string\n createdAt: string\n updatedAt: string\n deletedAt?: string\n}\n\nexport interface FeeBreakdown {\n kind: string\n recipientAddress: string\n bps: number\n}\n\nexport interface CollectibleOrder {\n metadata: TokenMetadata\n order?: Order\n}\n\nexport interface OrderFilter {\n createdBy?: Array<string>\n marketplace?: Array<MarketplaceKind>\n currencies?: Array<string>\n}\n\nexport interface Activity {\n type: string\n fromAddress: string\n toAddress: string\n txHash: string\n timestamp: number\n tokenId: string\n tokenImage: string\n tokenName: string\n currency?: Currency\n}\n\nexport interface Collection {\n status: CollectionStatus\n chainId: number\n contractAddress: string\n contractType: ContractType\n tokenQuantityDecimals: number\n config: CollectionConfig\n createdAt: string\n updatedAt: string\n deletedAt?: string\n}\n\nexport interface CollectionConfig {\n lastSynced: {[key: string]: CollectionLastSynced}\n collectiblesSynced: string\n}\n\nexport interface CollectionLastSynced {\n allOrders: string\n newOrders: string\n}\n\nexport interface Project {\n projectId: number\n chainId: number\n contractAddress: string\n status: ProjectStatus\n createdAt: string\n updatedAt: string\n deletedAt?: string\n}\n\nexport interface Collectible {\n chainId: number\n contractAddress: string\n status: CollectibleStatus\n tokenId: string\n createdAt: string\n updatedAt: string\n deletedAt?: string\n}\n\nexport interface Currency {\n chainId: number\n contractAddress: string\n name: string\n symbol: string\n decimals: number\n imageUrl: string\n exchangeRate: number\n defaultChainCurrency: boolean\n nativeCurrency: boolean\n createdAt: string\n updatedAt: string\n deletedAt?: string\n}\n\nexport interface OrderData {\n orderId: string\n quantity: string\n}\n\nexport interface AdditionalFee {\n amount: string\n receiver: string\n}\n\nexport interface Step {\n id: StepType\n data: string\n to: string\n value: string\n signature?: Signature\n post?: PostRequest\n executeType?: ExecuteType\n}\n\nexport interface PostRequest {\n endpoint: string\n method: string\n body: any\n}\n\nexport interface CreateReq {\n tokenId: string\n quantity: string\n expiry: string\n currencyAddress: string\n pricePerToken: string\n}\n\nexport interface GetOrdersInput {\n contractAddress: string\n orderId: string\n marketplace: MarketplaceKind\n}\n\nexport interface Signature {\n domain: Domain\n types: any\n primaryType: string\n value: any\n}\n\nexport interface Domain {\n name: string\n version: string\n chainId: number\n verifyingContract: string\n}\n\nexport interface CheckoutOptionsMarketplaceOrder {\n contractAddress: string\n orderId: string\n marketplace: MarketplaceKind\n}\n\nexport interface CheckoutOptionsItem {\n tokenId: string\n quantity: string\n}\n\nexport interface CheckoutOptions {\n crypto: TransactionCrypto\n swap: Array<TransactionSwapProvider>\n nftCheckout: Array<TransactionNFTCheckoutProvider>\n onRamp: Array<TransactionOnRampProvider>\n}\n\nexport interface Admin {\n createCollection(args: CreateCollectionArgs, headers?: object, signal?: AbortSignal): Promise<CreateCollectionReturn>\n getCollection(args: GetCollectionArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectionReturn>\n listCollections(args: ListCollectionsArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectionsReturn>\n deleteCollection(args: DeleteCollectionArgs, headers?: object, signal?: AbortSignal): Promise<DeleteCollectionReturn>\n syncCollection(args: SyncCollectionArgs, headers?: object, signal?: AbortSignal): Promise<SyncCollectionReturn>\n createCurrency(args: CreateCurrencyArgs, headers?: object, signal?: AbortSignal): Promise<CreateCurrencyReturn>\n createCurrencies(args: CreateCurrenciesArgs, headers?: object, signal?: AbortSignal): Promise<CreateCurrenciesReturn>\n updateCurrency(args: UpdateCurrencyArgs, headers?: object, signal?: AbortSignal): Promise<UpdateCurrencyReturn>\n listCurrencies(headers?: object, signal?: AbortSignal): Promise<ListCurrenciesReturn>\n deleteCurrency(args: DeleteCurrencyArgs, headers?: object, signal?: AbortSignal): Promise<DeleteCurrencyReturn>\n}\n\nexport interface CreateCollectionArgs {\n projectId: number\n contractAddress: string\n}\n\nexport interface CreateCollectionReturn {\n collection: Collection \n}\nexport interface GetCollectionArgs {\n projectId: number\n contractAddress: string\n}\n\nexport interface GetCollectionReturn {\n collection: Collection \n}\nexport interface ListCollectionsArgs {\n projectId: number\n page?: Page\n}\n\nexport interface ListCollectionsReturn {\n collections: Array<Collection>\n page?: Page \n}\nexport interface DeleteCollectionArgs {\n projectId: number\n contractAddress: string\n}\n\nexport interface DeleteCollectionReturn {\n collection: Collection \n}\nexport interface SyncCollectionArgs {\n projectId: number\n contractAddress: string\n}\n\nexport interface SyncCollectionReturn {\n collection: Collection \n}\nexport interface CreateCurrencyArgs {\n currency: Currency\n}\n\nexport interface CreateCurrencyReturn {\n currency: Currency \n}\nexport interface CreateCurrenciesArgs {\n currencies: Array<Currency>\n}\n\nexport interface CreateCurrenciesReturn {\n currency: {[key: string]: Currency} \n}\nexport interface UpdateCurrencyArgs {\n currency: Currency\n}\n\nexport interface UpdateCurrencyReturn {\n currency: Currency \n}\nexport interface ListCurrenciesArgs {\n}\n\nexport interface ListCurrenciesReturn {\n currencies: Array<Currency> \n}\nexport interface DeleteCurrencyArgs {\n chainId: number\n contractAddress: string\n}\n\nexport interface DeleteCurrencyReturn {\n currency: Currency \n}\n\nexport interface Marketplace {\n listCurrencies(headers?: object, signal?: AbortSignal): Promise<ListCurrenciesReturn>\n getCollectible(args: GetCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleReturn>\n getLowestPriceOfferForCollectible(args: GetLowestPriceOfferForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetLowestPriceOfferForCollectibleReturn>\n getHighestPriceOfferForCollectible(args: GetHighestPriceOfferForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetHighestPriceOfferForCollectibleReturn>\n getLowestPriceListingForCollectible(args: GetLowestPriceListingForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetLowestPriceListingForCollectibleReturn>\n getHighestPriceListingForCollectible(args: GetHighestPriceListingForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetHighestPriceListingForCollectibleReturn>\n listListingsForCollectible(args: ListListingsForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<ListListingsForCollectibleReturn>\n listOffersForCollectible(args: ListOffersForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<ListOffersForCollectibleReturn>\n getCountOfListingsForCollectible(args: GetCountOfListingsForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetCountOfListingsForCollectibleReturn>\n getCountOfOffersForCollectible(args: GetCountOfOffersForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetCountOfOffersForCollectibleReturn>\n getCollectibleLowestOffer(args: GetCollectibleLowestOfferArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleLowestOfferReturn>\n getCollectibleHighestOffer(args: GetCollectibleHighestOfferArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleHighestOfferReturn>\n getCollectibleLowestListing(args: GetCollectibleLowestListingArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleLowestListingReturn>\n getCollectibleHighestListing(args: GetCollectibleHighestListingArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleHighestListingReturn>\n listCollectibleListings(args: ListCollectibleListingsArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectibleListingsReturn>\n listCollectibleOffers(args: ListCollectibleOffersArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectibleOffersReturn>\n generateBuyTransaction(args: GenerateBuyTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateBuyTransactionReturn>\n generateSellTransaction(args: GenerateSellTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateSellTransactionReturn>\n generateListingTransaction(args: GenerateListingTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateListingTransactionReturn>\n generateOfferTransaction(args: GenerateOfferTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateOfferTransactionReturn>\n generateCancelTransaction(args: GenerateCancelTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateCancelTransactionReturn>\n execute(args: ExecuteArgs, headers?: object, signal?: AbortSignal): Promise<ExecuteReturn>\n listCollectibles(args: ListCollectiblesArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectiblesReturn>\n getCountOfAllCollectibles(args: GetCountOfAllCollectiblesArgs, headers?: object, signal?: AbortSignal): Promise<GetCountOfAllCollectiblesReturn>\n getCountOfFilteredCollectibles(args: GetCountOfFilteredCollectiblesArgs, headers?: object, signal?: AbortSignal): Promise<GetCountOfFilteredCollectiblesReturn>\n getFloorOrder(args: GetFloorOrderArgs, headers?: object, signal?: AbortSignal): Promise<GetFloorOrderReturn>\n listCollectiblesWithLowestListing(args: ListCollectiblesWithLowestListingArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectiblesWithLowestListingReturn>\n listCollectiblesWithHighestOffer(args: ListCollectiblesWithHighestOfferArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectiblesWithHighestOfferReturn>\n syncOrder(args: SyncOrderArgs, headers?: object, signal?: AbortSignal): Promise<SyncOrderReturn>\n syncOrders(args: SyncOrdersArgs, headers?: object, signal?: AbortSignal): Promise<SyncOrdersReturn>\n getOrders(args: GetOrdersArgs, headers?: object, signal?: AbortSignal): Promise<GetOrdersReturn>\n checkoutOptionsMarketplace(args: CheckoutOptionsMarketplaceArgs, headers?: object, signal?: AbortSignal): Promise<CheckoutOptionsMarketplaceReturn>\n checkoutOptionsSalesContract(args: CheckoutOptionsSalesContractArgs, headers?: object, signal?: AbortSignal): Promise<CheckoutOptionsSalesContractReturn>\n}\n\nexport interface ListCurrenciesArgs {\n}\n\nexport interface ListCurrenciesReturn {\n currencies: Array<Currency> \n}\nexport interface GetCollectibleArgs {\n contractAddress: string\n tokenId: string\n}\n\nexport interface GetCollectibleReturn {\n metadata: TokenMetadata \n}\nexport interface GetLowestPriceOfferForCollectibleArgs {\n contractAddress: string\n tokenId: string\n filter?: OrderFilter\n}\n\nexport interface GetLowestPriceOfferForCollectibleReturn {\n order: Order \n}\nexport interface GetHighestPriceOfferForCollectibleArgs {\n contractAddress: string\n tokenId: string\n filter?: OrderFilter\n}\n\nexport interface GetHighestPriceOfferForCollectibleReturn {\n order: Order \n}\nexport interface GetLowestPriceListingForCollectibleArgs {\n contractAddress: string\n tokenId: string\n filter?: OrderFilter\n}\n\nexport interface GetLowestPriceListingForCollectibleReturn {\n order: Order \n}\nexport interface GetHighestPriceListingForCollectibleArgs {\n contractAddress: string\n tokenId: string\n filter?: OrderFilter\n}\n\nexport interface GetHighestPriceListingForCollectibleReturn {\n order: Order \n}\nexport interface ListListingsForCollectibleArgs {\n contractAddress: string\n tokenId: string\n filter?: OrderFilter\n page?: Page\n}\n\nexport interface ListListingsForCollectibleReturn {\n listings: Array<Order>\n page?: Page \n}\nexport interface ListOffersForCollectibleArgs {\n contractAddress: string\n tokenId: string\n filter?: OrderFilter\n page?: Page\n}\n\nexport interface ListOffersForCollectibleReturn {\n offers: Array<Order>\n page?: Page \n}\nexport interface GetCountOfListingsForCollectibleArgs {\n contractAddress: string\n tokenId: string\n filter?: OrderFilter\n}\n\nexport interface GetCountOfListingsForCollectibleReturn {\n count: number \n}\nexport interface GetCountOfOffersForCollectibleArgs {\n contractAddress: string\n tokenId: string\n filter?: OrderFilter\n}\n\nexport interface GetCountOfOffersForCollectibleReturn {\n count: number \n}\nexport interface GetCollectibleLowestOfferArgs {\n contractAddress: string\n tokenId: string\n filter?: OrderFilter\n}\n\nexport interface GetCollectibleLowestOfferReturn {\n order?: Order \n}\nexport interface GetCollectibleHighestOfferArgs {\n contractAddress: string\n tokenId: string\n filter?: OrderFilter\n}\n\nexport interface GetCollectibleHighestOfferReturn {\n order?: Order \n}\nexport interface GetCollectibleLowestListingArgs {\n contractAddress: string\n tokenId: string\n filter?: OrderFilter\n}\n\nexport interface GetCollectibleLowestListingReturn {\n order?: Order \n}\nexport interface GetCollectibleHighestListingArgs {\n contractAddress: string\n tokenId: string\n filter?: OrderFilter\n}\n\nexport interface GetCollectibleHighestListingReturn {\n order?: Order \n}\nexport interface ListCollectibleListingsArgs {\n contractAddress: string\n tokenId: string\n filter?: OrderFilter\n page?: Page\n}\n\nexport interface ListCollectibleListingsReturn {\n listings: Array<Order>\n page?: Page \n}\nexport interface ListCollectibleOffersArgs {\n contractAddress: string\n tokenId: string\n filter?: OrderFilter\n page?: Page\n}\n\nexport interface ListCollectibleOffersReturn {\n offers: Array<Order>\n page?: Page \n}\nexport interface GenerateBuyTransactionArgs {\n collectionAddress: string\n buyer: string\n marketplace: MarketplaceKind\n ordersData: Array<OrderData>\n additionalFees: Array<AdditionalFee>\n walletType?: WalletKind\n}\n\nexport interface GenerateBuyTransactionReturn {\n steps: Array<Step> \n}\nexport interface GenerateSellTransactionArgs {\n collectionAddress: string\n seller: string\n marketplace: MarketplaceKind\n ordersData: Array<OrderData>\n additionalFees: Array<AdditionalFee>\n walletType?: WalletKind\n}\n\nexport interface GenerateSellTransactionReturn {\n steps: Array<Step> \n}\nexport interface GenerateListingTransactionArgs {\n collectionAddress: string\n owner: string\n contractType: ContractType\n orderbook: OrderbookKind\n listing: CreateReq\n walletType?: WalletKind\n}\n\nexport interface GenerateListingTransactionReturn {\n steps: Array<Step> \n}\nexport interface GenerateOfferTransactionArgs {\n collectionAddress: string\n maker: string\n contractType: ContractType\n orderbook: OrderbookKind\n offer: CreateReq\n walletType?: WalletKind\n}\n\nexport interface GenerateOfferTransactionReturn {\n steps: Array<Step> \n}\nexport interface GenerateCancelTransactionArgs {\n collectionAddress: string\n maker: string\n marketplace: MarketplaceKind\n orderId: string\n}\n\nexport interface GenerateCancelTransactionReturn {\n steps: Array<Step> \n}\nexport interface ExecuteArgs {\n signature: string\n executeType: ExecuteType\n body: any\n}\n\nexport interface ExecuteReturn {\n orderId: string \n}\nexport interface ListCollectiblesArgs {\n side: OrderSide\n contractAddress: string\n filter?: CollectiblesFilter\n page?: Page\n}\n\nexport interface ListCollectiblesReturn {\n collectibles: Array<CollectibleOrder>\n page?: Page \n}\nexport interface GetCountOfAllCollectiblesArgs {\n contractAddress: string\n}\n\nexport interface GetCountOfAllCollectiblesReturn {\n count: number \n}\nexport interface GetCountOfFilteredCollectiblesArgs {\n side: OrderSide\n contractAddress: string\n filter?: CollectiblesFilter\n}\n\nexport interface GetCountOfFilteredCollectiblesReturn {\n count: number \n}\nexport interface GetFloorOrderArgs {\n contractAddress: string\n filter?: CollectiblesFilter\n}\n\nexport interface GetFloorOrderReturn {\n collectible: CollectibleOrder \n}\nexport interface ListCollectiblesWithLowestListingArgs {\n contractAddress: string\n filter?: CollectiblesFilter\n page?: Page\n}\n\nexport interface ListCollectiblesWithLowestListingReturn {\n collectibles: Array<CollectibleOrder>\n page?: Page \n}\nexport interface ListCollectiblesWithHighestOfferArgs {\n contractAddress: string\n filter?: CollectiblesFilter\n page?: Page\n}\n\nexport interface ListCollectiblesWithHighestOfferReturn {\n collectibles: Array<CollectibleOrder>\n page?: Page \n}\nexport interface SyncOrderArgs {\n order: Order\n}\n\nexport interface SyncOrderReturn { \n}\nexport interface SyncOrdersArgs {\n orders: Array<Order>\n}\n\nexport interface SyncOrdersReturn { \n}\nexport interface GetOrdersArgs {\n input: Array<GetOrdersInput>\n page?: Page\n}\n\nexport interface GetOrdersReturn {\n orders: Array<Order>\n page?: Page \n}\nexport interface CheckoutOptionsMarketplaceArgs {\n wallet: string\n orders: Array<CheckoutOptionsMarketplaceOrder>\n additionalFee: number\n}\n\nexport interface CheckoutOptionsMarketplaceReturn {\n options: CheckoutOptions \n}\nexport interface CheckoutOptionsSalesContractArgs {\n wallet: string\n contractAddress: string\n collectionAddress: string\n items: Array<CheckoutOptionsItem>\n}\n\nexport interface CheckoutOptionsSalesContractReturn {\n options: CheckoutOptions \n}\n\n\n \n//\n// Client\n//\nexport class Admin implements Admin {\n protected hostname: string\n protected fetch: Fetch\n protected path = '/rpc/Admin/'\n\n constructor(hostname: string, fetch: Fetch) {\n this.hostname = hostname.replace(/\\/*$/, '')\n this.fetch = (input: RequestInfo, init?: RequestInit) => fetch(input, init)\n }\n\n private url(name: string): string {\n return this.hostname + this.path + name\n }\n \n createCollection = (args: CreateCollectionArgs, headers?: object, signal?: AbortSignal): Promise<CreateCollectionReturn> => {\n return this.fetch(\n this.url('CreateCollection'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n collection: <Collection>(_data.collection),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n getCollection = (args: GetCollectionArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectionReturn> => {\n return this.fetch(\n this.url('GetCollection'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n collection: <Collection>(_data.collection),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n listCollections = (args: ListCollectionsArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectionsReturn> => {\n return this.fetch(\n this.url('ListCollections'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n collections: <Array<Collection>>(_data.collections),\n page: <Page>(_data.page),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n deleteCollection = (args: DeleteCollectionArgs, headers?: object, signal?: AbortSignal): Promise<DeleteCollectionReturn> => {\n return this.fetch(\n this.url('DeleteCollection'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n collection: <Collection>(_data.collection),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n syncCollection = (args: SyncCollectionArgs, headers?: object, signal?: AbortSignal): Promise<SyncCollectionReturn> => {\n return this.fetch(\n this.url('SyncCollection'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n collection: <Collection>(_data.collection),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n createCurrency = (args: CreateCurrencyArgs, headers?: object, signal?: AbortSignal): Promise<CreateCurrencyReturn> => {\n return this.fetch(\n this.url('CreateCurrency'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n currency: <Currency>(_data.currency),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n createCurrencies = (args: CreateCurrenciesArgs, headers?: object, signal?: AbortSignal): Promise<CreateCurrenciesReturn> => {\n return this.fetch(\n this.url('CreateCurrencies'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n currency: <{[key: string]: Currency}>(_data.currency),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n updateCurrency = (args: UpdateCurrencyArgs, headers?: object, signal?: AbortSignal): Promise<UpdateCurrencyReturn> => {\n return this.fetch(\n this.url('UpdateCurrency'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n currency: <Currency>(_data.currency),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n listCurrencies = (headers?: object, signal?: AbortSignal): Promise<ListCurrenciesReturn> => {\n return this.fetch(\n this.url('ListCurrencies'),\n createHTTPRequest({}, headers, signal)\n ).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n currencies: <Array<Currency>>(_data.currencies),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n deleteCurrency = (args: DeleteCurrencyArgs, headers?: object, signal?: AbortSignal): Promise<DeleteCurrencyReturn> => {\n return this.fetch(\n this.url('DeleteCurrency'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n currency: <Currency>(_data.currency),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n}\nexport class Marketplace implements Marketplace {\n protected hostname: string\n protected fetch: Fetch\n protected path = '/rpc/Marketplace/'\n\n constructor(hostname: string, fetch: Fetch) {\n this.hostname = hostname.replace(/\\/*$/, '')\n this.fetch = (input: RequestInfo, init?: RequestInit) => fetch(input, init)\n }\n\n private url(name: string): string {\n return this.hostname + this.path + name\n }\n \n listCurrencies = (headers?: object, signal?: AbortSignal): Promise<ListCurrenciesReturn> => {\n return this.fetch(\n this.url('ListCurrencies'),\n createHTTPRequest({}, headers, signal)\n ).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n currencies: <Array<Currency>>(_data.currencies),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n getCollectible = (args: GetCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleReturn> => {\n return this.fetch(\n this.url('GetCollectible'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n metadata: <TokenMetadata>(_data.metadata),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n getLowestPriceOfferForCollectible = (args: GetLowestPriceOfferForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetLowestPriceOfferForCollectibleReturn> => {\n return this.fetch(\n this.url('GetLowestPriceOfferForCollectible'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n order: <Order>(_data.order),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n getHighestPriceOfferForCollectible = (args: GetHighestPriceOfferForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetHighestPriceOfferForCollectibleReturn> => {\n return this.fetch(\n this.url('GetHighestPriceOfferForCollectible'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n order: <Order>(_data.order),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n getLowestPriceListingForCollectible = (args: GetLowestPriceListingForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetLowestPriceListingForCollectibleReturn> => {\n return this.fetch(\n this.url('GetLowestPriceListingForCollectible'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n order: <Order>(_data.order),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n getHighestPriceListingForCollectible = (args: GetHighestPriceListingForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetHighestPriceListingForCollectibleReturn> => {\n return this.fetch(\n this.url('GetHighestPriceListingForCollectible'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n order: <Order>(_data.order),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n listListingsForCollectible = (args: ListListingsForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<ListListingsForCollectibleReturn> => {\n return this.fetch(\n this.url('ListListingsForCollectible'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n listings: <Array<Order>>(_data.listings),\n page: <Page>(_data.page),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n listOffersForCollectible = (args: ListOffersForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<ListOffersForCollectibleReturn> => {\n return this.fetch(\n this.url('ListOffersForCollectible'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n offers: <Array<Order>>(_data.offers),\n page: <Page>(_data.page),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n getCountOfListingsForCollectible = (args: GetCountOfListingsForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetCountOfListingsForCollectibleReturn> => {\n return this.fetch(\n this.url('GetCountOfListingsForCollectible'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n count: <number>(_data.count),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n getCountOfOffersForCollectible = (args: GetCountOfOffersForCollectibleArgs, headers?: object, signal?: AbortSignal): Promise<GetCountOfOffersForCollectibleReturn> => {\n return this.fetch(\n this.url('GetCountOfOffersForCollectible'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n count: <number>(_data.count),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n getCollectibleLowestOffer = (args: GetCollectibleLowestOfferArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleLowestOfferReturn> => {\n return this.fetch(\n this.url('GetCollectibleLowestOffer'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n order: <Order>(_data.order),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n getCollectibleHighestOffer = (args: GetCollectibleHighestOfferArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleHighestOfferReturn> => {\n return this.fetch(\n this.url('GetCollectibleHighestOffer'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n order: <Order>(_data.order),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n getCollectibleLowestListing = (args: GetCollectibleLowestListingArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleLowestListingReturn> => {\n return this.fetch(\n this.url('GetCollectibleLowestListing'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n order: <Order>(_data.order),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n getCollectibleHighestListing = (args: GetCollectibleHighestListingArgs, headers?: object, signal?: AbortSignal): Promise<GetCollectibleHighestListingReturn> => {\n return this.fetch(\n this.url('GetCollectibleHighestListing'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n order: <Order>(_data.order),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n listCollectibleListings = (args: ListCollectibleListingsArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectibleListingsReturn> => {\n return this.fetch(\n this.url('ListCollectibleListings'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n listings: <Array<Order>>(_data.listings),\n page: <Page>(_data.page),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n listCollectibleOffers = (args: ListCollectibleOffersArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectibleOffersReturn> => {\n return this.fetch(\n this.url('ListCollectibleOffers'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n offers: <Array<Order>>(_data.offers),\n page: <Page>(_data.page),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n generateBuyTransaction = (args: GenerateBuyTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateBuyTransactionReturn> => {\n return this.fetch(\n this.url('GenerateBuyTransaction'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n steps: <Array<Step>>(_data.steps),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n generateSellTransaction = (args: GenerateSellTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateSellTransactionReturn> => {\n return this.fetch(\n this.url('GenerateSellTransaction'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n steps: <Array<Step>>(_data.steps),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n generateListingTransaction = (args: GenerateListingTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateListingTransactionReturn> => {\n return this.fetch(\n this.url('GenerateListingTransaction'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n steps: <Array<Step>>(_data.steps),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n generateOfferTransaction = (args: GenerateOfferTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateOfferTransactionReturn> => {\n return this.fetch(\n this.url('GenerateOfferTransaction'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n steps: <Array<Step>>(_data.steps),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n generateCancelTransaction = (args: GenerateCancelTransactionArgs, headers?: object, signal?: AbortSignal): Promise<GenerateCancelTransactionReturn> => {\n return this.fetch(\n this.url('GenerateCancelTransaction'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n steps: <Array<Step>>(_data.steps),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n execute = (args: ExecuteArgs, headers?: object, signal?: AbortSignal): Promise<ExecuteReturn> => {\n return this.fetch(\n this.url('Execute'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n orderId: <string>(_data.orderId),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n listCollectibles = (args: ListCollectiblesArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectiblesReturn> => {\n return this.fetch(\n this.url('ListCollectibles'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n collectibles: <Array<CollectibleOrder>>(_data.collectibles),\n page: <Page>(_data.page),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n getCountOfAllCollectibles = (args: GetCountOfAllCollectiblesArgs, headers?: object, signal?: AbortSignal): Promise<GetCountOfAllCollectiblesReturn> => {\n return this.fetch(\n this.url('GetCountOfAllCollectibles'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n count: <number>(_data.count),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n getCountOfFilteredCollectibles = (args: GetCountOfFilteredCollectiblesArgs, headers?: object, signal?: AbortSignal): Promise<GetCountOfFilteredCollectiblesReturn> => {\n return this.fetch(\n this.url('GetCountOfFilteredCollectibles'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n count: <number>(_data.count),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n getFloorOrder = (args: GetFloorOrderArgs, headers?: object, signal?: AbortSignal): Promise<GetFloorOrderReturn> => {\n return this.fetch(\n this.url('GetFloorOrder'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n collectible: <CollectibleOrder>(_data.collectible),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n listCollectiblesWithLowestListing = (args: ListCollectiblesWithLowestListingArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectiblesWithLowestListingReturn> => {\n return this.fetch(\n this.url('ListCollectiblesWithLowestListing'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n collectibles: <Array<CollectibleOrder>>(_data.collectibles),\n page: <Page>(_data.page),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n listCollectiblesWithHighestOffer = (args: ListCollectiblesWithHighestOfferArgs, headers?: object, signal?: AbortSignal): Promise<ListCollectiblesWithHighestOfferReturn> => {\n return this.fetch(\n this.url('ListCollectiblesWithHighestOffer'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n collectibles: <Array<CollectibleOrder>>(_data.collectibles),\n page: <Page>(_data.page),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n syncOrder = (args: SyncOrderArgs, headers?: object, signal?: AbortSignal): Promise<SyncOrderReturn> => {\n return this.fetch(\n this.url('SyncOrder'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {}\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n syncOrders = (args: SyncOrdersArgs, headers?: object, signal?: AbortSignal): Promise<SyncOrdersReturn> => {\n return this.fetch(\n this.url('SyncOrders'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {}\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n getOrders = (args: GetOrdersArgs, headers?: object, signal?: AbortSignal): Promise<GetOrdersReturn> => {\n return this.fetch(\n this.url('GetOrders'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n orders: <Array<Order>>(_data.orders),\n page: <Page>(_data.page),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n checkoutOptionsMarketplace = (args: CheckoutOptionsMarketplaceArgs, headers?: object, signal?: AbortSignal): Promise<CheckoutOptionsMarketplaceReturn> => {\n return this.fetch(\n this.url('CheckoutOptionsMarketplace'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n options: <CheckoutOptions>(_data.options),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n checkoutOptionsSalesContract = (args: CheckoutOptionsSalesContractArgs, headers?: object, signal?: AbortSignal): Promise<CheckoutOptionsSalesContractReturn> => {\n return this.fetch(\n this.url('CheckoutOptionsSalesContract'),\n createHTTPRequest(args, headers, signal)).then((res) => {\n return buildResponse(res).then(_data => {\n return {\n options: <CheckoutOptions>(_data.options),\n }\n })\n }, (error) => {\n throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` })\n })\n }\n \n}\n\n const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => {\n const reqHeaders: {[key: string]: string} = { ...headers, 'Content-Type': 'application/json' }\n reqHeaders[WebrpcHeader] = WebrpcHeaderValue\n\n return {\n method: 'POST',\n headers: reqHeaders,\n body: JSON.stringify(body || {}),\n signal\n }\n}\n\nconst buildResponse = (res: Response): Promise<any> => {\n return res.text().then(text => {\n let data\n try {\n data = JSON.parse(text)\n } catch(error) {\n let message = ''\n if (error instanceof Error) {\n message = error.message\n }\n throw WebrpcBadResponseError.new({\n status: res.status,\n cause: `JSON.parse(): ${message}: response text: ${text}`},\n )\n }\n if (!res.ok) {\n const code: number = (typeof data.code === 'number') ? data.code : 0\n throw (webrpcErrorByCode[code] || WebrpcError).new(data)\n }\n return data\n })\n}\n\n//\n// Errors\n//\n\nexport class WebrpcError extends Error {\n name: string\n code: number\n message: string\n status: number\n cause?: string\n\n /** @deprecated Use message instead of msg. Deprecated in webrpc v0.11.0. */\n msg: string\n\n constructor(name: string, code: number, message: string, status: number, cause?: string) {\n super(message)\n this.name = name || 'WebrpcError'\n this.code = typeof code === 'number' ? code : 0\n this.message = message || `endpoint error ${this.code}`\n this.msg = this.message\n this.status = typeof status === 'number' ? status : 0\n this.cause = cause\n Object.setPrototypeOf(this, WebrpcError.prototype)\n }\n\n static new(payload: any): WebrpcError {\n return new this(payload.error, payload.code, payload.message || payload.msg, payload.status, payload.cause)\n }\n}\n\n// Webrpc errors\n\nexport class WebrpcEndpointError extends WebrpcError {\n constructor(\n name: string = 'WebrpcEndpoint',\n code: number = 0,\n message: string = 'endpoint error',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, WebrpcEndpointError.prototype)\n }\n}\n\nexport class WebrpcRequestFailedError extends WebrpcError {\n constructor(\n name: string = 'WebrpcRequestFailed',\n code: number = -1,\n message: string = 'request failed',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, WebrpcRequestFailedError.prototype)\n }\n}\n\nexport class WebrpcBadRouteError extends WebrpcError {\n constructor(\n name: string = 'WebrpcBadRoute',\n code: number = -2,\n message: string = 'bad route',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, WebrpcBadRouteError.prototype)\n }\n}\n\nexport class WebrpcBadMethodError extends WebrpcError {\n constructor(\n name: string = 'WebrpcBadMethod',\n code: number = -3,\n message: string = 'bad method',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, WebrpcBadMethodError.prototype)\n }\n}\n\nexport class WebrpcBadRequestError extends WebrpcError {\n constructor(\n name: string = 'WebrpcBadRequest',\n code: number = -4,\n message: string = 'bad request',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, WebrpcBadRequestError.prototype)\n }\n}\n\nexport class WebrpcBadResponseError extends WebrpcError {\n constructor(\n name: string = 'WebrpcBadResponse',\n code: number = -5,\n message: string = 'bad response',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, WebrpcBadResponseError.prototype)\n }\n}\n\nexport class WebrpcServerPanicError extends WebrpcError {\n constructor(\n name: string = 'WebrpcServerPanic',\n code: number = -6,\n message: string = 'server panic',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, WebrpcServerPanicError.prototype)\n }\n}\n\nexport class WebrpcInternalErrorError extends WebrpcError {\n constructor(\n name: string = 'WebrpcInternalError',\n code: number = -7,\n message: string = 'internal error',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, WebrpcInternalErrorError.prototype)\n }\n}\n\nexport class WebrpcClientDisconnectedError extends WebrpcError {\n constructor(\n name: string = 'WebrpcClientDisconnected',\n code: number = -8,\n message: string = 'client disconnected',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, WebrpcClientDisconnectedError.prototype)\n }\n}\n\nexport class WebrpcStreamLostError extends WebrpcError {\n constructor(\n name: string = 'WebrpcStreamLost',\n code: number = -9,\n message: string = 'stream lost',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, WebrpcStreamLostError.prototype)\n }\n}\n\nexport class WebrpcStreamFinishedError extends WebrpcError {\n constructor(\n name: string = 'WebrpcStreamFinished',\n code: number = -10,\n message: string = 'stream finished',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, WebrpcStreamFinishedError.prototype)\n }\n}\n\n\n// Schema errors\n\nexport class UnauthorizedError extends WebrpcError {\n constructor(\n name: string = 'Unauthorized',\n code: number = 1000,\n message: string = 'Unauthorized access',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, UnauthorizedError.prototype)\n }\n}\n\nexport class PermissionDeniedError extends WebrpcError {\n constructor(\n name: string = 'PermissionDenied',\n code: number = 1001,\n message: string = 'Permission denied',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, PermissionDeniedError.prototype)\n }\n}\n\nexport class SessionExpiredError extends WebrpcError {\n constructor(\n name: string = 'SessionExpired',\n code: number = 1002,\n message: string = 'Session expired',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, SessionExpiredError.prototype)\n }\n}\n\nexport class MethodNotFoundError extends WebrpcError {\n constructor(\n name: string = 'MethodNotFound',\n code: number = 1003,\n message: string = 'Method not found',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, MethodNotFoundError.prototype)\n }\n}\n\nexport class TimeoutError extends WebrpcError {\n constructor(\n name: string = 'Timeout',\n code: number = 2000,\n message: string = 'Request timed out',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, TimeoutError.prototype)\n }\n}\n\nexport class InvalidArgumentError extends WebrpcError {\n constructor(\n name: string = 'InvalidArgument',\n code: number = 2001,\n message: string = 'Invalid argument',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, InvalidArgumentError.prototype)\n }\n}\n\nexport class NotFoundError extends WebrpcError {\n constructor(\n name: string = 'NotFound',\n code: number = 3000,\n message: string = 'Resource not found',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, NotFoundError.prototype)\n }\n}\n\nexport class UserNotFoundError extends WebrpcError {\n constructor(\n name: string = 'UserNotFound',\n code: number = 3001,\n message: string = 'User not found',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, UserNotFoundError.prototype)\n }\n}\n\nexport class ProjectNotFoundError extends WebrpcError {\n constructor(\n name: string = 'ProjectNotFound',\n code: number = 3002,\n message: string = 'Project not found',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, ProjectNotFoundError.prototype)\n }\n}\n\nexport class InvalidTierError extends WebrpcError {\n constructor(\n name: string = 'InvalidTier',\n code: number = 3003,\n message: string = 'Invalid subscription tier',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, InvalidTierError.prototype)\n }\n}\n\nexport class ProjectLimitReachedError extends WebrpcError {\n constructor(\n name: string = 'ProjectLimitReached',\n code: number = 3005,\n message: string = 'Project limit reached',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, ProjectLimitReachedError.prototype)\n }\n}\n\nexport class NotImplementedError extends WebrpcError {\n constructor(\n name: string = 'NotImplemented',\n code: number = 9999,\n message: string = 'Not Implemented',\n status: number = 0,\n cause?: string\n ) {\n super(name, code, message, status, cause)\n Object.setPrototypeOf(this, NotImplementedError.prototype)\n }\n}\n\n\nexport enum errors {\n WebrpcEndpoint = 'WebrpcEndpoint',\n WebrpcRequestFailed = 'WebrpcRequestFailed',\n WebrpcBadRoute = 'WebrpcBadRoute',\n WebrpcBadMethod = 'WebrpcBadMethod',\n WebrpcBadRequest = 'WebrpcBadRequest',\n WebrpcBadResponse = 'WebrpcBadResponse',\n WebrpcServerPanic = 'WebrpcServerPanic',\n WebrpcInternalError = 'WebrpcInternalError',\n WebrpcClientDisconnected = 'WebrpcClientDisconnected',\n WebrpcStreamLost = 'WebrpcStreamLost',\n WebrpcStreamFinished = 'WebrpcStreamFinished',\n Unauthorized = 'Unauthorized',\n PermissionDenied = 'PermissionDenied',\n SessionExpired = 'SessionExpired',\n MethodNotFound = 'MethodNotFound',\n Timeout = 'Timeout',\n InvalidArgument = 'InvalidArgument',\n NotFound = 'NotFound',\n UserNotFound = 'UserNotFound',\n ProjectNotFound = 'ProjectNotFound',\n InvalidTier = 'InvalidTier',\n ProjectLimitReached = 'ProjectLimitReached',\n NotImplemented = 'NotImplemented',\n}\n\nexport enum WebrpcErrorCodes {\n WebrpcEndpoint = 0,\n WebrpcRequestFailed = -1,\n WebrpcBadRoute = -2,\n WebrpcBadMethod = -3,\n WebrpcBadRequest = -4,\n WebrpcBadResponse = -5,\n WebrpcServerPanic = -6,\n WebrpcInternalError = -7,\n WebrpcClientDisconnected = -8,\n WebrpcStreamLost = -9,\n WebrpcStreamFinished = -10,\n Unauthorized = 1000,\n PermissionDenied = 1001,\n SessionExpired = 1002,\n MethodNotFound = 1003,\n Timeout = 2000,\n InvalidArgument = 2001,\n NotFound = 3000,\n UserNotFound = 3001,\n ProjectNotFound = 3002,\n InvalidTier = 3003,\n ProjectLimitReached = 3005,\n NotImplemented = 9999,\n}\n\nexport const webrpcErrorByCode: { [code: number]: any } = {\n [0]: WebrpcEndpointError,\n [-1]: WebrpcRequestFailedError,\n [-2]: WebrpcBadRouteError,\n [-3]: WebrpcBadMethodError,\n [-4]: WebrpcBadRequestError,\n [-5]: WebrpcBadResponseError,\n [-6]: WebrpcServerPanicError,\n [-7]: WebrpcInternalErrorError,\n [-8]: WebrpcClientDisconnectedError,\n [-9]: WebrpcStreamLostError,\n [-10]: WebrpcStreamFinishedError,\n [1000]: UnauthorizedError,\n [1001]: PermissionDeniedError,\n [1002]: SessionExpiredError,\n [1003]: MethodNotFoundError,\n [2000]: TimeoutError,\n [2001]: InvalidArgumentError,\n [3000]: NotFoundError,\n [3001]: UserNotFoundError,\n [3002]: ProjectNotFoundError,\n [3003]: InvalidTierError,\n [3005]: ProjectLimitReachedError,\n [9999]: NotImplementedError,\n}\n\nexport type Fetch = (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n","// biome-ignore lint/complexity/noStaticOnlyClass:\nclass CollectableKeys {\n\tstatic all = ['collectable'] as const;\n\tstatic details = [...CollectableKeys.all, 'details'] as const;\n\tstatic lists = [...CollectableKeys.all, 'list'] as const;\n\tstatic floorOrders = [...CollectableKeys.all, 'floorOrders'] as const;\n\tstatic userBalances = [\n\t\t...CollectableKeys.all,\n\t\t...CollectableKeys.details,\n\t\t'userBalances',\n\t] as const;\n\tstatic royaltyPercentage = [\n\t\t...CollectableKeys.all,\n\t\t'royaltyPercentage',\n\t] as const;\n\tstatic highestOffers = [\n\t\t...CollectableKeys.all,\n\t\t...CollectableKeys.details,\n\t\t'highestOffers',\n\t] as const;\n\tstatic lowestListings = [\n\t\t...CollectableKeys.all,\n\t\t...CollectableKeys.details,\n\t\t'lowestListings',\n\t] as const;\n\tstatic offers = [...CollectableKeys.all, 'offers'] as const;\n\tstatic offersCount = [...CollectableKeys.all, 'offersCount'] as const;\n\tstatic listings = [...CollectableKeys.all, 'listings'] as const;\n\tstatic listingsCount = [...CollectableKeys.all, 'listingsCount'] as const;\n\tstatic filter = [...CollectableKeys.all, 'filter'] as const;\n\tstatic counts = [...CollectableKeys.all, 'counts'] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass:\nclass CollectionKeys {\n\tstatic all = ['collections'] as const;\n\tstatic list = [...CollectionKeys.all, 'list'] as const;\n\tstatic detail = [...CollectionKeys.all, 'detail'] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass:\nclass BalanceQueries {\n\tstatic all = ['balances'] as const;\n\tstatic lists = [...BalanceQueries.all, 'tokenBalances'] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass:\nclass CheckoutKeys {\n\tstatic all = ['checkouts'] as const;\n\tstatic options = [...CheckoutKeys.all, 'options'] as const;\n\tstatic cartItems = [...CheckoutKeys.all, 'cartItems'] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass:\nclass CurrencyKeys {\n\tstatic all = ['currencies'] as const;\n\tstatic lists = [...CurrencyKeys.all, 'list'] as const;\n\tstatic details = [...CurrencyKeys.all, 'details'] as const;\n}\n\n// biome-ignore lint/complexity/noStaticOnlyClass:\nclass ConfigKeys {\n\tstatic all = ['configs'] as const;\n\tstatic marketplace = [...ConfigKeys.all, 'marketplace'] as const;\n}\nexport const collectableKeys = CollectableKeys;\nexport const collectionKeys = CollectionKeys;\nexport const balanceQueries = BalanceQueries;\nexport const checkoutKeys = CheckoutKeys;\nexport const currencyKeys = CurrencyKeys;\nexport const configKeys = ConfigKeys;\n","import { SequenceIndexer } from '@0xsequence/indexer';\nimport { SequenceMetadata } from '@0xsequence/metadata';\nimport { networks, stringTemplate } from '@0xsequence/network';\nimport type { Env, SdkConfig } from '../../../types/sdk-config';\nimport { MissingConfigError } from '../../../utils/_internal/error/transaction';\nimport { SequenceMarketplace } from './marketplace-api';\n\nconst SERVICES = {\n\tsequenceApi: 'https://api.sequence.app',\n\tmetadata: 'https://${prefix}metadata.sequence.app',\n\tindexer: 'https://${prefix}${network}-indexer.sequence.app',\n\tmarketplaceApi: 'https://${prefix}marketplace-api.sequence.app/${network}',\n\timageProxy: 'https://imgproxy.sequence.xyz/',\n\tbuilderMarketplaceApi:\n\t\t'https://${prefix}api.sequence.build/marketplace/${projectId}',\n};\n\ntype ChainNameOrId = string | number;\n\nconst getNetwork = (nameOrId: ChainNameOrId) => {\n\tfor (const network of Object.values(networks)) {\n\t\tif (\n\t\t\tnetwork.name === String(nameOrId).toLowerCase() ||\n\t\t\tnetwork.chainId === Number(nameOrId)\n\t\t) {\n\t\t\treturn network;\n\t\t}\n\t}\n\tthrow new MissingConfigError(`Network configuration for chain ${nameOrId}`);\n};\n\nexport const imageProxy = stringTemplate(SERVICES.imageProxy, {});\nconst metadataURL = (env: Env = 'production') => {\n\tconst prefix = getPrefix(env);\n\treturn stringTemplate(SERVICES.metadata, { prefix });\n};\nconst indexerURL = (chain: ChainNameOrId, env: Env = 'production') => {\n\tconst prefix = getPrefix(env);\n\tconst network = getNetwork(chain).name;\n\treturn stringTemplate(SERVICES.indexer, { network: network, prefix });\n};\nconst marketplaceApiURL = (chain: ChainNameOrId, env: Env = 'production') => {\n\tconst prefix = getPrefix(env);\n\tconst network = getNetwork(chain).name;\n\treturn stringTemplate(SERVICES.marketplaceApi, { network: network, prefix });\n};\nexport const builderMarketplaceApi = (\n\tprojectId: string,\n\tenv: Env = 'production',\n) => {\n\tconst prefix = getPrefix(env);\n\treturn stringTemplate(SERVICES.builderMarketplaceApi, {\n\t\tprojectId,\n\t\tprefix,\n\t});\n};\nexport const getMetadataClient = (config: SdkConfig) => {\n\tconst env = config._internal?.metadataEnv || 'production';\n\tconst projectAccessKey = getAccessKey({ env, config });\n\treturn new SequenceMetadata(metadataURL(env), projectAccessKey);\n};\nexport const getIndexerClient = (chain: ChainNameOrId, config: SdkConfig) => {\n\tconst env = config._internal?.indexerEnv || 'production';\n\tconst projectAccessKey = getAccessKey({ env, config });\n\treturn new SequenceIndexer(indexerURL(chain, env), projectAccessKey);\n};\nexport const getMarketplaceClient = (\n\tchain: ChainNameOrId,\n\tconfig: SdkConfig,\n) => {\n\tconst env = config._internal?.marketplaceEnv || 'production';\n\tconst projectAccessKey = getAccessKey({ env, config });\n\treturn new SequenceMarketplace(\n\t\tmarketplaceApiURL(chain, env),\n\t\tprojectAccessKey,\n\t);\n};\nconst getAccessKey = ({ env, config }: { env: Env; config: SdkConfig }) => {\n\tswitch (env) {\n\t\tcase 'development':\n\t\t\tif (!config._internal?.devAccessKey)\n\t\t\t\tthrow new MissingConfigError('devAccessKey for development env');\n\t\t\treturn config._internal?.devAccessKey;\n\t\tcase 'production':\n\t\t\treturn config.projectAccessKey;\n\t\tcase 'next':\n\t\t\tif (!config._internal?.nextAccessKey)\n\t\t\t\tthrow new MissingConfigError('nextAccessKey for next env');\n\t\t\treturn config._internal?.nextAccessKey;\n\t}\n};\n\nconst getPrefix = (env: Env) => {\n\tswitch (env) {\n\t\tcase 'development':\n\t\t\treturn 'dev-';\n\t\tcase 'production':\n\t\t\treturn '';\n\t\tcase 'next':\n\t\t\treturn 'next-';\n\t}\n};\n","import { getDefaultChains } from '@0xsequence/kit';\nimport { allNetworks, findNetworkConfig } from '@0xsequence/network';\nimport type { Chain, Transport } from 'viem';\nimport { http, cookieStorage, createConfig, createStorage } from 'wagmi';\nimport type { MarketplaceConfig, SdkConfig } from '../../../types';\nimport { getWaasConnectors } from './embedded';\nimport { getUniversalConnectors } from './universal';\n\nexport const createWagmiConfig = (\n\tmarketplaceConfig: MarketplaceConfig,\n\tsdkConfig: SdkConfig,\n\tssr?: boolean,\n) => {\n\tconst chains = getChainConfigs(marketplaceConfig);\n\tconst transports = getTransportConfigs(chains, sdkConfig.projectAccessKey);\n\n\tconst walletType = sdkConfig.wallet?.embedded?.waasConfigKey\n\t\t? 'waas'\n\t\t: 'universal';\n\n\tconst connectors =\n\t\twalletType === 'universal'\n\t\t\t? getUniversalConnectors(marketplaceConfig, sdkConfig)\n\t\t\t: getWaasConnectors(marketplaceConfig, sdkConfig);\n\n\t// The old config did not support disabling EIP-6963 wallets\n\tconst includeEIP6963Wallets =\n\t\tmarketplaceConfig.walletOptionsNew?.includeEIP6963Wallets ?? true;\n\n\treturn createConfig({\n\t\tconnectors,\n\t\tchains,\n\t\tssr,\n\t\tmultiInjectedProviderDiscovery: includeEIP6963Wallets,\n\t\tstorage: ssr\n\t\t\t? createStorage({\n\t\t\t\t\tstorage: cookieStorage,\n\t\t\t\t})\n\t\t\t: undefined,\n\t\ttransports,\n\t});\n};\n\nfunction getChainConfigs(marketConfig: MarketplaceConfig): [Chain, ...Chain[]] {\n\tconst supportedChainIds = new Set(\n\t\tmarketConfig.collections.map((c) => c.chainId),\n\t);\n\treturn getDefaultChains([...supportedChainIds]);\n}\n\nfunction getTransportConfigs(\n\tchains: [Chain, ...Chain[]],\n\tprojectAccessKey: string,\n): Record<number, Transport> {\n\treturn chains.reduce(\n\t\t(acc, chain) => {\n\t\t\tconst network = findNetworkConfig(allNetworks, chain.id);\n\t\t\tif (network) {\n\t\t\t\tlet rpcUrl = network.rpcUrl;\n\t\t\t\tif (!network.rpcUrl.endsWith(projectAccessKey))\n\t\t\t\t\trpcUrl = `${rpcUrl}/${projectAccessKey}`;\n\t\t\t\tacc[chain.id] = http(rpcUrl);\n\t\t\t}\n\t\t\treturn acc;\n\t\t},\n\t\t{} as Record<number, Transport>,\n\t);\n}\n","import {\n\ttype Wallet,\n\tappleWaas,\n\tcoinbaseWallet,\n\temailWaas,\n\tgetKitConnectWallets,\n\tgoogleWaas,\n\twalletConnect,\n} from '@0xsequence/kit';\nimport type { CreateConnectorFn } from 'wagmi';\nimport type { MarketplaceConfig, SdkConfig } from '../../../types';\nimport { MissingConfigError } from '../../../utils/_internal/error/transaction';\nimport { DEFAULT_NETWORK } from '../consts';\n\nexport function getWaasConnectors(\n\tmarketplaceConfig: MarketplaceConfig,\n\tsdkConfig: SdkConfig,\n): CreateConnectorFn[] {\n\tconst { projectAccessKey } = sdkConfig;\n\n\tconst waasConfigKey = sdkConfig.wallet?.embedded?.waasConfigKey;\n\n\tif (!waasConfigKey) throw new MissingConfigError('waasConfigKey');\n\n\tconst walletConnectProjectId = sdkConfig.wallet?.walletConnectProjectId;\n\tconst { googleClientId, appleClientId, appleRedirectURI } =\n\t\tsdkConfig.wallet?.embedded || {};\n\n\tconst { title: appName } = marketplaceConfig;\n\n\t// Normalizing the wallet options, TODO: remove this after the marketplaceConfig is updated\n\tconst walletOptions = marketplaceConfig.walletOptionsNew || {\n\t\tconnectors: ['coinbase', 'walletconnect'],\n\t};\n\n\tconst wallets: Wallet[] = [\n\t\temailWaas({\n\t\t\tprojectAccessKey,\n\t\t\twaasConfigKey,\n\t\t\tnetwork: DEFAULT_NETWORK,\n\t\t}),\n\t];\n\n\tif (walletOptions.connectors.includes('coinbase')) {\n\t\twallets.push(\n\t\t\tcoinbaseWallet({\n\t\t\t\tappName,\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (\n\t\twalletConnectProjectId &&\n\t\twalletOptions.connectors.includes('walletconnect')\n\t) {\n\t\twallets.push(\n\t\t\twalletConnect({\n\t\t\t\tprojectId: walletConnectProjectId,\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (googleClientId) {\n\t\twallets.push(\n\t\t\tgoogleWaas({\n\t\t\t\tprojectAccessKey,\n\t\t\t\tgoogleClientId,\n\t\t\t\twaasConfigKey,\n\t\t\t\tnetwork: DEFAULT_NETWORK,\n\t\t\t}),\n\t\t);\n\t}\n\n\tif (appleClientId) {\n\t\twallets.push(\n\t\t\tappleWaas({\n\t\t\t\tprojectAccessKey,\n\t\t\t\tappleClientId,\n\t\t\t\tappleRedirectURI,\n\t\t\t\twaasConfigKey,\n\t\t\t\tnetwork: DEFAULT_NETWORK,\n\t\t\t}),\n\t\t);\n\t}\n\n\treturn getKitConnectWallets(projectAccessKey, wallets);\n}\n","import {\n\ttype SequenceOptions,\n\ttype Wallet,\n\tapple,\n\tcoinbaseWallet,\n\temail,\n\tfacebook,\n\tgetKitConnectWallets,\n\tgoogle,\n\tsequence,\n\ttwitch,\n\twalletConnect,\n} from '@0xsequence/kit';\nimport type { CreateConnectorFn } from 'wagmi';\nimport type { MarketplaceConfig, SdkConfig } from '../../../types';\nimport { DEFAULT_NETWORK } from '../consts';\n\nconst defaultNetwork = DEFAULT_NETWORK;\n\nexport function getUniversalConnectors(\n\tmarketplaceConfig: MarketplaceConfig,\n\tconfig: SdkConfig,\n): CreateConnectorFn[] {\n\tconst { projectAccessKey } = config;\n\tconst sequenceWalletOptions = {\n\t\tdefaultNetwork,\n\t\tconnect: {\n\t\t\tprojectAccessKey,\n\t\t\tapp: marketplaceConfig.title,\n\t\t\tsettings: {\n\t\t\t\tbannerUrl: marketplaceConfig.ogImage,\n\t\t\t},\n\t\t},\n\t};\n\tconst wallets = getWalletConfigs(\n\t\tmarketplaceConfig,\n\t\tsequenceWalletOptions,\n\t\tconfig.wallet?.walletConnectProjectId,\n\t);\n\tconst socialWallets = getSocialWalletConfigs(sequenceWalletOptions);\n\treturn getKitConnectWallets(projectAccessKey, [...socialWallets, ...wallets]);\n}\n\nfunction getWalletConfigs(\n\tmarketplaceConfig: MarketplaceConfig,\n\tsequenceWalletOptions: SequenceOptions,\n\twalletConnectProjectId?: string,\n): Wallet[] {\n\tconst wallets: Wallet[] = [];\n\n\t// Normalizing the wallet options, TODO: remove this after the marketplaceConfig is updated\n\tconst walletOptions = marketplaceConfig.walletOptionsNew || {\n\t\tconnectors: ['coinbase', 'walletconnect'],\n\t};\n\n\twallets.push(sequence(sequenceWalletOptions));\n\n\tif (walletOptions.connectors.includes('coinbase')) {\n\t\twallets.push(coinbaseWallet({ appName: marketplaceConfig.title }));\n\t}\n\n\tif (\n\t\twalletConnectProjectId &&\n\t\twalletOptions.connectors.includes('walletconnect')\n\t) {\n\t\twallets.push(walletConnect({ projectId: walletConnectProjectId }));\n\t}\n\n\treturn wallets;\n}\n\nfunction getSocialWalletConfigs(\n\tsequenceWalletOptions: SequenceOptions,\n): Wallet[] {\n\treturn [\n\t\temail(sequenceWalletOptions),\n\t\tfacebook(sequenceWalletOptions),\n\t\tgoogle(sequenceWalletOptions),\n\t\tapple(sequenceWalletOptions),\n\t\ttwitch(sequenceWalletOptions),\n\t] as const;\n}\n"],"mappings":";AAAA,SAAS,WAAW,sBAAsB;AAE1C,SAAS,SAAS;AAMX,IAAM,iBAAiB,EAC5B,OAAO;AAAA,EACP,SAAS,EAAE,QAAQ,EAAE,SAAS;AAC/B,CAAC,EACA,SAAS;AAIJ,IAAM,sBAAsB,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC;AAEpD,IAAM,gBAAgB,EAAE,MAAM;AAAA,EACpC,EAAE,OA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W,KAAK,aAAa;AACvD;;;AChEA,SAAS,uBAAuB;AAChC,SAAS,wBAAwB;AACjC,SAAS,UAAU,sBAAsB;AAKzC,IAAM,WAAW;AAAA,EAChB,aAAa;AAAA,EACb,UAAU;AAAA,EACV,SAAS;AAAA,EACT,gBAAgB;AAAA,EAChB,YAAY;AAAA,EACZ,uBACC;AACF;AAgBO,IAAM,aAAa,eAAe,SAAS,YAAY,CAAC,CAAC;;;AC/BhE,SAAS,wBAAwB;AACjC,SAAS,aAAa,yBAAyB;AAE/C,SAAS,MAAM,eAAe,cAAc,qBAAqB;;;ACHjE;AAAA,EAEC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;;;ACRP;AAAA,EAGC;AAAA,EACA,kBAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA,wBAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,iBAAAC;AAAA,OACM;","names":["SortOrder","PropertyType","MarketplaceKind","OrderbookKind","SourceKind","OrderSide","OrderStatus","ContractType","CollectionStatus","ProjectStatus","CollectibleStatus","WalletKind","StepType","TransactionCrypto","ExecuteType","coinbaseWallet","getKitConnectWallets","walletConnect"]}
|
|
@@ -29,6 +29,15 @@ var AddressSchema = z.string().transform((val, ctx) => {
|
|
|
29
29
|
}
|
|
30
30
|
return val;
|
|
31
31
|
});
|
|
32
|
+
var TransactionType = /* @__PURE__ */ ((TransactionType2) => {
|
|
33
|
+
TransactionType2["BUY"] = "BUY";
|
|
34
|
+
TransactionType2["SELL"] = "SELL";
|
|
35
|
+
TransactionType2["LISTING"] = "LISTING";
|
|
36
|
+
TransactionType2["OFFER"] = "OFFER";
|
|
37
|
+
TransactionType2["TRANSFER"] = "TRANSFER";
|
|
38
|
+
TransactionType2["CANCEL"] = "CANCEL";
|
|
39
|
+
return TransactionType2;
|
|
40
|
+
})(TransactionType || {});
|
|
32
41
|
|
|
33
42
|
export {
|
|
34
43
|
PROVIDER_ID,
|
|
@@ -36,6 +45,7 @@ export {
|
|
|
36
45
|
QueryArgSchema,
|
|
37
46
|
CollectableIdSchema,
|
|
38
47
|
ChainIdSchema,
|
|
39
|
-
AddressSchema
|
|
48
|
+
AddressSchema,
|
|
49
|
+
TransactionType
|
|
40
50
|
};
|
|
41
|
-
//# sourceMappingURL=chunk-
|
|
51
|
+
//# sourceMappingURL=chunk-DNVERQ5J.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react/_internal/get-provider.ts","../src/react/_internal/types.ts"],"sourcesContent":["export const PROVIDER_ID = 'sdk-provider';\n\nexport function getProviderEl() {\n\tif (!globalThis.document) return null;\n\treturn document.getElementById(PROVIDER_ID);\n}\n","import { ChainId as NetworkChainId } from '@0xsequence/network';\nimport type { Address } from 'viem';\nimport { z } from 'zod';\nimport type { ContractType, CreateReq } from '../../types';\nimport { Chain } from 'viem';\nimport { MarketplaceKind, OrderbookKind } from './api';\nimport { SdkConfig, MarketplaceConfig } from '../../types';\n\nexport const QueryArgSchema = z\n\t.object({\n\t\tenabled: z.boolean().optional(),\n\t})\n\t.optional();\n\nexport type QueryArg = z.infer<typeof QueryArgSchema>;\n\nexport const CollectableIdSchema = z.string().or(z.number());\n\nexport const ChainIdSchema = z.union([\n\tz.string(),\n\tz.number(),\n\tz.nativeEnum(NetworkChainId),\n]);\n\nexport const AddressSchema = z.string().transform((val, ctx) => {\n\tconst regex = /^0x[a-fA-F0-9]{40}$/;\n\n\tif (!regex.test(val)) {\n\t\tctx.addIssue({\n\t\t\tcode: z.ZodIssueCode.custom,\n\t\t\tmessage: `Invalid Address ${val}`,\n\t\t});\n\t}\n\n\treturn val as Address;\n});\n\nexport type ChainId = z.infer<typeof ChainIdSchema>;\n\nexport type CollectionType = ContractType.ERC1155 | ContractType.ERC721;\n\ntype TransactionStep = {\n\texist: boolean;\n\tisExecuting: boolean;\n\texecute: () => Promise<void>;\n};\n\nexport type TransactionSteps = {\n\tapproval: TransactionStep;\n\ttransaction: TransactionStep;\n};\n\nexport enum TransactionType {\n\tBUY = 'BUY',\n\tSELL = 'SELL',\n\tLISTING = 'LISTING',\n\tOFFER = 'OFFER',\n\tTRANSFER = 'TRANSFER',\n\tCANCEL = 'CANCEL',\n}\n\nexport interface TransactionConfig {\n\ttype: TransactionType;\n\tchainId: string;\n\tchains: readonly Chain[];\n\tcollectionAddress: string;\n\tsdkConfig: SdkConfig;\n\tmarketplaceConfig: MarketplaceConfig;\n\torderbookKind?: OrderbookKind;\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"],"mappings":";;;AAAO,IAAM,cAAc;AAEpB,SAAS,gBAAgB;AAC/B,MAAI,CAAC,WAAW,SAAU,QAAO;AACjC,SAAO,SAAS,eAAe,WAAW;AAC3C;;;ACLA,SAAS,WAAW,sBAAsB;AAE1C,SAAS,SAAS;AAMX,IAAM,iBAAiB,EAC5B,OAAO;AAAA,EACP,SAAS,EAAE,QAAQ,EAAE,SAAS;AAC/B,CAAC,EACA,SAAS;AAIJ,IAAM,sBAAsB,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC;AAEpD,IAAM,gBAAgB,EAAE,MAAM;AAAA,EACpC,EAAE,OAAO;AAAA,EACT,EAAE,OAAO;AAAA,EACT,EAAE,WAAW,cAAc;AAC5B,CAAC;AAEM,IAAM,gBAAgB,EAAE,OAAO,EAAE,UAAU,CAAC,KAAK,QAAQ;AAC/D,QAAM,QAAQ;AAEd,MAAI,CAAC,MAAM,KAAK,GAAG,GAAG;AACrB,QAAI,SAAS;AAAA,MACZ,MAAM,EAAE,aAAa;AAAA,MACrB,SAAS,mBAAmB,GAAG;AAAA,IAChC,CAAC;AAAA,EACF;AAEA,SAAO;AACR,CAAC;AAiBM,IAAK,kBAAL,kBAAKA,qBAAL;AACN,EAAAA,iBAAA,SAAM;AACN,EAAAA,iBAAA,UAAO;AACP,EAAAA,iBAAA,aAAU;AACV,EAAAA,iBAAA,WAAQ;AACR,EAAAA,iBAAA,cAAW;AACX,EAAAA,iBAAA,YAAS;AANE,SAAAA;AAAA,GAAA;","names":["TransactionType"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
MissingConfigError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WM4RGBFQ.js";
|
|
5
5
|
|
|
6
6
|
// src/utils/address.ts
|
|
7
7
|
var truncateMiddle = (address, minPrefix = 20, minSuffix = 3) => {
|
|
@@ -83,4 +83,4 @@ export {
|
|
|
83
83
|
getPresentableChainName,
|
|
84
84
|
calculatePriceDifferencePercentage
|
|
85
85
|
};
|
|
86
|
-
//# sourceMappingURL=chunk-
|
|
86
|
+
//# sourceMappingURL=chunk-LTHX6RXH.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
MissingConfigError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WM4RGBFQ.js";
|
|
5
5
|
|
|
6
6
|
// src/react/_internal/api/get-query-client.ts
|
|
7
7
|
import {
|
|
@@ -1350,4 +1350,4 @@ export {
|
|
|
1350
1350
|
getIndexerClient,
|
|
1351
1351
|
getMarketplaceClient
|
|
1352
1352
|
};
|
|
1353
|
-
//# sourceMappingURL=chunk-
|
|
1353
|
+
//# sourceMappingURL=chunk-QVOUL555.js.map
|
|
@@ -8,13 +8,13 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
useSwitchChainModal,
|
|
10
10
|
useWallet
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-3C2MT5TM.js";
|
|
12
12
|
import {
|
|
13
13
|
getPublicRpcClient
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LTHX6RXH.js";
|
|
15
15
|
import {
|
|
16
16
|
getProviderEl
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-DNVERQ5J.js";
|
|
18
18
|
|
|
19
19
|
// src/react/ui/modals/_internal/components/actionModal/ActionModal.tsx
|
|
20
20
|
import { useState } from "react";
|
|
@@ -457,4 +457,4 @@ export {
|
|
|
457
457
|
openModal,
|
|
458
458
|
closeModal
|
|
459
459
|
};
|
|
460
|
-
//# sourceMappingURL=chunk-
|
|
460
|
+
//# sourceMappingURL=chunk-RD7HPANB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react/ui/modals/_internal/components/actionModal/ActionModal.tsx","../src/react/ui/modals/_internal/components/waasFeeOptionsBox/index.tsx","../src/react/hooks/useCurrencyBalance.tsx","../src/react/ui/modals/_internal/components/waasFeeOptionsSelect/WaasFeeOptionsSelect.tsx","../src/react/ui/components/_internals/custom-select/CustomSelect.tsx","../src/react/ui/components/_internals/custom-select/styles.css.ts","../src/react/ui/modals/_internal/components/waasFeeOptionsBox/store.ts","../src/react/ui/modals/_internal/components/waasFeeOptionsBox/styles.css.ts","../src/react/ui/modals/_internal/components/actionModal/store.ts"],"sourcesContent":["'use client';\n\nimport type React from 'react';\nimport { useState, type ComponentProps } from 'react';\n\nimport {\n\tBox,\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 { getProviderEl } from '../../../../../_internal';\nimport {\n\tcloseButton,\n\tcta as ctaStyle,\n\tdialogContent,\n\tdialogOverlay,\n} from './styles.css';\nimport WaasFeeOptionsBox from '../waasFeeOptionsBox';\nimport { useSwitchChainModal } from '../switchChainModal';\nimport { useWallet } from '../../../../../_internal/wallet/useWallet';\n\nexport interface ActionModalProps {\n\tisOpen: boolean;\n\tonClose: () => void;\n\ttitle: string;\n\tchildren: React.ReactNode;\n\tctas: {\n\t\tlabel: string;\n\t\tonClick: (() => Promise<void>) | (() => void);\n\t\tpending?: boolean;\n\t\tdisabled?: boolean;\n\t\thidden?: boolean;\n\t\tvariant?: ComponentProps<typeof Button>['variant'];\n\t}[];\n\tchainId: number;\n}\n\nexport const ActionModal = observer(\n\t({ isOpen, onClose, title, children, ctas, chainId }: ActionModalProps) => {\n\t\tconst [isSelectingFees, setIsSelectingFees] = useState(false);\n\t\tconst { show: showSwitchChainModal } = useSwitchChainModal();\n\t\tconst { wallet } = useWallet();\n\n\t\tconst checkChain = async ({ onSuccess }: { onSuccess: () => void }) => {\n\t\t\tconst walletChainId = await wallet?.getChainId();\n\t\t\tconst chainMismatch = walletChainId !== Number(chainId);\n\t\t\tif (chainMismatch) {\n\t\t\t\tshowSwitchChainModal({\n\t\t\t\t\tchainIdToSwitchTo: Number(chainId),\n\t\t\t\t\tonSuccess,\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tonSuccess();\n\t\t\t}\n\t\t};\n\n\t\tif (wallet?.isWaaS) {\n\t\t\twallet.switchChain(Number(chainId));\n\t\t}\n\n\t\treturn (\n\t\t\t<Root open={isOpen && !!chainId}>\n\t\t\t\t<Portal container={getProviderEl()}>\n\t\t\t\t\t<Overlay className={dialogOverlay} />\n\t\t\t\t\t<Content className={dialogContent.narrow}>\n\t\t\t\t\t\t<Box\n\t\t\t\t\t\t\tdisplay=\"flex\"\n\t\t\t\t\t\t\tflexGrow={'1'}\n\t\t\t\t\t\t\talignItems=\"center\"\n\t\t\t\t\t\t\tflexDirection=\"column\"\n\t\t\t\t\t\t\tgap=\"4\"\n\t\t\t\t\t\t\tposition={'relative'}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tfontSize=\"medium\"\n\t\t\t\t\t\t\t\tfontWeight=\"bold\"\n\t\t\t\t\t\t\t\ttextAlign=\"center\"\n\t\t\t\t\t\t\t\twidth=\"full\"\n\t\t\t\t\t\t\t\tcolor=\"text100\"\n\t\t\t\t\t\t\t\tfontFamily=\"body\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t\t</Text>\n\n\t\t\t\t\t\t\t{children}\n\n\t\t\t\t\t\t\t<Box width=\"full\" display=\"flex\" flexDirection=\"column\" gap=\"2\">\n\t\t\t\t\t\t\t\t{ctas.map(\n\t\t\t\t\t\t\t\t\t(cta) =>\n\t\t\t\t\t\t\t\t\t\t!cta.hidden && (\n\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\tkey={cta.label}\n\t\t\t\t\t\t\t\t\t\t\t\tclassName={ctaStyle}\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={async () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tawait checkChain({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcta.onClick();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\tvariant={cta.variant || 'primary'}\n\t\t\t\t\t\t\t\t\t\t\t\tpending={cta.pending}\n\t\t\t\t\t\t\t\t\t\t\t\tdisabled={cta.disabled || isSelectingFees}\n\t\t\t\t\t\t\t\t\t\t\t\tsize=\"lg\"\n\t\t\t\t\t\t\t\t\t\t\t\twidth=\"full\"\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Box\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisplay=\"flex\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\talignItems=\"center\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tgap=\"2\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tjustifyContent=\"center\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{cta.pending && <Spinner size=\"sm\" />}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{cta.label}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</Box>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Box>\n\t\t\t\t\t\t</Box>\n\n\t\t\t\t\t\t<WaasFeeOptionsBox\n\t\t\t\t\t\t\tchainId={chainId}\n\t\t\t\t\t\t\tonFeeOptionsLoaded={() => setIsSelectingFees(true)}\n\t\t\t\t\t\t\tonFeeOptionConfirmed={() => setIsSelectingFees(false)}\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t<Close className={closeButton} asChild onClick={onClose}>\n\t\t\t\t\t\t\t<IconButton size=\"xs\" aria-label=\"Close modal\" icon={CloseIcon} />\n\t\t\t\t\t\t</Close>\n\t\t\t\t\t</Content>\n\t\t\t\t</Portal>\n\t\t\t</Root>\n\t\t);\n\t},\n);\n","import {\n\tBox,\n\tButton,\n\tSkeleton,\n\tText,\n\tWarningIcon,\n} from '@0xsequence/design-system';\nimport { useWaasFeeOptions } from '@0xsequence/kit';\nimport { observer } from '@legendapp/state/react';\nimport { useEffect } from 'react';\nimport { type Hex, zeroAddress } from 'viem';\nimport { useAccount } from 'wagmi';\nimport { useCurrencyBalance } from '../../../../../hooks/useCurrencyBalance';\nimport WaasFeeOptionsSelect, {\n\ttype FeeOption,\n} from '../waasFeeOptionsSelect/WaasFeeOptionsSelect';\nimport { waasFeeOptionsModal$ } from './store';\nimport { feeOptionsWrapper } from './styles.css';\n\ntype WaasFeeOptionsBoxProps = {\n\tonFeeOptionsLoaded: () => void;\n\tonFeeOptionConfirmed: () => void;\n\tchainId: number;\n};\n\nconst WaasFeeOptionsBox = observer(\n\t({\n\t\tonFeeOptionsLoaded,\n\t\tonFeeOptionConfirmed,\n\t\tchainId,\n\t}: WaasFeeOptionsBoxProps) => {\n\t\tconst { address: userAddress } = useAccount();\n\t\tconst selectedFeeOption$ = waasFeeOptionsModal$.selectedFeeOption;\n\t\tconst [pendingFeeOptionConfirmation, confirmPendingFeeOption] =\n\t\t\tuseWaasFeeOptions();\n\t\tconst { data: currencyBalance, isLoading: currencyBalanceLoading } =\n\t\t\tuseCurrencyBalance({\n\t\t\t\tchainId,\n\t\t\t\tcurrencyAddress: (selectedFeeOption$.token.contractAddress.get() ||\n\t\t\t\t\tzeroAddress) as Hex,\n\t\t\t\tuserAddress: userAddress as Hex,\n\t\t\t});\n\n\t\t// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>\n\t\tuseEffect(() => {\n\t\t\tif (pendingFeeOptionConfirmation) {\n\t\t\t\tonFeeOptionsLoaded();\n\t\t\t}\n\t\t}, [pendingFeeOptionConfirmation]);\n\n\t\tconst selectedFeeOption = selectedFeeOption$.get();\n\t\tconst insufficientBalance = (() => {\n\t\t\tif (!selectedFeeOption?.value || !selectedFeeOption.token.decimals) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (!currencyBalance?.value && currencyBalance?.value !== 0n) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\tconst feeValue = BigInt(selectedFeeOption.value);\n\t\t\t\treturn currencyBalance.value === 0n || currencyBalance.value < feeValue;\n\t\t\t} catch {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t})();\n\n\t\tconst handleConfirmFeeOption = () => {\n\t\t\tif (!selectedFeeOption?.token || !pendingFeeOptionConfirmation?.id)\n\t\t\t\treturn;\n\n\t\t\tconfirmPendingFeeOption(\n\t\t\t\tpendingFeeOptionConfirmation?.id,\n\t\t\t\tselectedFeeOption.token.contractAddress || zeroAddress,\n\t\t\t);\n\n\t\t\tonFeeOptionConfirmed();\n\t\t};\n\n\t\tif (!pendingFeeOptionConfirmation) return null;\n\n\t\treturn (\n\t\t\t<Box className={feeOptionsWrapper}>\n\t\t\t\t<Text\n\t\t\t\t\tfontSize=\"medium\"\n\t\t\t\t\tfontFamily=\"body\"\n\t\t\t\t\tfontWeight=\"bold\"\n\t\t\t\t\tmarginBottom=\"2\"\n\t\t\t\t>\n\t\t\t\t\tSelect a fee option\n\t\t\t\t</Text>\n\n\t\t\t\t<WaasFeeOptionsSelect\n\t\t\t\t\toptions={(pendingFeeOptionConfirmation?.options as FeeOption[]) || []}\n\t\t\t\t\tselectedFeeOption$={selectedFeeOption$}\n\t\t\t\t/>\n\n\t\t\t\t<Box\n\t\t\t\t\tdisplay=\"flex\"\n\t\t\t\t\talignItems=\"center\"\n\t\t\t\t\tjustifyContent=\"space-between\"\n\t\t\t\t\twidth=\"full\"\n\t\t\t\t>\n\t\t\t\t\t{currencyBalanceLoading ? (\n\t\t\t\t\t\t<Skeleton style={{ height: 15 }} borderRadius=\"md\" width=\"1/3\" />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<Box display=\"flex\" alignItems=\"center\" gap=\"2\">\n\t\t\t\t\t\t\t{insufficientBalance && (\n\t\t\t\t\t\t\t\t<WarningIcon color=\"negative\" size=\"xs\" />\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\tfontSize=\"small\"\n\t\t\t\t\t\t\t\tfontWeight=\"semibold\"\n\t\t\t\t\t\t\t\tfontFamily=\"body\"\n\t\t\t\t\t\t\t\tcolor={insufficientBalance ? 'negative' : 'text100'}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\tYou have {currencyBalance?.formatted || '0'}{' '}\n\t\t\t\t\t\t\t\t{selectedFeeOption?.token.symbol}\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</Box>\n\t\t\t\t\t)}\n\n\t\t\t\t\t<Button\n\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t!selectedFeeOption?.token ||\n\t\t\t\t\t\t\tinsufficientBalance ||\n\t\t\t\t\t\t\tcurrencyBalanceLoading\n\t\t\t\t\t\t}\n\t\t\t\t\t\tpending={currencyBalanceLoading}\n\t\t\t\t\t\tonClick={handleConfirmFeeOption}\n\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t<Box display=\"flex\" alignItems=\"center\" gap=\"2\">\n\t\t\t\t\t\t\t\tConfirm\n\t\t\t\t\t\t\t</Box>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvariant={insufficientBalance ? 'danger' : 'primary'}\n\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t/>\n\t\t\t\t</Box>\n\t\t\t</Box>\n\t\t);\n\t},\n);\n\nexport default WaasFeeOptionsBox;\n","import { useQuery } from '@tanstack/react-query';\nimport { type Address, erc20Abi, formatUnits, zeroAddress } from 'viem';\nimport { getPublicRpcClient } from '../../utils';\n\nexport function useCurrencyBalance({\n\tcurrencyAddress,\n\tchainId,\n\tuserAddress,\n}: {\n\tcurrencyAddress: Address;\n\tchainId: number;\n\tuserAddress: Address;\n}) {\n\tconst publicClient = getPublicRpcClient(chainId);\n\n\treturn useQuery({\n\t\tqueryKey: ['balance', currencyAddress, chainId, userAddress],\n\t\tqueryFn: async () => {\n\t\t\tif (!userAddress) return null;\n\n\t\t\tif (currencyAddress === zeroAddress) {\n\t\t\t\tconst balance = await publicClient.getBalance({\n\t\t\t\t\taddress: userAddress,\n\t\t\t\t});\n\t\t\t\treturn {\n\t\t\t\t\tvalue: balance,\n\t\t\t\t\tformatted: formatUnits(balance, 18),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst [balance, decimals] = await Promise.all([\n\t\t\t\tpublicClient.readContract({\n\t\t\t\t\taddress: currencyAddress,\n\t\t\t\t\tabi: erc20Abi,\n\t\t\t\t\tfunctionName: 'balanceOf',\n\t\t\t\t\targs: [userAddress],\n\t\t\t\t}),\n\t\t\t\tpublicClient.readContract({\n\t\t\t\t\taddress: currencyAddress,\n\t\t\t\t\tabi: erc20Abi,\n\t\t\t\t\tfunctionName: 'decimals',\n\t\t\t\t}),\n\t\t\t]);\n\n\t\t\treturn {\n\t\t\t\tvalue: balance,\n\t\t\t\tformatted: formatUnits(balance, decimals),\n\t\t\t};\n\t\t},\n\t\tenabled: !!userAddress && !!chainId && !!currencyAddress,\n\t});\n}\n","import { Box, Image, Text } from '@0xsequence/design-system';\nimport type { Observable } from '@legendapp/state';\nimport { observer } from '@legendapp/state/react';\nimport { useEffect } from 'react';\nimport { formatUnits } from 'viem';\nimport {\n\tCustomSelect,\n\ttype SelectItem,\n} from '../../../../components/_internals/custom-select/CustomSelect';\n\nexport type FeeOption = {\n\tgasLimit: number;\n\tto: string;\n\ttoken: {\n\t\tchainId: number;\n\t\tcontractAddress: string | null;\n\t\tdecimals: number;\n\t\tlogoURL: string;\n\t\tname: string;\n\t\tsymbol: string;\n\t\ttokenID: string | null;\n\t\ttype: string;\n\t};\n\tvalue: string;\n};\n\nconst WaasFeeOptionsSelect = observer(\n\t({\n\t\toptions,\n\t\tselectedFeeOption$,\n\t}: {\n\t\toptions: FeeOption[];\n\t\tselectedFeeOption$: Observable<FeeOption | undefined>;\n\t}) => {\n\t\tconst feeOptions = options\n\t\t\t.filter((option) => option.token.contractAddress !== null)\n\t\t\t.map((option) => {\n\t\t\t\tconst value = option.token.contractAddress ?? '';\n\t\t\t\treturn FeeOptionSelectItem({ value, option });\n\t\t\t});\n\n\t\t// biome-ignore lint/correctness/useExhaustiveDependencies: <explanation>\n\t\tuseEffect(() => {\n\t\t\tif (options.length > 0 && !selectedFeeOption$.get())\n\t\t\t\tselectedFeeOption$.set(options[0]);\n\t\t}, [options]);\n\n\t\tif (options.length === 0 || !selectedFeeOption$.get()?.token) return null;\n\n\t\treturn (\n\t\t\t<CustomSelect\n\t\t\t\titems={feeOptions}\n\t\t\t\tonValueChange={(value) => {\n\t\t\t\t\tconst selectedOption = options.find(\n\t\t\t\t\t\t(option) => option.token.contractAddress === value,\n\t\t\t\t\t);\n\n\t\t\t\t\tselectedFeeOption$.set(selectedOption);\n\t\t\t\t}}\n\t\t\t\tdefaultValue={\n\t\t\t\t\tselectedFeeOption$.get()?.token.contractAddress\n\t\t\t\t\t\t? FeeOptionSelectItem({\n\t\t\t\t\t\t\t\tvalue: selectedFeeOption$.get()?.token.contractAddress ?? '',\n\t\t\t\t\t\t\t\toption: selectedFeeOption$.get() ?? options[0],\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t: undefined\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nfunction FeeOptionSelectItem({\n\tvalue,\n\toption,\n}: {\n\tvalue: string;\n\toption: FeeOption;\n}) {\n\treturn {\n\t\tvalue,\n\t\tcontent: (\n\t\t\t<Box display=\"flex\" alignItems=\"center\" gap=\"2\">\n\t\t\t\t<Image\n\t\t\t\t\tsrc={option.token.logoURL}\n\t\t\t\t\talt={option.token.symbol}\n\t\t\t\t\twidth=\"3\"\n\t\t\t\t\theight=\"3\"\n\t\t\t\t/>\n\n\t\t\t\t<Box display=\"flex\" gap=\"1\">\n\t\t\t\t\t<Text color=\"text100\" fontSize=\"small\" fontFamily=\"body\">\n\t\t\t\t\t\tFee\n\t\t\t\t\t</Text>\n\t\t\t\t\t<Text\n\t\t\t\t\t\tcolor=\"text50\"\n\t\t\t\t\t\tfontSize=\"small\"\n\t\t\t\t\t\tfontFamily=\"body\"\n\t\t\t\t\t\tfontWeight=\"semibold\"\n\t\t\t\t\t>\n\t\t\t\t\t\t(in {option.token.symbol})\n\t\t\t\t\t</Text>\n\n\t\t\t\t\t<Text color=\"text100\" fontSize=\"small\" fontFamily=\"body\">\n\t\t\t\t\t\t:\n\t\t\t\t\t</Text>\n\t\t\t\t</Box>\n\n\t\t\t\t<Text fontSize=\"small\" fontFamily=\"body\">\n\t\t\t\t\t{formatUnits(BigInt(option.value), option.token.decimals || 0)}\n\t\t\t\t</Text>\n\t\t\t</Box>\n\t\t),\n\t} as SelectItem;\n}\n\nexport default WaasFeeOptionsSelect;\n","import { CheckmarkIcon, ChevronDownIcon } from '@0xsequence/design-system';\nimport * as Select from '@radix-ui/react-select';\nimport React, { type ReactNode } from 'react';\nimport { content, item, itemIndicator, trigger } from './styles.css';\n\nexport interface SelectItem {\n\tvalue: string;\n\tcontent: ReactNode;\n\tdisabled?: boolean;\n}\n\ninterface CustomSelectProps {\n\titems: SelectItem[];\n\tonValueChange?: (value: string) => void;\n\tdefaultValue?: SelectItem;\n}\n\nconst CustomSelectItem = React.forwardRef<\n\tHTMLDivElement,\n\tSelect.SelectItemProps & { children: ReactNode }\n>(({ children, ...props }, forwardedRef) => {\n\treturn (\n\t\t<Select.Item className={item} {...props} ref={forwardedRef}>\n\t\t\t<Select.ItemText>{children}</Select.ItemText>\n\t\t\t<Select.ItemIndicator className={itemIndicator}>\n\t\t\t\t<CheckmarkIcon size=\"xs\" />\n\t\t\t</Select.ItemIndicator>\n\t\t</Select.Item>\n\t);\n});\n\nexport const CustomSelect: React.FC<CustomSelectProps> = ({\n\titems,\n\tonValueChange,\n\tdefaultValue,\n}) => {\n\treturn (\n\t\t<Select.Root\n\t\t\tonValueChange={onValueChange}\n\t\t\tdefaultValue={defaultValue?.value}\n\t\t>\n\t\t\t<Select.Trigger className={trigger}>\n\t\t\t\t<Select.Value />\n\t\t\t\t<Select.Icon>\n\t\t\t\t\t<ChevronDownIcon size=\"xs\" />\n\t\t\t\t</Select.Icon>\n\t\t\t</Select.Trigger>\n\n\t\t\t<Select.Portal>\n\t\t\t\t<Select.Content className={content}>\n\t\t\t\t\t<Select.Viewport>\n\t\t\t\t\t\t{items.map((item) => (\n\t\t\t\t\t\t\t<CustomSelectItem\n\t\t\t\t\t\t\t\tkey={item.value}\n\t\t\t\t\t\t\t\tvalue={item.value}\n\t\t\t\t\t\t\t\tdisabled={item.disabled}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{item.content}\n\t\t\t\t\t\t\t</CustomSelectItem>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</Select.Viewport>\n\t\t\t\t</Select.Content>\n\t\t\t</Select.Portal>\n\t\t</Select.Root>\n\t);\n};\n","import 'src/react/ui/components/_internals/custom-select/styles.css.ts.vanilla.css?source=LnN0eWxlc19pdGVtX18xZGR0dWprMjpob3ZlciB7CiAgYmFja2dyb3VuZDogdmFyKC0tc2VxLWNvbG9ycy1iYWNrZ3JvdW5kLW11dGVkKTsKfQ==';\nexport var content = 'fyvr11eg fyvr11es fyvr11f4 fyvr11fg fyvr11hc fyvr11i0 fyvr11g0 fyvr11go fyvr11q0 fyvr11qg fyvr12g3 fyvr12ar fyvr1203 fyvr125f fyvr12hr fyvr12cf fyvr121r fyvr1273 fyvr11vx fyvr11r0 fyvr11rt';\nexport var item = 'styles_item__1ddtujk2 fyvr11h0 fyvr11ho fyvr11fo fyvr11gc fyvr1v4 fyvr1x8 fyvr1zs fyvr111g fyvr11ik fyvr12k9 fyvr11l8 fyvr11ow fyvr14g fyvr11m4 fyvr11rc fyvr12nf';\nexport var itemIndicator = 'fyvr11lw fyvr1qk fyvr11lk fyvr11ow fyvr11no';\nexport var trigger = 'fyvr11hk fyvr11i8 fyvr11g8 fyvr11gw fyvr1zg fyvr111k fyvr11lk fyvr11ow fyvr11no fyvr11ik fyvr14g fyvr11cg fyvr11ur fyvr12k9 fyvr12nf fyvr12i9 fyvr11a4';","import { observable } from '@legendapp/state';\nimport type { FeeOption } from '../waasFeeOptionsSelect/WaasFeeOptionsSelect';\n\ntype WaasFeeOptionsModalState = {\n\tselectedFeeOption: FeeOption | undefined;\n};\n\nconst initialState = {\n\tselectedFeeOption: undefined,\n} as WaasFeeOptionsModalState;\n\nexport const waasFeeOptionsModal$ = observable(initialState);\n","import 'src/react/ui/modals/_internal/components/waasFeeOptionsBox/styles.css.ts.vanilla.css?source=LnN0eWxlc19mZWVPcHRpb25zV3JhcHBlcl9fMTI0aWswdzAgewogIGJvdHRvbTogLTE0MHB4Owp9Ci5zdHlsZXNfZGlhbG9nQ29udGVudF9fMTI0aWswdzIgewogIHRvcDogNTAlOwogIGxlZnQ6IDUwJTsKICB0cmFuc2Zvcm06IHRyYW5zbGF0ZSgtNTAlLCAtNTAlKTsKICBwYWRkaW5nOiAyNHB4Owp9Ci5zdHlsZXNfY3RhX18xMjRpazB3MyB7CiAgYm9yZGVyLXJhZGl1czogMTJweCAhaW1wb3J0YW50Owp9Ci5zdHlsZXNfY3RhX18xMjRpazB3MyA+IGRpdiB7CiAganVzdGlmeS1jb250ZW50OiBjZW50ZXIgIWltcG9ydGFudDsKfQ==';\nexport var cta = 'styles_cta__124ik0w3';\nexport var dialogContent = 'styles_dialogContent__124ik0w2 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs fyvr11l8 fyvr11ul fyvr11m0 fyvr11rv';\nexport var dialogOverlay = 'fyvr1m0 fyvr1o8 fyvr1qg fyvr1so fyvr11vl fyvr11m0 fyvr11rv';\nexport var feeOptionsWrapper = 'styles_feeOptionsWrapper__124ik0w0 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs fyvr1vc fyvr1xg fyvr1zk fyvr111o fyvr11lw fyvr11w9 fyvr11r0 fyvr12g fyvr1qg fyvr11l8 fyvr11mc fyvr11cg';","import { type Observable, observable } from '@legendapp/state';\nimport type { ChainId } from '../../../../../_internal';\nimport type { Address } from 'viem';\n\nexport interface ActionModalState {\n\tisOpen: boolean;\n\tchainId: ChainId | null;\n\tcollectionAddress: Address | null;\n}\n\nexport function createActionModalStore() {\n\treturn observable<ActionModalState>({\n\t\tisOpen: false,\n\t\tchainId: null,\n\t\tcollectionAddress: null,\n\t});\n}\n\nexport function openModal(store: Observable<ActionModalState>) {\n\tstore.isOpen.set(true);\n}\n\nexport function closeModal(store: Observable<ActionModalState>) {\n\tstore.isOpen.set(false);\n}\n"],"mappings":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KAAI,WAAW,gBAAAR,KAAC,WAAQ,MAAK,MAAK;AAAA,0BAElCQ,KAAI;AAAA;AAAA;AAAA,oBACN;AAAA;AAAA,kBAxBIA,KAAI;AAAA,gBA0BV;AAAA,cAEH,GACD;AAAA;AAAA;AAAA,QACD;AAAA,QAEA,gBAAAR;AAAA,UAAC;AAAA;AAAA,YACA;AAAA,YACA,oBAAoB,MAAM,mBAAmB,IAAI;AAAA,YACjD,sBAAsB,MAAM,mBAAmB,KAAK;AAAA;AAAA,QACrD;AAAA,QAEA,gBAAAA,KAAC,SAAM,WAAW,aAAa,SAAO,MAAC,SAAS,SAC/C,0BAAAA,KAAC,cAAW,MAAK,MAAK,cAAW,eAAc,MAAM,WAAW,GACjE;AAAA,SACD;AAAA,OACD,GACD;AAAA,EAEF;AACD;;;AQ9IA,SAA0B,cAAAU,mBAAkB;AAUrC,SAAS,yBAAyB;AACxC,SAAOA,YAA6B;AAAA,IACnC,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,mBAAmB;AAAA,EACpB,CAAC;AACF;AAEO,SAAS,UAAU,OAAqC;AAC9D,QAAM,OAAO,IAAI,IAAI;AACtB;AAEO,SAAS,WAAW,OAAqC;AAC/D,QAAM,OAAO,IAAI,KAAK;AACvB;","names":["Box","Button","Text","observer","Content","Portal","Root","Box","Text","observer","useEffect","zeroAddress","balance","formatUnits","item","jsx","jsxs","formatUnits","jsx","jsxs","observer","zeroAddress","useEffect","Box","Text","jsx","jsxs","observer","Root","Portal","Content","Box","Text","cta","Button","observable"]}
|
|
@@ -103,14 +103,6 @@ var InvalidContractTypeError = class extends TransactionError {
|
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
|
-
var InvalidCurrencyOptionsError = class extends TransactionError {
|
|
107
|
-
name = "InvalidCurrencyOptionsError";
|
|
108
|
-
constructor(currencyOptions) {
|
|
109
|
-
super(`Invalid currency options: ${currencyOptions}`, {
|
|
110
|
-
details: "The currency options must be an array of valid currency contract addresses."
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
106
|
var ProjectNotFoundError = class extends TransactionError {
|
|
115
107
|
name = "ProjectNotFoundError";
|
|
116
108
|
constructor(projectId, url) {
|
|
@@ -155,10 +147,9 @@ export {
|
|
|
155
147
|
InvalidStepError,
|
|
156
148
|
TransactionConfirmationError,
|
|
157
149
|
InvalidContractTypeError,
|
|
158
|
-
InvalidCurrencyOptionsError,
|
|
159
150
|
ProjectNotFoundError,
|
|
160
151
|
MarketplaceConfigFetchError,
|
|
161
152
|
MissingConfigError,
|
|
162
153
|
WalletInstanceNotFoundError
|
|
163
154
|
};
|
|
164
|
-
//# sourceMappingURL=chunk-
|
|
155
|
+
//# sourceMappingURL=chunk-WM4RGBFQ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/_internal/error/base.ts","../src/utils/_internal/error/transaction.ts"],"sourcesContent":["export type ErrorType<name extends string = 'Error'> = Error & { name: name };\n\nexport type Compute<type> = { [key in keyof type]: type[key] } & unknown;\n\ntype BaseErrorOptions = Compute<\n\t{ details?: string | undefined } | { cause: BaseError | Error }\n>;\n\nexport class BaseError extends Error {\n\tdetails: string;\n\tshortMessage: string;\n\n\tname = 'MarketplaceSdkBaseError';\n\n\tconstructor(shortMessage: string, options: BaseErrorOptions = {}) {\n\t\tsuper();\n\n\t\tconst details = 'details' in options ? options.details : '';\n\t\tthis.message = [\n\t\t\tshortMessage || 'An error occurred.',\n\t\t\t'',\n\t\t\t...(details ? [`Details: ${details}`] : []),\n\t\t].join('\\n');\n\n\t\tif ('cause' in options && options.cause) {\n\t\t\tthis.cause = options.cause;\n\t\t}\n\n\t\tthis.details = details || '';\n\t\tthis.shortMessage = shortMessage;\n\t}\n}\n","import type { Address } from 'viem';\nimport { BaseError } from './base';\n\nexport type TransactionErrorType<name extends string = 'TransactionError'> =\n\tBaseError & { name: name };\n\nexport class TransactionError extends BaseError {\n\toverride name = 'TransactionError';\n}\n\nexport class ChainSwitchError extends TransactionError {\n\toverride name = 'ChainSwitchError';\n\tconstructor(currentChainId: number, targetChainId: number) {\n\t\tsuper(\n\t\t\t`Failed to switch network from ${currentChainId} to ${targetChainId}`,\n\t\t\t{\n\t\t\t\tdetails:\n\t\t\t\t\t'The user may have rejected the network switch or there might be a network connectivity issue.',\n\t\t\t},\n\t\t);\n\t}\n}\n\nexport class ChainSwitchUserRejectedError extends TransactionError {\n\toverride name = 'ChainSwitchUserRejectedError';\n\tconstructor() {\n\t\tsuper('User rejected chain switch', {\n\t\t\tdetails: 'The user rejected the chain switch request.',\n\t\t});\n\t}\n}\n\nexport class TransactionExecutionError extends TransactionError {\n\toverride name = 'TransactionExecutionError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to execute transaction step: ${stepId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction may have been rejected or failed during execution.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class TransactionSignatureError extends TransactionError {\n\toverride name = 'TransactionSignatureError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to sign transaction step: ${stepId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The signature request may have been rejected by the user.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class NoWalletConnectedError extends TransactionError {\n\toverride name = 'NoWalletConnectedError';\n\tconstructor() {\n\t\tsuper('No wallet connected', {\n\t\t\tdetails: 'Please connect your wallet before attempting this transaction.',\n\t\t});\n\t}\n}\n\nexport class NoMarketplaceConfigError extends TransactionError {\n\toverride name = 'NoMarketplaceConfigError';\n\tconstructor() {\n\t\tsuper('Marketplace configuration not found', {\n\t\t\tdetails:\n\t\t\t\t'The marketplace configuration is missing or invalid. This could be due to an initialization error.',\n\t\t});\n\t}\n}\n\nexport class UserRejectedRequestError extends TransactionError {\n\toverride name = 'UserRejectedRequestError';\n\tconstructor() {\n\t\tsuper('User rejected the request', {\n\t\t\tdetails: 'The user cancelled or rejected the transaction request.',\n\t\t});\n\t}\n}\n\nexport class InsufficientFundsError extends TransactionError {\n\toverride name = 'InsufficientFundsError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Insufficient funds for transaction', {\n\t\t\tdetails:\n\t\t\t\t'The wallet does not have enough funds to complete this transaction.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class SignatureExecutionError extends TransactionError {\n\toverride name = 'SignatureExecutionError';\n\tconstructor(signature: string, cause?: Error) {\n\t\tsuper(`Failed to execute signature: ${signature}`, {\n\t\t\tdetails: cause?.message || 'The execution of the signature failed.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class StepExecutionError extends TransactionError {\n\toverride name = 'StepExecutionError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to execute step ${stepId})`, {\n\t\t\tdetails: cause?.message || 'The step execution failed unexpectedly.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class StepGenerationError extends TransactionError {\n\toverride name = 'StepGenerationError';\n\tconstructor(transactionType: string, cause?: Error) {\n\t\tsuper(`Failed to generate steps for ${transactionType}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message || 'Could not generate the required transaction steps.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class PaymentModalError extends TransactionError {\n\toverride name = 'PaymentModalError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Payment modal operation failed', {\n\t\t\tdetails:\n\t\t\t\tcause?.message || 'The payment modal operation was unsuccessful.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class InvalidStepError extends TransactionError {\n\toverride name = 'InvalidStepError';\n\tconstructor(stepId: string, reason: string) {\n\t\tsuper(`Invalid step configuration for ${stepId}`, {\n\t\t\tdetails: reason,\n\t\t});\n\t}\n}\n\nexport class TransactionConfirmationError extends TransactionError {\n\toverride name = 'TransactionConfirmationError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Failed to confirm transaction ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction could not be confirmed on the network.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class OrderNotFoundError extends TransactionError {\n\toverride name = 'OrderNotFoundError';\n\tconstructor(orderId: string) {\n\t\tsuper(`Order ${orderId} not found`, {\n\t\t\tdetails: 'The requested order could not be found in the marketplace.',\n\t\t});\n\t}\n}\n\nexport class MissingStepDataError extends TransactionError {\n\toverride name = 'MissingStepDataError';\n\tconstructor() {\n\t\tsuper('Step is missing required data', {\n\t\t\tdetails:\n\t\t\t\t'The transaction step is missing required \"to\" or \"signature\" data.',\n\t\t});\n\t}\n}\n\nexport class MissingSignatureDataError extends TransactionError {\n\toverride name = 'MissingSignatureDataError';\n\tconstructor() {\n\t\tsuper('Step is missing signature data', {\n\t\t\tdetails:\n\t\t\t\t'The signature step is missing required signature data configuration.',\n\t\t});\n\t}\n}\n\nexport class InvalidSignatureStepError extends TransactionError {\n\toverride name = 'InvalidSignatureStepError';\n\tconstructor(stepId: string) {\n\t\tsuper(`Invalid signature step type: ${stepId}`, {\n\t\t\tdetails: 'The signature step type is not supported.',\n\t\t});\n\t}\n}\n\nexport class MissingPostStepError extends TransactionError {\n\toverride name = 'MissingPostStepError';\n\tconstructor() {\n\t\tsuper('Missing post step configuration', {\n\t\t\tdetails:\n\t\t\t\t'The signature step is missing required post-step configuration.',\n\t\t});\n\t}\n}\n\nexport class UnexpectedStepsError extends TransactionError {\n\toverride name = 'UnexpectedStepsError';\n\tconstructor() {\n\t\tsuper('Unexpected steps found', {\n\t\t\tdetails: 'The transaction contains more steps than expected.',\n\t\t});\n\t}\n}\n\nexport class NoExecutionStepError extends TransactionError {\n\toverride name = 'NoExecutionStepError';\n\tconstructor() {\n\t\tsuper('No execution step found', {\n\t\t\tdetails: 'The transaction is missing the required execution step.',\n\t\t});\n\t}\n}\n\nexport class NoStepsFoundError extends TransactionError {\n\toverride name = 'NoStepsFoundError';\n\tconstructor() {\n\t\tsuper('No steps found', {\n\t\t\tdetails: 'The transaction contains no steps to execute.',\n\t\t});\n\t}\n}\n\nexport class UnknownTransactionTypeError extends TransactionError {\n\toverride name = 'UnknownTransactionTypeError';\n\tconstructor(type: string) {\n\t\tsuper(`Unknown transaction type: ${type}`, {\n\t\t\tdetails: 'The specified transaction type is not supported.',\n\t\t});\n\t}\n}\n\nexport class InvalidContractTypeError extends TransactionError {\n\toverride name = 'InvalidContractTypeError';\n\tconstructor(contractType: string | undefined) {\n\t\tsuper(`Invalid contract type: ${contractType}`, {\n\t\t\tdetails: 'The contract type must be either ERC721 or ERC1155.',\n\t\t});\n\t}\n}\n\nexport class CollectionNotFoundError extends TransactionError {\n\toverride name = 'CollectionNotFoundError';\n\tconstructor(collectionAddress: string) {\n\t\tsuper(`Collection not found: ${collectionAddress}`, {\n\t\t\tdetails:\n\t\t\t\t'The specified collection address could not be found in the marketplace configuration.',\n\t\t});\n\t}\n}\n\nexport class InvalidCurrencyOptionsError extends TransactionError {\n\toverride name = 'InvalidCurrencyOptionsError';\n\tconstructor(currencyOptions: Address[]) {\n\t\tsuper(`Invalid currency options: ${currencyOptions}`, {\n\t\t\tdetails:\n\t\t\t\t'The currency options must be an array of valid currency contract addresses.',\n\t\t});\n\t}\n}\n\nexport class ProjectNotFoundError extends TransactionError {\n\toverride name = 'ProjectNotFoundError';\n\tconstructor(projectId: string, url: string) {\n\t\tsuper('Project not found', {\n\t\t\tdetails: `Project id: ${projectId} not found at ${url}`,\n\t\t});\n\t}\n}\n\nexport class MarketplaceConfigFetchError extends TransactionError {\n\toverride name = 'MarketplaceConfigFetchError';\n\tconstructor(message: string) {\n\t\tsuper('Failed to fetch marketplace config', {\n\t\t\tdetails: message,\n\t\t});\n\t}\n}\n\nexport class MissingConfigError extends TransactionError {\n\toverride name = 'MissingConfigError';\n\tconstructor(configName: string) {\n\t\tsuper(`Missing required config: ${configName}`, {\n\t\t\tdetails: 'A required configuration parameter is missing.',\n\t\t});\n\t}\n}\n\nexport class TransactionValidationError extends TransactionError {\n\toverride name = 'TransactionValidationError';\n\tconstructor(reason: string) {\n\t\tsuper('Transaction validation failed', {\n\t\t\tdetails: reason,\n\t\t});\n\t}\n}\n\nexport class ChainIdUnavailableError extends TransactionError {\n\toverride name = 'ChainIdUnavailableError';\n\tconstructor() {\n\t\tsuper('Chain ID is not available', {\n\t\t\tdetails: 'Could not determine the current chain ID from the wallet.',\n\t\t});\n\t}\n}\n\nexport class TransactionReceiptError extends TransactionError {\n\toverride name = 'TransactionReceiptError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Failed to get transaction receipt for ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the transaction receipt from the network.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class PaymentModalTransactionError extends TransactionError {\n\toverride name = 'PaymentModalTransactionError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Payment modal transaction failed for ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction initiated from the payment modal failed.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class CheckoutOptionsError extends TransactionError {\n\toverride name = 'CheckoutOptionsError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Failed to get checkout options', {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the checkout options from the marketplace.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class OrdersFetchError extends TransactionError {\n\toverride name = 'OrdersFetchError';\n\tconstructor(orderId: string, cause?: Error) {\n\t\tsuper(`Failed to fetch order ${orderId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the order details from the marketplace.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class WalletInstanceNotFoundError extends TransactionError {\n\toverride name = 'WalletInstanceNotFoundError';\n\tconstructor() {\n\t\tsuper('Wallet instance not found', {\n\t\t\tdetails: 'The wallet instance is undefined',\n\t\t});\n\t}\n}\n\nexport type TransactionErrorTypes =\n\t| ChainIdUnavailableError\n\t| TransactionReceiptError\n\t| PaymentModalTransactionError\n\t| CheckoutOptionsError\n\t| OrdersFetchError\n\t| TransactionConfirmationError\n\t| TransactionValidationError\n\t| MissingConfigError\n\t| MarketplaceConfigFetchError\n\t| ProjectNotFoundError\n\t| CollectionNotFoundError\n\t| InvalidCurrencyOptionsError\n\t| InvalidContractTypeError\n\t| UnknownTransactionTypeError\n\t| NoStepsFoundError\n\t| NoExecutionStepError\n\t| UnexpectedStepsError\n\t| MissingPostStepError\n\t| InvalidSignatureStepError\n\t| MissingSignatureDataError\n\t| MissingStepDataError\n\t| OrderNotFoundError\n\t| TransactionConfirmationError\n\t| InvalidStepError\n\t| PaymentModalError\n\t| StepGenerationError\n\t| StepExecutionError\n\t| UserRejectedRequestError\n\t| NoMarketplaceConfigError\n\t| InsufficientFundsError\n\t| ChainSwitchUserRejectedError\n\t| ChainSwitchError\n\t| TransactionSignatureError\n\t| TransactionExecutionError\n\t| NoWalletConnectedError\n\t| TransactionError\n\t| WalletInstanceNotFoundError;\n"],"mappings":";;;AAQO,IAAM,YAAN,cAAwB,MAAM;AAAA,EACpC;AAAA,EACA;AAAA,EAEA,OAAO;AAAA,EAEP,YAAY,cAAsB,UAA4B,CAAC,GAAG;AACjE,UAAM;AAEN,UAAM,UAAU,aAAa,UAAU,QAAQ,UAAU;AACzD,SAAK,UAAU;AAAA,MACd,gBAAgB;AAAA,MAChB;AAAA,MACA,GAAI,UAAU,CAAC,YAAY,OAAO,EAAE,IAAI,CAAC;AAAA,IAC1C,EAAE,KAAK,IAAI;AAEX,QAAI,WAAW,WAAW,QAAQ,OAAO;AACxC,WAAK,QAAQ,QAAQ;AAAA,IACtB;AAEA,SAAK,UAAU,WAAW;AAC1B,SAAK,eAAe;AAAA,EACrB;AACD;;;ACzBO,IAAM,mBAAN,cAA+B,UAAU;AAAA,EACt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OAAO;AAAA,EAChB,YAAY,MAAc,OAAe;AACxC,UAAM,iCAAiC,IAAI,IAAI;AAAA,MAC9C,SACC,OAAO,WACP;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AACD;AAsFO,IAAM,2BAAN,cAAuC,iBAAiB;AAAA,EACrD,OAAO;AAAA,EAChB,YAAY,cAAkC;AAC7C,UAAM,0BAA0B,YAAY,IAAI;AAAA,MAC/C,SAAS;AAAA,IACV,CAAC;AAAA,EACF;AACD;AAYO,IAAM,8BAAN,cAA0C,iBAAiB;AAAA,EACxD,OAAO;AAAA,EAChB,YAAY,iBAA4B;AACvC,UAAM,6BAA6B,eAAe,IAAI;AAAA,MACrD,SACC;AAAA,IACF,CAAC;AAAA,EACF;AACD;AAEO,IAAM,uBAAN,cAAmC,iBAAiB;AAAA,EACjD,OAAO;AAAA,EAChB,YAAY,WAAmB,KAAa;AAC3C,UAAM,qBAAqB;AAAA,MAC1B,SAAS,eAAe,SAAS,iBAAiB,GAAG;AAAA,IACtD,CAAC;AAAA,EACF;AACD;AAEO,IAAM,8BAAN,cAA0C,iBAAiB;AAAA,EACxD,OAAO;AAAA,EAChB,YAAY,SAAiB;AAC5B,UAAM,sCAAsC;AAAA,MAC3C,SAAS;AAAA,IACV,CAAC;AAAA,EACF;AACD;AAEO,IAAM,qBAAN,cAAiC,iBAAiB;AAAA,EAC/C,OAAO;AAAA,EAChB,YAAY,YAAoB;AAC/B,UAAM,4BAA4B,UAAU,IAAI;AAAA,MAC/C,SAAS;AAAA,IACV,CAAC;AAAA,EACF;AACD;AAoEO,IAAM,8BAAN,cAA0C,iBAAiB;AAAA,EACxD,OAAO;AAAA,EAChB,cAAc;AACb,UAAM,6BAA6B;AAAA,MAClC,SAAS;AAAA,IACV,CAAC;AAAA,EACF;AACD;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/utils/_internal/error/base.ts","../src/utils/_internal/error/transaction.ts"],"sourcesContent":["export type ErrorType<name extends string = 'Error'> = Error & { name: name };\n\nexport type Compute<type> = { [key in keyof type]: type[key] } & unknown;\n\ntype BaseErrorOptions = Compute<\n\t{ details?: string | undefined } | { cause: BaseError | Error }\n>;\n\nexport class BaseError extends Error {\n\tdetails: string;\n\tshortMessage: string;\n\n\tname = 'MarketplaceSdkBaseError';\n\n\tconstructor(shortMessage: string, options: BaseErrorOptions = {}) {\n\t\tsuper();\n\n\t\tconst details = 'details' in options ? options.details : '';\n\t\tthis.message = [\n\t\t\tshortMessage || 'An error occurred.',\n\t\t\t'',\n\t\t\t...(details ? [`Details: ${details}`] : []),\n\t\t].join('\\n');\n\n\t\tif ('cause' in options && options.cause) {\n\t\t\tthis.cause = options.cause;\n\t\t}\n\n\t\tthis.details = details || '';\n\t\tthis.shortMessage = shortMessage;\n\t}\n}\n","import type { Address } from 'viem';\nimport { BaseError } from './base';\n\nexport type TransactionErrorType<name extends string = 'TransactionError'> =\n\tBaseError & { name: name };\n\nexport class TransactionError extends BaseError {\n\toverride name = 'TransactionError';\n}\n\nexport class ChainSwitchError extends TransactionError {\n\toverride name = 'ChainSwitchError';\n\tconstructor(currentChainId: number, targetChainId: number) {\n\t\tsuper(\n\t\t\t`Failed to switch network from ${currentChainId} to ${targetChainId}`,\n\t\t\t{\n\t\t\t\tdetails:\n\t\t\t\t\t'The user may have rejected the network switch or there might be a network connectivity issue.',\n\t\t\t},\n\t\t);\n\t}\n}\n\nexport class ChainSwitchUserRejectedError extends TransactionError {\n\toverride name = 'ChainSwitchUserRejectedError';\n\tconstructor() {\n\t\tsuper('User rejected chain switch', {\n\t\t\tdetails: 'The user rejected the chain switch request.',\n\t\t});\n\t}\n}\n\nexport class TransactionExecutionError extends TransactionError {\n\toverride name = 'TransactionExecutionError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to execute transaction step: ${stepId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction may have been rejected or failed during execution.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class TransactionSignatureError extends TransactionError {\n\toverride name = 'TransactionSignatureError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to sign transaction step: ${stepId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The signature request may have been rejected by the user.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class NoWalletConnectedError extends TransactionError {\n\toverride name = 'NoWalletConnectedError';\n\tconstructor() {\n\t\tsuper('No wallet connected', {\n\t\t\tdetails: 'Please connect your wallet before attempting this transaction.',\n\t\t});\n\t}\n}\n\nexport class NoMarketplaceConfigError extends TransactionError {\n\toverride name = 'NoMarketplaceConfigError';\n\tconstructor() {\n\t\tsuper('Marketplace configuration not found', {\n\t\t\tdetails:\n\t\t\t\t'The marketplace configuration is missing or invalid. This could be due to an initialization error.',\n\t\t});\n\t}\n}\n\nexport class UserRejectedRequestError extends TransactionError {\n\toverride name = 'UserRejectedRequestError';\n\tconstructor() {\n\t\tsuper('User rejected the request', {\n\t\t\tdetails: 'The user cancelled or rejected the transaction request.',\n\t\t});\n\t}\n}\n\nexport class InsufficientFundsError extends TransactionError {\n\toverride name = 'InsufficientFundsError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Insufficient funds for transaction', {\n\t\t\tdetails:\n\t\t\t\t'The wallet does not have enough funds to complete this transaction.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class SignatureExecutionError extends TransactionError {\n\toverride name = 'SignatureExecutionError';\n\tconstructor(signature: string, cause?: Error) {\n\t\tsuper(`Failed to execute signature: ${signature}`, {\n\t\t\tdetails: cause?.message || 'The execution of the signature failed.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class StepExecutionError extends TransactionError {\n\toverride name = 'StepExecutionError';\n\tconstructor(stepId: string, cause?: Error) {\n\t\tsuper(`Failed to execute step ${stepId})`, {\n\t\t\tdetails: cause?.message || 'The step execution failed unexpectedly.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class StepGenerationError extends TransactionError {\n\toverride name = 'StepGenerationError';\n\tconstructor(transactionType: string, cause?: Error) {\n\t\tsuper(`Failed to generate steps for ${transactionType}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message || 'Could not generate the required transaction steps.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class PaymentModalError extends TransactionError {\n\toverride name = 'PaymentModalError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Payment modal operation failed', {\n\t\t\tdetails:\n\t\t\t\tcause?.message || 'The payment modal operation was unsuccessful.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class InvalidStepError extends TransactionError {\n\toverride name = 'InvalidStepError';\n\tconstructor(stepId: string, reason: string) {\n\t\tsuper(`Invalid step configuration for ${stepId}`, {\n\t\t\tdetails: reason,\n\t\t});\n\t}\n}\n\nexport class TransactionConfirmationError extends TransactionError {\n\toverride name = 'TransactionConfirmationError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Failed to confirm transaction ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction could not be confirmed on the network.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class OrderNotFoundError extends TransactionError {\n\toverride name = 'OrderNotFoundError';\n\tconstructor(orderId: string) {\n\t\tsuper(`Order ${orderId} not found`, {\n\t\t\tdetails: 'The requested order could not be found in the marketplace.',\n\t\t});\n\t}\n}\n\nexport class MissingStepDataError extends TransactionError {\n\toverride name = 'MissingStepDataError';\n\tconstructor() {\n\t\tsuper('Step is missing required data', {\n\t\t\tdetails:\n\t\t\t\t'The transaction step is missing required \"to\" or \"signature\" data.',\n\t\t});\n\t}\n}\n\nexport class MissingSignatureDataError extends TransactionError {\n\toverride name = 'MissingSignatureDataError';\n\tconstructor() {\n\t\tsuper('Step is missing signature data', {\n\t\t\tdetails:\n\t\t\t\t'The signature step is missing required signature data configuration.',\n\t\t});\n\t}\n}\n\nexport class InvalidSignatureStepError extends TransactionError {\n\toverride name = 'InvalidSignatureStepError';\n\tconstructor(stepId: string) {\n\t\tsuper(`Invalid signature step type: ${stepId}`, {\n\t\t\tdetails: 'The signature step type is not supported.',\n\t\t});\n\t}\n}\n\nexport class MissingPostStepError extends TransactionError {\n\toverride name = 'MissingPostStepError';\n\tconstructor() {\n\t\tsuper('Missing post step configuration', {\n\t\t\tdetails:\n\t\t\t\t'The signature step is missing required post-step configuration.',\n\t\t});\n\t}\n}\n\nexport class UnexpectedStepsError extends TransactionError {\n\toverride name = 'UnexpectedStepsError';\n\tconstructor() {\n\t\tsuper('Unexpected steps found', {\n\t\t\tdetails: 'The transaction contains more steps than expected.',\n\t\t});\n\t}\n}\n\nexport class NoExecutionStepError extends TransactionError {\n\toverride name = 'NoExecutionStepError';\n\tconstructor() {\n\t\tsuper('No execution step found', {\n\t\t\tdetails: 'The transaction is missing the required execution step.',\n\t\t});\n\t}\n}\n\nexport class NoStepsFoundError extends TransactionError {\n\toverride name = 'NoStepsFoundError';\n\tconstructor() {\n\t\tsuper('No steps found', {\n\t\t\tdetails: 'The transaction contains no steps to execute.',\n\t\t});\n\t}\n}\n\nexport class UnknownTransactionTypeError extends TransactionError {\n\toverride name = 'UnknownTransactionTypeError';\n\tconstructor(type: string) {\n\t\tsuper(`Unknown transaction type: ${type}`, {\n\t\t\tdetails: 'The specified transaction type is not supported.',\n\t\t});\n\t}\n}\n\nexport class InvalidContractTypeError extends TransactionError {\n\toverride name = 'InvalidContractTypeError';\n\tconstructor(contractType: string | undefined) {\n\t\tsuper(`Invalid contract type: ${contractType}`, {\n\t\t\tdetails: 'The contract type must be either ERC721 or ERC1155.',\n\t\t});\n\t}\n}\n\nexport class CollectionNotFoundError extends TransactionError {\n\toverride name = 'CollectionNotFoundError';\n\tconstructor(collectionAddress: string) {\n\t\tsuper(`Collection not found: ${collectionAddress}`, {\n\t\t\tdetails:\n\t\t\t\t'The specified collection address could not be found in the marketplace configuration.',\n\t\t});\n\t}\n}\n\nexport class InvalidCurrencyOptionsError extends TransactionError {\n\toverride name = 'InvalidCurrencyOptionsError';\n\tconstructor(currencyOptions: Address[]) {\n\t\tsuper(`Invalid currency options: ${currencyOptions}`, {\n\t\t\tdetails:\n\t\t\t\t'The currency options must be an array of valid currency contract addresses.',\n\t\t});\n\t}\n}\n\nexport class ProjectNotFoundError extends TransactionError {\n\toverride name = 'ProjectNotFoundError';\n\tconstructor(projectId: string, url: string) {\n\t\tsuper('Project not found', {\n\t\t\tdetails: `Project id: ${projectId} not found at ${url}`,\n\t\t});\n\t}\n}\n\nexport class MarketplaceConfigFetchError extends TransactionError {\n\toverride name = 'MarketplaceConfigFetchError';\n\tconstructor(message: string) {\n\t\tsuper('Failed to fetch marketplace config', {\n\t\t\tdetails: message,\n\t\t});\n\t}\n}\n\nexport class MissingConfigError extends TransactionError {\n\toverride name = 'MissingConfigError';\n\tconstructor(configName: string) {\n\t\tsuper(`Missing required config: ${configName}`, {\n\t\t\tdetails: 'A required configuration parameter is missing.',\n\t\t});\n\t}\n}\n\nexport class TransactionValidationError extends TransactionError {\n\toverride name = 'TransactionValidationError';\n\tconstructor(reason: string) {\n\t\tsuper('Transaction validation failed', {\n\t\t\tdetails: reason,\n\t\t});\n\t}\n}\n\nexport class ChainIdUnavailableError extends TransactionError {\n\toverride name = 'ChainIdUnavailableError';\n\tconstructor() {\n\t\tsuper('Chain ID is not available', {\n\t\t\tdetails: 'Could not determine the current chain ID from the wallet.',\n\t\t});\n\t}\n}\n\nexport class TransactionReceiptError extends TransactionError {\n\toverride name = 'TransactionReceiptError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Failed to get transaction receipt for ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the transaction receipt from the network.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class PaymentModalTransactionError extends TransactionError {\n\toverride name = 'PaymentModalTransactionError';\n\tconstructor(hash: string, cause?: Error) {\n\t\tsuper(`Payment modal transaction failed for ${hash}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'The transaction initiated from the payment modal failed.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class CheckoutOptionsError extends TransactionError {\n\toverride name = 'CheckoutOptionsError';\n\tconstructor(cause?: Error) {\n\t\tsuper('Failed to get checkout options', {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the checkout options from the marketplace.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class OrdersFetchError extends TransactionError {\n\toverride name = 'OrdersFetchError';\n\tconstructor(orderId: string, cause?: Error) {\n\t\tsuper(`Failed to fetch order ${orderId}`, {\n\t\t\tdetails:\n\t\t\t\tcause?.message ||\n\t\t\t\t'Could not retrieve the order details from the marketplace.',\n\t\t\tcause,\n\t\t});\n\t}\n}\n\nexport class WalletInstanceNotFoundError extends TransactionError {\n\toverride name = 'WalletInstanceNotFoundError';\n\tconstructor() {\n\t\tsuper('Wallet instance not found', {\n\t\t\tdetails: 'The wallet instance is undefined',\n\t\t});\n\t}\n}\n\nexport type TransactionErrorTypes =\n\t| ChainIdUnavailableError\n\t| TransactionReceiptError\n\t| PaymentModalTransactionError\n\t| CheckoutOptionsError\n\t| OrdersFetchError\n\t| TransactionConfirmationError\n\t| TransactionValidationError\n\t| MissingConfigError\n\t| MarketplaceConfigFetchError\n\t| ProjectNotFoundError\n\t| CollectionNotFoundError\n\t| InvalidCurrencyOptionsError\n\t| InvalidContractTypeError\n\t| UnknownTransactionTypeError\n\t| NoStepsFoundError\n\t| NoExecutionStepError\n\t| UnexpectedStepsError\n\t| MissingPostStepError\n\t| InvalidSignatureStepError\n\t| MissingSignatureDataError\n\t| MissingStepDataError\n\t| OrderNotFoundError\n\t| TransactionConfirmationError\n\t| InvalidStepError\n\t| PaymentModalError\n\t| StepGenerationError\n\t| StepExecutionError\n\t| UserRejectedRequestError\n\t| NoMarketplaceConfigError\n\t| InsufficientFundsError\n\t| ChainSwitchUserRejectedError\n\t| ChainSwitchError\n\t| TransactionSignatureError\n\t| TransactionExecutionError\n\t| NoWalletConnectedError\n\t| TransactionError\n\t| WalletInstanceNotFoundError;\n"],"mappings":";;;AAQO,IAAM,YAAN,cAAwB,MAAM;AAAA,EACpC;AAAA,EACA;AAAA,EAEA,OAAO;AAAA,EAEP,YAAY,cAAsB,UAA4B,CAAC,GAAG;AACjE,UAAM;AAEN,UAAM,UAAU,aAAa,UAAU,QAAQ,UAAU;AACzD,SAAK,UAAU;AAAA,MACd,gBAAgB;AAAA,MAChB;AAAA,MACA,GAAI,UAAU,CAAC,YAAY,OAAO,EAAE,IAAI,CAAC;AAAA,IAC1C,EAAE,KAAK,IAAI;AAEX,QAAI,WAAW,WAAW,QAAQ,OAAO;AACxC,WAAK,QAAQ,QAAQ;AAAA,IACtB;AAEA,SAAK,UAAU,WAAW;AAC1B,SAAK,eAAe;AAAA,EACrB;AACD;;;ACzBO,IAAM,mBAAN,cAA+B,UAAU;AAAA,EACtC,OAAO;AACjB;AAEO,IAAM,mBAAN,cAA+B,iBAAiB;AAAA,EAC7C,OAAO;AAAA,EAChB,YAAY,gBAAwB,eAAuB;AAC1D;AAAA,MACC,iCAAiC,cAAc,OAAO,aAAa;AAAA,MACnE;AAAA,QACC,SACC;AAAA,MACF;AAAA,IACD;AAAA,EACD;AACD;AAEO,IAAM,+BAAN,cAA2C,iBAAiB;AAAA,EACzD,OAAO;AAAA,EAChB,cAAc;AACb,UAAM,8BAA8B;AAAA,MACnC,SAAS;AAAA,IACV,CAAC;AAAA,EACF;AACD;AAEO,IAAM,4BAAN,cAAwC,iBAAiB;AAAA,EACtD,OAAO;AAAA,EAChB,YAAY,QAAgB,OAAe;AAC1C,UAAM,uCAAuC,MAAM,IAAI;AAAA,MACtD,SACC,OAAO,WACP;AAAA,MACD;AAAA,IACD,CAAC;AAAA,EACF;AACD;AAEO,IAAM,4BAAN,cAAwC,iBAAiB;AAAA,EACtD,OAAO;AAAA,EAChB,YAA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;AAAA,IACV,CAAC;AAAA,EACF;AACD;AAEO,IAAM,qBAAN,cAAiC,iBAAiB;AAAA,EAC/C,OAAO;AAAA,EAChB,YAAY,YAAoB;AAC/B,UAAM,4BAA4B,UAAU,IAAI;AAAA,MAC/C,SAAS;AAAA,IACV,CAAC;AAAA,EACF;AACD;AAoEO,IAAM,8BAAN,cAA0C,iBAAiB;AAAA,EACxD,OAAO;AAAA,EAChB,cAAc;AACb,UAAM,6BAA6B;AAAA,MAClC,SAAS;AAAA,IACV,CAAC;AAAA,EACF;AACD;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
MissingConfigError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WM4RGBFQ.js";
|
|
5
5
|
|
|
6
6
|
// src/react/_internal/wagmi/create-config.ts
|
|
7
7
|
import { getDefaultChains } from "@0xsequence/kit";
|
|
@@ -180,4 +180,4 @@ export {
|
|
|
180
180
|
getUniversalConnectors,
|
|
181
181
|
createWagmiConfig
|
|
182
182
|
};
|
|
183
|
-
//# sourceMappingURL=chunk-
|
|
183
|
+
//# sourceMappingURL=chunk-ZEH4JI2U.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as wagmi from 'wagmi';
|
|
2
2
|
import { Chain, Transport } from 'viem';
|
|
3
|
-
import {
|
|
4
|
-
import { M as MarketplaceConfig } from './marketplace-config-
|
|
3
|
+
import { Q as SdkConfig } from './sdk-config-CasNGLz4.js';
|
|
4
|
+
import { M as MarketplaceConfig } from './marketplace-config-vioKvBQe.js';
|
|
5
5
|
|
|
6
6
|
declare const createWagmiConfig: (marketplaceConfig: MarketplaceConfig, sdkConfig: SdkConfig, ssr?: boolean) => wagmi.Config<[Chain, ...Chain[]], Record<number, Transport>, wagmi.CreateConnectorFn[]>;
|
|
7
7
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
export { q as Activity, y as AdditionalFee, A as Asset, L as CheckoutOptions, K as CheckoutOptionsItem, J as CheckoutOptionsMarketplaceOrder, v as Collectible, o as CollectibleOrder, f as CollectibleStatus, l as CollectiblesFilter, r as Collection, s as CollectionConfig, t as CollectionLastSynced, d as CollectionStatus, C as ContractType, D as CreateReq, w as Currency, I as Domain, E as ExecuteType, n as FeeBreakdown, F as Filter, G as GetOrdersInput, M as MarketplaceKind, m as Order, x as OrderData, p as OrderFilter, b as OrderSide, c as OrderStatus, O as OrderbookKind, i as Page, B as PostRequest, u as Project, e as ProjectStatus, k as PropertyFilter, P as PropertyType, H as Signature, j as SortBy, S as SortOrder, a as SourceKind, z as Step, g as StepType, h as TokenMetadata, T as TransactionCrypto, W as WalletKind } from './
|
|
2
|
-
export {
|
|
3
|
-
export { M as MarketplaceConfig } from './marketplace-config-0Rft6_Hv.js';
|
|
1
|
+
export { q as Activity, y as AdditionalFee, A as Asset, L as CheckoutOptions, K as CheckoutOptionsItem, J as CheckoutOptionsMarketplaceOrder, v as Collectible, o as CollectibleOrder, f as CollectibleStatus, l as CollectiblesFilter, r as Collection, s as CollectionConfig, t as CollectionLastSynced, d as CollectionStatus, C as ContractType, D as CreateReq, w as Currency, I as Domain, N as Env, E as ExecuteType, n as FeeBreakdown, F as Filter, G as GetOrdersInput, M as MarketplaceKind, m as Order, x as OrderData, p as OrderFilter, b as OrderSide, c as OrderStatus, O as OrderbookKind, i as Page, B as PostRequest, u as Project, e as ProjectStatus, k as PropertyFilter, P as PropertyType, Q as SdkConfig, H as Signature, j as SortBy, S as SortOrder, a as SourceKind, z as Step, g as StepType, h as TokenMetadata, T as TransactionCrypto, W as WalletKind } from './sdk-config-CasNGLz4.js';
|
|
2
|
+
export { M as MarketplaceConfig } from './marketplace-config-vioKvBQe.js';
|
|
4
3
|
export { Price } from './types/index.js';
|
|
5
4
|
export { EIP2981_ABI, SequenceMarketplaceV1_ABI, SequenceMarketplaceV2_ABI } from './utils/abi/marketplace/index.js';
|
|
6
5
|
export { ERC1155_ABI, ERC20_ABI, ERC721_ABI } from './utils/abi/token/index.js';
|
|
7
6
|
export { calculatePriceDifferencePercentage, compareAddress, getPresentableChainName, getPublicRpcClient, truncateEnd, truncateMiddle } from './utils/index.js';
|
|
8
7
|
import '@0xsequence/network';
|
|
9
8
|
import 'viem';
|
|
10
|
-
import './types-
|
|
9
|
+
import './types-rupsBCjv.js';
|
|
11
10
|
import 'zod';
|
|
12
11
|
|
|
13
12
|
declare const SEQUENCE_MARKET_V1_ADDRESS = "0xB537a160472183f2150d42EB1c3DD6684A55f74c";
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
getPublicRpcClient,
|
|
12
12
|
truncateEnd,
|
|
13
13
|
truncateMiddle
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-LTHX6RXH.js";
|
|
15
15
|
import "./chunk-MCI3KOSQ.js";
|
|
16
16
|
import {
|
|
17
17
|
EIP2981_ABI,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
ERC20_ABI,
|
|
24
24
|
ERC721_ABI
|
|
25
25
|
} from "./chunk-WFE6OCYF.js";
|
|
26
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-DNVERQ5J.js";
|
|
27
27
|
import {
|
|
28
28
|
CollectibleStatus,
|
|
29
29
|
CollectionStatus,
|
|
@@ -40,9 +40,9 @@ import {
|
|
|
40
40
|
StepType,
|
|
41
41
|
TransactionCrypto,
|
|
42
42
|
WalletKind
|
|
43
|
-
} from "./chunk-
|
|
44
|
-
import "./chunk-
|
|
45
|
-
import "./chunk-
|
|
43
|
+
} from "./chunk-QVOUL555.js";
|
|
44
|
+
import "./chunk-ZEH4JI2U.js";
|
|
45
|
+
import "./chunk-WM4RGBFQ.js";
|
|
46
46
|
export {
|
|
47
47
|
CollectibleStatus,
|
|
48
48
|
CollectionStatus,
|