@defisaver/positions-sdk 1.0.11-fluid-dev11 → 1.0.11-fluid-dev13

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.
Files changed (104) hide show
  1. package/.mocharc.json +4 -4
  2. package/.nvmrc +1 -1
  3. package/README.md +69 -69
  4. package/cjs/config/contracts.d.ts +113 -53
  5. package/cjs/config/contracts.js +10 -0
  6. package/cjs/contracts.d.ts +1 -0
  7. package/cjs/contracts.js +2 -1
  8. package/cjs/fluid/index.js +80 -28
  9. package/cjs/helpers/fluidHelpers/index.js +21 -2
  10. package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
  11. package/cjs/markets/fluid/index.d.ts +0 -2
  12. package/cjs/markets/fluid/index.js +26 -24
  13. package/cjs/services/priceService.d.ts +2 -0
  14. package/cjs/services/priceService.js +13 -1
  15. package/cjs/types/contracts/generated/BTCPriceFeed.d.ts +135 -0
  16. package/cjs/types/contracts/generated/BTCPriceFeed.js +5 -0
  17. package/cjs/types/contracts/generated/index.d.ts +1 -0
  18. package/cjs/types/fluid.d.ts +4 -0
  19. package/esm/config/contracts.d.ts +113 -53
  20. package/esm/config/contracts.js +10 -0
  21. package/esm/contracts.d.ts +1 -0
  22. package/esm/contracts.js +1 -0
  23. package/esm/fluid/index.js +81 -29
  24. package/esm/helpers/fluidHelpers/index.js +21 -2
  25. package/esm/helpers/morphoBlueHelpers/index.js +66 -66
  26. package/esm/markets/fluid/index.d.ts +0 -2
  27. package/esm/markets/fluid/index.js +24 -21
  28. package/esm/services/priceService.d.ts +2 -0
  29. package/esm/services/priceService.js +11 -1
  30. package/esm/types/contracts/generated/BTCPriceFeed.d.ts +135 -0
  31. package/esm/types/contracts/generated/BTCPriceFeed.js +4 -0
  32. package/esm/types/contracts/generated/index.d.ts +1 -0
  33. package/esm/types/fluid.d.ts +4 -0
  34. package/package.json +54 -54
  35. package/src/aaveV2/index.ts +227 -227
  36. package/src/aaveV3/index.ts +624 -624
  37. package/src/assets/index.ts +60 -60
  38. package/src/chickenBonds/index.ts +123 -123
  39. package/src/compoundV2/index.ts +220 -220
  40. package/src/compoundV3/index.ts +291 -291
  41. package/src/config/contracts.js +1165 -1155
  42. package/src/constants/index.ts +6 -6
  43. package/src/contracts.ts +136 -135
  44. package/src/curveUsd/index.ts +239 -239
  45. package/src/eulerV2/index.ts +303 -303
  46. package/src/exchange/index.ts +17 -17
  47. package/src/fluid/index.ts +1320 -1261
  48. package/src/helpers/aaveHelpers/index.ts +203 -203
  49. package/src/helpers/chickenBondsHelpers/index.ts +23 -23
  50. package/src/helpers/compoundHelpers/index.ts +248 -248
  51. package/src/helpers/curveUsdHelpers/index.ts +40 -40
  52. package/src/helpers/eulerHelpers/index.ts +234 -234
  53. package/src/helpers/fluidHelpers/index.ts +325 -294
  54. package/src/helpers/index.ts +11 -11
  55. package/src/helpers/liquityV2Helpers/index.ts +80 -80
  56. package/src/helpers/llamaLendHelpers/index.ts +53 -53
  57. package/src/helpers/makerHelpers/index.ts +94 -94
  58. package/src/helpers/morphoBlueHelpers/index.ts +367 -367
  59. package/src/helpers/sparkHelpers/index.ts +154 -154
  60. package/src/index.ts +52 -52
  61. package/src/liquity/index.ts +116 -116
  62. package/src/liquityV2/index.ts +295 -295
  63. package/src/llamaLend/index.ts +275 -275
  64. package/src/maker/index.ts +117 -117
  65. package/src/markets/aave/index.ts +152 -152
  66. package/src/markets/aave/marketAssets.ts +46 -46
  67. package/src/markets/compound/index.ts +213 -213
  68. package/src/markets/compound/marketsAssets.ts +82 -82
  69. package/src/markets/curveUsd/index.ts +69 -69
  70. package/src/markets/euler/index.ts +26 -26
  71. package/src/markets/fluid/index.ts +2456 -2454
  72. package/src/markets/index.ts +27 -27
  73. package/src/markets/liquityV2/index.ts +54 -54
  74. package/src/markets/llamaLend/contractAddresses.ts +141 -141
  75. package/src/markets/llamaLend/index.ts +235 -235
  76. package/src/markets/morphoBlue/index.ts +895 -895
  77. package/src/markets/spark/index.ts +29 -29
  78. package/src/markets/spark/marketAssets.ts +10 -10
  79. package/src/moneymarket/moneymarketCommonService.ts +80 -80
  80. package/src/morphoAaveV2/index.ts +256 -256
  81. package/src/morphoAaveV3/index.ts +630 -630
  82. package/src/morphoBlue/index.ts +202 -202
  83. package/src/multicall/index.ts +33 -33
  84. package/src/services/priceService.ts +143 -130
  85. package/src/services/utils.ts +59 -59
  86. package/src/setup.ts +8 -8
  87. package/src/spark/index.ts +460 -460
  88. package/src/staking/staking.ts +217 -217
  89. package/src/types/aave.ts +275 -275
  90. package/src/types/chickenBonds.ts +45 -45
  91. package/src/types/common.ts +84 -84
  92. package/src/types/compound.ts +133 -133
  93. package/src/types/contracts/generated/BTCPriceFeed.ts +202 -0
  94. package/src/types/contracts/generated/index.ts +1 -0
  95. package/src/types/curveUsd.ts +119 -119
  96. package/src/types/euler.ts +173 -173
  97. package/src/types/fluid.ts +330 -325
  98. package/src/types/index.ts +11 -11
  99. package/src/types/liquity.ts +30 -30
  100. package/src/types/liquityV2.ts +119 -119
  101. package/src/types/llamaLend.ts +155 -155
  102. package/src/types/maker.ts +50 -50
  103. package/src/types/morphoBlue.ts +194 -194
  104. package/src/types/spark.ts +135 -135
@@ -0,0 +1,135 @@
1
+ /// <reference types="node" />
2
+ import type BN from "bn.js";
3
+ import type { ContractOptions } from "web3-eth-contract";
4
+ import type { EventLog } from "web3-core";
5
+ import type { EventEmitter } from "events";
6
+ import type { Callback, NonPayableTransactionObject, BlockType, ContractEventLog, BaseContract } from "./types";
7
+ export interface EventOptions {
8
+ filter?: object;
9
+ fromBlock?: BlockType;
10
+ topics?: string[];
11
+ }
12
+ export type AnswerUpdated = ContractEventLog<{
13
+ current: string;
14
+ roundId: string;
15
+ updatedAt: string;
16
+ 0: string;
17
+ 1: string;
18
+ 2: string;
19
+ }>;
20
+ export type NewRound = ContractEventLog<{
21
+ roundId: string;
22
+ startedBy: string;
23
+ startedAt: string;
24
+ 0: string;
25
+ 1: string;
26
+ 2: string;
27
+ }>;
28
+ export type OwnershipTransferRequested = ContractEventLog<{
29
+ from: string;
30
+ to: string;
31
+ 0: string;
32
+ 1: string;
33
+ }>;
34
+ export type OwnershipTransferred = ContractEventLog<{
35
+ from: string;
36
+ to: string;
37
+ 0: string;
38
+ 1: string;
39
+ }>;
40
+ export interface BTCPriceFeed extends BaseContract {
41
+ constructor(jsonInterface: any[], address?: string, options?: ContractOptions): BTCPriceFeed;
42
+ clone(): BTCPriceFeed;
43
+ methods: {
44
+ acceptOwnership(): NonPayableTransactionObject<void>;
45
+ accessController(): NonPayableTransactionObject<string>;
46
+ aggregator(): NonPayableTransactionObject<string>;
47
+ confirmAggregator(_aggregator: string): NonPayableTransactionObject<void>;
48
+ decimals(): NonPayableTransactionObject<string>;
49
+ description(): NonPayableTransactionObject<string>;
50
+ getAnswer(_roundId: number | string | BN): NonPayableTransactionObject<string>;
51
+ getRoundData(_roundId: number | string | BN): NonPayableTransactionObject<[
52
+ string,
53
+ string,
54
+ string,
55
+ string,
56
+ string
57
+ ] & {
58
+ roundId: string;
59
+ answer: string;
60
+ startedAt: string;
61
+ updatedAt: string;
62
+ answeredInRound: string;
63
+ }>;
64
+ getTimestamp(_roundId: number | string | BN): NonPayableTransactionObject<string>;
65
+ latestAnswer(): NonPayableTransactionObject<string>;
66
+ latestRound(): NonPayableTransactionObject<string>;
67
+ latestRoundData(): NonPayableTransactionObject<[
68
+ string,
69
+ string,
70
+ string,
71
+ string,
72
+ string
73
+ ] & {
74
+ roundId: string;
75
+ answer: string;
76
+ startedAt: string;
77
+ updatedAt: string;
78
+ answeredInRound: string;
79
+ }>;
80
+ latestTimestamp(): NonPayableTransactionObject<string>;
81
+ owner(): NonPayableTransactionObject<string>;
82
+ phaseAggregators(arg0: number | string | BN): NonPayableTransactionObject<string>;
83
+ phaseId(): NonPayableTransactionObject<string>;
84
+ proposeAggregator(_aggregator: string): NonPayableTransactionObject<void>;
85
+ proposedAggregator(): NonPayableTransactionObject<string>;
86
+ proposedGetRoundData(_roundId: number | string | BN): NonPayableTransactionObject<[
87
+ string,
88
+ string,
89
+ string,
90
+ string,
91
+ string
92
+ ] & {
93
+ roundId: string;
94
+ answer: string;
95
+ startedAt: string;
96
+ updatedAt: string;
97
+ answeredInRound: string;
98
+ }>;
99
+ proposedLatestRoundData(): NonPayableTransactionObject<[
100
+ string,
101
+ string,
102
+ string,
103
+ string,
104
+ string
105
+ ] & {
106
+ roundId: string;
107
+ answer: string;
108
+ startedAt: string;
109
+ updatedAt: string;
110
+ answeredInRound: string;
111
+ }>;
112
+ setController(_accessController: string): NonPayableTransactionObject<void>;
113
+ transferOwnership(_to: string): NonPayableTransactionObject<void>;
114
+ version(): NonPayableTransactionObject<string>;
115
+ };
116
+ events: {
117
+ AnswerUpdated(cb?: Callback<AnswerUpdated>): EventEmitter;
118
+ AnswerUpdated(options?: EventOptions, cb?: Callback<AnswerUpdated>): EventEmitter;
119
+ NewRound(cb?: Callback<NewRound>): EventEmitter;
120
+ NewRound(options?: EventOptions, cb?: Callback<NewRound>): EventEmitter;
121
+ OwnershipTransferRequested(cb?: Callback<OwnershipTransferRequested>): EventEmitter;
122
+ OwnershipTransferRequested(options?: EventOptions, cb?: Callback<OwnershipTransferRequested>): EventEmitter;
123
+ OwnershipTransferred(cb?: Callback<OwnershipTransferred>): EventEmitter;
124
+ OwnershipTransferred(options?: EventOptions, cb?: Callback<OwnershipTransferred>): EventEmitter;
125
+ allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
126
+ };
127
+ once(event: "AnswerUpdated", cb: Callback<AnswerUpdated>): void;
128
+ once(event: "AnswerUpdated", options: EventOptions, cb: Callback<AnswerUpdated>): void;
129
+ once(event: "NewRound", cb: Callback<NewRound>): void;
130
+ once(event: "NewRound", options: EventOptions, cb: Callback<NewRound>): void;
131
+ once(event: "OwnershipTransferRequested", cb: Callback<OwnershipTransferRequested>): void;
132
+ once(event: "OwnershipTransferRequested", options: EventOptions, cb: Callback<OwnershipTransferRequested>): void;
133
+ once(event: "OwnershipTransferred", cb: Callback<OwnershipTransferred>): void;
134
+ once(event: "OwnershipTransferred", options: EventOptions, cb: Callback<OwnershipTransferred>): void;
135
+ }
@@ -0,0 +1,4 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ export {};
@@ -12,6 +12,7 @@ export type { AaveV3LidoProtocolDataProvider } from "./AaveV3LidoProtocolDataPro
12
12
  export type { AaveV3PoolAddressesProvider } from "./AaveV3PoolAddressesProvider";
13
13
  export type { AaveV3ProtocolDataProvider } from "./AaveV3ProtocolDataProvider";
14
14
  export type { AaveV3View } from "./AaveV3View";
15
+ export type { BTCPriceFeed } from "./BTCPriceFeed";
15
16
  export type { BalanceScanner } from "./BalanceScanner";
16
17
  export type { COMPPriceFeed } from "./COMPPriceFeed";
17
18
  export type { CbEth } from "./CbEth";
@@ -241,6 +241,8 @@ export interface InnerFluidMarketData {
241
241
  borrowRate: string;
242
242
  liquidationMaxLimit: string;
243
243
  oraclePrice: string;
244
+ incentiveBorrowRate?: string;
245
+ incentiveSupplyRate?: string;
244
246
  collSharePrice?: string;
245
247
  maxSupplyShares?: string;
246
248
  maxSupplySharesUsd?: string;
@@ -259,6 +261,8 @@ export interface InnerFluidMarketData {
259
261
  totalBorrowToken0?: string;
260
262
  totalBorrowToken1?: string;
261
263
  borrowDexFee?: string;
264
+ tradingBorrowRate?: string;
265
+ tradingSupplyRate?: string;
262
266
  }
263
267
  export interface FluidMarketData {
264
268
  assetsData: FluidAssetsData;
package/package.json CHANGED
@@ -1,54 +1,54 @@
1
- {
2
- "name": "@defisaver/positions-sdk",
3
- "version": "1.0.11-fluid-dev11",
4
- "description": "",
5
- "main": "./cjs/index.js",
6
- "module": "./esm/index.js",
7
- "types": "./esm/index.d.ts",
8
- "scripts": {
9
- "build:esm": "rm -rf esm && tsc -p tsconfig.esm.json",
10
- "build:cjs": "rm -rf cjs && tsc -p tsconfig.cjs.json",
11
- "build": "npm run lint && npm run generate-contracts && npm run build:cjs && npm run build:esm",
12
- "dev": "npm run generate-contracts && tsc -p tsconfig.json --watch",
13
- "lint": "eslint src/ --fix",
14
- "lint-check": "eslint src/",
15
- "generate-contracts": "node scripts/generateContracts.js",
16
- "test": "mocha tests/*",
17
- "test-single": "mocha ./tests/$npm_config_name.ts",
18
- "test:debugger": "mocha --inspect-brk tests/*",
19
- "build-test": "npm run build && npm run test",
20
- "version-bump": "git commit -am \"Version bump to $(npm version patch | cut -c 2-)\""
21
- },
22
- "keywords": [],
23
- "author": "",
24
- "license": "ISC",
25
- "dependencies": {
26
- "@defisaver/tokens": "^1.6.2",
27
- "@ethersproject/bignumber": "^5.7.0",
28
- "@morpho-org/morpho-aave-v3-sdk": "^1.5.3",
29
- "@types/lodash": "^4.17.15",
30
- "@types/memoizee": "^0.4.12",
31
- "decimal.js": "^10.4.3",
32
- "lodash": "^4.17.21",
33
- "memoizee": "^0.4.17"
34
- },
35
- "devDependencies": {
36
- "@defisaver/eslint-config": "^1.0.1",
37
- "@types/chai": "^5.0.0",
38
- "@types/mocha": "^10.0.9",
39
- "@types/web3": "^1.0.20",
40
- "chai": "^4.3.8",
41
- "dotenv": "^16.3.1",
42
- "eslint": "^8.49.0",
43
- "eslint-plugin-import": "^2.31.0",
44
- "mocha": "^10.2.0",
45
- "nock": "^14.0.0",
46
- "ts-node": "^10.9.2",
47
- "typechain": "^8.3.1",
48
- "typechain-target-web3-v1-3mihai3": "^6.0.2",
49
- "typescript": "^5.2.2"
50
- },
51
- "peerDependencies": {
52
- "web3": "^1.10.2"
53
- }
54
- }
1
+ {
2
+ "name": "@defisaver/positions-sdk",
3
+ "version": "1.0.11-fluid-dev13",
4
+ "description": "",
5
+ "main": "./cjs/index.js",
6
+ "module": "./esm/index.js",
7
+ "types": "./esm/index.d.ts",
8
+ "scripts": {
9
+ "build:esm": "rm -rf esm && tsc -p tsconfig.esm.json",
10
+ "build:cjs": "rm -rf cjs && tsc -p tsconfig.cjs.json",
11
+ "build": "npm run lint && npm run generate-contracts && npm run build:cjs && npm run build:esm",
12
+ "dev": "npm run generate-contracts && tsc -p tsconfig.json --watch",
13
+ "lint": "eslint src/ --fix",
14
+ "lint-check": "eslint src/",
15
+ "generate-contracts": "node scripts/generateContracts.js",
16
+ "test": "mocha tests/*",
17
+ "test-single": "mocha ./tests/$npm_config_name.ts",
18
+ "test:debugger": "mocha --inspect-brk tests/*",
19
+ "build-test": "npm run build && npm run test",
20
+ "version-bump": "git commit -am \"Version bump to $(npm version patch | cut -c 2-)\""
21
+ },
22
+ "keywords": [],
23
+ "author": "",
24
+ "license": "ISC",
25
+ "dependencies": {
26
+ "@defisaver/tokens": "^1.6.6",
27
+ "@ethersproject/bignumber": "^5.7.0",
28
+ "@morpho-org/morpho-aave-v3-sdk": "^1.5.3",
29
+ "@types/lodash": "^4.17.15",
30
+ "@types/memoizee": "^0.4.12",
31
+ "decimal.js": "^10.4.3",
32
+ "lodash": "^4.17.21",
33
+ "memoizee": "^0.4.17"
34
+ },
35
+ "devDependencies": {
36
+ "@defisaver/eslint-config": "^1.0.1",
37
+ "@types/chai": "^5.0.0",
38
+ "@types/mocha": "^10.0.9",
39
+ "@types/web3": "^1.0.20",
40
+ "chai": "^4.3.8",
41
+ "dotenv": "^16.3.1",
42
+ "eslint": "^8.49.0",
43
+ "eslint-plugin-import": "^2.31.0",
44
+ "mocha": "^10.2.0",
45
+ "nock": "^14.0.0",
46
+ "ts-node": "^10.9.2",
47
+ "typechain": "^8.3.1",
48
+ "typechain-target-web3-v1-3mihai3": "^6.0.2",
49
+ "typescript": "^5.2.2"
50
+ },
51
+ "peerDependencies": {
52
+ "web3": "^1.10.2"
53
+ }
54
+ }