@aurigami/sdk 1.24.0 → 1.24.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.
Files changed (41) hide show
  1. package/dist/helpers/priceFetcher.js +9 -13
  2. package/package.json +2 -14
  3. package/src/SDK.ts +0 -223
  4. package/src/abis/index.ts +0 -38
  5. package/src/consts/constants.ts +0 -210
  6. package/src/consts/decimals.ts +0 -31
  7. package/src/consts/deployments.ts +0 -4
  8. package/src/consts/dummy.ts +0 -51
  9. package/src/consts/index.ts +0 -5
  10. package/src/consts/symbols.ts +0 -9
  11. package/src/entities/BlockchainEntity.ts +0 -29
  12. package/src/entities/auriEnv.ts +0 -180
  13. package/src/entities/index.ts +0 -4
  14. package/src/entities/token.ts +0 -21
  15. package/src/entities/tokenAmount.ts +0 -48
  16. package/src/helpers/aurigami-api.ts +0 -42
  17. package/src/helpers/aurora-api-helpers.ts +0 -17
  18. package/src/helpers/graphql-helpers.ts +0 -8
  19. package/src/helpers/helpers.ts +0 -212
  20. package/src/helpers/historicalPriceFetcher.ts +0 -200
  21. package/src/helpers/index.ts +0 -7
  22. package/src/helpers/kyber-aggregator-api.ts +0 -37
  23. package/src/helpers/multicall.ts +0 -251
  24. package/src/helpers/notification-api.ts +0 -22
  25. package/src/helpers/one-inch-aggregator-api.ts +0 -45
  26. package/src/helpers/priceFetcher.ts +0 -388
  27. package/src/helpers/subgraphQuery.ts +0 -17
  28. package/src/helpers/transfer-event-query.ts +0 -68
  29. package/src/index.ts +0 -14
  30. package/src/interactors/Airdrop.ts +0 -72
  31. package/src/interactors/MoneyMarket.ts +0 -486
  32. package/src/interactors/Multicall.ts +0 -50
  33. package/src/interactors/Papermill.ts +0 -185
  34. package/src/interactors/PlyGame.ts +0 -172
  35. package/src/interactors/PlyTokenLock.ts +0 -46
  36. package/src/interactors/Pulp.ts +0 -41
  37. package/src/interactors/Referral.ts +0 -214
  38. package/src/interactors/Staking.ts +0 -156
  39. package/src/interactors/index.ts +0 -9
  40. package/src/interactors/misc.ts +0 -433
  41. package/src/types/index.ts +0 -252
@@ -1,252 +0,0 @@
1
- import { AuToken } from '@aurigami/contracts/typechain';
2
- import { TypedEvent } from '@aurigami/contracts/typechain/common';
3
- import type { BlockTag } from '@ethersproject/abstract-provider';
4
- import BigNumber from 'bignumber.js';
5
- import type { Contract, providers, Signer } from 'ethers';
6
- import { BigNumber as BN } from 'ethers';
7
- import { TokenAmount } from '../entities/tokenAmount';
8
-
9
- export enum ComptrollerRewardType {
10
- PLY = 0,
11
- AURORA,
12
- }
13
- export type NetworkConnection = {
14
- provider: providers.Provider;
15
- signer?: Signer;
16
- };
17
-
18
- export type Address = string;
19
-
20
- export type CurrencyAmount = {
21
- currency: string;
22
- amount: string;
23
- };
24
-
25
- export type TokenValuation = {
26
- tokenAmount: TokenAmount;
27
- currencyAmount: CurrencyAmount;
28
- };
29
-
30
- export type MoneyMarketDetails = {
31
- auTokenAddress: string;
32
- totalTokenDeposited: TokenAmount;
33
- totalTokenBorrowed: TokenAmount;
34
- depositApy: number;
35
- depositPlyApy: number;
36
- borrowApy: number;
37
- borrowPlyApy: number;
38
- collateralRatio: number;
39
- depositPlyPerWeek: TokenAmount;
40
- borrowPlyPerWeek: TokenAmount;
41
- depositMETAApy: number;
42
- depositNEARApy: number;
43
- borrowNEARApy: number;
44
- staderDepositApy: number;
45
- };
46
-
47
- export type UserDetails = {
48
- markets: UserMarketDetails[];
49
- borrowLimit: CurrencyAmount;
50
- borrowableAmount: CurrencyAmount;
51
- };
52
-
53
- export type UserLockingDetails = {
54
- vestingStart: number;
55
- /** % of reward they will receive in PLY, if they claim this week */
56
- currentUnlockPortion: number;
57
- //** Amount of PLY rewards that a user has. Equal to currentPly + currentPulp */
58
- accruedPly: TokenAmount;
59
- /** Amount of PLY they will receive, if they claim this week */
60
- currentPly: TokenAmount;
61
- /** Amount of PULP they will receive, if they claim this week */
62
- currentPulp: TokenAmount;
63
- /** % of reward they will receive in PLY, if they claim next week */
64
- nextUnlockPortion: number;
65
- /**
66
- * Amount of PLY they will receive, if they claim next week.
67
- * This doesn't include the additional reward that they will earn
68
- * in the next week.
69
- */
70
- nextPly: TokenAmount;
71
- /**
72
- * Amount of PULP they will receive, if they claim next week.
73
- * This doesn't include the additional reward that they will earn
74
- * in the next week.
75
- */
76
- nextPulp: TokenAmount;
77
- };
78
-
79
- export type UserMarketDetails = {
80
- market: string;
81
- depositBalance: TokenAmount;
82
- borrowBalance: TokenAmount;
83
- isCollateral: boolean;
84
- maxWithdrawableAmount: TokenAmount;
85
- collateralRatio: number;
86
- underlyingPrice: string;
87
- };
88
-
89
- export type TokenAPY = {
90
- address: string;
91
- apy: string;
92
- };
93
-
94
- export type PLYWNEARPoolDetails = {
95
- totalStakedLiquidity: TokenAmount;
96
- APYs: TokenAPY[];
97
- };
98
-
99
- export type MulticallOverrides = {
100
- blockTag?: BlockTag | Promise<BlockTag>;
101
- };
102
-
103
- type ConcatTuple<A extends any[], B extends any[]> = [...A, ...B];
104
-
105
- type RemoveLastOptionalParam<Fn extends (...params: any[]) => any> = Fn extends (
106
- ...params: [...infer Head, any?]
107
- ) => infer R
108
- ? (...params: Head) => R
109
- : Fn;
110
-
111
- type AddParams<Fn extends (...params: any[]) => any, P extends any[]> = Fn extends (
112
- ...params: infer Params
113
- ) => infer R
114
- ? (...params: ConcatTuple<Params, P>) => R
115
- : Fn;
116
-
117
- export type MulticallStatic<T extends Contract> = {
118
- callStatic: {
119
- [P in keyof T['callStatic']]: AddParams<
120
- RemoveLastOptionalParam<T['callStatic'][P]>,
121
- [multicallOverrides?: MulticallOverrides]
122
- >;
123
- };
124
- address: string;
125
- raw: T;
126
- };
127
-
128
- export enum MarketAction {
129
- Deposit = 0,
130
- Borrow,
131
- Withdraw,
132
- Repay,
133
- EnableCollateral,
134
- DisableCollateral,
135
- }
136
-
137
- export type HypotheticalStats = {
138
- newBorrowLimit: CurrencyAmount;
139
- newBorrowUtilization: number;
140
- };
141
-
142
- export type AccountAuTokenInfo = {
143
- token: string;
144
- deposit: BigNumber;
145
- borrow: BigNumber;
146
- };
147
-
148
- export type AccountAuTokensInfo = {
149
- address: string;
150
- tokens: AccountAuTokenInfo[];
151
- };
152
-
153
- export type AuTokenWithUnderlying = MulticallStatic<AuToken> & {
154
- underlying: string;
155
- };
156
-
157
- export type ReferralReward = {
158
- campaign: string;
159
- /**
160
- * Truncated user address.
161
- */
162
- userAddr: string;
163
- /**
164
- * start timetamp of the referral round
165
- */
166
- startTime: number;
167
- /**
168
- * end timetamp of the referral round
169
- */
170
- endTime: number;
171
- /**
172
- * referrer's rewards
173
- */
174
- isReferrer: boolean;
175
- /**
176
- * reward amount
177
- */
178
- rewardTokenAmount: TokenAmount;
179
- /**
180
- * hash of the transaction on aurorascan (if no, return null)
181
- */
182
- transactionHash: string | null;
183
-
184
- refereeAddress: string | null;
185
- };
186
-
187
- export type PlyGameBetResult = {
188
- player: string;
189
- /**
190
- * Bet outcome result
191
- */
192
- outcome: string;
193
- /**
194
- * ply lost amount
195
- */
196
- lostAmount: TokenAmount;
197
- unlockedPulpAmount: TokenAmount;
198
-
199
- block: number;
200
- timestamp: number;
201
- /**
202
- * hash of the transaction on aurorascan (if no, return null)
203
- */
204
- transactionHash: string;
205
- };
206
-
207
- export type PlyGameLeaderboardItem = {
208
- player: string;
209
- gamesPlayed: number;
210
- unlockedPulpAmount: TokenAmount;
211
- };
212
-
213
- export type PlyBetMadeEvent = TypedEvent<
214
- [string, BN, number] & { player: string; amount: BN; outcome: number }
215
- >;
216
-
217
- export type Apy = {
218
- sum: BigNumber;
219
- suppliedValue: BigNumber;
220
- borrowedValue: BigNumber;
221
- };
222
-
223
- export type UserNotification = {
224
- message: string;
225
- userSetting: {
226
- address: Address;
227
- mail: string;
228
- utilisation: number;
229
- liquidation: boolean;
230
- }[];
231
- };
232
-
233
- export type LiquidationEventEntity = {
234
- liquidator: string;
235
- borrower: string;
236
- /** bigint string */
237
- repayAmount: string;
238
- marketRepayToken: string;
239
- /** bigint string */
240
- seizeTokens: string;
241
- auTokenCollateral: string;
242
- txnHash: string;
243
- blockNumber: number;
244
- };
245
-
246
- export type LiquidationDetail = {
247
- liquidationTime: Timestamp;
248
- tokenAmount: TokenAmount;
249
- transactionId: string;
250
- };
251
-
252
- export type Timestamp = number;