Skip to content

Commit

Permalink
feat: propagate custom contractNetworks config in Safe4337Pack.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Nesquiko committed Jan 21, 2025
1 parent 35a2e19 commit c6c4b94
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 8 additions & 2 deletions packages/relay-kit/src/packs/safe-4337/Safe4337Pack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ export class Safe4337Pack extends RelayKitBasePack<{
bundlerUrl,
customContracts,
paymasterOptions,
onchainAnalytics
onchainAnalytics,
contractNetworks
} = initOptions

let protocolKit: Safe
Expand Down Expand Up @@ -272,7 +273,12 @@ export class Safe4337Pack extends RelayKitBasePack<{
setupTransactions.push(approveToPaymasterTransaction)
}

const safeProvider = await SafeProvider.init({ provider, signer, safeVersion })
const safeProvider = await SafeProvider.init({
provider,
signer,
safeVersion,
contractNetworks
})

// third transaction: passkey support via shared signer SafeWebAuthnSharedSigner
// see: https://github.com/safe-global/safe-modules/blob/main/modules/passkey/contracts/4337/experimental/README.md
Expand Down
4 changes: 3 additions & 1 deletion packages/relay-kit/src/packs/safe-4337/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { Account, Address, Chain, Hash, Hex, PublicClient, PublicRpcSchema, Tran
import Safe, {
DeploymentType,
SafeProviderConfig,
OnchainAnalyticsProps
OnchainAnalyticsProps,
ContractNetworksConfig
} from '@safe-global/protocol-kit'
import {
EstimateGasData,
Expand Down Expand Up @@ -55,6 +56,7 @@ export type Safe4337InitOptions = {
options: ExistingSafeOptions | PredictedSafeOptions
paymasterOptions?: PaymasterOptions
onchainAnalytics?: OnchainAnalyticsProps
contractNetworks?: ContractNetworksConfig
}

export type Safe4337Options = {
Expand Down

0 comments on commit c6c4b94

Please sign in to comment.