Hey!
How can I get 10$ worth of BNB using getTokenPrice to use with Moralis.transfer?
Thank you sers
Hey!
How can I get 10$ worth of BNB using getTokenPrice to use with Moralis.transfer?
Thank you sers
You can use the WBNB contract address to get its price in USD and calculate it from there.
1 / 322.92080158901791 = 0.0030967345401077704
0.0030967345401077704 * 10 = 0.030967345401077706 BNB
For Moralis.transfer you can use Moralis.Units.ETH("0.030967345401077706")
.