Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

obyte-http-client

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

obyte-http-client

## Install ``yarn add obyte-http-client``

  • 0.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

Obyte http client

Install

yarn add obyte-http-client

Use

import obyte from "obyte-http-client"

Example

1. Create an instance

import obyte from "obyte-http-client";

export default new obyte.Client({
  testnet: true
});

2. Use

import obyteClientInstance from "..."; 

const witnesses = obyteClientInstance.getWitnesses();

Methods

getWitnesses - Returns list of the current witnesses.

const witnesses = obyteClientInstance.getWitnesses(); // use cache

const witnesses = obyteClientInstance.getWitnesses(true); // update every time

getPeers - Returns the list of the current peers.

const peers = obyteClientInstance.getPeers();

getJoint - Request data of a specific unit.

const joint = obyteClientInstance.getJoint('k37Xlns198EHCtubX5X0kqbrnC9XYVTa0aFpR78gidM=');

getLastMci - Get the last main chain index of the node you logged to.

const last_mci = obyteClientInstance.getLastMci();

getHistory - Get the history of one or multiple addresses.

const history = obyteClientInstance.getHistory(["ULQA63NGEZACP4N7ZMBUBISH6ZTCUS2Q"]);

getAttestation - Get attestation unit id from a specific attested value.

const attestation = obyteClientInstance.getAttestation("H5EZTQE7ABFH27AUDTQFMZIALANK6RBG", "email", "obyte@obyte.org");

getAttestation - Get all attestations of a specific address.

const attestations = obyteClientInstance.getAttestations("ULQA63NGEZACP4N7ZMBUBISH6ZTCUS2Q");

getDefinition - Get an address definition.

const definition = obyteClientInstance.getDefinition("TMWNLXR42CKIP4A774BQGNVBZAPHY7GH");

getBalances - Get balances from one or multiple addresses (max 100).

const balances = obyteClientInstance.getBalances(["TMWNLXR42CKIP4A774BQGNVBZAPHY7GH"]);

getProfileUnits - Get profile unit ids from one or multiple addresses (max 100).

const profile_units = obyteClientInstance.getProfileUnits(["TMWNLXR42CKIP4A774BQGNVBZAPHY7GH"]);

getDataFeed

const data = obyteClientInstance.getDataFeed(["I2ADHGP4HL6J37NQAD73J7E5SKFIXJOT"], "timestamp", "none");

dryRunAa - Calculates the predicted outcome of an Autonomous Agent with a sample transaction.

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);

getAaStateVars - Get state variables of an Autonomous Agent.

const state_vars = obyteClientInstance.getAaStateVars("TSDLQPZTSVDNC63G7YROC26CYCCZC4GO", "proposal_1");

getAasByBaseAas - Get Autonomous Agents that are based on some Autonomous Agent.

const aas = obyteClientInstance.getAasByBaseAas("QFM5ECICVHZKRVTW3EMVTUSYJ6P2WLDY"); // or ["QFM5ECICVHZKRVTW3EMVTUSYJ6P2WLDY"]

getAaResponses - Get latest Autonomous Agent responses.

const responses = obyteClientInstance.getAaResponses("PVMCXUZBEHCFWOLXUDQVNCQZ476LNEW4"); // or ["PVMCXUZBEHCFWOLXUDQVNCQZ476LNEW4"]

getAaResponseChain

const response_chain = obyteClientInstance.getAaResponseChain("QjJsukONZ57VBVtLk/0ak1jMYNW0vw7q0So95KBJH2k=");

executeGetter - Execute AA getter function

const result = obyteClientInstance.executeGetter("VLKI3XMMX5YULOBA6ZXBXDPI6TXF6V3D", "get_exchange_result", [0, 100]);

Donations

To support our work, donate through kivach.org.

Kivach

FAQs

Package last updated on 29 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc