|
1 | 1 | import { |
2 | | - AssessmentResult, |
3 | | - fetchRiskAssessment, |
4 | 2 | FundingRoute, |
5 | 3 | SaleItem, SalePaymentTypes, |
6 | 4 | } from '@imtbl/checkout-sdk'; |
@@ -98,7 +96,6 @@ type SaleContextValues = SaleContextProps & { |
98 | 96 | orderQuote: OrderQuote; |
99 | 97 | signTokenIds: string[]; |
100 | 98 | selectedCurrency: OrderQuoteCurrency | undefined; |
101 | | - riskAssessment: AssessmentResult | undefined; |
102 | 99 | }; |
103 | 100 |
|
104 | 101 | // eslint-disable-next-line @typescript-eslint/naming-convention |
@@ -141,7 +138,6 @@ const SaleContext = createContext<SaleContextValues>({ |
141 | 138 | selectedCurrency: undefined, |
142 | 139 | waitFulfillmentSettlements: true, |
143 | 140 | hideExcludedPaymentTypes: false, |
144 | | - riskAssessment: undefined, |
145 | 141 | }); |
146 | 142 |
|
147 | 143 | SaleContext.displayName = 'SaleSaleContext'; |
@@ -206,8 +202,6 @@ export function SaleContextProvider(props: { |
206 | 202 |
|
207 | 203 | const [invalidParameters, setInvalidParameters] = useState<boolean>(false); |
208 | 204 |
|
209 | | - const [riskAssessment, setRiskAssessment] = useState<AssessmentResult | undefined>(); |
210 | | - |
211 | 205 | const { selectedCurrency, orderQuote, orderQuoteError } = useQuoteOrder({ |
212 | 206 | items, |
213 | 207 | provider, |
@@ -246,26 +240,6 @@ export function SaleContextProvider(props: { |
246 | 240 | getUserInfo(); |
247 | 241 | }, [provider]); |
248 | 242 |
|
249 | | - // TODO: check if this is can be removed. It is used on switching payment method to credit/debit. |
250 | | - // Need to check with legal if we can remove the sanction check for fiat payments and rely on |
251 | | - // third party checks, as our V2 sanctions API required token details. |
252 | | - useEffect(() => { |
253 | | - if (!checkout || riskAssessment) { |
254 | | - return; |
255 | | - } |
256 | | - |
257 | | - (async () => { |
258 | | - const address = await (await provider?.getSigner())?.getAddress(); |
259 | | - |
260 | | - if (!address) { |
261 | | - return; |
262 | | - } |
263 | | - |
264 | | - const assessment = await fetchRiskAssessment([address], checkout.config); |
265 | | - setRiskAssessment(assessment); |
266 | | - })(); |
267 | | - }, [checkout, provider]); |
268 | | - |
269 | 243 | const { |
270 | 244 | sign: signOrder, |
271 | 245 | executeAll, |
@@ -419,7 +393,6 @@ export function SaleContextProvider(props: { |
419 | 393 | selectedCurrency, |
420 | 394 | waitFulfillmentSettlements, |
421 | 395 | hideExcludedPaymentTypes, |
422 | | - riskAssessment, |
423 | 396 | }), |
424 | 397 | [ |
425 | 398 | config, |
@@ -454,7 +427,6 @@ export function SaleContextProvider(props: { |
454 | 427 | selectedCurrency, |
455 | 428 | waitFulfillmentSettlements, |
456 | 429 | hideExcludedPaymentTypes, |
457 | | - riskAssessment, |
458 | 430 | ], |
459 | 431 | ); |
460 | 432 |
|
|
0 commit comments