@aurigami/sdk 1.7.9-dummy → 1.8.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/consts/constants.d.ts +6 -0
- package/dist/contracts/Referral.d.ts +1 -1
- package/dist/entities/tokenAmount.d.ts +1 -0
- package/dist/sdk.cjs.development.js +60 -7
- 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 +60 -8
- package/dist/sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/consts/constants.ts +6 -0
- package/src/contracts/Referral.ts +26 -7
- package/src/entities/tokenAmount.ts +4 -0
package/dist/sdk.esm.js
CHANGED
|
@@ -155,6 +155,13 @@ Object.entries({
|
|
|
155
155
|
var BORROW_NEAR_REWARDS_PER_WEEK = {// currently 0 for all markets
|
|
156
156
|
};
|
|
157
157
|
var HARDCODE_PRICE_TOKENS = /*#__PURE__*/Object.fromEntries([[/*#__PURE__*/networkAddresses.tokens.USN.toLowerCase(), '1']]);
|
|
158
|
+
var REFERRAL_CAMPAIGNS = /*#__PURE__*/Object.fromEntries([['referral-2505', {
|
|
159
|
+
start: 1652882400,
|
|
160
|
+
end: 1653487199
|
|
161
|
+
}], ['referrer-2505', {
|
|
162
|
+
start: 1652882400,
|
|
163
|
+
end: 1653487199
|
|
164
|
+
}]]);
|
|
158
165
|
|
|
159
166
|
var decimalRecords = {
|
|
160
167
|
'0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee': 18,
|
|
@@ -1628,6 +1635,10 @@ var TokenAmount = /*#__PURE__*/function () {
|
|
|
1628
1635
|
return this.rawAmnt;
|
|
1629
1636
|
};
|
|
1630
1637
|
|
|
1638
|
+
_proto.compare = function compare(other) {
|
|
1639
|
+
return new BigNumber(this.rawAmnt).comparedTo(new BigNumber(other.rawAmnt));
|
|
1640
|
+
};
|
|
1641
|
+
|
|
1631
1642
|
TokenAmount.fromAddressAndAmount = function fromAddressAndAmount(tokenAddress, amount, isRaw) {
|
|
1632
1643
|
if (isRaw === void 0) {
|
|
1633
1644
|
isRaw = true;
|
|
@@ -4667,13 +4678,32 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4667
4678
|
/*#__PURE__*/
|
|
4668
4679
|
function () {
|
|
4669
4680
|
var _referralRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(userAddr) {
|
|
4681
|
+
var result, items;
|
|
4670
4682
|
return runtime_1.wrap(function _callee5$(_context5) {
|
|
4671
4683
|
while (1) {
|
|
4672
4684
|
switch (_context5.prev = _context5.next) {
|
|
4673
4685
|
case 0:
|
|
4674
|
-
|
|
4686
|
+
_context5.next = 2;
|
|
4687
|
+
return getPaginatedApi('/referral/rewards', {
|
|
4688
|
+
address: userAddr
|
|
4689
|
+
});
|
|
4675
4690
|
|
|
4676
|
-
case
|
|
4691
|
+
case 2:
|
|
4692
|
+
result = _context5.sent;
|
|
4693
|
+
items = result.items.map(function (item, i) {
|
|
4694
|
+
return {
|
|
4695
|
+
campaign: item.campaign,
|
|
4696
|
+
userAddr: userAddr,
|
|
4697
|
+
isReferrer: item.campaign.includes('referrer'),
|
|
4698
|
+
rewardTokenAmount: TokenAmount.fromAddressAndAmount(item.token, item.amount),
|
|
4699
|
+
startTime: REFERRAL_CAMPAIGNS[item.campaign].start,
|
|
4700
|
+
endTime: REFERRAL_CAMPAIGNS[item.campaign].end,
|
|
4701
|
+
transactionHash: item == null ? void 0 : item.transactionHash
|
|
4702
|
+
};
|
|
4703
|
+
});
|
|
4704
|
+
return _context5.abrupt("return", items);
|
|
4705
|
+
|
|
4706
|
+
case 5:
|
|
4677
4707
|
case "end":
|
|
4678
4708
|
return _context5.stop();
|
|
4679
4709
|
}
|
|
@@ -4695,14 +4725,36 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4695
4725
|
_proto.leaderboard =
|
|
4696
4726
|
/*#__PURE__*/
|
|
4697
4727
|
function () {
|
|
4698
|
-
var _leaderboard = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6() {
|
|
4728
|
+
var _leaderboard = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee6(campaign) {
|
|
4729
|
+
var result, items;
|
|
4699
4730
|
return runtime_1.wrap(function _callee6$(_context6) {
|
|
4700
4731
|
while (1) {
|
|
4701
4732
|
switch (_context6.prev = _context6.next) {
|
|
4702
4733
|
case 0:
|
|
4703
|
-
|
|
4734
|
+
_context6.next = 2;
|
|
4735
|
+
return getPaginatedApi('/referral/leaderboard', {
|
|
4736
|
+
campaign: campaign
|
|
4737
|
+
});
|
|
4704
4738
|
|
|
4705
|
-
case
|
|
4739
|
+
case 2:
|
|
4740
|
+
result = _context6.sent;
|
|
4741
|
+
items = result.items.map(function (item, i) {
|
|
4742
|
+
return {
|
|
4743
|
+
campaign: campaign,
|
|
4744
|
+
userAddr: item.user,
|
|
4745
|
+
isReferrer: item.campaign.includes('referrer'),
|
|
4746
|
+
rewardTokenAmount: TokenAmount.fromAddressAndAmount(item.token, item.amount),
|
|
4747
|
+
startTime: REFERRAL_CAMPAIGNS[item.campaign].start,
|
|
4748
|
+
endTime: REFERRAL_CAMPAIGNS[item.campaign].end,
|
|
4749
|
+
transactionHash: null
|
|
4750
|
+
};
|
|
4751
|
+
});
|
|
4752
|
+
items.sort(function (a, b) {
|
|
4753
|
+
return b.rewardTokenAmount.compare(a.rewardTokenAmount);
|
|
4754
|
+
});
|
|
4755
|
+
return _context6.abrupt("return", items);
|
|
4756
|
+
|
|
4757
|
+
case 6:
|
|
4706
4758
|
case "end":
|
|
4707
4759
|
return _context6.stop();
|
|
4708
4760
|
}
|
|
@@ -4710,7 +4762,7 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4710
4762
|
}, _callee6);
|
|
4711
4763
|
}));
|
|
4712
4764
|
|
|
4713
|
-
function leaderboard() {
|
|
4765
|
+
function leaderboard(_x6) {
|
|
4714
4766
|
return _leaderboard.apply(this, arguments);
|
|
4715
4767
|
}
|
|
4716
4768
|
|
|
@@ -4784,7 +4836,7 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
|
|
|
4784
4836
|
}, _callee8, this);
|
|
4785
4837
|
}));
|
|
4786
4838
|
|
|
4787
|
-
function useReferralCode(
|
|
4839
|
+
function useReferralCode(_x7) {
|
|
4788
4840
|
return _useReferralCode.apply(this, arguments);
|
|
4789
4841
|
}
|
|
4790
4842
|
|
|
@@ -5270,5 +5322,5 @@ BigNumber.config({
|
|
|
5270
5322
|
DECIMAL_PLACES: 50
|
|
5271
5323
|
});
|
|
5272
5324
|
|
|
5273
|
-
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, 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, fetchToken0PriceByLP, fetchUnderlyingTokensPrices, fetchValuation, formatObject, getApi, getBlockBeforeTimestamp, getBlockTimestamp, getBlocksTimestamp, getBlocksTimestampViaRPC, getCurrentTimestamp, getDecimal, getPaginatedApi, getQuery, getSymbol, getUnderlying, isSameAddress, networkAddresses, queryGraphQL, referralRewardDummy1, referralRewardDummy2, symbolRecords, validateAndParseAddress, valuateToken };
|
|
5325
|
+
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, 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, fetchToken0PriceByLP, fetchUnderlyingTokensPrices, fetchValuation, formatObject, getApi, getBlockBeforeTimestamp, getBlockTimestamp, getBlocksTimestamp, getBlocksTimestampViaRPC, getCurrentTimestamp, getDecimal, getPaginatedApi, getQuery, getSymbol, getUnderlying, isSameAddress, networkAddresses, queryGraphQL, referralRewardDummy1, referralRewardDummy2, symbolRecords, validateAndParseAddress, valuateToken };
|
|
5274
5326
|
//# sourceMappingURL=sdk.esm.js.map
|