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

Configuration

Configuration

hive.configs is the configuration object you passed to the client — stored, frozen and fully typed. The SDK does not manage staging, production or testing.

Inspect configuration live

One client, one config

TypeScript
const hive = new HiveClient(config);

hive.configs; // exactly `config`, frozen

Everything you pass, except the SDK runtime options endpoint, beaconUrl and environment, is stored verbatim under hive.configs. There is no active configuration, no environment switching and no mutation API.

Your own structure

TypeScript
const hive = new HiveClient({
  accounts: {
    treasury: { accountEnv: "HIVE_TREASURY_ACCOUNT", keyEnv: "HIVE_TREASURY_ACTIVE_KEY" },
  },

  tests: {
    accounts: { minter: "test-minter" },
  },

  game: {
    accounts: { rewards: "game-rewards" },
  },
});

hive.configs.tests.accounts.minter;   // "test-minter"
hive.configs.game.accounts.rewards;   // "game-rewards"

Names like tests, game or production are your concepts, not the SDK's. TypeScript infers the exact shape you passed, so nested access stays typed. You can also declare the shape explicitly:

TypeScript
type AppConfig = {
  accounts: { treasury: { accountEnv: string } };
  tests: { accounts: { minter: string } };
};

const hive = new HiveClient<AppConfig>({ /* ... */ });

Note

Configuration never carries RPC endpoints — node selection belongs to the RPC system.

The accounts key

accounts is the one key the SDK reads: it maps developer-defined aliases to real Hive accounts, directly or through environment variables, and produces the key-free references in hive.accounts.

TypeScript
hive.accounts.treasury;          // key-free AccountReference
hive.listAccounts();             // ["treasury"]
hive.resolveAccount("treasury"); // { alias, account } — never key material

Multiple instances

TypeScript
const testHive = new HiveClient(testConfig);
const productionHive = new HiveClient(productionConfig);

testHive.configs;
productionHive.configs;

Need different configurations? Create different clients. They share nothing, so there is never an ambiguous "current" context.