Giter VIP home page Giter VIP logo

starname-npm's Introduction

@iov/starname-npm npm version

Client library for Starname blockchain.

Packs in a StarnameClient class that can be used to interact with the Starname blockchain and a Wallet class that can be used to sign transactions.

Installation

yarn add @iov/starname-npm

Initialization

import { SeedPhraseSigner, StarnameClient, Wallet } from "@iov/starname-npm";

const client = await StarnameClient.createConnected(rpcUrl, apiUrl, ...);
// Now for creating a wallet you need a signer
// Lets create and use a mnemonic/seed-phrase signer
const signer = new SeedPhraseSigner();
// Now we need to initialize this signer
// Every signer implementing the Signer interface needs to be initialized
// This is where the signer will be asked to provide authorization for the wallet
// Here we are using random method which can auto generate a random seed phrase
await signer.initializeRandom();
const wallet = new Wallet(signer, starnameClient);
// Our wallet is ready to perform transactions

Usage

Now that we have a client and a wallet...
We can use our client to (For eg.) resolve a starname.

const task = client.resolveStarname("alice*iov");
task.run().then((result) => {
  console.log(result);
});

And can use our wallet instance to sign and broadcast transactions.

const result = await wallet.registerDomain("helloworld");

For more info you can check out this.

Also check out @iov/wallet-providers if you are planning on building a web application.

starname-npm's People

Contributors

xpt1x avatar iharob avatar

Stargazers

Abdulaziz Kholbaev avatar

Watchers

 avatar  avatar

starname-npm's Issues

Fix escrow transactions for ledger

Currently we throw an error on any escrow related transaction where signer is Ledger
Fix implementation for escrow and ledger (Amino)

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.