@sonarwatch/portfolio-plugins 0.12.53 → 0.12.55
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/index.js +8 -0
- package/src/index.js.map +1 -1
- package/src/plugins/allbridge/positionsFetcher.js +1 -1
- package/src/plugins/allbridge/positionsFetcher.js.map +1 -1
- package/src/plugins/echelon/constants.d.ts +10 -0
- package/src/plugins/echelon/constants.js +20 -0
- package/src/plugins/echelon/constants.js.map +1 -0
- package/src/plugins/echelon/depositsFetcher.d.ts +3 -0
- package/src/plugins/echelon/depositsFetcher.js +178 -0
- package/src/plugins/echelon/depositsFetcher.js.map +1 -0
- package/src/plugins/echelon/helpers.d.ts +1 -0
- package/src/plugins/echelon/helpers.js +39 -0
- package/src/plugins/echelon/helpers.js.map +1 -0
- package/src/plugins/echelon/index.d.ts +6 -0
- package/src/plugins/echelon/index.js +13 -0
- package/src/plugins/echelon/index.js.map +1 -0
- package/src/plugins/echelon/marketsJob.d.ts +3 -0
- package/src/plugins/echelon/marketsJob.js +80 -0
- package/src/plugins/echelon/marketsJob.js.map +1 -0
- package/src/plugins/echelon/types.d.ts +78 -0
- package/src/plugins/echelon/types.js +3 -0
- package/src/plugins/echelon/types.js.map +1 -0
- package/src/plugins/famousfoxfederation/constants.d.ts +13 -0
- package/src/plugins/famousfoxfederation/constants.js +32 -0
- package/src/plugins/famousfoxfederation/constants.js.map +1 -0
- package/src/plugins/famousfoxfederation/helpers.d.ts +2 -0
- package/src/plugins/famousfoxfederation/helpers.js +11 -0
- package/src/plugins/famousfoxfederation/helpers.js.map +1 -0
- package/src/plugins/famousfoxfederation/index.d.ts +6 -0
- package/src/plugins/famousfoxfederation/index.js +14 -0
- package/src/plugins/famousfoxfederation/index.js.map +1 -0
- package/src/plugins/famousfoxfederation/stakingFetcher.d.ts +3 -0
- package/src/plugins/famousfoxfederation/stakingFetcher.js +70 -0
- package/src/plugins/famousfoxfederation/stakingFetcher.js.map +1 -0
- package/src/plugins/famousfoxfederation/stakingIdl.d.ts +31 -0
- package/src/plugins/famousfoxfederation/stakingIdl.js +226 -0
- package/src/plugins/famousfoxfederation/stakingIdl.js.map +1 -0
- package/src/plugins/famousfoxfederation/stakingJob.d.ts +3 -0
- package/src/plugins/famousfoxfederation/stakingJob.js +30 -0
- package/src/plugins/famousfoxfederation/stakingJob.js.map +1 -0
- package/src/plugins/famousfoxfederation/tokenMarketFetcher.d.ts +3 -0
- package/src/plugins/famousfoxfederation/tokenMarketFetcher.js +59 -0
- package/src/plugins/famousfoxfederation/tokenMarketFetcher.js.map +1 -0
- package/src/plugins/famousfoxfederation/tokenMarketIdl.d.ts +45 -0
- package/src/plugins/famousfoxfederation/tokenMarketIdl.js +792 -0
- package/src/plugins/famousfoxfederation/tokenMarketIdl.js.map +1 -0
- package/src/plugins/famousfoxfederation/types.d.ts +25 -0
- package/src/plugins/famousfoxfederation/types.js +3 -0
- package/src/plugins/famousfoxfederation/types.js.map +1 -0
- package/src/plugins/nxfinance/constants.d.ts +1 -0
- package/src/plugins/nxfinance/constants.js +2 -1
- package/src/plugins/nxfinance/constants.js.map +1 -1
- package/src/plugins/nxfinance/helpers.d.ts +4 -0
- package/src/plugins/nxfinance/helpers.js +52 -0
- package/src/plugins/nxfinance/helpers.js.map +1 -0
- package/src/plugins/nxfinance/positionsFetcher.js +57 -12
- package/src/plugins/nxfinance/positionsFetcher.js.map +1 -1
- package/src/plugins/nxfinance/types.d.ts +17 -0
- package/src/utils/solana/das/heliusAssetToAssetCollectible.js +1 -1
- package/src/utils/solana/das/heliusAssetToAssetCollectible.js.map +1 -1
- package/src/utils/solana/das/heliusAssetToAssetToken.d.ts +6 -0
- package/src/utils/solana/das/heliusAssetToAssetToken.js +27 -0
- package/src/utils/solana/das/heliusAssetToAssetToken.js.map +1 -0
- package/src/utils/solana/mintsToAssets.d.ts +3 -0
- package/src/utils/solana/mintsToAssets.js +58 -0
- package/src/utils/solana/mintsToAssets.js.map +1 -0
- package/src/plugins/nxfinance/structs.d.ts +0 -19
- package/src/plugins/nxfinance/structs.js +0 -22
- package/src/plugins/nxfinance/structs.js.map +0 -1
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.stakingConfigCacheKey = exports.cachePrefix = exports.stakingIdlItem = exports.foxyMint = exports.stakingConfigAccount = exports.foxProgram = exports.tokenMarketIdlItem = exports.tokenMarketProgram = exports.platform = exports.platformId = void 0;
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
5
|
+
const stakingIdl_1 = require("./stakingIdl");
|
6
|
+
const tokenMarketIdl_1 = require("./tokenMarketIdl");
|
7
|
+
exports.platformId = 'famousfoxfederation';
|
8
|
+
exports.platform = {
|
9
|
+
id: exports.platformId,
|
10
|
+
name: 'Famous Fox Federation',
|
11
|
+
image: 'https://sonar.watch/img/platforms/famousfoxfederation.webp',
|
12
|
+
website: 'https://famousfoxes.com',
|
13
|
+
twitter: 'https://twitter.com/famousfoxfed',
|
14
|
+
// defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
|
15
|
+
};
|
16
|
+
exports.tokenMarketProgram = new web3_js_1.PublicKey('8BYmYs3zsBhftNELJdiKsCN2WyCBbrTwXd6WG4AFPr6n');
|
17
|
+
exports.tokenMarketIdlItem = {
|
18
|
+
programId: exports.tokenMarketProgram.toString(),
|
19
|
+
idl: tokenMarketIdl_1.tokenMarketIdl,
|
20
|
+
idlType: 'anchor',
|
21
|
+
};
|
22
|
+
exports.foxProgram = new web3_js_1.PublicKey('FoXpJL1exLBJgHVvdSHNKyKu2xX2uatctH9qp6dLmfpP');
|
23
|
+
exports.stakingConfigAccount = new web3_js_1.PublicKey('7N7M1H2CK51ip7sNtPgKhhv2eScx6BokLgHi1Ke3ZLiq');
|
24
|
+
exports.foxyMint = 'FoXyMu5xwXre7zEoSvzViRk3nGawHUp9kUh97y2NDhcq';
|
25
|
+
exports.stakingIdlItem = {
|
26
|
+
programId: exports.foxProgram.toString(),
|
27
|
+
idl: stakingIdl_1.StakingIDL,
|
28
|
+
idlType: 'anchor',
|
29
|
+
};
|
30
|
+
exports.cachePrefix = 'famousfoxfederation';
|
31
|
+
exports.stakingConfigCacheKey = 'stakingconfig';
|
32
|
+
//# sourceMappingURL=constants.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/famousfoxfederation/constants.ts"],"names":[],"mappings":";;;AAEA,6CAA4C;AAC5C,6CAA0C;AAC1C,qDAAkD;AAErC,QAAA,UAAU,GAAG,qBAAqB,CAAC;AAEnC,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE,4DAA4D;IACnE,OAAO,EAAE,yBAAyB;IAClC,OAAO,EAAE,kCAAkC;IAC3C,qEAAqE;CACtE,CAAC;AAEW,QAAA,kBAAkB,GAAG,IAAI,mBAAS,CAC7C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,kBAAkB,GAAG;IAChC,SAAS,EAAE,0BAAkB,CAAC,QAAQ,EAAE;IACxC,GAAG,EAAE,+BAAc;IACnB,OAAO,EAAE,QAAQ;CACP,CAAC;AAEA,QAAA,UAAU,GAAG,IAAI,mBAAS,CACrC,8CAA8C,CAC/C,CAAC;AACW,QAAA,oBAAoB,GAAG,IAAI,mBAAS,CAC/C,8CAA8C,CAC/C,CAAC;AAEW,QAAA,QAAQ,GAAG,8CAA8C,CAAC;AAE1D,QAAA,cAAc,GAAG;IAC5B,SAAS,EAAE,kBAAU,CAAC,QAAQ,EAAE;IAChC,GAAG,EAAE,uBAAU;IACf,OAAO,EAAE,QAAQ;CACP,CAAC;AAEA,QAAA,WAAW,GAAG,qBAAqB,CAAC;AACpC,QAAA,qBAAqB,GAAG,eAAe,CAAC"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.calcEarnings = void 0;
|
4
|
+
const calcEarnings = (stakingAccount, stakingConfig) => {
|
5
|
+
const amount = Number(stakingConfig.amount);
|
6
|
+
return Math.floor(((Date.now() / 1e3 - Number(stakingAccount.lastClaim)) /
|
7
|
+
Number(stakingConfig.interval)) *
|
8
|
+
(stakingAccount.tff ? amount / 4 : amount));
|
9
|
+
};
|
10
|
+
exports.calcEarnings = calcEarnings;
|
11
|
+
//# sourceMappingURL=helpers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/famousfoxfederation/helpers.ts"],"names":[],"mappings":";;;AAEO,MAAM,YAAY,GAAG,CAC1B,cAA8B,EAC9B,aAA4B,EAC5B,EAAE;IACF,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IAC5C,OAAO,IAAI,CAAC,KAAK,CACf,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;QACpD,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAC/B,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAC7C,CAAC;AACJ,CAAC,CAAC;AAVW,QAAA,YAAY,gBAUvB"}
|
@@ -0,0 +1,14 @@
|
|
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 = exports.platforms = void 0;
|
7
|
+
const constants_1 = require("./constants");
|
8
|
+
const tokenMarketFetcher_1 = __importDefault(require("./tokenMarketFetcher"));
|
9
|
+
const stakingFetcher_1 = __importDefault(require("./stakingFetcher"));
|
10
|
+
const stakingJob_1 = __importDefault(require("./stakingJob"));
|
11
|
+
exports.platforms = [constants_1.platform];
|
12
|
+
exports.jobs = [stakingJob_1.default];
|
13
|
+
exports.fetchers = [tokenMarketFetcher_1.default, stakingFetcher_1.default];
|
14
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/famousfoxfederation/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,8EAAsD;AACtD,sEAA8C;AAC9C,8DAAsC;AAEzB,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,oBAAU,CAAC,CAAC;AAC3B,QAAA,QAAQ,GAAc,CAAC,4BAAkB,EAAE,wBAAc,CAAC,CAAC"}
|
@@ -0,0 +1,70 @@
|
|
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 constants_1 = require("./constants");
|
17
|
+
const clients_1 = require("../../utils/clients");
|
18
|
+
const solana_1 = require("../../utils/solana");
|
19
|
+
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
20
|
+
const helpers_1 = require("./helpers");
|
21
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
22
|
+
const connection = (0, clients_1.getClientSolana)();
|
23
|
+
const [accounts] = yield Promise.all([
|
24
|
+
(0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.stakingIdlItem, [
|
25
|
+
{
|
26
|
+
memcmp: {
|
27
|
+
bytes: owner,
|
28
|
+
offset: 41,
|
29
|
+
},
|
30
|
+
},
|
31
|
+
]),
|
32
|
+
]);
|
33
|
+
if (!accounts.length)
|
34
|
+
return [];
|
35
|
+
const [tokenPrice, configAccount] = yield Promise.all([
|
36
|
+
cache.getTokenPrice((0, portfolio_core_1.formatTokenAddress)(constants_1.foxyMint, portfolio_core_1.NetworkId.solana), portfolio_core_1.NetworkId.solana),
|
37
|
+
cache.getItem(constants_1.stakingConfigCacheKey, {
|
38
|
+
prefix: constants_1.cachePrefix,
|
39
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
40
|
+
}),
|
41
|
+
]);
|
42
|
+
if (!tokenPrice || !configAccount)
|
43
|
+
return [];
|
44
|
+
const earnings = accounts.reduce((sum, stakingAccount) => {
|
45
|
+
const earningForThisOne = (0, helpers_1.calcEarnings)(stakingAccount, configAccount);
|
46
|
+
return earningForThisOne !== null ? sum + earningForThisOne : sum;
|
47
|
+
}, 0);
|
48
|
+
if (earnings === 0)
|
49
|
+
return [];
|
50
|
+
const asset = (0, tokenPriceToAssetToken_1.default)(constants_1.foxyMint, earnings, portfolio_core_1.NetworkId.solana, tokenPrice, undefined, { isClaimable: true });
|
51
|
+
return [
|
52
|
+
{
|
53
|
+
type: portfolio_core_1.PortfolioElementType.multiple,
|
54
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
55
|
+
platformId: constants_1.platformId,
|
56
|
+
label: 'Rewards',
|
57
|
+
value: asset.value,
|
58
|
+
data: {
|
59
|
+
assets: [asset],
|
60
|
+
},
|
61
|
+
},
|
62
|
+
];
|
63
|
+
});
|
64
|
+
const fetcher = {
|
65
|
+
id: `${constants_1.platformId}-staking`,
|
66
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
67
|
+
executor,
|
68
|
+
};
|
69
|
+
exports.default = fetcher;
|
70
|
+
//# sourceMappingURL=stakingFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/famousfoxfederation/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AAEpC,2CAMqB;AAErB,iDAAsD;AACtD,+CAAkE;AAElE,qGAA6E;AAC7E,uCAAyC;AAEzC,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,CAAC,QAAQ,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACnC,IAAA,qCAA4B,EAAiB,UAAU,EAAE,0BAAc,EAAE;YACvE;gBACE,MAAM,EAAE;oBACN,KAAK,EAAE,KAAK;oBACZ,MAAM,EAAE,EAAE;iBACX;aACF;SACF,CAAC;KACH,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IAEhC,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACpD,KAAK,CAAC,aAAa,CACjB,IAAA,mCAAkB,EAAC,oBAAQ,EAAE,0BAAS,CAAC,MAAM,CAAC,EAC9C,0BAAS,CAAC,MAAM,CACjB;QACD,KAAK,CAAC,OAAO,CAAgB,iCAAqB,EAAE;YAClD,MAAM,EAAE,uBAAW;YACnB,SAAS,EAAE,0BAAS,CAAC,MAAM;SAC5B,CAAC;KACH,CAAC,CAAC;IAEH,IAAI,CAAC,UAAU,IAAI,CAAC,aAAa;QAAE,OAAO,EAAE,CAAC;IAE7C,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAW,EAAE,cAAc,EAAE,EAAE;QAC/D,MAAM,iBAAiB,GAAG,IAAA,sBAAY,EAAC,cAAc,EAAE,aAAa,CAAC,CAAC;QACtE,OAAO,iBAAiB,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,GAAG,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC;IACpE,CAAC,EAAE,CAAC,CAAC,CAAC;IAEN,IAAI,QAAQ,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE9B,MAAM,KAAK,GAAG,IAAA,gCAAsB,EAClC,oBAAQ,EACR,QAAQ,EACR,0BAAS,CAAC,MAAM,EAChB,UAAU,EACV,SAAS,EACT,EAAE,WAAW,EAAE,IAAI,EAAE,CACtB,CAAC;IAEF,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,QAAQ;YACnC,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,IAAI,EAAE;gBACJ,MAAM,EAAE,CAAC,KAAK,CAAC;aAChB;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
export declare const StakingIDL: {
|
2
|
+
version: string;
|
3
|
+
name: string;
|
4
|
+
instructions: {
|
5
|
+
name: string;
|
6
|
+
accounts: {
|
7
|
+
name: string;
|
8
|
+
isMut: boolean;
|
9
|
+
isSigner: boolean;
|
10
|
+
}[];
|
11
|
+
args: {
|
12
|
+
name: string;
|
13
|
+
type: string;
|
14
|
+
}[];
|
15
|
+
}[];
|
16
|
+
accounts: {
|
17
|
+
name: string;
|
18
|
+
type: {
|
19
|
+
kind: string;
|
20
|
+
fields: {
|
21
|
+
name: string;
|
22
|
+
type: string;
|
23
|
+
}[];
|
24
|
+
};
|
25
|
+
}[];
|
26
|
+
errors: {
|
27
|
+
code: number;
|
28
|
+
name: string;
|
29
|
+
msg: string;
|
30
|
+
}[];
|
31
|
+
};
|
@@ -0,0 +1,226 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.StakingIDL = void 0;
|
4
|
+
exports.StakingIDL = {
|
5
|
+
version: '0.1.0',
|
6
|
+
name: 'staking',
|
7
|
+
instructions: [
|
8
|
+
{
|
9
|
+
name: 'initialize',
|
10
|
+
accounts: [
|
11
|
+
{ name: 'config', isMut: true, isSigner: true },
|
12
|
+
{ name: 'authority', isMut: true, isSigner: false },
|
13
|
+
{ name: 'systemProgram', isMut: false, isSigner: false },
|
14
|
+
],
|
15
|
+
args: [
|
16
|
+
{ name: 'reward', type: 'publicKey' },
|
17
|
+
{ name: 'amount', type: 'i64' },
|
18
|
+
{ name: 'interval', type: 'i64' },
|
19
|
+
{ name: 'timelock', type: 'i64' },
|
20
|
+
],
|
21
|
+
},
|
22
|
+
{
|
23
|
+
name: 'updateConfig',
|
24
|
+
accounts: [
|
25
|
+
{ name: 'config', isMut: true, isSigner: false },
|
26
|
+
{ name: 'authority', isMut: false, isSigner: true },
|
27
|
+
],
|
28
|
+
args: [
|
29
|
+
{ name: 'reward', type: 'publicKey' },
|
30
|
+
{ name: 'amount', type: 'i64' },
|
31
|
+
{ name: 'interval', type: 'i64' },
|
32
|
+
{ name: 'timelock', type: 'i64' },
|
33
|
+
],
|
34
|
+
},
|
35
|
+
{
|
36
|
+
name: 'initDeposit',
|
37
|
+
accounts: [
|
38
|
+
{ name: 'config', isMut: true, isSigner: false },
|
39
|
+
{ name: 'authority', isMut: false, isSigner: false },
|
40
|
+
{ name: 'rewardAccount', isMut: true, isSigner: false },
|
41
|
+
{ name: 'reward', isMut: false, isSigner: false },
|
42
|
+
{ name: 'owner', isMut: false, isSigner: true },
|
43
|
+
{ name: 'tokenProgram', isMut: false, isSigner: false },
|
44
|
+
{ name: 'systemProgram', isMut: false, isSigner: false },
|
45
|
+
{ name: 'rent', isMut: false, isSigner: false },
|
46
|
+
],
|
47
|
+
args: [
|
48
|
+
{ name: 'authBump', type: 'u8' },
|
49
|
+
{ name: 'rewardBump', type: 'u8' },
|
50
|
+
],
|
51
|
+
},
|
52
|
+
{
|
53
|
+
name: 'deposit',
|
54
|
+
accounts: [
|
55
|
+
{ name: 'config', isMut: true, isSigner: false },
|
56
|
+
{ name: 'authority', isMut: false, isSigner: false },
|
57
|
+
{ name: 'rewardAccount', isMut: true, isSigner: false },
|
58
|
+
{ name: 'reward', isMut: false, isSigner: false },
|
59
|
+
{ name: 'mainAccount', isMut: true, isSigner: false },
|
60
|
+
{ name: 'owner', isMut: false, isSigner: true },
|
61
|
+
{ name: 'tokenProgram', isMut: false, isSigner: false },
|
62
|
+
],
|
63
|
+
args: [{ name: 'amount', type: 'u64' }],
|
64
|
+
},
|
65
|
+
{
|
66
|
+
name: 'stakeFox',
|
67
|
+
accounts: [
|
68
|
+
{ name: 'config', isMut: true, isSigner: false },
|
69
|
+
{ name: 'authority', isMut: true, isSigner: false },
|
70
|
+
{ name: 'stakeAccount', isMut: true, isSigner: false },
|
71
|
+
{ name: 'tokenAccount', isMut: true, isSigner: false },
|
72
|
+
{ name: 'owner', isMut: false, isSigner: true },
|
73
|
+
{ name: 'fromAccount', isMut: true, isSigner: false },
|
74
|
+
{ name: 'mint', isMut: false, isSigner: false },
|
75
|
+
{ name: 'metadata', isMut: false, isSigner: false },
|
76
|
+
{ name: 'tokenProgram', isMut: false, isSigner: false },
|
77
|
+
{ name: 'systemProgram', isMut: false, isSigner: false },
|
78
|
+
{ name: 'rent', isMut: false, isSigner: false },
|
79
|
+
{ name: 'clock', isMut: false, isSigner: false },
|
80
|
+
],
|
81
|
+
args: [
|
82
|
+
{ name: 'authBump', type: 'u8' },
|
83
|
+
{ name: 'stakeBump', type: 'u8' },
|
84
|
+
{ name: 'tokenBump', type: 'u8' },
|
85
|
+
],
|
86
|
+
},
|
87
|
+
{
|
88
|
+
name: 'stakeFoxV2',
|
89
|
+
accounts: [
|
90
|
+
{ name: 'config', isMut: true, isSigner: false },
|
91
|
+
{ name: 'authority', isMut: true, isSigner: false },
|
92
|
+
{ name: 'stakeAccount', isMut: true, isSigner: false },
|
93
|
+
{ name: 'owner', isMut: false, isSigner: true },
|
94
|
+
{ name: 'fromAccount', isMut: true, isSigner: false },
|
95
|
+
{ name: 'mint', isMut: false, isSigner: false },
|
96
|
+
{ name: 'metadata', isMut: false, isSigner: false },
|
97
|
+
{ name: 'metaplexAcc', isMut: false, isSigner: false },
|
98
|
+
{ name: 'masterEdition', isMut: false, isSigner: false },
|
99
|
+
{ name: 'tokenProgram', isMut: false, isSigner: false },
|
100
|
+
{ name: 'systemProgram', isMut: false, isSigner: false },
|
101
|
+
{ name: 'rent', isMut: false, isSigner: false },
|
102
|
+
{ name: 'clock', isMut: false, isSigner: false },
|
103
|
+
],
|
104
|
+
args: [
|
105
|
+
{ name: 'authBump', type: 'u8' },
|
106
|
+
{ name: 'stakeBump', type: 'u8' },
|
107
|
+
],
|
108
|
+
},
|
109
|
+
{
|
110
|
+
name: 'unstakeFox',
|
111
|
+
accounts: [
|
112
|
+
{ name: 'config', isMut: true, isSigner: false },
|
113
|
+
{ name: 'authority', isMut: true, isSigner: false },
|
114
|
+
{ name: 'stakeAccount', isMut: true, isSigner: false },
|
115
|
+
{ name: 'tokenAccount', isMut: true, isSigner: false },
|
116
|
+
{ name: 'owner', isMut: true, isSigner: true },
|
117
|
+
{ name: 'toAccount', isMut: true, isSigner: false },
|
118
|
+
{ name: 'mint', isMut: false, isSigner: false },
|
119
|
+
{ name: 'tokenProgram', isMut: false, isSigner: false },
|
120
|
+
{ name: 'systemProgram', isMut: false, isSigner: false },
|
121
|
+
{ name: 'clock', isMut: false, isSigner: false },
|
122
|
+
{ name: 'associatedTokenProgram', isMut: false, isSigner: false },
|
123
|
+
{ name: 'rent', isMut: false, isSigner: false },
|
124
|
+
],
|
125
|
+
args: [],
|
126
|
+
},
|
127
|
+
{
|
128
|
+
name: 'bonkDerug',
|
129
|
+
accounts: [
|
130
|
+
{ name: 'config', isMut: true, isSigner: false },
|
131
|
+
{ name: 'authority', isMut: true, isSigner: false },
|
132
|
+
{ name: 'tokenAccount', isMut: true, isSigner: false },
|
133
|
+
{ name: 'owner', isMut: true, isSigner: true },
|
134
|
+
{ name: 'toAccount', isMut: true, isSigner: false },
|
135
|
+
{ name: 'mint', isMut: false, isSigner: false },
|
136
|
+
{ name: 'tokenProgram', isMut: false, isSigner: false },
|
137
|
+
{ name: 'systemProgram', isMut: false, isSigner: false },
|
138
|
+
{ name: 'associatedTokenProgram', isMut: false, isSigner: false },
|
139
|
+
{ name: 'rent', isMut: false, isSigner: false },
|
140
|
+
],
|
141
|
+
args: [{ name: 'bump', type: 'u8' }],
|
142
|
+
},
|
143
|
+
{
|
144
|
+
name: 'unstakeFoxV2',
|
145
|
+
accounts: [
|
146
|
+
{ name: 'config', isMut: true, isSigner: false },
|
147
|
+
{ name: 'authority', isMut: true, isSigner: false },
|
148
|
+
{ name: 'stakeAccount', isMut: true, isSigner: false },
|
149
|
+
{ name: 'masterEdition', isMut: false, isSigner: false },
|
150
|
+
{ name: 'metaplexAcc', isMut: false, isSigner: false },
|
151
|
+
{ name: 'owner', isMut: true, isSigner: true },
|
152
|
+
{ name: 'toAccount', isMut: true, isSigner: false },
|
153
|
+
{ name: 'mint', isMut: false, isSigner: false },
|
154
|
+
{ name: 'tokenProgram', isMut: false, isSigner: false },
|
155
|
+
{ name: 'systemProgram', isMut: false, isSigner: false },
|
156
|
+
{ name: 'clock', isMut: false, isSigner: false },
|
157
|
+
{ name: 'rent', isMut: false, isSigner: false },
|
158
|
+
],
|
159
|
+
args: [],
|
160
|
+
},
|
161
|
+
{
|
162
|
+
name: 'claim',
|
163
|
+
accounts: [
|
164
|
+
{ name: 'config', isMut: true, isSigner: false },
|
165
|
+
{ name: 'authority', isMut: false, isSigner: false },
|
166
|
+
{ name: 'rewardAccount', isMut: true, isSigner: false },
|
167
|
+
{ name: 'userRewardAccount', isMut: true, isSigner: false },
|
168
|
+
{ name: 'stakeAccount', isMut: true, isSigner: false },
|
169
|
+
{ name: 'owner', isMut: false, isSigner: true },
|
170
|
+
{ name: 'mint', isMut: false, isSigner: false },
|
171
|
+
{ name: 'reward', isMut: false, isSigner: false },
|
172
|
+
{ name: 'clock', isMut: false, isSigner: false },
|
173
|
+
{ name: 'tokenProgram', isMut: false, isSigner: false },
|
174
|
+
{ name: 'associatedTokenProgram', isMut: false, isSigner: false },
|
175
|
+
{ name: 'rent', isMut: false, isSigner: false },
|
176
|
+
{ name: 'systemProgram', isMut: false, isSigner: false },
|
177
|
+
],
|
178
|
+
args: [],
|
179
|
+
},
|
180
|
+
],
|
181
|
+
accounts: [
|
182
|
+
{
|
183
|
+
name: 'StakingAccount',
|
184
|
+
type: {
|
185
|
+
kind: 'struct',
|
186
|
+
fields: [
|
187
|
+
{ name: 'bump', type: 'u8' },
|
188
|
+
{ name: 'fox', type: 'publicKey' },
|
189
|
+
{ name: 'owner', type: 'publicKey' },
|
190
|
+
{ name: 'lock', type: 'i64' },
|
191
|
+
{ name: 'lastClaim', type: 'i64' },
|
192
|
+
{ name: 'tff', type: 'bool' },
|
193
|
+
{ name: 'v2', type: 'bool' },
|
194
|
+
],
|
195
|
+
},
|
196
|
+
},
|
197
|
+
{
|
198
|
+
name: 'StakingConfig',
|
199
|
+
type: {
|
200
|
+
kind: 'struct',
|
201
|
+
fields: [
|
202
|
+
{ name: 'bump', type: 'u8' },
|
203
|
+
{ name: 'reward', type: 'publicKey' },
|
204
|
+
{ name: 'authority', type: 'publicKey' },
|
205
|
+
{ name: 'amount', type: 'i64' },
|
206
|
+
{ name: 'interval', type: 'i64' },
|
207
|
+
{ name: 'timelock', type: 'i64' },
|
208
|
+
{ name: 'count', type: 'u64' },
|
209
|
+
{ name: 'tcount', type: 'u64' },
|
210
|
+
],
|
211
|
+
},
|
212
|
+
},
|
213
|
+
],
|
214
|
+
errors: [
|
215
|
+
{ code: 6000, name: 'IncorrectOwner', msg: 'Invalid owner account' },
|
216
|
+
{ code: 6001, name: 'FoxLocked', msg: 'Fox is locked' },
|
217
|
+
{ code: 6002, name: 'FoxNotStaked', msg: 'Fox not staked' },
|
218
|
+
{ code: 6003, name: 'FoxNotFound', msg: 'Fox not found' },
|
219
|
+
{ code: 6004, name: 'NoReward', msg: 'No reward' },
|
220
|
+
{ code: 6005, name: 'InvalidReward', msg: 'Invalid reward account' },
|
221
|
+
{ code: 6006, name: 'InvalidFox', msg: 'Invalid Index' },
|
222
|
+
{ code: 6007, name: 'InvalidMetadata', msg: 'Invalid Fox' },
|
223
|
+
{ code: 6008, name: 'ClaimReward', msg: 'Claim Reward' },
|
224
|
+
],
|
225
|
+
};
|
226
|
+
//# sourceMappingURL=stakingIdl.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"stakingIdl.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/famousfoxfederation/stakingIdl.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG;IACxB,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,SAAS;IACf,YAAY,EAAE;QACZ;YACE,IAAI,EAAE,YAAY;YAClB,QAAQ,EAAE;gBACR,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;gBAC/C,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE;gBACnD,EAAE,IAAI,EAAE,eAAe,EAAE,K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IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,eAAe,EAAE;QACzD,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,WAAW,EAAE;QAClD,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,wBAAwB,EAAE;QACpE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,eAAe,EAAE;QACxD,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,aAAa,EAAE;QAC3D,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,cAAc,EAAE;KACzD;CACF,CAAC"}
|
@@ -0,0 +1,30 @@
|
|
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 clients_1 = require("../../utils/clients");
|
16
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
17
|
+
const connection = (0, clients_1.getClientSolana)();
|
18
|
+
const [stakingConfig] = yield (0, solana_1.getAutoParsedMultipleAccountsInfo)(connection, constants_1.stakingIdlItem, [constants_1.stakingConfigAccount]);
|
19
|
+
yield cache.setItem(constants_1.stakingConfigCacheKey, stakingConfig, {
|
20
|
+
prefix: constants_1.cachePrefix,
|
21
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
22
|
+
});
|
23
|
+
});
|
24
|
+
const job = {
|
25
|
+
id: `${constants_1.platformId}-staking`,
|
26
|
+
executor,
|
27
|
+
label: 'normal',
|
28
|
+
};
|
29
|
+
exports.default = job;
|
30
|
+
//# sourceMappingURL=stakingJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"stakingJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/famousfoxfederation/stakingJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAMqB;AAErB,+CAAuE;AACvE,iDAAsD;AAEtD,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,CAAC,aAAa,CAAC,GACnB,MAAM,IAAA,0CAAiC,EACrC,UAAU,EACV,0BAAc,EACd,CAAC,gCAAoB,CAAC,CACvB,CAAC;IAEJ,MAAM,KAAK,CAAC,OAAO,CAAC,iCAAqB,EAAE,aAAa,EAAE;QACxD,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,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,59 @@
|
|
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 bignumber_js_1 = __importDefault(require("bignumber.js"));
|
17
|
+
const constants_1 = require("./constants");
|
18
|
+
const clients_1 = require("../../utils/clients");
|
19
|
+
const solana_1 = require("../../utils/solana");
|
20
|
+
const getSolanaDasEndpoint_1 = __importDefault(require("../../utils/clients/getSolanaDasEndpoint"));
|
21
|
+
const mintsToAssets_1 = require("../../utils/solana/mintsToAssets");
|
22
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
|
+
const dasUrl = (0, getSolanaDasEndpoint_1.default)();
|
24
|
+
const connection = (0, clients_1.getClientSolana)();
|
25
|
+
const accounts = yield (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.tokenMarketIdlItem, [
|
26
|
+
{
|
27
|
+
memcmp: {
|
28
|
+
bytes: owner,
|
29
|
+
offset: 41,
|
30
|
+
},
|
31
|
+
},
|
32
|
+
]);
|
33
|
+
if (accounts.length === 0)
|
34
|
+
return [];
|
35
|
+
const assetsByMint = yield (0, mintsToAssets_1.mintsToAssets)(dasUrl, cache, accounts.map((acc) => acc.mint), accounts.map((acc) => new bignumber_js_1.default(acc.count).toNumber()));
|
36
|
+
const elements = [];
|
37
|
+
const assets = [...assetsByMint.values()];
|
38
|
+
if (assets.length === 0)
|
39
|
+
return [];
|
40
|
+
elements.push({
|
41
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
42
|
+
label: 'Deposit',
|
43
|
+
platformId: constants_1.platformId,
|
44
|
+
type: portfolio_core_1.PortfolioElementType.multiple,
|
45
|
+
value: (0, portfolio_core_1.getUsdValueSum)(assets.map((a) => a.value)),
|
46
|
+
name: 'Sell Orders',
|
47
|
+
data: {
|
48
|
+
assets,
|
49
|
+
},
|
50
|
+
});
|
51
|
+
return elements;
|
52
|
+
});
|
53
|
+
const fetcher = {
|
54
|
+
id: `${constants_1.platformId}-tokenmarket`,
|
55
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
56
|
+
executor,
|
57
|
+
};
|
58
|
+
exports.default = fetcher;
|
59
|
+
//# sourceMappingURL=tokenMarketFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"tokenMarketFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/famousfoxfederation/tokenMarketFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAErC,2CAA6D;AAE7D,iDAAsD;AACtD,+CAAkE;AAElE,oGAA4E;AAC5E,oEAAiE;AAEjE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,8BAAoB,GAAE,CAAC;IACtC,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,QAAQ,GAAG,MAAM,IAAA,qCAA4B,EACjD,UAAU,EACV,8BAAkB,EAClB;QACE;YACE,MAAM,EAAE;gBACN,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,EAAE;aACX;SACF;KACF,CACF,CAAC;IAEF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErC,MAAM,YAAY,GAAG,MAAM,IAAA,6BAAa,EACtC,MAAM,EACN,KAAK,EACL,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,EAC/B,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,sBAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,CAC3D,CAAC;IAEF,MAAM,QAAQ,GAAuB,EAAE,CAAC;IACxC,MAAM,MAAM,GAAqB,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC;IAE5D,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,QAAQ,CAAC,IAAI,CAAC;QACZ,SAAS,EAAE,0BAAS,CAAC,MAAM;QAC3B,KAAK,EAAE,SAAS;QAChB,UAAU,EAAV,sBAAU;QACV,IAAI,EAAE,qCAAoB,CAAC,QAAQ;QACnC,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACjD,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE;YACJ,MAAM;SACP;KACF,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
export declare const tokenMarketIdl: {
|
2
|
+
version: string;
|
3
|
+
name: string;
|
4
|
+
instructions: {
|
5
|
+
name: string;
|
6
|
+
accounts: ({
|
7
|
+
name: string;
|
8
|
+
isMut: boolean;
|
9
|
+
isSigner: boolean;
|
10
|
+
isOptional?: undefined;
|
11
|
+
} | {
|
12
|
+
name: string;
|
13
|
+
isMut: boolean;
|
14
|
+
isSigner: boolean;
|
15
|
+
isOptional: boolean;
|
16
|
+
})[];
|
17
|
+
args: {
|
18
|
+
name: string;
|
19
|
+
type: string;
|
20
|
+
}[];
|
21
|
+
}[];
|
22
|
+
accounts: {
|
23
|
+
name: string;
|
24
|
+
type: {
|
25
|
+
kind: string;
|
26
|
+
fields: {
|
27
|
+
name: string;
|
28
|
+
type: string;
|
29
|
+
}[];
|
30
|
+
};
|
31
|
+
}[];
|
32
|
+
events: {
|
33
|
+
name: string;
|
34
|
+
fields: {
|
35
|
+
name: string;
|
36
|
+
type: string;
|
37
|
+
index: boolean;
|
38
|
+
}[];
|
39
|
+
}[];
|
40
|
+
errors: {
|
41
|
+
code: number;
|
42
|
+
name: string;
|
43
|
+
msg: string;
|
44
|
+
}[];
|
45
|
+
};
|