0.2.2 • Published 1 year ago

hotkeys-sdk v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Usage

npm i hotkeys-sdk

Generate a key

import * as hotkeys from "hotkeys-sdk";

const [txId, mintId] = await hotkeys.generateKey(
	connection,
	owner,
	"HK: Plugin",
	"https://raw.githubusercontent.com/HotKeysInc/programs/main/assets/test_metadata.json"
);

console.log("txId: ", txId);
console.log("mintId: ", mintId);

Resell a key

import * as hotkeys from "hotkeys-sdk";

const token = new PublicKey("4eepA7KT2ZzyA8Gih94AxVb5uNPXy7d2mPZR6HF2TtZF");

const txId = await hotkeys.sellKey(connection, owner, buyer, token, 0.1);

console.log("txId: ", txId);

Check access

import * as hotkeys from "hotkeys-sdk";

const tokenExpected = new PublicKey(
	"4eepA7KT2ZzyA8Gih94AxVb5uNPXy7d2mPZR6HF2TtZF"
);

if (await hotkeys.checkAccess(connection, owner, tokenExpected)) {
	console.log("Access granted");
} else {
	console.log("Access denied");
}

Delete / Burn a key

import * as hotkeys from "hotkeys-sdk";

const tokenToDestroy = new PublicKey(
	"61F6P86LKaztWmYyjiPTjf1oqdkhBEYy6Y8FcYVq9o2w"
);

const response = await destroyKey(connection, owner, tokenToDestroy);

console.log("response: ", response);

Development

See .github/CONTRIBUTING.md. Thanks! 💖

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago