-
Notifications
You must be signed in to change notification settings - Fork 18
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
API create bid with "nftAddress" param #73
Comments
You needn't set the nftAddress, it's only for multi-address wallet, such as Xverse, hiro. |
I'm actually trying to do it too, but receiving problem:
Can you help? @cloud6605 |
Well, I guess I need to use the nftAddress param... My use case: A HD wallet with many different UTXOs across many different p2wpkh addresses for payments & single derived p2tr address for ordinals. So I need to pay for the ordinal with the p2wpkh utxos - using the "utxos" param (and receive change to p2wpkh change address - using the "address" param) & receive the ordinal to the single derived p2tr address - using the "nftAddress" param. How do I accomplish this with the API? |
What's the endpoint you are using for this? Any pointers to docs about this procedure? |
Bind btcAddress and nftAddress. |
Thank you! So that's the endpoint I am looking for! How are you producing the signature? |
@cloud6605 Am I right ? but it's not working for me, so if you will manage it -> let me know please |
Based on the docs you should be signing by the ordinals address (p2tr), not by the payment address. Anyway I am trying to do that but also getting the same error as you do, so there might be some issue on the unisat's API side. Btw I am also using bitcoinjs-lib, but bip322-js lib for signing the message - you also should use that because bitcoinjs-message is 4 years old and doesn't support p2tr (and you need to sign by the ordinals p2tr address). |
Could you share the code? |
Here it is, just be sure to get the version 6.1.6 of the bitcoinjs-lib (7 doesn't work well for me for some reason), and version 2.1.0 of ecpair.
It prints out the signature in base64 and also in hex, you can get just the signature by stripping first 2 bytes (witness push count & signature push size) and the last 1 byte (sighash) |
Maybe we can try with this Signer:
Saw in some reps. You can check if you want. So you have the same error, yes ? it's really strange. |
That can only sign a specific hash, doesn't really help, because bip322 is about how you construct that hash (it is actually an invalid bitcoin transaction).
Yep, if I send the hex output of the bip322-js library (full witness) I get:
And if I send just the signature (strip first 2 bytes & last byte), I get:
|
I am also wondering why this binding procedure is even required (especially when used over the API), to me seems like just a UX hurdle. |
Maybe @cloud6605 could help, for now I see only one way -> use Taproot address |
If I try to to call the create bid endpoint for collections (https://open-api.unisat.io/v3/market/collection/auction/create_bid), with the following data:
I get a response saying:
What does this mean and how do I "bind first" through the API?
The text was updated successfully, but these errors were encountered: