@stabilitydao/stability 0.5.0 → 0.6.1
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.
- package/README.md +11 -0
- package/out/api.types.d.ts +93 -0
- package/out/api.types.d.ts.map +1 -0
- package/out/api.types.js +3 -0
- package/out/api.types.js.map +1 -0
- package/out/index.d.ts +6 -3
- package/out/index.d.ts.map +1 -1
- package/out/index.js +11 -1
- package/out/index.js.map +1 -1
- package/out/subgraphs.d.ts +4 -0
- package/out/subgraphs.d.ts.map +1 -0
- package/out/subgraphs.js +8 -0
- package/out/subgraphs.js.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/gh/stabilitydao%2Fstability)
|
|
4
4
|
[](https://badge.fury.io/js/@stabilitydao%2Fstability)
|
|
5
|
+
[](https://codecov.io/github/stabilitydao/stability)
|
|
5
6
|
|
|
6
7
|
This is library for integrating the platform into Node.js applications.
|
|
7
8
|
|
|
@@ -47,6 +48,16 @@ DeFi organizations, protocols, their integration statuses, usage and other infor
|
|
|
47
48
|
|
|
48
49
|
`stability.tokenlist.json`
|
|
49
50
|
|
|
51
|
+
### API types
|
|
52
|
+
|
|
53
|
+
```typescript
|
|
54
|
+
import type {ApiMainReply, ApiAggSwapData} from '@stabilitydao/stability'
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Subgraphs
|
|
58
|
+
|
|
59
|
+
The Graph API query URLs for supported networks.
|
|
60
|
+
|
|
50
61
|
## Develop
|
|
51
62
|
|
|
52
63
|
```shell
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export type ApiMainReply = {
|
|
2
|
+
title: string;
|
|
3
|
+
about: string;
|
|
4
|
+
status: string;
|
|
5
|
+
services: string[];
|
|
6
|
+
vaults: Vaults;
|
|
7
|
+
underlyings: Underlyings;
|
|
8
|
+
assetPrices: AssetPrices;
|
|
9
|
+
error?: string;
|
|
10
|
+
};
|
|
11
|
+
export type ApiAggSwapData = {
|
|
12
|
+
router: string;
|
|
13
|
+
src: string;
|
|
14
|
+
dst: string;
|
|
15
|
+
amountIn: string;
|
|
16
|
+
amountOut: string;
|
|
17
|
+
txData: string;
|
|
18
|
+
};
|
|
19
|
+
export type Underlyings = {
|
|
20
|
+
[chainId: number]: {
|
|
21
|
+
[addr: string]: Underlying;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export type Underlying = {
|
|
25
|
+
address: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
apr: {
|
|
28
|
+
daily?: number;
|
|
29
|
+
monthly?: number;
|
|
30
|
+
allTime?: number;
|
|
31
|
+
status?: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export type Vaults = {
|
|
35
|
+
[chainId: number]: {
|
|
36
|
+
[addrLowerCase: string]: Vault;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export type Vault = {
|
|
40
|
+
address: string;
|
|
41
|
+
name: string;
|
|
42
|
+
symbol: string;
|
|
43
|
+
strategyId: string;
|
|
44
|
+
strategyShortId: string;
|
|
45
|
+
sharePrice: string;
|
|
46
|
+
tvl: string;
|
|
47
|
+
strategy?: `0x${string}`;
|
|
48
|
+
underlying?: `0x${string}`;
|
|
49
|
+
lastHardWork?: number;
|
|
50
|
+
status?: string;
|
|
51
|
+
strategySpecific?: string;
|
|
52
|
+
strategyDescription?: string;
|
|
53
|
+
pool?: {
|
|
54
|
+
address: string;
|
|
55
|
+
ammName?: string;
|
|
56
|
+
ammAlgoName?: string;
|
|
57
|
+
tvl?: number;
|
|
58
|
+
amountToken0?: number;
|
|
59
|
+
amountToken1?: number;
|
|
60
|
+
fee?: number;
|
|
61
|
+
tick?: number;
|
|
62
|
+
};
|
|
63
|
+
alm?: {
|
|
64
|
+
protocol: string;
|
|
65
|
+
tvl: number;
|
|
66
|
+
amountToken0: number;
|
|
67
|
+
amountToken1: number;
|
|
68
|
+
positions: {
|
|
69
|
+
tvl: number;
|
|
70
|
+
amountToken0: number;
|
|
71
|
+
amountToken1: number;
|
|
72
|
+
lowerTick: number;
|
|
73
|
+
upperTick: number;
|
|
74
|
+
inRange: boolean;
|
|
75
|
+
}[];
|
|
76
|
+
};
|
|
77
|
+
risk?: Risk;
|
|
78
|
+
};
|
|
79
|
+
export type Risk = {
|
|
80
|
+
symbol: string;
|
|
81
|
+
isRektStrategy?: string;
|
|
82
|
+
factors: string[];
|
|
83
|
+
};
|
|
84
|
+
export type AssetPrices = {
|
|
85
|
+
[chainId: number]: {
|
|
86
|
+
[addr: string]: AssetPriceUsd;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
export type AssetPriceUsd = {
|
|
90
|
+
price: string;
|
|
91
|
+
trusted: boolean;
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=api.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.types.d.ts","sourceRoot":"","sources":["../src/api.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,WAAW,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,OAAO,EAAE,MAAM,GAAG;QAC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AM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,GAAG,CAAC,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAC;QACjB,GAAG,EAAE,MAAM,CAAC;QACZ,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE;YACT,GAAG,EAAE,MAAM,CAAC;YACZ,YAAY,EAAE,MAAM,CAAC;YACrB,YAAY,EAAE,MAAM,CAAC;YACrB,SAAS,EAAE,MAAM,CAAC;YAClB,SAAS,EAAE,MAAM,CAAC;YAClB,OAAO,EAAE,OAAO,CAAC;SAClB,EAAE,CAAC;KACL,CAAC;IACF,IAAI,CAAC,EAAE,IAAI,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,IAAI,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,OAAO,EAAE,MAAM,GAAG;QACjB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAAC;KAC/B,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC"}
|
package/out/api.types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.types.js","sourceRoot":"","sources":["../src/api.types.ts"],"names":[],"mappings":""}
|
package/out/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { deployments, CoreContracts } from "./deployments";
|
|
2
2
|
import { networks, NetworkId, Network } from "./networks";
|
|
3
|
-
import { strategies, StrategyShortId, StrategyState, Strategy } from "./strategies";
|
|
4
|
-
import { integrations, DefiCategory, DeFiOrganization, DeFiProtocol, IntegrationStatus } from "./integrations";
|
|
5
|
-
|
|
3
|
+
import { strategies, StrategyShortId, StrategyState, Strategy, getMerklStrategies, getStrategyShortId } from "./strategies";
|
|
4
|
+
import { integrations, DefiCategory, DeFiOrganization, DeFiProtocol, IntegrationStatus, getIntegrationStatus } from "./integrations";
|
|
5
|
+
import { subgraphs } from "./subgraphs";
|
|
6
|
+
import type { ApiMainReply, ApiAggSwapData } from "./api.types";
|
|
7
|
+
import tokenlist from "./stability.tokenlist.json";
|
|
8
|
+
export { deployments, networks, strategies, integrations, subgraphs, CoreContracts, Network, NetworkId, Strategy, StrategyShortId, StrategyState, DefiCategory, DeFiOrganization, DeFiProtocol, IntegrationStatus, ApiMainReply, ApiAggSwapData, tokenlist, getMerklStrategies, getStrategyShortId, getIntegrationStatus, };
|
|
6
9
|
//# sourceMappingURL=index.d.ts.map
|
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AACzD,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAC,MAAM,YAAY,CAAC;AACxD,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,aAAa,EAAC,MAAM,eAAe,CAAC;AACzD,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAC,MAAM,YAAY,CAAC;AACxD,OAAO,EACL,UAAU,EACV,eAAe,EACf,aAAa,EACb,QAAQ,EACR,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,KAAK,EAAC,YAAY,EAAE,cAAc,EAAC,MAAM,aAAa,CAAA;AAC7D,OAAO,SAAS,MAAM,4BAA4B,CAAA;AAElD,OAAO,EACL,WAAW,EACX,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,SAAS,EACT,aAAa,EACb,OAAO,EACP,SAAS,EACT,QAAQ,EACR,eAAe,EACf,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,GACrB,CAAA"}
|
package/out/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DefiCategory = exports.StrategyState = exports.integrations = exports.strategies = exports.networks = exports.deployments = void 0;
|
|
6
|
+
exports.getIntegrationStatus = exports.getStrategyShortId = exports.getMerklStrategies = exports.tokenlist = exports.DefiCategory = exports.StrategyState = exports.subgraphs = exports.integrations = exports.strategies = exports.networks = exports.deployments = void 0;
|
|
4
7
|
const deployments_1 = require("./deployments");
|
|
5
8
|
Object.defineProperty(exports, "deployments", { enumerable: true, get: function () { return deployments_1.deployments; } });
|
|
6
9
|
const networks_1 = require("./networks");
|
|
@@ -8,7 +11,14 @@ Object.defineProperty(exports, "networks", { enumerable: true, get: function ()
|
|
|
8
11
|
const strategies_1 = require("./strategies");
|
|
9
12
|
Object.defineProperty(exports, "strategies", { enumerable: true, get: function () { return strategies_1.strategies; } });
|
|
10
13
|
Object.defineProperty(exports, "StrategyState", { enumerable: true, get: function () { return strategies_1.StrategyState; } });
|
|
14
|
+
Object.defineProperty(exports, "getMerklStrategies", { enumerable: true, get: function () { return strategies_1.getMerklStrategies; } });
|
|
15
|
+
Object.defineProperty(exports, "getStrategyShortId", { enumerable: true, get: function () { return strategies_1.getStrategyShortId; } });
|
|
11
16
|
const integrations_1 = require("./integrations");
|
|
12
17
|
Object.defineProperty(exports, "integrations", { enumerable: true, get: function () { return integrations_1.integrations; } });
|
|
13
18
|
Object.defineProperty(exports, "DefiCategory", { enumerable: true, get: function () { return integrations_1.DefiCategory; } });
|
|
19
|
+
Object.defineProperty(exports, "getIntegrationStatus", { enumerable: true, get: function () { return integrations_1.getIntegrationStatus; } });
|
|
20
|
+
const subgraphs_1 = require("./subgraphs");
|
|
21
|
+
Object.defineProperty(exports, "subgraphs", { enumerable: true, get: function () { return subgraphs_1.subgraphs; } });
|
|
22
|
+
const stability_tokenlist_json_1 = __importDefault(require("./stability.tokenlist.json"));
|
|
23
|
+
exports.tokenlist = stability_tokenlist_json_1.default;
|
|
14
24
|
//# sourceMappingURL=index.js.map
|
package/out/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAyD;AAuBvD,4FAvBM,yBAAW,OAuBN;AAtBb,yCAAwD;AAuBtD,yFAvBM,mBAAQ,OAuBN;AAtBV,6CAOsB;AAgBpB,2FAtBA,uBAAU,OAsBA;AAQV,8FA5BA,0BAAa,OA4BA;AAQb,mGAlCA,+BAAkB,OAkCA;AAClB,mGAlCA,+BAAkB,OAkCA;AAhCpB,iDAOwB;AAStB,6FAfA,2BAAY,OAeA;AAQZ,6FAtBA,2BAAY,OAsBA;AASZ,qGA3BA,mCAAoB,OA2BA;AAzBtB,2CAAsC;AASpC,0FATM,qBAAS,OASN;AAPX,0FAAkD;AAoBhD,oBApBK,kCAAS,CAoBL"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subgraphs.d.ts","sourceRoot":"","sources":["../src/subgraphs.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,EAAG;IAAC,CAAC,OAAO,EAAC,MAAM,GAAE,MAAM,CAAA;CAGhD,CAAA"}
|
package/out/subgraphs.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.subgraphs = void 0;
|
|
4
|
+
exports.subgraphs = {
|
|
5
|
+
"137": "https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/7WgM7jRzoW7yiJCE8DMEwCxtN3KLisYrVVShuAL2Kz4N",
|
|
6
|
+
"8453": "https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/8uU5LrpCLCP1P31GBCUXu8AdWKQ2aW6mKTKsr2ssUdJS",
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=subgraphs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subgraphs.js","sourceRoot":"","sources":["../src/subgraphs.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAA+B;IACnD,KAAK,EAAE,uHAAuH;IAC9H,MAAM,EAAE,uHAAuH;CAChI,CAAA"}
|