@wireio/stake 1.0.0 → 1.0.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/lib/stake.browser.js +15 -20
- package/lib/stake.browser.js.map +1 -1
- package/lib/stake.js +15 -20
- package/lib/stake.js.map +1 -1
- package/lib/stake.m.js +15 -20
- package/lib/stake.m.js.map +1 -1
- package/package.json +1 -1
- package/src/networks/solana/solana.ts +29 -23
package/package.json
CHANGED
|
@@ -208,14 +208,18 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
try {
|
|
211
|
-
|
|
212
|
-
const {
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
211
|
+
// Build compute budget increase instruction
|
|
212
|
+
const cuIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 400_000 });
|
|
213
|
+
|
|
214
|
+
// Build the Outpost synd instruction
|
|
215
|
+
const ix = await this.depositClient.buildDepositTx(amountLamports);
|
|
216
|
+
|
|
217
|
+
// Wrap in a transaction and send
|
|
218
|
+
const tx = new Transaction().add(cuIx, ix);
|
|
219
|
+
const prepared = await this.prepareTx(tx);
|
|
220
|
+
const signed = await this.signTransaction(prepared.tx);
|
|
221
|
+
|
|
222
|
+
return this.sendAndConfirmHttp(signed, prepared);
|
|
219
223
|
} catch (err) {
|
|
220
224
|
throw new Error(`Failed to deposit Solana: ${err}`);
|
|
221
225
|
}
|
|
@@ -238,14 +242,18 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
238
242
|
}
|
|
239
243
|
|
|
240
244
|
try {
|
|
241
|
-
|
|
242
|
-
const {
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
245
|
+
// Build compute budget increase instruction
|
|
246
|
+
const cuIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 400_000 });
|
|
247
|
+
|
|
248
|
+
// Build the Outpost synd instruction
|
|
249
|
+
const ix = await this.depositClient.buildWithdrawTx(amountLamports);
|
|
250
|
+
|
|
251
|
+
// Wrap in a transaction and send
|
|
252
|
+
const tx = new Transaction().add(cuIx, ix);
|
|
253
|
+
const prepared = await this.prepareTx(tx);
|
|
254
|
+
const signed = await this.signTransaction(prepared.tx);
|
|
255
|
+
|
|
256
|
+
return this.sendAndConfirmHttp(signed, prepared);
|
|
249
257
|
} catch (err) {
|
|
250
258
|
throw new Error(`Failed to withdraw Solana: ${err}`);
|
|
251
259
|
}
|
|
@@ -328,14 +336,12 @@ export class SolanaStakingClient implements IStakingClient {
|
|
|
328
336
|
const user = this.solPubKey;
|
|
329
337
|
const cuIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 400_000 });
|
|
330
338
|
const ix = await this.tokenClient.buildPurchaseIx(amountLamports, user);
|
|
339
|
+
|
|
331
340
|
const tx = new Transaction().add(cuIx, ix);
|
|
332
|
-
const
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
return
|
|
336
|
-
blockhash,
|
|
337
|
-
lastValidBlockHeight,
|
|
338
|
-
});
|
|
341
|
+
const prepared = await this.prepareTx(tx);
|
|
342
|
+
const signed = await this.signTransaction(prepared.tx);
|
|
343
|
+
|
|
344
|
+
return this.sendAndConfirmHttp(signed, prepared);
|
|
339
345
|
}
|
|
340
346
|
catch (err) {
|
|
341
347
|
throw new Error(`Failed to buy liqSOL pretokens: ${err}`);
|