@skalenetwork/skale-contracts-ethers-v5 1.0.2-develop.5 → 1.0.2-develop.51
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +4 -4
- package/lib/ethers5Adapter.d.ts +2 -1
- package/lib/ethers5Adapter.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
@@ -48,7 +48,7 @@ The library provides master object `skaleContracts`.
|
|
48
48
|
|
49
49
|
This object is used to provide desired [network](#network), [project](#project) and [instance](#instance) using it's [alias](#alias) or direct address.
|
50
50
|
|
51
|
-
When target instance is received it can be queried for information
|
51
|
+
When target instance is received it can be queried for information (address, ABI or Contract object) about a particular contract by it's name.
|
52
52
|
|
53
53
|
### Example
|
54
54
|
|
@@ -56,10 +56,10 @@ When target instance is received it can be queried for information (address, AB
|
|
56
56
|
import { skaleContracts } from "@skalenetwork/skale-contracts-ethers-v5";
|
57
57
|
import { ethers } from "ethers";
|
58
58
|
|
59
|
-
const provider = new ethers.providers.JsonRpcProvider(endpoint)
|
59
|
+
const provider = new ethers.providers.JsonRpcProvider(endpoint);
|
60
60
|
const network = await skaleContracts.getNetworkByProvider(provider);
|
61
|
-
const project =
|
61
|
+
const project = network.getProject("skale-manager");
|
62
62
|
const instance = await project.getInstance("production");
|
63
63
|
const distributor = await instance.getContract("Distributor");
|
64
|
-
const fee = await distributor.getEarnedFeeAmount()
|
64
|
+
const fee = await distributor.getEarnedFeeAmount();
|
65
65
|
```
|
package/lib/ethers5Adapter.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { Abi, Adapter, ContractData, FunctionCall } from "@skalenetwork/skale-contracts";
|
2
2
|
import { BaseContract, ethers } from "ethers";
|
3
|
+
import { ContractAddress } from "@skalenetwork/skale-contracts/lib/domain/types";
|
3
4
|
import { Provider } from "@ethersproject/providers";
|
4
5
|
export declare class Ethers5Adapter implements Adapter<BaseContract> {
|
5
6
|
provider: Provider;
|
@@ -7,5 +8,5 @@ export declare class Ethers5Adapter implements Adapter<BaseContract> {
|
|
7
8
|
createContract(address: string, abi: Abi): ethers.Contract;
|
8
9
|
makeCall(contract: ContractData, targetFunction: FunctionCall): Promise<unknown>;
|
9
10
|
getChainId(): Promise<bigint>;
|
10
|
-
isAddress(value: string):
|
11
|
+
isAddress(value: string): value is ContractAddress;
|
11
12
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ethers5Adapter.js","sourceRoot":"","sources":["../src/ethers5Adapter.ts"],"names":[],"mappings":";;;AAMA,mCAA8C;
|
1
|
+
{"version":3,"file":"ethers5Adapter.js","sourceRoot":"","sources":["../src/ethers5Adapter.ts"],"names":[],"mappings":";;;AAMA,mCAA8C;AAO9C,MAAa,cAAc;IAGvB,YAAa,QAAkB;QAC3B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IAED,cAAc,CAAE,OAAe,EAAE,GAAQ;QACrC,OAAO,IAAI,eAAM,CAAC,QAAQ,CACtB,OAAO,EACP,IAAI,eAAM,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,CAAC,EAC/B,IAAI,CAAC,QAAQ,CACA,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,QAAQ,CACV,QAAsB,EACtB,cAA4B;QAE5B,MAAM,iBAAiB,GAAG,IAAI,eAAM,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACnE,MAAM,CAAC,MAAM,CAAC,GAAG,iBAAiB,CAAC,oBAAoB,CACnD,cAAc,CAAC,YAAY,EAC3B,MAAM,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;YACrB,MAAM,EAAE,iBAAiB,CAAC,kBAAkB,CACxC,cAAc,CAAC,YAAY,EAC3B,cAAc,CAAC,IAAI,CACtB;YACD,IAAI,EAAE,QAAQ,CAAC,OAAO;SACzB,CAAC,CACL,CAAC;QACF,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,UAAU;QACZ,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC;QACrD,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IAED,kDAAkD;IAClD,SAAS,CAAE,KAAa;QACpB,OAAO,eAAM,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;CACJ;AA1CD,wCA0CC"}
|
package/package.json
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
"node": ">=16.0.0"
|
4
4
|
},
|
5
5
|
"devDependencies": {
|
6
|
-
"@types/node": "^
|
6
|
+
"@types/node": "^22.10.2",
|
7
7
|
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
8
|
-
"@typescript-eslint/parser": "^
|
8
|
+
"@typescript-eslint/parser": "^8.15.0",
|
9
9
|
"eslint": "^8.45.0",
|
10
|
-
"typescript": "^5.
|
10
|
+
"typescript": "^5.7.2"
|
11
11
|
},
|
12
12
|
"files": [
|
13
13
|
"lib/**/*"
|
@@ -23,8 +23,8 @@
|
|
23
23
|
},
|
24
24
|
"types": "lib/index.d.ts",
|
25
25
|
"dependencies": {
|
26
|
-
"@skalenetwork/skale-contracts": "1.0.2-develop.
|
26
|
+
"@skalenetwork/skale-contracts": "1.0.2-develop.51",
|
27
27
|
"ethers": "^5.7.2"
|
28
28
|
},
|
29
|
-
"version": "1.0.2-develop.
|
29
|
+
"version": "1.0.2-develop.51"
|
30
30
|
}
|