mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-21 14:26:45 +00:00

* Add basic wallet library * Add CLI * Add multisig support * Add persistence to wallet * Add tests * go mod tidy * Fix lint errors * Fix wallet send command * Always use the password as byte slice * Remove redundant empty string * Use different salt per private key * Don't sign a signed transaction * Add comment * Remove old wallet * Change directory permissions * Use NormalizeRPCServerAddress * Fix compilation errors
30 lines
663 B
Go
30 lines
663 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))
|
|
case createUnsignedTransactionSubCmd:
|
|
err = createUnsignedTransaction(config.(*createUnsignedTransactionConfig))
|
|
case signSubCmd:
|
|
err = sign(config.(*signConfig))
|
|
case broadcastSubCmd:
|
|
err = broadcast(config.(*broadcastConfig))
|
|
default:
|
|
err = errors.Errorf("Unknown sub-command '%s'\n", subCmd)
|
|
}
|
|
|
|
if err != nil {
|
|
printErrorAndExit(err)
|
|
}
|
|
}
|