This commit is contained in:
stjet
2024-06-19 03:21:08 +00:00
parent d4a457944a
commit 532afbce89
69 changed files with 350 additions and 185 deletions

View File

@@ -1,18 +1,38 @@
import * as banani from "banani";
import * as banani from "../main.js"//"banani";
import * as fs from "fs";
let rpc = new banani.RPC("https://kaliumapi.appditto.com/api");
//rpc.debug = true
console.log(rpc.rpc_url);
console.log(await rpc.get_block_count())
let test_seed = fs.readFileSync("./.secret", "utf-8").trim();
let wallet = new banani.Wallet(rpc, test_seed);
let z_address = wallet.address; //0 index
wallet.index = 2; //3rd account
let t_address = wallet.address;
console.log(wallet.address);
//console.log(await wallet.receive("03EEE28C2CB5CA0552BF31A60A797929920FDE044B5E021B8CEC16F57278F79A"));
console.log("send 1");
let send_hash = await wallet.send(z_address, "1.001");
wallet.send("ban_1o7ija3mdbmpzt8qfnck583tn99fiupgbyzxtbk5h4g6j57a7rawge6yzxqp", "1.001");
wallet.index = 0;
console.log("receive 1");
await wallet.receive(send_hash);
console.log("send 2");
await wallet.send(t_address, "0.1");
console.log("send 3");
await wallet.send_all(t_address);
wallet.index = 2;
console.log("receive 2");
console.log(await wallet.receive_all());
await wallet.change_rep("ban_3p3sp1ynb5i3qxmqoha3pt79hyk8gxhtr58tk51qctwyyik6hy4dbbqbanan");
//