GithubHelp home page GithubHelp logo

besoeasy / nanopay Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 1.0 68 KB

NanoPay is a simple and easy-to-use Node.js library for interacting with the Nano cryptocurrency network. This library allows you to perform various wallet-related tasks such as sending Nano, fetching account history, and more.

Home Page: https://www.npmjs.com/package/nanopay

JavaScript 100.00%
nanocurrency payment

nanopay's People

Contributors

besoeasy avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tylerpennexx

nanopay's Issues

typo in done1 and done2 console log

Currently:

    //recieve pending transactions
var done1 = await nano.fetchPending(secrateKey);

if (done1.hash) {
	console.log('fetched : ' + done.hash);
}

      // send nano to address
var done2 = await nano.send(secrateKey, nanoaddress, amount);

if (done2.hash) {
	console.log('sent : ' + done.hash);
}

should be:

//recieve pending transactions
var done1 = await nano.fetchPending(secrateKey);

if (done1.hash) {
console.log('fetched : ' + done1.hash);
}

        // send nano to address
var done2 = await nano.send(secrateKey, nanoaddress, amount);

if (done2.hash) {
console.log('sent : ' + done2.hash);
}

PoW pre rendering idea

Hi Besoeasy,
First of all I want to thank you for this piece of code, I have a blast playing with nano and code at the same time. It also helps that your code is very readable.

I created a function that allows you to create and store a new PoW at the start of the application and each time you spend the old PoW and need a new one. This saves some time for the end user because generating a PoW can take some time. It is not finished, and not perfect, but I do want to share it with you.

setTimeout(() => {
	generatePow(secrateKey);
}, 1000);

var pow = null;
async function generatePow(secretKey) {
	var address = await secretKeytoaddr(secretKey);
	var sddsf_address = await accountdig(address);
	var previous = sddsf_address.frontier;
	console.log("generating PoW")
	pow = await hybirdWork(previous);
	console.log("PoW ready");
}

async function send(secretKey, sendto, amount) {
	
        if(pow == null){
		console.log("PoW not ready yet")
		return;
	}

        ...

	generatePow(secretKey);

	return retr;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.