Skip to content

Commit

Permalink
feat: show callout if ordinal holds a rare sat (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulhaseeb4239 committed Nov 27, 2023
1 parent 5499535 commit fdbc08a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/app/components/confirmBtcTransactionComponent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ interface Props {
currencyType?: CurrencyTypes;
isPartOfBundle?: boolean;
ordinalBundle?: BundleV2;
holdsRareSats?: boolean;
currentFeeRate: BigNumber;
setCurrentFee: (feeRate: BigNumber) => void;
setCurrentFeeRate: (feeRate: BigNumber) => void;
Expand All @@ -161,6 +162,7 @@ function ConfirmBtcTransactionComponent({
isPartOfBundle,
currencyType,
ordinalBundle,
holdsRareSats,
currentFeeRate,
setCurrentFee,
setCurrentFeeRate,
Expand Down Expand Up @@ -406,6 +408,11 @@ function ConfirmBtcTransactionComponent({
/>
</CalloutContainer>
)}
{holdsRareSats && (
<CalloutContainer>
<Callout bodyText={t('NFT_DASHBOARD_SCREEN.HOLDS_RARE_SAT')} variant="warning" />
</CalloutContainer>
)}

{bundle && <SatsBundle bundle={bundle} />}

Expand Down
9 changes: 8 additions & 1 deletion src/app/screens/confirmOrdinalTransaction/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,18 @@ function ConfirmOrdinalTransaction() {
}
}, [txError]);

const { bundle: ordinalBundle, isPartOfABundle } = useGetUtxoOrdinalBundleV2(
const {
bundle: ordinalBundle,
isPartOfABundle,
ordinalSatributes,
} = useGetUtxoOrdinalBundleV2(
selectedOrdinal?.output,
hasActivatedRareSatsKey,
selectedOrdinal?.number,
);

const holdsRareSats = ordinalSatributes?.length > 0;

const handleOnConfirmClick = (txHex: string) => {
if (isLedgerAccount(selectedAccount)) {
const txType: LedgerTransactionType = 'ORDINALS';
Expand Down Expand Up @@ -190,6 +196,7 @@ function ConfirmOrdinalTransaction() {
currencyType={isRareSat ? 'RareSat' : 'Ordinal'}
isPartOfBundle={isPartOfABundle}
ordinalBundle={ordinalBundle}
holdsRareSats={!!holdsRareSats}
>
{selectedOrdinal && (
<Container>
Expand Down
3 changes: 2 additions & 1 deletion src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,8 @@
"RARE_SATS_NOTICE_TITLE": "Don't see your rare sat?",
"RARE_SATS_NOTICE_DETAIL": "Currently, Xverse only supports the Rodarmor rarity index. Your sats may have other attributes.",
"SEE_SUPPORTED": "See supported rarity scale",
"FROM_RARE_SAT_BUNDLE": "This inscription belongs to the same bundle as other assets. Transferring it will involve transferring the full bundle."
"FROM_RARE_SAT_BUNDLE": "This inscription belongs to the same bundle as other assets. Transferring it will involve transferring the full bundle.",
"HOLDS_RARE_SAT": "This inscription holds a rare sat."
},
"RESTORE_FUND_SCREEN": {
"TITLE": "Restore assets",
Expand Down

0 comments on commit fdbc08a

Please sign in to comment.