-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update code and include package.json
- Loading branch information
1 parent
3355b47
commit 86f5984
Showing
2 changed files
with
33 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
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]); | ||
import { MeshWallet } from "@meshsdk/core"; | ||
import fs from "node:fs"; | ||
|
||
async function main() { | ||
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", (await wallet.getUnusedAddresses())[0]); | ||
} | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "hello_world", | ||
"version": "0.0.1", | ||
"scripts": { | ||
"generate": "npx tsx generate-credentials.ts", | ||
"lock": "npx tsx lock.ts" | ||
}, | ||
"author": "jinglescode", | ||
"dependencies": { | ||
"@meshsdk/core": "^1.8.4", | ||
"tsx": "^4.19.2" | ||
} | ||
} |