How to use requestnetworkartifacts - 10 common examples

To help you get started, we’ve selected a few requestnetworkartifacts 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 RequestNetwork / requestNetwork / test / deploy.ts View on Github external
const addressContractBurner = 0;
const feesPerTenThousand = 10; // 0.1 %

import requestArtifacts from 'requestnetworkartifacts';
import { Web3Single } from '../src/servicesExternal/web3-Single';

const requestCoreJson = requestArtifacts('private', 'last-RequestCore');
const requestEthereumJson = requestArtifacts('private', 'last-RequestEthereum');
const requestBurnManagerSimple = requestArtifacts('private', 'last-RequestBurnManagerSimple');

Web3Single.init('http://localhost:8545', 10000000000);
const web3Single = Web3Single.getInstance();

const instanceRequestCore = new web3Single.web3.eth.Contract(requestCoreJson.abi);
const instanceRequestEthereum = new web3Single.web3.eth.Contract(requestEthereumJson.abi);
const instancerequestBurnManagerSimple = new web3Single.web3.eth.Contract(requestBurnManagerSimple.abi)

let addressRequestCore: string;
let addressRequestEthereum: string;
let addressrequestBurnManagerSimple: string;
let newContractInstanceRequestCore: any;
let newContractInstanceRequestEthereum: any;
let newContractInstancerequestBurnManagerSimple: any;

web3Single.getDefaultAccount().then((creator) => {
github RequestNetwork / requestNetwork / packages / requestNetwork.js / src / utils / currency.ts View on Github external
// Test token on rinkeby
            'RequestERC20-centralbank': Types.Currency.REQ,

            'RequestERC20-knc': Types.Currency.KNC,
            'RequestERC20-dgx': Types.Currency.DGX,
            'RequestERC20-dai': Types.Currency.DAI,
            'RequestERC20-omg': Types.Currency.OMG,
            'RequestERC20-kin': Types.Currency.KIN,
            'RequestERC20-zrx': Types.Currency.ZRX,
            'RequestERC20-bat': Types.Currency.BAT,
            'RequestERC20-bnb': Types.Currency.BNB,
            'RequestERC20-link': Types.Currency.LINK,
        };

        const currencyContractName = requestArtifacts.getContractNameForAddress(address.toLowerCase());
        return currencyMapping[currencyContractName];
    },
github RequestNetwork / requestNetwork / test / unit / ethereumServices / broadcastSignedRequestAsPayer.ts View on Github external
import {expect} from 'chai';
import 'mocha';
import requestArtifacts from 'requestnetworkartifacts';
import RequestNetwork from '../../../src/requestNetwork';
import * as utils from '../../utils';

const WEB3 = require('web3');
const BN = WEB3.utils.BN;

const addressRequestEthereum = requestArtifacts('private', 'last-RequestEthereum').networks.private.address;
const addressRequestCore = requestArtifacts('private', 'last-RequestCore').networks.private.address;

let rn: any;
let web3: any;
let defaultAccount: string;
let payer: string;
let payee: string;
let otherGuy: string;

let currentNumRequest: any;

let signedRequest: any;

describe('broadcastSignedRequestAsPayer', () => {
    const arbitraryAmount = 100000000;
    rn = new RequestNetwork('http://localhost:8545', 10000000000, false);
github RequestNetwork / requestNetwork / test / unit / coreServices / getRequestByTransactionHash.ts View on Github external
import {expect} from 'chai';
import 'mocha';
import requestArtifacts from 'requestnetworkartifacts';
import RequestNetwork from '../../../src/requestNetwork';
import * as utils from '../../utils';

const WEB3 = require('web3');
const BN = WEB3.utils.BN;

const addressRequestEthereum = requestArtifacts('private', 'last-RequestEthereum').networks.private.address;
const addressRequestCore = requestArtifacts('private', 'last-RequestCore').networks.private.address;

let rn: any;
let web3: any;
let defaultAccount: string;
let payer: string;
let payee: string;
let otherGuy: string;

let coreVersion: any;
let currentNumRequest: any;

describe('getRequestByTransactionHash', () => {
    const arbitraryAmount = 100000000;
    rn = new RequestNetwork('http://localhost:8545', 10000000000);
    web3 = rn.requestEthereumService.web3Single.web3;
github RequestNetwork / requestNetwork / test / unit / ethereumServices / paymentAction.ts View on Github external
import {expect} from 'chai';
import 'mocha';
import requestArtifacts from 'requestnetworkartifacts';
import RequestNetwork from '../../../src/requestNetwork';
import * as utils from '../../utils';

const WEB3 = require('web3');
const BN = WEB3.utils.BN;

const addressRequestEthereum = requestArtifacts('private', 'last-RequestEthereum').networks.private.address;
const addressRequestCore = requestArtifacts('private', 'last-RequestCore').networks.private.address;

let rn: any;
let web3: any;
let defaultAccount: string;
let payer: string;
let payee: string;
let otherGuy: string;

let coreVersion: any;
let currentNumRequest: any;

let requestId: any;

describe('paymentAction', () => {
    const arbitraryAmount = 100000000;
github RequestNetwork / requestNetwork / test / unit / ethereumServices / cancel.ts View on Github external
import {expect} from 'chai';
import 'mocha';
import requestArtifacts from 'requestnetworkartifacts';
import RequestNetwork from '../../../src/requestNetwork';
import * as utils from '../../utils';

const WEB3 = require('web3');
const BN = WEB3.utils.BN;

const addressRequestEthereum = requestArtifacts('private', 'last-RequestEthereum').networks.private.address;
const addressRequestCore = requestArtifacts('private', 'last-RequestCore').networks.private.address;

let rn: any;
let web3: any;
let defaultAccount;
let payer: any;
let payee: any;
let otherGuy: any;

let coreVersion: any;
let currentNumRequest: any;

let requestId: any;

describe('cancel', () => {
    const arbitraryAmount = 100000000;
    rn = new RequestNetwork('http://localhost:8545', 10000000000, false);
github RequestNetwork / requestNetwork / test / unit / ethereumServices / refundAction.ts View on Github external
import {expect} from 'chai';
import 'mocha';
import requestArtifacts from 'requestnetworkartifacts';
import RequestNetwork from '../../../src/requestNetwork';
import * as utils from '../../utils';

const WEB3 = require('web3');
const BN = WEB3.utils.BN;

const addressRequestEthereum = requestArtifacts('private', 'last-RequestEthereum').networks.private.address;
const addressRequestCore = requestArtifacts('private', 'last-RequestCore').networks.private.address;

let rn: any;
let web3: any;
let defaultAccount: string;
let payer: string;
let payee: string;
let otherGuy: string;

let coreVersion: any;
let currentNumRequest: any;

let requestId: any;

describe('refundAction', () => {
    const arbitraryAmount = 100000000;
github RequestNetwork / requestNetwork / test / unit / ethereumServices / paymentAction.ts View on Github external
import {expect} from 'chai';
import 'mocha';
import requestArtifacts from 'requestnetworkartifacts';
import RequestNetwork from '../../../src/requestNetwork';
import * as utils from '../../utils';

const WEB3 = require('web3');
const BN = WEB3.utils.BN;

const addressRequestEthereum = requestArtifacts('private', 'last-RequestEthereum').networks.private.address;
const addressRequestCore = requestArtifacts('private', 'last-RequestCore').networks.private.address;

let rn: any;
let web3: any;
let defaultAccount: string;
let payer: string;
let payee: string;
let otherGuy: string;

let coreVersion: any;
let currentNumRequest: any;

let requestId: any;

describe('paymentAction', () => {
    const arbitraryAmount = 100000000;
    rn = new RequestNetwork('http://localhost:8545', 10000000000, false);
github RequestNetwork / requestNetwork / test / unit / ethereumServices / cancel.ts View on Github external
import {expect} from 'chai';
import 'mocha';
import requestArtifacts from 'requestnetworkartifacts';
import RequestNetwork from '../../../src/requestNetwork';
import * as utils from '../../utils';

const WEB3 = require('web3');
const BN = WEB3.utils.BN;

const addressRequestEthereum = requestArtifacts('private', 'last-RequestEthereum').networks.private.address;
const addressRequestCore = requestArtifacts('private', 'last-RequestCore').networks.private.address;

let rn: any;
let web3: any;
let defaultAccount;
let payer: any;
let payee: any;
let otherGuy: any;

let coreVersion: any;
let currentNumRequest: any;

let requestId: any;

describe('cancel', () => {
    const arbitraryAmount = 100000000;
github RequestNetwork / requestNetwork / packages / requestNetwork.js / src / servicesCore / requestCore-service.ts View on Github external
public getAllCoreInstance(): any[] {
        const result: any[] = [];
        const allArtifacts = requestArtifacts.getAllArtifactsForNetwork(this.web3Single.networkName);
        for ( const key in allArtifacts ) {
            if (key.slice(0, 2) === '0x' && allArtifacts[key].split('/')[0] === 'RequestCore') {
                result.push( this.web3Single.getContractInstance(key) );
            }
        }
        return result;
    }

requestnetworkartifacts

Artifacts for Request Network Ethereum contracts

MIT
Latest version published 5 years ago

Package Health Score

64 / 100
Full package analysis