Skip to content

Commit

Permalink
fix: fix interface (#227)
Browse files Browse the repository at this point in the history
* fix: fix interface

* fix: change type

* fix: ue Provider down the road

* cleanup: remove unncessary type
  • Loading branch information
sakulstra authored Aug 20, 2021
1 parent 9616c57 commit 9971d35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
12 changes: 2 additions & 10 deletions src/tx-builder/txBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ export default class BaseTxBuilder {

constructor(
network: Network = Network.mainnet,
injectedProvider?:
| providers.ExternalProvider
| providers.StaticJsonRpcProvider
| providers.Web3Provider
| string
| undefined,
injectedProvider?: providers.Provider | string | undefined,
defaultProviderKeys?: DefaultProviderKeys
) {
let provider: providers.Provider;
Expand All @@ -62,10 +57,7 @@ export default class BaseTxBuilder {
}
} else if (typeof injectedProvider === 'string') {
provider = new providers.StaticJsonRpcProvider(injectedProvider, chainId);
} else if (
injectedProvider instanceof providers.Web3Provider ||
injectedProvider instanceof providers.StaticJsonRpcProvider
) {
} else if (injectedProvider instanceof providers.Provider) {
provider = injectedProvider;
} else {
provider = new providers.Web3Provider(injectedProvider, chainId);
Expand Down
6 changes: 1 addition & 5 deletions src/tx-builder/v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ export default class TxBuilder

constructor(
network: Network = Network.mainnet,
injectedProvider?:
| providers.ExternalProvider
| providers.Web3Provider
| string
| undefined,
injectedProvider?: providers.Provider | string | undefined,
defaultProviderKeys?: DefaultProviderKeys
) {
super(network, injectedProvider, defaultProviderKeys);
Expand Down

0 comments on commit 9971d35

Please sign in to comment.