diff --git a/ng-sdk-js/app-node/index.js b/ng-sdk-js/app-node/index.js index 79947cd..98cabf7 100644 --- a/ng-sdk-js/app-node/index.js +++ b/ng-sdk-js/app-node/index.js @@ -14,6 +14,14 @@ global.WebSocket = WebSocket; // get your wallet file as an ArrayBuffer and pass it to wallet_read_file +// ng.gen_wallet_for_test("rS6pZiroUZ5yjq9eraesDkpxWWOAoX_8QZ_5U9GXsOgA").then( async (res) => { +// console.log(res[0]); +// let opened = await ng.wallet_open_with_mnemonic_words(res[0].wallet, res[1], [1, 2, 1, 2]); +// console.log(opened.V0.personal_site); +// }); +// return; + + const fs = require('fs'); let buffer = fs.readFileSync("/Users/nl/Downloads/wallet-Hr-UITwGtjE1k6lXBoVGzD4FQMiDkM3T6bSeAi9PXt4A.ngw"); diff --git a/ng-sdk-js/prepare-node.js b/ng-sdk-js/prepare-node.js index 1cdf4d5..f974a3d 100644 --- a/ng-sdk-js/prepare-node.js +++ b/ng-sdk-js/prepare-node.js @@ -6,7 +6,7 @@ const PATH_README = './pkg-node/README.md'; const pkg_json = fs.readFileSync(PATH); let pkg = JSON.parse(pkg_json) pkg.name = "nextgraph"; -pkg.version = "0.1.1-alpha.4"; +pkg.version = "0.1.1-alpha.5"; pkg.description = "nodeJS SDK of NextGraph"; pkg.files.push("ng_sdk_js_bg.wasm.d.ts"); pkg.files.push("snippets/**/*.js"); diff --git a/ng-sdk-js/src/lib.rs b/ng-sdk-js/src/lib.rs index d5df5dc..723a6e3 100644 --- a/ng-sdk-js/src/lib.rs +++ b/ng-sdk-js/src/lib.rs @@ -1970,7 +1970,7 @@ pub async fn gen_wallet_for_test(ngd_peer_id: String)-> Result pazzle_length: 9, send_bootstrap: false, send_wallet: false, - result_with_wallet_file: true, + result_with_wallet_file: false, local_save: false, core_bootstrap: BootstrapContentV0::new_localhost(peer_id_of_server_broker), core_registration: None, @@ -1988,7 +1988,7 @@ pub async fn gen_wallet_for_test(ngd_peer_id: String)-> Result mnemonic_words.push(word.clone()); }); - let res = (serde_bytes::ByteBuf::from(wallet_result.wallet_file.clone()),mnemonic_words); + let res = (wallet_result,mnemonic_words); Ok(serde_wasm_bindgen::to_value(&res).unwrap()) } diff --git a/ng-wallet/src/lib.rs b/ng-wallet/src/lib.rs index 8bfe589..2cc41a7 100644 --- a/ng-wallet/src/lib.rs +++ b/ng-wallet/src/lib.rs @@ -787,6 +787,8 @@ pub async fn create_wallet_second_step_v0( #[cfg(test)] mod test { + use crate::emojis::display_pazzle_one; + use super::*; use ng_net::types::BootstrapContentV0; use std::fs::File;