11import { z } from "zod" ;
2- import SafeApiKit , { type SafeApiKitConfig } from "@safe-global/api-kit" ;
2+ import SafeApiKit from "@safe-global/api-kit" ;
33
44import { SignatureRequestPurpose } from "../../graphql/schemas/typeDefs/signatureRequestTypeDefs.js" ;
55import { SupabaseDataService } from "../../services/SupabaseDataService.js" ;
66import { UserResponse } from "../../types/api.js" ;
77import { isTypedMessage } from "../../utils/signatures.js" ;
8+ import { SafeApiStrategyFactory } from "../safe/SafeApiKitStrategy.js" ;
89
910import type { UserUpsertStrategy } from "./UserUpsertStrategy.js" ;
1011import type { MultisigUpdateRequest } from "./schemas.js" ;
@@ -30,17 +31,16 @@ export default class MultisigUpdateStrategy implements UserUpsertStrategy {
3031 private readonly dataService : SupabaseDataService ;
3132 // Safe SDKs only support CommonJS, so TS interprets `SafeApiKit` as a namespace.
3233 // https://docs.safe.global/sdk/overview
33- // Hence the explicit `default` here and on the instantiation further down .
34+ // Hence the explicit `default` here.
3435 private readonly safeApiKit : SafeApiKit . default ;
3536
3637 constructor (
3738 private readonly address : string ,
3839 private readonly request : MultisigUpdateRequest ,
3940 ) {
40- const config : SafeApiKitConfig = {
41- chainId : BigInt ( request . chain_id ) ,
42- } ;
43- this . safeApiKit = new SafeApiKit . default ( config ) ;
41+ this . safeApiKit = SafeApiStrategyFactory . getStrategy (
42+ this . request . chain_id ,
43+ ) . createInstance ( ) ;
4444 this . dataService = new SupabaseDataService ( ) ;
4545 }
4646
0 commit comments