nknorg / nkn-wallet-js Goto Github PK
View Code? Open in Web Editor NEW[Deprecated, use nkn-sdk-js instead] JavaScript implementation of NKN wallet
License: Apache License 2.0
[Deprecated, use nkn-sdk-js instead] JavaScript implementation of NKN wallet
License: Apache License 2.0
Hi,
I'm using this package to interact width NKN and when I use this code:
wallet.registerName('MATINMATIN', 'myPassword')
It throws an error and says:
{code: -43001, message: "INVALID TRANSACTION"}
"nkn-wallet": "^0.2.0",
node: v10.15.0
Details refer to https://github.com/nknorg/nkn-testnet-website/issues/1
This tx hash was generated for a 5000 transfer that completed successfully but yet the hash returns transaction invalid:
90975f83dfa905b3fc3ec4e53ef5bf9eeed219ed93eeedc1913504832a951d2d
Since base-x@3.0.5 base-x commit 172a3d2, base module required argument of encode() MUST isBuffer.
# node --version
v9.11.2
# npm -v
6.4.1
# npm list base-x
/usr/lib
└── [email protected]
# cd nkn-wallet-js && git log |head -1
commit f14a3f1feda039b1a2739f1e7470ddebac46a527
# node examples/node_example.js
/usr/lib/node_modules/base-x/index.js:29
if (!Buffer.isBuffer(source)) throw new TypeError('Expected Buffer')
^
TypeError: Expected Buffer
at Object.encode (/usr/lib/node_modules/base-x/index.js:29:41)
at Object.programHashString2Address (/home/admin/nkn-wallet-js/lib/crypto/algorithm.js:163:17)
at new account (/home/admin/nkn-wallet-js/lib/crypto/account.js:29:27)
at Object.newAccount (/home/admin/nkn-wallet-js/lib/crypto/account.js:61:10)
at Object.newWallet (/home/admin/nkn-wallet-js/lib/wallet.js:317:28)
at Object.<anonymous> (/home/admin/nkn-wallet-js/examples/node_example.js:9:26)
at Module._compile (internal/modules/cjs/loader.js:654:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.