Storage Program payload for transaction data

Unified payload supporting both JSON and Binary encodings with robust ACL.

interface StorageProgramPayload {
    accessControl?: StorageProgramAccessControl;
    acl?: StorageProgramACL;
    allowedAddresses?: string[];
    data?: string | Record<string, any>;
    encoding?: StorageEncoding;
    field?: string;
    index?: number;
    metadata?: Record<string, unknown>;
    operation: StorageProgramOperation;
    programName?: string;
    salt?: string;
    storageAddress: string;
    storageLocation?: StorageLocation;
    value?: unknown;
}

Properties

Use acl instead. Kept for backward compatibility. Simple access control mode

Robust access control configuration (new) Supports owner, allowed, blacklisted, public, and groups

allowedAddresses?: string[]

Use acl.allowed instead. Kept for backward compatibility. Allowed addresses for 'restricted' access control

data?: string | Record<string, any>

Data to store

  • For json encoding: Record<string, any> (max 64 nesting levels)
  • For binary encoding: base64 encoded string Max size: 1MB for both
encoding?: StorageEncoding

Encoding format for the data

  • json: data field contains Record<string, any>
  • binary: data field contains base64 string
"json"
field?: string

Field name for granular operations (SET_FIELD, SET_ITEM, APPEND_ITEM, DELETE_FIELD, DELETE_ITEM) Required for all granular operations

index?: number

Array index for SET_ITEM and DELETE_ITEM operations Required for SET_ITEM and DELETE_ITEM

metadata?: Record<string, unknown>

Optional metadata (filename, mimeType, description, etc.)

The storage operation to perform

programName?: string

Name of the storage program (required for CREATE_STORAGE_PROGRAM)

salt?: string

Random salt for deterministic address derivation (optional)

storageAddress: string

The storage program address (stor-{hash format})

storageLocation?: StorageLocation

Storage location preference

"onchain"
Note: "ipfs" is not yet implemented, will fall back to "onchain"
value?: unknown

Value for SET_FIELD, SET_ITEM, and APPEND_ITEM operations Required for SET_FIELD, SET_ITEM, and APPEND_ITEM