Skip to content
Agentmart
Submit a tool

mvx-blockchain-data

Read on-chain state in MultiversX smart contracts.

Skill by multiversx

IndexedMIT★ 12
Write a review

Chalk Labs

Need help deploying mvx-blockchain-data?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/multiversx-mvx-blockchain-data

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Read on-chain state in MultiversX smart contracts. Use when accessing caller info, account balances, block timestamps, ESDT token metadata, local roles, code metadata, or any data from self.blockchain().

Use cases: data

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/mvx-blockchain-data

What's inside

Skill name
mvx-blockchain-data
Description
Read on-chain state in MultiversX smart contracts. Use when accessing caller info, account balances, block timestamps, ESDT token metadata, local roles, code metadata, or any data from self.blockchain().
License
MIT
Instructions
243 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# MultiversX Blockchain Data — `self.blockchain()` API Reference

Complete reference for reading on-chain state in MultiversX smart contracts (SDK v0.64+).

## Caller & Account Info

| Method | Returns | Description |
|--------|---------|-------------|
| `.get_caller()` | `ManagedAddress` | Address that initiated the current call |
| `.get_sc_address()` | `ManagedAddress` | This contract's own address |
| `.get_owner_address()` | `ManagedAddress` | Contract owner address |
| `.check_caller_is_owner()` | `()` | Panics if caller != owner. Equivalent to `#[only_owner]`. |
| `.check_caller_is_user_account()` | `()` | Panics if caller is a smart contract (not an EOA). |
| `.is_smart_contract(address)` | `bool` | Check if an address is a smart contract |
| `.get_shard_of_address(address)` | `u32` | Get shard ID for an address |

```rust
// Owner-only guard (manual alternative to #[only_owner])
self.blockchain().check_caller_is_owner();

// Prevent contract-to-contract calls (anti-flash-loan)
self.blockchain().check_caller_is_user_account();

// Check if target is a SC before sending
let is_sc = self.blockchain().is_smart_contract(&target);
```

## Balances

| Method | Returns | Description |
|--------|---------|-------------|
| `.get_balance(address)` | `BigUint` | EGLD balance of any address |
| `.get_sc_balance(token_id, nonce)` | `BigUint` | This contract's balance of any token (EGLD or ESDT). `token_id` is `impl AsRef<TokenId>`. |
| `.get_esdt_balance(address, token_id, nonce)` | `BigUint` | ESDT balance of any address. `token_id` is `&EsdtTokenIdentifier`. |

```rust
// Check own EGLD balance
let egld = self.blockchain().get_balance(&self.blockchain().get_sc_address());

// Check own ESDT balance (simpler via get_sc_balance)
let balance = self.blockchain().get_sc_balance(&my_token_id, 0u64);
```

## Block Info

### Current Block

| Method | Returns | Description |
|--------|---------|-------------|
| `.get_block_timestamp_seconds()` | `TimestampSeconds` | Block timestamp in seconds (v0.63+) |
| `.get_block_timestamp_millis()` | `TimestampMillis` | Block timestamp in milliseconds (v0.63+) |
| `.get_block_nonce()` | `u64` | Block nonce (height) |
| `.get_block_round()` | `u64` | Block round |
| `.get_block_epoch()` | `u64` | Current epoch |
| `.get_block_round_time_millis()` | `DurationMillis` | Round duration in ms (v0.63+) |
| `.get_block_random_seed()` | `ManagedByteArray<48>` | 48-byte random seed |

### Previous Block

| Method | Returns | Description |
|--------|---------|-------------|
| `.get_prev_block_timestamp_seconds()` | `TimestampSeconds` | Previous block timestamp (seconds) |
| `.get_prev_block_timestamp_millis()` | `TimestampMillis` | Previous block timestamp (ms) |
| `.get_prev_block_nonce()` | `u64` | Previous block nonce |
| `.get_prev_block_round()` | `u64` | Previous block round |
| `.get_prev_block_epoch()` | `u64` | Previous epoch |
| `.get_prev_block_random_seed()` | `ManagedByteArray<48>` | Previous block random seed |

### Epoch Start Info

| Method | Returns | Description |
|--------|---------|-------------|
| `.get_epoch_start_block_timestamp_millis()` | `TimestampMillis` | When current epoch started |
| `.get_epoch_start_block_nonce()` | `u64` | Block nonce at epoch start |
| `.get_epoch_start_block_round()` | `u64` | Block round at epoch start |

### Deprecated Timestamp Methods (Do NOT Use)

| Deprecated | Replacement | Since |
|-----------|-------------|-------|
| `.get_block_timestamp()` | `.get_block_timestamp_seconds()` | v0.63 |
| `.get_block_timestamp_ms()` | `.get_block_timestamp_millis()` | v0.63 |
| `.get_prev_block_timestamp()` | `.get_prev_block_timestamp_seconds()` | v0.63 |
| `.get_prev_block_timestamp_ms()` | `.get_prev_block_timestamp_millis()` | v0.63 |
| `.get_block_round_time_ms()` | `.get_block_round_time_millis()` | v0.63 |
| `.epoch_start_block_timestamp_ms()` | `.get_epoch_start_block_timestamp_millis()` | v0.63 |
| `.epoch_start_block_timestamp_millis()` | `.get_epoch_start_block_timestamp_millis()` | v0.63.1 |
| `.epoch_start_block_nonce()` | `.get_epoch_start_block_nonce()` | v0.63.1 |
| `.epoch_start_block_round()` | `.get_epoch_start_block_round()` | v0.63.1 |

## Transaction Info

| Method | Returns | Description |
|--------|---------|-------------|
| `.get_tx_hash()` | `ManagedByteArray<32>` | Current transaction hash |
| `.get_gas_left()` | `u64` | Remaining gas |
| `.get_state_root_hash()` | `ManagedByteArray<32>` | State root hash |

## ESDT Token Metadata

| Method | Returns | Description |
|--------|---------|-------------|
| `.get_esdt_token_data(address, token_id, nonce)` | `EsdtTokenData` | Full token data (amount, attributes, creator, royalties, URIs, etc.) |
| `.get_esdt_token_type(address, token_id, nonce)` | `EsdtTokenType` | Token type enum (Fungible, NonFungible, SemiFungible, Meta) |
| `.get_token_attributes::<T>(token_id, nonce)` | `T: TopDecode` | Deserialized NFT/SFT attributes from this contract's account |
| `.get_current_esdt_nft_nonce(address, token_id)` | `u64` | Last minted nonce for a token on an address |

```rust
// EsdtTokenData fields:
pub struct EsdtTokenData<M: ManagedTypeApi> {
    pub token_type: EsdtTokenType,
    pub amount: BigUint<M>,
    pub frozen: bool,
    pub hash: ManagedBuffer<M>,
    pub name: ManagedBuffer<M>,
    pub attributes: ManagedBuffer<M>,  // raw bytes — use get_token_attributes for typed
    pub creator: ManagedAddress<M>,
    pub royalties: BigUint<M>,         // 0-10000 (basis points)
    pub uris: ManagedVec<M, ManagedBuffer<M>>,

From multiversx/mx-ai-skills, MIT.

More from multiversx/mx-ai-skills

Signals

Stars
12
Forks
4
Open issues
0
Last commit (this folder)
Jul 2, 2026 (4 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from multiversx

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get mvx-blockchain-data running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying mvx-blockchain-data?

CallGet help
Cite this page

mvx-blockchain-data skill. Agent Mart. https://agentmart.dev/skills/multiversx-mvx-blockchain-data (last updated 2026-10-24)