byte_publish_data
Publish a data payload to a subscriber, hashing it on-chain and settling the fee in USDC while recording the size on the DataStream contract.
Instructions
Publish data to a subscriber via the PayPerByte DataStream contract. Hashes the payload, records size on-chain, and settles the fee in USDC. Requires PRIVATE_KEY.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"subscriber": "<subscriber>",
"data": "<data>",
"maxFee": "<maxFee>"
},
"name": "byte_publish_data"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Data payload to publish (will be hashed on-chain) | |
| maxFee | Yes | Maximum fee in USDC willing to pay for this publish (e.g. 0.05) | |
| subscriber | Yes | Subscriber Ethereum address (0x...) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| txHash | No | Publish transaction hash | |
| success | No | True if publish landed on-chain | |
| payloadHash | No | keccak256 of the payload as recorded on-chain | |
| payloadSize | No | Payload size recorded on-chain (bytes) |