@reflexer-finance/geb-typechain
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -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 = |
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
209371
723