Skip to content

TypeScript SDK RPC Result Models

RPC interfaces are exported from phantasma-sdk-ts/public as TypeScript types. They mirror the JSON-RPC response shape and preserve encoded fields where the node returns encoded strings.

Common Field Rules

Field patternMeaning
amount, currentSupply, maxSupply, fee, priceBase-unit strings unless a helper explicitly formats decimals.
hash, blockHash, script, payload, result, rom, ramEncoded strings returned by the node.
carbonId, carbonTokenId, carbonSeriesId, carbonNftAddressCarbon identifiers used by current token/NFT workflows.
stateExecution state. Check transaction state before parsing operation results.

Pagination

TypeFields
Paginated<T>page/page-size style result data for older endpoints.
CursorPaginatedResult<T>result, cursor for Carbon token/NFT inventory reads.

Keep passing the returned cursor with the same filters until it is empty.

Account And Balance Models

TypeFields
Balancechain, amount, symbol, decimals, optional ids.
Stakeamount, time, unclaimed.
Storageavailable, used, avatar, archives.
AccountInfoaddress, name, stake.
Accountaddress, name, stakes, stake, unclaimed, optional relay, validator, storage, balances, optional txs.
AccountTransactionsaddress, txs.

AccountInfo is the result of getAccountInfo and getAccountInfos. name is the registered name, or anonymous when the address has none. Its stake field carries the staking object. Account carries the same object under stakes and uses stake for a deprecated flat scalar.

Chain, Contract, And Organization Models

TypeFields
Platform, Interop, GovernanceNexus platform and governance metadata.
Chainname, address, parent, height, organization, contracts, dapps.
Nexusname, protocol, platforms, tokens, chains, governance, organizations.
Organizationname, owner, carbonOwner, metadata, memberCount.
OrganizationMemberaddress, carbonAddress, isMember, memberTime.
Contractname, address, owner, script, methods, events.
Leaderboard, LeaderboardRownamed leaderboard rows.
ABIContract, ABIMethod, ABIEvent, ABIParameterContract ABI structures.

Block, Transaction, Event, And Script Models

TypeFields
RpcEvent, EventExtended, EventExtendedTypedEvent address, contract, kind, data, and typed extension fields. RpcEvent also carries name.
OracleURL and content fields.
SignatureResultsignature kind and data.
TransactionDatahash, chainAddress, timestamp, blockHeight, blockHash, script, payload, carbonTxType, carbonTxData, events, optional extendedEvents, result, optional debugComment, fee, state, signatures, sender, gasPayer, gasTarget, gasPrice, gasLimit, expiration.
Blockhash, previousHash, timestamp, height, chainAddress, protocol, txs, validatorAddress, optional producerAddress, reward, optional events, optional oracles.
Scriptevents, result, results, oracles, optional error.
VmValueA value decoded from VM storage: a scalar, an array or a struct.

For a contract event, kind is Custom_V2 and name is the event name the contract declared. For every other event, name repeats kind.

Use decodeVMObject or Decoder helpers where a script result contains VM object bytes.

producerAddress is the fee payout address the block producer stamped inside the hashed block input. It is present on gas model v2 blocks and absent on earlier ones. It is a different field from validatorAddress, which names the consensus-log leader. Do not assume the two are equal.

VmValue is string | VmValue[] | { [field: string]: VmValue }. The wire carries the plain JSON value, so the shape itself says which of the three it is. Narrow it with typeof value === 'string' for a scalar and Array.isArray for an array. Scalars are always strings, because chain numbers are big integers and JSON numbers lose precision above 2^53. Byte values arrive as hex.

EventExtendedTyped is EventExtended<ExtendedEventData>, and ExtendedEventData is the union of the typed payloads: TokenCreateData, TokenSeriesCreateData, MarketOrderData and SpecialResolutionData. A special resolution call carries its arguments typed per method.

Token, NFT, Schema, And Price Models

TypeFields
Tokensymbol, name, decimals, currentSupply, maxSupply, burnedSupply, address, owner, flags, optional script, series, carbonId, optional metadata, optional tokenSchemas, optional external, optional price.
TokenData / NFTid, series, carbonTokenId, carbonSeriesId, carbonNftAddress, mint, chainName, ownerAddress, creatorAddress, ram, rom, status, infusion, properties.
TokenSeries, TokenSeriesResultseriesId, carbonTokenId, carbonSeriesId, ownerAddress, maxMint, mintCount, currentSupply, maxSupply, optional burnedSupply, optional mode, optional script, optional methods, metadata.
TokenSchemasResult, VmStructSchemaResult, VmVariableSchemaResult, VmNamedVariableSchemaResultRPC schema shape.
TokenExternal, TokenPriceexternal mappings and price rows.

Convert RPC schema payloads with vmStructSchemaFromRpcResult and vmVariableSchemaFromRpcResult before passing them into Carbon schema builders.

Fee And Gas Configuration Models

TypeFields
GasConfigResultgasModelVersion, optional gasConfig, blockRateTarget, expiryWindow, optional unitsPerBlockDataByte.
GasConfigDataThe JSON shape of the on-chain gas configuration.
EstimateTransactionResultwouldAbort, optional abortReason, gasBillKcalBase, dataRows, dataEscrowAtoms, dataRefundAtoms, recommendedMaxGas, recommendedMaxData.

gasModelVersion is 1 for the original fee model and 2 for gas model v2. The fields of GasConfigData after gasBurnRatioShift exist only when GasConfigData.version is 1 or higher. A gas model v1 response omits them.

64-bit values in both models arrive as decimal strings, because they can exceed the 2^53 precision of a JSON number.

gasConfigFromRpc(result) converts a GasConfigResult into the GasConfig the fee planner uses. It throws on a malformed numeric string, on a v2 response that is missing its tail fields, and on a byte price this SDK does not implement.

feeEstimateFromRpc(result) converts a completed estimate into the same FeeQuote a local plan produces. It throws when wouldAbort is set, because an aborted simulation carries no recommendation.

Auction, Archive, And Network Models

TypeUse
AuctionMarketplace listing data.
Archiveoptional name, optional hash, time, size, optional encryption, blockCount, optional missingBlocks, optional owners.
BuildInfoResultNode version, commit, and build time.
PhantasmaVmConfigVM gas and deployment configuration values.
Peer, Validator, Swap, Receipt, Channel, DappExplorer, status, and operational tooling data.