@@ -7,7 +7,6 @@ import { privateKeyToAccount } from "viem/accounts";
77import { env } from "./env.js" ;
88
99async function run ( ) {
10- // Environment variables are already validated and parsed
1110 const {
1211 RPC_URL : rpcUrl ,
1312 SAFE_ADDRESS : safeAddress ,
@@ -22,23 +21,19 @@ async function run() {
2221 core . info ( `📍 Safe Address: ${ safeAddress } ` ) ;
2322 core . info ( `🎯 Target Address: ${ transactionTo } ` ) ;
2423
25- // Initialize wallet
2624 const account = privateKeyToAccount ( safeProposerPrivateKey as `0x${string } `) ;
2725 core . info ( `🔑 Proposer Address: ${ account . address } ` ) ;
2826
29- // Detect chainId from RPC
3027 const publicClient = createPublicClient ( {
3128 transport : http ( rpcUrl ) ,
3229 } ) ;
3330 const chainId = await publicClient . getChainId ( ) ;
3431
35- // Initialize API Kit
3632 const apiKit = new SafeApiKit ( {
3733 chainId : BigInt ( chainId ) ,
3834 apiKey : safeApiKey ,
3935 } ) ;
4036
41- // Initialize Protocol Kit
4237 const protocolKit = await Safe . init ( {
4338 provider : rpcUrl ,
4439 signer : safeProposerPrivateKey ,
@@ -47,7 +42,6 @@ async function run() {
4742
4843 core . info ( `👤 Safe initialized for: ${ safeAddress } ` ) ;
4944
50- // Create transaction
5145 const safeTransactionData : MetaTransactionData = {
5246 to : transactionTo ,
5347 value : transactionValue ,
@@ -66,7 +60,6 @@ async function run() {
6660
6761 core . info ( `🔐 Transaction signed - hash: ${ safeTxHash } ` ) ;
6862
69- // Propose transaction to the service
7063 await apiKit . proposeTransaction ( {
7164 safeAddress : safeAddress ,
7265 safeTransactionData : safeTransaction . data ,
@@ -76,10 +69,8 @@ async function run() {
7669 origin : "GitHub Action - Propose Safe Multisig Transaction" ,
7770 } ) ;
7871
79- // Get transaction details
8072 const transaction = await apiKit . getTransaction ( safeTxHash ) ;
8173
82- // Set outputs
8374 core . setOutput ( "tx-hash" , safeTxHash ) ;
8475 core . setOutput ( "tx-details" , JSON . stringify ( transaction ) ) ;
8576
0 commit comments