Skip to content

Commit

Permalink
Merge pull request #38 from skalenetwork/instance
Browse files Browse the repository at this point in the history
Add Instance type
  • Loading branch information
DimaStebaev authored Sep 7, 2023
2 parents 171f72c + 06339d7 commit 89bec4e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion typescript/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"eslint": "npx eslint ."
},
"types": "lib/index.d.ts",
"version": "0.0.3",
"version": "0.1.0",
"dependencies": {
"axios": "^1.4.0"
}
Expand Down
2 changes: 2 additions & 0 deletions typescript/ethers-v5/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { SkaleContracts } from "./skaleContracts";

export { Instance } from "./skaleContracts";

export const skaleContracts = new SkaleContracts();
4 changes: 4 additions & 0 deletions typescript/ethers-v5/src/skaleContracts.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
import { BaseContract, ethers } from "ethers";
import {
Instance as BaseInstance
} from "@skalenetwork/skale-contracts/lib/instance";
import {
SkaleContracts as BaseSkaleContracts
} from "@skalenetwork/skale-contracts";
import { Ethers5Adapter } from "./ethers5Adapter";
import { Provider } from "@ethersproject/providers";

export type Instance = BaseInstance<BaseContract>;

export class SkaleContracts extends BaseSkaleContracts<BaseContract> {
getNetworkByChainId (chainId: number) {
Expand Down
3 changes: 3 additions & 0 deletions typescript/ethers-v6/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import { SkaleContracts } from "./skaleContracts";


export { Instance } from "./skaleContracts";

export const skaleContracts = new SkaleContracts();
5 changes: 5 additions & 0 deletions typescript/ethers-v6/src/skaleContracts.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import { BaseContract, Provider, ethers } from "ethers";
import {
Instance as BaseInstance
} from "@skalenetwork/skale-contracts/lib/instance";
import {
SkaleContracts as BaseSkaleContracts
} from "@skalenetwork/skale-contracts";
import { Ethers6Adapter } from "./ethers6Adapter";


export type Instance = BaseInstance<BaseContract>;

export class SkaleContracts extends BaseSkaleContracts<BaseContract> {
getNetworkByChainId (chainId: number) {
return this.getNetworkByProvider(ethers.getDefaultProvider(chainId));
Expand Down

0 comments on commit 89bec4e

Please sign in to comment.