This repository contains the official JavaScript SDK for Cobo WaaS API, enabling developers to integrate with Cobo's Custodial and/or MPC services seamlessly using the JavaScript programming language.
To access the API documentation, navigate to the API references.
For more information on Cobo's JavaScript SDK, refer to the JavaScript SDK Guide.
Ensure that you have created an account and configured Cobo's Custodial and/or MPC services. For detailed instructions, please refer to the Quickstart guide.
Node.js v10.18.0 or newer.
add dependency in package.json
{
"dependencies": {
"cobo-custody": "https://github.com/CoboGlobal/cobo-js-api/releases/download/v0.49.0/release.tgz"
}
}
const { LocalSigner } = require('cobo-custody');
const keyPair = LocalSigner.newKeyPair();
console.log(keyPair["privKey"]);
console.log(keyPair["pubKey"]);
For more information on the API key, please click here.
ApiSigner
can be instantiated through
const { LocalSigner } = require("cobo-custody");
const signer = new LocalSigner(keyPair["privKey"]);
In certain scenarios, the private key may be restricted from export, such as when it is stored in AWS Key Management Service (KMS). In such cases, please pass in a custom implementation using the ApiSigner interface:
const { Client } = require('cobo-custody');
const { LocalSigner } = require('cobo-custody');
const {DEV,PROD} = require('cobo-custody');
const client = new Client(API_SIGNER, DEV, true)
const { Client } = require('cobo-custody');
const { LocalSigner } = require('cobo-custody');
const {DEV,PROD} = require('cobo-custody');
const keyPair = LocalSigner.newKeyPair();
console.log(keyPair["privKey"]);
console.log(keyPair["pubKey"]);
const signer = new LocalSigner(keyPair["privKey"]);
const client = new Client(keyPair["privKey"], DEV, true)
const res = client.getAccountInfo();
console.log(res)