Cancels all orders. See https://gate.io/api2.

@param type order type(0:sell,1:buy,-1:all)
@param currencyPair currency pair
@return
@throws IOException
354023
public boolean cancelAllOrders(String type, CurrencyPair currencyPair) throws IOException {

    GateioBaseResponse cancelAllOrdersResult =
        bter.cancelAllOrders(type, formatCurrencyPair(currencyPair), apiKey, signatureCreator);

    return handleResponse(cancelAllOrdersResult).isResult();
  }
320390
public EXXTickerResponse getExxTicker(CurrencyPair currencyPair) throws IOException {

    return exx.getTicker(EXXAdapters.toSymbol(currencyPair));
  }
883722
public <S extends Storable> void unregister(Class<S> type, Cursor<S> cursor) {
        mLock.lock();
        try {
            if (mCursors != null) {
                CursorList<TransactionImpl<Txn>> cursorList = mCursors.get(type);
                if (cursorList != null) {
                    TransactionImpl<Txn> txnImpl = cursorList.unregister(cursor);
                    if (txnImpl != null) {
                        txnImpl.unregister(cursor);
                    }
                }
            }
        } finally {
            mLock.unlock();
        }
    }
652985
function OrderBook(currencyPair) {
    this._currencyPair = currencyPair;

    this._updateBufferMaxSize = OrderBook.DEFAULT_UPDATE_BUFFER_MAX_SIZE;

    this._wrapperPush = new PushWrapper();
    this._wrapperPublic = new PublicWrapper();

    this._statusRunning = false;
    this._statusSync = OrderBook.SYNC_STATUS_DESYNCHRONIZED;

    this._asks = new Table();
    this._bids = new Table();

    this._lastHandledSeq = -1;

    this._updateBuffer = new Array();

    this._eventEmitter = new events.EventEmitter();

    this._metrics = {
        "spread": 0,
        "askSumAmount": 0,
        "askSumTotal": 0,
        "bidSumAmount": 0,
        "bidSumTotal": 0
    };
}
634629
public static BitfinexOrderBookSymbol rawOrderBook(final BitfinexCurrencyPair currencyPair) {
        return new BitfinexOrderBookSymbol(currencyPair, BitfinexOrderBookSymbol.Precision.R0, null, null);
    }
1046657
public function refundOrder(Order $order, $currency, array $params = [])
    {
        $params['currency'] = $currency;

        $this->postAndMap($order->getResourcePath().'/refund', $params, 'toOrder', $order);
    }
951641
public OkCoinTickerResponse getFuturesTicker(CurrencyPair currencyPair, FuturesContract prompt)
      throws IOException {
    return okCoin.getFuturesTicker(OkCoinAdapters.adaptSymbol(currencyPair), prompt.getName());
  }
143745
public void remove(Class<? extends T> type) throws IOException {
        for (T t : data) {
            if(t.getClass()==type) {
                data.remove(t);
                onModified();
                return;
            }
        }
    }
570792
private static void createCurrencies(TypeSpec.Builder type, List<String> currencies) {
    TypeSpec.Builder currencyType = TypeSpec.enumBuilder("Currency")
        .addModifiers(PUBLIC, STATIC);

    List<String> codes = new ArrayList<>();
    codes.addAll(currencies);
    Collections.sort(codes);
    
    StringBuilder buf = new StringBuilder("$T.unmodifiableList($T.asList(\n");
    for (int i = 0; i < codes.size(); i++) {
      if (i > 0) {
        buf.append(",\n");
      }
      currencyType.addEnumConstant(codes.get(i));
      buf.append("  Currency.$L");
    }
    buf.append("))");
    
    // Add a safe string mapping that returns null instead of throwing.
    MethodSpec.Builder method = MethodSpec.methodBuilder("fromString")
        .addModifiers(PUBLIC, STATIC)
        .addParameter(STRING, "code")
        .returns(Types.CLDR_CURRENCY_ENUM);

    method.beginControlFlow("if (code != null)");
    method.beginControlFlow("switch (code)");
    for (int i = 0; i < codes.size(); i++) {
      method.addStatement("case $S: return $L", codes.get(i), codes.get(i));
    }
    method.addStatement("default: break");
    method.endControlFlow();
    method.endControlFlow();
    method.addStatement("return null");
    
    currencyType.addMethod(method.build());
    
    type.addType(currencyType.build());

    // Initialize field containing all currencies
    List<Object> arguments = new ArrayList<>();
    arguments.add(Collections.class);
    arguments.add(Arrays.class);
    arguments.addAll(codes);
  }
1226651
public List<OkCoinFutureKline> getFutureKline(
      CurrencyPair currencyPair,
      OkCoinKlineType type,
      FuturesContract contractType,
      Integer size,
      Long since)
      throws IOException {
    List<Object[]> list =
        okCoin.getFutureKline(
            "1",
            OkCoinAdapters.adaptSymbol(currencyPair),
            type.getType(),
            contractType.getName(),
            size,
            since);
    List<OkCoinFutureKline> klineList = new ArrayList<>();
    list.stream().forEach(kline -> klineList.add(new OkCoinFutureKline(kline)));
    return klineList;
  }
527252
public OkCoinTradeResult futuresTrade(
      String symbol,
      String type,
      String price,
      String amount,
      FuturesContract contract,
      int matchPrice,
      int leverRate)
      throws IOException {

    OkCoinTradeResult tradeResult =
        okCoin.futuresTrade(
            apikey,
            symbol,
            contract.getName(),
            type,
            price,
            amount,
            matchPrice,
            leverRate,
            signatureCreator());
    return returnOrThrow(tradeResult);
  }
906664
public static Trade adaptTrade(
      CryptonitTransaction tx, CurrencyPair currencyPair, int timeScale) {

    OrderType orderType = tx.getType() == 0 ? OrderType.BID : OrderType.ASK;
    final String tradeId = String.valueOf(tx.getTid());
    Date date =
        DateUtils.fromMillisUtc(
            tx.getDate()
                * timeScale); // polled order books provide a timestamp in seconds, stream in ms
    return new Trade(orderType, tx.getAmount(), currencyPair, tx.getPrice(), date, tradeId);
  }
480392
public BitZTrades getOrder(CurrencyPair currencyPair) throws IOException {
    BitZTradesResult result = bitz.getOrder(BitZUtils.toPairString(currencyPair));
    return result.getData();
  }
453266
public OkCoinBatchTradeResult cancelUpToThreeOrders(Set<Long> orderIds, String symbol)
      throws IOException {
    String ids =
        orderIds.stream().map(Object::toString).collect(Collectors.joining(BATCH_DELIMITER));
    return okCoin.cancelOrders(apikey, ids, symbol, signatureCreator());
  }
198804
@Indexable(type = IndexableType.DELETE)
	@Override
	public CommerceOrderPayment deleteCommerceOrderPayment(
		CommerceOrderPayment commerceOrderPayment) {
		return commerceOrderPaymentPersistence.remove(commerceOrderPayment);
	}
962697
@Override
    public void writeExternal(ObjectOutput out) throws IOException {
        out.writeByte(type);
        switch (type) {
            case BIG_MONEY: {
                BigMoney obj = (BigMoney) object;
                writeBigMoney(out, obj);
                return;
            }
            case MONEY: {
                Money obj = (Money) object;
                writeBigMoney(out, obj.toBigMoney());
                return;
            }
            case CURRENCY_UNIT: {
                CurrencyUnit obj = (CurrencyUnit) object;
                writeCurrency(out, obj);
                return;
            }
        }
        throw new InvalidClassException("Joda-Money bug: Serialization broken");
    }
468717
public function trade($pair, $type, $ordertype, $price=false, $price2=false, $volume) {
            return $this->addOrder($pair, $type, $ordertype, $price, $price2, $volume);
        }