@aurigami/sdk 1.7.8-dummy → 1.8.0
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 +64 -9
- 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 +64 -10
- package/dist/sdk.esm.js.map +1 -1
- package/dist/types/index.d.ts +4 -0
- package/package.json +1 -1
- package/src/consts/constants.ts +6 -0
- package/src/consts/dummy.ts +2 -0
- package/src/contracts/Referral.ts +26 -7
- package/src/entities/tokenAmount.ts +4 -0
- package/src/types/index.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-1805', {
|
|
159
|
+
start: 1652882400,
|
|
160
|
+
end: 1653487199
|
|
161
|
+
}], ['referrer-1805', {
|
|
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;
|
|
@@ -1663,7 +1674,8 @@ var referralRewardDummy1 = {
|
|
|
1663
1674
|
endTime: 1653573599,
|
|
1664
1675
|
isReferrer: false,
|
|
1665
1676
|
rewardTokenAmount: dummyTokenAmount,
|
|
1666
|
-
transactionHash: null
|
|
1677
|
+
transactionHash: null,
|
|
1678
|
+
userAddr: '0x...123'
|
|
1667
1679
|
};
|
|
1668
1680
|
var referralRewardDummy2 = {
|
|
1669
1681
|
campaign: 'testb',
|
|
@@ -1671,7 +1683,8 @@ var referralRewardDummy2 = {
|
|
|
1671
1683
|
endTime: 1653573599,
|
|
1672
1684
|
isReferrer: true,
|
|
1673
1685
|
rewardTokenAmount: dummyTokenAmount2,
|
|
1674
|
-
transactionHash: '0x4da9657663b46ef18d150b897b28c7b717f16421978b52e3a06d91b54ca3548b'
|
|
1686
|
+
transactionHash: '0x4da9657663b46ef18d150b897b28c7b717f16421978b52e3a06d91b54ca3548b',
|
|
1687
|
+
userAddr: '0x...456'
|
|
1675
1688
|
};
|
|
1676
1689
|
|
|
1677
1690
|
var AURIGAMI_API_END_POINT = 'https://api.aurigami.finance/app/';
|
|
@@ -4665,13 +4678,32 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4665
4678
|
/*#__PURE__*/
|
|
4666
4679
|
function () {
|
|
4667
4680
|
var _referralRewards = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee5(userAddr) {
|
|
4681
|
+
var result, items;
|
|
4668
4682
|
return runtime_1.wrap(function _callee5$(_context5) {
|
|
4669
4683
|
while (1) {
|
|
4670
4684
|
switch (_context5.prev = _context5.next) {
|
|
4671
4685
|
case 0:
|
|
4672
|
-
|
|
4686
|
+
_context5.next = 2;
|
|
4687
|
+
return getPaginatedApi('/referral/rewards', {
|
|
4688
|
+
address: userAddr
|
|
4689
|
+
});
|
|
4673
4690
|
|
|
4674
|
-
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:
|
|
4675
4707
|
case "end":
|
|
4676
4708
|
return _context5.stop();
|
|
4677
4709
|
}
|
|
@@ -4693,14 +4725,36 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4693
4725
|
_proto.leaderboard =
|
|
4694
4726
|
/*#__PURE__*/
|
|
4695
4727
|
function () {
|
|
4696
|
-
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;
|
|
4697
4730
|
return runtime_1.wrap(function _callee6$(_context6) {
|
|
4698
4731
|
while (1) {
|
|
4699
4732
|
switch (_context6.prev = _context6.next) {
|
|
4700
4733
|
case 0:
|
|
4701
|
-
|
|
4734
|
+
_context6.next = 2;
|
|
4735
|
+
return getPaginatedApi('/referral/leaderboard', {
|
|
4736
|
+
campaign: campaign
|
|
4737
|
+
});
|
|
4702
4738
|
|
|
4703
|
-
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:
|
|
4704
4758
|
case "end":
|
|
4705
4759
|
return _context6.stop();
|
|
4706
4760
|
}
|
|
@@ -4708,7 +4762,7 @@ var ReferralRead = /*#__PURE__*/function (_BlockchainEntityRead) {
|
|
|
4708
4762
|
}, _callee6);
|
|
4709
4763
|
}));
|
|
4710
4764
|
|
|
4711
|
-
function leaderboard() {
|
|
4765
|
+
function leaderboard(_x6) {
|
|
4712
4766
|
return _leaderboard.apply(this, arguments);
|
|
4713
4767
|
}
|
|
4714
4768
|
|
|
@@ -4782,7 +4836,7 @@ var ReferralReadWrite = /*#__PURE__*/function (_ReferralRead) {
|
|
|
4782
4836
|
}, _callee8, this);
|
|
4783
4837
|
}));
|
|
4784
4838
|
|
|
4785
|
-
function useReferralCode(
|
|
4839
|
+
function useReferralCode(_x7) {
|
|
4786
4840
|
return _useReferralCode.apply(this, arguments);
|
|
4787
4841
|
}
|
|
4788
4842
|
|
|
@@ -5268,5 +5322,5 @@ BigNumber.config({
|
|
|
5268
5322
|
DECIMAL_PLACES: 50
|
|
5269
5323
|
});
|
|
5270
5324
|
|
|
5271
|
-
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 };
|
|
5272
5326
|
//# sourceMappingURL=sdk.esm.js.map
|