Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typechain

Package Overview
Dependencies
Maintainers
1
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typechain - npm Package Compare versions

Comparing version 0.9.0-beta.0 to 1.0.0-beta.0

dist/TypeChain.d.ts

7

dist/cli/cli.js
#!/usr/bin/env node
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -14,3 +15,3 @@ });

const parseArgs_1 = require("./parseArgs");
const __1 = require("..");
const TypeChain_1 = require("../TypeChain");
const logger_1 = require("../utils/logger");

@@ -22,3 +23,3 @@ function main() {

const cwd = process.cwd();
yield ts_generator_1.tsGenerator({ cwd, loggingLvl: "info" }, new __1.Typechain({ cwd, rawConfig: options }));
yield ts_generator_1.tsGenerator({ cwd, loggingLvl: "info" }, new TypeChain_1.Typechain({ cwd, rawConfig: options }));
});

@@ -25,0 +26,0 @@ }

@@ -1,7 +0,6 @@

import { TTypechainTarget } from "..";
export interface IOptions {
files: string;
target: TTypechainTarget;
target: string;
outDir?: string;
}
export declare function parseArgs(): IOptions;

@@ -1,18 +0,3 @@

import { TsGeneratorPlugin, TFileDesc, TContext, TOutput } from "ts-generator";
export declare type TTypechainTarget = "truffle" | "web3-1.0.0" | "legacy" | "ethers";
export interface ITypechainCfg {
target: TTypechainTarget;
outDir?: string;
}
/**
* Proxies calls to real implementation that is selected based on target parameter.
*/
export declare class Typechain extends TsGeneratorPlugin {
name: string;
private realImpl;
constructor(ctx: TContext<ITypechainCfg>);
private findRealImpl;
beforeRun(): TOutput | Promise<TOutput>;
transformFile(file: TFileDesc): TOutput | Promise<TOutput>;
afterRun(): TOutput | Promise<TOutput>;
}
export * from "./parser/abiParser";
export * from "./parser/parseEvmType";
export * from "./utils/files";
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
const ts_generator_1 = require("ts-generator");
const legacy_1 = require("./targets/legacy");
const truffle_1 = require("./targets/truffle");
const web3_1 = require("./targets/web3");
const ethers_1 = require("./targets/ethers");
/**
* Proxies calls to real implementation that is selected based on target parameter.
*/
class Typechain extends ts_generator_1.TsGeneratorPlugin {
constructor(ctx) {
super(ctx);
this.name = "Typechain";
this.realImpl = this.findRealImpl(ctx);
}
findRealImpl(ctx) {
switch (ctx.rawConfig.target) {
case "legacy":
return new legacy_1.TypechainLegacy(ctx);
case "truffle":
return new truffle_1.Truffle(ctx);
case "web3-1.0.0":
return new web3_1.Web3(ctx);
case "ethers":
return new ethers_1.Ethers(ctx);
case undefined:
throw new Error(`Please provide --target parameter!`);
default:
throw new Error(`Unsupported target ${this.ctx.rawConfig.target}!`);
}
}
beforeRun() {
return this.realImpl.beforeRun();
}
transformFile(file) {
return this.realImpl.transformFile(file);
}
afterRun() {
return this.realImpl.afterRun();
}
}
exports.Typechain = Typechain;
__export(require("./parser/abiParser"));
__export(require("./parser/parseEvmType"));
__export(require("./utils/files"));
{
"name": "typechain",
"description": "🔌 Typescript bindings for Ethereum smartcontracts",
"description": "🔌 TypeScript bindings for Ethereum smartcontracts",
"keywords": [

@@ -11,3 +11,3 @@ "ethereum",

],
"version": "0.9.0-beta.0",
"version": "1.0.0-beta.0",
"license": "MIT",

@@ -36,19 +36,4 @@ "repository": "https://github.com/ethereum-ts/Typechain",

"glob": "^7.1.2",
"krzkaczor-solc": "^0.4.24",
"mocha": "^4.0.1",
"mocha-prepare": "^0.1.0",
"nyc": "^12.0.2",
"patch-package": "^5.1.1",
"prettier": "^1.14.2",
"snap-shot-it": "^6.1.1",
"source-map-support": "^0.5.8",
"truffle": "^4.1.14",
"truffle-typings": "^1.0.4",
"ts-node": "^3.3.0",
"tslint": "^5.11.0",
"tslint-language-service": "^0.9.7",
"typescript": "^3.0.1",
"typestrict": "^0.0.6",
"web3": "0.20.x",
"web3-typescript-typings": "^0.7.2"
"truffle-typings": "^1.0.4"
},

@@ -63,21 +48,3 @@ "dependencies": {

"scripts": {
"prepare": "patch-package",
"prepublishOnly": "yarn build",
"build": "rm -rf ./dist && tsc -p ./tsconfig.production.json && cp -R ./lib/targets/legacy/runtime ./dist/targets/legacy/",
"postbuild": "chmod +x ./dist/cli/cli.js",
"lint": "yarn formatting && yarn tslint",
"lint:fix": "yarn tslint:fix && yarn formatting:fix",
"tslint": "tslint -c ./tslint.json --project ./tsconfig.json --format stylish",
"tslint:fix": "tslint -c ./tslint.json --project ./tsconfig.json --format stylish --fix ",
"tsc": "tsc --noEmit",
"tsc:truffle": "tsc --noEmit --project ./test/integration/targets/truffle/tsconfig.json",
"formatting": "prettier --list-different '**/*.ts'",
"formatting:fix": "prettier --write '**/*.ts'",
"test": "yarn lint && ./scripts/test.sh",
"test:coverage": "yarn lint && ./scripts/test.sh COVERAGE",
"test:fix": "yarn lint:fix && ./scripts/test.sh",
"test:mocha": "TS_NODE_IGNORE=\"/test/integration/targets/web3-1.0.0/\" mocha --require ts-node/register.js --require test/setup-chai.ts --require 'test/integration/before.ts' 'test/integration/web3.ts' './**/*.spec.ts'",
"test:mocha:coverage": "NODE_ENV=test nyc mocha --require ts-node/register.js --require source-map-support/register --require test/setup-chai.ts --require 'test/integration/before.ts' 'test/integration/web3.ts' './**/*.spec.ts'",
"test:package-bundle": "cd ./test/package-test && yarn && yarn start",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
"build": "rm -rf ./dist && cp -R '../../dist/core/lib' ./dist/ && chmod +x ./dist/cli/cli.js && cp ../../README.md ."
},

@@ -84,0 +51,0 @@ "main": "./dist/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc