@aurigami/sdk 1.11.1 → 1.12.0-beta1

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.
@@ -54,6 +54,7 @@ var dummyAddress = '0xDEADbeEfEEeEEEeEEEeEEeeeeeEeEEeeeeEEEEeE';
54
54
  var ETHAddress = '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE';
55
55
  var AURORA_CHAINID = 1313161554;
56
56
  var DECIMAL_PRECISION = 10;
57
+ var AURORA_PLUS_API_PREFIX = 'https://aurora.plus/api/wallet/';
57
58
  var networkAddresses = {
58
59
  auTokens: [{
59
60
  name: 'auUSDC',
@@ -115,7 +116,7 @@ var networkAddresses = {
115
116
  PLY_TOKEN_LOCK: /*#__PURE__*/MAINNET_ADDRESSES.plyTokenLock.toLowerCase(),
116
117
  REFERRAL: /*#__PURE__*/MAINNET_ADDRESSES.referralDirectory.toLowerCase(),
117
118
  AURI_INTERNAL_LENS: /*#__PURE__*/MAINNET_ADDRESSES.auriInternalLens.toLowerCase(),
118
- PLYGAME: /*#__PURE__*/MAINNET_ADDRESSES.plyGame.toLowerCase()
119
+ PLYGAME: /*#__PURE__*/'0x60bf668CA101060BD83BD644531a38719586B89f'.toLowerCase()
119
120
  },
120
121
  tokens: {
121
122
  AURORA: /*#__PURE__*/'0x8bec47865ade3b172a928df8f990bc7f2a3b9f79'.toLowerCase(),
@@ -1212,30 +1213,6 @@ var isSameAddress = function isSameAddress(address1, address2) {
1212
1213
  var getCurrentTimestamp = function getCurrentTimestamp() {
1213
1214
  return Math.trunc(Date.now() / 1000);
1214
1215
  };
1215
- function sleep(_x) {
1216
- return _sleep.apply(this, arguments);
1217
- }
1218
-
1219
- function _sleep() {
1220
- _sleep = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(duration) {
1221
- return runtime_1.wrap(function _callee$(_context) {
1222
- while (1) {
1223
- switch (_context.prev = _context.next) {
1224
- case 0:
1225
- return _context.abrupt("return", new Promise(function (resolve) {
1226
- setTimeout(resolve, duration);
1227
- }));
1228
-
1229
- case 1:
1230
- case "end":
1231
- return _context.stop();
1232
- }
1233
- }
1234
- }, _callee);
1235
- }));
1236
- return _sleep.apply(this, arguments);
1237
- }
1238
-
1239
1216
  function validateAndParseAddress(address) {
1240
1217
  try {
1241
1218
  return ethers.utils.getAddress(address);
@@ -1277,35 +1254,35 @@ function calcLMRewardApr(rewardsValue, totalStakeValue, frequencyPerYear) {
1277
1254
 
1278
1255
  return rewardsValue.multipliedBy(frequencyPerYear).dividedBy(totalStakeValue);
1279
1256
  }
1280
- function getBlockTimestamp(_x2, _x3) {
1257
+ function getBlockTimestamp(_x, _x2) {
1281
1258
  return _getBlockTimestamp.apply(this, arguments);
1282
1259
  }
1283
1260
 
1284
1261
  function _getBlockTimestamp() {
1285
- _getBlockTimestamp = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(provider, blockNumber) {
1262
+ _getBlockTimestamp = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(provider, blockNumber) {
1286
1263
  var block;
1287
- return runtime_1.wrap(function _callee2$(_context2) {
1264
+ return runtime_1.wrap(function _callee$(_context) {
1288
1265
  while (1) {
1289
- switch (_context2.prev = _context2.next) {
1266
+ switch (_context.prev = _context.next) {
1290
1267
  case 0:
1291
- _context2.next = 2;
1268
+ _context.next = 2;
1292
1269
  return provider.getBlock(blockNumber);
1293
1270
 
1294
1271
  case 2:
1295
- block = _context2.sent;
1296
- return _context2.abrupt("return", block.timestamp);
1272
+ block = _context.sent;
1273
+ return _context.abrupt("return", block.timestamp);
1297
1274
 
1298
1275
  case 4:
1299
1276
  case "end":
1300
- return _context2.stop();
1277
+ return _context.stop();
1301
1278
  }
1302
1279
  }
1303
- }, _callee2);
1280
+ }, _callee);
1304
1281
  }));
1305
1282
  return _getBlockTimestamp.apply(this, arguments);
1306
1283
  }
1307
1284
 
1308
- function getBlocksTimestampViaRPC(_x4, _x5) {
1285
+ function getBlocksTimestampViaRPC(_x3, _x4) {
1309
1286
  return _getBlocksTimestampViaRPC.apply(this, arguments);
1310
1287
  }
1311
1288
  /**
@@ -1315,11 +1292,11 @@ function getBlocksTimestampViaRPC(_x4, _x5) {
1315
1292
  */
1316
1293
 
1317
1294
  function _getBlocksTimestampViaRPC() {
1318
- _getBlocksTimestampViaRPC = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(provider, blocksNumber) {
1295
+ _getBlocksTimestampViaRPC = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(provider, blocksNumber) {
1319
1296
  var CHUNK_SIZE, results, i, slice, promises;
1320
- return runtime_1.wrap(function _callee4$(_context4) {
1297
+ return runtime_1.wrap(function _callee3$(_context3) {
1321
1298
  while (1) {
1322
- switch (_context4.prev = _context4.next) {
1299
+ switch (_context3.prev = _context3.next) {
1323
1300
  case 0:
1324
1301
  // Promise all 200 blocks at a time, using too many blocks at once will cause the RPC call timeout.
1325
1302
  CHUNK_SIZE = 200;
@@ -1328,58 +1305,58 @@ function _getBlocksTimestampViaRPC() {
1328
1305
 
1329
1306
  case 3:
1330
1307
  if (!(i < blocksNumber.length)) {
1331
- _context4.next = 14;
1308
+ _context3.next = 14;
1332
1309
  break;
1333
1310
  }
1334
1311
 
1335
1312
  slice = blocksNumber.slice(i, i + CHUNK_SIZE);
1336
1313
  promises = slice.map( /*#__PURE__*/function () {
1337
- var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(blockNumber) {
1338
- return runtime_1.wrap(function _callee3$(_context3) {
1314
+ var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(blockNumber) {
1315
+ return runtime_1.wrap(function _callee2$(_context2) {
1339
1316
  while (1) {
1340
- switch (_context3.prev = _context3.next) {
1317
+ switch (_context2.prev = _context2.next) {
1341
1318
  case 0:
1342
- return _context3.abrupt("return", getBlockTimestamp(provider, blockNumber));
1319
+ return _context2.abrupt("return", getBlockTimestamp(provider, blockNumber));
1343
1320
 
1344
1321
  case 1:
1345
1322
  case "end":
1346
- return _context3.stop();
1323
+ return _context2.stop();
1347
1324
  }
1348
1325
  }
1349
- }, _callee3);
1326
+ }, _callee2);
1350
1327
  }));
1351
1328
 
1352
- return function (_x10) {
1329
+ return function (_x9) {
1353
1330
  return _ref.apply(this, arguments);
1354
1331
  };
1355
1332
  }());
1356
- _context4.t0 = results;
1357
- _context4.next = 9;
1333
+ _context3.t0 = results;
1334
+ _context3.next = 9;
1358
1335
  return Promise.all(promises);
1359
1336
 
1360
1337
  case 9:
1361
- _context4.t1 = _context4.sent;
1362
- results = _context4.t0.concat.call(_context4.t0, _context4.t1);
1338
+ _context3.t1 = _context3.sent;
1339
+ results = _context3.t0.concat.call(_context3.t0, _context3.t1);
1363
1340
 
1364
1341
  case 11:
1365
1342
  i += CHUNK_SIZE;
1366
- _context4.next = 3;
1343
+ _context3.next = 3;
1367
1344
  break;
1368
1345
 
1369
1346
  case 14:
1370
- return _context4.abrupt("return", results);
1347
+ return _context3.abrupt("return", results);
1371
1348
 
1372
1349
  case 15:
1373
1350
  case "end":
1374
- return _context4.stop();
1351
+ return _context3.stop();
1375
1352
  }
1376
1353
  }
1377
- }, _callee4);
1354
+ }, _callee3);
1378
1355
  }));
1379
1356
  return _getBlocksTimestampViaRPC.apply(this, arguments);
1380
1357
  }
1381
1358
 
1382
- function getBlocksTimestamp(_x6, _x7) {
1359
+ function getBlocksTimestamp(_x5, _x6) {
1383
1360
  return _getBlocksTimestamp.apply(this, arguments);
1384
1361
  }
1385
1362
  /**
@@ -1392,18 +1369,18 @@ function getBlocksTimestamp(_x6, _x7) {
1392
1369
  */
1393
1370
 
1394
1371
  function _getBlocksTimestamp() {
1395
- _getBlocksTimestamp = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(provider, blockNumbers) {
1372
+ _getBlocksTimestamp = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(provider, blockNumbers) {
1396
1373
  var CHUNK_SIZE, promises, lines, i, query, results, missingBlocks, missingBlocksTimestamps;
1397
- return runtime_1.wrap(function _callee5$(_context5) {
1374
+ return runtime_1.wrap(function _callee4$(_context4) {
1398
1375
  while (1) {
1399
- switch (_context5.prev = _context5.next) {
1376
+ switch (_context4.prev = _context4.next) {
1400
1377
  case 0:
1401
1378
  if (!(blockNumbers.length == 0)) {
1402
- _context5.next = 2;
1379
+ _context4.next = 2;
1403
1380
  break;
1404
1381
  }
1405
1382
 
1406
- return _context5.abrupt("return", []);
1383
+ return _context4.abrupt("return", []);
1407
1384
 
1408
1385
  case 2:
1409
1386
  CHUNK_SIZE = 100; // graphql query limit
@@ -1419,11 +1396,11 @@ function _getBlocksTimestamp() {
1419
1396
  } // merge all the json objects
1420
1397
 
1421
1398
 
1422
- _context5.next = 8;
1399
+ _context4.next = 8;
1423
1400
  return Promise.all(promises);
1424
1401
 
1425
1402
  case 8:
1426
- results = _context5.sent.reduce(function (acc, cur) {
1403
+ results = _context4.sent.reduce(function (acc, cur) {
1427
1404
  return _extends({}, acc, cur);
1428
1405
  });
1429
1406
  missingBlocks = blockNumbers.filter(function (blockNumber) {
@@ -1434,71 +1411,71 @@ function _getBlocksTimestamp() {
1434
1411
  devLog("These blocks are missing from Aurora GraphQL endpoint: " + missingBlocks.join(', '));
1435
1412
  }
1436
1413
 
1437
- _context5.next = 13;
1414
+ _context4.next = 13;
1438
1415
  return getBlocksTimestampViaRPC(provider, missingBlocks);
1439
1416
 
1440
1417
  case 13:
1441
- missingBlocksTimestamps = _context5.sent;
1418
+ missingBlocksTimestamps = _context4.sent;
1442
1419
  missingBlocksTimestamps.forEach(function (timestamp, index) {
1443
1420
  results["b" + missingBlocks[index]] = {
1444
1421
  timestamp: new Date(timestamp * 1000).toISOString()
1445
1422
  };
1446
1423
  });
1447
- return _context5.abrupt("return", blockNumbers.map(function (blockNumber) {
1424
+ return _context4.abrupt("return", blockNumbers.map(function (blockNumber) {
1448
1425
  return Math.trunc(new Date(results["b" + blockNumber].timestamp).getTime() / 1000);
1449
1426
  }));
1450
1427
 
1451
1428
  case 16:
1452
1429
  case "end":
1453
- return _context5.stop();
1430
+ return _context4.stop();
1454
1431
  }
1455
1432
  }
1456
- }, _callee5);
1433
+ }, _callee4);
1457
1434
  }));
1458
1435
  return _getBlocksTimestamp.apply(this, arguments);
1459
1436
  }
1460
1437
 
1461
- function getBlockBeforeTimestamp(_x8, _x9) {
1438
+ function getBlockBeforeTimestamp(_x7, _x8) {
1462
1439
  return _getBlockBeforeTimestamp.apply(this, arguments);
1463
1440
  }
1464
1441
 
1465
1442
  function _getBlockBeforeTimestamp() {
1466
- _getBlockBeforeTimestamp = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(provider, timestamp) {
1443
+ _getBlockBeforeTimestamp = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(provider, timestamp) {
1467
1444
  var result;
1468
- return runtime_1.wrap(function _callee6$(_context6) {
1445
+ return runtime_1.wrap(function _callee5$(_context5) {
1469
1446
  while (1) {
1470
- switch (_context6.prev = _context6.next) {
1447
+ switch (_context5.prev = _context5.next) {
1471
1448
  case 0:
1472
- _context6.next = 2;
1449
+ _context5.next = 2;
1473
1450
  return getQuery('block', 'getblocknobytime', {
1474
1451
  timestamp: timestamp,
1475
1452
  closest: 'before'
1476
1453
  });
1477
1454
 
1478
1455
  case 2:
1479
- result = _context6.sent;
1480
- _context6.t0 = parseInt(result);
1456
+ result = _context5.sent;
1457
+ _context5.t0 = parseInt(result);
1481
1458
 
1482
- if (_context6.t0) {
1483
- _context6.next = 8;
1459
+ if (_context5.t0) {
1460
+ _context5.next = 8;
1484
1461
  break;
1485
1462
  }
1486
1463
 
1487
- _context6.next = 7;
1464
+ _context5.next = 7;
1488
1465
  return provider.getBlockNumber();
1489
1466
 
1490
1467
  case 7:
1491
- _context6.t0 = _context6.sent;
1468
+ _context5.t0 = _context5.sent;
1492
1469
 
1493
1470
  case 8:
1494
- return _context6.abrupt("return", _context6.t0);
1471
+ return _context5.abrupt("return", _context5.t0);
1495
1472
 
1496
1473
  case 9:
1497
1474
  case "end":
1498
- return _context6.stop();
1475
+ return _context5.stop();
1499
1476
  }
1500
1477
  }
1501
- }, _callee6);
1478
+ }, _callee5);
1502
1479
  }));
1503
1480
  return _getBlockBeforeTimestamp.apply(this, arguments);
1504
1481
  }
@@ -1514,20 +1491,6 @@ function devLog(message) {
1514
1491
  (_console = console).log.apply(_console, ['[DEV LOG]', message].concat(optionalParams));
1515
1492
  }
1516
1493
  }
1517
- /**
1518
- * Sorts (in place) an array of Events by blocknumber.
1519
- * This method mutates the array and returns a reference to the same array.
1520
- **/
1521
-
1522
- function sortEvents(events) {
1523
- return events.sort(function (a, b) {
1524
- if (a.blockNumber == b.blockNumber) {
1525
- return a.logIndex - b.logIndex;
1526
- }
1527
-
1528
- return a.blockNumber - b.blockNumber;
1529
- });
1530
- }
1531
1494
 
1532
1495
  var BlockchainEntityRead = function BlockchainEntityRead(networkConnection) {
1533
1496
  this._networkConnection = networkConnection;
@@ -2626,7 +2589,6 @@ var helpers = {
2626
2589
  decimalFactor: decimalFactor,
2627
2590
  isSameAddress: isSameAddress,
2628
2591
  getCurrentTimestamp: getCurrentTimestamp,
2629
- sleep: sleep,
2630
2592
  validateAndParseAddress: validateAndParseAddress,
2631
2593
  getDecimal: getDecimal,
2632
2594
  getSymbol: getSymbol,
@@ -2637,7 +2599,6 @@ var helpers = {
2637
2599
  getBlocksTimestamp: getBlocksTimestamp,
2638
2600
  getBlockBeforeTimestamp: getBlockBeforeTimestamp,
2639
2601
  devLog: devLog,
2640
- sortEvents: sortEvents,
2641
2602
  fetchPriceFromCoingeckoAPI: fetchPriceFromCoingeckoAPI,
2642
2603
  fetchPriceFromCoingecko: fetchPriceFromCoingecko,
2643
2604
  fetchLPPositions: fetchLPPositions,
@@ -4688,14 +4649,11 @@ var PlyGameRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4688
4649
 
4689
4650
  _proto.parseBetMakeEvent = function parseBetMakeEvent(event) {
4690
4651
  var outcome = ['bigWin', 'win', 'lose', 'noImpact'][event.args.outcome];
4691
- var betAmount = event.args.amount; // 0%, 0%, 100%, 2%
4692
- // big win, win, lose, no impact
4693
-
4694
- var lostAmount = betAmount.mul([0, 0, 100, 2][event.args.outcome]).div(100);
4695
- var unlock = betAmount.mul([10, 1, 0, 0][event.args.outcome]);
4652
+ var amount = event.args.amount;
4653
+ var unlock = amount.mul([10, 1, 0, 0][event.args.outcome]);
4696
4654
  return {
4697
4655
  player: event.args.player,
4698
- lostAmount: new TokenAmount(this.plyToken, lostAmount.toString()),
4656
+ amount: new TokenAmount(this.plyToken, amount.toString()),
4699
4657
  unlockedPulpAmount: new TokenAmount(this.pulpToken, unlock.toString()),
4700
4658
  outcome: outcome,
4701
4659
  transactionHash: event.transactionHash,
@@ -4775,13 +4733,11 @@ var PlyGameRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4775
4733
 
4776
4734
  case 8:
4777
4735
  events = _context2.sent;
4778
- // Sort descending by block number
4779
- sortEvents(events).reverse();
4780
4736
  return _context2.abrupt("return", this.attachTimestamp(events.map(function (event) {
4781
4737
  return _this2.parseBetMakeEvent(event);
4782
4738
  })));
4783
4739
 
4784
- case 11:
4740
+ case 10:
4785
4741
  case "end":
4786
4742
  return _context2.stop();
4787
4743
  }
@@ -4831,81 +4787,72 @@ var PlyGameRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4831
4787
  return currentJackpotAmount;
4832
4788
  }();
4833
4789
 
4834
- _proto.earlyUnlockedPulpAmount = /*#__PURE__*/function () {
4835
- var _earlyUnlockedPulpAmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(user) {
4836
- var earlyUnlockedPulpAmount;
4790
+ _proto.nextJackpotRevealTime = /*#__PURE__*/function () {
4791
+ var _nextJackpotRevealTime = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4() {
4837
4792
  return runtime_1.wrap(function _callee4$(_context4) {
4838
4793
  while (1) {
4839
4794
  switch (_context4.prev = _context4.next) {
4840
4795
  case 0:
4841
- _context4.next = 2;
4842
- return this.env.plygame.totalPlyUnlockedEarly(user);
4843
-
4844
- case 2:
4845
- earlyUnlockedPulpAmount = _context4.sent;
4846
- return _context4.abrupt("return", new TokenAmount(this.pulpToken, earlyUnlockedPulpAmount.toString()));
4796
+ return _context4.abrupt("return", 0);
4847
4797
 
4848
- case 4:
4798
+ case 1:
4849
4799
  case "end":
4850
4800
  return _context4.stop();
4851
4801
  }
4852
4802
  }
4853
- }, _callee4, this);
4803
+ }, _callee4);
4854
4804
  }));
4855
4805
 
4856
- function earlyUnlockedPulpAmount(_x3) {
4857
- return _earlyUnlockedPulpAmount.apply(this, arguments);
4806
+ function nextJackpotRevealTime() {
4807
+ return _nextJackpotRevealTime.apply(this, arguments);
4858
4808
  }
4859
4809
 
4860
- return earlyUnlockedPulpAmount;
4810
+ return nextJackpotRevealTime;
4861
4811
  }();
4862
4812
 
4863
- _proto.getPlyGameResultsInTransaction = /*#__PURE__*/function () {
4864
- var _getPlyGameResultsInTransaction = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(txHash) {
4865
- var _this3 = this;
4866
-
4867
- var tx, i, filter, betMadeEvents;
4813
+ _proto.earlyUnlockedPulpAmount = /*#__PURE__*/function () {
4814
+ var _earlyUnlockedPulpAmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(user) {
4815
+ var earlyUnlockedPulpAmount;
4868
4816
  return runtime_1.wrap(function _callee5$(_context5) {
4869
4817
  while (1) {
4870
4818
  switch (_context5.prev = _context5.next) {
4871
4819
  case 0:
4872
4820
  _context5.next = 2;
4873
- return this._networkConnection.provider.getTransactionReceipt(txHash);
4821
+ return this.env.plygame.totalPlyUnlockedEarly(user);
4874
4822
 
4875
4823
  case 2:
4876
- tx = _context5.sent;
4877
- i = 0;
4824
+ earlyUnlockedPulpAmount = _context5.sent;
4825
+ return _context5.abrupt("return", new TokenAmount(this.pulpToken, earlyUnlockedPulpAmount.toString()));
4878
4826
 
4879
4827
  case 4:
4880
- if (!(i < 100 && !tx)) {
4881
- _context5.next = 13;
4882
- break;
4883
- }
4884
-
4885
- _context5.next = 7;
4886
- return sleep(1000);
4887
-
4888
- case 7:
4889
- _context5.next = 9;
4890
- return this._networkConnection.provider.getTransactionReceipt(txHash);
4828
+ case "end":
4829
+ return _context5.stop();
4830
+ }
4831
+ }
4832
+ }, _callee5, this);
4833
+ }));
4891
4834
 
4892
- case 9:
4893
- tx = _context5.sent;
4835
+ function earlyUnlockedPulpAmount(_x3) {
4836
+ return _earlyUnlockedPulpAmount.apply(this, arguments);
4837
+ }
4894
4838
 
4895
- case 10:
4896
- i++;
4897
- _context5.next = 4;
4898
- break;
4839
+ return earlyUnlockedPulpAmount;
4840
+ }();
4899
4841
 
4900
- case 13:
4901
- if (tx) {
4902
- _context5.next = 15;
4903
- break;
4904
- }
4842
+ _proto.getPlyGameResultsInTransaction = /*#__PURE__*/function () {
4843
+ var _getPlyGameResultsInTransaction = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(txHash) {
4844
+ var _this3 = this;
4905
4845
 
4906
- throw new Error("Transaction " + txHash + " takes too long to be mined");
4846
+ var tx, filter, betMadeEvents;
4847
+ return runtime_1.wrap(function _callee6$(_context6) {
4848
+ while (1) {
4849
+ switch (_context6.prev = _context6.next) {
4850
+ case 0:
4851
+ _context6.next = 2;
4852
+ return this._networkConnection.provider.getTransactionReceipt(txHash);
4907
4853
 
4908
- case 15:
4854
+ case 2:
4855
+ tx = _context6.sent;
4909
4856
  filter = this.env.plygame.filters.BetMade();
4910
4857
  betMadeEvents = tx.logs.filter(function (log) {
4911
4858
  return isSameAddress(log.topics[0], filter.topics[0]);
@@ -4915,16 +4862,16 @@ var PlyGameRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4915
4862
  transactionHash: txHash
4916
4863
  });
4917
4864
  });
4918
- return _context5.abrupt("return", this.attachTimestamp(betMadeEvents.map(function (e) {
4865
+ return _context6.abrupt("return", this.attachTimestamp(betMadeEvents.map(function (e) {
4919
4866
  return _this3.parseBetMakeEvent(e);
4920
4867
  })));
4921
4868
 
4922
- case 18:
4869
+ case 6:
4923
4870
  case "end":
4924
- return _context5.stop();
4871
+ return _context6.stop();
4925
4872
  }
4926
4873
  }
4927
- }, _callee5, this);
4874
+ }, _callee6, this);
4928
4875
  }));
4929
4876
 
4930
4877
  function getPlyGameResultsInTransaction(_x4) {
@@ -4941,20 +4888,20 @@ var PlyGameRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4941
4888
  _proto.leaderboard =
4942
4889
  /*#__PURE__*/
4943
4890
  function () {
4944
- var _leaderboard = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6() {
4891
+ var _leaderboard = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7() {
4945
4892
  var _this4 = this;
4946
4893
 
4947
4894
  var result;
4948
- return runtime_1.wrap(function _callee6$(_context6) {
4895
+ return runtime_1.wrap(function _callee7$(_context7) {
4949
4896
  while (1) {
4950
- switch (_context6.prev = _context6.next) {
4897
+ switch (_context7.prev = _context7.next) {
4951
4898
  case 0:
4952
- _context6.next = 2;
4899
+ _context7.next = 2;
4953
4900
  return getPaginatedApi('/plygame/leaderboard');
4954
4901
 
4955
4902
  case 2:
4956
- result = _context6.sent;
4957
- return _context6.abrupt("return", result.items.map(function (item, i) {
4903
+ result = _context7.sent;
4904
+ return _context7.abrupt("return", result.items.map(function (item, i) {
4958
4905
  return {
4959
4906
  player: item.user,
4960
4907
  unlockedPulpAmount: new TokenAmount(_this4.pulpToken, item.unlockedAmount),
@@ -4964,10 +4911,10 @@ var PlyGameRead = /*#__PURE__*/function (_BlockchainEntityRead) {
4964
4911
 
4965
4912
  case 4:
4966
4913
  case "end":
4967
- return _context6.stop();
4914
+ return _context7.stop();
4968
4915
  }
4969
4916
  }
4970
- }, _callee6);
4917
+ }, _callee7);
4971
4918
  }));
4972
4919
 
4973
4920
  function leaderboard() {
@@ -4988,28 +4935,57 @@ var PlyGameReadWrite = /*#__PURE__*/function (_PlyGameRead) {
4988
4935
 
4989
4936
  var _proto2 = PlyGameReadWrite.prototype;
4990
4937
 
4938
+ /**
4939
+ * makes "times" independent bets, but consecutively, of the same amount
4940
+ */
4941
+ _proto2.makeBetMultiple =
4942
+ /*#__PURE__*/
4943
+ function () {
4944
+ var _makeBetMultiple = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(amount, times) {
4945
+ return runtime_1.wrap(function _callee8$(_context8) {
4946
+ while (1) {
4947
+ switch (_context8.prev = _context8.next) {
4948
+ case 0:
4949
+ return _context8.abrupt("return", this.env.plygame.connect(this._networkConnection.signer).makeBetMultiple(amount.rawAmount(), times));
4950
+
4951
+ case 1:
4952
+ case "end":
4953
+ return _context8.stop();
4954
+ }
4955
+ }
4956
+ }, _callee8, this);
4957
+ }));
4958
+
4959
+ function makeBetMultiple(_x5, _x6) {
4960
+ return _makeBetMultiple.apply(this, arguments);
4961
+ }
4962
+
4963
+ return makeBetMultiple;
4964
+ }()
4991
4965
  /**
4992
4966
  * Make a single bet
4993
4967
  */
4968
+ ;
4969
+
4994
4970
  _proto2.makeBetOnce =
4995
4971
  /*#__PURE__*/
4996
4972
  function () {
4997
- var _makeBetOnce = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(amount) {
4998
- return runtime_1.wrap(function _callee7$(_context7) {
4973
+ var _makeBetOnce = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(amount) {
4974
+ return runtime_1.wrap(function _callee9$(_context9) {
4999
4975
  while (1) {
5000
- switch (_context7.prev = _context7.next) {
4976
+ switch (_context9.prev = _context9.next) {
5001
4977
  case 0:
5002
- return _context7.abrupt("return", this.env.plygame.connect(this._networkConnection.signer).makeBetOnce(amount.rawAmount()));
4978
+ return _context9.abrupt("return", this.env.plygame.connect(this._networkConnection.signer).makeBetOnce(amount.rawAmount()));
5003
4979
 
5004
4980
  case 1:
5005
4981
  case "end":
5006
- return _context7.stop();
4982
+ return _context9.stop();
5007
4983
  }
5008
4984
  }
5009
- }, _callee7, this);
4985
+ }, _callee9, this);
5010
4986
  }));
5011
4987
 
5012
- function makeBetOnce(_x5) {
4988
+ function makeBetOnce(_x7) {
5013
4989
  return _makeBetOnce.apply(this, arguments);
5014
4990
  }
5015
4991
 
@@ -5017,22 +4993,22 @@ var PlyGameReadWrite = /*#__PURE__*/function (_PlyGameRead) {
5017
4993
  }();
5018
4994
 
5019
4995
  _proto2.approve = /*#__PURE__*/function () {
5020
- var _approve = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(amount) {
5021
- return runtime_1.wrap(function _callee8$(_context8) {
4996
+ var _approve = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(amount) {
4997
+ return runtime_1.wrap(function _callee10$(_context10) {
5022
4998
  while (1) {
5023
- switch (_context8.prev = _context8.next) {
4999
+ switch (_context10.prev = _context10.next) {
5024
5000
  case 0:
5025
- return _context8.abrupt("return", this.env.ply.connect(this._networkConnection.signer).approve(this.env.plygame.address, amount.rawAmount()));
5001
+ return _context10.abrupt("return", this.env.ply.connect(this._networkConnection.signer).approve(this.env.plygame.address, amount.rawAmount()));
5026
5002
 
5027
5003
  case 1:
5028
5004
  case "end":
5029
- return _context8.stop();
5005
+ return _context10.stop();
5030
5006
  }
5031
5007
  }
5032
- }, _callee8, this);
5008
+ }, _callee10, this);
5033
5009
  }));
5034
5010
 
5035
- function approve(_x6) {
5011
+ function approve(_x8) {
5036
5012
  return _approve.apply(this, arguments);
5037
5013
  }
5038
5014
 
@@ -5347,6 +5323,66 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
5347
5323
  return leaderboard;
5348
5324
  }();
5349
5325
 
5326
+ _proto.isWhitelistedAddress = /*#__PURE__*/function () {
5327
+ var _isWhitelistedAddress = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(address) {
5328
+ var result;
5329
+ return runtime_1.wrap(function _callee7$(_context7) {
5330
+ while (1) {
5331
+ switch (_context7.prev = _context7.next) {
5332
+ case 0:
5333
+ _context7.next = 2;
5334
+ return getApi('/referral/whitelisted', {
5335
+ address: address
5336
+ });
5337
+
5338
+ case 2:
5339
+ result = _context7.sent;
5340
+ return _context7.abrupt("return", result.isWhitelisted);
5341
+
5342
+ case 4:
5343
+ case "end":
5344
+ return _context7.stop();
5345
+ }
5346
+ }
5347
+ }, _callee7);
5348
+ }));
5349
+
5350
+ function isWhitelistedAddress(_x7) {
5351
+ return _isWhitelistedAddress.apply(this, arguments);
5352
+ }
5353
+
5354
+ return isWhitelistedAddress;
5355
+ }();
5356
+
5357
+ _proto.isOnAuroraPlus = /*#__PURE__*/function () {
5358
+ var _isOnAuroraPlus = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(address) {
5359
+ var resp;
5360
+ return runtime_1.wrap(function _callee8$(_context8) {
5361
+ while (1) {
5362
+ switch (_context8.prev = _context8.next) {
5363
+ case 0:
5364
+ _context8.next = 2;
5365
+ return axios.get(AURORA_PLUS_API_PREFIX + address);
5366
+
5367
+ case 2:
5368
+ resp = _context8.sent;
5369
+ return _context8.abrupt("return", resp.data.status == 'active');
5370
+
5371
+ case 4:
5372
+ case "end":
5373
+ return _context8.stop();
5374
+ }
5375
+ }
5376
+ }, _callee8);
5377
+ }));
5378
+
5379
+ function isOnAuroraPlus(_x8) {
5380
+ return _isOnAuroraPlus.apply(this, arguments);
5381
+ }
5382
+
5383
+ return isOnAuroraPlus;
5384
+ }();
5385
+
5350
5386
  return ReferralRead;
5351
5387
  }(BlockchainEntityRead);
5352
5388
  var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
@@ -5366,21 +5402,21 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
5366
5402
  _proto2.registerNewReferralCode =
5367
5403
  /*#__PURE__*/
5368
5404
  function () {
5369
- var _registerNewReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7() {
5405
+ var _registerNewReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9() {
5370
5406
  var referralCode;
5371
- return runtime_1.wrap(function _callee7$(_context7) {
5407
+ return runtime_1.wrap(function _callee9$(_context9) {
5372
5408
  while (1) {
5373
- switch (_context7.prev = _context7.next) {
5409
+ switch (_context9.prev = _context9.next) {
5374
5410
  case 0:
5375
5411
  referralCode = ethers.ethers.utils.formatBytes32String(this.generateReferralCode());
5376
- return _context7.abrupt("return", this.env.referralDirectory.connect(this._networkConnection.signer).registerNewUserReferralCode(referralCode));
5412
+ return _context9.abrupt("return", this.env.referralDirectory.connect(this._networkConnection.signer).registerNewUserReferralCode(referralCode));
5377
5413
 
5378
5414
  case 2:
5379
5415
  case "end":
5380
- return _context7.stop();
5416
+ return _context9.stop();
5381
5417
  }
5382
5418
  }
5383
- }, _callee7, this);
5419
+ }, _callee9, this);
5384
5420
  }));
5385
5421
 
5386
5422
  function registerNewReferralCode() {
@@ -5397,24 +5433,24 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
5397
5433
  _proto2.useReferralCode =
5398
5434
  /*#__PURE__*/
5399
5435
  function () {
5400
- var _useReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(code) {
5436
+ var _useReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(code) {
5401
5437
  var referralCode;
5402
- return runtime_1.wrap(function _callee8$(_context8) {
5438
+ return runtime_1.wrap(function _callee10$(_context10) {
5403
5439
  while (1) {
5404
- switch (_context8.prev = _context8.next) {
5440
+ switch (_context10.prev = _context10.next) {
5405
5441
  case 0:
5406
5442
  referralCode = ethers.ethers.utils.formatBytes32String(code);
5407
- return _context8.abrupt("return", this.env.referralDirectory.connect(this._networkConnection.signer).registerReferralCodeUsed(referralCode));
5443
+ return _context10.abrupt("return", this.env.referralDirectory.connect(this._networkConnection.signer).registerReferralCodeUsed(referralCode));
5408
5444
 
5409
5445
  case 2:
5410
5446
  case "end":
5411
- return _context8.stop();
5447
+ return _context10.stop();
5412
5448
  }
5413
5449
  }
5414
- }, _callee8, this);
5450
+ }, _callee10, this);
5415
5451
  }));
5416
5452
 
5417
- function useReferralCode(_x7) {
5453
+ function useReferralCode(_x9) {
5418
5454
  return _useReferralCode.apply(this, arguments);
5419
5455
  }
5420
5456
 
@@ -5428,23 +5464,23 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
5428
5464
  _proto2.claimReferralRewards =
5429
5465
  /*#__PURE__*/
5430
5466
  function () {
5431
- var _claimReferralRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9() {
5467
+ var _claimReferralRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11() {
5432
5468
  var unclaimedRewards, campaigns, tokens;
5433
- return runtime_1.wrap(function _callee9$(_context9) {
5469
+ return runtime_1.wrap(function _callee11$(_context11) {
5434
5470
  while (1) {
5435
- switch (_context9.prev = _context9.next) {
5471
+ switch (_context11.prev = _context11.next) {
5436
5472
  case 0:
5437
- _context9.t0 = this;
5438
- _context9.next = 3;
5473
+ _context11.t0 = this;
5474
+ _context11.next = 3;
5439
5475
  return this._networkConnection.signer.getAddress();
5440
5476
 
5441
5477
  case 3:
5442
- _context9.t1 = _context9.sent;
5443
- _context9.next = 6;
5444
- return _context9.t0.referralRewards.call(_context9.t0, _context9.t1);
5478
+ _context11.t1 = _context11.sent;
5479
+ _context11.next = 6;
5480
+ return _context11.t0.referralRewards.call(_context11.t0, _context11.t1);
5445
5481
 
5446
5482
  case 6:
5447
- unclaimedRewards = _context9.sent.filter(function (reward) {
5483
+ unclaimedRewards = _context11.sent.filter(function (reward) {
5448
5484
  return reward.transactionHash == null;
5449
5485
  });
5450
5486
  campaigns = unclaimedRewards.map(function (reward) {
@@ -5453,14 +5489,14 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
5453
5489
  tokens = unclaimedRewards.map(function (reward) {
5454
5490
  return reward.rewardTokenAmount.token.address;
5455
5491
  });
5456
- return _context9.abrupt("return", new AirdropReadWrite(this._networkConnection).redeemMultiple(campaigns, tokens));
5492
+ return _context11.abrupt("return", new AirdropReadWrite(this._networkConnection).redeemMultiple(campaigns, tokens));
5457
5493
 
5458
5494
  case 10:
5459
5495
  case "end":
5460
- return _context9.stop();
5496
+ return _context11.stop();
5461
5497
  }
5462
5498
  }
5463
- }, _callee9, this);
5499
+ }, _callee11, this);
5464
5500
  }));
5465
5501
 
5466
5502
  function claimReferralRewards() {
@@ -5875,6 +5911,7 @@ exports.AIRDROP_KEEP_THRESHOLD = AIRDROP_KEEP_THRESHOLD;
5875
5911
  exports.AIRDROP_START_TIMESTAMP = AIRDROP_START_TIMESTAMP;
5876
5912
  exports.ALL_STAKING_POOLS = ALL_STAKING_POOLS;
5877
5913
  exports.AURORA_CHAINID = AURORA_CHAINID;
5914
+ exports.AURORA_PLUS_API_PREFIX = AURORA_PLUS_API_PREFIX;
5878
5915
  exports.Airdrop = Airdrop;
5879
5916
  exports.AirdropRead = AirdropRead;
5880
5917
  exports.AirdropReadWrite = AirdropReadWrite;
@@ -5968,8 +6005,6 @@ exports.networkAddresses = networkAddresses;
5968
6005
  exports.queryGraphQL = queryGraphQL;
5969
6006
  exports.referralRewardDummy1 = referralRewardDummy1;
5970
6007
  exports.referralRewardDummy2 = referralRewardDummy2;
5971
- exports.sleep = sleep;
5972
- exports.sortEvents = sortEvents;
5973
6008
  exports.symbolRecords = symbolRecords;
5974
6009
  exports.validateAndParseAddress = validateAndParseAddress;
5975
6010
  exports.valuateToken = valuateToken;