UNPKG

@haechi-labs/henesis-cli

Version:

🚀 Command Line Interface tool to Utilize henesis

175 lines • 5.81 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const types_1 = require("../types"); const faker = tslib_1.__importStar(require("faker")); const types_2 = require("../types"); function newMockLogin() { return new types_1.LoginResponse(faker.internet.email(), faker.name.findName(), faker.commerce.productName(), 'ashd8uado9012i31kod'); } exports.newMockLogin = newMockLogin; function newMockAccount() { return new types_1.DescribeResponse(faker.internet.email(), faker.name.findName(), faker.commerce.productName(), 'jcashd8uoa9p012i31kod'); } exports.newMockAccount = newMockAccount; function newMockIntegration() { return new types_1.Integration(faker.random.alphaNumeric(15), faker.random.number(2), 'asdf', 'v1', 'v1', new types_1.Blockchain(types_1.PlatformType.ETHEREUM, types_1.NetworkType.MAINNET, 3), new types_1.Filter([ { abi: [ { constant: false, inputs: [ { name: 'to', type: 'address', }, ], name: 'delegate', outputs: [], payable: false, stateMutability: 'nonpayable', type: 'function', }, { constant: true, inputs: [], name: 'winningProposal', outputs: [ { name: '_winningProposal', type: 'uint8', }, ], payable: false, stateMutability: 'view', type: 'function', }, { constant: false, inputs: [ { name: 'toVoter', type: 'address', }, ], name: 'giveRightToVote', outputs: [], payable: false, stateMutability: 'nonpayable', type: 'function', }, { constant: false, inputs: [ { name: 'toProposal', type: 'uint8', }, ], name: 'vote', outputs: [], payable: false, stateMutability: 'nonpayable', type: 'function', }, { inputs: [ { name: '_numProposals', type: 'uint8', }, ], payable: false, stateMutability: 'nonpayable', type: 'constructor', }, ], address: '0x213', name: faker.random.alphaNumeric(15), }, ]), new types_1.Provider('webhook'), new types_2.Status('Available')); } exports.newMockIntegration = newMockIntegration; function newMockIntegrationSpec() { return { version: 'v1', apiVersion: 'v1', name: 'integration', blockchain: { platform: types_1.PlatformType.KLAYTN, network: types_1.NetworkType.MAINNET, threshold: 5, }, filters: { contracts: [ { address: '0xef3fbc3e228dbdc523ce5e58530874005553eb2e', name: 'example', files: [ { path: `${__dirname}/../../templates/contracts/example.sol`, contractName: 'example', compilerVersion: '0.5.8', }, ], }, ], }, provider: { type: 'webhook', url: 'https://localhost:8080', method: 'POST', headers: { Authorization: 'Bearer aisdjiajdais', }, }, }; } exports.newMockIntegrationSpec = newMockIntegrationSpec; // DailyStats for haechi@haechi.io function newMockJsonRpcDailyStats() { return [ { id: 12, clientId: 'dummyClientId', count: 43, platform: 'ethereum', requestBytes: 3090, responseBytes: 1639286, createdAt: '2019-11-30T00:00:01.463', jobId: 212, }, { id: 8, clientId: 'dummyClientId', count: 303, platform: 'ethereum', requestBytes: 20937, responseBytes: 2721064, createdAt: '2019-11-29T00:00:02.188', jobId: 187, }, { id: 5, clientId: 'dummyClientId', count: 3028, platform: 'ethereum', requestBytes: 485178, responseBytes: 4583237, createdAt: '2019-11-28T00:00:01.509', jobId: 161, }, { id: 2, clientId: 'dummyClientId', count: 253, platform: 'ethereum', requestBytes: 30453, responseBytes: 4178469, createdAt: '2019-11-27T00:00:02.05', jobId: 136, }, ]; } exports.newMockJsonRpcDailyStats = newMockJsonRpcDailyStats; //# sourceMappingURL=factory.js.map