Skip to content

Commit

Permalink
Merge pull request #331 from kodadot/main
Browse files Browse the repository at this point in the history
🔖  Stick v13
  • Loading branch information
vikiival authored Dec 12, 2024
2 parents cb1a0a1 + 072d6fb commit 150670e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/subsquid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
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: 14
version: 15
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: 12
version: 13
description: 'SubSquid indexer for Uniques and Assets on Statemine'
build:
deploy:
Expand Down
8 changes: 4 additions & 4 deletions src/mappings/nfts/createSwap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function handleCreateSwap(context: Context): Promise<void> {
// 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
Expand All @@ -44,9 +44,9 @@ export async function handleCreateSwap(context: Context): Promise<void> {
final.considered = considered
final.desired = desired
final.expiration = deadline
final.price = event.price
if ('surcharge' in final) {
final.surcharge = event.surcharge
final.price = event.price || null
if (!offer) {
(final as Swap).surcharge = event.surcharge || null
}
final.status = final.blockNumber >= deadline ? TradeStatus.EXPIRED : TradeStatus.ACTIVE
final.updatedAt = event.timestamp
Expand Down
7 changes: 4 additions & 3 deletions src/mappings/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -99,12 +100,12 @@ export function eventFrom<T>(
}
}

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),
}
)
Expand Down

0 comments on commit 150670e

Please sign in to comment.