0.1.1 • Published 4 years ago

@cosmostation/keystation-es6 v0.1.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

:star: Developed / Developing by Cosmostation

This is a library developers can use to connect to Keystation for React(ES6). It provides only Keystation connection part. See GitHub for the full Keystation source code.

MIT

Installation

NPM

npm install @cosmostation/keystation-es6

Yarn

yarn add @cosmostation/keystation-es6

Import

ES6 module

import Keystation from "@cosmostation/keystation-es6";

Usage

const Wallet = (props) => {
	const [myKeystation, setMyKeystation] = React.useState(new Keystation);

	const connectKeystation = React.useCallback(() => {

		let myKeystation = new Keystation();

		setMyKeystation(myKeystation);

		myKeystation.client = "https://www.test.com";
		myKeystation.lcd = "https://lcd-cosmos-free.cosmostation.io";
		myKeystation.path = "44/118/0/0/0";

	    let prefix = "cosmos";
	    let popup = keystation1.openWindow("signin", prefix);
	    let popupTick = setInterval(function() {
			if (popup.closed) {
				clearInterval(popupTick);
				console.log("window closed!");
			}
	    }, 500);
	}, [])

	window.addEventListener("message", function(e) {
	    if (e.origin != "https://keystation.cosmostation.io") return;
	    console.log(e.data);
	    // e.data.account : User's keychain account. Remember this account!
	} , false);
}

Cosmostation offers LCD url(https://lcd-cosmos-free.cosmostation.io).

  • API Rate Limiting: 10 requests per second

Supporting Message Types (Updating...)

Documentation

This library is simple and easy to use. We don't have any formal documentation yet other than examples. Ask for help if our examples aren't enough to guide you

Contribution

  • Contributions, suggestions, improvements, and feature requests are always welcome

When opening a PR with a minor fix, make sure to add #trivial to the title/description of said PR.

Cosmostation's Services and Community