Interfacing with the World

Overview

You interact with the EVE Frontier world in two ways:

  • Write path — Submit transactions to Move public functions to mutate on-chain state (create assemblies, bring them online, deposit items, etc.).
  • Read path — Query on-chain state and events via GraphQL, gRPC, or custom indexers.

Writing to the World Contracts

Write operations use the Sui TypeScript SDK to build and submit transactions. The world-contracts ts-scripts provide examples on how to interact with the EVE Frontier world.

Example: Bring Assembly Online

This script borrows OwnerCap from a character, calls the assembly online function, then returns the cap:

import { Transaction } from "@mysten/sui/transactions";

// 1. Borrow OwnerCap from character
const [ownerCap] = tx.moveCall({
  target: `${config.packageId}::character::borrow_owner_cap`,
  typeArguments: [`${config.packageId}::assembly::Assembly`],
  arguments: [tx.object(characterId), tx.object(ownerCapId)],
});

// 2. Bring assembly online
tx.moveCall({
  target: `${config.packageId}::assembly::online`,
  arguments: [
    tx.object(assemblyId),
    tx.object(networkNodeId),
    tx.object(config.energyConfig),
    ownerCap,
  ],
});

// 3. Return OwnerCap to character
tx.moveCall({
  target: `${config.packageId}::character::return_owner_cap`,
  typeArguments: [`${config.packageId}::assembly::Assembly`],
  arguments: [tx.object(characterId), ownerCap],
});

See ts-scripts/assembly/online.ts for the full script.

Example: Sponsored Transactions

Many world operations require server-side validation (e.g., proximity checks). These use sponsored transactions — the player signs the intent, and an authorized sponsor (e.g., EVE Frontier) pays gas and submits:

tx.setSender(playerAddress);
tx.setGasOwner(adminAddress);  // Sponsor pays gas

// ... moveCall to game_item_to_chain_inventory, etc.

const result = await executeSponsoredTransaction(
  tx, client, playerKeypair, adminKeypair,
  playerAddress, adminAddress,
  { showEvents: true }
);

Reading from the World Contracts

SuiClient is the main entry point for read operations in the TypeScript SDK. It connects to a Sui full node and exposes methods for querying objects, events, and transactions.

GraphQL

Use Sui’s GraphQL RPC to query objects by type, owner, or filters.

query GetObjectsByType($type: String!, $first: Int) {
  objects(filter: { type: $type }, first: $first) {
    pageInfo {
      hasNextPage
      endCursor
    }
    nodes {
      address
      asMoveObject {
        contents {
          json
        }
      }
    }
  }
}

Try it: GraphQL Testnet IDE.

gRPC

For higher throughput and streaming (e.g., checkpoints), use gRPC — Sui’s preferred read path. Requires a gRPC-enabled Sui full node.

# List objects owned by an address
grpcurl -d '{ "owner": "<Sui_address>" }' \
  <full_node_url>:443 sui.rpc.v2.StateService/ListOwnedObjects

Events

State changes emit events on transactions. Use suix_queryEvents to filter by module, type, or sender:

curl -X POST https://fullnode.mainnet.sui.io:443 \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "suix_queryEvents",
    "params": [{
      "MoveEventType": "0x...::smartgate::JumpEvent"
    }, null, 10, false]
  }'

World events include JumpEvent (gate traversal), inventory updates, and deployment changes.


References

Tip

Use the menu on the left hand side to find the article you are looking for. You can also use search at the top to search for specific terms.