Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: show hint if AENS name is in revoked state 2 #609

Merged
merged 1 commit into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/components/NameDetailsPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ const nameStatusLabel = computed(() => {
const nameStatusHint = computed(() => {
if (isNameInAuction.value) {
return 'ends'
} else if (isNameRevoked.value) {
return 'revoked'
} else if (isNameExpired.value) {
return 'expired'
} else if (isNameActive.value) {
Expand All @@ -159,6 +161,9 @@ const nameStatusHint = computed(() => {
const isNameExpired = computed(() =>
name.value.status === 'name' && !name.value.active,
)
const isNameRevoked = computed(() =>
isNameExpired.value && name.value.isRevoked === true,
)
const isNameActive = computed(() =>
name.value.active && name.value.activated,
)
Expand Down
3 changes: 2 additions & 1 deletion src/utils/adapters.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
formatTokenLimit,
} from '@/utils/format'

import { MINUTES_PER_BLOCK, SPECIAL_POINTERS_PRESET_KEYS } from '@/utils/constants'
import { MINUTES_PER_BLOCK, REVOKED_PERIOD, SPECIAL_POINTERS_PRESET_KEYS } from '@/utils/constants'

export function adaptKeyblock(keyblock, keyblockDeltaStats = null) {
if (keyblock) {
Expand Down Expand Up @@ -287,6 +287,7 @@ export function adaptName(name, blockHeight, blockTime) {
name.info.expireHeight ?? name.info.auctionEnd,
blockHeight,
),
isRevoked: name.active === false && name.info.expireHeight + REVOKED_PERIOD > blockHeight,
specialPointers: {
account: name.info?.pointers?.accountPubkey,
channel: name.info?.pointers?.channel,
Expand Down
1 change: 1 addition & 0 deletions src/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,4 @@ export const KNOWN_ADDRESSES = [
{ hash: 'ct_azbNZ1XrPjXfqBqbAh1ffLNTQ1sbnuUDFvJrXjYz7JQA1saQ3', name: 'Superhero DEX' },
{ hash: 'ct_2mfj3FoZxnhkSw5RZMcP8BfPoB1QR4QiYGNCdkAvLZ1zfF6paW', name: 'Superhero DEX' },
]
export const REVOKED_PERIOD = 2016
3 changes: 2 additions & 1 deletion src/utils/hints/namesHints.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ export const namesHints = {
highestBid: 'Account of the highest bidder and the highest bid price. Required minimum bid increase is 5%.',
bidCount: 'Amount of bids in the auction.',
ends: 'Keyblock height and estimated date and time when the auction ends.',
expired: 'Keyblock height and estimated date and time when the name has been detached from the account. After expiration, the name entered into a revoked state and can be claimed again after a fixed timeout of 2016 keyblocks.',
expired: 'Keyblock height and estimated date and time when the name has been detached from the account. Name passed revoked period and can be claimed again.',
revoked: 'Keyblock height and estimated date and time when the name has been detached from the account. Name is in revoked state and can be claimed again after a fixed timeout of 2016 keyblocks after expiration.',
lastBuyer: 'Account that previously paid the shown price to claim the name.',
lastOwner: 'Last owner of the name.',
bidder: 'Account of the highest bidder.',
Expand Down