@aurigami/sdk 1.11.0-beta5 → 1.11.1
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/helpers/helpers.d.ts +1 -0
- package/dist/interactors/PlyGame.d.ts +0 -5
- package/dist/sdk.cjs.development.js +155 -149
- 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 +155 -150
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/consts/constants.ts +1 -1
- package/src/helpers/helpers.ts +6 -0
- package/src/interactors/PlyGame.ts +13 -15
package/dist/sdk.esm.js
CHANGED
|
@@ -110,7 +110,7 @@ var networkAddresses = {
|
|
|
110
110
|
PLY_TOKEN_LOCK: /*#__PURE__*/MAINNET_ADDRESSES.plyTokenLock.toLowerCase(),
|
|
111
111
|
REFERRAL: /*#__PURE__*/MAINNET_ADDRESSES.referralDirectory.toLowerCase(),
|
|
112
112
|
AURI_INTERNAL_LENS: /*#__PURE__*/MAINNET_ADDRESSES.auriInternalLens.toLowerCase(),
|
|
113
|
-
PLYGAME: /*#__PURE__*/
|
|
113
|
+
PLYGAME: /*#__PURE__*/MAINNET_ADDRESSES.plyGame.toLowerCase()
|
|
114
114
|
},
|
|
115
115
|
tokens: {
|
|
116
116
|
AURORA: /*#__PURE__*/'0x8bec47865ade3b172a928df8f990bc7f2a3b9f79'.toLowerCase(),
|
|
@@ -1207,6 +1207,30 @@ var isSameAddress = function isSameAddress(address1, address2) {
|
|
|
1207
1207
|
var getCurrentTimestamp = function getCurrentTimestamp() {
|
|
1208
1208
|
return Math.trunc(Date.now() / 1000);
|
|
1209
1209
|
};
|
|
1210
|
+
function sleep(_x) {
|
|
1211
|
+
return _sleep.apply(this, arguments);
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
function _sleep() {
|
|
1215
|
+
_sleep = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee(duration) {
|
|
1216
|
+
return runtime_1.wrap(function _callee$(_context) {
|
|
1217
|
+
while (1) {
|
|
1218
|
+
switch (_context.prev = _context.next) {
|
|
1219
|
+
case 0:
|
|
1220
|
+
return _context.abrupt("return", new Promise(function (resolve) {
|
|
1221
|
+
setTimeout(resolve, duration);
|
|
1222
|
+
}));
|
|
1223
|
+
|
|
1224
|
+
case 1:
|
|
1225
|
+
case "end":
|
|
1226
|
+
return _context.stop();
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
}, _callee);
|
|
1230
|
+
}));
|
|
1231
|
+
return _sleep.apply(this, arguments);
|
|
1232
|
+
}
|
|
1233
|
+
|
|
1210
1234
|
function validateAndParseAddress(address) {
|
|
1211
1235
|
try {
|
|
1212
1236
|
return utils.getAddress(address);
|
|
@@ -1248,35 +1272,35 @@ function calcLMRewardApr(rewardsValue, totalStakeValue, frequencyPerYear) {
|
|
|
1248
1272
|
|
|
1249
1273
|
return rewardsValue.multipliedBy(frequencyPerYear).dividedBy(totalStakeValue);
|
|
1250
1274
|
}
|
|
1251
|
-
function getBlockTimestamp(
|
|
1275
|
+
function getBlockTimestamp(_x2, _x3) {
|
|
1252
1276
|
return _getBlockTimestamp.apply(this, arguments);
|
|
1253
1277
|
}
|
|
1254
1278
|
|
|
1255
1279
|
function _getBlockTimestamp() {
|
|
1256
|
-
_getBlockTimestamp = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
1280
|
+
_getBlockTimestamp = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee2(provider, blockNumber) {
|
|
1257
1281
|
var block;
|
|
1258
|
-
return runtime_1.wrap(function
|
|
1282
|
+
return runtime_1.wrap(function _callee2$(_context2) {
|
|
1259
1283
|
while (1) {
|
|
1260
|
-
switch (
|
|
1284
|
+
switch (_context2.prev = _context2.next) {
|
|
1261
1285
|
case 0:
|
|
1262
|
-
|
|
1286
|
+
_context2.next = 2;
|
|
1263
1287
|
return provider.getBlock(blockNumber);
|
|
1264
1288
|
|
|
1265
1289
|
case 2:
|
|
1266
|
-
block =
|
|
1267
|
-
return
|
|
1290
|
+
block = _context2.sent;
|
|
1291
|
+
return _context2.abrupt("return", block.timestamp);
|
|
1268
1292
|
|
|
1269
1293
|
case 4:
|
|
1270
1294
|
case "end":
|
|
1271
|
-
return
|
|
1295
|
+
return _context2.stop();
|
|
1272
1296
|
}
|
|
1273
1297
|
}
|
|
1274
|
-
},
|
|
1298
|
+
}, _callee2);
|
|
1275
1299
|
}));
|
|
1276
1300
|
return _getBlockTimestamp.apply(this, arguments);
|
|
1277
1301
|
}
|
|
1278
1302
|
|
|
1279
|
-
function getBlocksTimestampViaRPC(
|
|
1303
|
+
function getBlocksTimestampViaRPC(_x4, _x5) {
|
|
1280
1304
|
return _getBlocksTimestampViaRPC.apply(this, arguments);
|
|
1281
1305
|
}
|
|
1282
1306
|
/**
|
|
@@ -1286,11 +1310,11 @@ function getBlocksTimestampViaRPC(_x3, _x4) {
|
|
|
1286
1310
|
*/
|
|
1287
1311
|
|
|
1288
1312
|
function _getBlocksTimestampViaRPC() {
|
|
1289
|
-
_getBlocksTimestampViaRPC = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
1313
|
+
_getBlocksTimestampViaRPC = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(provider, blocksNumber) {
|
|
1290
1314
|
var CHUNK_SIZE, results, i, slice, promises;
|
|
1291
|
-
return runtime_1.wrap(function
|
|
1315
|
+
return runtime_1.wrap(function _callee4$(_context4) {
|
|
1292
1316
|
while (1) {
|
|
1293
|
-
switch (
|
|
1317
|
+
switch (_context4.prev = _context4.next) {
|
|
1294
1318
|
case 0:
|
|
1295
1319
|
// Promise all 200 blocks at a time, using too many blocks at once will cause the RPC call timeout.
|
|
1296
1320
|
CHUNK_SIZE = 200;
|
|
@@ -1299,58 +1323,58 @@ function _getBlocksTimestampViaRPC() {
|
|
|
1299
1323
|
|
|
1300
1324
|
case 3:
|
|
1301
1325
|
if (!(i < blocksNumber.length)) {
|
|
1302
|
-
|
|
1326
|
+
_context4.next = 14;
|
|
1303
1327
|
break;
|
|
1304
1328
|
}
|
|
1305
1329
|
|
|
1306
1330
|
slice = blocksNumber.slice(i, i + CHUNK_SIZE);
|
|
1307
1331
|
promises = slice.map( /*#__PURE__*/function () {
|
|
1308
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
1309
|
-
return runtime_1.wrap(function
|
|
1332
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(blockNumber) {
|
|
1333
|
+
return runtime_1.wrap(function _callee3$(_context3) {
|
|
1310
1334
|
while (1) {
|
|
1311
|
-
switch (
|
|
1335
|
+
switch (_context3.prev = _context3.next) {
|
|
1312
1336
|
case 0:
|
|
1313
|
-
return
|
|
1337
|
+
return _context3.abrupt("return", getBlockTimestamp(provider, blockNumber));
|
|
1314
1338
|
|
|
1315
1339
|
case 1:
|
|
1316
1340
|
case "end":
|
|
1317
|
-
return
|
|
1341
|
+
return _context3.stop();
|
|
1318
1342
|
}
|
|
1319
1343
|
}
|
|
1320
|
-
},
|
|
1344
|
+
}, _callee3);
|
|
1321
1345
|
}));
|
|
1322
1346
|
|
|
1323
|
-
return function (
|
|
1347
|
+
return function (_x10) {
|
|
1324
1348
|
return _ref.apply(this, arguments);
|
|
1325
1349
|
};
|
|
1326
1350
|
}());
|
|
1327
|
-
|
|
1328
|
-
|
|
1351
|
+
_context4.t0 = results;
|
|
1352
|
+
_context4.next = 9;
|
|
1329
1353
|
return Promise.all(promises);
|
|
1330
1354
|
|
|
1331
1355
|
case 9:
|
|
1332
|
-
|
|
1333
|
-
results =
|
|
1356
|
+
_context4.t1 = _context4.sent;
|
|
1357
|
+
results = _context4.t0.concat.call(_context4.t0, _context4.t1);
|
|
1334
1358
|
|
|
1335
1359
|
case 11:
|
|
1336
1360
|
i += CHUNK_SIZE;
|
|
1337
|
-
|
|
1361
|
+
_context4.next = 3;
|
|
1338
1362
|
break;
|
|
1339
1363
|
|
|
1340
1364
|
case 14:
|
|
1341
|
-
return
|
|
1365
|
+
return _context4.abrupt("return", results);
|
|
1342
1366
|
|
|
1343
1367
|
case 15:
|
|
1344
1368
|
case "end":
|
|
1345
|
-
return
|
|
1369
|
+
return _context4.stop();
|
|
1346
1370
|
}
|
|
1347
1371
|
}
|
|
1348
|
-
},
|
|
1372
|
+
}, _callee4);
|
|
1349
1373
|
}));
|
|
1350
1374
|
return _getBlocksTimestampViaRPC.apply(this, arguments);
|
|
1351
1375
|
}
|
|
1352
1376
|
|
|
1353
|
-
function getBlocksTimestamp(
|
|
1377
|
+
function getBlocksTimestamp(_x6, _x7) {
|
|
1354
1378
|
return _getBlocksTimestamp.apply(this, arguments);
|
|
1355
1379
|
}
|
|
1356
1380
|
/**
|
|
@@ -1363,18 +1387,18 @@ function getBlocksTimestamp(_x5, _x6) {
|
|
|
1363
1387
|
*/
|
|
1364
1388
|
|
|
1365
1389
|
function _getBlocksTimestamp() {
|
|
1366
|
-
_getBlocksTimestamp = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
1390
|
+
_getBlocksTimestamp = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(provider, blockNumbers) {
|
|
1367
1391
|
var CHUNK_SIZE, promises, lines, i, query, results, missingBlocks, missingBlocksTimestamps;
|
|
1368
|
-
return runtime_1.wrap(function
|
|
1392
|
+
return runtime_1.wrap(function _callee5$(_context5) {
|
|
1369
1393
|
while (1) {
|
|
1370
|
-
switch (
|
|
1394
|
+
switch (_context5.prev = _context5.next) {
|
|
1371
1395
|
case 0:
|
|
1372
1396
|
if (!(blockNumbers.length == 0)) {
|
|
1373
|
-
|
|
1397
|
+
_context5.next = 2;
|
|
1374
1398
|
break;
|
|
1375
1399
|
}
|
|
1376
1400
|
|
|
1377
|
-
return
|
|
1401
|
+
return _context5.abrupt("return", []);
|
|
1378
1402
|
|
|
1379
1403
|
case 2:
|
|
1380
1404
|
CHUNK_SIZE = 100; // graphql query limit
|
|
@@ -1390,11 +1414,11 @@ function _getBlocksTimestamp() {
|
|
|
1390
1414
|
} // merge all the json objects
|
|
1391
1415
|
|
|
1392
1416
|
|
|
1393
|
-
|
|
1417
|
+
_context5.next = 8;
|
|
1394
1418
|
return Promise.all(promises);
|
|
1395
1419
|
|
|
1396
1420
|
case 8:
|
|
1397
|
-
results =
|
|
1421
|
+
results = _context5.sent.reduce(function (acc, cur) {
|
|
1398
1422
|
return _extends({}, acc, cur);
|
|
1399
1423
|
});
|
|
1400
1424
|
missingBlocks = blockNumbers.filter(function (blockNumber) {
|
|
@@ -1405,71 +1429,71 @@ function _getBlocksTimestamp() {
|
|
|
1405
1429
|
devLog("These blocks are missing from Aurora GraphQL endpoint: " + missingBlocks.join(', '));
|
|
1406
1430
|
}
|
|
1407
1431
|
|
|
1408
|
-
|
|
1432
|
+
_context5.next = 13;
|
|
1409
1433
|
return getBlocksTimestampViaRPC(provider, missingBlocks);
|
|
1410
1434
|
|
|
1411
1435
|
case 13:
|
|
1412
|
-
missingBlocksTimestamps =
|
|
1436
|
+
missingBlocksTimestamps = _context5.sent;
|
|
1413
1437
|
missingBlocksTimestamps.forEach(function (timestamp, index) {
|
|
1414
1438
|
results["b" + missingBlocks[index]] = {
|
|
1415
1439
|
timestamp: new Date(timestamp * 1000).toISOString()
|
|
1416
1440
|
};
|
|
1417
1441
|
});
|
|
1418
|
-
return
|
|
1442
|
+
return _context5.abrupt("return", blockNumbers.map(function (blockNumber) {
|
|
1419
1443
|
return Math.trunc(new Date(results["b" + blockNumber].timestamp).getTime() / 1000);
|
|
1420
1444
|
}));
|
|
1421
1445
|
|
|
1422
1446
|
case 16:
|
|
1423
1447
|
case "end":
|
|
1424
|
-
return
|
|
1448
|
+
return _context5.stop();
|
|
1425
1449
|
}
|
|
1426
1450
|
}
|
|
1427
|
-
},
|
|
1451
|
+
}, _callee5);
|
|
1428
1452
|
}));
|
|
1429
1453
|
return _getBlocksTimestamp.apply(this, arguments);
|
|
1430
1454
|
}
|
|
1431
1455
|
|
|
1432
|
-
function getBlockBeforeTimestamp(
|
|
1456
|
+
function getBlockBeforeTimestamp(_x8, _x9) {
|
|
1433
1457
|
return _getBlockBeforeTimestamp.apply(this, arguments);
|
|
1434
1458
|
}
|
|
1435
1459
|
|
|
1436
1460
|
function _getBlockBeforeTimestamp() {
|
|
1437
|
-
_getBlockBeforeTimestamp = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
1461
|
+
_getBlockBeforeTimestamp = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(provider, timestamp) {
|
|
1438
1462
|
var result;
|
|
1439
|
-
return runtime_1.wrap(function
|
|
1463
|
+
return runtime_1.wrap(function _callee6$(_context6) {
|
|
1440
1464
|
while (1) {
|
|
1441
|
-
switch (
|
|
1465
|
+
switch (_context6.prev = _context6.next) {
|
|
1442
1466
|
case 0:
|
|
1443
|
-
|
|
1467
|
+
_context6.next = 2;
|
|
1444
1468
|
return getQuery('block', 'getblocknobytime', {
|
|
1445
1469
|
timestamp: timestamp,
|
|
1446
1470
|
closest: 'before'
|
|
1447
1471
|
});
|
|
1448
1472
|
|
|
1449
1473
|
case 2:
|
|
1450
|
-
result =
|
|
1451
|
-
|
|
1474
|
+
result = _context6.sent;
|
|
1475
|
+
_context6.t0 = parseInt(result);
|
|
1452
1476
|
|
|
1453
|
-
if (
|
|
1454
|
-
|
|
1477
|
+
if (_context6.t0) {
|
|
1478
|
+
_context6.next = 8;
|
|
1455
1479
|
break;
|
|
1456
1480
|
}
|
|
1457
1481
|
|
|
1458
|
-
|
|
1482
|
+
_context6.next = 7;
|
|
1459
1483
|
return provider.getBlockNumber();
|
|
1460
1484
|
|
|
1461
1485
|
case 7:
|
|
1462
|
-
|
|
1486
|
+
_context6.t0 = _context6.sent;
|
|
1463
1487
|
|
|
1464
1488
|
case 8:
|
|
1465
|
-
return
|
|
1489
|
+
return _context6.abrupt("return", _context6.t0);
|
|
1466
1490
|
|
|
1467
1491
|
case 9:
|
|
1468
1492
|
case "end":
|
|
1469
|
-
return
|
|
1493
|
+
return _context6.stop();
|
|
1470
1494
|
}
|
|
1471
1495
|
}
|
|
1472
|
-
},
|
|
1496
|
+
}, _callee6);
|
|
1473
1497
|
}));
|
|
1474
1498
|
return _getBlockBeforeTimestamp.apply(this, arguments);
|
|
1475
1499
|
}
|
|
@@ -2597,6 +2621,7 @@ var helpers = {
|
|
|
2597
2621
|
decimalFactor: decimalFactor,
|
|
2598
2622
|
isSameAddress: isSameAddress,
|
|
2599
2623
|
getCurrentTimestamp: getCurrentTimestamp,
|
|
2624
|
+
sleep: sleep,
|
|
2600
2625
|
validateAndParseAddress: validateAndParseAddress,
|
|
2601
2626
|
getDecimal: getDecimal,
|
|
2602
2627
|
getSymbol: getSymbol,
|
|
@@ -4805,72 +4830,81 @@ var PlyGameRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4805
4830
|
return currentJackpotAmount;
|
|
4806
4831
|
}();
|
|
4807
4832
|
|
|
4808
|
-
_proto.
|
|
4809
|
-
var
|
|
4833
|
+
_proto.earlyUnlockedPulpAmount = /*#__PURE__*/function () {
|
|
4834
|
+
var _earlyUnlockedPulpAmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee4(user) {
|
|
4835
|
+
var earlyUnlockedPulpAmount;
|
|
4810
4836
|
return runtime_1.wrap(function _callee4$(_context4) {
|
|
4811
4837
|
while (1) {
|
|
4812
4838
|
switch (_context4.prev = _context4.next) {
|
|
4813
4839
|
case 0:
|
|
4814
|
-
|
|
4840
|
+
_context4.next = 2;
|
|
4841
|
+
return this.env.plygame.totalPlyUnlockedEarly(user);
|
|
4815
4842
|
|
|
4816
|
-
case
|
|
4843
|
+
case 2:
|
|
4844
|
+
earlyUnlockedPulpAmount = _context4.sent;
|
|
4845
|
+
return _context4.abrupt("return", new TokenAmount(this.pulpToken, earlyUnlockedPulpAmount.toString()));
|
|
4846
|
+
|
|
4847
|
+
case 4:
|
|
4817
4848
|
case "end":
|
|
4818
4849
|
return _context4.stop();
|
|
4819
4850
|
}
|
|
4820
4851
|
}
|
|
4821
|
-
}, _callee4);
|
|
4852
|
+
}, _callee4, this);
|
|
4822
4853
|
}));
|
|
4823
4854
|
|
|
4824
|
-
function
|
|
4825
|
-
return
|
|
4855
|
+
function earlyUnlockedPulpAmount(_x3) {
|
|
4856
|
+
return _earlyUnlockedPulpAmount.apply(this, arguments);
|
|
4826
4857
|
}
|
|
4827
4858
|
|
|
4828
|
-
return
|
|
4859
|
+
return earlyUnlockedPulpAmount;
|
|
4829
4860
|
}();
|
|
4830
4861
|
|
|
4831
|
-
_proto.
|
|
4832
|
-
var
|
|
4833
|
-
var
|
|
4862
|
+
_proto.getPlyGameResultsInTransaction = /*#__PURE__*/function () {
|
|
4863
|
+
var _getPlyGameResultsInTransaction = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(txHash) {
|
|
4864
|
+
var _this3 = this;
|
|
4865
|
+
|
|
4866
|
+
var tx, i, filter, betMadeEvents;
|
|
4834
4867
|
return runtime_1.wrap(function _callee5$(_context5) {
|
|
4835
4868
|
while (1) {
|
|
4836
4869
|
switch (_context5.prev = _context5.next) {
|
|
4837
4870
|
case 0:
|
|
4838
4871
|
_context5.next = 2;
|
|
4839
|
-
return this.
|
|
4872
|
+
return this._networkConnection.provider.getTransactionReceipt(txHash);
|
|
4840
4873
|
|
|
4841
4874
|
case 2:
|
|
4842
|
-
|
|
4843
|
-
|
|
4875
|
+
tx = _context5.sent;
|
|
4876
|
+
i = 0;
|
|
4844
4877
|
|
|
4845
4878
|
case 4:
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
}, _callee5, this);
|
|
4851
|
-
}));
|
|
4879
|
+
if (!(i < 100 && !tx)) {
|
|
4880
|
+
_context5.next = 13;
|
|
4881
|
+
break;
|
|
4882
|
+
}
|
|
4852
4883
|
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
}
|
|
4884
|
+
_context5.next = 7;
|
|
4885
|
+
return sleep(1000);
|
|
4856
4886
|
|
|
4857
|
-
|
|
4858
|
-
|
|
4887
|
+
case 7:
|
|
4888
|
+
_context5.next = 9;
|
|
4889
|
+
return this._networkConnection.provider.getTransactionReceipt(txHash);
|
|
4859
4890
|
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
var _this3 = this;
|
|
4891
|
+
case 9:
|
|
4892
|
+
tx = _context5.sent;
|
|
4863
4893
|
|
|
4864
|
-
|
|
4865
|
-
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
case 0:
|
|
4869
|
-
_context6.next = 2;
|
|
4870
|
-
return this._networkConnection.provider.waitForTransaction(txHash, 1);
|
|
4894
|
+
case 10:
|
|
4895
|
+
i++;
|
|
4896
|
+
_context5.next = 4;
|
|
4897
|
+
break;
|
|
4871
4898
|
|
|
4872
|
-
case
|
|
4873
|
-
tx
|
|
4899
|
+
case 13:
|
|
4900
|
+
if (tx) {
|
|
4901
|
+
_context5.next = 15;
|
|
4902
|
+
break;
|
|
4903
|
+
}
|
|
4904
|
+
|
|
4905
|
+
throw new Error("Transaction " + txHash + " takes too long to be mined");
|
|
4906
|
+
|
|
4907
|
+
case 15:
|
|
4874
4908
|
filter = this.env.plygame.filters.BetMade();
|
|
4875
4909
|
betMadeEvents = tx.logs.filter(function (log) {
|
|
4876
4910
|
return isSameAddress(log.topics[0], filter.topics[0]);
|
|
@@ -4880,16 +4914,16 @@ var PlyGameRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4880
4914
|
transactionHash: txHash
|
|
4881
4915
|
});
|
|
4882
4916
|
});
|
|
4883
|
-
return
|
|
4917
|
+
return _context5.abrupt("return", this.attachTimestamp(betMadeEvents.map(function (e) {
|
|
4884
4918
|
return _this3.parseBetMakeEvent(e);
|
|
4885
4919
|
})));
|
|
4886
4920
|
|
|
4887
|
-
case
|
|
4921
|
+
case 18:
|
|
4888
4922
|
case "end":
|
|
4889
|
-
return
|
|
4923
|
+
return _context5.stop();
|
|
4890
4924
|
}
|
|
4891
4925
|
}
|
|
4892
|
-
},
|
|
4926
|
+
}, _callee5, this);
|
|
4893
4927
|
}));
|
|
4894
4928
|
|
|
4895
4929
|
function getPlyGameResultsInTransaction(_x4) {
|
|
@@ -4906,20 +4940,20 @@ var PlyGameRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4906
4940
|
_proto.leaderboard =
|
|
4907
4941
|
/*#__PURE__*/
|
|
4908
4942
|
function () {
|
|
4909
|
-
var _leaderboard = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4943
|
+
var _leaderboard = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6() {
|
|
4910
4944
|
var _this4 = this;
|
|
4911
4945
|
|
|
4912
4946
|
var result;
|
|
4913
|
-
return runtime_1.wrap(function
|
|
4947
|
+
return runtime_1.wrap(function _callee6$(_context6) {
|
|
4914
4948
|
while (1) {
|
|
4915
|
-
switch (
|
|
4949
|
+
switch (_context6.prev = _context6.next) {
|
|
4916
4950
|
case 0:
|
|
4917
|
-
|
|
4951
|
+
_context6.next = 2;
|
|
4918
4952
|
return getPaginatedApi('/plygame/leaderboard');
|
|
4919
4953
|
|
|
4920
4954
|
case 2:
|
|
4921
|
-
result =
|
|
4922
|
-
return
|
|
4955
|
+
result = _context6.sent;
|
|
4956
|
+
return _context6.abrupt("return", result.items.map(function (item, i) {
|
|
4923
4957
|
return {
|
|
4924
4958
|
player: item.user,
|
|
4925
4959
|
unlockedPulpAmount: new TokenAmount(_this4.pulpToken, item.unlockedAmount),
|
|
@@ -4929,10 +4963,10 @@ var PlyGameRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4929
4963
|
|
|
4930
4964
|
case 4:
|
|
4931
4965
|
case "end":
|
|
4932
|
-
return
|
|
4966
|
+
return _context6.stop();
|
|
4933
4967
|
}
|
|
4934
4968
|
}
|
|
4935
|
-
},
|
|
4969
|
+
}, _callee6);
|
|
4936
4970
|
}));
|
|
4937
4971
|
|
|
4938
4972
|
function leaderboard() {
|
|
@@ -4953,57 +4987,28 @@ var PlyGameReadWrite = /*#__PURE__*/function (_PlyGameRead) {
|
|
|
4953
4987
|
|
|
4954
4988
|
var _proto2 = PlyGameReadWrite.prototype;
|
|
4955
4989
|
|
|
4956
|
-
/**
|
|
4957
|
-
* makes "times" independent bets, but consecutively, of the same amount
|
|
4958
|
-
*/
|
|
4959
|
-
_proto2.makeBetMultiple =
|
|
4960
|
-
/*#__PURE__*/
|
|
4961
|
-
function () {
|
|
4962
|
-
var _makeBetMultiple = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(amount, times) {
|
|
4963
|
-
return runtime_1.wrap(function _callee8$(_context8) {
|
|
4964
|
-
while (1) {
|
|
4965
|
-
switch (_context8.prev = _context8.next) {
|
|
4966
|
-
case 0:
|
|
4967
|
-
return _context8.abrupt("return", this.env.plygame.connect(this._networkConnection.signer).makeBetMultiple(amount.rawAmount(), times));
|
|
4968
|
-
|
|
4969
|
-
case 1:
|
|
4970
|
-
case "end":
|
|
4971
|
-
return _context8.stop();
|
|
4972
|
-
}
|
|
4973
|
-
}
|
|
4974
|
-
}, _callee8, this);
|
|
4975
|
-
}));
|
|
4976
|
-
|
|
4977
|
-
function makeBetMultiple(_x5, _x6) {
|
|
4978
|
-
return _makeBetMultiple.apply(this, arguments);
|
|
4979
|
-
}
|
|
4980
|
-
|
|
4981
|
-
return makeBetMultiple;
|
|
4982
|
-
}()
|
|
4983
4990
|
/**
|
|
4984
4991
|
* Make a single bet
|
|
4985
4992
|
*/
|
|
4986
|
-
;
|
|
4987
|
-
|
|
4988
4993
|
_proto2.makeBetOnce =
|
|
4989
4994
|
/*#__PURE__*/
|
|
4990
4995
|
function () {
|
|
4991
|
-
var _makeBetOnce = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
4992
|
-
return runtime_1.wrap(function
|
|
4996
|
+
var _makeBetOnce = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(amount) {
|
|
4997
|
+
return runtime_1.wrap(function _callee7$(_context7) {
|
|
4993
4998
|
while (1) {
|
|
4994
|
-
switch (
|
|
4999
|
+
switch (_context7.prev = _context7.next) {
|
|
4995
5000
|
case 0:
|
|
4996
|
-
return
|
|
5001
|
+
return _context7.abrupt("return", this.env.plygame.connect(this._networkConnection.signer).makeBetOnce(amount.rawAmount()));
|
|
4997
5002
|
|
|
4998
5003
|
case 1:
|
|
4999
5004
|
case "end":
|
|
5000
|
-
return
|
|
5005
|
+
return _context7.stop();
|
|
5001
5006
|
}
|
|
5002
5007
|
}
|
|
5003
|
-
},
|
|
5008
|
+
}, _callee7, this);
|
|
5004
5009
|
}));
|
|
5005
5010
|
|
|
5006
|
-
function makeBetOnce(
|
|
5011
|
+
function makeBetOnce(_x5) {
|
|
5007
5012
|
return _makeBetOnce.apply(this, arguments);
|
|
5008
5013
|
}
|
|
5009
5014
|
|
|
@@ -5011,22 +5016,22 @@ var PlyGameReadWrite = /*#__PURE__*/function (_PlyGameRead) {
|
|
|
5011
5016
|
}();
|
|
5012
5017
|
|
|
5013
5018
|
_proto2.approve = /*#__PURE__*/function () {
|
|
5014
|
-
var _approve = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
5015
|
-
return runtime_1.wrap(function
|
|
5019
|
+
var _approve = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(amount) {
|
|
5020
|
+
return runtime_1.wrap(function _callee8$(_context8) {
|
|
5016
5021
|
while (1) {
|
|
5017
|
-
switch (
|
|
5022
|
+
switch (_context8.prev = _context8.next) {
|
|
5018
5023
|
case 0:
|
|
5019
|
-
return
|
|
5024
|
+
return _context8.abrupt("return", this.env.ply.connect(this._networkConnection.signer).approve(this.env.plygame.address, amount.rawAmount()));
|
|
5020
5025
|
|
|
5021
5026
|
case 1:
|
|
5022
5027
|
case "end":
|
|
5023
|
-
return
|
|
5028
|
+
return _context8.stop();
|
|
5024
5029
|
}
|
|
5025
5030
|
}
|
|
5026
|
-
},
|
|
5031
|
+
}, _callee8, this);
|
|
5027
5032
|
}));
|
|
5028
5033
|
|
|
5029
|
-
function approve(
|
|
5034
|
+
function approve(_x6) {
|
|
5030
5035
|
return _approve.apply(this, arguments);
|
|
5031
5036
|
}
|
|
5032
5037
|
|
|
@@ -5862,5 +5867,5 @@ BigNumber.config({
|
|
|
5862
5867
|
DECIMAL_PLACES: 50
|
|
5863
5868
|
});
|
|
5864
5869
|
|
|
5865
|
-
export { AIRDROP_END_TIMESTAMP, AIRDROP_KEEP_THRESHOLD, AIRDROP_START_TIMESTAMP, ALL_STAKING_POOLS, AURORA_CHAINID, Airdrop, AirdropRead, AirdropReadWrite, AuriEnv, BORROW_LIMIT_BUFFER, BORROW_NEAR_REWARDS_PER_WEEK, BlockchainEntity, BlockchainEntityRead, BlockchainEntityReadWrite, ComptrollerRewardType, DECIMAL_PRECISION, DEPOSIT_NEAR_REWARDS_PER_WEEK, DEPOSIT_ONLY_TOKENS, ETHAddress, HARDCODE_PRICE_TOKENS, INF, MarketAction, MiscRead, MoneyMarket, MoneyMarketRead, MoneyMarketReadWrite, ONE_DAY, ONE_WEEK, ONE_YEAR, PLYToken, PLYWNEARToken, PLYWNEAR_POOL_ID, PLYWNEAR_REWARD_TOKENS, PRICE_WHITELISTED, Papermill, PapermillRead, PapermillReadWrite, PlyGame, PlyGameRead, PlyGameReadWrite, REFERRAL_CAMPAIGNS, REWARD_CLAIM_START, Referral, ReferralRead, ReferralReadWrite, SDK, SdkRead, SdkReadWrite, Staking, StakingRead, StakingReadWrite, Token, TokenAmount, TransferEventQuery, index as abis, assert, calcLMRewardApr, calcValuation, decimalFactor, decimalRecords, devLog, dummyAddress, dummyMarketAddress, dummyPly, dummyPlyAurora, dummyToken, dummyTokenAmount, dummyTokenAmount2, dummyTokenAmount3, dummyUserMarketDetails, dummyZeroTokenAmount, fetchLPPositions, fetchLPPrice, fetchPLYPrice, fetchPULPPrice, fetchPrice, fetchPriceFromCoingecko, fetchPriceFromCoingeckoAPI, fetchPriceFromOracle, fetchStNEARPrice, fetchToken0PriceByLP, fetchUnderlyingTokensPrices, fetchValuation, formatObject, getApi, getBlockBeforeTimestamp, getBlockTimestamp, getBlocksTimestamp, getBlocksTimestampViaRPC, getCurrentTimestamp, getDecimal, getPaginatedApi, getQuery, getSymbol, getUnderlying, isSameAddress, networkAddresses, queryGraphQL, referralRewardDummy1, referralRewardDummy2, sortEvents, symbolRecords, validateAndParseAddress, valuateToken };
|
|
5870
|
+
export { AIRDROP_END_TIMESTAMP, AIRDROP_KEEP_THRESHOLD, AIRDROP_START_TIMESTAMP, ALL_STAKING_POOLS, AURORA_CHAINID, Airdrop, AirdropRead, AirdropReadWrite, AuriEnv, BORROW_LIMIT_BUFFER, BORROW_NEAR_REWARDS_PER_WEEK, BlockchainEntity, BlockchainEntityRead, BlockchainEntityReadWrite, ComptrollerRewardType, DECIMAL_PRECISION, DEPOSIT_NEAR_REWARDS_PER_WEEK, DEPOSIT_ONLY_TOKENS, ETHAddress, HARDCODE_PRICE_TOKENS, INF, MarketAction, MiscRead, MoneyMarket, MoneyMarketRead, MoneyMarketReadWrite, ONE_DAY, ONE_WEEK, ONE_YEAR, PLYToken, PLYWNEARToken, PLYWNEAR_POOL_ID, PLYWNEAR_REWARD_TOKENS, PRICE_WHITELISTED, Papermill, PapermillRead, PapermillReadWrite, PlyGame, PlyGameRead, PlyGameReadWrite, REFERRAL_CAMPAIGNS, REWARD_CLAIM_START, Referral, ReferralRead, ReferralReadWrite, SDK, SdkRead, SdkReadWrite, Staking, StakingRead, StakingReadWrite, Token, TokenAmount, TransferEventQuery, index as abis, assert, calcLMRewardApr, calcValuation, decimalFactor, decimalRecords, devLog, dummyAddress, dummyMarketAddress, dummyPly, dummyPlyAurora, dummyToken, dummyTokenAmount, dummyTokenAmount2, dummyTokenAmount3, dummyUserMarketDetails, dummyZeroTokenAmount, fetchLPPositions, fetchLPPrice, fetchPLYPrice, fetchPULPPrice, fetchPrice, fetchPriceFromCoingecko, fetchPriceFromCoingeckoAPI, fetchPriceFromOracle, fetchStNEARPrice, fetchToken0PriceByLP, fetchUnderlyingTokensPrices, fetchValuation, formatObject, getApi, getBlockBeforeTimestamp, getBlockTimestamp, getBlocksTimestamp, getBlocksTimestampViaRPC, getCurrentTimestamp, getDecimal, getPaginatedApi, getQuery, getSymbol, getUnderlying, isSameAddress, networkAddresses, queryGraphQL, referralRewardDummy1, referralRewardDummy2, sleep, sortEvents, symbolRecords, validateAndParseAddress, valuateToken };
|
|
5866
5871
|
//# sourceMappingURL=sdk.esm.js.map
|