@statsanytime/trade-bots-pricempire
v1.0.0-alpha.26
Published
Official Pricempire plugin for the StatsAnytime Trade Bots framework.
Downloads
6
Readme
@statsanytime/trade-bots-pricempire
Official Pricempire plugin for the StatsAnytime Trade Bots framework.
Installation
pnpm install @statsanytime/trade-bots-pricempire
Usage
For information on how to use this in the context of the framework, we recommend reading the official framework documentation here.
This package exports the following functions:
createPricempirePlugin
Creates a new Pricempire plugin instance. This takes a single options argument:
export interface PricempirePluginOptions {
apiKey: string;
version: 'v2' | 'v3';
sources: string[];
}
getPrice
Returns the price of the item in the current context. It takes a single argument which should match the price attribute path:
getPrice('buff_buy.random_price');
getPricePercentage
Returns the price percentage of the item in the current context. It takes the same argument as getPrice
:
getPricePercentage('buff_buy.random_price');
As any example, if the price of the item is 90 USD and the buff price is 100 USD, this function will return 90.