Index of every page on this site: llms.txt
All skills
availproject avatar

/nexus-sdk-balances-metadata-utils

@8f83d92
Run it yourself

Fetch balances, supported chains/tokens, intent history, and use Nexus SDK formatter utilities. Use when building token/chain selectors, showing balances, or formatting UI values.

Use this Skill: https://skilld.dev/gh/availproject/widgets/nexus-sdk-balances-metadata-utils

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈54 tokens for metadata: the name and description. ≈431 when used: this file.

Description uses 2.7% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈215 characters, or 2.7%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

Balances, Metadata, and Utilities

Fetch bridge balances

  • Call sdk.getBalancesForBridge() to list assets usable in bridge flows.
  • Typical fields on each asset:
    • symbol, decimals, balance, balanceInFiat, breakdown[]
  • Use for:
    • token selectors
    • max amount validation
    • per-chain balance breakdown

Fetch swap balances

  • Call sdk.getBalancesForSwap(onlyNativesAndStables?) to list assets usable in swap flows.
  • Use for:
    • swap token selectors
    • swap input validation
    • source selection for exact-in swaps

Fetch supported chains/tokens

  • Call sdk.utils.getSupportedChains(env?) for supported chains + tokens.
  • Call sdk.utils.getSwapSupportedChainsAndTokens() for swap-supported chains/tokens.
  • Call sdk.getSwapSupportedChains() for chains where swaps are supported.

Fetch intent history

  • Call sdk.getMyIntents(page = 1) to retrieve RequestForFunds[].
  • Use history to show status updates or allow retries.

Use constants for UI

  • Use SUPPORTED_CHAINS for chain IDs.
  • Use CHAIN_METADATA for names, logos, explorers, native currency.
  • Use TOKEN_CONTRACT_ADDRESSES for token addresses by chain.
  • Use NEXUS_EVENTS for event name constants.

Use formatter utilities

  • Call sdk.utils.formatTokenBalance(value, { symbol, decimals }).
  • Call sdk.utils.formatTokenBalanceParts(...).
  • Call sdk.utils.formatUnits(value, decimals).
  • Call sdk.utils.parseUnits(value, decimals).
  • Call sdk.utils.truncateAddress(address, start?, end?).
  • Call sdk.utils.isValidAddress(address).
  • Call sdk.utils.getCoinbaseRates() for optional fiat rates.
  • Call sdk.convertTokenReadableAmountToBigInt(value, tokenSymbol, chainId) when decimals vary by chain.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts8mo3 checks · Risk SAFE
  • Gen Agent Trust Hub9mo

    The skill provides documentation for a blockchain SDK. It processes external intent history and accesses fiat rates from external providers, which presents minor surfaces for indirect prompt injection and non-whitelisted network requests.

  • Socket8mo

    No alerts

  • Snyk9mo

    Risk: LOW · No issues

Signed by skilld at 8f83d92. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated 9 months ago

README badge

README badge for availproject/widgets/nexus-sdk-balances-metadata-utils