Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion dist/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -8756,6 +8756,7 @@ async function sendTx(program, options) {
let network = options.network;
let data = options.data;
let to = options.to;
let value = options.value;
if (!privateKey) {
privateKey = await password({
message: 'Enter the private key for the wallet that holds the tokens',
Expand Down Expand Up @@ -8796,7 +8797,8 @@ async function sendTx(program, options) {
const provider = new ethers.JsonRpcProvider(nodeUrl);
const wallet = new ethers.Wallet(privateKey, provider);
try {
const res = await wallet.sendTransaction({ data: data, to: to });
const tx = { data: data, to: to, value: value };
const res = await wallet.sendTransaction(tx);
console.log("Transaction hash", res.hash);
}
catch (e) {
Expand All @@ -8818,6 +8820,7 @@ function makeCommandWallet(program) {
.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);
});
Expand Down
5 changes: 4 additions & 1 deletion src/wallet/send_tx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export async function sendTx(program: Command, options: any) {
let network = options.network;
let data = options.data
let to = options.to
let value = options.value

if (!privateKey) {
privateKey = await password({
Expand Down Expand Up @@ -69,7 +70,9 @@ export async function sendTx(program: Command, options: any) {
const wallet = new ethers.Wallet(privateKey, provider);

try {
const res = await wallet.sendTransaction({data: data, to: to})
const tx = {data: data, to: to, value: value};

const res = await wallet.sendTransaction(tx)
console.log("Transaction hash", res.hash)
} catch (e) {
console.error(e)
Expand Down
5 changes: 5 additions & 0 deletions src/wallet/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ export function makeCommandWallet(program: Command) {
"Marketplace version",
"v2"
)
.option(
"-v, --value <value>",
"Tx value",
"0"
)
.action((options) => {
sendTx(program, options);
});
Expand Down