@@ -39,7 +39,7 @@ export function getToken(
3939 txn : Tx [ "tx" ] ,
4040 nativeToken : string
4141) : string | undefined {
42- if ( txn ?. kind === "bond" ) return nativeToken ;
42+ if ( txn ?. kind === "bond" || txn ?. kind === "unbond" ) return nativeToken ;
4343 let parsed ;
4444 try {
4545 parsed = txn ?. data ? JSON . parse ( txn . data ) : undefined ;
@@ -62,7 +62,7 @@ export function getToken(
6262 return undefined ;
6363}
6464
65- const getBondTransactionInfo = (
65+ const getBondOrUnbondTransactionInfo = (
6666 tx : Tx [ "tx" ]
6767) : { amount : BigNumber ; sender ?: string ; receiver ?: string } | undefined => {
6868 if ( ! tx ?. data ) return undefined ;
@@ -118,10 +118,12 @@ export const TransactionCard = ({
118118 const token = getToken ( transaction , nativeToken ?? "" ) ;
119119 const chainAssetsMap = useAtomValue ( chainAssetsMapAtom ) ;
120120 const asset = token ? chainAssetsMap [ token ] : undefined ;
121- const isBondingTransaction = transactionTopLevel ?. tx ?. kind === "bond" ;
121+ const isBondingOrUnbondingTransaction = [ "bond" , "unbond" ] . includes (
122+ transactionTopLevel ?. tx ?. kind ?? ""
123+ ) ;
122124 const txnInfo =
123- isBondingTransaction ?
124- getBondTransactionInfo ( transaction )
125+ isBondingOrUnbondingTransaction ?
126+ getBondOrUnbondTransactionInfo ( transaction )
125127 : getTransactionInfo ( transaction ) ;
126128 const receiver = txnInfo ?. receiver ;
127129 const sender = txnInfo ?. sender ;
@@ -134,7 +136,8 @@ export const TransactionCard = ({
134136
135137 const getBaseAmount = ( ) : BigNumber | undefined => {
136138 if ( asset && txnInfo ?. amount ) {
137- if ( isBondingTransaction ) return toDisplayAmount ( asset , txnInfo . amount ) ;
139+ if ( isBondingOrUnbondingTransaction )
140+ return toDisplayAmount ( asset , txnInfo . amount ) ;
138141 if ( isNamadaAsset ( asset ) ) return txnInfo . amount ;
139142 return toDisplayAmount ( asset , txnInfo . amount ) ;
140143 } else return undefined ;
@@ -154,6 +157,7 @@ export const TransactionCard = ({
154157 if ( isReceived ) return "Receive" ;
155158 if ( kind . startsWith ( "ibc" ) ) return "IBC Transfer" ;
156159 if ( kind === "bond" ) return "Stake" ;
160+ if ( kind === "unbond" ) return "Unstake" ;
157161 if ( kind === "claimRewards" ) return "Claim Rewards" ;
158162 if ( kind === "transparentTransfer" ) return "Transparent Transfer" ;
159163 if ( kind === "shieldingTransfer" ) return "Shielding Transfer" ;
@@ -171,7 +175,9 @@ export const TransactionCard = ({
171175 "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 items-center my-1 font-semibold" ,
172176 "gap-5 bg-neutral-800 rounded-sm px-5 text-white border border-transparent" ,
173177 "transition-colors duration-200 hover:border-neutral-500" ,
174- isBondingTransaction && validator ?. imageUrl ? "py-3" : "py-5"
178+ isBondingOrUnbondingTransaction && validator ?. imageUrl ?
179+ "py-3"
180+ : "py-5"
175181 )
176182 ) }
177183 >
@@ -205,7 +211,7 @@ export const TransactionCard = ({
205211 < div className = "relative group/tooltip" >
206212 < CopyToClipboardControl
207213 className = "ml-1.5 text-neutral-400"
208- value = { transaction ?. txId ?? "" }
214+ value = { transaction ?. wrapperId ?? "" }
209215 />
210216 < Tooltip position = "right" className = "p-2 -mr-3 w-[150px] z-10" >
211217 Copy transaction hash
@@ -239,7 +245,7 @@ export const TransactionCard = ({
239245 />
240246 </ div >
241247
242- { ! isBondingTransaction && (
248+ { ! isBondingOrUnbondingTransaction && (
243249 < div className = "flex flex-col" >
244250 < h4 className = { isShieldedAddress ( sender ?? "" ) ? "text-yellow" : "" } >
245251 From
@@ -260,14 +266,14 @@ export const TransactionCard = ({
260266
261267 < div className = "flex flex-col" >
262268 < h4 className = { isShieldedAddress ( receiver ?? "" ) ? "text-yellow" : "" } >
263- { isBondingTransaction ? "Validator" : "To" }
269+ { isBondingOrUnbondingTransaction ? "Validator" : "To" }
264270 </ h4 >
265271 < h4 className = { isShieldedAddress ( receiver ?? "" ) ? "text-yellow" : "" } >
266272 { isShieldedAddress ( receiver ?? "" ) ?
267273 < span className = "flex items-center gap-1" >
268274 < FaLock className = "w-4 h-4" /> Shielded
269275 </ span >
270- : isBondingTransaction ?
276+ : isBondingOrUnbondingTransaction ?
271277 validator ?. imageUrl ?
272278 < img
273279 src = { validator ?. imageUrl }
0 commit comments