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: add new objkt.com contracts #374

Merged
merged 1 commit into from
Jan 24, 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
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VITE_TEIA_REPORT='https://lists.teia.art'

VITE_LOGOS='https://lists.teia.art/teia-logos/dist'

VITE_TEIA_GRAPHQL_API='https://teztok.teia.rocks/v1/graphql'
VITE_TEIA_GRAPHQL_API='https://teztok2.teia.rocks/v1/graphql'
# VITE_TEIA_GRAPHQL_API='https://teia-api.teztok.com/v1/graphql'
VITE_TEZOSDOMAINS_GRAPHQL_API='https://api.tezos.domains/graphql'
VITE_TZKT_API='https://api.tzkt.io'
Expand Down
7 changes: 5 additions & 2 deletions src/context/userStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
ContractMethodObject,
Wallet,
WalletParamsWithKind,
MichelsonMap,
} from '@taquito/taquito'
import { create } from 'zustand'
import {
Expand Down Expand Up @@ -148,7 +149,7 @@ export const useUserStore = create<UserState>()(
const timeout = setTimeout(() => {
show(
title,
'Something seem to hang, did you abort the transaction?'
'Something seems to hang, did you abort the transaction?'
)
}, 15000)

Expand Down Expand Up @@ -410,14 +411,16 @@ export const useUserStore = create<UserState>()(
const showError = useModalStore.getState().showError

let batch = undefined

try {
if (['HEN_SWAP_V2', 'TEIA_SWAP'].includes(listing.type)) {
const contract = await Tezos.wallet.at(listing.contract_address)
batch = contract.methods.collect(parseInt(listing.swap_id))
} else if (['OBJKT_ASK', 'OBJKT_ASK_V2'].includes(listing.type)) {
const contract = await Tezos.wallet.at(listing.contract_address)
batch = contract.methods.fulfill_ask(listing.ask_id)
} else if (['OBJKT_ASK_V3', 'OBJKT_ASK_V3_PRE'].includes(listing.type)) {
const contract = await Tezos.wallet.at(listing.contract_address)
batch = contract.methods.fulfill_ask(listing.ask_id, 1, null, null, MichelsonMap.fromLiteral({}))
} else if (['VERSUM_SWAP'].includes(listing.type)) {
const contract = await Tezos.wallet.at(listing.contract_address)
batch = contract.methods.collect_swap('1', listing.swap_id)
Expand Down
2 changes: 1 addition & 1 deletion src/data/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ query objkt($id: String!) {
tags {
tag
}
events(where: { _or: [{ implements: {_eq: "SALE"} }, { type: {_in: ["HEN_MINT", "TEIA_SWAP", "HEN_SWAP", "HEN_SWAP_V2", "VERSUM_SWAP", "FA2_TRANSFER", "OBJKT_ASK", "OBJKT_ASK_V2"]} }]}, order_by: [{level: desc}, {opid: desc}]) {
events(where: { _or: [{ implements: {_eq: "SALE"} }, { type: {_in: ["HEN_MINT", "TEIA_SWAP", "HEN_SWAP", "HEN_SWAP_V2", "VERSUM_SWAP", "FA2_TRANSFER", "OBJKT_ASK", "OBJKT_ASK_V2", "OBJKT_ASK_V3", "OBJKT_ASK_V3_PRE"]} }]}, order_by: [{level: desc}, {opid: desc}]) {
timestamp
implements
ophash
Expand Down
2 changes: 2 additions & 0 deletions src/pages/objkt-display/tabs/History.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ export const History = () => {
[
'OBJKT_ASK',
'OBJKT_ASK_V2',
'OBJKT_ASK_V3',
'OBJKT_ASK_V3_PRE',
'TEIA_SWAP',
'HEN_SWAP',
'HEN_SWAP_V2',
Expand Down
2 changes: 2 additions & 0 deletions src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ export type ListingType =
| 'HEN_SWAP_V2'
| 'OBJKT_ASK'
| 'OBJKT_ASK_V2'
| 'OBJKT_ASK_V3'
| 'OBJKT_ASK_V3_PRE'
| 'VERSUM_SWAP'
export type MetadataAccessibility = {
/** resource that is physiologically dangerous to some users.*/
Expand Down
Loading