Skip to content

how to put a transaction ? #14

Answered by nguyenphuminh
sasdecompte asked this question in Q&A
Discussion options

You must be logged in to vote

As said in the README, you can send a transaction by using the sendTransaction function.

Example:

// Create a new transaction object
const transaction = new Transaction(publicKey, "the address you are sending to", amount, gas);

// sign the transaction
transaction.sign(keyPair);

// broadcast transaction
sendTransaction(transaction);

Replace amount with the amount of money you want to send, replace gas with the amount of gas you want to use, 1 is minimum.

Paste the code in jenode.js if you haven't known about this.

Advanced

To deploy a contract, replace the recipient's address with "SC" + code of your contract.

To add additional arguments when you are calling a contract, add an argument to

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by nguyenphuminh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants