Core concepts
Custom JSON
A standardized envelope makes application data easy to index, parse and validate: every payload is an action name plus an optional metadata object.
Build one in the playgroundThe envelope
JSON
{
"action": "claim",
"metadata": { "rewardId": "123" }
}The envelope is serialized into the json field of a Hive custom_json operation. metadata may be null.
CustomJsonBuilder
TypeScript
const operation = hive.builder.buildOperation({
username: "alice",
id: "my-application",
action: "claim",
metadata: { rewardId: "123" },
authority: "posting",
});
// [
// "custom_json",
// {
// required_auths: [],
// required_posting_auths: ["alice"],
// id: "my-application",
// json: "{\"action\":\"claim\",\"metadata\":{\"rewardId\":\"123\"}}"
// }
// ]Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| username | string | Yes | Signing Hive account. |
| id | string | Yes | Custom JSON id namespace for your application. |
| action | string | Yes | Action name inside the standardized envelope. |
| metadata | object | null | No | Optional payload object. Defaults to null. |
| authority | "posting" | "active" | No | Which authority signs. Defaults to "posting". |
