fix token names in toast messages

Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
Uncle Fatso 2025-08-11 21:07:42 +03:00
parent 3348a99155
commit 9b1c8c0f09
Signed by: f4ts0
GPG Key ID: 565F4F2860226EBB
5 changed files with 47 additions and 18 deletions

View File

@ -1,7 +1,7 @@
{
"name": "ghost-dao-interface",
"private": true,
"version": "0.2.2",
"version": "0.2.3",
"type": "module",
"scripts": {
"dev": "vite",

View File

@ -19,7 +19,7 @@ const ClaimConfirmationModal = (props) => {
switch (props.action.toUpperCase()) {
case "FORFEIT":
await forfeit(props.chainId, props.receiver);
await forfeit(props.chainId, props.receiver, props.ftsoSymbol);
break;
case "CLAIM":
await claim(

View File

@ -91,6 +91,7 @@ export const ClaimsArea = ({ chainId, address, epoch }) => {
outputToken={claim.expiry > epoch.number ? ftsoSymbol : isPayoutGhst ? ghstSymbol : stnkSymbol}
stnkSymbol={stnkSymbol}
ghstSymbol={ghstSymbol}
ftsoSymbol={ftsoSymbol}
action={claim.expiry > epoch.number ? "forfeit" : "claim"}
chainId={chainId}
/>

View File

@ -71,18 +71,46 @@ const StakeConfirmationModal = (props) => {
switch (props.action) {
case "STAKE":
isRebase = props.bottomToken.toUpperCase() === "STNK";
await stake(props.chainId, props.address, actionAmount._value.toBigInt(), isRebase, props.isClaim);
isRebase = props.bottomToken === props.stnkSymbol;
await stake(
props.chainId,
props.address,
actionAmount._value.toBigInt(),
isRebase,
props.isClaim,
props.ftsoSymbol,
props.stnkSymbol,
props.ghstSymbol
);
break;
case "UNSTAKE":
isRebase = props.upperToken.toUpperCase() === "STNK";
await unstake(props.chainId, props.address, actionAmount._value.toBigInt(), props.isTrigger, isRebase);
isRebase = props.upperToken === stnkSymbol;
await unstake(
props.chainId,
props.address,
actionAmount._value.toBigInt(),
props.isTrigger,
isRebase,
props.ftsoSymbol,
props.stnkSymbol,
props.ghstSymbol
);
break;
case "WRAP":
await wrap(props.chainId, props.address, actionAmount._value.toBigInt());
await wrap(
props.chainId,
props.address,
actionAmount._value.toBigInt(),
props.ghstSymbol
);
break;
case "UNWRAP":
await unwrap(props.chainId, props.address, actionAmount._value.toBigInt());
await unwrap(
props.chainId,
props.address,
actionAmount._value.toBigInt(),
props.stnkSymbol
);
break;
default:
console.log("Wrong action to be executed!");

View File

@ -113,7 +113,7 @@ export const useGhostedSupply = (chainId) => {
return ghostedSupply;
}
export const stake = async (chainId, account, amount, isRebase, isClaim) => {
export const stake = async (chainId, account, amount, isRebase, isClaim, ftsoSymbol, stnkSymbol, ghstSymbol) => {
const args = [
amount,
account,
@ -122,7 +122,7 @@ export const stake = async (chainId, account, amount, isRebase, isClaim) => {
];
const messages = {
replacedMsg: "Staking transaction was replaced. Wait for inclusion please.",
successMsg: `FTSO tokens staked successfully! Wait for the warmup period to claim your ${isRebase ? "STNK" : "GHST"}.`,
successMsg: `${ftsoSymbol} tokens staked successfully! Wait for the warmup period to claim your ${isRebase ? stnkSymbol : ghstSymbol}.`,
errorMsg: "Staking transaction failed. Check logs for error detalization.",
};
await executeOnChainTransaction(
@ -134,7 +134,7 @@ export const stake = async (chainId, account, amount, isRebase, isClaim) => {
);
}
export const unstake = async (chainId, account, amount, isTrigger, isRebase) => {
export const unstake = async (chainId, account, amount, isTrigger, isRebase, ftsoSymbol, stnkSymbol, ghstSymbol) => {
const args = [
amount,
account,
@ -143,7 +143,7 @@ export const unstake = async (chainId, account, amount, isTrigger, isRebase) =>
];
const messages = {
replacedMsg: "Unstake transaction was replaced. Wait for inclusion please.",
successMsg: `${isRebase ? "STNK" : "GHST"} tokens unstaked successfully! Check your FTSO balance on ${shorten(account)}.`,
successMsg: `${isRebase ? stnkSymbol : ghstSymbol} tokens unstaked successfully! Check your ${ftsoSymbol} balance on ${shorten(account)}.`,
errorMsg: "Unstake transaction failed. Check logs for error detalization.",
};
await executeOnChainTransaction(
@ -155,10 +155,10 @@ export const unstake = async (chainId, account, amount, isTrigger, isRebase) =>
);
}
export const forfeit = async (chainId, account) => {
export const forfeit = async (chainId, account, ftsoSymbol) => {
const messages = {
replacedMsg: "Forfeit transaction was replaced. Wait for inclusion please.",
successMsg: `Tokens forfeited successfully! Check your FTSO balance on ${shorten(account)}.`,
successMsg: `Tokens forfeited successfully! Check your ${ftsoSymbol} balance on ${shorten(account)}.`,
errorMsg: "Forfeit transaction failed. Check logs for error detalization.",
};
await executeOnChainTransaction(
@ -186,10 +186,10 @@ export const claim = async (chainId, account, isStnk, stnkSymbol, ghstSymbol) =>
);
}
export const unwrap = async (chainId, account, amount) => {
export const unwrap = async (chainId, account, amount, stnkSymbol) => {
const messages = {
replacedMsg: "Unwrap transaction was replaced. Wait for inclusion please.",
successMsg: `Tokens unwrapped successfully! Check your STNK balance on ${shorten(account)}.`,
successMsg: `Tokens unwrapped successfully! Check your ${stnkSymbol} balance on ${shorten(account)}.`,
errorMsg: "Unwrap transaction failed. Check logs for error detalization.",
};
await executeOnChainTransaction(
@ -201,10 +201,10 @@ export const unwrap = async (chainId, account, amount) => {
);
}
export const wrap = async (chainId, account, amount) => {
export const wrap = async (chainId, account, amount, ghstSymbol) => {
const messages = {
replacedMsg: "Wrap transaction was replaced. Wait for inclusion please.",
successMsg: `Tokens wrapped successfully! Check your GHST balance on ${shorten(account)}.`,
successMsg: `Tokens wrapped successfully! Check your ${ghstSymbol} balance on ${shorten(account)}.`,
errorMsg: "Wrap transaction failed. Check logs for error detalization.",
};
await executeOnChainTransaction(