-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
81 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { Ics20Withdrawal } from '@buf/penumbra-zone_penumbra.bufbuild_es/penumbra/core/component/ibc/v1/ibc_pb'; | ||
import { ViewBox } from './viewbox'; | ||
import { ActionDetails } from './action-details'; | ||
import { joinLoHiAmount } from '@penumbra-zone/types/src/amount'; | ||
import { bech32Address } from '@penumbra-zone/bech32'; | ||
|
||
export const Ics20WithdrawalComponent = ({ value }: { value: Ics20Withdrawal }) => { | ||
return ( | ||
<ViewBox | ||
label='Ics20 Withdrawal' | ||
visibleContent={ | ||
<ActionDetails> | ||
{value.denom && <ActionDetails.Row label='Denom'>{value.denom.denom}</ActionDetails.Row>} | ||
|
||
{value.amount && ( | ||
<ActionDetails.Row label='Amount'> | ||
{joinLoHiAmount(value.amount).toString()} | ||
</ActionDetails.Row> | ||
)} | ||
|
||
<ActionDetails.Row label='Destination Address'> | ||
{value.destinationChainAddress} | ||
</ActionDetails.Row> | ||
|
||
<ActionDetails.Row label='Source channel'>{value.sourceChannel}</ActionDetails.Row> | ||
|
||
{value.returnAddress && ( | ||
<ActionDetails.Row label='Return Address'> | ||
{bech32Address(value.returnAddress)} | ||
</ActionDetails.Row> | ||
)} | ||
|
||
{value.timeoutHeight && ( | ||
<> | ||
<ActionDetails.Row label='Timeout Revision Height'> | ||
{value.timeoutHeight.revisionHeight.toString()} | ||
</ActionDetails.Row> | ||
<ActionDetails.Row label='Timeout Revision Number'> | ||
{value.timeoutHeight.revisionNumber.toString()} | ||
</ActionDetails.Row> | ||
</> | ||
)} | ||
|
||
<ActionDetails.Row label='Timeout Time'> | ||
{new Date(Number(value.timeoutTime)).toString()} | ||
</ActionDetails.Row> | ||
</ActionDetails> | ||
} | ||
/> | ||
); | ||
}; |