Replies: 3 comments
-
how do i send token from 1 account to another ?
where do i import i don't know how to require sendTransaction so i used axios but i'm getting
|
Beta Was this translation helpful? Give feedback.
-
Sorry for the late reply, I did not realize that there is a new discussion in here.
You get "invalid option" error when the method you are calling does not exist. In this case I think you are sending it as a GET request rather than POST.
you don't call it, if you are starting a new chain, the node will generate a new genesis block by calling that for you. Or you can request blocks from other nodes you are connected to by enabling "ENABLE_CHAIN_REQUEST" (that's if you have other nodes to connect to).
Here's an example for creating a transaction: // Import the transaction class and EC somewhere here
const transaction = new Transaction("paste receiver address here", "amount to send here", "gas fee", {}, nonce_as_number);
// Oof, I forgot to add an RPC to get nonce, will release a patch soon
Transaction.sign(transaction, ec.keyFromPrivate("Your private key goes here"));
// Alternatively you can use the `signTransaction` rpc method to sign a transaction.
// Send the transaction
axios
.post("http://localhost:3000/sendTransaction", {
params: {
transaction: Transaction.serialize(transaction),
},
})
.then((response) => {
console.log(`Response`, response.data);
})
.catch((error) => {
console.error(`2ndError`, error.response.data);
}); Don't use the Things are kind of complicated currently because I haven't put too much notice on the UX and libs to interact with JeChain, too many things to add to the infra 😅 If you have any question, feel free to ask! Will be more alerted about discussions from this point on. |
Beta Was this translation helpful? Give feedback.
-
cool, thanks for responding.. |
Beta Was this translation helpful? Give feedback.
-
i have created wallet address for my localhost. how do i get tokens or balance
but when i sent http://localhost:3000/get_balance via postman.
i get
now how do i call genesis block or something ?
FIRST_ACCOUNT is never mentioned.
Beta Was this translation helpful? Give feedback.
All reactions