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

Staking Transaction Error #483

Open
1 of 4 tasks
adam-young-dev opened this issue Jan 19, 2025 · 0 comments
Open
1 of 4 tasks

Staking Transaction Error #483

adam-young-dev opened this issue Jan 19, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@adam-young-dev
Copy link

Summary

I create and submit a simple staking transaction but get an error

Registering stake certificate transaction goes through successfully
But delegating stake certificate transaction get back the error

Did a similar staking transaction with Lucid, goes through successfully

Steps to reproduce the bug

Here is the code:

const blockchainProvider = new BlockfrostProvider('preprodKaL…ECp');

const wallet = new MeshWallet({
  networkId: 0, 
  fetcher: blockchainProvider,
  submitter: blockchainProvider,
  key: {
    type: 'mnemonic',
    words: ‘…’,
  },
});

async function delegate() {
  const addresses = await wallet.getRewardAddresses();
  const rewardAddress = addresses[0];
  const poolID = "pool1y74f44yeedrls4nj0yf6h5pdl5ythd5ahm73knqf33hfvq9rhaf"
  const tx = new Transaction({ initiator: wallet })
    .delegateStake(rewardAddress, poolID);

  const unsignedTx = await tx.build();
  const signedTx = await wallet.signTx(unsignedTx)
  const txHash = await wallet.submitTx(signedTx);
  console.log("txHash: ",txHash)
}

Actual Result

Get an error:

UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "{"data":{"error":"Bad Request","message":"{\"contents\":{\"contents\":{\"contents\":{\"era\":\"ShelleyBasedEraConway\",\"error\":[\"ConwayUtxowFailure (MissingVKeyWitnessesUTXOW (fromList [KeyHash {unKeyHash = \\\"af804f33d70e20d226bd8a40eb1b90a338f18c8df974ca56c6bc1754\\\"}]))\"],\"kind\":\"ShelleyTxValidationError\"},\"tag\":\"TxValidationErrorInCardanoMode\"},\"tag\":\"TxCmdTxSubmitValidationError\"},\"tag\":\"TxSubmitFail\"}","status_code":400},"headers":{"date":"Sun, 19 Jan 2025 03:31:56 GMT","content-type":"application/json; charset=utf-8","content-length":"444","connection":"keep-alive","vary":"Origin","access-control-allow-origin":"*","bf-submit-server":"e1f4ccc29ee5a9bb1f2d55e35e58119727c3f3f0e0da9c0cf0a9582299058083","cf-cache-status":"DYNAMIC","report-to":"{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=c9WAYEzcne844gTmO1gowjZaN%2Bbboqsevra0W6iXAT4wH7h3hVY0HAt%2BIgqnGHfHEqeFhvji3Wa260Wa7I%2BbUTK3yOfySa2Bf7H4btKFt4I6ZllKj1sxWYQPUQU77k4zLE13Kadv5F%2FjNtDOCsad\"}],\"group\":\"cf-nel\",\"max_age\":604800}","nel":"{\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}","set-cookie":"__cflb=0pg1P7HW5cKHeRugHdPsq7nS66pKUqQnoGCQ27gh; SameSite=Lax; path=/; expires=Sun, 19-Jan-25 04:01:56 GMT; HttpOnly","server":"cloudflare","cf-ray":"9043c1341d3b7b4c-BKK","server-timing":"cfL4;desc=\"?proto=TCP&rtt=10071&min_rtt=4190&rtt_var=11584&sent=10&recv=9&lost=0&retrans=0&sent_bytes=5370&recv_bytes=1980&delivery_rate=817438&cwnd=255&unsent_bytes=0&cid=9d670bc723770a4f&ts=1317&x=0\""},"status":400}".
    at throwUnhandledRejectionsMode (node:internal/process/promises:392:7)
    at processPromiseRejections (node:internal/process/promises:475:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:106:32) {
  code: 'ERR_UNHANDLED_REJECTION'
}

Expected Result

Transaction is submitted and get the returned hash

SDK version

1.8.0

Environment type

  • Node.js
  • Browser
  • Browser Extension
  • Other

Environment details

Node.js: v22.13.0
Mesh with Aiken
Blockfrost
Preprod testnet

@adam-young-dev adam-young-dev added the bug Something isn't working label Jan 19, 2025
@MeshJS MeshJS deleted a comment Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant