@aurigami/sdk 1.12.8 → 1.12.9-hf
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 +371 -0
- package/dist/interactors/PlyGame.d.ts +1 -0
- package/dist/sdk.cjs.development.js +53 -13
- package/dist/sdk.cjs.development.js.map +1 -1
- package/dist/sdk.cjs.production.min.js +1 -1
- package/dist/sdk.cjs.production.min.js.map +1 -1
- package/dist/sdk.esm.js +53 -13
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +4 -3
- package/src/.DS_Store +0 -0
- package/src/interactors/PlyGame.ts +10 -1
- package/src/interactors/misc.ts +8 -5
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.12.
|
|
2
|
+
"version": "1.12.9-hf",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"name": "@aurigami/sdk",
|
|
31
31
|
"author": "Aurigami Finance",
|
|
32
32
|
"module": "dist/sdk.esm.js",
|
|
33
|
-
"size-limit": [
|
|
33
|
+
"size-limit": [
|
|
34
|
+
{
|
|
34
35
|
"path": "dist/sdk.cjs.production.min.js",
|
|
35
36
|
"limit": "300 KB"
|
|
36
37
|
},
|
|
@@ -69,4 +70,4 @@
|
|
|
69
70
|
"jest": {
|
|
70
71
|
"testURL": "https://app.aurigami.finance"
|
|
71
72
|
}
|
|
72
|
-
}
|
|
73
|
+
}
|
package/src/.DS_Store
ADDED
|
Binary file
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
NetworkConnection,
|
|
11
11
|
PlyBetMadeEvent,
|
|
12
12
|
PlyGameBetResult,
|
|
13
|
-
PlyGameLeaderboardItem
|
|
13
|
+
PlyGameLeaderboardItem
|
|
14
14
|
} from '../types';
|
|
15
15
|
|
|
16
16
|
export class PlyGameRead extends BlockchainEntityRead {
|
|
@@ -131,6 +131,15 @@ export class PlyGameRead extends BlockchainEntityRead {
|
|
|
131
131
|
amount: new TokenAmount(this.plyToken, result.amount.toString()),
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
|
+
|
|
135
|
+
public async overallLeaderboard(): Promise<PlyGameLeaderboardItem[]> {
|
|
136
|
+
const result = await AuriAPI.getPaginatedApi('/plygame/overallLeaderboard');
|
|
137
|
+
return result.items.map((item) => ({
|
|
138
|
+
player: item.user,
|
|
139
|
+
unlockedPulpAmount: new TokenAmount(this.pulpToken, item.unlockedAmount!),
|
|
140
|
+
gamesPlayed: item.count!,
|
|
141
|
+
}));
|
|
142
|
+
}
|
|
134
143
|
}
|
|
135
144
|
|
|
136
145
|
export class PlyGameReadWrite extends PlyGameRead {
|
package/src/interactors/misc.ts
CHANGED
|
@@ -88,7 +88,10 @@ export class MiscRead extends BlockchainEntityRead {
|
|
|
88
88
|
return p;
|
|
89
89
|
}, new BigNumber(0));
|
|
90
90
|
|
|
91
|
-
var accountLiquidity: [BN, BN] = await this.env.comptroller.getAccountLiquidity(userAddress)
|
|
91
|
+
var accountLiquidity: [BN, BN] = await this.env.comptroller.getAccountLiquidity(userAddress).catch((e) => {
|
|
92
|
+
console.log(e);
|
|
93
|
+
return [BN.from(0), BN.from(0)]
|
|
94
|
+
});
|
|
92
95
|
|
|
93
96
|
var borrowedvaluation: BigNumber = totalBorrowLimit.minus(
|
|
94
97
|
new BigNumber(accountLiquidity[0].toString()).div(decimalFactor(18))
|
|
@@ -126,12 +129,12 @@ export class MiscRead extends BlockchainEntityRead {
|
|
|
126
129
|
.div(underlyingPrices[i]);
|
|
127
130
|
userMarketDetails[i].maxWithdrawableAmount =
|
|
128
131
|
userMarketDetails[i].isCollateral &&
|
|
129
|
-
|
|
132
|
+
maxWithdrawCap.lt(userMarketDetails[i].depositBalance.formattedAmount())
|
|
130
133
|
? new TokenAmount(moneyMarket.underlying, maxWithdrawCap.toFixed(24), false)
|
|
131
134
|
: new TokenAmount(
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
+
moneyMarket.underlying,
|
|
136
|
+
userMarketDetails[i].depositBalance.rawAmount()
|
|
137
|
+
);
|
|
135
138
|
}
|
|
136
139
|
|
|
137
140
|
return {
|