From 359651210a0f10d22175147695c35202b0cf0848 Mon Sep 17 00:00:00 2001 From: Viki Val Date: Mon, 14 Oct 2024 00:06:14 +0200 Subject: [PATCH 1/5] :bug: inccorrectly handling attributest --- src/mappings/utils/types.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mappings/utils/types.ts b/src/mappings/utils/types.ts index de3a6e79..7c82500a 100644 --- a/src/mappings/utils/types.ts +++ b/src/mappings/utils/types.ts @@ -18,6 +18,7 @@ import { Attribute } from '../../model/generated/_attribute' import { Interaction } from '../../model' import { SetMetadata } from '../nfts/types' import { COLLECTION_OFFER } from '../../environment' +import { type Attribute as HyperAttribute, attributeFrom as hyperAttributeFrom } from '@kodadot1/hyperdata' export type BaseCall = { caller: string @@ -99,12 +100,12 @@ export function eventFrom( } } -export function attributeFrom(attribute: MetadataAttribute): Attribute { +export function attributeFrom(attribute: HyperAttribute): Attribute { return new Attribute( {}, { - display: attribute.display_type ? String(attribute.display_type) : null, - trait: String(attribute.trait_type), + display: attribute.display ? String(attribute.display) : null, + trait: attribute.trait ? String(attribute.trait) : null, value: String(attribute.value), } ) From a51c6270db74c4dd48da111c7b1aa9e2545131fb Mon Sep 17 00:00:00 2001 From: hassnian <44554284+hassnian@users.noreply.github.com> Date: Fri, 29 Nov 2024 08:43:02 +0500 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=90=9B=20swaps=20without=20`surcharge?= =?UTF-8?q?`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mappings/nfts/createSwap.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mappings/nfts/createSwap.ts b/src/mappings/nfts/createSwap.ts index 991bbda1..126bfd01 100644 --- a/src/mappings/nfts/createSwap.ts +++ b/src/mappings/nfts/createSwap.ts @@ -45,8 +45,8 @@ export async function handleCreateSwap(context: Context): Promise { final.desired = desired final.expiration = deadline final.price = event.price - if ('surcharge' in final) { - final.surcharge = event.surcharge + if (!offer) { + (final as Swap).surcharge = event.surcharge } final.status = final.blockNumber >= deadline ? TradeStatus.EXPIRED : TradeStatus.ACTIVE final.updatedAt = event.timestamp From 6eb4aa88d6be6f065b5cdd41629bf0043bfa7592 Mon Sep 17 00:00:00 2001 From: Viki Val Date: Tue, 10 Dec 2024 14:09:27 +0200 Subject: [PATCH 3/5] :bookmark: Speck v15 --- speck.yaml | 2 +- squid.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/speck.yaml b/speck.yaml index 2f7133ac..733e7ff7 100644 --- a/speck.yaml +++ b/speck.yaml @@ -1,6 +1,6 @@ manifestVersion: subsquid.io/v0.1 name: speck -version: 14 +version: 15 description: 'SubSquid indexer for Uniques and Assets on Statemint' build: deploy: diff --git a/squid.yaml b/squid.yaml index 559a7d3e..df588914 100644 --- a/squid.yaml +++ b/squid.yaml @@ -1,6 +1,6 @@ manifestVersion: subsquid.io/v0.1 name: stick -version: 12 +version: 13 description: 'SubSquid indexer for Uniques and Assets on Statemine' build: deploy: From e95153bd22b51840d267c8e5b45c27bbe204926c Mon Sep 17 00:00:00 2001 From: Viki Val Date: Tue, 10 Dec 2024 14:23:57 +0200 Subject: [PATCH 4/5] Update subsquid.yml --- .github/workflows/subsquid.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/subsquid.yml b/.github/workflows/subsquid.yml index c9d7d532..0f345a10 100644 --- a/.github/workflows/subsquid.yml +++ b/.github/workflows/subsquid.yml @@ -23,4 +23,4 @@ jobs: sqd auth -k ${{ secrets.DEPLOYMENT_KEY }} - name: deploy subsquid id: deploy - run: sqd deploy -o kodadot -u -m ${{ env.VERSION }}.yaml . + run: sqd deploy -o kodadot --allow-update --no-interactive --no-stream-logs -m ${{ env.VERSION }}.yaml . From b261d157abc3306b5ddc490bc45739da5edb1ed1 Mon Sep 17 00:00:00 2001 From: hassnian <44554284+hassnian@users.noreply.github.com> Date: Thu, 12 Dec 2024 09:37:24 +0500 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=90=9B=20swaps=20with=20old=20swap=20?= =?UTF-8?q?data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - when overriding a swap some fields like price, surcharge and desired would carry over to the new swap --- src/mappings/nfts/createSwap.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mappings/nfts/createSwap.ts b/src/mappings/nfts/createSwap.ts index 126bfd01..98f0bb59 100644 --- a/src/mappings/nfts/createSwap.ts +++ b/src/mappings/nfts/createSwap.ts @@ -35,7 +35,7 @@ export async function handleCreateSwap(context: Context): Promise { // the nft that is being swapped const nft = await get(context.store, NE, id) const considered = await get(context.store, CE, event.consideration.collectionId) - const desired = isNFT(event.consideration) ? await get(context.store, NE, tokenIdOf(event.consideration as any)) : undefined + const desired = isNFT(event.consideration) ? await get(context.store, NE, tokenIdOf(event.consideration as any)) : null final.blockNumber = BigInt(event.blockNumber) final.createdAt = event.timestamp @@ -44,9 +44,9 @@ export async function handleCreateSwap(context: Context): Promise { final.considered = considered final.desired = desired final.expiration = deadline - final.price = event.price + final.price = event.price || null if (!offer) { - (final as Swap).surcharge = event.surcharge + (final as Swap).surcharge = event.surcharge || null } final.status = final.blockNumber >= deadline ? TradeStatus.EXPIRED : TradeStatus.ACTIVE final.updatedAt = event.timestamp