Skip to content

Commit

Permalink
Merge pull request #3012 from dusk-network/feature-3011
Browse files Browse the repository at this point in the history
web-wallet: Fix Broken Explorer Links for Stake
  • Loading branch information
nortonandreev authored Nov 18, 2024
2 parents 2e875ad + 06586d5 commit 08f95c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import { Gas } from "$lib/vendor/w3sper.js/src/mod";
import { createCurrencyFormatter, luxToDusk } from "$lib/dusk/currency";
import { getLastTransactionHash } from "$lib/transactions";
import {
gasStore,
operationsStore,
Expand Down Expand Up @@ -70,18 +69,18 @@
stake: (amount, gasPrice, gasLimit) =>
walletStore
.stake(amount, new Gas({ limit: gasLimit, price: gasPrice }))
.then(getLastTransactionHash),
.then(getKey("hash")),
unstake: (gasPrice, gasLimit) =>
walletStore
.unstake(new Gas({ limit: gasLimit, price: gasPrice }))
.then(getLastTransactionHash),
.then(getKey("hash")),
"withdraw-rewards": (gasPrice, gasLimit) =>
walletStore
.withdrawReward(
$walletStore.stakeInfo.reward,
new Gas({ limit: gasLimit, price: gasPrice })
)
.then(getLastTransactionHash),
.then(getKey("hash")),
};
/** @type {(operations: ContractOperation[]) => ContractOperation[]} */
Expand Down
8 changes: 5 additions & 3 deletions web-wallet/src/lib/stores/stores.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ type WalletStoreServices = {
stake: (
amount: bigint,
gas: import("$lib/vendor/w3sper.js/src/mod").Gas
) => Promise<any>;
) => Promise<TransactionInfo>;

sync: (fromBlock?: bigint) => Promise<void>;

Expand All @@ -141,12 +141,14 @@ type WalletStoreServices = {
gas: import("$lib/vendor/w3sper.js/src/mod").Gas
) => Promise<TransactionInfo>;

unstake: (gas: import("$lib/vendor/w3sper.js/src/mod").Gas) => Promise<any>;
unstake: (
gas: import("$lib/vendor/w3sper.js/src/mod").Gas
) => Promise<TransactionInfo>;

withdrawReward: (
amount: bigint,
gas: import("$lib/vendor/w3sper.js/src/mod").Gas
) => Promise<any>;
) => Promise<TransactionInfo>;
};

type WalletStore = Readable<WalletStoreContent> & WalletStoreServices;

0 comments on commit 08f95c3

Please sign in to comment.