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