@@ -98,8 +98,6 @@ if echo "$ROUTES_RESPONSE" | grep -q "error"; then
9898 exit 1
9999fi
100100
101- echo response gotten: $ROUTES_RESPONSE
102-
103101# Extract the first route and its first step
104102FIRST_STEP=$( echo " $ROUTES_RESPONSE " | jq -r ' .routes[1].steps[0]' )
105103
137135echo " ✓ Transaction calldata retrieved successfully"
138136echo " "
139137
140- echo $STEP_TX_RESPONSE
141-
142138# Extract transaction details
143139TX_TO=$( echo " $STEP_TX_RESPONSE " | jq -r ' .transactionRequest.to' )
144140TX_DATA=$( echo " $STEP_TX_RESPONSE " | jq -r ' .transactionRequest.data' )
@@ -155,12 +151,16 @@ echo " Approval Amount: $APPROVAL_AMOUNT (Bridge Amount: $FROM_AMOUNT )"
155151echo " Spender: $TX_TO "
156152echo " "
157153
158- APPROVE_TX_HASH =$( cast send " $FROM_TOKEN " \
154+ APPROVE_TX_OUTPUT =$( cast send " $FROM_TOKEN " \
159155 " approve(address,uint256)(bool)" \
160156 " $TX_TO " \
161157 " $APPROVAL_AMOUNT " \
162158 --private-key " $PRIVATE_KEY " \
163- --rpc-url " $FROM_RPC_URL " | grep " transactionHash" | awk ' {print $2}' )
159+ --rpc-url " $FROM_RPC_URL " \
160+ --json)
161+
162+ APPROVE_TX_HASH=$( echo " $APPROVE_TX_OUTPUT " | jq -r ' .transactionHash' )
163+ echo Approve tx hash: $APPROVE_TX_HASH
164164
165165if [ -z " $APPROVE_TX_HASH " ]; then
166166 echo " Error: Approval transaction failed"
@@ -172,7 +172,7 @@ echo "Approval Transaction Hash: $APPROVE_TX_HASH"
172172echo " "
173173
174174
175- echo " Sleeping to avoid nonce/tx replacement issues"
175+ echo " Sleeping to avoid nonce/tx replacement issues ... "
176176sleep 4
177177
178178# Step 3: Submit the transaction
@@ -181,11 +181,15 @@ echo "To Address: $TX_TO"
181181echo " Gas Limit: $TX_GAS_LIMIT "
182182echo " "
183183
184- TX_HASH =$( cast send " $TX_TO " \
184+ TX_OUTPUT =$( cast send " $TX_TO " \
185185 --private-key " $PRIVATE_KEY " \
186186 --gas-limit " $TX_GAS_LIMIT " \
187187 --rpc-url " $FROM_RPC_URL " \
188- " $TX_DATA " | grep " transactionHash" | awk ' {print $2}' )
188+ --json \
189+ " $TX_DATA " )
190+
191+ TX_HASH=$( echo " $TX_OUTPUT " | jq -r ' .transactionHash' )
192+ echo Burn tx hash: $TX_HASH
189193
190194if [ -z " $TX_HASH " ]; then
191195 echo " Error: Transaction submission failed"
@@ -213,7 +217,7 @@ echo "✓ Transaction mined successfully"
213217echo " "
214218
215219# Step 4: Monitor CCTP transfer status
216- echo " Step 4: Monitoring CCTP transfer status... "
220+ echo " Step 4: Monitoring CCTP transfer status at url " " ${API_URL} /v1/status/ ${TX_HASH} "
217221MAX_RETRIES=60
218222RETRY_INTERVAL=10
219223RETRY_COUNT=0
0 commit comments