Getting Started
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
npm install keycatjs
yarn add keycatjs
import { Keycat } from 'keycatjs'
// Connect to eos main net
const keycat = new Keycat({
blockchain: {
name: 'eos',
nodes: eosNodes,
}
})
// e.g) This function is called when user clicks keycat signin button.
async function handleSignin() {
try {
const { accountName, permission, publicKey } = await keycat.signin()
} catch (err) {
async function handleRequest() {
// Use account info saved in cookie, localStorage or variable.
try {
await keycat
.account('testaccount1')
.transact({
actions: [...]
}, {
blocksBehind: 3,
expireSeconds: 30,
})
} catch (err) {
}
}
async function sign() {
try {
await keycat
.account('testaccount2')
.signArbitraryData(['sign this', 'this too'])
catch (err) {}
}