Skip to main content

Overview

The renewal methods allow you to extend the storage duration of existing uploads before they expire, maintaining the same CID and file accessibility.

Get Renewal Cost

Before renewing, get a cost quote:

Parameters

string
required
Content identifier of the file to renew
number
required
Number of days to add to current expiration (minimum: 7)

Response

Renew Storage Duration

Execute the renewal and pay for the extension:

Parameters

string
required
Content identifier of the file to renew
number
required
Number of days to add (minimum: 7)
PublicKey
required
Solana wallet public key for payment
Function
required
Async function to sign the renewal transaction

Response

boolean
Whether the renewal succeeded
string
Content identifier (unchanged)
string
Solana transaction signature
string
IPFS gateway URL (same as before)
string
Human-readable success message
string
Updated expiration date (ISO 8601)
string
Error message (only if success is false)

Complete Example

With Duration Presets

Offer common renewal durations:

Balance Verification

Check if user has enough SOL before renewing:

Error Handling

Common errors and solutions:
Error: CID doesn’t exist in the databaseSolution: Verify the CID is correct and belongs to the connected wallet
Error: Cannot renew a file that’s already been deletedSolution: Check deletion status before attempting renewal
Error: Not enough SOL to pay for renewalSolution: Verify balance before renewal (see Balance Verification above)
Error: Blockchain transaction failed or was rejectedSolution: Check network status and retry

Multiple Renewals

Renew multiple files in sequence:
Each renewal is a separate blockchain transaction. Renewing multiple files will require multiple wallet signatures and transaction fees.

Renewal History

Track renewal transactions:

Best Practices

Get Quote First

Always show cost estimate before renewal

Verify Balance

Check sufficient SOL before proceeding

Show Expiration Dates

Display both current and new expiration clearly

Handle Errors

Provide clear feedback for all error cases

Renewal Concept

Understand renewal mechanics

Upload History

Find files to renew

Create Deposit

Initial file uploads

Storage Payments

Payment flow