@aurigami/sdk 1.11.0-beta → 1.11.0-beta2
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 +6 -1
- package/dist/sdk.cjs.development.js +78 -12
- 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 +78 -12
- package/dist/sdk.esm.js.map +1 -1
- package/dist/types/index.d.ts +5 -0
- package/package.json +1 -1
- package/src/interactors/PlyGame.ts +25 -1
- package/src/types/index.ts +6 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TransactionResponse } from '@ethersproject/abstract-provider';
|
|
2
2
|
import { AuriEnv, BlockchainEntity, BlockchainEntityRead, Token, TokenAmount } from '../entities';
|
|
3
|
-
import { Address, NetworkConnection, PlyGameBetResult } from '../types';
|
|
3
|
+
import { Address, NetworkConnection, PlyGameBetResult, PlyGameLeaderboardItem } from '../types';
|
|
4
4
|
export declare class PlyGameRead extends BlockchainEntityRead {
|
|
5
5
|
readonly plyToken: Token;
|
|
6
6
|
readonly pulpToken: Token;
|
|
@@ -19,6 +19,10 @@ export declare class PlyGameRead extends BlockchainEntityRead {
|
|
|
19
19
|
nextJackpotRevealTime(): Promise<number>;
|
|
20
20
|
earlyUnlockedPulpAmount(user: Address): Promise<TokenAmount>;
|
|
21
21
|
getPlyGameResultsInTransaction(txHash: Address): Promise<PlyGameBetResult[]>;
|
|
22
|
+
/**
|
|
23
|
+
* Top 100 users by amount of PULP unlocked
|
|
24
|
+
*/
|
|
25
|
+
leaderboard(): Promise<PlyGameLeaderboardItem[]>;
|
|
22
26
|
}
|
|
23
27
|
export declare class PlyGameReadWrite extends PlyGameRead {
|
|
24
28
|
/**
|
|
@@ -29,6 +33,7 @@ export declare class PlyGameReadWrite extends PlyGameRead {
|
|
|
29
33
|
* Make a single bet
|
|
30
34
|
*/
|
|
31
35
|
makeBetOnce(amount: TokenAmount): Promise<TransactionResponse>;
|
|
36
|
+
approve(amount: TokenAmount): Promise<TransactionResponse>;
|
|
32
37
|
}
|
|
33
38
|
export declare class PlyGame extends BlockchainEntity {
|
|
34
39
|
constructor();
|
|
@@ -4878,6 +4878,49 @@ var PlyGameRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4878
4878
|
}
|
|
4879
4879
|
|
|
4880
4880
|
return getPlyGameResultsInTransaction;
|
|
4881
|
+
}()
|
|
4882
|
+
/**
|
|
4883
|
+
* Top 100 users by amount of PULP unlocked
|
|
4884
|
+
*/
|
|
4885
|
+
;
|
|
4886
|
+
|
|
4887
|
+
_proto.leaderboard =
|
|
4888
|
+
/*#__PURE__*/
|
|
4889
|
+
function () {
|
|
4890
|
+
var _leaderboard = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7() {
|
|
4891
|
+
var _this4 = this;
|
|
4892
|
+
|
|
4893
|
+
var result;
|
|
4894
|
+
return runtime_1.wrap(function _callee7$(_context7) {
|
|
4895
|
+
while (1) {
|
|
4896
|
+
switch (_context7.prev = _context7.next) {
|
|
4897
|
+
case 0:
|
|
4898
|
+
_context7.next = 2;
|
|
4899
|
+
return getPaginatedApi('/plygame/leaderboard');
|
|
4900
|
+
|
|
4901
|
+
case 2:
|
|
4902
|
+
result = _context7.sent;
|
|
4903
|
+
return _context7.abrupt("return", result.items.map(function (item, i) {
|
|
4904
|
+
return {
|
|
4905
|
+
player: item.user,
|
|
4906
|
+
unlockedPulpAmount: new TokenAmount(_this4.pulpToken, item.unlockedAmount),
|
|
4907
|
+
gamesPlayed: item.count
|
|
4908
|
+
};
|
|
4909
|
+
}));
|
|
4910
|
+
|
|
4911
|
+
case 4:
|
|
4912
|
+
case "end":
|
|
4913
|
+
return _context7.stop();
|
|
4914
|
+
}
|
|
4915
|
+
}
|
|
4916
|
+
}, _callee7);
|
|
4917
|
+
}));
|
|
4918
|
+
|
|
4919
|
+
function leaderboard() {
|
|
4920
|
+
return _leaderboard.apply(this, arguments);
|
|
4921
|
+
}
|
|
4922
|
+
|
|
4923
|
+
return leaderboard;
|
|
4881
4924
|
}();
|
|
4882
4925
|
|
|
4883
4926
|
return PlyGameRead;
|
|
@@ -4897,19 +4940,19 @@ var PlyGameReadWrite = /*#__PURE__*/function (_PlyGameRead) {
|
|
|
4897
4940
|
_proto2.makeBetMultiple =
|
|
4898
4941
|
/*#__PURE__*/
|
|
4899
4942
|
function () {
|
|
4900
|
-
var _makeBetMultiple = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4901
|
-
return runtime_1.wrap(function
|
|
4943
|
+
var _makeBetMultiple = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(amount, times) {
|
|
4944
|
+
return runtime_1.wrap(function _callee8$(_context8) {
|
|
4902
4945
|
while (1) {
|
|
4903
|
-
switch (
|
|
4946
|
+
switch (_context8.prev = _context8.next) {
|
|
4904
4947
|
case 0:
|
|
4905
|
-
return
|
|
4948
|
+
return _context8.abrupt("return", this.env.plygame.connect(this._networkConnection.signer).makeBetMultiple(amount.rawAmount(), times));
|
|
4906
4949
|
|
|
4907
4950
|
case 1:
|
|
4908
4951
|
case "end":
|
|
4909
|
-
return
|
|
4952
|
+
return _context8.stop();
|
|
4910
4953
|
}
|
|
4911
4954
|
}
|
|
4912
|
-
},
|
|
4955
|
+
}, _callee8, this);
|
|
4913
4956
|
}));
|
|
4914
4957
|
|
|
4915
4958
|
function makeBetMultiple(_x5, _x6) {
|
|
@@ -4926,19 +4969,19 @@ var PlyGameReadWrite = /*#__PURE__*/function (_PlyGameRead) {
|
|
|
4926
4969
|
_proto2.makeBetOnce =
|
|
4927
4970
|
/*#__PURE__*/
|
|
4928
4971
|
function () {
|
|
4929
|
-
var _makeBetOnce = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4930
|
-
return runtime_1.wrap(function
|
|
4972
|
+
var _makeBetOnce = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(amount) {
|
|
4973
|
+
return runtime_1.wrap(function _callee9$(_context9) {
|
|
4931
4974
|
while (1) {
|
|
4932
|
-
switch (
|
|
4975
|
+
switch (_context9.prev = _context9.next) {
|
|
4933
4976
|
case 0:
|
|
4934
|
-
return
|
|
4977
|
+
return _context9.abrupt("return", this.env.plygame.connect(this._networkConnection.signer).makeBetOnce(amount.rawAmount()));
|
|
4935
4978
|
|
|
4936
4979
|
case 1:
|
|
4937
4980
|
case "end":
|
|
4938
|
-
return
|
|
4981
|
+
return _context9.stop();
|
|
4939
4982
|
}
|
|
4940
4983
|
}
|
|
4941
|
-
},
|
|
4984
|
+
}, _callee9, this);
|
|
4942
4985
|
}));
|
|
4943
4986
|
|
|
4944
4987
|
function makeBetOnce(_x7) {
|
|
@@ -4948,6 +4991,29 @@ var PlyGameReadWrite = /*#__PURE__*/function (_PlyGameRead) {
|
|
|
4948
4991
|
return makeBetOnce;
|
|
4949
4992
|
}();
|
|
4950
4993
|
|
|
4994
|
+
_proto2.approve = /*#__PURE__*/function () {
|
|
4995
|
+
var _approve = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(amount) {
|
|
4996
|
+
return runtime_1.wrap(function _callee10$(_context10) {
|
|
4997
|
+
while (1) {
|
|
4998
|
+
switch (_context10.prev = _context10.next) {
|
|
4999
|
+
case 0:
|
|
5000
|
+
return _context10.abrupt("return", this.env.ply.connect(this._networkConnection.signer).approve(this.env.plygame.address, amount.rawAmount()));
|
|
5001
|
+
|
|
5002
|
+
case 1:
|
|
5003
|
+
case "end":
|
|
5004
|
+
return _context10.stop();
|
|
5005
|
+
}
|
|
5006
|
+
}
|
|
5007
|
+
}, _callee10, this);
|
|
5008
|
+
}));
|
|
5009
|
+
|
|
5010
|
+
function approve(_x8) {
|
|
5011
|
+
return _approve.apply(this, arguments);
|
|
5012
|
+
}
|
|
5013
|
+
|
|
5014
|
+
return approve;
|
|
5015
|
+
}();
|
|
5016
|
+
|
|
4951
5017
|
return PlyGameReadWrite;
|
|
4952
5018
|
}(PlyGameRead);
|
|
4953
5019
|
var PlyGame = /*#__PURE__*/function (_BlockchainEntity) {
|