mcpField
W
wow-api-currency-economy

wow-api-currency-economy

github.com/jburlison开发4641 次安装37 周前更新
代码仓库

关于 wow-api-currency-economy

面向 World of Warcraft Retail 插件与脚本开发者的货币和经济 API 参考,涵盖 Patch 12.0.0 的货币、拍卖行、商店、交易与邮件系统。

主要功能

  1. 01查询货币数量、上限与追踪状态
  2. 02搜索、竞拍和上架拍卖物品
  3. 03查看 WoW Token 市场价格
  4. 04访问 Trading Post 与黑市拍卖信息
  5. 05读取玩家交易和邮件数据

适用场景

  1. 01开发显示货币及周上限的界面
  2. 02制作拍卖行搜索或上架插件
  3. 03检查 Trading Post 商品与奖励
  4. 04构建交易或邮箱相关插件

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/jburlison/wowaddonapiagents --skill wow-api-currency-economy

安装后在 Claude Code 中输入/wow-api-currency-economy确认已加载。

详细介绍

货币与经济 API(零售版 — Patch 12.0.0)

货币、拍卖行、商店、代币、贸易站、邮件和交易 API 的综合参考。

来源: https://warcraft.wiki.gg/wiki/World_of_Warcraft_API 截至: Patch 12.0.0(Build 65655)— 2026 年 1 月 28 日 范围: 仅限零售版。


范围

  • C_CurrencyInfo — 货币数据、追踪、背包显示
  • 拍卖行 — 上架、竞拍、购买、出售、商品
  • C_WowTokenPublic / C_WowTokenUI — WoW Token 市场
  • AccountStore / StorePublic — 游戏内商店
  • CatalogShop — 目录商店系统
  • C_PerksProgram — 贸易站(Trader's Tender)
  • BlackMarket — 黑市拍卖行
  • TradeInfo — 玩家间交易
  • MailInfo — 邮箱系统

C_CurrencyInfo — 货币系统

货币数据
函数返回值描述
C_CurrencyInfo.GetCurrencyInfo(currencyType)currencyInfo按类型获取货币信息
C_CurrencyInfo.GetCurrencyInfoFromLink(link)currencyInfo从超链接获取
C_CurrencyInfo.GetCurrencyIDFromLink(link)currencyID从超链接获取 ID
C_CurrencyInfo.GetCurrencyLink(currencyType, amount)link货币超链接
C_CurrencyInfo.GetCurrencyListSize()size条目数
C_CurrencyInfo.GetCurrencyListInfo(index)info指定索引处的条目
C_CurrencyInfo.GetCurrencyListLink(index)link指定索引处的链接
货币信息字段
  • name — 货币名称
  • description — 描述文本
  • currencyID — 唯一 ID
  • iconFileID — 图标纹理
  • quantity — 当前数量
  • maxQuantity — 数量上限(0 = 无上限)
  • canEarnPerWeek — 是否有每周上限?
  • quantityEarnedThisWeek — 本周获得数量
  • maxWeeklyQuantity — 每周上限
  • totalEarned — 历来获得的总量
  • isTradeable — 是否可以交易?
  • quality — 物品品质
  • isDiscovered — 是否已发现?
  • isShowInBackpack — 是否显示在背包中?
背包与追踪
函数返回值描述
C_CurrencyInfo.GetBackpackCurrencyInfo(index)currencyData背包栏位
C_CurrencyInfo.GetNumBackpackCurrencies()numSlots背包栏位数
C_CurrencyInfo.SetCurrencyBackpack(index, backpack)—切换背包显示
C_CurrencyInfo.IsCurrencyTracked(currencyID)isTracked是否正在追踪?
C_CurrencyInfo.SetCurrencyTracked(currencyID, tracked)—设置追踪状态
货币列表管理
函数返回值描述
C_CurrencyInfo.ExpandCurrencyList(index, expand)—展开/折叠标题
C_CurrencyInfo.IsCurrencyHeader(index)isHeader是否为标题?
C_CurrencyInfo.GetFactionGrantedByCurrency(currencyID)factionID关联阵营
C_CurrencyInfo.DoesCurrentFilterPassFilter(currencyID)passes是否通过筛选?
金币函数(全局)
函数返回值描述
GetMoney()copper玩家持有的钱币,单位为铜币
GetCoinTextureString(copper)text金币/银币/铜币字符串
GetMoneyString(copper, ...)text格式化的钱币字符串

拍卖行

浏览与搜索
函数返回值描述
C_AuctionHouse.SearchForItemKeys(itemKeys, sorts)—按物品键搜索
C_AuctionHouse.SendBrowseQuery(query)—浏览查询
C_AuctionHouse.SendSearchQuery(itemKey, sorts, separateOwnerItems)—物品搜索
C_AuctionHouse.GetBrowseResults()browseResults浏览结果
C_AuctionHouse.GetNumItemSearchResults(itemKey)numResults搜索结果数量
C_AuctionHouse.GetItemSearchResultInfo(itemKey, index)resultInfo搜索结果信息
C_AuctionHouse.RefreshItemSearchResults(itemKey)—刷新搜索结果
C_AuctionHouse.GetFilterGroups()filterGroups可用筛选条件
商品
函数返回值描述
C_AuctionHouse.SendSellSearchQuery(itemKey, sorts, separateOwnerItems)—商品搜索
C_AuctionHouse.GetCommoditySearchResultInfo(itemID, index)resultInfo商品搜索结果
C_AuctionHouse.GetNumCommoditySearchResults(itemID)numResults商品搜索结果数量
C_AuctionHouse.StartCommoditiesPurchase(itemID, quantity)—开始购买商品
C_AuctionHouse.ConfirmCommoditiesPurchase()—确认购买商品
C_AuctionHouse.CancelCommoditiesPurchase()—取消购买商品
C_AuctionHouse.GetCommodityQuote(itemID)quote报价
上架与出售
函数返回值描述
C_AuctionHouse.PostItem(itemLocation, duration, quantity, bid, buyout)—上架物品
C_AuctionHouse.PostCommodity(itemLocation, duration, quantity, unitPrice)—上架商品
C_AuctionHouse.GetItemKeyInfo(itemKey)keyInfo物品键信息
C_AuctionHouse.MakeItemKey(itemID, itemLevel, itemSuffix, battlePetSpeciesID)itemKey创建物品键
C_AuctionHouse.GetAvailablePostCount(itemLocation)count可上架数量
C_AuctionHouse.CalculateItemDeposit(itemLocation, duration, quantity)deposit保证金费用
C_AuctionHouse.GetQuoteDurationRemaining()seconds报价剩余时间
竞拍与购买
函数返回值描述
C_AuctionHouse.PlaceBid(auctionID, bidAmount)—出价
C_AuctionHouse.GetBidInfo(index)bidInfo出价信息
C_AuctionHouse.GetNumBids()numBids正在进行的竞拍
C_AuctionHouse.HasFavorite(itemKey)isFavorite是否已收藏?
C_AuctionHouse.SetFavoriteItem(itemKey, isFavorite)—设置收藏状态
C_AuctionHouse.GetFavoriteItems()itemKeys所有收藏
自有拍卖
函数返回值描述
C_AuctionHouse.GetNumOwnedAuctions()numAuctions自有拍卖数量
C_AuctionHouse.GetOwnedAuctionInfo(index)auctionInfo自有拍卖信息
C_AuctionHouse.CancelAuction(auctionID)—取消拍卖
C_AuctionHouse.QueryOwnedAuctions(sorts)—查询自有拍卖
拍卖行状态
函数返回值描述
C_AuctionHouse.IsAuctionHouseAvailable()isAvailable拍卖行是否可用?
C_AuctionHouse.CloseAuctionHouse()—关闭拍卖行
C_AuctionHouse.GetAuctionHouseTimeLeftBand(timeLeftEnum)seconds剩余时间
C_AuctionHouse.ReplicateItems()—完整扫描拍卖行
C_AuctionHouse.GetNumReplicateItems()count扫描物品数量
C_AuctionHouse.GetReplicateItemInfo(index)info扫描物品信息

C_WowTokenPublic — WoW Token

函数返回值描述
C_WowTokenPublic.GetCurrentMarketPrice()price金币价格
C_WowTokenPublic.GetGuaranteedPrice()price保底价格
C_WowTokenPublic.UpdateMarketPrice()—请求更新
C_WowTokenPublic.GetCommerceSystemStatus()status系统状态
C_WowTokenPublic.BuyToken()—购买代币(金币)
C_WowTokenPublic.SellToken(auctionID)—出售代币

AccountStore / StorePublic — 游戏内商店

函数返回值描述
C_StorePublic.IsEnabled()enabled商店已启用?
C_StorePublic.IsDisabledByParentalControls()disabled是否受到家长控制限制?
C_StorePublic.DoesGroupHavePurchaseableProducts(group)hasPurchaseable是否有可购买的商品?

C_PerksProgram — 商栈

函数返回值描述
C_PerksProgram.GetAvailableActivities()activities当前活动
C_PerksProgram.GetPendingChestRewards()rewards待领取奖励
C_PerksProgram.GetTimeRemaining()seconds本轮剩余时间
C_PerksProgram.GetCurrencyAmount()amount商贩的标币
C_PerksProgram.GetVendorItemInfo(perksVendorItemID)itemInfo商贩物品
C_PerksProgram.GetAvailableVendorItemIDs()itemIDs当前轮换物品
C_PerksProgram.GetFrozenPerksVendorItemInfo()info冻结物品
C_PerksProgram.RequestPurchase(perksVendorItemID)—购买物品
C_PerksProgram.RequestRefund(perksVendorItemID)—退还物品
C_PerksProgram.GetDraggedPerksVendorItemInfo()itemInfo拖动的物品
C_PerksProgram.IsFrozenItem(perksVendorItemID)isFrozen是否已冻结?
C_PerksProgram.SetFrozenPerksVendorItem(perksVendorItemID)—冻结物品
C_PerksProgram.ClearFrozenPerksVendorItem()—解除冻结
C_PerksProgram.GetPerksVendorCategoryIDs()categoryIDs类别 ID
C_PerksProgram.GetPerksVendorCategoryInfo(categoryID)categoryInfo类别信息

黑市

函数返回值描述
C_BlackMarket.GetNumItems()numItems当前黑市拍卖行物品
C_BlackMarket.GetItemInfoByIndex(index)info黑市拍卖行物品信息
C_BlackMarket.GetHotItem()info今日热门物品
C_BlackMarket.ItemPlaceBid(index, amount)—对黑市拍卖行物品出价
C_BlackMarket.RequestItems()—请求物品列表
C_BlackMarket.IsViewOnly()isViewOnly是否为只读模式?

交易(玩家对玩家)

函数返回值描述
InitiateTrade(unit)—开始交易
AcceptTrade()—接受交易
CancelTrade()—取消交易
AddTradeMoney()—添加金币报价
SetTradeMoney(copper)—设置金币数量
GetTargetTradeMoney()copper对方的金币报价
GetPlayerTradeMoney()copper你的金币报价
GetTradeTargetItemInfo(slotIndex)name, texture, quantity, quality, isUsable, enchant对方的物品
GetTradePlayerItemInfo(slotIndex)name, texture, quantity, quality, isUsable, enchant你的物品
ClickTradeButton(slotIndex)—点击交易栏位
GetNumTradeItems()numPlayerItems, numTargetItems物品数量

邮件系统

功能返回值描述
GetInboxNumItems()numItems, totalItems收件箱数量
GetInboxHeaderInfo(index)packageIcon, stationeryIcon, sender, subject, money, CODAmount, daysLeft, hasItem, wasRead, wasReturned, textCreated, canReply, isGM邮件标题信息
GetInboxText(index)bodyText, stationeryBG, stationeryBGR, stationeryBGG, stationeryBGB, color邮件正文
GetInboxItem(index, itemIndex)name, itemID, texture, count, quality, canUse附件
GetInboxItemLink(index, itemIndex)link附件链接
TakeInboxItem(index, itemIndex)—收取附件
TakeInboxMoney(index)—收取金币
TakeInboxTextItem(index)—收取文本物品
DeleteInboxItem(index)—删除邮件
ReturnInboxItem(index)—退回邮件
AutoLootMailItem(index)—自动拾取全部物品
InboxItemCanDelete(index)canDelete可以删除吗?
SendMail(recipient, subject, body)—发送邮件
SetSendMailMoney(copper)—设置要发送的金币
SetSendMailCOD(copper)—设置货到付款金额
GetSendMailPrice()cost邮寄费用
GetSendMailItem(index)name, texture, count, quality附加物品
GetSendMailItemLink(index)link附加物品链接
ClickSendMailItemButton(itemIndex, clearItem)—添加/移除附件
SendMailCanSend()canSend可以发送吗?

常见模式

显示带上限的货币
local function ShowCurrency(currencyID)
    local info = C_CurrencyInfo.GetCurrencyInfo(currencyID)
    if info then
        local text = info.name .. ": " .. info.quantity
        if info.maxQuantity > 0 then
            text = text .. " / " .. info.maxQuantity
        end
        if info.canEarnPerWeek and info.maxWeeklyQuantity > 0 then
            text = text .. " (Weekly: " .. info.quantityEarnedThisWeek .. "/" .. info.maxWeeklyQuantity .. ")"
        end
        print(text)
    end
end
拍卖行搜索
-- Register for results
local f = CreateFrame("Frame")
f:RegisterEvent("ITEM_SEARCH_RESULTS_UPDATED")
f:SetScript("OnEvent", function(self, event, itemKey, ...)
    local numResults = C_AuctionHouse.GetNumItemSearchResults(itemKey)
    for i = 1, numResults do
        local result = C_AuctionHouse.GetItemSearchResultInfo(itemKey, i)
        if result then
            print(result.buyoutAmount, "copper -", result.quantity, "available")
        end
    end
end)

-- Initiate search
local itemKey = C_AuctionHouse.MakeItemKey(12345) -- itemID
C_AuctionHouse.SendSearchQuery(itemKey, {}, false)
查看 WoW Token 价格
C_WowTokenPublic.UpdateMarketPrice()

local f = CreateFrame("Frame")
f:RegisterEvent("TOKEN_MARKET_PRICE_UPDATED")
f:SetScript("OnEvent", function()
    local price = C_WowTokenPublic.GetCurrentMarketPrice()
    if price then
        print("WoW Token: " .. GetCoinTextureString(price))
    end
end)

关键事件

事件负载描述
CURRENCY_DISPLAY_UPDATEcurrencyType, quantity, quantityChange, quantityGainSource, quantityLostSource货币发生变化
AUCTION_HOUSE_SHOW—拍卖行已打开
AUCTION_HOUSE_CLOSED—拍卖行已关闭
AUCTION_HOUSE_BROWSE_RESULTS_UPDATED—浏览结果已就绪
ITEM_SEARCH_RESULTS_UPDATEDitemKey物品搜索已就绪
COMMODITY_SEARCH_RESULTS_UPDATEDitemID商品搜索已就绪
AUCTION_HOUSE_NEW_RESULTS_RECEIVEDitemKey收到新结果
ITEM_SEARCH_RESULTS_ADDEDitemKey已添加搜索结果
AUCTION_HOUSE_AUCTION_CREATEDauctionID拍卖已发布
AUCTION_CANCELEDauctionID拍卖已取消
TOKEN_MARKET_PRICE_UPDATEDresultToken 价格已更新
TOKEN_STATUS_CHANGED—Token 状态已变化
PERKS_PROGRAM_CURRENCY_REFRESH—商贩的标币已更新
PERKS_PROGRAM_PURCHASE_SUCCESS—已在贸易站购买
PERKS_PROGRAM_SET_FROZEN_ITEM—物品已冻结
MAIL_INBOX_UPDATE—收件箱已更新
MAIL_SEND_SUCCESS—邮件已发送
MAIL_SHOW—邮箱已打开
MAIL_CLOSED—邮箱已关闭
TRADE_SHOW—交易窗口已打开
TRADE_CLOSED—交易已结束
TRADE_ACCEPT_UPDATEplayerAccept, targetAccept接受状态
TRADE_MONEY_CHANGED—金币报价已更改
TRADE_PLAYER_ITEM_CHANGEDslotIndex玩家物品已更改
TRADE_TARGET_ITEM_CHANGEDslotIndex对方物品已更改
BLACK_MARKET_ITEM_UPDATE—黑市拍卖行物品已更新
BLACK_MARKET_OUTBID—黑市拍卖行竞价已被超越

注意事项与限制

  1. 拍卖行硬件事件 — 发布、购买和竞拍都需要硬件事件(用户点击)。
  2. 商品与物品 — 商品(可堆叠)使用的 API 路径与装备/独特物品不同。
  3. 拍卖行限流 — 搜索有频率限制。快速查询会受到服务端限流。
  4. 邮寄货到付款(COD) — 取走附件时,COD 邮件会自动扣除金币。使用 InboxItemCanDelete() 进行测试。
  5. GetMoney() 返回铜币 — 除以 100 得到银币,除以 10000 得到金币。
  6. 货币上限 — 显示进度前,务必检查 maxQuantity 和 maxWeeklyQuantity。
  7. WoW Token 价格为异步获取 — 调用 UpdateMarketPrice(),然后等待 TOKEN_MARKET_PRICE_UPDATED。
  8. ReplicateItems() 速度较慢 — 全量拍卖行扫描开销很大。请谨慎使用,并逐步处理结果。

评论

支持 Markdown