@aurigami/sdk 1.20.6 → 1.20.7

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/ChangeLog.md ADDED
@@ -0,0 +1,384 @@
1
+ # Change Logs
2
+ # 1.15.0:
3
+ - `SDKRead(...).setUserNotificationSettings(address: string, mail: string, utilisation: number, liquidation: boolean, captchaResponse: string)`:
4
+ - utilisation in range (0..1)
5
+ - `SDKRead(...).unsetUserNotificationSettings(address: string, captchaResponse: string)` use this to unsubscribe for notification
6
+
7
+ # 1.14.0:
8
+ - Fix cache bug
9
+ - Remove `stNEAR` in `DEPOSIT_ONLY_TOKENS` (this is for monitoring bot)
10
+ # 1.13.1
11
+ - Add `PlyGameRead(...).overallLeaderboard(): Promise<PlyGameLeaderboardItem[]>`: overall ranking of the top 50 users by amount of PULP unlocked
12
+
13
+ # 1.13.0
14
+ - Add `SdkRead(...).getNetApyWithIncentive` and `getNetApyWithoutIncentive`.
15
+
16
+ # 1.12.8:
17
+
18
+ - Add `mintCap(): Promise<TokenAmount>` return the mint cap of the autoken
19
+ - Add `borrowCap(): Promise<TokenAmount>)` return the borrow cap of the autoken
20
+
21
+ # 1.12.7:
22
+
23
+ - Add `(...).queuePosition(address: Address): Promise<number>` return the position of the address in referral queue. -1 if not in queue,
24
+ 999 if not in top 600.
25
+ - `slotsInUse()` now will not accept any param, and return the total slots in total.
26
+
27
+ ## 1.12.6:
28
+
29
+ - Remove `getJackpotResult`, use `getLastJackpotResult` instead.
30
+ - Hide winner address in jackpot result.
31
+
32
+ ## 1.12.3
33
+
34
+ - Add `PlyGameRead(...).getJackpotResult(round:number): Promise<{amount: TokenAmount, winner: Address}>`: return jackpot winner of the given round
35
+
36
+ ## 1.12.2
37
+
38
+ - Use DefiLlama API as an backup for Coingecko
39
+
40
+ ## 1.12.0 + 1.12.1
41
+
42
+ - Use new referral contract
43
+ - Remove referral V1 data
44
+
45
+ - `ReferralRead(...).isNewUserAtReferralTime(address: Address): Promise<boolean>`: Return true if this is a new user of aurigami
46
+ when he got referred
47
+ - `...(...).depositedMoreThanMinimumAmount(address: Address): Promise<boolean>`: Return true if the user has deposited more than the minimum amount (100$)
48
+
49
+ - `ReferralRead(...).isWhitelistedAddress(address: Address): Promise<boolean>`: check whether a user is a whitelisted referrer or not
50
+ - `ReferralRead(...).isOnAuroraPlus(address: Address): Promise<boolean>`: Check whether a user on Aurora+ or not
51
+
52
+ - `ReferralRead(...).slotsInUse(referralCode: string): Promise<number>`
53
+ - `(...).totalReferralSlots(): number` -> return 500
54
+ - `(...).userReferralStatus(userAddr: Address): Promise<string>` -> return `notReferred`, `notQualified`, `Qualified`, or `Withdrawn` base on the user status
55
+ - Type changes: `ReferralReward` now will have `refereeAddress: string | null`
56
+
57
+ ## 1.11.1
58
+
59
+ - PlyGame `getPlyGameResultsInTransaction` get result faster by using `getTransactionReceipt` instead of `waitForTransaction`
60
+
61
+ ## 1.11.0
62
+
63
+ - Add support for Plygame with testing contract
64
+ - Type:
65
+
66
+ ```ts
67
+ export type PlyGameBetResult = {
68
+ player: string;
69
+ outcome: string;
70
+ lostAmount: TokenAmount;
71
+ unlockedPulpAmount: TokenAmount;
72
+
73
+ block: number;
74
+ timestamp: number;
75
+ transactionHash: string;
76
+ };
77
+
78
+ type PlyGameLeaderboardItem = {
79
+ player: string;
80
+ gamesPlayed: number;
81
+ unlockedPulpAmount: TokenAmount;
82
+ };
83
+ ```
84
+
85
+ - Read functions:
86
+
87
+ - `PlyGameRead(...).getUserPlyGameHistory(user) -> Promise<PlyGameBetResult[]>`: Get 100 most recent bets of the market users
88
+ - `(...).currentJackpotAmount(): Promise<TokenAmount>`
89
+ - `(...).earlyUnlockedPulpAmount(user): Promise<TokenAmount>`: get total unlocked pulp amount since launch.
90
+ - `(...).getPlyGameResultsInTransaction(txHash): Promise<PlyGameBetResult[]>`: Return list of bet made from the given transaction.
91
+ - `PlyGameRead(...).leaderboard(): Promise<PlyGameLeaderboardItem[]>`: ranking list of the top 100 users by amount of PULP unlocked
92
+
93
+ - Write functions:
94
+
95
+ - `PlyGameReadWrite(...).makeBetOnce(amount: TokenAmount)`
96
+ - `(...).approve(amount: TokenAmount)`: approve plygame contract spending user's PLY
97
+
98
+ ## 1.10.0
99
+
100
+ - Public `PapermillRead(...).getWeek(timestamp: number): number`
101
+
102
+ ## 1.9.7
103
+
104
+ - Change oracle address
105
+
106
+ ## 1.9.6
107
+
108
+ - Add oracle to ENV
109
+
110
+ ## 1.9.5
111
+
112
+ - Use compound formular to calculate market APY.
113
+
114
+ ## 1.9.4
115
+
116
+ - Allow to set custom dust in sneak account
117
+
118
+ ## 1.9.3
119
+
120
+ - Change ply circulating supply
121
+
122
+ ## 1.9.2
123
+
124
+ - Use 10B for PLY total supply
125
+
126
+ ## 1.9.1
127
+
128
+ - Handle error in fetching LP price
129
+
130
+ ## 1.9.0
131
+
132
+ - Rename `contracts` folder to `interactors`.
133
+ - Catching fetch price error
134
+
135
+ ## 1.8.6
136
+
137
+ - Fix bug in `formattedAmount` when using custom format.
138
+
139
+ ## 1.8.5
140
+
141
+ - Able to customize format in TokenAmount.formattedAmount()
142
+
143
+ ## 1.8.4
144
+
145
+ - Add campaign ids for referrals
146
+
147
+ ## 1.8.3
148
+
149
+ - Markets rewards + staking rewards can be claim in one txn by `SdkReadWrite(...).claim()`
150
+ - Remove `SdkReadWrite(...).claimLpRewards()`
151
+
152
+ ## 1.8.2
153
+
154
+ Bug fix on missing txnHash in referralReward type
155
+
156
+ ## 1.8.1
157
+
158
+ - Change campaign id
159
+
160
+ ## 1.8.0
161
+
162
+ - Return actual data for referral rewards.
163
+ - Change `ReferralRead(...).leaderboard()` to `ReferralRead(...).leaderboard(campaign: string)`: now can get the leaderboard of a given campaign.
164
+
165
+ ## 1.7.9-dummy
166
+
167
+ - Add `userAddr` in ReferralReward type
168
+
169
+ ## 1.7.8-dummy
170
+
171
+ - Update Meta rewards for stNEAR to `1,250,000` META.
172
+
173
+ ## 1.7.7-dummy
174
+
175
+ - [Dummy data] Add `ReferralRead(...).referralRewards(userAddr: Address): Promise<ReferralReward[]>`: Array of rewards, sorted by time of the referral period (from latest to oldest)
176
+ - [Dummy data] Add `ReferralRead(...).leaderboard(): Promise<ReferralReward[]>`: Top 50 reward earners from the last round, sorted by token amount.
177
+
178
+ - Add `ReferralReadWrite(...).claimReferralRewards()`: Claim all unclaimed rewards for a given user
179
+
180
+ New type:
181
+
182
+ ```ts
183
+ export type ReferralReward = {
184
+ campaign: string;
185
+ /**
186
+ * start timetamp of the referral round
187
+ */
188
+ startTime: number;
189
+ /**
190
+ * end timetamp of the referral round
191
+ */
192
+ endTime: number;
193
+ /**
194
+ * referrer's rewards
195
+ */
196
+ isReferrer: boolean;
197
+ /**
198
+ * reward amount
199
+ */
200
+ rewardTokenAmount: TokenAmount;
201
+ /**
202
+ * hash of the transaction on aurorascan (if no, return null)
203
+ */
204
+ transactionHash: string | null;
205
+ };
206
+ ```
207
+
208
+ ## 1.7.3
209
+
210
+ - Add helper functions for Auri monitoring system
211
+
212
+ ## 1.7.1 & 1.7.2
213
+
214
+ - Return correct timestamp in referrals list
215
+
216
+ ## 1.7.0
217
+
218
+ - Add `ReferralRead(...).getReferralsList(userAddr: Address): Promise<{ user: string; timestamp: number }[]>`: Get 50 latest referrals of the given address, sorted descending by timestamp. Currently the timestamp is dummy data.
219
+
220
+ ## 1.6.9
221
+
222
+ Support internal aurilens
223
+
224
+ ## 1.6.6
225
+
226
+ Use `public readonly` modifier instead of `private/protected` in SDK.
227
+
228
+ ## 1.6.5
229
+
230
+ SDK refactor #2, remove support for loterry campaign. Package size reduced from 3MB -> 200KB
231
+
232
+ ## 1.6.4
233
+
234
+ Return meaningful result instead of INF in `calcLMRewardApr`
235
+
236
+ ## 1.6.3
237
+
238
+ Add USN supports. Hardcoded USN price to $1.
239
+
240
+ ## 1.6.2
241
+
242
+ - Add `ReferralRead(...).getUserReferralCode(userAddr: Address): Promise<string>`: Get the referral code for a given address, returns empty string if not found. Called to check if a user has a referral code.
243
+ - Add `ReferralRead(...).getReferralCodeOwner(code: string): Promise<Address>`: Get owner of a referral code, returns zero address if not found.
244
+ - Add `ReferralRead(...).getReferralCodeUsed(userAddr: Address): Promise<string>`: Get referral code that a user was referred by, returns empty string if not found.
245
+ - Add `ReferralReadWrite(...).registerNewReferralCode(): Promise<TransactionResponse>`: Generate a referral code for a given address. Called when an user want to creates his own referral code
246
+ - Add `ReferralReadWrite(...).useReferralCode(code: string): Promise<TransactionResponse>`: Called when an user confirms he is referred by a specified code
247
+
248
+ ## 1.6.1
249
+
250
+ Add `PapermillRead(...).getNextWeekTimestamp(): number`: get the start timestamp of next week of the papermill contract.
251
+
252
+ Add `SdkRead(...).getPlyCirculatingSupply(): Promise<TokenAmount>`: get the ply's circulating supply
253
+
254
+ ## 1.6.0
255
+
256
+ SDK refactor - Why?:
257
+
258
+ - more modular and less coupled.
259
+ - more testable.
260
+ - more maintainable.
261
+
262
+ Things to do:
263
+
264
+ - [x] Restructure the folder structure.
265
+ - Refactor the code - Use composition pattern to SDK class
266
+ - [x] Use address from contract package instead of hardcoded address.
267
+
268
+ ## 1.5.8 + 1.5.9
269
+
270
+ Fix gas error on claim rewards: Instead of claim all the rewards in all market in 1 txns, we will claim rewards in 2 txns.
271
+
272
+ ## 1.5.7
273
+
274
+ - Change return type of `SdkRead(...).LpBalanceOf` and `stakeBalanceOf` from `TokenValuation` to `TokenAmount` to match other functions in the SDK.
275
+ - `totalStakedLiquidity` field in `PLYWNEARPoolDetails` is now `TokenAmount` instead of `TokenValuation`.
276
+
277
+ ```ts
278
+ export type PLYWNEARPoolDetails = {
279
+ totalStakedLiquidity: TokenAmount;
280
+ APYs: TokenAPY[];
281
+ };
282
+ ```
283
+
284
+ ## 1.5.6
285
+
286
+ Add PLYWNEAR pool to ALL_STAKING_POOLS
287
+
288
+ ## 1.5.5
289
+
290
+ Add auPLY market, integrate new fair launch contract
291
+
292
+ Hard code PULP price to 0
293
+
294
+ ## 1.5.4
295
+
296
+ Use browser-friendly assert
297
+
298
+ ## 1.5.2
299
+
300
+ Added `SdkRead(...).unclaimedRewardsOf(userAddress: Address): Promise<TokenAmount[]>` to get unclaimed rewards of a user in LP staking.
301
+
302
+ ## 1.5.1
303
+
304
+ Added `PapermillRead(...).getUnlockPortionAt(userAddress: Address, timestamp: number)`
305
+
306
+ ```ts
307
+ export type TokenAPY = {
308
+ address: string;
309
+ apy: string;
310
+ };
311
+
312
+ export type PLYWNEARPoolDetails = {
313
+ totalStakedLiquidity: TokenValuation;
314
+ APYs: TokenAPY[];
315
+ //apy: string; removed
316
+ };
317
+ ```
318
+
319
+ ## 1.5.0 For staking PLYWNEAR
320
+
321
+ ### Unchanged:
322
+
323
+ - Stake/unstake: Use `SdkReadWrite(...).stake(amount: TokenAmount)` (or `unstake`)
324
+
325
+ ### Rename:
326
+
327
+ - `SdkRead(...).getPlyAuroraPoolDetails` -> `SdkRead(...).getPLYWNEARPoolDetails`
328
+
329
+ ### Add
330
+
331
+ - Read:
332
+ - `SdkRead(...).LpBalanceOf(user: Address):TokenValuation` => amount and $ value of LP token in wallet. To get amount staked, use the old `stakeBalanceOf()` above
333
+ - Type:
334
+ - `TokenValuation` is a type that contains amount and $ value of token.
335
+
336
+ ```ts
337
+ export type TokenValuation = {
338
+ tokenAmount: TokenAmount;
339
+ currencyAmount: CurrencyAmount;
340
+ };
341
+ ```
342
+
343
+ ```ts
344
+ export type PLYWNEARPoolDetails = {
345
+ totalStakedLiquidity: TokenValuation;
346
+ apy: string;
347
+ };
348
+ ```
349
+
350
+ ### Return type changed:
351
+
352
+ - `SdkRead(...).stakeBalanceOf()` will return `TokenValuation` instead of `TokenAmount`
353
+
354
+ ### Remove:
355
+
356
+ - Type `PlyAuroraPoolDetails` removed.
357
+
358
+ ## 1.5.0 For Papermill
359
+
360
+ ### Add
361
+
362
+ - Read functions:
363
+
364
+ - `new PapermillRead(...).getPlyBalance(address: Address): TokenAmount` => PLY balance in user wallet
365
+ - `new PapermillRead(...).getPulpBalance(address: Address): TokenAmount` => PULP balance in user wallet
366
+ - `new PapermillRead(...).getLockingDetails(address: Address): UserLockingDetails`: Get locking details. This function is for convenience only, because the locking details are already available in the `UserLockingDetails` result (which you can get by calling the old `SdkRead(...).getUserDetails()`)
367
+
368
+ - Write functions:
369
+
370
+ - `new PapermillReadWrite(...).redeem(recipient: Address, amount: TokenAmount)` => Redeem Ply from PULP. Set `amount` to `ethers.constants.MaxUint256` for max redeem.
371
+ - `new PapermillReadWrite(...).selfRedeem(amount: TokenAmount)` => Redeem Ply from PULP to msg.sender. This is just a shortcut for the redeem function above.
372
+ - Collect all PLY reward from all markets + staking pool: No added functions, using the old `SdkReadWrite(...).claim()`
373
+
374
+ - Type:
375
+ - `UserLockingDetails` to store all user locking details
376
+
377
+ ### Update
378
+
379
+ - `SdkRead(...).getUserDetails()`: this will include the result from `getLockingDetails`.
380
+
381
+ ### Remove
382
+
383
+ - `SdkRead(...).getLockingDetails()`: Use the `getLockingDetails` in papermill instead if needed.
384
+ - Remove `LockingDetails` type