Error: Unregistered type url: /cosmwasm.wasm.v1.MsgExecuteContract
Closed this issue · 2 comments
lutwidse commented
I tried to execute a contract on Atlantic-1 Testnet with sei-js but it fails.
Does Atlantic-1 have endpoints?
const msg = {
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
value: {
"sender": "sei1....",
"contract": "sei1....",
"msg": {
"test": {}
},
"funds": []
}
}
Error: Unregistered type url: /cosmwasm.wasm.v1.MsgExecuteContract
at Registry.lookupTypeWithError (C:\Users\-\node_modules\@sei-js\proto\node_modules\@cosmjs\proto-signing\src\registry.ts:128:13)
at Registry.encode (C:\Users\-\node_modules\@sei-js\proto\node_modules\@cosmjs\proto-signing\src\registry.ts:145:23)
at Registry.encodeAsAny (C:\Users\-\node_modules\@sei-js\proto\node_modules\@cosmjs\proto-signing\src\registry.ts:155:30)
at C:\Users\-\node_modules\@sei-js\proto\node_modules\@cosmjs\proto-signing\src\registry.ts:163:73
at Array.map (<anonymous>)
at Registry.encodeTxBody (C:\Users\-\node_modules\@sei-js\proto\node_modules\@cosmjs\proto-signing\src\registry.ts:163:51)
at Registry.encode (C:\Users\-\node_modules\@sei-js\proto\node_modules\@cosmjs\proto-signing\src\registry.ts:143:19)
at SigningStargateClient.signDirect (C:\Users\-\node_modules\@sei-js\proto\node_modules\@cosmjs\stargate\src\signingstargateclient.ts:402:39)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async SigningStargateClient.signAndBroadcast (C:\Users\-\node_modules\@sei-js\proto\node_modules\@cosmjs\stargate\src\signingstargateclient.ts:295:19)
hieus207 commented
The problem lies in the type of the msg you are going to send, it's in the form /cosmwasm so use cosmwasm Client to sign the msg executable don't use seiSigning Client
import { SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate";
const client = await SigningCosmWasmClient.connectWithSigner(rpcEndpoint, wallet);
const executeFee = calculateFee(300_000, gasPrice);
const result = await client.execute(alice.address0, contractAddress, [msg], executeFee);
lutwidse commented
Got it, thank you! You really made my day.