@bcswaper/apis
Version:
bcswaper apis
1 lines • 548 B
JavaScript
import{ClientSettings}from"../clientContext";export class TradesHandler{constructor(t){this.symbol=t,this.trades=[]}initialize(t){const{id:e,contents:s}=t;s.trades&&(this.trades=s.trades)}update(t){const{id:e,contents:s}=t;s.trades?(this.trades.unshift(s.trades),this.trades.length>ClientSettings.ListLenths&&this.trades.pop()):console.error("got empty contents for trades channel.")}getTrades(){return this.trades}}export var TradeType;!function(t){t.LIMIT="LIMIT",t.LIQUIDATED="LIQUIDATED",t.DELEVERAGED="DELEVERAGED"}(TradeType||(TradeType={}));