Skip to content

Conversation

@Dushusir
Copy link
Member

@Dushusir Dushusir commented Nov 17, 2025

Analysis

Since similar crypto-related formulas on the market mainly involve pulling encrypted data, they usually require requesting an API. CoinGecko, Binance, Coinbase, and others all have APIs with similar functionality. Users may need to switch between these API addresses and API keys in the Univer to use them. For example, the crypto price query API provides a formula =CRYPTO.PRICE. Internally, it retrieves different data structures based on different API addresses, then performs a transformation layer to convert them into a unified data structure for the formula's result.

Task

  • The formula plugin supports configuring API addresses and API keys. If not configured, it falls back to https://api.coingecko.com/api/v3/ (Coingecko's public API does not require an API key).
  • Implement the necessary underlying services such as the API request layer and data transformation layer. The actual formula logic should minimize the differences caused by different APIs.
  • First, implement the price query function =CRYPTO.PRICE (referencing Excel notation with the =CRYPTO. prefix), and set several commonly used input parameters (preferably those commonly supported by major exchanges or API providers).

Functions List

  • Price
    =CRYPTO.PRICE("BTC")
    
  • Address Balance
    =CRYPTO.BALANCE("0x...", "ethereum")
    
  • Token Balance
    =CRYPTO.TOKEN.BALANCE("0x...", "0xTokenAddr", "ethereum")
    
  • Transaction Information
    =CRYPTO.TX("ethereum", "0xTxHash")
    
  • NFT Floor Price
    =CRYPTO.NFT.FLOOR("azuki")
    

Reference

https://docs.coingecko.com/v3.0.1/reference/simple-price
https://developers.binance.com/docs/binance-spot-api-docs/faqs/market_data_only

Pull Request Checklist

  • Related tickets or issues have been linked in the PR description (or missing issue).
  • Naming convention is followed (do please check it especially when you created new plugins, commands and resources).
  • Unit tests have been added for the changes (if applicable).
  • Breaking changes have been documented (or no breaking changes introduced in this PR).

@github-actions
Copy link

github-actions bot commented Nov 17, 2025

View Deployment

📑 Demo (React@19) Demo (React@16) 📚 Storybook
🔗 Preview link 🔗 Preview link 🔗 Preview link

@github-actions
Copy link

Playwright test results

passed  27 passed

Details

stats  27 tests across 12 suites
duration  6 minutes, 19 seconds
commit  2471482
info  For more information, see full report

Copy link
Member

@jikkai jikkai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create it as a standalone plugin and place it in the packages-experimental directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants