Skip to content

[SDK] Add ipfsQuote nodeCall helper #603

Description

@tcsenpai

Repository: ../sdks

Add a helper method to get IPFS cost quote before building transaction.

Files to modify

  • src/websdk/demosclass.ts - Add ipfsQuote method

Implementation

/**
 * Get a cost quote for an IPFS operation without submitting a transaction.
 * Use this to populate tx.content.custom_charges before signing.
 * 
 * @param fileSize - Size of file in bytes
 * @param operation - 'add' or 'pin'
 * @returns Cost quote with breakdown
 */
async ipfsQuote(fileSize: number, operation: 'add' | 'pin' = 'add'): Promise<IpfsQuote> {
    return this.nodeCall("ipfsQuote", { fileSize, operation })
}

Verification

  • bun run build in ../sdks must pass
  • Commit and push to SDK repo
  • WAIT for user to publish new SDK version before continuing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions