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

Configuration

Account aliases

Code refers to roles — treasury, minter, rewards — while the real account name lives in the environment. Rotating an account never touches application code.

Resolve an alias

Why aliases

Backend operations take from: "treasury", not a Hive username. The alias maps to environment variables, so staging and production differ only by configuration.

Alias shape

TypeScript
accounts: {
  treasury: {
    accountEnv: "HIVE_TREASURY_ACCOUNT",       // resolves to the Hive username
    keyEnv: "HIVE_TREASURY_ACTIVE_KEY",        // resolves to the signing key
  },
}
HiveAccountConfig
ParameterTypeRequiredDescription
accountEnvstringYesEnvironment variable holding the Hive account name.
keyEnvstringNoEnvironment variable holding the private key used for signing.

Account references

Backend issuer operations never take an alias string. They take the reference object the SDK exposes for that alias, so a typo becomes a compile error instead of a runtime one.

TypeScript
hive.accounts.treasury;                  // default configuration
hive.configs.game.accounts.minter;       // named configuration

await hive.issuer.token.issue({
  from: hive.accounts.treasury,          // AccountReference — not "treasury"
  symbol: "MYTOKEN",
  account: "bob",
  quantity: "10.000",
});

Security

An AccountReference carries the alias and the environment variable names only. It never carries a resolved account name or key. Hive Keychain is unaffected and still takes username: string.

Resolution

TypeScript
hive.listAccounts();               // ["treasury"]
hive.accounts.treasury;            // AccountReference passed to issuers
hive.resolveAccount("treasury");   // { alias, account } — internal resolution

Security

Signing keys are resolved internally, server-side, only when a backend issuer operation needs one. A missing key throws a secret-safe error naming the variable — never its value.