@@ -535,6 +535,8 @@ export class HypercertClient implements HypercertClientInterface {
535535 * This function handles the batch claiming of fractions from multiple allowlists for the connected account.
536536 * It verifies the Merkle proofs if roots are provided and then submits the batch minting request.
537537 *
538+ * If you provide `overrides.safeAddress`, the transaction will be sent as a Safe transaction instead.
539+ *
538540 * @param params - The parameters for the batch claim operation.
539541 * @param params.hypercertTokenIds - The IDs of the hypercert tokens to claim.
540542 * @param params.units - The number of units to claim for each token.
@@ -563,12 +565,20 @@ export class HypercertClient implements HypercertClientInterface {
563565 ) ;
564566 }
565567
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 ) ;
572582
573583 return this . submitRequest ( request ) ;
574584 } ;
0 commit comments