Skip to content

Commit

Permalink
Merge pull request #127 from kodadot/main
Browse files Browse the repository at this point in the history
🔖  Stick v6
  • Loading branch information
vikiival authored Oct 19, 2023
2 parents 17987d4 + 43941d7 commit dc25244
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion speck.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
manifestVersion: subsquid.io/v0.1
name: speck
version: 5
version: 6
description: 'SubSquid indexer for Uniques and Assets on Statemint'
build:
deploy:
Expand Down
2 changes: 1 addition & 1 deletion squid.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
manifestVersion: subsquid.io/v0.1
name: stick
version: 5
version: 6
description: 'SubSquid indexer for Uniques and Assets on Statemine'
build:
deploy:
Expand Down
4 changes: 2 additions & 2 deletions src/mappings/shared/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Optional, TokenMetadata } from '@kodadot1/metasquid/types'
import { logger } from '@kodadot1/metasquid/logger'
import { MetadataEntity as Metadata } from '../../model/generated'
import { fetchMetadata } from '../utils/metadata'
import { Store } from '../utils/types'
import { Store, attributeFrom } from '../utils/types'
import { isEmpty } from '../utils/helper'

export async function handleMetadata(id: string, store: Store): Promise<Optional<Metadata>> {
Expand All @@ -26,7 +26,7 @@ export async function handleMetadata(id: string, store: Store): Promise<Optional
description: metadata.description || '',
image: metadata.image || metadata.thumbnailUri || metadata.mediaUri,
animationUrl: metadata.animation_url || metadata.mediaUri,
attributes: [], // metadata.attributes?.map(attributeFrom) || [],
attributes: metadata.attributes?.map(attributeFrom) || [],
name: metadata.name || '',
type: metadata.type || '',
}
Expand Down
19 changes: 11 additions & 8 deletions src/mappings/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { EventHandlerContext } from '@subsquid/substrate-processor'
import { nanoid } from 'nanoid'
import { EntityManager } from 'typeorm'
// impsort { Interaction } from '../../model/generated/_interaction';
// import { Attribute } from '../../model/generated/_attribute';
import { Attribute } from '../../model/generated/_attribute'

import { Interaction } from '../../model'
import { SetMetadata } from '../nfts/types'
Expand Down Expand Up @@ -45,13 +45,16 @@ export function eventFrom<T>(
}
}

// export function attributeFrom(attribute: MetadataAttribute): Attribute {
// return new Attribute({}, {
// display: String(attribute.display_type),
// trait: String(attribute.trait_type),
// value: String(attribute.value),
// });
// }
export function attributeFrom(attribute: MetadataAttribute): Attribute {
return new Attribute(
{},
{
display: attribute.display_type ? String(attribute.display_type) : null,
trait: String(attribute.trait_type),
value: String(attribute.value),
}
)
}

export type Store = EntityManager
export type Context = EventHandlerContext<Store>
Expand Down

0 comments on commit dc25244

Please sign in to comment.