@sonarwatch/portfolio-plugins 0.12.29 → 0.12.31
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1819 -1806
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/index.js +8 -0
- package/src/index.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/banx/calculateLoanRepayValue.d.ts +4 -0
- package/src/plugins/banx/calculateLoanRepayValue.js +37 -0
- package/src/plugins/banx/calculateLoanRepayValue.js.map +1 -0
- package/src/plugins/banx/collectionsJob.d.ts +3 -0
- package/src/plugins/banx/collectionsJob.js +40 -0
- package/src/plugins/banx/collectionsJob.js.map +1 -0
- package/src/plugins/banx/constants.d.ts +8 -0
- package/src/plugins/banx/constants.js +13 -1
- package/src/plugins/banx/constants.js.map +1 -1
- package/src/plugins/banx/filters.d.ts +2 -0
- package/src/plugins/banx/filters.js +26 -1
- package/src/plugins/banx/filters.js.map +1 -1
- package/src/plugins/banx/idl.d.ts +115 -0
- package/src/plugins/banx/idl.js +2256 -0
- package/src/plugins/banx/idl.js.map +1 -0
- package/src/plugins/banx/index.js +9 -2
- package/src/plugins/banx/index.js.map +1 -1
- package/src/plugins/banx/loansFetcher.d.ts +3 -0
- package/src/plugins/banx/loansFetcher.js +158 -0
- package/src/plugins/banx/loansFetcher.js.map +1 -0
- package/src/plugins/banx/offersFetcher.d.ts +3 -0
- package/src/plugins/banx/offersFetcher.js +99 -0
- package/src/plugins/banx/offersFetcher.js.map +1 -0
- package/src/plugins/banx/types.d.ts +200 -0
- package/src/plugins/citrus/collectionsJob.d.ts +3 -0
- package/src/plugins/citrus/collectionsJob.js +40 -0
- package/src/plugins/citrus/collectionsJob.js.map +1 -0
- package/src/plugins/citrus/constants.d.ts +12 -0
- package/src/plugins/citrus/constants.js +26 -0
- package/src/plugins/citrus/constants.js.map +1 -0
- package/src/plugins/citrus/filters.d.ts +2 -0
- package/src/plugins/citrus/filters.js +32 -0
- package/src/plugins/citrus/filters.js.map +1 -0
- package/src/plugins/citrus/idl.d.ts +73 -0
- package/src/plugins/citrus/idl.js +292 -0
- package/src/plugins/citrus/idl.js.map +1 -0
- package/src/plugins/citrus/index.d.ts +6 -0
- package/src/plugins/citrus/index.js +13 -0
- package/src/plugins/citrus/index.js.map +1 -0
- package/src/plugins/citrus/loansFetcher.d.ts +3 -0
- package/src/plugins/citrus/loansFetcher.js +150 -0
- package/src/plugins/citrus/loansFetcher.js.map +1 -0
- package/src/plugins/citrus/types.d.ts +54 -0
- package/src/plugins/citrus/types.js +3 -0
- package/src/plugins/citrus/types.js.map +1 -0
- package/src/plugins/raydium/clmmJob.js +4 -2
- package/src/plugins/raydium/clmmJob.js.map +1 -1
- package/src/plugins/sharky/collectionsJob.d.ts +3 -0
- package/src/plugins/sharky/collectionsJob.js +75 -0
- package/src/plugins/sharky/collectionsJob.js.map +1 -0
- package/src/plugins/sharky/constants.d.ts +12 -0
- package/src/plugins/sharky/constants.js +26 -0
- package/src/plugins/sharky/constants.js.map +1 -0
- package/src/plugins/sharky/filters.d.ts +6 -0
- package/src/plugins/sharky/filters.js +43 -0
- package/src/plugins/sharky/filters.js.map +1 -0
- package/src/plugins/sharky/idl.d.ts +135 -0
- package/src/plugins/sharky/idl.js +388 -0
- package/src/plugins/sharky/idl.js.map +1 -0
- package/src/plugins/sharky/index.d.ts +6 -0
- package/src/plugins/sharky/index.js +13 -0
- package/src/plugins/sharky/index.js.map +1 -0
- package/src/plugins/sharky/loansFetcher.d.ts +3 -0
- package/src/plugins/sharky/loansFetcher.js +141 -0
- package/src/plugins/sharky/loansFetcher.js.map +1 -0
- package/src/plugins/sharky/types.d.ts +66 -0
- package/src/plugins/sharky/types.js +11 -0
- package/src/plugins/sharky/types.js.map +1 -0
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
- package/src/utils/solana/das/getAssetBatchDas.d.ts +4 -0
- package/src/utils/solana/das/getAssetBatchDas.js +68 -0
- package/src/utils/solana/das/getAssetBatchDas.js.map +1 -0
- package/src/utils/solana/das/heliusAssetToAssetCollectible.d.ts +7 -1
- package/src/utils/solana/das/heliusAssetToAssetCollectible.js +13 -9
- package/src/utils/solana/das/heliusAssetToAssetCollectible.js.map +1 -1
- package/src/utils/solana/das/types.d.ts +5 -0
- package/src/utils/solana/getAutoParsedMultipleAccountsInfo.d.ts +4 -0
- package/src/utils/solana/getAutoParsedMultipleAccountsInfo.js +33 -0
- package/src/utils/solana/getAutoParsedMultipleAccountsInfo.js.map +1 -0
- package/src/utils/solana/getAutoParsedProgramAccounts.d.ts +4 -0
- package/src/utils/solana/getAutoParsedProgramAccounts.js +37 -0
- package/src/utils/solana/getAutoParsedProgramAccounts.js.map +1 -0
- package/src/utils/solana/getMultipleAccountsInfoSafe.d.ts +2 -2
- package/src/utils/solana/getMultipleAccountsInfoSafe.js +3 -3
- package/src/utils/solana/getMultipleAccountsInfoSafe.js.map +1 -1
- package/src/utils/solana/getParsedMultipleAccountsInfo.d.ts +2 -2
- package/src/utils/solana/getParsedMultipleAccountsInfo.js +2 -2
- package/src/utils/solana/getParsedMultipleAccountsInfo.js.map +1 -1
- package/src/utils/solana/index.d.ts +2 -0
- package/src/utils/solana/index.js +2 -0
- package/src/utils/solana/index.js.map +1 -1
@@ -0,0 +1,54 @@
|
|
1
|
+
export type OfferType = {
|
2
|
+
global?: string;
|
3
|
+
mortgage?: string;
|
4
|
+
borrow?: string;
|
5
|
+
};
|
6
|
+
export type Status = {
|
7
|
+
waitingForBorrower?: string;
|
8
|
+
waitingForLender?: string;
|
9
|
+
repaid?: string;
|
10
|
+
defaulted?: string;
|
11
|
+
active?: string;
|
12
|
+
onSale?: string;
|
13
|
+
};
|
14
|
+
export type Loan = {
|
15
|
+
lender: string;
|
16
|
+
borrower: string;
|
17
|
+
mint: string;
|
18
|
+
collectionConfig: string;
|
19
|
+
status: Status;
|
20
|
+
loanTerms: LoanTerms;
|
21
|
+
creationTime: string;
|
22
|
+
startTime: string;
|
23
|
+
endTime: string;
|
24
|
+
fox: boolean;
|
25
|
+
mortgage: boolean;
|
26
|
+
private: boolean;
|
27
|
+
offerType: OfferType;
|
28
|
+
listingPrice: string;
|
29
|
+
ltvTerms: LtvTerms | null;
|
30
|
+
pool: boolean;
|
31
|
+
listedLoan: ListedLoan;
|
32
|
+
};
|
33
|
+
export type ListedLoan = {
|
34
|
+
listed: boolean;
|
35
|
+
price: string;
|
36
|
+
sold: boolean;
|
37
|
+
fox: boolean;
|
38
|
+
listingTime: string;
|
39
|
+
};
|
40
|
+
export type LoanTerms = {
|
41
|
+
apyBps: string;
|
42
|
+
duration: string;
|
43
|
+
principal: string;
|
44
|
+
};
|
45
|
+
export type LtvTerms = {
|
46
|
+
ltvBps: string;
|
47
|
+
maxOffer: string;
|
48
|
+
};
|
49
|
+
export type Collection = {
|
50
|
+
id: string;
|
51
|
+
name: string;
|
52
|
+
floor: number;
|
53
|
+
tProjectId: string;
|
54
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/citrus/types.ts"],"names":[],"mappings":""}
|
@@ -22,6 +22,8 @@ const clmms_1 = require("./structs/clmms");
|
|
22
22
|
const filters_1 = require("./filters");
|
23
23
|
const getLpUnderlyingTokenSource_1 = require("../../utils/misc/getLpUnderlyingTokenSource");
|
24
24
|
const constants_2 = require("../../utils/misc/constants");
|
25
|
+
const getSourceWeight_1 = __importDefault(require("../../utils/misc/getSourceWeight"));
|
26
|
+
const constants_3 = require("../tokens/constants");
|
25
27
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
26
28
|
const client = (0, clients_1.getClientSolana)();
|
27
29
|
const allPoolsPubkeys = yield client.getProgramAccounts(constants_1.raydiumProgram, {
|
@@ -121,10 +123,10 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
121
123
|
decimals: unkDecimal,
|
122
124
|
id: constants_1.platformId,
|
123
125
|
networkId: portfolio_core_1.NetworkId.solana,
|
124
|
-
platformId:
|
126
|
+
platformId: constants_3.walletTokensPlatform.id,
|
125
127
|
price: unknownPrice,
|
126
128
|
timestamp: Date.now(),
|
127
|
-
weight:
|
129
|
+
weight: (0, getSourceWeight_1.default)(refLiquidity.times(2)),
|
128
130
|
});
|
129
131
|
promises.push(cache.setItem(poolState.pubkey.toString(), poolState, {
|
130
132
|
prefix: constants_1.poolStatesPrefix,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"clmmJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/clmmJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AAEzE,4DAAiC;AACjC,2CAA2E;AAC3E,+CAK4B;AAC5B,iDAAsD;AAGtD,8EAA2E;AAC3E,2CAA6D;AAC7D,uCAAiD;AACjD,4FAAmF;AACnF,0DAAiE;
|
1
|
+
{"version":3,"file":"clmmJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/raydium/clmmJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AAEzE,4DAAiC;AACjC,2CAA2E;AAC3E,+CAK4B;AAC5B,iDAAsD;AAGtD,8EAA2E;AAC3E,2CAA6D;AAC7D,uCAAiD;AACjD,4FAAmF;AACnF,0DAAiE;AACjE,uFAA+D;AAC/D,mDAA2D;AAE3D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,eAAe,GAAG,MAAM,MAAM,CAAC,kBAAkB,CAAC,0BAAc,EAAE;QACtE,OAAO,EAAE,8BAAoB;QAC7B,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;KACpC,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,iDAAoB,C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Aa,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,QAAQ,EAAE,CAAC;YAEjE,iBAAiB,CAAC,IAAI,CAAC;gBACrB,OAAO,EAAE,OAAO;gBAChB,QAAQ,EAAE,UAAU;gBACpB,EAAE,EAAE,sBAAU;gBACd,SAAS,EAAE,0BAAS,CAAC,MAAM;gBAC3B,UAAU,EAAE,gCAAoB,CAAC,EAAE;gBACnC,KAAK,EAAE,YAAY;gBACnB,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;gBACrB,MAAM,EAAE,IAAA,yBAAe,EAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;aAC/C,CAAC,CAAC;YAEH,QAAQ,CAAC,IAAI,CACX,KAAK,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE;gBACpD,MAAM,EAAE,4BAAgB;gBACxB,SAAS,EAAE,0BAAS,CAAC,MAAM;aAC5B,CAAC,CACH,CAAC;QACJ,CAAC;QACD,MAAM,OAAO,CAAC,GAAG,CAAC;YAChB,GAAG,QAAQ;YACX,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;SAC9C,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,OAAO;IACxB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,75 @@
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
+
};
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
|
+
const axios_1 = __importDefault(require("axios"));
|
17
|
+
const web3_js_1 = require("@solana/web3.js");
|
18
|
+
const constants_1 = require("./constants");
|
19
|
+
const types_1 = require("./types");
|
20
|
+
const solana_1 = require("../../utils/solana");
|
21
|
+
const clients_1 = require("../../utils/clients");
|
22
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
|
+
const connection = (0, clients_1.getClientSolana)();
|
24
|
+
const [floorPrices, orderBooks] = yield Promise.all([
|
25
|
+
axios_1.default
|
26
|
+
.get(`https://sharky.fi/api/floor-prices`, {
|
27
|
+
timeout: 5000,
|
28
|
+
})
|
29
|
+
.catch((err) => {
|
30
|
+
throw Error(`SHARKY_API ERR: ${err}`);
|
31
|
+
}),
|
32
|
+
(0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.sharkyIdlItem, [
|
33
|
+
{
|
34
|
+
dataSize: constants_1.orderBookDataSize,
|
35
|
+
},
|
36
|
+
]),
|
37
|
+
]);
|
38
|
+
if (!floorPrices.data || !orderBooks)
|
39
|
+
return;
|
40
|
+
const nftLists = yield (0, solana_1.getParsedMultipleAccountsInfo)(connection, types_1.nftListStruct, orderBooks.map((ob) => new web3_js_1.PublicKey(ob.orderBookType.nftList.listAccount)), {
|
41
|
+
dataSlice: { offset: 0, length: 231 },
|
42
|
+
});
|
43
|
+
const collectionNamesAsMap = new Map();
|
44
|
+
nftLists.forEach((nftList) => {
|
45
|
+
if (!nftList || !nftList.collectionName)
|
46
|
+
return;
|
47
|
+
collectionNamesAsMap.set(nftList.pubkey.toString(), (0, solana_1.u8ArrayToString)(nftList.collectionName));
|
48
|
+
});
|
49
|
+
const collections = [];
|
50
|
+
orderBooks.forEach((orderBook) => {
|
51
|
+
var _a, _b, _c;
|
52
|
+
if (!orderBook || !orderBook.orderBookType.nftList.listAccount)
|
53
|
+
return;
|
54
|
+
const collectionName = collectionNamesAsMap.get(orderBook.orderBookType.nftList.listAccount);
|
55
|
+
if (!collectionName)
|
56
|
+
return;
|
57
|
+
collections.push({
|
58
|
+
orderBook: orderBook.pubkey.toString(),
|
59
|
+
name: collectionName,
|
60
|
+
floor: (_a = floorPrices.data.floorPrices[collectionName]) === null || _a === void 0 ? void 0 : _a.floorPriceSol,
|
61
|
+
tensor_id: (_c = (_b = floorPrices.data.floorPrices[collectionName]) === null || _b === void 0 ? void 0 : _b.tensor) === null || _c === void 0 ? void 0 : _c.slug,
|
62
|
+
});
|
63
|
+
});
|
64
|
+
yield cache.setItem(constants_1.collectionsCacheKey, collections, {
|
65
|
+
prefix: constants_1.cachePrefix,
|
66
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
67
|
+
});
|
68
|
+
});
|
69
|
+
const job = {
|
70
|
+
id: `${constants_1.platformId}-collections`,
|
71
|
+
executor,
|
72
|
+
label: 'normal',
|
73
|
+
};
|
74
|
+
exports.default = job;
|
75
|
+
//# sourceMappingURL=collectionsJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"collectionsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/collectionsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AACvD,kDAA0B;AAC1B,6CAA4C;AAG5C,2CAMqB;AACrB,mCAA+D;AAC/D,+CAI4B;AAC5B,iDAAsD;AAEtD,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,M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,OAAO,CAAC,WAAW;YAAE,OAAO;QACvE,MAAM,cAAc,GAAG,oBAAoB,CAAC,GAAG,CAC7C,SAAS,CAAC,aAAa,CAAC,OAAO,CAAC,WAAW,CAC5C,CAAC;QACF,IAAI,CAAC,cAAc;YAAE,OAAO;QAC5B,WAAW,CAAC,IAAI,CAAC;YACf,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE;YACtC,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,MAAA,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,0CAAE,aAAa;YAClE,SAAS,EAAE,MAAA,MAAA,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,0CAAE,MAAM,0CAAE,IAAI;SACtE,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,KAAK,CAAC,OAAO,CAAC,+BAAmB,EAAE,WAAW,EAAE;QACpD,MAAM,EAAE,uBAAW;QACnB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { Platform } from '@sonarwatch/portfolio-core';
|
2
|
+
import { PublicKey } from '@solana/web3.js';
|
3
|
+
import { IdlItem } from '@solanafm/explorer-kit-idls';
|
4
|
+
export declare const platformId = "sharky";
|
5
|
+
export declare const platform: Platform;
|
6
|
+
export declare const collectionsCacheKey = "sharky-collections";
|
7
|
+
export declare const cachePrefix = "sharky";
|
8
|
+
export declare const sharkyProgram: PublicKey;
|
9
|
+
export declare const loanDataSize = 338;
|
10
|
+
export declare const orderBookDataSize = 10240;
|
11
|
+
export declare const collectionRefreshInterval = 3600000;
|
12
|
+
export declare const sharkyIdlItem: IdlItem;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.sharkyIdlItem = exports.collectionRefreshInterval = exports.orderBookDataSize = exports.loanDataSize = exports.sharkyProgram = exports.cachePrefix = exports.collectionsCacheKey = exports.platform = exports.platformId = void 0;
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
5
|
+
const idl_1 = require("./idl");
|
6
|
+
exports.platformId = 'sharky';
|
7
|
+
exports.platform = {
|
8
|
+
id: exports.platformId,
|
9
|
+
name: 'Sharky',
|
10
|
+
image: 'https://sonar.watch/img/platforms/foo.webp',
|
11
|
+
website: 'https://sharki.fi/',
|
12
|
+
twitter: 'https://twitter.com/SharkyFi',
|
13
|
+
defiLlamaId: 'sharky', // from https://defillama.com/docs/api
|
14
|
+
};
|
15
|
+
exports.collectionsCacheKey = `${exports.platformId}-collections`;
|
16
|
+
exports.cachePrefix = `${exports.platformId}`;
|
17
|
+
exports.sharkyProgram = new web3_js_1.PublicKey('SHARKobtfF1bHhxD2eqftjHBdVSCbKo9JtgK71FhELP');
|
18
|
+
exports.loanDataSize = 338;
|
19
|
+
exports.orderBookDataSize = 10240;
|
20
|
+
exports.collectionRefreshInterval = 3600000;
|
21
|
+
exports.sharkyIdlItem = {
|
22
|
+
programId: exports.sharkyProgram.toString(),
|
23
|
+
idl: idl_1.SharkyIDL,
|
24
|
+
idlType: 'anchor',
|
25
|
+
};
|
26
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/constants.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAE5C,+BAAkC;AAErB,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,4CAA4C;IACnD,OAAO,EAAE,oBAAoB;IAC7B,OAAO,EAAE,8BAA8B;IACvC,WAAW,EAAE,QAAQ,EAAE,sCAAsC;CAC9D,CAAC;AACW,QAAA,mBAAmB,GAAG,GAAG,kBAAU,cAAc,CAAC;AAClD,QAAA,WAAW,GAAG,GAAG,kBAAU,EAAE,CAAC;AAE9B,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,YAAY,GAAG,GAAG,CAAC;AACnB,QAAA,iBAAiB,GAAG,KAAK,CAAC;AAC1B,QAAA,yBAAyB,GAAG,OAAO,CAAC;AAEpC,QAAA,aAAa,GAAG;IAC3B,SAAS,EAAE,qBAAa,CAAC,QAAQ,EAAE;IACnC,GAAG,EAAE,eAAS;IACd,OAAO,EAAE,QAAQ;CACP,CAAC"}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getLoanFilters = void 0;
|
4
|
+
const constants_1 = require("./constants");
|
5
|
+
function getLoanFilters(owner) {
|
6
|
+
return [
|
7
|
+
[
|
8
|
+
{
|
9
|
+
dataSize: constants_1.loanDataSize,
|
10
|
+
},
|
11
|
+
{
|
12
|
+
memcmp: {
|
13
|
+
bytes: owner,
|
14
|
+
offset: 115,
|
15
|
+
},
|
16
|
+
},
|
17
|
+
],
|
18
|
+
[
|
19
|
+
{
|
20
|
+
dataSize: constants_1.loanDataSize,
|
21
|
+
},
|
22
|
+
{
|
23
|
+
memcmp: {
|
24
|
+
bytes: owner,
|
25
|
+
offset: 147,
|
26
|
+
},
|
27
|
+
},
|
28
|
+
],
|
29
|
+
[
|
30
|
+
{
|
31
|
+
dataSize: constants_1.loanDataSize,
|
32
|
+
},
|
33
|
+
{
|
34
|
+
memcmp: {
|
35
|
+
bytes: owner,
|
36
|
+
offset: 83,
|
37
|
+
},
|
38
|
+
},
|
39
|
+
],
|
40
|
+
];
|
41
|
+
}
|
42
|
+
exports.getLoanFilters = getLoanFilters;
|
43
|
+
//# sourceMappingURL=filters.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/filters.ts"],"names":[],"mappings":";;;AACA,2CAA2C;AAE3C,SAAgB,cAAc,CAC5B,KAAa;IAMb,OAAO;QACL;YACE;gBACE,QAAQ,EAAE,wBAAY;aACvB;YACD;gBACE,MAAM,EAAE;oBACN,KAAK,EAAE,KAAK;oBACZ,MAAM,EAAE,GAAG;iBACZ;aACF;SACF;QACD;YACE;gBACE,QAAQ,EAAE,wBAAY;aACvB;YACD;gBACE,MAAM,EAAE;oBACN,KAAK,EAAE,KAAK;oBACZ,MAAM,EAAE,GAAG;iBACZ;aACF;SACF;QACD;YACE;gBACE,QAAQ,EAAE,wBAAY;aACvB;YACD;gBACE,MAAM,EAAE;oBACN,KAAK,EAAE,KAAK;oBACZ,MAAM,EAAE,EAAE;iBACX;aACF;SACF;KACF,CAAC;AACJ,CAAC;AA1CD,wCA0CC"}
|
@@ -0,0 +1,135 @@
|
|
1
|
+
export declare const SharkyIDL: {
|
2
|
+
version: string;
|
3
|
+
name: string;
|
4
|
+
instructions: never[];
|
5
|
+
accounts: ({
|
6
|
+
name: string;
|
7
|
+
type: {
|
8
|
+
kind: string;
|
9
|
+
fields: ({
|
10
|
+
name: string;
|
11
|
+
type: string;
|
12
|
+
} | {
|
13
|
+
name: string;
|
14
|
+
type: {
|
15
|
+
defined: string;
|
16
|
+
};
|
17
|
+
})[];
|
18
|
+
};
|
19
|
+
} | {
|
20
|
+
name: string;
|
21
|
+
type: {
|
22
|
+
kind: string;
|
23
|
+
fields: ({
|
24
|
+
name: string;
|
25
|
+
type: string;
|
26
|
+
docs?: undefined;
|
27
|
+
} | {
|
28
|
+
name: string;
|
29
|
+
docs: string[];
|
30
|
+
type: string;
|
31
|
+
} | {
|
32
|
+
name: string;
|
33
|
+
docs: string[];
|
34
|
+
type: {
|
35
|
+
defined: string;
|
36
|
+
};
|
37
|
+
})[];
|
38
|
+
};
|
39
|
+
})[];
|
40
|
+
types: ({
|
41
|
+
name: string;
|
42
|
+
type: {
|
43
|
+
kind: string;
|
44
|
+
fields: ({
|
45
|
+
name: string;
|
46
|
+
type: {
|
47
|
+
array: (string | number)[];
|
48
|
+
};
|
49
|
+
} | {
|
50
|
+
name: string;
|
51
|
+
type: string;
|
52
|
+
})[];
|
53
|
+
variants?: undefined;
|
54
|
+
};
|
55
|
+
docs?: undefined;
|
56
|
+
} | {
|
57
|
+
name: string;
|
58
|
+
type: {
|
59
|
+
kind: string;
|
60
|
+
fields: ({
|
61
|
+
name: string;
|
62
|
+
type: string;
|
63
|
+
docs?: undefined;
|
64
|
+
} | {
|
65
|
+
name: string;
|
66
|
+
docs: string[];
|
67
|
+
type: {
|
68
|
+
defined: string;
|
69
|
+
};
|
70
|
+
} | {
|
71
|
+
name: string;
|
72
|
+
type: {
|
73
|
+
defined: string;
|
74
|
+
};
|
75
|
+
docs?: undefined;
|
76
|
+
})[];
|
77
|
+
variants?: undefined;
|
78
|
+
};
|
79
|
+
docs?: undefined;
|
80
|
+
} | {
|
81
|
+
name: string;
|
82
|
+
docs: string[];
|
83
|
+
type: {
|
84
|
+
kind: string;
|
85
|
+
variants: {
|
86
|
+
name: string;
|
87
|
+
fields: {
|
88
|
+
name: string;
|
89
|
+
docs: string[];
|
90
|
+
type: string;
|
91
|
+
}[];
|
92
|
+
}[];
|
93
|
+
fields?: undefined;
|
94
|
+
};
|
95
|
+
} | {
|
96
|
+
name: string;
|
97
|
+
type: {
|
98
|
+
kind: string;
|
99
|
+
variants: ({
|
100
|
+
name: string;
|
101
|
+
fields: {
|
102
|
+
name: string;
|
103
|
+
type: {
|
104
|
+
defined: string;
|
105
|
+
};
|
106
|
+
}[];
|
107
|
+
} | {
|
108
|
+
name: string;
|
109
|
+
fields?: undefined;
|
110
|
+
})[];
|
111
|
+
fields?: undefined;
|
112
|
+
};
|
113
|
+
docs?: undefined;
|
114
|
+
} | {
|
115
|
+
name: string;
|
116
|
+
type: {
|
117
|
+
kind: string;
|
118
|
+
variants: {
|
119
|
+
name: string;
|
120
|
+
fields: ({
|
121
|
+
name: string;
|
122
|
+
docs: string[];
|
123
|
+
type: string;
|
124
|
+
} | {
|
125
|
+
name: string;
|
126
|
+
type: string;
|
127
|
+
docs?: undefined;
|
128
|
+
})[];
|
129
|
+
}[];
|
130
|
+
fields?: undefined;
|
131
|
+
};
|
132
|
+
docs?: undefined;
|
133
|
+
})[];
|
134
|
+
errors: never[];
|
135
|
+
};
|