Skip to content

Commit 39ac052

Browse files
authoredOct 13, 2024
Merge pull request #321 from kodadot/fix/incorrect-attributes
🐛 inccorrectly handling attributest
2 parents 1fadd0f + 3596512 commit 39ac052

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎src/mappings/utils/types.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { Attribute } from '../../model/generated/_attribute'
1818
import { Interaction } from '../../model'
1919
import { SetMetadata } from '../nfts/types'
2020
import { COLLECTION_OFFER } from '../../environment'
21+
import { type Attribute as HyperAttribute, attributeFrom as hyperAttributeFrom } from '@kodadot1/hyperdata'
2122

2223
export type BaseCall = {
2324
caller: string
@@ -99,12 +100,12 @@ export function eventFrom<T>(
99100
}
100101
}
101102

102-
export function attributeFrom(attribute: MetadataAttribute): Attribute {
103+
export function attributeFrom(attribute: HyperAttribute): Attribute {
103104
return new Attribute(
104105
{},
105106
{
106-
display: attribute.display_type ? String(attribute.display_type) : null,
107-
trait: String(attribute.trait_type),
107+
display: attribute.display ? String(attribute.display) : null,
108+
trait: attribute.trait ? String(attribute.trait) : null,
108109
value: String(attribute.value),
109110
}
110111
)

0 commit comments

Comments
 (0)