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

@ixo/client-sdk

Package Overview
Dependencies
Maintainers
3
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ixo/client-sdk

One ixo client to rule them all

  • 1.11.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

ixo-client SDK

A complete package of client software for developing client applications which connect to the ixo software stack and build on the Internet of Impact.

Usage Example

const {makeWallet, makeClient} = require('@ixo/client-sdk')

const
    wallet = await makeWallet(),
    client = makeClient(wallet)

await client.register()

await client.sendTokens('<target address>', 10)

const someProject = await client.getProject('<a valid project DID>')

const someClaims = await client.listClaims(someProject)
console.log('Here are the claims', someClaims)

See wallet API and client API for details.

Wallet API

makeWallet(source, didPrefix = 'did:ixo:'): Create a new wallet

  • source: Either a mnemonic string or a plain object representing a wallet state (possibly obtained via toJSON() -see below for details). Optional.

    If empty, a brand new wallet is generated. If a mnemonic string, recovers a wallet based on the mnemonic. If a state object, revives the wallet using that state.

  • didPrefix: A DID prefix. Optional, defaults to did:ixo:.

    If the source is a mnemonic which means that you are importing a wallet from elsewhere, you may need to provide the didPrefix as well to obtain the exact same wallet. If the DID prefix of the wallet is different from did:ixo: then it must be provided here.

makeWallet returns a wallet object with the following properties:

  • secp: An instance of CosmJS' Secp256k1HdWallet

  • agent: A custom wallet instance implementing OfflineAminoSigner

  • toJSON(): Standard toJSON method for JSON.stringify integration. One can also use this to get a representation of the wallet's internal state as a plain object and use it in a context where a class instance is not supported. (e.g. Global application state of a client app)

Client API

Client methods:

Create a new client

  • makeClient(signer, blockchainURL, blocksyncURL): Create a new ixo client

    • signer: Either a wallet object created by makeWallet or a custom signer object with the following properties:

      See the wallet API for more info on secp and agent keywords.

      Optional. If empty, client methods that require a signer won't work.

    • blockchainURL: The URL of the target ixo chain. Optional, defaults to the current mainnet URL.

    • blocksyncURL: The URL of the target ixo blocksync service. Optional, defaults to the current main blocksync service URL.

Client methods

Debugging

Put the ixo-client-sdk string into your DEBUG environment variable to log network requests and responses. See the debug package for more info.

FAQs

Package last updated on 01 Nov 2021

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