@0xsequence/marketplace-sdk 0.3.5 → 0.3.7
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-URTXTVOU.js → chunk-3LGNSRBR.js} +476 -417
- package/dist/chunk-3LGNSRBR.js.map +1 -0
- package/dist/{chunk-RZSZNVEH.js → chunk-L6GSYPCR.js} +5 -5
- package/dist/{chunk-RZSZNVEH.js.map → chunk-L6GSYPCR.js.map} +1 -1
- package/dist/{chunk-Q57TEA3Z.js → chunk-NMCGA2TB.js} +4 -2
- package/dist/chunk-NMCGA2TB.js.map +1 -0
- package/dist/{chunk-6LQST3KZ.js → chunk-QGELCUYG.js} +27 -15
- package/dist/chunk-QGELCUYG.js.map +1 -0
- package/dist/index.js +6 -6
- package/dist/react/hooks/index.d.ts +3 -1
- package/dist/react/hooks/index.js +3 -3
- package/dist/react/index.js +6 -6
- package/dist/react/ui/components/index.js +6 -6
- package/dist/react/ui/index.d.ts +4 -21
- package/dist/react/ui/index.js +6 -6
- 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/abi/index.js +5 -5
- package/dist/utils/index.js +5 -5
- 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/components/_internals/custom-select/CustomSelect.tsx +4 -4
- 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/currencyOptionsSelect/index.tsx +15 -7
- package/src/react/ui/modals/_internal/components/expirationDateSelect/index.tsx +9 -18
- package/src/react/ui/modals/_internal/components/priceInput/index.tsx +1 -1
- 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-Q57TEA3Z.js.map +0 -1
- package/dist/chunk-URTXTVOU.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
|
@@ -4,102 +4,119 @@ import {
|
|
|
4
4
|
Skeleton,
|
|
5
5
|
Text,
|
|
6
6
|
} from '@0xsequence/design-system';
|
|
7
|
-
import type { ChainId } from '@0xsequence/network';
|
|
8
7
|
import { observer } from '@legendapp/state/react';
|
|
9
8
|
import { Close, Content, Overlay, Portal, Root } from '@radix-ui/react-dialog';
|
|
10
|
-
import type
|
|
11
|
-
import { useEffect } from 'react';
|
|
12
|
-
import type
|
|
13
|
-
import { useTransactionReceipt } from 'wagmi';
|
|
9
|
+
import { type QueryKey } from '@tanstack/react-query';
|
|
10
|
+
import { useEffect, useState } from 'react';
|
|
11
|
+
import { WaitForTransactionReceiptTimeoutError, type Hex } from 'viem';
|
|
14
12
|
import type { Price } from '../../../../../../types';
|
|
15
|
-
import type { BaseCallbacks } from '../../../../../../types/callbacks';
|
|
16
13
|
import { getQueryClient } from '../../../../../_internal';
|
|
17
14
|
import { useCollectible } from '../../../../../hooks';
|
|
18
15
|
import TransactionFooter from '../transaction-footer';
|
|
19
16
|
import TransactionPreview from '../transactionPreview';
|
|
20
|
-
import {
|
|
21
|
-
type ConfirmationStatus,
|
|
22
|
-
type StatusOrderType,
|
|
23
|
-
transactionStatusModal$,
|
|
24
|
-
} from './store';
|
|
17
|
+
import { TransactionStatus, transactionStatusModal$ } from './store';
|
|
25
18
|
import {
|
|
26
19
|
closeButton,
|
|
27
20
|
dialogOverlay,
|
|
28
21
|
transactionStatusModalContent,
|
|
29
22
|
} from './styles.css';
|
|
23
|
+
import { ChainId } from '@0xsequence/network';
|
|
24
|
+
import { getPublicRpcClient } from '../../../../../../utils';
|
|
25
|
+
import { TRANSACTION_CONFIRMATIONS_DEFAULT } from '@0xsequence/kit';
|
|
26
|
+
import { TransactionType } from '../../../../../_internal/transaction-machine/execute-transaction';
|
|
27
|
+
import { ModalCallbacks } from '../../types';
|
|
28
|
+
import { getTransactionStatusModalTitle } from './util/getTitle';
|
|
29
|
+
import { getTransactionStatusModalMessage } from './util/getMessage';
|
|
30
30
|
|
|
31
31
|
export type ShowTransactionStatusModalArgs = {
|
|
32
32
|
hash: Hex;
|
|
33
33
|
price?: Price;
|
|
34
34
|
collectionAddress: Hex;
|
|
35
35
|
chainId: string;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
type: StatusOrderType;
|
|
40
|
-
callbacks?: BaseCallbacks;
|
|
36
|
+
collectibleId: string;
|
|
37
|
+
type: TransactionType;
|
|
38
|
+
callbacks?: ModalCallbacks;
|
|
41
39
|
queriesToInvalidate?: QueryKey[];
|
|
40
|
+
confirmations?: number;
|
|
41
|
+
blocked?: boolean;
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
export const useTransactionStatusModal = () => {
|
|
45
45
|
return {
|
|
46
|
-
show: (args: ShowTransactionStatusModalArgs) =>
|
|
47
|
-
|
|
46
|
+
show: (args: ShowTransactionStatusModalArgs) => {
|
|
47
|
+
if (args.blocked) return;
|
|
48
|
+
|
|
49
|
+
transactionStatusModal$.open(args);
|
|
50
|
+
},
|
|
48
51
|
close: () => transactionStatusModal$.close(),
|
|
49
52
|
};
|
|
50
53
|
};
|
|
51
54
|
|
|
52
55
|
const TransactionStatusModal = observer(() => {
|
|
53
56
|
const {
|
|
57
|
+
type,
|
|
54
58
|
hash,
|
|
55
59
|
price,
|
|
56
60
|
collectionAddress,
|
|
57
61
|
chainId,
|
|
58
|
-
|
|
59
|
-
getTitle,
|
|
60
|
-
getMessage,
|
|
62
|
+
collectibleId,
|
|
61
63
|
callbacks,
|
|
62
64
|
queriesToInvalidate,
|
|
65
|
+
confirmations,
|
|
63
66
|
} = transactionStatusModal$.state.get();
|
|
64
|
-
const { data: collectible } = useCollectible({
|
|
67
|
+
const { data: collectible, isLoading: collectibleLoading } = useCollectible({
|
|
65
68
|
collectionAddress,
|
|
66
69
|
chainId,
|
|
67
|
-
collectibleId
|
|
70
|
+
collectibleId,
|
|
68
71
|
});
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
const [transactionStatus, setTransactionStatus] =
|
|
73
|
+
useState<TransactionStatus>('PENDING');
|
|
74
|
+
const title = getTransactionStatusModalTitle({
|
|
75
|
+
transactionStatus,
|
|
76
|
+
transactionType: type!,
|
|
77
|
+
});
|
|
78
|
+
const message = getTransactionStatusModalMessage({
|
|
79
|
+
transactionStatus,
|
|
80
|
+
transactionType: type!,
|
|
81
|
+
collectibleName: collectible?.name || '',
|
|
82
|
+
});
|
|
83
|
+
const { onError, onSuccess }: ModalCallbacks = callbacks || {};
|
|
80
84
|
const queryClient = getQueryClient();
|
|
85
|
+
const publicClient = chainId ? getPublicRpcClient(chainId) : null;
|
|
86
|
+
const waitForTransactionReceiptPromise =
|
|
87
|
+
publicClient?.waitForTransactionReceipt({
|
|
88
|
+
confirmations: confirmations || TRANSACTION_CONFIRMATIONS_DEFAULT,
|
|
89
|
+
hash: hash!,
|
|
90
|
+
});
|
|
81
91
|
|
|
82
92
|
useEffect(() => {
|
|
83
93
|
if (!transactionStatusModal$.isOpen.get()) return;
|
|
84
94
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
console.log('Waiting for transaction receipt ...');
|
|
96
|
+
waitForTransactionReceiptPromise
|
|
97
|
+
?.then((receipt) => {
|
|
98
|
+
if (receipt.status === 'success') {
|
|
99
|
+
console.log('receipt', receipt);
|
|
100
|
+
setTransactionStatus('SUCCESS');
|
|
101
|
+
}
|
|
102
|
+
})
|
|
103
|
+
.catch((error) => {
|
|
104
|
+
if (error instanceof WaitForTransactionReceiptTimeoutError) {
|
|
105
|
+
setTransactionStatus('TIMEOUT');
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
setTransactionStatus('FAILED');
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
if (queriesToInvalidate) {
|
|
96
113
|
queryClient.invalidateQueries({ queryKey: [...queriesToInvalidate] });
|
|
97
114
|
}
|
|
98
115
|
|
|
99
116
|
return () => {
|
|
100
|
-
|
|
117
|
+
setTransactionStatus('PENDING');
|
|
101
118
|
};
|
|
102
|
-
}, [
|
|
119
|
+
}, [onSuccess, onError, transactionStatusModal$.isOpen.get()]);
|
|
103
120
|
|
|
104
121
|
return (
|
|
105
122
|
<Root open={transactionStatusModal$.isOpen.get()}>
|
|
@@ -128,24 +145,25 @@ const TransactionStatusModal = observer(() => {
|
|
|
128
145
|
<Skeleton width="20" height="4" />
|
|
129
146
|
)}
|
|
130
147
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
148
|
+
<TransactionPreview
|
|
149
|
+
price={price}
|
|
150
|
+
collectionAddress={collectionAddress}
|
|
151
|
+
chainId={chainId}
|
|
152
|
+
collectible={collectible}
|
|
153
|
+
collectibleLoading={collectibleLoading}
|
|
154
|
+
currencyImageUrl={price?.currency.imageUrl}
|
|
155
|
+
isConfirming={transactionStatus === 'PENDING'}
|
|
156
|
+
isConfirmed={transactionStatus === 'SUCCESS'}
|
|
157
|
+
isFailed={transactionStatus === 'FAILED'}
|
|
158
|
+
isTimeout={transactionStatus === 'TIMEOUT'}
|
|
159
|
+
/>
|
|
143
160
|
|
|
144
161
|
<TransactionFooter
|
|
145
162
|
transactionHash={hash!}
|
|
146
|
-
isConfirming={
|
|
147
|
-
isConfirmed={
|
|
148
|
-
isFailed={
|
|
163
|
+
isConfirming={transactionStatus === 'PENDING'}
|
|
164
|
+
isConfirmed={transactionStatus === 'SUCCESS'}
|
|
165
|
+
isFailed={transactionStatus === 'FAILED'}
|
|
166
|
+
isTimeout={transactionStatus === 'TIMEOUT'}
|
|
149
167
|
chainId={chainId as unknown as ChainId}
|
|
150
168
|
/>
|
|
151
169
|
|
|
@@ -1,29 +1,19 @@
|
|
|
1
|
-
import type { TransactionStatus } from '@0xsequence/indexer';
|
|
2
1
|
import { observable } from '@legendapp/state';
|
|
3
2
|
import type { QueryKey } from '@tanstack/react-query';
|
|
4
3
|
import type { Hex } from 'viem';
|
|
5
4
|
import type { ShowTransactionStatusModalArgs } from '.';
|
|
6
5
|
import type { Price } from '../../../../../../types';
|
|
7
|
-
import
|
|
8
|
-
import
|
|
6
|
+
import { TransactionType } from '../../../../../_internal/transaction-machine/execute-transaction';
|
|
7
|
+
import { ModalCallbacks } from '../../types';
|
|
9
8
|
|
|
10
9
|
export type ConfirmationStatus = {
|
|
11
10
|
isConfirming: boolean;
|
|
12
11
|
isConfirmed: boolean;
|
|
13
12
|
isFailed: boolean;
|
|
13
|
+
isTimeout: boolean;
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
export type
|
|
17
|
-
|
|
18
|
-
export type StatusOrderType =
|
|
19
|
-
| Pick<
|
|
20
|
-
typeof StepType,
|
|
21
|
-
'sell' | 'createListing' | 'createOffer' | 'buy'
|
|
22
|
-
>[keyof Pick<
|
|
23
|
-
typeof StepType,
|
|
24
|
-
'sell' | 'createListing' | 'createOffer' | 'buy'
|
|
25
|
-
>]
|
|
26
|
-
| 'transfer';
|
|
16
|
+
export type TransactionStatus = 'PENDING' | 'SUCCESS' | 'FAILED' | 'TIMEOUT';
|
|
27
17
|
|
|
28
18
|
export interface TransactionStatusModalState {
|
|
29
19
|
isOpen: boolean;
|
|
@@ -31,16 +21,16 @@ export interface TransactionStatusModalState {
|
|
|
31
21
|
close: () => void;
|
|
32
22
|
state: {
|
|
33
23
|
hash: Hex | undefined;
|
|
34
|
-
status:
|
|
35
|
-
type:
|
|
24
|
+
status: TransactionStatus;
|
|
25
|
+
type: TransactionType | undefined;
|
|
36
26
|
price: Price | undefined;
|
|
37
27
|
collectionAddress: Hex;
|
|
38
28
|
chainId: string;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
getMessage?: (params: ConfirmationStatus) => string;
|
|
42
|
-
callbacks?: BaseCallbacks;
|
|
29
|
+
collectibleId: string;
|
|
30
|
+
callbacks?: ModalCallbacks;
|
|
43
31
|
queriesToInvalidate?: QueryKey[];
|
|
32
|
+
confirmations?: number;
|
|
33
|
+
blocked?: boolean;
|
|
44
34
|
};
|
|
45
35
|
}
|
|
46
36
|
|
|
@@ -51,12 +41,12 @@ export const initialState: TransactionStatusModalState = {
|
|
|
51
41
|
price,
|
|
52
42
|
collectionAddress,
|
|
53
43
|
chainId,
|
|
54
|
-
|
|
55
|
-
getTitle,
|
|
56
|
-
getMessage,
|
|
44
|
+
collectibleId,
|
|
57
45
|
type,
|
|
58
46
|
callbacks,
|
|
59
47
|
queriesToInvalidate,
|
|
48
|
+
confirmations,
|
|
49
|
+
blocked,
|
|
60
50
|
}) => {
|
|
61
51
|
transactionStatusModal$.state.set({
|
|
62
52
|
...transactionStatusModal$.state.get(),
|
|
@@ -64,12 +54,12 @@ export const initialState: TransactionStatusModalState = {
|
|
|
64
54
|
price,
|
|
65
55
|
collectionAddress,
|
|
66
56
|
chainId,
|
|
67
|
-
|
|
68
|
-
getTitle,
|
|
69
|
-
getMessage,
|
|
57
|
+
collectibleId,
|
|
70
58
|
type,
|
|
71
59
|
callbacks,
|
|
72
60
|
queriesToInvalidate,
|
|
61
|
+
confirmations,
|
|
62
|
+
blocked,
|
|
73
63
|
});
|
|
74
64
|
transactionStatusModal$.isOpen.set(true);
|
|
75
65
|
},
|
|
@@ -85,10 +75,12 @@ export const initialState: TransactionStatusModalState = {
|
|
|
85
75
|
price: undefined,
|
|
86
76
|
collectionAddress: '' as Hex,
|
|
87
77
|
chainId: '',
|
|
88
|
-
|
|
89
|
-
getTitle: undefined,
|
|
90
|
-
getMessage: undefined,
|
|
78
|
+
collectibleId: '',
|
|
91
79
|
type: undefined,
|
|
80
|
+
callbacks: undefined,
|
|
81
|
+
queriesToInvalidate: [],
|
|
82
|
+
confirmations: -1,
|
|
83
|
+
blocked: false,
|
|
92
84
|
},
|
|
93
85
|
};
|
|
94
86
|
|
package/src/react/ui/modals/_internal/components/transactionStatusModal/util/getFormattedType.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TransactionType } from '../../../../../../_internal/transaction-machine/execute-transaction';
|
|
2
|
+
|
|
3
|
+
export function getFormattedType(
|
|
4
|
+
transactionType: TransactionType,
|
|
5
|
+
verb: boolean = false,
|
|
6
|
+
): string {
|
|
7
|
+
switch (transactionType) {
|
|
8
|
+
case TransactionType.TRANSFER:
|
|
9
|
+
return verb ? 'transferred' : 'transfer';
|
|
10
|
+
case TransactionType.LISTING:
|
|
11
|
+
return verb ? 'listed' : 'listing';
|
|
12
|
+
case TransactionType.BUY:
|
|
13
|
+
return verb ? 'purchased' : 'purchase';
|
|
14
|
+
case TransactionType.SELL:
|
|
15
|
+
return verb ? 'sold' : 'sale';
|
|
16
|
+
case TransactionType.CANCEL:
|
|
17
|
+
return verb ? 'cancelled' : 'cancellation';
|
|
18
|
+
case TransactionType.OFFER:
|
|
19
|
+
return verb ? 'offered' : 'offer';
|
|
20
|
+
default:
|
|
21
|
+
return 'transaction';
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { TransactionType } from '../../../../../../_internal/transaction-machine/execute-transaction';
|
|
2
|
+
import { TransactionStatus } from '../store';
|
|
3
|
+
import { getFormattedType } from './getFormattedType';
|
|
4
|
+
|
|
5
|
+
export function getTransactionStatusModalMessage({
|
|
6
|
+
transactionStatus,
|
|
7
|
+
transactionType,
|
|
8
|
+
collectibleName,
|
|
9
|
+
}: {
|
|
10
|
+
transactionStatus: TransactionStatus;
|
|
11
|
+
transactionType: TransactionType;
|
|
12
|
+
collectibleName: string;
|
|
13
|
+
}): string {
|
|
14
|
+
// without this, the text will be "Your cancellation CollectibleXXX has failed." which sounds weird
|
|
15
|
+
const hideCollectibleName = transactionType === 'CANCEL';
|
|
16
|
+
|
|
17
|
+
switch (transactionStatus) {
|
|
18
|
+
case 'PENDING':
|
|
19
|
+
return `You just ${getFormattedType(transactionType, true)}${!hideCollectibleName ? ` ${collectibleName}` : ''}. It should be confirmed on the blockchain shortly.`;
|
|
20
|
+
case 'SUCCESS':
|
|
21
|
+
return `You just ${getFormattedType(transactionType, true)}${!hideCollectibleName ? ` ${collectibleName}` : ''}. It’s been confirmed on the blockchain!`;
|
|
22
|
+
case 'FAILED':
|
|
23
|
+
return `Your ${getFormattedType(transactionType)} has failed.`;
|
|
24
|
+
case 'TIMEOUT':
|
|
25
|
+
return `Your ${getFormattedType(transactionType)} takes too long. Click the link below to track it on the explorer.`;
|
|
26
|
+
default:
|
|
27
|
+
return 'Your transaction is processing';
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { TransactionType } from '../../../../../../_internal/transaction-machine/execute-transaction';
|
|
2
|
+
import { TransactionStatus } from '../store';
|
|
3
|
+
import { getFormattedType } from './getFormattedType';
|
|
4
|
+
|
|
5
|
+
export function getTransactionStatusModalTitle({
|
|
6
|
+
transactionStatus,
|
|
7
|
+
transactionType,
|
|
8
|
+
}: {
|
|
9
|
+
transactionStatus: TransactionStatus;
|
|
10
|
+
transactionType: TransactionType;
|
|
11
|
+
}): string {
|
|
12
|
+
switch (transactionStatus) {
|
|
13
|
+
case 'PENDING':
|
|
14
|
+
return `Your ${getFormattedType(transactionType)} is processing`;
|
|
15
|
+
case 'SUCCESS':
|
|
16
|
+
return `Your ${getFormattedType(transactionType)} has processed`;
|
|
17
|
+
case 'FAILED':
|
|
18
|
+
return `Your ${getFormattedType(transactionType)} has failed`;
|
|
19
|
+
case 'TIMEOUT':
|
|
20
|
+
return `Your ${getFormattedType(transactionType)} takes too long`;
|
|
21
|
+
default:
|
|
22
|
+
return 'Your transaction is processing';
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function getTransactionStatusModalSpinnerTitle({
|
|
27
|
+
transactionStatus,
|
|
28
|
+
}: {
|
|
29
|
+
transactionStatus: TransactionStatus;
|
|
30
|
+
}): string {
|
|
31
|
+
switch (transactionStatus) {
|
|
32
|
+
case 'PENDING':
|
|
33
|
+
return 'Processing transaction';
|
|
34
|
+
case 'SUCCESS':
|
|
35
|
+
return 'Transaction completed';
|
|
36
|
+
case 'FAILED':
|
|
37
|
+
return 'Transaction failed';
|
|
38
|
+
case 'TIMEOUT':
|
|
39
|
+
return 'Taking too long';
|
|
40
|
+
default:
|
|
41
|
+
return 'Processing transaction';
|
|
42
|
+
}
|
|
43
|
+
}
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./src/consts.ts","./src/index.ts","./src/react/index.ts","./src/react/provider.tsx","./src/react/_internal/consts.ts","./src/react/_internal/get-provider.ts","./src/react/_internal/index.ts","./src/react/_internal/types.ts","./src/react/_internal/api/get-query-client.ts","./src/react/_internal/api/index.ts","./src/react/_internal/api/marketplace-api.ts","./src/react/_internal/api/marketplace.gen.ts","./src/react/_internal/api/query-keys.ts","./src/react/_internal/api/services.ts","./src/react/_internal/api/zod-schema.ts","./src/react/_internal/transaction-machine/execute-transaction.ts","./src/react/_internal/transaction-machine/logger.ts","./src/react/_internal/transaction-machine/usetransactionmachine.ts","./src/react/_internal/wagmi/create-config.ts","./src/react/_internal/wagmi/embedded.ts","./src/react/_internal/wagmi/index.ts","./src/react/_internal/wagmi/universal.ts","./src/react/hooks/index.ts","./src/react/hooks/usebalanceofcollectible.tsx","./src/react/hooks/usebuycollectable.tsx","./src/react/hooks/usecancelorder.tsx","./src/react/hooks/usecheckoutoptions.tsx","./src/react/hooks/usecollectible.tsx","./src/react/hooks/usecollection.tsx","./src/react/hooks/useconfig.tsx","./src/react/hooks/usecountlistingsforcollectible.tsx","./src/react/hooks/usecountofcollectables.tsx","./src/react/hooks/usecountoffersforcollectible.tsx","./src/react/hooks/usecreatelisting.tsx","./src/react/hooks/usecurrencies.tsx","./src/react/hooks/usecurrency.tsx","./src/react/hooks/usefilters.tsx","./src/react/hooks/usefloororder.tsx","./src/react/hooks/usegeneratebuytransaction.tsx","./src/react/hooks/usegeneratecanceltransaction.tsx","./src/react/hooks/usegeneratelistingtransaction.tsx","./src/react/hooks/usegenerateoffertransaction.tsx","./src/react/hooks/usegenerateselltransaction.tsx","./src/react/hooks/usehighestoffer.tsx","./src/react/hooks/uselistbalances.tsx","./src/react/hooks/uselistcollectibles.tsx","./src/react/hooks/uselistcollections.tsx","./src/react/hooks/uselistlistingsforcollectible.tsx","./src/react/hooks/uselistoffersforcollectible.tsx","./src/react/hooks/uselowestlisting.tsx","./src/react/hooks/usemakeoffer.tsx","./src/react/hooks/usemarketplaceconfig.tsx","./src/react/hooks/useroyaltypercentage.tsx","./src/react/hooks/usesell.tsx","./src/react/hooks/usetransfertokens.tsx","./src/react/hooks/options/marketplaceconfigoptions.ts","./src/react/ssr/create-ssr-client.ts","./src/react/ssr/index.ts","./src/react/ui/index.ts","./src/react/ui/components/index.ts","./src/react/ui/components/_internals/action-button/actionbutton.tsx","./src/react/ui/components/_internals/custom-network-image/customnetworkimage.tsx","./src/react/ui/components/_internals/custom-network-image/styles.css.ts","./src/react/ui/components/_internals/custom-select/customselect.tsx","./src/react/ui/components/_internals/custom-select/styles.css.ts","./src/react/ui/components/_internals/pill/pill.tsx","./src/react/ui/components/collectible-card/collectiblecard.tsx","./src/react/ui/components/collectible-card/footer.tsx","./src/react/ui/components/collectible-card/styles.css.ts","./src/react/ui/icons/arrowup.tsx","./src/react/ui/icons/bell.tsx","./src/react/ui/icons/calendaricon.tsx","./src/react/ui/icons/diamondeye.tsx","./src/react/ui/icons/infoicon.tsx","./src/react/ui/icons/inventoryicon.tsx","./src/react/ui/icons/minusicon.tsx","./src/react/ui/icons/plusicon.tsx","./src/react/ui/icons/positivecircleicon.tsx","./src/react/ui/icons/index.ts","./src/react/ui/icons/styles.css.ts","./src/react/ui/modals/modal-provider.tsx","./src/react/ui/modals/account/index.tsx","./src/react/ui/modals/buymodal/_store.ts","./src/react/ui/modals/buymodal/index.tsx","./src/react/ui/modals/createlistingmodal/_store.ts","./src/react/ui/modals/createlistingmodal/index.tsx","./src/react/ui/modals/
|
|
1
|
+
{"root":["./src/consts.ts","./src/index.ts","./src/react/index.ts","./src/react/provider.tsx","./src/react/_internal/consts.ts","./src/react/_internal/get-provider.ts","./src/react/_internal/index.ts","./src/react/_internal/types.ts","./src/react/_internal/api/get-query-client.ts","./src/react/_internal/api/index.ts","./src/react/_internal/api/marketplace-api.ts","./src/react/_internal/api/marketplace.gen.ts","./src/react/_internal/api/query-keys.ts","./src/react/_internal/api/services.ts","./src/react/_internal/api/zod-schema.ts","./src/react/_internal/transaction-machine/execute-transaction.ts","./src/react/_internal/transaction-machine/logger.ts","./src/react/_internal/transaction-machine/usetransactionmachine.ts","./src/react/_internal/wagmi/create-config.ts","./src/react/_internal/wagmi/embedded.ts","./src/react/_internal/wagmi/index.ts","./src/react/_internal/wagmi/universal.ts","./src/react/hooks/index.ts","./src/react/hooks/usebalanceofcollectible.tsx","./src/react/hooks/usebuycollectable.tsx","./src/react/hooks/usecancelorder.tsx","./src/react/hooks/usecheckoutoptions.tsx","./src/react/hooks/usecollectible.tsx","./src/react/hooks/usecollection.tsx","./src/react/hooks/useconfig.tsx","./src/react/hooks/usecountlistingsforcollectible.tsx","./src/react/hooks/usecountofcollectables.tsx","./src/react/hooks/usecountoffersforcollectible.tsx","./src/react/hooks/usecreatelisting.tsx","./src/react/hooks/usecurrencies.tsx","./src/react/hooks/usecurrency.tsx","./src/react/hooks/usefilters.tsx","./src/react/hooks/usefloororder.tsx","./src/react/hooks/usegeneratebuytransaction.tsx","./src/react/hooks/usegeneratecanceltransaction.tsx","./src/react/hooks/usegeneratelistingtransaction.tsx","./src/react/hooks/usegenerateoffertransaction.tsx","./src/react/hooks/usegenerateselltransaction.tsx","./src/react/hooks/usehighestoffer.tsx","./src/react/hooks/uselistbalances.tsx","./src/react/hooks/uselistcollectibles.tsx","./src/react/hooks/uselistcollections.tsx","./src/react/hooks/uselistlistingsforcollectible.tsx","./src/react/hooks/uselistoffersforcollectible.tsx","./src/react/hooks/uselowestlisting.tsx","./src/react/hooks/usemakeoffer.tsx","./src/react/hooks/usemarketplaceconfig.tsx","./src/react/hooks/useroyaltypercentage.tsx","./src/react/hooks/usesell.tsx","./src/react/hooks/usetransfertokens.tsx","./src/react/hooks/options/marketplaceconfigoptions.ts","./src/react/ssr/create-ssr-client.ts","./src/react/ssr/index.ts","./src/react/ui/index.ts","./src/react/ui/components/index.ts","./src/react/ui/components/_internals/action-button/actionbutton.tsx","./src/react/ui/components/_internals/custom-network-image/customnetworkimage.tsx","./src/react/ui/components/_internals/custom-network-image/styles.css.ts","./src/react/ui/components/_internals/custom-select/customselect.tsx","./src/react/ui/components/_internals/custom-select/styles.css.ts","./src/react/ui/components/_internals/pill/pill.tsx","./src/react/ui/components/collectible-card/collectiblecard.tsx","./src/react/ui/components/collectible-card/footer.tsx","./src/react/ui/components/collectible-card/styles.css.ts","./src/react/ui/icons/arrowup.tsx","./src/react/ui/icons/bell.tsx","./src/react/ui/icons/calendaricon.tsx","./src/react/ui/icons/diamondeye.tsx","./src/react/ui/icons/infoicon.tsx","./src/react/ui/icons/inventoryicon.tsx","./src/react/ui/icons/minusicon.tsx","./src/react/ui/icons/plusicon.tsx","./src/react/ui/icons/positivecircleicon.tsx","./src/react/ui/icons/index.ts","./src/react/ui/icons/styles.css.ts","./src/react/ui/modals/modal-provider.tsx","./src/react/ui/modals/account/index.tsx","./src/react/ui/modals/buymodal/_store.ts","./src/react/ui/modals/buymodal/index.tsx","./src/react/ui/modals/createlistingmodal/_store.ts","./src/react/ui/modals/createlistingmodal/index.tsx","./src/react/ui/modals/makeoffermodal/_store.ts","./src/react/ui/modals/makeoffermodal/index.tsx","./src/react/ui/modals/sellmodal/_store.ts","./src/react/ui/modals/sellmodal/index.tsx","./src/react/ui/modals/sellmodal/utils.ts","./src/react/ui/modals/successfulpurchasemodal/_store.ts","./src/react/ui/modals/successfulpurchasemodal/index.tsx","./src/react/ui/modals/successfulpurchasemodal/styles.css.ts","./src/react/ui/modals/transfermodal/_store.ts","./src/react/ui/modals/transfermodal/index.tsx","./src/react/ui/modals/transfermodal/messages.ts","./src/react/ui/modals/transfermodal/styles.css.ts","./src/react/ui/modals/transfermodal/_views/enterwalletaddress/index.tsx","./src/react/ui/modals/transfermodal/_views/enterwalletaddress/usehandletransfer.tsx","./src/react/ui/modals/transfermodal/_views/followwalletinstructions/index.tsx","./src/react/ui/modals/_internal/types.ts","./src/react/ui/modals/_internal/components/actionmodal/actionmodal.tsx","./src/react/ui/modals/_internal/components/actionmodal/errormodal.tsx","./src/react/ui/modals/_internal/components/actionmodal/loadingmodal.tsx","./src/react/ui/modals/_internal/components/actionmodal/index.ts","./src/react/ui/modals/_internal/components/actionmodal/store.ts","./src/react/ui/modals/_internal/components/actionmodal/styles.css.ts","./src/react/ui/modals/_internal/components/alertmessage/index.tsx","./src/react/ui/modals/_internal/components/alertmessage/styles.css.ts","./src/react/ui/modals/_internal/components/calendar/index.tsx","./src/react/ui/modals/_internal/components/calendarpopover/index.tsx","./src/react/ui/modals/_internal/components/calendarpopover/styles.css.ts","./src/react/ui/modals/_internal/components/currencyoptionsselect/index.tsx","./src/react/ui/modals/_internal/components/expirationdateselect/index.tsx","./src/react/ui/modals/_internal/components/floorpricetext/index.tsx","./src/react/ui/modals/_internal/components/priceinput/index.tsx","./src/react/ui/modals/_internal/components/priceinput/styles.css.ts","./src/react/ui/modals/_internal/components/priceinput/types.ts","./src/react/ui/modals/_internal/components/quantityinput/index.tsx","./src/react/ui/modals/_internal/components/quantityinput/styles.css.ts","./src/react/ui/modals/_internal/components/switchchainmodal/index.tsx","./src/react/ui/modals/_internal/components/switchchainmodal/store.ts","./src/react/ui/modals/_internal/components/switchchainmodal/styles.css.ts","./src/react/ui/modals/_internal/components/timeago/index.tsx","./src/react/ui/modals/_internal/components/tokenpreview/index.tsx","./src/react/ui/modals/_internal/components/tokenpreview/styles.css.ts","./src/react/ui/modals/_internal/components/transaction-footer/index.tsx","./src/react/ui/modals/_internal/components/transactiondetails/index.tsx","./src/react/ui/modals/_internal/components/transactionheader/index.tsx","./src/react/ui/modals/_internal/components/transactionpreview/consts.ts","./src/react/ui/modals/_internal/components/transactionpreview/index.tsx","./src/react/ui/modals/_internal/components/transactionpreview/usetransactionpreviewtitle.tsx","./src/react/ui/modals/_internal/components/transactionstatusmodal/index.tsx","./src/react/ui/modals/_internal/components/transactionstatusmodal/store.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/styles.css.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/util/getformattedtype.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/util/getmessage.ts","./src/react/ui/modals/_internal/components/transactionstatusmodal/util/gettitle.ts","./src/react/ui/modals/_internal/stores/accountmodal.ts","./src/react/ui/styles/index.ts","./src/react/ui/styles/modal.css.ts","./src/styles/index.ts","./src/types/api-types.ts","./src/types/custom.d.ts","./src/types/index.ts","./src/types/marketplace-config.ts","./src/types/messages.ts","./src/types/sdk-config.ts","./src/types/types.ts","./src/utils/address.ts","./src/utils/get-public-rpc-client.ts","./src/utils/index.ts","./src/utils/network.ts","./src/utils/price.ts","./src/utils/_internal/error/base.ts","./src/utils/_internal/error/context.ts","./src/utils/_internal/error/transaction.ts","./src/utils/abi/index.ts","./src/utils/abi/marketplace/eip2981.ts","./src/utils/abi/marketplace/index.ts","./src/utils/abi/marketplace/sequence-marketplace-v1.ts","./src/utils/abi/marketplace/sequence-marketplace-v2.ts","./src/utils/abi/token/erc1155.ts","./src/utils/abi/token/erc20.ts","./src/utils/abi/token/erc721.ts","./src/utils/abi/token/index.ts","./tsup.config.ts"],"version":"5.7.2"}
|