mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00

* Copy over the CLI wallet from Kasparov. * Fix trivial compilation errors. * Reimplement the balance command. * Extract isUTXOSpendable to a separate function. * Reimplement the send command. * Fix bad transaction ID parsing. * Add a missing newline in a log. * Don't use msgTx in send(). * Fix isUTXOSpendable not checking whether a UTXO is of a coinbase transaction. * Add --devnet, --testnet, etc. to command line flags. * In `create`, only print the public key of the active network. * Use coinbase maturity in isUTXOSpendable. * Add a readme. * Fix formatting in readme.
26 lines
431 B
Go
26 lines
431 B
Go
package main
|
|
|
|
import (
|
|
"github.com/pkg/errors"
|
|
)
|
|
|
|
func main() {
|
|
subCmd, config := parseCommandLine()
|
|
|
|
var err error
|
|
switch subCmd {
|
|
case createSubCmd:
|
|
err = create(config.(*createConfig))
|
|
case balanceSubCmd:
|
|
err = balance(config.(*balanceConfig))
|
|
case sendSubCmd:
|
|
err = send(config.(*sendConfig))
|
|
default:
|
|
err = errors.Errorf("Unknown sub-command '%s'\n", subCmd)
|
|
}
|
|
|
|
if err != nil {
|
|
printErrorAndExit(err)
|
|
}
|
|
}
|