@exponent-labs/exponent-types 0.1.8 → 0.9.1

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/kamino.d.ts CHANGED
@@ -1,17 +1,17 @@
1
- import { BN } from "@coral-xyz/anchor";
2
- import { web3 } from "@coral-xyz/anchor";
1
+ import BN from "bn.js";
3
2
  import { SyEmissionJson, SyEmissionRaw, SyEmissionRaw2 } from "./common";
3
+ import { PublicKey } from "@solana/web3.js";
4
4
  export interface KaminoSyState {
5
- selfAddress: web3.PublicKey;
5
+ selfAddress: PublicKey;
6
6
  account: KaminoSyMetaAccount;
7
- klendSyProgramId: web3.PublicKey;
7
+ klendSyProgramId: PublicKey;
8
8
  /** The value of SY tokens in terms of the base asset */
9
9
  syRate: string;
10
- mintBase: web3.PublicKey;
11
- tokenProgramBase: web3.PublicKey;
12
- klendProgramId: web3.PublicKey;
13
- klendMarketId: web3.PublicKey;
14
- scopePriceFeed?: web3.PublicKey;
10
+ mintBase: PublicKey;
11
+ tokenProgramBase: PublicKey;
12
+ klendProgramId: PublicKey;
13
+ klendMarketId: PublicKey;
14
+ scopePriceFeed?: PublicKey;
15
15
  }
16
16
  export interface KaminoSyStateJson {
17
17
  selfAddress: string;
@@ -25,14 +25,14 @@ export interface KaminoSyStateJson {
25
25
  scopePriceFeed?: string;
26
26
  }
27
27
  export interface KaminoSyMetaAccount {
28
- kaminoReserve: web3.PublicKey;
29
- kaminoObligation: web3.PublicKey;
30
- kaminoFarm: web3.PublicKey;
31
- kaminoUserMetadata: web3.PublicKey;
32
- mintSy: web3.PublicKey;
28
+ kaminoReserve: PublicKey;
29
+ kaminoObligation: PublicKey;
30
+ kaminoFarm: PublicKey;
31
+ kaminoUserMetadata: PublicKey;
32
+ mintSy: PublicKey;
33
33
  /** Where deposited SY tokens reside */
34
- tokenSyEscrow: web3.PublicKey;
35
- userState: web3.PublicKey;
34
+ tokenSyEscrow: PublicKey;
35
+ userState: PublicKey;
36
36
  maxSySupply: string;
37
37
  minMintSize: string;
38
38
  minRedeemSize: string;
@@ -52,20 +52,20 @@ interface KaminoSyMetaAccountJson {
52
52
  emissions: SyEmissionJson[];
53
53
  }
54
54
  export interface KaminoSyMetaAccountRaw {
55
- kamino_reserve: web3.PublicKey;
56
- kamino_obligation: web3.PublicKey;
57
- kamino_farm: web3.PublicKey;
58
- kamino_user_metadata: web3.PublicKey;
59
- mint_sy: web3.PublicKey;
55
+ kamino_reserve: PublicKey;
56
+ kamino_obligation: PublicKey;
57
+ kamino_farm: PublicKey;
58
+ kamino_user_metadata: PublicKey;
59
+ mint_sy: PublicKey;
60
60
  /** Where deposited SY tokens reside */
61
- token_sy_escrow: web3.PublicKey;
61
+ token_sy_escrow: PublicKey;
62
62
  /** Robot authority over the Mfi Account */
63
- authority_klend_account: web3.PublicKey;
63
+ authority_klend_account: PublicKey;
64
64
  /** Authority over the SY token escrow account */
65
- authority_escrow: web3.PublicKey;
65
+ authority_escrow: PublicKey;
66
66
  /** Authority over the sy mint */
67
- mint_authority: web3.PublicKey;
68
- user_state: web3.PublicKey;
67
+ mint_authority: PublicKey;
68
+ user_state: PublicKey;
69
69
  max_sy_supply: BN;
70
70
  min_mint_size: BN;
71
71
  min_redeem_size: BN;
@@ -1,17 +1,18 @@
1
- import { BN, web3 } from "@coral-xyz/anchor";
1
+ import { PublicKey } from "@solana/web3.js";
2
2
  import { SyEmissionRaw, SyEmissionJson } from "./common";
3
+ import BN from 'bn.js';
3
4
  export interface MfiSyState {
4
- selfAddress: web3.PublicKey;
5
+ selfAddress: PublicKey;
5
6
  account: MarginfiSyMeta;
6
- marginfiSyProgramId: web3.PublicKey;
7
+ marginfiSyProgramId: PublicKey;
7
8
  /** The value of SY tokens in terms of the base asset taken directly from the bank */
8
9
  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;
10
+ mintBase: PublicKey;
11
+ tokenProgramBase: PublicKey;
12
+ marginfiProgramId: PublicKey;
13
+ marginfiGroupId: PublicKey;
14
+ emissionsMint: PublicKey | null;
15
+ emissionsTokenProgram: PublicKey | null;
15
16
  }
16
17
  export interface MfiSyStateJson {
17
18
  selfAddress: string;
@@ -38,11 +39,11 @@ export interface SyMetaJson {
38
39
  syRate: string;
39
40
  }
40
41
  export interface MarginfiSyMeta {
41
- marginfiBank: web3.PublicKey;
42
- marginfiAccount: web3.PublicKey;
43
- mintSy: web3.PublicKey;
42
+ marginfiBank: PublicKey;
43
+ marginfiAccount: PublicKey;
44
+ mintSy: PublicKey;
44
45
  /** Where the SY tokens get deposited */
45
- tokenSyEscrow: web3.PublicKey;
46
+ tokenSyEscrow: PublicKey;
46
47
  maxSySupply: bigint;
47
48
  minMintSize: bigint;
48
49
  minRedeemSize: bigint;
@@ -59,14 +60,14 @@ export interface MarginfiSyMetaJson {
59
60
  emissions: SyEmissionJson[];
60
61
  }
61
62
  export interface MarginfiSyMetaRaw {
62
- marginfiBank: web3.PublicKey;
63
- marginfiAccount: web3.PublicKey;
64
- mintSy: web3.PublicKey;
63
+ marginfiBank: PublicKey;
64
+ marginfiAccount: PublicKey;
65
+ mintSy: PublicKey;
65
66
  maxSySupply: BN;
66
67
  minMintSize: BN;
67
68
  minRedeemSize: BN;
68
69
  /** Where the SY tokens get deposited */
69
- tokenSyEscrow: web3.PublicKey;
70
+ tokenSyEscrow: PublicKey;
70
71
  emissions: SyEmissionRaw[];
71
72
  }
72
73
  export type AnchorizedPNum = {
@@ -1,9 +1,9 @@
1
- import { web3 } from "@coral-xyz/anchor";
1
+ import { PublicKey } from "@solana/web3.js";
2
2
  import { CpiAccountsRaw, ExponentCoreCpiAccountsRaw } from "./cpi";
3
3
  import { Flavor } from "./flavor";
4
- export declare const MAX_PRICE_NODES = 100;
5
- export declare const MAX_OFFERS = 500;
6
- export declare const MAX_USER_ESCROWS = 250;
4
+ export declare const MAX_PRICE_NODES = 1000;
5
+ export declare const MAX_OFFERS = 2500;
6
+ export declare const MAX_USER_ESCROWS = 1500;
7
7
  export declare const PRICE_NODE_REGISTERS = 3;
8
8
  export declare const OFFER_REGISTERS = 1;
9
9
  export declare const ESCROW_REGISTERS = 0;
@@ -45,12 +45,14 @@ export interface PriceTreeNode {
45
45
  right: number;
46
46
  }
47
47
  export interface OfferNode {
48
+ /** Actual NodeAllocator slot for this offer (0 is sentinel, live offers are 1-based) */
49
+ offerIndex: number;
48
50
  /** Internal register 1 (the free‐list link when unused) */
49
51
  nextOfferPointer: number;
50
52
  /** Internal register 3 (the free‐list link when unused) */
51
53
  pricePointer: number;
52
54
  /** SY/PT/YT amount deposited */
53
- amount: BigInt;
55
+ amount: bigint;
54
56
  /** Index of the user escrow that owns this offer */
55
57
  userVaultPointer: number;
56
58
  /** Expiry timestamp (unix seconds) */
@@ -66,8 +68,8 @@ export interface OfferNode {
66
68
  }
67
69
  export interface UserEscrowNode {
68
70
  /** The user’s Pubkey */
69
- user: web3.PublicKey;
70
- /** Yield‐index for this user (protocol’s Number type) */
71
+ user: PublicKey;
72
+ /** Last seen SY exchange rate for this user escrow */
71
73
  yieldIndex: number;
72
74
  /** Token amounts held */
73
75
  ptAmount: bigint;
@@ -80,24 +82,24 @@ export interface UserEscrowNode {
80
82
  /** ─── Full On-chain Orderbook ───────────────────────────────────────────────── */
81
83
  export interface Orderbook {
82
84
  /** PDA link to vault */
83
- vault: web3.PublicKey;
85
+ vault: PublicKey;
84
86
  /** PDA link to a vault-owned YT position */
85
- yieldPosition: web3.PublicKey;
87
+ yieldPosition: PublicKey;
86
88
  /** Address Lookup Table key for the orderbook */
87
- addressLookupTable: web3.PublicKey;
89
+ addressLookupTable: PublicKey;
88
90
  /** Address of the Exponent Core program */
89
- exponentCoreProgram: web3.PublicKey;
91
+ exponentCoreProgram: PublicKey;
90
92
  /** Address of the Sy program */
91
- syProgram: web3.PublicKey;
93
+ syProgram: PublicKey;
92
94
  /** Orderbook-owned escrow for SY tokens */
93
- tokenEscrowSy: web3.PublicKey;
95
+ tokenEscrowSy: PublicKey;
94
96
  /** Orderbook-owned escrow for YT tokens */
95
- tokenEscrowYt: web3.PublicKey;
97
+ tokenEscrowYt: PublicKey;
96
98
  /** Orderbook-owned escrow for PT tokens */
97
- tokenEscrowPt: web3.PublicKey;
98
- admin: web3.PublicKey;
99
+ tokenEscrowPt: PublicKey;
100
+ admin: PublicKey;
99
101
  /** CPI accounts storage key */
100
- cpiAccountOrderbook: web3.PublicKey;
102
+ cpiAccountOrderbook: PublicKey;
101
103
  /** How many price nodes are currently in use */
102
104
  nodeCount: number;
103
105
  financials: OrderbookFinancials;
@@ -112,25 +114,25 @@ export interface Orderbook {
112
114
  }
113
115
  export interface OrderbookState {
114
116
  /** PDA link to vault */
115
- vault: web3.PublicKey;
117
+ vault: PublicKey;
116
118
  /** PDA link to a vault-owned YT position */
117
- yieldPosition: web3.PublicKey;
119
+ yieldPosition: PublicKey;
118
120
  /** Address Lookup Table key for the orderbook */
119
- addressLookupTable: web3.PublicKey;
121
+ addressLookupTable: PublicKey;
120
122
  /** Address of the Exponent Core program */
121
- exponentCoreProgram: web3.PublicKey;
123
+ exponentCoreProgram: PublicKey;
122
124
  /** Address of the Exponent Core program */
123
- syProgram: web3.PublicKey;
125
+ syProgram: PublicKey;
124
126
  /** Orderbook-owned escrow for SY tokens */
125
- tokenEscrowSy: web3.PublicKey;
127
+ tokenEscrowSy: PublicKey;
126
128
  /** Orderbook-owned escrow for YT tokens */
127
- tokenEscrowYt: web3.PublicKey;
129
+ tokenEscrowYt: PublicKey;
128
130
  /** Orderbook-owned escrow for PT tokens */
129
- tokenEscrowPt: web3.PublicKey;
131
+ tokenEscrowPt: PublicKey;
130
132
  /** CPI accounts storage key */
131
- cpiAccountOrderbook: web3.PublicKey;
133
+ cpiAccountOrderbook: PublicKey;
132
134
  /** Admin key */
133
- admin: web3.PublicKey;
135
+ admin: PublicKey;
134
136
  configurationOptions: ConfigurationOptions;
135
137
  financials: OrderbookFinancials;
136
138
  /** All PriceNode entries (fixed capacity) */
@@ -142,4 +144,8 @@ export interface OrderbookState {
142
144
  syCpiAccounts: CpiAccountsRaw;
143
145
  exponentCoreCpiAccounts: ExponentCoreCpiAccountsRaw;
144
146
  flavor: Flavor;
147
+ /** Next offer index that will be allocated (from NodeAllocator free list) */
148
+ offersFreeListHead: number;
149
+ /** Bump index boundary for offers allocator */
150
+ offersBumpIndex: number;
145
151
  }
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ESCROW_REGISTERS = exports.OFFER_REGISTERS = exports.PRICE_NODE_REGISTERS = exports.MAX_USER_ESCROWS = exports.MAX_OFFERS = exports.MAX_PRICE_NODES = void 0;
4
- exports.MAX_PRICE_NODES = 100;
5
- exports.MAX_OFFERS = 500;
6
- exports.MAX_USER_ESCROWS = 250;
4
+ exports.MAX_PRICE_NODES = 1000;
5
+ exports.MAX_OFFERS = 2500;
6
+ exports.MAX_USER_ESCROWS = 1500;
7
7
  // RedBlackTree uses 3 registers per node: parent, left, right
8
8
  exports.PRICE_NODE_REGISTERS = 3;
9
9
  // Offer allocator uses 1 register per node (free‐list pointer)
@@ -1 +1 @@
1
- {"version":3,"file":"orderbook.js","sourceRoot":"","sources":["../src/orderbook.ts"],"names":[],"mappings":";;;AAKa,QAAA,eAAe,GAAG,GAAG,CAAA;AACrB,QAAA,UAAU,GAAG,GAAG,CAAA;AAChB,QAAA,gBAAgB,GAAG,GAAG,CAAA;AACnC,8DAA8D;AACjD,QAAA,oBAAoB,GAAG,CAAC,CAAA;AACrC,+DAA+D;AAClD,QAAA,eAAe,GAAG,CAAC,CAAA;AAChC,wCAAwC;AAC3B,QAAA,gBAAgB,GAAG,CAAC,CAAA"}
1
+ {"version":3,"file":"orderbook.js","sourceRoot":"","sources":["../src/orderbook.ts"],"names":[],"mappings":";;;AAKa,QAAA,eAAe,GAAG,IAAI,CAAA;AACtB,QAAA,UAAU,GAAG,IAAI,CAAA;AACjB,QAAA,gBAAgB,GAAG,IAAI,CAAA;AACpC,8DAA8D;AACjD,QAAA,oBAAoB,GAAG,CAAC,CAAA;AACrC,+DAA+D;AAClD,QAAA,eAAe,GAAG,CAAC,CAAA;AAChC,wCAAwC;AAC3B,QAAA,gBAAgB,GAAG,CAAC,CAAA"}
package/build/perena.d.ts CHANGED
@@ -1,29 +1,30 @@
1
- import { BN, web3 } from "@coral-xyz/anchor";
1
+ import { PublicKey } from "@solana/web3.js";
2
2
  import { SyEmissionRaw, SyEmissionJson } from "./common";
3
+ import BN from 'bn.js';
3
4
  export interface PerenaSyState {
4
- selfAddress: web3.PublicKey;
5
+ selfAddress: PublicKey;
5
6
  account: PerenaSyMetaAccount;
6
7
  /** The value of SY tokens in terms of the base asset */
7
8
  syRate: string;
8
- tokenProgramBase: web3.PublicKey;
9
- lpMint: web3.PublicKey;
9
+ tokenProgramBase: PublicKey;
10
+ lpMint: PublicKey;
10
11
  }
11
12
  export interface PerenaSyMetaAccountRaw {
12
- perenaStablePool: web3.PublicKey;
13
- mintSy: web3.PublicKey;
14
- tokenSyEscrow: web3.PublicKey;
13
+ perenaStablePool: PublicKey;
14
+ mintSy: PublicKey;
15
+ tokenSyEscrow: PublicKey;
15
16
  maxSySupply: BN;
16
17
  minMintSize: BN;
17
18
  minRedeemSize: BN;
18
19
  selfAddressBump: number[];
19
20
  emissions: SyEmissionRaw[];
20
- interfaceAccounts: web3.PublicKey[];
21
+ interfaceAccounts: PublicKey[];
21
22
  }
22
23
  export interface PerenaSyMetaAccount {
23
- perenaStablePool: web3.PublicKey;
24
- mintSy: web3.PublicKey;
25
- tokenSyEscrow: web3.PublicKey;
26
- interfaceAccounts: web3.PublicKey[];
24
+ perenaStablePool: PublicKey;
25
+ mintSy: PublicKey;
26
+ tokenSyEscrow: PublicKey;
27
+ interfaceAccounts: PublicKey[];
27
28
  maxSySupply: BN;
28
29
  minMintSize: BN;
29
30
  minRedeemSize: BN;
package/build/perena.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.deserializePerenaSyMetaAccountRaw = void 0;
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
@@ -1 +1 @@
1
- {"version":3,"file":"perena.js","sourceRoot":"","sources":["../src/perena.ts"],"names":[],"mappings":";;;AA8CA,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;AAXD,8EAWC"}
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/build/vault.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { BN, web3 } from "@coral-xyz/anchor";
2
1
  import { IFlavorStateJson, Flavor } from "./flavor";
3
2
  import { CpiAccountsRaw, CpiAccountsRawJson } from "./cpi";
4
3
  import { AnchorizedPNum, AnchorizedPNumJson } from "./common";
4
+ import { PublicKey } from "@solana/web3.js";
5
+ import BN from 'bn.js';
5
6
  export type VaultJson = {
6
7
  /** When does the vault start, as a UNIX timestamp */
7
8
  startTs: number;
@@ -66,26 +67,26 @@ export interface VaultState {
66
67
  /** For how long is the vault active */
67
68
  durationSeconds: number;
68
69
  /** Vault signer for token accounts, mints, SY position etc */
69
- authority: web3.PublicKey;
70
- addressLookupTable: web3.PublicKey;
70
+ authority: PublicKey;
71
+ addressLookupTable: PublicKey;
71
72
  lastSeenSyExchangeRate: number;
72
73
  allTimeHighSyExchangeRate: number;
73
74
  /** Vault-owned account for passing SY between SY program and user */
74
- escrowSy: web3.PublicKey;
75
+ escrowSy: PublicKey;
75
76
  /** Escrow account for holding deposited YT */
76
- escrowYt: web3.PublicKey;
77
+ escrowYt: PublicKey;
77
78
  /** Key to SY Program */
78
- syProgram: web3.PublicKey;
79
+ syProgram: PublicKey;
79
80
  syPosition: SyPosition;
80
81
  cpiAccounts: CpiAccountsRaw;
81
- mintPt: web3.PublicKey;
82
+ mintPt: PublicKey;
82
83
  status: number;
83
84
  minOperationSizeStrip: bigint;
84
85
  minOperationSizeMerge: bigint;
85
- mintYt: web3.PublicKey;
86
- mintSy: web3.PublicKey;
87
- yieldPositonAddress: web3.PublicKey;
88
- treasurySyTokenAccount: web3.PublicKey;
86
+ mintYt: PublicKey;
87
+ mintSy: PublicKey;
88
+ yieldPositonAddress: PublicKey;
89
+ treasurySyTokenAccount: PublicKey;
89
90
  interestBpsFee: number;
90
91
  totalSyInEscrow: bigint;
91
92
  flavor: Flavor;
@@ -140,22 +141,22 @@ export interface SyPositionJson {
140
141
  }
141
142
  export interface SyPosition {
142
143
  balanceSy: bigint;
143
- owner: web3.PublicKey;
144
+ owner: PublicKey;
144
145
  emissions: {
145
146
  /** Last seen index for SY-to-emission exchange rate */
146
147
  lastSeenIndex: number;
147
148
  /** mint of emission token */
148
- mint: web3.PublicKey;
149
+ mint: PublicKey;
149
150
  /** How many emissions are staged to claim */
150
151
  staged: bigint;
151
152
  }[];
152
153
  }
153
154
  export interface VaultEmission {
154
- tokenAccount: web3.PublicKey;
155
+ tokenAccount: PublicKey;
155
156
  initialIndex: AnchorizedPNum;
156
157
  lastSeenIndex: AnchorizedPNum;
157
158
  finalIndex: AnchorizedPNum;
158
- treasuryTokenAccount: web3.PublicKey;
159
+ treasuryTokenAccount: PublicKey;
159
160
  feeBps: number;
160
161
  treasuryEmission: BN;
161
162
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exponent-labs/exponent-types",
3
- "version": "0.1.8",
3
+ "version": "0.9.1",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "license": "AGPL-3.0",
@@ -8,8 +8,9 @@
8
8
  "build": "tsc --build"
9
9
  },
10
10
  "dependencies": {
11
- "@coral-xyz/anchor": "0.31.0",
12
- "@solana/spl-stake-pool": "1.1.8"
11
+ "@solana/web3.js": "1.98.4",
12
+ "@solana/spl-stake-pool": "1.1.8",
13
+ "bn.js": "5.2.2"
13
14
  },
14
15
  "devDependencies": {
15
16
  "typescript": "5.4.5"
package/src/common.ts CHANGED
@@ -1,23 +1,24 @@
1
- import { BN, web3 } from "@coral-xyz/anchor"
1
+ import { PublicKey } from '@solana/web3.js';
2
+ import BN from 'bn.js';
2
3
 
3
4
  export interface SyEmissionRaw {
4
- mint: web3.PublicKey
5
+ mint: PublicKey
5
6
  index: AnchorizedPNum
6
7
  lastSeenTotalAccruedEmissions: BN
7
8
  totalClaimedEmissions: BN
8
- tokenProgram: web3.PublicKey
9
- escrowAccount: web3.PublicKey
9
+ tokenProgram: PublicKey
10
+ escrowAccount: PublicKey
10
11
  treasuryEmission: BN
11
12
  lastSeenIndex: AnchorizedPNum
12
13
  }
13
14
 
14
15
  export interface SyEmissionRaw2 {
15
- mint: web3.PublicKey
16
+ mint: PublicKey
16
17
  index: AnchorizedPNum
17
18
  last_seen_total_accrued_emissions: BN
18
19
  total_claimed_emissions: BN
19
- token_program: web3.PublicKey
20
- escrow_account: web3.PublicKey
20
+ token_program: PublicKey
21
+ escrow_account: PublicKey
21
22
  treasury_emission: BN
22
23
  last_seen_index: AnchorizedPNum
23
24
  }
@@ -34,4 +35,4 @@ export interface SyEmissionJson {
34
35
  }
35
36
 
36
37
  export type AnchorizedPNum = { 0: BN[] }
37
- export type AnchorizedPNumJson = { 0: string[] }
38
+ export type AnchorizedPNumJson = { 0: string[] }
package/src/cpi.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { web3 } from "@coral-xyz/anchor"
1
+ import { PublicKey } from "@solana/web3.js"
2
2
 
3
3
  export interface AccountInfo {
4
- pubkey: web3.PublicKey
4
+ pubkey: PublicKey
5
5
  isSigner: boolean
6
6
  isWritable: boolean
7
7
  }
@@ -68,7 +68,7 @@ export type AccountInfoJson = {
68
68
 
69
69
  export function deserializeCpiAccountsRaw(serialized: CpiAccountsRawJson): CpiAccountsRaw {
70
70
  const deserializeAccountInfo = (accountInfo: AccountInfoJson): AccountInfo => ({
71
- pubkey: new web3.PublicKey(accountInfo.pubkey),
71
+ pubkey: new PublicKey(accountInfo.pubkey),
72
72
  isSigner: accountInfo.isSigner,
73
73
  isWritable: accountInfo.isWritable,
74
74
  })
package/src/flavor.ts CHANGED
@@ -1,41 +1,40 @@
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"
8
-
7
+ import {PublicKey, TransactionInstruction} from "@solana/web3.js"
9
8
  export type FlavorDiscriminator = "marginfi" | "kamino" | "jitoRestaking" | "perena" | "generic"
10
9
 
11
10
  export type MintSyArgs = {
12
11
  amountBase: string
13
- depositor: web3.PublicKey
14
- depositorBaseTokenAccount: web3.PublicKey
15
- depositorSyTokenAccount: web3.PublicKey
12
+ depositor: PublicKey
13
+ depositorBaseTokenAccount: PublicKey
14
+ depositorSyTokenAccount: PublicKey
16
15
  }
17
16
 
18
17
  export type RedeemSyArgs = {
19
18
  amountSy: string
20
- redeemer: web3.PublicKey
21
- redeemerBaseTokenAccount: web3.PublicKey
22
- redeemerSyTokenAccount: web3.PublicKey
19
+ redeemer: PublicKey
20
+ redeemerBaseTokenAccount: PublicKey
21
+ redeemerSyTokenAccount: PublicKey
23
22
  }
24
23
 
25
24
  export type InterfaceInstructionArgs = {
26
- signer: web3.PublicKey
25
+ signer: PublicKey
27
26
  amountBase: string
28
27
  }
29
28
 
30
29
  type BaseFlavorState = {
31
30
  flavor: FlavorDiscriminator
32
31
  currentSyExchangeRate: number
33
- mintBase: web3.PublicKey
34
- baseTokenProgram: web3.PublicKey
32
+ mintBase: PublicKey
33
+ baseTokenProgram: PublicKey
35
34
  emissions: {
36
35
  exchangeRate: AnchorizedPNum
37
- mint: web3.PublicKey
38
- tokenProgram: web3.PublicKey
36
+ mint: PublicKey
37
+ tokenProgram: PublicKey
39
38
  }[]
40
39
  }
41
40
 
@@ -52,12 +51,12 @@ type BaseFlavorStateJson = {
52
51
  }
53
52
 
54
53
  interface BaseFlavorTrait {
55
- ixMintSy: (args: MintSyArgs) => Promise<web3.TransactionInstruction>
56
- ixRedeemSy: (args: RedeemSyArgs) => Promise<web3.TransactionInstruction>
57
- preIxs: (args: { signer: web3.PublicKey }) => Promise<web3.TransactionInstruction[]>
58
- postIxs: (args: { signer: web3.PublicKey }) => Promise<web3.TransactionInstruction[]>
59
- preMintSyIx?: (args: InterfaceInstructionArgs) => Promise<web3.TransactionInstruction[]>
60
- postRedeemSyIx?: (args: InterfaceInstructionArgs) => Promise<web3.TransactionInstruction[]>
54
+ ixMintSy: (args: MintSyArgs) => Promise<TransactionInstruction>
55
+ ixRedeemSy: (args: RedeemSyArgs) => Promise<TransactionInstruction>
56
+ preIxs: (args: { signer: PublicKey }) => Promise<TransactionInstruction[]>
57
+ postIxs: (args: { signer: PublicKey }) => Promise<TransactionInstruction[]>
58
+ preMintSyIx?: (args: InterfaceInstructionArgs) => Promise<TransactionInstruction[]>
59
+ postRedeemSyIx?: (args: InterfaceInstructionArgs) => Promise<TransactionInstruction[]>
61
60
  }
62
61
 
63
62
  export interface FlavorKaminoState extends BaseFlavorState {
@@ -67,9 +66,9 @@ export interface FlavorKaminoState extends BaseFlavorState {
67
66
 
68
67
  export interface FlavorMarginfiState extends BaseFlavorState {
69
68
  flavor: "marginfi"
70
- bank: web3.PublicKey
71
- emissionMint?: web3.PublicKey
72
- emissionTokenProgram?: web3.PublicKey
69
+ bank: PublicKey
70
+ emissionMint?: PublicKey
71
+ emissionTokenProgram?: PublicKey
73
72
  mfiSyState: MfiSyState
74
73
  }
75
74