@exponent-labs/exponent-types 0.0.3
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/CHANGELOG.md +16 -0
- package/build/common.d.ts +27 -0
- package/build/common.js +3 -0
- package/build/common.js.map +1 -0
- package/build/cpi.d.ts +37 -0
- package/build/cpi.js +3 -0
- package/build/cpi.js.map +1 -0
- package/build/flavor.d.ts +122 -0
- package/build/flavor.js +3 -0
- package/build/flavor.js.map +1 -0
- package/build/generic.d.ts +89 -0
- package/build/generic.js +26 -0
- package/build/generic.js.map +1 -0
- package/build/index.d.ts +11 -0
- package/build/index.js +27 -0
- package/build/index.js.map +1 -0
- package/build/jito-restaking.d.ts +57 -0
- package/build/jito-restaking.js +18 -0
- package/build/jito-restaking.js.map +1 -0
- package/build/kamino.d.ts +72 -0
- package/build/kamino.js +3 -0
- package/build/kamino.js.map +1 -0
- package/build/liquidity.d.ts +10 -0
- package/build/liquidity.js +3 -0
- package/build/liquidity.js.map +1 -0
- package/build/marginfi.d.ts +77 -0
- package/build/marginfi.js +3 -0
- package/build/marginfi.js.map +1 -0
- package/build/perena.d.ts +50 -0
- package/build/perena.js +17 -0
- package/build/perena.js.map +1 -0
- package/build/trade.d.ts +32 -0
- package/build/trade.js +3 -0
- package/build/trade.js.map +1 -0
- package/build/vault.d.ts +131 -0
- package/build/vault.js +3 -0
- package/build/vault.js.map +1 -0
- package/package.json +18 -0
- package/src/common.ts +26 -0
- package/src/cpi.ts +44 -0
- package/src/flavor.ts +141 -0
- package/src/generic.ts +121 -0
- package/src/index.ts +11 -0
- package/src/jito-restaking.ts +78 -0
- package/src/kamino.ts +76 -0
- package/src/liquidity.ts +17 -0
- package/src/marginfi.ts +81 -0
- package/src/perena.ts +67 -0
- package/src/trade.ts +37 -0
- package/src/vault.ts +191 -0
- package/tsconfig.json +23 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## [0.0.3](https://github.com/exponent-finance/exponent-core/compare/@exponent-labs/exponent-types@0.0.2...@exponent-labs/exponent-types@0.0.3) (2025-03-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @exponent-labs/exponent-types
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.0.2](https://github.com/exponent-finance/exponent-core/compare/@exponent-labs/exponent-types@0.0.1...@exponent-labs/exponent-types@0.0.2) (2025-03-03)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @exponent-labs/exponent-types
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { BN, web3 } from "@coral-xyz/anchor";
|
|
2
|
+
export interface SyEmissionRaw {
|
|
3
|
+
mint: web3.PublicKey;
|
|
4
|
+
index: AnchorizedPNum;
|
|
5
|
+
lastSeenTotalAccruedEmissions: BN;
|
|
6
|
+
totalClaimedEmissions: BN;
|
|
7
|
+
tokenProgram: web3.PublicKey;
|
|
8
|
+
escrowAccount: web3.PublicKey;
|
|
9
|
+
treasuryEmission: BN;
|
|
10
|
+
lastSeenIndex: AnchorizedPNum;
|
|
11
|
+
}
|
|
12
|
+
export interface SyEmissionJson {
|
|
13
|
+
mint: string;
|
|
14
|
+
tokenProgram: string;
|
|
15
|
+
escrowAccount: string;
|
|
16
|
+
index: number;
|
|
17
|
+
lastSeenIndex: number;
|
|
18
|
+
lastSeenTotalAccruedEmissions: string;
|
|
19
|
+
totalClaimedEmissions: string;
|
|
20
|
+
treasuryEmission: string;
|
|
21
|
+
}
|
|
22
|
+
export type AnchorizedPNum = {
|
|
23
|
+
0: BN[];
|
|
24
|
+
};
|
|
25
|
+
export type AnchorizedPNumJson = {
|
|
26
|
+
0: string[];
|
|
27
|
+
};
|
package/build/common.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":""}
|
package/build/cpi.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { web3 } from "@coral-xyz/anchor";
|
|
2
|
+
export interface AccountInfo {
|
|
3
|
+
pubkey: web3.PublicKey;
|
|
4
|
+
isSigner: boolean;
|
|
5
|
+
isWritable: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** Generic container for CPI account lists */
|
|
8
|
+
export interface CpiMeta<T> {
|
|
9
|
+
getSyState: T[];
|
|
10
|
+
withdrawSy: T[];
|
|
11
|
+
depositSy: T[];
|
|
12
|
+
claimEmission: T[][];
|
|
13
|
+
getPositionState: T[];
|
|
14
|
+
}
|
|
15
|
+
/** The on-chain storage for CPI accounts, which references an ALT */
|
|
16
|
+
export interface CpiAccountIndex {
|
|
17
|
+
/** Index in the Address Lookup Table */
|
|
18
|
+
altIndex: number;
|
|
19
|
+
isSigner: boolean;
|
|
20
|
+
isWritable: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** Raw account infos for CPI that include the Pubkey */
|
|
23
|
+
export type CpiAccountsRaw = CpiMeta<AccountInfo>;
|
|
24
|
+
/** This account is stored in state on the vault/market to track indexes in the ALT */
|
|
25
|
+
export type CpiAccountIndexes = CpiMeta<CpiAccountIndex>;
|
|
26
|
+
export interface CpiAccountsRawJson {
|
|
27
|
+
getSyState: AccountInfoJson[];
|
|
28
|
+
withdrawSy: AccountInfoJson[];
|
|
29
|
+
depositSy: AccountInfoJson[];
|
|
30
|
+
claimEmission: AccountInfoJson[][];
|
|
31
|
+
getPositionState: AccountInfoJson[];
|
|
32
|
+
}
|
|
33
|
+
export type AccountInfoJson = {
|
|
34
|
+
pubkey: string;
|
|
35
|
+
isSigner: boolean;
|
|
36
|
+
isWritable: boolean;
|
|
37
|
+
};
|
package/build/cpi.js
ADDED
package/build/cpi.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cpi.js","sourceRoot":"","sources":["../src/cpi.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { web3 } from "@coral-xyz/anchor";
|
|
2
|
+
import { MfiSyStateJson, MfiSyState } from "./marginfi";
|
|
3
|
+
import { KaminoSyState, KaminoSyStateJson } from "./kamino";
|
|
4
|
+
import { JitoRestakingSyState, JitoRestakingSyStateJson } from "./jito-restaking";
|
|
5
|
+
import { AnchorizedPNum } from "./common";
|
|
6
|
+
import { PerenaSyState, PerenaSyStateJson } from "./perena";
|
|
7
|
+
import { GenericSyState, GenericSyStateJson } from "./generic";
|
|
8
|
+
export type FlavorDiscriminator = "marginfi" | "kamino" | "jitoRestaking" | "perena" | "generic";
|
|
9
|
+
export type MintSyArgs = {
|
|
10
|
+
amountBase: string;
|
|
11
|
+
depositor: web3.PublicKey;
|
|
12
|
+
depositorBaseTokenAccount: web3.PublicKey;
|
|
13
|
+
depositorSyTokenAccount: web3.PublicKey;
|
|
14
|
+
};
|
|
15
|
+
export type RedeemSyArgs = {
|
|
16
|
+
amountSy: string;
|
|
17
|
+
redeemer: web3.PublicKey;
|
|
18
|
+
redeemerBaseTokenAccount: web3.PublicKey;
|
|
19
|
+
redeemerSyTokenAccount: web3.PublicKey;
|
|
20
|
+
};
|
|
21
|
+
export type InterfaceInstructionArgs = {
|
|
22
|
+
signer: web3.PublicKey;
|
|
23
|
+
amountBase: string;
|
|
24
|
+
};
|
|
25
|
+
type BaseFlavorState = {
|
|
26
|
+
flavor: FlavorDiscriminator;
|
|
27
|
+
currentSyExchangeRate: number;
|
|
28
|
+
mintBase: web3.PublicKey;
|
|
29
|
+
baseTokenProgram: web3.PublicKey;
|
|
30
|
+
emissions: {
|
|
31
|
+
exchangeRate: AnchorizedPNum;
|
|
32
|
+
mint: web3.PublicKey;
|
|
33
|
+
tokenProgram: web3.PublicKey;
|
|
34
|
+
}[];
|
|
35
|
+
};
|
|
36
|
+
type BaseFlavorStateJson = {
|
|
37
|
+
flavor: FlavorDiscriminator;
|
|
38
|
+
currentSyExchangeRate: number;
|
|
39
|
+
mintBase: string;
|
|
40
|
+
baseTokenProgram: string;
|
|
41
|
+
emissions: {
|
|
42
|
+
exchangeRate: number;
|
|
43
|
+
mint: string;
|
|
44
|
+
tokenProgram: string;
|
|
45
|
+
}[];
|
|
46
|
+
};
|
|
47
|
+
interface BaseFlavorTrait {
|
|
48
|
+
ixMintSy: (args: MintSyArgs) => Promise<web3.TransactionInstruction>;
|
|
49
|
+
ixRedeemSy: (args: RedeemSyArgs) => Promise<web3.TransactionInstruction>;
|
|
50
|
+
preIxs: (args: {
|
|
51
|
+
signer: web3.PublicKey;
|
|
52
|
+
}) => Promise<web3.TransactionInstruction[]>;
|
|
53
|
+
postIxs: (args: {
|
|
54
|
+
signer: web3.PublicKey;
|
|
55
|
+
}) => Promise<web3.TransactionInstruction[]>;
|
|
56
|
+
preMintSyIx?: (args: InterfaceInstructionArgs) => Promise<web3.TransactionInstruction[]>;
|
|
57
|
+
postRedeemSyIx?: (args: InterfaceInstructionArgs) => Promise<web3.TransactionInstruction[]>;
|
|
58
|
+
}
|
|
59
|
+
export interface FlavorKaminoState extends BaseFlavorState {
|
|
60
|
+
flavor: "kamino";
|
|
61
|
+
kaminoSyState: KaminoSyState;
|
|
62
|
+
}
|
|
63
|
+
export interface FlavorMarginfiState extends BaseFlavorState {
|
|
64
|
+
flavor: "marginfi";
|
|
65
|
+
bank: web3.PublicKey;
|
|
66
|
+
emissionMint?: web3.PublicKey;
|
|
67
|
+
emissionTokenProgram?: web3.PublicKey;
|
|
68
|
+
mfiSyState: MfiSyState;
|
|
69
|
+
}
|
|
70
|
+
export interface FlavorJitoRestakingState extends BaseFlavorState {
|
|
71
|
+
flavor: "jitoRestaking";
|
|
72
|
+
jitoSyState: JitoRestakingSyState;
|
|
73
|
+
}
|
|
74
|
+
export interface FlavorPerenaState extends BaseFlavorState {
|
|
75
|
+
flavor: "perena";
|
|
76
|
+
perenaSyState: PerenaSyState;
|
|
77
|
+
}
|
|
78
|
+
export interface FlavorGenericState extends BaseFlavorState {
|
|
79
|
+
flavor: "generic";
|
|
80
|
+
genericSyState: GenericSyState;
|
|
81
|
+
}
|
|
82
|
+
export interface FlavorJitoRestakingStateJson extends BaseFlavorStateJson {
|
|
83
|
+
flavor: "jitoRestaking";
|
|
84
|
+
jitoSyState: JitoRestakingSyStateJson;
|
|
85
|
+
}
|
|
86
|
+
export interface FlavorPerenaStateJson extends BaseFlavorStateJson {
|
|
87
|
+
flavor: "perena";
|
|
88
|
+
perenaSyState: PerenaSyStateJson;
|
|
89
|
+
}
|
|
90
|
+
export interface FlavorMarginfiStateJson extends BaseFlavorStateJson {
|
|
91
|
+
flavor: "marginfi";
|
|
92
|
+
bank: string;
|
|
93
|
+
emissionMint?: string;
|
|
94
|
+
emissionTokenProgram?: string;
|
|
95
|
+
mfiSyState: MfiSyStateJson;
|
|
96
|
+
}
|
|
97
|
+
export interface FlavorKaminoStateJson extends BaseFlavorStateJson {
|
|
98
|
+
flavor: "kamino";
|
|
99
|
+
kaminoSyState: KaminoSyStateJson;
|
|
100
|
+
}
|
|
101
|
+
export interface FlavorJitoRestakingStateJson extends BaseFlavorStateJson {
|
|
102
|
+
flavor: "jitoRestaking";
|
|
103
|
+
jitoSyState: JitoRestakingSyStateJson;
|
|
104
|
+
}
|
|
105
|
+
export interface FlavorGenericStateJson extends BaseFlavorStateJson {
|
|
106
|
+
flavor: "generic";
|
|
107
|
+
genericSyState: GenericSyStateJson;
|
|
108
|
+
}
|
|
109
|
+
export interface FlavorKamino extends BaseFlavorTrait, FlavorKaminoState {
|
|
110
|
+
}
|
|
111
|
+
export interface FlavorMarginfi extends BaseFlavorTrait, FlavorMarginfiState {
|
|
112
|
+
}
|
|
113
|
+
export interface FlavorJitoRestaking extends BaseFlavorTrait, FlavorJitoRestakingState {
|
|
114
|
+
}
|
|
115
|
+
export interface FlavorPerena extends BaseFlavorTrait, FlavorPerenaState {
|
|
116
|
+
}
|
|
117
|
+
export interface FlavorGeneric extends BaseFlavorTrait, FlavorGenericState {
|
|
118
|
+
}
|
|
119
|
+
export type IFlavorState = FlavorMarginfiState | FlavorKaminoState | FlavorJitoRestakingState | FlavorPerenaState | FlavorGenericState;
|
|
120
|
+
export type IFlavorStateJson = FlavorMarginfiStateJson | FlavorKaminoStateJson | FlavorJitoRestakingStateJson | FlavorPerenaStateJson | FlavorGenericStateJson;
|
|
121
|
+
export type Flavor = FlavorMarginfi | FlavorKamino | FlavorJitoRestaking | FlavorPerena | FlavorGeneric;
|
|
122
|
+
export {};
|
package/build/flavor.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flavor.js","sourceRoot":"","sources":["../src/flavor.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { BN, web3 } from "@coral-xyz/anchor";
|
|
4
|
+
import { AnchorizedPNum, SyEmissionRaw, SyEmissionJson } from "./common";
|
|
5
|
+
export type InterfaceTypeGeneric = {
|
|
6
|
+
pyth: {
|
|
7
|
+
lastSlot: BN;
|
|
8
|
+
maximumAgeSeconds: BN;
|
|
9
|
+
};
|
|
10
|
+
} | {
|
|
11
|
+
splStakePool: Record<string, never>;
|
|
12
|
+
} | {
|
|
13
|
+
one: Record<string, never>;
|
|
14
|
+
} | {
|
|
15
|
+
fragmetric: Record<string, never>;
|
|
16
|
+
} | {
|
|
17
|
+
meteora: Record<string, never>;
|
|
18
|
+
};
|
|
19
|
+
export interface Hook {
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
interfaceEmissionsAccountsUntil: number;
|
|
22
|
+
preMintHookDiscriminator: number[];
|
|
23
|
+
postRedeemHookDiscriminator: number[];
|
|
24
|
+
programId: web3.PublicKey;
|
|
25
|
+
}
|
|
26
|
+
export interface HookRaw {
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
interfaceEmissionsAccountsUntil: number;
|
|
29
|
+
preMintHookDiscriminator: Buffer;
|
|
30
|
+
postRedeemHookDiscriminator: Buffer;
|
|
31
|
+
programId: web3.PublicKey;
|
|
32
|
+
}
|
|
33
|
+
export interface GenericSyState {
|
|
34
|
+
selfAddress: web3.PublicKey;
|
|
35
|
+
account: GenericSyMetaAccount;
|
|
36
|
+
tokenProgramBase: web3.PublicKey;
|
|
37
|
+
syRate: number;
|
|
38
|
+
fragmetricData?: {
|
|
39
|
+
receiptTokenMint: web3.PublicKey;
|
|
40
|
+
wrappedTokenMint: web3.PublicKey;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export interface GenericSyStateJson {
|
|
44
|
+
selfAddress: string;
|
|
45
|
+
account: GenericSyMetaAccountJson;
|
|
46
|
+
tokenProgramBase: string;
|
|
47
|
+
syRate: number;
|
|
48
|
+
}
|
|
49
|
+
export interface GenericSyMetaAccountJson {
|
|
50
|
+
mintSy: string;
|
|
51
|
+
yieldBearingMint: string;
|
|
52
|
+
tokenSyEscrow: string;
|
|
53
|
+
interfaceAccounts: string[];
|
|
54
|
+
interfaceType: InterfaceTypeGeneric;
|
|
55
|
+
maxSySupply: string;
|
|
56
|
+
minMintSize: string;
|
|
57
|
+
minRedeemSize: string;
|
|
58
|
+
hook: HookRaw;
|
|
59
|
+
emissions: SyEmissionJson[];
|
|
60
|
+
index: number;
|
|
61
|
+
}
|
|
62
|
+
export interface GenericSyMetaAccount {
|
|
63
|
+
mintSy: web3.PublicKey;
|
|
64
|
+
yieldBearingMint: web3.PublicKey;
|
|
65
|
+
tokenSyEscrow: web3.PublicKey;
|
|
66
|
+
interfaceAccounts: web3.PublicKey[];
|
|
67
|
+
interfaceType: InterfaceTypeGeneric;
|
|
68
|
+
maxSySupply: BN;
|
|
69
|
+
minMintSize: BN;
|
|
70
|
+
minRedeemSize: BN;
|
|
71
|
+
hook: Hook;
|
|
72
|
+
emissions: SyEmissionRaw[];
|
|
73
|
+
index: AnchorizedPNum;
|
|
74
|
+
}
|
|
75
|
+
export interface GenericSyMetaAccountRaw {
|
|
76
|
+
mintSy: web3.PublicKey;
|
|
77
|
+
yieldBearingMint: web3.PublicKey;
|
|
78
|
+
tokenSyEscrow: web3.PublicKey;
|
|
79
|
+
maxSySupply: BN;
|
|
80
|
+
minMintSize: BN;
|
|
81
|
+
minRedeemSize: BN;
|
|
82
|
+
selfAddressBump: number[];
|
|
83
|
+
emissions: SyEmissionRaw[];
|
|
84
|
+
interfaceAccounts: web3.PublicKey[];
|
|
85
|
+
interfaceType: InterfaceTypeGeneric;
|
|
86
|
+
index: AnchorizedPNum;
|
|
87
|
+
hook: HookRaw;
|
|
88
|
+
}
|
|
89
|
+
export declare function deserializeGenericSyMetaAccountRaw(raw: GenericSyMetaAccountRaw): GenericSyMetaAccount;
|
package/build/generic.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deserializeGenericSyMetaAccountRaw = void 0;
|
|
4
|
+
function deserializeGenericSyMetaAccountRaw(raw) {
|
|
5
|
+
return {
|
|
6
|
+
mintSy: raw.mintSy,
|
|
7
|
+
yieldBearingMint: raw.yieldBearingMint,
|
|
8
|
+
tokenSyEscrow: raw.tokenSyEscrow,
|
|
9
|
+
interfaceAccounts: raw.interfaceAccounts,
|
|
10
|
+
interfaceType: raw.interfaceType,
|
|
11
|
+
index: raw.index,
|
|
12
|
+
maxSySupply: raw.maxSySupply,
|
|
13
|
+
minMintSize: raw.minMintSize,
|
|
14
|
+
minRedeemSize: raw.minRedeemSize,
|
|
15
|
+
emissions: raw.emissions,
|
|
16
|
+
hook: {
|
|
17
|
+
enabled: raw.hook.enabled,
|
|
18
|
+
interfaceEmissionsAccountsUntil: raw.hook.interfaceEmissionsAccountsUntil,
|
|
19
|
+
preMintHookDiscriminator: Array.from(raw.hook.preMintHookDiscriminator),
|
|
20
|
+
postRedeemHookDiscriminator: Array.from(raw.hook.postRedeemHookDiscriminator),
|
|
21
|
+
programId: raw.hook.programId,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
exports.deserializeGenericSyMetaAccountRaw = deserializeGenericSyMetaAccountRaw;
|
|
26
|
+
//# sourceMappingURL=generic.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generic.js","sourceRoot":"","sources":["../src/generic.ts"],"names":[],"mappings":";;;AAoGA,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"}
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { SyEmissionRaw, SyEmissionJson } from "./common";
|
|
2
|
+
export * from "./flavor";
|
|
3
|
+
export * from "./jito-restaking";
|
|
4
|
+
export * from "./kamino";
|
|
5
|
+
export * from "./marginfi";
|
|
6
|
+
export * from "./perena";
|
|
7
|
+
export * from "./vault";
|
|
8
|
+
export * from "./cpi";
|
|
9
|
+
export * from "./trade";
|
|
10
|
+
export * from "./liquidity";
|
|
11
|
+
export * from "./generic";
|
package/build/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./flavor"), exports);
|
|
18
|
+
__exportStar(require("./jito-restaking"), exports);
|
|
19
|
+
__exportStar(require("./kamino"), exports);
|
|
20
|
+
__exportStar(require("./marginfi"), exports);
|
|
21
|
+
__exportStar(require("./perena"), exports);
|
|
22
|
+
__exportStar(require("./vault"), exports);
|
|
23
|
+
__exportStar(require("./cpi"), exports);
|
|
24
|
+
__exportStar(require("./trade"), exports);
|
|
25
|
+
__exportStar(require("./liquidity"), exports);
|
|
26
|
+
__exportStar(require("./generic"), exports);
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,2CAAwB;AACxB,mDAAgC;AAChC,2CAAwB;AACxB,6CAA0B;AAC1B,2CAAwB;AACxB,0CAAuB;AACvB,wCAAqB;AACrB,0CAAuB;AACvB,8CAA2B;AAC3B,4CAAyB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { BN, web3 } from "@coral-xyz/anchor";
|
|
2
|
+
import { SyEmissionRaw, SyEmissionJson } from "./common";
|
|
3
|
+
export interface InterfaceType {
|
|
4
|
+
splStakePool: {};
|
|
5
|
+
}
|
|
6
|
+
export interface JitoRestakingSyState {
|
|
7
|
+
selfAddress: web3.PublicKey;
|
|
8
|
+
account: JitoRestakingSyMetaAccount;
|
|
9
|
+
/** The value of SY tokens in terms of the base asset */
|
|
10
|
+
syRate: string;
|
|
11
|
+
underlyingExchangeRate: number;
|
|
12
|
+
mintBase: web3.PublicKey;
|
|
13
|
+
tokenProgramBase: web3.PublicKey;
|
|
14
|
+
}
|
|
15
|
+
export interface JitoRestakingSyMetaAccountRaw {
|
|
16
|
+
jitoVault: web3.PublicKey;
|
|
17
|
+
mintSy: web3.PublicKey;
|
|
18
|
+
tokenSyEscrow: web3.PublicKey;
|
|
19
|
+
maxSySupply: BN;
|
|
20
|
+
minMintSize: BN;
|
|
21
|
+
minRedeemSize: BN;
|
|
22
|
+
selfAddressBump: number[];
|
|
23
|
+
emissions: SyEmissionRaw[];
|
|
24
|
+
interfaceAccounts: web3.PublicKey[];
|
|
25
|
+
interfaceType: InterfaceType;
|
|
26
|
+
}
|
|
27
|
+
export interface JitoRestakingSyMetaAccount {
|
|
28
|
+
jitoVault: web3.PublicKey;
|
|
29
|
+
mintSy: web3.PublicKey;
|
|
30
|
+
tokenSyEscrow: web3.PublicKey;
|
|
31
|
+
interfaceAccounts: web3.PublicKey[];
|
|
32
|
+
interfaceType: InterfaceType;
|
|
33
|
+
maxSySupply: BN;
|
|
34
|
+
minMintSize: BN;
|
|
35
|
+
minRedeemSize: BN;
|
|
36
|
+
emissions: SyEmissionRaw[];
|
|
37
|
+
}
|
|
38
|
+
export interface JitoRestakingSyMetaAccountJson {
|
|
39
|
+
jitoVault: string;
|
|
40
|
+
mintSy: string;
|
|
41
|
+
tokenSyEscrow: string;
|
|
42
|
+
interfaceAccounts: string[];
|
|
43
|
+
interfaceType: InterfaceType;
|
|
44
|
+
maxSySupply: string;
|
|
45
|
+
minMintSize: string;
|
|
46
|
+
minRedeemSize: string;
|
|
47
|
+
emissions: SyEmissionJson[];
|
|
48
|
+
}
|
|
49
|
+
export declare function deserializeJitoRestakingSyMetaAccountRaw(raw: JitoRestakingSyMetaAccountRaw): JitoRestakingSyMetaAccount;
|
|
50
|
+
export interface JitoRestakingSyStateJson {
|
|
51
|
+
selfAddress: string;
|
|
52
|
+
account: JitoRestakingSyMetaAccountJson;
|
|
53
|
+
syRate: string;
|
|
54
|
+
underlyingExchangeRate: number;
|
|
55
|
+
mintBase: string;
|
|
56
|
+
tokenProgramBase: string;
|
|
57
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deserializeJitoRestakingSyMetaAccountRaw = void 0;
|
|
4
|
+
function deserializeJitoRestakingSyMetaAccountRaw(raw) {
|
|
5
|
+
return {
|
|
6
|
+
jitoVault: raw.jitoVault,
|
|
7
|
+
mintSy: raw.mintSy,
|
|
8
|
+
tokenSyEscrow: raw.tokenSyEscrow,
|
|
9
|
+
interfaceAccounts: raw.interfaceAccounts,
|
|
10
|
+
interfaceType: raw.interfaceType,
|
|
11
|
+
maxSySupply: raw.maxSySupply,
|
|
12
|
+
minMintSize: raw.minMintSize,
|
|
13
|
+
minRedeemSize: raw.minRedeemSize,
|
|
14
|
+
emissions: raw.emissions,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
exports.deserializeJitoRestakingSyMetaAccountRaw = deserializeJitoRestakingSyMetaAccountRaw;
|
|
18
|
+
//# sourceMappingURL=jito-restaking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jito-restaking.js","sourceRoot":"","sources":["../src/jito-restaking.ts"],"names":[],"mappings":";;;AAsDA,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;AAdD,4FAcC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { BN } from "@coral-xyz/anchor";
|
|
2
|
+
import { web3 } from "@coral-xyz/anchor";
|
|
3
|
+
import { SyEmissionRaw, SyEmissionJson } from "./common";
|
|
4
|
+
export interface KaminoSyState {
|
|
5
|
+
selfAddress: web3.PublicKey;
|
|
6
|
+
account: KaminoSyMetaAccount;
|
|
7
|
+
klendSyProgramId: web3.PublicKey;
|
|
8
|
+
/** The value of SY tokens in terms of the base asset */
|
|
9
|
+
syRate: string;
|
|
10
|
+
mintBase: web3.PublicKey;
|
|
11
|
+
tokenProgramBase: web3.PublicKey;
|
|
12
|
+
klendProgramId: web3.PublicKey;
|
|
13
|
+
klendMarketId: web3.PublicKey;
|
|
14
|
+
}
|
|
15
|
+
export interface KaminoSyStateJson {
|
|
16
|
+
selfAddress: string;
|
|
17
|
+
account: KaminoSyMetaAccountJson;
|
|
18
|
+
klendSyProgramId: string;
|
|
19
|
+
syRate: string;
|
|
20
|
+
mintBase: string;
|
|
21
|
+
tokenProgramBase: string;
|
|
22
|
+
klendProgramId: string;
|
|
23
|
+
klendMarketId: string;
|
|
24
|
+
}
|
|
25
|
+
export interface KaminoSyMetaAccount {
|
|
26
|
+
kaminoReserve: web3.PublicKey;
|
|
27
|
+
kaminoObligation: web3.PublicKey;
|
|
28
|
+
kaminoFarm: web3.PublicKey;
|
|
29
|
+
kaminoUserMetadata: web3.PublicKey;
|
|
30
|
+
mintSy: web3.PublicKey;
|
|
31
|
+
/** Where deposited SY tokens reside */
|
|
32
|
+
tokenSyEscrow: web3.PublicKey;
|
|
33
|
+
userState: web3.PublicKey;
|
|
34
|
+
maxSySupply: string;
|
|
35
|
+
minMintSize: string;
|
|
36
|
+
minRedeemSize: string;
|
|
37
|
+
emissions: SyEmissionRaw[];
|
|
38
|
+
}
|
|
39
|
+
interface KaminoSyMetaAccountJson {
|
|
40
|
+
kaminoReserve: string;
|
|
41
|
+
kaminoObligation: string;
|
|
42
|
+
kaminoFarm: string;
|
|
43
|
+
kaminoUserMetadata: string;
|
|
44
|
+
mintSy: string;
|
|
45
|
+
tokenSyEscrow: string;
|
|
46
|
+
userState: string;
|
|
47
|
+
maxSySupply: string;
|
|
48
|
+
minMintSize: string;
|
|
49
|
+
minRedeemSize: string;
|
|
50
|
+
emissions: SyEmissionJson[];
|
|
51
|
+
}
|
|
52
|
+
export interface KaminoSyMetaAccountRaw {
|
|
53
|
+
kamino_reserve: web3.PublicKey;
|
|
54
|
+
kamino_obligation: web3.PublicKey;
|
|
55
|
+
kamino_farm: web3.PublicKey;
|
|
56
|
+
kamino_user_metadata: web3.PublicKey;
|
|
57
|
+
mint_sy: web3.PublicKey;
|
|
58
|
+
/** Where deposited SY tokens reside */
|
|
59
|
+
token_sy_escrow: web3.PublicKey;
|
|
60
|
+
/** Robot authority over the Mfi Account */
|
|
61
|
+
authority_klend_account: web3.PublicKey;
|
|
62
|
+
/** Authority over the SY token escrow account */
|
|
63
|
+
authority_escrow: web3.PublicKey;
|
|
64
|
+
/** Authority over the sy mint */
|
|
65
|
+
mint_authority: web3.PublicKey;
|
|
66
|
+
user_state: web3.PublicKey;
|
|
67
|
+
max_sy_supply: BN;
|
|
68
|
+
min_mint_size: BN;
|
|
69
|
+
min_redeem_size: BN;
|
|
70
|
+
emissions: SyEmissionRaw[];
|
|
71
|
+
}
|
|
72
|
+
export {};
|
package/build/kamino.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kamino.js","sourceRoot":"","sources":["../src/kamino.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liquidity.js","sourceRoot":"","sources":["../src/liquidity.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { BN, web3 } from "@coral-xyz/anchor";
|
|
2
|
+
import { SyEmissionRaw, SyEmissionJson } from "./common";
|
|
3
|
+
export interface MfiSyState {
|
|
4
|
+
selfAddress: web3.PublicKey;
|
|
5
|
+
account: MarginfiSyMeta;
|
|
6
|
+
marginfiSyProgramId: web3.PublicKey;
|
|
7
|
+
/** The value of SY tokens in terms of the base asset taken directly from the bank */
|
|
8
|
+
syRate: string;
|
|
9
|
+
mintBase: web3.PublicKey;
|
|
10
|
+
tokenProgramBase: web3.PublicKey;
|
|
11
|
+
marginfiProgramId: web3.PublicKey;
|
|
12
|
+
marginfiGroupId: web3.PublicKey;
|
|
13
|
+
emissionsMint: web3.PublicKey | null;
|
|
14
|
+
emissionsTokenProgram: web3.PublicKey | null;
|
|
15
|
+
}
|
|
16
|
+
export interface MfiSyStateJson {
|
|
17
|
+
selfAddress: string;
|
|
18
|
+
account: MarginfiSyMetaJson;
|
|
19
|
+
marginfiSyProgramId: string;
|
|
20
|
+
syRate: string;
|
|
21
|
+
mintBase: string;
|
|
22
|
+
tokenProgramBase: string;
|
|
23
|
+
marginfiProgramId: string;
|
|
24
|
+
marginfiGroupId: string;
|
|
25
|
+
emissionsMint: string | null;
|
|
26
|
+
emissionsTokenProgram: string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface SyMetaJson {
|
|
29
|
+
selfAddress: string;
|
|
30
|
+
marginfiBank: string;
|
|
31
|
+
marginfiAccount: string;
|
|
32
|
+
mintSy: string;
|
|
33
|
+
tokenSyEscrow: string;
|
|
34
|
+
emissions: SyEmissionJson[];
|
|
35
|
+
maxSySupply: string;
|
|
36
|
+
minMintSize: string;
|
|
37
|
+
minRedeemSize: string;
|
|
38
|
+
syRate: string;
|
|
39
|
+
}
|
|
40
|
+
export interface MarginfiSyMeta {
|
|
41
|
+
marginfiBank: web3.PublicKey;
|
|
42
|
+
marginfiAccount: web3.PublicKey;
|
|
43
|
+
mintSy: web3.PublicKey;
|
|
44
|
+
/** Where the SY tokens get deposited */
|
|
45
|
+
tokenSyEscrow: web3.PublicKey;
|
|
46
|
+
maxSySupply: bigint;
|
|
47
|
+
minMintSize: bigint;
|
|
48
|
+
minRedeemSize: bigint;
|
|
49
|
+
emissions: SyEmissionRaw[];
|
|
50
|
+
}
|
|
51
|
+
export interface MarginfiSyMetaJson {
|
|
52
|
+
marginfiBank: string;
|
|
53
|
+
marginfiAccount: string;
|
|
54
|
+
mintSy: string;
|
|
55
|
+
tokenSyEscrow: string;
|
|
56
|
+
maxSySupply: string;
|
|
57
|
+
minMintSize: string;
|
|
58
|
+
minRedeemSize: string;
|
|
59
|
+
emissions: SyEmissionJson[];
|
|
60
|
+
}
|
|
61
|
+
export interface MarginfiSyMetaRaw {
|
|
62
|
+
marginfiBank: web3.PublicKey;
|
|
63
|
+
marginfiAccount: web3.PublicKey;
|
|
64
|
+
mintSy: web3.PublicKey;
|
|
65
|
+
maxSySupply: BN;
|
|
66
|
+
minMintSize: BN;
|
|
67
|
+
minRedeemSize: BN;
|
|
68
|
+
/** Where the SY tokens get deposited */
|
|
69
|
+
tokenSyEscrow: web3.PublicKey;
|
|
70
|
+
emissions: SyEmissionRaw[];
|
|
71
|
+
}
|
|
72
|
+
export type AnchorizedPNum = {
|
|
73
|
+
0: BN[];
|
|
74
|
+
};
|
|
75
|
+
export type AnchorizedPNumJson = {
|
|
76
|
+
0: string[];
|
|
77
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marginfi.js","sourceRoot":"","sources":["../src/marginfi.ts"],"names":[],"mappings":""}
|