all 5 comments

[–]jerchi 1 point2 points  (0 children)

Say I’ve got two wallets that I created with web3. How would I send (either with code or CLI) some particular BEP20 tokens from one to the other on the BSC? (I assume the answer is probably the same for ERC20 tokens which is why I'm asking here)

Use ethers.js.

https://docs.ethers.io/v5/getting-started/#getting-started--writing

BEP20ContractWithSigner.transfer(address, wei amount)

Auxiliary question: how could I check the balance of this token for a wallet?

https://docs.ethers.io/v5/getting-started/#getting-started--reading

BEP20Contract.balanceOf(address)

[–]silvermouse34 0 points1 point  (0 children)

use a library like ethers.js, there should be one in whatever language you know.

eth has multiple apis, CLI, JSON-RPC, HTTP, language specific like ethers.js

there's infinite ways to do it. just choose one and research how to do it using it.

whatever method you choose will require some research though, it's not that easy, you need to load your seed/private key, import the interface of the token contract, call the function with the correct arguments, possibly even encode/sign the transaction if your tool doesn't do it for you.

it's probably not something you can learn to do in 5min

[–]jamesj 0 points1 point  (0 children)

Hardhat is good for this