@@ -535,6 +535,8 @@ export class HypercertClient implements HypercertClientInterface {
535
535
* This function handles the batch claiming of fractions from multiple allowlists for the connected account.
536
536
* It verifies the Merkle proofs if roots are provided and then submits the batch minting request.
537
537
*
538
+ * If you provide `overrides.safeAddress`, the transaction will be sent as a Safe transaction instead.
539
+ *
538
540
* @param params - The parameters for the batch claim operation.
539
541
* @param params.hypercertTokenIds - The IDs of the hypercert tokens to claim.
540
542
* @param params.units - The number of units to claim for each token.
@@ -563,12 +565,20 @@ export class HypercertClient implements HypercertClientInterface {
563
565
) ;
564
566
}
565
567
566
- const request = await this . simulateRequest (
567
- account ,
568
- "batchMintClaimsFromAllowlists" ,
569
- [ account . address , proofs , hypercertTokenIds , units ] ,
570
- overrides ,
571
- ) ;
568
+ const accountAddress = overrides ?. safeAddress ?? account . address ;
569
+ const params = [ accountAddress , proofs , hypercertTokenIds , units ] ;
570
+
571
+ // If a safe address is provided, use the SafeTransactions class
572
+ if ( overrides ?. safeAddress ) {
573
+ if ( ! this . _walletClient ) {
574
+ throw new ClientError ( "Safe address provided but no wallet client found" ) ;
575
+ }
576
+
577
+ const safeTransactions = new SafeTransactions ( overrides . safeAddress , this . _walletClient , this . _getContract ( ) ) ;
578
+ return safeTransactions . sendTransaction ( "batchMintClaimsFromAllowlists" , params , overrides ) ;
579
+ }
580
+
581
+ const request = await this . simulateRequest ( account , "batchMintClaimsFromAllowlists" , params , overrides ) ;
572
582
573
583
return this . submitRequest ( request ) ;
574
584
} ;
0 commit comments