How to use the icon-sdk-js.HttpProvider function in icon-sdk-js

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

github icon-project / icon-sdk-js / quickstart / example / js / IcxTransactionExample.js View on Github external
constructor() {

		// HttpProvider is used to communicate with http.
		this.provider = new HttpProvider(MockData.NODE_URL);
		
		// Create IconService instance
        this.iconService = new IconService(this.provider);
        
        // Load wallet
        this.wallet = IconWallet.loadPrivateKey(MockData.PRIVATE_KEY_1);
        this.txHash = '';

        this.addListener();
        (async () => {
            try {
              await this.getWalletBalance();
            } catch(e) {
              console.log(e);
            }
        })();
github icon-project / icon-sdk-js / quickstart / example / js / DeployAndTransferTokenExample.js View on Github external
constructor() {
		// HttpProvider is used to communicate with http.
		this.provider = new HttpProvider(MockData.NODE_URL);
		
		// Create IconService instance
        this.iconService = new IconService(this.provider);
        
        // Load wallet
        this.wallet = IconWallet.loadPrivateKey(MockData.PRIVATE_KEY_1);
        
        this.deployTxHash = '';
        this.transactionTxHash = '';
        this.content = '';

        this.scoreAddress = '';

        this.addListener();
    }
github icon-project / icon-sdk-js / quickstart / example / js / SyncBlockExample.js View on Github external
constructor() {
		// HttpProvider is used to communicate with http.
		this.provider = new HttpProvider(MockData.NODE_URL);
		
		// Create IconService instance
        this.iconService = new IconService(this.provider);
        this.timer;
        this.prevHeight = null;
        this.addListener();
    }