xJonathanLEI / starkli

Starkli (/ˈstɑːrklaɪ/), a ⚡ blazing ⚡ fast ⚡ CLI tool for Starknet powered by 🦀 starknet-rs 🦀
https://book.starkli.rs
Apache License 2.0
155 stars 43 forks source link

Feature request: Print raw Tx #57

Open amanusk opened 6 months ago

amanusk commented 6 months ago

It would be very useful to have an option to print out the raw transaction without broadcasting it to the network. For example, to compare a possible future transaction with an existing transaction on the network, and see the difference.

Example:

[~/Code/Starknet/starkli]> starkli invoke eth transfer 0x5465aa79114f0415f95100cafeb4640b17bce2653810903738ac6c1a7694b6c 100 0 --raw-tx
Enter keystore password:
{
  "type": "INVOKE",
  "sender_address": "0x3e4447641b3c09b3fe3571911352e0cb1027b0799f699245859cf588314fe5d",
  "calldata": [
    "0x1",
    "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",
    "0x83afd3f4caedc6eebf44246fe54e38c95e3179a5ec9ea81740eca5b482d12e",
    "0x0",
    "0x3",
    "0x3",
    "0x5465aa79114f0415f95100cafeb4640b17bce2653810903738ac6c1a7694b6c",
    "0x64",
    "0x0"
  ],
  "max_fee": "0x3cc4cff9230",
  "version": "0x100000000000000000000000000000001",
  "signature": [
    "0x11b0d36e8b9a7cb150dc6a3c0ce09872016a733989a1c22cdbad8e99488095f",
    "0x70bb815da62d1ded7eb31c4a8fabab18b2978506f3b0803f830ba699a569102"
  ],
  "nonce": "0x6"
}
xJonathanLEI commented 6 months ago

Yeah I was thinking about this exact feature at some point.