@qubic-labs/contracts
v1.2.1
Published
Type-safe runtime interfaces for Qubic contract `inputData` consumption.
Downloads
599
Readme
@qubic-labs/contracts
Type-safe runtime interfaces for Qubic contract inputData consumption.
This package is intended for external consumers (SDK/app code) to work with typed contract interfaces and runtime encode/decode helpers.
Install
bun add @qubic-labs/contractsPublic Surface (External Use)
- Bundled core registry:
coreContractsRegistrycoreContractDefinitions- Runtime contract entry input codec:
encodeContractEntryInputDatadecodeContractEntryInputData- Base64 helpers:
bytesFromBase64bytesToBase64- Shared contract registry interfaces (types only):
ContractDefinitionContractEntryContractIoTypeDefinitionContractsRegistry- and related type exports from
src/registry/types.ts.
Runtime Requirements
- Bun
>=1.1. - Node-compatible TypeScript runtime (ESM).
Runtime Example
import {
coreContractsRegistry,
decodeContractEntryInputData,
encodeContractEntryInputData,
} from "@qubic-labs/contracts";
const encoded = encodeContractEntryInputData({
registry: coreContractsRegistry,
contractName: "QUTIL",
entryName: "Vote",
value: {
poll_id: 1n,
address: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
amount: 1000n,
chosen_option: 0n,
},
});
const decoded = decodeContractEntryInputData({
registry: coreContractsRegistry,
contractName: "QUTIL",
entryName: "Vote",
bytes: encoded.bytes,
});Public API
- Root exports from
src/index.tsare intentionally consumer-only: - bundled core registry
- base64 helpers
- runtime codec helpers
- registry/model interfaces (types only)
Detailed API reference:
docs/API.md
Maintainers
Generation, ingestion, and release tooling are repository-maintainer workflows, not public npm package API.
docs/CLI.mddocs/RELEASING.mddocs/README.md
Development
bun install
bun run check
bun test
bun run buildRelease
Run the full release gate:
CORE_REPO=../core bun run release:checkAutomated publish is done by semantic-release on main using NPM_TOKEN.
Then follow:
docs/RELEASING.md
