nodejs-verge
nodejs-verge copied to clipboard
Typescript Doc
I've installed verge-node
npm install verge-node-typescript;
I've imported it in my node project
var verge = require(verge-node-typescript);
When I try to execute the code in the document, I start getting error message that its not a function.
And it doesn't throw any error or result.
Kindly write document for using it.
Thank you ..
It requires a complete node to be run. Without a verge node, you won't be able to request anything.
How to init it: https://github.com/vergecurrency/vWallet/blob/develop/src/stores/VergeClient.ts#L38-L41
How to (for example) get transaction lists: https://github.com/vergecurrency/vWallet/blob/develop/src/stores/TransactionStore.ts#L191-L198
Supported Methods: (it's WIP) https://github.com/marpme/verge-node-typescript/blob/master/src/API.ts
To your other question about to send XVG to multiple addresses: It's not yet supported.
It requires a complete node to be run. Without a verge node, you won't be able to request anything.
How to init it: https://github.com/vergecurrency/vWallet/blob/develop/src/stores/VergeClient.ts#L38-L41
How to (for example) get transaction lists: https://github.com/vergecurrency/vWallet/blob/develop/src/stores/TransactionStore.ts#L191-L198
Supported Methods: (it's WIP) https://github.com/marpme/verge-node-typescript/blob/master/src/API.ts
I've a full node running on my system. It's 100% synced too. I've added verge.config file in %appdata% folder. I have entered proper user and pass values in my node application. Still am not able to fetch the data.
Then it should work if you have done everything correctly, which it sounds. Show me the config & the code for the connection otherwise, I can't help you right now.
verge.conf (I've created it in VERGE folder in %appdata%. Its not a .txt file. I've checked it properly)
rpcuser=vergerpcusername
rpcpassword=55CpSuCNvDcYsdQU9w526mkQqJAimSQwCSJL6dPT8wQX
rpcport=20102
port=21102
daemon=1
algo=groestl
In node cli
npm install verge-node-typescript;
Inside node's app.js file
var verge = require('verge-node-typescript');
verge.auth('vergerpcusername','55CpSuCNvDcYsdQU9w526mkQqJAimSQwCSJL6dPT8wQX');
When I execute this, it throws error that .auth isn't a function.
If I do this
var verge = require('node-verge')()
It starts throwing error. 'node-verge' module not found.
This:
var verge = require('verge-node-typescript');
verge.auth('vergerpcusername','55CpSuCNvDcYsdQU9w526mkQqJAimSQwCSJL6dPT8wQX');
Should be this:
const { Client } = require('verge-node-typescript');
client = new Client({
user: vergerpcusername,
pass: '55CpSuCNvDcYsdQU9w526mkQqJAimSQwCSJL6dPT8wQX',
})
And please make sure your verge node is running on the same system (meaning localhost)!
I'm using above code and trying to call getInfo method.
client.getInfo()
.then( (info) => {
console.log(info)
console.log('Fetched new transactions')
})
.catch((err) => {
console.log('Failed fetching new transactions '+err);
});
It's giving me following error:
Failed fetching new transactions Error: connect ECONNREFUSED 127.0.0.1:20102
Yes, my Verge wallet is synced fully and is on same machine where am running my node application.
Still its not working.