@aurigami/sdk 1.12.3 → 1.12.4
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/dist/interactors/PlyGame.d.ts +1 -1
- package/dist/sdk.cjs.development.js +20 -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 +20 -13
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/interactors/PlyGame.ts +8 -3
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TransactionResponse } from '@ethersproject/abstract-provider';
|
|
2
|
+
import { BigNumber as BN } from 'ethers';
|
|
2
3
|
import * as consts from '../consts';
|
|
3
4
|
import { AuriEnv, BlockchainEntity, BlockchainEntityRead, Token, TokenAmount } from '../entities';
|
|
4
5
|
import * as helpers from '../helpers';
|
|
@@ -119,10 +120,14 @@ export class PlyGameRead extends BlockchainEntityRead {
|
|
|
119
120
|
}));
|
|
120
121
|
}
|
|
121
122
|
|
|
122
|
-
public async
|
|
123
|
-
|
|
123
|
+
public async getLastJackpotResult(): Promise<{ winner: Address; amount: TokenAmount }> {
|
|
124
|
+
// 158 is the storage slot of the jackpot length
|
|
125
|
+
let round = BN.from(
|
|
126
|
+
await this._networkConnection.provider.getStorageAt(this.env.plygame.address, 158)
|
|
127
|
+
);
|
|
128
|
+
let result = await this.env.plygame.jackpotHistory(round.sub(1));
|
|
124
129
|
return {
|
|
125
|
-
winner: result.winner,
|
|
130
|
+
winner: result.winner.slice(0, 6) + '...' + result.winner.slice(4),
|
|
126
131
|
amount: new TokenAmount(this.plyToken, result.amount.toString()),
|
|
127
132
|
};
|
|
128
133
|
}
|