Skip to main content

Data Types

This section provides a comprehensive reference for all the custom data structures, input parameters, and response objects used throughout the OCAP Client API. Understanding these types is essential for effectively interacting with the OCAP blockchain.

Core Types

These are fundamental data structures used across various API calls.

Any

A generic container for protobuf messages, allowing for flexible data structures.

  • typeUrl string — A URL-like string that uniquely identifies the type of the serialized message.
  • value string — The serialized message content as a string.

Multisig

Represents a multi-signature, often used in transactions requiring multiple approvals.

  • signer string — The address of the signer.
  • pk string — The public key of the signer.
  • signature string — The signature generated by the signer.
  • delegator string — The address of the delegator, if the signature is delegated.
  • data Any — Optional arbitrary data associated with the signature.

PageInfo

Contains pagination details for list-based query responses.

  • cursor string — A cursor for fetching the next page of results.
  • next boolean — Indicates if there is a next page of results available.
  • total number — The total number of items matching the query.

StateContext

Provides context about the creation and last modification of a state object.

  • genesisTx TransactionInfo — The transaction that created this state object.
  • renaissanceTx TransactionInfo — The transaction that last updated this state object.
  • genesisTime string — The timestamp when the state object was created.
  • renaissanceTime string — The timestamp when the state object was last updated.

Wallet Objects

These types define the structure of wallets used for signing transactions.

WalletObject

  • publicKey string
  • secretKey string
  • type WalletTypeObject

WalletTypeObject

  • pk number
  • role number
  • hash number
  • address number — Defaults to base58btc

WalletType

  • pk KeyType
  • hash HashType
  • address EncodingType
  • role RoleType

Input & Filter Types

These objects are used to provide parameters and filters for GraphQL queries.

General Filter Inputs

  • AccountFilterInput object
    • accounts array<string>
  • AddressFilterInput object
    • sender string
    • receiver string
    • direction Direction
  • AssetFilterInput object
    • assets array<string>
  • DelegationFilterInput object
    • delegations array<string>
  • FactoryFilterInput object
    • factories array<string>
  • RangeFilterInput object
    • from string
    • to string
  • RollupFilterInput object
    • rollups array<string>
  • StakeFilterInput object
    • stakes array<string>
  • TimeFilterInput object
    • startDateTime string
    • endDateTime string
    • field string
  • TokenFactoryFilterInput object
    • tokenFactories array<string>
  • TokenFilterInput object
    • tokens array<string>
  • TxFilterInput object
    • txs array<string>
  • TypeFilterInput object
    • types array<string>
  • ValidatorFilterInput object
    • validators array<string>
  • ValidityFilterInput object
    • validity Validity

Pagination Inputs

PageInput

  • cursor string
  • size number
  • order array<PageOrderInput>

PageOrderInput

  • field string
  • type string

Request-Specific Inputs

These objects are used as parameters for specific query and mutation methods.

  • RequestEstimateGasInput object
    • typeUrl string
    • tx string
  • RequestGetAccountStateInput object
    • address string
    • keys array<string>
    • height number
    • traceMigration boolean
  • RequestGetAccountTokensInput object
    • address string
    • token string
  • RequestGetBlockInput object
    • height number
  • RequestGetBlocksInput object
    • paging PageInput
    • heightFilter RangeFilterInput
    • emptyExcluded boolean
  • RequestListTransactionsInput object
    • paging PageInput
    • timeFilter TimeFilterInput
    • addressFilter AddressFilterInput
    • typeFilter TypeFilterInput
    • validityFilter ValidityFilterInput
    • factoryFilter FactoryFilterInput
    • tokenFilter TokenFilterInput
    • assetFilter AssetFilterInput
    • accountFilter AccountFilterInput
    • txFilter TxFilterInput
    • rollupFilter RollupFilterInput
    • stakeFilter StakeFilterInput
    • delegationFilter DelegationFilterInput
    • tokenFactoryFilter TokenFactoryFilterInput

State Objects

These types represent the state of various entities on the blockchain, such as accounts, assets, and tokens.

AccountState

Represents the state of a user account.

  • balance string
  • nonce string
  • numTxs string
  • address string
  • pk string
  • type WalletType
  • moniker string
  • context StateContext
  • issuer string
  • gasBalance string
  • migratedTo array<string>
  • migratedFrom array<string>
  • numAssets string
  • tokens array<IndexedTokenInput>
  • data Any

AssetState

Represents the state of a non-fungible asset (NFT).

  • address string
  • owner string
  • moniker string
  • readonly boolean
  • transferrable boolean
  • ttl number
  • consumedTime string
  • issuer string
  • parent string
  • endpoint NFTEndpoint
  • display NFTDisplay
  • tags array<string>
  • context StateContext
  • data Any

AssetFactoryState

Represents the state of an asset factory, which is used to mint new assets.

  • address string
  • owner string
  • name string
  • description string
  • settlement string
  • limit number
  • trustedIssuers array<string>
  • input IndexedFactoryInput
  • output CreateAssetTx
  • hooks array<AssetFactoryHook>
  • data Any
  • context StateContext
  • balance string
  • tokens array<IndexedTokenInput>
  • numMinted number
  • display NFTDisplay
  • lastSettlement string

DelegateState

Represents the state of a delegation, where one account authorizes another to perform actions on its behalf.

  • address string
  • ops array<DelegateState_OpsEntry>
  • from string
  • to string
  • context StateContext
  • data Any

StakeState

Represents the state of a stake, which can involve tokens or assets.

  • address string
  • sender string
  • receiver string
  • tokens array<IndexedTokenInput>
  • assets array<string>
  • revocable boolean
  • message string
  • revokeWaitingPeriod number
  • revokedTokens array<IndexedTokenInput>
  • revokedAssets array<string>
  • slashers array<string>
  • nonce string
  • context StateContext
  • data Any

TokenState

Represents the state of a fungible token.

  • address string
  • issuer string
  • name string
  • description string
  • symbol string
  • unit string
  • decimal number
  • icon string
  • totalSupply string
  • initialSupply string
  • maxTotalSupply string
  • foreignToken ForeignToken
  • tokenFactoryAddress string
  • context StateContext
  • data Any

TokenFactoryState

Represents the state of a token factory, used for minting and burning tokens.

  • address string
  • tokenAddress string
  • reserveAddress string
  • currentSupply string
  • reserveBalance string
  • owner string
  • feeRate number
  • curve CurveConfig
  • context StateContext
  • token TokenState
  • reserveToken TokenState
  • data Any

Transaction Payloads (ITX)

These types define the itx (inner transaction) object for various transaction types.

AccountMigrateTx

  • pk string
  • type WalletType
  • address string
  • data Any

AcquireAssetV2Tx

  • factory string
  • address string
  • assets array<string>
  • variables array<VariableInput>
  • issuer NFTIssuer
  • data Any

CreateAssetTx

  • moniker string
  • data Any
  • readonly boolean
  • transferrable boolean
  • ttl number
  • parent string
  • address string
  • issuer string
  • endpoint NFTEndpoint
  • display NFTDisplay
  • tags array<string>

DelegateTx

  • address string
  • to string
  • ops array<DelegateOp>
  • data Any

ExchangeTx

  • to string
  • sender ExchangeInfo
  • receiver ExchangeInfo
  • expiredAt string
  • data Any

StakeTx

  • address string
  • receiver string
  • inputs array<TransactionInput>
  • locked boolean
  • message string
  • revokeWaitingPeriod number
  • slashers array<string>
  • nonce string
  • data Any

TransferTx

  • to string
  • value string
  • assets array<string>
  • data Any

Response Wrappers

These types are the top-level objects returned by API queries, containing a status code and the requested data.

ResponseGetAccountState

  • code string
  • state AccountState

ResponseGetAssetState

  • code string
  • state AssetState

ResponseGetBlock

  • code string
  • block BlockInfo

ResponseGetChainInfo

  • code string
  • info ChainInfo

ResponseGetTx

  • code string
  • info TransactionInfo

ResponseListTransactions

  • code string
  • page PageInfo
  • transactions array<IndexedTransaction>

ResponseSendTx

  • code string
  • hash string