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

Feedback for “Hello, World! - with Mesh” #105

Open
cowcode8150 opened this issue Jan 30, 2025 · 1 comment
Open

Feedback for “Hello, World! - with Mesh” #105

cowcode8150 opened this issue Jan 30, 2025 · 1 comment
Labels
documentation Improvements or additions to documentation help welcomed Contributor friendly

Comments

@cowcode8150
Copy link

current example in hello world throws errors because wallet is a promise.

import { MeshWallet } from '@meshsdk/core';
import fs from 'node:fs';
 
const secret_key = MeshWallet.brew(true) as string;
 
fs.writeFileSync('me.sk', secret_key);
 
const wallet = new MeshWallet({
  networkId: 0,
  key: {
    type: 'root',
    bech32: secret_key,
  },
});
 
fs.writeFileSync('me.addr', wallet.getUnusedAddresses()[0]);

change to

wallet
  .getUnusedAddresses()
  .then((addresses) => {
    fs.writeFileSync("me.addr", addresses[0]);
  })
  .catch((error) => {
    console.error("Error generating address:", error);
  });
@KtorZ
Copy link
Member

KtorZ commented Jan 31, 2025

Nice catch, PR welcome 👌

@KtorZ KtorZ added documentation Improvements or additions to documentation help welcomed Contributor friendly labels Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation help welcomed Contributor friendly
Projects
None yet
Development

No branches or pull requests

2 participants