@aurigami/sdk 1.12.0-beta3 → 1.12.0-beta4
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 -0
- package/dist/sdk.cjs.development.js +87 -25
- 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 +87 -25
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/interactors/Referral.ts +10 -0
package/dist/sdk.esm.js
CHANGED
|
@@ -5506,6 +5506,68 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
5506
5506
|
return isOnAuroraPlus;
|
|
5507
5507
|
}();
|
|
5508
5508
|
|
|
5509
|
+
_proto.isNewUserAtReferralTime = /*#__PURE__*/function () {
|
|
5510
|
+
var _isNewUserAtReferralTime = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee11(address) {
|
|
5511
|
+
var result;
|
|
5512
|
+
return runtime_1.wrap(function _callee11$(_context11) {
|
|
5513
|
+
while (1) {
|
|
5514
|
+
switch (_context11.prev = _context11.next) {
|
|
5515
|
+
case 0:
|
|
5516
|
+
_context11.next = 2;
|
|
5517
|
+
return getApi('/referral/isNewUser', {
|
|
5518
|
+
address: address
|
|
5519
|
+
});
|
|
5520
|
+
|
|
5521
|
+
case 2:
|
|
5522
|
+
result = _context11.sent;
|
|
5523
|
+
return _context11.abrupt("return", result);
|
|
5524
|
+
|
|
5525
|
+
case 4:
|
|
5526
|
+
case "end":
|
|
5527
|
+
return _context11.stop();
|
|
5528
|
+
}
|
|
5529
|
+
}
|
|
5530
|
+
}, _callee11);
|
|
5531
|
+
}));
|
|
5532
|
+
|
|
5533
|
+
function isNewUserAtReferralTime(_x11) {
|
|
5534
|
+
return _isNewUserAtReferralTime.apply(this, arguments);
|
|
5535
|
+
}
|
|
5536
|
+
|
|
5537
|
+
return isNewUserAtReferralTime;
|
|
5538
|
+
}();
|
|
5539
|
+
|
|
5540
|
+
_proto.depositedMoreThanMinimumAmount = /*#__PURE__*/function () {
|
|
5541
|
+
var _depositedMoreThanMinimumAmount = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee12(address) {
|
|
5542
|
+
var result;
|
|
5543
|
+
return runtime_1.wrap(function _callee12$(_context12) {
|
|
5544
|
+
while (1) {
|
|
5545
|
+
switch (_context12.prev = _context12.next) {
|
|
5546
|
+
case 0:
|
|
5547
|
+
_context12.next = 2;
|
|
5548
|
+
return getApi('/referral/depositedEnough', {
|
|
5549
|
+
address: address
|
|
5550
|
+
});
|
|
5551
|
+
|
|
5552
|
+
case 2:
|
|
5553
|
+
result = _context12.sent;
|
|
5554
|
+
return _context12.abrupt("return", result);
|
|
5555
|
+
|
|
5556
|
+
case 4:
|
|
5557
|
+
case "end":
|
|
5558
|
+
return _context12.stop();
|
|
5559
|
+
}
|
|
5560
|
+
}
|
|
5561
|
+
}, _callee12);
|
|
5562
|
+
}));
|
|
5563
|
+
|
|
5564
|
+
function depositedMoreThanMinimumAmount(_x12) {
|
|
5565
|
+
return _depositedMoreThanMinimumAmount.apply(this, arguments);
|
|
5566
|
+
}
|
|
5567
|
+
|
|
5568
|
+
return depositedMoreThanMinimumAmount;
|
|
5569
|
+
}();
|
|
5570
|
+
|
|
5509
5571
|
return ReferralRead;
|
|
5510
5572
|
}(BlockchainEntityRead);
|
|
5511
5573
|
var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
|
|
@@ -5525,21 +5587,21 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
|
|
|
5525
5587
|
_proto2.registerNewReferralCode =
|
|
5526
5588
|
/*#__PURE__*/
|
|
5527
5589
|
function () {
|
|
5528
|
-
var _registerNewReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
5590
|
+
var _registerNewReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee13() {
|
|
5529
5591
|
var referralCode;
|
|
5530
|
-
return runtime_1.wrap(function
|
|
5592
|
+
return runtime_1.wrap(function _callee13$(_context13) {
|
|
5531
5593
|
while (1) {
|
|
5532
|
-
switch (
|
|
5594
|
+
switch (_context13.prev = _context13.next) {
|
|
5533
5595
|
case 0:
|
|
5534
5596
|
referralCode = ethers.utils.formatBytes32String(this.generateReferralCode());
|
|
5535
|
-
return
|
|
5597
|
+
return _context13.abrupt("return", this.env.referralDirectory.connect(this._networkConnection.signer).registerNewUserReferralCode(referralCode));
|
|
5536
5598
|
|
|
5537
5599
|
case 2:
|
|
5538
5600
|
case "end":
|
|
5539
|
-
return
|
|
5601
|
+
return _context13.stop();
|
|
5540
5602
|
}
|
|
5541
5603
|
}
|
|
5542
|
-
},
|
|
5604
|
+
}, _callee13, this);
|
|
5543
5605
|
}));
|
|
5544
5606
|
|
|
5545
5607
|
function registerNewReferralCode() {
|
|
@@ -5556,24 +5618,24 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
|
|
|
5556
5618
|
_proto2.useReferralCode =
|
|
5557
5619
|
/*#__PURE__*/
|
|
5558
5620
|
function () {
|
|
5559
|
-
var _useReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
5621
|
+
var _useReferralCode = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee14(code) {
|
|
5560
5622
|
var referralCode;
|
|
5561
|
-
return runtime_1.wrap(function
|
|
5623
|
+
return runtime_1.wrap(function _callee14$(_context14) {
|
|
5562
5624
|
while (1) {
|
|
5563
|
-
switch (
|
|
5625
|
+
switch (_context14.prev = _context14.next) {
|
|
5564
5626
|
case 0:
|
|
5565
5627
|
referralCode = ethers.utils.formatBytes32String(code);
|
|
5566
|
-
return
|
|
5628
|
+
return _context14.abrupt("return", this.env.referralDirectory.connect(this._networkConnection.signer).registerReferralCodeUsed(referralCode));
|
|
5567
5629
|
|
|
5568
5630
|
case 2:
|
|
5569
5631
|
case "end":
|
|
5570
|
-
return
|
|
5632
|
+
return _context14.stop();
|
|
5571
5633
|
}
|
|
5572
5634
|
}
|
|
5573
|
-
},
|
|
5635
|
+
}, _callee14, this);
|
|
5574
5636
|
}));
|
|
5575
5637
|
|
|
5576
|
-
function useReferralCode(
|
|
5638
|
+
function useReferralCode(_x13) {
|
|
5577
5639
|
return _useReferralCode.apply(this, arguments);
|
|
5578
5640
|
}
|
|
5579
5641
|
|
|
@@ -5587,23 +5649,23 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
|
|
|
5587
5649
|
_proto2.claimReferralRewards =
|
|
5588
5650
|
/*#__PURE__*/
|
|
5589
5651
|
function () {
|
|
5590
|
-
var _claimReferralRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
5652
|
+
var _claimReferralRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee15() {
|
|
5591
5653
|
var unclaimedRewards, campaigns, tokens;
|
|
5592
|
-
return runtime_1.wrap(function
|
|
5654
|
+
return runtime_1.wrap(function _callee15$(_context15) {
|
|
5593
5655
|
while (1) {
|
|
5594
|
-
switch (
|
|
5656
|
+
switch (_context15.prev = _context15.next) {
|
|
5595
5657
|
case 0:
|
|
5596
|
-
|
|
5597
|
-
|
|
5658
|
+
_context15.t0 = this;
|
|
5659
|
+
_context15.next = 3;
|
|
5598
5660
|
return this._networkConnection.signer.getAddress();
|
|
5599
5661
|
|
|
5600
5662
|
case 3:
|
|
5601
|
-
|
|
5602
|
-
|
|
5603
|
-
return
|
|
5663
|
+
_context15.t1 = _context15.sent;
|
|
5664
|
+
_context15.next = 6;
|
|
5665
|
+
return _context15.t0.referralRewards.call(_context15.t0, _context15.t1);
|
|
5604
5666
|
|
|
5605
5667
|
case 6:
|
|
5606
|
-
unclaimedRewards =
|
|
5668
|
+
unclaimedRewards = _context15.sent.filter(function (reward) {
|
|
5607
5669
|
return reward.transactionHash == null;
|
|
5608
5670
|
});
|
|
5609
5671
|
campaigns = unclaimedRewards.map(function (reward) {
|
|
@@ -5612,14 +5674,14 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
|
|
|
5612
5674
|
tokens = unclaimedRewards.map(function (reward) {
|
|
5613
5675
|
return reward.rewardTokenAmount.token.address;
|
|
5614
5676
|
});
|
|
5615
|
-
return
|
|
5677
|
+
return _context15.abrupt("return", new AirdropReadWrite(this._networkConnection).redeemMultiple(campaigns, tokens));
|
|
5616
5678
|
|
|
5617
5679
|
case 10:
|
|
5618
5680
|
case "end":
|
|
5619
|
-
return
|
|
5681
|
+
return _context15.stop();
|
|
5620
5682
|
}
|
|
5621
5683
|
}
|
|
5622
|
-
},
|
|
5684
|
+
}, _callee15, this);
|
|
5623
5685
|
}));
|
|
5624
5686
|
|
|
5625
5687
|
function claimReferralRewards() {
|