@0xsequence/marketplace-sdk 0.3.4 → 0.3.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-PMDJARYX.js → chunk-F42XMKDS.js} +438 -382
- package/dist/chunk-F42XMKDS.js.map +1 -0
- package/dist/{chunk-Q57TEA3Z.js → chunk-NMCGA2TB.js} +4 -2
- package/dist/chunk-NMCGA2TB.js.map +1 -0
- package/dist/{chunk-L6GSYPCR.js → chunk-RZSZNVEH.js} +5 -5
- package/dist/{chunk-L6GSYPCR.js.map → chunk-RZSZNVEH.js.map} +1 -1
- package/dist/{chunk-6LQST3KZ.js → chunk-Z3VR2KMP.js} +30 -18
- package/dist/chunk-Z3VR2KMP.js.map +1 -0
- package/dist/index.js +72 -172
- package/dist/react/hooks/index.d.ts +3 -1
- package/dist/react/hooks/index.js +5 -5
- package/dist/react/index.js +8 -8
- package/dist/react/ui/components/index.js +8 -8
- package/dist/react/ui/index.d.ts +4 -21
- package/dist/react/ui/index.js +8 -8
- package/dist/react/ui/modals/_internal/components/actionModal/index.d.ts +1 -1
- package/dist/react/ui/modals/_internal/components/actionModal/index.js +1 -1
- package/dist/react/ui/styles/index.d.ts +1 -1
- package/dist/styles/index.d.ts +1 -1
- package/dist/styles/index.js +1 -1
- package/dist/utils/index.js +1 -1
- package/package.json +1 -1
- package/src/react/_internal/transaction-machine/execute-transaction.ts +10 -3
- package/src/react/_internal/transaction-machine/useTransactionMachine.ts +18 -5
- package/src/react/ui/components/_internals/action-button/ActionButton.tsx +1 -1
- package/src/react/ui/modals/BuyModal/index.tsx +42 -10
- package/src/react/ui/modals/CreateListingModal/index.tsx +9 -16
- package/src/react/ui/modals/MakeOfferModal/_store.ts +1 -1
- package/src/react/ui/modals/MakeOfferModal/index.tsx +9 -12
- package/src/react/ui/modals/SellModal/index.tsx +10 -10
- package/src/react/ui/modals/TransferModal/_store.ts +12 -10
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/index.tsx +2 -2
- package/src/react/ui/modals/TransferModal/_views/enterWalletAddress/useHandleTransfer.tsx +16 -38
- package/src/react/ui/modals/TransferModal/index.tsx +7 -9
- package/src/react/ui/modals/_internal/components/actionModal/ActionModal.tsx +4 -2
- package/src/react/ui/modals/_internal/components/quantityInput/index.tsx +25 -3
- package/src/react/ui/modals/_internal/components/switchChainModal/index.tsx +2 -0
- package/src/react/ui/modals/_internal/components/switchChainModal/store.ts +4 -4
- package/src/react/ui/modals/_internal/components/transaction-footer/index.tsx +7 -4
- package/src/react/ui/modals/_internal/components/transactionPreview/consts.ts +10 -5
- package/src/react/ui/modals/_internal/components/transactionPreview/index.tsx +27 -8
- package/src/react/ui/modals/_internal/components/transactionPreview/useTransactionPreviewTitle.tsx +3 -5
- package/src/react/ui/modals/_internal/components/transactionStatusModal/index.tsx +80 -62
- package/src/react/ui/modals/_internal/components/transactionStatusModal/store.ts +21 -29
- package/src/react/ui/modals/_internal/components/transactionStatusModal/util/getFormattedType.ts +23 -0
- package/src/react/ui/modals/_internal/components/transactionStatusModal/util/getMessage.ts +29 -0
- package/src/react/ui/modals/_internal/components/transactionStatusModal/util/getTitle.ts +43 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/chunk-6LQST3KZ.js.map +0 -1
- package/dist/chunk-PMDJARYX.js.map +0 -1
- package/dist/chunk-Q57TEA3Z.js.map +0 -1
- package/src/react/ui/modals/CreateListingModal/_utils/getCreateListingTransactionTitleMessage.ts +0 -30
- package/src/react/ui/modals/MakeOfferModal/_utils/getMakeOfferTransactionTitleMessage.ts +0 -28
- package/src/react/ui/modals/SellModal/_utils/getSellTransactionTitleMessage.ts +0 -28
- package/src/react/ui/modals/TransferModal/_utils/getTransferTransactionTitleMessage.ts +0 -28
- package/src/types/callbacks.ts +0 -51
package/dist/index.js
CHANGED
|
@@ -1,175 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var t = null != arguments[r] ? arguments[r] : {};
|
|
43
|
-
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
44
|
-
_defineProperty(e, r2, t[r2]);
|
|
45
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
46
|
-
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
return e;
|
|
50
|
-
}
|
|
51
|
-
function mapValues(input, fn) {
|
|
52
|
-
var result = {};
|
|
53
|
-
for (var _key in input) {
|
|
54
|
-
result[_key] = fn(input[_key], _key);
|
|
55
|
-
}
|
|
56
|
-
return result;
|
|
57
|
-
}
|
|
58
|
-
var shouldApplyCompound = (compoundCheck, selections, defaultVariants) => {
|
|
59
|
-
for (var key of Object.keys(compoundCheck)) {
|
|
60
|
-
var _selections$key;
|
|
61
|
-
if (compoundCheck[key] !== ((_selections$key = selections[key]) !== null && _selections$key !== void 0 ? _selections$key : defaultVariants[key])) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return true;
|
|
66
|
-
};
|
|
67
|
-
var createRuntimeFn = (config) => {
|
|
68
|
-
var runtimeFn = (options) => {
|
|
69
|
-
var className = config.defaultClassName;
|
|
70
|
-
var selections = _objectSpread2(_objectSpread2({}, config.defaultVariants), options);
|
|
71
|
-
for (var variantName in selections) {
|
|
72
|
-
var _selections$variantNa;
|
|
73
|
-
var variantSelection = (_selections$variantNa = selections[variantName]) !== null && _selections$variantNa !== void 0 ? _selections$variantNa : config.defaultVariants[variantName];
|
|
74
|
-
if (variantSelection != null) {
|
|
75
|
-
var selection = variantSelection;
|
|
76
|
-
if (typeof selection === "boolean") {
|
|
77
|
-
selection = selection === true ? "true" : "false";
|
|
78
|
-
}
|
|
79
|
-
var selectionClassName = (
|
|
80
|
-
// @ts-expect-error
|
|
81
|
-
config.variantClassNames[variantName][selection]
|
|
82
|
-
);
|
|
83
|
-
if (selectionClassName) {
|
|
84
|
-
className += " " + selectionClassName;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
for (var [compoundCheck, compoundClassName] of config.compoundVariants) {
|
|
89
|
-
if (shouldApplyCompound(compoundCheck, selections, config.defaultVariants)) {
|
|
90
|
-
className += " " + compoundClassName;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return className;
|
|
94
|
-
};
|
|
95
|
-
runtimeFn.variants = () => Object.keys(config.variantClassNames);
|
|
96
|
-
runtimeFn.classNames = {
|
|
97
|
-
get base() {
|
|
98
|
-
return config.defaultClassName.split(" ")[0];
|
|
99
|
-
},
|
|
100
|
-
get variants() {
|
|
101
|
-
return mapValues(config.variantClassNames, (classNames) => mapValues(classNames, (className) => className.split(" ")[0]));
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
return runtimeFn;
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
// src/react/ui/icons/styles.css.ts
|
|
108
|
-
var iconVariants = createRuntimeFn({ defaultClassName: "styles_iconVariants__1x12tbe0", variantClassNames: { size: { xs: "styles_iconVariants_size_xs__1x12tbe1", sm: "styles_iconVariants_size_sm__1x12tbe2", md: "styles_iconVariants_size_md__1x12tbe3", lg: "styles_iconVariants_size_lg__1x12tbe4", xl: "styles_iconVariants_size_xl__1x12tbe5" } }, defaultVariants: {}, compoundVariants: [] });
|
|
109
|
-
|
|
110
|
-
// src/react/ui/modals/_internal/components/actionModal/styles.css.ts
|
|
111
|
-
var cta = "styles_cta__1rop7tw0";
|
|
112
|
-
|
|
113
|
-
// src/react/ui/modals/_internal/components/calendarPopover/styles.css.ts
|
|
114
|
-
var dateSelectButton = "styles_dateSelectButton__1jc6p8j0";
|
|
115
|
-
var dateSelectPopoverContent = "fyvr11h8 fyvr11hw fyvr11fw fyvr11gk fyvr11rs fyvr130l fyvr11xx fyvr11r0";
|
|
116
|
-
|
|
117
|
-
// src/react/ui/modals/_internal/components/priceInput/styles.css.ts
|
|
118
|
-
var priceInputCurrencyImage = "styles_priceInputCurrencyImage__6jjz8t1";
|
|
119
|
-
var priceInputWrapper = "styles_priceInputWrapper__6jjz8t0";
|
|
120
|
-
|
|
121
|
-
// src/react/ui/modals/_internal/components/quantityInput/styles.css.ts
|
|
122
|
-
var quantityInputWrapper = "styles_quantityInputWrapper__50g4m90";
|
|
123
|
-
|
|
124
|
-
// src/react/ui/modals/_internal/components/tokenPreview/styles.css.ts
|
|
125
|
-
var tokenPreview = "fyvr1188 fyvr11ag fyvr11l8 fyvr11ow fyvr12g";
|
|
126
|
-
|
|
127
|
-
// src/react/ui/modals/_internal/components/alertMessage/styles.css.ts
|
|
128
|
-
var alertMessageBox = "fyvr11hc fyvr11i0 fyvr11g0 fyvr11go fyvr1vc fyvr1xg fyvr1zk fyvr111o fyvr11l8 fyvr11ow fyvr11o4 fyvr11ck";
|
|
129
|
-
var alertMessageBoxVariants = { warning: "styles_alertMessageBoxVariants_warning__yzftal1", info: "styles_alertMessageBoxVariants_info__yzftal2" };
|
|
130
|
-
|
|
131
|
-
// src/react/ui/modals/_internal/components/switchChainModal/styles.css.ts
|
|
132
|
-
var switchChainCta = { "default": "styles_switchChainCtaBase__xmi06q1", pending: "styles_switchChainCta_pending__xmi06q3 styles_switchChainCtaBase__xmi06q1" };
|
|
133
|
-
var switchChainModalContent = "modal_dialogContent_wide__1ypl6nt3 modal_dialogContentBase__1ypl6nt1 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs fyvr11l8 fyvr11wl fyvr11m0 fyvr11rs fyvr1vo fyvr1xs fyvr1zw fyvr1120 fyvr11lc fyvr11mc fyvr11cw";
|
|
134
|
-
|
|
135
|
-
// src/react/ui/modals/SuccessfulPurchaseModal/styles.css.ts
|
|
136
|
-
var collectiblesGrid = "styles_collectiblesGrid__1njkwfe0";
|
|
137
|
-
var collectiblesGridImage = "styles_collectiblesGridImage__1njkwfe2";
|
|
138
|
-
var collectiblesGridImagePale = "styles_collectiblesGridImagePale__1njkwfe3 styles_collectiblesGridImage__1njkwfe2";
|
|
139
|
-
var collectiblesGridItem = "styles_collectiblesGridItem__1njkwfe1";
|
|
140
|
-
|
|
141
|
-
// src/react/ui/modals/TransferModal/styles.css.ts
|
|
142
|
-
var transferModalContent = "styles_transferModalContent__i1qz9g0 modal_dialogContent_wide__1ypl6nt3 modal_dialogContentBase__1ypl6nt1 fyvr11hg fyvr11i4 fyvr11g4 fyvr11gs fyvr11l8 fyvr11wl fyvr11m0 fyvr11rs fyvr1vo fyvr1xs fyvr1zw fyvr1120";
|
|
1
|
+
"use client"
|
|
2
|
+
import {
|
|
3
|
+
calculatePriceDifferencePercentage,
|
|
4
|
+
compareAddress,
|
|
5
|
+
getPresentableChainName,
|
|
6
|
+
getPublicRpcClient,
|
|
7
|
+
truncateEnd,
|
|
8
|
+
truncateMiddle
|
|
9
|
+
} from "./chunk-OUZ42I6B.js";
|
|
10
|
+
import "./chunk-MJ4YU7RW.js";
|
|
11
|
+
import "./chunk-Q2BVDQ3G.js";
|
|
12
|
+
import {
|
|
13
|
+
CollectibleStatus,
|
|
14
|
+
CollectionStatus,
|
|
15
|
+
ContractType,
|
|
16
|
+
ExecuteType,
|
|
17
|
+
MarketplaceKind,
|
|
18
|
+
OrderSide,
|
|
19
|
+
OrderStatus,
|
|
20
|
+
OrderbookKind,
|
|
21
|
+
ProjectStatus,
|
|
22
|
+
PropertyType,
|
|
23
|
+
SortOrder,
|
|
24
|
+
SourceKind,
|
|
25
|
+
StepType,
|
|
26
|
+
TransactionCrypto,
|
|
27
|
+
WalletKind
|
|
28
|
+
} from "./chunk-D3HRXVYJ.js";
|
|
29
|
+
import "./chunk-3CXEYH2I.js";
|
|
30
|
+
import "./chunk-T2AMWIKD.js";
|
|
31
|
+
import "./chunk-MCI3KOSQ.js";
|
|
32
|
+
import {
|
|
33
|
+
EIP2981_ABI,
|
|
34
|
+
SequenceMarketplaceV1_ABI,
|
|
35
|
+
SequenceMarketplaceV2_ABI
|
|
36
|
+
} from "./chunk-3OHM45R3.js";
|
|
37
|
+
import {
|
|
38
|
+
ERC1155_ABI,
|
|
39
|
+
ERC20_ABI,
|
|
40
|
+
ERC721_ABI
|
|
41
|
+
} from "./chunk-WFE6OCYF.js";
|
|
143
42
|
|
|
144
|
-
// src/
|
|
145
|
-
var
|
|
146
|
-
var collectibleCard = "styles_collectibleCard__biep7a0";
|
|
147
|
-
var collectibleImage = "styles_collectibleImage__biep7a1";
|
|
148
|
-
var collectibleTileWrapper = "styles_collectibleTileWrapper__biep7a2";
|
|
149
|
-
var footer = { animated: "styles_footer_animated__biep7a5 fyvr11wl", "static": "fyvr11wl" };
|
|
150
|
-
var offerBellButton = "styles_offerBellButton__biep7a3";
|
|
43
|
+
// src/consts.ts
|
|
44
|
+
var SEQUENCE_MARKET_V1_ADDRESS = "0xB537a160472183f2150d42EB1c3DD6684A55f74c";
|
|
151
45
|
export {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
46
|
+
CollectibleStatus,
|
|
47
|
+
CollectionStatus,
|
|
48
|
+
ContractType,
|
|
49
|
+
EIP2981_ABI,
|
|
50
|
+
ERC1155_ABI,
|
|
51
|
+
ERC20_ABI,
|
|
52
|
+
ERC721_ABI,
|
|
53
|
+
ExecuteType,
|
|
54
|
+
MarketplaceKind,
|
|
55
|
+
OrderSide,
|
|
56
|
+
OrderStatus,
|
|
57
|
+
OrderbookKind,
|
|
58
|
+
ProjectStatus,
|
|
59
|
+
PropertyType,
|
|
60
|
+
SEQUENCE_MARKET_V1_ADDRESS,
|
|
61
|
+
SequenceMarketplaceV1_ABI,
|
|
62
|
+
SequenceMarketplaceV2_ABI,
|
|
63
|
+
SortOrder,
|
|
64
|
+
SourceKind,
|
|
65
|
+
StepType,
|
|
66
|
+
TransactionCrypto,
|
|
67
|
+
WalletKind,
|
|
68
|
+
calculatePriceDifferencePercentage,
|
|
69
|
+
compareAddress,
|
|
70
|
+
getPresentableChainName,
|
|
71
|
+
getPublicRpcClient,
|
|
72
|
+
truncateEnd,
|
|
73
|
+
truncateMiddle
|
|
175
74
|
};
|
|
75
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -2192,6 +2192,7 @@ declare enum TransactionType {
|
|
|
2192
2192
|
SELL = "SELL",
|
|
2193
2193
|
LISTING = "LISTING",
|
|
2194
2194
|
OFFER = "OFFER",
|
|
2195
|
+
TRANSFER = "TRANSFER",
|
|
2195
2196
|
CANCEL = "CANCEL"
|
|
2196
2197
|
}
|
|
2197
2198
|
interface TransactionConfig {
|
|
@@ -2202,6 +2203,7 @@ interface TransactionConfig {
|
|
|
2202
2203
|
collectionAddress: string;
|
|
2203
2204
|
sdkConfig: SdkConfig;
|
|
2204
2205
|
marketplaceConfig: MarketplaceConfig;
|
|
2206
|
+
isWaaS: boolean;
|
|
2205
2207
|
}
|
|
2206
2208
|
interface BuyInput {
|
|
2207
2209
|
orderId: string;
|
|
@@ -2362,7 +2364,7 @@ declare class OrdersFetchError extends TransactionError {
|
|
|
2362
2364
|
}
|
|
2363
2365
|
type TransactionErrorTypes = ChainIdUnavailableError | TransactionReceiptError | PaymentModalTransactionError | CheckoutOptionsError | OrdersFetchError | TransactionConfirmationError | TransactionValidationError | MissingConfigError | MarketplaceConfigFetchError | ProjectNotFoundError | CollectionNotFoundError | InvalidContractTypeError | UnknownTransactionTypeError | NoStepsFoundError | NoExecutionStepError | UnexpectedStepsError | MissingPostStepError | InvalidSignatureStepError | MissingSignatureDataError | MissingStepDataError | OrderNotFoundError | TransactionConfirmationError | InvalidStepError | PaymentModalError | StepGenerationError | StepExecutionError | UserRejectedRequestError | NoMarketplaceConfigError | InsufficientFundsError | ChainSwitchError | TransactionSignatureError | TransactionExecutionError | NoWalletConnectedError | TransactionError;
|
|
2364
2366
|
|
|
2365
|
-
type UseTransactionMachineConfig = Omit<TransactionConfig, 'sdkConfig' | 'marketplaceConfig' | 'walletKind' | 'chains'>;
|
|
2367
|
+
type UseTransactionMachineConfig = Omit<TransactionConfig, 'sdkConfig' | 'marketplaceConfig' | 'walletKind' | 'chains' | 'isWaaS'>;
|
|
2366
2368
|
|
|
2367
2369
|
interface UseCancelOrderArgs extends Omit<UseTransactionMachineConfig, 'type'> {
|
|
2368
2370
|
onSuccess?: (hash: string) => void;
|
|
@@ -58,20 +58,20 @@ import {
|
|
|
58
58
|
useMarketplaceConfig,
|
|
59
59
|
useRoyaltyPercentage,
|
|
60
60
|
useTransferTokens
|
|
61
|
-
} from "../../chunk-
|
|
61
|
+
} from "../../chunk-Z3VR2KMP.js";
|
|
62
62
|
import "../../chunk-Y7YO5TLE.js";
|
|
63
63
|
import "../../chunk-7NJETFMF.js";
|
|
64
64
|
import "../../chunk-SBVLWSRZ.js";
|
|
65
65
|
import "../../chunk-NJ2GXOPW.js";
|
|
66
|
-
import "../../chunk-MJ4YU7RW.js";
|
|
67
66
|
import "../../chunk-OUZ42I6B.js";
|
|
68
|
-
import "../../chunk-
|
|
69
|
-
import "../../chunk-3OHM45R3.js";
|
|
70
|
-
import "../../chunk-WFE6OCYF.js";
|
|
67
|
+
import "../../chunk-MJ4YU7RW.js";
|
|
71
68
|
import "../../chunk-Q2BVDQ3G.js";
|
|
72
69
|
import "../../chunk-D3HRXVYJ.js";
|
|
73
70
|
import "../../chunk-3CXEYH2I.js";
|
|
74
71
|
import "../../chunk-T2AMWIKD.js";
|
|
72
|
+
import "../../chunk-MCI3KOSQ.js";
|
|
73
|
+
import "../../chunk-3OHM45R3.js";
|
|
74
|
+
import "../../chunk-WFE6OCYF.js";
|
|
75
75
|
export {
|
|
76
76
|
UseGenerateBuyTransactionArgsSchema,
|
|
77
77
|
balanceOfCollectibleOptions,
|
package/dist/react/index.js
CHANGED
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
useSellModal,
|
|
9
9
|
useSuccessfulPurchaseModal,
|
|
10
10
|
useTransferModal
|
|
11
|
-
} from "../chunk-
|
|
12
|
-
import "../chunk-
|
|
11
|
+
} from "../chunk-F42XMKDS.js";
|
|
12
|
+
import "../chunk-NMCGA2TB.js";
|
|
13
13
|
import "../chunk-FFCNYF3S.js";
|
|
14
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-RZSZNVEH.js";
|
|
15
15
|
import "../chunk-O642NH7U.js";
|
|
16
16
|
import {
|
|
17
17
|
MarketplaceProvider,
|
|
@@ -74,16 +74,13 @@ import {
|
|
|
74
74
|
useMarketplaceConfig,
|
|
75
75
|
useRoyaltyPercentage,
|
|
76
76
|
useTransferTokens
|
|
77
|
-
} from "../chunk-
|
|
77
|
+
} from "../chunk-Z3VR2KMP.js";
|
|
78
78
|
import "../chunk-Y7YO5TLE.js";
|
|
79
79
|
import "../chunk-7NJETFMF.js";
|
|
80
80
|
import "../chunk-SBVLWSRZ.js";
|
|
81
81
|
import "../chunk-NJ2GXOPW.js";
|
|
82
|
-
import "../chunk-MJ4YU7RW.js";
|
|
83
82
|
import "../chunk-OUZ42I6B.js";
|
|
84
|
-
import "../chunk-
|
|
85
|
-
import "../chunk-3OHM45R3.js";
|
|
86
|
-
import "../chunk-WFE6OCYF.js";
|
|
83
|
+
import "../chunk-MJ4YU7RW.js";
|
|
87
84
|
import "../chunk-Q2BVDQ3G.js";
|
|
88
85
|
import {
|
|
89
86
|
getQueryClient
|
|
@@ -92,6 +89,9 @@ import {
|
|
|
92
89
|
createWagmiConfig
|
|
93
90
|
} from "../chunk-3CXEYH2I.js";
|
|
94
91
|
import "../chunk-T2AMWIKD.js";
|
|
92
|
+
import "../chunk-MCI3KOSQ.js";
|
|
93
|
+
import "../chunk-3OHM45R3.js";
|
|
94
|
+
import "../chunk-WFE6OCYF.js";
|
|
95
95
|
export {
|
|
96
96
|
CollectibleCard,
|
|
97
97
|
MarketplaceProvider,
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
import {
|
|
3
3
|
CollectibleCard
|
|
4
|
-
} from "../../../chunk-
|
|
5
|
-
import "../../../chunk-
|
|
4
|
+
} from "../../../chunk-F42XMKDS.js";
|
|
5
|
+
import "../../../chunk-NMCGA2TB.js";
|
|
6
6
|
import "../../../chunk-FFCNYF3S.js";
|
|
7
|
-
import "../../../chunk-
|
|
7
|
+
import "../../../chunk-RZSZNVEH.js";
|
|
8
8
|
import "../../../chunk-O642NH7U.js";
|
|
9
|
-
import "../../../chunk-
|
|
9
|
+
import "../../../chunk-Z3VR2KMP.js";
|
|
10
10
|
import "../../../chunk-Y7YO5TLE.js";
|
|
11
11
|
import "../../../chunk-7NJETFMF.js";
|
|
12
12
|
import "../../../chunk-SBVLWSRZ.js";
|
|
13
13
|
import "../../../chunk-NJ2GXOPW.js";
|
|
14
|
-
import "../../../chunk-MJ4YU7RW.js";
|
|
15
14
|
import "../../../chunk-OUZ42I6B.js";
|
|
16
|
-
import "../../../chunk-
|
|
17
|
-
import "../../../chunk-3OHM45R3.js";
|
|
18
|
-
import "../../../chunk-WFE6OCYF.js";
|
|
15
|
+
import "../../../chunk-MJ4YU7RW.js";
|
|
19
16
|
import "../../../chunk-Q2BVDQ3G.js";
|
|
20
17
|
import "../../../chunk-D3HRXVYJ.js";
|
|
21
18
|
import "../../../chunk-3CXEYH2I.js";
|
|
22
19
|
import "../../../chunk-T2AMWIKD.js";
|
|
20
|
+
import "../../../chunk-MCI3KOSQ.js";
|
|
21
|
+
import "../../../chunk-3OHM45R3.js";
|
|
22
|
+
import "../../../chunk-WFE6OCYF.js";
|
|
23
23
|
export {
|
|
24
24
|
CollectibleCard
|
|
25
25
|
};
|
package/dist/react/ui/index.d.ts
CHANGED
|
@@ -10,24 +10,6 @@ import 'zod';
|
|
|
10
10
|
|
|
11
11
|
declare const ModalProvider: () => react_jsx_runtime.JSX.Element;
|
|
12
12
|
|
|
13
|
-
type OnApproveTokenError = (error: Error | unknown) => void;
|
|
14
|
-
type BaseErrorCallbacks = {
|
|
15
|
-
onApproveTokenError?: OnApproveTokenError;
|
|
16
|
-
onSwitchingNotSupportedError?: () => void;
|
|
17
|
-
onUserRejectedSwitchingChainRequestError?: () => void;
|
|
18
|
-
onSwitchChainError?: (error: Error | unknown) => void;
|
|
19
|
-
};
|
|
20
|
-
type BaseSuccessCallbacks = {
|
|
21
|
-
onApproveTokenSuccess?: () => void;
|
|
22
|
-
onSwitchChainSuccess?: () => void;
|
|
23
|
-
};
|
|
24
|
-
type TransferErrorCallbacks = BaseErrorCallbacks & {
|
|
25
|
-
onTransferError?: (error: Error | unknown) => void;
|
|
26
|
-
};
|
|
27
|
-
type TransferSuccessCallbacks = BaseSuccessCallbacks & {
|
|
28
|
-
onTransferSuccess?: () => void;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
13
|
type ModalCallbacks = {
|
|
32
14
|
onSuccess?: (hash: Hash) => void;
|
|
33
15
|
onError?: (error: Error) => void;
|
|
@@ -83,14 +65,15 @@ declare const useSuccessfulPurchaseModal: (callbacks?: ModalCallbacks) => {
|
|
|
83
65
|
|
|
84
66
|
type ShowTransferModalArgs = {
|
|
85
67
|
collectionAddress: Hex;
|
|
86
|
-
|
|
68
|
+
collectibleId: string;
|
|
87
69
|
chainId: string;
|
|
70
|
+
callbacks?: ModalCallbacks;
|
|
88
71
|
};
|
|
89
72
|
declare const useTransferModal: () => {
|
|
90
73
|
show: (args: ShowTransferModalArgs) => void;
|
|
91
74
|
close: () => void;
|
|
92
|
-
onError: (callbacks:
|
|
93
|
-
onSuccess: (callbacks:
|
|
75
|
+
onError: (callbacks: ModalCallbacks) => void;
|
|
76
|
+
onSuccess: (callbacks: ModalCallbacks) => void;
|
|
94
77
|
};
|
|
95
78
|
|
|
96
79
|
type ShowSellModalArgs = {
|
package/dist/react/ui/index.js
CHANGED
|
@@ -8,25 +8,25 @@ import {
|
|
|
8
8
|
useSellModal,
|
|
9
9
|
useSuccessfulPurchaseModal,
|
|
10
10
|
useTransferModal
|
|
11
|
-
} from "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
11
|
+
} from "../../chunk-F42XMKDS.js";
|
|
12
|
+
import "../../chunk-NMCGA2TB.js";
|
|
13
13
|
import "../../chunk-FFCNYF3S.js";
|
|
14
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-RZSZNVEH.js";
|
|
15
15
|
import "../../chunk-O642NH7U.js";
|
|
16
|
-
import "../../chunk-
|
|
16
|
+
import "../../chunk-Z3VR2KMP.js";
|
|
17
17
|
import "../../chunk-Y7YO5TLE.js";
|
|
18
18
|
import "../../chunk-7NJETFMF.js";
|
|
19
19
|
import "../../chunk-SBVLWSRZ.js";
|
|
20
20
|
import "../../chunk-NJ2GXOPW.js";
|
|
21
|
-
import "../../chunk-MJ4YU7RW.js";
|
|
22
21
|
import "../../chunk-OUZ42I6B.js";
|
|
23
|
-
import "../../chunk-
|
|
24
|
-
import "../../chunk-3OHM45R3.js";
|
|
25
|
-
import "../../chunk-WFE6OCYF.js";
|
|
22
|
+
import "../../chunk-MJ4YU7RW.js";
|
|
26
23
|
import "../../chunk-Q2BVDQ3G.js";
|
|
27
24
|
import "../../chunk-D3HRXVYJ.js";
|
|
28
25
|
import "../../chunk-3CXEYH2I.js";
|
|
29
26
|
import "../../chunk-T2AMWIKD.js";
|
|
27
|
+
import "../../chunk-MCI3KOSQ.js";
|
|
28
|
+
import "../../chunk-3OHM45R3.js";
|
|
29
|
+
import "../../chunk-WFE6OCYF.js";
|
|
30
30
|
export {
|
|
31
31
|
CollectibleCard,
|
|
32
32
|
ModalProvider,
|
package/dist/styles/index.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ declare const alertMessageBox: string;
|
|
|
43
43
|
declare const alertMessageBoxVariants: Record<"info" | "warning", string>;
|
|
44
44
|
|
|
45
45
|
declare const switchChainModalContent: string;
|
|
46
|
-
declare const switchChainCta: Record<"
|
|
46
|
+
declare const switchChainCta: Record<"default" | "pending", string>;
|
|
47
47
|
|
|
48
48
|
declare const collectiblesGrid: string;
|
|
49
49
|
declare const collectiblesGridItem: string;
|
package/dist/styles/index.js
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
truncateEnd,
|
|
8
8
|
truncateMiddle
|
|
9
9
|
} from "../chunk-OUZ42I6B.js";
|
|
10
|
+
import "../chunk-T2AMWIKD.js";
|
|
10
11
|
import "../chunk-MCI3KOSQ.js";
|
|
11
12
|
import {
|
|
12
13
|
EIP2981_ABI,
|
|
@@ -18,7 +19,6 @@ import {
|
|
|
18
19
|
ERC20_ABI,
|
|
19
20
|
ERC721_ABI
|
|
20
21
|
} from "../chunk-WFE6OCYF.js";
|
|
21
|
-
import "../chunk-T2AMWIKD.js";
|
|
22
22
|
export {
|
|
23
23
|
EIP2981_ABI,
|
|
24
24
|
ERC1155_ABI,
|
package/package.json
CHANGED
|
@@ -67,6 +67,7 @@ export enum TransactionType {
|
|
|
67
67
|
SELL = 'SELL',
|
|
68
68
|
LISTING = 'LISTING',
|
|
69
69
|
OFFER = 'OFFER',
|
|
70
|
+
TRANSFER = 'TRANSFER',
|
|
70
71
|
CANCEL = 'CANCEL',
|
|
71
72
|
}
|
|
72
73
|
|
|
@@ -78,6 +79,7 @@ export interface TransactionConfig {
|
|
|
78
79
|
collectionAddress: string;
|
|
79
80
|
sdkConfig: SdkConfig;
|
|
80
81
|
marketplaceConfig: MarketplaceConfig;
|
|
82
|
+
isWaaS: boolean;
|
|
81
83
|
}
|
|
82
84
|
|
|
83
85
|
interface StateConfig {
|
|
@@ -360,7 +362,10 @@ export class TransactionMachine {
|
|
|
360
362
|
|
|
361
363
|
await this.transition(TransactionState.SWITCH_CHAIN);
|
|
362
364
|
try {
|
|
363
|
-
|
|
365
|
+
if (!this.config.config.isWaaS) {
|
|
366
|
+
await this.switchChainFn(this.config.config.chainId);
|
|
367
|
+
}
|
|
368
|
+
|
|
364
369
|
await this.walletClient.switchChain({
|
|
365
370
|
id: Number(this.config.config.chainId),
|
|
366
371
|
});
|
|
@@ -413,6 +418,8 @@ export class TransactionMachine {
|
|
|
413
418
|
|
|
414
419
|
private async executeTransaction(step: Step): Promise<Hash> {
|
|
415
420
|
try {
|
|
421
|
+
await this.switchChain();
|
|
422
|
+
|
|
416
423
|
const transactionData = {
|
|
417
424
|
account: this.getAccount(),
|
|
418
425
|
chain: this.getChainForTransaction(),
|
|
@@ -438,6 +445,8 @@ export class TransactionMachine {
|
|
|
438
445
|
throw new MissingPostStepError();
|
|
439
446
|
}
|
|
440
447
|
|
|
448
|
+
await this.switchChain();
|
|
449
|
+
|
|
441
450
|
let signature: Hex;
|
|
442
451
|
if (!step.signature) {
|
|
443
452
|
throw new MissingSignatureDataError();
|
|
@@ -594,8 +603,6 @@ export class TransactionMachine {
|
|
|
594
603
|
throw new MissingStepDataError();
|
|
595
604
|
}
|
|
596
605
|
|
|
597
|
-
await this.switchChain();
|
|
598
|
-
|
|
599
606
|
if (step.id === StepType.buy) {
|
|
600
607
|
await this.executeBuyStep({ step, props: props as BuyInput });
|
|
601
608
|
return;
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
|
|
19
19
|
export type UseTransactionMachineConfig = Omit<
|
|
20
20
|
TransactionConfig,
|
|
21
|
-
'sdkConfig' | 'marketplaceConfig' | 'walletKind' | 'chains'
|
|
21
|
+
'sdkConfig' | 'marketplaceConfig' | 'walletKind' | 'chains' | 'isWaaS'
|
|
22
22
|
>;
|
|
23
23
|
|
|
24
24
|
export const useTransactionMachine = (
|
|
@@ -41,7 +41,12 @@ export const useTransactionMachine = (
|
|
|
41
41
|
|
|
42
42
|
const { connector, isConnected } = useAccount();
|
|
43
43
|
const walletKind =
|
|
44
|
-
connector?.id === 'sequence'
|
|
44
|
+
connector?.id === 'sequence'
|
|
45
|
+
? WalletKind.sequence
|
|
46
|
+
: WalletKind.unknown;
|
|
47
|
+
|
|
48
|
+
// TODO: remove this once we have a better way to check if the wallet is a WAAS wallet
|
|
49
|
+
const isWaaS = connector?.id.endsWith('waas') || false;
|
|
45
50
|
|
|
46
51
|
if (!isConnected) {
|
|
47
52
|
// No wallet connected, TODO: add some sort of state for this
|
|
@@ -74,19 +79,27 @@ export const useTransactionMachine = (
|
|
|
74
79
|
|
|
75
80
|
const machine = new TransactionMachine(
|
|
76
81
|
{
|
|
77
|
-
config: {
|
|
82
|
+
config: {
|
|
83
|
+
sdkConfig,
|
|
84
|
+
marketplaceConfig,
|
|
85
|
+
walletKind,
|
|
86
|
+
chains,
|
|
87
|
+
...config,
|
|
88
|
+
isWaaS
|
|
89
|
+
},
|
|
78
90
|
onSuccess,
|
|
79
91
|
onTransactionSent,
|
|
80
92
|
},
|
|
81
93
|
walletClient,
|
|
82
94
|
getPublicRpcClient(config.chainId),
|
|
83
95
|
openSelectPaymentModal,
|
|
84
|
-
async (
|
|
96
|
+
async () =>
|
|
85
97
|
new Promise((resolve, reject) => {
|
|
86
98
|
showSwitchChainModal({
|
|
87
|
-
chainIdToSwitchTo: Number(chainId),
|
|
99
|
+
chainIdToSwitchTo: Number(config.chainId),
|
|
88
100
|
onSuccess: resolve,
|
|
89
101
|
onError: reject,
|
|
102
|
+
onClose: reject,
|
|
90
103
|
});
|
|
91
104
|
}),
|
|
92
105
|
);
|