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: Collection Atomic Swaps support #11319

Open
wants to merge 52 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
7d3c2b5
add: `offers` tab in collections & init support for non specific toke…
hassnian Jan 1, 2025
ec8f682
Merge branch 'main' into issue-11116
hassnian Jan 2, 2025
f113a09
ref(useTrades.ts): cleaner `subscribeToTargetsOfTrades` with better t…
hassnian Jan 2, 2025
400b9de
add(trades): search nft in collection input
hassnian Jan 3, 2025
80d782b
ref(transactionMintToken.ts): use `isAssetHub` util
hassnian Jan 4, 2025
c3858b2
Merge branch 'main' into issue-11116
hassnian Jan 4, 2025
39a4dac
Merge branch 'main' into issue-11116
hassnian Jan 6, 2025
8af29cc
fix(TradeOwnerButton.vue): button config not reactive
hassnian Jan 6, 2025
65aea48
add(TokenInCollection.vue): show cart item skeleton while loading
hassnian Jan 6, 2025
d56226c
ref(GalleryItemTradesTable.vue): offers naming to trdes
hassnian Jan 6, 2025
a9d3e42
fix(SearchInput.vue): input styles
hassnian Jan 6, 2025
3f2c618
fix(swaps): send item copy
hassnian Jan 6, 2025
bc14d25
feat: Add TokenInCollection component to TypeSwap.vue.
hassnian Jan 7, 2025
cc10f5f
fix(TokenInCollection.vue): hide search input for owner of token
hassnian Jan 7, 2025
9ed0c19
ref(TradeOverviewModal.vue): force reset of child components on modal…
hassnian Jan 7, 2025
95416e5
Merge branch 'main' into issue-11116
hassnian Jan 7, 2025
e0eadd5
add(TradeOverviewModal.vue): missing send item events and prop
hassnian Jan 7, 2025
e40fc4a
ref(TradeOwnerButton.vue): hide counter swap button for collection swaps
hassnian Jan 7, 2025
b010710
Merge branch 'main' into issue-11116
hassnian Jan 8, 2025
137d9a6
fix(TokenSearchInput.vue): search item results styles
hassnian Jan 8, 2025
8bbafd2
ref(TradeOverviewModal.vue): unify content of modal based on types
hassnian Jan 8, 2025
b592c81
ref(TokenSearchInput.vue): remove `any`
hassnian Jan 8, 2025
a110ddc
ref(TradeFilter.vue): plurar translation
hassnian Jan 8, 2025
9f3fca1
Merge branch 'main' into issue-11116
hassnian Jan 9, 2025
f2b00c6
add(a-swaps): init incoming offer/swaps and ref query
hassnian Jan 9, 2025
2aacefa
fix(WalletAssetTrades.vue): `formatDistanceToNow` trade created at ti…
hassnian Jan 9, 2025
2ba28be
fix(WalletAssetTrades.vue): match design styles
hassnian Jan 9, 2025
a2f358c
add(WalletAsset.vue): show incoming trades for supported chains
hassnian Jan 10, 2025
458658e
ref(useOwnedCollections.ts): use tanstack useQuery
hassnian Jan 10, 2025
ae1b9ad
Merge branch 'main' into issue-11116
hassnian Jan 10, 2025
c7657c9
add(WalletAssetTrades.vue): show offered if type `SWAP`
hassnian Jan 10, 2025
c9319bc
fix(utils/trades.ts): wrong considered json array
hassnian Jan 10, 2025
2d24c6f
fix(useTrades.ts): wrong orderby
hassnian Jan 10, 2025
9ee2f1a
add(WalletAssetTrades.vue): collection atomic swaps case
hassnian Jan 10, 2025
2a3dbfd
fix(useTrades.ts): `createdAt` date
hassnian Jan 10, 2025
832ec3a
add(WalletAssetTrades.vue): view all trades redirect
hassnian Jan 10, 2025
cc9e224
ref(WalletAssetMenu.vue): change tab name`Swap` -> `Create Swap`
hassnian Jan 10, 2025
90942d9
ref(WalletAssetTrades.vue): code cleanup
hassnian Jan 10, 2025
735baf5
ref(collectionEntities): simplify `useOwnedCollections`
hassnian Jan 10, 2025
f84c93b
ref(WalletAssetTrades.vue): reorginze code
hassnian Jan 10, 2025
14ad3b3
ref(WalletAssetTrades.vue): cleaner `getTradeTypeWithMoreIncomingTrades`
hassnian Jan 10, 2025
7c895cd
ref(composables/useTrades.ts): move types to `components/trade/types`
hassnian Jan 10, 2025
cc9844d
fix: add missing trade types
hassnian Jan 10, 2025
6248289
fix(TradeActivityTable.vue): remove import type
hassnian Jan 10, 2025
a0a6bff
fix(trades): add missing type import
hassnian Jan 10, 2025
f68946b
fix: add missing trade type imports
hassnian Jan 11, 2025
1573e03
Merge branch 'main' into issue-11116
hassnian Jan 17, 2025
d2672c0
fix(SearchInput.vue): text color
hassnian Jan 17, 2025
7cd6777
fix(TradeOverviewModal.vue): can't accept token specific trades
hassnian Jan 17, 2025
7c785e7
fix(useTrades.ts): trades table loading forever when empty
hassnian Jan 18, 2025
fc72445
ref(utils/trades.ts): simplify regex and query stringify
hassnian Jan 18, 2025
dd35d5f
Merge branch 'main' into issue-11116
hassnian Jan 21, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@

<script setup lang="ts">
import { type TradeTableQuery } from '@/components/trade/TradeActivityTable.vue'
import type { TradeType } from '@/components/trade/types'

const tradeType = TradeType.SWAP
defineProps<{
tradeType: TradeType
}>()

const route = useRoute()

Expand Down
42 changes: 42 additions & 0 deletions components/common/BaseCartItemDetailsSkeleton.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<template>
<div class="w-full h-[50px]">
<div class="flex justify-between">
<div class="flex">
<div>
<NeoSkeleton
no-margin
height="48px"
width="48px"
:rounded="false"
/>
</div>

<div class="flex flex-col justify-between ml-4 w-[100px] md:w-[170px]">
<NeoSkeleton
no-margin
:rounded="false"
width="130px"
/>

<NeoSkeleton
no-margin
:rounded="false"
width="90px"
/>
</div>
</div>

<div class="flex items-end">
<NeoSkeleton
no-margin
:rounded="false"
width="60px"
/>
</div>
</div>
</div>
</template>

<script setup lang="ts">
import { NeoSkeleton } from '@kodadot1/brick'
</script>
10 changes: 9 additions & 1 deletion components/common/ConnectWallet/WalletAsset.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,30 @@
<MultipleBalances />
</div>

<WalletAssetMenu />
<div class="h-full flex flex-col justify-end gap-5">
<WalletAssetTrades v-if="tradeVisible(urlPrefix) && vm === walletVm" />
<WalletAssetMenu />
</div>
</div>
</template>

<script lang="ts" setup>
import WalletAssetIdentity from './WalletAssetIdentity.vue'
import WalletAssetNfts from './WalletAssetNfts.vue'
import WalletAssetMenu from './WalletAssetMenu.vue'
import WalletAssetTrades from './WalletAssetTrades.vue'
import { useIdentityStore } from '@/stores/identity'
import { tradeVisible } from '@/utils/config/permission.config'

const MultipleBalances = defineAsyncComponent(
() => import('@/components/balance/MultipleBalances.vue'),
)

const identityStore = useIdentityStore()
const { $consola } = useNuxtApp()
const { urlPrefix } = usePrefix()
const { vm } = useChain()
const { getWalletVM: walletVm } = storeToRefs(useWalletStore())

if (identityStore.getAuthAddress) {
$consola.log('fetching balance...')
Expand Down
142 changes: 70 additions & 72 deletions components/common/ConnectWallet/WalletAssetMenu.vue
Original file line number Diff line number Diff line change
@@ -1,79 +1,77 @@
<template>
<div class="h-full flex flex-col justify-end">
<div
:class="{ 'border-t': filteredMenus.length }"
class="wallet-asset-container flex flex-col"
data-testid="sidebar-wallet-container"
>
<div>
<a
v-for="menu in filteredMenus"
:key="menu.label"
v-safe-href="menu.to"
class="wallet-asset-menu"
>
<span>{{ menu.label }}</span>
<NeoIcon
icon="angle-right"
size="medium"
class="text-k-grey"
/>
</a>
</div>
<div class="wallet-asset-footer flex py-5 text-xs text-k-grey">
<!-- light/dark mode -->
<ColorModeSwitch />
<div
:class="{ 'border-t': filteredMenus.length }"
class="wallet-asset-container flex flex-col"
data-testid="sidebar-wallet-container"
>
<div>
<a
v-for="menu in filteredMenus"
:key="menu.label"
v-safe-href="menu.to"
class="wallet-asset-menu"
>
<span>{{ menu.label }}</span>
<NeoIcon
icon="angle-right"
size="medium"
class="text-k-grey"
/>
</a>
</div>
<div class="wallet-asset-footer flex py-5 text-xs text-k-grey">
<!-- light/dark mode -->
<ColorModeSwitch />

<!-- language -->
<div
data-testid="sidebar-language"
class="language-selector"
<!-- language -->
<div
data-testid="sidebar-language"
class="language-selector"
>
<NeoDropdown
position="top-left"
aria-role="menu"
mobile-modal
>
<NeoDropdown
position="top-left"
aria-role="menu"
mobile-modal
>
<template #trigger>
<div class="flex items-center">
<NeoIcon
icon="globe"
size="medium"
/>
<span class="is-hidden-mobile ml-1">
{{ $t('profileMenu.language') }}
</span>
</div>
</template>
<template #trigger>
<div class="flex items-center">
<NeoIcon
icon="globe"
size="medium"
/>
<span class="is-hidden-mobile ml-1">
{{ $t('profileMenu.language') }}
</span>
</div>
</template>

<NeoDropdownItem
v-for="lang in langsFlags"
:key="lang.value"
aria-role="listitem"
:data-testid="`sidebar-language-${lang.value}`"
:value="lang.value"
:class="{ 'is-active': $i18n.locale === lang.value }"
@click="setUserLocale(lang.value)"
>
<span>{{ lang.flag }} {{ lang.label }}</span>
</NeoDropdownItem>
</NeoDropdown>
</div>

<!-- settings -->
<nuxt-link
to="/settings"
class="text-k-grey items-center"
data-testid="sidebar-link-settings"
@click="closeModal"
>
<NeoIcon
icon="gear"
size="medium"
/>
<span class="is-hidden-mobile">{{ $t('settings') }}</span>
</nuxt-link>
<NeoDropdownItem
v-for="lang in langsFlags"
:key="lang.value"
aria-role="listitem"
:data-testid="`sidebar-language-${lang.value}`"
:value="lang.value"
:class="{ 'is-active': $i18n.locale === lang.value }"
@click="setUserLocale(lang.value)"
>
<span>{{ lang.flag }} {{ lang.label }}</span>
</NeoDropdownItem>
</NeoDropdown>
</div>

<!-- settings -->
<nuxt-link
to="/settings"
class="text-k-grey items-center"
data-testid="sidebar-link-settings"
@click="closeModal"
>
<NeoIcon
icon="gear"
size="medium"
/>
<span class="is-hidden-mobile">{{ $t('settings') }}</span>
</nuxt-link>
</div>
</div>
</template>
Expand All @@ -100,7 +98,7 @@ const menus = ref<{ label: string, to: string, check: (v: Prefix) => boolean }[]
check: teleportVisible,
},
{
label: $i18n.t('swap.swap'),
label: $i18n.t('swap.createSwap'),
to: `/${urlPrefix.value}/swap`,
check: swapVisible,
},
Expand Down
Loading
Loading