@bosonprotocol/react-kit 0.29.0 → 0.29.1-alpha.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/dist/cjs/components/cta/offer/CommitButton.d.ts.map +1 -1
- package/dist/cjs/components/cta/offer/CommitButton.js.map +1 -1
- package/dist/cjs/components/currencyDisplay/CurrencyDisplay.d.ts.map +1 -1
- package/dist/cjs/components/currencyDisplay/CurrencyDisplay.js +3 -3
- package/dist/cjs/components/currencyDisplay/CurrencyDisplay.js.map +1 -1
- package/dist/cjs/components/datepicker/SelectTime.js.map +1 -1
- package/dist/cjs/components/form/BaseSelect.js.map +1 -1
- package/dist/cjs/components/form/Select.js.map +1 -1
- package/dist/cjs/components/modal/ModalContext.d.ts +1 -1
- package/dist/cjs/components/modal/ModalContext.d.ts.map +1 -1
- package/dist/cjs/components/modal/ModalContext.js.map +1 -1
- package/dist/cjs/components/modal/components/Commit/CommitSuccess/CommitSuccess.js +1 -1
- package/dist/cjs/components/modal/components/Redeem/ExchangeView/cancellation/CancelExchange.d.ts.map +1 -1
- package/dist/cjs/components/modal/components/Redeem/ExchangeView/cancellation/CancelExchange.js.map +1 -1
- package/dist/cjs/components/modal/components/Redeem/ExchangeView/expireVoucher/ExpireVoucher.d.ts.map +1 -1
- package/dist/cjs/components/modal/components/Redeem/ExchangeView/expireVoucher/ExpireVoucher.js.map +1 -1
- package/dist/cjs/components/modal/components/Redeem/MyItems/WithExchangesData.js.map +1 -1
- package/dist/cjs/components/modal/components/Redeem/RedeemNonModal.js.map +1 -1
- package/dist/cjs/components/modal/components/common/OfferFullDescription/DigitalProductData.js.map +1 -1
- package/dist/cjs/components/modal/components/common/OfferFullDescription/OfferFullDescription.d.ts +1 -1
- package/dist/cjs/components/modal/components/common/OfferFullDescription/OfferFullDescription.d.ts.map +1 -1
- package/dist/cjs/components/modal/components/common/detail/Detail.style.d.ts.map +1 -1
- package/dist/cjs/components/modal/components/common/detail/Detail.style.js +5 -2
- package/dist/cjs/components/modal/components/common/detail/Detail.style.js.map +1 -1
- package/dist/cjs/components/modal/components/common/detail/DetailSlider.js.map +1 -1
- package/dist/cjs/components/modal/components/common/detail/DetailViewWithProvider.js.map +1 -1
- package/dist/cjs/components/modal/components/common/detail/TokenGatedItem.js.map +1 -1
- package/dist/cjs/components/wallet/wallet-connection.d.ts.map +1 -1
- package/dist/cjs/components/wallet/wallet-connection.js +22 -0
- package/dist/cjs/components/wallet/wallet-connection.js.map +1 -1
- package/dist/cjs/components/widgets/commit/CommitModalWithOffer.js.map +1 -1
- package/dist/cjs/lib/chains/getNativeLogoURI.d.ts +1 -1
- package/dist/cjs/lib/chains/getNativeLogoURI.d.ts.map +1 -1
- package/dist/cjs/lib/chains/getNativeLogoURI.js +1 -0
- package/dist/cjs/lib/chains/getNativeLogoURI.js.map +1 -1
- package/dist/cjs/lib/config/config.d.ts +1 -0
- package/dist/cjs/lib/config/config.d.ts.map +1 -1
- package/dist/cjs/lib/const/chainInfo.d.ts.map +1 -1
- package/dist/cjs/lib/const/chainInfo.js +15 -0
- package/dist/cjs/lib/const/chainInfo.js.map +1 -1
- package/dist/cjs/lib/const/chains.d.ts +2 -1
- package/dist/cjs/lib/const/chains.d.ts.map +1 -1
- package/dist/cjs/lib/const/chains.js +3 -1
- package/dist/cjs/lib/const/chains.js.map +1 -1
- package/dist/cjs/lib/const/networks.d.ts +2 -0
- package/dist/cjs/lib/const/networks.d.ts.map +1 -1
- package/dist/cjs/lib/const/networks.js +8 -0
- package/dist/cjs/lib/const/networks.js.map +1 -1
- package/dist/cjs/lib/const/tokens.d.ts +3 -1
- package/dist/cjs/lib/const/tokens.d.ts.map +1 -1
- package/dist/cjs/lib/const/tokens.js +4 -2
- package/dist/cjs/lib/const/tokens.js.map +1 -1
- package/dist/cjs/lib/opensea/getOpenSeaUrl.js +4 -4
- package/dist/cjs/lib/opensea/getOpenSeaUrl.js.map +1 -1
- package/dist/esm/components/cta/offer/CommitButton.d.ts.map +1 -1
- package/dist/esm/components/cta/offer/CommitButton.js.map +1 -1
- package/dist/esm/components/currencyDisplay/CurrencyDisplay.d.ts.map +1 -1
- package/dist/esm/components/currencyDisplay/CurrencyDisplay.js +3 -3
- package/dist/esm/components/currencyDisplay/CurrencyDisplay.js.map +1 -1
- package/dist/esm/components/datepicker/SelectTime.js.map +1 -1
- package/dist/esm/components/form/BaseSelect.js.map +1 -1
- package/dist/esm/components/form/Select.js.map +1 -1
- package/dist/esm/components/modal/ModalContext.d.ts +1 -1
- package/dist/esm/components/modal/ModalContext.d.ts.map +1 -1
- package/dist/esm/components/modal/ModalContext.js.map +1 -1
- package/dist/esm/components/modal/components/Commit/CommitSuccess/CommitSuccess.js +1 -1
- package/dist/esm/components/modal/components/Redeem/ExchangeView/cancellation/CancelExchange.d.ts.map +1 -1
- package/dist/esm/components/modal/components/Redeem/ExchangeView/cancellation/CancelExchange.js.map +1 -1
- package/dist/esm/components/modal/components/Redeem/ExchangeView/expireVoucher/ExpireVoucher.d.ts.map +1 -1
- package/dist/esm/components/modal/components/Redeem/ExchangeView/expireVoucher/ExpireVoucher.js.map +1 -1
- package/dist/esm/components/modal/components/Redeem/MyItems/WithExchangesData.js.map +1 -1
- package/dist/esm/components/modal/components/Redeem/RedeemNonModal.js.map +1 -1
- package/dist/esm/components/modal/components/common/OfferFullDescription/DigitalProductData.js.map +1 -1
- package/dist/esm/components/modal/components/common/OfferFullDescription/OfferFullDescription.d.ts +1 -1
- package/dist/esm/components/modal/components/common/OfferFullDescription/OfferFullDescription.d.ts.map +1 -1
- package/dist/esm/components/modal/components/common/detail/Detail.style.d.ts.map +1 -1
- package/dist/esm/components/modal/components/common/detail/Detail.style.js +5 -2
- package/dist/esm/components/modal/components/common/detail/Detail.style.js.map +1 -1
- package/dist/esm/components/modal/components/common/detail/DetailSlider.js.map +1 -1
- package/dist/esm/components/modal/components/common/detail/DetailViewWithProvider.js.map +1 -1
- package/dist/esm/components/modal/components/common/detail/TokenGatedItem.js.map +1 -1
- package/dist/esm/components/wallet/wallet-connection.d.ts.map +1 -1
- package/dist/esm/components/wallet/wallet-connection.js +22 -0
- package/dist/esm/components/wallet/wallet-connection.js.map +1 -1
- package/dist/esm/components/widgets/commit/CommitModalWithOffer.js.map +1 -1
- package/dist/esm/lib/chains/getNativeLogoURI.d.ts +1 -1
- package/dist/esm/lib/chains/getNativeLogoURI.d.ts.map +1 -1
- package/dist/esm/lib/chains/getNativeLogoURI.js +1 -0
- package/dist/esm/lib/chains/getNativeLogoURI.js.map +1 -1
- package/dist/esm/lib/config/config.d.ts +1 -0
- package/dist/esm/lib/config/config.d.ts.map +1 -1
- package/dist/esm/lib/const/chainInfo.d.ts.map +1 -1
- package/dist/esm/lib/const/chainInfo.js +15 -0
- package/dist/esm/lib/const/chainInfo.js.map +1 -1
- package/dist/esm/lib/const/chains.d.ts +2 -1
- package/dist/esm/lib/const/chains.d.ts.map +1 -1
- package/dist/esm/lib/const/chains.js +3 -1
- package/dist/esm/lib/const/chains.js.map +1 -1
- package/dist/esm/lib/const/networks.d.ts +2 -0
- package/dist/esm/lib/const/networks.d.ts.map +1 -1
- package/dist/esm/lib/const/networks.js +8 -0
- package/dist/esm/lib/const/networks.js.map +1 -1
- package/dist/esm/lib/const/tokens.d.ts +3 -1
- package/dist/esm/lib/const/tokens.d.ts.map +1 -1
- package/dist/esm/lib/const/tokens.js +4 -1
- package/dist/esm/lib/const/tokens.js.map +1 -1
- package/dist/esm/lib/opensea/getOpenSeaUrl.js +4 -4
- package/dist/esm/lib/opensea/getOpenSeaUrl.js.map +1 -1
- package/package.json +6 -5
- package/src/components/cta/offer/CommitButton.tsx +2 -3
- package/src/components/currencyDisplay/CurrencyDisplay.tsx +4 -5
- package/src/components/datepicker/SelectTime.tsx +4 -4
- package/src/components/form/BaseSelect.tsx +2 -2
- package/src/components/form/Select.tsx +4 -4
- package/src/components/modal/ModalContext.tsx +4 -5
- package/src/components/modal/components/Commit/CommitSuccess/CommitSuccess.tsx +1 -1
- package/src/components/modal/components/Redeem/ExchangeView/cancellation/CancelExchange.tsx +2 -3
- package/src/components/modal/components/Redeem/ExchangeView/expireVoucher/ExpireVoucher.tsx +2 -3
- package/src/components/modal/components/Redeem/MyItems/WithExchangesData.tsx +2 -2
- package/src/components/modal/components/Redeem/RedeemNonModal.tsx +8 -8
- package/src/components/modal/components/common/OfferFullDescription/DigitalProductData.tsx +6 -6
- package/src/components/modal/components/common/OfferFullDescription/OfferFullDescription.tsx +1 -1
- package/src/components/modal/components/common/detail/Detail.style.tsx +5 -2
- package/src/components/modal/components/common/detail/DetailSlider.tsx +2 -2
- package/src/components/modal/components/common/detail/DetailViewWithProvider.tsx +1 -1
- package/src/components/modal/components/common/detail/TokenGatedItem.tsx +10 -10
- package/src/components/wallet/wallet-connection.ts +23 -1
- package/src/components/widgets/commit/CommitModalWithOffer.tsx +1 -1
- package/src/lib/chains/getNativeLogoURI.ts +4 -1
- package/src/lib/const/chainInfo.ts +15 -0
- package/src/lib/const/chains.ts +3 -1
- package/src/lib/const/networks.ts +8 -0
- package/src/lib/const/tokens.ts +15 -2
- package/src/lib/opensea/getOpenSeaUrl.ts +6 -6
- package/src/stories/cta/dispute/AddFeesDisputeResolverButton.stories.tsx +2 -2
- package/src/stories/cta/dispute/AddSellerToDisputeResolverButton.stories.tsx +2 -2
- package/src/stories/cta/dispute/CreateDisputeResolverButton.stories.tsx +2 -2
- package/src/stories/cta/dispute/DecideDisputeButton.stories.tsx +2 -2
- package/src/stories/cta/dispute/EscalateDisputeButton.stories.tsx +2 -2
- package/src/stories/cta/dispute/ExpireDisputeButton.stories.tsx +2 -2
- package/src/stories/cta/dispute/ExpireEscalationDisputeButton.stories.tsx +2 -2
- package/src/stories/cta/dispute/ExtendDisputeTimeoutButton.stories.tsx +2 -2
- package/src/stories/cta/dispute/RaiseDisputeButton.stories.tsx +2 -2
- package/src/stories/cta/dispute/RefuseDisputeButton.stories.tsx +2 -2
- package/src/stories/cta/dispute/RemoveFeesDisputeResolverButton.stories.tsx +2 -2
- package/src/stories/cta/dispute/RemoveSellerFromDisputeResolverButton.stories.tsx +2 -2
- package/src/stories/cta/dispute/ResolveDisputeButton.stories.tsx +2 -2
- package/src/stories/cta/dispute/RetractDisputeButton.stories.tsx +2 -2
- package/src/stories/cta/dispute/UpdateDisputeResolverButton.stories.tsx +2 -2
- package/src/stories/cta/exchange/BatchCompleteButton.stories.tsx +2 -2
- package/src/stories/cta/exchange/CancelButton.stories.tsx +2 -2
- package/src/stories/cta/exchange/CompleteButton.stories.tsx +2 -2
- package/src/stories/cta/exchange/ExpireButton.stories.tsx +2 -2
- package/src/stories/cta/exchange/RedeemButton.stories.tsx +3 -3
- package/src/stories/cta/exchange/RevokeButton.stories.tsx +2 -2
- package/src/stories/cta/funds/DepositFundsButton.stories.tsx +3 -3
- package/src/stories/cta/funds/WithdrawAllFunds.stories.tsx +3 -3
- package/src/stories/cta/funds/WithdrawFundsButton.stories.tsx +3 -3
- package/src/stories/cta/offer/BatchVoidButton.stories.tsx +2 -2
- package/src/stories/cta/offer/CommitButton.stories.tsx +3 -3
- package/src/stories/cta/offer/CreateOfferButton.stories.tsx +2 -2
- package/src/stories/cta/offer/VoidButton.stories.tsx +2 -2
- package/src/stories/cta/seller/CreateSellerButton.stories.tsx +2 -2
- package/src/stories/cta/seller/UpdateSellerButton.stories.tsx +2 -2
- package/src/stories/helpers/CtaButtonWrapper.tsx +1 -1
|
@@ -46,8 +46,8 @@ export default function SelectTime({
|
|
|
46
46
|
period
|
|
47
47
|
? [date?.isToday() ? dayjs().format("HH") : "00", "23"]
|
|
48
48
|
: date?.isToday()
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
? dayjs().format("HH")
|
|
50
|
+
: "00",
|
|
51
51
|
[period, date]
|
|
52
52
|
);
|
|
53
53
|
const DEFAULT_MINUTE = useMemo(
|
|
@@ -55,8 +55,8 @@ export default function SelectTime({
|
|
|
55
55
|
period
|
|
56
56
|
? [date?.isToday() ? dayjs().add(5, "minute").format("mm") : "00", "59"]
|
|
57
57
|
: date?.isToday()
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
? dayjs().add(5, "minute").format("mm")
|
|
59
|
+
: "00",
|
|
60
60
|
[period, date]
|
|
61
61
|
);
|
|
62
62
|
const DEFAULT_TIME = useMemo(() => (period ? ["00", "00"] : "00"), [period]);
|
|
@@ -23,8 +23,8 @@ const customStyles = (error: any) => ({
|
|
|
23
23
|
border: state.isFocused
|
|
24
24
|
? `1px solid ${colors.secondary}`
|
|
25
25
|
: !checkIfValueIsEmpty(error)
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
? `1px solid ${colors.orange}`
|
|
27
|
+
: `1px solid ${colors.border}`
|
|
28
28
|
}),
|
|
29
29
|
container: (provided: any, state: any) => ({
|
|
30
30
|
...provided,
|
|
@@ -42,8 +42,8 @@ const customStyles = (error: any) => ({
|
|
|
42
42
|
border: state.isFocused
|
|
43
43
|
? `1px solid ${colors.secondary}`
|
|
44
44
|
: !checkIfValueIsEmpty(error)
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
? `1px solid ${colors.orange}`
|
|
46
|
+
: `1px solid ${colors.border}`,
|
|
47
47
|
...before
|
|
48
48
|
};
|
|
49
49
|
},
|
|
@@ -87,8 +87,8 @@ export default function SelectComponent({
|
|
|
87
87
|
meta.error && meta.touched && !errorMessage
|
|
88
88
|
? meta.error
|
|
89
89
|
: meta.error && meta.touched && errorMessage
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
? errorMessage
|
|
91
|
+
: "";
|
|
92
92
|
|
|
93
93
|
const displayError =
|
|
94
94
|
typeof displayErrorMessage === typeof "string" &&
|
|
@@ -24,11 +24,10 @@ export type Store = {
|
|
|
24
24
|
> | null;
|
|
25
25
|
theme?: "light" | "dark";
|
|
26
26
|
};
|
|
27
|
-
export type GenericModalProps<T extends keyof typeof MODAL_TYPES> =
|
|
28
|
-
typeof MODAL_COMPONENTS[T]
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
: ModalProps & Parameters<typeof MODAL_COMPONENTS[T]>[0];
|
|
27
|
+
export type GenericModalProps<T extends keyof typeof MODAL_TYPES> =
|
|
28
|
+
Parameters<(typeof MODAL_COMPONENTS)[T]>[0] extends Record<string, never>
|
|
29
|
+
? ModalProps & Record<string, never>
|
|
30
|
+
: ModalProps & Parameters<(typeof MODAL_COMPONENTS)[T]>[0];
|
|
32
31
|
|
|
33
32
|
export interface ModalContextType {
|
|
34
33
|
showModal: <T extends keyof typeof MODAL_TYPES>(
|
|
@@ -113,7 +113,7 @@ export function CommitSuccess({ onHouseClick, exchangeId, commitHash }: Props) {
|
|
|
113
113
|
}}
|
|
114
114
|
>
|
|
115
115
|
View on{" "}
|
|
116
|
-
{[
|
|
116
|
+
{[80002, 137].includes(config.chainId)
|
|
117
117
|
? "Polygonscan"
|
|
118
118
|
: "Etherscan"}{" "}
|
|
119
119
|
<ArrowSquareUpRight
|
|
@@ -233,9 +233,8 @@ export function CancelExchange({
|
|
|
233
233
|
const [, { exchangeId }] = args;
|
|
234
234
|
await poll(
|
|
235
235
|
async () => {
|
|
236
|
-
const canceledExchange =
|
|
237
|
-
exchangeId
|
|
238
|
-
);
|
|
236
|
+
const canceledExchange =
|
|
237
|
+
await coreSDK.getExchangeById(exchangeId);
|
|
239
238
|
return canceledExchange.cancelledDate;
|
|
240
239
|
},
|
|
241
240
|
(cancelledDate) => {
|
|
@@ -236,9 +236,8 @@ export default function ExpireVoucher({
|
|
|
236
236
|
const [, { exchangeId }] = args;
|
|
237
237
|
await poll(
|
|
238
238
|
async () => {
|
|
239
|
-
const expiredExchange =
|
|
240
|
-
exchangeId
|
|
241
|
-
);
|
|
239
|
+
const expiredExchange =
|
|
240
|
+
await coreSDK.getExchangeById(exchangeId);
|
|
242
241
|
return expiredExchange.expired;
|
|
243
242
|
},
|
|
244
243
|
(expired) => {
|
|
@@ -52,8 +52,8 @@ export function WithExchangesData(
|
|
|
52
52
|
? sellerIds.filter((s) => sellerCurationList?.includes(s))
|
|
53
53
|
: sellerIds
|
|
54
54
|
: enableCurationLists
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
? sellerCurationList
|
|
56
|
+
: undefined;
|
|
57
57
|
const committedExchanges = useExchanges(
|
|
58
58
|
{
|
|
59
59
|
...orderProps,
|
|
@@ -257,14 +257,14 @@ const getInitialStep = (
|
|
|
257
257
|
return showRedemptionOverview
|
|
258
258
|
? ActiveStep.STEPS_OVERVIEW
|
|
259
259
|
: widgetAction === RedemptionWidgetAction.SELECT_EXCHANGE
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
260
|
+
? ActiveStep.MY_ITEMS
|
|
261
|
+
: widgetAction === RedemptionWidgetAction.REDEEM_FORM
|
|
262
|
+
? ActiveStep.REDEEM_FORM
|
|
263
|
+
: widgetAction === RedemptionWidgetAction.CANCEL_FORM
|
|
264
|
+
? ActiveStep.CANCELLATION_VIEW
|
|
265
|
+
: widgetAction === RedemptionWidgetAction.EXCHANGE_DETAILS
|
|
266
|
+
? ActiveStep.EXCHANGE_VIEW
|
|
267
|
+
: ActiveStep.REDEEM_FORM_CONFIRMATION;
|
|
268
268
|
};
|
|
269
269
|
const getPreviousSteps = (
|
|
270
270
|
widgetAction: RedemptionWidgetAction,
|
|
@@ -102,12 +102,12 @@ export const DigitalProductData: React.FC<DigitalProductDataProps> = ({
|
|
|
102
102
|
attribute.value as keyof typeof digitalTypeMappingDisplay
|
|
103
103
|
]
|
|
104
104
|
: digitalNftTypeMapping[
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
105
|
+
attribute.value as keyof typeof digitalNftTypeMapping
|
|
106
|
+
]
|
|
107
|
+
? digitalNftTypeMapping[
|
|
108
|
+
attribute.value as keyof typeof digitalNftTypeMapping
|
|
109
|
+
]
|
|
110
|
+
: attribute.value}
|
|
111
111
|
</Typography>
|
|
112
112
|
)
|
|
113
113
|
})),
|
package/src/components/modal/components/common/OfferFullDescription/OfferFullDescription.tsx
CHANGED
|
@@ -31,7 +31,7 @@ export type OfferFullDescriptionProps = OnClickBuyOrSwapHandler & {
|
|
|
31
31
|
includeGeneralProductDataTab: boolean;
|
|
32
32
|
exchange: Exchange | null;
|
|
33
33
|
className?: string;
|
|
34
|
-
defaultSelectedTabId?: typeof ids[number];
|
|
34
|
+
defaultSelectedTabId?: (typeof ids)[number];
|
|
35
35
|
} & Pick<UseGetOfferDetailDataProps, "onExchangePolicyClick"> &
|
|
36
36
|
Pick<TabsProps, "withFullViewportWidth">;
|
|
37
37
|
|
|
@@ -506,8 +506,11 @@ export const BaseWidget = styled.div`
|
|
|
506
506
|
}
|
|
507
507
|
|
|
508
508
|
box-shadow: 0px 4.318px 107.946px rgba(21, 30, 52, 0.1);
|
|
509
|
-
box-shadow:
|
|
510
|
-
0px 0px
|
|
509
|
+
box-shadow:
|
|
510
|
+
0px 0px 0px rgba(0, 0, 0, 0.05),
|
|
511
|
+
0px 0px 16px rgba(0, 0, 0, 0.05),
|
|
512
|
+
0px 0px 32px rgba(0, 0, 0, 0.05),
|
|
513
|
+
0px 0px 64px rgba(0, 0, 0, 0.05),
|
|
511
514
|
0px 0px 128px rgba(0, 0, 0, 0.05);
|
|
512
515
|
|
|
513
516
|
> div {
|
|
@@ -125,8 +125,8 @@ export default function DetailSlider({
|
|
|
125
125
|
outerShowArrows === false
|
|
126
126
|
? false
|
|
127
127
|
: sumMediaFiles !== 1 && (sliderOptions.perView ?? 1) === 1
|
|
128
|
-
|
|
129
|
-
|
|
128
|
+
? true
|
|
129
|
+
: sumMediaFiles > (sliderOptions.perView ?? 1);
|
|
130
130
|
const draggable = showArrows;
|
|
131
131
|
useEffect(() => {
|
|
132
132
|
if (mediaFiles.length !== 0 && ref.current !== null) {
|
|
@@ -216,16 +216,16 @@ export const TokenGatedItem = ({
|
|
|
216
216
|
!chainId || !condition
|
|
217
217
|
? null
|
|
218
218
|
: condition.tokenAddress === ethers.constants.AddressZero
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
219
|
+
? nativeOnChain(chainId)
|
|
220
|
+
: erc20TokenInfo
|
|
221
|
+
? new Token(
|
|
222
|
+
chainId,
|
|
223
|
+
condition.tokenAddress,
|
|
224
|
+
Number(erc20TokenInfo.decimals),
|
|
225
|
+
erc20TokenInfo.symbol,
|
|
226
|
+
erc20TokenInfo.name
|
|
227
|
+
)
|
|
228
|
+
: null,
|
|
229
229
|
[chainId, condition, erc20TokenInfo]
|
|
230
230
|
);
|
|
231
231
|
|
|
@@ -12,11 +12,33 @@ import { useConfigContext } from "../config/ConfigContext";
|
|
|
12
12
|
|
|
13
13
|
function getChain(
|
|
14
14
|
chainId: number
|
|
15
|
-
): [typeof wagmiChains[keyof typeof wagmiChains]] {
|
|
15
|
+
): [(typeof wagmiChains)[keyof typeof wagmiChains]] {
|
|
16
16
|
const chain = Object.values(wagmiChains).find(
|
|
17
17
|
(chain) => chain.id === chainId
|
|
18
18
|
);
|
|
19
19
|
if (!chain) {
|
|
20
|
+
if (chainId === 80002) {
|
|
21
|
+
// Amoy config, from https://github.com/wevm/viem/pull/1787
|
|
22
|
+
return [
|
|
23
|
+
{
|
|
24
|
+
id: 80_002,
|
|
25
|
+
name: "Polygon Amoy",
|
|
26
|
+
nativeCurrency: { name: "MATIC", symbol: "MATIC", decimals: 18 },
|
|
27
|
+
rpcUrls: {
|
|
28
|
+
default: {
|
|
29
|
+
http: ["https://rpc-amoy.polygon.technology"]
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
blockExplorers: {
|
|
33
|
+
default: {
|
|
34
|
+
name: "OK LINK",
|
|
35
|
+
url: "https://www.oklink.com/amoy"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
testnet: true
|
|
39
|
+
} as unknown as (typeof wagmiChains)[keyof typeof wagmiChains] // Force casting
|
|
40
|
+
];
|
|
41
|
+
}
|
|
20
42
|
throw new Error(`Cannot find a chain with id ${chainId} in wagmiChains`);
|
|
21
43
|
}
|
|
22
44
|
return [chain];
|
|
@@ -2,10 +2,13 @@ import { ChainId } from "@uniswap/sdk-core";
|
|
|
2
2
|
import EthereumLogo from "../../assets/svg/ethereum_square_logo.svg";
|
|
3
3
|
import MaticLogo from "../../assets/svg/matic-token-icon.svg";
|
|
4
4
|
|
|
5
|
-
export function getNativeLogoURI(
|
|
5
|
+
export function getNativeLogoURI(
|
|
6
|
+
chainId: ChainId | number = ChainId.MAINNET
|
|
7
|
+
): string {
|
|
6
8
|
switch (chainId) {
|
|
7
9
|
case ChainId.POLYGON:
|
|
8
10
|
case ChainId.POLYGON_MUMBAI:
|
|
11
|
+
case 80002:
|
|
9
12
|
return MaticLogo;
|
|
10
13
|
default:
|
|
11
14
|
return EthereumLogo;
|
|
@@ -98,6 +98,21 @@ const CHAIN_INFO: ChainInfoMap = {
|
|
|
98
98
|
symbol: "mMATIC",
|
|
99
99
|
decimals: 18
|
|
100
100
|
}
|
|
101
|
+
},
|
|
102
|
+
80002: {
|
|
103
|
+
networkType: NetworkType.L1,
|
|
104
|
+
blockWaitMsBeforeWarning: ms(`10m`),
|
|
105
|
+
bridge: "https://wallet.polygon.technology/polygon/bridge/deposit",
|
|
106
|
+
docs: "https://polygon.io/",
|
|
107
|
+
explorer: "https://www.oklink.com/amoy/",
|
|
108
|
+
infoLink: "https://info.uniswap.org/#/polygon/",
|
|
109
|
+
label: "Polygon Amoy",
|
|
110
|
+
logoUrl: polygonMaticLogo,
|
|
111
|
+
nativeCurrency: {
|
|
112
|
+
name: "Polygon Amoy Matic",
|
|
113
|
+
symbol: "aMATIC",
|
|
114
|
+
decimals: 18
|
|
115
|
+
}
|
|
101
116
|
}
|
|
102
117
|
} as const;
|
|
103
118
|
|
package/src/lib/const/chains.ts
CHANGED
|
@@ -5,6 +5,7 @@ export const CHAIN_IDS_TO_NAMES = {
|
|
|
5
5
|
[ChainId.SEPOLIA]: "sepolia",
|
|
6
6
|
[ChainId.POLYGON]: "polygon",
|
|
7
7
|
[ChainId.POLYGON_MUMBAI]: "polygon_mumbai",
|
|
8
|
+
80002: "polygon_amoy",
|
|
8
9
|
[ChainId.CELO]: "celo",
|
|
9
10
|
[ChainId.CELO_ALFAJORES]: "celo_alfajores",
|
|
10
11
|
[ChainId.ARBITRUM_ONE]: "arbitrum",
|
|
@@ -25,7 +26,8 @@ export const L1_CHAIN_IDS = [
|
|
|
25
26
|
// ChainId.GOERLI,
|
|
26
27
|
ChainId.SEPOLIA,
|
|
27
28
|
ChainId.POLYGON,
|
|
28
|
-
ChainId.POLYGON_MUMBAI
|
|
29
|
+
ChainId.POLYGON_MUMBAI,
|
|
30
|
+
80002
|
|
29
31
|
// LocalChainId
|
|
30
32
|
// ChainId.CELO,
|
|
31
33
|
// ChainId.CELO_ALFAJORES
|
|
@@ -71,6 +71,10 @@ export const FALLBACK_URLS = {
|
|
|
71
71
|
"https://rpc-mumbai.maticvigil.com",
|
|
72
72
|
"https://matic-testnet-archive-rpc.bwarelabs.com"
|
|
73
73
|
],
|
|
74
|
+
80002: [
|
|
75
|
+
// "Safe" URLs
|
|
76
|
+
"https://rpc-amoy.polygon.technology"
|
|
77
|
+
],
|
|
74
78
|
[ChainId.ARBITRUM_ONE]: [
|
|
75
79
|
// "Safe" URLs
|
|
76
80
|
"https://arb1.arbitrum.io/rpc",
|
|
@@ -175,6 +179,10 @@ export const getRpcUrls = (infuraKey: string) => ({
|
|
|
175
179
|
`https://polygon-mumbai.infura.io/v3/${infuraKey}`,
|
|
176
180
|
...FALLBACK_URLS[ChainId.POLYGON_MUMBAI]
|
|
177
181
|
],
|
|
182
|
+
80002: [ // AMOY
|
|
183
|
+
`https://polygon-amoy.infura.io/v3/${infuraKey}`,
|
|
184
|
+
...FALLBACK_URLS[80002]
|
|
185
|
+
],
|
|
178
186
|
[ChainId.CELO]: FALLBACK_URLS[ChainId.CELO],
|
|
179
187
|
[ChainId.CELO_ALFAJORES]: FALLBACK_URLS[ChainId.CELO_ALFAJORES],
|
|
180
188
|
[ChainId.BNB]: [
|
package/src/lib/const/tokens.ts
CHANGED
|
@@ -411,6 +411,13 @@ export const WRAPPED_NATIVE_CURRENCY: { [chainId: number]: Token | undefined } =
|
|
|
411
411
|
"WMATIC",
|
|
412
412
|
"Wrapped MATIC"
|
|
413
413
|
),
|
|
414
|
+
80002: new Token(
|
|
415
|
+
80002,
|
|
416
|
+
"0x52eF3d68BaB452a294342DC3e5f464d7f610f72E",
|
|
417
|
+
18,
|
|
418
|
+
"WMATIC",
|
|
419
|
+
"Wrapped MATIC"
|
|
420
|
+
),
|
|
414
421
|
[ChainId.CELO]: new Token(
|
|
415
422
|
ChainId.CELO,
|
|
416
423
|
"0x471ece3750da237f93b8e339c536989b8978a438",
|
|
@@ -458,10 +465,16 @@ function getCeloNativeCurrency(chainId: number) {
|
|
|
458
465
|
}
|
|
459
466
|
}
|
|
460
467
|
|
|
468
|
+
type NewType = 80002;
|
|
469
|
+
|
|
461
470
|
export function isMatic(
|
|
462
471
|
chainId: number
|
|
463
|
-
): chainId is ChainId.POLYGON | ChainId.POLYGON_MUMBAI {
|
|
464
|
-
return
|
|
472
|
+
): chainId is ChainId.POLYGON | ChainId.POLYGON_MUMBAI | NewType {
|
|
473
|
+
return (
|
|
474
|
+
chainId === ChainId.POLYGON_MUMBAI ||
|
|
475
|
+
chainId === ChainId.POLYGON ||
|
|
476
|
+
chainId === 80002
|
|
477
|
+
);
|
|
465
478
|
}
|
|
466
479
|
|
|
467
480
|
class MaticNativeCurrency extends NativeCurrency {
|
|
@@ -4,12 +4,12 @@ import { getExchangeTokenId } from "../utils/exchange";
|
|
|
4
4
|
|
|
5
5
|
const openSeaUrlMap = new Map([
|
|
6
6
|
[
|
|
7
|
-
"testing", //
|
|
7
|
+
"testing", // testnets
|
|
8
8
|
new Map([
|
|
9
9
|
[
|
|
10
|
-
"testing-
|
|
10
|
+
"testing-80002-0",
|
|
11
11
|
(tokenId: string, contractAddress: string) =>
|
|
12
|
-
`https://testnets.opensea.io/assets/
|
|
12
|
+
`https://testnets.opensea.io/assets/amoy/${contractAddress}/${tokenId}` // TO BE CONFIRMED
|
|
13
13
|
],
|
|
14
14
|
[
|
|
15
15
|
"testing-11155111-0",
|
|
@@ -19,12 +19,12 @@ const openSeaUrlMap = new Map([
|
|
|
19
19
|
])
|
|
20
20
|
],
|
|
21
21
|
[
|
|
22
|
-
"staging", //
|
|
22
|
+
"staging", // testnets
|
|
23
23
|
new Map([
|
|
24
24
|
[
|
|
25
|
-
"staging-
|
|
25
|
+
"staging-80002-0",
|
|
26
26
|
(tokenId: string, contractAddress: string) =>
|
|
27
|
-
`https://testnets.opensea.io/assets/
|
|
27
|
+
`https://testnets.opensea.io/assets/amoy/${contractAddress}/${tokenId}` // TO BE CONFIRMED
|
|
28
28
|
],
|
|
29
29
|
[
|
|
30
30
|
"staging-11155111-0",
|
|
@@ -41,7 +41,7 @@ export const WithExtraInfo: ComponentStory<
|
|
|
41
41
|
|
|
42
42
|
Simple.args = {
|
|
43
43
|
coreSdkConfig: {
|
|
44
|
-
configId: "testing-
|
|
44
|
+
configId: "testing-80002-0",
|
|
45
45
|
envName: "testing",
|
|
46
46
|
web3Provider: undefined
|
|
47
47
|
},
|
|
@@ -74,7 +74,7 @@ Simple.args = {
|
|
|
74
74
|
|
|
75
75
|
WithExtraInfo.args = {
|
|
76
76
|
coreSdkConfig: {
|
|
77
|
-
configId: "testing-
|
|
77
|
+
configId: "testing-80002-0",
|
|
78
78
|
envName: "testing",
|
|
79
79
|
web3Provider: undefined
|
|
80
80
|
},
|
|
@@ -40,7 +40,7 @@ export const WithExtraInfo: ComponentStory<typeof AddSellerToDisputeResolver> =
|
|
|
40
40
|
|
|
41
41
|
Simple.args = {
|
|
42
42
|
coreSdkConfig: {
|
|
43
|
-
configId: "testing-
|
|
43
|
+
configId: "testing-80002-0",
|
|
44
44
|
envName: "testing",
|
|
45
45
|
web3Provider: undefined
|
|
46
46
|
},
|
|
@@ -66,7 +66,7 @@ Simple.args = {
|
|
|
66
66
|
|
|
67
67
|
WithExtraInfo.args = {
|
|
68
68
|
coreSdkConfig: {
|
|
69
|
-
configId: "testing-
|
|
69
|
+
configId: "testing-80002-0",
|
|
70
70
|
envName: "testing",
|
|
71
71
|
web3Provider: undefined
|
|
72
72
|
},
|
|
@@ -40,7 +40,7 @@ export const WithExtraInfo: ComponentStory<typeof CreateDisputeResolverButton> =
|
|
|
40
40
|
|
|
41
41
|
Simple.args = {
|
|
42
42
|
coreSdkConfig: {
|
|
43
|
-
configId: "testing-
|
|
43
|
+
configId: "testing-80002-0",
|
|
44
44
|
envName: "testing",
|
|
45
45
|
web3Provider: undefined
|
|
46
46
|
},
|
|
@@ -75,7 +75,7 @@ Simple.args = {
|
|
|
75
75
|
|
|
76
76
|
WithExtraInfo.args = {
|
|
77
77
|
coreSdkConfig: {
|
|
78
|
-
configId: "testing-
|
|
78
|
+
configId: "testing-80002-0",
|
|
79
79
|
envName: "testing",
|
|
80
80
|
web3Provider: undefined
|
|
81
81
|
},
|
|
@@ -41,7 +41,7 @@ export const WithExtraInfo: ComponentStory<typeof DecideDisputeButton> =
|
|
|
41
41
|
|
|
42
42
|
Simple.args = {
|
|
43
43
|
coreSdkConfig: {
|
|
44
|
-
configId: "testing-
|
|
44
|
+
configId: "testing-80002-0",
|
|
45
45
|
envName: "testing"
|
|
46
46
|
// metaTransactionsApiKey: undefined,
|
|
47
47
|
// metaTransactionsApiId: "dummyApiId",
|
|
@@ -68,7 +68,7 @@ Simple.args = {
|
|
|
68
68
|
|
|
69
69
|
WithExtraInfo.args = {
|
|
70
70
|
coreSdkConfig: {
|
|
71
|
-
configId: "testing-
|
|
71
|
+
configId: "testing-80002-0",
|
|
72
72
|
envName: "testing"
|
|
73
73
|
// metaTransactionsApiKey: undefined,
|
|
74
74
|
},
|
|
@@ -40,7 +40,7 @@ export const WithExtraInfo: ComponentStory<typeof EscalateDisputeButton> =
|
|
|
40
40
|
|
|
41
41
|
Simple.args = {
|
|
42
42
|
coreSdkConfig: {
|
|
43
|
-
configId: "testing-
|
|
43
|
+
configId: "testing-80002-0",
|
|
44
44
|
envName: "testing"
|
|
45
45
|
// metaTransactionsApiKey: undefined,
|
|
46
46
|
// metaTransactionsApiId: "dummyApiId",
|
|
@@ -66,7 +66,7 @@ Simple.args = {
|
|
|
66
66
|
|
|
67
67
|
WithExtraInfo.args = {
|
|
68
68
|
coreSdkConfig: {
|
|
69
|
-
configId: "testing-
|
|
69
|
+
configId: "testing-80002-0",
|
|
70
70
|
envName: "testing"
|
|
71
71
|
// metaTransactionsApiKey: undefined,
|
|
72
72
|
},
|
|
@@ -41,7 +41,7 @@ export const WithExtraInfo: ComponentStory<typeof ExpireDisputeButton> =
|
|
|
41
41
|
|
|
42
42
|
Simple.args = {
|
|
43
43
|
coreSdkConfig: {
|
|
44
|
-
configId: "testing-
|
|
44
|
+
configId: "testing-80002-0",
|
|
45
45
|
envName: "testing"
|
|
46
46
|
// metaTransactionsApiKey: undefined,
|
|
47
47
|
// metaTransactionsApiId: "dummyApiId",
|
|
@@ -67,7 +67,7 @@ Simple.args = {
|
|
|
67
67
|
|
|
68
68
|
WithExtraInfo.args = {
|
|
69
69
|
coreSdkConfig: {
|
|
70
|
-
configId: "testing-
|
|
70
|
+
configId: "testing-80002-0",
|
|
71
71
|
envName: "testing"
|
|
72
72
|
// metaTransactionsApiKey: undefined,
|
|
73
73
|
},
|
|
@@ -41,7 +41,7 @@ export const WithExtraInfo: ComponentStory<
|
|
|
41
41
|
|
|
42
42
|
Simple.args = {
|
|
43
43
|
coreSdkConfig: {
|
|
44
|
-
configId: "testing-
|
|
44
|
+
configId: "testing-80002-0",
|
|
45
45
|
envName: "testing"
|
|
46
46
|
// metaTransactionsApiKey: undefined,
|
|
47
47
|
// metaTransactionsApiId: "dummyApiId"
|
|
@@ -67,7 +67,7 @@ Simple.args = {
|
|
|
67
67
|
|
|
68
68
|
WithExtraInfo.args = {
|
|
69
69
|
coreSdkConfig: {
|
|
70
|
-
configId: "testing-
|
|
70
|
+
configId: "testing-80002-0",
|
|
71
71
|
envName: "testing"
|
|
72
72
|
// metaTransactionsApiKey: undefined,
|
|
73
73
|
},
|
|
@@ -40,7 +40,7 @@ export const WithExtraInfo: ComponentStory<typeof ExtendDisputeTimeoutButton> =
|
|
|
40
40
|
|
|
41
41
|
Simple.args = {
|
|
42
42
|
coreSdkConfig: {
|
|
43
|
-
configId: "testing-
|
|
43
|
+
configId: "testing-80002-0",
|
|
44
44
|
envName: "testing"
|
|
45
45
|
// metaTransactionsApiKey: undefined,
|
|
46
46
|
// metaTransactionsApiId: "dummyApiId",
|
|
@@ -67,7 +67,7 @@ Simple.args = {
|
|
|
67
67
|
|
|
68
68
|
WithExtraInfo.args = {
|
|
69
69
|
coreSdkConfig: {
|
|
70
|
-
configId: "testing-
|
|
70
|
+
configId: "testing-80002-0",
|
|
71
71
|
envName: "testing"
|
|
72
72
|
// metaTransactionsApiKey: undefined,
|
|
73
73
|
},
|
|
@@ -41,7 +41,7 @@ export const WithExtraInfo: ComponentStory<typeof RaiseDisputeButton> =
|
|
|
41
41
|
|
|
42
42
|
Simple.args = {
|
|
43
43
|
coreSdkConfig: {
|
|
44
|
-
configId: "testing-
|
|
44
|
+
configId: "testing-80002-0",
|
|
45
45
|
envName: "testing"
|
|
46
46
|
// metaTransactionsApiKey: undefined,
|
|
47
47
|
// metaTransactionsApiId: "dummyApiId",
|
|
@@ -67,7 +67,7 @@ Simple.args = {
|
|
|
67
67
|
|
|
68
68
|
WithExtraInfo.args = {
|
|
69
69
|
coreSdkConfig: {
|
|
70
|
-
configId: "testing-
|
|
70
|
+
configId: "testing-80002-0",
|
|
71
71
|
envName: "testing"
|
|
72
72
|
// metaTransactionsApiKey: undefined,
|
|
73
73
|
},
|
|
@@ -41,7 +41,7 @@ export const WithExtraInfo: ComponentStory<typeof RefuseDisputeButton> =
|
|
|
41
41
|
|
|
42
42
|
Simple.args = {
|
|
43
43
|
coreSdkConfig: {
|
|
44
|
-
configId: "testing-
|
|
44
|
+
configId: "testing-80002-0",
|
|
45
45
|
envName: "testing"
|
|
46
46
|
// metaTransactionsApiKey: undefined,
|
|
47
47
|
// metaTransactionsApiId: "dummyApiId",
|
|
@@ -67,7 +67,7 @@ Simple.args = {
|
|
|
67
67
|
|
|
68
68
|
WithExtraInfo.args = {
|
|
69
69
|
coreSdkConfig: {
|
|
70
|
-
configId: "testing-
|
|
70
|
+
configId: "testing-80002-0",
|
|
71
71
|
envName: "testing"
|
|
72
72
|
// metaTransactionsApiKey: undefined,
|
|
73
73
|
},
|
|
@@ -40,7 +40,7 @@ export const WithExtraInfo: ComponentStory<typeof RemoveFeesDisputeResolver> =
|
|
|
40
40
|
|
|
41
41
|
Simple.args = {
|
|
42
42
|
coreSdkConfig: {
|
|
43
|
-
configId: "testing-
|
|
43
|
+
configId: "testing-80002-0",
|
|
44
44
|
envName: "testing",
|
|
45
45
|
web3Provider: undefined
|
|
46
46
|
},
|
|
@@ -66,7 +66,7 @@ Simple.args = {
|
|
|
66
66
|
|
|
67
67
|
WithExtraInfo.args = {
|
|
68
68
|
coreSdkConfig: {
|
|
69
|
-
configId: "testing-
|
|
69
|
+
configId: "testing-80002-0",
|
|
70
70
|
envName: "testing",
|
|
71
71
|
web3Provider: undefined
|
|
72
72
|
},
|