-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationhelp welcomedContributor friendlyContributor friendly
Description
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);
});
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationhelp welcomedContributor friendlyContributor friendly