deso.js
v0.5.4
Published
Package to interact with DeSo API
Downloads
6
Readme
deso.js
An SDK to interact with DeSo APIs
WARNING: Project is under heavy development, expect breakage until this warning is removed.
Installation
yarn add deso.js
or
npm install --save deso.js
Usage
See full usage in code docs: documentation
DeSo
Fetch a profile
import { Deso } from "deso.js";
const deso = new Deso({ baseUrl: "https://node.deso.org/api" });
const fetchProfile = async (publicKey: string) => {
const response = await deso.getSingleProfile({ publicKey });
return response['Profile'];
};
Identity
Login
import { Identity } from "deso.js";
const identity = Identity.init();
const login = async () => {
const payload = await identity.login({ accessLevel: 2 });
const publicKey = payload.publicKeyAdded;
return publicKey;
};
Example code / Sample app
A sample app can be found in /example
Running 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