Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to withdraw ustc from anchor protocol, through '@terra-money/terra.js'. 🙏🙏🙏 #66

Open
mnuestc opened this issue Dec 9, 2023 · 0 comments

Comments

@mnuestc
Copy link

mnuestc commented Dec 9, 2023

this is my whole code:
截屏2023-12-09 18 12 09

but it always failed with "message: "failed to execute message; message index: 0: unrecognized wasm message type: *legacy.MsgExecuteContract: unknown request [CosmWasm/[email protected]/x/wasm/handler.go:44]","

is classc url lcd connected problm?

`import { LCDClient, MnemonicKey, MsgExecuteContract } from '@terra-money/terra.js';

const mk = new MnemonicKey({
mnemonic: '****'
})

// connect to localterra
const terra = new LCDClient({
URL: 'https://lcd.terra.dev',
chainID: 'columbus-5',
isClassic: true
});

const wallet = terra.wallet(mk);
console.log(wallet.key.accAddress);

const execute = new MsgExecuteContract(
wallet.key.accAddress, // sender
"terra1hzh9vpxhsk8253se0vv5jj6etdvxu3nv8z07zu", // aUst contract
{
"send": {
"msg": "eyJyZWRlZW1fc3RhYmxlIjp7fX0=",
"amount": "18995960848",
"contract": "terra1sepfj7s0aeg5967uxnfk4thzlerrsktkpelm5s"
}
},
{ uluna: 509008 } // coins
);

const executeTx = await wallet.createAndSignTx({
msgs: [execute]
});

const executeTxResult = await terra.tx.broadcast(executeTx);`

@mnuestc mnuestc changed the title how to withdraw ustc from anchor protocol, through '@terra-money/terra.js' how to withdraw ustc from anchor protocol, through '@terra-money/terra.js'. 🙏🙏🙏 Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant