@@ -0,0 +1,2844 @@
+package com.chain.api;%0A%0Aimport com.chain.exception.APIException;%0Aimport com.chain.exception.ChainException;%0Aimport com.chain.http.Context;%0A%0Aimport java.util.HashMap;%0A%0A/**%0A * When used in conjunction with /list-transactions, Cursors can be used to%0A * receive notifications about transactions.%0A */%0Apublic class Cursor %7B%0A  /**%0A   * Cursor ID, automatically generated when a cursor is created.%0A   */%0A  public String id;%0A%0A  /**%0A   * An optional, user-supplied alias that can be used to uniquely identify%0A   * this cursor.%0A   */%0A  public String alias;%0A%0A  /**%0A   * The query filter used in /list-transactions.%0A   */%0A  public String filter;%0A%0A  /**%0A   * The direction (%22asc%22 or %22desc%22) that this cursor moves through the%0A   * transaction list. Only %22asc%22 (oldest transactions first) is supported%0A   * currently.%0A   */%0A  public String order;%0A%0A  /**%0A   * Indicates the last transaction consumed by this cursor.%0A   */%0A  public String after;%0A%0A  /**%0A   * Creates a cursor.%0A   *%0A   * @param ctx context object that makes requests to core%0A   * @return a cursor object%0A   * @throws ChainException%0A   */%0A  public static Cursor create(Context ctx, String alias, String filter) throws ChainException %7B%0A    Map%3CString, Object%3E req = new HashMap%3C%3E();%0A    req.put(%22alias%22, alias);%0A    req.put(%22filter%22, filter);%0A    return ctx.request(%22create-cursor%22, req, Cursor.class);%0A  %7D%0A%0A  /**%0A   * Retrieves a cursor by ID.%0A   *%0A   * @param ctx context object that makes requests to core%0A   * @param id the cursor id%0A   * @return a cursor object%0A   * @throws ChainException%0A   */%0A  public static Cursor getByID(Context ctx, String id) throws ChainException %7B%0A    Map%3CString, Object%3E req = new HashMap%3C%3E();%0A    req.put(%22id%22, id);%0A    return ctx.request(%22get-cursor%22, req, Cursor.class);%0A  %7D%0A%0A  /**%0A   * Retrieves a cursor by alias.%0A   *%0A   * @param ctx context object that makes requests to core%0A   * @param alias the cursor alias%0A   * @return a cursor object%0A   * @throws ChainException%0A   */%0A  public static Cursor getByAlias(Context ctx, String alias) throws ChainException %7B%0A    Map%3CString, Object%3E req = new HashMap%3C%3E();%0A    req.put(%22alias%22, alias);%0A    return ctx.request(%22get-cursor%22, req, Cursor.class);%0A  %7D%0A%0A  /**%0A   * Updates a cursor with a new %60after%60. Cursors can only be updated forwards%0A   * (i.e., a cursor cannot be updated with a value that is previous to its%0A   * current value).%0A   *%0A   * @param ctx context object that makes requests to core%0A   * @param after an indicator of the last transaction processed%0A   * @return a cursor object%0A   * @throws ChainException%0A   */%0A  public Cursor update(Context ctx, String after) throws ChainException %7B%0A    Map%3CString, Object%3E req = new HashMap%3C%3E();%0A    req.put(%22id%22, this.id);%0A    req.put(%22previous_after%22, this.after);%0A    req.put(%22after%22, after);%0A    return ctx.request(%22update-cursor%22, req, Cursor.class);%0A  %7D%0A%7D%0A

add basic Cursor functionality