File tree Expand file tree Collapse file tree 2 files changed +97
-148
lines changed Expand file tree Collapse file tree 2 files changed +97
-148
lines changed Original file line number Diff line number Diff line change @@ -1119,8 +1119,21 @@ export class Near extends BaseCoin {
11191119      throw  new  Error ( 'Error on token enablements: transaction has no outputs to validate beneficiary' ) ; 
11201120    } 
11211121
1122+     // NEAR token enablements only support a single recipient 
1123+     if  ( ! txParams . recipients  ||  txParams . recipients . length  ===  0 )  { 
1124+       throw  new  Error ( 'Error on token enablements: missing recipients in transaction parameters' ) ; 
1125+     } 
1126+ 
1127+     if  ( txParams . recipients . length  !==  1 )  { 
1128+       throw  new  Error ( 'Error on token enablements: token enablement only supports a single recipient' ) ; 
1129+     } 
1130+ 
1131+     if  ( explainedTx . outputs . length  !==  1 )  { 
1132+       throw  new  Error ( 'Error on token enablements: transaction must have exactly 1 output' ) ; 
1133+     } 
1134+ 
11221135    const  output  =  explainedTx . outputs [ 0 ] ; 
1123-     const  recipient  =  txParams . recipients ?. [ 0 ] ; 
1136+     const  recipient  =  txParams . recipients [ 0 ] ; 
11241137
11251138    if  ( ! recipient ?. address )  { 
11261139      throw  new  Error ( 'Error on token enablements: missing beneficiary address in transaction parameters' ) ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments