# Alchemy enhanced APIs ###### tags: `開發筆記` **Transfers API** 用戶查看特定地址的歷史交易。是一項具挑戰性且效率低的任務,需掃描整個區塊鏈並索引所有內容以搜索與所需地址相關的交易。但是使用 Transfers API,用戶可以在單個請求中查詢給定地址的所有類型的歷史交易。 **Token Metadata** 這是一種 Alchemy 智能方法,可在一次調用中返回給定代幣合約地址的Metadata single call: Name,Symbol,Decimals,Logo **Token Balance** 這是一種 Alchemy 智能方法,它返回給定合約地址列表的地址的代幣餘額。 **Token Allowance.** returns the amount of tokens the spender is allowed to withdraw from the owner. 這是一種 Alchemy 智能方法,它返回允許支出者從所有者那裡提取的代幣數量。 **Alchemy Web3** JavaScript Library **Smart WebSocket** Unlike HTTP, with WebSockets, you don't need to continuously make requests when you want specific information. WebSockets maintain a network connection for you (if done right) and listen for changes. As with any network connection, you should not assume that a WebSocket will remain open forever without interruptio tcp 通訊協議 http、websocket WebSocket 連接本質上是短暫的,這使得客戶端有必要圍繞重新連接和錯過事件的回填來設計非平凡的機制。 Alchemy Web3 開箱即用地處理此問題,以確保在臨時網絡故障或連接斷開的情況下正確的 WebSocket 行為。 **Trace API** *Trace包含parity; Alchemy provides access to Parity's trace module, which allows for deeper insight into transaction processing.* These API methods allow you to get a full externality trace on any transaction executed throughout the Ethereum chain. Unlike the log filtering API, you are able to search and filter based only upon address information. Information returned includes the execution of all CREATE, SUICIDE and all variants of CALL together with input data, output data, gas usage, amount transferred and the success status of each individual action. **Debug API (only available on enterprise)** Parity 的跟踪模塊一樣,Alchemy 目前公開了 debug_traceTransaction 以在運行在 Geth(Rinkeby、Goerli)上的網絡上進行調試。 **NFT API** 設置 Alchemy 帳戶。您將需要一個 API 密鑰! Alchemy 的 NFT API 允許您從區塊鏈(即 Ethereum、Polygon、Flow)中快速獲取您需要了解的有關 NFT 的所有信息。與其自己搜索、索引和存儲數據 - 您現在可以發出一個請求來獲取 ERC-721 和 ERC-1155 token的特定 NFT 信息,例如: 一個地址擁有的所有 NFT、特定 NFT 代幣的元數據和屬性。 getNFTs 方法將用戶地址作為輸入,並將返回該地址擁有的所有 ERC721 和 ERC1155 代幣。 getNFTMetadata 方法將 NFT 合約地址和token ID 作為輸入,並將返回元數據,包括特徵和用於顯示該 NFT 的圖像 URI # Alchemy other API **Notify API** Webhooks for address activity, mined transactions, dropped transactions, and gas price on Ethereum, Polygon, Optimism, and Arbitrum. **Subscription API (Websockets)** 訂閱的type和log(數據和主題) Learn how to subscribe to pending transactions, log events, new blocks and more using Websockets on Ethereum, Polygon, and Arbitrum. **Unstoppable Domains APIs** 獲取domains的資料 # ###### About Insight Software ###### 兌心科技的專業橫跨多個領域,雲端架構、遊戲製作、區塊鏈技術、去中心化金融、醫療資訊和物聯網服務等,致力於成為企業Web2.0到Web3.0的領航員,提供**雲服務、線路、區塊鏈技術、金庫**等解決方案。 # ### 聯絡方式 兌心聯絡信箱 : service@insight-software.com ### 社群 [Website](https://www.insight-software.com/) [Medium](https://medium.com/insight-software) [Youtube](https://www.youtube.com/@insight-software) [Telegram](https://t.me/Insight_software) [Twitter](https://twitter.com/insightcapital_) [Instagram](https://www.instagram.com/insight.capital/) ![](https://i.imgur.com/MRSPRzH.png)