@mento-protocol/mento-sdk 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,7 @@ export type ContractAddresses = {
6
6
  MentoToken: string;
7
7
  TimelockController: string;
8
8
  Locking: string;
9
+ MentoRouter: string;
9
10
  Broker: string;
10
11
  BiPoolManager: string;
11
12
  BreakerBox: string;
@@ -1,5 +1,11 @@
1
1
  import { BigNumberish, providers, Signer } from 'ethers';
2
2
  import { Address } from './interfaces';
3
+ /**
4
+ * Gets the chain ID from a signer or provider
5
+ * @param signerOrProvider an ethers provider or signer
6
+ * @returns the chain ID
7
+ */
8
+ export declare function getChainId(signerOrProvider: Signer | providers.Provider): Promise<number>;
3
9
  /**
4
10
  * Ensures that given signer is truly a a connected signer
5
11
  * @param signer an ethers signer
package/dist/esm/utils.js CHANGED
@@ -8,6 +8,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { constants, Contract, providers, Signer } from 'ethers';
11
+ /**
12
+ * Gets the chain ID from a signer or provider
13
+ * @param signerOrProvider an ethers provider or signer
14
+ * @returns the chain ID
15
+ */
16
+ export function getChainId(signerOrProvider) {
17
+ return __awaiter(this, void 0, void 0, function* () {
18
+ const provider = Signer.isSigner(signerOrProvider)
19
+ ? signerOrProvider.provider
20
+ : signerOrProvider;
21
+ return (yield provider.getNetwork()).chainId;
22
+ });
23
+ }
11
24
  /**
12
25
  * Ensures that given signer is truly a a connected signer
13
26
  * @param signer an ethers signer
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mento-protocol/mento-sdk",
3
3
  "description": "Official SDK for interacting with the Mento Protocol",
4
- "version": "1.0.1",
4
+ "version": "1.0.2",
5
5
  "license": "MIT",
6
6
  "author": "Mento Labs",
7
7
  "keywords": [
@@ -77,7 +77,8 @@
77
77
  "typescript": "^4.9.5"
78
78
  },
79
79
  "dependencies": {
80
- "@mento-protocol/mento-core-ts": "^0.2.0"
80
+ "@mento-protocol/mento-core-ts": "^0.2.0",
81
+ "mento-router-ts": "^0.2.0"
81
82
  },
82
83
  "peerDependencies": {
83
84
  "ethers": "^5.7"