@exponent-labs/exponent-types 0.9.11 → 0.9.13
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/build/cpi.js +2 -3
- package/build/cpi.js.map +1 -1
- package/build/generic.d.ts +75 -39
- package/build/generic.js +80 -40
- package/build/generic.js.map +1 -1
- package/build/jito-restaking.d.ts +7 -1
- package/build/jito-restaking.js +3 -2
- package/build/jito-restaking.js.map +1 -1
- package/build/kamino.d.ts +8 -2
- package/build/marginfi.d.ts +10 -8
- package/build/perena.d.ts +8 -2
- package/build/perena.js +3 -2
- package/build/perena.js.map +1 -1
- package/package.json +1 -1
- package/src/generic.ts +150 -59
- package/src/jito-restaking.ts +8 -0
- package/src/kamino.ts +10 -4
- package/src/marginfi.ts +12 -5
- package/src/perena.ts +13 -3
package/build/cpi.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.deserializeCpiAccountsRaw = deserializeCpiAccountsRaw;
|
|
4
|
+
exports.serializeCpiAccountsRaw = serializeCpiAccountsRaw;
|
|
4
5
|
const web3_js_1 = require("@solana/web3.js");
|
|
5
6
|
function deserializeCpiAccountsRaw(serialized) {
|
|
6
7
|
const deserializeAccountInfo = (accountInfo) => ({
|
|
@@ -16,7 +17,6 @@ function deserializeCpiAccountsRaw(serialized) {
|
|
|
16
17
|
getPositionState: serialized.getPositionState.map(deserializeAccountInfo),
|
|
17
18
|
};
|
|
18
19
|
}
|
|
19
|
-
exports.deserializeCpiAccountsRaw = deserializeCpiAccountsRaw;
|
|
20
20
|
function serializeCpiAccountsRaw(cpiAccounts) {
|
|
21
21
|
const serializeAccountInfo = (accountInfo) => ({
|
|
22
22
|
pubkey: accountInfo.pubkey.toString(),
|
|
@@ -31,5 +31,4 @@ function serializeCpiAccountsRaw(cpiAccounts) {
|
|
|
31
31
|
getPositionState: cpiAccounts.getPositionState.map(serializeAccountInfo),
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
exports.serializeCpiAccountsRaw = serializeCpiAccountsRaw;
|
|
35
34
|
//# sourceMappingURL=cpi.js.map
|
package/build/cpi.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cpi.js","sourceRoot":"","sources":["../src/cpi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cpi.js","sourceRoot":"","sources":["../src/cpi.ts"],"names":[],"mappings":";;AAoEA,8DAaC;AAED,0DAcC;AAjGD,6CAA2C;AAoE3C,SAAgB,yBAAyB,CAAC,UAA8B;IACtE,MAAM,sBAAsB,GAAG,CAAC,WAA4B,EAAe,EAAE,CAAC,CAAC;QAC7E,MAAM,EAAE,IAAI,mBAAS,CAAC,WAAW,CAAC,MAAM,CAAC;QACzC,QAAQ,EAAE,WAAW,CAAC,QAAQ;QAC9B,UAAU,EAAE,WAAW,CAAC,UAAU;KACnC,CAAC,CAAA;IACF,OAAO;QACL,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,sBAAsB,CAAC;QAC7D,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,sBAAsB,CAAC;QAC7D,SAAS,EAAE,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,sBAAsB,CAAC;QAC3D,aAAa,EAAE,UAAU,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;QAC/F,gBAAgB,EAAE,UAAU,CAAC,gBAAgB,CAAC,GAAG,CAAC,sBAAsB,CAAC;KAC1E,CAAA;AACH,CAAC;AAED,SAAgB,uBAAuB,CAAC,WAA2B;IACjE,MAAM,oBAAoB,GAAG,CAAC,WAAwB,EAAE,EAAE,CAAC,CAAC;QAC1D,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,QAAQ,EAAE;QACrC,QAAQ,EAAE,WAAW,CAAC,QAAQ;QAC9B,UAAU,EAAE,WAAW,CAAC,UAAU;KACnC,CAAC,CAAA;IAEF,OAAO;QACL,UAAU,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,oBAAoB,CAAC;QAC5D,UAAU,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,oBAAoB,CAAC;QAC5D,SAAS,EAAE,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,oBAAoB,CAAC;QAC1D,aAAa,EAAE,WAAW,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QAC9F,gBAAgB,EAAE,WAAW,CAAC,gBAAgB,CAAC,GAAG,CAAC,oBAAoB,CAAC;KACzE,CAAA;AACH,CAAC"}
|
package/build/generic.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import { PublicKey } from "@solana/web3.js";
|
|
4
|
-
import { AnchorizedPNum, SyEmissionJson, SyEmissionRaw } from "./common";
|
|
1
|
+
import { BN, web3 } from "@coral-xyz/anchor";
|
|
5
2
|
import { StakePoolAccount } from "@solana/spl-stake-pool";
|
|
6
|
-
import
|
|
3
|
+
import { AnchorizedPNum, AnchorizedPNumJson, SyEmissionJson, SyEmissionRaw } from "./common";
|
|
7
4
|
export type InterfaceTypeGeneric = {
|
|
8
5
|
pyth: {
|
|
9
6
|
lastSlot: BN;
|
|
@@ -56,6 +53,24 @@ export type InterfaceTypeGeneric = {
|
|
|
56
53
|
chainlink: {
|
|
57
54
|
padding: number[];
|
|
58
55
|
};
|
|
56
|
+
} | {
|
|
57
|
+
chainlinkDataStream: {
|
|
58
|
+
feedHash: number[];
|
|
59
|
+
lastStreamedExchangeRate: AnchorizedPNum;
|
|
60
|
+
decimals: number;
|
|
61
|
+
lastSlot: BN;
|
|
62
|
+
lastStreamedTimestamp: number;
|
|
63
|
+
freshnessWindowSeconds: number;
|
|
64
|
+
};
|
|
65
|
+
} | {
|
|
66
|
+
scope: {
|
|
67
|
+
priceChain: number[];
|
|
68
|
+
maximumAgeSeconds: BN;
|
|
69
|
+
};
|
|
70
|
+
} | {
|
|
71
|
+
solsticeGlamVault: {
|
|
72
|
+
padding: number[];
|
|
73
|
+
};
|
|
59
74
|
};
|
|
60
75
|
export type InterfaceTypeGenericJson = {
|
|
61
76
|
pyth: {
|
|
@@ -109,39 +124,57 @@ export type InterfaceTypeGenericJson = {
|
|
|
109
124
|
chainlink: {
|
|
110
125
|
padding: number[];
|
|
111
126
|
};
|
|
127
|
+
} | {
|
|
128
|
+
chainlinkDataStream: {
|
|
129
|
+
feedHash: number[];
|
|
130
|
+
lastStreamedExchangeRate: AnchorizedPNumJson;
|
|
131
|
+
decimals: number;
|
|
132
|
+
lastSlot: string;
|
|
133
|
+
lastStreamedTimestamp: number;
|
|
134
|
+
freshnessWindowSeconds: number;
|
|
135
|
+
};
|
|
136
|
+
} | {
|
|
137
|
+
scope: {
|
|
138
|
+
priceChain: number[];
|
|
139
|
+
maximumAgeSeconds: string;
|
|
140
|
+
};
|
|
141
|
+
} | {
|
|
142
|
+
solsticeGlamVault: {
|
|
143
|
+
padding: number[];
|
|
144
|
+
};
|
|
112
145
|
};
|
|
113
146
|
/** Additional data that different interface types may need */
|
|
114
147
|
export interface AdditionalDataGeneric {
|
|
115
148
|
fragmetricData?: {
|
|
116
|
-
receiptTokenMint: PublicKey;
|
|
117
|
-
wrappedTokenMint: PublicKey;
|
|
149
|
+
receiptTokenMint: web3.PublicKey;
|
|
150
|
+
wrappedTokenMint: web3.PublicKey;
|
|
118
151
|
};
|
|
119
152
|
jupiterLendData?: {
|
|
120
|
-
baseTokenMint: PublicKey;
|
|
121
|
-
tokenReservesLiquidity: PublicKey;
|
|
122
|
-
lendingSupplyPosition: PublicKey;
|
|
123
|
-
rewardsRateModel: PublicKey;
|
|
124
|
-
rateModel: PublicKey;
|
|
153
|
+
baseTokenMint: web3.PublicKey;
|
|
154
|
+
tokenReservesLiquidity: web3.PublicKey;
|
|
155
|
+
lendingSupplyPosition: web3.PublicKey;
|
|
156
|
+
rewardsRateModel: web3.PublicKey;
|
|
157
|
+
rateModel: web3.PublicKey;
|
|
125
158
|
};
|
|
126
159
|
kaminoVaultData?: {
|
|
127
|
-
vault: PublicKey;
|
|
160
|
+
vault: web3.PublicKey;
|
|
128
161
|
reserves: {
|
|
129
|
-
reserveAddress: PublicKey;
|
|
130
|
-
marketAddress: PublicKey;
|
|
162
|
+
reserveAddress: web3.PublicKey;
|
|
163
|
+
marketAddress: web3.PublicKey;
|
|
131
164
|
}[];
|
|
132
|
-
tokenVault: PublicKey;
|
|
133
|
-
tokenMint: PublicKey;
|
|
134
|
-
baseVaultAuthority: PublicKey;
|
|
135
|
-
sharesMint: PublicKey;
|
|
165
|
+
tokenVault: web3.PublicKey;
|
|
166
|
+
tokenMint: web3.PublicKey;
|
|
167
|
+
baseVaultAuthority: web3.PublicKey;
|
|
168
|
+
sharesMint: web3.PublicKey;
|
|
136
169
|
};
|
|
137
170
|
splStakePoolData?: {
|
|
138
171
|
stakePoolAccount?: StakePoolAccount;
|
|
139
|
-
stakePoolAddress: PublicKey;
|
|
140
|
-
stakePoolProgramId: PublicKey;
|
|
141
|
-
validatorList: PublicKey;
|
|
142
|
-
reserveStake: PublicKey;
|
|
143
|
-
managerFeeAccount: PublicKey;
|
|
144
|
-
poolMint: PublicKey;
|
|
172
|
+
stakePoolAddress: web3.PublicKey;
|
|
173
|
+
stakePoolProgramId: web3.PublicKey;
|
|
174
|
+
validatorList: web3.PublicKey;
|
|
175
|
+
reserveStake: web3.PublicKey;
|
|
176
|
+
managerFeeAccount: web3.PublicKey;
|
|
177
|
+
poolMint: web3.PublicKey;
|
|
145
178
|
};
|
|
146
179
|
}
|
|
147
180
|
/** JSON version of additional data */
|
|
@@ -180,7 +213,7 @@ export interface AdditionalDataGenericJson {
|
|
|
180
213
|
export interface Hook {
|
|
181
214
|
enabled: boolean;
|
|
182
215
|
interfaceEmissionsAccountsUntil: number;
|
|
183
|
-
programId: PublicKey;
|
|
216
|
+
programId: web3.PublicKey;
|
|
184
217
|
preMintHookDiscriminator: number[];
|
|
185
218
|
postRedeemHookDiscriminator: number[];
|
|
186
219
|
}
|
|
@@ -196,12 +229,12 @@ export interface HookRaw {
|
|
|
196
229
|
interfaceEmissionsAccountsUntil: number;
|
|
197
230
|
preMintHookDiscriminator: Buffer;
|
|
198
231
|
postRedeemHookDiscriminator: Buffer;
|
|
199
|
-
programId: PublicKey;
|
|
232
|
+
programId: web3.PublicKey;
|
|
200
233
|
}
|
|
201
234
|
export interface GenericSyState {
|
|
202
|
-
selfAddress: PublicKey;
|
|
235
|
+
selfAddress: web3.PublicKey;
|
|
203
236
|
account: GenericSyMetaAccount;
|
|
204
|
-
tokenProgramBase: PublicKey;
|
|
237
|
+
tokenProgramBase: web3.PublicKey;
|
|
205
238
|
syRate: number;
|
|
206
239
|
additionalData?: AdditionalDataGeneric;
|
|
207
240
|
}
|
|
@@ -229,12 +262,13 @@ export interface GenericSyMetaAccountJson {
|
|
|
229
262
|
hook: HookJson;
|
|
230
263
|
emissions: SyEmissionJson[];
|
|
231
264
|
index: number;
|
|
265
|
+
lastSlotCached: string;
|
|
232
266
|
}
|
|
233
267
|
export interface GenericSyMetaAccount {
|
|
234
|
-
mintSy: PublicKey;
|
|
235
|
-
yieldBearingMint: PublicKey;
|
|
236
|
-
tokenSyEscrow: PublicKey;
|
|
237
|
-
interfaceAccounts: PublicKey[];
|
|
268
|
+
mintSy: web3.PublicKey;
|
|
269
|
+
yieldBearingMint: web3.PublicKey;
|
|
270
|
+
tokenSyEscrow: web3.PublicKey;
|
|
271
|
+
interfaceAccounts: web3.PublicKey[];
|
|
238
272
|
interfaceType: InterfaceTypeGeneric;
|
|
239
273
|
maxSySupply: BN;
|
|
240
274
|
minMintSize: BN;
|
|
@@ -242,20 +276,22 @@ export interface GenericSyMetaAccount {
|
|
|
242
276
|
hook: Hook;
|
|
243
277
|
emissions: SyEmissionRaw[];
|
|
244
278
|
index: AnchorizedPNum;
|
|
279
|
+
lastSlotCached: BN;
|
|
245
280
|
}
|
|
246
281
|
export interface GenericSyMetaAccountRaw {
|
|
247
|
-
mintSy: PublicKey;
|
|
248
|
-
yieldBearingMint: PublicKey;
|
|
249
|
-
tokenSyEscrow: PublicKey;
|
|
282
|
+
mintSy: web3.PublicKey;
|
|
283
|
+
yieldBearingMint: web3.PublicKey;
|
|
284
|
+
tokenSyEscrow: web3.PublicKey;
|
|
250
285
|
maxSySupply: BN;
|
|
251
286
|
minMintSize: BN;
|
|
252
287
|
minRedeemSize: BN;
|
|
253
288
|
selfAddressBump: number[];
|
|
254
289
|
emissions: SyEmissionRaw[];
|
|
255
|
-
interfaceAccounts: PublicKey[];
|
|
290
|
+
interfaceAccounts: web3.PublicKey[];
|
|
256
291
|
interfaceType: InterfaceTypeGeneric;
|
|
257
292
|
index: AnchorizedPNum;
|
|
258
293
|
hook: HookRaw;
|
|
294
|
+
lastSlotCached: BN;
|
|
259
295
|
}
|
|
260
296
|
export declare function deserializeGenericSyMetaAccountRaw(raw: GenericSyMetaAccountRaw): GenericSyMetaAccount;
|
|
261
297
|
/** Convert InterfaceTypeGeneric to InterfaceTypeGenericJson */
|
|
@@ -272,6 +308,6 @@ export declare function toAdditionalDataGenericJson(additionalData: AdditionalDa
|
|
|
272
308
|
export declare function fromAdditionalDataGenericJson(json: AdditionalDataGenericJson): AdditionalDataGeneric;
|
|
273
309
|
/** Helper function to extract fragmetric data from additional data */
|
|
274
310
|
export declare function getFragmetricDataFromAdditionalData(additionalData?: AdditionalDataGeneric): {
|
|
275
|
-
receiptTokenMint: PublicKey;
|
|
276
|
-
wrappedTokenMint: PublicKey;
|
|
311
|
+
receiptTokenMint: web3.PublicKey;
|
|
312
|
+
wrappedTokenMint: web3.PublicKey;
|
|
277
313
|
} | undefined;
|
package/build/generic.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
exports.deserializeGenericSyMetaAccountRaw = deserializeGenericSyMetaAccountRaw;
|
|
4
|
+
exports.toInterfaceTypeGenericJson = toInterfaceTypeGenericJson;
|
|
5
|
+
exports.fromInterfaceTypeGenericJson = fromInterfaceTypeGenericJson;
|
|
6
|
+
exports.toHookJson = toHookJson;
|
|
7
|
+
exports.fromHookJson = fromHookJson;
|
|
8
|
+
exports.toAdditionalDataGenericJson = toAdditionalDataGenericJson;
|
|
9
|
+
exports.fromAdditionalDataGenericJson = fromAdditionalDataGenericJson;
|
|
10
|
+
exports.getFragmetricDataFromAdditionalData = getFragmetricDataFromAdditionalData;
|
|
11
|
+
const anchor_1 = require("@coral-xyz/anchor");
|
|
9
12
|
function deserializeGenericSyMetaAccountRaw(raw) {
|
|
10
13
|
return {
|
|
11
14
|
mintSy: raw.mintSy,
|
|
@@ -18,6 +21,7 @@ function deserializeGenericSyMetaAccountRaw(raw) {
|
|
|
18
21
|
minMintSize: raw.minMintSize,
|
|
19
22
|
minRedeemSize: raw.minRedeemSize,
|
|
20
23
|
emissions: raw.emissions,
|
|
24
|
+
lastSlotCached: raw.lastSlotCached,
|
|
21
25
|
hook: {
|
|
22
26
|
enabled: raw.hook.enabled,
|
|
23
27
|
interfaceEmissionsAccountsUntil: raw.hook.interfaceEmissionsAccountsUntil,
|
|
@@ -27,7 +31,6 @@ function deserializeGenericSyMetaAccountRaw(raw) {
|
|
|
27
31
|
},
|
|
28
32
|
};
|
|
29
33
|
}
|
|
30
|
-
exports.deserializeGenericSyMetaAccountRaw = deserializeGenericSyMetaAccountRaw;
|
|
31
34
|
/** Convert InterfaceTypeGeneric to InterfaceTypeGenericJson */
|
|
32
35
|
function toInterfaceTypeGenericJson(interfaceType) {
|
|
33
36
|
if ("pyth" in interfaceType) {
|
|
@@ -69,16 +72,37 @@ function toInterfaceTypeGenericJson(interfaceType) {
|
|
|
69
72
|
},
|
|
70
73
|
};
|
|
71
74
|
}
|
|
75
|
+
if ("chainlinkDataStream" in interfaceType) {
|
|
76
|
+
return {
|
|
77
|
+
chainlinkDataStream: {
|
|
78
|
+
feedHash: interfaceType.chainlinkDataStream.feedHash,
|
|
79
|
+
lastStreamedExchangeRate: {
|
|
80
|
+
0: interfaceType.chainlinkDataStream.lastStreamedExchangeRate[0].map((bn) => bn.toString()),
|
|
81
|
+
},
|
|
82
|
+
decimals: interfaceType.chainlinkDataStream.decimals,
|
|
83
|
+
lastSlot: interfaceType.chainlinkDataStream.lastSlot.toString(),
|
|
84
|
+
lastStreamedTimestamp: interfaceType.chainlinkDataStream.lastStreamedTimestamp,
|
|
85
|
+
freshnessWindowSeconds: interfaceType.chainlinkDataStream.freshnessWindowSeconds,
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
if ("scope" in interfaceType) {
|
|
90
|
+
return {
|
|
91
|
+
scope: {
|
|
92
|
+
priceChain: interfaceType.scope.priceChain,
|
|
93
|
+
maximumAgeSeconds: interfaceType.scope.maximumAgeSeconds.toString(),
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
72
97
|
return interfaceType;
|
|
73
98
|
}
|
|
74
|
-
exports.toInterfaceTypeGenericJson = toInterfaceTypeGenericJson;
|
|
75
99
|
/** Convert InterfaceTypeGenericJson to InterfaceTypeGeneric */
|
|
76
100
|
function fromInterfaceTypeGenericJson(json) {
|
|
77
101
|
if ("pyth" in json) {
|
|
78
102
|
return {
|
|
79
103
|
pyth: {
|
|
80
|
-
lastSlot: new
|
|
81
|
-
maximumAgeSeconds: new
|
|
104
|
+
lastSlot: new anchor_1.BN(json.pyth.lastSlot),
|
|
105
|
+
maximumAgeSeconds: new anchor_1.BN(json.pyth.maximumAgeSeconds),
|
|
82
106
|
},
|
|
83
107
|
};
|
|
84
108
|
}
|
|
@@ -86,8 +110,8 @@ function fromInterfaceTypeGenericJson(json) {
|
|
|
86
110
|
return {
|
|
87
111
|
jupiterPerps: {
|
|
88
112
|
lastFeeUsdResetUnixTimestamp: parseInt(json.jupiterPerps.lastFeeUsdResetUnixTimestamp),
|
|
89
|
-
lastRealizedFeeUsd: new
|
|
90
|
-
lastAumUsd: new
|
|
113
|
+
lastRealizedFeeUsd: new anchor_1.BN(json.jupiterPerps.lastRealizedFeeUsd),
|
|
114
|
+
lastAumUsd: new anchor_1.BN(json.jupiterPerps.lastAumUsd),
|
|
91
115
|
lastRealizedFeeUsdUpdateUnixTimestamp: parseInt(json.jupiterPerps.lastRealizedFeeUsdUpdateUnixTimestamp),
|
|
92
116
|
},
|
|
93
117
|
};
|
|
@@ -95,7 +119,7 @@ function fromInterfaceTypeGenericJson(json) {
|
|
|
95
119
|
if ("adrena" in json) {
|
|
96
120
|
return {
|
|
97
121
|
adrena: {
|
|
98
|
-
previousTotalFees: new
|
|
122
|
+
previousTotalFees: new anchor_1.BN(json.adrena.previousTotalFees),
|
|
99
123
|
},
|
|
100
124
|
};
|
|
101
125
|
}
|
|
@@ -113,9 +137,30 @@ function fromInterfaceTypeGenericJson(json) {
|
|
|
113
137
|
},
|
|
114
138
|
};
|
|
115
139
|
}
|
|
140
|
+
if ("chainlinkDataStream" in json) {
|
|
141
|
+
return {
|
|
142
|
+
chainlinkDataStream: {
|
|
143
|
+
feedHash: json.chainlinkDataStream.feedHash,
|
|
144
|
+
lastStreamedExchangeRate: {
|
|
145
|
+
0: json.chainlinkDataStream.lastStreamedExchangeRate[0].map((s) => new anchor_1.BN(s)),
|
|
146
|
+
},
|
|
147
|
+
decimals: json.chainlinkDataStream.decimals,
|
|
148
|
+
lastSlot: new anchor_1.BN(json.chainlinkDataStream.lastSlot),
|
|
149
|
+
lastStreamedTimestamp: json.chainlinkDataStream.lastStreamedTimestamp,
|
|
150
|
+
freshnessWindowSeconds: json.chainlinkDataStream.freshnessWindowSeconds,
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
if ("scope" in json) {
|
|
155
|
+
return {
|
|
156
|
+
scope: {
|
|
157
|
+
priceChain: json.scope.priceChain,
|
|
158
|
+
maximumAgeSeconds: new anchor_1.BN(json.scope.maximumAgeSeconds),
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
}
|
|
116
162
|
return json;
|
|
117
163
|
}
|
|
118
|
-
exports.fromInterfaceTypeGenericJson = fromInterfaceTypeGenericJson;
|
|
119
164
|
/** Convert Hook to HookJson */
|
|
120
165
|
function toHookJson(hook) {
|
|
121
166
|
return {
|
|
@@ -126,18 +171,16 @@ function toHookJson(hook) {
|
|
|
126
171
|
postRedeemHookDiscriminator: hook.postRedeemHookDiscriminator,
|
|
127
172
|
};
|
|
128
173
|
}
|
|
129
|
-
exports.toHookJson = toHookJson;
|
|
130
174
|
/** Convert HookJson to Hook */
|
|
131
175
|
function fromHookJson(json) {
|
|
132
176
|
return {
|
|
133
177
|
enabled: json.enabled,
|
|
134
178
|
interfaceEmissionsAccountsUntil: json.interfaceEmissionsAccountsUntil,
|
|
135
|
-
programId: new
|
|
179
|
+
programId: new anchor_1.web3.PublicKey(json.programId),
|
|
136
180
|
preMintHookDiscriminator: json.preMintHookDiscriminator,
|
|
137
181
|
postRedeemHookDiscriminator: json.postRedeemHookDiscriminator,
|
|
138
182
|
};
|
|
139
183
|
}
|
|
140
|
-
exports.fromHookJson = fromHookJson;
|
|
141
184
|
/** Convert AdditionalDataGeneric to AdditionalDataGenericJson */
|
|
142
185
|
function toAdditionalDataGenericJson(additionalData) {
|
|
143
186
|
const result = {};
|
|
@@ -181,56 +224,53 @@ function toAdditionalDataGenericJson(additionalData) {
|
|
|
181
224
|
}
|
|
182
225
|
return result;
|
|
183
226
|
}
|
|
184
|
-
exports.toAdditionalDataGenericJson = toAdditionalDataGenericJson;
|
|
185
227
|
/** Convert AdditionalDataGenericJson to AdditionalDataGeneric */
|
|
186
228
|
function fromAdditionalDataGenericJson(json) {
|
|
187
229
|
const result = {};
|
|
188
230
|
if (json.fragmetricData) {
|
|
189
231
|
result.fragmetricData = {
|
|
190
|
-
receiptTokenMint: new
|
|
191
|
-
wrappedTokenMint: new
|
|
232
|
+
receiptTokenMint: new anchor_1.web3.PublicKey(json.fragmetricData.receiptTokenMint),
|
|
233
|
+
wrappedTokenMint: new anchor_1.web3.PublicKey(json.fragmetricData.wrappedTokenMint),
|
|
192
234
|
};
|
|
193
235
|
}
|
|
194
236
|
if (json.jupiterLendData) {
|
|
195
237
|
result.jupiterLendData = {
|
|
196
|
-
baseTokenMint: new
|
|
197
|
-
tokenReservesLiquidity: new
|
|
198
|
-
lendingSupplyPosition: new
|
|
199
|
-
rewardsRateModel: new
|
|
200
|
-
rateModel: new
|
|
238
|
+
baseTokenMint: new anchor_1.web3.PublicKey(json.jupiterLendData.baseTokenMint),
|
|
239
|
+
tokenReservesLiquidity: new anchor_1.web3.PublicKey(json.jupiterLendData.tokenReservesLiquidity),
|
|
240
|
+
lendingSupplyPosition: new anchor_1.web3.PublicKey(json.jupiterLendData.lendingSupplyPosition),
|
|
241
|
+
rewardsRateModel: new anchor_1.web3.PublicKey(json.jupiterLendData.rewardsRateModel),
|
|
242
|
+
rateModel: new anchor_1.web3.PublicKey(json.jupiterLendData.rateModel),
|
|
201
243
|
};
|
|
202
244
|
}
|
|
203
245
|
if (json.kaminoVaultData) {
|
|
204
246
|
result.kaminoVaultData = {
|
|
205
|
-
vault: new
|
|
247
|
+
vault: new anchor_1.web3.PublicKey(json.kaminoVaultData.vault),
|
|
206
248
|
reserves: json.kaminoVaultData.reserves.map((r) => ({
|
|
207
|
-
reserveAddress: new
|
|
208
|
-
marketAddress: new
|
|
249
|
+
reserveAddress: new anchor_1.web3.PublicKey(r.reserveAddress),
|
|
250
|
+
marketAddress: new anchor_1.web3.PublicKey(r.marketAddress),
|
|
209
251
|
})),
|
|
210
|
-
tokenVault: new
|
|
211
|
-
tokenMint: new
|
|
212
|
-
baseVaultAuthority: new
|
|
213
|
-
sharesMint: new
|
|
252
|
+
tokenVault: new anchor_1.web3.PublicKey(json.kaminoVaultData.tokenVault),
|
|
253
|
+
tokenMint: new anchor_1.web3.PublicKey(json.kaminoVaultData.tokenMint),
|
|
254
|
+
baseVaultAuthority: new anchor_1.web3.PublicKey(json.kaminoVaultData.baseVaultAuthority),
|
|
255
|
+
sharesMint: new anchor_1.web3.PublicKey(json.kaminoVaultData.sharesMint),
|
|
214
256
|
};
|
|
215
257
|
}
|
|
216
258
|
if (json.splStakePoolData) {
|
|
217
259
|
result.splStakePoolData = {
|
|
218
|
-
stakePoolAddress: new
|
|
219
|
-
stakePoolProgramId: new
|
|
220
|
-
validatorList: new
|
|
221
|
-
reserveStake: new
|
|
222
|
-
managerFeeAccount: new
|
|
223
|
-
poolMint: new
|
|
260
|
+
stakePoolAddress: new anchor_1.web3.PublicKey(json.splStakePoolData.stakePoolAddress),
|
|
261
|
+
stakePoolProgramId: new anchor_1.web3.PublicKey(json.splStakePoolData.stakePoolProgramId),
|
|
262
|
+
validatorList: new anchor_1.web3.PublicKey(json.splStakePoolData.validatorList),
|
|
263
|
+
reserveStake: new anchor_1.web3.PublicKey(json.splStakePoolData.reserveStake),
|
|
264
|
+
managerFeeAccount: new anchor_1.web3.PublicKey(json.splStakePoolData.managerFeeAccount),
|
|
265
|
+
poolMint: new anchor_1.web3.PublicKey(json.splStakePoolData.poolMint),
|
|
224
266
|
};
|
|
225
267
|
}
|
|
226
268
|
return result;
|
|
227
269
|
}
|
|
228
|
-
exports.fromAdditionalDataGenericJson = fromAdditionalDataGenericJson;
|
|
229
270
|
/** Helper function to extract fragmetric data from additional data */
|
|
230
271
|
function getFragmetricDataFromAdditionalData(additionalData) {
|
|
231
272
|
if (!additionalData)
|
|
232
273
|
return undefined;
|
|
233
274
|
return additionalData.fragmetricData;
|
|
234
275
|
}
|
|
235
|
-
exports.getFragmetricDataFromAdditionalData = getFragmetricDataFromAdditionalData;
|
|
236
276
|
//# sourceMappingURL=generic.js.map
|
package/build/generic.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generic.js","sourceRoot":"","sources":["../src/generic.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generic.js","sourceRoot":"","sources":["../src/generic.ts"],"names":[],"mappings":";;AAiWA,gFAqBC;AAGD,gEAgEC;AAGD,oEA+DC;AAGD,gCAQC;AAGD,oCAQC;AAGD,kEA8CC;AAGD,sEA8CC;AAGD,kFASC;AA/nBD,8CAA4C;AAiW5C,SAAgB,kCAAkC,CAAC,GAA4B;IAC7E,OAAO;QACL,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;QACtC,aAAa,EAAE,GAAG,CAAC,aAAa;QAChC,iBAAiB,EAAE,GAAG,CAAC,iBAAiB;QACxC,aAAa,EAAE,GAAG,CAAC,aAAa;QAChC,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,aAAa,EAAE,GAAG,CAAC,aAAa;QAChC,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,cAAc,EAAE,GAAG,CAAC,cAAc;QAClC,IAAI,EAAE;YACJ,OAAO,EAAE,GAAG,CAAC,IAAI,CAAC,OAAO;YACzB,+BAA+B,EAAE,GAAG,CAAC,IAAI,CAAC,+BAA+B;YACzE,wBAAwB,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,wBAAwB,CAAC;YACvE,2BAA2B,EAAE,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,2BAA2B,CAAC;YAC7E,SAAS,EAAE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CAAC,kBAAkB,CAAC;YAChF,aAAa,EAAE,IAAI,aAAI,CAAC,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC;YACtE,YAAY,EAAE,IAAI,aAAI,CAAC,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC;YACpE,iBAAiB,EAAE,IAAI,aAAI,CAAC,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC;YAC9E,QAAQ,EAAE,IAAI,aAAI,CAAC,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC;SAC7D,CAAA;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAED,sEAAsE;AACtE,SAAgB,mCAAmC,CAAC,cAAsC;IAMxF,IAAI,CAAC,cAAc;QAAE,OAAO,SAAS,CAAA;IAErC,OAAO,cAAc,CAAC,cAAc,CAAA;AACtC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SyEmissionRaw, SyEmissionJson } from "./common";
|
|
1
|
+
import { AnchorizedPNum, AnchorizedPNumJson, SyEmissionRaw, SyEmissionJson } from "./common";
|
|
2
2
|
import { PublicKey } from "@solana/web3.js";
|
|
3
3
|
import BN from 'bn.js';
|
|
4
4
|
export interface InterfaceType {
|
|
@@ -24,6 +24,8 @@ export interface JitoRestakingSyMetaAccountRaw {
|
|
|
24
24
|
emissions: SyEmissionRaw[];
|
|
25
25
|
interfaceAccounts: PublicKey[];
|
|
26
26
|
interfaceType: InterfaceType;
|
|
27
|
+
lastIndex: AnchorizedPNum;
|
|
28
|
+
lastSlotCached: BN;
|
|
27
29
|
}
|
|
28
30
|
export interface JitoRestakingSyMetaAccount {
|
|
29
31
|
jitoVault: PublicKey;
|
|
@@ -35,6 +37,8 @@ export interface JitoRestakingSyMetaAccount {
|
|
|
35
37
|
minMintSize: BN;
|
|
36
38
|
minRedeemSize: BN;
|
|
37
39
|
emissions: SyEmissionRaw[];
|
|
40
|
+
lastIndex: AnchorizedPNum;
|
|
41
|
+
lastSlotCached: BN;
|
|
38
42
|
}
|
|
39
43
|
export interface JitoRestakingSyMetaAccountJson {
|
|
40
44
|
jitoVault: string;
|
|
@@ -46,6 +50,8 @@ export interface JitoRestakingSyMetaAccountJson {
|
|
|
46
50
|
minMintSize: string;
|
|
47
51
|
minRedeemSize: string;
|
|
48
52
|
emissions: SyEmissionJson[];
|
|
53
|
+
lastIndex: AnchorizedPNumJson;
|
|
54
|
+
lastSlotCached: string;
|
|
49
55
|
}
|
|
50
56
|
export declare function deserializeJitoRestakingSyMetaAccountRaw(raw: JitoRestakingSyMetaAccountRaw): JitoRestakingSyMetaAccount;
|
|
51
57
|
export interface JitoRestakingSyStateJson {
|
package/build/jito-restaking.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deserializeJitoRestakingSyMetaAccountRaw =
|
|
3
|
+
exports.deserializeJitoRestakingSyMetaAccountRaw = deserializeJitoRestakingSyMetaAccountRaw;
|
|
4
4
|
function deserializeJitoRestakingSyMetaAccountRaw(raw) {
|
|
5
5
|
return {
|
|
6
6
|
jitoVault: raw.jitoVault,
|
|
@@ -12,7 +12,8 @@ function deserializeJitoRestakingSyMetaAccountRaw(raw) {
|
|
|
12
12
|
minMintSize: raw.minMintSize,
|
|
13
13
|
minRedeemSize: raw.minRedeemSize,
|
|
14
14
|
emissions: raw.emissions,
|
|
15
|
+
lastIndex: raw.lastIndex,
|
|
16
|
+
lastSlotCached: raw.lastSlotCached,
|
|
15
17
|
};
|
|
16
18
|
}
|
|
17
|
-
exports.deserializeJitoRestakingSyMetaAccountRaw = deserializeJitoRestakingSyMetaAccountRaw;
|
|
18
19
|
//# sourceMappingURL=jito-restaking.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jito-restaking.js","sourceRoot":"","sources":["../src/jito-restaking.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jito-restaking.js","sourceRoot":"","sources":["../src/jito-restaking.ts"],"names":[],"mappings":";;AA4DA,4FAgBC;AAhBD,SAAgB,wCAAwC,CACtD,GAAkC;IAElC,OAAO;QACL,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,aAAa,EAAE,GAAG,CAAC,aAAa;QAChC,iBAAiB,EAAE,GAAG,CAAC,iBAAiB;QACxC,aAAa,EAAE,GAAG,CAAC,aAAa;QAChC,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,aAAa,EAAE,GAAG,CAAC,aAAa;QAChC,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,cAAc,EAAE,GAAG,CAAC,cAAc;KACnC,CAAA;AACH,CAAC"}
|
package/build/kamino.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import BN from "bn.js";
|
|
2
|
-
import { SyEmissionJson, SyEmissionRaw, SyEmissionRaw2 } from "./common";
|
|
3
1
|
import { PublicKey } from "@solana/web3.js";
|
|
2
|
+
import BN from "bn.js";
|
|
3
|
+
import { AnchorizedPNum, SyEmissionJson, SyEmissionRaw, SyEmissionRaw2 } from "./common";
|
|
4
4
|
export interface KaminoSyState {
|
|
5
5
|
selfAddress: PublicKey;
|
|
6
6
|
account: KaminoSyMetaAccount;
|
|
@@ -37,6 +37,8 @@ export interface KaminoSyMetaAccount {
|
|
|
37
37
|
minMintSize: string;
|
|
38
38
|
minRedeemSize: string;
|
|
39
39
|
emissions: SyEmissionRaw[];
|
|
40
|
+
lastIndex: AnchorizedPNum;
|
|
41
|
+
lastSlotCached: string;
|
|
40
42
|
}
|
|
41
43
|
interface KaminoSyMetaAccountJson {
|
|
42
44
|
kaminoReserve: string;
|
|
@@ -50,6 +52,8 @@ interface KaminoSyMetaAccountJson {
|
|
|
50
52
|
minMintSize: string;
|
|
51
53
|
minRedeemSize: string;
|
|
52
54
|
emissions: SyEmissionJson[];
|
|
55
|
+
lastIndex: number;
|
|
56
|
+
lastSlotCached: string;
|
|
53
57
|
}
|
|
54
58
|
export interface KaminoSyMetaAccountRaw {
|
|
55
59
|
kamino_reserve: PublicKey;
|
|
@@ -70,5 +74,7 @@ export interface KaminoSyMetaAccountRaw {
|
|
|
70
74
|
min_mint_size: BN;
|
|
71
75
|
min_redeem_size: BN;
|
|
72
76
|
emissions: SyEmissionRaw2[];
|
|
77
|
+
last_index: AnchorizedPNum;
|
|
78
|
+
last_slot_cached: BN;
|
|
73
79
|
}
|
|
74
80
|
export {};
|
package/build/marginfi.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PublicKey } from "@solana/web3.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import BN from "bn.js";
|
|
3
|
+
import { AnchorizedPNum, SyEmissionJson, SyEmissionRaw } from "./common";
|
|
4
4
|
export interface MfiSyState {
|
|
5
5
|
selfAddress: PublicKey;
|
|
6
6
|
account: MarginfiSyMeta;
|
|
@@ -36,6 +36,8 @@ export interface SyMetaJson {
|
|
|
36
36
|
maxSySupply: string;
|
|
37
37
|
minMintSize: string;
|
|
38
38
|
minRedeemSize: string;
|
|
39
|
+
lastIndex: number;
|
|
40
|
+
lastSlotCached: string;
|
|
39
41
|
syRate: string;
|
|
40
42
|
}
|
|
41
43
|
export interface MarginfiSyMeta {
|
|
@@ -48,6 +50,8 @@ export interface MarginfiSyMeta {
|
|
|
48
50
|
minMintSize: bigint;
|
|
49
51
|
minRedeemSize: bigint;
|
|
50
52
|
emissions: SyEmissionRaw[];
|
|
53
|
+
lastIndex: AnchorizedPNum;
|
|
54
|
+
lastSlotCached: bigint;
|
|
51
55
|
}
|
|
52
56
|
export interface MarginfiSyMetaJson {
|
|
53
57
|
marginfiBank: string;
|
|
@@ -57,6 +61,8 @@ export interface MarginfiSyMetaJson {
|
|
|
57
61
|
maxSySupply: string;
|
|
58
62
|
minMintSize: string;
|
|
59
63
|
minRedeemSize: string;
|
|
64
|
+
lastIndex: number;
|
|
65
|
+
lastSlotCached: string;
|
|
60
66
|
emissions: SyEmissionJson[];
|
|
61
67
|
}
|
|
62
68
|
export interface MarginfiSyMetaRaw {
|
|
@@ -69,10 +75,6 @@ export interface MarginfiSyMetaRaw {
|
|
|
69
75
|
/** Where the SY tokens get deposited */
|
|
70
76
|
tokenSyEscrow: PublicKey;
|
|
71
77
|
emissions: SyEmissionRaw[];
|
|
78
|
+
lastIndex: AnchorizedPNum;
|
|
79
|
+
lastSlotCached: BN;
|
|
72
80
|
}
|
|
73
|
-
export type AnchorizedPNum = {
|
|
74
|
-
0: BN[];
|
|
75
|
-
};
|
|
76
|
-
export type AnchorizedPNumJson = {
|
|
77
|
-
0: string[];
|
|
78
|
-
};
|
package/build/perena.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PublicKey } from "@solana/web3.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import BN from "bn.js";
|
|
3
|
+
import { AnchorizedPNum, SyEmissionJson, SyEmissionRaw } from "./common";
|
|
4
4
|
export interface PerenaSyState {
|
|
5
5
|
selfAddress: PublicKey;
|
|
6
6
|
account: PerenaSyMetaAccount;
|
|
@@ -19,6 +19,8 @@ export interface PerenaSyMetaAccountRaw {
|
|
|
19
19
|
selfAddressBump: number[];
|
|
20
20
|
emissions: SyEmissionRaw[];
|
|
21
21
|
interfaceAccounts: PublicKey[];
|
|
22
|
+
lastIndex: AnchorizedPNum;
|
|
23
|
+
lastSlotCached: BN;
|
|
22
24
|
}
|
|
23
25
|
export interface PerenaSyMetaAccount {
|
|
24
26
|
perenaStablePool: PublicKey;
|
|
@@ -29,6 +31,8 @@ export interface PerenaSyMetaAccount {
|
|
|
29
31
|
minMintSize: BN;
|
|
30
32
|
minRedeemSize: BN;
|
|
31
33
|
emissions: SyEmissionRaw[];
|
|
34
|
+
lastIndex: AnchorizedPNum;
|
|
35
|
+
lastSlotCached: BN;
|
|
32
36
|
}
|
|
33
37
|
export interface PerenaSyMetaAccountJson {
|
|
34
38
|
perenaStablePool: string;
|
|
@@ -39,6 +43,8 @@ export interface PerenaSyMetaAccountJson {
|
|
|
39
43
|
minMintSize: string;
|
|
40
44
|
minRedeemSize: string;
|
|
41
45
|
emissions: SyEmissionJson[];
|
|
46
|
+
lastIndex: number;
|
|
47
|
+
lastSlotCached: string;
|
|
42
48
|
}
|
|
43
49
|
export declare function deserializePerenaSyMetaAccountRaw(raw: PerenaSyMetaAccountRaw): PerenaSyMetaAccount;
|
|
44
50
|
export interface PerenaSyStateJson {
|
package/build/perena.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.deserializePerenaSyMetaAccountRaw =
|
|
3
|
+
exports.deserializePerenaSyMetaAccountRaw = deserializePerenaSyMetaAccountRaw;
|
|
4
4
|
function deserializePerenaSyMetaAccountRaw(raw) {
|
|
5
5
|
return {
|
|
6
6
|
perenaStablePool: raw.perenaStablePool,
|
|
@@ -11,7 +11,8 @@ function deserializePerenaSyMetaAccountRaw(raw) {
|
|
|
11
11
|
minMintSize: raw.minMintSize,
|
|
12
12
|
minRedeemSize: raw.minRedeemSize,
|
|
13
13
|
emissions: raw.emissions,
|
|
14
|
+
lastIndex: raw.lastIndex,
|
|
15
|
+
lastSlotCached: raw.lastSlotCached,
|
|
14
16
|
};
|
|
15
17
|
}
|
|
16
|
-
exports.deserializePerenaSyMetaAccountRaw = deserializePerenaSyMetaAccountRaw;
|
|
17
18
|
//# sourceMappingURL=perena.js.map
|
package/build/perena.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perena.js","sourceRoot":"","sources":["../src/perena.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"perena.js","sourceRoot":"","sources":["../src/perena.ts"],"names":[],"mappings":";;AAsDA,8EAaC;AAbD,SAAgB,iCAAiC,CAAC,GAA2B;IAC3E,OAAO;QACL,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;QACtC,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,aAAa,EAAE,GAAG,CAAC,aAAa;QAChC,iBAAiB,EAAE,GAAG,CAAC,iBAAiB;QACxC,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,aAAa,EAAE,GAAG,CAAC,aAAa;QAChC,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,cAAc,EAAE,GAAG,CAAC,cAAc;KACnC,CAAA;AACH,CAAC"}
|
package/package.json
CHANGED
package/src/generic.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AnchorizedPNum, SyEmissionJson, SyEmissionRaw } from "./common"
|
|
1
|
+
import { BN, web3 } from "@coral-xyz/anchor"
|
|
3
2
|
import { StakePoolAccount } from "@solana/spl-stake-pool"
|
|
4
|
-
|
|
3
|
+
|
|
4
|
+
import { AnchorizedPNum, AnchorizedPNumJson, SyEmissionJson, SyEmissionRaw } from "./common"
|
|
5
|
+
|
|
5
6
|
export type InterfaceTypeGeneric =
|
|
6
7
|
| {
|
|
7
8
|
pyth: {
|
|
@@ -71,6 +72,27 @@ export type InterfaceTypeGeneric =
|
|
|
71
72
|
padding: number[]
|
|
72
73
|
}
|
|
73
74
|
}
|
|
75
|
+
| {
|
|
76
|
+
chainlinkDataStream: {
|
|
77
|
+
feedHash: number[]
|
|
78
|
+
lastStreamedExchangeRate: AnchorizedPNum
|
|
79
|
+
decimals: number
|
|
80
|
+
lastSlot: BN
|
|
81
|
+
lastStreamedTimestamp: number
|
|
82
|
+
freshnessWindowSeconds: number
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
| {
|
|
86
|
+
scope: {
|
|
87
|
+
priceChain: number[]
|
|
88
|
+
maximumAgeSeconds: BN
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
| {
|
|
92
|
+
solsticeGlamVault: {
|
|
93
|
+
padding: number[]
|
|
94
|
+
}
|
|
95
|
+
}
|
|
74
96
|
export type InterfaceTypeGenericJson =
|
|
75
97
|
| {
|
|
76
98
|
pyth: {
|
|
@@ -140,38 +162,59 @@ export type InterfaceTypeGenericJson =
|
|
|
140
162
|
padding: number[]
|
|
141
163
|
}
|
|
142
164
|
}
|
|
165
|
+
| {
|
|
166
|
+
chainlinkDataStream: {
|
|
167
|
+
feedHash: number[]
|
|
168
|
+
lastStreamedExchangeRate: AnchorizedPNumJson
|
|
169
|
+
decimals: number
|
|
170
|
+
lastSlot: string
|
|
171
|
+
lastStreamedTimestamp: number
|
|
172
|
+
freshnessWindowSeconds: number
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
| {
|
|
176
|
+
scope: {
|
|
177
|
+
priceChain: number[]
|
|
178
|
+
maximumAgeSeconds: string
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
| {
|
|
182
|
+
solsticeGlamVault: {
|
|
183
|
+
padding: number[]
|
|
184
|
+
}
|
|
185
|
+
}
|
|
143
186
|
/** Additional data that different interface types may need */
|
|
144
187
|
export interface AdditionalDataGeneric {
|
|
145
188
|
fragmetricData?: {
|
|
146
|
-
receiptTokenMint: PublicKey
|
|
147
|
-
wrappedTokenMint: PublicKey
|
|
189
|
+
receiptTokenMint: web3.PublicKey
|
|
190
|
+
wrappedTokenMint: web3.PublicKey
|
|
148
191
|
}
|
|
149
192
|
jupiterLendData?: {
|
|
150
|
-
baseTokenMint: PublicKey
|
|
151
|
-
tokenReservesLiquidity: PublicKey
|
|
152
|
-
lendingSupplyPosition: PublicKey
|
|
153
|
-
rewardsRateModel: PublicKey
|
|
154
|
-
rateModel: PublicKey
|
|
193
|
+
baseTokenMint: web3.PublicKey
|
|
194
|
+
tokenReservesLiquidity: web3.PublicKey
|
|
195
|
+
lendingSupplyPosition: web3.PublicKey
|
|
196
|
+
rewardsRateModel: web3.PublicKey
|
|
197
|
+
rateModel: web3.PublicKey
|
|
155
198
|
}
|
|
156
199
|
kaminoVaultData?: {
|
|
157
|
-
vault: PublicKey
|
|
200
|
+
vault: web3.PublicKey
|
|
158
201
|
reserves: {
|
|
159
|
-
reserveAddress: PublicKey
|
|
160
|
-
marketAddress: PublicKey
|
|
202
|
+
reserveAddress: web3.PublicKey
|
|
203
|
+
marketAddress: web3.PublicKey
|
|
161
204
|
}[]
|
|
162
|
-
tokenVault: PublicKey
|
|
163
|
-
tokenMint: PublicKey
|
|
164
|
-
baseVaultAuthority: PublicKey
|
|
165
|
-
sharesMint: PublicKey
|
|
205
|
+
tokenVault: web3.PublicKey
|
|
206
|
+
tokenMint: web3.PublicKey
|
|
207
|
+
baseVaultAuthority: web3.PublicKey
|
|
208
|
+
sharesMint: web3.PublicKey
|
|
166
209
|
}
|
|
167
210
|
splStakePoolData?: {
|
|
168
211
|
stakePoolAccount?: StakePoolAccount // Optional because it is expensive to serialize / not always needed on clients
|
|
169
|
-
stakePoolAddress: PublicKey
|
|
170
|
-
stakePoolProgramId: PublicKey // Dynamic program ID from account owner
|
|
171
|
-
validatorList: PublicKey
|
|
172
|
-
reserveStake: PublicKey
|
|
173
|
-
managerFeeAccount: PublicKey
|
|
174
|
-
poolMint: PublicKey
|
|
212
|
+
stakePoolAddress: web3.PublicKey
|
|
213
|
+
stakePoolProgramId: web3.PublicKey // Dynamic program ID from account owner
|
|
214
|
+
validatorList: web3.PublicKey
|
|
215
|
+
reserveStake: web3.PublicKey
|
|
216
|
+
managerFeeAccount: web3.PublicKey
|
|
217
|
+
poolMint: web3.PublicKey
|
|
175
218
|
}
|
|
176
219
|
// Add other interface-specific data here as needed
|
|
177
220
|
// meteoraData?: { ... }
|
|
@@ -220,7 +263,7 @@ export interface AdditionalDataGenericJson {
|
|
|
220
263
|
export interface Hook {
|
|
221
264
|
enabled: boolean
|
|
222
265
|
interfaceEmissionsAccountsUntil: number
|
|
223
|
-
programId: PublicKey
|
|
266
|
+
programId: web3.PublicKey
|
|
224
267
|
preMintHookDiscriminator: number[]
|
|
225
268
|
postRedeemHookDiscriminator: number[]
|
|
226
269
|
}
|
|
@@ -238,13 +281,13 @@ export interface HookRaw {
|
|
|
238
281
|
interfaceEmissionsAccountsUntil: number
|
|
239
282
|
preMintHookDiscriminator: Buffer
|
|
240
283
|
postRedeemHookDiscriminator: Buffer
|
|
241
|
-
programId: PublicKey
|
|
284
|
+
programId: web3.PublicKey
|
|
242
285
|
}
|
|
243
286
|
|
|
244
287
|
export interface GenericSyState {
|
|
245
|
-
selfAddress: PublicKey
|
|
288
|
+
selfAddress: web3.PublicKey
|
|
246
289
|
account: GenericSyMetaAccount
|
|
247
|
-
tokenProgramBase: PublicKey
|
|
290
|
+
tokenProgramBase: web3.PublicKey
|
|
248
291
|
syRate: number
|
|
249
292
|
additionalData?: AdditionalDataGeneric
|
|
250
293
|
}
|
|
@@ -274,13 +317,14 @@ export interface GenericSyMetaAccountJson {
|
|
|
274
317
|
hook: HookJson
|
|
275
318
|
emissions: SyEmissionJson[]
|
|
276
319
|
index: number
|
|
320
|
+
lastSlotCached: string
|
|
277
321
|
}
|
|
278
322
|
|
|
279
323
|
export interface GenericSyMetaAccount {
|
|
280
|
-
mintSy: PublicKey
|
|
281
|
-
yieldBearingMint: PublicKey
|
|
282
|
-
tokenSyEscrow: PublicKey
|
|
283
|
-
interfaceAccounts: PublicKey[]
|
|
324
|
+
mintSy: web3.PublicKey
|
|
325
|
+
yieldBearingMint: web3.PublicKey
|
|
326
|
+
tokenSyEscrow: web3.PublicKey
|
|
327
|
+
interfaceAccounts: web3.PublicKey[]
|
|
284
328
|
interfaceType: InterfaceTypeGeneric
|
|
285
329
|
maxSySupply: BN
|
|
286
330
|
minMintSize: BN
|
|
@@ -288,21 +332,23 @@ export interface GenericSyMetaAccount {
|
|
|
288
332
|
hook: Hook
|
|
289
333
|
emissions: SyEmissionRaw[]
|
|
290
334
|
index: AnchorizedPNum
|
|
335
|
+
lastSlotCached: BN
|
|
291
336
|
}
|
|
292
337
|
|
|
293
338
|
export interface GenericSyMetaAccountRaw {
|
|
294
|
-
mintSy: PublicKey
|
|
295
|
-
yieldBearingMint: PublicKey
|
|
296
|
-
tokenSyEscrow: PublicKey
|
|
339
|
+
mintSy: web3.PublicKey
|
|
340
|
+
yieldBearingMint: web3.PublicKey
|
|
341
|
+
tokenSyEscrow: web3.PublicKey
|
|
297
342
|
maxSySupply: BN
|
|
298
343
|
minMintSize: BN
|
|
299
344
|
minRedeemSize: BN
|
|
300
345
|
selfAddressBump: number[]
|
|
301
346
|
emissions: SyEmissionRaw[]
|
|
302
|
-
interfaceAccounts: PublicKey[]
|
|
347
|
+
interfaceAccounts: web3.PublicKey[]
|
|
303
348
|
interfaceType: InterfaceTypeGeneric
|
|
304
349
|
index: AnchorizedPNum
|
|
305
350
|
hook: HookRaw
|
|
351
|
+
lastSlotCached: BN
|
|
306
352
|
}
|
|
307
353
|
|
|
308
354
|
export function deserializeGenericSyMetaAccountRaw(raw: GenericSyMetaAccountRaw): GenericSyMetaAccount {
|
|
@@ -317,6 +363,7 @@ export function deserializeGenericSyMetaAccountRaw(raw: GenericSyMetaAccountRaw)
|
|
|
317
363
|
minMintSize: raw.minMintSize,
|
|
318
364
|
minRedeemSize: raw.minRedeemSize,
|
|
319
365
|
emissions: raw.emissions,
|
|
366
|
+
lastSlotCached: raw.lastSlotCached,
|
|
320
367
|
hook: {
|
|
321
368
|
enabled: raw.hook.enabled,
|
|
322
369
|
interfaceEmissionsAccountsUntil: raw.hook.interfaceEmissionsAccountsUntil,
|
|
@@ -369,6 +416,28 @@ export function toInterfaceTypeGenericJson(interfaceType: InterfaceTypeGeneric):
|
|
|
369
416
|
},
|
|
370
417
|
}
|
|
371
418
|
}
|
|
419
|
+
if ("chainlinkDataStream" in interfaceType) {
|
|
420
|
+
return {
|
|
421
|
+
chainlinkDataStream: {
|
|
422
|
+
feedHash: interfaceType.chainlinkDataStream.feedHash,
|
|
423
|
+
lastStreamedExchangeRate: {
|
|
424
|
+
0: interfaceType.chainlinkDataStream.lastStreamedExchangeRate[0].map((bn) => bn.toString()),
|
|
425
|
+
},
|
|
426
|
+
decimals: interfaceType.chainlinkDataStream.decimals,
|
|
427
|
+
lastSlot: interfaceType.chainlinkDataStream.lastSlot.toString(),
|
|
428
|
+
lastStreamedTimestamp: interfaceType.chainlinkDataStream.lastStreamedTimestamp,
|
|
429
|
+
freshnessWindowSeconds: interfaceType.chainlinkDataStream.freshnessWindowSeconds,
|
|
430
|
+
},
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
if ("scope" in interfaceType) {
|
|
434
|
+
return {
|
|
435
|
+
scope: {
|
|
436
|
+
priceChain: interfaceType.scope.priceChain,
|
|
437
|
+
maximumAgeSeconds: interfaceType.scope.maximumAgeSeconds.toString(),
|
|
438
|
+
},
|
|
439
|
+
}
|
|
440
|
+
}
|
|
372
441
|
return interfaceType as InterfaceTypeGenericJson
|
|
373
442
|
}
|
|
374
443
|
|
|
@@ -413,6 +482,28 @@ export function fromInterfaceTypeGenericJson(json: InterfaceTypeGenericJson): In
|
|
|
413
482
|
},
|
|
414
483
|
}
|
|
415
484
|
}
|
|
485
|
+
if ("chainlinkDataStream" in json) {
|
|
486
|
+
return {
|
|
487
|
+
chainlinkDataStream: {
|
|
488
|
+
feedHash: json.chainlinkDataStream.feedHash,
|
|
489
|
+
lastStreamedExchangeRate: {
|
|
490
|
+
0: json.chainlinkDataStream.lastStreamedExchangeRate[0].map((s) => new BN(s)),
|
|
491
|
+
},
|
|
492
|
+
decimals: json.chainlinkDataStream.decimals,
|
|
493
|
+
lastSlot: new BN(json.chainlinkDataStream.lastSlot),
|
|
494
|
+
lastStreamedTimestamp: json.chainlinkDataStream.lastStreamedTimestamp,
|
|
495
|
+
freshnessWindowSeconds: json.chainlinkDataStream.freshnessWindowSeconds,
|
|
496
|
+
},
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
if ("scope" in json) {
|
|
500
|
+
return {
|
|
501
|
+
scope: {
|
|
502
|
+
priceChain: json.scope.priceChain,
|
|
503
|
+
maximumAgeSeconds: new BN(json.scope.maximumAgeSeconds),
|
|
504
|
+
},
|
|
505
|
+
}
|
|
506
|
+
}
|
|
416
507
|
return json as InterfaceTypeGeneric
|
|
417
508
|
}
|
|
418
509
|
|
|
@@ -432,7 +523,7 @@ export function fromHookJson(json: HookJson): Hook {
|
|
|
432
523
|
return {
|
|
433
524
|
enabled: json.enabled,
|
|
434
525
|
interfaceEmissionsAccountsUntil: json.interfaceEmissionsAccountsUntil,
|
|
435
|
-
programId: new PublicKey(json.programId),
|
|
526
|
+
programId: new web3.PublicKey(json.programId),
|
|
436
527
|
preMintHookDiscriminator: json.preMintHookDiscriminator,
|
|
437
528
|
postRedeemHookDiscriminator: json.postRedeemHookDiscriminator,
|
|
438
529
|
}
|
|
@@ -493,43 +584,43 @@ export function fromAdditionalDataGenericJson(json: AdditionalDataGenericJson):
|
|
|
493
584
|
|
|
494
585
|
if (json.fragmetricData) {
|
|
495
586
|
result.fragmetricData = {
|
|
496
|
-
receiptTokenMint: new PublicKey(json.fragmetricData.receiptTokenMint),
|
|
497
|
-
wrappedTokenMint: new PublicKey(json.fragmetricData.wrappedTokenMint),
|
|
587
|
+
receiptTokenMint: new web3.PublicKey(json.fragmetricData.receiptTokenMint),
|
|
588
|
+
wrappedTokenMint: new web3.PublicKey(json.fragmetricData.wrappedTokenMint),
|
|
498
589
|
}
|
|
499
590
|
}
|
|
500
591
|
|
|
501
592
|
if (json.jupiterLendData) {
|
|
502
593
|
result.jupiterLendData = {
|
|
503
|
-
baseTokenMint: new PublicKey(json.jupiterLendData.baseTokenMint),
|
|
504
|
-
tokenReservesLiquidity: new PublicKey(json.jupiterLendData.tokenReservesLiquidity),
|
|
505
|
-
lendingSupplyPosition: new PublicKey(json.jupiterLendData.lendingSupplyPosition),
|
|
506
|
-
rewardsRateModel: new PublicKey(json.jupiterLendData.rewardsRateModel),
|
|
507
|
-
rateModel: new PublicKey(json.jupiterLendData.rateModel),
|
|
594
|
+
baseTokenMint: new web3.PublicKey(json.jupiterLendData.baseTokenMint),
|
|
595
|
+
tokenReservesLiquidity: new web3.PublicKey(json.jupiterLendData.tokenReservesLiquidity),
|
|
596
|
+
lendingSupplyPosition: new web3.PublicKey(json.jupiterLendData.lendingSupplyPosition),
|
|
597
|
+
rewardsRateModel: new web3.PublicKey(json.jupiterLendData.rewardsRateModel),
|
|
598
|
+
rateModel: new web3.PublicKey(json.jupiterLendData.rateModel),
|
|
508
599
|
}
|
|
509
600
|
}
|
|
510
601
|
|
|
511
602
|
if (json.kaminoVaultData) {
|
|
512
603
|
result.kaminoVaultData = {
|
|
513
|
-
vault: new PublicKey(json.kaminoVaultData.vault),
|
|
604
|
+
vault: new web3.PublicKey(json.kaminoVaultData.vault),
|
|
514
605
|
reserves: json.kaminoVaultData.reserves.map((r) => ({
|
|
515
|
-
reserveAddress: new PublicKey(r.reserveAddress),
|
|
516
|
-
marketAddress: new PublicKey(r.marketAddress),
|
|
606
|
+
reserveAddress: new web3.PublicKey(r.reserveAddress),
|
|
607
|
+
marketAddress: new web3.PublicKey(r.marketAddress),
|
|
517
608
|
})),
|
|
518
|
-
tokenVault: new PublicKey(json.kaminoVaultData.tokenVault),
|
|
519
|
-
tokenMint: new PublicKey(json.kaminoVaultData.tokenMint),
|
|
520
|
-
baseVaultAuthority: new PublicKey(json.kaminoVaultData.baseVaultAuthority),
|
|
521
|
-
sharesMint: new PublicKey(json.kaminoVaultData.sharesMint),
|
|
609
|
+
tokenVault: new web3.PublicKey(json.kaminoVaultData.tokenVault),
|
|
610
|
+
tokenMint: new web3.PublicKey(json.kaminoVaultData.tokenMint),
|
|
611
|
+
baseVaultAuthority: new web3.PublicKey(json.kaminoVaultData.baseVaultAuthority),
|
|
612
|
+
sharesMint: new web3.PublicKey(json.kaminoVaultData.sharesMint),
|
|
522
613
|
}
|
|
523
614
|
}
|
|
524
615
|
|
|
525
616
|
if (json.splStakePoolData) {
|
|
526
617
|
result.splStakePoolData = {
|
|
527
|
-
stakePoolAddress: new PublicKey(json.splStakePoolData.stakePoolAddress),
|
|
528
|
-
stakePoolProgramId: new PublicKey(json.splStakePoolData.stakePoolProgramId),
|
|
529
|
-
validatorList: new PublicKey(json.splStakePoolData.validatorList),
|
|
530
|
-
reserveStake: new PublicKey(json.splStakePoolData.reserveStake),
|
|
531
|
-
managerFeeAccount: new PublicKey(json.splStakePoolData.managerFeeAccount),
|
|
532
|
-
poolMint: new PublicKey(json.splStakePoolData.poolMint),
|
|
618
|
+
stakePoolAddress: new web3.PublicKey(json.splStakePoolData.stakePoolAddress),
|
|
619
|
+
stakePoolProgramId: new web3.PublicKey(json.splStakePoolData.stakePoolProgramId),
|
|
620
|
+
validatorList: new web3.PublicKey(json.splStakePoolData.validatorList),
|
|
621
|
+
reserveStake: new web3.PublicKey(json.splStakePoolData.reserveStake),
|
|
622
|
+
managerFeeAccount: new web3.PublicKey(json.splStakePoolData.managerFeeAccount),
|
|
623
|
+
poolMint: new web3.PublicKey(json.splStakePoolData.poolMint),
|
|
533
624
|
}
|
|
534
625
|
}
|
|
535
626
|
|
|
@@ -539,11 +630,11 @@ export function fromAdditionalDataGenericJson(json: AdditionalDataGenericJson):
|
|
|
539
630
|
/** Helper function to extract fragmetric data from additional data */
|
|
540
631
|
export function getFragmetricDataFromAdditionalData(additionalData?: AdditionalDataGeneric):
|
|
541
632
|
| {
|
|
542
|
-
receiptTokenMint: PublicKey
|
|
543
|
-
wrappedTokenMint: PublicKey
|
|
633
|
+
receiptTokenMint: web3.PublicKey
|
|
634
|
+
wrappedTokenMint: web3.PublicKey
|
|
544
635
|
}
|
|
545
636
|
| undefined {
|
|
546
637
|
if (!additionalData) return undefined
|
|
547
638
|
|
|
548
639
|
return additionalData.fragmetricData
|
|
549
|
-
}
|
|
640
|
+
}
|
package/src/jito-restaking.ts
CHANGED
|
@@ -26,6 +26,8 @@ export interface JitoRestakingSyMetaAccountRaw {
|
|
|
26
26
|
emissions: SyEmissionRaw[]
|
|
27
27
|
interfaceAccounts: PublicKey[]
|
|
28
28
|
interfaceType: InterfaceType
|
|
29
|
+
lastIndex: AnchorizedPNum
|
|
30
|
+
lastSlotCached: BN
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
export interface JitoRestakingSyMetaAccount {
|
|
@@ -38,6 +40,8 @@ export interface JitoRestakingSyMetaAccount {
|
|
|
38
40
|
minMintSize: BN
|
|
39
41
|
minRedeemSize: BN
|
|
40
42
|
emissions: SyEmissionRaw[]
|
|
43
|
+
lastIndex: AnchorizedPNum
|
|
44
|
+
lastSlotCached: BN
|
|
41
45
|
}
|
|
42
46
|
|
|
43
47
|
export interface JitoRestakingSyMetaAccountJson {
|
|
@@ -50,6 +54,8 @@ export interface JitoRestakingSyMetaAccountJson {
|
|
|
50
54
|
minMintSize: string
|
|
51
55
|
minRedeemSize: string
|
|
52
56
|
emissions: SyEmissionJson[]
|
|
57
|
+
lastIndex: AnchorizedPNumJson
|
|
58
|
+
lastSlotCached: string
|
|
53
59
|
}
|
|
54
60
|
|
|
55
61
|
export function deserializeJitoRestakingSyMetaAccountRaw(
|
|
@@ -65,6 +71,8 @@ export function deserializeJitoRestakingSyMetaAccountRaw(
|
|
|
65
71
|
minMintSize: raw.minMintSize,
|
|
66
72
|
minRedeemSize: raw.minRedeemSize,
|
|
67
73
|
emissions: raw.emissions,
|
|
74
|
+
lastIndex: raw.lastIndex,
|
|
75
|
+
lastSlotCached: raw.lastSlotCached,
|
|
68
76
|
}
|
|
69
77
|
}
|
|
70
78
|
|
package/src/kamino.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import BN from "bn.js"
|
|
2
|
-
|
|
3
|
-
import { SyEmissionJson, SyEmissionRaw, SyEmissionRaw2 } from "./common"
|
|
4
1
|
import { PublicKey } from "@solana/web3.js"
|
|
2
|
+
import BN from "bn.js"
|
|
3
|
+
|
|
4
|
+
import { AnchorizedPNum, SyEmissionJson, SyEmissionRaw, SyEmissionRaw2 } from "./common"
|
|
5
5
|
|
|
6
6
|
export interface KaminoSyState {
|
|
7
7
|
selfAddress: PublicKey
|
|
@@ -41,6 +41,8 @@ export interface KaminoSyMetaAccount {
|
|
|
41
41
|
minMintSize: string
|
|
42
42
|
minRedeemSize: string
|
|
43
43
|
emissions: SyEmissionRaw[]
|
|
44
|
+
lastIndex: AnchorizedPNum
|
|
45
|
+
lastSlotCached: string
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
interface KaminoSyMetaAccountJson {
|
|
@@ -55,6 +57,8 @@ interface KaminoSyMetaAccountJson {
|
|
|
55
57
|
minMintSize: string
|
|
56
58
|
minRedeemSize: string
|
|
57
59
|
emissions: SyEmissionJson[]
|
|
60
|
+
lastIndex: number
|
|
61
|
+
lastSlotCached: string
|
|
58
62
|
}
|
|
59
63
|
|
|
60
64
|
export interface KaminoSyMetaAccountRaw {
|
|
@@ -76,4 +80,6 @@ export interface KaminoSyMetaAccountRaw {
|
|
|
76
80
|
min_mint_size: BN
|
|
77
81
|
min_redeem_size: BN
|
|
78
82
|
emissions: SyEmissionRaw2[]
|
|
79
|
-
|
|
83
|
+
last_index: AnchorizedPNum
|
|
84
|
+
last_slot_cached: BN
|
|
85
|
+
}
|
package/src/marginfi.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { PublicKey } from "@solana/web3.js"
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import BN from "bn.js"
|
|
3
|
+
|
|
4
|
+
import { AnchorizedPNum, SyEmissionJson, SyEmissionRaw } from "./common"
|
|
5
|
+
|
|
4
6
|
export interface MfiSyState {
|
|
5
7
|
selfAddress: PublicKey
|
|
6
8
|
account: MarginfiSyMeta
|
|
@@ -39,6 +41,8 @@ export interface SyMetaJson {
|
|
|
39
41
|
maxSySupply: string
|
|
40
42
|
minMintSize: string
|
|
41
43
|
minRedeemSize: string
|
|
44
|
+
lastIndex: number
|
|
45
|
+
lastSlotCached: string
|
|
42
46
|
syRate: string
|
|
43
47
|
}
|
|
44
48
|
|
|
@@ -52,6 +56,8 @@ export interface MarginfiSyMeta {
|
|
|
52
56
|
minMintSize: bigint
|
|
53
57
|
minRedeemSize: bigint
|
|
54
58
|
emissions: SyEmissionRaw[]
|
|
59
|
+
lastIndex: AnchorizedPNum
|
|
60
|
+
lastSlotCached: bigint
|
|
55
61
|
}
|
|
56
62
|
|
|
57
63
|
export interface MarginfiSyMetaJson {
|
|
@@ -62,6 +68,8 @@ export interface MarginfiSyMetaJson {
|
|
|
62
68
|
maxSySupply: string
|
|
63
69
|
minMintSize: string
|
|
64
70
|
minRedeemSize: string
|
|
71
|
+
lastIndex: number
|
|
72
|
+
lastSlotCached: string
|
|
65
73
|
emissions: SyEmissionJson[]
|
|
66
74
|
}
|
|
67
75
|
|
|
@@ -75,7 +83,6 @@ export interface MarginfiSyMetaRaw {
|
|
|
75
83
|
/** Where the SY tokens get deposited */
|
|
76
84
|
tokenSyEscrow: PublicKey
|
|
77
85
|
emissions: SyEmissionRaw[]
|
|
86
|
+
lastIndex: AnchorizedPNum
|
|
87
|
+
lastSlotCached: BN
|
|
78
88
|
}
|
|
79
|
-
|
|
80
|
-
export type AnchorizedPNum = { 0: BN[] }
|
|
81
|
-
export type AnchorizedPNumJson = { 0: string[] }
|
package/src/perena.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { PublicKey } from "@solana/web3.js"
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import BN from "bn.js"
|
|
3
|
+
|
|
4
|
+
import { AnchorizedPNum, SyEmissionJson, SyEmissionRaw } from "./common"
|
|
5
|
+
|
|
4
6
|
export interface PerenaSyState {
|
|
5
7
|
selfAddress: PublicKey
|
|
6
8
|
account: PerenaSyMetaAccount
|
|
@@ -20,6 +22,8 @@ export interface PerenaSyMetaAccountRaw {
|
|
|
20
22
|
selfAddressBump: number[]
|
|
21
23
|
emissions: SyEmissionRaw[]
|
|
22
24
|
interfaceAccounts: PublicKey[]
|
|
25
|
+
lastIndex: AnchorizedPNum
|
|
26
|
+
lastSlotCached: BN
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
export interface PerenaSyMetaAccount {
|
|
@@ -31,6 +35,8 @@ export interface PerenaSyMetaAccount {
|
|
|
31
35
|
minMintSize: BN
|
|
32
36
|
minRedeemSize: BN
|
|
33
37
|
emissions: SyEmissionRaw[]
|
|
38
|
+
lastIndex: AnchorizedPNum
|
|
39
|
+
lastSlotCached: BN
|
|
34
40
|
}
|
|
35
41
|
|
|
36
42
|
export interface PerenaSyMetaAccountJson {
|
|
@@ -42,6 +48,8 @@ export interface PerenaSyMetaAccountJson {
|
|
|
42
48
|
minMintSize: string
|
|
43
49
|
minRedeemSize: string
|
|
44
50
|
emissions: SyEmissionJson[]
|
|
51
|
+
lastIndex: number
|
|
52
|
+
lastSlotCached: string
|
|
45
53
|
}
|
|
46
54
|
|
|
47
55
|
export function deserializePerenaSyMetaAccountRaw(raw: PerenaSyMetaAccountRaw): PerenaSyMetaAccount {
|
|
@@ -54,6 +62,8 @@ export function deserializePerenaSyMetaAccountRaw(raw: PerenaSyMetaAccountRaw):
|
|
|
54
62
|
minMintSize: raw.minMintSize,
|
|
55
63
|
minRedeemSize: raw.minRedeemSize,
|
|
56
64
|
emissions: raw.emissions,
|
|
65
|
+
lastIndex: raw.lastIndex,
|
|
66
|
+
lastSlotCached: raw.lastSlotCached,
|
|
57
67
|
}
|
|
58
68
|
}
|
|
59
69
|
|
|
@@ -64,4 +74,4 @@ export interface PerenaSyStateJson {
|
|
|
64
74
|
underlyingExchangeRate: number
|
|
65
75
|
mintBase: string
|
|
66
76
|
tokenProgramBase: string
|
|
67
|
-
}
|
|
77
|
+
}
|