@exponent-labs/exponent-types 0.9.10 → 0.9.12
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 +72 -39
- package/build/generic.js +79 -40
- package/build/generic.js.map +1 -1
- package/build/jito-restaking.js +1 -2
- package/build/jito-restaking.js.map +1 -1
- package/build/perena.js +1 -2
- package/build/perena.js.map +1 -1
- package/package.json +1 -1
- package/src/generic.ts +146 -59
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
|
@@ -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AAC;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
|
}
|
|
@@ -231,10 +264,10 @@ export interface GenericSyMetaAccountJson {
|
|
|
231
264
|
index: number;
|
|
232
265
|
}
|
|
233
266
|
export interface GenericSyMetaAccount {
|
|
234
|
-
mintSy: PublicKey;
|
|
235
|
-
yieldBearingMint: PublicKey;
|
|
236
|
-
tokenSyEscrow: PublicKey;
|
|
237
|
-
interfaceAccounts: PublicKey[];
|
|
267
|
+
mintSy: web3.PublicKey;
|
|
268
|
+
yieldBearingMint: web3.PublicKey;
|
|
269
|
+
tokenSyEscrow: web3.PublicKey;
|
|
270
|
+
interfaceAccounts: web3.PublicKey[];
|
|
238
271
|
interfaceType: InterfaceTypeGeneric;
|
|
239
272
|
maxSySupply: BN;
|
|
240
273
|
minMintSize: BN;
|
|
@@ -244,15 +277,15 @@ export interface GenericSyMetaAccount {
|
|
|
244
277
|
index: AnchorizedPNum;
|
|
245
278
|
}
|
|
246
279
|
export interface GenericSyMetaAccountRaw {
|
|
247
|
-
mintSy: PublicKey;
|
|
248
|
-
yieldBearingMint: PublicKey;
|
|
249
|
-
tokenSyEscrow: PublicKey;
|
|
280
|
+
mintSy: web3.PublicKey;
|
|
281
|
+
yieldBearingMint: web3.PublicKey;
|
|
282
|
+
tokenSyEscrow: web3.PublicKey;
|
|
250
283
|
maxSySupply: BN;
|
|
251
284
|
minMintSize: BN;
|
|
252
285
|
minRedeemSize: BN;
|
|
253
286
|
selfAddressBump: number[];
|
|
254
287
|
emissions: SyEmissionRaw[];
|
|
255
|
-
interfaceAccounts: PublicKey[];
|
|
288
|
+
interfaceAccounts: web3.PublicKey[];
|
|
256
289
|
interfaceType: InterfaceTypeGeneric;
|
|
257
290
|
index: AnchorizedPNum;
|
|
258
291
|
hook: HookRaw;
|
|
@@ -272,6 +305,6 @@ export declare function toAdditionalDataGenericJson(additionalData: AdditionalDa
|
|
|
272
305
|
export declare function fromAdditionalDataGenericJson(json: AdditionalDataGenericJson): AdditionalDataGeneric;
|
|
273
306
|
/** Helper function to extract fragmetric data from additional data */
|
|
274
307
|
export declare function getFragmetricDataFromAdditionalData(additionalData?: AdditionalDataGeneric): {
|
|
275
|
-
receiptTokenMint: PublicKey;
|
|
276
|
-
wrappedTokenMint: PublicKey;
|
|
308
|
+
receiptTokenMint: web3.PublicKey;
|
|
309
|
+
wrappedTokenMint: web3.PublicKey;
|
|
277
310
|
} | 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,
|
|
@@ -27,7 +30,6 @@ function deserializeGenericSyMetaAccountRaw(raw) {
|
|
|
27
30
|
},
|
|
28
31
|
};
|
|
29
32
|
}
|
|
30
|
-
exports.deserializeGenericSyMetaAccountRaw = deserializeGenericSyMetaAccountRaw;
|
|
31
33
|
/** Convert InterfaceTypeGeneric to InterfaceTypeGenericJson */
|
|
32
34
|
function toInterfaceTypeGenericJson(interfaceType) {
|
|
33
35
|
if ("pyth" in interfaceType) {
|
|
@@ -69,16 +71,37 @@ function toInterfaceTypeGenericJson(interfaceType) {
|
|
|
69
71
|
},
|
|
70
72
|
};
|
|
71
73
|
}
|
|
74
|
+
if ("chainlinkDataStream" in interfaceType) {
|
|
75
|
+
return {
|
|
76
|
+
chainlinkDataStream: {
|
|
77
|
+
feedHash: interfaceType.chainlinkDataStream.feedHash,
|
|
78
|
+
lastStreamedExchangeRate: {
|
|
79
|
+
0: interfaceType.chainlinkDataStream.lastStreamedExchangeRate[0].map((bn) => bn.toString()),
|
|
80
|
+
},
|
|
81
|
+
decimals: interfaceType.chainlinkDataStream.decimals,
|
|
82
|
+
lastSlot: interfaceType.chainlinkDataStream.lastSlot.toString(),
|
|
83
|
+
lastStreamedTimestamp: interfaceType.chainlinkDataStream.lastStreamedTimestamp,
|
|
84
|
+
freshnessWindowSeconds: interfaceType.chainlinkDataStream.freshnessWindowSeconds,
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
if ("scope" in interfaceType) {
|
|
89
|
+
return {
|
|
90
|
+
scope: {
|
|
91
|
+
priceChain: interfaceType.scope.priceChain,
|
|
92
|
+
maximumAgeSeconds: interfaceType.scope.maximumAgeSeconds.toString(),
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
}
|
|
72
96
|
return interfaceType;
|
|
73
97
|
}
|
|
74
|
-
exports.toInterfaceTypeGenericJson = toInterfaceTypeGenericJson;
|
|
75
98
|
/** Convert InterfaceTypeGenericJson to InterfaceTypeGeneric */
|
|
76
99
|
function fromInterfaceTypeGenericJson(json) {
|
|
77
100
|
if ("pyth" in json) {
|
|
78
101
|
return {
|
|
79
102
|
pyth: {
|
|
80
|
-
lastSlot: new
|
|
81
|
-
maximumAgeSeconds: new
|
|
103
|
+
lastSlot: new anchor_1.BN(json.pyth.lastSlot),
|
|
104
|
+
maximumAgeSeconds: new anchor_1.BN(json.pyth.maximumAgeSeconds),
|
|
82
105
|
},
|
|
83
106
|
};
|
|
84
107
|
}
|
|
@@ -86,8 +109,8 @@ function fromInterfaceTypeGenericJson(json) {
|
|
|
86
109
|
return {
|
|
87
110
|
jupiterPerps: {
|
|
88
111
|
lastFeeUsdResetUnixTimestamp: parseInt(json.jupiterPerps.lastFeeUsdResetUnixTimestamp),
|
|
89
|
-
lastRealizedFeeUsd: new
|
|
90
|
-
lastAumUsd: new
|
|
112
|
+
lastRealizedFeeUsd: new anchor_1.BN(json.jupiterPerps.lastRealizedFeeUsd),
|
|
113
|
+
lastAumUsd: new anchor_1.BN(json.jupiterPerps.lastAumUsd),
|
|
91
114
|
lastRealizedFeeUsdUpdateUnixTimestamp: parseInt(json.jupiterPerps.lastRealizedFeeUsdUpdateUnixTimestamp),
|
|
92
115
|
},
|
|
93
116
|
};
|
|
@@ -95,7 +118,7 @@ function fromInterfaceTypeGenericJson(json) {
|
|
|
95
118
|
if ("adrena" in json) {
|
|
96
119
|
return {
|
|
97
120
|
adrena: {
|
|
98
|
-
previousTotalFees: new
|
|
121
|
+
previousTotalFees: new anchor_1.BN(json.adrena.previousTotalFees),
|
|
99
122
|
},
|
|
100
123
|
};
|
|
101
124
|
}
|
|
@@ -113,9 +136,30 @@ function fromInterfaceTypeGenericJson(json) {
|
|
|
113
136
|
},
|
|
114
137
|
};
|
|
115
138
|
}
|
|
139
|
+
if ("chainlinkDataStream" in json) {
|
|
140
|
+
return {
|
|
141
|
+
chainlinkDataStream: {
|
|
142
|
+
feedHash: json.chainlinkDataStream.feedHash,
|
|
143
|
+
lastStreamedExchangeRate: {
|
|
144
|
+
0: json.chainlinkDataStream.lastStreamedExchangeRate[0].map((s) => new anchor_1.BN(s)),
|
|
145
|
+
},
|
|
146
|
+
decimals: json.chainlinkDataStream.decimals,
|
|
147
|
+
lastSlot: new anchor_1.BN(json.chainlinkDataStream.lastSlot),
|
|
148
|
+
lastStreamedTimestamp: json.chainlinkDataStream.lastStreamedTimestamp,
|
|
149
|
+
freshnessWindowSeconds: json.chainlinkDataStream.freshnessWindowSeconds,
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
if ("scope" in json) {
|
|
154
|
+
return {
|
|
155
|
+
scope: {
|
|
156
|
+
priceChain: json.scope.priceChain,
|
|
157
|
+
maximumAgeSeconds: new anchor_1.BN(json.scope.maximumAgeSeconds),
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
}
|
|
116
161
|
return json;
|
|
117
162
|
}
|
|
118
|
-
exports.fromInterfaceTypeGenericJson = fromInterfaceTypeGenericJson;
|
|
119
163
|
/** Convert Hook to HookJson */
|
|
120
164
|
function toHookJson(hook) {
|
|
121
165
|
return {
|
|
@@ -126,18 +170,16 @@ function toHookJson(hook) {
|
|
|
126
170
|
postRedeemHookDiscriminator: hook.postRedeemHookDiscriminator,
|
|
127
171
|
};
|
|
128
172
|
}
|
|
129
|
-
exports.toHookJson = toHookJson;
|
|
130
173
|
/** Convert HookJson to Hook */
|
|
131
174
|
function fromHookJson(json) {
|
|
132
175
|
return {
|
|
133
176
|
enabled: json.enabled,
|
|
134
177
|
interfaceEmissionsAccountsUntil: json.interfaceEmissionsAccountsUntil,
|
|
135
|
-
programId: new
|
|
178
|
+
programId: new anchor_1.web3.PublicKey(json.programId),
|
|
136
179
|
preMintHookDiscriminator: json.preMintHookDiscriminator,
|
|
137
180
|
postRedeemHookDiscriminator: json.postRedeemHookDiscriminator,
|
|
138
181
|
};
|
|
139
182
|
}
|
|
140
|
-
exports.fromHookJson = fromHookJson;
|
|
141
183
|
/** Convert AdditionalDataGeneric to AdditionalDataGenericJson */
|
|
142
184
|
function toAdditionalDataGenericJson(additionalData) {
|
|
143
185
|
const result = {};
|
|
@@ -181,56 +223,53 @@ function toAdditionalDataGenericJson(additionalData) {
|
|
|
181
223
|
}
|
|
182
224
|
return result;
|
|
183
225
|
}
|
|
184
|
-
exports.toAdditionalDataGenericJson = toAdditionalDataGenericJson;
|
|
185
226
|
/** Convert AdditionalDataGenericJson to AdditionalDataGeneric */
|
|
186
227
|
function fromAdditionalDataGenericJson(json) {
|
|
187
228
|
const result = {};
|
|
188
229
|
if (json.fragmetricData) {
|
|
189
230
|
result.fragmetricData = {
|
|
190
|
-
receiptTokenMint: new
|
|
191
|
-
wrappedTokenMint: new
|
|
231
|
+
receiptTokenMint: new anchor_1.web3.PublicKey(json.fragmetricData.receiptTokenMint),
|
|
232
|
+
wrappedTokenMint: new anchor_1.web3.PublicKey(json.fragmetricData.wrappedTokenMint),
|
|
192
233
|
};
|
|
193
234
|
}
|
|
194
235
|
if (json.jupiterLendData) {
|
|
195
236
|
result.jupiterLendData = {
|
|
196
|
-
baseTokenMint: new
|
|
197
|
-
tokenReservesLiquidity: new
|
|
198
|
-
lendingSupplyPosition: new
|
|
199
|
-
rewardsRateModel: new
|
|
200
|
-
rateModel: new
|
|
237
|
+
baseTokenMint: new anchor_1.web3.PublicKey(json.jupiterLendData.baseTokenMint),
|
|
238
|
+
tokenReservesLiquidity: new anchor_1.web3.PublicKey(json.jupiterLendData.tokenReservesLiquidity),
|
|
239
|
+
lendingSupplyPosition: new anchor_1.web3.PublicKey(json.jupiterLendData.lendingSupplyPosition),
|
|
240
|
+
rewardsRateModel: new anchor_1.web3.PublicKey(json.jupiterLendData.rewardsRateModel),
|
|
241
|
+
rateModel: new anchor_1.web3.PublicKey(json.jupiterLendData.rateModel),
|
|
201
242
|
};
|
|
202
243
|
}
|
|
203
244
|
if (json.kaminoVaultData) {
|
|
204
245
|
result.kaminoVaultData = {
|
|
205
|
-
vault: new
|
|
246
|
+
vault: new anchor_1.web3.PublicKey(json.kaminoVaultData.vault),
|
|
206
247
|
reserves: json.kaminoVaultData.reserves.map((r) => ({
|
|
207
|
-
reserveAddress: new
|
|
208
|
-
marketAddress: new
|
|
248
|
+
reserveAddress: new anchor_1.web3.PublicKey(r.reserveAddress),
|
|
249
|
+
marketAddress: new anchor_1.web3.PublicKey(r.marketAddress),
|
|
209
250
|
})),
|
|
210
|
-
tokenVault: new
|
|
211
|
-
tokenMint: new
|
|
212
|
-
baseVaultAuthority: new
|
|
213
|
-
sharesMint: new
|
|
251
|
+
tokenVault: new anchor_1.web3.PublicKey(json.kaminoVaultData.tokenVault),
|
|
252
|
+
tokenMint: new anchor_1.web3.PublicKey(json.kaminoVaultData.tokenMint),
|
|
253
|
+
baseVaultAuthority: new anchor_1.web3.PublicKey(json.kaminoVaultData.baseVaultAuthority),
|
|
254
|
+
sharesMint: new anchor_1.web3.PublicKey(json.kaminoVaultData.sharesMint),
|
|
214
255
|
};
|
|
215
256
|
}
|
|
216
257
|
if (json.splStakePoolData) {
|
|
217
258
|
result.splStakePoolData = {
|
|
218
|
-
stakePoolAddress: new
|
|
219
|
-
stakePoolProgramId: new
|
|
220
|
-
validatorList: new
|
|
221
|
-
reserveStake: new
|
|
222
|
-
managerFeeAccount: new
|
|
223
|
-
poolMint: new
|
|
259
|
+
stakePoolAddress: new anchor_1.web3.PublicKey(json.splStakePoolData.stakePoolAddress),
|
|
260
|
+
stakePoolProgramId: new anchor_1.web3.PublicKey(json.splStakePoolData.stakePoolProgramId),
|
|
261
|
+
validatorList: new anchor_1.web3.PublicKey(json.splStakePoolData.validatorList),
|
|
262
|
+
reserveStake: new anchor_1.web3.PublicKey(json.splStakePoolData.reserveStake),
|
|
263
|
+
managerFeeAccount: new anchor_1.web3.PublicKey(json.splStakePoolData.managerFeeAccount),
|
|
264
|
+
poolMint: new anchor_1.web3.PublicKey(json.splStakePoolData.poolMint),
|
|
224
265
|
};
|
|
225
266
|
}
|
|
226
267
|
return result;
|
|
227
268
|
}
|
|
228
|
-
exports.fromAdditionalDataGenericJson = fromAdditionalDataGenericJson;
|
|
229
269
|
/** Helper function to extract fragmetric data from additional data */
|
|
230
270
|
function getFragmetricDataFromAdditionalData(additionalData) {
|
|
231
271
|
if (!additionalData)
|
|
232
272
|
return undefined;
|
|
233
273
|
return additionalData.fragmetricData;
|
|
234
274
|
}
|
|
235
|
-
exports.getFragmetricDataFromAdditionalData = getFragmetricDataFromAdditionalData;
|
|
236
275
|
//# 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":";;AA8VA,gFAoBC;AAGD,gEAgEC;AAGD,oEA+DC;AAGD,gCAQC;AAGD,oCAQC;AAGD,kEA8CC;AAGD,sEA8CC;AAGD,kFASC;AA3nBD,8CAA4C;AA8V5C,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,GA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AAC,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC;YAC/E,UAAU,EAAE,IAAI,aAAI,CAAC,SAAS,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC;SAChE,CAAA;IACH,CAAC;IAED,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC1B,MAAM,CAAC,gBAAgB,GAAG;YACxB,gBAAgB,EAAE,IAAI,aAAI,CAAC,SAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC;YAC5E,kBAAkB,EAAE,IAAI,aAAI,CAAC,SAAS,CAAC,IAAI,CAAC,gBAAgB,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"}
|
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,
|
|
@@ -14,5 +14,4 @@ function deserializeJitoRestakingSyMetaAccountRaw(raw) {
|
|
|
14
14
|
emissions: raw.emissions,
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
exports.deserializeJitoRestakingSyMetaAccountRaw = deserializeJitoRestakingSyMetaAccountRaw;
|
|
18
17
|
//# 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":";;AAsDA,4FAcC;AAdD,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;KACzB,CAAA;AACH,CAAC"}
|
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,
|
|
@@ -13,5 +13,4 @@ function deserializePerenaSyMetaAccountRaw(raw) {
|
|
|
13
13
|
emissions: raw.emissions,
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
exports.deserializePerenaSyMetaAccountRaw = deserializePerenaSyMetaAccountRaw;
|
|
17
16
|
//# 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":";;AA8CA,8EAWC;AAXD,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;KACzB,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
|
}
|
|
@@ -277,10 +320,10 @@ export interface GenericSyMetaAccountJson {
|
|
|
277
320
|
}
|
|
278
321
|
|
|
279
322
|
export interface GenericSyMetaAccount {
|
|
280
|
-
mintSy: PublicKey
|
|
281
|
-
yieldBearingMint: PublicKey
|
|
282
|
-
tokenSyEscrow: PublicKey
|
|
283
|
-
interfaceAccounts: PublicKey[]
|
|
323
|
+
mintSy: web3.PublicKey
|
|
324
|
+
yieldBearingMint: web3.PublicKey
|
|
325
|
+
tokenSyEscrow: web3.PublicKey
|
|
326
|
+
interfaceAccounts: web3.PublicKey[]
|
|
284
327
|
interfaceType: InterfaceTypeGeneric
|
|
285
328
|
maxSySupply: BN
|
|
286
329
|
minMintSize: BN
|
|
@@ -291,15 +334,15 @@ export interface GenericSyMetaAccount {
|
|
|
291
334
|
}
|
|
292
335
|
|
|
293
336
|
export interface GenericSyMetaAccountRaw {
|
|
294
|
-
mintSy: PublicKey
|
|
295
|
-
yieldBearingMint: PublicKey
|
|
296
|
-
tokenSyEscrow: PublicKey
|
|
337
|
+
mintSy: web3.PublicKey
|
|
338
|
+
yieldBearingMint: web3.PublicKey
|
|
339
|
+
tokenSyEscrow: web3.PublicKey
|
|
297
340
|
maxSySupply: BN
|
|
298
341
|
minMintSize: BN
|
|
299
342
|
minRedeemSize: BN
|
|
300
343
|
selfAddressBump: number[]
|
|
301
344
|
emissions: SyEmissionRaw[]
|
|
302
|
-
interfaceAccounts: PublicKey[]
|
|
345
|
+
interfaceAccounts: web3.PublicKey[]
|
|
303
346
|
interfaceType: InterfaceTypeGeneric
|
|
304
347
|
index: AnchorizedPNum
|
|
305
348
|
hook: HookRaw
|
|
@@ -369,6 +412,28 @@ export function toInterfaceTypeGenericJson(interfaceType: InterfaceTypeGeneric):
|
|
|
369
412
|
},
|
|
370
413
|
}
|
|
371
414
|
}
|
|
415
|
+
if ("chainlinkDataStream" in interfaceType) {
|
|
416
|
+
return {
|
|
417
|
+
chainlinkDataStream: {
|
|
418
|
+
feedHash: interfaceType.chainlinkDataStream.feedHash,
|
|
419
|
+
lastStreamedExchangeRate: {
|
|
420
|
+
0: interfaceType.chainlinkDataStream.lastStreamedExchangeRate[0].map((bn) => bn.toString()),
|
|
421
|
+
},
|
|
422
|
+
decimals: interfaceType.chainlinkDataStream.decimals,
|
|
423
|
+
lastSlot: interfaceType.chainlinkDataStream.lastSlot.toString(),
|
|
424
|
+
lastStreamedTimestamp: interfaceType.chainlinkDataStream.lastStreamedTimestamp,
|
|
425
|
+
freshnessWindowSeconds: interfaceType.chainlinkDataStream.freshnessWindowSeconds,
|
|
426
|
+
},
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
if ("scope" in interfaceType) {
|
|
430
|
+
return {
|
|
431
|
+
scope: {
|
|
432
|
+
priceChain: interfaceType.scope.priceChain,
|
|
433
|
+
maximumAgeSeconds: interfaceType.scope.maximumAgeSeconds.toString(),
|
|
434
|
+
},
|
|
435
|
+
}
|
|
436
|
+
}
|
|
372
437
|
return interfaceType as InterfaceTypeGenericJson
|
|
373
438
|
}
|
|
374
439
|
|
|
@@ -413,6 +478,28 @@ export function fromInterfaceTypeGenericJson(json: InterfaceTypeGenericJson): In
|
|
|
413
478
|
},
|
|
414
479
|
}
|
|
415
480
|
}
|
|
481
|
+
if ("chainlinkDataStream" in json) {
|
|
482
|
+
return {
|
|
483
|
+
chainlinkDataStream: {
|
|
484
|
+
feedHash: json.chainlinkDataStream.feedHash,
|
|
485
|
+
lastStreamedExchangeRate: {
|
|
486
|
+
0: json.chainlinkDataStream.lastStreamedExchangeRate[0].map((s) => new BN(s)),
|
|
487
|
+
},
|
|
488
|
+
decimals: json.chainlinkDataStream.decimals,
|
|
489
|
+
lastSlot: new BN(json.chainlinkDataStream.lastSlot),
|
|
490
|
+
lastStreamedTimestamp: json.chainlinkDataStream.lastStreamedTimestamp,
|
|
491
|
+
freshnessWindowSeconds: json.chainlinkDataStream.freshnessWindowSeconds,
|
|
492
|
+
},
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
if ("scope" in json) {
|
|
496
|
+
return {
|
|
497
|
+
scope: {
|
|
498
|
+
priceChain: json.scope.priceChain,
|
|
499
|
+
maximumAgeSeconds: new BN(json.scope.maximumAgeSeconds),
|
|
500
|
+
},
|
|
501
|
+
}
|
|
502
|
+
}
|
|
416
503
|
return json as InterfaceTypeGeneric
|
|
417
504
|
}
|
|
418
505
|
|
|
@@ -432,7 +519,7 @@ export function fromHookJson(json: HookJson): Hook {
|
|
|
432
519
|
return {
|
|
433
520
|
enabled: json.enabled,
|
|
434
521
|
interfaceEmissionsAccountsUntil: json.interfaceEmissionsAccountsUntil,
|
|
435
|
-
programId: new PublicKey(json.programId),
|
|
522
|
+
programId: new web3.PublicKey(json.programId),
|
|
436
523
|
preMintHookDiscriminator: json.preMintHookDiscriminator,
|
|
437
524
|
postRedeemHookDiscriminator: json.postRedeemHookDiscriminator,
|
|
438
525
|
}
|
|
@@ -493,43 +580,43 @@ export function fromAdditionalDataGenericJson(json: AdditionalDataGenericJson):
|
|
|
493
580
|
|
|
494
581
|
if (json.fragmetricData) {
|
|
495
582
|
result.fragmetricData = {
|
|
496
|
-
receiptTokenMint: new PublicKey(json.fragmetricData.receiptTokenMint),
|
|
497
|
-
wrappedTokenMint: new PublicKey(json.fragmetricData.wrappedTokenMint),
|
|
583
|
+
receiptTokenMint: new web3.PublicKey(json.fragmetricData.receiptTokenMint),
|
|
584
|
+
wrappedTokenMint: new web3.PublicKey(json.fragmetricData.wrappedTokenMint),
|
|
498
585
|
}
|
|
499
586
|
}
|
|
500
587
|
|
|
501
588
|
if (json.jupiterLendData) {
|
|
502
589
|
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),
|
|
590
|
+
baseTokenMint: new web3.PublicKey(json.jupiterLendData.baseTokenMint),
|
|
591
|
+
tokenReservesLiquidity: new web3.PublicKey(json.jupiterLendData.tokenReservesLiquidity),
|
|
592
|
+
lendingSupplyPosition: new web3.PublicKey(json.jupiterLendData.lendingSupplyPosition),
|
|
593
|
+
rewardsRateModel: new web3.PublicKey(json.jupiterLendData.rewardsRateModel),
|
|
594
|
+
rateModel: new web3.PublicKey(json.jupiterLendData.rateModel),
|
|
508
595
|
}
|
|
509
596
|
}
|
|
510
597
|
|
|
511
598
|
if (json.kaminoVaultData) {
|
|
512
599
|
result.kaminoVaultData = {
|
|
513
|
-
vault: new PublicKey(json.kaminoVaultData.vault),
|
|
600
|
+
vault: new web3.PublicKey(json.kaminoVaultData.vault),
|
|
514
601
|
reserves: json.kaminoVaultData.reserves.map((r) => ({
|
|
515
|
-
reserveAddress: new PublicKey(r.reserveAddress),
|
|
516
|
-
marketAddress: new PublicKey(r.marketAddress),
|
|
602
|
+
reserveAddress: new web3.PublicKey(r.reserveAddress),
|
|
603
|
+
marketAddress: new web3.PublicKey(r.marketAddress),
|
|
517
604
|
})),
|
|
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),
|
|
605
|
+
tokenVault: new web3.PublicKey(json.kaminoVaultData.tokenVault),
|
|
606
|
+
tokenMint: new web3.PublicKey(json.kaminoVaultData.tokenMint),
|
|
607
|
+
baseVaultAuthority: new web3.PublicKey(json.kaminoVaultData.baseVaultAuthority),
|
|
608
|
+
sharesMint: new web3.PublicKey(json.kaminoVaultData.sharesMint),
|
|
522
609
|
}
|
|
523
610
|
}
|
|
524
611
|
|
|
525
612
|
if (json.splStakePoolData) {
|
|
526
613
|
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),
|
|
614
|
+
stakePoolAddress: new web3.PublicKey(json.splStakePoolData.stakePoolAddress),
|
|
615
|
+
stakePoolProgramId: new web3.PublicKey(json.splStakePoolData.stakePoolProgramId),
|
|
616
|
+
validatorList: new web3.PublicKey(json.splStakePoolData.validatorList),
|
|
617
|
+
reserveStake: new web3.PublicKey(json.splStakePoolData.reserveStake),
|
|
618
|
+
managerFeeAccount: new web3.PublicKey(json.splStakePoolData.managerFeeAccount),
|
|
619
|
+
poolMint: new web3.PublicKey(json.splStakePoolData.poolMint),
|
|
533
620
|
}
|
|
534
621
|
}
|
|
535
622
|
|
|
@@ -539,11 +626,11 @@ export function fromAdditionalDataGenericJson(json: AdditionalDataGenericJson):
|
|
|
539
626
|
/** Helper function to extract fragmetric data from additional data */
|
|
540
627
|
export function getFragmetricDataFromAdditionalData(additionalData?: AdditionalDataGeneric):
|
|
541
628
|
| {
|
|
542
|
-
receiptTokenMint: PublicKey
|
|
543
|
-
wrappedTokenMint: PublicKey
|
|
629
|
+
receiptTokenMint: web3.PublicKey
|
|
630
|
+
wrappedTokenMint: web3.PublicKey
|
|
544
631
|
}
|
|
545
632
|
| undefined {
|
|
546
633
|
if (!additionalData) return undefined
|
|
547
634
|
|
|
548
635
|
return additionalData.fragmetricData
|
|
549
|
-
}
|
|
636
|
+
}
|