@typechain/ethers-v4
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -7,2 +7,3 @@ "use strict"; | ||
const functions_1 = require("./functions"); | ||
const common_1 = require("../common"); | ||
function codegenContractTypings(contract) { | ||
@@ -89,5 +90,5 @@ const template = ` | ||
import { TransactionOverrides } from "."; | ||
import { ${contract.name} } from "./${contract.name}"; | ||
import { ${contract.name} } from "../${contract.name}"; | ||
export class ${contract.name}Factory extends ContractFactory { | ||
export class ${contract.name}${common_1.FACTORY_POSTFIX} extends ContractFactory { | ||
${generateFactoryConstructor(contract, bytecode)} | ||
@@ -103,4 +104,4 @@ deploy(${constructorArgs}): Promise<${contract.name}> { | ||
} | ||
connect(signer: Signer): ${contract.name}Factory { | ||
return super.connect(signer) as ${contract.name}Factory; | ||
connect(signer: Signer): ${contract.name}${common_1.FACTORY_POSTFIX} { | ||
return super.connect(signer) as ${contract.name}${common_1.FACTORY_POSTFIX}; | ||
} | ||
@@ -125,5 +126,5 @@ static connect(address: string, signerOrProvider: Signer | Provider): ${contract.name} { | ||
import { ${contract.name} } from "./${contract.name}"; | ||
import { ${contract.name} } from "../${contract.name}"; | ||
export class ${contract.name}Factory { | ||
export class ${contract.name}${common_1.FACTORY_POSTFIX} { | ||
static connect(address: string, signerOrProvider: Signer | Provider): ${contract.name} { | ||
@@ -159,3 +160,3 @@ return new Contract(address, _abi, signerOrProvider) as ${contract.name}; | ||
constructor(linkLibraryAddresses: ${contract.name}LibraryAddresses, signer?: Signer) { | ||
super(_abi, ${contract.name}Factory.linkBytecode(linkLibraryAddresses), signer); | ||
super(_abi, ${contract.name}${common_1.FACTORY_POSTFIX}.linkBytecode(linkLibraryAddresses), signer); | ||
} | ||
@@ -162,0 +163,0 @@ |
@@ -8,2 +8,3 @@ "use strict"; | ||
const codegen_1 = require("./codegen"); | ||
const common_1 = require("./common"); | ||
const DEFAULT_OUT_PATH = './types/ethers-contracts/'; | ||
@@ -72,3 +73,3 @@ class Ethers extends ts_generator_1.TsGeneratorPlugin { | ||
return { | ||
path: path_1.join(this.outDirAbs, `${contract.name}Factory.ts`), | ||
path: path_1.join(this.outDirAbs, 'factories', `${contract.name}${common_1.FACTORY_POSTFIX}.ts`), | ||
contents: codegen_1.codegenContractFactory(contract, abi, bytecode), | ||
@@ -83,3 +84,3 @@ }; | ||
return { | ||
path: path_1.join(this.outDirAbs, `${contract.name}Factory.ts`), | ||
path: path_1.join(this.outDirAbs, 'factories', `${contract.name}${common_1.FACTORY_POSTFIX}.ts`), | ||
contents: codegen_1.codegenAbstractContractFactory(contract, abi), | ||
@@ -86,0 +87,0 @@ }; |
@@ -11,3 +11,3 @@ { | ||
], | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"license": "MIT", | ||
@@ -63,5 +63,5 @@ "repository": "https://github.com/ethereum-ts/Typechain", | ||
"typescript": "3.9.0-beta", | ||
"typechain": "^3.0.0", | ||
"typechain": "^4.0.0", | ||
"test-utils": "1.0.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
40953
19
478