Hi, I’m trying to convert the bLuna CW20 token to the UST native token using TerraSwap and terra.js, I’m following examples online but not having any luck. I’m also looking at this example of a bLuna to UST transaction. This is the closest I think I’ve come:
const terraSwap = new MsgExecuteContract(
"terra1qxv6uyan8u0a88zemfcqffdtfqq9fxy575cwgq",
"terra1qpd9n7afwf45rkjlpujrrdfh83pldec8rpujgn",
{
swap : {
offer_asset: {
amount: "4000",
info: {
token: {
contract_addr: "terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp"
}
}
},
}
},
{ terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp: "4000" }
);
This returns the error:
'failed to execute message; message index: 0: 0terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp is smaller than 4000terra1kc87mu460fwkqte29rquh4hc20m54fxwtsx7gp: insufficient funds: invalid request'
I was wondering if anyone can see where I’m going wrong here. I have 58894 bLuna in my wallet and can print this out right before executing the transaction.