@sonarwatch/portfolio-plugins 0.14.145 → 0.14.151

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.
@@ -0,0 +1,203 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.lpStruct = exports.LpStatus = exports.positionStruct = exports.positionrewardinfoStruct = exports.userStatsStruct = exports.userStruct = exports.marginPositionStruct = exports.orderStruct = exports.OrderType = exports.OrderStatus = exports.yieldPositionStruct = exports.oracleStruct = exports.yieldMarketStruct = exports.MarginType = exports.ammpoolStruct = exports.ammPoolRewardInfoStruct = exports.marginMarketStruct = exports.stateStruct = 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
+ exports.stateStruct = new beet_1.FixableBeetStruct([
8
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
9
+ ['admin', beet_solana_1.publicKey],
10
+ ['signer', beet_solana_1.publicKey],
11
+ ['numberOfAuthorities', solana_1.u64],
12
+ ['numberOfSubAccounts', solana_1.u64],
13
+ ['collateralRatioInitial', solana_1.i64],
14
+ ['collateralRatioMaintenance', solana_1.i64],
15
+ ['collateralRatioInitialPreExpiry', solana_1.i64],
16
+ ['numberOfYieldMarkets', beet_1.u32],
17
+ ['numberOfMarginMarkets', beet_1.u32],
18
+ ['signerNonce', beet_1.u8],
19
+ ['twapDuration', beet_1.u32],
20
+ ['marginIndexStart', beet_1.u32],
21
+ ['marketIndexStart', beet_1.u32],
22
+ ['keepers', (0, beet_1.uniformFixedSizeArray)(beet_solana_1.publicKey, 20)],
23
+ ['keeperFeePerTx', solana_1.u64],
24
+ ['keeperFee', solana_1.u64],
25
+ ], (args) => args);
26
+ exports.marginMarketStruct = new beet_1.FixableBeetStruct([
27
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
28
+ ['pubkey', beet_solana_1.publicKey],
29
+ ['mint', beet_solana_1.publicKey],
30
+ ], (args) => args);
31
+ exports.ammPoolRewardInfoStruct = new beet_1.BeetStruct([
32
+ ['mint', beet_solana_1.publicKey],
33
+ ['vault', beet_solana_1.publicKey],
34
+ ['authority', beet_solana_1.publicKey],
35
+ ['emissionsPerSecondX64', solana_1.u128],
36
+ ['growthGlobalX64', solana_1.u128],
37
+ ], (args) => args);
38
+ exports.ammpoolStruct = new beet_1.BeetStruct([
39
+ ['ammpoolsConfig', beet_solana_1.publicKey],
40
+ ['liquidity', solana_1.u128],
41
+ ['sqrtPrice', solana_1.u128],
42
+ ['protocolFeeOwedA', solana_1.u64],
43
+ ['protocolFeeOwedB', solana_1.u64],
44
+ ['tokenMintBase', beet_solana_1.publicKey],
45
+ ['tokenVaultBase', beet_solana_1.publicKey],
46
+ ['feeGrowthGlobalA', solana_1.u128],
47
+ ['tokenMintQuote', beet_solana_1.publicKey],
48
+ ['tokenVaultQuote', beet_solana_1.publicKey],
49
+ ['feeGrowthGlobalB', solana_1.u128],
50
+ ['rewardLastUpdatedTimestamp', solana_1.u64],
51
+ ['rewardInfos', (0, beet_1.uniformFixedSizeArray)(exports.ammPoolRewardInfoStruct, 3)],
52
+ ['oracle', beet_solana_1.publicKey],
53
+ ['tickCurrentIndex', beet_1.i32],
54
+ ['observationIndex', beet_1.u16],
55
+ ['observationUpdateDuration', beet_1.u16],
56
+ ['tickSpacing', beet_1.u16],
57
+ ['tickSpacingSeed', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 2)],
58
+ ['feeRate', beet_1.u16],
59
+ ['protocolFeeRate', beet_1.u16],
60
+ ], (args) => args);
61
+ var MarginType;
62
+ (function (MarginType) {
63
+ MarginType[MarginType["NonYieldBearing"] = 0] = "NonYieldBearing";
64
+ MarginType[MarginType["YieldBearing"] = 1] = "YieldBearing";
65
+ })(MarginType || (exports.MarginType = MarginType = {}));
66
+ exports.yieldMarketStruct = new beet_1.FixableBeetStruct([
67
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
68
+ ['pubkey', beet_solana_1.publicKey],
69
+ ['oracle', beet_solana_1.publicKey],
70
+ ['name', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
71
+ ['quoteAssetVault', beet_solana_1.publicKey],
72
+ ['baseAssetVault', beet_solana_1.publicKey],
73
+ ['pool', exports.ammpoolStruct],
74
+ ['startTs', solana_1.i64],
75
+ ['expireTs', solana_1.i64],
76
+ ['orderStepSize', solana_1.u64],
77
+ ['minOrderSize', solana_1.u64],
78
+ ['minLpAmount', solana_1.u64],
79
+ ['minLiquidationSize', solana_1.u64],
80
+ ['marketIndex', beet_1.u32],
81
+ ['marginIndex', beet_1.u32],
82
+ ['lpMarginIndex', beet_1.u32],
83
+ ['marginType', beet_1.u8],
84
+ ['lpMarginType', beet_1.u8],
85
+ ['marginDecimals', beet_1.u8],
86
+ ['lpMarginDecimals', beet_1.u8],
87
+ ], (args) => args);
88
+ exports.oracleStruct = new beet_1.FixableBeetStruct([
89
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
90
+ ['admin', beet_solana_1.publicKey],
91
+ ['name', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
92
+ ['lastRate', solana_1.u64],
93
+ ['rate', solana_1.u64],
94
+ ['marketRate', solana_1.u64],
95
+ ['ts', solana_1.i64],
96
+ ['decimals', beet_1.u32],
97
+ ['padding', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 4)],
98
+ ['epochStartTimestamp', solana_1.i64],
99
+ ['lastEpochStartTimestamp', solana_1.i64],
100
+ ['padding1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
101
+ ], (args) => args);
102
+ exports.yieldPositionStruct = new beet_1.BeetStruct([
103
+ ['baseAssetAmount', solana_1.i64],
104
+ ['quoteAssetAmount', solana_1.i64],
105
+ ['lastRate', solana_1.u64],
106
+ ['marketIndex', beet_1.u32],
107
+ ['padding1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 4)],
108
+ ['padding2', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
109
+ ], (args) => args);
110
+ var OrderStatus;
111
+ (function (OrderStatus) {
112
+ OrderStatus[OrderStatus["Init"] = 0] = "Init";
113
+ OrderStatus[OrderStatus["Open"] = 1] = "Open";
114
+ OrderStatus[OrderStatus["Filled"] = 2] = "Filled";
115
+ OrderStatus[OrderStatus["Canceled"] = 3] = "Canceled";
116
+ })(OrderStatus || (exports.OrderStatus = OrderStatus = {}));
117
+ var OrderType;
118
+ (function (OrderType) {
119
+ OrderType[OrderType["Market"] = 0] = "Market";
120
+ OrderType[OrderType["Limit"] = 1] = "Limit";
121
+ })(OrderType || (exports.OrderType = OrderType = {}));
122
+ exports.orderStruct = new beet_1.BeetStruct([
123
+ ['slot', solana_1.u64],
124
+ ['priceLimit', solana_1.u128],
125
+ ['baseAssetAmount', solana_1.i64],
126
+ ['baseAssetAmountFilled', solana_1.i64],
127
+ ['quoteAssetAmountFilled', solana_1.i64],
128
+ ['expireTs', solana_1.i64],
129
+ ['orderIndex', beet_1.u32],
130
+ ['orderId', beet_1.u32],
131
+ ['isolatedMarginAmount', solana_1.u64],
132
+ ['marketIndex', beet_1.u32],
133
+ ['status', beet_1.u8],
134
+ ['orderType', beet_1.u8],
135
+ ['isClose', beet_1.bool],
136
+ ['padding1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 1)],
137
+ ['padding2', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
138
+ ], (args) => args);
139
+ exports.marginPositionStruct = new beet_1.BeetStruct([
140
+ ['balance', solana_1.i64],
141
+ ['marketIndex', beet_1.u32],
142
+ ['decimals', beet_1.u32],
143
+ ['padding2', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
144
+ ], (args) => args);
145
+ exports.userStruct = new beet_1.FixableBeetStruct([
146
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
147
+ ['authority', beet_solana_1.publicKey],
148
+ ['marginPositions', (0, beet_1.uniformFixedSizeArray)(exports.marginPositionStruct, 2)],
149
+ ['orders', (0, beet_1.uniformFixedSizeArray)(exports.orderStruct, 32)],
150
+ ['yieldPositions', (0, beet_1.uniformFixedSizeArray)(exports.yieldPositionStruct, 8)],
151
+ ['lastActiveSlot', solana_1.u64],
152
+ ['lastOrderId', beet_1.u32],
153
+ ['subAccountId', beet_1.u16],
154
+ ['idle', beet_1.bool],
155
+ ['padding2', beet_1.bool],
156
+ ['isIsolated', beet_1.bool],
157
+ ['isExpiryOn', beet_1.bool],
158
+ ['padding1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 6)],
159
+ ], (args) => args);
160
+ exports.userStatsStruct = new beet_1.BeetStruct([
161
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
162
+ ['authority', beet_solana_1.publicKey],
163
+ ['referrer', beet_solana_1.publicKey],
164
+ ['numberOfSubAccounts', beet_1.u16],
165
+ ['numberOfSubAccountsCreated', beet_1.u16],
166
+ ['padding', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 52)],
167
+ ], (args) => args);
168
+ exports.positionrewardinfoStruct = new beet_1.BeetStruct([
169
+ ['growthInsideCheckpoint', solana_1.u128],
170
+ ['amountOwed', solana_1.u64],
171
+ ], (args) => args);
172
+ exports.positionStruct = new beet_1.BeetStruct([
173
+ ['ammpool', beet_solana_1.publicKey],
174
+ ['liquidity', solana_1.u128],
175
+ ['tickLowerIndex', beet_1.i32],
176
+ ['tickUpperIndex', beet_1.i32],
177
+ ['lowerRate', solana_1.u64],
178
+ ['upperRate', solana_1.u64],
179
+ ['feeGrowthCheckpointA', solana_1.u128],
180
+ ['feeOwedA', solana_1.u64],
181
+ ['feeGrowthCheckpointB', solana_1.u128],
182
+ ['feeOwedB', solana_1.u64],
183
+ ['rewardInfos', (0, beet_1.uniformFixedSizeArray)(exports.positionrewardinfoStruct, 3)],
184
+ ], (args) => args);
185
+ var LpStatus;
186
+ (function (LpStatus) {
187
+ LpStatus[LpStatus["Active"] = 0] = "Active";
188
+ LpStatus[LpStatus["Updating"] = 1] = "Updating";
189
+ })(LpStatus || (exports.LpStatus = LpStatus = {}));
190
+ exports.lpStruct = new beet_1.BeetStruct([
191
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
192
+ ['authority', beet_solana_1.publicKey],
193
+ ['ammPosition', exports.positionStruct],
194
+ ['reserveQuoteAmount', solana_1.i64],
195
+ ['reserveBaseAmount', solana_1.i64],
196
+ ['lastActiveSlot', solana_1.u64],
197
+ ['subAccountId', beet_1.u16],
198
+ ['idle', beet_1.bool],
199
+ ['state', beet_1.u8],
200
+ ['padding1', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 7)],
201
+ ['padding2', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 72)],
202
+ ], (args) => args);
203
+ //# sourceMappingURL=structs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/ratex/structs.ts"],"names":[],"mappings":";;;AAEA,oDASmC;AACnC,kEAA6D;AAC7D,+CAAoD;AAsBvC,QAAA,WAAW,GAAG,IAAI,wBAAiB,CAC9C;IACE,CAAC,sBAAsB,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,QAAQ,EAAE,uBAAS,CAAC;IACrB,CAAC,qBAAqB,EAAE,YAAG,CAAC;IAC5B,CAAC,qBAAqB,EAAE,YAAG,CAAC;IAC5B,CAAC,wBAAwB,EAAE,YAAG,CAAC;IAC/B,CAAC,4BAA4B,EAAE,YAAG,CAAC;IACnC,CAAC,iCAAiC,EAAE,YAAG,CAAC;IACxC,CAAC,sBAAsB,EAAE,UAAG,CA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CAAY,CAAA;AACd,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB;AAgBY,QAAA,QAAQ,GAAG,IAAI,iBAAU,CACpC;IACE,CAAC,sBAAsB,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,aAAa,EAAE,sBAAc,CAAC;IAC/B,CAAC,oBAAoB,EAAE,YAAG,CAAC;IAC3B,CAAC,mBAAmB,EAAE,YAAG,CAAC;IAC1B,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,cAAc,EAAE,UAAG,CAAC;IACrB,CAAC,MAAM,EAAE,WAAI,CAAC;IACd,CAAC,OAAO,EAAE,SAAE,CAAC;IACb,CAAC,UAAU,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IAC1C,CAAC,UAAU,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,EAAE,CAAC,CAAC;CAC5C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAU,CACrB,CAAC"}
@@ -1,83 +1,9 @@
1
- export type State = {
2
- marketIndexStart: number;
3
- };
4
- export type MarginMarket = {
5
- pubkey: string;
6
- mint: string;
7
- };
1
+ import BigNumber from 'bignumber.js';
2
+ import { YieldMarket } from './structs';
8
3
  export type Program = {
9
4
  programId: string;
10
5
  mint: string;
11
6
  };
12
- export type UserStats = {
13
- numberOfSubAccountsCreated: number;
14
- };
15
- export type User = {
16
- marginPositions: MarginPosition[];
17
- };
18
- export type MarginPosition = {
19
- balance: number;
20
- marketIndex: number;
21
- decimals: number;
22
- };
23
- export type LP = {
24
- ammPosition: AmmPosition;
25
- reserveQuoteAmount: number;
26
- reserveBaseAmount: number;
27
- };
28
- export type AmmPosition = {
29
- ammpool: string;
30
- liquidity: number;
31
- tickLowerIndex: number;
32
- tickUpperIndex: number;
33
- lowerRate: number;
34
- upperRate: number;
35
- feeGrowthCheckpointA: number;
36
- feeOwedA: number;
37
- feeGrowthCheckpointB: number;
38
- feeOwedB: number;
39
- };
40
- export type YieldMarket = {
41
- pubkey: string;
42
- oracle: string;
43
- pool: Ammpool;
44
- lpMarginIndex: number;
45
- lpMarginDecimals: number;
46
- };
47
- export type AmmpoolRewardInfo = {
48
- mint: string;
49
- vault: string;
50
- authority: string;
51
- emissionsPerSecondX64: number;
52
- growthGlobalX64: number;
53
- };
54
- export type Ammpool = {
55
- ammpoolsConfig: string;
56
- liquidity: number;
57
- sqrtPrice: number;
58
- protocolFeeOwedA: number;
59
- protocolFeeOwedB: number;
60
- tokenMintBase: string;
61
- tokenVaultBase: string;
62
- feeGrowthGlobalA: number;
63
- tokenMintQuote: string;
64
- tokenVaultQuote: string;
65
- feeGrowthGlobalB: number;
66
- rewardLastUpdatedTimestamp: number;
67
- rewardInfos: AmmpoolRewardInfo[];
68
- oracle: string;
69
- tickCurrentIndex: number;
70
- observationIndex: number;
71
- observationUpdateDuration: number;
72
- tickSpacing: number;
73
- tickSpacingSeed: number[];
74
- feeRate: number;
75
- protocolFeeRate: number;
76
- };
77
- export type Oracle = {
78
- rate: number;
79
- };
80
- export type YieldMarketWithOracle = YieldMarket & Oracle;
81
7
  export type PtToken = {
82
8
  pt_mint: string;
83
9
  pt_price: number;
@@ -85,3 +11,6 @@ export type PtToken = {
85
11
  pt_yield: number;
86
12
  security_id: string;
87
13
  };
14
+ export type YieldMarketWithOracle = YieldMarket & {
15
+ rate: BigNumber;
16
+ };
@@ -2,7 +2,6 @@
2
2
  /// <reference types="jito-ts/node_modules/@solana/web3.js" />
3
3
  import { PublicKey } from '@solana/web3.js';
4
4
  import { Platform } from '@sonarwatch/portfolio-core';
5
- import { IdlItem } from '@solanafm/explorer-kit-idls';
6
5
  import { AirdropStatics } from '../../AirdropFetcher';
7
6
  export declare const zexMint = "ZEXy1pqteRu3n13kdyh4LwPQknkFk3GzmMYMuNadWPo";
8
7
  export declare const platformId = "zeta";
@@ -14,4 +13,3 @@ export declare const zexDecimals = 6;
14
13
  export declare const distributorPid = "4JSALTb4QbipG7NNLryAFJg4y8X5C1ELErSncsVMA3gZ";
15
14
  export declare const distributors: string[];
16
15
  export declare const stakingPid: PublicKey;
17
- export declare const zetaIdlItem: IdlItem;
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zetaIdlItem = exports.stakingPid = exports.distributors = exports.distributorPid = exports.zexDecimals = exports.airdropStatics = exports.graphqlApi = exports.programId = exports.platform = exports.platformId = exports.zexMint = void 0;
3
+ exports.stakingPid = exports.distributors = exports.distributorPid = exports.zexDecimals = exports.airdropStatics = exports.graphqlApi = exports.programId = exports.platform = exports.platformId = exports.zexMint = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
- const idls_1 = require("./idls");
6
5
  exports.zexMint = 'ZEXy1pqteRu3n13kdyh4LwPQknkFk3GzmMYMuNadWPo';
7
6
  exports.platformId = 'zeta';
8
7
  exports.platform = {
@@ -70,9 +69,4 @@ exports.distributors = [
70
69
  '6o1ZexNBJnQCDXiWtJgDPkE4u5WndgUb1wKDjofRuWme',
71
70
  ];
72
71
  exports.stakingPid = new web3_js_1.PublicKey('4DUapvWZDDCkfWJpdwvX2QjwAE9Yq4wU8792RMMv7Csg');
73
- exports.zetaIdlItem = {
74
- programId: exports.stakingPid.toString(),
75
- idl: idls_1.idls,
76
- idlType: 'anchor',
77
- };
78
72
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG5C,iCAA+C;AAGlC,QAAA,OAAO,GAAG,6CAA6C,CAAC;AACxD,QAAA,UAAU,GAAG,MAAM,CAAC;AACpB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EACH,0EAA0E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/C,CAAC;AAEW,QAAA,UAAU,GAAG,IAAI,mBAAS,CACrC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,WAAW,GAAG;IACzB,SAAS,EAAE,kBAAU,CAAC,QAAQ,EAAE;IAChC,GAAG,EAAE,WAAa;IAClB,OAAO,EAAE,QAAQ;CACP,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAI/B,QAAA,OAAO,GAAG,6CAA6C,CAAC;AACxD,QAAA,UAAU,GAAG,MAAM,CAAC;AACpB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EACH,0EAA0E;IAC5E,WAAW,EAAE,MAAM;IACnB,OAAO,EAAE,2BAA2B;IACpC,OAAO,EAAE,2BAA2B;IACpC,aAAa,EAAE,4BAA4B;IAC3C,MAAM,EAAE,CAAC,eAAO,CAAC;IACjB,QAAQ,EAAE,8BAA8B;IACxC,OAAO,EAAE,+BAA+B;IACxC,MAAM,EAAE,gCAAgC;IACxC,WAAW,EAAE,6DAA6D;CAC3E,CAAC;AAEW,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,6CAA6C,CAC9C,CAAC;AACW,QAAA,UAAU,GAAG,sCAAsC,CAAC;AAEpD,QAAA,cAAc,GAAmB;IAC5C,SAAS,EAAE,6BAA6B;IACxC,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE,MAAM;IACnB,EAAE,EAAE,cAAc;IAClB,KAAK,EACH,0EAA0E;IAC5E,UAAU,EAAE,aAAa;IACzB,QAAQ,EAAE,aAAa;CACxB,CAAC;AAEW,QAAA,WAAW,GAAG,CAAC,CAAC;AAChB,QAAA,cAAc,GAAG,8CAA8C,CAAC;AAChE,QAAA,YAAY,GAAG;IAC1B,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,6CAA6C;IAC7C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;CAC/C,CAAC;AAEW,QAAA,UAAU,GAAG,IAAI,mBAAS,CACrC,8CAA8C,CAC/C,CAAC"}
@@ -19,6 +19,7 @@ const clients_1 = require("../../utils/clients");
19
19
  const helpers_1 = require("./helpers");
20
20
  const solana_1 = require("../../utils/solana");
21
21
  const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
22
+ const structs_1 = require("./structs");
22
23
  const networkId = portfolio_core_1.NetworkId.solana;
23
24
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
24
25
  const client = (0, clients_1.getClientSolana)();
@@ -27,10 +28,12 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
27
28
  const accounts = [];
28
29
  do {
29
30
  const stakeAccountsAddresses = (0, helpers_1.getStakeAccountsAddresses)(owner, index, index + step);
30
- const stakeAccounts = yield (0, solana_1.getAutoParsedMultipleAccountsInfo)(client, constants_1.zetaIdlItem, stakeAccountsAddresses);
31
+ const stakeAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, structs_1.stakeAccountStruct, stakeAccountsAddresses);
31
32
  index += step;
32
33
  accounts.push(...stakeAccounts);
33
34
  } while (!accounts.some((acc) => !acc));
35
+ if (!accounts.length)
36
+ return [];
34
37
  const registry = new ElementRegistry_1.ElementRegistry(networkId, constants_1.platformId);
35
38
  const stakingElement = registry.addElementMultiple({
36
39
  label: 'Staked',
@@ -42,8 +45,8 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
42
45
  const name = (0, solana_1.u8ArrayToString)(account.name);
43
46
  const amount = new bignumber_js_1.default(account.amountStillStaked).toNumber();
44
47
  const attributes = {
45
- lockedUntil: account.stakeState.vesting
46
- ? (0, helpers_1.getTimestamp)(account.stakeDurationEpochs, account.stakeState.vesting.stakeStartEpoch)
48
+ lockedUntil: account.stakeState.__kind === 'Vesting'
49
+ ? (0, helpers_1.getTimestamp)(account.stakeDurationEpochs, account.stakeState.stakeStartEpoch)
47
50
  : -1,
48
51
  tags: [name],
49
52
  };
@@ -1 +1 @@
1
- {"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAGoC;AACpC,gEAAqC;AAGrC,2CAA+D;AAC/D,iDAAsD;AACtD,uCAAoE;AACpE,+CAG4B;AAE5B,gFAA6E;AAE7E,MAAM,SAAS,GAAG,0BAAS,CAAC,MAAM,CAAC;AAEnC,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,IAAI,GAAG,CAAC,CAAC;IACf,MAAM,QAAQ,GAAG,EAAE,CAAC;IAEpB,GAAG,CAAC;QACF,MAAM,sBAAsB,GAAG,IAAA,mCAAyB,EACtD,KAAK,EACL,KAAK,EACL,KAAK,GAAG,IAAI,CACb,CAAC;QACF,MAAM,aAAa,GAAG,MAAM,IAAA,0CAAiC,EAC3D,MAAM,EACN,uBAAW,EACX,sBAAsB,CACvB,CAAC;QAEF,KAAK,IAAI,IA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CAAC;QAC/B,IAAI,CAAC,OAAO;YAAE,SAAS;QACvB,MAAM,IAAI,GAAG,IAAA,wBAAe,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAE3C,MAAM,MAAM,GAAG,IAAI,sBAAS,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,QAAQ,EAAE,CAAC;QAEnE,MAAM,UAAU,GAA6B;YAC3C,WAAW,EACT,OAAO,CAAC,UAAU,CAAC,MAAM,KAAK,SAAS;gBACrC,CAAC,CAAC,IAAA,sBAAY,EACV,OAAO,CAAC,mBAAmB,EAC3B,OAAO,CAAC,UAAU,CAAC,eAAe,CACnC;gBACH,CAAC,CAAC,CAAC,CAAC;YACR,IAAI,EAAE,CAAC,IAAI,CAAC;SACb,CAAC;QAEF,cAAc,CAAC,QAAQ,CAAC;YACtB,OAAO,EAAE,mBAAO;YAChB,MAAM;YACN,UAAU;YACV,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE;SAC/B,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS;IACT,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
3
3
  /// <reference types="jito-ts/node_modules/@solana/web3.js" />
4
- import { BeetStruct, FixableBeetStruct } from '@metaplex-foundation/beet';
4
+ import { BeetStruct, FixableBeetStruct, DataEnumKeyAsKind } from '@metaplex-foundation/beet';
5
5
  import { PublicKey } from '@solana/web3.js';
6
6
  import BigNumber from 'bignumber.js';
7
7
  export declare enum MarginAccountType {
@@ -57,3 +57,26 @@ export type ClaimStatus = {
57
57
  claimedAmount: BigNumber;
58
58
  };
59
59
  export declare const claimStatusStruct: BeetStruct<ClaimStatus, Partial<ClaimStatus>>;
60
+ type StakeStateRecord = {
61
+ Uninitialized: NonNullable<unknown>;
62
+ Vesting: {
63
+ stakeStartEpoch: number;
64
+ lastClaimTs: BigNumber;
65
+ };
66
+ Locked: NonNullable<unknown>;
67
+ };
68
+ type StakeState = DataEnumKeyAsKind<StakeStateRecord>;
69
+ export type StakeAccount = {
70
+ accountDiscriminator: number[];
71
+ name: number[];
72
+ vaultNonce: number;
73
+ bitInUse: number;
74
+ stakeState: StakeState;
75
+ initialStakeAmount: BigNumber;
76
+ amountStillStaked: BigNumber;
77
+ amountClaimed: BigNumber;
78
+ stakeDurationEpochs: number;
79
+ authority: PublicKey;
80
+ };
81
+ export declare const stakeAccountStruct: FixableBeetStruct<StakeAccount, Partial<StakeAccount>>;
82
+ export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.claimStatusStruct = exports.crossMarginAccountStruct = exports.productLedgerStruct = exports.orderStateStruct = exports.positionStruct = exports.anchorDecimalStruct = exports.MarginAccountType = void 0;
3
+ exports.stakeAccountStruct = exports.claimStatusStruct = exports.crossMarginAccountStruct = exports.productLedgerStruct = exports.orderStateStruct = exports.positionStruct = exports.anchorDecimalStruct = exports.MarginAccountType = 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");
@@ -55,4 +55,33 @@ exports.claimStatusStruct = new beet_1.BeetStruct([
55
55
  ['claimedAt', solana_1.u64],
56
56
  ['claimedAmount', solana_1.u64],
57
57
  ], (args) => args);
58
+ const stakeStateStruct = (0, beet_1.dataEnum)([
59
+ [
60
+ 'Uninitialized',
61
+ new beet_1.FixableBeetArgsStruct([], 'StakeStateRecord["Uninitialized"]'),
62
+ ],
63
+ [
64
+ 'Vesting',
65
+ new beet_1.FixableBeetArgsStruct([
66
+ ['stakeStartEpoch', beet_1.u32],
67
+ ['lastClaimTs', solana_1.u64],
68
+ ], 'StakeStateRecord["Vesting"]'),
69
+ ],
70
+ [
71
+ 'Locked',
72
+ new beet_1.FixableBeetArgsStruct([], 'StakeStateRecord["Locked"]'),
73
+ ],
74
+ ]);
75
+ exports.stakeAccountStruct = new beet_1.FixableBeetStruct([
76
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
77
+ ['name', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 10)],
78
+ ['vaultNonce', beet_1.u8],
79
+ ['bitInUse', beet_1.u8],
80
+ ['stakeState', stakeStateStruct],
81
+ ['initialStakeAmount', solana_1.u64],
82
+ ['amountStillStaked', solana_1.u64],
83
+ ['amountClaimed', solana_1.u64],
84
+ ['stakeDurationEpochs', beet_1.u32],
85
+ ['authority', beet_solana_1.publicKey], // 49
86
+ ], (args) => args);
58
87
  //# sourceMappingURL=structs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/structs.ts"],"names":[],"mappings":";;;AAAA,oDAOmC;AACnC,kEAA6D;AAG7D,+CAAoD;AAEpD,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,6DAAM,CAAA;IACN,uEAAW,CAAA;AACb,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B;AAQY,QAAA,mBAAmB,GAAG,IAAI,iBAAU,CAC/C;IACE,CAAC,OAAO,EAAE,UAAG,CAAC;IACd,CAAC,IAAI,EAAE,UAAG,CAAC;IACX,CAAC,IAAI,EAAE,UAAG,CAAC;IACX,CAAC,KAAK,EAAE,UAAG,CAAC;CACb,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAqB,CAChC,CAAC;AAMW,QAAA,cAAc,GAAG,IAAI,iBAAU,CAC1C;IACE,CAAC,MAAM,EAAE,YAAG,CAAC;IACb,CAAC,cAAc,EAAE,YAAG,CAAC;CACtB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,EAAE,CAAC,CAAC,CAAC;IACjE,CAAC,uBAAuB,EAAE,IAAA,4BAAqB,EAAC,2BAAmB,EAAE,EAAE,CAAC,CAAC;IACzE,CAAC,SAAS,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,IAAI,CAAC,CAAC;CAC7C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAA0B,CACrC,CAAC;AASS,QAAA,iBAAiB,GAAG,IAAI,iBAAU,CAC7C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,UAAU,EAAE,uBAAS,CAAC;IACvB,CAAC,WAAW,EAAE,YAAG,CAAC;IAClB,CAAC,eAAe,EAAE,YAAG,CAAC;CACvB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAmB,CAC9B,CAAC"}
1
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/structs.ts"],"names":[],"mappings":";;;AAAA,oDAWmC;AACnC,kEAA6D;AAG7D,+CAAoD;AAEpD,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,6DAAM,CAAA;IACN,uEAAW,CAAA;AACb,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B;AAQY,QAAA,mBAAmB,GAAG,IAAI,iBAAU,CAC/C;IACE,CAAC,OAAO,EAAE,UAAG,CAAC;IACd,CAAC,IAAI,EAAE,UAAG,CAAC;IACX,CAAC,IAAI,EAAE,UAAG,CAAC;IACX,CAAC,KAAK,EAAE,UAAG,CAAC;CACb,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAqB,CAChC,CAAC;AAMW,QAAA,cAAc,GAAG,IAAI,iBAAU,CAC1C;IACE,CAAC,MAAM,EAAE,YAAG,CAAC;IACb,CAAC,cAAc,EAAE,YAAG,CAAC;CACtB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAgB,CAC3B,CAAC;AAOW,QAAA,gBAAgB,GAAG,I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,EAAE,UAAG,CAAC;IAC5B,CAAC,WAAW,EAAE,uBAAS,CAAC,EAAE,KAAK;CAChC,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAoB,CAC/B,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  export type GQLResponse = {
3
2
  getAirdropFinalFrontend: GetAirdropFinalFrontend;
4
3
  };
@@ -13,28 +12,3 @@ export type GetAirdropFinalFrontend = {
13
12
  total_allocation: number;
14
13
  __typename: string;
15
14
  };
16
- export declare enum StakeStateName {
17
- Uninitialized = 0,
18
- Vesting = 1,
19
- Locked = 2
20
- }
21
- export type StakeState = {
22
- vesting?: {
23
- lastClaimTs: string;
24
- stakeStartEpoch: number;
25
- };
26
- locked?: null;
27
- uninitialized?: null;
28
- };
29
- export type StakeAccount = {
30
- buffer: Buffer;
31
- name: number[];
32
- vaultNonce: number;
33
- bitInUse: number;
34
- stakeState: StakeState;
35
- initialStakeAmount: string;
36
- amountStillStaked: string;
37
- amountClaimed: string;
38
- stakeDurationEpochs: number;
39
- authority: string;
40
- };
@@ -1,10 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StakeStateName = void 0;
4
- var StakeStateName;
5
- (function (StakeStateName) {
6
- StakeStateName[StakeStateName["Uninitialized"] = 0] = "Uninitialized";
7
- StakeStateName[StakeStateName["Vesting"] = 1] = "Vesting";
8
- StakeStateName[StakeStateName["Locked"] = 2] = "Locked";
9
- })(StakeStateName || (exports.StakeStateName = StakeStateName = {}));
10
3
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/types.ts"],"names":[],"mappings":";;;AAgBA,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,qEAAa,CAAA;IACb,yDAAO,CAAA;IACP,uDAAM,CAAA;AACR,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/types.ts"],"names":[],"mappings":""}