@exponent-labs/exponent-types 0.1.8 → 0.9.0
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/common.d.ts +8 -7
- package/build/cpi.d.ts +2 -2
- package/build/cpi.js +2 -2
- package/build/cpi.js.map +1 -1
- package/build/exponent-vaults.d.ts +107 -0
- package/build/exponent-vaults.js +6 -0
- package/build/exponent-vaults.js.map +1 -0
- package/build/flavor.d.ts +23 -23
- package/build/generic.d.ts +44 -35
- package/build/generic.js +31 -27
- package/build/generic.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/jito-restaking.d.ts +13 -12
- package/build/kamino.d.ts +26 -26
- package/build/marginfi.d.ts +18 -17
- package/build/orderbook.d.ts +33 -27
- package/build/orderbook.js +3 -3
- package/build/orderbook.js.map +1 -1
- package/build/perena.d.ts +13 -12
- package/build/vault.d.ts +16 -15
- package/package.json +4 -3
- package/src/common.ts +9 -8
- package/src/cpi.ts +3 -3
- package/src/flavor.ts +21 -22
- package/src/generic.ts +73 -64
- package/src/index.ts +1 -1
- package/src/jito-restaking.ts +14 -14
- package/src/kamino.ts +27 -27
- package/src/marginfi.ts +19 -19
- package/src/orderbook.ts +35 -27
- package/src/perena.ts +14 -14
- package/src/vault.ts +17 -17
package/build/common.d.ts
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PublicKey } from '@solana/web3.js';
|
|
2
|
+
import BN from 'bn.js';
|
|
2
3
|
export interface SyEmissionRaw {
|
|
3
|
-
mint:
|
|
4
|
+
mint: PublicKey;
|
|
4
5
|
index: AnchorizedPNum;
|
|
5
6
|
lastSeenTotalAccruedEmissions: BN;
|
|
6
7
|
totalClaimedEmissions: BN;
|
|
7
|
-
tokenProgram:
|
|
8
|
-
escrowAccount:
|
|
8
|
+
tokenProgram: PublicKey;
|
|
9
|
+
escrowAccount: PublicKey;
|
|
9
10
|
treasuryEmission: BN;
|
|
10
11
|
lastSeenIndex: AnchorizedPNum;
|
|
11
12
|
}
|
|
12
13
|
export interface SyEmissionRaw2 {
|
|
13
|
-
mint:
|
|
14
|
+
mint: PublicKey;
|
|
14
15
|
index: AnchorizedPNum;
|
|
15
16
|
last_seen_total_accrued_emissions: BN;
|
|
16
17
|
total_claimed_emissions: BN;
|
|
17
|
-
token_program:
|
|
18
|
-
escrow_account:
|
|
18
|
+
token_program: PublicKey;
|
|
19
|
+
escrow_account: PublicKey;
|
|
19
20
|
treasury_emission: BN;
|
|
20
21
|
last_seen_index: AnchorizedPNum;
|
|
21
22
|
}
|
package/build/cpi.d.ts
CHANGED
package/build/cpi.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.serializeCpiAccountsRaw = exports.deserializeCpiAccountsRaw = void 0;
|
|
4
|
-
const
|
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
5
5
|
function deserializeCpiAccountsRaw(serialized) {
|
|
6
6
|
const deserializeAccountInfo = (accountInfo) => ({
|
|
7
|
-
pubkey: new
|
|
7
|
+
pubkey: new web3_js_1.PublicKey(accountInfo.pubkey),
|
|
8
8
|
isSigner: accountInfo.isSigner,
|
|
9
9
|
isWritable: accountInfo.isWritable,
|
|
10
10
|
});
|
package/build/cpi.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cpi.js","sourceRoot":"","sources":["../src/cpi.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"cpi.js","sourceRoot":"","sources":["../src/cpi.ts"],"names":[],"mappings":";;;AAAA,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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C;AAdD,0DAcC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { web3 } from "@coral-xyz/anchor";
|
|
2
|
+
/** Seed used for withdrawal PDA derivation on-chain. */
|
|
3
|
+
export declare const WITHDRAWAL_ACCOUNT_SEED: "withdrawal";
|
|
4
|
+
/** Unique vault identifier is stored as 8 bytes on-chain. */
|
|
5
|
+
export type VaultSeedId = Uint8Array | [number, number, number, number, number, number, number, number];
|
|
6
|
+
export interface VaultFinancials {
|
|
7
|
+
/** Expiration timestamp mirrored from the underlying PT vault. */
|
|
8
|
+
expirationTs: number;
|
|
9
|
+
/** Total LP that has been minted. */
|
|
10
|
+
lpBalance: bigint;
|
|
11
|
+
/** Assets under management tracked in base units. */
|
|
12
|
+
aumInBase: bigint;
|
|
13
|
+
}
|
|
14
|
+
export interface OrderbookEntry {
|
|
15
|
+
/** Orderbook PDA powering the routing for this vault. */
|
|
16
|
+
orderbook: web3.PublicKey;
|
|
17
|
+
/** User escrow index that belongs to the vault inside the orderbook. */
|
|
18
|
+
userEscrowIdx: number;
|
|
19
|
+
/** Mint of the SY leg this entry routes into. */
|
|
20
|
+
mintSy: web3.PublicKey;
|
|
21
|
+
/** Offer indices that belong to the vault inside the target orderbook. */
|
|
22
|
+
offerIdxVec: number[];
|
|
23
|
+
/** PT priced in the base asset (0–1.0 range). */
|
|
24
|
+
ptPriceInAsset: number;
|
|
25
|
+
/** Total liquidity committed on this orderbook leg. */
|
|
26
|
+
totalLiquidity: bigint;
|
|
27
|
+
/** Bitmap describing the orderbook flavor/config. */
|
|
28
|
+
orderbookFlag: number;
|
|
29
|
+
}
|
|
30
|
+
export type SyEntryType = "generic" | "jitoSol";
|
|
31
|
+
export interface SyCpiInterfaceContext {
|
|
32
|
+
/** Index inside the shared ALT that holds the account key. */
|
|
33
|
+
altIndex: number;
|
|
34
|
+
isSigner: boolean;
|
|
35
|
+
isWritable: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface CpiSyAccounts {
|
|
38
|
+
/** Packed account meta information for `getSyState` CPI validation. */
|
|
39
|
+
getSyState: SyCpiInterfaceContext[];
|
|
40
|
+
}
|
|
41
|
+
export interface SyEntry {
|
|
42
|
+
/** SY mint handled by the entry. */
|
|
43
|
+
mintSy: web3.PublicKey;
|
|
44
|
+
/** SPL account controlled by Squads (user deposits flow here first). */
|
|
45
|
+
tokenSquadsAccount: web3.PublicKey;
|
|
46
|
+
/** Escrow owned by the vault PDA that earmarks SY for withdrawals. */
|
|
47
|
+
tokenEscrowSy: web3.PublicKey;
|
|
48
|
+
/** Basis points share of this entry relative to total deposits. */
|
|
49
|
+
shareBp: number;
|
|
50
|
+
/** Liquidity currently allocated to the entry (in SY). */
|
|
51
|
+
currentLiquidity: bigint;
|
|
52
|
+
/** Anchor point for LP/SY conversion math. */
|
|
53
|
+
rateAnchor: number;
|
|
54
|
+
/** Type hint describing which SY program is behind the entry. */
|
|
55
|
+
syType: SyEntryType;
|
|
56
|
+
/** CPI account lists used for validation. */
|
|
57
|
+
syCpiAccounts: CpiSyAccounts;
|
|
58
|
+
/** Flag stored on-chain for mint-level bookkeeping. */
|
|
59
|
+
mintFlag: number;
|
|
60
|
+
}
|
|
61
|
+
export interface ExponentVaultState {
|
|
62
|
+
addressLookupTable: web3.PublicKey;
|
|
63
|
+
manager: web3.PublicKey;
|
|
64
|
+
squadsSettings: web3.PublicKey;
|
|
65
|
+
/** All configured SY entries (one per underlying SY mint). */
|
|
66
|
+
syEntries: SyEntry[];
|
|
67
|
+
mintLp: web3.PublicKey;
|
|
68
|
+
tokenLpEscrow: web3.PublicKey;
|
|
69
|
+
feeTreasuryLpBps: number;
|
|
70
|
+
/** PDA authority for CPI calls. */
|
|
71
|
+
selfAddress: web3.PublicKey;
|
|
72
|
+
/** Single byte bump used when deriving the authority PDA. */
|
|
73
|
+
signerBump: number;
|
|
74
|
+
/** Bitfield of vault runtime flags. */
|
|
75
|
+
statusFlags: number;
|
|
76
|
+
financials: VaultFinancials;
|
|
77
|
+
/** Tracks cross-program liquidity parked on orderbooks. */
|
|
78
|
+
orderbookEntries: OrderbookEntry[];
|
|
79
|
+
maxLpSupply: bigint;
|
|
80
|
+
lpEscrowAmount: bigint;
|
|
81
|
+
seedId: VaultSeedId;
|
|
82
|
+
}
|
|
83
|
+
/** Type of withdrawal: either SOL or SY tokens. */
|
|
84
|
+
export type WithdrawalType = "sol" | "sy";
|
|
85
|
+
/** Individual fill entry tracking SY mint and amount distributed. */
|
|
86
|
+
export interface WithdrawalSyFill {
|
|
87
|
+
/** SY mint that was used for this fill. */
|
|
88
|
+
mintSy: web3.PublicKey;
|
|
89
|
+
/** Amount of SY tokens distributed in this fill. */
|
|
90
|
+
syAmount: bigint;
|
|
91
|
+
}
|
|
92
|
+
export interface WithdrawalAccount {
|
|
93
|
+
vault: web3.PublicKey;
|
|
94
|
+
owner: web3.PublicKey;
|
|
95
|
+
withdrawalId: bigint;
|
|
96
|
+
/** Type of withdrawal being processed. */
|
|
97
|
+
withdrawalType: WithdrawalType;
|
|
98
|
+
lpAmountRequested: bigint;
|
|
99
|
+
lpAmountRemaining: bigint;
|
|
100
|
+
/** Vector of fills tracking how the withdrawal was satisfied. */
|
|
101
|
+
fills: WithdrawalSyFill[];
|
|
102
|
+
createdAt: number;
|
|
103
|
+
updatedAt: number;
|
|
104
|
+
bump: number;
|
|
105
|
+
/** Reserved bytes retained for future extensions. */
|
|
106
|
+
reserved: Uint8Array | [number, number, number, number, number, number, number];
|
|
107
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WITHDRAWAL_ACCOUNT_SEED = void 0;
|
|
4
|
+
/** Seed used for withdrawal PDA derivation on-chain. */
|
|
5
|
+
exports.WITHDRAWAL_ACCOUNT_SEED = "withdrawal";
|
|
6
|
+
//# sourceMappingURL=exponent-vaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exponent-vaults.js","sourceRoot":"","sources":["../src/exponent-vaults.ts"],"names":[],"mappings":";;;AAEA,wDAAwD;AAC3C,QAAA,uBAAuB,GAAG,YAAqB,CAAA"}
|
package/build/flavor.d.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { web3 } from "@coral-xyz/anchor";
|
|
2
1
|
import { MfiSyStateJson, MfiSyState } from "./marginfi";
|
|
3
2
|
import { KaminoSyState, KaminoSyStateJson } from "./kamino";
|
|
4
3
|
import { JitoRestakingSyState, JitoRestakingSyStateJson } from "./jito-restaking";
|
|
5
4
|
import { AnchorizedPNum } from "./common";
|
|
6
5
|
import { PerenaSyState, PerenaSyStateJson } from "./perena";
|
|
7
6
|
import { GenericSyState, GenericSyStateJson } from "./generic";
|
|
7
|
+
import { PublicKey, TransactionInstruction } from "@solana/web3.js";
|
|
8
8
|
export type FlavorDiscriminator = "marginfi" | "kamino" | "jitoRestaking" | "perena" | "generic";
|
|
9
9
|
export type MintSyArgs = {
|
|
10
10
|
amountBase: string;
|
|
11
|
-
depositor:
|
|
12
|
-
depositorBaseTokenAccount:
|
|
13
|
-
depositorSyTokenAccount:
|
|
11
|
+
depositor: PublicKey;
|
|
12
|
+
depositorBaseTokenAccount: PublicKey;
|
|
13
|
+
depositorSyTokenAccount: PublicKey;
|
|
14
14
|
};
|
|
15
15
|
export type RedeemSyArgs = {
|
|
16
16
|
amountSy: string;
|
|
17
|
-
redeemer:
|
|
18
|
-
redeemerBaseTokenAccount:
|
|
19
|
-
redeemerSyTokenAccount:
|
|
17
|
+
redeemer: PublicKey;
|
|
18
|
+
redeemerBaseTokenAccount: PublicKey;
|
|
19
|
+
redeemerSyTokenAccount: PublicKey;
|
|
20
20
|
};
|
|
21
21
|
export type InterfaceInstructionArgs = {
|
|
22
|
-
signer:
|
|
22
|
+
signer: PublicKey;
|
|
23
23
|
amountBase: string;
|
|
24
24
|
};
|
|
25
25
|
type BaseFlavorState = {
|
|
26
26
|
flavor: FlavorDiscriminator;
|
|
27
27
|
currentSyExchangeRate: number;
|
|
28
|
-
mintBase:
|
|
29
|
-
baseTokenProgram:
|
|
28
|
+
mintBase: PublicKey;
|
|
29
|
+
baseTokenProgram: PublicKey;
|
|
30
30
|
emissions: {
|
|
31
31
|
exchangeRate: AnchorizedPNum;
|
|
32
|
-
mint:
|
|
33
|
-
tokenProgram:
|
|
32
|
+
mint: PublicKey;
|
|
33
|
+
tokenProgram: PublicKey;
|
|
34
34
|
}[];
|
|
35
35
|
};
|
|
36
36
|
type BaseFlavorStateJson = {
|
|
@@ -45,16 +45,16 @@ type BaseFlavorStateJson = {
|
|
|
45
45
|
}[];
|
|
46
46
|
};
|
|
47
47
|
interface BaseFlavorTrait {
|
|
48
|
-
ixMintSy: (args: MintSyArgs) => Promise<
|
|
49
|
-
ixRedeemSy: (args: RedeemSyArgs) => Promise<
|
|
48
|
+
ixMintSy: (args: MintSyArgs) => Promise<TransactionInstruction>;
|
|
49
|
+
ixRedeemSy: (args: RedeemSyArgs) => Promise<TransactionInstruction>;
|
|
50
50
|
preIxs: (args: {
|
|
51
|
-
signer:
|
|
52
|
-
}) => Promise<
|
|
51
|
+
signer: PublicKey;
|
|
52
|
+
}) => Promise<TransactionInstruction[]>;
|
|
53
53
|
postIxs: (args: {
|
|
54
|
-
signer:
|
|
55
|
-
}) => Promise<
|
|
56
|
-
preMintSyIx?: (args: InterfaceInstructionArgs) => Promise<
|
|
57
|
-
postRedeemSyIx?: (args: InterfaceInstructionArgs) => Promise<
|
|
54
|
+
signer: PublicKey;
|
|
55
|
+
}) => Promise<TransactionInstruction[]>;
|
|
56
|
+
preMintSyIx?: (args: InterfaceInstructionArgs) => Promise<TransactionInstruction[]>;
|
|
57
|
+
postRedeemSyIx?: (args: InterfaceInstructionArgs) => Promise<TransactionInstruction[]>;
|
|
58
58
|
}
|
|
59
59
|
export interface FlavorKaminoState extends BaseFlavorState {
|
|
60
60
|
flavor: "kamino";
|
|
@@ -62,9 +62,9 @@ export interface FlavorKaminoState extends BaseFlavorState {
|
|
|
62
62
|
}
|
|
63
63
|
export interface FlavorMarginfiState extends BaseFlavorState {
|
|
64
64
|
flavor: "marginfi";
|
|
65
|
-
bank:
|
|
66
|
-
emissionMint?:
|
|
67
|
-
emissionTokenProgram?:
|
|
65
|
+
bank: PublicKey;
|
|
66
|
+
emissionMint?: PublicKey;
|
|
67
|
+
emissionTokenProgram?: PublicKey;
|
|
68
68
|
mfiSyState: MfiSyState;
|
|
69
69
|
}
|
|
70
70
|
export interface FlavorJitoRestakingState extends BaseFlavorState {
|
package/build/generic.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
|
-
import {
|
|
3
|
+
import { PublicKey } from "@solana/web3.js";
|
|
4
4
|
import { AnchorizedPNum, SyEmissionJson, SyEmissionRaw } from "./common";
|
|
5
5
|
import { StakePoolAccount } from "@solana/spl-stake-pool";
|
|
6
|
+
import BN from 'bn.js';
|
|
6
7
|
export type InterfaceTypeGeneric = {
|
|
7
8
|
pyth: {
|
|
8
9
|
lastSlot: BN;
|
|
@@ -51,6 +52,10 @@ export type InterfaceTypeGeneric = {
|
|
|
51
52
|
};
|
|
52
53
|
} | {
|
|
53
54
|
ore: Record<string, never>;
|
|
55
|
+
} | {
|
|
56
|
+
chainlink: {
|
|
57
|
+
padding: number[];
|
|
58
|
+
};
|
|
54
59
|
};
|
|
55
60
|
export type InterfaceTypeGenericJson = {
|
|
56
61
|
pyth: {
|
|
@@ -100,39 +105,43 @@ export type InterfaceTypeGenericJson = {
|
|
|
100
105
|
};
|
|
101
106
|
} | {
|
|
102
107
|
ore: Record<string, never>;
|
|
108
|
+
} | {
|
|
109
|
+
chainlink: {
|
|
110
|
+
padding: number[];
|
|
111
|
+
};
|
|
103
112
|
};
|
|
104
113
|
/** Additional data that different interface types may need */
|
|
105
114
|
export interface AdditionalDataGeneric {
|
|
106
115
|
fragmetricData?: {
|
|
107
|
-
receiptTokenMint:
|
|
108
|
-
wrappedTokenMint:
|
|
116
|
+
receiptTokenMint: PublicKey;
|
|
117
|
+
wrappedTokenMint: PublicKey;
|
|
109
118
|
};
|
|
110
119
|
jupiterLendData?: {
|
|
111
|
-
baseTokenMint:
|
|
112
|
-
tokenReservesLiquidity:
|
|
113
|
-
lendingSupplyPosition:
|
|
114
|
-
rewardsRateModel:
|
|
115
|
-
rateModel:
|
|
120
|
+
baseTokenMint: PublicKey;
|
|
121
|
+
tokenReservesLiquidity: PublicKey;
|
|
122
|
+
lendingSupplyPosition: PublicKey;
|
|
123
|
+
rewardsRateModel: PublicKey;
|
|
124
|
+
rateModel: PublicKey;
|
|
116
125
|
};
|
|
117
126
|
kaminoVaultData?: {
|
|
118
|
-
vault:
|
|
127
|
+
vault: PublicKey;
|
|
119
128
|
reserves: {
|
|
120
|
-
reserveAddress:
|
|
121
|
-
marketAddress:
|
|
129
|
+
reserveAddress: PublicKey;
|
|
130
|
+
marketAddress: PublicKey;
|
|
122
131
|
}[];
|
|
123
|
-
tokenVault:
|
|
124
|
-
tokenMint:
|
|
125
|
-
baseVaultAuthority:
|
|
126
|
-
sharesMint:
|
|
132
|
+
tokenVault: PublicKey;
|
|
133
|
+
tokenMint: PublicKey;
|
|
134
|
+
baseVaultAuthority: PublicKey;
|
|
135
|
+
sharesMint: PublicKey;
|
|
127
136
|
};
|
|
128
137
|
splStakePoolData?: {
|
|
129
138
|
stakePoolAccount?: StakePoolAccount;
|
|
130
|
-
stakePoolAddress:
|
|
131
|
-
stakePoolProgramId:
|
|
132
|
-
validatorList:
|
|
133
|
-
reserveStake:
|
|
134
|
-
managerFeeAccount:
|
|
135
|
-
poolMint:
|
|
139
|
+
stakePoolAddress: PublicKey;
|
|
140
|
+
stakePoolProgramId: PublicKey;
|
|
141
|
+
validatorList: PublicKey;
|
|
142
|
+
reserveStake: PublicKey;
|
|
143
|
+
managerFeeAccount: PublicKey;
|
|
144
|
+
poolMint: PublicKey;
|
|
136
145
|
};
|
|
137
146
|
}
|
|
138
147
|
/** JSON version of additional data */
|
|
@@ -171,7 +180,7 @@ export interface AdditionalDataGenericJson {
|
|
|
171
180
|
export interface Hook {
|
|
172
181
|
enabled: boolean;
|
|
173
182
|
interfaceEmissionsAccountsUntil: number;
|
|
174
|
-
programId:
|
|
183
|
+
programId: PublicKey;
|
|
175
184
|
preMintHookDiscriminator: number[];
|
|
176
185
|
postRedeemHookDiscriminator: number[];
|
|
177
186
|
}
|
|
@@ -187,12 +196,12 @@ export interface HookRaw {
|
|
|
187
196
|
interfaceEmissionsAccountsUntil: number;
|
|
188
197
|
preMintHookDiscriminator: Buffer;
|
|
189
198
|
postRedeemHookDiscriminator: Buffer;
|
|
190
|
-
programId:
|
|
199
|
+
programId: PublicKey;
|
|
191
200
|
}
|
|
192
201
|
export interface GenericSyState {
|
|
193
|
-
selfAddress:
|
|
202
|
+
selfAddress: PublicKey;
|
|
194
203
|
account: GenericSyMetaAccount;
|
|
195
|
-
tokenProgramBase:
|
|
204
|
+
tokenProgramBase: PublicKey;
|
|
196
205
|
syRate: number;
|
|
197
206
|
additionalData?: AdditionalDataGeneric;
|
|
198
207
|
}
|
|
@@ -222,10 +231,10 @@ export interface GenericSyMetaAccountJson {
|
|
|
222
231
|
index: number;
|
|
223
232
|
}
|
|
224
233
|
export interface GenericSyMetaAccount {
|
|
225
|
-
mintSy:
|
|
226
|
-
yieldBearingMint:
|
|
227
|
-
tokenSyEscrow:
|
|
228
|
-
interfaceAccounts:
|
|
234
|
+
mintSy: PublicKey;
|
|
235
|
+
yieldBearingMint: PublicKey;
|
|
236
|
+
tokenSyEscrow: PublicKey;
|
|
237
|
+
interfaceAccounts: PublicKey[];
|
|
229
238
|
interfaceType: InterfaceTypeGeneric;
|
|
230
239
|
maxSySupply: BN;
|
|
231
240
|
minMintSize: BN;
|
|
@@ -235,15 +244,15 @@ export interface GenericSyMetaAccount {
|
|
|
235
244
|
index: AnchorizedPNum;
|
|
236
245
|
}
|
|
237
246
|
export interface GenericSyMetaAccountRaw {
|
|
238
|
-
mintSy:
|
|
239
|
-
yieldBearingMint:
|
|
240
|
-
tokenSyEscrow:
|
|
247
|
+
mintSy: PublicKey;
|
|
248
|
+
yieldBearingMint: PublicKey;
|
|
249
|
+
tokenSyEscrow: PublicKey;
|
|
241
250
|
maxSySupply: BN;
|
|
242
251
|
minMintSize: BN;
|
|
243
252
|
minRedeemSize: BN;
|
|
244
253
|
selfAddressBump: number[];
|
|
245
254
|
emissions: SyEmissionRaw[];
|
|
246
|
-
interfaceAccounts:
|
|
255
|
+
interfaceAccounts: PublicKey[];
|
|
247
256
|
interfaceType: InterfaceTypeGeneric;
|
|
248
257
|
index: AnchorizedPNum;
|
|
249
258
|
hook: HookRaw;
|
|
@@ -263,6 +272,6 @@ export declare function toAdditionalDataGenericJson(additionalData: AdditionalDa
|
|
|
263
272
|
export declare function fromAdditionalDataGenericJson(json: AdditionalDataGenericJson): AdditionalDataGeneric;
|
|
264
273
|
/** Helper function to extract fragmetric data from additional data */
|
|
265
274
|
export declare function getFragmetricDataFromAdditionalData(additionalData?: AdditionalDataGeneric): {
|
|
266
|
-
receiptTokenMint:
|
|
267
|
-
wrappedTokenMint:
|
|
275
|
+
receiptTokenMint: PublicKey;
|
|
276
|
+
wrappedTokenMint: PublicKey;
|
|
268
277
|
} | undefined;
|
package/build/generic.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.getFragmetricDataFromAdditionalData = exports.fromAdditionalDataGenericJson = exports.toAdditionalDataGenericJson = exports.fromHookJson = exports.toHookJson = exports.fromInterfaceTypeGenericJson = exports.toInterfaceTypeGenericJson = exports.deserializeGenericSyMetaAccountRaw = void 0;
|
|
4
|
-
const
|
|
7
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
8
|
+
const bn_js_1 = __importDefault(require("bn.js"));
|
|
5
9
|
function deserializeGenericSyMetaAccountRaw(raw) {
|
|
6
10
|
return {
|
|
7
11
|
mintSy: raw.mintSy,
|
|
@@ -73,8 +77,8 @@ function fromInterfaceTypeGenericJson(json) {
|
|
|
73
77
|
if ("pyth" in json) {
|
|
74
78
|
return {
|
|
75
79
|
pyth: {
|
|
76
|
-
lastSlot: new
|
|
77
|
-
maximumAgeSeconds: new
|
|
80
|
+
lastSlot: new bn_js_1.default(json.pyth.lastSlot),
|
|
81
|
+
maximumAgeSeconds: new bn_js_1.default(json.pyth.maximumAgeSeconds),
|
|
78
82
|
},
|
|
79
83
|
};
|
|
80
84
|
}
|
|
@@ -82,8 +86,8 @@ function fromInterfaceTypeGenericJson(json) {
|
|
|
82
86
|
return {
|
|
83
87
|
jupiterPerps: {
|
|
84
88
|
lastFeeUsdResetUnixTimestamp: parseInt(json.jupiterPerps.lastFeeUsdResetUnixTimestamp),
|
|
85
|
-
lastRealizedFeeUsd: new
|
|
86
|
-
lastAumUsd: new
|
|
89
|
+
lastRealizedFeeUsd: new bn_js_1.default(json.jupiterPerps.lastRealizedFeeUsd),
|
|
90
|
+
lastAumUsd: new bn_js_1.default(json.jupiterPerps.lastAumUsd),
|
|
87
91
|
lastRealizedFeeUsdUpdateUnixTimestamp: parseInt(json.jupiterPerps.lastRealizedFeeUsdUpdateUnixTimestamp),
|
|
88
92
|
},
|
|
89
93
|
};
|
|
@@ -91,7 +95,7 @@ function fromInterfaceTypeGenericJson(json) {
|
|
|
91
95
|
if ("adrena" in json) {
|
|
92
96
|
return {
|
|
93
97
|
adrena: {
|
|
94
|
-
previousTotalFees: new
|
|
98
|
+
previousTotalFees: new bn_js_1.default(json.adrena.previousTotalFees),
|
|
95
99
|
},
|
|
96
100
|
};
|
|
97
101
|
}
|
|
@@ -128,7 +132,7 @@ function fromHookJson(json) {
|
|
|
128
132
|
return {
|
|
129
133
|
enabled: json.enabled,
|
|
130
134
|
interfaceEmissionsAccountsUntil: json.interfaceEmissionsAccountsUntil,
|
|
131
|
-
programId: new
|
|
135
|
+
programId: new web3_js_1.PublicKey(json.programId),
|
|
132
136
|
preMintHookDiscriminator: json.preMintHookDiscriminator,
|
|
133
137
|
postRedeemHookDiscriminator: json.postRedeemHookDiscriminator,
|
|
134
138
|
};
|
|
@@ -183,40 +187,40 @@ function fromAdditionalDataGenericJson(json) {
|
|
|
183
187
|
const result = {};
|
|
184
188
|
if (json.fragmetricData) {
|
|
185
189
|
result.fragmetricData = {
|
|
186
|
-
receiptTokenMint: new
|
|
187
|
-
wrappedTokenMint: new
|
|
190
|
+
receiptTokenMint: new web3_js_1.PublicKey(json.fragmetricData.receiptTokenMint),
|
|
191
|
+
wrappedTokenMint: new web3_js_1.PublicKey(json.fragmetricData.wrappedTokenMint),
|
|
188
192
|
};
|
|
189
193
|
}
|
|
190
194
|
if (json.jupiterLendData) {
|
|
191
195
|
result.jupiterLendData = {
|
|
192
|
-
baseTokenMint: new
|
|
193
|
-
tokenReservesLiquidity: new
|
|
194
|
-
lendingSupplyPosition: new
|
|
195
|
-
rewardsRateModel: new
|
|
196
|
-
rateModel: new
|
|
196
|
+
baseTokenMint: new web3_js_1.PublicKey(json.jupiterLendData.baseTokenMint),
|
|
197
|
+
tokenReservesLiquidity: new web3_js_1.PublicKey(json.jupiterLendData.tokenReservesLiquidity),
|
|
198
|
+
lendingSupplyPosition: new web3_js_1.PublicKey(json.jupiterLendData.lendingSupplyPosition),
|
|
199
|
+
rewardsRateModel: new web3_js_1.PublicKey(json.jupiterLendData.rewardsRateModel),
|
|
200
|
+
rateModel: new web3_js_1.PublicKey(json.jupiterLendData.rateModel),
|
|
197
201
|
};
|
|
198
202
|
}
|
|
199
203
|
if (json.kaminoVaultData) {
|
|
200
204
|
result.kaminoVaultData = {
|
|
201
|
-
vault: new
|
|
205
|
+
vault: new web3_js_1.PublicKey(json.kaminoVaultData.vault),
|
|
202
206
|
reserves: json.kaminoVaultData.reserves.map((r) => ({
|
|
203
|
-
reserveAddress: new
|
|
204
|
-
marketAddress: new
|
|
207
|
+
reserveAddress: new web3_js_1.PublicKey(r.reserveAddress),
|
|
208
|
+
marketAddress: new web3_js_1.PublicKey(r.marketAddress),
|
|
205
209
|
})),
|
|
206
|
-
tokenVault: new
|
|
207
|
-
tokenMint: new
|
|
208
|
-
baseVaultAuthority: new
|
|
209
|
-
sharesMint: new
|
|
210
|
+
tokenVault: new web3_js_1.PublicKey(json.kaminoVaultData.tokenVault),
|
|
211
|
+
tokenMint: new web3_js_1.PublicKey(json.kaminoVaultData.tokenMint),
|
|
212
|
+
baseVaultAuthority: new web3_js_1.PublicKey(json.kaminoVaultData.baseVaultAuthority),
|
|
213
|
+
sharesMint: new web3_js_1.PublicKey(json.kaminoVaultData.sharesMint),
|
|
210
214
|
};
|
|
211
215
|
}
|
|
212
216
|
if (json.splStakePoolData) {
|
|
213
217
|
result.splStakePoolData = {
|
|
214
|
-
stakePoolAddress: new
|
|
215
|
-
stakePoolProgramId: new
|
|
216
|
-
validatorList: new
|
|
217
|
-
reserveStake: new
|
|
218
|
-
managerFeeAccount: new
|
|
219
|
-
poolMint: new
|
|
218
|
+
stakePoolAddress: new web3_js_1.PublicKey(json.splStakePoolData.stakePoolAddress),
|
|
219
|
+
stakePoolProgramId: new web3_js_1.PublicKey(json.splStakePoolData.stakePoolProgramId),
|
|
220
|
+
validatorList: new web3_js_1.PublicKey(json.splStakePoolData.validatorList),
|
|
221
|
+
reserveStake: new web3_js_1.PublicKey(json.splStakePoolData.reserveStake),
|
|
222
|
+
managerFeeAccount: new web3_js_1.PublicKey(json.splStakePoolData.managerFeeAccount),
|
|
223
|
+
poolMint: new web3_js_1.PublicKey(json.splStakePoolData.poolMint),
|
|
220
224
|
};
|
|
221
225
|
}
|
|
222
226
|
return result;
|
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":";;;;;;AAAA,6CAA2C;AAG3C,kDAAsB;AAgTtB,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,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,GAAG,CAAC,IAAI,CAAC,SAAS;SAC9B;KACF,CAAA;AACH,CAAC;AApBD,gFAoBC;AAED,+DAA+D;AAC/D,SAAgB,0BAA0B,CAAC,aAAmC;IAC5E,IAAI,MAAM,IAAI,aAAa,EAAE,CAAC;QAC5B,OAAO;YACL,IAAI,EAAE;gBACJ,QAAQ,EAAE,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;gBAChD,iBAAiB,EAAE,aAAa,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,EAAE;aACnE;SACF,CAAA;IACH,CA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AAE,IAAI,mBAAS,CAAC,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC;YAC1E,UAAU,EAAE,IAAI,mBAAS,CAAC,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC;SAC3D,CAAA;IACH,CAAC;IAED,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC1B,MAAM,CAAC,gBAAgB,GAAG;YACxB,gBAAgB,EAAE,IAAI,mBAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,gBAAgB,CAAC;YACvE,kBAAkB,EAAE,IAAI,mBAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC;YAC3E,aAAa,EAAE,IAAI,mBAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC;YACjE,YAAY,EAAE,IAAI,mBAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC;YAC/D,iBAAiB,EAAE,IAAI,mBAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC;YACzE,QAAQ,EAAE,IAAI,mBAAS,CAAC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC;SACxD,CAAA;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AA9CD,sEA8CC;AAED,sEAAsE;AACtE,SAAgB,mCAAmC,CAAC,cAAsC;IAMxF,IAAI,CAAC,cAAc;QAAE,OAAO,SAAS,CAAA;IAErC,OAAO,cAAc,CAAC,cAAc,CAAA;AACtC,CAAC;AATD,kFASC"}
|
package/build/index.d.ts
CHANGED
|
@@ -1,34 +1,35 @@
|
|
|
1
|
-
import { BN, web3 } from "@coral-xyz/anchor";
|
|
2
1
|
import { SyEmissionRaw, SyEmissionJson } from "./common";
|
|
2
|
+
import { PublicKey } from "@solana/web3.js";
|
|
3
|
+
import BN from 'bn.js';
|
|
3
4
|
export interface InterfaceType {
|
|
4
5
|
splStakePool: {};
|
|
5
6
|
}
|
|
6
7
|
export interface JitoRestakingSyState {
|
|
7
|
-
selfAddress:
|
|
8
|
+
selfAddress: PublicKey;
|
|
8
9
|
account: JitoRestakingSyMetaAccount;
|
|
9
10
|
/** The value of SY tokens in terms of the base asset */
|
|
10
11
|
syRate: string;
|
|
11
12
|
underlyingExchangeRate: number;
|
|
12
|
-
mintBase:
|
|
13
|
-
tokenProgramBase:
|
|
13
|
+
mintBase: PublicKey;
|
|
14
|
+
tokenProgramBase: PublicKey;
|
|
14
15
|
}
|
|
15
16
|
export interface JitoRestakingSyMetaAccountRaw {
|
|
16
|
-
jitoVault:
|
|
17
|
-
mintSy:
|
|
18
|
-
tokenSyEscrow:
|
|
17
|
+
jitoVault: PublicKey;
|
|
18
|
+
mintSy: PublicKey;
|
|
19
|
+
tokenSyEscrow: PublicKey;
|
|
19
20
|
maxSySupply: BN;
|
|
20
21
|
minMintSize: BN;
|
|
21
22
|
minRedeemSize: BN;
|
|
22
23
|
selfAddressBump: number[];
|
|
23
24
|
emissions: SyEmissionRaw[];
|
|
24
|
-
interfaceAccounts:
|
|
25
|
+
interfaceAccounts: PublicKey[];
|
|
25
26
|
interfaceType: InterfaceType;
|
|
26
27
|
}
|
|
27
28
|
export interface JitoRestakingSyMetaAccount {
|
|
28
|
-
jitoVault:
|
|
29
|
-
mintSy:
|
|
30
|
-
tokenSyEscrow:
|
|
31
|
-
interfaceAccounts:
|
|
29
|
+
jitoVault: PublicKey;
|
|
30
|
+
mintSy: PublicKey;
|
|
31
|
+
tokenSyEscrow: PublicKey;
|
|
32
|
+
interfaceAccounts: PublicKey[];
|
|
32
33
|
interfaceType: InterfaceType;
|
|
33
34
|
maxSySupply: BN;
|
|
34
35
|
minMintSize: BN;
|