@@ -24,15 +24,15 @@ export type AssessmentResult = {
2424
2525// New type for v2 request items
2626type SanctionsCheckV2RequestItem = {
27- address ? : string ;
28- amount ? : string ;
29- token_addr ? : string ;
27+ address : string ;
28+ amount : string ;
29+ token_addr : string ;
3030} ;
3131
3232export const fetchRiskAssessment = async (
3333 addresses : string [ ] ,
3434 config : CheckoutConfiguration ,
35- tokenData ? : Array < { address : string ; tokenAddr ? : string ; amount ? : string } > ,
35+ tokenData : Array < { address : string ; tokenAddr : string ; amount : string } > ,
3636) : Promise < AssessmentResult > => {
3737 const result = Object . fromEntries (
3838 addresses . map ( ( address ) => [ address . toLowerCase ( ) , { sanctioned : false } ] ) ,
@@ -51,15 +51,17 @@ export const fetchRiskAssessment = async (
5151
5252 // Prepare v2 request payload
5353 const requestPayload : SanctionsCheckV2RequestItem [ ] = addresses . map ( ( address ) => {
54- const item : SanctionsCheckV2RequestItem = { address } ;
55-
56- // Add token and amount data if available
57- if ( tokenData ) {
58- const tokenInfo = tokenData . find ( ( t ) => t . address . toLowerCase ( ) === address . toLowerCase ( ) ) ;
59- if ( tokenInfo ) {
60- if ( tokenInfo . tokenAddr ) item . token_addr = tokenInfo . tokenAddr ;
61- if ( tokenInfo . amount ) item . amount = tokenInfo . amount ;
62- }
54+ const item : SanctionsCheckV2RequestItem = {
55+ address,
56+ token_addr : '' ,
57+ amount : '0'
58+ } ;
59+
60+ // Add token and amount data
61+ const tokenInfo = tokenData . find ( ( t ) => t . address . toLowerCase ( ) === address . toLowerCase ( ) ) ;
62+ if ( tokenInfo ) {
63+ item . token_addr = tokenInfo . tokenAddr ;
64+ item . amount = tokenInfo . amount ;
6365 }
6466
6567 return item ;
0 commit comments