11const core = require ( '@actions/core' ) ;
22const SafeApiKit = require ( '@safe-global/api-kit' ) . default ;
33const Safe = require ( '@safe-global/protocol-kit' ) . default ;
4+ const { EthersAdapter } = require ( '@safe-global/protocol-kit' ) ;
45const { OperationType } = require ( '@safe-global/types-kit' ) ;
5- const { Wallet } = require ( 'ethers' ) ;
6+ const { Wallet, JsonRpcProvider , ethers } = require ( 'ethers' ) ;
67
78async function run ( ) {
89 try {
@@ -20,10 +21,17 @@ async function run() {
2021 core . info ( `📍 Safe Address: ${ safeAddress } ` ) ;
2122 core . info ( `🎯 Target Address: ${ transactionTargetAddress } ` ) ;
2223
23- // Initialize wallet
24- const wallet = new Wallet ( proposerPrivateKey ) ;
24+ // Initialize wallet and provider
25+ const provider = new JsonRpcProvider ( rpcUrl ) ;
26+ const wallet = new Wallet ( proposerPrivateKey , provider ) ;
2527 core . info ( `👤 Proposer Address: ${ wallet . address } ` ) ;
2628
29+ // Initialize EthAdapter
30+ const ethAdapter = new EthersAdapter ( {
31+ ethers,
32+ signerOrProvider : wallet ,
33+ } ) ;
34+
2735 // Initialize API Kit
2836 const apiKit = new SafeApiKit ( {
2937 chainId : chainId ,
@@ -32,8 +40,7 @@ async function run() {
3240
3341 // Initialize Protocol Kit
3442 const protocolKit = await Safe . create ( {
35- provider : rpcUrl ,
36- signer : proposerPrivateKey ,
43+ ethAdapter,
3744 safeAddress : safeAddress ,
3845 } ) ;
3946
0 commit comments