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

Conversation

hassnian
Copy link
Contributor

@hassnian hassnian commented Jan 1, 2025

PR Type

  • Bugfix
  • Feature
  • Refactoring

Context

Screenshot 📸

  • My fix has changed something on UI;

Accept Collection Atomic Swap

CleanShot 2025-01-07 at 14 44 50

Offer tab in Collection

CleanShot 2025-01-08 at 11 23 20@2x

Incoming Trades & Create swap tab

Copy link

netlify bot commented Jan 1, 2025

Deploy Preview for koda-canary ready!

Name Link
🔨 Latest commit dd35d5f
🔍 Latest deploy log https://app.netlify.com/sites/koda-canary/deploys/678f881559259a0008df9158
😎 Deploy Preview https://deploy-preview-11319--koda-canary.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 1, 2025

Deploy Preview for polkadot ready!

Name Link
🔨 Latest commit ec8f682
🔍 Latest deploy log https://app.netlify.com/sites/polkadot/deploys/677600011ca1b00008749aaa
😎 Deploy Preview https://deploy-preview-11319--polkadot.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 15
Accessibility: 83
Best Practices: 83
SEO: 81
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@hassnian hassnian changed the title feat: Collection offer feat: Collection Atomic Swaps Jan 7, 2025
@hassnian hassnian changed the title feat: Collection Atomic Swaps feat: Accept Collection Atomic Swaps Jan 7, 2025
@hassnian hassnian marked this pull request as ready for review January 8, 2025 08:44
@hassnian hassnian marked this pull request as ready for review January 10, 2025 11:27
@hassnian
Copy link
Contributor Author

hassnian commented Jan 10, 2025

PR is ready, I'll do another round of testing tomorrow

cc @exezbcz for visual check, let me know if i need to change the copy or something

@hassnian hassnian marked this pull request as draft January 10, 2025 11:34
@hassnian hassnian marked this pull request as ready for review January 10, 2025 11:40
@Jarsen136
Copy link
Contributor

https://deploy-preview-11319--koda-canary.netlify.app/ahk/collection/379/swaps

The offers and swaps are not shown on the collection page.
image

here is the error on console
image

@hassnian
Copy link
Contributor Author

hassnian commented Jan 14, 2025

https://deploy-preview-11319--koda-canary.netlify.app/ahk/collection/379/swaps

The offers and swaps are not shown on the collection page. image

here is the error on console image

the issue is that some offers/swaps have wrong data due to a bug in the indexers, which has been already fixed but not deployed cc @vikiival

alternatively you can run this branch locally andreplace the indexer urls with

STICK (AHK)

https://kodadot.squids.live/stick@v13/api/graphql

SPECK (AHP)

https://kodadot.squids.live/speck@v15/api/graphql

inside utils/constants.ts

CleanShot 2025-01-14 at 08 08 04@2x

@vikiival
Copy link
Member

vikiival commented Jan 14, 2025

Can promote the squids

@hassnian done

Screenshot 2025-01-14 at 18 32 47

@hassnian
Copy link
Contributor Author

hassnian commented Jan 15, 2025

@Jarsen136 the indexer bug is deployed , could you try again

@Jarsen136
Copy link
Contributor

It's still the same on the offers tab.

https://deploy-preview-11319--koda-canary.netlify.app/ahk/collection/379/swaps
image

There is another issue that may not related to this PR. I can click the "accept" button on the expired offer.

Kapt

@hassnian
Copy link
Contributor Author

hassnian commented Jan 18, 2025

It's still the same on the offers tab.

https://deploy-preview-11319--koda-canary.netlify.app/ahk/collection/379/swaps image

fixed

There is another issue that may not related to this PR. I can click the "accept" button on the expired offer.

Kapt

I'm using the status to either show or not show the button

for these swaps status is ACTIVE

so it's an indexer issue

cc @vikiival

data

{
  "data": {
    "swaps": [
      {
        "__typename": "Swap",
        "blockNumber": "8544830",
        "caller": "EokuN2xVQ2doATZGrwZdrumivCXD8XazC8Np5MBYqS3ucMp",
        "considered": {
          "__typename": "CollectionEntity",
          "currentOwner": "DYc9cY7q7UA3Rq97HtiobrLNbMbZgepATJtn3fzPE2jf5v6",
          "id": "493",
          "image": "ipfs://ipfs/QmZckAQZuYy5q6grmMQRmwgQJRzyLArMhRpCxHL66NBPsU",
          "name": "uwu"
        },
        "desired": null,
        "expiration": "8595230",
        "id": "379-4228294995",
        "nft": {
          "__typename": "NFTEntity",
          "collection": {
            "__typename": "CollectionEntity",
            "id": "379"
          },
          "currentOwner": "EokuN2xVQ2doATZGrwZdrumivCXD8XazC8Np5MBYqS3ucMp",
          "id": "379-4228294995",
          "image": "https://dyndata.koda.art/v1/image/ahk/379/4228294995",
          "meta": {
            "__typename": "MetadataEntity",
            "animationUrl": "ipfs://bafybeicdv7iu5racra3vsvg2k2uvp2jxvb534h67f6lqdwidhmvzg2tjou?hash=0x70f4a78a48f42acbe9d9cf154241836129f76f9f27af3a0407fc31364d9175fb",
            "description": "Artist: [LikeMurvin](https://twitter.com/LikeMurvin) \n\n\n 'Meadow' transports viewers to serene landscapes, where lush fields sway under the embrace of a gentle breeze. Each painting exudes tranquility, inviting one to wander through sun-kissed meadows adorned with vibrant wildflowers. The collection captures the timeless beauty of nature, offering a moment of escape into a world of peace and harmony.",
            "id": "https://dyndata.koda.art/v1/metadata/ahk/379/4228294995",
            "image": "https://dyndata.koda.art/v1/image/ahk/379/4228294995",
            "name": "MEADOW #496"
          },
          "name": "MEADOW #496",
          "sn": "4228294995"
        },
        "price": null,
        "status": "ACTIVE",
        "surcharge": null
      },
      {
        "__typename": "Swap",
        "blockNumber": "8505205",
        "caller": "DBih8bHEUhRbA5z8wYAa9CADKco5GFSfUadvwB67J4n5emW",
        "considered": {
          "__typename": "CollectionEntity",
          "currentOwner": "Gn84LKb5HSxc3SACayxCzKQcWESRMcT1VUCqeZURfGj6ASi",
          "id": "379",
          "image": "ipfs://bafkreic7ii2fvo3fhe557pyozhzitkfnhgmxovaebnf3shqmjiva42erb4",
          "name": "MEADOW"
        },
        "desired": {
          "__typename": "NFTEntity",
          "collection": {
            "__typename": "CollectionEntity",
            "id": "379"
          },
          "currentOwner": "DYc9cY7q7UA3Rq97HtiobrLNbMbZgepATJtn3fzPE2jf5v6",
          "id": "379-4008717980",
          "image": "https://dyndata.koda.art/v1/image/ahk/379/4008717980",
          "meta": {
            "__typename": "MetadataEntity",
            "animationUrl": "ipfs://bafybeicdv7iu5racra3vsvg2k2uvp2jxvb534h67f6lqdwidhmvzg2tjou?hash=0x9fb51ef4a431ed45998990aba028bf896911778e9bd621635e58b1cc415f7dbc",
            "description": "Artist: [LikeMurvin](https://twitter.com/LikeMurvin) \n\n\n 'Meadow' transports viewers to serene landscapes, where lush fields sway under the embrace of a gentle breeze. Each painting exudes tranquility, inviting one to wander through sun-kissed meadows adorned with vibrant wildflowers. The collection captures the timeless beauty of nature, offering a moment of escape into a world of peace and harmony.",
            "id": "https://dyndata.koda.art/v1/metadata/ahk/379/4008717980",
            "image": "https://dyndata.koda.art/v1/image/ahk/379/4008717980",
            "name": "MEADOW #467"
          },
          "name": "MEADOW #467",
          "sn": "4008717980"
        },
        "expiration": "8555605",
        "id": "379-21",
        "nft": {
          "__typename": "NFTEntity",
          "collection": {
            "__typename": "CollectionEntity",
            "id": "379"
          },
          "currentOwner": "DBih8bHEUhRbA5z8wYAa9CADKco5GFSfUadvwB67J4n5emW",
          "id": "379-21",
          "image": "ipfs://ipfs/bafkreibv6v57w6lunn2tmxxijsxgdwvc5ftz7ly7ekuxuqjxhpofr2at7u",
          "meta": {
            "__typename": "MetadataEntity",
            "animationUrl": "ipfs://bafybeicdv7iu5racra3vsvg2k2uvp2jxvb534h67f6lqdwidhmvzg2tjou/?hash=0x0cbd68d21271b14f33395a717c0cb7c3111a77fbc2ac809b2421e7e9e5d3e77e",
            "description": "Artist: [LikeMurvin](https://twitter.com/LikeMurvin) \n\n\n 'Meadow' transports viewers to serene landscapes, where lush fields sway under the embrace of a gentle breeze. Each painting exudes tranquility, inviting one to wander through sun-kissed meadows adorned with vibrant wildflowers. The collection captures the timeless beauty of nature, offering a moment of escape into a world of peace and harmony.",
            "id": "ipfs://ipfs/bafkreigr3ae35mxbo44uamrp5g2hjiw7kv55rcigisl42c6rotg7ukxzce",
            "image": "ipfs://ipfs/bafkreibv6v57w6lunn2tmxxijsxgdwvc5ftz7ly7ekuxuqjxhpofr2at7u",
            "name": "MEADOW"
          },
          "name": "MEADOW",
          "sn": "21"
        },
        "price": null,
        "status": "ACTIVE",
        "surcharge": null
      },
      {
        "__typename": "Swap",
        "blockNumber": "8505205",
        "caller": "DBih8bHEUhRbA5z8wYAa9CADKco5GFSfUadvwB67J4n5emW",
        "considered": {
          "__typename": "CollectionEntity",
          "currentOwner": "Gn84LKb5HSxc3SACayxCzKQcWESRMcT1VUCqeZURfGj6ASi",
          "id": "379",
          "image": "ipfs://bafkreic7ii2fvo3fhe557pyozhzitkfnhgmxovaebnf3shqmjiva42erb4",
          "name": "MEADOW"
        },
        "desired": {
          "__typename": "NFTEntity",
          "collection": {
            "__typename": "CollectionEntity",
            "id": "379"
          },
          "currentOwner": "DYc9cY7q7UA3Rq97HtiobrLNbMbZgepATJtn3fzPE2jf5v6",
          "id": "379-2405207167",
          "image": "https://fxart-beta.kodadot.workers.dev/metadata/v2/image?chain=ahk&collection=379&hash=0x3338cfbee1cd823000871bf0c298d9baa16f7ee5a3e23acc598a135965cc7f9b",
          "meta": {
            "__typename": "MetadataEntity",
            "animationUrl": "ipfs://bafybeicdv7iu5racra3vsvg2k2uvp2jxvb534h67f6lqdwidhmvzg2tjou/?hash=0x3338cfbee1cd823000871bf0c298d9baa16f7ee5a3e23acc598a135965cc7f9b",
            "description": "Artist: [LikeMurvin](https://twitter.com/LikeMurvin) \n\n\n 'Meadow' transports viewers to serene landscapes, where lush fields sway under the embrace of a gentle breeze. Each painting exudes tranquility, inviting one to wander through sun-kissed meadows adorned with vibrant wildflowers. The collection captures the timeless beauty of nature, offering a moment of escape into a world of peace and harmony.",
            "id": "https://fxart-beta.kodadot.workers.dev/metadata/v2/json?chain=ahk&collection=379&hash=0x3338cfbee1cd823000871bf0c298d9baa16f7ee5a3e23acc598a135965cc7f9b&sn=349",
            "image": "https://fxart-beta.kodadot.workers.dev/metadata/v2/image?chain=ahk&collection=379&hash=0x3338cfbee1cd823000871bf0c298d9baa16f7ee5a3e23acc598a135965cc7f9b",
            "name": "MEADOW #349"
          },
          "name": "MEADOW #349",
          "sn": "2405207167"
        },
        "expiration": "8555605",
        "id": "379-6",
        "nft": {
          "__typename": "NFTEntity",
          "collection": {
            "__typename": "CollectionEntity",
            "id": "379"
          },
          "currentOwner": "DBih8bHEUhRbA5z8wYAa9CADKco5GFSfUadvwB67J4n5emW",
          "id": "379-6",
          "image": "ipfs://ipfs/bafkreid6ilqfc3bky6mcuru52ykpa7ykokn7crztifh6232lbd2elkjifa",
          "meta": {
            "__typename": "MetadataEntity",
            "animationUrl": "ipfs://bafybeicdv7iu5racra3vsvg2k2uvp2jxvb534h67f6lqdwidhmvzg2tjou/?hash=0x6198179e7f30dc268ab00411f993d654cdf5785e9b82f809807cec6326e533a6",
            "description": "Artist: [LikeMurvin](https://twitter.com/LikeMurvin) \n\n\n 'Meadow' transports viewers to serene landscapes, where lush fields sway under the embrace of a gentle breeze. Each painting exudes tranquility, inviting one to wander through sun-kissed meadows adorned with vibrant wildflowers. The collection captures the timeless beauty of nature, offering a moment of escape into a world of peace and harmony.",
            "id": "ipfs://ipfs/bafkreihpccu7bcjt5u7s3qny467majnqfaj6hfozwoxufgfqhdia2ym66i",
            "image": "ipfs://ipfs/bafkreid6ilqfc3bky6mcuru52ykpa7ykokn7crztifh6232lbd2elkjifa",
            "name": "MEADOW"
          },
          "name": "MEADOW",
          "sn": "6"
        },
        "price": null,
        "status": "ACTIVE",
        "surcharge": null
      },
      {
        "__typename": "Swap",
        "blockNumber": "8371368",
        "caller": "G5HzxgmKtBzFX9E7Ym9to3gH2cr722v1Wamj1w8GjzWJJ4e",
        "considered": {
          "__typename": "CollectionEntity",
          "currentOwner": "Gn84LKb5HSxc3SACayxCzKQcWESRMcT1VUCqeZURfGj6ASi",
          "id": "352",
          "image": "ipfs://bafkreidkkkekoom6crzf2rjuycjwawvmnzdct336bic5i6pxs6oy3ondge",
          "name": "Complexity"
        },
        "desired": {
          "__typename": "NFTEntity",
          "collection": {
            "__typename": "CollectionEntity",
            "id": "352"
          },
          "currentOwner": "J23zaM8DDUewdGtrS8Vo7VSiTYrwaKpKdQ5qTTp5BDQNaMs",
          "id": "352-2405350561",
          "image": "https://fxart-beta.kodadot.workers.dev/metadata/v2/image?chain=ahk&collection=352&hash=0x8c18210df0d9514f2d2e5d8ca7c100978219ee80d3968ad850ab5ead208287b3",
          "meta": {
            "__typename": "MetadataEntity",
            "animationUrl": "ipfs://bafybeic4xh3jbctxh5eaommwlsoli6gx2vut2k2kymfromx2unsqm7qdoa/?hash=0x8c18210df0d9514f2d2e5d8ca7c100978219ee80d3968ad850ab5ead208287b3",
            "description": "Artist: [@NoMonetaryValue](https://kodadot.xyz) \n\n\n The most complex hints for life can be hidden in the simplest abstractions.",
            "id": "https://fxart-beta.kodadot.workers.dev/metadata/v2/json?chain=ahk&collection=352&sn=100",
            "image": "https://fxart-beta.kodadot.workers.dev/metadata/v2/image?chain=ahk&collection=352&hash=0x8c18210df0d9514f2d2e5d8ca7c100978219ee80d3968ad850ab5ead208287b3",
            "name": "Complexity #100"
          },
          "name": "Complexity #100",
          "sn": "2405350561"
        },
        "expiration": "8421768",
        "id": "379-102",
        "nft": {
          "__typename": "NFTEntity",
          "collection": {
            "__typename": "CollectionEntity",
            "id": "379"
          },
          "currentOwner": "G5HzxgmKtBzFX9E7Ym9to3gH2cr722v1Wamj1w8GjzWJJ4e",
          "id": "379-102",
          "image": "ipfs://ipfs/bafybeicsgfk5eihpbipashqbfxmh3hsjpntmds2hwznmeguq6wx3ssbzvq",
          "meta": {
            "__typename": "MetadataEntity",
            "animationUrl": "ipfs://bafybeicdv7iu5racra3vsvg2k2uvp2jxvb534h67f6lqdwidhmvzg2tjou/?hash=0xc53df2971e9ac6f1d30bb52e477e3aeb6a5d91d782a1f3fa5c8993fb995a8e38",
            "description": "Artist: [LikeMurvin](https://twitter.com/LikeMurvin) \n\n\n 'Meadow' transports viewers to serene landscapes, where lush fields sway under the embrace of a gentle breeze. Each painting exudes tranquility, inviting one to wander through sun-kissed meadows adorned with vibrant wildflowers. The collection captures the timeless beauty of nature, offering a moment of escape into a world of peace and harmony.",
            "id": "ipfs://ipfs/bafkreiepjfwug4pnxzgdzb6glhq2o2itzxsps5hcg7lluubawpbvyiaahq",
            "image": "ipfs://ipfs/bafybeicsgfk5eihpbipashqbfxmh3hsjpntmds2hwznmeguq6wx3ssbzvq",
            "name": "MEADOW"
          },
          "name": "MEADOW",
          "sn": "102"
        },
        "price": null,
        "status": "ACTIVE",
        "surcharge": null
      }
    ]
  }
}

@vikiival
Copy link
Member

I'm using the status to either show or not show the button for these swaps status is ACTIVE so it's an indexer issue cc @vikiival

Can you please open an issue at kodadot/stick ?
or if you know where the bug could be PR is welcomed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incoming swaps and offers in profile sidebar
4 participants