Skip to content

Commit

Permalink
Set signerOrProvider optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubilmax committed Sep 7, 2022
1 parent 92faf28 commit c169fd2
Show file tree
Hide file tree
Showing 30 changed files with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class Counter__factory extends ContractFactory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): Counter {
return new Contract(address, _abi, signerOrProvider) as Counter;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class Demo__factory extends ContractFactory {
static createInterface(): DemoInterface {
return new utils.Interface(_abi) as DemoInterface;
}
static connect(address: string, signerOrProvider: Signer | Provider): Demo {
static connect(address: string, signerOrProvider?: Signer | Provider): Demo {
return new Contract(address, _abi, signerOrProvider) as Demo;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class Hello__factory extends ContractFactory {
static createInterface(): HelloInterface {
return new utils.Interface(_abi) as HelloInterface;
}
static connect(address: string, signerOrProvider: Signer | Provider): Hello {
static connect(address: string, signerOrProvider?: Signer | Provider): Hello {
return new Contract(address, _abi, signerOrProvider) as Hello;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export class StructsInConstructor__factory extends ContractFactory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): StructsInConstructor {
return new Contract(
address,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ export class DataTypesInput__factory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): DataTypesInput {
return new Contract(address, _abi, signerOrProvider) as DataTypesInput;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export class DataTypesPure__factory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): DataTypesPure {
return new Contract(address, _abi, signerOrProvider) as DataTypesPure;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export class DataTypesView__factory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): DataTypesView {
return new Contract(address, _abi, signerOrProvider) as DataTypesView;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export class Events__factory {
static createInterface(): EventsInterface {
return new utils.Interface(_abi) as EventsInterface;
}
static connect(address: string, signerOrProvider: Signer | Provider): Events {
static connect(address: string, signerOrProvider?: Signer | Provider): Events {
return new Contract(address, _abi, signerOrProvider) as Events;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class A__factory {
static createInterface(): AInterface {
return new utils.Interface(_abi) as AInterface;
}
static connect(address: string, signerOrProvider: Signer | Provider): A {
static connect(address: string, signerOrProvider?: Signer | Provider): A {
return new Contract(address, _abi, signerOrProvider) as A;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class B__factory {
static createInterface(): BInterface {
return new utils.Interface(_abi) as BInterface;
}
static connect(address: string, signerOrProvider: Signer | Provider): B {
static connect(address: string, signerOrProvider?: Signer | Provider): B {
return new Contract(address, _abi, signerOrProvider) as B;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class Lib__factory {
static createInterface(): LibInterface {
return new utils.Interface(_abi) as LibInterface;
}
static connect(address: string, signerOrProvider: Signer | Provider): Lib {
static connect(address: string, signerOrProvider?: Signer | Provider): Lib {
return new Contract(address, _abi, signerOrProvider) as Lib;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class LibraryConsumer__factory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): LibraryConsumer {
return new Contract(address, _abi, signerOrProvider) as LibraryConsumer;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class NAME12mangling__factory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): NAME12mangling {
return new Contract(address, _abi, signerOrProvider) as NAME12mangling;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class Overloads__factory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): Overloads {
return new Contract(address, _abi, signerOrProvider) as Overloads;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class PayableFactory__factory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): PayableFactory {
return new Contract(address, _abi, signerOrProvider) as PayableFactory;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class Payable__factory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): Payable {
return new Contract(address, _abi, signerOrProvider) as Payable;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class ISimpleToken__factory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): ISimpleToken {
return new Contract(address, _abi, signerOrProvider) as ISimpleToken;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class Issue552_Reproduction__factory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): Issue552_Reproduction {
return new Contract(
address,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class KingOfTheHill__factory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): KingOfTheHill {
return new Contract(address, _abi, signerOrProvider) as KingOfTheHill;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class Withdrawable__factory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): Withdrawable {
return new Contract(address, _abi, signerOrProvider) as Withdrawable;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export class ERC721Enumerable__factory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): ERC721Enumerable {
return new Contract(address, _abi, signerOrProvider) as ERC721Enumerable;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ export class ERC721__factory {
static createInterface(): ERC721Interface {
return new utils.Interface(_abi) as ERC721Interface;
}
static connect(address: string, signerOrProvider: Signer | Provider): ERC721 {
static connect(address: string, signerOrProvider?: Signer | Provider): ERC721 {
return new Contract(address, _abi, signerOrProvider) as ERC721;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ export class IERC721Enumerable__factory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): IERC721Enumerable {
return new Contract(address, _abi, signerOrProvider) as IERC721Enumerable;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class IERC721Receiver__factory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): IERC721Receiver {
return new Contract(address, _abi, signerOrProvider) as IERC721Receiver;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export class IERC721__factory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): IERC721 {
return new Contract(address, _abi, signerOrProvider) as IERC721;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ export class Rarity__factory {
static createInterface(): RarityInterface {
return new utils.Interface(_abi) as RarityInterface;
}
static connect(address: string, signerOrProvider: Signer | Provider): Rarity {
static connect(address: string, signerOrProvider?: Signer | Provider): Rarity {
return new Contract(address, _abi, signerOrProvider) as Rarity;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class SimpleToken__factory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): SimpleToken {
return new Contract(address, _abi, signerOrProvider) as SimpleToken;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class NestedLibrary__factory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): NestedLibrary {
return new Contract(address, _abi, signerOrProvider) as NestedLibrary;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class NestedLibrary__factory {
}
static connect(
address: string,
signerOrProvider: Signer | Provider
signerOrProvider?: Signer | Provider
): NestedLibrary {
return new Contract(address, _abi, signerOrProvider) as NestedLibrary;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/target-ethers-v5/src/codegen/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ function codegenCommonContractFactory(contract: Contract, abi: any): { header: s
static createInterface(): ${contract.name}Interface {
return new utils.Interface(_abi) as ${contract.name}Interface;
}
static connect(address: string, signerOrProvider: Signer | Provider): ${contract.name} {
static connect(address: string, signerOrProvider?: Signer | Provider): ${contract.name} {
return new Contract(address, _abi, signerOrProvider) as ${contract.name};
}
`.trim()
Expand Down

0 comments on commit c169fd2

Please sign in to comment.