@0xsequence/marketplace-sdk 0.0.1
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/README.md +8 -0
- package/dist/chunk-3TYUQEFM.js +115 -0
- package/dist/chunk-3TYUQEFM.js.map +1 -0
- package/dist/chunk-4ESPWOBV.js +13 -0
- package/dist/chunk-4ESPWOBV.js.map +1 -0
- package/dist/chunk-4PFMUVE4.js +78 -0
- package/dist/chunk-4PFMUVE4.js.map +1 -0
- package/dist/chunk-5WRI5ZAA.js +31 -0
- package/dist/chunk-5WRI5ZAA.js.map +1 -0
- package/dist/chunk-6S4FYXP6.js +43 -0
- package/dist/chunk-6S4FYXP6.js.map +1 -0
- package/dist/chunk-7OO74L2K.js +41 -0
- package/dist/chunk-7OO74L2K.js.map +1 -0
- package/dist/chunk-BBB3XUB4.js +213 -0
- package/dist/chunk-BBB3XUB4.js.map +1 -0
- package/dist/chunk-BCNFYVAL.js +1 -0
- package/dist/chunk-BCNFYVAL.js.map +1 -0
- package/dist/chunk-D7QQP6MS.js +2 -0
- package/dist/chunk-D7QQP6MS.js.map +1 -0
- package/dist/chunk-DBFOPEV6.js +23 -0
- package/dist/chunk-DBFOPEV6.js.map +1 -0
- package/dist/chunk-EDTC7UES.js +176 -0
- package/dist/chunk-EDTC7UES.js.map +1 -0
- package/dist/chunk-G3D572BT.js +249 -0
- package/dist/chunk-G3D572BT.js.map +1 -0
- package/dist/chunk-HGBEC3WX.js +1285 -0
- package/dist/chunk-HGBEC3WX.js.map +1 -0
- package/dist/chunk-MJ4YU7RW.js +2 -0
- package/dist/chunk-MJ4YU7RW.js.map +1 -0
- package/dist/chunk-NJ2GXOPW.js +2 -0
- package/dist/chunk-NJ2GXOPW.js.map +1 -0
- package/dist/chunk-O5JXKTWP.js +1029 -0
- package/dist/chunk-O5JXKTWP.js.map +1 -0
- package/dist/chunk-O642NH7U.js +15 -0
- package/dist/chunk-O642NH7U.js.map +1 -0
- package/dist/chunk-QOJXWHRZ.js +71 -0
- package/dist/chunk-QOJXWHRZ.js.map +1 -0
- package/dist/chunk-QVFMD6S2.js +21 -0
- package/dist/chunk-QVFMD6S2.js.map +1 -0
- package/dist/chunk-RNUHUVLC.js +214 -0
- package/dist/chunk-RNUHUVLC.js.map +1 -0
- package/dist/chunk-SM7V6ZWI.js +2740 -0
- package/dist/chunk-SM7V6ZWI.js.map +1 -0
- package/dist/chunk-STO74F2I.js +14 -0
- package/dist/chunk-STO74F2I.js.map +1 -0
- package/dist/chunk-TZGLKJRF.js +198 -0
- package/dist/chunk-TZGLKJRF.js.map +1 -0
- package/dist/chunk-UYRQ5MJQ.js +1027 -0
- package/dist/chunk-UYRQ5MJQ.js.map +1 -0
- package/dist/chunk-VPGWEMWL.js +162 -0
- package/dist/chunk-VPGWEMWL.js.map +1 -0
- package/dist/chunk-ZE2LNX65.js +394 -0
- package/dist/chunk-ZE2LNX65.js.map +1 -0
- package/dist/create-config-Dz0gCiQ0.d.ts +8 -0
- package/dist/get-query-client-D46hbjk6.d.ts +5 -0
- package/dist/index.css +232 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +76 -0
- package/dist/index.js.map +1 -0
- package/dist/marketplace-config-DZbtyrma.d.ts +57 -0
- package/dist/marketplace.gen-Ceofb9Cs.d.ts +904 -0
- package/dist/react/_internal/api/index.d.ts +51 -0
- package/dist/react/_internal/api/index.js +134 -0
- package/dist/react/_internal/api/index.js.map +1 -0
- package/dist/react/_internal/index.d.ts +22 -0
- package/dist/react/_internal/index.js +150 -0
- package/dist/react/_internal/index.js.map +1 -0
- package/dist/react/_internal/wagmi/index.d.ts +12 -0
- package/dist/react/_internal/wagmi/index.js +12 -0
- package/dist/react/_internal/wagmi/index.js.map +1 -0
- package/dist/react/hooks/index.d.ts +381 -0
- package/dist/react/hooks/index.js +82 -0
- package/dist/react/hooks/index.js.map +1 -0
- package/dist/react/index.css +233 -0
- package/dist/react/index.css.map +1 -0
- package/dist/react/index.d.ts +27 -0
- package/dist/react/index.js +113 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/ssr/index.d.ts +94 -0
- package/dist/react/ssr/index.js +351 -0
- package/dist/react/ssr/index.js.map +1 -0
- package/dist/react/ui/icons/index.css +25 -0
- package/dist/react/ui/icons/index.css.map +1 -0
- package/dist/react/ui/icons/index.d.ts +2 -0
- package/dist/react/ui/icons/index.js +12 -0
- package/dist/react/ui/icons/index.js.map +1 -0
- package/dist/react/ui/index.css +233 -0
- package/dist/react/ui/index.css.map +1 -0
- package/dist/react/ui/index.d.ts +112 -0
- package/dist/react/ui/index.js +34 -0
- package/dist/react/ui/index.js.map +1 -0
- package/dist/react/ui/modals/_internal/components/actionModal/index.css +44 -0
- package/dist/react/ui/modals/_internal/components/actionModal/index.css.map +1 -0
- package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +31 -0
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +39 -0
- package/dist/react/ui/modals/_internal/components/actionModal/index.js.map +1 -0
- package/dist/react/ui/styles/index.css +36 -0
- package/dist/react/ui/styles/index.css.map +1 -0
- package/dist/react/ui/styles/index.d.ts +5 -0
- package/dist/react/ui/styles/index.js +13 -0
- package/dist/react/ui/styles/index.js.map +1 -0
- package/dist/sdk-config-xWkdBdrL.d.ts +24 -0
- package/dist/services-BIwQ1C1c.d.ts +20 -0
- package/dist/styles/index.css +233 -0
- package/dist/styles/index.css.map +1 -0
- package/dist/styles/index.d.ts +58 -0
- package/dist/styles/index.js +5019 -0
- package/dist/styles/index.js.map +1 -0
- package/dist/styles.css-BVaTR5nO.d.ts +3 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.js +39 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types-BrAQ8-w4.d.ts +12 -0
- package/dist/utils/abi/abi/standard/index.d.ts +25 -0
- package/dist/utils/abi/abi/standard/index.js +8 -0
- package/dist/utils/abi/abi/standard/index.js.map +1 -0
- package/dist/utils/abi/abi/token/index.d.ts +1125 -0
- package/dist/utils/abi/abi/token/index.js +13 -0
- package/dist/utils/abi/abi/token/index.js.map +1 -0
- package/dist/utils/abi/clients/index.d.ts +27 -0
- package/dist/utils/abi/clients/index.js +13 -0
- package/dist/utils/abi/clients/index.js.map +1 -0
- package/dist/utils/index.d.ts +23 -0
- package/dist/utils/index.js +37 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +74 -0
- package/src/consts.ts +2 -0
- package/src/index.ts +3 -0
- package/src/react/_internal/api/get-query-client.ts +32 -0
- package/src/react/_internal/api/index.ts +5 -0
- package/src/react/_internal/api/marketplace-api.ts +31 -0
- package/src/react/_internal/api/marketplace.gen.ts +1911 -0
- package/src/react/_internal/api/query-keys.ts +61 -0
- package/src/react/_internal/api/services.ts +101 -0
- package/src/react/_internal/consts.ts +1 -0
- package/src/react/_internal/get-provider.ts +6 -0
- package/src/react/_internal/index.ts +5 -0
- package/src/react/_internal/types.ts +13 -0
- package/src/react/_internal/wagmi/create-config.ts +62 -0
- package/src/react/_internal/wagmi/embedded.ts +87 -0
- package/src/react/_internal/wagmi/index.ts +3 -0
- package/src/react/_internal/wagmi/universal.ts +82 -0
- package/src/react/hooks/index.ts +17 -0
- package/src/react/hooks/options/marketplaceConfigOptions.ts +62 -0
- package/src/react/hooks/useBalanceOfCollectible.tsx +51 -0
- package/src/react/hooks/useCollectible.tsx +47 -0
- package/src/react/hooks/useCollection.tsx +42 -0
- package/src/react/hooks/useCollectionCounts.tsx +61 -0
- package/src/react/hooks/useConfig.tsx +15 -0
- package/src/react/hooks/useCurrencies.tsx +76 -0
- package/src/react/hooks/useFilters.tsx +39 -0
- package/src/react/hooks/useFloorOrder.tsx +28 -0
- package/src/react/hooks/useGenerateListingTransaction.tsx +63 -0
- package/src/react/hooks/useGenerateOfferTransaction.tsx +60 -0
- package/src/react/hooks/useGenerateSellTransaction.tsx +43 -0
- package/src/react/hooks/useHighestOffer.tsx +46 -0
- package/src/react/hooks/useListBalances.tsx +56 -0
- package/src/react/hooks/useListCollectibles.tsx +54 -0
- package/src/react/hooks/useListOffersForCollectible.tsx +53 -0
- package/src/react/hooks/useLowestListing.tsx +47 -0
- package/src/react/hooks/useMarketplaceConfig.tsx +10 -0
- package/src/react/hooks/useRoyaltyPercentage.tsx +45 -0
- package/src/react/hooks/useTransferTokens.tsx +81 -0
- package/src/react/index.ts +5 -0
- package/src/react/provider.tsx +24 -0
- package/src/react/ssr/create-ssr-client.ts +31 -0
- package/src/react/ssr/index.ts +1 -0
- package/src/react/ui/icons/ArrowUp.tsx +29 -0
- package/src/react/ui/icons/CalendarIcon.tsx +29 -0
- package/src/react/ui/icons/InfoIcon.tsx +36 -0
- package/src/react/ui/icons/InventoryIcon.tsx +41 -0
- package/src/react/ui/icons/MinusIcon.tsx +31 -0
- package/src/react/ui/icons/PlusIcon.tsx +29 -0
- package/src/react/ui/icons/PositiveCircleIcon.tsx +35 -0
- package/src/react/ui/icons/index.ts +7 -0
- package/src/react/ui/icons/styles.css.ts +35 -0
- package/src/react/ui/index.ts +6 -0
- package/src/react/ui/modals/Account/index.tsx +29 -0
- package/src/react/ui/modals/CreateListingModal/_store.ts +326 -0
- package/src/react/ui/modals/CreateListingModal/_utils/getCreateListingTransactionTitleMessage.ts +30 -0
- package/src/react/ui/modals/CreateListingModal/index.tsx +146 -0
- package/src/react/ui/modals/MakeOfferModal/_store.ts +296 -0
- package/src/react/ui/modals/MakeOfferModal/_utils/getMakeOfferTransactionTitleMessage.ts +28 -0
- package/src/react/ui/modals/MakeOfferModal/index.tsx +157 -0
- package/src/react/ui/modals/SellModal/_store.ts +274 -0
- package/src/react/ui/modals/SellModal/_utils/getSellTransactionTitleMessage.ts +28 -0
- package/src/react/ui/modals/SellModal/index.tsx +126 -0
- package/src/react/ui/modals/SellModal/utils.ts +38 -0
- package/src/react/ui/modals/SuccessfulPurchaseModal/_store.ts +58 -0
- package/src/react/ui/modals/SuccessfulPurchaseModal/index.tsx +186 -0
- package/src/react/ui/modals/SuccessfulPurchaseModal/styles.css.ts +52 -0
- package/src/react/ui/modals/TransferModal/_store.ts +58 -0
- package/src/react/ui/modals/TransferModal/_utils/getTransferTransactionTitleMessage.ts +28 -0
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx +102 -0
- package/src/react/ui/modals/TransferModal/_views/followWalletInstructions/index.tsx +130 -0
- package/src/react/ui/modals/TransferModal/index.tsx +92 -0
- package/src/react/ui/modals/TransferModal/messages.ts +14 -0
- package/src/react/ui/modals/TransferModal/styles.css.ts +20 -0
- package/src/react/ui/modals/_internal/components/actionModal/ActionModal.tsx +94 -0
- package/src/react/ui/modals/_internal/components/actionModal/index.ts +3 -0
- package/src/react/ui/modals/_internal/components/actionModal/store.ts +19 -0
- package/src/react/ui/modals/_internal/components/actionModal/styles.css.ts +15 -0
- package/src/react/ui/modals/_internal/components/alertMessage/index.tsx +21 -0
- package/src/react/ui/modals/_internal/components/alertMessage/styles.css.ts +22 -0
- package/src/react/ui/modals/_internal/components/calendar/index.tsx +59 -0
- package/src/react/ui/modals/_internal/components/calendarPopover/index.tsx +41 -0
- package/src/react/ui/modals/_internal/components/calendarPopover/styles.css.ts +16 -0
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/index.tsx +76 -0
- package/src/react/ui/modals/_internal/components/currencyOptionsSelect/styles.css.ts +33 -0
- package/src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx +127 -0
- package/src/react/ui/modals/_internal/components/expirationDateSelect/styles.css.ts +25 -0
- package/src/react/ui/modals/_internal/components/floorPriceText/index.tsx +54 -0
- package/src/react/ui/modals/_internal/components/priceInput/index.tsx +72 -0
- package/src/react/ui/modals/_internal/components/priceInput/styles.css.ts +23 -0
- package/src/react/ui/modals/_internal/components/priceInput/types.ts +4 -0
- package/src/react/ui/modals/_internal/components/quantityInput/index.tsx +168 -0
- package/src/react/ui/modals/_internal/components/quantityInput/styles.css.ts +30 -0
- package/src/react/ui/modals/_internal/components/switchChainModal/index.tsx +132 -0
- package/src/react/ui/modals/_internal/components/switchChainModal/store.ts +41 -0
- package/src/react/ui/modals/_internal/components/switchChainModal/styles.css.ts +37 -0
- package/src/react/ui/modals/_internal/components/timeAgo/index.tsx +32 -0
- package/src/react/ui/modals/_internal/components/tokenPreview/index.tsx +58 -0
- package/src/react/ui/modals/_internal/components/tokenPreview/styles.css.ts +11 -0
- package/src/react/ui/modals/_internal/components/transaction-footer/index.tsx +48 -0
- package/src/react/ui/modals/_internal/components/transactionDetails/index.tsx +80 -0
- package/src/react/ui/modals/_internal/components/transactionHeader/index.tsx +30 -0
- package/src/react/ui/modals/_internal/components/transactionPreview/consts.ts +27 -0
- package/src/react/ui/modals/_internal/components/transactionPreview/index.tsx +111 -0
- package/src/react/ui/modals/_internal/components/transactionPreview/useTransactionPreviewTitle.tsx +24 -0
- package/src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx +123 -0
- package/src/react/ui/modals/_internal/components/transactionStatusModal/store.ts +87 -0
- package/src/react/ui/modals/_internal/components/transactionStatusModal/styles.css.ts +15 -0
- package/src/react/ui/modals/_internal/stores/accountModal.ts +3 -0
- package/src/react/ui/modals/modal-provider.tsx +27 -0
- package/src/react/ui/styles/index.ts +1 -0
- package/src/react/ui/styles/modal.css.ts +73 -0
- package/src/styles/index.ts +18 -0
- package/src/types/api-types.ts +48 -0
- package/src/types/index.ts +4 -0
- package/src/types/marketplace-config.ts +63 -0
- package/src/types/messages.ts +43 -0
- package/src/types/sdk-config.ts +23 -0
- package/src/types/types.ts +6 -0
- package/src/utils/abi/abi/standard/EIP2981.ts +15 -0
- package/src/utils/abi/abi/standard/index.ts +1 -0
- package/src/utils/abi/abi/token/ERC1155.ts +324 -0
- package/src/utils/abi/abi/token/ERC20.ts +185 -0
- package/src/utils/abi/abi/token/ERC721.ts +506 -0
- package/src/utils/abi/abi/token/index.ts +3 -0
- package/src/utils/abi/clients/ERC1155.ts +82 -0
- package/src/utils/abi/clients/ERC20.ts +101 -0
- package/src/utils/abi/clients/ERC721.ts +97 -0
- package/src/utils/abi/clients/index.ts +3 -0
- package/src/utils/address.ts +26 -0
- package/src/utils/get-public-rpc-client.ts +32 -0
- package/src/utils/index.ts +6 -0
- package/src/utils/network.ts +5 -0
- package/src/utils/price.ts +21 -0
|
@@ -0,0 +1,1285 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
// src/react/_internal/api/get-query-client.ts
|
|
4
|
+
import {
|
|
5
|
+
QueryClient,
|
|
6
|
+
defaultShouldDehydrateQuery
|
|
7
|
+
} from "@tanstack/react-query";
|
|
8
|
+
import { hashFn } from "wagmi/query";
|
|
9
|
+
function makeQueryClient() {
|
|
10
|
+
return new QueryClient({
|
|
11
|
+
defaultOptions: {
|
|
12
|
+
queries: {
|
|
13
|
+
staleTime: 60 * 1e3,
|
|
14
|
+
queryKeyHashFn: hashFn
|
|
15
|
+
},
|
|
16
|
+
dehydrate: {
|
|
17
|
+
shouldDehydrateQuery: (query) => defaultShouldDehydrateQuery(query) || query.state.status === "pending"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
var browserQueryClient = void 0;
|
|
23
|
+
function getQueryClient() {
|
|
24
|
+
if (typeof globalThis.document === "undefined") {
|
|
25
|
+
return makeQueryClient();
|
|
26
|
+
} else {
|
|
27
|
+
if (!browserQueryClient) browserQueryClient = makeQueryClient();
|
|
28
|
+
return browserQueryClient;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// src/react/_internal/api/marketplace.gen.ts
|
|
33
|
+
var WebrpcHeader = "Webrpc";
|
|
34
|
+
var WebrpcHeaderValue = "webrpc@v0.21.0;gen-typescript@v0.15.0;marketplace-api@v0.0.0-272a2d3c9208fb21b84c88a2a8cbd9ab8e29964d";
|
|
35
|
+
var WebRPCVersion = "v1";
|
|
36
|
+
var WebRPCSchemaVersion = "";
|
|
37
|
+
var WebRPCSchemaHash = "272a2d3c9208fb21b84c88a2a8cbd9ab8e29964d";
|
|
38
|
+
function VersionFromHeader(headers) {
|
|
39
|
+
const headerValue = headers.get(WebrpcHeader);
|
|
40
|
+
if (!headerValue) {
|
|
41
|
+
return {
|
|
42
|
+
webrpcGenVersion: "",
|
|
43
|
+
codeGenName: "",
|
|
44
|
+
codeGenVersion: "",
|
|
45
|
+
schemaName: "",
|
|
46
|
+
schemaVersion: ""
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return parseWebrpcGenVersions(headerValue);
|
|
50
|
+
}
|
|
51
|
+
function parseWebrpcGenVersions(header) {
|
|
52
|
+
const versions = header.split(";");
|
|
53
|
+
if (versions.length < 3) {
|
|
54
|
+
return {
|
|
55
|
+
webrpcGenVersion: "",
|
|
56
|
+
codeGenName: "",
|
|
57
|
+
codeGenVersion: "",
|
|
58
|
+
schemaName: "",
|
|
59
|
+
schemaVersion: ""
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
const [_, webrpcGenVersion] = versions[0].split("@");
|
|
63
|
+
const [codeGenName, codeGenVersion] = versions[1].split("@");
|
|
64
|
+
const [schemaName, schemaVersion] = versions[2].split("@");
|
|
65
|
+
return {
|
|
66
|
+
webrpcGenVersion,
|
|
67
|
+
codeGenName,
|
|
68
|
+
codeGenVersion,
|
|
69
|
+
schemaName,
|
|
70
|
+
schemaVersion
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
|
|
74
|
+
SortOrder2["DESC"] = "DESC";
|
|
75
|
+
SortOrder2["ASC"] = "ASC";
|
|
76
|
+
return SortOrder2;
|
|
77
|
+
})(SortOrder || {});
|
|
78
|
+
var PropertyType = /* @__PURE__ */ ((PropertyType2) => {
|
|
79
|
+
PropertyType2["INT"] = "INT";
|
|
80
|
+
PropertyType2["STRING"] = "STRING";
|
|
81
|
+
PropertyType2["ARRAY"] = "ARRAY";
|
|
82
|
+
PropertyType2["GENERIC"] = "GENERIC";
|
|
83
|
+
return PropertyType2;
|
|
84
|
+
})(PropertyType || {});
|
|
85
|
+
var MarketplaceKind = /* @__PURE__ */ ((MarketplaceKind2) => {
|
|
86
|
+
MarketplaceKind2["unknown"] = "unknown";
|
|
87
|
+
MarketplaceKind2["sequence_marketplace_v1"] = "sequence_marketplace_v1";
|
|
88
|
+
MarketplaceKind2["sequence_marketplace_v2"] = "sequence_marketplace_v2";
|
|
89
|
+
MarketplaceKind2["opensea"] = "opensea";
|
|
90
|
+
MarketplaceKind2["magic_eden"] = "magic_eden";
|
|
91
|
+
MarketplaceKind2["mintify"] = "mintify";
|
|
92
|
+
MarketplaceKind2["looks_rare"] = "looks_rare";
|
|
93
|
+
MarketplaceKind2["x2y2"] = "x2y2";
|
|
94
|
+
MarketplaceKind2["sudo_swap"] = "sudo_swap";
|
|
95
|
+
MarketplaceKind2["coinbase"] = "coinbase";
|
|
96
|
+
MarketplaceKind2["rarible"] = "rarible";
|
|
97
|
+
MarketplaceKind2["nftx"] = "nftx";
|
|
98
|
+
MarketplaceKind2["foundation"] = "foundation";
|
|
99
|
+
MarketplaceKind2["manifold"] = "manifold";
|
|
100
|
+
MarketplaceKind2["zora"] = "zora";
|
|
101
|
+
MarketplaceKind2["blur"] = "blur";
|
|
102
|
+
MarketplaceKind2["super_rare"] = "super_rare";
|
|
103
|
+
MarketplaceKind2["okx"] = "okx";
|
|
104
|
+
MarketplaceKind2["element"] = "element";
|
|
105
|
+
MarketplaceKind2["aqua_xyz"] = "aqua_xyz";
|
|
106
|
+
MarketplaceKind2["auranft_co"] = "auranft_co";
|
|
107
|
+
return MarketplaceKind2;
|
|
108
|
+
})(MarketplaceKind || {});
|
|
109
|
+
var OrderbookKind = /* @__PURE__ */ ((OrderbookKind2) => {
|
|
110
|
+
OrderbookKind2["unknown"] = "unknown";
|
|
111
|
+
OrderbookKind2["sequence_marketplace_v1"] = "sequence_marketplace_v1";
|
|
112
|
+
OrderbookKind2["sequence_marketplace_v2"] = "sequence_marketplace_v2";
|
|
113
|
+
OrderbookKind2["blur"] = "blur";
|
|
114
|
+
OrderbookKind2["opensea"] = "opensea";
|
|
115
|
+
OrderbookKind2["looks_rare"] = "looks_rare";
|
|
116
|
+
OrderbookKind2["reservoir"] = "reservoir";
|
|
117
|
+
OrderbookKind2["x2y2"] = "x2y2";
|
|
118
|
+
return OrderbookKind2;
|
|
119
|
+
})(OrderbookKind || {});
|
|
120
|
+
var SourceKind = /* @__PURE__ */ ((SourceKind2) => {
|
|
121
|
+
SourceKind2["unknown"] = "unknown";
|
|
122
|
+
SourceKind2["external"] = "external";
|
|
123
|
+
SourceKind2["sequence_marketplace_v1"] = "sequence_marketplace_v1";
|
|
124
|
+
SourceKind2["sequence_marketplace_v2"] = "sequence_marketplace_v2";
|
|
125
|
+
return SourceKind2;
|
|
126
|
+
})(SourceKind || {});
|
|
127
|
+
var OrderSide = /* @__PURE__ */ ((OrderSide2) => {
|
|
128
|
+
OrderSide2["unknown"] = "unknown";
|
|
129
|
+
OrderSide2["listing"] = "listing";
|
|
130
|
+
OrderSide2["offer"] = "offer";
|
|
131
|
+
return OrderSide2;
|
|
132
|
+
})(OrderSide || {});
|
|
133
|
+
var OrderStatus = /* @__PURE__ */ ((OrderStatus2) => {
|
|
134
|
+
OrderStatus2["unknown"] = "unknown";
|
|
135
|
+
OrderStatus2["active"] = "active";
|
|
136
|
+
OrderStatus2["inactive"] = "inactive";
|
|
137
|
+
OrderStatus2["expired"] = "expired";
|
|
138
|
+
OrderStatus2["cancelled"] = "cancelled";
|
|
139
|
+
OrderStatus2["filled"] = "filled";
|
|
140
|
+
return OrderStatus2;
|
|
141
|
+
})(OrderStatus || {});
|
|
142
|
+
var ContractType = /* @__PURE__ */ ((ContractType2) => {
|
|
143
|
+
ContractType2["UNKNOWN"] = "UNKNOWN";
|
|
144
|
+
ContractType2["ERC20"] = "ERC20";
|
|
145
|
+
ContractType2["ERC721"] = "ERC721";
|
|
146
|
+
ContractType2["ERC1155"] = "ERC1155";
|
|
147
|
+
return ContractType2;
|
|
148
|
+
})(ContractType || {});
|
|
149
|
+
var CollectionStatus = /* @__PURE__ */ ((CollectionStatus2) => {
|
|
150
|
+
CollectionStatus2["unknown"] = "unknown";
|
|
151
|
+
CollectionStatus2["created"] = "created";
|
|
152
|
+
CollectionStatus2["syncing_metadata"] = "syncing_metadata";
|
|
153
|
+
CollectionStatus2["synced_metadata"] = "synced_metadata";
|
|
154
|
+
CollectionStatus2["syncing_tokens"] = "syncing_tokens";
|
|
155
|
+
CollectionStatus2["synced_tokens"] = "synced_tokens";
|
|
156
|
+
CollectionStatus2["syncing_orders"] = "syncing_orders";
|
|
157
|
+
CollectionStatus2["active"] = "active";
|
|
158
|
+
CollectionStatus2["failed"] = "failed";
|
|
159
|
+
CollectionStatus2["inactive"] = "inactive";
|
|
160
|
+
return CollectionStatus2;
|
|
161
|
+
})(CollectionStatus || {});
|
|
162
|
+
var ProjectStatus = /* @__PURE__ */ ((ProjectStatus2) => {
|
|
163
|
+
ProjectStatus2["unknown"] = "unknown";
|
|
164
|
+
ProjectStatus2["active"] = "active";
|
|
165
|
+
ProjectStatus2["inactive"] = "inactive";
|
|
166
|
+
return ProjectStatus2;
|
|
167
|
+
})(ProjectStatus || {});
|
|
168
|
+
var CollectibleStatus = /* @__PURE__ */ ((CollectibleStatus2) => {
|
|
169
|
+
CollectibleStatus2["unknown"] = "unknown";
|
|
170
|
+
CollectibleStatus2["active"] = "active";
|
|
171
|
+
CollectibleStatus2["inactive"] = "inactive";
|
|
172
|
+
return CollectibleStatus2;
|
|
173
|
+
})(CollectibleStatus || {});
|
|
174
|
+
var WalletKind = /* @__PURE__ */ ((WalletKind2) => {
|
|
175
|
+
WalletKind2["unknown"] = "unknown";
|
|
176
|
+
WalletKind2["sequence"] = "sequence";
|
|
177
|
+
return WalletKind2;
|
|
178
|
+
})(WalletKind || {});
|
|
179
|
+
var StepType = /* @__PURE__ */ ((StepType2) => {
|
|
180
|
+
StepType2["unknown"] = "unknown";
|
|
181
|
+
StepType2["tokenApproval"] = "tokenApproval";
|
|
182
|
+
StepType2["buy"] = "buy";
|
|
183
|
+
StepType2["sell"] = "sell";
|
|
184
|
+
StepType2["createListing"] = "createListing";
|
|
185
|
+
StepType2["createOffer"] = "createOffer";
|
|
186
|
+
StepType2["signEIP712"] = "signEIP712";
|
|
187
|
+
StepType2["signEIP191"] = "signEIP191";
|
|
188
|
+
return StepType2;
|
|
189
|
+
})(StepType || {});
|
|
190
|
+
var TransactionCrypto = /* @__PURE__ */ ((TransactionCrypto2) => {
|
|
191
|
+
TransactionCrypto2["none"] = "none";
|
|
192
|
+
TransactionCrypto2["partially"] = "partially";
|
|
193
|
+
TransactionCrypto2["all"] = "all";
|
|
194
|
+
return TransactionCrypto2;
|
|
195
|
+
})(TransactionCrypto || {});
|
|
196
|
+
var TransactionNFTCheckoutProvider = /* @__PURE__ */ ((TransactionNFTCheckoutProvider2) => {
|
|
197
|
+
TransactionNFTCheckoutProvider2["unknown"] = "unknown";
|
|
198
|
+
TransactionNFTCheckoutProvider2["sardine"] = "sardine";
|
|
199
|
+
TransactionNFTCheckoutProvider2["transak"] = "transak";
|
|
200
|
+
return TransactionNFTCheckoutProvider2;
|
|
201
|
+
})(TransactionNFTCheckoutProvider || {});
|
|
202
|
+
var TransactionOnRampProvider = /* @__PURE__ */ ((TransactionOnRampProvider2) => {
|
|
203
|
+
TransactionOnRampProvider2["unknown"] = "unknown";
|
|
204
|
+
TransactionOnRampProvider2["sardine"] = "sardine";
|
|
205
|
+
TransactionOnRampProvider2["transak"] = "transak";
|
|
206
|
+
return TransactionOnRampProvider2;
|
|
207
|
+
})(TransactionOnRampProvider || {});
|
|
208
|
+
var TransactionSwapProvider = /* @__PURE__ */ ((TransactionSwapProvider2) => {
|
|
209
|
+
TransactionSwapProvider2["unknown"] = "unknown";
|
|
210
|
+
TransactionSwapProvider2["zerox"] = "zerox";
|
|
211
|
+
return TransactionSwapProvider2;
|
|
212
|
+
})(TransactionSwapProvider || {});
|
|
213
|
+
var ExecuteType = /* @__PURE__ */ ((ExecuteType2) => {
|
|
214
|
+
ExecuteType2["unknown"] = "unknown";
|
|
215
|
+
ExecuteType2["order"] = "order";
|
|
216
|
+
return ExecuteType2;
|
|
217
|
+
})(ExecuteType || {});
|
|
218
|
+
var Admin = class {
|
|
219
|
+
hostname;
|
|
220
|
+
fetch;
|
|
221
|
+
path = "/rpc/Admin/";
|
|
222
|
+
constructor(hostname, fetch2) {
|
|
223
|
+
this.hostname = hostname.replace(/\/*$/, "");
|
|
224
|
+
this.fetch = (input, init) => fetch2(input, init);
|
|
225
|
+
}
|
|
226
|
+
url(name) {
|
|
227
|
+
return this.hostname + this.path + name;
|
|
228
|
+
}
|
|
229
|
+
createCollection = (args, headers, signal) => {
|
|
230
|
+
return this.fetch(
|
|
231
|
+
this.url("CreateCollection"),
|
|
232
|
+
createHTTPRequest(args, headers, signal)
|
|
233
|
+
).then((res) => {
|
|
234
|
+
return buildResponse(res).then((_data) => {
|
|
235
|
+
return {
|
|
236
|
+
collection: _data.collection
|
|
237
|
+
};
|
|
238
|
+
});
|
|
239
|
+
}, (error) => {
|
|
240
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
241
|
+
});
|
|
242
|
+
};
|
|
243
|
+
getCollection = (args, headers, signal) => {
|
|
244
|
+
return this.fetch(
|
|
245
|
+
this.url("GetCollection"),
|
|
246
|
+
createHTTPRequest(args, headers, signal)
|
|
247
|
+
).then((res) => {
|
|
248
|
+
return buildResponse(res).then((_data) => {
|
|
249
|
+
return {
|
|
250
|
+
collection: _data.collection
|
|
251
|
+
};
|
|
252
|
+
});
|
|
253
|
+
}, (error) => {
|
|
254
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
255
|
+
});
|
|
256
|
+
};
|
|
257
|
+
listCollections = (args, headers, signal) => {
|
|
258
|
+
return this.fetch(
|
|
259
|
+
this.url("ListCollections"),
|
|
260
|
+
createHTTPRequest(args, headers, signal)
|
|
261
|
+
).then((res) => {
|
|
262
|
+
return buildResponse(res).then((_data) => {
|
|
263
|
+
return {
|
|
264
|
+
collections: _data.collections,
|
|
265
|
+
page: _data.page
|
|
266
|
+
};
|
|
267
|
+
});
|
|
268
|
+
}, (error) => {
|
|
269
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
270
|
+
});
|
|
271
|
+
};
|
|
272
|
+
deleteCollection = (args, headers, signal) => {
|
|
273
|
+
return this.fetch(
|
|
274
|
+
this.url("DeleteCollection"),
|
|
275
|
+
createHTTPRequest(args, headers, signal)
|
|
276
|
+
).then((res) => {
|
|
277
|
+
return buildResponse(res).then((_data) => {
|
|
278
|
+
return {
|
|
279
|
+
collection: _data.collection
|
|
280
|
+
};
|
|
281
|
+
});
|
|
282
|
+
}, (error) => {
|
|
283
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
284
|
+
});
|
|
285
|
+
};
|
|
286
|
+
syncCollection = (args, headers, signal) => {
|
|
287
|
+
return this.fetch(
|
|
288
|
+
this.url("SyncCollection"),
|
|
289
|
+
createHTTPRequest(args, headers, signal)
|
|
290
|
+
).then((res) => {
|
|
291
|
+
return buildResponse(res).then((_data) => {
|
|
292
|
+
return {
|
|
293
|
+
collection: _data.collection
|
|
294
|
+
};
|
|
295
|
+
});
|
|
296
|
+
}, (error) => {
|
|
297
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
298
|
+
});
|
|
299
|
+
};
|
|
300
|
+
createCurrency = (args, headers, signal) => {
|
|
301
|
+
return this.fetch(
|
|
302
|
+
this.url("CreateCurrency"),
|
|
303
|
+
createHTTPRequest(args, headers, signal)
|
|
304
|
+
).then((res) => {
|
|
305
|
+
return buildResponse(res).then((_data) => {
|
|
306
|
+
return {
|
|
307
|
+
currency: _data.currency
|
|
308
|
+
};
|
|
309
|
+
});
|
|
310
|
+
}, (error) => {
|
|
311
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
312
|
+
});
|
|
313
|
+
};
|
|
314
|
+
createCurrencies = (args, headers, signal) => {
|
|
315
|
+
return this.fetch(
|
|
316
|
+
this.url("CreateCurrencies"),
|
|
317
|
+
createHTTPRequest(args, headers, signal)
|
|
318
|
+
).then((res) => {
|
|
319
|
+
return buildResponse(res).then((_data) => {
|
|
320
|
+
return {
|
|
321
|
+
currency: _data.currency
|
|
322
|
+
};
|
|
323
|
+
});
|
|
324
|
+
}, (error) => {
|
|
325
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
326
|
+
});
|
|
327
|
+
};
|
|
328
|
+
updateCurrency = (args, headers, signal) => {
|
|
329
|
+
return this.fetch(
|
|
330
|
+
this.url("UpdateCurrency"),
|
|
331
|
+
createHTTPRequest(args, headers, signal)
|
|
332
|
+
).then((res) => {
|
|
333
|
+
return buildResponse(res).then((_data) => {
|
|
334
|
+
return {
|
|
335
|
+
currency: _data.currency
|
|
336
|
+
};
|
|
337
|
+
});
|
|
338
|
+
}, (error) => {
|
|
339
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
340
|
+
});
|
|
341
|
+
};
|
|
342
|
+
listCurrencies = (headers, signal) => {
|
|
343
|
+
return this.fetch(
|
|
344
|
+
this.url("ListCurrencies"),
|
|
345
|
+
createHTTPRequest({}, headers, signal)
|
|
346
|
+
).then((res) => {
|
|
347
|
+
return buildResponse(res).then((_data) => {
|
|
348
|
+
return {
|
|
349
|
+
currencies: _data.currencies
|
|
350
|
+
};
|
|
351
|
+
});
|
|
352
|
+
}, (error) => {
|
|
353
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
354
|
+
});
|
|
355
|
+
};
|
|
356
|
+
deleteCurrency = (args, headers, signal) => {
|
|
357
|
+
return this.fetch(
|
|
358
|
+
this.url("DeleteCurrency"),
|
|
359
|
+
createHTTPRequest(args, headers, signal)
|
|
360
|
+
).then((res) => {
|
|
361
|
+
return buildResponse(res).then((_data) => {
|
|
362
|
+
return {
|
|
363
|
+
currency: _data.currency
|
|
364
|
+
};
|
|
365
|
+
});
|
|
366
|
+
}, (error) => {
|
|
367
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
368
|
+
});
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
var Marketplace = class {
|
|
372
|
+
hostname;
|
|
373
|
+
fetch;
|
|
374
|
+
path = "/rpc/Marketplace/";
|
|
375
|
+
constructor(hostname, fetch2) {
|
|
376
|
+
this.hostname = hostname.replace(/\/*$/, "");
|
|
377
|
+
this.fetch = (input, init) => fetch2(input, init);
|
|
378
|
+
}
|
|
379
|
+
url(name) {
|
|
380
|
+
return this.hostname + this.path + name;
|
|
381
|
+
}
|
|
382
|
+
listCurrencies = (headers, signal) => {
|
|
383
|
+
return this.fetch(
|
|
384
|
+
this.url("ListCurrencies"),
|
|
385
|
+
createHTTPRequest({}, headers, signal)
|
|
386
|
+
).then((res) => {
|
|
387
|
+
return buildResponse(res).then((_data) => {
|
|
388
|
+
return {
|
|
389
|
+
currencies: _data.currencies
|
|
390
|
+
};
|
|
391
|
+
});
|
|
392
|
+
}, (error) => {
|
|
393
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
394
|
+
});
|
|
395
|
+
};
|
|
396
|
+
getCollectible = (args, headers, signal) => {
|
|
397
|
+
return this.fetch(
|
|
398
|
+
this.url("GetCollectible"),
|
|
399
|
+
createHTTPRequest(args, headers, signal)
|
|
400
|
+
).then((res) => {
|
|
401
|
+
return buildResponse(res).then((_data) => {
|
|
402
|
+
return {
|
|
403
|
+
metadata: _data.metadata
|
|
404
|
+
};
|
|
405
|
+
});
|
|
406
|
+
}, (error) => {
|
|
407
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
408
|
+
});
|
|
409
|
+
};
|
|
410
|
+
getLowestPriceOfferForCollectible = (args, headers, signal) => {
|
|
411
|
+
return this.fetch(
|
|
412
|
+
this.url("GetLowestPriceOfferForCollectible"),
|
|
413
|
+
createHTTPRequest(args, headers, signal)
|
|
414
|
+
).then((res) => {
|
|
415
|
+
return buildResponse(res).then((_data) => {
|
|
416
|
+
return {
|
|
417
|
+
order: _data.order
|
|
418
|
+
};
|
|
419
|
+
});
|
|
420
|
+
}, (error) => {
|
|
421
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
422
|
+
});
|
|
423
|
+
};
|
|
424
|
+
getHighestPriceOfferForCollectible = (args, headers, signal) => {
|
|
425
|
+
return this.fetch(
|
|
426
|
+
this.url("GetHighestPriceOfferForCollectible"),
|
|
427
|
+
createHTTPRequest(args, headers, signal)
|
|
428
|
+
).then((res) => {
|
|
429
|
+
return buildResponse(res).then((_data) => {
|
|
430
|
+
return {
|
|
431
|
+
order: _data.order
|
|
432
|
+
};
|
|
433
|
+
});
|
|
434
|
+
}, (error) => {
|
|
435
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
436
|
+
});
|
|
437
|
+
};
|
|
438
|
+
getLowestPriceListingForCollectible = (args, headers, signal) => {
|
|
439
|
+
return this.fetch(
|
|
440
|
+
this.url("GetLowestPriceListingForCollectible"),
|
|
441
|
+
createHTTPRequest(args, headers, signal)
|
|
442
|
+
).then((res) => {
|
|
443
|
+
return buildResponse(res).then((_data) => {
|
|
444
|
+
return {
|
|
445
|
+
order: _data.order
|
|
446
|
+
};
|
|
447
|
+
});
|
|
448
|
+
}, (error) => {
|
|
449
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
450
|
+
});
|
|
451
|
+
};
|
|
452
|
+
getHighestPriceListingForCollectible = (args, headers, signal) => {
|
|
453
|
+
return this.fetch(
|
|
454
|
+
this.url("GetHighestPriceListingForCollectible"),
|
|
455
|
+
createHTTPRequest(args, headers, signal)
|
|
456
|
+
).then((res) => {
|
|
457
|
+
return buildResponse(res).then((_data) => {
|
|
458
|
+
return {
|
|
459
|
+
order: _data.order
|
|
460
|
+
};
|
|
461
|
+
});
|
|
462
|
+
}, (error) => {
|
|
463
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
464
|
+
});
|
|
465
|
+
};
|
|
466
|
+
listListingsForCollectible = (args, headers, signal) => {
|
|
467
|
+
return this.fetch(
|
|
468
|
+
this.url("ListListingsForCollectible"),
|
|
469
|
+
createHTTPRequest(args, headers, signal)
|
|
470
|
+
).then((res) => {
|
|
471
|
+
return buildResponse(res).then((_data) => {
|
|
472
|
+
return {
|
|
473
|
+
listings: _data.listings,
|
|
474
|
+
page: _data.page
|
|
475
|
+
};
|
|
476
|
+
});
|
|
477
|
+
}, (error) => {
|
|
478
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
479
|
+
});
|
|
480
|
+
};
|
|
481
|
+
listOffersForCollectible = (args, headers, signal) => {
|
|
482
|
+
return this.fetch(
|
|
483
|
+
this.url("ListOffersForCollectible"),
|
|
484
|
+
createHTTPRequest(args, headers, signal)
|
|
485
|
+
).then((res) => {
|
|
486
|
+
return buildResponse(res).then((_data) => {
|
|
487
|
+
return {
|
|
488
|
+
offers: _data.offers,
|
|
489
|
+
page: _data.page
|
|
490
|
+
};
|
|
491
|
+
});
|
|
492
|
+
}, (error) => {
|
|
493
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
494
|
+
});
|
|
495
|
+
};
|
|
496
|
+
getCollectibleLowestOffer = (args, headers, signal) => {
|
|
497
|
+
return this.fetch(
|
|
498
|
+
this.url("GetCollectibleLowestOffer"),
|
|
499
|
+
createHTTPRequest(args, headers, signal)
|
|
500
|
+
).then((res) => {
|
|
501
|
+
return buildResponse(res).then((_data) => {
|
|
502
|
+
return {
|
|
503
|
+
order: _data.order
|
|
504
|
+
};
|
|
505
|
+
});
|
|
506
|
+
}, (error) => {
|
|
507
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
508
|
+
});
|
|
509
|
+
};
|
|
510
|
+
getCollectibleHighestOffer = (args, headers, signal) => {
|
|
511
|
+
return this.fetch(
|
|
512
|
+
this.url("GetCollectibleHighestOffer"),
|
|
513
|
+
createHTTPRequest(args, headers, signal)
|
|
514
|
+
).then((res) => {
|
|
515
|
+
return buildResponse(res).then((_data) => {
|
|
516
|
+
return {
|
|
517
|
+
order: _data.order
|
|
518
|
+
};
|
|
519
|
+
});
|
|
520
|
+
}, (error) => {
|
|
521
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
522
|
+
});
|
|
523
|
+
};
|
|
524
|
+
getCollectibleLowestListing = (args, headers, signal) => {
|
|
525
|
+
return this.fetch(
|
|
526
|
+
this.url("GetCollectibleLowestListing"),
|
|
527
|
+
createHTTPRequest(args, headers, signal)
|
|
528
|
+
).then((res) => {
|
|
529
|
+
return buildResponse(res).then((_data) => {
|
|
530
|
+
return {
|
|
531
|
+
order: _data.order
|
|
532
|
+
};
|
|
533
|
+
});
|
|
534
|
+
}, (error) => {
|
|
535
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
536
|
+
});
|
|
537
|
+
};
|
|
538
|
+
getCollectibleHighestListing = (args, headers, signal) => {
|
|
539
|
+
return this.fetch(
|
|
540
|
+
this.url("GetCollectibleHighestListing"),
|
|
541
|
+
createHTTPRequest(args, headers, signal)
|
|
542
|
+
).then((res) => {
|
|
543
|
+
return buildResponse(res).then((_data) => {
|
|
544
|
+
return {
|
|
545
|
+
order: _data.order
|
|
546
|
+
};
|
|
547
|
+
});
|
|
548
|
+
}, (error) => {
|
|
549
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
550
|
+
});
|
|
551
|
+
};
|
|
552
|
+
listCollectibleListings = (args, headers, signal) => {
|
|
553
|
+
return this.fetch(
|
|
554
|
+
this.url("ListCollectibleListings"),
|
|
555
|
+
createHTTPRequest(args, headers, signal)
|
|
556
|
+
).then((res) => {
|
|
557
|
+
return buildResponse(res).then((_data) => {
|
|
558
|
+
return {
|
|
559
|
+
listings: _data.listings,
|
|
560
|
+
page: _data.page
|
|
561
|
+
};
|
|
562
|
+
});
|
|
563
|
+
}, (error) => {
|
|
564
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
565
|
+
});
|
|
566
|
+
};
|
|
567
|
+
listCollectibleOffers = (args, headers, signal) => {
|
|
568
|
+
return this.fetch(
|
|
569
|
+
this.url("ListCollectibleOffers"),
|
|
570
|
+
createHTTPRequest(args, headers, signal)
|
|
571
|
+
).then((res) => {
|
|
572
|
+
return buildResponse(res).then((_data) => {
|
|
573
|
+
return {
|
|
574
|
+
offers: _data.offers,
|
|
575
|
+
page: _data.page
|
|
576
|
+
};
|
|
577
|
+
});
|
|
578
|
+
}, (error) => {
|
|
579
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
580
|
+
});
|
|
581
|
+
};
|
|
582
|
+
generateBuyTransaction = (args, headers, signal) => {
|
|
583
|
+
return this.fetch(
|
|
584
|
+
this.url("GenerateBuyTransaction"),
|
|
585
|
+
createHTTPRequest(args, headers, signal)
|
|
586
|
+
).then((res) => {
|
|
587
|
+
return buildResponse(res).then((_data) => {
|
|
588
|
+
return {
|
|
589
|
+
steps: _data.steps
|
|
590
|
+
};
|
|
591
|
+
});
|
|
592
|
+
}, (error) => {
|
|
593
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
594
|
+
});
|
|
595
|
+
};
|
|
596
|
+
generateSellTransaction = (args, headers, signal) => {
|
|
597
|
+
return this.fetch(
|
|
598
|
+
this.url("GenerateSellTransaction"),
|
|
599
|
+
createHTTPRequest(args, headers, signal)
|
|
600
|
+
).then((res) => {
|
|
601
|
+
return buildResponse(res).then((_data) => {
|
|
602
|
+
return {
|
|
603
|
+
steps: _data.steps
|
|
604
|
+
};
|
|
605
|
+
});
|
|
606
|
+
}, (error) => {
|
|
607
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
608
|
+
});
|
|
609
|
+
};
|
|
610
|
+
generateListingTransaction = (args, headers, signal) => {
|
|
611
|
+
return this.fetch(
|
|
612
|
+
this.url("GenerateListingTransaction"),
|
|
613
|
+
createHTTPRequest(args, headers, signal)
|
|
614
|
+
).then((res) => {
|
|
615
|
+
return buildResponse(res).then((_data) => {
|
|
616
|
+
return {
|
|
617
|
+
steps: _data.steps
|
|
618
|
+
};
|
|
619
|
+
});
|
|
620
|
+
}, (error) => {
|
|
621
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
622
|
+
});
|
|
623
|
+
};
|
|
624
|
+
generateOfferTransaction = (args, headers, signal) => {
|
|
625
|
+
return this.fetch(
|
|
626
|
+
this.url("GenerateOfferTransaction"),
|
|
627
|
+
createHTTPRequest(args, headers, signal)
|
|
628
|
+
).then((res) => {
|
|
629
|
+
return buildResponse(res).then((_data) => {
|
|
630
|
+
return {
|
|
631
|
+
steps: _data.steps
|
|
632
|
+
};
|
|
633
|
+
});
|
|
634
|
+
}, (error) => {
|
|
635
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
636
|
+
});
|
|
637
|
+
};
|
|
638
|
+
execute = (args, headers, signal) => {
|
|
639
|
+
return this.fetch(
|
|
640
|
+
this.url("Execute"),
|
|
641
|
+
createHTTPRequest(args, headers, signal)
|
|
642
|
+
).then((res) => {
|
|
643
|
+
return buildResponse(res).then((_data) => {
|
|
644
|
+
return {
|
|
645
|
+
orderId: _data.orderId
|
|
646
|
+
};
|
|
647
|
+
});
|
|
648
|
+
}, (error) => {
|
|
649
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
650
|
+
});
|
|
651
|
+
};
|
|
652
|
+
listCollectibles = (args, headers, signal) => {
|
|
653
|
+
return this.fetch(
|
|
654
|
+
this.url("ListCollectibles"),
|
|
655
|
+
createHTTPRequest(args, headers, signal)
|
|
656
|
+
).then((res) => {
|
|
657
|
+
return buildResponse(res).then((_data) => {
|
|
658
|
+
return {
|
|
659
|
+
collectibles: _data.collectibles,
|
|
660
|
+
page: _data.page
|
|
661
|
+
};
|
|
662
|
+
});
|
|
663
|
+
}, (error) => {
|
|
664
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
665
|
+
});
|
|
666
|
+
};
|
|
667
|
+
getCountOfAllCollectibles = (args, headers, signal) => {
|
|
668
|
+
return this.fetch(
|
|
669
|
+
this.url("GetCountOfAllCollectibles"),
|
|
670
|
+
createHTTPRequest(args, headers, signal)
|
|
671
|
+
).then((res) => {
|
|
672
|
+
return buildResponse(res).then((_data) => {
|
|
673
|
+
return {
|
|
674
|
+
count: _data.count
|
|
675
|
+
};
|
|
676
|
+
});
|
|
677
|
+
}, (error) => {
|
|
678
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
679
|
+
});
|
|
680
|
+
};
|
|
681
|
+
getCountOfFilteredCollectibles = (args, headers, signal) => {
|
|
682
|
+
return this.fetch(
|
|
683
|
+
this.url("GetCountOfFilteredCollectibles"),
|
|
684
|
+
createHTTPRequest(args, headers, signal)
|
|
685
|
+
).then((res) => {
|
|
686
|
+
return buildResponse(res).then((_data) => {
|
|
687
|
+
return {
|
|
688
|
+
count: _data.count
|
|
689
|
+
};
|
|
690
|
+
});
|
|
691
|
+
}, (error) => {
|
|
692
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
693
|
+
});
|
|
694
|
+
};
|
|
695
|
+
getFloorOrder = (args, headers, signal) => {
|
|
696
|
+
return this.fetch(
|
|
697
|
+
this.url("GetFloorOrder"),
|
|
698
|
+
createHTTPRequest(args, headers, signal)
|
|
699
|
+
).then((res) => {
|
|
700
|
+
return buildResponse(res).then((_data) => {
|
|
701
|
+
return {
|
|
702
|
+
collectible: _data.collectible
|
|
703
|
+
};
|
|
704
|
+
});
|
|
705
|
+
}, (error) => {
|
|
706
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
707
|
+
});
|
|
708
|
+
};
|
|
709
|
+
listCollectiblesWithLowestListing = (args, headers, signal) => {
|
|
710
|
+
return this.fetch(
|
|
711
|
+
this.url("ListCollectiblesWithLowestListing"),
|
|
712
|
+
createHTTPRequest(args, headers, signal)
|
|
713
|
+
).then((res) => {
|
|
714
|
+
return buildResponse(res).then((_data) => {
|
|
715
|
+
return {
|
|
716
|
+
collectibles: _data.collectibles,
|
|
717
|
+
page: _data.page
|
|
718
|
+
};
|
|
719
|
+
});
|
|
720
|
+
}, (error) => {
|
|
721
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
722
|
+
});
|
|
723
|
+
};
|
|
724
|
+
listCollectiblesWithHighestOffer = (args, headers, signal) => {
|
|
725
|
+
return this.fetch(
|
|
726
|
+
this.url("ListCollectiblesWithHighestOffer"),
|
|
727
|
+
createHTTPRequest(args, headers, signal)
|
|
728
|
+
).then((res) => {
|
|
729
|
+
return buildResponse(res).then((_data) => {
|
|
730
|
+
return {
|
|
731
|
+
collectibles: _data.collectibles,
|
|
732
|
+
page: _data.page
|
|
733
|
+
};
|
|
734
|
+
});
|
|
735
|
+
}, (error) => {
|
|
736
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
737
|
+
});
|
|
738
|
+
};
|
|
739
|
+
syncOrder = (args, headers, signal) => {
|
|
740
|
+
return this.fetch(
|
|
741
|
+
this.url("SyncOrder"),
|
|
742
|
+
createHTTPRequest(args, headers, signal)
|
|
743
|
+
).then((res) => {
|
|
744
|
+
return buildResponse(res).then((_data) => {
|
|
745
|
+
return {};
|
|
746
|
+
});
|
|
747
|
+
}, (error) => {
|
|
748
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
749
|
+
});
|
|
750
|
+
};
|
|
751
|
+
syncOrders = (args, headers, signal) => {
|
|
752
|
+
return this.fetch(
|
|
753
|
+
this.url("SyncOrders"),
|
|
754
|
+
createHTTPRequest(args, headers, signal)
|
|
755
|
+
).then((res) => {
|
|
756
|
+
return buildResponse(res).then((_data) => {
|
|
757
|
+
return {};
|
|
758
|
+
});
|
|
759
|
+
}, (error) => {
|
|
760
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
761
|
+
});
|
|
762
|
+
};
|
|
763
|
+
getOrders = (args, headers, signal) => {
|
|
764
|
+
return this.fetch(
|
|
765
|
+
this.url("GetOrders"),
|
|
766
|
+
createHTTPRequest(args, headers, signal)
|
|
767
|
+
).then((res) => {
|
|
768
|
+
return buildResponse(res).then((_data) => {
|
|
769
|
+
return {
|
|
770
|
+
orders: _data.orders,
|
|
771
|
+
page: _data.page
|
|
772
|
+
};
|
|
773
|
+
});
|
|
774
|
+
}, (error) => {
|
|
775
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
776
|
+
});
|
|
777
|
+
};
|
|
778
|
+
checkoutOptionsMarketplace = (args, headers, signal) => {
|
|
779
|
+
return this.fetch(
|
|
780
|
+
this.url("CheckoutOptionsMarketplace"),
|
|
781
|
+
createHTTPRequest(args, headers, signal)
|
|
782
|
+
).then((res) => {
|
|
783
|
+
return buildResponse(res).then((_data) => {
|
|
784
|
+
return {
|
|
785
|
+
options: _data.options
|
|
786
|
+
};
|
|
787
|
+
});
|
|
788
|
+
}, (error) => {
|
|
789
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
790
|
+
});
|
|
791
|
+
};
|
|
792
|
+
checkoutOptionsSalesContract = (args, headers, signal) => {
|
|
793
|
+
return this.fetch(
|
|
794
|
+
this.url("CheckoutOptionsSalesContract"),
|
|
795
|
+
createHTTPRequest(args, headers, signal)
|
|
796
|
+
).then((res) => {
|
|
797
|
+
return buildResponse(res).then((_data) => {
|
|
798
|
+
return {
|
|
799
|
+
options: _data.options
|
|
800
|
+
};
|
|
801
|
+
});
|
|
802
|
+
}, (error) => {
|
|
803
|
+
throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ""}` });
|
|
804
|
+
});
|
|
805
|
+
};
|
|
806
|
+
};
|
|
807
|
+
var createHTTPRequest = (body = {}, headers = {}, signal = null) => {
|
|
808
|
+
const reqHeaders = { ...headers, "Content-Type": "application/json" };
|
|
809
|
+
reqHeaders[WebrpcHeader] = WebrpcHeaderValue;
|
|
810
|
+
return {
|
|
811
|
+
method: "POST",
|
|
812
|
+
headers: reqHeaders,
|
|
813
|
+
body: JSON.stringify(body || {}),
|
|
814
|
+
signal
|
|
815
|
+
};
|
|
816
|
+
};
|
|
817
|
+
var buildResponse = (res) => {
|
|
818
|
+
return res.text().then((text) => {
|
|
819
|
+
let data;
|
|
820
|
+
try {
|
|
821
|
+
data = JSON.parse(text);
|
|
822
|
+
} catch (error) {
|
|
823
|
+
let message = "";
|
|
824
|
+
if (error instanceof Error) {
|
|
825
|
+
message = error.message;
|
|
826
|
+
}
|
|
827
|
+
throw WebrpcBadResponseError.new(
|
|
828
|
+
{
|
|
829
|
+
status: res.status,
|
|
830
|
+
cause: `JSON.parse(): ${message}: response text: ${text}`
|
|
831
|
+
}
|
|
832
|
+
);
|
|
833
|
+
}
|
|
834
|
+
if (!res.ok) {
|
|
835
|
+
const code = typeof data.code === "number" ? data.code : 0;
|
|
836
|
+
throw (webrpcErrorByCode[code] || WebrpcError).new(data);
|
|
837
|
+
}
|
|
838
|
+
return data;
|
|
839
|
+
});
|
|
840
|
+
};
|
|
841
|
+
var WebrpcError = class _WebrpcError extends Error {
|
|
842
|
+
name;
|
|
843
|
+
code;
|
|
844
|
+
message;
|
|
845
|
+
status;
|
|
846
|
+
cause;
|
|
847
|
+
/** @deprecated Use message instead of msg. Deprecated in webrpc v0.11.0. */
|
|
848
|
+
msg;
|
|
849
|
+
constructor(name, code, message, status, cause) {
|
|
850
|
+
super(message);
|
|
851
|
+
this.name = name || "WebrpcError";
|
|
852
|
+
this.code = typeof code === "number" ? code : 0;
|
|
853
|
+
this.message = message || `endpoint error ${this.code}`;
|
|
854
|
+
this.msg = this.message;
|
|
855
|
+
this.status = typeof status === "number" ? status : 0;
|
|
856
|
+
this.cause = cause;
|
|
857
|
+
Object.setPrototypeOf(this, _WebrpcError.prototype);
|
|
858
|
+
}
|
|
859
|
+
static new(payload) {
|
|
860
|
+
return new this(payload.error, payload.code, payload.message || payload.msg, payload.status, payload.cause);
|
|
861
|
+
}
|
|
862
|
+
};
|
|
863
|
+
var WebrpcEndpointError = class _WebrpcEndpointError extends WebrpcError {
|
|
864
|
+
constructor(name = "WebrpcEndpoint", code = 0, message = "endpoint error", status = 0, cause) {
|
|
865
|
+
super(name, code, message, status, cause);
|
|
866
|
+
Object.setPrototypeOf(this, _WebrpcEndpointError.prototype);
|
|
867
|
+
}
|
|
868
|
+
};
|
|
869
|
+
var WebrpcRequestFailedError = class _WebrpcRequestFailedError extends WebrpcError {
|
|
870
|
+
constructor(name = "WebrpcRequestFailed", code = -1, message = "request failed", status = 0, cause) {
|
|
871
|
+
super(name, code, message, status, cause);
|
|
872
|
+
Object.setPrototypeOf(this, _WebrpcRequestFailedError.prototype);
|
|
873
|
+
}
|
|
874
|
+
};
|
|
875
|
+
var WebrpcBadRouteError = class _WebrpcBadRouteError extends WebrpcError {
|
|
876
|
+
constructor(name = "WebrpcBadRoute", code = -2, message = "bad route", status = 0, cause) {
|
|
877
|
+
super(name, code, message, status, cause);
|
|
878
|
+
Object.setPrototypeOf(this, _WebrpcBadRouteError.prototype);
|
|
879
|
+
}
|
|
880
|
+
};
|
|
881
|
+
var WebrpcBadMethodError = class _WebrpcBadMethodError extends WebrpcError {
|
|
882
|
+
constructor(name = "WebrpcBadMethod", code = -3, message = "bad method", status = 0, cause) {
|
|
883
|
+
super(name, code, message, status, cause);
|
|
884
|
+
Object.setPrototypeOf(this, _WebrpcBadMethodError.prototype);
|
|
885
|
+
}
|
|
886
|
+
};
|
|
887
|
+
var WebrpcBadRequestError = class _WebrpcBadRequestError extends WebrpcError {
|
|
888
|
+
constructor(name = "WebrpcBadRequest", code = -4, message = "bad request", status = 0, cause) {
|
|
889
|
+
super(name, code, message, status, cause);
|
|
890
|
+
Object.setPrototypeOf(this, _WebrpcBadRequestError.prototype);
|
|
891
|
+
}
|
|
892
|
+
};
|
|
893
|
+
var WebrpcBadResponseError = class _WebrpcBadResponseError extends WebrpcError {
|
|
894
|
+
constructor(name = "WebrpcBadResponse", code = -5, message = "bad response", status = 0, cause) {
|
|
895
|
+
super(name, code, message, status, cause);
|
|
896
|
+
Object.setPrototypeOf(this, _WebrpcBadResponseError.prototype);
|
|
897
|
+
}
|
|
898
|
+
};
|
|
899
|
+
var WebrpcServerPanicError = class _WebrpcServerPanicError extends WebrpcError {
|
|
900
|
+
constructor(name = "WebrpcServerPanic", code = -6, message = "server panic", status = 0, cause) {
|
|
901
|
+
super(name, code, message, status, cause);
|
|
902
|
+
Object.setPrototypeOf(this, _WebrpcServerPanicError.prototype);
|
|
903
|
+
}
|
|
904
|
+
};
|
|
905
|
+
var WebrpcInternalErrorError = class _WebrpcInternalErrorError extends WebrpcError {
|
|
906
|
+
constructor(name = "WebrpcInternalError", code = -7, message = "internal error", status = 0, cause) {
|
|
907
|
+
super(name, code, message, status, cause);
|
|
908
|
+
Object.setPrototypeOf(this, _WebrpcInternalErrorError.prototype);
|
|
909
|
+
}
|
|
910
|
+
};
|
|
911
|
+
var WebrpcClientDisconnectedError = class _WebrpcClientDisconnectedError extends WebrpcError {
|
|
912
|
+
constructor(name = "WebrpcClientDisconnected", code = -8, message = "client disconnected", status = 0, cause) {
|
|
913
|
+
super(name, code, message, status, cause);
|
|
914
|
+
Object.setPrototypeOf(this, _WebrpcClientDisconnectedError.prototype);
|
|
915
|
+
}
|
|
916
|
+
};
|
|
917
|
+
var WebrpcStreamLostError = class _WebrpcStreamLostError extends WebrpcError {
|
|
918
|
+
constructor(name = "WebrpcStreamLost", code = -9, message = "stream lost", status = 0, cause) {
|
|
919
|
+
super(name, code, message, status, cause);
|
|
920
|
+
Object.setPrototypeOf(this, _WebrpcStreamLostError.prototype);
|
|
921
|
+
}
|
|
922
|
+
};
|
|
923
|
+
var WebrpcStreamFinishedError = class _WebrpcStreamFinishedError extends WebrpcError {
|
|
924
|
+
constructor(name = "WebrpcStreamFinished", code = -10, message = "stream finished", status = 0, cause) {
|
|
925
|
+
super(name, code, message, status, cause);
|
|
926
|
+
Object.setPrototypeOf(this, _WebrpcStreamFinishedError.prototype);
|
|
927
|
+
}
|
|
928
|
+
};
|
|
929
|
+
var UnauthorizedError = class _UnauthorizedError extends WebrpcError {
|
|
930
|
+
constructor(name = "Unauthorized", code = 1e3, message = "Unauthorized access", status = 0, cause) {
|
|
931
|
+
super(name, code, message, status, cause);
|
|
932
|
+
Object.setPrototypeOf(this, _UnauthorizedError.prototype);
|
|
933
|
+
}
|
|
934
|
+
};
|
|
935
|
+
var PermissionDeniedError = class _PermissionDeniedError extends WebrpcError {
|
|
936
|
+
constructor(name = "PermissionDenied", code = 1001, message = "Permission denied", status = 0, cause) {
|
|
937
|
+
super(name, code, message, status, cause);
|
|
938
|
+
Object.setPrototypeOf(this, _PermissionDeniedError.prototype);
|
|
939
|
+
}
|
|
940
|
+
};
|
|
941
|
+
var SessionExpiredError = class _SessionExpiredError extends WebrpcError {
|
|
942
|
+
constructor(name = "SessionExpired", code = 1002, message = "Session expired", status = 0, cause) {
|
|
943
|
+
super(name, code, message, status, cause);
|
|
944
|
+
Object.setPrototypeOf(this, _SessionExpiredError.prototype);
|
|
945
|
+
}
|
|
946
|
+
};
|
|
947
|
+
var MethodNotFoundError = class _MethodNotFoundError extends WebrpcError {
|
|
948
|
+
constructor(name = "MethodNotFound", code = 1003, message = "Method not found", status = 0, cause) {
|
|
949
|
+
super(name, code, message, status, cause);
|
|
950
|
+
Object.setPrototypeOf(this, _MethodNotFoundError.prototype);
|
|
951
|
+
}
|
|
952
|
+
};
|
|
953
|
+
var TimeoutError = class _TimeoutError extends WebrpcError {
|
|
954
|
+
constructor(name = "Timeout", code = 2e3, message = "Request timed out", status = 0, cause) {
|
|
955
|
+
super(name, code, message, status, cause);
|
|
956
|
+
Object.setPrototypeOf(this, _TimeoutError.prototype);
|
|
957
|
+
}
|
|
958
|
+
};
|
|
959
|
+
var InvalidArgumentError = class _InvalidArgumentError extends WebrpcError {
|
|
960
|
+
constructor(name = "InvalidArgument", code = 2001, message = "Invalid argument", status = 0, cause) {
|
|
961
|
+
super(name, code, message, status, cause);
|
|
962
|
+
Object.setPrototypeOf(this, _InvalidArgumentError.prototype);
|
|
963
|
+
}
|
|
964
|
+
};
|
|
965
|
+
var NotFoundError = class _NotFoundError extends WebrpcError {
|
|
966
|
+
constructor(name = "NotFound", code = 3e3, message = "Resource not found", status = 0, cause) {
|
|
967
|
+
super(name, code, message, status, cause);
|
|
968
|
+
Object.setPrototypeOf(this, _NotFoundError.prototype);
|
|
969
|
+
}
|
|
970
|
+
};
|
|
971
|
+
var UserNotFoundError = class _UserNotFoundError extends WebrpcError {
|
|
972
|
+
constructor(name = "UserNotFound", code = 3001, message = "User not found", status = 0, cause) {
|
|
973
|
+
super(name, code, message, status, cause);
|
|
974
|
+
Object.setPrototypeOf(this, _UserNotFoundError.prototype);
|
|
975
|
+
}
|
|
976
|
+
};
|
|
977
|
+
var ProjectNotFoundError = class _ProjectNotFoundError extends WebrpcError {
|
|
978
|
+
constructor(name = "ProjectNotFound", code = 3002, message = "Project not found", status = 0, cause) {
|
|
979
|
+
super(name, code, message, status, cause);
|
|
980
|
+
Object.setPrototypeOf(this, _ProjectNotFoundError.prototype);
|
|
981
|
+
}
|
|
982
|
+
};
|
|
983
|
+
var InvalidTierError = class _InvalidTierError extends WebrpcError {
|
|
984
|
+
constructor(name = "InvalidTier", code = 3003, message = "Invalid subscription tier", status = 0, cause) {
|
|
985
|
+
super(name, code, message, status, cause);
|
|
986
|
+
Object.setPrototypeOf(this, _InvalidTierError.prototype);
|
|
987
|
+
}
|
|
988
|
+
};
|
|
989
|
+
var ProjectLimitReachedError = class _ProjectLimitReachedError extends WebrpcError {
|
|
990
|
+
constructor(name = "ProjectLimitReached", code = 3005, message = "Project limit reached", status = 0, cause) {
|
|
991
|
+
super(name, code, message, status, cause);
|
|
992
|
+
Object.setPrototypeOf(this, _ProjectLimitReachedError.prototype);
|
|
993
|
+
}
|
|
994
|
+
};
|
|
995
|
+
var NotImplementedError = class _NotImplementedError extends WebrpcError {
|
|
996
|
+
constructor(name = "NotImplemented", code = 9999, message = "Not Implemented", status = 0, cause) {
|
|
997
|
+
super(name, code, message, status, cause);
|
|
998
|
+
Object.setPrototypeOf(this, _NotImplementedError.prototype);
|
|
999
|
+
}
|
|
1000
|
+
};
|
|
1001
|
+
var errors = /* @__PURE__ */ ((errors2) => {
|
|
1002
|
+
errors2["WebrpcEndpoint"] = "WebrpcEndpoint";
|
|
1003
|
+
errors2["WebrpcRequestFailed"] = "WebrpcRequestFailed";
|
|
1004
|
+
errors2["WebrpcBadRoute"] = "WebrpcBadRoute";
|
|
1005
|
+
errors2["WebrpcBadMethod"] = "WebrpcBadMethod";
|
|
1006
|
+
errors2["WebrpcBadRequest"] = "WebrpcBadRequest";
|
|
1007
|
+
errors2["WebrpcBadResponse"] = "WebrpcBadResponse";
|
|
1008
|
+
errors2["WebrpcServerPanic"] = "WebrpcServerPanic";
|
|
1009
|
+
errors2["WebrpcInternalError"] = "WebrpcInternalError";
|
|
1010
|
+
errors2["WebrpcClientDisconnected"] = "WebrpcClientDisconnected";
|
|
1011
|
+
errors2["WebrpcStreamLost"] = "WebrpcStreamLost";
|
|
1012
|
+
errors2["WebrpcStreamFinished"] = "WebrpcStreamFinished";
|
|
1013
|
+
errors2["Unauthorized"] = "Unauthorized";
|
|
1014
|
+
errors2["PermissionDenied"] = "PermissionDenied";
|
|
1015
|
+
errors2["SessionExpired"] = "SessionExpired";
|
|
1016
|
+
errors2["MethodNotFound"] = "MethodNotFound";
|
|
1017
|
+
errors2["Timeout"] = "Timeout";
|
|
1018
|
+
errors2["InvalidArgument"] = "InvalidArgument";
|
|
1019
|
+
errors2["NotFound"] = "NotFound";
|
|
1020
|
+
errors2["UserNotFound"] = "UserNotFound";
|
|
1021
|
+
errors2["ProjectNotFound"] = "ProjectNotFound";
|
|
1022
|
+
errors2["InvalidTier"] = "InvalidTier";
|
|
1023
|
+
errors2["ProjectLimitReached"] = "ProjectLimitReached";
|
|
1024
|
+
errors2["NotImplemented"] = "NotImplemented";
|
|
1025
|
+
return errors2;
|
|
1026
|
+
})(errors || {});
|
|
1027
|
+
var webrpcErrorByCode = {
|
|
1028
|
+
[0]: WebrpcEndpointError,
|
|
1029
|
+
[-1]: WebrpcRequestFailedError,
|
|
1030
|
+
[-2]: WebrpcBadRouteError,
|
|
1031
|
+
[-3]: WebrpcBadMethodError,
|
|
1032
|
+
[-4]: WebrpcBadRequestError,
|
|
1033
|
+
[-5]: WebrpcBadResponseError,
|
|
1034
|
+
[-6]: WebrpcServerPanicError,
|
|
1035
|
+
[-7]: WebrpcInternalErrorError,
|
|
1036
|
+
[-8]: WebrpcClientDisconnectedError,
|
|
1037
|
+
[-9]: WebrpcStreamLostError,
|
|
1038
|
+
[-10]: WebrpcStreamFinishedError,
|
|
1039
|
+
[1e3]: UnauthorizedError,
|
|
1040
|
+
[1001]: PermissionDeniedError,
|
|
1041
|
+
[1002]: SessionExpiredError,
|
|
1042
|
+
[1003]: MethodNotFoundError,
|
|
1043
|
+
[2e3]: TimeoutError,
|
|
1044
|
+
[2001]: InvalidArgumentError,
|
|
1045
|
+
[3e3]: NotFoundError,
|
|
1046
|
+
[3001]: UserNotFoundError,
|
|
1047
|
+
[3002]: ProjectNotFoundError,
|
|
1048
|
+
[3003]: InvalidTierError,
|
|
1049
|
+
[3005]: ProjectLimitReachedError,
|
|
1050
|
+
[9999]: NotImplementedError
|
|
1051
|
+
};
|
|
1052
|
+
|
|
1053
|
+
// src/react/_internal/api/marketplace-api.ts
|
|
1054
|
+
var SequenceMarketplace = class extends Marketplace {
|
|
1055
|
+
constructor(hostname, projectAccessKey, jwtAuth) {
|
|
1056
|
+
super(hostname.endsWith("/") ? hostname.slice(0, -1) : hostname, fetch);
|
|
1057
|
+
this.projectAccessKey = projectAccessKey;
|
|
1058
|
+
this.jwtAuth = jwtAuth;
|
|
1059
|
+
this.fetch = this._fetch;
|
|
1060
|
+
}
|
|
1061
|
+
_fetch = (input, init) => {
|
|
1062
|
+
const headers = {};
|
|
1063
|
+
const jwtAuth = this.jwtAuth;
|
|
1064
|
+
const projectAccessKey = this.projectAccessKey;
|
|
1065
|
+
if (jwtAuth && jwtAuth.length > 0) {
|
|
1066
|
+
headers.Authorization = `BEARER ${jwtAuth}`;
|
|
1067
|
+
}
|
|
1068
|
+
if (projectAccessKey && projectAccessKey.length > 0) {
|
|
1069
|
+
headers["X-Access-Key"] = projectAccessKey;
|
|
1070
|
+
}
|
|
1071
|
+
init.headers = { ...init.headers, ...headers };
|
|
1072
|
+
return fetch(input, init);
|
|
1073
|
+
};
|
|
1074
|
+
};
|
|
1075
|
+
|
|
1076
|
+
// src/react/_internal/api/query-keys.ts
|
|
1077
|
+
var CollectableKeys = class _CollectableKeys {
|
|
1078
|
+
static all = ["collectable"];
|
|
1079
|
+
static details = [..._CollectableKeys.all, "details"];
|
|
1080
|
+
static lists = [..._CollectableKeys.all, "list"];
|
|
1081
|
+
static floorOrders = [..._CollectableKeys.all, "floorOrders"];
|
|
1082
|
+
static userBalances = [
|
|
1083
|
+
..._CollectableKeys.all,
|
|
1084
|
+
..._CollectableKeys.details,
|
|
1085
|
+
"userBalances"
|
|
1086
|
+
];
|
|
1087
|
+
static royaltyPercentage = [
|
|
1088
|
+
..._CollectableKeys.all,
|
|
1089
|
+
"royaltyPercentage"
|
|
1090
|
+
];
|
|
1091
|
+
static highestOffers = [
|
|
1092
|
+
..._CollectableKeys.all,
|
|
1093
|
+
..._CollectableKeys.details,
|
|
1094
|
+
"highestOffers"
|
|
1095
|
+
];
|
|
1096
|
+
static lowestListings = [
|
|
1097
|
+
..._CollectableKeys.all,
|
|
1098
|
+
..._CollectableKeys.details,
|
|
1099
|
+
"lowestListings"
|
|
1100
|
+
];
|
|
1101
|
+
static offers = [..._CollectableKeys.all, "offers"];
|
|
1102
|
+
static filter = [..._CollectableKeys.all, "filter"];
|
|
1103
|
+
static counts = [..._CollectableKeys.all, "counts"];
|
|
1104
|
+
};
|
|
1105
|
+
var CollectionKeys = class _CollectionKeys {
|
|
1106
|
+
static all = ["collections"];
|
|
1107
|
+
static list = [..._CollectionKeys.all, "list"];
|
|
1108
|
+
static detail = [..._CollectionKeys.all, "detail"];
|
|
1109
|
+
};
|
|
1110
|
+
var BalanceQueries = class _BalanceQueries {
|
|
1111
|
+
static all = ["balances"];
|
|
1112
|
+
static lists = [..._BalanceQueries.all, "tokenBalances"];
|
|
1113
|
+
};
|
|
1114
|
+
var CheckoutKeys = class _CheckoutKeys {
|
|
1115
|
+
static all = ["checkouts"];
|
|
1116
|
+
static options = [..._CheckoutKeys.all, "options"];
|
|
1117
|
+
static cartItems = [..._CheckoutKeys.all, "cartItems"];
|
|
1118
|
+
};
|
|
1119
|
+
var CurrencyKeys = class _CurrencyKeys {
|
|
1120
|
+
static all = ["currencies"];
|
|
1121
|
+
static lists = [..._CurrencyKeys.all, "list"];
|
|
1122
|
+
};
|
|
1123
|
+
var ConfigKeys = class _ConfigKeys {
|
|
1124
|
+
static all = ["configs"];
|
|
1125
|
+
static marketplace = [..._ConfigKeys.all, "marketplace"];
|
|
1126
|
+
};
|
|
1127
|
+
var collectableKeys = CollectableKeys;
|
|
1128
|
+
var collectionKeys = CollectionKeys;
|
|
1129
|
+
var balanceQueries = BalanceQueries;
|
|
1130
|
+
var checkoutKeys = CheckoutKeys;
|
|
1131
|
+
var currencyKeys = CurrencyKeys;
|
|
1132
|
+
var configKeys = ConfigKeys;
|
|
1133
|
+
|
|
1134
|
+
// src/react/_internal/api/services.ts
|
|
1135
|
+
import { SequenceIndexer } from "@0xsequence/indexer";
|
|
1136
|
+
import { SequenceMetadata } from "@0xsequence/metadata";
|
|
1137
|
+
import { networks, stringTemplate } from "@0xsequence/network";
|
|
1138
|
+
var SERVICES = {
|
|
1139
|
+
sequenceApi: "https://api.sequence.app",
|
|
1140
|
+
metadata: "https://${prefix}metadata.sequence.app",
|
|
1141
|
+
indexer: "https://${prefix}${network}-indexer.sequence.app",
|
|
1142
|
+
marketplaceApi: "https://${prefix}marketplace-api.sequence.app/${network}",
|
|
1143
|
+
imageProxy: "https://imgproxy.sequence.xyz/",
|
|
1144
|
+
builderMarketplaceApi: "https://${prefix}api.sequence.build/marketplace/${projectId}"
|
|
1145
|
+
};
|
|
1146
|
+
var getNetwork = (nameOrId) => {
|
|
1147
|
+
for (const network of Object.values(networks)) {
|
|
1148
|
+
if (network.name === String(nameOrId).toLowerCase() || network.chainId === Number(nameOrId)) {
|
|
1149
|
+
return network;
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
throw new Error(`Unsopported chain; ${nameOrId}`);
|
|
1153
|
+
};
|
|
1154
|
+
var imageProxy = stringTemplate(SERVICES.imageProxy, {});
|
|
1155
|
+
var metadataURL = (env = "production") => {
|
|
1156
|
+
const prefix = getPrefix(env);
|
|
1157
|
+
return stringTemplate(SERVICES.metadata, { prefix });
|
|
1158
|
+
};
|
|
1159
|
+
var indexerURL = (chain, env = "production") => {
|
|
1160
|
+
const prefix = getPrefix(env);
|
|
1161
|
+
const network = getNetwork(chain).name;
|
|
1162
|
+
return stringTemplate(SERVICES.indexer, { network, prefix });
|
|
1163
|
+
};
|
|
1164
|
+
var marketplaceApiURL = (chain, env = "production") => {
|
|
1165
|
+
const prefix = getPrefix(env);
|
|
1166
|
+
const network = getNetwork(chain).name;
|
|
1167
|
+
return stringTemplate(SERVICES.marketplaceApi, { network, prefix });
|
|
1168
|
+
};
|
|
1169
|
+
var builderMarketplaceApi = (projectId, env = "production") => {
|
|
1170
|
+
const prefix = getPrefix(env);
|
|
1171
|
+
return stringTemplate(SERVICES.builderMarketplaceApi, {
|
|
1172
|
+
projectId,
|
|
1173
|
+
prefix
|
|
1174
|
+
});
|
|
1175
|
+
};
|
|
1176
|
+
var getMetadataClient = (config) => {
|
|
1177
|
+
const env = config._internal?.metadataEnv || "production";
|
|
1178
|
+
const projectAccessKey = getAccessKey({ env, config });
|
|
1179
|
+
return new SequenceMetadata(metadataURL(env), projectAccessKey);
|
|
1180
|
+
};
|
|
1181
|
+
var getIndexerClient = (chain, config) => {
|
|
1182
|
+
const env = config._internal?.indexerEnv || "production";
|
|
1183
|
+
const projectAccessKey = getAccessKey({ env, config });
|
|
1184
|
+
return new SequenceIndexer(indexerURL(chain, env), projectAccessKey);
|
|
1185
|
+
};
|
|
1186
|
+
var getMarketplaceClient = (chain, config) => {
|
|
1187
|
+
const env = config._internal?.marketplaceEnv || "production";
|
|
1188
|
+
const projectAccessKey = getAccessKey({ env, config });
|
|
1189
|
+
return new SequenceMarketplace(
|
|
1190
|
+
marketplaceApiURL(chain, env),
|
|
1191
|
+
projectAccessKey
|
|
1192
|
+
);
|
|
1193
|
+
};
|
|
1194
|
+
var getAccessKey = ({ env, config }) => {
|
|
1195
|
+
switch (env) {
|
|
1196
|
+
case "development":
|
|
1197
|
+
if (!config._internal?.devAccessKey)
|
|
1198
|
+
throw new Error("devAccessKey is required for development env");
|
|
1199
|
+
return config._internal?.devAccessKey;
|
|
1200
|
+
case "production":
|
|
1201
|
+
return config.projectAccessKey;
|
|
1202
|
+
case "next":
|
|
1203
|
+
if (!config._internal?.nextAccessKey)
|
|
1204
|
+
throw new Error("nextAccessKey is required for next env");
|
|
1205
|
+
return config._internal?.nextAccessKey;
|
|
1206
|
+
}
|
|
1207
|
+
};
|
|
1208
|
+
var getPrefix = (env) => {
|
|
1209
|
+
switch (env) {
|
|
1210
|
+
case "development":
|
|
1211
|
+
return "dev-";
|
|
1212
|
+
case "production":
|
|
1213
|
+
return "";
|
|
1214
|
+
case "next":
|
|
1215
|
+
return "next-";
|
|
1216
|
+
}
|
|
1217
|
+
};
|
|
1218
|
+
|
|
1219
|
+
export {
|
|
1220
|
+
getQueryClient,
|
|
1221
|
+
WebrpcHeader,
|
|
1222
|
+
WebrpcHeaderValue,
|
|
1223
|
+
WebRPCVersion,
|
|
1224
|
+
WebRPCSchemaVersion,
|
|
1225
|
+
WebRPCSchemaHash,
|
|
1226
|
+
VersionFromHeader,
|
|
1227
|
+
SortOrder,
|
|
1228
|
+
PropertyType,
|
|
1229
|
+
MarketplaceKind,
|
|
1230
|
+
OrderbookKind,
|
|
1231
|
+
SourceKind,
|
|
1232
|
+
OrderSide,
|
|
1233
|
+
OrderStatus,
|
|
1234
|
+
ContractType,
|
|
1235
|
+
CollectionStatus,
|
|
1236
|
+
ProjectStatus,
|
|
1237
|
+
CollectibleStatus,
|
|
1238
|
+
WalletKind,
|
|
1239
|
+
StepType,
|
|
1240
|
+
TransactionCrypto,
|
|
1241
|
+
TransactionNFTCheckoutProvider,
|
|
1242
|
+
TransactionOnRampProvider,
|
|
1243
|
+
TransactionSwapProvider,
|
|
1244
|
+
ExecuteType,
|
|
1245
|
+
Admin,
|
|
1246
|
+
Marketplace,
|
|
1247
|
+
WebrpcError,
|
|
1248
|
+
WebrpcEndpointError,
|
|
1249
|
+
WebrpcRequestFailedError,
|
|
1250
|
+
WebrpcBadRouteError,
|
|
1251
|
+
WebrpcBadMethodError,
|
|
1252
|
+
WebrpcBadRequestError,
|
|
1253
|
+
WebrpcBadResponseError,
|
|
1254
|
+
WebrpcServerPanicError,
|
|
1255
|
+
WebrpcInternalErrorError,
|
|
1256
|
+
WebrpcClientDisconnectedError,
|
|
1257
|
+
WebrpcStreamLostError,
|
|
1258
|
+
WebrpcStreamFinishedError,
|
|
1259
|
+
UnauthorizedError,
|
|
1260
|
+
PermissionDeniedError,
|
|
1261
|
+
SessionExpiredError,
|
|
1262
|
+
MethodNotFoundError,
|
|
1263
|
+
TimeoutError,
|
|
1264
|
+
InvalidArgumentError,
|
|
1265
|
+
NotFoundError,
|
|
1266
|
+
UserNotFoundError,
|
|
1267
|
+
ProjectNotFoundError,
|
|
1268
|
+
InvalidTierError,
|
|
1269
|
+
ProjectLimitReachedError,
|
|
1270
|
+
NotImplementedError,
|
|
1271
|
+
errors,
|
|
1272
|
+
SequenceMarketplace,
|
|
1273
|
+
collectableKeys,
|
|
1274
|
+
collectionKeys,
|
|
1275
|
+
balanceQueries,
|
|
1276
|
+
checkoutKeys,
|
|
1277
|
+
currencyKeys,
|
|
1278
|
+
configKeys,
|
|
1279
|
+
imageProxy,
|
|
1280
|
+
builderMarketplaceApi,
|
|
1281
|
+
getMetadataClient,
|
|
1282
|
+
getIndexerClient,
|
|
1283
|
+
getMarketplaceClient
|
|
1284
|
+
};
|
|
1285
|
+
//# sourceMappingURL=chunk-HGBEC3WX.js.map
|