-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwallet.ts
More file actions
94 lines (87 loc) · 2.61 KB
/
wallet.ts
File metadata and controls
94 lines (87 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import { Command } from "commander";
import { createSingleSigner } from "./create_single_signer";
import { identifySequenceWallet } from "./identify_sequence_wallet";
import {sendTx} from "./send_tx";
export function makeCommandWallet(program: Command) {
const comm = new Command("wallet");
comm.action(() => {
comm.help();
});
comm
.command("send-tx")
.description("Sign tx data coming from marketplace API and send it to chain")
.option(
"-k, --key <private_key>",
"Private key for the wallet that holds the tokens"
)
.option(
"-d, --data <data>",
"TX data from marketplace API"
)
.option(
"--to <to>",
"Target address"
)
.option(
"-n, --network <network>",
"Network to be used (mainnet, polygon, etc.)"
)
.option(
"--marketplace-version <version>",
"Marketplace version",
"v2"
)
.option(
"-v, --value <value>",
"Tx value",
"0"
)
.action((options) => {
sendTx(program, options);
});
comm
.command("create-single-signer")
.description("Generate a Sequence Wallet Single Signer using an EOA wallet (i.e. MetaMask)")
.option(
"-k, --key <private_key>",
"Private key for the wallet that holds the tokens"
)
.option(
"-n, --network <network>",
"Network to be used (mainnet, polygon, etc.)"
)
.option(
"--project-access-key <access_key>",
"Project access key for Sequence requests"
)
.option(
"--verbose",
"Show additional information in the output"
)
.action((options) => {
createSingleSigner(program, options);
});
comm
.command("identify-sequence-wallet")
.description("Identify Sequence Wallet address from a transaction hash")
.option(
"-t, --txn <txn>",
"Transaction hash to be used"
)
.option(
"-n, --network <network>",
"Network to be used (mainnet, polygon, etc.)"
)
.option(
"--project-access-key <access_key>",
"Project access key for Sequence requests"
)
.option(
"--verbose",
"Show additional information in the output"
)
.action((options) => {
identifySequenceWallet(program, options);
});
return comm;
}