## Install ``yarn add obyte-http-client``
npm install obyte-http-clientyarn add obyte-http-clientUse
`js
import obyte from "obyte-http-client"
`
Example
$3
`js
import obyte from "obyte-http-client";export default new obyte.Client({
testnet: true
});
`
$3
`js
import obyteClientInstance from "..."; const witnesses = obyteClientInstance.getWitnesses();
`Methods
$3
`js
const witnesses = obyteClientInstance.getWitnesses(); // use cacheconst witnesses = obyteClientInstance.getWitnesses(true); // update every time
`$3
`js
const peers = obyteClientInstance.getPeers();
`$3
`js
const joint = obyteClientInstance.getJoint('k37Xlns198EHCtubX5X0kqbrnC9XYVTa0aFpR78gidM=');
`$3
`js
const last_mci = obyteClientInstance.getLastMci();
`$3
`js
const history = obyteClientInstance.getHistory(["ULQA63NGEZACP4N7ZMBUBISH6ZTCUS2Q"]);
`$3
`js
const attestation = obyteClientInstance.getAttestation("H5EZTQE7ABFH27AUDTQFMZIALANK6RBG", "email", "obyte@obyte.org");
`$3
`js
const attestations = obyteClientInstance.getAttestations("ULQA63NGEZACP4N7ZMBUBISH6ZTCUS2Q");
`$3
`js
const definition = obyteClientInstance.getDefinition("TMWNLXR42CKIP4A774BQGNVBZAPHY7GH");
`$3
`js
const balances = obyteClientInstance.getBalances(["TMWNLXR42CKIP4A774BQGNVBZAPHY7GH"]);
`$3
`js
const profile_units = obyteClientInstance.getProfileUnits(["TMWNLXR42CKIP4A774BQGNVBZAPHY7GH"]);
`$3
`js
const data = obyteClientInstance.getDataFeed(["I2ADHGP4HL6J37NQAD73J7E5SKFIXJOT"], "timestamp", "none");
`$3
`js
const trigger = {
address: 'K237YYRMBYWCJBLSZGLJTXLZVVEXLI2Y', // sent from address
outputs: {
'base': 10000 // default AA bounce fee in bytes
},
data: {
'vest': true
}
};const result = obyteClientInstance.dryRunAa("TSDLQPZTSVDNC63G7YROC26CYCCZC4GO", trigger);
`$3
`js
const state_vars = obyteClientInstance.getAaStateVars("TSDLQPZTSVDNC63G7YROC26CYCCZC4GO", "proposal_1");
`$3
`js
const aas = obyteClientInstance.getAasByBaseAas("QFM5ECICVHZKRVTW3EMVTUSYJ6P2WLDY"); // or ["QFM5ECICVHZKRVTW3EMVTUSYJ6P2WLDY"]`$3
`js
const responses = obyteClientInstance.getAaResponses("PVMCXUZBEHCFWOLXUDQVNCQZ476LNEW4"); // or ["PVMCXUZBEHCFWOLXUDQVNCQZ476LNEW4"]
`$3
`js
const response_chain = obyteClientInstance.getAaResponseChain("QjJsukONZ57VBVtLk/0ak1jMYNW0vw7q0So95KBJH2k=");
`$3
`js
const result = obyteClientInstance.executeGetter("VLKI3XMMX5YULOBA6ZXBXDPI6TXF6V3D", "get_exchange_result", [0, 100]);
``To support our work, donate through kivach.org.
