How to use @zilliqa-js/blockchain - 4 common examples

To help you get started, we’ve selected a few @zilliqa-js/blockchain examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zilpay / zil-pay / packages / inpage / zil-pay.js View on Github external
constructor(subjectStream, stream) {
    if (!subjectStream || !stream) {
      throw new Error('subjectStream and stream is necessary params.')
    }

    // Create instance Proxy provider.
    this.provider = new HTTPProvider(subjectStream, stream)
    // Redefined Wallet to work with user interface.
    this.wallet = new Wallet(subjectStream, stream)
    
    this.blockchain = new Blockchain(this.provider, this.wallet)
    this.contracts = new Contracts(this.provider, this.wallet)
    this.transactions = new TransactionFactory(this.provider, this.wallet)

    this.utils = zilUtils
    this.crypto = {
      fromBech32Address,
      toBech32Address,
      isValidChecksumAddress,
      toChecksumAddress
    }
  }
}
github Zilliqa / Zilliqa-JavaScript-Library / packages / zilliqa / src / index.ts View on Github external
constructor(node: string, websocket: string, provider?: Provider) {
    this.provider = provider || new HTTPProvider(node);
    this.wallet = new Wallet(this.provider);
    this.blockchain = new Blockchain(this.provider, this.wallet);
    this.network = new Network(this.provider, this.wallet);
    this.contracts = new Contracts(this.provider, this.wallet);
    this.transactions = new TransactionFactory(this.provider, this.wallet);
    this.newTxBlockSubscription = new NewTxBlockSubscription(websocket);
  }
}
github zilpay / zil-pay / extension / inpage / browser / zilPay.js View on Github external
constructor(node=PROVIDER, provider=new HTTPProvider(PROVIDER)) {
    this.provider = provider || new HTTPProvider(node);
    this.wallet = window.zilPay;
    this.blockchain = new Blockchain(this.provider, this.wallet);
    this.contracts = new Contracts(this.provider, this.wallet);
    this.transactions = new TransactionFactory(this.provider, this.wallet);
    this.utils = zilUtils;
    this.crypto = {
      decodeBase58, encodeBase58,
      fromBech32Address, toBech32Address,
      isValidChecksumAddress, toChecksumAddress
    }
  }
}
github Zilliqa / Zilliqa-JavaScript-Library / packages / zilliqa / src / index.ts View on Github external
constructor(node: string, websocket: string, provider?: Provider) {
    this.provider = provider || new HTTPProvider(node);
    this.wallet = new Wallet(this.provider);
    this.blockchain = new Blockchain(this.provider, this.wallet);
    this.network = new Network(this.provider, this.wallet);
    this.contracts = new Contracts(this.provider, this.wallet);
    this.transactions = new TransactionFactory(this.provider, this.wallet);
    this.newTxBlockSubscription = new NewTxBlockSubscription(websocket);
  }
}

@zilliqa-js/blockchain

Class(es) for interacting with the Zilliqa blockchain.

GPL-3.0
Latest version published 6 months ago

Package Health Score

74 / 100
Full package analysis

Similar packages