Irys-xyz / js-sdk

4 stars 3 forks source link

Error 402: Not Enough Balance for Transaction on Solana Devnet #14

Closed liompei closed 1 month ago

liompei commented 1 month ago

I have obtained SOL tokens on the Solana Devnet through https://faucet.solana.com/. However, when I use the following code:

const getIrysArweave = async (secretKey: Uint8Array) => { // Create Irys uploader instance const irysUploader = await Uploader(Solana) .withWallet(secretKey) // Set wallet .withRpc('xxxx') // Set RPC endpoint .devnet(); // Use devnet // Return the created uploader instance return irysUploader; }

const irys = await getIrysArweave(payer.secretKey)

const imageUploadReceipt = await irys.uploadFile(imagePath) I receive the following error:

Error: 402 error: Not enough balance for transaction I have confirmed that the secretKey being passed is correct.

Versions:

json

"@irys/upload": "^0.0.7", "@irys/upload-solana": "^0.0.7", Environment:

Node.js: v22.8.0

Request for Assistance:

Could you please help me understand why this error occurs despite having sufficient SOL in my Devnet account? Are there any additional requirements or configurations needed to successfully upload files using Irys on the Solana Devnet?

Thank you for your assistance!

liompei commented 1 month ago

I found the reason. The uploaded image exceeded 100KB. When I used an image smaller than 100KB, the upload was successful.