@aurigami/sdk 1.12.5 → 1.12.7
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/Referral.d.ts +2 -1
- package/dist/sdk.cjs.development.js +105 -76
- 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 +105 -76
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/interactors/PlyGame.ts +1 -1
- package/src/interactors/Referral.ts +7 -2
package/dist/sdk.esm.js
CHANGED
|
@@ -5077,7 +5077,7 @@ var PlyGameRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5077
5077
|
case 7:
|
|
5078
5078
|
result = _context7.sent;
|
|
5079
5079
|
return _context7.abrupt("return", {
|
|
5080
|
-
winner: result.winner.slice(0,
|
|
5080
|
+
winner: result.winner.slice(0, 5) + '...' + result.winner.slice(-3),
|
|
5081
5081
|
amount: new TokenAmount(this.plyToken, result.amount.toString())
|
|
5082
5082
|
});
|
|
5083
5083
|
|
|
@@ -5475,16 +5475,14 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5475
5475
|
_proto.slotsInUse =
|
|
5476
5476
|
/*#__PURE__*/
|
|
5477
5477
|
function () {
|
|
5478
|
-
var _slotsInUse = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7(
|
|
5478
|
+
var _slotsInUse = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee7() {
|
|
5479
5479
|
var result;
|
|
5480
5480
|
return runtime_1.wrap(function _callee7$(_context7) {
|
|
5481
5481
|
while (1) {
|
|
5482
5482
|
switch (_context7.prev = _context7.next) {
|
|
5483
5483
|
case 0:
|
|
5484
5484
|
_context7.next = 2;
|
|
5485
|
-
return getApi('/referral/slotsInUse'
|
|
5486
|
-
referralCode: referralCode
|
|
5487
|
-
});
|
|
5485
|
+
return getApi('/referral/slotsInUse');
|
|
5488
5486
|
|
|
5489
5487
|
case 2:
|
|
5490
5488
|
result = _context7.sent;
|
|
@@ -5498,7 +5496,7 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5498
5496
|
}, _callee7);
|
|
5499
5497
|
}));
|
|
5500
5498
|
|
|
5501
|
-
function slotsInUse(
|
|
5499
|
+
function slotsInUse() {
|
|
5502
5500
|
return _slotsInUse.apply(this, arguments);
|
|
5503
5501
|
}
|
|
5504
5502
|
|
|
@@ -5507,7 +5505,38 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5507
5505
|
|
|
5508
5506
|
_proto.totalReferralSlots = function totalReferralSlots() {
|
|
5509
5507
|
return 500;
|
|
5510
|
-
}
|
|
5508
|
+
};
|
|
5509
|
+
|
|
5510
|
+
_proto.queuePosition = /*#__PURE__*/function () {
|
|
5511
|
+
var _queuePosition = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee8(address) {
|
|
5512
|
+
var result;
|
|
5513
|
+
return runtime_1.wrap(function _callee8$(_context8) {
|
|
5514
|
+
while (1) {
|
|
5515
|
+
switch (_context8.prev = _context8.next) {
|
|
5516
|
+
case 0:
|
|
5517
|
+
_context8.next = 2;
|
|
5518
|
+
return getApi('/referral/queuePosition', {
|
|
5519
|
+
address: address
|
|
5520
|
+
});
|
|
5521
|
+
|
|
5522
|
+
case 2:
|
|
5523
|
+
result = _context8.sent;
|
|
5524
|
+
return _context8.abrupt("return", result);
|
|
5525
|
+
|
|
5526
|
+
case 4:
|
|
5527
|
+
case "end":
|
|
5528
|
+
return _context8.stop();
|
|
5529
|
+
}
|
|
5530
|
+
}
|
|
5531
|
+
}, _callee8);
|
|
5532
|
+
}));
|
|
5533
|
+
|
|
5534
|
+
function queuePosition(_x7) {
|
|
5535
|
+
return _queuePosition.apply(this, arguments);
|
|
5536
|
+
}
|
|
5537
|
+
|
|
5538
|
+
return queuePosition;
|
|
5539
|
+
}()
|
|
5511
5540
|
/**
|
|
5512
5541
|
* a way to determine qualification status of a user. null if not referred yet,
|
|
5513
5542
|
* qualified if referred + min deposit, notQualified if referred + min deposit
|
|
@@ -5518,41 +5547,41 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5518
5547
|
_proto.userReferralStatus =
|
|
5519
5548
|
/*#__PURE__*/
|
|
5520
5549
|
function () {
|
|
5521
|
-
var _userReferralStatus = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
5550
|
+
var _userReferralStatus = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee9(userAddr) {
|
|
5522
5551
|
var result;
|
|
5523
|
-
return runtime_1.wrap(function
|
|
5552
|
+
return runtime_1.wrap(function _callee9$(_context9) {
|
|
5524
5553
|
while (1) {
|
|
5525
|
-
switch (
|
|
5554
|
+
switch (_context9.prev = _context9.next) {
|
|
5526
5555
|
case 0:
|
|
5527
|
-
|
|
5556
|
+
_context9.next = 2;
|
|
5528
5557
|
return getApi('/referral/referralStatus', {
|
|
5529
5558
|
address: userAddr
|
|
5530
5559
|
});
|
|
5531
5560
|
|
|
5532
5561
|
case 2:
|
|
5533
|
-
result =
|
|
5534
|
-
|
|
5535
|
-
|
|
5562
|
+
result = _context9.sent;
|
|
5563
|
+
_context9.t0 = result;
|
|
5564
|
+
_context9.next = _context9.t0 === -1 ? 6 : _context9.t0 === 0 ? 7 : _context9.t0 === 1 ? 8 : 9;
|
|
5536
5565
|
break;
|
|
5537
5566
|
|
|
5538
5567
|
case 6:
|
|
5539
|
-
return
|
|
5568
|
+
return _context9.abrupt("return", 'notReferred');
|
|
5540
5569
|
|
|
5541
5570
|
case 7:
|
|
5542
|
-
return
|
|
5571
|
+
return _context9.abrupt("return", 'notQualified');
|
|
5543
5572
|
|
|
5544
5573
|
case 8:
|
|
5545
|
-
return
|
|
5574
|
+
return _context9.abrupt("return", 'Qualified');
|
|
5546
5575
|
|
|
5547
5576
|
case 9:
|
|
5548
|
-
return
|
|
5577
|
+
return _context9.abrupt("return", 'Withdrawn');
|
|
5549
5578
|
|
|
5550
5579
|
case 10:
|
|
5551
5580
|
case "end":
|
|
5552
|
-
return
|
|
5581
|
+
return _context9.stop();
|
|
5553
5582
|
}
|
|
5554
5583
|
}
|
|
5555
|
-
},
|
|
5584
|
+
}, _callee9);
|
|
5556
5585
|
}));
|
|
5557
5586
|
|
|
5558
5587
|
function userReferralStatus(_x8) {
|
|
@@ -5563,25 +5592,25 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5563
5592
|
}();
|
|
5564
5593
|
|
|
5565
5594
|
_proto.isWhitelistedAddress = /*#__PURE__*/function () {
|
|
5566
|
-
var _isWhitelistedAddress = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
5595
|
+
var _isWhitelistedAddress = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee10(address) {
|
|
5567
5596
|
var result;
|
|
5568
|
-
return runtime_1.wrap(function
|
|
5597
|
+
return runtime_1.wrap(function _callee10$(_context10) {
|
|
5569
5598
|
while (1) {
|
|
5570
|
-
switch (
|
|
5599
|
+
switch (_context10.prev = _context10.next) {
|
|
5571
5600
|
case 0:
|
|
5572
|
-
|
|
5601
|
+
_context10.next = 2;
|
|
5573
5602
|
return this.env.referralDirectoryV2.isUserWhitelisted(address);
|
|
5574
5603
|
|
|
5575
5604
|
case 2:
|
|
5576
|
-
result =
|
|
5577
|
-
return
|
|
5605
|
+
result = _context10.sent;
|
|
5606
|
+
return _context10.abrupt("return", result.eq(1));
|
|
5578
5607
|
|
|
5579
5608
|
case 4:
|
|
5580
5609
|
case "end":
|
|
5581
|
-
return
|
|
5610
|
+
return _context10.stop();
|
|
5582
5611
|
}
|
|
5583
5612
|
}
|
|
5584
|
-
},
|
|
5613
|
+
}, _callee10, this);
|
|
5585
5614
|
}));
|
|
5586
5615
|
|
|
5587
5616
|
function isWhitelistedAddress(_x9) {
|
|
@@ -5592,25 +5621,25 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5592
5621
|
}();
|
|
5593
5622
|
|
|
5594
5623
|
_proto.isOnAuroraPlus = /*#__PURE__*/function () {
|
|
5595
|
-
var _isOnAuroraPlus = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
5624
|
+
var _isOnAuroraPlus = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(address) {
|
|
5596
5625
|
var resp;
|
|
5597
|
-
return runtime_1.wrap(function
|
|
5626
|
+
return runtime_1.wrap(function _callee11$(_context11) {
|
|
5598
5627
|
while (1) {
|
|
5599
|
-
switch (
|
|
5628
|
+
switch (_context11.prev = _context11.next) {
|
|
5600
5629
|
case 0:
|
|
5601
|
-
|
|
5630
|
+
_context11.next = 2;
|
|
5602
5631
|
return axios.get(AURORA_PLUS_API_PREFIX + address);
|
|
5603
5632
|
|
|
5604
5633
|
case 2:
|
|
5605
|
-
resp =
|
|
5606
|
-
return
|
|
5634
|
+
resp = _context11.sent;
|
|
5635
|
+
return _context11.abrupt("return", resp.data.status == 'active');
|
|
5607
5636
|
|
|
5608
5637
|
case 4:
|
|
5609
5638
|
case "end":
|
|
5610
|
-
return
|
|
5639
|
+
return _context11.stop();
|
|
5611
5640
|
}
|
|
5612
5641
|
}
|
|
5613
|
-
},
|
|
5642
|
+
}, _callee11);
|
|
5614
5643
|
}));
|
|
5615
5644
|
|
|
5616
5645
|
function isOnAuroraPlus(_x10) {
|
|
@@ -5621,27 +5650,27 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5621
5650
|
}();
|
|
5622
5651
|
|
|
5623
5652
|
_proto.isNewUserAtReferralTime = /*#__PURE__*/function () {
|
|
5624
|
-
var _isNewUserAtReferralTime = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
5653
|
+
var _isNewUserAtReferralTime = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(address) {
|
|
5625
5654
|
var result;
|
|
5626
|
-
return runtime_1.wrap(function
|
|
5655
|
+
return runtime_1.wrap(function _callee12$(_context12) {
|
|
5627
5656
|
while (1) {
|
|
5628
|
-
switch (
|
|
5657
|
+
switch (_context12.prev = _context12.next) {
|
|
5629
5658
|
case 0:
|
|
5630
|
-
|
|
5659
|
+
_context12.next = 2;
|
|
5631
5660
|
return getApi('/referral/isNewUser', {
|
|
5632
5661
|
address: address
|
|
5633
5662
|
});
|
|
5634
5663
|
|
|
5635
5664
|
case 2:
|
|
5636
|
-
result =
|
|
5637
|
-
return
|
|
5665
|
+
result = _context12.sent;
|
|
5666
|
+
return _context12.abrupt("return", result);
|
|
5638
5667
|
|
|
5639
5668
|
case 4:
|
|
5640
5669
|
case "end":
|
|
5641
|
-
return
|
|
5670
|
+
return _context12.stop();
|
|
5642
5671
|
}
|
|
5643
5672
|
}
|
|
5644
|
-
},
|
|
5673
|
+
}, _callee12);
|
|
5645
5674
|
}));
|
|
5646
5675
|
|
|
5647
5676
|
function isNewUserAtReferralTime(_x11) {
|
|
@@ -5652,27 +5681,27 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5652
5681
|
}();
|
|
5653
5682
|
|
|
5654
5683
|
_proto.depositedMoreThanMinimumAmount = /*#__PURE__*/function () {
|
|
5655
|
-
var _depositedMoreThanMinimumAmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
5684
|
+
var _depositedMoreThanMinimumAmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13(address) {
|
|
5656
5685
|
var result;
|
|
5657
|
-
return runtime_1.wrap(function
|
|
5686
|
+
return runtime_1.wrap(function _callee13$(_context13) {
|
|
5658
5687
|
while (1) {
|
|
5659
|
-
switch (
|
|
5688
|
+
switch (_context13.prev = _context13.next) {
|
|
5660
5689
|
case 0:
|
|
5661
|
-
|
|
5690
|
+
_context13.next = 2;
|
|
5662
5691
|
return getApi('/referral/depositedEnough', {
|
|
5663
5692
|
address: address
|
|
5664
5693
|
});
|
|
5665
5694
|
|
|
5666
5695
|
case 2:
|
|
5667
|
-
result =
|
|
5668
|
-
return
|
|
5696
|
+
result = _context13.sent;
|
|
5697
|
+
return _context13.abrupt("return", result);
|
|
5669
5698
|
|
|
5670
5699
|
case 4:
|
|
5671
5700
|
case "end":
|
|
5672
|
-
return
|
|
5701
|
+
return _context13.stop();
|
|
5673
5702
|
}
|
|
5674
5703
|
}
|
|
5675
|
-
},
|
|
5704
|
+
}, _callee13);
|
|
5676
5705
|
}));
|
|
5677
5706
|
|
|
5678
5707
|
function depositedMoreThanMinimumAmount(_x12) {
|
|
@@ -5701,21 +5730,21 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
|
|
|
5701
5730
|
_proto2.registerNewReferralCode =
|
|
5702
5731
|
/*#__PURE__*/
|
|
5703
5732
|
function () {
|
|
5704
|
-
var _registerNewReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
5733
|
+
var _registerNewReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee14() {
|
|
5705
5734
|
var referralCode;
|
|
5706
|
-
return runtime_1.wrap(function
|
|
5735
|
+
return runtime_1.wrap(function _callee14$(_context14) {
|
|
5707
5736
|
while (1) {
|
|
5708
|
-
switch (
|
|
5737
|
+
switch (_context14.prev = _context14.next) {
|
|
5709
5738
|
case 0:
|
|
5710
5739
|
referralCode = ethers.utils.formatBytes32String(this.generateReferralCode());
|
|
5711
|
-
return
|
|
5740
|
+
return _context14.abrupt("return", this.env.referralDirectoryV2.connect(this._networkConnection.signer).registerNewUserReferralCode(referralCode));
|
|
5712
5741
|
|
|
5713
5742
|
case 2:
|
|
5714
5743
|
case "end":
|
|
5715
|
-
return
|
|
5744
|
+
return _context14.stop();
|
|
5716
5745
|
}
|
|
5717
5746
|
}
|
|
5718
|
-
},
|
|
5747
|
+
}, _callee14, this);
|
|
5719
5748
|
}));
|
|
5720
5749
|
|
|
5721
5750
|
function registerNewReferralCode() {
|
|
@@ -5732,21 +5761,21 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
|
|
|
5732
5761
|
_proto2.useReferralCode =
|
|
5733
5762
|
/*#__PURE__*/
|
|
5734
5763
|
function () {
|
|
5735
|
-
var _useReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
5764
|
+
var _useReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee15(code) {
|
|
5736
5765
|
var referralCode;
|
|
5737
|
-
return runtime_1.wrap(function
|
|
5766
|
+
return runtime_1.wrap(function _callee15$(_context15) {
|
|
5738
5767
|
while (1) {
|
|
5739
|
-
switch (
|
|
5768
|
+
switch (_context15.prev = _context15.next) {
|
|
5740
5769
|
case 0:
|
|
5741
5770
|
referralCode = ethers.utils.formatBytes32String(code);
|
|
5742
|
-
return
|
|
5771
|
+
return _context15.abrupt("return", this.env.referralDirectoryV2.connect(this._networkConnection.signer).registerReferralCodeUsed(referralCode));
|
|
5743
5772
|
|
|
5744
5773
|
case 2:
|
|
5745
5774
|
case "end":
|
|
5746
|
-
return
|
|
5775
|
+
return _context15.stop();
|
|
5747
5776
|
}
|
|
5748
5777
|
}
|
|
5749
|
-
},
|
|
5778
|
+
}, _callee15, this);
|
|
5750
5779
|
}));
|
|
5751
5780
|
|
|
5752
5781
|
function useReferralCode(_x13) {
|
|
@@ -5763,23 +5792,23 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
|
|
|
5763
5792
|
_proto2.claimReferralRewards =
|
|
5764
5793
|
/*#__PURE__*/
|
|
5765
5794
|
function () {
|
|
5766
|
-
var _claimReferralRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
5795
|
+
var _claimReferralRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee16() {
|
|
5767
5796
|
var unclaimedRewards, campaigns, tokens;
|
|
5768
|
-
return runtime_1.wrap(function
|
|
5797
|
+
return runtime_1.wrap(function _callee16$(_context16) {
|
|
5769
5798
|
while (1) {
|
|
5770
|
-
switch (
|
|
5799
|
+
switch (_context16.prev = _context16.next) {
|
|
5771
5800
|
case 0:
|
|
5772
|
-
|
|
5773
|
-
|
|
5801
|
+
_context16.t0 = this;
|
|
5802
|
+
_context16.next = 3;
|
|
5774
5803
|
return this._networkConnection.signer.getAddress();
|
|
5775
5804
|
|
|
5776
5805
|
case 3:
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
return
|
|
5806
|
+
_context16.t1 = _context16.sent;
|
|
5807
|
+
_context16.next = 6;
|
|
5808
|
+
return _context16.t0.referralRewards.call(_context16.t0, _context16.t1);
|
|
5780
5809
|
|
|
5781
5810
|
case 6:
|
|
5782
|
-
unclaimedRewards =
|
|
5811
|
+
unclaimedRewards = _context16.sent.filter(function (reward) {
|
|
5783
5812
|
return reward.transactionHash == null;
|
|
5784
5813
|
});
|
|
5785
5814
|
campaigns = unclaimedRewards.map(function (reward) {
|
|
@@ -5788,14 +5817,14 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
|
|
|
5788
5817
|
tokens = unclaimedRewards.map(function (reward) {
|
|
5789
5818
|
return reward.rewardTokenAmount.token.address;
|
|
5790
5819
|
});
|
|
5791
|
-
return
|
|
5820
|
+
return _context16.abrupt("return", new AirdropReadWrite(this._networkConnection).redeemMultiple(campaigns, tokens));
|
|
5792
5821
|
|
|
5793
5822
|
case 10:
|
|
5794
5823
|
case "end":
|
|
5795
|
-
return
|
|
5824
|
+
return _context16.stop();
|
|
5796
5825
|
}
|
|
5797
5826
|
}
|
|
5798
|
-
},
|
|
5827
|
+
}, _callee16, this);
|
|
5799
5828
|
}));
|
|
5800
5829
|
|
|
5801
5830
|
function claimReferralRewards() {
|