@wireio/stake 2.3.1 → 2.4.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.
@@ -118,6 +118,40 @@ export type LiqsolToken = {
118
118
  }
119
119
  }
120
120
  ]
121
+ },
122
+ {
123
+ "name": "updateLiqsolMetadataPermissionless",
124
+ "discriminator": [
125
+ 21,
126
+ 255,
127
+ 26,
128
+ 184,
129
+ 136,
130
+ 110,
131
+ 214,
132
+ 33
133
+ ],
134
+ "accounts": [
135
+ {
136
+ "name": "payer",
137
+ "writable": true,
138
+ "signer": true
139
+ },
140
+ {
141
+ "name": "mintAuthority"
142
+ },
143
+ {
144
+ "name": "mint",
145
+ "writable": true
146
+ },
147
+ {
148
+ "name": "tokenProgram"
149
+ },
150
+ {
151
+ "name": "systemProgram"
152
+ }
153
+ ],
154
+ "args": []
121
155
  }
122
156
  ],
123
157
  "errors": [
@@ -100,6 +100,40 @@ export type TransferHook = {
100
100
  "type": "u64"
101
101
  }
102
102
  ]
103
+ },
104
+ {
105
+ "name": "updateExtraAccountMetaList",
106
+ "discriminator": [
107
+ 44,
108
+ 125,
109
+ 141,
110
+ 226,
111
+ 97,
112
+ 179,
113
+ 166,
114
+ 96
115
+ ],
116
+ "accounts": [
117
+ {
118
+ "name": "payer",
119
+ "writable": true,
120
+ "signer": true
121
+ },
122
+ {
123
+ "name": "extraAccountMetaList",
124
+ "writable": true
125
+ },
126
+ {
127
+ "name": "mint"
128
+ },
129
+ {
130
+ "name": "systemProgram"
131
+ },
132
+ {
133
+ "name": "liqsolCore"
134
+ }
135
+ ],
136
+ "args": []
103
137
  }
104
138
  ],
105
139
  "accounts": [
@@ -169,6 +169,7 @@ export class OutpostClient {
169
169
  tokenProgram: TOKEN_2022_PROGRAM_ID,
170
170
  associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID,
171
171
  systemProgram: SystemProgram.programId,
172
+ pretokenPurchaseHistory: a.pretokenPurchaseHistory,
172
173
  })
173
174
  .instruction();
174
175
  }
@@ -210,6 +211,7 @@ export class OutpostClient {
210
211
  tokenProgram: TOKEN_2022_PROGRAM_ID,
211
212
  systemProgram: SystemProgram.programId,
212
213
  associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID,
214
+ pretokenPurchaseHistory: a.pretokenPurchaseHistory,
213
215
  })
214
216
  .instruction();
215
217
  }
@@ -147,6 +147,8 @@ export class TokenClient {
147
147
  tokenProgram: TOKEN_2022_PROGRAM_ID,
148
148
  associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID,
149
149
  systemProgram: SystemProgram.programId,
150
+
151
+ pretokenPurchaseHistory: a.pretokenPurchaseHistory,
150
152
  })
151
153
  .instruction();
152
154
  }
@@ -109,6 +109,9 @@ export const PDA_SEEDS = {
109
109
  MINT_METADATA: 'mint_metadata',
110
110
  LIQ_RECEIPT_DATA: 'liq_receipt_data',
111
111
  WITHDRAW_MINT: 'mint',
112
+
113
+ // New
114
+ PRETOKEN_PURCHASE_HISTORY: 'pretoken_purchase_history',
112
115
  } as const;
113
116
 
114
117
  /**
@@ -263,6 +263,13 @@ export class SolanaProgramService {
263
263
  )[0];
264
264
  }
265
265
 
266
+ derivePretokenPurchaseHistoryPda(poolAuthority: PublicKey): PublicKey {
267
+ return PublicKey.findProgramAddressSync(
268
+ [Buffer.from(PDA_SEEDS.PRETOKEN_PURCHASE_HISTORY), poolAuthority.toBuffer()],
269
+ this.ids.LIQSOL_CORE,
270
+ )[0];
271
+ }
272
+
266
273
  /**
267
274
  * NFT mint for withdrawal receipt, derived from nextReceiptId.
268
275
  */
@@ -238,10 +238,10 @@ export type GlobalState = {
238
238
  currentIndex: BN;
239
239
 
240
240
  /**
241
- * Last observed liqSOL pool balance
242
- * used for computing incremental yield.
241
+ * Replaced legacy `lastPoolLiqsolBalance`
242
+ * with expected balance based on total shares and current index.
243
243
  */
244
- lastPoolLiqsolBalance: BN;
244
+ expectedPoolBalance: BN;
245
245
 
246
246
  /**
247
247
  * Accumulated liqSOL yield available to the protocol
@@ -278,6 +278,9 @@ export interface OutpostAccounts {
278
278
 
279
279
  // Transfer hook extra accounts
280
280
  extraAccountMetaList: PublicKey;
281
+
282
+ // New
283
+ pretokenPurchaseHistory: PublicKey;
281
284
  }
282
285
 
283
286
  export async function buildOutpostAccounts(
@@ -325,6 +328,8 @@ export async function buildOutpostAccounts(
325
328
 
326
329
  const extraAccountMetaList = pgs.deriveExtraAccountMetaListPda(liqsolMint);
327
330
 
331
+ const pretokenPurchaseHistory = pgs.derivePretokenPurchaseHistoryPda(poolAuthority);
332
+
328
333
  // Chainlink program feeds
329
334
  let chainLinkFeed = CHAINLINK_FEED;
330
335
  let chainLinkProgram = CHAINLINK_PROGRAM;
@@ -365,7 +370,8 @@ export async function buildOutpostAccounts(
365
370
  trancheState,
366
371
  chainLinkFeed,
367
372
  chainLinkProgram,
368
- extraAccountMetaList
373
+ extraAccountMetaList,
374
+ pretokenPurchaseHistory
369
375
  };
370
376
  }
371
377
  // -----------------------------------------------------------------------------