Skip to main content

JSON RPC Documentation

For an end user or application to interact with MOI Network, either to submit Interactions or read state information, it must connect to MOI Node that exposes its JSON-RPC endpoint. The JSON-RPC API of MOI is transport agnostic and uses JSON for data exchange. Interactions are serialized with POLO before signing.

Client Libraries

While it is acceptable to directly communicate with MOI Nodes with the JSON-RPC API, an easier option is to use a client library or wrapper SDK to handle the heavy lifting. Some available SDKs are:

  • JS-MOI-SDK (Javascript & Typescript SDK)

Conventions

TesseractOptions Parameter

Some JSON-RPC methods have an additional parameter to specify some TesseractOptions to define the default Tesseract. It is represented as an object with the following fields for either a Tesseract Number or Hash:

Field NameTypeDescription
tesseract_numberNUMBERTesseract Number
tesseract_hashHEXTesseract Hash
note

If both tesseract_number and tesseract_hash are provided, an error is returned.

To indicate the earliest or latest Tesseract, use the following values for tesseract_number:

  • 0 for the earliest Tesseract
  • -1 for the latest Tesseract

Hex Value Encoding

There are two main types of data that are passed over JSON:

  1. Unformatted byte arrays
  2. Quantities (like integers and numbers)

These are both passed with a hex encoding, but they have different formatting requirements.

Quantities Formatting Rules

When we encode quantities such as integers and numbers, we use the following rules:

  1. Encode as hex.
  2. Prefix with "0x".
  3. Use the most compact representation.
  4. Zero should be represented as "0x0" (slight exception to rule 3).

Examples

Hex ValueDecimal EquivalentIs it Correct?
0x4165Yes
0x4001024Yes
0xN/ANo (should always have at least one digit - zero is "0x0")
0x04001024No (no leading zeroes allowed)
ff255No (must be prefixed with 0x)

Interactions

A Interaction enable you to submit a group of Operations to the network as a single Interaction. When you submit an Interaction using the endpoints listed below, you'll receive an Interaction Hash. This hash can be used to query the interaction's receipt via the moi.InteractionReceipt API. The interactions receipt has the result of operation stored within the ix_operations field along with operation type and status.

Operations

A Operation is an individual action encapsulated within an interaction on the MOI network. It is responsible for executing specific actions, such as asset creation, transfer, minting, burning, logic deployment, invocation, or enlisting. Each operation includes key details like the type of action being performed and the associated payload. Operations are processed as part of an interaction, and their execution directly impacts the state of participants and contributes to changes in the overall network state. When an interaction containing these operations is submitted, you'll receive an Interaction Hash. This hash can be used to query the receipt of the interaction via the moi.moi.InteractionReceipt API. The interaction receipt will include a list of operation results within the operations field containing specific details such as the operation type, status, and result.

The supported operation types are:

Operation TypeType of OperationPayloadResult
1ParticipantCreateParticipantCreatePayloadn/a
2AssetTransferAssetTransferPayloadn/a
4AssetCreateAssetCreatePayloadAssetCreateResult
7AssetMintAssetMintPayloadAssetMintResult
8AssetBurnAsseBurnPayloadAssetBurnResult
9LogicDeployLogicDeployPayloadLogicDeployResult
10LogicInvokeLogicInvokePayloadLogicInvokeResult
11LogicEnlistLogicEnlistPayloadLogicEnlistResult

ParticipantCreate

This type of operation allows users to register an account in the network. It returns an interaction hash, which can be used to retrieve the interaction receipt.

Parameters:

ParameterTypeDescription
senderHEX (32 Bytes)Sender's address
fuel_priceHEXFuel price for the interaction
fuel_limitHEXFuel limit for the interaction
nonceHEXNonce for the interaction
ix_operationsArrayList containing participant create operation.

ParticipantCreateOperation

ParameterTypeDescription
typeNUMBERType of interaction (1 for ParticipantCreate)
payloadParticipantCreatePayloadContains the information about the participant to be registered

ParticipantCreatePayload

ParametersTypeDescription
addressHEX (32 Bytes)Address of the participant to be registered
amountHEXThe hex value of the initial amount to be transferred

Returns:

TypeDescription
HEX (32 Bytes)Interaction hash of the ParticipantCreate
{
"params": [
{
"sender": "0x9c6cc5cccfe2a3dc447bce25f88cb28ce142459057e6c04b59911b6d3f10930a",
"fuel_price": "0x130D41",
"fuel_limit": "0x130D41",
"nonce": "0x1",
"ix_operations": [
{
"type": 1,
"payload": {
"address": "0x44ce1d50da7681c7a8a7277106f400134ff7f422bcc1d9fce5954c2531f54c66",
"amount": "0x3E8"
}
}
]
}
]
}

AssetTransfer

This type of operation allows users to transfer assets between sender and receiver addresses. It returns an interaction hash, which can be used to retrieve the interaction receipt.

Parameters:

ParameterTypeDescription
senderHEX (32 Bytes)Sender's address
fuel_priceHEXFuel price for the interaction
fuel_limitHEXFuel limit for the interaction
ix_operationsArrayList containing asset transfer operation.

AssetTransferOperation

ParameterTypeDescription
typeNUMBERType of interaction (2 for AssetTransfer)
payloadAssetTransferPayloadContains the information about the asset to be transferred

AssetTransferPayload

ParametersTypeDescription
benefactorHEX (32 Bytes)Address of the benefactor
beneficiaryHEX (32 Bytes)Address of the beneficiary
asset_idAssetIDID of the asset to be transferred
amountHEXThe hex value of the amount intended for transfer

Returns:

TypeDescription
HEX (32 Bytes)Interaction hash of the AssetTransfer
{
"params": [
{
"sender": "0x9c6cc5cccfe2a3dc447bce25f88cb28ce142459057e6c04b59911b6d3f10930a",
"fuel_price": "0x130D41",
"fuel_limit": "0x130D41",
"ix_operations": [
{
"type": 2,
"payload": {
"beneficiary": "0x6ef7715969a7a99edf06957e94494e40203b4be2b0ffb325196677a82de6fcb6",
"asset_id": "0x00000000778549058becea5d34d6554ace488a9f63707c38f39e3d24b42f43453f3d83b9",
"amount": "0x4c4b40"
}
}
]
}
]
}

AssetCreate

This type of operation is used to create a new asset on the Tesseract Lattice. It returns the interaction hash which can be used to retrieve the receipt.

Parameters:

ParametersTypeDescription
senderHEX (32 Bytes)Sender address
fuel_priceHEXFuel price of the asset
fuel_limitHEXFuel limit of the asset
ix_operationsArrayList containing asset create operation.

AssetCreateOperation

ParameterTypeDescription
typeNUMBERType of interaction (4 for AssetCreate)
payloadAssetCreatePayloadContains the information about the asset to be created

AssetCreatePayload

ParametersTypeDescription
symbolSTRINGSymbol of the asset
supplyHEXSupply of the asset
dimensionHEXMultidimensional value of the asset
standardHEXStandard of the asset

AssetCreateResult

ParametersTypeDescription
asset_idAssetIDAsset ID of created asset
addressHEXAccount address of asset

Returns:

TypeDescription
HEX (32 Bytes)Interaction hash of the AssetCreate
{
"params": [
{
"fuel_price": "0x130D41",
"fuel_limit": "0x130D41",
"sender": "0x9c6cc5cccfe2a3dc447bce25f88cb28ce142459057e6c04b59911b6d3f10930a",
"ix_operations": [
{
"type": 4,
"payload": {
"symbol": "RMOI",
"dimension": "0x0",
"standard": "0x0",
"supply": "0x5F5E100"
}
}
]
}
]
}

AssetMint

This type of operation is used to mint additional supply from the already existing total supply of an asset. It returns the interaction hash which can be used to retrieve the receipt.

ParametersTypeDescription
fuel_priceHEXFuel price for the interaction
fuel_limitHEXFuel limit for the interaction
senderHEX (32 Bytes)Sender address
nonceHEXNonce for the interaction
ix_operationsArrayList containing asset mint operation.

AssetMintOperation

ParameterTypeDescription
typeNUMBERType of interaction (7 for AssetMint)
payloadAssetMintPayloadContains the information about the asset to be minted

AssetMintPayload

ParametersTypeDescription
asset_idAssetIDID of the asset to be minted
amountHEXsupply of the asset to be minted

AssetMintResult

ParametersTypeDescription
total_supplyHEXsupply of the asset after minting

Returns:

TypeDescription
HEX (32 Bytes)Interaction hash of the AssetMint
{
"params": [
{
"fuel_price": "0x1",
"fuel_limit": "0xc8",
"sender": "0x9c6cc5cccfe2a3dc447bce25f88cb28ce142459057e6c04b59911b6d3f10930a",
"nonce": "0x1",
"ix_operations": [
{
"type": 7,
"payload": {
"asset_id": "0x00000000778549058becea5d34d6554ace488a9f63707c38f39e3d24b42f43453f3d83b9",
"amount": "0x4c4b40"
}
}
]
}
]
}

AssetBurn

This type of operation is used to burn a certain amount of supply of an asset on the network. It returns the interaction hash which can be used to retrieve the receipt.

ParametersTypeDescription
fuel_priceHEXFuel price for the interaction
fuel_limitHEXFuel limit for the interaction
senderHEX (32 Bytes)Sender address
nonceHEXNonce for the interaction
ix_operationsArrayList containing asset burn operation.

AssetBurnOperation

ParameterTypeDescription
typeNUMBERType of interaction (8 for AssetBurn)
payloadAssetBurnPayloadContains the information about the asset to be burned

AssetBurnPayload

ParametersTypeDescription
asset_idAssetIDID of the asset to be burned
amountHEXsupply of the asset to be burned

AssetBurnResult

ParametersTypeDescription
total_supplyHEXsupply of the asset after burning

Returns:

TypeDescription
HEX (32 Bytes)Interaction hash of the AssetBurn
{
"params": [
{
"fuel_price": "0x1",
"fuel_limit": "0xc8",
"sender": "0x9c6cc5cccfe2a3dc447bce25f88cb28ce142459057e6c04b59911b6d3f10930a",
"nonce": "0x1",
"ix_operations": [
{
"type": 8,
"payload": {
"asset_id": "0x00000000778549058becea5d34d6554ace488a9f63707c38f39e3d24b42f43453f3d83b9",
"amount": "0x4c4b40"
}
}
]
}
]
}

LogicDeploy

The type of operation allows users to deploy a new logic on the network. It returns the interaction hash which can be used to retrieve the receipt.

Parameters:

ParameterTypeDescription
senderHEX (32 Bytes)Sender address
fuel_priceHEXFuel price for the deployment
fuel_limitHEXFuel limit for the deployment
nonceHEXNonce for the interaction
ix_operationsArrayList containing logic deploy operation.

LogicDeployOperation

ParameterTypeDescription
typeNUMBERType of interaction (9 for LogicDeploy)
payloadLogicDeployPayloadContains the information about the logic to be deployed

LogicDeployPayload

ParametersTypeDescription
manifestHEXserialized manifest
callsiteSTRINGroutine to be executed
calldataHEXserialized input for logic deploy

LogicDeployResult

ParametersTypeDescription
logic_idLogicIDLogic ID of deployed Logic
errorHEXserialised error data if deployer execution fails

Returns:

TypeDescription
HEX (32 Bytes)Interaction hash of the LogicDeploy
{
"params": [
{
"fuel_price": "0x130D41",
"fuel_limit": "0x130D41",
"sender": "0x9c6cc5cccfe2a3dc447bce25f88cb28ce142459057e6c04b59911b6d3f10930a",
"nonce": "0x1",
"ix_operations": [
{
"type": 9,
"payload": {
"manifest": "0x7b2273796e746178223a22302e312e30222c22656e67696e65223a7b226b696e64223a2250495341222c22666c616773223a5b5d7d2c22656c656d656e7473223a5b7b22707472223a302c2264657073223a6e756c6c2c226b696e64223a227374617465222c2264617461223a7b226b696e64223a2270657273697374656e74222c226669656c6473223a5b7b22736c6f74223a302c226c6162656c223a226e616d65222c2274797065223a22737472696e67227d2c7b22736c6f74223a312c226c6162656c223a2273796d626f6c222c2274797065223a22737472696e67227d2c7b22736c6f74223a322c226c6162656c223a22737570706c79222c2274797065223a22753634227d2c7b22736c6f74223a332c226c6162656c223a2262616c616e636573222c2274797065223a226d61705b616464726573735d753634227d2c7b22736c6f74223a342c226c6162656c223a22616c6c6f77616e636573222c2274797065223a226d61705b616464726573735d6d61705b616464726573735d753634227d5d7d7d2c7b22707472223a312c2264657073223a5b305d2c226b696e64223a22726f7574696e65222c2264617461223a7b226e616d65223a2253656564657221222c226b696e64223a226465706c6f796572222c2261636365707473223a5b7b22736c6f74223a302c226c6162656c223a226e616d65222c2274797065223a22737472696e67227d2c7b22736c6f74223a312c226c6162656c223a2273796d626f6c222c2274797065223a22737472696e67227d2c7b22736c6f74223a322c226c6162656c223a22737570706c79222c2274797065223a22753634227d2c7b22736c6f74223a332c226c6162656c223a22736565646572222c2274797065223a2261646472657373227d5d2c2272657475726e73223a6e756c6c2c226578656375746573223a7b2262696e223a5b342c302c302c3132392c302c302c342c302c312c3132392c302c312c342c302c322c3132392c302c322c3132382c312c332c342c322c332c38342c312c322c302c3132392c312c335d2c22686578223a22222c2261736d223a6e756c6c7d2c2263617463686573223a6e756c6c7d7d2c7b22707472223a322c2264657073223a6e756c6c2c226b696e64223a22636f6e7374616e74222c2264617461223a7b2274797065223a22753634222c2276616c7565223a22307830333061227d7d2c7b22707472223a332c2264657073223a6e756c6c2c226b696e64223a2274797065646566222c2264617461223a226d61705b616464726573735d753634227d2c7b22707472223a342c2264657073223a5b305d2c226b696e64223a22726f7574696e65222c2264617461223a7b226e616d65223a224e616d65222c226b696e64223a22696e766f6b61626c65222c2261636365707473223a6e756c6c2c2272657475726e73223a5b7b22736c6f74223a302c226c6162656c223a226e616d65222c2274797065223a22737472696e67227d5d2c226578656375746573223a7b2262696e223a5b3132382c302c302c352c302c305d2c22686578223a22222c2261736d223a6e756c6c7d2c2263617463686573223a6e756c6c7d7d2c7b22707472223a352c2264657073223a5b305d2c226b696e64223a22726f7574696e65222c2264617461223a7b226e616d65223a2253796d626f6c222c226b696e64223a22696e766f6b61626c65222c2261636365707473223a6e756c6c2c2272657475726e73223a5b7b22736c6f74223a302c226c6162656c223a2273796d626f6c222c2274797065223a22737472696e67227d5d2c226578656375746573223a7b2262696e223a5b3132382c302c312c352c302c305d2c22686578223a22222c2261736d223a6e756c6c7d2c2263617463686573223a6e756c6c7d7d2c7b22707472223a362c2264657073223a5b305d2c226b696e64223a22726f7574696e65222c2264617461223a7b226e616d65223a22446563696d616c73222c226b696e64223a22696e766f6b61626c65222c2261636365707473223a6e756c6c2c2272657475726e73223a5b7b22736c6f74223a302c226c6162656c223a22646563696d616c73222c2274797065223a22753634227d5d2c226578656375746573223a7b2262696e223a5b31372c302c322c31362c302c302c352c302c305d2c22686578223a22222c2261736d223a6e756c6c7d2c2263617463686573223a6e756c6c7d7d2c7b22707472223a372c2264657073223a5b305d2c226b696e64223a22726f7574696e65222c2264617461223a7b226e616d65223a22546f74616c537570706c79222c226b696e64223a22696e766f6b61626c65222c2261636365707473223a6e756c6c2c2272657475726e73223a5b7b22736c6f74223a302c226c6162656c223a22737570706c79222c2274797065223a22753634227d5d2c226578656375746573223a7b2262696e223a5b3132382c302c322c352c302c305d2c22686578223a22222c2261736d223a6e756c6c7d2c2263617463686573223a6e756c6c7d7d2c7b22707472223a382c2264657073223a5b305d2c226b696e64223a22726f7574696e65222c2264617461223a7b226e616d65223a2242616c616e63654f66222c226b696e64223a22696e766f6b61626c65222c2261636365707473223a5b7b22736c6f74223a302c226c6162656c223a2261646472222c2274797065223a2261646472657373227d5d2c2272657475726e73223a5b7b22736c6f74223a302c226c6162656c223a2262616c616e6365222c2274797065223a22753634227d5d2c226578656375746573223a7b2262696e223a5b3132382c302c332c342c312c302c38332c322c302c312c352c322c305d2c22686578223a22222c2261736d223a6e756c6c7d2c2263617463686573223a6e756c6c7d7d2c7b22707472223a392c2264657073223a5b305d2c226b696e64223a22726f7574696e65222c2264617461223a7b226e616d65223a22416c6c6f77616e6365222c226b696e64223a22696e766f6b61626c65222c2261636365707473223a5b7b22736c6f74223a302c226c6162656c223a226f776e6572222c2274797065223a2261646472657373227d2c7b22736c6f74223a312c226c6162656c223a227370656e646572222c2274797065223a2261646472657373227d5d2c2272657475726e73223a5b7b22736c6f74223a302c226c6162656c223a22616c6c6f77616e6365222c2274797065223a22753634227d5d2c226578656375746573223a7b2262696e223a5b3132382c302c342c342c312c302c38332c322c302c312c342c332c312c38332c342c322c332c352c342c305d2c22686578223a22222c2261736d223a6e756c6c7d2c2263617463686573223a6e756c6c7d7d2c7b22707472223a31302c2264657073223a5b302c335d2c226b696e64223a22726f7574696e65222c2264617461223a7b226e616d65223a22417070726f766521222c226b696e64223a22696e766f6b61626c65222c2261636365707473223a5b7b22736c6f74223a302c226c6162656c223a226f776e6572222c2274797065223a2261646472657373227d2c7b22736c6f74223a312c226c6162656c223a227370656e646572222c2274797065223a2261646472657373227d2c7b22736c6f74223a322c226c6162656c223a22616d6f756e74222c2274797065223a22753634227d5d2c2272657475726e73223a5b7b22736c6f74223a302c226c6162656c223a226f6b222c2274797065223a22626f6f6c227d5d2c226578656375746573223a7b2262696e223a5b3132382c302c342c342c312c302c38332c322c302c312c33322c332c322c39382c332c332c31372c342c31302c332c342c332c31372c342c302c34302c342c342c33362c322c342c312c342c332c312c342c342c322c38342c322c332c342c38342c302c312c322c3132392c302c342c34312c302c312c39382c302c302c352c302c305d2c22686578223a22222c2261736d223a6e756c6c7d2c2263617463686573223a6e756c6c7d7d2c7b22707472223a31312c2264657073223a5b305d2c226b696e64223a22726f7574696e65222c2264617461223a7b226e616d65223a225472616e7366657221222c226b696e64223a22696e766f6b61626c65222c2261636365707473223a5b7b22736c6f74223a302c226c6162656c223a2266726f6d222c2274797065223a2261646472657373227d2c7b22736c6f74223a312c226c6162656c223a22746f222c2274797065223a2261646472657373227d2c7b22736c6f74223a322c226c6162656c223a22616d6f756e74222c2274797065223a22753634227d5d2c2272657475726e73223a5b7b22736c6f74223a302c226c6162656c223a226f6b222c2274797065223a22626f6f6c227d5d2c226578656375746573223a7b2262696e223a5b3132382c302c332c342c312c302c38332c322c302c312c342c332c322c36382c342c332c322c31372c352c31302c332c352c342c34312c302c312c352c302c302c302c312c3130322c342c322c332c38342c302c312c342c342c352c312c38332c342c302c352c3130312c362c342c332c38342c302c352c362c3132392c302c332c34312c302c312c39382c302c302c352c302c305d2c22686578223a22222c2261736d223a6e756c6c7d2c2263617463686573223a6e756c6c7d7d2c7b22707472223a31322c2264657073223a5b305d2c226b696e64223a22726f7574696e65222c2264617461223a7b226e616d65223a224d696e7421222c226b696e64223a22696e766f6b61626c65222c2261636365707473223a5b7b22736c6f74223a302c226c6162656c223a22616d6f756e74222c2274797065223a22753634227d2c7b22736c6f74223a312c226c6162656c223a2261646472222c2274797065223a2261646472657373227d5d2c2272657475726e73223a5b7b22736c6f74223a302c226c6162656c223a226f6b222c2274797065223a22626f6f6c227d5d2c226578656375746573223a7b2262696e223a5b3132382c302c322c342c312c302c3130312c302c302c312c3132392c302c322c3132382c302c332c342c322c312c38332c332c302c322c3130312c332c332c312c38342c302c322c332c3132392c302c332c34312c302c312c39382c302c302c352c302c305d2c22686578223a22222c2261736d223a6e756c6c7d2c2263617463686573223a6e756c6c7d7d2c7b22707472223a31332c2264657073223a5b305d2c226b696e64223a22726f7574696e65222c2264617461223a7b226e616d65223a224275726e21222c226b696e64223a22696e766f6b61626c65222c2261636365707473223a5b7b22736c6f74223a302c226c6162656c223a22616d6f756e74222c2274797065223a22753634227d2c7b22736c6f74223a312c226c6162656c223a2261646472222c2274797065223a2261646472657373227d5d2c2272657475726e73223a5b7b22736c6f74223a302c226c6162656c223a226f6b222c2274797065223a22626f6f6c227d5d2c226578656375746573223a7b2262696e223a5b3132382c302c332c342c312c312c38332c322c302c312c342c332c302c36382c342c332c322c31372c352c31302c332c352c342c34312c302c312c352c302c302c302c312c3130322c342c322c332c38342c302c312c342c3132392c302c332c3132382c302c322c3130322c302c302c332c3132392c302c322c34312c302c312c39382c302c302c352c302c305d2c22686578223a22222c2261736d223a6e756c6c7d2c2263617463686573223a6e756c6c7d7d5d7d",
"callsite": "Seeder!",
"calldata": "0x0def0106458601e501f605d506a60785086e616d65064d4f497365656465720652fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649737570706c790301312d0073796d626f6c064d4f49"
}
}
]
}
]
}

LogicInvoke

The type of operation is responsible for invoking a specific routine within a deployed logic. This returns the interaction hash, which can be used to retrieve the receipt.

Parameters:

ParameterTypeDescription
senderHEX (32 Bytes)Sender address
fuel_priceHEXFuel price
fuel_limitHEXFuel limit
nonceHEXNonce for the interaction
ix_operationsArrayList containing logic invoke operation.

LogicInvokeOperation

ParameterTypeDescription
typeNUMBERType of interaction (10 for LogicInvoke)
payloadLogicInvokePayloadContains the information about the specific routine to be invoked

LogicInvokePayload

ParametersTypeDescription
logic_idLogicIDThe unique identifier of the logic for that needs to be invoked.
callsiteSTRINGroutine to be executed
calldataHEXserialised input for logic execution

LogicInvokeResult

ParametersTypeDescription
outputsHEXserialised output of logic execution
errorHEXserialised error data if logic execution failed

Returns:

TypeDescription
HEX (32 Bytes)Interaction hash of the LogicInvoke
{
"params": [
{
"fuel_price": "0x130D41",
"fuel_limit": "0x130D41",
"sender": "0x9c6cc5cccfe2a3dc447bce25f88cb28ce142459057e6c04b59911b6d3f10930a",
"nonce": "0x1",
"ix_operations": [
{
"type": 10,
"payload": {
"logic_id": "0x0800008d898ef91ebd8a208855d6d1c98939202cfcb6a067530845993fe6975de1eb84",
"callsite": "BalanceOf",
"calldata": "0x0d2f0645616464720652fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"
}
}
]
}
]
}

LogicEnlist

The type of operation is responsible for enlisting a specific participant for a deployed logic. This returns the interaction hash, which can be used to retrieve the receipt.

Parameters:

ParameterTypeDescription
senderHEX (32 Bytes)Sender address
fuel_priceHEXFuel price
fuel_limitHEXFuel limit
nonceHEXNonce for the interaction
ix_operationsArrayList containing logic enlist operation.

LogicEnlistOperation

ParameterTypeDescription
typeNUMBERType of interaction (10 for LogicInvoke)
payloadLogicEnlistPayloadContains the information about the specific routine to be enlisted

LogicEnlistPayload

ParametersTypeDescription
logic_idLogicIDThe unique identifier of the logic for that needs to be invoked.
callsiteSTRINGroutine to be executed
calldataHEXserialised input for logic execution

LogicInvokeResult

ParametersTypeDescription
outputsHEXserialised output of logic execution
errorHEXserialised error data if logic execution failed

Returns:

TypeDescription
HEX (32 Bytes)Interaction hash of the LogicEnlist
{
"params": [
{
"fuel_price": "0x130D41",
"fuel_limit": "0x130D41",
"sender": "0x9c6cc5cccfe2a3dc447bce25f88cb28ce142459057e6c04b59911b6d3f10930a",
"nonce": "0x1",
"ix_operations": [
{
"type": 11,
"payload": {
"logic_id": "0x0800008d898ef91ebd8a208855d6d1c98939202cfcb6a067530845993fe6975de1eb84",
"callsite": "Register"
}
}
]
}
]
}

MOI Core APIs

moi.Call

The moi.Call method enables users to perform a stateless simulation of submitting an interaction. This means that it executes the interaction without permanently recording it on the blockchain. It operates similarly to moi.SendInteractions, but with the key difference that the user is not required to sign the interaction.

Parameters:

ParameterTypeDescription
typeNUMBERType of interaction
senderHEX (32 Bytes)Sender address.
ix_operationsARRAYList of operations, each containing operation type and payload fields.
optionsMAP [ [Address] -> TesseractOptions ]Options for querying the tesseract.

Returns:

ReturnTypeDescription
ix_hashHEX (32 Bytes)The interaction hash.
ts_hashHEX (32 Bytes)The tesseract hash.
fromHEX (32 Bytes)The address of the sender who sent the interaction.
statusNUMBERThe status of the interaction.
fuel_usedHEXThe amount of fuel used by this specific interaction alone.
ix_operationsARRAYThe list of operation containing type, status and output
 curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.Call",
"params": [
"ix_args": {
"sender": "0x45b9906e65c9bdf4703918aa2c78fe139ba8e32c5e0dcda585dac4c584651f08",
"ix_operations": [
{
"type": 6,
"payload": "0x0e3f068309303030303030303062396139643631383836376265633039326462373163303663333638613664376637386463303163663336663836613335393931666565313133303363336439c350"
},
{
"type": 7,
"payload": "0x0e3f0683093030303030303030623961396436313838363762656330393264623731633036633336386136643766373864633031636633366638366133353939316665653131333033633364391388"
},
{
"type": 1,
"payload": "0x0e7f068604860883117634b2eab0905f319a82616ccdffc89850a54a669f34672e9f35284fc26973da7634b2eab0905f319a82616ccdffc89850a54a669f34672e9f35284fc26973da30303030303030306239613964363138383637626563303932646237316330366333363861366437663738646330316366333666383661333539393166656531313330336333643901f4"
}
]
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.SendInteractions

The moi.SendInteractions method is employed to send an interaction to the network. This involves the ix_args field, which holds the encoded interaction object, and the signature field, which represents the user's signature of the interaction using their private key.

In simple terms, it's a way for the user to securely transmit and validate interactions on the blockchain.

{
"ix_args": "0ebf0206860483089308a308c008ce08fe30b044b04445b9906e65c9bdf4703918aa2c78fe139ba8e32c5e0dcda585dac4c584651f080000000000000000000000000000000000000000000000000000000000000000010101f45f0ebe0aee142f0316060e3f068309303030303030303062396139643631383836376265633039326462373163303663333638613664376637386463303163663336663836613335393931666565313133303363336439c3502f0316070e3f06830930303030303030306239613964363138383637626563303932646237316330366333363861366437663738646330316366333666383661333539393166656531313330336333643913882f0316010e7f068604860883117634b2eab0905f319a82616ccdffc89850a54a669f34672e9f35284fc26973da7634b2eab0905f319a82616ccdffc89850a54a669f34672e9f35284fc26973da30303030303030306239613964363138383637626563303932646237316330366333363861366437663738646330316366333666383661333539393166656531313330336333643901f47f0ede04ae09fe0d3f06830445b9906e65c9bdf4703918aa2c78fe139ba8e32c5e0dcda585dac4c584651f08013f068304b9a9d618867bec092db71c06c368a6d7f78dc01cf36f86a35991fee11303c3d9013f068304b9a9d618867bec092db71c06c368a6d7f78dc01cf36f86a35991fee11303c3d9013f0683047634b2eab0905f319a82616ccdffc89850a54a669f34672e9f35284fc26973da01",
"signature": "01463044022079233fc7de9c6f6b67d133771748692b655292668e8c94c497c14690d313d36102201f45d4a455d406ef708b61dfade04fc088dbae26fd9982d41ffa8259c96ae63a03"
}

moi.Tesseract

This method retrieves the tesseract by the provided options. The tesseract details can be fetched by either providing the address along with the tesseract number or by providing the tesseract hash alone.

Parameters:

ParameterTypeDescription
addressHEX (32 Bytes)The address of the sender requesting the tesseract.
with_interactionsBOOLEANIf true, it returns the interactions list as part of the tesseract.
optionsTesseractOptionsOptions for querying the tesseract.

Returns:

ReturnTypeDescription
participantsARRAYAn array of participants involved in the interaction and their details.
interactions_hashHEX (32 Bytes)The hash of all the interactions in the tesseract.
receipts_hashHEX (32 Bytes)The hash of all the receipts.
hashHEX (32 Bytes)The hash of the tesseract.
sealHEXThe signature of node which executed the tesseract.
epochHEXEpoch denotes the fixed time slot.
time_stampHEXThe ICS request time.
operatorSTRINGThe krama ID of the operator node.
consensus_infoOBJECTAn object containing consensus related information.
fuel_usedHEXThe amount of fuel used until the tesseract formation.
fuel_limitHEXFuel limit.
ixnsARRAYIf with_interactions is set to true, an array of interactions is returned.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.Tesseract",
"params": [
{
"address": "0x45b9906e65c9bdf4703918aa2c78fe139ba8e32c5e0dcda585dac4c584651f08",
"with_interactions": true,
"options": {
"tesseract_number": -1
}
}
],
"jsonrpc": "2.0",
"id": 1
}'
  curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.Tesseract",
"params": [
{
"with_interactions": true,
"options": {
"tesseract_hash": "0x4f9991aabeb642ef4b45033038e9be2cd864c6b6ac8666d3b66818a7d76b50cc"
}
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.InteractionByTesseract

This method allows users to retrieve an interaction based on a given tesseract hash and interaction index. If the interaction index is not found, the function will throw an error.

Parameters:

ParameterTypeDescription
addressHEX (32 Bytes)The address of the sender.
optionsTesseractOptionsOptions for querying the tesseract.
ix_indexHEXRepresents the index of the interaction within the tesseract.

Returns:

ReturnTypeDescription
nonceHEXThe nonce of the tesseract.
senderHEX (32 Bytes)Sender address.
payerHEX (32 Bytes)Payer address.
fuel_priceHEXThe fuel price for the interaction.
fuel_limitHEXThe fuel limit of the interaction.
operationsHEXThe list of operations.
hashHEX (32 Bytes)The hash of the interaction.
ts_hashHEX (32 Bytes)The hash of the tesseract.
signatureARRAYAn array of signature bytes associated with the interaction.
participantsARRAYAn array of participants involved in the interaction and their details.
ix_indexHEXAn integer representing the interaction index in the tesseract.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.InteractionByTesseract",
"params": [
{
"address": "0x45b9906e65c9bdf4703918aa2c78fe139ba8e32c5e0dcda585dac4c584651f08",
"options": {
"tesseract_number": -1
},
"ix_index": "0x0"
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.InteractionByHash

This method retrieves the interaction details for a given interaction hash.

Parameters:

ParameterTypeDescription
hashHEX (32 Bytes)Interaction hash for which you want to fetch interaction details.

Returns:

ReturnTypeDescription
typeNUMBERType of the interaction.
nonceHEXThe nonce of the tesseract.
senderHEX (32 Bytes)Sender address.
fuel_priceHEXThe fuel price for the interaction.
fuel_limitHEXThe fuel limit of the interaction.
operationsHEXThe list of operations.
hashHEX (32 Bytes)The hash of the interaction.
ts_hashHEX (32 Bytes)The hash of the tesseract.
signatureARRAYAn array of signature bytes associated with the interaction.
participantsARRAYAn array of participants involved in the interaction and their details.
ix_indexHEXAn integer representing the interaction index in the tesseract.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.InteractionByHash",
"params": [
{
"hash": "0xf4220d4caa3cfa0ee9ded4d01e43bc2890ab9152a789955fae4a45707f90fa0b"
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.InteractionReceipt

This method retrieves the receipt of a specific interaction in the system. The interaction is identified by its unique hash. The receipt provides detailed information about the interaction.

Parameters:

ParameterTypeDescription
hashHEX (32 Bytes)The unique hash that identifies the interaction.

Returns:

ReturnTypeDescription
ix_typeHEXThe type of the interaction in hex.
ix_hashHEX (32 Bytes)The unique hash of the interaction.
statusNUMBERThe status of the interaction.
fuel_usedHEXThe amount of fuel used by this specific interaction alone.
fromHEX (32 Bytes)The address of the sender.
ts_hashHEX (32 Bytes)The hash of the tesseract.
ix_indexHEXThe integer representing the interaction index in the tesseract.
participantsARRAYAn array of participants involved in the interaction and their details.
operationsARRAYA list of operations
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.InteractionReceipt",
"params": [
{
"hash": "0xc63135e38e9edfd68107f8efccbedcc4c8141984b383b941fe42070b867f2a85"
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.InteractionCount

This method helps to fetch the total number of interactions performed by a particular account.

Parameters:

ParameterTypeDescription
addressHEX (32 Bytes)The address of the account for which the total interaction count is queried.
optionsTesseractOptionsOptions for querying the tesseract.

Returns:

Return TypeDescription
HEXThe total number of interactions that have been made by the queried account.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.InteractionCount",
"params": [
{
"address": "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649",
"options": {
"tesseract_number": -1
}
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.PendingInteractionCount

This method provides the total number of interactions for a given address, inclusive of both the completed and pending interactions in IxPool.

Parameters:

NameTypeDescription
addressHEX (32 Bytes)The address of the account for which the total number interaction count is queried.

Returns:

Returns TypeDescription
HEXThe total number of interactions made by the queried account, including the pending interactions in IxPool.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.PendingInteractionCount",
"params": [
{
"address": "0x81855ad8681d0d86d1e91e00167939cb6694d2c422acd208a0072939487f6999"
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.AccountMetaInfo

This method provides metadata information about a specific account based on the provided account's address.

Parameters:

ParameterTypeDescription
addressHEX (32 Bytes)The account address for which metadata information is to be retrieved.

Returns:

Return TypeDescription
OBJECTThe object contains meta information about the queried account.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.AccountMetaInfo",
"params": [
{
"address": "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649",
"options": {
"tesseract_number": -1
}
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.AccountState

This method returns the account for a provided address.

Parameters:

ParameterTypeDescription
addressHEX (32 Bytes)The address of the sender whose account state is to be retrieved.
optionsTesseractOptionsOptions for querying the tesseract.

Returns:

Return TypeDescription
OBJECTThe object contains detailed information about the queried account.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.AccountState",
"params": [
{
"address": "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649",
"options": {
"tesseract_number": -1
}
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.ContextInfo

This method provides information the context information that is associated with the provided address. It includes the krama id's of the behaviour nodes, random nodes, and storage nodes that are part of this interaction.

Parameters:

ParameterTypeDescription
addressHEX (32 Bytes)The address of the sender.
optionsTesseractOptionsOptions for querying the tesseract.

Returns:

ReturnsTypeDescription
behaviour_nodesARRAYA list of the krama id's of behaviour nodes that are part of the latest interaction.
random_nodesARRAYA list of the krama id's of random nodes that are part of the latest interaction.
storage_nodesARRAYA list of the krama id's of storage nodes that are part of the latest interaction.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.ContextInfo",
"params": [
{
"address": "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649",
"options": {
"tesseract_number": -1
}
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.TDU

This method is used to retrieve the Total Digital Utility (TDU) of a specific address. It is a method to get a list of all asset IDs associated with a given address and their total supply.

Parameters:

ParameterTypeDescription
addressHEX (32 Bytes)the address of the sender for which TDU is required.
optionsTesseractOptionsOptions for querying the tesseract.

Returns:

Return TypeDescription
ARRAYA list of asset IDs and their respective total supply.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.TDU",
"params": [
{
"address": "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649",
"options": {
"tesseract_number": -1
}
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.Balance

This method is used to retrieve the current balance of a specified asset associated with a given account.

Parameters:

ParameterTypeDescription
addressHEX (32 Bytes)The address for which the balance needs to be retrieved.
asset_idAssetIDThe ID of the asset for which the balance is to be retrieved.
optionsTesseractOptionsOptions for querying the tesseract.

Returns:

Return TypeDescription
NUMBERAn integer representing the current balance of the queried asset.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.Balance",
"params": [
{
"address": "0x81855ad8681d0d86d1e91e00167939cb6694d2c422acd208a0072939487f6999",
"asset_id": "0000ed517b0e68a54bf19fa0a1f88130a0503b18b258f7f7042e03f1518e4ab015bc",
"options": {
"tesseract_number": -1
}
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.Registry

This method is used to obtain a list of registries that store asset IDs and their corresponding asset descriptions.

Parameters:

ParameterTypeDescription
addressHEX (32 Bytes)The address for which the registries need to be retrieved.
optionsTesseractOptionsOptions for querying the tesseract.

Returns:

Return TypeDescription
ARRAYA list of registries that store asset IDs and their corresponding asset descriptions.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.Registry",
"params": [
{
"address": "0x81855ad8681d0d86d1e91e00167939cb6694d2c422acd208a0072939487f6999",
"options": {
"tesseract_number": -1
}
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.Syncing

This method returns the sync status of an account if address is given else returns the node sync status. If the pending accounts variable is set to true, it returns the node sync status with a list of accounts awaiting synchronization.

Parameters:

ParameterTypeDescription
addressHEX (32 Bytes)The address of the account for which the sync status is to be determined
pending_accountsBOOLEANIf true, it provides a list of accounts awaiting synchronization as part of the node sync status.

Returns:

ReturnTypeDescription
account_sync_statusOBJECTThe sync status of the account for which address is given
node_sync_statusOBJECTThe sync status of the node
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.Syncing",
"params": [
{
"address": "0xa6ba9853f131679d00da0f033516a2efe9cd53c3d54e1f9a6e60e9077e9f9384"
}
],
"jsonrpc": "2.0",
"id": 1
}'
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.Syncing",
"params": [
{
"pending_accounts": true
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.FuelEstimate

This method returns an estimate of the fuel that is required for executing an interaction.

Parameters:

ParameterTypeDescription
typeNUMBERType of interaction (1 for AssetTransfer)
senderHEX (32 Bytes)Sender's address
receiverHEX (32 Bytes)Receiver's address
transfer_valuesMAP [ AssetID -> HEX ]ID of the asset and the hex value of the amount intended for transfer
fuel_priceHEXFuel price for the interaction (optional)
fuel_limitHEXFuel limit for the interaction (optional)
payloadHEXDepending on interaction type (refer here)
optionsMAP [ [Address] -> TesseractOptions ]Options for querying the tesseract.

Returns:

Return TypeDescription
fuel_usedAn estimate of the amount of fuel used by this specific interaction alone.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.FuelEstimate",
"params": [
{
"ix_args": {
"sender": "0x45b9906e65c9bdf4703918aa2c78fe139ba8e32c5e0dcda585dac4c584651f08",
"ix_operations": [
{
"type": 6,
"payload": "0x0e3f068309303030303030303062396139643631383836376265633039326462373163303663333638613664376637386463303163663336663836613335393931666565313133303363336439c350"
},
{
"type": 7,
"payload": "0x0e3f0683093030303030303030623961396436313838363762656330393264623731633036633336386136643766373864633031636633366638366133353939316665653131333033633364391388"
},
{
"type": 1,
"payload": "0x0e7f068604860883117634b2eab0905f319a82616ccdffc89850a54a669f34672e9f35284fc26973da7634b2eab0905f319a82616ccdffc89850a54a669f34672e9f35284fc26973da30303030303030306239613964363138383637626563303932646237316330366333363861366437663738646330316366333666383661333539393166656531313330336333643901f4"
}
]
}
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.AssetInfoByAssetID

This method provides detailed information about a specific asset identified by the provided asset ID.

Parameters:

ParameterTypeDescription
asset_idAssetIDThe asset ID for which the information is to be retrieved.
optionsTesseractOptionsOptions for querying the tesseract.

Returns:

ReturnTypeDescription
symbolSTRINGThe symbolic representation of the asset.
operatorHEX (32 Bytes)The address of the operator of the asset.
supplyHEXThe total supply of the asset.
dimensionHEXThe dimensions of the asset.
standardHEXIndicates the asset standard.
is_logicalBOOLEANIndicates whether the asset is logical or not.
is_statefulBOOLEANIndicates whether the asset is stateful or not.
logic_idLogicIDThe logic id associated with the asset.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.AssetInfoByAssetID",
"params": [
{
"asset_id":"0x000000009d8810a510ec135b73848a9de05ed747fbbeedfbf689583f59e50dca0089b7c4",
"options":{
"tesseract_number":-1
}
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.LogicIDs

This method is used to retrieve a list of all the logic IDs associated with a specific logic address.

Parameters:

ParameterTypeDescription
addressHEX (32 Bytes)The address of the sender for which the logic IDs are required.
optionsTesseractOptionsOptions for querying the tesseract.

Returns:

Return TypeDescription
ARRAYA list of logic IDs.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.LogicIDs",
"params": [
{
"address": "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649",
"options": {
"tesseract_number": -1
}
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.LogicManifest

This method retrieves the manifest associated with a specific logicID.

Parameters:

ParameterTypeDescription
logic_idLogicIDThe unique identifier of the logic for which the manifest is to be returned.
encodingSTRINGSpecifies the encoding type of the manifest. It should be JSON, POLO, or YAML.
optionsTesseractOptionsOptions for querying the tesseract.

Returns:

Return TypeDescription
HEXContains the manifest associated with the given logic ID, encoded in the requested format.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.LogicManifest",
"params": [
{
"logic_id": "0800009259ee349d92e578e7ae0150d8f8ffa1aa73535baecf3ae18c3e7ea8e305b3f5",
"encoding": "JSON",
"options": {
"tesseract_number": -1
}
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.LogicStorage

This method is used to retrieve the data associated with a particular storage slot and Logic ID. This can be useful when you want to inspect or read the data that is stored in a specific slot of a logic entity.

Parameters:

ParameterTypeDescription
logic_idLogicIDThe id of the logic whose associated data is to be accessed.
storage-keyStorageKeyThe key of the storage slot hash whose data is to be accessed. It's represented as hexadecimal of 32 bytes long.
optionsTesseractOptionsOptions for querying the tesseract.

Returns:

Return TypeDescription
HEXThe data associated with the given logic id and storage slot within the tesseract.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.LogicStorage",
"params": [
{
"logic_id": "0800009259ee349d92e578e7ae0150d8f8ffa1aa73535baecf3ae18c3e7ea8e305b3f5",
"storage_key": "03170a2e7597b7b7e3d84c05391d139a62b157e78786d8c082f29dcf4c111314",
"options": {
"tesseract_number": -1
}
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.GetLogs

This method is used to get all the tesseract logs for an account within a given tesseract range.

Note: Difference between start height and end height should be less than or equal to 10 tesseracts

Parameters:

ParameterTypeDescription
addressHEX (32 Bytes)The account address for which you are requesting logs
start_heightINTEGERThe start height of the tesseract
end_heightINTEGERThe end height of the tesseract
topicsARRAYAn array of topic hashes in order
Type of topic queries:
ParameterDescription
[] or nilmatches any topic list
[[A]]matches topic A in first position
[[], [B]]matches any topic in first position AND B in second position
[[A], [B]]matches topic A in first position AND B in second position
[[A], [B]], [[C], [D]]matches topic (A OR B) in first position AND (C OR D) in second position

Returns:

ReturnTypeDescription
addressHEX (32 Bytes)The address of the sender
logic_idLogicIDThe unique identifier of the logic for which the manifest is to be returned.
topicsARRAYAn array of hashes representing the indexed parameters in an event, where the first topic corresponds to the event signature.
dataARRAYAn array of bytes representing the data in the event.
ix_hashHEX (32 Bytes)The hash of all the interactions in the tesseract.
ts_hashHEX (32 Bytes)The hash of the tesseract.
participantsARRAYAn array of participants involved in the interaction and their details.
  curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.GetLogs",
"params": [
{
"address": "0x5fc0247c18448e91d15542ffb7a0956b6d5f1a19bdd11a36e6a1f7369288f886",
"start_height": 0,
"end_height": 9,
"topics": [
["0x223c39e29dff6467fedda09758d91781c5372e091ff86b3af9e310e386562bef"],
[
"0x91f07c7f1215b122f8ac96a1f841293a2a0796395b4e46d2174b4d16f89de12c",
"0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"
]
]
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.NewTesseractFilter

This method is used to set up a filter to get all new terreracts since filter is set up. The method has a timeout period of 1 minute. Each time we query, the timeout is reset to 1 minute.

Parameters:

This method does not require any parameters.

Returns:

ReturnTypeDescription
idSTRINGThe object containing the Filter ID for NewTesseractFilter
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method":"moi.NewTesseractFilter",
"jsonrpc":"2.0",
"id":1
}'

moi.NewTesseractsByAccountFilter

This method is used to set up a filter to get all new terreracts for the given account since filter is set up. The method has a timeout period of 1 minute. Each time we query, the timeout is reset to 1 minute.

Parameters:

ParameterTypeDescription
addressHEX (32 Bytes)The address of the account you want to get new tesseracts for

Returns:

ReturnTypeDescription
idSTRINGThe object containing the Filter ID for NewTesseractsByAccountFilter
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method":"moi.NewTesseractsByAccountFilter",
"params":[
{
"address":"0x9673f1882112b218e5be9f2e0c8a65ce2b3f35ecd4e056dde4d9084229ddaa4e"
}
],
"jsonrpc":"2.0",
"id":1
}'

moi.NewLogFilter

This method is used to set up a filter to get all new tesseract logs for the given account since filter is set up. The method has a timeout period of 1 minute. Each time we query, the timeout is reset to 1 minute.

Note: Difference between start height and end height should be less than or equal to 10 tesseracts

Parameters:

ParameterTypeDescription
addressHEX (32 Bytes)The account address for which you are requesting logs
start_heightINTEGERThe start height of the tesseract
end_heightINTEGERThe end height of the tesseract
topicsARRAYAn array of topic hashes in order
Type of topic queries:
ParameterDescription
[] or nilmatches any topic list
[[A]]matches topic A in first position
[[], [B]]matches any topic in first position AND B in second position
[[A], [B]]matches topic A in first position AND B in second position
[[A], [B]], [[C], [D]]matches topic (A OR B) in first position AND (C OR D) in second position

Returns:

ReturnTypeDescription
idSTRINGThe object containing the Filter ID for NewLogFilter
  curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "moi.NewLogFilter",
"params": [
{
"address": "0x5fc0247c18448e91d15542ffb7a0956b6d5f1a19bdd11a36e6a1f7369288f886",
"start_height": 0,
"end_height": 2,
"topics": [
["0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b"],
[
"0x000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b",
"0x0000000000000000000000000aff3454fce5edbc8cca8697c15331677e6ebccc"
]
]
}
],
"jsonrpc": "2.0",
"id": 1
}'

moi.PendingIxnsFilter

This method is used to set up a filter to get all new interactions in ixpool since filter is set up. The method has a timeout period of 1 minute. Each time we query, the timeout is reset to 1 minute.

Parameters:

This method does not require any parameters.

Returns:

ReturnTypeDescription
idSTRINGThe object containing the Filter ID for PendingIxnsFilter
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method":"moi.PendingIxnsFilter",
"jsonrpc":"2.0",
"id":1
}'

moi.RemoveFilter

This method is used to remove a filter.

Parameters:

ParameterTypeDescription
idSTRINGThe object containing the Filter ID of the filter you want to remove

Returns:

ReturnTypeDescription
statusBOOLReturns true on successful removal of filter, else false
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method":"moi.RemoveFilter",
"params":[
{
"id": "4155a053-7b74-46ac-98b6-9f440e27e2e5"
}
],
"jsonrpc":"2.0",
"id":1
}'

moi.GetFilterChanges

This method is used to get all filter changes since the last poll. The result varies based on filter.

Parameters:

ParameterTypeDescription
idSTRINGThe object containing the Filter ID of the filter you want changes for

Returns:

ReturnTypeDescription
dataJSONThe object data varies based on filter. Example used: moi.NewTesseractFilter
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method":"moi.GetFilterChanges",
"params":[
{
"id": "4ef7b0b7-6a21-4522-a8d6-78296cc2d028"
}
],
"jsonrpc":"2.0",
"id":1
}'

IxPool APIs

ixpool.ContentFrom

This method is used to fetch detailed information about the interactions that are pending for inclusion in the next Tesseract(s) or are scheduled for future execution. This information is fetched based on the address provided as a parameter.

Parameters:

ParameterTypeDescription
addressHEX (32 Bytes)The address of the sender.

Returns:

ReturnTypeDescription
pendingOBJECTThe object containing details of pending interactions for the given address.
queuedOBJECTThe object containing details of queued interactions for the given address.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "ixpool.ContentFrom",
"params": [
{
"address": "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"
}
],
"jsonrpc": "2.0",
"id": 1
}'

ixpool.WaitTime

This method is used to retrieve the waiting time for an account in ixpool. It's a way to check how long an account has to wait in the queue to get processed.

Parameters:

ParameterTypeDescription
addressHEX (32 Bytes)The address of the account for which the wait time has to be retrieved.

Returns:

ReturnTypeDescription
expiredBOOLEANIndicates whether if it has exceeded the wait time
timeDURATIONThe amount of time the account will have to wait in the queue to get processed (expressed in milliseconds)
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "ixpool.WaitTime",
"params": [
{
"address": "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"
}
],
"jsonrpc": "2.0",
"id": 1
}'

ixpool.Content

This method is used to retrieve a comprehensive list of all interactions that are awaiting inclusion in the upcoming Tesseract(s). It also retrieves all the interactions that are scheduled for execution in the future.

Parameters:

This method does not require any parameters.

Returns:

Return TypeDescription
OBJECTThe object contains a list of all pending and queued interactions
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "ixpool.Content",
"jsonrpc": "2.0",
"id": 1
}'

ixpool.Inspect

This method provides a summary of all the interactions that are currently waiting to be included in the next Tesseract(s), as well as interactions scheduled for future execution. Additionally, it provides a list of all the accounts in the ixpool with their respective wait times. This method is particularly useful for developers, as it can help them quickly review interactions in the pool and identify any potential issues.

Parameters:

This method does not require any parameters.

Returns:

Return TypeDescription
OBJECTThe object contains a simplified, readable list of all interactions that are waiting for inclusion in the next Tesseract and are scheduled for future execution. It also includes a list of accounts with their respective wait times.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "ixpool.Inspect",
"jsonrpc": "2.0",
"id": 1
}'

ixpool.Status

This method provides a summary of all the interactions that are currently pending for inclusion in the next Tesseract(s) and interactions that are scheduled for future execution. This method is particularly useful for developers, as it can help them quickly review interactions and identify any potential issues.

Parameters:

This method does not require any parameters.

Returns:

Return TypeDescription
OBJECTAn object containing the number of pending and queued interactions.
curl --location 'https://voyage-rpc.moi.technology/babylon/ \
--header 'Content-Type: application/json' \
--data '{
"method": "ixpool.Status",
"jsonrpc": "2.0",
"id": 1
}'

Net APIs

net.Peers

This method allows you to retrieve a list of peers in the network. Peers are represented by their unique Krama IDs.

Parameters:

This method doesn't require any parameters.

Returns:

Return TypeDescription
ARRAYA list of Krama IDs, each representing a unique peer in the network.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "net.Peers",
"jsonrpc": "2.0",
"id": 1
}'

net.Version

This method is used to get the version of the software running.

Parameters:

This method does not require any parameters.

Returns:

Return TypeDescription
STRINGThe version of the software running.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "net.Version",
"jsonrpc": "2.0",
"id": 1
}'

net.Info

This method is used to get the Krama ID of the node.

Parameters:

This method does not require any parameters.

Returns:

Return TypeDescription
OBJECTKrama ID of the node.
curl --location 'https://voyage-rpc.moi.technology/babylon/' \
--header 'Content-Type: application/json' \
--data '{
"method": "net.Info",
"jsonrpc": "2.0",
"id": 1
}'

Debug APIs

debug.DBGet

This method is used to retrieve raw value of a particular key stored in the database.

Parameters:

ParameterTypeDescription
storage_keyDBkeyThis is the unique identifier for the stored data you want to retrieve. This is represented as hexadecimal of 65 bytes long.

Returns:

Return TypeDescription
OBJECTThis is the raw value that is stored in the database corresponding to the provided storage key.
curl --location --request POST 'http://localhost:1600/' \
--header 'Content-Type: application/json' \
--data-raw '{
"method": "debug.DBGet",
"params": [
{
"storage_key":"6275636b657400000384a6ba9853f131679d00da0f033516a2efe9cd53c3d54e1f9a6e60e9077e9f9384"
}
],
"jsonrpc": "2.0",
"id": 1
}'

debug.NodeMetaInfo

This method retrieves the metadata for a specific peer based on the provided parameters. If no parameters are provided, it returns metadata for all peers available in the database.

Parameters:

ParameterTypeDescription
peer_idSTRINGThe peer id of the node for which metadata is requested (optional).
krama_idSTRINGThe krama id of the node for which metadata is requested (optional).

Returns:

Return TypeDescription
OBJECTThe object contains node meta info for the specific node or all nodes in the database.
curl --location --request POST 'http://localhost:1600/' \
--header 'Content-Type: application/json' \
--data-raw '{
"method": "debug.NodeMetaInfo",
"params": [{}],
"jsonrpc": "2.0",
"id": 1
}'

debug.Accounts

This method is used to fetch a list of all registered account addresses.

Parameters:

This method does not require any parameters.

Returns:

Return TypeDescription
ARRAYThis contains a list of addresses of all registered accounts.
curl --location 'http://localhost:1600/' \
--header 'Content-Type: application/json' \
--data '{
"method": "debug.Accounts",
"jsonrpc": "2.0",
"id": 1
}'

debug.Connections

This method is used to fetch a list of active connections and connection stats.

Parameters:

This method does not require any parameters.

Returns:

ReturnTypeDescription
connsARRAYAn array of active connections.
inbound_conn_countINTThe number of in-bound connections.
outbound_conn_countINTThe number of out-bound connections.
active_pub_sub_topicsMAP [ [STRING] -> INT ]Active pub-sub topics.
curl --location 'http://localhost:1601/' \
--header 'Content-Type: application/json' \
--data '{
"method": "debug.Connections",
"jsonrpc": "2.0",
"id": 1
}'

debug.Diagnosis

This method initiates a diagnosis process with the provided parameters, collects various diagnostic information for the moipod.

Parameters:

ParameterTypeDescription
output_pathSTRINGThe path where diagnostic information will be stored.
collectorsSTRINGAn array of specific diagnostic data collectors to include in the diagnosis. Options include: goroutines-stack, goroutines-pprof, version, heap, allocs, cpu, mutex, block.
profile_timeSTRINGThe duration for which profiling data should be collected (e.g., "2m" for 2 minutes).
mutex_profile_fractionNUMBERFractional sampling rate for mutex profiling.
block_profile_rateSTRINGThe rate at which block (contention) profiling data should be collected (e.g., "5s" for every 5 seconds).

Returns:

Return TypeDescription
OBJECTAn empty object.
curl --location --request POST 'http://localhost:1600/' \
--header 'Content-Type: application/json' \
--data-raw '{
"method": "debug.Diagnosis",
"params": [
{
"output_path": "/path/go-moi",
"collectors": [],
"profile_time": "2m",
"mutex_profile_fraction": 4,
"block_profile_rate": "5s"
}
],
"jsonrpc": "2.0",
"id": 1
}'

debug.SyncJob

This method returns the sync job meta info for a given address.

Parameters:

ParameterTypeDescription
addressHEX (32 Bytes)The address of the account for which the sync job meta info has to be retrieved.

Returns:

Return TypeDescription
OBJECTThe object contains the sync job meta info for given address
  curl --location 'http://localhost:1600/' \
--header 'Content-Type: application/json' \
--data '{
"method": "debug.SyncJob",
"params": [
{
"address": "0x52fdfc072182654f163f5f0f9a621d729566c74d10037c4d7bbb0407d1e2c649"
}
],
"jsonrpc": "2.0",
"id": 1
}'