aptos-labs / aptos-ts-sdk

An SDK for accessing the Aptos blockchain data, submitting transactions, and more!
https://aptos-labs.github.io/aptos-ts-sdk/
Apache License 2.0
67 stars 37 forks source link

add getprice to estimate irys upload cost #451

Closed jillxuu closed 2 months ago

jillxuu commented 2 months ago

Description

add getprice to estimate irys upload cost

Test Plan

Related Links

https://docs.irys.xyz/developer-docs/irys-sdk/api/getPrice

0xaptosj commented 2 months ago

not related to this PR, but when we calculate upload cost, how do we handle the size change after we update the media url in metadata files? If the media url is blank in metadata file at the beginning, after the media upload and it's filled, the size of metadata file will grow a bit.

Maybe a potential solution is we calculate how many media url there would be, e.g. for a collection of 1000 NFTs, there would be 1009+1 media urls need to be updated. And Irys URL should have fixed length, we can add the total file size by 1001 * bytes_of(Irys URL)

0xmaayan commented 2 months ago

not related to this PR, but when we calculate upload cost, how do we handle the size change after we update the media url in metadata files? If the media url is blank in metadata file at the beginning, after the media upload and it's filled, the size of metadata file will grow a bit.

Maybe a potential solution is we calculate how many media url there would be, e.g. for a collection of 1000 NFTs, there would be 1009+1 media urls need to be updated. And Irys URL should have fixed length, we can add the total file size by 1001 * bytes_of(Irys URL)

do you mean updating a folder after a folder has been uploaded to irys? or it the change in cost with vs without the media url?

jillxuu commented 2 months ago

not related to this PR, but when we calculate upload cost, how do we handle the size change after we update the media url in metadata files? If the media url is blank in metadata file at the beginning, after the media upload and it's filled, the size of metadata file will grow a bit.

Maybe a potential solution is we calculate how many media url there would be, e.g. for a collection of 1000 NFTs, there would be 1009+1 media urls need to be updated. And Irys URL should have fixed length, we can add the total file size by 1001 * bytes_of(Irys URL)

this shouldn't be a problem from beginning because the cost should be calculated before the submission where the json file is already updated?