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

Regarding unionlabs/client transaction issues #3840

Open
2198923 opened this issue Feb 22, 2025 · 0 comments
Open

Regarding unionlabs/client transaction issues #3840

2198923 opened this issue Feb 22, 2025 · 0 comments

Comments

@2198923
Copy link

2198923 commented Feb 22, 2025

Unionlabs/client has been updated more than ten hours ago, but the problem I found before still exists. When using the transaction, @unionlabs/client-[connectCosmwasmWithSigner] Error: unknown pubkey type: cometbft/PubKeyBn254 will be reported.
at decodePubkey (C:\Users\22225\Desktop\test\node_modules@cosmjs\tendermint-rpc\build\tendermint37\adaptor\responses.js:95:23), among which tendermint37 does not support the cometbft/PubKeyBn254 format public key of the current test endpoint https://rpc.testnet-9.union.build at all

const { DirectSecp256k1Wallet } = require("@cosmjs/proto-signing");
const { createUnionClient, hexToBytes, http } = require("@unionlabs/client");

async function main() {
const cosmosAccount = await DirectSecp256k1Wallet.fromKey(
Uint8Array.from(hexToBytes("")),//privateKey
"union"
);

const client = createUnionClient({
account: cosmosAccount,
chainId: "union-testnet-9",
transport: http("https://rpc.testnet-9.union.build"),
gasPrice: { amount: "1000", denom: "muno" }
});

const transfer = await client.transferAsset({
baseAmount: 1000,
baseToken: "muno",
quoteAmount: 1000,
quoteToken: "0x62626e31666e63356d7066753366343273796e706767376c6c746c397070346b387375666c76376d756532643776377476736334656334713065346e3475",
receiver: ``, // Receiver's address
sourceChannelId: 3, // Source channel ID
ucs03address: "union1x2jzeup7uwfxjxxrtfna2ktcugltntgu6kvc0eeayk0d82l247cqz669ee", // Contract address
});

if (transfer.isErr()) {
console.error(transfer.error);
process.exit(1);
}

console.info(transfer.value);
}

main().catch((error) => {
console.error("Error:", error);
process.exit(1);
});

@2198923 2198923 marked this as a duplicate of #3834 Feb 22, 2025
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