@sonarwatch/portfolio-plugins 0.14.180 → 0.14.181
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/CHANGELOG.md +2362 -2358
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/index.js +6 -0
- package/src/index.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/bio/constants.d.ts +7 -0
- package/src/plugins/bio/constants.js +9 -0
- package/src/plugins/bio/constants.js.map +1 -0
- package/src/plugins/bio/depositFetcher.d.ts +3 -0
- package/src/plugins/bio/depositFetcher.js +85 -0
- package/src/plugins/bio/depositFetcher.js.map +1 -0
- package/src/plugins/bio/helpers.d.ts +4 -0
- package/src/plugins/bio/helpers.js +14 -0
- package/src/plugins/bio/helpers.js.map +1 -0
- package/src/plugins/bio/index.d.ts +4 -0
- package/src/plugins/bio/index.js +11 -0
- package/src/plugins/bio/index.js.map +1 -0
- package/src/plugins/bio/structs.d.ts +61 -0
- package/src/plugins/bio/structs.js +40 -0
- package/src/plugins/bio/structs.js.map +1 -0
- package/src/plugins/bio/tokenStatsJob.d.ts +3 -0
- package/src/plugins/bio/tokenStatsJob.js +33 -0
- package/src/plugins/bio/tokenStatsJob.js.map +1 -0
- package/src/plugins/cropper/index.js +2 -1
- package/src/plugins/cropper/index.js.map +1 -1
- package/src/plugins/cropper/stakingFetcher.js +5 -6
- package/src/plugins/cropper/stakingFetcher.js.map +1 -1
- package/src/plugins/debridge/airdropFetcher.js +6 -14
- package/src/plugins/debridge/airdropFetcher.js.map +1 -1
- package/src/plugins/debridge/dlmmVaultsFetcher.js +15 -6
- package/src/plugins/debridge/dlmmVaultsFetcher.js.map +1 -1
- package/src/plugins/debridge/helpers.d.ts +5 -0
- package/src/plugins/debridge/helpers.js +18 -0
- package/src/plugins/debridge/helpers.js.map +1 -0
- package/src/plugins/huma/constants.d.ts +3 -0
- package/src/plugins/huma/constants.js +7 -0
- package/src/plugins/huma/constants.js.map +1 -0
- package/src/plugins/huma/index.d.ts +4 -0
- package/src/plugins/huma/index.js +10 -0
- package/src/plugins/huma/index.js.map +1 -0
- package/src/plugins/huma/mpstPricingJob.d.ts +3 -0
- package/src/plugins/huma/mpstPricingJob.js +36 -0
- package/src/plugins/huma/mpstPricingJob.js.map +1 -0
- package/src/plugins/oresupply/boostJob.d.ts +3 -0
- package/src/plugins/oresupply/boostJob.js +34 -0
- package/src/plugins/oresupply/boostJob.js.map +1 -0
- package/src/plugins/oresupply/constants.d.ts +6 -0
- package/src/plugins/oresupply/constants.js +8 -0
- package/src/plugins/oresupply/constants.js.map +1 -0
- package/src/plugins/oresupply/helpers.d.ts +4 -0
- package/src/plugins/oresupply/helpers.js +14 -0
- package/src/plugins/oresupply/helpers.js.map +1 -0
- package/src/plugins/oresupply/index.d.ts +4 -0
- package/src/plugins/oresupply/index.js +11 -0
- package/src/plugins/oresupply/index.js.map +1 -0
- package/src/plugins/oresupply/stakeFetcher.d.ts +3 -0
- package/src/plugins/oresupply/stakeFetcher.js +69 -0
- package/src/plugins/oresupply/stakeFetcher.js.map +1 -0
- package/src/plugins/oresupply/structs.d.ts +52 -0
- package/src/plugins/oresupply/structs.js +42 -0
- package/src/plugins/oresupply/structs.js.map +1 -0
- package/src/plugins/solayer/airdropFetcher.js +13 -9
- package/src/plugins/solayer/airdropFetcher.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/switchboard/onDemandPricingJob.js +6 -0
- package/src/plugins/switchboard/onDemandPricingJob.js.map +1 -1
- package/src/plugins/texture/loansFetcher.js +7 -3
- package/src/plugins/texture/loansFetcher.js.map +1 -1
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/plugins/zeta/airdropFetcher.js +14 -14
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getSolReceiptPdaBySeason = exports.getEvmReceiptPdaBySeason = void 0;
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
5
|
+
const constants_1 = require("./constants");
|
6
|
+
function getEvmReceiptPdaBySeason(owner, season) {
|
7
|
+
return web3_js_1.PublicKey.findProgramAddressSync([
|
8
|
+
constants_1.receiptBuffer,
|
9
|
+
Uint8Array.from([season]),
|
10
|
+
Buffer.from(owner.slice(2), 'hex'),
|
11
|
+
], constants_1.distributorPid)[0];
|
12
|
+
}
|
13
|
+
exports.getEvmReceiptPdaBySeason = getEvmReceiptPdaBySeason;
|
14
|
+
function getSolReceiptPdaBySeason(owner, season) {
|
15
|
+
return web3_js_1.PublicKey.findProgramAddressSync([constants_1.receiptBuffer, Uint8Array.from([season]), new web3_js_1.PublicKey(owner).toBytes()], constants_1.distributorPid)[0];
|
16
|
+
}
|
17
|
+
exports.getSolReceiptPdaBySeason = getSolReceiptPdaBySeason;
|
18
|
+
//# sourceMappingURL=helpers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/debridge/helpers.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAC5C,2CAA4D;AAE5D,SAAgB,wBAAwB,CACtC,KAAa,EACb,MAAc;IAEd,OAAO,mBAAS,CAAC,sBAAsB,CACrC;QACE,yBAAa;QACb,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;QACzB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC;KACnC,EACD,0BAAc,CACf,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AAZD,4DAYC;AAED,SAAgB,wBAAwB,CACtC,KAAa,EACb,MAAc;IAEd,OAAO,mBAAS,CAAC,sBAAsB,CACrC,CAAC,yBAAa,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,EAC1E,0BAAc,CACf,CAAC,CAAC,CAAC,CAAC;AACP,CAAC;AARD,4DAQC"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.mPstMint = exports.pstMint = exports.platformId = void 0;
|
4
|
+
exports.platformId = 'huma';
|
5
|
+
exports.pstMint = '59obFNBzyTBGowrkif5uK7ojS58vsuWz3ZCvg6tfZAGw';
|
6
|
+
exports.mPstMint = 'HUPfpnsaJtJGpJxAPNX1vXah7BgYiQYt1c2JMgMumvPs';
|
7
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/huma/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG,MAAM,CAAC;AACpB,QAAA,OAAO,GAAG,8CAA8C,CAAC;AACzD,QAAA,QAAQ,GAAG,8CAA8C,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.fetchers = exports.jobs = void 0;
|
7
|
+
const mpstPricingJob_1 = __importDefault(require("./mpstPricingJob"));
|
8
|
+
exports.jobs = [mpstPricingJob_1.default];
|
9
|
+
exports.fetchers = [];
|
10
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/huma/index.ts"],"names":[],"mappings":";;;;;;AAEA,sEAA8C;AAEjC,QAAA,IAAI,GAAU,CAAC,wBAAc,CAAC,CAAC;AAC/B,QAAA,QAAQ,GAAc,EAAE,CAAC"}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
+
const constants_1 = require("./constants");
|
14
|
+
const solana_1 = require("../../utils/solana");
|
15
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
16
|
+
const usdcPrice = yield cache.getTokenPrice(solana_1.usdcSolanaMint, portfolio_core_1.NetworkId.solana);
|
17
|
+
if (!usdcPrice)
|
18
|
+
return;
|
19
|
+
yield cache.setTokenPriceSource({
|
20
|
+
address: constants_1.mPstMint,
|
21
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
22
|
+
decimals: 6,
|
23
|
+
id: 'Huma',
|
24
|
+
platformId: portfolio_core_1.walletTokensPlatformId,
|
25
|
+
price: usdcPrice.price,
|
26
|
+
timestamp: Date.now(),
|
27
|
+
weight: 1,
|
28
|
+
});
|
29
|
+
});
|
30
|
+
const job = {
|
31
|
+
id: `${constants_1.platformId}-token-stats`,
|
32
|
+
executor,
|
33
|
+
labels: ['normal'],
|
34
|
+
};
|
35
|
+
exports.default = job;
|
36
|
+
//# sourceMappingURL=mpstPricingJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"mpstPricingJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/huma/mpstPricingJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAA+E;AAG/E,2CAAmD;AACnD,+CAAoD;AAEpD,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,uBAAc,EAAE,0BAAS,CAAC,MAAM,CAAC,CAAC;IAC9E,IAAI,CAAC,SAAS;QAAE,OAAO;IACvB,MAAM,KAAK,CAAC,mBAAmB,CAAC;QAC9B,OAAO,EAAE,oBAAQ;QACjB,SAAS,EAAE,0BAAS,CAAC,MAAM;QAC3B,QAAQ,EAAE,CAAC;QACX,EAAE,EAAE,MAAM;QACV,UAAU,EAAE,uCAAsB;QAClC,KAAK,EAAE,SAAS,CAAC,KAAK;QACtB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;QACrB,MAAM,EAAE,CAAC;KACV,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,QAAQ;IACR,MAAM,EAAE,CAAC,QAAQ,CAAC;CACnB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
+
const constants_1 = require("./constants");
|
14
|
+
const clients_1 = require("../../utils/clients");
|
15
|
+
const structs_1 = require("./structs");
|
16
|
+
const ParsedGpa_1 = require("../../utils/solana/beets/ParsedGpa");
|
17
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
18
|
+
const connection = (0, clients_1.getClientSolana)();
|
19
|
+
const boostAccounts = yield ParsedGpa_1.ParsedGpa.build(connection, structs_1.boostStruct, constants_1.orePid)
|
20
|
+
.addDataSizeFilter(structs_1.boostStruct.byteSize)
|
21
|
+
.addFilter('accountDiscriminator', [100, 0, 0, 0, 0, 0, 0, 0])
|
22
|
+
.run();
|
23
|
+
yield cache.setItem('boosts', boostAccounts, {
|
24
|
+
prefix: constants_1.platformId,
|
25
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
26
|
+
});
|
27
|
+
});
|
28
|
+
const job = {
|
29
|
+
id: `${constants_1.platformId}-boost`,
|
30
|
+
executor,
|
31
|
+
labels: ['normal'],
|
32
|
+
};
|
33
|
+
exports.default = job;
|
34
|
+
//# sourceMappingURL=boostJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"boostJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/oresupply/boostJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAAiD;AACjD,iDAAsD;AACtD,uCAAwC;AACxC,kEAA+D;AAE/D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IACrC,MAAM,aAAa,GAAG,MAAM,qBAAS,CAAC,KAAK,CAAC,UAAU,EAAE,qBAAW,EAAE,kBAAM,CAAC;SACzE,iBAAiB,CAAC,qBAAW,CAAC,QAAQ,CAAC;SACvC,SAAS,CAAC,sBAAsB,EAAE,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;SAC7D,GAAG,EAAE,CAAC;IAET,MAAM,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,aAAa,EAAE;QAC3C,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,MAAM,EAAE,CAAC,QAAQ,CAAC;CACnB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
2
|
+
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
3
|
+
import { PublicKey } from '@solana/web3.js';
|
4
|
+
export declare const platformId = "oresupply";
|
5
|
+
export declare const orePid: PublicKey;
|
6
|
+
export declare const oreMint = "oreoU2P8bN6jkk3jbaiVxYnG1dCXcYxwhwyK9jSybcp";
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.oreMint = exports.orePid = exports.platformId = void 0;
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
5
|
+
exports.platformId = 'oresupply';
|
6
|
+
exports.orePid = new web3_js_1.PublicKey('BoostzzkNfCA9D1qNuN5xZxB5ErbK4zQuBeTHGDpXT1');
|
7
|
+
exports.oreMint = 'oreoU2P8bN6jkk3jbaiVxYnG1dCXcYxwhwyK9jSybcp';
|
8
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/oresupply/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAE/B,QAAA,UAAU,GAAG,WAAW,CAAC;AAEzB,QAAA,MAAM,GAAG,IAAI,mBAAS,CACjC,6CAA6C,CAC9C,CAAC;AACW,QAAA,OAAO,GAAG,6CAA6C,CAAC"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getStakePdas = void 0;
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
5
|
+
const constants_1 = require("./constants");
|
6
|
+
function getStakePdas(owner, boosts) {
|
7
|
+
return boosts.map((boost) => web3_js_1.PublicKey.findProgramAddressSync([
|
8
|
+
Buffer.from('stake', 'utf-8'),
|
9
|
+
new web3_js_1.PublicKey(owner).toBuffer(),
|
10
|
+
new web3_js_1.PublicKey(boost).toBuffer(),
|
11
|
+
], constants_1.orePid)[0]);
|
12
|
+
}
|
13
|
+
exports.getStakePdas = getStakePdas;
|
14
|
+
//# sourceMappingURL=helpers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/oresupply/helpers.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAC5C,2CAAqC;AAErC,SAAgB,YAAY,CAAC,KAAa,EAAE,MAAgB;IAC1D,OAAO,MAAM,CAAC,GAAG,CACf,CAAC,KAAK,EAAE,EAAE,CACR,mBAAS,CAAC,sBAAsB,CAC9B;QACE,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC;QAC7B,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;QAC/B,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;KAChC,EACD,kBAAM,CACP,CAAC,CAAC,CAAC,CACP,CAAC;AACJ,CAAC;AAZD,oCAYC"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.fetchers = exports.jobs = void 0;
|
7
|
+
const stakeFetcher_1 = __importDefault(require("./stakeFetcher"));
|
8
|
+
const boostJob_1 = __importDefault(require("./boostJob"));
|
9
|
+
exports.jobs = [boostJob_1.default];
|
10
|
+
exports.fetchers = [stakeFetcher_1.default];
|
11
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/oresupply/index.ts"],"names":[],"mappings":";;;;;;AAEA,kEAA0C;AAC1C,0DAAkC;AAErB,QAAA,IAAI,GAAU,CAAC,kBAAQ,CAAC,CAAC;AACzB,QAAA,QAAQ,GAAc,CAAC,sBAAY,CAAC,CAAC"}
|
@@ -0,0 +1,69 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
+
const constants_1 = require("./constants");
|
14
|
+
const clients_1 = require("../../utils/clients");
|
15
|
+
const solana_1 = require("../../utils/solana");
|
16
|
+
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
17
|
+
const structs_1 = require("./structs");
|
18
|
+
const MemoizedCache_1 = require("../../utils/misc/MemoizedCache");
|
19
|
+
const helpers_1 = require("./helpers");
|
20
|
+
const boostMemo = new MemoizedCache_1.MemoizedCache('boosts', {
|
21
|
+
prefix: constants_1.platformId,
|
22
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
23
|
+
});
|
24
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
25
|
+
const connection = (0, clients_1.getClientSolana)();
|
26
|
+
const boostAccounts = yield boostMemo.getItem(cache);
|
27
|
+
if (!boostAccounts)
|
28
|
+
throw new Error('Boosts not found in cache');
|
29
|
+
const stakeAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(connection, structs_1.stakeStruct, (0, helpers_1.getStakePdas)(owner, boostAccounts.map((b) => b.pubkey)));
|
30
|
+
if (!stakeAccounts.some((acc) => acc))
|
31
|
+
return [];
|
32
|
+
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
|
33
|
+
const element = elementRegistry.addElementLiquidity({
|
34
|
+
label: 'Farming',
|
35
|
+
});
|
36
|
+
stakeAccounts.forEach((acc) => {
|
37
|
+
if (!acc)
|
38
|
+
return;
|
39
|
+
const boostAcc = boostAccounts.find((b) => b.pubkey === acc.boost.toString());
|
40
|
+
if (!boostAcc)
|
41
|
+
return;
|
42
|
+
const liq = element.addLiquidity({
|
43
|
+
ref: acc.pubkey,
|
44
|
+
link: `https://ore.supply/stake/${boostAcc.mint.toString()}`,
|
45
|
+
sourceRefs: [
|
46
|
+
{
|
47
|
+
address: boostAcc.pubkey.toString(),
|
48
|
+
name: 'Pool',
|
49
|
+
},
|
50
|
+
],
|
51
|
+
});
|
52
|
+
liq.addAsset({
|
53
|
+
address: boostAcc.mint,
|
54
|
+
amount: acc.balance,
|
55
|
+
});
|
56
|
+
liq.addRewardAsset({
|
57
|
+
address: constants_1.oreMint,
|
58
|
+
amount: acc.rewards,
|
59
|
+
});
|
60
|
+
});
|
61
|
+
return elementRegistry.getElements(cache);
|
62
|
+
});
|
63
|
+
const fetcher = {
|
64
|
+
id: `${constants_1.platformId}-staking`,
|
65
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
66
|
+
executor,
|
67
|
+
};
|
68
|
+
exports.default = fetcher;
|
69
|
+
//# sourceMappingURL=stakeFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"stakeFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/oresupply/stakeFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAEvD,2CAAkD;AAElD,iDAAsD;AACtD,+CAAmE;AACnE,gFAA6E;AAC7E,uCAAqD;AACrD,kEAA+D;AAC/D,uCAAyC;AAEzC,MAAM,SAAS,GAAG,IAAI,6BAAa,CAAgB,QAAQ,EAAE;IAC3D,MAAM,EAAE,sBAAU;IAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;CAC5B,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IACrC,MAAM,aAAa,GAAG,MAAM,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACrD,IAAI,CAAC,aAAa;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAEjE,MAAM,aAAa,GAAG,MAAM,IAAA,sCAA6B,EACvD,UAAU,EACV,qBAAW,EACX,IAAA,sBAAY,EACV,KAAK,EACL,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CACnC,CACF,CAAC;IACF,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC;QAAE,OAAO,EAAE,CAAC;IAEjD,MAAM,eAAe,GAAG,IAAI,iCAAe,CAAC,0BAAS,C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ift-labs/sdk/node_modules/@solana/web3.js" />
|
2
|
+
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
3
|
+
import { PublicKey } from '@solana/web3.js';
|
4
|
+
import BigNumber from 'bignumber.js';
|
5
|
+
import { BeetStruct } from '@metaplex-foundation/beet';
|
6
|
+
export type ParsedBoost = {
|
7
|
+
pubkey: string;
|
8
|
+
accountDiscriminator: number[];
|
9
|
+
expiresAt: string;
|
10
|
+
mint: string;
|
11
|
+
weight: string;
|
12
|
+
lastRewardsFactor: string;
|
13
|
+
rewardsFactor: string;
|
14
|
+
totalDeposits: string;
|
15
|
+
totalStakers: string;
|
16
|
+
withdrawFee: string;
|
17
|
+
};
|
18
|
+
export type Boost = {
|
19
|
+
accountDiscriminator: number[];
|
20
|
+
expiresAt: BigNumber;
|
21
|
+
mint: PublicKey;
|
22
|
+
weight: BigNumber;
|
23
|
+
lastRewardsFactor: BigNumber;
|
24
|
+
rewardsFactor: BigNumber;
|
25
|
+
totalDeposits: BigNumber;
|
26
|
+
totalStakers: BigNumber;
|
27
|
+
withdrawFee: BigNumber;
|
28
|
+
};
|
29
|
+
export declare const boostStruct: BeetStruct<Boost, Partial<Boost>>;
|
30
|
+
export type Config = {
|
31
|
+
accountDiscriminator: number[];
|
32
|
+
admin: PublicKey;
|
33
|
+
boosts: PublicKey[];
|
34
|
+
len: number;
|
35
|
+
rewardsFactor: BigNumber;
|
36
|
+
takeRate: BigNumber;
|
37
|
+
totalWeight: BigNumber;
|
38
|
+
};
|
39
|
+
export declare const configStruct: BeetStruct<Config, Partial<Config>>;
|
40
|
+
export type Stake = {
|
41
|
+
accountDiscriminator: number[];
|
42
|
+
authority: PublicKey;
|
43
|
+
balance: BigNumber;
|
44
|
+
boost: PublicKey;
|
45
|
+
lastClaimAt: BigNumber;
|
46
|
+
lastDepositAt: BigNumber;
|
47
|
+
lastWithdrawAt: BigNumber;
|
48
|
+
lastRewardsFactor: BigNumber;
|
49
|
+
rewards: BigNumber;
|
50
|
+
buffer: number[];
|
51
|
+
};
|
52
|
+
export declare const stakeStruct: BeetStruct<Stake, Partial<Stake>>;
|
@@ -0,0 +1,42 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.stakeStruct = exports.configStruct = exports.boostStruct = void 0;
|
4
|
+
const beet_1 = require("@metaplex-foundation/beet");
|
5
|
+
const beet_solana_1 = require("@metaplex-foundation/beet-solana");
|
6
|
+
const solana_1 = require("../../utils/solana");
|
7
|
+
// Struct for Boost
|
8
|
+
exports.boostStruct = new beet_1.BeetStruct([
|
9
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
10
|
+
['expiresAt', solana_1.i64],
|
11
|
+
['lastRewardsFactor', solana_1.u128],
|
12
|
+
['mint', beet_solana_1.publicKey],
|
13
|
+
['weight', solana_1.u64],
|
14
|
+
['rewardsFactor', solana_1.u128],
|
15
|
+
['totalDeposits', solana_1.u64],
|
16
|
+
['totalStakers', solana_1.u64],
|
17
|
+
['withdrawFee', solana_1.u64],
|
18
|
+
], (args) => args);
|
19
|
+
// Struct for Config
|
20
|
+
exports.configStruct = new beet_1.BeetStruct([
|
21
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
22
|
+
['admin', beet_solana_1.publicKey],
|
23
|
+
['boosts', (0, beet_1.uniformFixedSizeArray)(beet_solana_1.publicKey, 256)], // Array of 256 PublicKeys
|
24
|
+
['len', beet_1.u8],
|
25
|
+
['rewardsFactor', solana_1.u128],
|
26
|
+
['takeRate', solana_1.u64],
|
27
|
+
['totalWeight', solana_1.u64],
|
28
|
+
], (args) => args);
|
29
|
+
// Struct for Stake
|
30
|
+
exports.stakeStruct = new beet_1.BeetStruct([
|
31
|
+
['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
|
32
|
+
['authority', beet_solana_1.publicKey],
|
33
|
+
['balance', solana_1.u64],
|
34
|
+
['boost', beet_solana_1.publicKey],
|
35
|
+
['lastClaimAt', solana_1.i64],
|
36
|
+
['lastDepositAt', solana_1.i64],
|
37
|
+
['lastWithdrawAt', solana_1.i64],
|
38
|
+
['lastRewardsFactor', solana_1.u128],
|
39
|
+
['rewards', solana_1.u64],
|
40
|
+
['buffer', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 1024)], // Array of 1024 u8 values
|
41
|
+
], (args) => args);
|
42
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/oresupply/structs.ts"],"names":[],"mappings":";;;AAEA,oDAImC;AACnC,kEAA6D;AAC7D,+CAAoD;AA4BpD,mBAAmB;AACN,QAAA,WAAW,GAAG,IAAI,iBAAU,CACvC;IACE,CAAC,sBAAsB,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC,WAAW,EAAE,YAAG,CAAC;IAClB,CAAC,mBAAmB,EAAE,aAAI,CAAC;IAC3B,CAAC,MAAM,EAAE,uBAAS,CAAC;IACnB,CAAC,QAAQ,EAAE,YAAG,CAAC;IACf,CAAC,eAAe,EAAE,aAAI,CAAC;IACvB,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,cAAc,EAAE,YAAG,CAAC;IACrB,CAAC,aAAa,EAAE,YAAG,CAAC;CACrB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAa,CACxB,CAAC;AAaF,oBAAoB;AACP,QAAA,YAAY,GAAG,IAAI,iBAAU,CACxC;IACE,CAAC,sBAAsB,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,QAAQ,EAAE,IAAA,4BAAqB,EAAC,uBAAS,EAAE,GAAG,CAAC,CAAC,EAAE,0BAA0B;IAC7E,CAAC,KAAK,EAAE,SAAE,CAAC;IACX,CAAC,eAAe,EAAE,aAAI,CAAC;IACvB,CAAC,UAAU,EAAE,YAAG,CAAC;IACjB,CAAC,aAAa,EAAE,YAAG,CAAC;CACrB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAc,CACzB,CAAC;AAgBF,mBAAmB;AACN,QAAA,WAAW,GAAG,IAAI,iBAAU,CACvC;IACE,CAAC,sBAAsB,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,SAAS,EAAE,YAAG,CAAC;IAChB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,aAAa,EAAE,YAAG,CAAC;IACpB,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,mBAAmB,EAAE,aAAI,CAAC;IAC3B,CAAC,SAAS,EAAE,YAAG,CAAC;IAChB,CAAC,QAAQ,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,IAAI,CAAC,CAAC,EAAE,0BAA0B;CACxE,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAa,CACxB,CAAC"}
|
@@ -18,7 +18,9 @@ const axios_1 = __importDefault(require("axios"));
|
|
18
18
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
19
19
|
const AirdropFetcher_1 = require("../../AirdropFetcher");
|
20
20
|
const constants_1 = require("./constants");
|
21
|
+
const clients_1 = require("../../utils/clients");
|
21
22
|
const executor = (owner) => __awaiter(void 0, void 0, void 0, function* () {
|
23
|
+
const epoch = yield (0, clients_1.getClientSolana)().getEpochInfo();
|
22
24
|
let res;
|
23
25
|
try {
|
24
26
|
res = yield axios_1.default.get(constants_1.airdropApi + owner);
|
@@ -48,19 +50,21 @@ const executor = (owner) => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
50
|
},
|
49
51
|
],
|
50
52
|
});
|
51
|
-
const
|
52
|
-
const
|
53
|
+
const claimedAmount = new bignumber_js_1.default(res.data.claimedAmount);
|
54
|
+
const vestedAmount = new bignumber_js_1.default(res.data.totalAmount).times((epoch.epoch - res.data.startEpoch) /
|
55
|
+
(res.data.endEpoch - res.data.startEpoch));
|
53
56
|
return (0, AirdropFetcher_1.getAirdropRaw)({
|
54
57
|
statics: constants_1.airdropStatics,
|
55
58
|
items: [
|
56
59
|
{
|
57
|
-
amount:
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
60
|
+
amount: claimedAmount.dividedBy(Math.pow(10, constants_1.layerDecimals)).toNumber(),
|
61
|
+
isClaimed: true,
|
62
|
+
label: 'LAYER',
|
63
|
+
address: constants_1.layerMint,
|
64
|
+
},
|
65
|
+
{
|
66
|
+
amount: vestedAmount.dividedBy(Math.pow(10, constants_1.layerDecimals)).toNumber(),
|
67
|
+
isClaimed: false,
|
64
68
|
label: 'LAYER',
|
65
69
|
address: constants_1.layerMint,
|
66
70
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/solayer/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,kDAA6C;AAC7C,gEAAqC;AACrC,yDAK8B;AAC9B,2CAMqB;
|
1
|
+
{"version":3,"file":"airdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/solayer/airdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,kDAA6C;AAC7C,gEAAqC;AACrC,yDAK8B;AAC9B,2CAMqB;AAErB,iDAAsD;AAEtD,MAAM,QAAQ,GAA2B,CAAO,KAAa,EAAE,EAAE;IAC/D,MAAM,KAAK,GAAG,MAAM,IAAA,yBAAe,GAAE,CAAC,YAAY,EAAE,CAAC;IACrD,IAAI,GAAmC,CAAC;IACxC,IAAI,CAAC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AS;aACnB;YACD;gBACE,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC,SAAA,EAAE,EAAI,yBAAa,CAAA,CAAC,CAAC,QAAQ,EAAE;gBAC9D,SAAS,EAAE,KAAK;gBAChB,KAAK,EAAE,OAAO;gBACd,OAAO,EAAE,qBAAS;aACnB;SACF;KACF,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEW,QAAA,cAAc,GAAmB;IAC5C,EAAE,EAAE,0BAAc,CAAC,EAAE;IACrB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AACW,QAAA,OAAO,GAAG,IAAA,wCAAuB,EAC5C,sBAAc,EACd,sBAAU,EACV,iBAAiB,EACjB,0BAAc,CAAC,QAAQ,CACxB,CAAC"}
|
@@ -54,30 +54,30 @@ function sushiV3PairToUniV2(pair) {
|
|
54
54
|
}
|
55
55
|
function getV3PairsAddresses(url, length = 300) {
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
57
|
-
const query = (0, graphql_request_1.gql) `
|
58
|
-
{
|
59
|
-
pools(
|
60
|
-
orderBy: totalValueLockedUSD
|
61
|
-
first: ${length}
|
62
|
-
orderDirection: desc
|
63
|
-
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
-
) {
|
65
|
-
id
|
66
|
-
token0Price
|
67
|
-
token1Price
|
68
|
-
liquidity
|
69
|
-
token0 {
|
70
|
-
id
|
71
|
-
totalSupply
|
72
|
-
decimals
|
73
|
-
}
|
74
|
-
token1 {
|
75
|
-
id
|
76
|
-
totalSupply
|
77
|
-
decimals
|
78
|
-
}
|
79
|
-
}
|
80
|
-
}
|
57
|
+
const query = (0, graphql_request_1.gql) `
|
58
|
+
{
|
59
|
+
pools(
|
60
|
+
orderBy: totalValueLockedUSD
|
61
|
+
first: ${length}
|
62
|
+
orderDirection: desc
|
63
|
+
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
+
) {
|
65
|
+
id
|
66
|
+
token0Price
|
67
|
+
token1Price
|
68
|
+
liquidity
|
69
|
+
token0 {
|
70
|
+
id
|
71
|
+
totalSupply
|
72
|
+
decimals
|
73
|
+
}
|
74
|
+
token1 {
|
75
|
+
id
|
76
|
+
totalSupply
|
77
|
+
decimals
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
81
|
`;
|
82
82
|
const res = yield (0, graphql_request_1.default)(url, query);
|
83
83
|
const pools = res.pools;
|
@@ -16,6 +16,7 @@ const clients_1 = require("../../utils/clients");
|
|
16
16
|
const getSwitchboardOnDemandPrice_1 = require("./helpers/getSwitchboardOnDemandPrice");
|
17
17
|
const getDecimalsForToken_1 = require("../../utils/misc/getDecimalsForToken");
|
18
18
|
const solana_1 = require("../../utils/solana");
|
19
|
+
const constants_2 = require("../huma/constants");
|
19
20
|
const feedsToFetch = [
|
20
21
|
{
|
21
22
|
feedsAddresses: [
|
@@ -36,6 +37,11 @@ const feedsToFetch = [
|
|
36
37
|
mintAddress: solana_1.crtSolanaMint,
|
37
38
|
networkId: portfolio_core_1.NetworkId.solana,
|
38
39
|
},
|
40
|
+
{
|
41
|
+
feedsAddresses: ['EcSxuQKGVQUTQJNsayW5X6CHcnZjbfYNkCSHbN7ndb22'],
|
42
|
+
mintAddress: constants_2.pstMint,
|
43
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
44
|
+
},
|
39
45
|
];
|
40
46
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
41
47
|
const connection = (0, clients_1.getClientSolana)();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"onDemandPricingJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/switchboard/onDemandPricingJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAKoC;AACpC,6CAA4C;AAG5C,2CAAyC;AACzC,iDAAsD;AACtD,uFAAqF;AACrF,8EAA2E;AAE3E,+CAAmE;
|
1
|
+
{"version":3,"file":"onDemandPricingJob.js","sourceRoot":"","sources":["../../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EAAE,CAAC,EAAE,EAAE;YAClD,MAAM,KAAK,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAC3B,IAAI,CAAC,KAAK,IAAI,CAAC,QAAQ;gBAAE,OAAO;YAEhC,MAAM,MAAM,GAAqB;gBAC/B,OAAO,EAAE,SAAS,CAAC,WAAW;gBAC9B,QAAQ;gBACR,EAAE,EAAE,GAAG,sBAAU,SAAS,WAAW,CAAC,QAAQ,EAAE,EAAE;gBAClD,SAAS,EAAE,SAAS,CAAC,SAAS;gBAC9B,UAAU,EAAE,uCAAsB;gBAClC,MAAM,EAAE,GAAG;gBACX,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;gBACrB,KAAK;aACN,CAAC;YACF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,mBAAmB;IACpC,QAAQ;IACR,MAAM,EAAE,CAAC,UAAU,CAAC;CACrB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -21,10 +21,14 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
21
21
|
const user = yield (0, helpers_1.getMemoizedUser)(owner);
|
22
22
|
if (!user)
|
23
23
|
return [];
|
24
|
+
const apiClient = axios_1.default.create({
|
25
|
+
baseURL: 'https://moneyback.texture.finance',
|
26
|
+
timeout: 500,
|
27
|
+
});
|
24
28
|
const [loansAsBorrower, loansAsLender, offersAsLender] = yield Promise.all([
|
25
|
-
|
26
|
-
|
27
|
-
|
29
|
+
apiClient.get(`/loans?borrower=${user}`),
|
30
|
+
apiClient.get(`/loans?lender=${user}`),
|
31
|
+
apiClient.get(`/my_offers?lender=${user}`),
|
28
32
|
]);
|
29
33
|
const pairs = yield constants_1.pairsMemo.getItem(cache);
|
30
34
|
if (!pairs)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"loansFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/texture/loansFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,kDAA0B;AAE1B,2CAAoD;AAEpD,uCAA4C;AAE5C,gFAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,IAAI,GAAG,MAAM,IAAA,yBAAe,EAAC,KAAK,CAAC,CAAC;IAC1C,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAErB,MAAM,CAAC,eAAe,EAAE,aAAa,EAAE,cAAc,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACzE,
|
1
|
+
{"version":3,"file":"loansFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/texture/loansFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,kDAA0B;AAE1B,2CAAoD;AAEpD,uCAA4C;AAE5C,gFAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,IAAI,GAAG,MAAM,IAAA,yBAAe,EAAC,KAAK,CAAC,CAAC;IAC1C,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAErB,MAAM,SAAS,GAAG,eAAK,CAAC,MAAM,CAAC;QAC7B,OAAO,EAAE,mCAAmC;QAC5C,OAAO,EAAE,GAAG;KACb,CAAC,CAAC;IAEH,MAAM,CAAC,eAAe,EAAE,aAAa,EAAE,cAAc,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACzE,SAAS,CAAC,GAAG,CAAS,mBAAmB,IAAI,EAAE,CAAC;QAChD,SAAS,CAAC,GAAG,CAAS,iBAAiB,IAAI,EAAE,CAAC;QAC9C,SAAS,CA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