@aurigami/sdk 1.11.0-beta4 → 1.11.0
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 +0 -5
- package/dist/sdk.cjs.development.js +40 -92
- 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 +40 -92
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/consts/constants.ts +1 -1
- package/src/interactors/PlyGame.ts +4 -14
|
@@ -16,7 +16,6 @@ export declare class PlyGameRead extends BlockchainEntityRead {
|
|
|
16
16
|
* Get current jackpot amount
|
|
17
17
|
*/
|
|
18
18
|
currentJackpotAmount(): Promise<TokenAmount>;
|
|
19
|
-
nextJackpotRevealTime(): Promise<number>;
|
|
20
19
|
earlyUnlockedPulpAmount(user: Address): Promise<TokenAmount>;
|
|
21
20
|
getPlyGameResultsInTransaction(txHash: Address): Promise<PlyGameBetResult[]>;
|
|
22
21
|
/**
|
|
@@ -25,10 +24,6 @@ export declare class PlyGameRead extends BlockchainEntityRead {
|
|
|
25
24
|
leaderboard(): Promise<PlyGameLeaderboardItem[]>;
|
|
26
25
|
}
|
|
27
26
|
export declare class PlyGameReadWrite extends PlyGameRead {
|
|
28
|
-
/**
|
|
29
|
-
* makes "times" independent bets, but consecutively, of the same amount
|
|
30
|
-
*/
|
|
31
|
-
makeBetMultiple(amount: TokenAmount, times: number): Promise<TransactionResponse>;
|
|
32
27
|
/**
|
|
33
28
|
* Make a single bet
|
|
34
29
|
*/
|
|
@@ -115,7 +115,7 @@ var networkAddresses = {
|
|
|
115
115
|
PLY_TOKEN_LOCK: /*#__PURE__*/MAINNET_ADDRESSES.plyTokenLock.toLowerCase(),
|
|
116
116
|
REFERRAL: /*#__PURE__*/MAINNET_ADDRESSES.referralDirectory.toLowerCase(),
|
|
117
117
|
AURI_INTERNAL_LENS: /*#__PURE__*/MAINNET_ADDRESSES.auriInternalLens.toLowerCase(),
|
|
118
|
-
PLYGAME: /*#__PURE__*/
|
|
118
|
+
PLYGAME: /*#__PURE__*/MAINNET_ADDRESSES.plyGame.toLowerCase()
|
|
119
119
|
},
|
|
120
120
|
tokens: {
|
|
121
121
|
AURORA: /*#__PURE__*/'0x8bec47865ade3b172a928df8f990bc7f2a3b9f79'.toLowerCase(),
|
|
@@ -4806,49 +4806,26 @@ var PlyGameRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4806
4806
|
return currentJackpotAmount;
|
|
4807
4807
|
}();
|
|
4808
4808
|
|
|
4809
|
-
_proto.nextJackpotRevealTime = /*#__PURE__*/function () {
|
|
4810
|
-
var _nextJackpotRevealTime = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
|
|
4811
|
-
return runtime_1.wrap(function _callee4$(_context4) {
|
|
4812
|
-
while (1) {
|
|
4813
|
-
switch (_context4.prev = _context4.next) {
|
|
4814
|
-
case 0:
|
|
4815
|
-
return _context4.abrupt("return", 0);
|
|
4816
|
-
|
|
4817
|
-
case 1:
|
|
4818
|
-
case "end":
|
|
4819
|
-
return _context4.stop();
|
|
4820
|
-
}
|
|
4821
|
-
}
|
|
4822
|
-
}, _callee4);
|
|
4823
|
-
}));
|
|
4824
|
-
|
|
4825
|
-
function nextJackpotRevealTime() {
|
|
4826
|
-
return _nextJackpotRevealTime.apply(this, arguments);
|
|
4827
|
-
}
|
|
4828
|
-
|
|
4829
|
-
return nextJackpotRevealTime;
|
|
4830
|
-
}();
|
|
4831
|
-
|
|
4832
4809
|
_proto.earlyUnlockedPulpAmount = /*#__PURE__*/function () {
|
|
4833
|
-
var _earlyUnlockedPulpAmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4810
|
+
var _earlyUnlockedPulpAmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(user) {
|
|
4834
4811
|
var earlyUnlockedPulpAmount;
|
|
4835
|
-
return runtime_1.wrap(function
|
|
4812
|
+
return runtime_1.wrap(function _callee4$(_context4) {
|
|
4836
4813
|
while (1) {
|
|
4837
|
-
switch (
|
|
4814
|
+
switch (_context4.prev = _context4.next) {
|
|
4838
4815
|
case 0:
|
|
4839
|
-
|
|
4816
|
+
_context4.next = 2;
|
|
4840
4817
|
return this.env.plygame.totalPlyUnlockedEarly(user);
|
|
4841
4818
|
|
|
4842
4819
|
case 2:
|
|
4843
|
-
earlyUnlockedPulpAmount =
|
|
4844
|
-
return
|
|
4820
|
+
earlyUnlockedPulpAmount = _context4.sent;
|
|
4821
|
+
return _context4.abrupt("return", new TokenAmount(this.pulpToken, earlyUnlockedPulpAmount.toString()));
|
|
4845
4822
|
|
|
4846
4823
|
case 4:
|
|
4847
4824
|
case "end":
|
|
4848
|
-
return
|
|
4825
|
+
return _context4.stop();
|
|
4849
4826
|
}
|
|
4850
4827
|
}
|
|
4851
|
-
},
|
|
4828
|
+
}, _callee4, this);
|
|
4852
4829
|
}));
|
|
4853
4830
|
|
|
4854
4831
|
function earlyUnlockedPulpAmount(_x3) {
|
|
@@ -4859,19 +4836,19 @@ var PlyGameRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4859
4836
|
}();
|
|
4860
4837
|
|
|
4861
4838
|
_proto.getPlyGameResultsInTransaction = /*#__PURE__*/function () {
|
|
4862
|
-
var _getPlyGameResultsInTransaction = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4839
|
+
var _getPlyGameResultsInTransaction = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(txHash) {
|
|
4863
4840
|
var _this3 = this;
|
|
4864
4841
|
|
|
4865
4842
|
var tx, filter, betMadeEvents;
|
|
4866
|
-
return runtime_1.wrap(function
|
|
4843
|
+
return runtime_1.wrap(function _callee5$(_context5) {
|
|
4867
4844
|
while (1) {
|
|
4868
|
-
switch (
|
|
4845
|
+
switch (_context5.prev = _context5.next) {
|
|
4869
4846
|
case 0:
|
|
4870
|
-
|
|
4871
|
-
return this._networkConnection.provider.
|
|
4847
|
+
_context5.next = 2;
|
|
4848
|
+
return this._networkConnection.provider.waitForTransaction(txHash, 1);
|
|
4872
4849
|
|
|
4873
4850
|
case 2:
|
|
4874
|
-
tx =
|
|
4851
|
+
tx = _context5.sent;
|
|
4875
4852
|
filter = this.env.plygame.filters.BetMade();
|
|
4876
4853
|
betMadeEvents = tx.logs.filter(function (log) {
|
|
4877
4854
|
return isSameAddress(log.topics[0], filter.topics[0]);
|
|
@@ -4881,16 +4858,16 @@ var PlyGameRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4881
4858
|
transactionHash: txHash
|
|
4882
4859
|
});
|
|
4883
4860
|
});
|
|
4884
|
-
return
|
|
4861
|
+
return _context5.abrupt("return", this.attachTimestamp(betMadeEvents.map(function (e) {
|
|
4885
4862
|
return _this3.parseBetMakeEvent(e);
|
|
4886
4863
|
})));
|
|
4887
4864
|
|
|
4888
4865
|
case 6:
|
|
4889
4866
|
case "end":
|
|
4890
|
-
return
|
|
4867
|
+
return _context5.stop();
|
|
4891
4868
|
}
|
|
4892
4869
|
}
|
|
4893
|
-
},
|
|
4870
|
+
}, _callee5, this);
|
|
4894
4871
|
}));
|
|
4895
4872
|
|
|
4896
4873
|
function getPlyGameResultsInTransaction(_x4) {
|
|
@@ -4907,20 +4884,20 @@ var PlyGameRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4907
4884
|
_proto.leaderboard =
|
|
4908
4885
|
/*#__PURE__*/
|
|
4909
4886
|
function () {
|
|
4910
|
-
var _leaderboard = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4887
|
+
var _leaderboard = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6() {
|
|
4911
4888
|
var _this4 = this;
|
|
4912
4889
|
|
|
4913
4890
|
var result;
|
|
4914
|
-
return runtime_1.wrap(function
|
|
4891
|
+
return runtime_1.wrap(function _callee6$(_context6) {
|
|
4915
4892
|
while (1) {
|
|
4916
|
-
switch (
|
|
4893
|
+
switch (_context6.prev = _context6.next) {
|
|
4917
4894
|
case 0:
|
|
4918
|
-
|
|
4895
|
+
_context6.next = 2;
|
|
4919
4896
|
return getPaginatedApi('/plygame/leaderboard');
|
|
4920
4897
|
|
|
4921
4898
|
case 2:
|
|
4922
|
-
result =
|
|
4923
|
-
return
|
|
4899
|
+
result = _context6.sent;
|
|
4900
|
+
return _context6.abrupt("return", result.items.map(function (item, i) {
|
|
4924
4901
|
return {
|
|
4925
4902
|
player: item.user,
|
|
4926
4903
|
unlockedPulpAmount: new TokenAmount(_this4.pulpToken, item.unlockedAmount),
|
|
@@ -4930,10 +4907,10 @@ var PlyGameRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4930
4907
|
|
|
4931
4908
|
case 4:
|
|
4932
4909
|
case "end":
|
|
4933
|
-
return
|
|
4910
|
+
return _context6.stop();
|
|
4934
4911
|
}
|
|
4935
4912
|
}
|
|
4936
|
-
},
|
|
4913
|
+
}, _callee6);
|
|
4937
4914
|
}));
|
|
4938
4915
|
|
|
4939
4916
|
function leaderboard() {
|
|
@@ -4954,57 +4931,28 @@ var PlyGameReadWrite = /*#__PURE__*/function (_PlyGameRead) {
|
|
|
4954
4931
|
|
|
4955
4932
|
var _proto2 = PlyGameReadWrite.prototype;
|
|
4956
4933
|
|
|
4957
|
-
/**
|
|
4958
|
-
* makes "times" independent bets, but consecutively, of the same amount
|
|
4959
|
-
*/
|
|
4960
|
-
_proto2.makeBetMultiple =
|
|
4961
|
-
/*#__PURE__*/
|
|
4962
|
-
function () {
|
|
4963
|
-
var _makeBetMultiple = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(amount, times) {
|
|
4964
|
-
return runtime_1.wrap(function _callee8$(_context8) {
|
|
4965
|
-
while (1) {
|
|
4966
|
-
switch (_context8.prev = _context8.next) {
|
|
4967
|
-
case 0:
|
|
4968
|
-
return _context8.abrupt("return", this.env.plygame.connect(this._networkConnection.signer).makeBetMultiple(amount.rawAmount(), times));
|
|
4969
|
-
|
|
4970
|
-
case 1:
|
|
4971
|
-
case "end":
|
|
4972
|
-
return _context8.stop();
|
|
4973
|
-
}
|
|
4974
|
-
}
|
|
4975
|
-
}, _callee8, this);
|
|
4976
|
-
}));
|
|
4977
|
-
|
|
4978
|
-
function makeBetMultiple(_x5, _x6) {
|
|
4979
|
-
return _makeBetMultiple.apply(this, arguments);
|
|
4980
|
-
}
|
|
4981
|
-
|
|
4982
|
-
return makeBetMultiple;
|
|
4983
|
-
}()
|
|
4984
4934
|
/**
|
|
4985
4935
|
* Make a single bet
|
|
4986
4936
|
*/
|
|
4987
|
-
;
|
|
4988
|
-
|
|
4989
4937
|
_proto2.makeBetOnce =
|
|
4990
4938
|
/*#__PURE__*/
|
|
4991
4939
|
function () {
|
|
4992
|
-
var _makeBetOnce = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4993
|
-
return runtime_1.wrap(function
|
|
4940
|
+
var _makeBetOnce = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(amount) {
|
|
4941
|
+
return runtime_1.wrap(function _callee7$(_context7) {
|
|
4994
4942
|
while (1) {
|
|
4995
|
-
switch (
|
|
4943
|
+
switch (_context7.prev = _context7.next) {
|
|
4996
4944
|
case 0:
|
|
4997
|
-
return
|
|
4945
|
+
return _context7.abrupt("return", this.env.plygame.connect(this._networkConnection.signer).makeBetOnce(amount.rawAmount()));
|
|
4998
4946
|
|
|
4999
4947
|
case 1:
|
|
5000
4948
|
case "end":
|
|
5001
|
-
return
|
|
4949
|
+
return _context7.stop();
|
|
5002
4950
|
}
|
|
5003
4951
|
}
|
|
5004
|
-
},
|
|
4952
|
+
}, _callee7, this);
|
|
5005
4953
|
}));
|
|
5006
4954
|
|
|
5007
|
-
function makeBetOnce(
|
|
4955
|
+
function makeBetOnce(_x5) {
|
|
5008
4956
|
return _makeBetOnce.apply(this, arguments);
|
|
5009
4957
|
}
|
|
5010
4958
|
|
|
@@ -5012,22 +4960,22 @@ var PlyGameReadWrite = /*#__PURE__*/function (_PlyGameRead) {
|
|
|
5012
4960
|
}();
|
|
5013
4961
|
|
|
5014
4962
|
_proto2.approve = /*#__PURE__*/function () {
|
|
5015
|
-
var _approve = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
5016
|
-
return runtime_1.wrap(function
|
|
4963
|
+
var _approve = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(amount) {
|
|
4964
|
+
return runtime_1.wrap(function _callee8$(_context8) {
|
|
5017
4965
|
while (1) {
|
|
5018
|
-
switch (
|
|
4966
|
+
switch (_context8.prev = _context8.next) {
|
|
5019
4967
|
case 0:
|
|
5020
|
-
return
|
|
4968
|
+
return _context8.abrupt("return", this.env.ply.connect(this._networkConnection.signer).approve(this.env.plygame.address, amount.rawAmount()));
|
|
5021
4969
|
|
|
5022
4970
|
case 1:
|
|
5023
4971
|
case "end":
|
|
5024
|
-
return
|
|
4972
|
+
return _context8.stop();
|
|
5025
4973
|
}
|
|
5026
4974
|
}
|
|
5027
|
-
},
|
|
4975
|
+
}, _callee8, this);
|
|
5028
4976
|
}));
|
|
5029
4977
|
|
|
5030
|
-
function approve(
|
|
4978
|
+
function approve(_x6) {
|
|
5031
4979
|
return _approve.apply(this, arguments);
|
|
5032
4980
|
}
|
|
5033
4981
|
|