@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.
Files changed (165) hide show
  1. package/dist/cjs/components/cta/offer/CommitButton.d.ts.map +1 -1
  2. package/dist/cjs/components/cta/offer/CommitButton.js.map +1 -1
  3. package/dist/cjs/components/currencyDisplay/CurrencyDisplay.d.ts.map +1 -1
  4. package/dist/cjs/components/currencyDisplay/CurrencyDisplay.js +3 -3
  5. package/dist/cjs/components/currencyDisplay/CurrencyDisplay.js.map +1 -1
  6. package/dist/cjs/components/datepicker/SelectTime.js.map +1 -1
  7. package/dist/cjs/components/form/BaseSelect.js.map +1 -1
  8. package/dist/cjs/components/form/Select.js.map +1 -1
  9. package/dist/cjs/components/modal/ModalContext.d.ts +1 -1
  10. package/dist/cjs/components/modal/ModalContext.d.ts.map +1 -1
  11. package/dist/cjs/components/modal/ModalContext.js.map +1 -1
  12. package/dist/cjs/components/modal/components/Commit/CommitSuccess/CommitSuccess.js +1 -1
  13. package/dist/cjs/components/modal/components/Redeem/ExchangeView/cancellation/CancelExchange.d.ts.map +1 -1
  14. package/dist/cjs/components/modal/components/Redeem/ExchangeView/cancellation/CancelExchange.js.map +1 -1
  15. package/dist/cjs/components/modal/components/Redeem/ExchangeView/expireVoucher/ExpireVoucher.d.ts.map +1 -1
  16. package/dist/cjs/components/modal/components/Redeem/ExchangeView/expireVoucher/ExpireVoucher.js.map +1 -1
  17. package/dist/cjs/components/modal/components/Redeem/MyItems/WithExchangesData.js.map +1 -1
  18. package/dist/cjs/components/modal/components/Redeem/RedeemNonModal.js.map +1 -1
  19. package/dist/cjs/components/modal/components/common/OfferFullDescription/DigitalProductData.js.map +1 -1
  20. package/dist/cjs/components/modal/components/common/OfferFullDescription/OfferFullDescription.d.ts +1 -1
  21. package/dist/cjs/components/modal/components/common/OfferFullDescription/OfferFullDescription.d.ts.map +1 -1
  22. package/dist/cjs/components/modal/components/common/detail/Detail.style.d.ts.map +1 -1
  23. package/dist/cjs/components/modal/components/common/detail/Detail.style.js +5 -2
  24. package/dist/cjs/components/modal/components/common/detail/Detail.style.js.map +1 -1
  25. package/dist/cjs/components/modal/components/common/detail/DetailSlider.js.map +1 -1
  26. package/dist/cjs/components/modal/components/common/detail/DetailViewWithProvider.js.map +1 -1
  27. package/dist/cjs/components/modal/components/common/detail/TokenGatedItem.js.map +1 -1
  28. package/dist/cjs/components/wallet/wallet-connection.d.ts.map +1 -1
  29. package/dist/cjs/components/wallet/wallet-connection.js +22 -0
  30. package/dist/cjs/components/wallet/wallet-connection.js.map +1 -1
  31. package/dist/cjs/components/widgets/commit/CommitModalWithOffer.js.map +1 -1
  32. package/dist/cjs/lib/chains/getNativeLogoURI.d.ts +1 -1
  33. package/dist/cjs/lib/chains/getNativeLogoURI.d.ts.map +1 -1
  34. package/dist/cjs/lib/chains/getNativeLogoURI.js +1 -0
  35. package/dist/cjs/lib/chains/getNativeLogoURI.js.map +1 -1
  36. package/dist/cjs/lib/config/config.d.ts +1 -0
  37. package/dist/cjs/lib/config/config.d.ts.map +1 -1
  38. package/dist/cjs/lib/const/chainInfo.d.ts.map +1 -1
  39. package/dist/cjs/lib/const/chainInfo.js +15 -0
  40. package/dist/cjs/lib/const/chainInfo.js.map +1 -1
  41. package/dist/cjs/lib/const/chains.d.ts +2 -1
  42. package/dist/cjs/lib/const/chains.d.ts.map +1 -1
  43. package/dist/cjs/lib/const/chains.js +3 -1
  44. package/dist/cjs/lib/const/chains.js.map +1 -1
  45. package/dist/cjs/lib/const/networks.d.ts +2 -0
  46. package/dist/cjs/lib/const/networks.d.ts.map +1 -1
  47. package/dist/cjs/lib/const/networks.js +8 -0
  48. package/dist/cjs/lib/const/networks.js.map +1 -1
  49. package/dist/cjs/lib/const/tokens.d.ts +3 -1
  50. package/dist/cjs/lib/const/tokens.d.ts.map +1 -1
  51. package/dist/cjs/lib/const/tokens.js +4 -2
  52. package/dist/cjs/lib/const/tokens.js.map +1 -1
  53. package/dist/cjs/lib/opensea/getOpenSeaUrl.js +4 -4
  54. package/dist/cjs/lib/opensea/getOpenSeaUrl.js.map +1 -1
  55. package/dist/esm/components/cta/offer/CommitButton.d.ts.map +1 -1
  56. package/dist/esm/components/cta/offer/CommitButton.js.map +1 -1
  57. package/dist/esm/components/currencyDisplay/CurrencyDisplay.d.ts.map +1 -1
  58. package/dist/esm/components/currencyDisplay/CurrencyDisplay.js +3 -3
  59. package/dist/esm/components/currencyDisplay/CurrencyDisplay.js.map +1 -1
  60. package/dist/esm/components/datepicker/SelectTime.js.map +1 -1
  61. package/dist/esm/components/form/BaseSelect.js.map +1 -1
  62. package/dist/esm/components/form/Select.js.map +1 -1
  63. package/dist/esm/components/modal/ModalContext.d.ts +1 -1
  64. package/dist/esm/components/modal/ModalContext.d.ts.map +1 -1
  65. package/dist/esm/components/modal/ModalContext.js.map +1 -1
  66. package/dist/esm/components/modal/components/Commit/CommitSuccess/CommitSuccess.js +1 -1
  67. package/dist/esm/components/modal/components/Redeem/ExchangeView/cancellation/CancelExchange.d.ts.map +1 -1
  68. package/dist/esm/components/modal/components/Redeem/ExchangeView/cancellation/CancelExchange.js.map +1 -1
  69. package/dist/esm/components/modal/components/Redeem/ExchangeView/expireVoucher/ExpireVoucher.d.ts.map +1 -1
  70. package/dist/esm/components/modal/components/Redeem/ExchangeView/expireVoucher/ExpireVoucher.js.map +1 -1
  71. package/dist/esm/components/modal/components/Redeem/MyItems/WithExchangesData.js.map +1 -1
  72. package/dist/esm/components/modal/components/Redeem/RedeemNonModal.js.map +1 -1
  73. package/dist/esm/components/modal/components/common/OfferFullDescription/DigitalProductData.js.map +1 -1
  74. package/dist/esm/components/modal/components/common/OfferFullDescription/OfferFullDescription.d.ts +1 -1
  75. package/dist/esm/components/modal/components/common/OfferFullDescription/OfferFullDescription.d.ts.map +1 -1
  76. package/dist/esm/components/modal/components/common/detail/Detail.style.d.ts.map +1 -1
  77. package/dist/esm/components/modal/components/common/detail/Detail.style.js +5 -2
  78. package/dist/esm/components/modal/components/common/detail/Detail.style.js.map +1 -1
  79. package/dist/esm/components/modal/components/common/detail/DetailSlider.js.map +1 -1
  80. package/dist/esm/components/modal/components/common/detail/DetailViewWithProvider.js.map +1 -1
  81. package/dist/esm/components/modal/components/common/detail/TokenGatedItem.js.map +1 -1
  82. package/dist/esm/components/wallet/wallet-connection.d.ts.map +1 -1
  83. package/dist/esm/components/wallet/wallet-connection.js +22 -0
  84. package/dist/esm/components/wallet/wallet-connection.js.map +1 -1
  85. package/dist/esm/components/widgets/commit/CommitModalWithOffer.js.map +1 -1
  86. package/dist/esm/lib/chains/getNativeLogoURI.d.ts +1 -1
  87. package/dist/esm/lib/chains/getNativeLogoURI.d.ts.map +1 -1
  88. package/dist/esm/lib/chains/getNativeLogoURI.js +1 -0
  89. package/dist/esm/lib/chains/getNativeLogoURI.js.map +1 -1
  90. package/dist/esm/lib/config/config.d.ts +1 -0
  91. package/dist/esm/lib/config/config.d.ts.map +1 -1
  92. package/dist/esm/lib/const/chainInfo.d.ts.map +1 -1
  93. package/dist/esm/lib/const/chainInfo.js +15 -0
  94. package/dist/esm/lib/const/chainInfo.js.map +1 -1
  95. package/dist/esm/lib/const/chains.d.ts +2 -1
  96. package/dist/esm/lib/const/chains.d.ts.map +1 -1
  97. package/dist/esm/lib/const/chains.js +3 -1
  98. package/dist/esm/lib/const/chains.js.map +1 -1
  99. package/dist/esm/lib/const/networks.d.ts +2 -0
  100. package/dist/esm/lib/const/networks.d.ts.map +1 -1
  101. package/dist/esm/lib/const/networks.js +8 -0
  102. package/dist/esm/lib/const/networks.js.map +1 -1
  103. package/dist/esm/lib/const/tokens.d.ts +3 -1
  104. package/dist/esm/lib/const/tokens.d.ts.map +1 -1
  105. package/dist/esm/lib/const/tokens.js +4 -1
  106. package/dist/esm/lib/const/tokens.js.map +1 -1
  107. package/dist/esm/lib/opensea/getOpenSeaUrl.js +4 -4
  108. package/dist/esm/lib/opensea/getOpenSeaUrl.js.map +1 -1
  109. package/package.json +6 -5
  110. package/src/components/cta/offer/CommitButton.tsx +2 -3
  111. package/src/components/currencyDisplay/CurrencyDisplay.tsx +4 -5
  112. package/src/components/datepicker/SelectTime.tsx +4 -4
  113. package/src/components/form/BaseSelect.tsx +2 -2
  114. package/src/components/form/Select.tsx +4 -4
  115. package/src/components/modal/ModalContext.tsx +4 -5
  116. package/src/components/modal/components/Commit/CommitSuccess/CommitSuccess.tsx +1 -1
  117. package/src/components/modal/components/Redeem/ExchangeView/cancellation/CancelExchange.tsx +2 -3
  118. package/src/components/modal/components/Redeem/ExchangeView/expireVoucher/ExpireVoucher.tsx +2 -3
  119. package/src/components/modal/components/Redeem/MyItems/WithExchangesData.tsx +2 -2
  120. package/src/components/modal/components/Redeem/RedeemNonModal.tsx +8 -8
  121. package/src/components/modal/components/common/OfferFullDescription/DigitalProductData.tsx +6 -6
  122. package/src/components/modal/components/common/OfferFullDescription/OfferFullDescription.tsx +1 -1
  123. package/src/components/modal/components/common/detail/Detail.style.tsx +5 -2
  124. package/src/components/modal/components/common/detail/DetailSlider.tsx +2 -2
  125. package/src/components/modal/components/common/detail/DetailViewWithProvider.tsx +1 -1
  126. package/src/components/modal/components/common/detail/TokenGatedItem.tsx +10 -10
  127. package/src/components/wallet/wallet-connection.ts +23 -1
  128. package/src/components/widgets/commit/CommitModalWithOffer.tsx +1 -1
  129. package/src/lib/chains/getNativeLogoURI.ts +4 -1
  130. package/src/lib/const/chainInfo.ts +15 -0
  131. package/src/lib/const/chains.ts +3 -1
  132. package/src/lib/const/networks.ts +8 -0
  133. package/src/lib/const/tokens.ts +15 -2
  134. package/src/lib/opensea/getOpenSeaUrl.ts +6 -6
  135. package/src/stories/cta/dispute/AddFeesDisputeResolverButton.stories.tsx +2 -2
  136. package/src/stories/cta/dispute/AddSellerToDisputeResolverButton.stories.tsx +2 -2
  137. package/src/stories/cta/dispute/CreateDisputeResolverButton.stories.tsx +2 -2
  138. package/src/stories/cta/dispute/DecideDisputeButton.stories.tsx +2 -2
  139. package/src/stories/cta/dispute/EscalateDisputeButton.stories.tsx +2 -2
  140. package/src/stories/cta/dispute/ExpireDisputeButton.stories.tsx +2 -2
  141. package/src/stories/cta/dispute/ExpireEscalationDisputeButton.stories.tsx +2 -2
  142. package/src/stories/cta/dispute/ExtendDisputeTimeoutButton.stories.tsx +2 -2
  143. package/src/stories/cta/dispute/RaiseDisputeButton.stories.tsx +2 -2
  144. package/src/stories/cta/dispute/RefuseDisputeButton.stories.tsx +2 -2
  145. package/src/stories/cta/dispute/RemoveFeesDisputeResolverButton.stories.tsx +2 -2
  146. package/src/stories/cta/dispute/RemoveSellerFromDisputeResolverButton.stories.tsx +2 -2
  147. package/src/stories/cta/dispute/ResolveDisputeButton.stories.tsx +2 -2
  148. package/src/stories/cta/dispute/RetractDisputeButton.stories.tsx +2 -2
  149. package/src/stories/cta/dispute/UpdateDisputeResolverButton.stories.tsx +2 -2
  150. package/src/stories/cta/exchange/BatchCompleteButton.stories.tsx +2 -2
  151. package/src/stories/cta/exchange/CancelButton.stories.tsx +2 -2
  152. package/src/stories/cta/exchange/CompleteButton.stories.tsx +2 -2
  153. package/src/stories/cta/exchange/ExpireButton.stories.tsx +2 -2
  154. package/src/stories/cta/exchange/RedeemButton.stories.tsx +3 -3
  155. package/src/stories/cta/exchange/RevokeButton.stories.tsx +2 -2
  156. package/src/stories/cta/funds/DepositFundsButton.stories.tsx +3 -3
  157. package/src/stories/cta/funds/WithdrawAllFunds.stories.tsx +3 -3
  158. package/src/stories/cta/funds/WithdrawFundsButton.stories.tsx +3 -3
  159. package/src/stories/cta/offer/BatchVoidButton.stories.tsx +2 -2
  160. package/src/stories/cta/offer/CommitButton.stories.tsx +3 -3
  161. package/src/stories/cta/offer/CreateOfferButton.stories.tsx +2 -2
  162. package/src/stories/cta/offer/VoidButton.stories.tsx +2 -2
  163. package/src/stories/cta/seller/CreateSellerButton.stories.tsx +2 -2
  164. package/src/stories/cta/seller/UpdateSellerButton.stories.tsx +2 -2
  165. 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
- ? dayjs().format("HH")
50
- : "00",
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
- ? dayjs().add(5, "minute").format("mm")
59
- : "00",
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
- ? `1px solid ${colors.orange}`
27
- : `1px solid ${colors.border}`
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
- ? `1px solid ${colors.orange}`
46
- : `1px solid ${colors.border}`,
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
- ? errorMessage
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> = Parameters<
28
- typeof MODAL_COMPONENTS[T]
29
- >[0] extends Record<string, never>
30
- ? ModalProps & Record<string, never>
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
- {[80001, 137].includes(config.chainId)
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 = await coreSDK.getExchangeById(
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 = await coreSDK.getExchangeById(
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
- ? sellerCurationList
56
- : undefined;
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
- ? 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;
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
- attribute.value as keyof typeof digitalNftTypeMapping
106
- ]
107
- ? digitalNftTypeMapping[
108
- attribute.value as keyof typeof digitalNftTypeMapping
109
- ]
110
- : attribute.value}
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
  })),
@@ -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: 0px 0px 0px rgba(0, 0, 0, 0.05), 0px 0px 16px rgba(0, 0, 0, 0.05),
510
- 0px 0px 32px rgba(0, 0, 0, 0.05), 0px 0px 64px rgba(0, 0, 0, 0.05),
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
- ? true
129
- : sumMediaFiles > (sliderOptions.perView ?? 1);
128
+ ? true
129
+ : sumMediaFiles > (sliderOptions.perView ?? 1);
130
130
  const draggable = showArrows;
131
131
  useEffect(() => {
132
132
  if (mediaFiles.length !== 0 && ref.current !== null) {
@@ -111,7 +111,7 @@ export const DetailViewWithProvider: React.FC<
111
111
  )
112
112
  : "",
113
113
  [swapQueryParameters.exactField]: Field.OUTPUT.toLowerCase()
114
- } as const),
114
+ }) as const,
115
115
  [
116
116
  minNeededBalance,
117
117
  offer.exchangeToken.address,
@@ -216,16 +216,16 @@ export const TokenGatedItem = ({
216
216
  !chainId || !condition
217
217
  ? null
218
218
  : condition.tokenAddress === ethers.constants.AddressZero
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,
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];
@@ -82,7 +82,7 @@ function WithProductOrOffer(
82
82
  ({
83
83
  variations: productV1Item.variations,
84
84
  offer: bundle.offer
85
- } as VariantV1)
85
+ }) as VariantV1
86
86
  );
87
87
  })
88
88
  .filter(isTruthy);
@@ -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(chainId: ChainId = ChainId.MAINNET): string {
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
 
@@ -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]: [
@@ -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 chainId === ChainId.POLYGON_MUMBAI || chainId === ChainId.POLYGON;
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", // Mumbai
7
+ "testing", // testnets
8
8
  new Map([
9
9
  [
10
- "testing-80001-0",
10
+ "testing-80002-0",
11
11
  (tokenId: string, contractAddress: string) =>
12
- `https://testnets.opensea.io/assets/mumbai/${contractAddress}/${tokenId}`
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", // Mumbai
22
+ "staging", // testnets
23
23
  new Map([
24
24
  [
25
- "staging-80001-0",
25
+ "staging-80002-0",
26
26
  (tokenId: string, contractAddress: string) =>
27
- `https://testnets.opensea.io/assets/mumbai/${contractAddress}/${tokenId}`
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-80001-0",
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-80001-0",
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-80001-0",
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-80001-0",
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-80001-0",
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-80001-0",
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-80001-0",
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-80001-0",
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-80001-0",
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-80001-0",
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-80001-0",
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-80001-0",
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-80001-0",
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-80001-0",
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-80001-0",
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-80001-0",
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-80001-0",
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-80001-0",
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-80001-0",
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-80001-0",
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-80001-0",
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-80001-0",
69
+ configId: "testing-80002-0",
70
70
  envName: "testing",
71
71
  web3Provider: undefined
72
72
  },