Breaking changes

  1. Updated /orders/get endpoint. Changes make this endpoint paginated, so orders should be fetched by pages.

    Updated endpoint method: PATCH

    Updated body interface:

    {
        token: string;
    
        limit: number;
        offset: number;
        filterInfo: {
            pairId?: number;
            status?: "active" | "finished";
            type?: "buy" | "sell";
            date?: {
                // UNIX timestamps in milliseconds
                from: number;
                to: number;
            };
        };
    }
    

    Here, limit correspond to amount of orders page to be retrieved, and offset correspond to offset of the fetched orders page in the whole orders list, filtered with provided filters setup.

    All filterInfo fields are optional and correspond to filtering options for selecting orders to be canceled.

    Extended success response:

    type GetUserOrdersResCurrency = {
        id: number;
        name: string;
        code: string;
        type: string;
        asset_id: string;
        auto_parsed: boolean;
        asset_info?: {
            asset_id: string;
            logo: string;
            price_url: string;
            ticker: string;
            full_name: string;
            total_max_supply: string;
            current_supply: string;
            decimal_point: number;
            meta_info: string;
        };
        whitelisted: boolean;
    };
    
    type GetUserOrdersResOrderData = {
        id: number;
        type: string;
        timestamp: number;
        side: string;
        price: string;
        amount: string;
        total: string;
        pair_id: number;
        user_id: number;
        status: string;
        left: string;
        hasNotification: boolean;
    
        pair: {
            id: number;
            first_currency_id: number;
            second_currency_id: number;
            rate?: number;
            coefficient?: number;
            high?: number;
            low?: number;
            volume: number;
            featured: boolean;
    
            first_currency: GetUserOrdersResCurrency;
            second_currency: GetUserOrdersResCurrency;
        };
    
        first_currency: GetUserOrdersResCurrency;
        second_currency: GetUserOrdersResCurrency;
        isInstant: boolean;
    };
    
    type GetUserOrdersSuccessRes = {
        success: true;
        totalItemsCount: number;
        data: GetUserOrdersResOrderData[];
    };
    

    Here, the only provided update is totalItemsCount field, which displays the total amount of orders set of current user, filtered with provided filters setup.

  2. Added /auth/request-auth endpoint. The endpoint is required part in new updated secure auth algorithm. This endpoint should be called to start auth session. It returns message that is to be signed by Zano wallet. Then, generated sign should be passed to /auth endpoint. Message expires in 5 minutes.

    Endpoint method: POST

    Body interface:

    {
      token: string;
    
        address: string;
        alias: string;
    }
    

    Here, address and alias are credentials of wallet that is planned to auth with.

    Success response interface:

    {
        success: true;
        // Auth message
        data: string;
    }
    

    Here, data is message that is needed to be signed by Zano wallet.

  3. Updated /auth endpoint. No interface updates are provided in the endpoint; semantics, on the contrary, are. Now, auth with self-generated message is no longer a supported method; message should be previously requested via /auth/request-auth endpoint.

    Non-breaking changes:

    1. Extended /dex/get-assets-price-rates endpoint.

      Extended success response interface:

      {
        success: true;
        priceRates: {
          asset_id: string;
          rate: number | null;
          day_change: number | null;
          day_volume: number | null;
          day_high: number | null;
          day_low: number | null;
        }[];
      }
      
    2. Added /orders/get-user-orders-pairs endpoint. The endpoint adds possibility to fetch all pairs the user has orders in, which is required within new paginated schema of accessing My Orders list.

      Endpoint method: PATCH

      Body interface:

      {
        token: string
      }
      

      Success response interface:

      {
          success: true;
          data: {
              id: number;
              firstCurrency: {
                  id: number;
                  ticker: string;
              };
              secondCurrency: {
                  id: number;
                  ticker: string;
              };
          }[]
      }
      
    3. Added /orders/cancel-all endpoint. The endpoints adds possibility to cancel all user’s orders in one atomic request, which is required within new paginated schema of accessing My Orders list.

      Endpoint method: PATCH

      Body interface:

      {
          token: string;
      
          filterInfo: {
              pairId?: number;
              type?: "buy" | "sell";
              date?: {
                  // UNIX timestamps in milliseconds
                  from: number;
                  to: number;
              };
          };
      }
      

      Here, all filterInfo fields are optional and correspond to filtering options for selecting orders to be canceled.

      Success response interface:

      {
          success: true;
      }