@sonarwatch/portfolio-plugins 0.8.53 → 0.8.55
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 +8 -0
- package/package.json +2 -2
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/plugins/realms/constants.d.ts +2 -4
- package/src/plugins/realms/constants.js +3 -5
- package/src/plugins/realms/constants.js.map +1 -1
- package/src/plugins/realms/depositsFetcher.js +14 -3
- package/src/plugins/realms/depositsFetcher.js.map +1 -1
- package/src/plugins/realms/filters.d.ts +6 -0
- package/src/plugins/realms/filters.js +11 -2
- package/src/plugins/realms/filters.js.map +1 -1
- package/src/plugins/realms/index.js +2 -1
- package/src/plugins/realms/index.js.map +1 -1
- package/src/plugins/realms/programsJob.d.ts +3 -0
- package/src/plugins/realms/programsJob.js +32 -0
- package/src/plugins/realms/programsJob.js.map +1 -0
- package/src/plugins/realms/structs.d.ts +6 -0
- package/src/plugins/realms/structs.js +6 -1
- package/src/plugins/realms/structs.js.map +1 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
+
## [0.8.55](https://github.com/sonarwatch/portfolio/compare/plugins-0.8.54...plugins-0.8.55) (2023-11-03)
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
## [0.8.54](https://github.com/sonarwatch/portfolio/compare/plugins-0.8.53...plugins-0.8.54) (2023-11-02)
|
10
|
+
|
11
|
+
|
12
|
+
|
5
13
|
## [0.8.53](https://github.com/sonarwatch/portfolio/compare/plugins-0.8.52...plugins-0.8.53) (2023-11-02)
|
6
14
|
|
7
15
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.8.
|
3
|
+
"version": "0.8.55",
|
4
4
|
"type": "commonjs",
|
5
5
|
"generators": "./generators.json",
|
6
6
|
"dependencies": {
|
@@ -39,7 +39,7 @@
|
|
39
39
|
"web3-v1": "npm:web3@^1.5.0"
|
40
40
|
},
|
41
41
|
"peerDependencies": {
|
42
|
-
"@sonarwatch/portfolio-core": "0.8.
|
42
|
+
"@sonarwatch/portfolio-core": "0.8.55"
|
43
43
|
},
|
44
44
|
"main": "./src/index.js",
|
45
45
|
"types": "./src/index.d.ts"
|
package/src/index.js
CHANGED
package/src/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAGA,wFAAqF;AACrF,sEAA8C;AAC9C,6CAI0B;AAC1B,yDAIgC;AAChC,iDAG4B;AAC5B,iDAI4B;AAC5B,2CAGyB;AACzB,6CAI0B;AAC1B,+CAI2B;AAC3B,yCAIwB;AACxB,+CAG2B;AAC3B,2CAIyB;AACzB,6CAI0B;AAC1B,2CAIyB;AACzB,6CAG0B;AAC1B,6CAI0B;AAC1B,yCAIwB;AACxB,2DAGiC;AACjC,6CAI0B;AAC1B,2CAIyB;AACzB,2CAIyB;AACzB,qDAA6D;AAC7D,qEAIsC;AACtC,uDAG+B;AAC/B,mDAG6B;AAC7B,qDAG8B;AAC9B,uDAG+B;AAC/B,2CAIyB;AACzB,6CAG0B;AAC1B,6CAG0B;AAC1B,yCAIwB;AACxB,uDAG+B;AAC/B,yCAGwB;AACxB,2CAIyB;AACzB,iDAI4B;AAC5B,iDAI4B;AAC5B,6CAI0B;AAC1B,+CAI2B;AAC3B,qDAG8B;AAC9B,iDAI4B;AAC5B,iDAI4B;AAC5B,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/plugins/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAGA,wFAAqF;AACrF,sEAA8C;AAC9C,6CAI0B;AAC1B,yDAIgC;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ChB,GAAG,gBAAa;IAChB,GAAG,iBAAc;IACjB,GAAG,wBAAoB;IACvB,GAAG,eAAY;IACf,GAAG,iBAAc;IACjB,GAAG,iBAAc;IACjB,GAAG,6BAAyB;IAC5B,GAAG,iBAAc;IACjB,GAAG,eAAY;IACf,GAAG,sBAAkB;IACrB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,gBAAa;IAChB,GAAG,mBAAgB;IACnB,GAAG,eAAY;IACf,GAAG,iBAAc;IACjB,GAAG,qBAAiB;IACpB,GAAG,kBAAe;IAClB,GAAG,mBAAgB;IACnB,GAAG,mBAAgB;IACnB,GAAG,iBAAc;CAClB,CAAC;AACW,QAAA,uBAAuB,GAAG,IAAA,uDAA0B,EAAC,gBAAQ,CAAC,CAAC"}
|
@@ -1,7 +1,5 @@
|
|
1
|
-
import { PublicKey } from '@solana/web3.js';
|
2
1
|
import { Platform } from '@sonarwatch/portfolio-core';
|
3
2
|
export declare const platformId = "realms";
|
4
3
|
export declare const realmsPlatform: Platform;
|
5
|
-
export declare const
|
6
|
-
export declare const
|
7
|
-
export declare const goveProgramId: PublicKey;
|
4
|
+
export declare const splGovProgramsKey = "splGovernancePrograms";
|
5
|
+
export declare const splGovernanceUrl = "https://app.realms.today/api/splGovernancePrograms";
|
@@ -1,7 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
4
|
-
const web3_js_1 = require("@solana/web3.js");
|
3
|
+
exports.splGovernanceUrl = exports.splGovProgramsKey = exports.realmsPlatform = exports.platformId = void 0;
|
5
4
|
exports.platformId = 'realms';
|
6
5
|
exports.realmsPlatform = {
|
7
6
|
id: exports.platformId,
|
@@ -9,7 +8,6 @@ exports.realmsPlatform = {
|
|
9
8
|
image: 'https://sonar.watch/img/platforms/realms.png',
|
10
9
|
defiLlamaId: 'realms',
|
11
10
|
};
|
12
|
-
exports.
|
13
|
-
exports.
|
14
|
-
exports.goveProgramId = new web3_js_1.PublicKey('GovMaiHfpVPw8BAM1mbdzgmSZYDw2tdP32J2fapoQoYs');
|
11
|
+
exports.splGovProgramsKey = 'splGovernancePrograms';
|
12
|
+
exports.splGovernanceUrl = 'https://app.realms.today/api/splGovernancePrograms';
|
15
13
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/realms/constants.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/realms/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,QAAQ,CAAC;AAEtB,QAAA,cAAc,GAAa;IACtC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,8CAA8C;IACrD,WAAW,EAAE,QAAQ;CACtB,CAAC;AAEW,QAAA,iBAAiB,GAAG,uBAAuB,CAAC;AAE5C,QAAA,gBAAgB,GAC3B,oDAAoD,CAAC"}
|
@@ -13,6 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
15
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
|
+
const web3_js_1 = require("@solana/web3.js");
|
16
17
|
const constants_1 = require("./constants");
|
17
18
|
const clients_1 = require("../../utils/clients");
|
18
19
|
const solana_1 = require("../../utils/solana");
|
@@ -21,9 +22,17 @@ const filters_1 = require("./filters");
|
|
21
22
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
22
23
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
24
|
const client = (0, clients_1.getClientSolana)();
|
24
|
-
const
|
25
|
-
|
26
|
-
|
25
|
+
const programs = yield cache.getItem(constants_1.splGovProgramsKey, {
|
26
|
+
prefix: constants_1.platformId,
|
27
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
28
|
+
});
|
29
|
+
const promises = [];
|
30
|
+
if (programs) {
|
31
|
+
for (const program of programs) {
|
32
|
+
promises.push((0, solana_1.getParsedProgramAccounts)(client, structs_1.voteAccountStruct, new web3_js_1.PublicKey(program), (0, filters_1.voteAccountFilters)(owner)));
|
33
|
+
}
|
34
|
+
}
|
35
|
+
const oldVoteAccounts = (yield Promise.all(promises)).flat();
|
27
36
|
if (oldVoteAccounts.length === 0)
|
28
37
|
return [];
|
29
38
|
const mints = oldVoteAccounts.map((acc) => acc.mint.toString());
|
@@ -34,6 +43,8 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
34
43
|
tokenPrices.forEach((tP) => (tP ? tokenPriceByMint.set(tP.address, tP) : []));
|
35
44
|
const assets = [];
|
36
45
|
for (const voteAccount of oldVoteAccounts) {
|
46
|
+
if (voteAccount.amount.isZero())
|
47
|
+
continue;
|
37
48
|
const tokenMint = voteAccount.mint.toString();
|
38
49
|
const tokenPrice = tokenPriceByMint.get(tokenMint);
|
39
50
|
if (!tokenPrice)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/realms/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;
|
1
|
+
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/realms/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AACpC,6CAA4C;AAG5C,2CAA4D;AAC5D,iDAAsD;AACtD,+CAA8D;AAC9D,uCAA8C;AAC9C,uCAA+C;AAC/C,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,QAAQ,GAAG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AAE,SAAS;QAC1C,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC9C,MAAM,UAAU,GAAG,gBAAgB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACnD,IAAI,CAAC,UAAU;YAAE,SAAS;QAE1B,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,SAAA,EAAE,EAAI,UAAU,CAAC,QAAQ,CAAA,CAAC,CAAC,QAAQ,EAAE,CAAC;QAE5E,MAAM,KAAK,GAAG,IAAA,gCAAsB,EAClC,SAAS,EACT,MAAM,EACN,0BAAS,CAAC,MAAM,EAChB,UAAU,CACX,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACpB;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,OAAO;QACL;YACE,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACjD,IAAI,EAAE;gBACJ,MAAM;aACP;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.voterAccountFilters = exports.voteAccountFilters = void 0;
|
3
|
+
exports.governanceAccountFilter = exports.voterAccountFilters = exports.voteAccountFilters = void 0;
|
4
4
|
const structs_1 = require("./structs");
|
5
5
|
const voteAccountFilters = (address) => [
|
6
6
|
{ dataSize: structs_1.voteAccountStruct.byteSize },
|
@@ -16,10 +16,19 @@ const voterAccountFilters = (address) => [
|
|
16
16
|
{ dataSize: structs_1.voterStruct.byteSize },
|
17
17
|
{
|
18
18
|
memcmp: {
|
19
|
-
offset:
|
19
|
+
offset: 65,
|
20
20
|
bytes: address,
|
21
21
|
},
|
22
22
|
},
|
23
23
|
];
|
24
24
|
exports.voterAccountFilters = voterAccountFilters;
|
25
|
+
const governanceAccountFilter = () => [
|
26
|
+
{
|
27
|
+
memcmp: {
|
28
|
+
offset: 0,
|
29
|
+
bytes: '2',
|
30
|
+
},
|
31
|
+
},
|
32
|
+
];
|
33
|
+
exports.governanceAccountFilter = governanceAccountFilter;
|
25
34
|
//# sourceMappingURL=filters.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/realms/filters.ts"],"names":[],"mappings":";;;AAAA,uCAA2D;AAEpD,MAAM,kBAAkB,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC;IACrD,EAAE,QAAQ,EAAE,2BAAiB,CAAC,QAAQ,EAAE;IACxC;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,OAAO;SACf;KACF;CACF,CAAC;AARW,QAAA,kBAAkB,sBAQ7B;AAEK,MAAM,mBAAmB,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC;IACtD,EAAE,QAAQ,EAAE,qBAAW,CAAC,QAAQ,EAAE;IAClC;QACE,MAAM,EAAE;YACN,MAAM,EAAE,
|
1
|
+
{"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/realms/filters.ts"],"names":[],"mappings":";;;AAAA,uCAA2D;AAEpD,MAAM,kBAAkB,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC;IACrD,EAAE,QAAQ,EAAE,2BAAiB,CAAC,QAAQ,EAAE;IACxC;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,OAAO;SACf;KACF;CACF,CAAC;AARW,QAAA,kBAAkB,sBAQ7B;AAEK,MAAM,mBAAmB,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC;IACtD,EAAE,QAAQ,EAAE,qBAAW,CAAC,QAAQ,EAAE;IAClC;QACE,MAAM,EAAE;YACN,MAAM,EAAE,EAAE;YACV,KAAK,EAAE,OAAO;SACf;KACF;CACF,CAAC;AARW,QAAA,mBAAmB,uBAQ9B;AAEK,MAAM,uBAAuB,GAAG,GAAG,EAAE,CAAC;IAC3C;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,GAAG;SACX;KACF;CACF,CAAC;AAPW,QAAA,uBAAuB,2BAOlC"}
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.platforms = exports.fetchers = exports.jobs = void 0;
|
7
7
|
const depositsFetcher_1 = __importDefault(require("./depositsFetcher"));
|
8
8
|
const constants_1 = require("./constants");
|
9
|
-
|
9
|
+
const programsJob_1 = __importDefault(require("./programsJob"));
|
10
|
+
exports.jobs = [programsJob_1.default];
|
10
11
|
exports.fetchers = [depositsFetcher_1.default];
|
11
12
|
exports.platforms = [constants_1.realmsPlatform];
|
12
13
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/realms/index.ts"],"names":[],"mappings":";;;;;;AAGA,wEAAgD;AAChD,2CAA6C;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/realms/index.ts"],"names":[],"mappings":";;;;;;AAGA,wEAAgD;AAChD,2CAA6C;AAC7C,gEAAwC;AAE3B,QAAA,IAAI,GAAU,CAAC,qBAAW,CAAC,CAAC;AAC5B,QAAA,QAAQ,GAAc,CAAC,yBAAe,CAAC,CAAC;AACxC,QAAA,SAAS,GAAe,CAAC,0BAAc,CAAC,CAAC"}
|
@@ -0,0 +1,32 @@
|
|
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 axios_1 = __importDefault(require("axios"));
|
16
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
17
|
+
const constants_1 = require("./constants");
|
18
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
19
|
+
const splGovPrograms = yield axios_1.default.get(constants_1.splGovernanceUrl);
|
20
|
+
if (splGovPrograms.data.length !== 0) {
|
21
|
+
yield cache.setItem(constants_1.splGovProgramsKey, splGovPrograms.data, {
|
22
|
+
prefix: constants_1.platformId,
|
23
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
24
|
+
});
|
25
|
+
}
|
26
|
+
});
|
27
|
+
const job = {
|
28
|
+
id: `${constants_1.platformId}-programs`,
|
29
|
+
executor,
|
30
|
+
};
|
31
|
+
exports.default = job;
|
32
|
+
//# sourceMappingURL=programsJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"programsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/realms/programsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAA6C;AAC7C,+DAAuD;AAGvD,2CAA8E;AAE9E,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,cAAc,GAA4B,MAAM,eAAK,CAAC,GAAG,CAC7D,4BAAgB,CACjB,CAAC;IAEF,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QACpC,MAAM,KAAK,CAAC,OAAO,CAAC,6BAAiB,EAAE,cAAc,CAAC,IAAI,EAAE;YAC1D,MAAM,EAAE,sBAAU;YAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;SAC5B,CAAC,CAAC;KACJ;AACH,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,QAAQ;CACT,CAAC;AAEF,kBAAe,GAAG,CAAC"}
|
@@ -70,3 +70,9 @@ export type Registrar = {
|
|
70
70
|
reserved3: BigNumber[];
|
71
71
|
};
|
72
72
|
export declare const registrarStruct: BeetStruct<Registrar, Partial<Registrar>>;
|
73
|
+
export type Governance = {
|
74
|
+
buffer: Buffer;
|
75
|
+
field1: PublicKey;
|
76
|
+
padding: number[];
|
77
|
+
};
|
78
|
+
export declare const governanceStruct: BeetStruct<Governance, Partial<Governance>>;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.registrarStruct = exports.votingMintConfigStruct = exports.voterStruct = exports.depositEntryStruct = exports.voteAccountStruct = exports.lockupStruct = exports.LockupKind = void 0;
|
3
|
+
exports.governanceStruct = exports.registrarStruct = exports.votingMintConfigStruct = exports.voterStruct = exports.depositEntryStruct = exports.voteAccountStruct = exports.lockupStruct = exports.LockupKind = void 0;
|
4
4
|
const beet_1 = require("@metaplex-foundation/beet");
|
5
5
|
const beet_solana_1 = require("@metaplex-foundation/beet-solana");
|
6
6
|
const solana_1 = require("../../utils/solana");
|
@@ -67,4 +67,9 @@ exports.registrarStruct = new beet_1.BeetStruct([
|
|
67
67
|
['reserved2', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 7)],
|
68
68
|
['reserved3', (0, beet_1.uniformFixedSizeArray)(solana_1.u64, 11)],
|
69
69
|
], (args) => args);
|
70
|
+
exports.governanceStruct = new beet_1.BeetStruct([
|
71
|
+
['buffer', (0, solana_1.blob)(8)],
|
72
|
+
['field1', beet_solana_1.publicKey],
|
73
|
+
['padding', (0, beet_1.uniformFixedSizeArray)(beet_1.u16, 10)],
|
74
|
+
], (args) => args);
|
70
75
|
//# sourceMappingURL=structs.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/realms/structs.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/realms/structs.ts"],"names":[],"mappings":";;;AAAA,oDAOmC;AACnC,kEAA6D;AAG7D,+CAAoD;AAEpD,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,2CAAM,CAAA;IACN,6CAAO,CAAA;IACP,iDAAS,CAAA;IACT,6CAAO,CAAA;IACP,mDAAU,CAAA;AACZ,CAAC,EANW,UAAU,0BAAV,UAAU,QAMrB;AASY,QAAA,YAAY,GAAG,IAAI,iBAAU,CACxC;IACE,CAAC,SAAS,EAAE,YAAG,CAAC;IAChB,CAAC,OAAO,EAAE,YAAG,CAAC;IACd,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,UAAU,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;CAC5C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAc,CACzB,CAAC;AAWW,QAAA,iBAAiB,GAAG,IAAI,iBAAU,CAC7C;IACE,CAAC,SAAS,EAAE,SAAE,CAAC;I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