-
-
Notifications
You must be signed in to change notification settings - Fork 353
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
Migration UI - 3 - Signing #7562
Comments
Some changes will be made, mainly to the structure of what you are signing, and maybe some flow as well. don't take this issue please till we update that. cc @vikiival |
@exezbcz where the user will see if everything was migrated successfully with on-chain checks? Like item list for example? |
After each transaction is complete, you can click on the link. Once everything is completed it also works like a list of transactions. It does proceed to the congratulations before you click the complete button I will add more comprehensive list on the congratulations screen - list of items with status and link to tx. Thanks for feedback sir |
ContextSo as I wrote the migration script I found out a unpleasant truth: If user wants to presign items, he/she need to sign MANUALY EVERY SINGLE ITEM. The codeThe create collectoion tx should be composed of // Step 1
const nextId = weHaveACodeForThis()
const collection = getCollectionById('ksm', collectionId)
batch [
create(accountId, defaultSettings),
set_collection_metadata(nextId, collection.metadata),
set_team(nextId, KODA_BOT, accountId, accountId)
] after transaction is successful the code should call an API
body {
"from": {
"chain": "ksm", // or rmrk depends which
"collection": "" // collection id from
},
"to": {
"chain": "ahk", // or ahp depends
"collection": "" // collection id
},
"issuer": "" // account id
} Once API call was returned with status 200. we need to compose another API call that sends all the required params to sign.
The return of this api call is a list of Signatures where signature is composed at least from {
"result": {
"ok": true,
"id": "", //basically id of last one
"error": null
},
"data": [
{
"account": "", //current owner of nft
"attributes": "", // attributes to be created
"chain": "ksm", // chain
"collection": "", // rmrk_collection_id
"data": "", // packed data, check step 3, sig.data
"deadline": 12000000,
"id": "", // internal id
"metadata": "", // metadta to be minted along
"signature": "", // signature, check step 3, sig.signature
"signer": "",// signer, check step 3, sig. signer
"sn": "", // rmrk_sn_id
"to_chain": "ahk",
"to_collection": "", // collection_id
"to_sn": "" // future_nft_sn
}
]
Once you get this list of signatures we need to build a payload for tx // Step 3
function createItem(api: ApiPromise, sig: Signature) {
const preSignInfo = api.createType("PalletNftsPreSignedMint", sig.data);
const create = api.tx.nfts.mintPreSigned(preSignInfo, {
Ed25519: sig.signature,
}, sig.signer);
return create;
}
const items = iterations.data.map((sig) => createItem(api, sig));
batch(
items
) Once this is successful we can burn the existing nfts
Last step is to iterate over signatures one more time and build proper so iterate over nfts build proper extrinsic (do not remeber from head so can find along the way). Once this is done. TBA
Body [
] From design perspectiveI wrote the code first so I can guide better. 1. Create collection (✅)2. Waiting API to sign NFTsThis will be possibly done in iterations. 3. Creating your own NFTs (✅)Due to the limit of the AH blockchain my estimation is that 200 items can be minted in one iteration. Each iteration needs to wait for the in block state (then we can reflect it as done). 4. Burning migrated NFTs on KusamaSame as step 3, but different naming, however we are not limited (13K items were tested). Questions
|
Thank you sir; mostly clear, however, ad signing txs - some questions For me, it's important how many tx the user will sign and after which step the user will wait. from what i understand:
cc @vikiival |
So min 3 |
@vikiival, last question just to be sure What will user sign if he is not the owner of the collection - migrating only items that were pre-signed by the owner
thanks! |
There should be a separated screen for /migrations where user can find list of waiting mogrations and can transact them in the batch EDIT: |
Changes/second iteration
Initiation stage
Migrating your items
Finalization |
I updated the API |
hi @vikiival, is there something wrong with my args in here? https://assethub-kusama.subscan.io/block/0xf8cbf28ce3b0ce89b07ab484654c589efd443e6ed241902c437a59b52f920b73 I'm getting a 400 error on the |
For the logs purposes
Everything is good here
There was a bug with usage of uniquery I was requesting |
Updates:
I will check again tomorrow |
Updates:
|
Updates #7909: On ahk:
On ahp:
cc @vikiival Iterations and Burn not yet implemented. I will implement that once migration nfts look ok |
Because of the API error, I will try to help on the backend side also on https://github.com/kodadot/private-workers |
This was fixed |
I'm still not able to test this out. My dashboard has been blank since yesterday. There were some issues on the Cloudflare side. ref: kodadot/workers#192 (comment) |
part of a bigger issue:
Signing 🚥
the parent section changes based on whether its in progress, its done, or inactive, changes between three states.
![image](https://private-user-images.githubusercontent.com/90852205/273452405-bfbacaba-80c5-49d2-8155-74ab9fbf8515.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjExMzYyOTcsIm5iZiI6MTcyMTEzNTk5NywicGF0aCI6Ii85MDg1MjIwNS8yNzM0NTI0MDUtYmZiYWNhYmEtODBjNS00OWQyLTgxNTUtNzRhYjlmYmY4NTE1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE2VDEzMTk1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWI0YTAyM2UwMmFmZjlhYzJjZjE2NTBhMzY3N2U2MjM5OWY2NGEwMzlmMzVjZWEyMDQ5MmU4M2U2OWE1NDA5Y2QmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.maTQiD0LL485axIOeFmMc-jdlQEyCN6mCDapwPvZZTY)
the grey 1/4 circle is a loading wheel, please match the style as much as possible.
The same icons are used for the subsections. Every step is in this case one signed transaction.
let me give an example.
![image](https://private-user-images.githubusercontent.com/90852205/273452980-16f8397b-4f07-4a91-bddf-91607fc9a3f4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjExMzYyOTcsIm5iZiI6MTcyMTEzNTk5NywicGF0aCI6Ii85MDg1MjIwNS8yNzM0NTI5ODAtMTZmODM5N2ItNGYwNy00YTkxLWJkZGYtOTE2MDdmYzlhM2Y0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzE2VDEzMTk1N1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTU0NjAwYjIwZGFhNDJhYzU0ZWI2ZWU2ODVjOTM0ZDk3YjhkYjgwYzIxYTkxMzE4MGIwZDE1NmI5MTY3YjRhZjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.fLyh6DVqb-0uPd5GOBIQYQR95r2Xi7ZVdlamY5LIwE4)
the contextual message is in this case what is changing.
when you cancel signing, you have the option to retry (it could say failed or canceled)
The text was updated successfully, but these errors were encountered: