Coder Social home page Coder Social logo

irishub-sdk-js's Introduction

irisnet

IRIS Network

This is a directory holding materials for IRISnet related communication, such as infor being used on www.irisnet.org

irishub-sdk-js's People

Contributors

chengwenxi avatar dependabot[bot] avatar dreamer-zq avatar duanjie-cmd avatar hangts avatar lavender66 avatar marshallbao avatar oncloudit avatar zhangjinbiao746 avatar zhangyelong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

irishub-sdk-js's Issues

Docs CI

Add CI/CD config for TypeDoc

EventListener Framework

Ref: #22

Develop EventListener Framework:

  • connect: init ws client
  • disconnect: destroy ws client
  • onError: callback on error

Distribution Module

  • queryRewards
  • setWithdrawAddr
  • withdrawRewards
    • withdrawValidatorRewardsAll
    • withdrawDelegatorReward
    • withdrawDelegatorRewardsAll

Subscribe Tx

Ref: #22

Provide a Subscribe Tx function which accepts user defined query params.

Tendermint Query Methods Implementation

  • queryBlock(height?: number)
  • queryBlockResult(height?: number)
  • queryTx(hash: string)
  • searchTxs(query: QueryBuilder, page?: number, size?: number)
  • queryValidators(height?: number)

Subscribe NewBlockHeader

Ref: #22

Provide a Subscribe NewBlockHeader function, and convert ProposerAddress in Header to bech32 encoded.

Key Management

Implement the Keys Module:

  • Add a new Key
  • Recover an existing Key by seed phrase
  • Add Ledger Support
  • Import from Keystore
  • Export Keystore
  • Delete Keys
  • Show Keys
  • HD Wallet Support

Unit Conversion

  • Auto convert input coins to min unit (irishub api only accepts min unit)
  • Do not convert output coins (for performance and precision purpose)
  • Users can use the separated methods toMinCoin and toMainCoin to convert coin units

Business logic layer listeners

In general, we may need the following event listeners:

  1. Transfers - used to monitor transfers to a certain address, etc.
  2. Validator Info - used to monitor whether the validator has changed the commission ratio, etc.
  3. Validator Status - used to monitor whether the status of the validator is abnormal or the voting power has changed significantly
  4. Service - Invocation and callback notification
  5. Coinswap - Liquidity monitoring

Ref: #22

Staking Module

  • queryDelegation
  • queryDelegations
  • queryUnbondingDelegation
  • queryUnbondingDelegations
  • queryRedelegation
  • queryRedelegations
  • queryDelegationsTo
  • queryUnbondingDelegationsFrom
  • queryRedelegationsFrom
  • queryValidator
  • queryValidators
  • queryPool
  • queryParams
  • delegate
  • unbond
  • redelegate

Gov Module

  • query-proposal Query details of a single proposal
  • query-proposals Query proposals with optional filters
  • query-vote Query vote
  • query-votes Query votes on a proposal
  • query-deposit Query details of a deposit
  • query-deposits Query deposits on a proposal
  • query-tally Get the tally of a proposal vote
  • submit-proposal Submit a proposal along with an initial deposit
  • deposit Deposit tokens for activing proposal
  • vote Vote for an active proposal, options: Yes/No/NoWithVeto/Abstain

SDK Structure

Initialize sdk instance in some ways like:

let sdk = iris.newSdk(config: SdkConfig)
  • SdkConfig *:SDK default configs
    • node *:irishub full node addr
    • network:mainnet / testnet(default: mainnet)
    • chainId:Identity of the chain(default: irishub)
    • gas:default gas limit(default: 100000)
    • fee:default fee(default: 0.6iris)
    • keyDAO:Keys Data Access Object,to be implemented by Apps
      • write(param:TBD):save the Keystore to Apps
      • read(name: string):read Keystore from Apps
        • name: Key name

Project Init

Initialize irishub-sdk-js, using Yarn + Typescript + Jest

Store account pubkey locally

For offline signing and new account signing, we can not obtain the account pubkey from the blockchain, so we need to store/get the account pubkey locally.

Bank Module

Implement Bank Module:

  • Get CoinType
  • Get Token Stats
  • Get Account Info
  • Send Coins
  • Burn Coins
  • Set Memo Regexp

Blocked by #14, #15

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.