@mento-protocol/mento-sdk 2.0.0-beta.11 → 2.0.0-beta.13
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.
|
@@ -2,7 +2,6 @@ import { ProviderAdapter, StableToken } from '../types';
|
|
|
2
2
|
export declare class StableTokenService {
|
|
3
3
|
private provider;
|
|
4
4
|
private tokenMetadataService;
|
|
5
|
-
private supplyAdjustmentService;
|
|
6
5
|
constructor(provider: ProviderAdapter);
|
|
7
6
|
getStableTokens(): Promise<StableToken[]>;
|
|
8
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stableTokenService.d.ts","sourceRoot":"","sources":["../../src/services/stableTokenService.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"stableTokenService.d.ts","sourceRoot":"","sources":["../../src/services/stableTokenService.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AAGvD,qBAAa,kBAAkB;IAGjB,OAAO,CAAC,QAAQ;IAF5B,OAAO,CAAC,oBAAoB,CAAsB;gBAE9B,QAAQ,EAAE,eAAe;IAIvC,eAAe,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;CA2BhD"}
|
|
@@ -3,14 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.StableTokenService = void 0;
|
|
4
4
|
const abis_1 = require("../abis");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
|
-
const supply_1 = require("./supply");
|
|
7
|
-
const supplyAdjustmentService_1 = require("./supplyAdjustmentService");
|
|
8
6
|
const tokenMetadataService_1 = require("./tokenMetadataService");
|
|
9
7
|
class StableTokenService {
|
|
10
8
|
constructor(provider) {
|
|
11
9
|
this.provider = provider;
|
|
12
10
|
this.tokenMetadataService = new tokenMetadataService_1.TokenMetadataService(provider);
|
|
13
|
-
this.supplyAdjustmentService = new supplyAdjustmentService_1.SupplyAdjustmentService(provider, new supply_1.DefaultCalculatorFactory());
|
|
14
11
|
}
|
|
15
12
|
async getStableTokens() {
|
|
16
13
|
const chainId = await this.provider.getChainId();
|
|
@@ -24,14 +21,11 @@ class StableTokenService {
|
|
|
24
21
|
for (const address of tokenAddresses) {
|
|
25
22
|
const metadata = await this.tokenMetadataService.getTokenMetadata(address);
|
|
26
23
|
const totalSupply = await this.tokenMetadataService.getTotalSupply(address);
|
|
27
|
-
|
|
24
|
+
tokens.push({
|
|
28
25
|
address,
|
|
29
26
|
...metadata,
|
|
30
27
|
totalSupply,
|
|
31
|
-
};
|
|
32
|
-
const adjustedSupply = await this.supplyAdjustmentService.getAdjustedSupply(token);
|
|
33
|
-
token.totalSupply = adjustedSupply;
|
|
34
|
-
tokens.push(token);
|
|
28
|
+
});
|
|
35
29
|
}
|
|
36
30
|
return tokens;
|
|
37
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stableTokenService.js","sourceRoot":"","sources":["../../src/services/stableTokenService.ts"],"names":[],"mappings":";;;AAAA,kCAAqC;AACrC,4CAA0D;AAE1D,
|
|
1
|
+
{"version":3,"file":"stableTokenService.js","sourceRoot":"","sources":["../../src/services/stableTokenService.ts"],"names":[],"mappings":";;;AAAA,kCAAqC;AACrC,4CAA0D;AAE1D,iEAA6D;AAE7D,MAAa,kBAAkB;IAG7B,YAAoB,QAAyB;QAAzB,aAAQ,GAAR,QAAQ,CAAiB;QAC3C,IAAI,CAAC,oBAAoB,GAAG,IAAI,2CAAoB,CAAC,QAAQ,CAAC,CAAA;IAChE,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAA;QAChD,MAAM,cAAc,GAAG,IAAA,8BAAkB,EAAC,OAAO,EAAE,mBAAO,CAAC,CAAA;QAE3D,MAAM,cAAc,GAAG,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC;YACvD,OAAO,EAAE,cAAc;YACvB,GAAG,EAAE,kBAAW;YAChB,YAAY,EAAE,WAAW;SAC1B,CAAC,CAAa,CAAA;QAEf,MAAM,MAAM,GAAkB,EAAE,CAAA;QAEhC,KAAK,MAAM,OAAO,IAAI,cAAc,EAAE,CAAC;YACrC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAA;YAC1E,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,cAAc,CAChE,OAAO,CACR,CAAA;YAED,MAAM,CAAC,IAAI,CAAC;gBACV,OAAO;gBACP,GAAG,QAAQ;gBACX,WAAW;aACZ,CAAC,CAAA;QACJ,CAAC;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAlCD,gDAkCC"}
|
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": "2.0.0-beta.
|
|
4
|
+
"version": "2.0.0-beta.13",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Mento Labs",
|
|
7
7
|
"keywords": [
|
|
@@ -20,14 +20,6 @@
|
|
|
20
20
|
"!dist/**/*.test.*"
|
|
21
21
|
],
|
|
22
22
|
"type": "commonjs",
|
|
23
|
-
"scripts": {
|
|
24
|
-
"build": "pnpm clean && tsc --project ./tsconfig.json",
|
|
25
|
-
"clean": "rm -rf ./dist",
|
|
26
|
-
"lint": "eslint --config ./.eslintrc.json src/**/*.ts",
|
|
27
|
-
"prettier": "prettier --config ./.prettierrc.json --write **/*.{json,md,js,ts,yml}",
|
|
28
|
-
"test": "jest --verbose",
|
|
29
|
-
"coverage": "jest --coverage"
|
|
30
|
-
},
|
|
31
23
|
"engines": {
|
|
32
24
|
"node": ">=18",
|
|
33
25
|
"pnpm": ">=9"
|
|
@@ -69,5 +61,13 @@
|
|
|
69
61
|
"@mento-protocol/mento-core-ts": "^0.2.0",
|
|
70
62
|
"bignumber.js": "^9.1.2",
|
|
71
63
|
"dotenv": "^16.4.5"
|
|
64
|
+
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"build": "pnpm clean && tsc --project ./tsconfig.json",
|
|
67
|
+
"clean": "rm -rf ./dist",
|
|
68
|
+
"lint": "eslint --config ./.eslintrc.json src/**/*.ts",
|
|
69
|
+
"prettier": "prettier --config ./.prettierrc.json --write **/*.{json,md,js,ts,yml}",
|
|
70
|
+
"test": "jest --verbose",
|
|
71
|
+
"coverage": "jest --coverage"
|
|
72
72
|
}
|
|
73
|
-
}
|
|
73
|
+
}
|