Update type definition for Instance API response
This commit is contained in:
parent
0abb2b4bef
commit
7d4d9d31a4
3 changed files with 13 additions and 8 deletions
|
@ -8,9 +8,9 @@ export interface InstanceInfo {
|
||||||
description: string;
|
description: string;
|
||||||
registrations: boolean;
|
registrations: boolean;
|
||||||
login_message: string;
|
login_message: string;
|
||||||
ethereum_explorer_url: string | null;
|
blockchain_explorer_url: string | null;
|
||||||
nft_contract_name: string | null;
|
blockchain_contract_name: string | null;
|
||||||
nft_contract_address: string | null;
|
blockchain_contract_address: string | null;
|
||||||
ipfs_gateway_url: string | null;
|
ipfs_gateway_url: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -437,7 +437,7 @@ export default class PostComponent extends Vue {
|
||||||
|
|
||||||
canMintToken(): boolean {
|
canMintToken(): boolean {
|
||||||
return (
|
return (
|
||||||
!!this.store.instance?.nft_contract_address &&
|
!!this.store.instance?.blockchain_contract_address &&
|
||||||
this.post.account.id === this.store.currentUser?.id &&
|
this.post.account.id === this.store.currentUser?.id &&
|
||||||
this.post.visibility === "public" &&
|
this.post.visibility === "public" &&
|
||||||
!this.isTokenized &&
|
!this.isTokenized &&
|
||||||
|
@ -447,7 +447,12 @@ export default class PostComponent extends Vue {
|
||||||
|
|
||||||
async mintToken() {
|
async mintToken() {
|
||||||
const { currentUser, instance } = this.store
|
const { currentUser, instance } = this.store
|
||||||
if (!currentUser || !instance || !instance.nft_contract_name || !instance.nft_contract_address) {
|
if (
|
||||||
|
!currentUser ||
|
||||||
|
!instance ||
|
||||||
|
!instance.blockchain_contract_name ||
|
||||||
|
!instance.blockchain_contract_address
|
||||||
|
) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (this.isTokenized || this.isWaitingForToken) {
|
if (this.isTokenized || this.isWaitingForToken) {
|
||||||
|
@ -476,8 +481,8 @@ export default class PostComponent extends Vue {
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const transaction = await mintToken(
|
const transaction = await mintToken(
|
||||||
instance.nft_contract_name,
|
instance.blockchain_contract_name,
|
||||||
instance.nft_contract_address,
|
instance.blockchain_contract_address,
|
||||||
currentUser.wallet_address,
|
currentUser.wallet_address,
|
||||||
tokenUri,
|
tokenUri,
|
||||||
signature,
|
signature,
|
||||||
|
|
|
@ -104,7 +104,7 @@ export default class PostOverlay extends Vue {
|
||||||
}
|
}
|
||||||
|
|
||||||
get transactionUrl(): string | null {
|
get transactionUrl(): string | null {
|
||||||
const explorerUrl = this.store.instance?.ethereum_explorer_url
|
const explorerUrl = this.store.instance?.blockchain_explorer_url
|
||||||
if (!explorerUrl || !this.post?.token_tx_id) {
|
if (!explorerUrl || !this.post?.token_tx_id) {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue