@streamflow/staking 8.0.1-alpha.p287.54fe41f → 8.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/dist/cjs/index.cjs +24 -70
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +25 -71
- package/dist/esm/index.js.map +1 -1
- package/package.json +4 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -2449,16 +2449,8 @@ var SolanaStakingClient = class {
|
|
|
2449
2449
|
return feeManagerProgram.account.feeValue.fetchNullable(feeValueKey);
|
|
2450
2450
|
}
|
|
2451
2451
|
async createStakePool(data, extParams) {
|
|
2452
|
-
const
|
|
2453
|
-
const {
|
|
2454
|
-
async (params) => this.prepareCreateStakePoolInstructions(data, params).then((res) => ({
|
|
2455
|
-
ixs: solana.prepareBaseInstructions(this.connection, params).concat(res.ixs),
|
|
2456
|
-
publicKey: res.publicKey
|
|
2457
|
-
})),
|
|
2458
|
-
executionParams,
|
|
2459
|
-
(res) => res.ixs
|
|
2460
|
-
);
|
|
2461
|
-
const { signature } = await this.execute(ixs, extParams.invoker, executionParams.skipSimulation);
|
|
2452
|
+
const { ixs, publicKey } = await this.prepareCreateStakePoolInstructions(data, extParams);
|
|
2453
|
+
const { signature } = await this.execute(ixs, extParams);
|
|
2462
2454
|
return {
|
|
2463
2455
|
ixs,
|
|
2464
2456
|
txId: signature,
|
|
@@ -2488,14 +2480,8 @@ var SolanaStakingClient = class {
|
|
|
2488
2480
|
return { ixs: [createInstruction], publicKey: stakePoolPDA };
|
|
2489
2481
|
}
|
|
2490
2482
|
async stake(data, extParams) {
|
|
2491
|
-
const
|
|
2492
|
-
const
|
|
2493
|
-
(params) => this.prepareStakeInstructions(data, params).then(
|
|
2494
|
-
(res) => solana.prepareBaseInstructions(this.connection, params).concat(res.ixs)
|
|
2495
|
-
),
|
|
2496
|
-
executionParams
|
|
2497
|
-
);
|
|
2498
|
-
const { signature } = await this.execute(ixs, extParams.invoker, executionParams.skipSimulation);
|
|
2483
|
+
const { ixs } = await this.prepareStakeInstructions(data, extParams);
|
|
2484
|
+
const { signature } = await this.execute(ixs, extParams);
|
|
2499
2485
|
return {
|
|
2500
2486
|
ixs,
|
|
2501
2487
|
txId: signature
|
|
@@ -2519,14 +2505,8 @@ var SolanaStakingClient = class {
|
|
|
2519
2505
|
return { ixs: [instruction] };
|
|
2520
2506
|
}
|
|
2521
2507
|
async unstake(data, extParams) {
|
|
2522
|
-
const
|
|
2523
|
-
const
|
|
2524
|
-
(params) => this.prepareUnstakeInstructions(data, params).then(
|
|
2525
|
-
(res) => solana.prepareBaseInstructions(this.connection, params).concat(res.ixs)
|
|
2526
|
-
),
|
|
2527
|
-
executionParams
|
|
2528
|
-
);
|
|
2529
|
-
const { signature } = await this.execute(ixs, extParams.invoker, executionParams.skipSimulation);
|
|
2508
|
+
const { ixs } = await this.prepareUnstakeInstructions(data, extParams);
|
|
2509
|
+
const { signature } = await this.execute(ixs, extParams);
|
|
2530
2510
|
return {
|
|
2531
2511
|
ixs,
|
|
2532
2512
|
txId: signature
|
|
@@ -2550,16 +2530,8 @@ var SolanaStakingClient = class {
|
|
|
2550
2530
|
return { ixs: [instruction] };
|
|
2551
2531
|
}
|
|
2552
2532
|
async createRewardPool(data, extParams) {
|
|
2553
|
-
const
|
|
2554
|
-
const {
|
|
2555
|
-
async (params) => this.prepareCreateRewardPoolInstructions(data, params).then((res) => ({
|
|
2556
|
-
ixs: solana.prepareBaseInstructions(this.connection, params).concat(res.ixs),
|
|
2557
|
-
publicKey: res.publicKey
|
|
2558
|
-
})),
|
|
2559
|
-
executionParams,
|
|
2560
|
-
(res) => res.ixs
|
|
2561
|
-
);
|
|
2562
|
-
const { signature } = await this.execute(ixs, extParams.invoker, executionParams.skipSimulation);
|
|
2533
|
+
const { ixs, publicKey } = await this.prepareCreateRewardPoolInstructions(data, extParams);
|
|
2534
|
+
const { signature } = await this.execute(ixs, extParams);
|
|
2563
2535
|
return {
|
|
2564
2536
|
ixs,
|
|
2565
2537
|
txId: signature,
|
|
@@ -2589,14 +2561,8 @@ var SolanaStakingClient = class {
|
|
|
2589
2561
|
return { publicKey: rewardPoolKey, ixs: [instruction] };
|
|
2590
2562
|
}
|
|
2591
2563
|
async claimRewards(data, extParams) {
|
|
2592
|
-
const
|
|
2593
|
-
const
|
|
2594
|
-
(params) => this.prepareClaimRewardsInstructions(data, params).then(
|
|
2595
|
-
(res) => solana.prepareBaseInstructions(this.connection, params).concat(res.ixs)
|
|
2596
|
-
),
|
|
2597
|
-
executionParams
|
|
2598
|
-
);
|
|
2599
|
-
const { signature } = await this.execute(ixs, extParams.invoker, executionParams.skipSimulation);
|
|
2564
|
+
const { ixs } = await this.prepareClaimRewardsInstructions(data, extParams);
|
|
2565
|
+
const { signature } = await this.execute(ixs, extParams);
|
|
2600
2566
|
return {
|
|
2601
2567
|
ixs,
|
|
2602
2568
|
txId: signature
|
|
@@ -2616,14 +2582,8 @@ var SolanaStakingClient = class {
|
|
|
2616
2582
|
return { ixs: [instruction] };
|
|
2617
2583
|
}
|
|
2618
2584
|
async fundPool(data, extParams) {
|
|
2619
|
-
const
|
|
2620
|
-
const
|
|
2621
|
-
(params) => this.prepareFundPoolInstructions(data, params).then(
|
|
2622
|
-
(res) => solana.prepareBaseInstructions(this.connection, params).concat(res.ixs)
|
|
2623
|
-
),
|
|
2624
|
-
executionParams
|
|
2625
|
-
);
|
|
2626
|
-
const { signature } = await this.execute(ixs, extParams.invoker, executionParams.skipSimulation);
|
|
2585
|
+
const { ixs } = await this.prepareFundPoolInstructions(data, extParams);
|
|
2586
|
+
const { signature } = await this.execute(ixs, extParams);
|
|
2627
2587
|
return {
|
|
2628
2588
|
ixs,
|
|
2629
2589
|
txId: signature
|
|
@@ -2656,13 +2616,8 @@ var SolanaStakingClient = class {
|
|
|
2656
2616
|
return { ixs: treasuryATA ? treasuryATA.concat([instruction]) : [instruction] };
|
|
2657
2617
|
}
|
|
2658
2618
|
async createRewardEntry(data, extParams) {
|
|
2659
|
-
const
|
|
2660
|
-
const
|
|
2661
|
-
return this.prepareCreateRewardEntryInstructions(data, params).then(
|
|
2662
|
-
(res) => solana.prepareBaseInstructions(this.connection, params).concat(res.ixs)
|
|
2663
|
-
);
|
|
2664
|
-
}, executionParams);
|
|
2665
|
-
const { signature } = await this.execute(ixs, extParams.invoker, executionParams.skipSimulation);
|
|
2619
|
+
const { ixs } = await this.prepareCreateRewardEntryInstructions(data, extParams);
|
|
2620
|
+
const { signature } = await this.execute(ixs, extParams);
|
|
2666
2621
|
return {
|
|
2667
2622
|
ixs,
|
|
2668
2623
|
txId: signature
|
|
@@ -2681,13 +2636,8 @@ var SolanaStakingClient = class {
|
|
|
2681
2636
|
return { ixs: [instruction] };
|
|
2682
2637
|
}
|
|
2683
2638
|
async updateRewardPool(data, extParams) {
|
|
2684
|
-
const
|
|
2685
|
-
const
|
|
2686
|
-
return this.prepareUpdateRewardPoolInstructions(data, params).then(
|
|
2687
|
-
(res) => solana.prepareBaseInstructions(this.connection, params).concat(res.ixs)
|
|
2688
|
-
);
|
|
2689
|
-
}, executionParams);
|
|
2690
|
-
const { signature } = await this.execute(ixs, extParams.invoker, executionParams.skipSimulation);
|
|
2639
|
+
const { ixs } = await this.prepareUpdateRewardPoolInstructions(data, extParams);
|
|
2640
|
+
const { signature } = await this.execute(ixs, extParams);
|
|
2691
2641
|
return {
|
|
2692
2642
|
ixs,
|
|
2693
2643
|
txId: signature
|
|
@@ -2719,19 +2669,23 @@ var SolanaStakingClient = class {
|
|
|
2719
2669
|
);
|
|
2720
2670
|
return accountEntity.discriminator;
|
|
2721
2671
|
}
|
|
2722
|
-
async execute(ixs,
|
|
2723
|
-
const { tx, hash, context } = await solana.prepareTransaction(
|
|
2672
|
+
async execute(ixs, extParams) {
|
|
2673
|
+
const { tx, hash, context } = await solana.prepareTransaction(
|
|
2674
|
+
this.connection,
|
|
2675
|
+
solana.prepareBaseInstructions(this.connection, extParams).concat(ixs),
|
|
2676
|
+
extParams.invoker.publicKey
|
|
2677
|
+
);
|
|
2724
2678
|
try {
|
|
2725
2679
|
const signature = await solana.signAndExecuteTransaction(
|
|
2726
2680
|
this.connection,
|
|
2727
|
-
invoker,
|
|
2681
|
+
extParams.invoker,
|
|
2728
2682
|
tx,
|
|
2729
2683
|
{
|
|
2730
2684
|
hash,
|
|
2731
2685
|
context,
|
|
2732
2686
|
commitment: this.getCommitment()
|
|
2733
2687
|
},
|
|
2734
|
-
{ sendThrottler: this.sendThrottler
|
|
2688
|
+
{ sendThrottler: this.sendThrottler }
|
|
2735
2689
|
);
|
|
2736
2690
|
return { signature };
|
|
2737
2691
|
} catch (err) {
|