Skip to content

[SDK] Update IPFSOperations to include custom_charges in payloads #602

@tcsenpai

Description

@tcsenpai

Repository: ../sdks

Update IPFS payload creation methods to include custom_charges.

Files to modify

  • src/abstraction/ipfs/IPFSOperations.ts - Update createAddPayload, createPinPayload

Implementation

Methods should accept optional maxCostDem parameter:

createAddPayload(content, options?: { maxCostDem?: number }) {
    // ... existing logic
    if (options?.maxCostDem) {
        payload.custom_charges = {
            ipfs: {
                max_cost_dem: options.maxCostDem,
                file_size_bytes: content.length,
                operation: 'add'
            }
        }
    }
    return payload
}

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