QubicTypeScript

Constants

PROTOCOL, CONTRACT_INDEX, and LOG_TYPE — Qubic protocol constants exported from @qubic.org/types.

PROTOCOL

Low-level protocol constants. Useful for building custom transports or validating wire-format data.

import { PROTOCOL } from "@qubic.org/types"
ConstantValueDescription
MAX_INPUT_SIZE1024Maximum payload byte length
TX_HEADER_SIZE80Fixed transaction header size in bytes
SIGNATURE_SIZE64SchnorrQ signature size in bytes
PUBLIC_KEY_SIZE32FourQ public key byte length
IDENTITY_LENGTH60Identity string character count
SEED_LENGTH55Seed string character count
TX_HASH_LENGTH60Transaction hash character count
TICKS_TO_EXPIRY5Default ticks ahead used for targetTick

CONTRACT_INDEX

Maps contract names to their on-chain index numbers. Used internally by @qubic.org/contracts and @qubic.org/rpc.

import { CONTRACT_INDEX } from "@qubic.org/types"

console.log(CONTRACT_INDEX.QEARN)     // 9
console.log(CONTRACT_INDEX.QX)        // 1
console.log(CONTRACT_INDEX.QUOTTERY)  // 4
NameIndex
RANDOM0
QX1
QUOTTERY4
QUTIL5
SUPPLY_WATCHER
COMPUTOR_CONTROLLED_FUND
QEARN9
QVAULT10
MSVAULT11
QBAY12

LOG_TYPE

Maps event log type names to their numeric IDs used in the live event stream and archive.

import { LOG_TYPE } from "@qubic.org/types"

console.log(LOG_TYPE.QU_TRANSFER)    // 14
console.log(LOG_TYPE.ASSET_ISSUANCE) // 1
IDNameDescription
0QU_TRANSFER_IN_REGISTRATIONQU transfer during identity registration
1ASSET_ISSUANCENew asset issued
2ASSET_OWNERSHIP_CHANGEAsset ownership transferred
3ASSET_POSSESSION_CHANGEAsset possession transferred
4CONTRACT_ERROR_MESSAGEContract emitted an error
5CONTRACT_WARNING_MESSAGEContract warning
6CONTRACT_INFORMATION_MESSAGEContract info log
7CONTRACT_DEBUG_MESSAGEContract debug log
8BURNINGQU burned
9DUST_BURNINGDust threshold burning
10SPECTRUM_STATSNetwork spectrum statistics
11ASSET_OWNERSHIP_MANAGING_CONTRACT_CHANGEAsset management contract changed
12ASSET_POSSESSION_MANAGING_CONTRACT_CHANGEAsset possession manager changed
13CONTRACT_RESERVE_DEDUCTIONContract reserve deducted
14QU_TRANSFERStandard QU transfer
15ORACLE_QUERY_STATUS_CHANGEOracle query status update
16ORACLE_SUBSCRIBER_LOG_MESSAGEOracle subscriber log
255CUSTOM_MESSAGECustom contract message

LOG_TYPE IDs correspond to eventType values in event log responses from @qubic.org/bob and @qubic.org/rpc.

On this page