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

Create offer on AssetHub #10765

Closed
vikiival opened this issue Aug 7, 2024 · 11 comments · Fixed by #10842
Closed

Create offer on AssetHub #10765

vikiival opened this issue Aug 7, 2024 · 11 comments · Fixed by #10842
Assignees
Labels
A-statemine-ahk related for statemine common chain, under new name Asset Hub Kusama A-statemint-ahp Polkadot Asset Hub related issues enhancement New feature or request p2 core functionality, or is affecting 60% of app

Comments

@vikiival
Copy link
Member

vikiival commented Aug 7, 2024

Context

We would like to spin up offers on AssetHub and therefore we would need a create UI for that

Task

  1. Implement modal by figma design
  2. make sure that that you are able to make transaction

Transaction

this is consisted on batch (2 calls):

Mint an OfferToken

  const OFFER_MINT_PRICE = '500000000'
  const offerId = 0 // 174 for ahp // 464 for ahk
  const nextId =  0 // random id // @preschian can help you here 
  const create = api.tx.nfts.mint(
    offerId, // comes from the link above 
    nextId,
    accountId.value,
    {
      mintPrice: OFFER_MINT_PRICE,
    },
  )
  
  const duration = 300 // this tells about one hour (12sec /block --> 300blocks/hr)
  const offer = api.tx.nfts.createSwap(
    offerId, 
    nextId,
    theCollectionIdOfNFTIWant,
    theSnOfNFTIWant,
    {
      amount: 1e10 // the amount I want to offer
      direction: 'Send' // This I very important
    },
    duration
  )

if there is something unclear pls let me know.

@vikiival vikiival added enhancement New feature or request A-statemine-ahk related for statemine common chain, under new name Asset Hub Kusama design-request A-statemint-ahp Polkadot Asset Hub related issues labels Aug 7, 2024
@vikiival
Copy link
Member Author

vikiival commented Aug 7, 2024

cc @preschian pls check comment

@vikiival vikiival added the p2 core functionality, or is affecting 60% of app label Aug 7, 2024
@preschian
Copy link
Member

for id can use this endpoint: https://dyndata.koda.art/generate-id

@vikiival
Copy link
Member Author

cc @Jarsen136 any progress ?

@exezbcz
Copy link
Member

exezbcz commented Aug 12, 2024

i will drop revised design today/tomorrow

@Jarsen136
Copy link
Contributor

cc @Jarsen136 any progress ?

Task
Implement modal by figma design
make sure that that you are able to make transaction

Not yet, I'm waiting for the design and then start to implement it.

@exezbcz
Copy link
Member

exezbcz commented Aug 13, 2024

I have created a solo issue for the design

@exezbcz exezbcz removed their assignment Aug 14, 2024
@Jarsen136
Copy link
Contributor

@vikiival I tried to make the offer transaction but it failed.
Could you pls find anything wrong from my tx?

https://assethub-polkadot.subscan.io/extrinsic/6907000-2
https://assethub-polkadot.subscan.io/extrinsic/6906934-2

@vikiival
Copy link
Member Author

I will recheck the permissions on collection.
Ahk works for you?

@Jarsen136
Copy link
Contributor

I will recheck the permissions on collection. Ahk works for you?

No, it does not work on ahk either.
https://assethub-kusama.subscan.io/extrinsic/7571861-2

@Jarsen136
Copy link
Contributor

@vikiival Feel free to let me know when I can test the offer transaction.

@vikiival
Copy link
Member Author

vikiival commented Aug 16, 2024

I have enabled both

Important

it costs 500000000 to mint offer nft (it is a constant)

I have updated the snippet for u

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-statemine-ahk related for statemine common chain, under new name Asset Hub Kusama A-statemint-ahp Polkadot Asset Hub related issues enhancement New feature or request p2 core functionality, or is affecting 60% of app
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants