@aurigami/sdk 1.10.0 → 1.11.0-beta
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/abis/index.d.ts +2 -1
- package/dist/entities/auriEnv.d.ts +3 -1
- package/dist/interactors/PlyGame.d.ts +37 -0
- package/dist/interactors/index.d.ts +1 -0
- package/dist/sdk.cjs.development.js +370 -7
- 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 +368 -8
- package/dist/sdk.esm.js.map +1 -1
- package/dist/types/index.d.ts +25 -0
- package/package.json +70 -70
- package/src/abis/index.ts +2 -0
- package/src/consts/constants.ts +1 -0
- package/src/consts/symbols.ts +4 -2
- package/src/entities/auriEnv.ts +9 -1
- package/src/interactors/PlyGame.ts +121 -0
- package/src/interactors/index.ts +1 -0
- package/src/types/index.ts +26 -0
package/dist/abis/index.d.ts
CHANGED
|
@@ -13,4 +13,5 @@ import IUniswapV2PairABI from '@aurigami/contracts/artifacts/contracts/mock/IUni
|
|
|
13
13
|
import Multicall2ABI from '@aurigami/contracts/artifacts/contracts/mock/Multicall2.sol/Multicall2.json';
|
|
14
14
|
import PulpABI from '@aurigami/contracts/artifacts/contracts/PULP.sol/PULP.json';
|
|
15
15
|
import ReferralDirectoryABI from '@aurigami/contracts/artifacts/contracts/ReferralDirectory.sol/ReferralDirectory.json';
|
|
16
|
-
|
|
16
|
+
import PlyGameABI from '@aurigami/contracts/artifacts/contracts/plygame/PlyGame.sol/PlyGame.json';
|
|
17
|
+
export { AuriOracleABI, AuTokenABI, IUniswapV2PairABI, AuriAirdropABI, AuriFairLaunchABI, AuriLensABI, ComptrollerABI, EIP20InterfaceABI, ReferralDirectoryABI, AuErc20ABI, AuETHABI, EthRepayHelperABI, Multicall2ABI, PulpABI, AuriInternalLensABI, PlyGameABI, };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuErc20, AuriAirdrop, AuriFairLaunch, AuriInternalLens, AuriLens, AuriOracle, Comptroller, IERC20, PULP, ReferralDirectory } from '@aurigami/contracts/typechain';
|
|
1
|
+
import { AuErc20, AuriAirdrop, AuriFairLaunch, AuriInternalLens, AuriLens, AuriOracle, Comptroller, IERC20, PlyGame, PULP, ReferralDirectory } from '@aurigami/contracts/typechain';
|
|
2
2
|
import { Contract } from 'ethers';
|
|
3
3
|
import { AuTokenWithUnderlying } from '../types';
|
|
4
4
|
import { BlockchainEntityRead } from './BlockchainEntity';
|
|
@@ -12,6 +12,7 @@ export declare class AuriEnv extends BlockchainEntityRead {
|
|
|
12
12
|
private _auriAirdrop;
|
|
13
13
|
private _referralDirectory;
|
|
14
14
|
private _oracle;
|
|
15
|
+
private _plygame;
|
|
15
16
|
getContract<CType extends Contract>(address: string, abi: any): CType;
|
|
16
17
|
getAuTokenContracts(): AuTokenWithUnderlying[];
|
|
17
18
|
/**
|
|
@@ -33,4 +34,5 @@ export declare class AuriEnv extends BlockchainEntityRead {
|
|
|
33
34
|
get auriAirdrop(): AuriAirdrop;
|
|
34
35
|
get referralDirectory(): ReferralDirectory;
|
|
35
36
|
get oracle(): AuriOracle;
|
|
37
|
+
get plygame(): PlyGame;
|
|
36
38
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { TransactionResponse } from '@ethersproject/abstract-provider';
|
|
2
|
+
import { AuriEnv, BlockchainEntity, BlockchainEntityRead, Token, TokenAmount } from '../entities';
|
|
3
|
+
import { Address, NetworkConnection, PlyGameBetResult } from '../types';
|
|
4
|
+
export declare class PlyGameRead extends BlockchainEntityRead {
|
|
5
|
+
readonly plyToken: Token;
|
|
6
|
+
readonly pulpToken: Token;
|
|
7
|
+
readonly env: AuriEnv;
|
|
8
|
+
constructor(networkConnection: NetworkConnection);
|
|
9
|
+
private parseBetMakeEvent;
|
|
10
|
+
private attachTimestamp;
|
|
11
|
+
/**
|
|
12
|
+
* Get 100 most recent bets of the market users
|
|
13
|
+
*/
|
|
14
|
+
getUserPlyGameHistory(user: Address): Promise<PlyGameBetResult[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Get current jackpot amount
|
|
17
|
+
*/
|
|
18
|
+
currentJackpotAmount(): Promise<TokenAmount>;
|
|
19
|
+
nextJackpotRevealTime(): Promise<number>;
|
|
20
|
+
earlyUnlockedPulpAmount(user: Address): Promise<TokenAmount>;
|
|
21
|
+
getPlyGameResultsInTransaction(txHash: Address): Promise<PlyGameBetResult[]>;
|
|
22
|
+
}
|
|
23
|
+
export declare class PlyGameReadWrite extends PlyGameRead {
|
|
24
|
+
/**
|
|
25
|
+
* makes "times" independent bets, but consecutively, of the same amount
|
|
26
|
+
*/
|
|
27
|
+
makeBetMultiple(amount: TokenAmount, times: number): Promise<TransactionResponse>;
|
|
28
|
+
/**
|
|
29
|
+
* Make a single bet
|
|
30
|
+
*/
|
|
31
|
+
makeBetOnce(amount: TokenAmount): Promise<TransactionResponse>;
|
|
32
|
+
}
|
|
33
|
+
export declare class PlyGame extends BlockchainEntity {
|
|
34
|
+
constructor();
|
|
35
|
+
read(networkConnection: NetworkConnection): PlyGameRead;
|
|
36
|
+
readWrite(networkConnection: NetworkConnection): PlyGameReadWrite;
|
|
37
|
+
}
|
|
@@ -22,6 +22,7 @@ var IUniswapV2PairABI = _interopDefault(require('@aurigami/contracts/artifacts/c
|
|
|
22
22
|
var abis$b = _interopDefault(require('@aurigami/contracts/artifacts/contracts/mock/Multicall2.sol/Multicall2.json'));
|
|
23
23
|
var abis$c = _interopDefault(require('@aurigami/contracts/artifacts/contracts/PULP.sol/PULP.json'));
|
|
24
24
|
var abis$d = _interopDefault(require('@aurigami/contracts/artifacts/contracts/ReferralDirectory.sol/ReferralDirectory.json'));
|
|
25
|
+
var abis$e = _interopDefault(require('@aurigami/contracts/artifacts/contracts/plygame/PlyGame.sol/PlyGame.json'));
|
|
25
26
|
var MAINNET_ADDRESSES = _interopDefault(require('@aurigami/contracts/deployments/aurora_mainnet.json'));
|
|
26
27
|
var aurora_testnet_json = _interopDefault(require('@aurigami/contracts/deployments/aurora_testnet.json'));
|
|
27
28
|
var axios = _interopDefault(require('axios'));
|
|
@@ -45,7 +46,8 @@ var index = {
|
|
|
45
46
|
EthRepayHelperABI: abis$8,
|
|
46
47
|
Multicall2ABI: abis$b,
|
|
47
48
|
PulpABI: abis$c,
|
|
48
|
-
AuriInternalLensABI: abis$a
|
|
49
|
+
AuriInternalLensABI: abis$a,
|
|
50
|
+
PlyGameABI: abis$e
|
|
49
51
|
};
|
|
50
52
|
|
|
51
53
|
var dummyAddress = '0xDEADbeEfEEeEEEeEEEeEEeeeeeEeEEeeeeEEEEeE';
|
|
@@ -112,7 +114,8 @@ var networkAddresses = {
|
|
|
112
114
|
PULP_CONTRACT: /*#__PURE__*/'0x04ac48711bcdc45b4d223fb021e09da73c71095e'.toLowerCase(),
|
|
113
115
|
PLY_TOKEN_LOCK: /*#__PURE__*/MAINNET_ADDRESSES.plyTokenLock.toLowerCase(),
|
|
114
116
|
REFERRAL: /*#__PURE__*/MAINNET_ADDRESSES.referralDirectory.toLowerCase(),
|
|
115
|
-
AURI_INTERNAL_LENS: /*#__PURE__*/MAINNET_ADDRESSES.auriInternalLens.toLowerCase()
|
|
117
|
+
AURI_INTERNAL_LENS: /*#__PURE__*/MAINNET_ADDRESSES.auriInternalLens.toLowerCase(),
|
|
118
|
+
PLYGAME: /*#__PURE__*/'0x60bf668CA101060BD83BD644531a38719586B89f'.toLowerCase()
|
|
116
119
|
},
|
|
117
120
|
tokens: {
|
|
118
121
|
AURORA: /*#__PURE__*/'0x8bec47865ade3b172a928df8f990bc7f2a3b9f79'.toLowerCase(),
|
|
@@ -1103,10 +1106,17 @@ try {
|
|
|
1103
1106
|
});
|
|
1104
1107
|
|
|
1105
1108
|
var symbolRecords = /*#__PURE__*/Object.fromEntries( /*#__PURE__*/networkAddresses.auTokens.map(function (e) {
|
|
1106
|
-
return [e.address
|
|
1107
|
-
})
|
|
1108
|
-
|
|
1109
|
-
|
|
1109
|
+
return [e.address, e.name];
|
|
1110
|
+
}) // AuToken
|
|
1111
|
+
.concat(networkAddresses.auTokens.map(function (e) {
|
|
1112
|
+
return [e.underlying, e.name.slice(2)];
|
|
1113
|
+
})) // underlying token
|
|
1114
|
+
.concat([['0x04ac48711bcdc45b4d223fb021e09da73c71095e', 'PULP']]) // others
|
|
1115
|
+
.map(function (_ref) {
|
|
1116
|
+
var address = _ref[0],
|
|
1117
|
+
name = _ref[1];
|
|
1118
|
+
return [address.toLowerCase(), name];
|
|
1119
|
+
}));
|
|
1110
1120
|
|
|
1111
1121
|
var AURORA_API_BASE_URL = 'https://api.aurorascan.dev/api';
|
|
1112
1122
|
function getQuery(_x, _x2, _x3) {
|
|
@@ -1529,6 +1539,7 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
1529
1539
|
_this._auriAirdrop = null;
|
|
1530
1540
|
_this._referralDirectory = null;
|
|
1531
1541
|
_this._oracle = null;
|
|
1542
|
+
_this._plygame = null;
|
|
1532
1543
|
return _this;
|
|
1533
1544
|
}
|
|
1534
1545
|
|
|
@@ -1567,7 +1578,6 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
1567
1578
|
address = (_networkAddresses$auT = networkAddresses.auTokens.find(function (auToken) {
|
|
1568
1579
|
return auToken.name == 'au' + underlyingName;
|
|
1569
1580
|
})) == null ? void 0 : _networkAddresses$auT.address;
|
|
1570
|
-
console.log(address);
|
|
1571
1581
|
assert(address !== undefined, "AuToken with underlying " + underlyingName + " not found");
|
|
1572
1582
|
}
|
|
1573
1583
|
|
|
@@ -1655,6 +1665,15 @@ var AuriEnv = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
1655
1665
|
|
|
1656
1666
|
return this._oracle;
|
|
1657
1667
|
}
|
|
1668
|
+
}, {
|
|
1669
|
+
key: "plygame",
|
|
1670
|
+
get: function get() {
|
|
1671
|
+
if (!this._plygame) {
|
|
1672
|
+
this._plygame = this.getContract(networkAddresses.misc.PLYGAME, abis$e.abi);
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
return this._plygame;
|
|
1676
|
+
}
|
|
1658
1677
|
}]);
|
|
1659
1678
|
|
|
1660
1679
|
return AuriEnv;
|
|
@@ -4610,6 +4629,347 @@ var MiscRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4610
4629
|
return MiscRead;
|
|
4611
4630
|
}(BlockchainEntityRead);
|
|
4612
4631
|
|
|
4632
|
+
var PlyGameRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
4633
|
+
_inheritsLoose(PlyGameRead, _BlockchainEntityRead);
|
|
4634
|
+
|
|
4635
|
+
function PlyGameRead(networkConnection) {
|
|
4636
|
+
var _this;
|
|
4637
|
+
|
|
4638
|
+
_this = _BlockchainEntityRead.call(this, networkConnection) || this;
|
|
4639
|
+
_this.env = new AuriEnv(networkConnection);
|
|
4640
|
+
var plyAddress = networkAddresses.tokens.PLY;
|
|
4641
|
+
var pulpAddress = networkAddresses.tokens.PULP;
|
|
4642
|
+
_this.plyToken = new Token(plyAddress, getDecimal(plyAddress));
|
|
4643
|
+
_this.pulpToken = new Token(pulpAddress, getDecimal(pulpAddress));
|
|
4644
|
+
return _this;
|
|
4645
|
+
}
|
|
4646
|
+
|
|
4647
|
+
var _proto = PlyGameRead.prototype;
|
|
4648
|
+
|
|
4649
|
+
_proto.parseBetMakeEvent = function parseBetMakeEvent(event) {
|
|
4650
|
+
var outcome = ['bigWin', 'win', 'lose', 'noImpact'][event.args.outcome];
|
|
4651
|
+
var amount = event.args.amount;
|
|
4652
|
+
var unlock = amount.mul([10, 1, 0, 0][event.args.outcome]);
|
|
4653
|
+
return {
|
|
4654
|
+
player: event.args.player,
|
|
4655
|
+
amount: new TokenAmount(this.plyToken, amount.toString()),
|
|
4656
|
+
unlockedPulpAmount: new TokenAmount(this.pulpToken, unlock.toString()),
|
|
4657
|
+
outcome: outcome,
|
|
4658
|
+
transactionHash: event.transactionHash,
|
|
4659
|
+
block: event.blockNumber,
|
|
4660
|
+
timestamp: 0
|
|
4661
|
+
};
|
|
4662
|
+
};
|
|
4663
|
+
|
|
4664
|
+
_proto.attachTimestamp = /*#__PURE__*/function () {
|
|
4665
|
+
var _attachTimestamp = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(results) {
|
|
4666
|
+
var blockNumbers, blockstimestamp;
|
|
4667
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
4668
|
+
while (1) {
|
|
4669
|
+
switch (_context.prev = _context.next) {
|
|
4670
|
+
case 0:
|
|
4671
|
+
blockNumbers = results.map(function (e) {
|
|
4672
|
+
return e.block;
|
|
4673
|
+
});
|
|
4674
|
+
_context.next = 3;
|
|
4675
|
+
return getBlocksTimestamp(this._networkConnection.provider, blockNumbers);
|
|
4676
|
+
|
|
4677
|
+
case 3:
|
|
4678
|
+
blockstimestamp = _context.sent;
|
|
4679
|
+
return _context.abrupt("return", results.map(function (e, i) {
|
|
4680
|
+
return _extends({}, e, {
|
|
4681
|
+
timestamp: blockstimestamp[i]
|
|
4682
|
+
});
|
|
4683
|
+
}));
|
|
4684
|
+
|
|
4685
|
+
case 5:
|
|
4686
|
+
case "end":
|
|
4687
|
+
return _context.stop();
|
|
4688
|
+
}
|
|
4689
|
+
}
|
|
4690
|
+
}, _callee, this);
|
|
4691
|
+
}));
|
|
4692
|
+
|
|
4693
|
+
function attachTimestamp(_x) {
|
|
4694
|
+
return _attachTimestamp.apply(this, arguments);
|
|
4695
|
+
}
|
|
4696
|
+
|
|
4697
|
+
return attachTimestamp;
|
|
4698
|
+
}()
|
|
4699
|
+
/**
|
|
4700
|
+
* Get 100 most recent bets of the market users
|
|
4701
|
+
*/
|
|
4702
|
+
;
|
|
4703
|
+
|
|
4704
|
+
_proto.getUserPlyGameHistory =
|
|
4705
|
+
/*#__PURE__*/
|
|
4706
|
+
function () {
|
|
4707
|
+
var _getUserPlyGameHistory = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(user) {
|
|
4708
|
+
var _this2 = this;
|
|
4709
|
+
|
|
4710
|
+
var block100, filter, events;
|
|
4711
|
+
return runtime_1.wrap(function _callee2$(_context2) {
|
|
4712
|
+
while (1) {
|
|
4713
|
+
switch (_context2.prev = _context2.next) {
|
|
4714
|
+
case 0:
|
|
4715
|
+
_context2.next = 2;
|
|
4716
|
+
return this.env.plygame.getLastBlock(user, 100);
|
|
4717
|
+
|
|
4718
|
+
case 2:
|
|
4719
|
+
block100 = _context2.sent;
|
|
4720
|
+
|
|
4721
|
+
if (!block100.eq(0)) {
|
|
4722
|
+
_context2.next = 5;
|
|
4723
|
+
break;
|
|
4724
|
+
}
|
|
4725
|
+
|
|
4726
|
+
return _context2.abrupt("return", []);
|
|
4727
|
+
|
|
4728
|
+
case 5:
|
|
4729
|
+
filter = this.env.plygame.filters.BetMade(user);
|
|
4730
|
+
_context2.next = 8;
|
|
4731
|
+
return this.env.plygame.queryFilter(filter, block100.toNumber());
|
|
4732
|
+
|
|
4733
|
+
case 8:
|
|
4734
|
+
events = _context2.sent;
|
|
4735
|
+
return _context2.abrupt("return", this.attachTimestamp(events.map(function (event) {
|
|
4736
|
+
return _this2.parseBetMakeEvent(event);
|
|
4737
|
+
})));
|
|
4738
|
+
|
|
4739
|
+
case 10:
|
|
4740
|
+
case "end":
|
|
4741
|
+
return _context2.stop();
|
|
4742
|
+
}
|
|
4743
|
+
}
|
|
4744
|
+
}, _callee2, this);
|
|
4745
|
+
}));
|
|
4746
|
+
|
|
4747
|
+
function getUserPlyGameHistory(_x2) {
|
|
4748
|
+
return _getUserPlyGameHistory.apply(this, arguments);
|
|
4749
|
+
}
|
|
4750
|
+
|
|
4751
|
+
return getUserPlyGameHistory;
|
|
4752
|
+
}()
|
|
4753
|
+
/**
|
|
4754
|
+
* Get current jackpot amount
|
|
4755
|
+
*/
|
|
4756
|
+
;
|
|
4757
|
+
|
|
4758
|
+
_proto.currentJackpotAmount =
|
|
4759
|
+
/*#__PURE__*/
|
|
4760
|
+
function () {
|
|
4761
|
+
var _currentJackpotAmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3() {
|
|
4762
|
+
var jackpot;
|
|
4763
|
+
return runtime_1.wrap(function _callee3$(_context3) {
|
|
4764
|
+
while (1) {
|
|
4765
|
+
switch (_context3.prev = _context3.next) {
|
|
4766
|
+
case 0:
|
|
4767
|
+
_context3.next = 2;
|
|
4768
|
+
return this.env.plygame.currentJackpotAmount();
|
|
4769
|
+
|
|
4770
|
+
case 2:
|
|
4771
|
+
jackpot = _context3.sent;
|
|
4772
|
+
return _context3.abrupt("return", new TokenAmount(this.plyToken, jackpot.toString()));
|
|
4773
|
+
|
|
4774
|
+
case 4:
|
|
4775
|
+
case "end":
|
|
4776
|
+
return _context3.stop();
|
|
4777
|
+
}
|
|
4778
|
+
}
|
|
4779
|
+
}, _callee3, this);
|
|
4780
|
+
}));
|
|
4781
|
+
|
|
4782
|
+
function currentJackpotAmount() {
|
|
4783
|
+
return _currentJackpotAmount.apply(this, arguments);
|
|
4784
|
+
}
|
|
4785
|
+
|
|
4786
|
+
return currentJackpotAmount;
|
|
4787
|
+
}();
|
|
4788
|
+
|
|
4789
|
+
_proto.nextJackpotRevealTime = /*#__PURE__*/function () {
|
|
4790
|
+
var _nextJackpotRevealTime = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
|
|
4791
|
+
return runtime_1.wrap(function _callee4$(_context4) {
|
|
4792
|
+
while (1) {
|
|
4793
|
+
switch (_context4.prev = _context4.next) {
|
|
4794
|
+
case 0:
|
|
4795
|
+
return _context4.abrupt("return", 0);
|
|
4796
|
+
|
|
4797
|
+
case 1:
|
|
4798
|
+
case "end":
|
|
4799
|
+
return _context4.stop();
|
|
4800
|
+
}
|
|
4801
|
+
}
|
|
4802
|
+
}, _callee4);
|
|
4803
|
+
}));
|
|
4804
|
+
|
|
4805
|
+
function nextJackpotRevealTime() {
|
|
4806
|
+
return _nextJackpotRevealTime.apply(this, arguments);
|
|
4807
|
+
}
|
|
4808
|
+
|
|
4809
|
+
return nextJackpotRevealTime;
|
|
4810
|
+
}();
|
|
4811
|
+
|
|
4812
|
+
_proto.earlyUnlockedPulpAmount = /*#__PURE__*/function () {
|
|
4813
|
+
var _earlyUnlockedPulpAmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(user) {
|
|
4814
|
+
var earlyUnlockedPulpAmount;
|
|
4815
|
+
return runtime_1.wrap(function _callee5$(_context5) {
|
|
4816
|
+
while (1) {
|
|
4817
|
+
switch (_context5.prev = _context5.next) {
|
|
4818
|
+
case 0:
|
|
4819
|
+
_context5.next = 2;
|
|
4820
|
+
return this.env.plygame.totalPlyUnlockedEarly(user);
|
|
4821
|
+
|
|
4822
|
+
case 2:
|
|
4823
|
+
earlyUnlockedPulpAmount = _context5.sent;
|
|
4824
|
+
return _context5.abrupt("return", new TokenAmount(this.pulpToken, earlyUnlockedPulpAmount.toString()));
|
|
4825
|
+
|
|
4826
|
+
case 4:
|
|
4827
|
+
case "end":
|
|
4828
|
+
return _context5.stop();
|
|
4829
|
+
}
|
|
4830
|
+
}
|
|
4831
|
+
}, _callee5, this);
|
|
4832
|
+
}));
|
|
4833
|
+
|
|
4834
|
+
function earlyUnlockedPulpAmount(_x3) {
|
|
4835
|
+
return _earlyUnlockedPulpAmount.apply(this, arguments);
|
|
4836
|
+
}
|
|
4837
|
+
|
|
4838
|
+
return earlyUnlockedPulpAmount;
|
|
4839
|
+
}();
|
|
4840
|
+
|
|
4841
|
+
_proto.getPlyGameResultsInTransaction = /*#__PURE__*/function () {
|
|
4842
|
+
var _getPlyGameResultsInTransaction = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(txHash) {
|
|
4843
|
+
var _this3 = this;
|
|
4844
|
+
|
|
4845
|
+
var tx, filter, betMadeEvents;
|
|
4846
|
+
return runtime_1.wrap(function _callee6$(_context6) {
|
|
4847
|
+
while (1) {
|
|
4848
|
+
switch (_context6.prev = _context6.next) {
|
|
4849
|
+
case 0:
|
|
4850
|
+
_context6.next = 2;
|
|
4851
|
+
return this._networkConnection.provider.getTransactionReceipt(txHash);
|
|
4852
|
+
|
|
4853
|
+
case 2:
|
|
4854
|
+
tx = _context6.sent;
|
|
4855
|
+
filter = this.env.plygame.filters.BetMade();
|
|
4856
|
+
betMadeEvents = tx.logs.filter(function (log) {
|
|
4857
|
+
return isSameAddress(log.topics[0], filter.topics[0]);
|
|
4858
|
+
}).map(function (log) {
|
|
4859
|
+
return _extends({}, _this3.env.plygame["interface"].parseLog(log), {
|
|
4860
|
+
blockNumber: tx.blockNumber,
|
|
4861
|
+
transactionHash: txHash
|
|
4862
|
+
});
|
|
4863
|
+
});
|
|
4864
|
+
return _context6.abrupt("return", this.attachTimestamp(betMadeEvents.map(function (e) {
|
|
4865
|
+
return _this3.parseBetMakeEvent(e);
|
|
4866
|
+
})));
|
|
4867
|
+
|
|
4868
|
+
case 6:
|
|
4869
|
+
case "end":
|
|
4870
|
+
return _context6.stop();
|
|
4871
|
+
}
|
|
4872
|
+
}
|
|
4873
|
+
}, _callee6, this);
|
|
4874
|
+
}));
|
|
4875
|
+
|
|
4876
|
+
function getPlyGameResultsInTransaction(_x4) {
|
|
4877
|
+
return _getPlyGameResultsInTransaction.apply(this, arguments);
|
|
4878
|
+
}
|
|
4879
|
+
|
|
4880
|
+
return getPlyGameResultsInTransaction;
|
|
4881
|
+
}();
|
|
4882
|
+
|
|
4883
|
+
return PlyGameRead;
|
|
4884
|
+
}(BlockchainEntityRead);
|
|
4885
|
+
var PlyGameReadWrite = /*#__PURE__*/function (_PlyGameRead) {
|
|
4886
|
+
_inheritsLoose(PlyGameReadWrite, _PlyGameRead);
|
|
4887
|
+
|
|
4888
|
+
function PlyGameReadWrite() {
|
|
4889
|
+
return _PlyGameRead.apply(this, arguments) || this;
|
|
4890
|
+
}
|
|
4891
|
+
|
|
4892
|
+
var _proto2 = PlyGameReadWrite.prototype;
|
|
4893
|
+
|
|
4894
|
+
/**
|
|
4895
|
+
* makes "times" independent bets, but consecutively, of the same amount
|
|
4896
|
+
*/
|
|
4897
|
+
_proto2.makeBetMultiple =
|
|
4898
|
+
/*#__PURE__*/
|
|
4899
|
+
function () {
|
|
4900
|
+
var _makeBetMultiple = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(amount, times) {
|
|
4901
|
+
return runtime_1.wrap(function _callee7$(_context7) {
|
|
4902
|
+
while (1) {
|
|
4903
|
+
switch (_context7.prev = _context7.next) {
|
|
4904
|
+
case 0:
|
|
4905
|
+
return _context7.abrupt("return", this.env.plygame.connect(this._networkConnection.signer).makeBetMultiple(amount.rawAmount(), times));
|
|
4906
|
+
|
|
4907
|
+
case 1:
|
|
4908
|
+
case "end":
|
|
4909
|
+
return _context7.stop();
|
|
4910
|
+
}
|
|
4911
|
+
}
|
|
4912
|
+
}, _callee7, this);
|
|
4913
|
+
}));
|
|
4914
|
+
|
|
4915
|
+
function makeBetMultiple(_x5, _x6) {
|
|
4916
|
+
return _makeBetMultiple.apply(this, arguments);
|
|
4917
|
+
}
|
|
4918
|
+
|
|
4919
|
+
return makeBetMultiple;
|
|
4920
|
+
}()
|
|
4921
|
+
/**
|
|
4922
|
+
* Make a single bet
|
|
4923
|
+
*/
|
|
4924
|
+
;
|
|
4925
|
+
|
|
4926
|
+
_proto2.makeBetOnce =
|
|
4927
|
+
/*#__PURE__*/
|
|
4928
|
+
function () {
|
|
4929
|
+
var _makeBetOnce = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(amount) {
|
|
4930
|
+
return runtime_1.wrap(function _callee8$(_context8) {
|
|
4931
|
+
while (1) {
|
|
4932
|
+
switch (_context8.prev = _context8.next) {
|
|
4933
|
+
case 0:
|
|
4934
|
+
return _context8.abrupt("return", this.env.plygame.connect(this._networkConnection.signer).makeBetOnce(amount.rawAmount()));
|
|
4935
|
+
|
|
4936
|
+
case 1:
|
|
4937
|
+
case "end":
|
|
4938
|
+
return _context8.stop();
|
|
4939
|
+
}
|
|
4940
|
+
}
|
|
4941
|
+
}, _callee8, this);
|
|
4942
|
+
}));
|
|
4943
|
+
|
|
4944
|
+
function makeBetOnce(_x7) {
|
|
4945
|
+
return _makeBetOnce.apply(this, arguments);
|
|
4946
|
+
}
|
|
4947
|
+
|
|
4948
|
+
return makeBetOnce;
|
|
4949
|
+
}();
|
|
4950
|
+
|
|
4951
|
+
return PlyGameReadWrite;
|
|
4952
|
+
}(PlyGameRead);
|
|
4953
|
+
var PlyGame = /*#__PURE__*/function (_BlockchainEntity) {
|
|
4954
|
+
_inheritsLoose(PlyGame, _BlockchainEntity);
|
|
4955
|
+
|
|
4956
|
+
function PlyGame() {
|
|
4957
|
+
return _BlockchainEntity.call(this) || this;
|
|
4958
|
+
}
|
|
4959
|
+
|
|
4960
|
+
var _proto3 = PlyGame.prototype;
|
|
4961
|
+
|
|
4962
|
+
_proto3.read = function read(networkConnection) {
|
|
4963
|
+
return new PlyGameRead(networkConnection);
|
|
4964
|
+
};
|
|
4965
|
+
|
|
4966
|
+
_proto3.readWrite = function readWrite(networkConnection) {
|
|
4967
|
+
return new PlyGameReadWrite(networkConnection);
|
|
4968
|
+
};
|
|
4969
|
+
|
|
4970
|
+
return PlyGame;
|
|
4971
|
+
}(BlockchainEntity);
|
|
4972
|
+
|
|
4613
4973
|
var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
4614
4974
|
_inheritsLoose(ReferralRead, _BlockchainEntityRead);
|
|
4615
4975
|
|
|
@@ -5454,6 +5814,9 @@ exports.PRICE_WHITELISTED = PRICE_WHITELISTED;
|
|
|
5454
5814
|
exports.Papermill = Papermill;
|
|
5455
5815
|
exports.PapermillRead = PapermillRead;
|
|
5456
5816
|
exports.PapermillReadWrite = PapermillReadWrite;
|
|
5817
|
+
exports.PlyGame = PlyGame;
|
|
5818
|
+
exports.PlyGameRead = PlyGameRead;
|
|
5819
|
+
exports.PlyGameReadWrite = PlyGameReadWrite;
|
|
5457
5820
|
exports.REFERRAL_CAMPAIGNS = REFERRAL_CAMPAIGNS;
|
|
5458
5821
|
exports.REWARD_CLAIM_START = REWARD_CLAIM_START;
|
|
5459
5822
|
exports.Referral = Referral;
|