@exponent-labs/exponent-types 0.1.7 → 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 +34 -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 +94 -30
- package/build/generic.js +99 -9
- package/build/generic.js.map +1 -1
- package/build/index.d.ts +2 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/jito-restaking.d.ts +13 -12
- package/build/kamino.d.ts +27 -25
- package/build/marginfi.d.ts +18 -17
- package/build/orderbook.d.ts +151 -0
- package/build/orderbook.js +13 -0
- package/build/orderbook.js.map +1 -0
- package/build/perena.d.ts +13 -12
- package/build/vault.d.ts +53 -15
- package/package.json +4 -2
- package/src/common.ts +9 -8
- package/src/cpi.ts +43 -3
- package/src/flavor.ts +21 -22
- package/src/generic.ts +192 -35
- package/src/index.ts +3 -2
- package/src/jito-restaking.ts +14 -14
- package/src/kamino.ts +28 -26
- package/src/marginfi.ts +19 -19
- package/src/orderbook.ts +195 -0
- package/src/perena.ts +14 -14
- package/src/vault.ts +82 -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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PublicKey } from "@solana/web3.js";
|
|
2
2
|
export interface AccountInfo {
|
|
3
|
-
pubkey:
|
|
3
|
+
pubkey: PublicKey;
|
|
4
4
|
isSigner: boolean;
|
|
5
5
|
isWritable: boolean;
|
|
6
6
|
}
|
|
@@ -12,6 +12,14 @@ export interface CpiMeta<T> {
|
|
|
12
12
|
claimEmission: T[][];
|
|
13
13
|
getPositionState: T[];
|
|
14
14
|
}
|
|
15
|
+
/** Generic container for ExponentCore CPI account lists */
|
|
16
|
+
export interface ExponentCoreCpiMeta<T> {
|
|
17
|
+
depositYt: T[];
|
|
18
|
+
withdrawYt: T[];
|
|
19
|
+
stripSy: T[];
|
|
20
|
+
mergeSy: T[];
|
|
21
|
+
collectInterest: T[];
|
|
22
|
+
}
|
|
15
23
|
/** The on-chain storage for CPI accounts, which references an ALT */
|
|
16
24
|
export interface CpiAccountIndex {
|
|
17
25
|
/** Index in the Address Lookup Table */
|
|
@@ -21,8 +29,12 @@ export interface CpiAccountIndex {
|
|
|
21
29
|
}
|
|
22
30
|
/** Raw account infos for CPI that include the Pubkey */
|
|
23
31
|
export type CpiAccountsRaw = CpiMeta<AccountInfo>;
|
|
32
|
+
/** Raw account infos for CPI that include the Pubkey */
|
|
33
|
+
export type ExponentCoreCpiAccountsRaw = ExponentCoreCpiMeta<AccountInfo>;
|
|
24
34
|
/** This account is stored in state on the vault/market to track indexes in the ALT */
|
|
25
35
|
export type CpiAccountIndexes = CpiMeta<CpiAccountIndex>;
|
|
36
|
+
/** This account is stored in state on the vault/market to track indexes in the ALT */
|
|
37
|
+
export type ExponentCoreCpiIndexes = ExponentCoreCpiMeta<CpiAccountIndex>;
|
|
26
38
|
export interface CpiAccountsRawJson {
|
|
27
39
|
getSyState: AccountInfoJson[];
|
|
28
40
|
withdrawSy: AccountInfoJson[];
|
|
@@ -30,6 +42,13 @@ export interface CpiAccountsRawJson {
|
|
|
30
42
|
claimEmission: AccountInfoJson[][];
|
|
31
43
|
getPositionState: AccountInfoJson[];
|
|
32
44
|
}
|
|
45
|
+
export interface ExponentCoreCpiAccountsRawJson {
|
|
46
|
+
depositYt: AccountInfoJson[];
|
|
47
|
+
withdrawYt: AccountInfoJson[];
|
|
48
|
+
stripSy: AccountInfoJson[];
|
|
49
|
+
mergeSy: AccountInfoJson[];
|
|
50
|
+
collectInterest: AccountInfoJson[];
|
|
51
|
+
}
|
|
33
52
|
export type AccountInfoJson = {
|
|
34
53
|
pubkey: string;
|
|
35
54
|
isSigner: boolean;
|
|
@@ -37,3 +56,16 @@ export type AccountInfoJson = {
|
|
|
37
56
|
};
|
|
38
57
|
export declare function deserializeCpiAccountsRaw(serialized: CpiAccountsRawJson): CpiAccountsRaw;
|
|
39
58
|
export declare function serializeCpiAccountsRaw(cpiAccounts: CpiAccountsRaw): CpiAccountsRawJson;
|
|
59
|
+
/** MarketThree/CLMM only uses a subset of ExponentCore CPI accounts (strip and merge) */
|
|
60
|
+
export interface MarketCpiCoreMeta<T> {
|
|
61
|
+
stripSy: T[];
|
|
62
|
+
mergeSy: T[];
|
|
63
|
+
}
|
|
64
|
+
export interface MarketCpiCoreAccountsRawJson {
|
|
65
|
+
stripSy: AccountInfoJson[];
|
|
66
|
+
mergeSy: AccountInfoJson[];
|
|
67
|
+
}
|
|
68
|
+
/** Type alias for MarketThree's CPI core accounts with pubkeys */
|
|
69
|
+
export type MarketCpiCoreAccountsRaw = MarketCpiCoreMeta<AccountInfo>;
|
|
70
|
+
/** Type alias for MarketThree's CPI core accounts stored in state */
|
|
71
|
+
export type MarketCpiCoreIndexes = MarketCpiCoreMeta<CpiAccountIndex>;
|
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,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;AAbD,8DAaC;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;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,7 +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
|
+
import { StakePoolAccount } from "@solana/spl-stake-pool";
|
|
6
|
+
import BN from 'bn.js';
|
|
5
7
|
export type InterfaceTypeGeneric = {
|
|
6
8
|
pyth: {
|
|
7
9
|
lastSlot: BN;
|
|
@@ -44,6 +46,16 @@ export type InterfaceTypeGeneric = {
|
|
|
44
46
|
solstice: {
|
|
45
47
|
padding: number[];
|
|
46
48
|
};
|
|
49
|
+
} | {
|
|
50
|
+
reflect: {
|
|
51
|
+
padding: number[];
|
|
52
|
+
};
|
|
53
|
+
} | {
|
|
54
|
+
ore: Record<string, never>;
|
|
55
|
+
} | {
|
|
56
|
+
chainlink: {
|
|
57
|
+
padding: number[];
|
|
58
|
+
};
|
|
47
59
|
};
|
|
48
60
|
export type InterfaceTypeGenericJson = {
|
|
49
61
|
pyth: {
|
|
@@ -87,30 +99,49 @@ export type InterfaceTypeGenericJson = {
|
|
|
87
99
|
solstice: {
|
|
88
100
|
padding: number[];
|
|
89
101
|
};
|
|
102
|
+
} | {
|
|
103
|
+
reflect: {
|
|
104
|
+
padding: number[];
|
|
105
|
+
};
|
|
106
|
+
} | {
|
|
107
|
+
ore: Record<string, never>;
|
|
108
|
+
} | {
|
|
109
|
+
chainlink: {
|
|
110
|
+
padding: number[];
|
|
111
|
+
};
|
|
90
112
|
};
|
|
91
113
|
/** Additional data that different interface types may need */
|
|
92
114
|
export interface AdditionalDataGeneric {
|
|
93
115
|
fragmetricData?: {
|
|
94
|
-
receiptTokenMint:
|
|
95
|
-
wrappedTokenMint:
|
|
116
|
+
receiptTokenMint: PublicKey;
|
|
117
|
+
wrappedTokenMint: PublicKey;
|
|
96
118
|
};
|
|
97
119
|
jupiterLendData?: {
|
|
98
|
-
baseTokenMint:
|
|
99
|
-
tokenReservesLiquidity:
|
|
100
|
-
lendingSupplyPosition:
|
|
101
|
-
rewardsRateModel:
|
|
102
|
-
rateModel:
|
|
120
|
+
baseTokenMint: PublicKey;
|
|
121
|
+
tokenReservesLiquidity: PublicKey;
|
|
122
|
+
lendingSupplyPosition: PublicKey;
|
|
123
|
+
rewardsRateModel: PublicKey;
|
|
124
|
+
rateModel: PublicKey;
|
|
103
125
|
};
|
|
104
126
|
kaminoVaultData?: {
|
|
105
|
-
vault:
|
|
127
|
+
vault: PublicKey;
|
|
106
128
|
reserves: {
|
|
107
|
-
reserveAddress:
|
|
108
|
-
marketAddress:
|
|
129
|
+
reserveAddress: PublicKey;
|
|
130
|
+
marketAddress: PublicKey;
|
|
109
131
|
}[];
|
|
110
|
-
tokenVault:
|
|
111
|
-
tokenMint:
|
|
112
|
-
baseVaultAuthority:
|
|
113
|
-
sharesMint:
|
|
132
|
+
tokenVault: PublicKey;
|
|
133
|
+
tokenMint: PublicKey;
|
|
134
|
+
baseVaultAuthority: PublicKey;
|
|
135
|
+
sharesMint: PublicKey;
|
|
136
|
+
};
|
|
137
|
+
splStakePoolData?: {
|
|
138
|
+
stakePoolAccount?: StakePoolAccount;
|
|
139
|
+
stakePoolAddress: PublicKey;
|
|
140
|
+
stakePoolProgramId: PublicKey;
|
|
141
|
+
validatorList: PublicKey;
|
|
142
|
+
reserveStake: PublicKey;
|
|
143
|
+
managerFeeAccount: PublicKey;
|
|
144
|
+
poolMint: PublicKey;
|
|
114
145
|
};
|
|
115
146
|
}
|
|
116
147
|
/** JSON version of additional data */
|
|
@@ -122,12 +153,41 @@ export interface AdditionalDataGenericJson {
|
|
|
122
153
|
jupiterLendData?: {
|
|
123
154
|
baseTokenMint: string;
|
|
124
155
|
tokenReservesLiquidity: string;
|
|
156
|
+
lendingSupplyPosition: string;
|
|
157
|
+
rewardsRateModel: string;
|
|
158
|
+
rateModel: string;
|
|
159
|
+
};
|
|
160
|
+
kaminoVaultData?: {
|
|
161
|
+
vault: string;
|
|
162
|
+
reserves: {
|
|
163
|
+
reserveAddress: string;
|
|
164
|
+
marketAddress: string;
|
|
165
|
+
}[];
|
|
166
|
+
tokenVault: string;
|
|
167
|
+
tokenMint: string;
|
|
168
|
+
baseVaultAuthority: string;
|
|
169
|
+
sharesMint: string;
|
|
170
|
+
};
|
|
171
|
+
splStakePoolData?: {
|
|
172
|
+
stakePoolAddress: string;
|
|
173
|
+
stakePoolProgramId: string;
|
|
174
|
+
validatorList: string;
|
|
175
|
+
reserveStake: string;
|
|
176
|
+
managerFeeAccount: string;
|
|
177
|
+
poolMint: string;
|
|
125
178
|
};
|
|
126
179
|
}
|
|
127
180
|
export interface Hook {
|
|
128
181
|
enabled: boolean;
|
|
129
182
|
interfaceEmissionsAccountsUntil: number;
|
|
130
|
-
programId:
|
|
183
|
+
programId: PublicKey;
|
|
184
|
+
preMintHookDiscriminator: number[];
|
|
185
|
+
postRedeemHookDiscriminator: number[];
|
|
186
|
+
}
|
|
187
|
+
export interface HookJson {
|
|
188
|
+
enabled: boolean;
|
|
189
|
+
interfaceEmissionsAccountsUntil: number;
|
|
190
|
+
programId: string;
|
|
131
191
|
preMintHookDiscriminator: number[];
|
|
132
192
|
postRedeemHookDiscriminator: number[];
|
|
133
193
|
}
|
|
@@ -136,12 +196,12 @@ export interface HookRaw {
|
|
|
136
196
|
interfaceEmissionsAccountsUntil: number;
|
|
137
197
|
preMintHookDiscriminator: Buffer;
|
|
138
198
|
postRedeemHookDiscriminator: Buffer;
|
|
139
|
-
programId:
|
|
199
|
+
programId: PublicKey;
|
|
140
200
|
}
|
|
141
201
|
export interface GenericSyState {
|
|
142
|
-
selfAddress:
|
|
202
|
+
selfAddress: PublicKey;
|
|
143
203
|
account: GenericSyMetaAccount;
|
|
144
|
-
tokenProgramBase:
|
|
204
|
+
tokenProgramBase: PublicKey;
|
|
145
205
|
syRate: number;
|
|
146
206
|
additionalData?: AdditionalDataGeneric;
|
|
147
207
|
}
|
|
@@ -166,15 +226,15 @@ export interface GenericSyMetaAccountJson {
|
|
|
166
226
|
maxSySupply: string;
|
|
167
227
|
minMintSize: string;
|
|
168
228
|
minRedeemSize: string;
|
|
169
|
-
hook:
|
|
229
|
+
hook: HookJson;
|
|
170
230
|
emissions: SyEmissionJson[];
|
|
171
231
|
index: number;
|
|
172
232
|
}
|
|
173
233
|
export interface GenericSyMetaAccount {
|
|
174
|
-
mintSy:
|
|
175
|
-
yieldBearingMint:
|
|
176
|
-
tokenSyEscrow:
|
|
177
|
-
interfaceAccounts:
|
|
234
|
+
mintSy: PublicKey;
|
|
235
|
+
yieldBearingMint: PublicKey;
|
|
236
|
+
tokenSyEscrow: PublicKey;
|
|
237
|
+
interfaceAccounts: PublicKey[];
|
|
178
238
|
interfaceType: InterfaceTypeGeneric;
|
|
179
239
|
maxSySupply: BN;
|
|
180
240
|
minMintSize: BN;
|
|
@@ -184,15 +244,15 @@ export interface GenericSyMetaAccount {
|
|
|
184
244
|
index: AnchorizedPNum;
|
|
185
245
|
}
|
|
186
246
|
export interface GenericSyMetaAccountRaw {
|
|
187
|
-
mintSy:
|
|
188
|
-
yieldBearingMint:
|
|
189
|
-
tokenSyEscrow:
|
|
247
|
+
mintSy: PublicKey;
|
|
248
|
+
yieldBearingMint: PublicKey;
|
|
249
|
+
tokenSyEscrow: PublicKey;
|
|
190
250
|
maxSySupply: BN;
|
|
191
251
|
minMintSize: BN;
|
|
192
252
|
minRedeemSize: BN;
|
|
193
253
|
selfAddressBump: number[];
|
|
194
254
|
emissions: SyEmissionRaw[];
|
|
195
|
-
interfaceAccounts:
|
|
255
|
+
interfaceAccounts: PublicKey[];
|
|
196
256
|
interfaceType: InterfaceTypeGeneric;
|
|
197
257
|
index: AnchorizedPNum;
|
|
198
258
|
hook: HookRaw;
|
|
@@ -202,12 +262,16 @@ export declare function deserializeGenericSyMetaAccountRaw(raw: GenericSyMetaAcc
|
|
|
202
262
|
export declare function toInterfaceTypeGenericJson(interfaceType: InterfaceTypeGeneric): InterfaceTypeGenericJson;
|
|
203
263
|
/** Convert InterfaceTypeGenericJson to InterfaceTypeGeneric */
|
|
204
264
|
export declare function fromInterfaceTypeGenericJson(json: InterfaceTypeGenericJson): InterfaceTypeGeneric;
|
|
265
|
+
/** Convert Hook to HookJson */
|
|
266
|
+
export declare function toHookJson(hook: Hook): HookJson;
|
|
267
|
+
/** Convert HookJson to Hook */
|
|
268
|
+
export declare function fromHookJson(json: HookJson): Hook;
|
|
205
269
|
/** Convert AdditionalDataGeneric to AdditionalDataGenericJson */
|
|
206
270
|
export declare function toAdditionalDataGenericJson(additionalData: AdditionalDataGeneric): AdditionalDataGenericJson;
|
|
207
271
|
/** Convert AdditionalDataGenericJson to AdditionalDataGeneric */
|
|
208
272
|
export declare function fromAdditionalDataGenericJson(json: AdditionalDataGenericJson): AdditionalDataGeneric;
|
|
209
273
|
/** Helper function to extract fragmetric data from additional data */
|
|
210
274
|
export declare function getFragmetricDataFromAdditionalData(additionalData?: AdditionalDataGeneric): {
|
|
211
|
-
receiptTokenMint:
|
|
212
|
-
wrappedTokenMint:
|
|
275
|
+
receiptTokenMint: PublicKey;
|
|
276
|
+
wrappedTokenMint: PublicKey;
|
|
213
277
|
} | undefined;
|