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

[TAS-1257] 🔥 Remove iscn tx hash query #449

Merged
merged 1 commit into from
Feb 26, 2024
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
18 changes: 1 addition & 17 deletions components/IscnUploadedInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,17 +91,6 @@
>
{{ owner }}
</FormField>
<FormField :label="$t('iscn.meta.transaction')" class="mb-[12px]">
<Link
v-if="iscnHash"
:class="['text-[14px]', 'break-all']"
nofollow="true"
:href="transactionsURL"
>
{{ iscnHash }}
</Link>
<ProgressIndicator v-else class="my-[4px]" preset="thin" />
</FormField>
<IconDiverMini :class="['mb-[12px]', 'text-shade-gray']" />
<FormField v-if="iscnId" :label="$t('iscn.meta.id.copy')" class="mb-[12px]">
<Button
Expand Down Expand Up @@ -160,7 +149,7 @@ import { Vue, Component, Prop } from 'vue-property-decorator'

import { ISCNRecordWithID } from '~/utils/cosmos/iscn/iscn.type'
import { downloadJSON } from '~/utils/misc'
import { BIG_DIPPER_TX_BASE_URL, NFT_BOOK_PRESS_URL } from '~/constant'
import { NFT_BOOK_PRESS_URL } from '~/constant'
import { logTrackerEvent } from '~/utils/logger'
import { copyToClipboard, extractIscnIdPrefix } from '~/utils/ui'

Expand All @@ -170,7 +159,6 @@ import { copyToClipboard, extractIscnIdPrefix } from '~/utils/ui'
export default class IscnUploadedInfo extends Vue {
@Prop(String) readonly owner!: string
@Prop(String) readonly iscnId!: string
@Prop(String) readonly iscnHash!: string
@Prop({ default: null }) readonly record: ISCNRecordWithID | null | undefined
@Prop({ default: null }) readonly exifInfo: any | null | undefined
@Prop(Number) readonly step: number | undefined
Expand All @@ -197,10 +185,6 @@ export default class IscnUploadedInfo extends Vue {
return this.metadata?.description || ''
}

get transactionsURL() {
return `${BIG_DIPPER_TX_BASE_URL}${this.iscnHash}`
}

get keywords(): Array<string> {
return (this.metadata?.keywords && this.metadata?.keywords.split(',')) || []
}
Expand Down
12 changes: 0 additions & 12 deletions constant/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,10 @@ export const RAWDATA_URL = {
production: 'https://mainnet-node.like.co/iscn/records/id?iscn_id=',
}

export const RAWDATA_TX_URLS = {
testnet: ['https://node.testnet.like.co/cosmos/tx/v1beta1/txs?events=message.action=\'/likechain.iscn.MsgCreateIscnRecord\'&events=iscn_record.iscn_id='],
production: [
'https://mainnet-node.like.co/cosmos/tx/v1beta1/txs?events=message.action=\'create_iscn_record\'&events=iscn_record.iscn_id=',
'https://mainnet-node.like.co/cosmos/tx/v1beta1/txs?events=message.action=\'/likechain.iscn.MsgCreateIscnRecord\'&events=iscn_record.iscn_id=',
],
}

export const ISCN_RAW_DATA_ENDPOINT = IS_TESTNET
? RAWDATA_URL.testnet
: RAWDATA_URL.production

export const ISCN_TX_RAW_DATA_ENDPOINTS = IS_TESTNET
? RAWDATA_TX_URLS.testnet
: RAWDATA_TX_URLS.production

export const BIG_DIPPER_TX_BASE_URL = 'https://likecoin.bigdipper.live/transactions/';

export const LIKER_LAND_APP_URI = 'com.oice://';
Expand Down
40 changes: 0 additions & 40 deletions pages/view/_iscnId/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
class="w-full"
:owner="iscnOwner"
:iscn-id="iscnId"
:iscn-hash="txHash"
:record="record"
:exif-info="exifInfo"
>
Expand Down Expand Up @@ -209,23 +208,6 @@
{{ iscnOwner }}
</Link>
</FormField>
<FormField :label="$t('iscn.meta.transaction')" class="mb-[12px]">
<Link
v-if="txHash"
:class="[
'text-[14px]',
'break-all',
]"
nofollow="true"
:href="transactionsURL">
{{ txHash }}
</Link>
<ProgressIndicator
v-else
class="my-[4px]"
preset="thin"
/>
</FormField>
<Divider class="my-[12px]" />
<FormField
v-if="iscnId"
Expand Down Expand Up @@ -490,9 +472,7 @@ import { ellipsis, copyToClipboard, extractIscnIdPrefix } from '~/utils/ui'
import {
NFT_BOOK_PRESS_URL,
ISCN_PREFIX,
BIG_DIPPER_TX_BASE_URL,
ISCN_RAW_DATA_ENDPOINT,
ISCN_TX_RAW_DATA_ENDPOINTS,
WALLET_TYPE_REPLACER,
IPFS_VIEW_GATEWAY_URL,
LIKER_LAND_URL,
Expand Down Expand Up @@ -608,7 +588,6 @@ export enum ExifList {
export default class ViewIscnIdPage extends Vue {
iscnOwner = ''
iscnId = ''
txHash = ''
url = ''
isOpenAuthorDialog = false
isOpenCopiedAlert = false
Expand Down Expand Up @@ -692,10 +671,6 @@ export default class ViewIscnIdPage extends Vue {
return this.recordData?.stakeholders
}

get transactionsURL() {
return `${BIG_DIPPER_TX_BASE_URL}${this.txHash}`
}

get rawDataURL() {
return `${ISCN_RAW_DATA_ENDPOINT}${this.iscnId}`
}
Expand Down Expand Up @@ -775,21 +750,6 @@ export default class ViewIscnIdPage extends Vue {
return
}
this.exifInfo = this.showExifInfo()
this.fetchTxHash().then(txHash => { this.txHash = txHash; });
}

async fetchTxHash() {
const datas = await Promise.all(
ISCN_TX_RAW_DATA_ENDPOINTS.map((url: string) =>
this.$axios.get(`${url}'${this.iscnId}'`),
),
);

const data = datas.find(d => !!(d?.data?.tx_responses?.length));
if (!data) {
return undefined;
}
return data?.data?.tx_responses[0]?.txhash;
}

onClickViewContent() {
Expand Down
Loading