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