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

@reflexer-finance/geb-typechain

Package Overview
Dependencies
Maintainers
4
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reflexer-finance/geb-typechain - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

17

lib/codegen.js

@@ -8,19 +8,14 @@ "use strict";

// Implements the ERC20 interface for the contracts that are ERC20
const isERCO20 = contract.name === 'Weth' ||
contract.name === 'Coin' ||
contract.name === 'Erc20'
? true
: false;
// prettier-ignore
let template = `
export class ${contract.name} extends BaseContractAPI${isERCO20 ? ' implements ERC20' : ''} {
export class ${contract.name} extends BaseContractAPI {
${codegenForFunctions(contract.functions, abi)}
}
`;
template = addImports(template, isERCO20);
template = addImports(template);
return template;
}
exports.codegenContract = codegenContract;
function addImports(template, isERC20) {
function addImports(template) {
if (template.includes('BigNumber)') ||

@@ -45,8 +40,2 @@ template.includes('BigNumber ') ||

}
if (isERC20) {
template =
`
import { ERC20 } from '@reflexer-finance/geb-contract-base'` +
template;
}
if (template.includes('TransactionRequest')) {

@@ -53,0 +42,0 @@ template =

4

package.json
{
"name": "@reflexer-finance/geb-typechain",
"version": "0.0.7",
"version": "0.0.8",
"description": "",

@@ -19,3 +19,3 @@ "main": "./lib/index.js",

},
"gitHead": "b2e8ba46b163912f5abef17f804d1a1a78c01878"
"gitHead": "3746bb58364983fd43985281433e9a64f2049923"
}

@@ -18,8 +18,2 @@ import {

// Implements the ERC20 interface for the contracts that are ERC20
const isERCO20 =
contract.name === 'Weth' ||
contract.name === 'Coin' ||
contract.name === 'Erc20'
? true
: false

@@ -29,7 +23,7 @@ // prettier-ignore

export class ${contract.name} extends BaseContractAPI${isERCO20 ? ' implements ERC20' : ''} {
export class ${contract.name} extends BaseContractAPI {
${codegenForFunctions(contract.functions, abi)}
}
`
template = addImports(template, isERCO20)
template = addImports(template)

@@ -39,3 +33,3 @@ return template

function addImports(template: string, isERC20: boolean): string {
function addImports(template: string): string {
if (

@@ -65,9 +59,2 @@ template.includes('BigNumber)') ||

if (isERC20) {
template =
`
import { ERC20 } from '@reflexer-finance/geb-contract-base'` +
template
}
if (template.includes('TransactionRequest')) {

@@ -74,0 +61,0 @@ template =

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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