HiveXPH SDKhivexph-sdk
NPM
Developer toolkit for Hive Custom JSON and Hive Engine transactions.

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 playground

The 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

buildOperation(input)
ParameterTypeRequiredDescription
usernamestringYesSigning Hive account.
idstringYesCustom JSON id namespace for your application.
actionstringYesAction name inside the standardized envelope.
metadataobject | nullNoOptional payload object. Defaults to null.
authority"posting" | "active"NoWhich authority signs. Defaults to "posting".