All Projects → nano-ecosystem → nano-websocket-client

nano-ecosystem / nano-websocket-client

Licence: MIT license
nano javascript WebSocket client SDK

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to nano-websocket-client

gonano
An implementation of the Nano cryptocurrency in Go
Stars: ✭ 34 (+88.89%)
Mutual labels:  nano
RaiBlocksWebAssemblyPoW
WebAssembly Nanocurrency PoW implementation
Stars: ✭ 33 (+83.33%)
Mutual labels:  nano
nano-rs
An implementation of Nano in Rust using Tokio
Stars: ✭ 29 (+61.11%)
Mutual labels:  nano
RaiBlocksPHP
A bunch of PHP methods to build and sign transactions
Stars: ✭ 20 (+11.11%)
Mutual labels:  nano
nanolinks
A curated link guide for finding anything about Nano; The fast, fee-less and green digital currency!
Stars: ✭ 25 (+38.89%)
Mutual labels:  nano
MyNanoNinja
The perfect tool for Nano representatives lists and network statistics
Stars: ✭ 33 (+83.33%)
Mutual labels:  nano
Nano.Net
A .NET library for Nano
Stars: ✭ 19 (+5.56%)
Mutual labels:  nano
Nano.Library
Take full advantage of Nano Library, and rapidly implement enriched .Net 6.0 micro-services.
Stars: ✭ 39 (+116.67%)
Mutual labels:  nano
jNano
A comprehensive Java library for the Nano cryptocurrency.
Stars: ✭ 25 (+38.89%)
Mutual labels:  nano
nano-vanity
A NANO vanity address generator (supports OpenCL)
Stars: ✭ 83 (+361.11%)
Mutual labels:  nano
Arduino
🚀 Proyectos de todo tipo para arduino utilizando sus sensores y actuadores. 🤖
Stars: ✭ 27 (+50%)
Mutual labels:  nano
nano-s3
Upload a file to S3.
Stars: ✭ 45 (+150%)
Mutual labels:  nano
linux-workspace
This is the greatest management of all time
Stars: ✭ 19 (+5.56%)
Mutual labels:  nano
ledger-app-nano
Ledger Nano X, Nano S & Blue applications for NANO and derivative coins
Stars: ✭ 34 (+88.89%)
Mutual labels:  nano
cashuwallet
Cashu is a cryptocurrency wallet for smartphones. Be your own bank. Accept payments or spend crypto directly from your phone.
Stars: ✭ 35 (+94.44%)
Mutual labels:  nano
windows-container
Docker files for various Windows Container build
Stars: ✭ 30 (+66.67%)
Mutual labels:  nano
Nault
⚡ The most advanced Nano wallet with focus on security, speed and robustness
Stars: ✭ 228 (+1166.67%)
Mutual labels:  nano
piranha
Piranha - a modern cloud runtime
Stars: ✭ 136 (+655.56%)
Mutual labels:  nano
nanook
Ruby library for making and receiving payments and managing a nano currency node
Stars: ✭ 17 (-5.56%)
Mutual labels:  nano
nano-sidebar
Emacs package to have configurable sidebars on a per frame basis.
Stars: ✭ 98 (+444.44%)
Mutual labels:  nano

nano-websocket-client

nano javascript WebSocket client SDK

API

Connect to server

nano.init(params, callback);

Examples

nano.init({
    host: host,
    port: port,
	user: {},
	handshakeCallback : function(){}
}, function() {
	console.log('success');
});

Send request to server with callback

nano.request(route, msg, callback);

Examples

nano.request(route, {
	rid: rid
}, function(data) {
	console.log(dta);	
});

Send request to server without callback

nano.notify(route, params);

Receive message from server

nano.on(route, callback); 

Examples

nano.on('onChat', function(data) {
	addMessage(data.from, data.target, data.msg);
	$("#chatHistory").show();
});

Disconnect from server

nano.disconnect();

Usage

<!DOCTYPE html/>
<html>
<head>
	<title>nano WebSocket Test Page</title>
</head>
<body>
<script src="./protocol.js"></script>
<script src="./nano-websocket-client.js"></script>
<script type="text/javascript">

var nano = window.nano

nano.init({host: "127.0.0.1", port: 3250, log: true}, function(){
	nano.request("gate.Handler.Login", {"name":"chrislonng", "age":10000}, function(data){
		console.log(data);
	});

	nano.request("gate.Handler.Signup", {"name":"Signup chrislonng", "age":10000}, function(data){
		console.log(data);
	});

	nano.on("notify", function(data){
		console.log(data);
	});
});

</script>
</body>
</html>

License

MIT License

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].