获取用户持仓获取OKEX合约账户信息 （全仓）

@param symbol
@param contract
@return
@throws IOException
972997
public OkCoinPositionResult getFuturesPosition(String symbol, FuturesContract contract)
      throws IOException {
    OkCoinPositionResult futuresPositionsCross =
        okCoin.getFuturesPositionsCross(apikey, symbol, contract.getName(), signatureCreator());

    return returnOrThrow(futuresPositionsCross);
  }
1252235
public OkCoinTradeResult cancelOrder(long orderId, String symbol) throws IOException {

    OkCoinTradeResult tradeResult = okCoin.cancelOrder(apikey, orderId, symbol, signatureCreator());
    return returnOrThrow(tradeResult);
  }
449911
def _format_contract(contract: icontract._Contract) -> str:
    """"""
    # pylint: disable=too-many-branches
    decorator_inspection = None  # type: Optional[icontract._represent.DecoratorInspection]

    ##
    # Parse condition
    ##

    if not icontract._represent._is_lambda(a_function=contract.condition):
        condition_text = ':py:func:`{}`'.format(contract.condition.__name__)
    else:
        # We need to extract the source code corresponding to the decorator since inspect.getsource() is broken with
        # lambdas.

        # Find the line corresponding to the condition lambda
        lines, condition_lineno = inspect.findsource(contract.condition)
        filename = inspect.getsourcefile(contract.condition)

        decorator_inspection = icontract._represent.inspect_decorator(
            lines=lines, lineno=condition_lineno, filename=filename)

        lambda_inspection = icontract._represent.find_lambda_condition(decorator_inspection=decorator_inspection)
        assert lambda_inspection is not None, \
            "Expected non-None lambda inspection with the condition: {}".format(contract.condition)

        condition_text = _condition_as_text(lambda_inspection=lambda_inspection)

    ##
    # Parse error
    ##

    error_type = None  # type: Optional[str]

    # Error message is set only for an error of a contract given as a lambda that takes no arguments and returns
    # a result of a call on a string literal (*e.g.*, ``error=ValueError("some message")``.
    error_msg = None  # type: Optional[str]

    if contract.error is not None:
        if isinstance(contract.error, type):
            error_type = contract.error.__qualname__
        elif inspect.isfunction(contract.error) and icontract._represent._is_lambda(a_function=contract.error):
            if decorator_inspection is None:
                lines, condition_lineno = inspect.findsource(contract.error)
                filename = inspect.getsourcefile(contract.error)

                decorator_inspection = icontract._represent.inspect_decorator(
                    lines=lines, lineno=condition_lineno, filename=filename)

            error_type, error_msg = _error_type_and_message(decorator_inspection=decorator_inspection)
        else:
            # Error type could not be inferred
            pass

    ##
    # Format
    ##

    description = None  # type: Optional[str]
    if contract.description:
        description = contract.description
    elif error_msg is not None:
        description = error_msg
    else:
        # Description could not be inferred.
        pass

    doc = None  # type: Optional[str]
    if description and error_type:
        if description.strip()[-1] in [".", "!", "?"]:
            doc = "{} Raise :py:class:`{}`".format(description, error_type)
        elif description.strip()[-1] in [",", ";"]:
            doc = "{} raise :py:class:`{}`".format(description, error_type)
        else:
            doc = "{}; raise :py:class:`{}`".format(description, error_type)

    elif not description and error_type:
        doc = "Raise :py:class:`{}`".format(error_type)

    elif description and not error_type:
        doc = description

    else:
        # No extra documentation can be generated since the error type could not be inferred and
        # no contract description was given.
        doc = None

    if doc is not None:
        return "{} ({})".format(condition_text, doc)

    return condition_text
442130
public OkCoinFuturesOrderResult getFuturesOrders(
      String orderIds, String symbol, FuturesContract contract) throws IOException {

    OkCoinFuturesOrderResult futuresOrder =
        okCoin.getFuturesOrders(apikey, orderIds, symbol, contract.getName(), signatureCreator());
    return returnOrThrow(futuresOrder);
  }
654677
@Requires({
    "kind != null",
    "kind.isOld()",
    "list != null"
  })
  protected void allocateOldValues(ContractKind kind, List<Integer> list) {
    List<MethodContractHandle> olds =
        contracts.getMethodHandles(kind, methodName, methodDesc, 0);
    if (olds.isEmpty()) {
      return;
    }

    Integer[] locals = new Integer[olds.size()];
    for (MethodContractHandle h : olds) {
      int k = h.getKey();
      locals[k] = newLocal(Type.getReturnType(h.getContractMethod().desc));
      push((String) null);
      storeLocal(locals[k]);
    }
    list.addAll(Arrays.asList(locals));
  }
26932
public void ifge(String target) throws IOException
    {
        if (wideIndex)
        {
            out.writeByte(NOT_IFGE);
            out.writeShort(WIDEFIXOFFSET);
            Branch branch = createBranch(target);
            out.writeByte(GOTO_W);
            out.writeInt(branch);
        }
        else
        {
            Branch branch = createBranch(target);
            out.writeOpCode(IFGE);
            out.writeShort(branch);
        }
    }
625125
def tickerId(self, contract_identifier):
        
        # contract passed instead of symbol?
        symbol = contract_identifier
        if isinstance(symbol, Contract):
            symbol = self.contractString(symbol)

        for tickerId in self.tickerIds:
            if symbol == self.tickerIds[tickerId]:
                return tickerId
        else:
            tickerId = len(self.tickerIds)
            self.tickerIds[tickerId] = symbol
            return tickerId
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);
  }
653876
public static BitfinexExecutedTradeSymbol fromBitfinexString(final String symbol) {
		final BitfinexCurrencyPair bitfinexCurrencyPair = BitfinexCurrencyPair.fromSymbolString(symbol);
		return BitfinexSymbols.executedTrades(bitfinexCurrencyPair);
	}
1077749
public <Result, Param extends Resource> Result execWithoutCacheClear(Param resource, IUnitOfWork<Result, Param> transaction) throws WrappedException {
		CacheAdapter cacheAdapter = getOrCreate(resource);
		try {
			cacheAdapter.ignoreNotifications();
			return transaction.exec(resource);
		} catch (RuntimeException e) {
			throw e;
		} catch (Exception e) {
			throw new WrappedException(e);
		} finally {
			cacheAdapter.listenToNotifications();
		}
	}
1244566
public JSONObject getByContract(String contract, String date, HashMap<String, String> params) throws JSONException {
        return oClient.get("/team/v3/workdiaries/contracts/" + contract + "/" + date, params);
    }
1266643
@Requires("ClassName.isBinaryName(className)")
  protected ContractAnalyzer analyze(String className)
      throws IOException {
    /* Skip helper classes. */
    if (className.endsWith(JavaUtils.HELPER_CLASS_SUFFIX)) {
      return null;
    }

    /* Skip interfaces. */
    String helperFileName = className + JavaUtils.HELPER_CLASS_SUFFIX
        + Kind.CLASS.extension;
    if (JavaUtils.resourceExists(loader, helperFileName)) {
      return null;
    }

    /* Try to get contracts class file. */
    InputStream contractStream =
        JavaUtils.getContractClassInputStream(loader, className);
    if (contractStream == null) {
      return null;
    }

    return extractContracts(new ClassReader(contractStream));
  }
1132128
@Override
  public synchronized void mark(int idx) throws IOException {
    try {
      in.mark(idx);
    } catch (IOException e) {
      handleIOException(e);
    }
  }
1199782
private ContractImpl getContractImpl(final Class<?> cls) throws InitializationError {
        final ContractImpl impl = cls.getAnnotation( ContractImpl.class );
        if (impl == null) {

            throw new InitializationError( "Classes annotated as @RunWith( ContractSuite ) [" + cls
                    + "] must also be annotated with @ContractImpl" );
        }
        return impl;
    }
1319133
public Symbol getSymbolForScope(SymbolScope scope) {
    if (scope.getSymbolForScope() == null) {
      scope.setSymbolForScope(findSymbolForScope(scope));
    }
    return scope.getSymbolForScope();
  }
1315013
public final void printSymbol(CharSequence text)
        throws IOException
    {
        if (text == null)
        {
            appendAscii("null.symbol");
        }
        else if (symbolNeedsQuoting(text, true)) {
            appendAscii('\'');
            printCodePoints(text, SYMBOL_ESCAPE_CODES);
            appendAscii('\'');
        }
        else
        {
            appendAscii(text);
        }
    }
1347107
public Object getKlines(CurrencyPair currencyPair) throws IOException {

    Map<String, String> data = new HashMap<String, String>();
    data.put("symbol", currencyPair.toString());

    RestRequestParam parameters =
        RestApiRequestHandler.generateRequestParam(data, this.apiKey, this.secretKey);

    return coinsuper.getKlines(parameters);
  }