0.5.2 • Published 2 years ago
bitclout-sdk v0.5.2
bitclout-sdk
An SDK to interact with DeSo APIs
WARNING: Project is under heavy development, expect breakage until this warning is removed.
Installation
yarn add bitclout-sdk
or
npm install --save bitclout-sdk
Usage
See full usage in code docs: documentation
Bitclout
Fetch a profile
import { BitClout } from "bitclout-sdk";
const bitclout = new BitClout({ baseUrl: "https://node.deso.org/api" });
const fetchProfile = async (publicKey: string) => {
const profile = await bitclout.getSingleProfile({
publicKey,
});
};
Identity
Login
import { identity } from "bitclout-sdk";
const login = async () => {
const response = await identity.login({ accessLevel: 2 });
const publicKey = response.publicKeyAdded;
return publicKey;
};
Example code / Sample app
A sample app can be found in /example
Runing example code project:
yarn example
Navigate to http://localhost:3000
Identity login example
Navigate to http://localhost:3000/login
Building code for development
Install dependencies:
Depends on node.js
& yarn
yarn install
Build output:
yarn build
License
MIT