Page MenuHomePhabricator

[Cashtab] Support agora partial listings, cancels, and buys
ClosedPublic

Authored by bytesofman on Oct 2 2024, 20:36.

Details

Reviewers
emack
Group Reviewers
Restricted Project
Commits
rABC07388568e236: [Cashtab] Support agora partial listings, cancels, and buys
Summary

Support for SLP partial agora offers (listing fungible SLP tokens)

This diff is large. I think I have split out everything that can be split out.

Reviewer notes

For practical purposes, it's best to review this diff in some component parts. It's not practical to stack the diff into these parts, as these things need to happen at the same time (i.e. a user needs to be able to list, buy, and cancel an offer as soon as we launch support for this feature).

  • Addition of a new screen, Agora, and its navigation / icon (see assets/doge.svg, components/App/App.js, App.test.js, components/Common/CustomIcons.js)
  • Changes to the Token screen, where users can now create Agora offers to sell their tokens (see components/Etokens/Token/index.js and tests)
  • Associated validation functions for agora partial offer creation in validation/index.js and tests
  • The Agora screen, where users can see active offers and cancel their own offers (see components/Agora/index.js, components/Agora/OrderBook.js, and tests in same dir
  • new formatting functions in formatting.js
Test Plan

npm test (new integration tests cover expected behavior or listing, buying, and canceling agora offers; as well as validation)

ping me on telegram for the test URL, make some offers, cancel some offers, partial accept offers, full accept offers, note any UX complaints for future, note any UX complaints that are MVP-critical

Diff Detail

Repository
rABC Bitcoin ABC
Branch
agora-partials-in-cashtab
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 30577
Build 60670: Build Diffcashtab-tests · ecash-lib-tests
Build 60669: arc lint + arc unit

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Failed tests logs:

====== CashTab Unit Tests: <Agora /> We can see multiple offers, some we made, others we did not, and we can cancel an offer ======
Error: Unable to find role="button" and name "Buy Cachet (CACHET)"

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="sc-lcpuFF jfUAAN"
    >
      <div
        class="Toastify"
      />
      <div
        class="sc-bqjOQT ciCLHs"
      >
        <div
          class="sc-jkCMRl ctQUxv"
        >
          <div
            class="sc-jWojfa jGbtQf"
          >
            <img
              alt="cashtab"
              class="sc-kVrTmx cTxXsJ"
              src="test-file-stub"
            />
          </div>
          <div
            class="sc-kEmuub llfLwN"
          >
            <select
              class="sc-bbkauy bqCSoV"
              data-testid="wallet-select"
              id="wallets"
              name="wallets"
            >
              <option
                class="sc-fihHvN djDEBm"
                value="Agora Partial Alpha"
              >
                Agora Partial Alpha
              </option>
              <option
                class="sc-fihHvN djDEBm"
                value="Agora Partial Beta"
              >
                Agora Partial Beta
              </option>
            </select>
            <div
              class="sc-iuDHTM ljrTW"
            >
              <button
                aria-label="Copy ecash:qqpmsv8yh8wwx3lnf92rrc0e6yq97j6zqs8av8vx8h"
                class="sc-cMhqgX fkhNx"
              >
                <svg
                  title="copy-paste"
                />
              </button>
              <div
                class="sc-gFaPwZ bhfoic"
              >
                <div
                  class="sc-fhYwyz kXwmEk"
                >
                  <input
                    checked=""
                    class="sc-bMvGRv dnGmSn"
                    id="show-hide-balance"
                    name="show-hide-balance"
                    title="show-hide-balance"
                    type="checkbox"
                  />
                  <label
                    class="sc-jzgbtB hsNhPD"
                    for="show-hide-balance"
                  >
                    <span
                      class="sc-gJWqzi dYGNll"
                      data-off=""
                      data-on=""
                    />
                    <span
                      class="sc-rBLzX gWpmmy"
                    />
                  </label>
                </div>
              </div>
            </div>
          </div>
          <div
            class="sc-fKGOjr hMNNRp"
            title="Wallet Info"
          >
            <div
              class="sc-dznXNo jKtlQC"
              title="Balance in XEC"
            >
              4,200.00
               
              XEC
               
            </div>
            <div
              class="sc-ekulBa kTuluH"
              title="Balance in Local Currency"
            >
              $
              0.13
               
              USD
            </div>
            <p
              class="sc-ciodno cDVVai"
              title="Price in Local Currency"
            >
              1 
              XEC
               = 
              0.00003000
               
              USD
            </p>
          </div>
          <div
            class="sc-keFjpB hkQwbf"
          >
            <div
              class="sc-jGxEUC cbRPYv"
              title="Active Offers"
            >
              <div
                class="sc-clNaTc kXFjVl"
              >
                <div
                  class="sc-gFaPwZ bhfoic"
                >
                  <div
                    class="sc-fhYwyz kZTqdd"
                  >
                    <input
                      class="sc-bMvGRv dnGmSn"
                      id="Toggle Active Offers"
                      name="Toggle Active Offers"
                      title="Toggle Active Offers"
                      type="checkbox"
                    />
                    <label
                      class="sc-jzgbtB hsNhPD"
                      for="Toggle Active Offers"
                    >
                      <span
                        class="sc-gJWqzi gEydeL"
                        data-off=""
                        data-on=""
                      />
                      <span
                        class="sc-rBLzX hAekJS"
                      />
                    </label>
                  </div>
                </div>
                <div
                  class="sc-bAeIUo lmFIpi"
                >
                  Toggle Buy / Manage Listings
                </div>
              </div>
              <div
                class="sc-jdeSqf jExdeV"
              >
                Token Offers
              </div>
              <div
                class="sc-cBrjTV fueBIc"
              >
                <div
                  class="sc-fkyLDJ gZobKm"
                >
                  Cachet
                   (CACHET)
                </div>
                <div
                  class="sc-fkyLDJ gZobKm"
                >
                  <div
                    class="sc-eopZyb hfvbnD"
                  >
                    <button
                      aria-label="View detailed orderbook for Cachet"
                      class="sc-iCwjlJ eTBPhB"
                      size="64"
                      title="aed861a31b96934b88c0252ede135cb9700d7649f69191235087a3030e553cb1"
                    />
                    <div
                      class="sc-fkyLDJ gZobKm"
                    >
                      <div
                        class="sc-fOICqy jmYJDb"
                      >
                        <a
                          href="https://explorer.e.cash/tx/aed861a31b96934b88c0252ede135cb9700d7649f69191235087a3030e553cb1"
                          rel="noopener noreferrer"
                          target="_blank"
                        >
                          aed
                          ...
                          cb1
                        </a>
                        <button
                          class="sc-cMhqgX fkhNx"
                        >
                          <svg
                            title="copy-paste"
                          />
                        </button>
                      </div>
                    </div>
                  </div>
                  <div
                    class="sc-kNBZmU jpjTkc"
                  >
                    <button
                      class="sc-drlKqa digPev"
                    >
                      <div
                        class="sc-hMrMfs gUcTiO"
                      >
                        $0.00036 USD
                        <div
                          class="sc-eEieub dwJhxI"
                        />
                        <div
                          class="sc-RbTVP hIrcbO"
                        />
                      </div>
                    </button>
                    <button
                      class="sc-drlKqa BlxJE"
                    >
                      <div
                        class="sc-hMrMfs gUcTiO"
                      >
                        $0.0030 USD
                        <div
                          class="sc-eEieub fPfyBq"
                        />
                      </div>
                    </button>
                    <button
                      class="sc-drlKqa BlxJE"
                    >
                      <div
                        class="sc-hMrMfs gUcTiO"
                      >
                        $0.0036 USD
                        <div
                          class="sc-eEieub hoRYgL"
                        />
                      </div>
                    </button>
                  </div>
                </div>
                <div
                  class="sc-jUpvKA gAUqs"
                >
                  <div
                    class="sc-gGBfsJ bcyGFW"
                  >
                    <input
                      aria-labelledby="Select buy qty aed861a31b96934b88c0252ede135cb9700d7649f69191235087a3030e553cb1"
                      class="sc-gxMtzJ dqortC"
                      max="200"
                      min="0.2"
                      name="Select buy qty aed861a31b96934b88c0252ede135cb9700d7649f69191235087a3030e553cb1"
                      step="0.01"
                      type="range"
                      value=".20"
                    />
                    <div
                      class="sc-lhVmIH kOeoRj"
                    />
                  </div>
                  <div
                    class="sc-hzNEM cYtJIu"
                  >
                    .20
                     
                    <button
                      aria-label="Click for more info about agora partial sales"
                      class="sc-cMhqgX fkhNx"
                    >
                      <svg
                        title="More Info"
                      />
                    </button>
                  </div>
                  <div
                    class="sc-jdfcpN dJrnaT"
                  >
                    240.64
                     XEC
                  </div>
                  <div
                    class="sc-jdfcpN dJrnaT"
                  >
                    $0.0072 USD
                  </div>
                </div>
                <div
                  class="sc-fkyLDJ gZobKm"
                >
                  <button
                    class="sc-gwVKww sc-bsbRJL pTBjF"
                  >
                    Cancel your offer
                  </button>
                </div>
                <div
                  class="sc-fkyLDJ gZobKm"
                >
                  Bull
                   (BULL)
                </div>
                <div
                  class="sc-fkyLDJ gZobKm"
                >
                  <div
                    class="sc-eopZyb hfvbnD"
                  >
                    <button
                      aria-label="View detailed orderbook for Bull"
                      class="sc-iCwjlJ dutzjs"
                      size="64"
                      title="01d63c4f4cb496829a6743f7b1805d086ea3877a1dd34b3f92ffba2c9c99f896"
                    />
                    <div
                      class="sc-fkyLDJ gZobKm"
                    >
                      <div
                        class="sc-fOICqy jmYJDb"
                      >
                        <a
                          href="https://explorer.e.cash/tx/01d63c4f4cb496829a6743f7b1805d086ea3877a1dd34b3f92ffba2c9c99f896"
                          rel="noopener noreferrer"
                          target="_blank"
                        >
                          01d
                          ...
                          896
                        </a>
                        <button
                          class="sc-cMhqgX fkhNx"
                        >
                          <svg
                            title="copy-paste"
                          />
                        </button>
                      </div>
                    </div>
                  </div>
                  <div
                    class="sc-kNBZmU jpjTkc"
                  >
                    <button
                      class="sc-drlKqa digPev"
                    >
                      <div
                        class="sc-hMrMfs gUcTiO"
                      >
                        $1.50 USD
                        <div
                          class="sc-eEieub hoRYgL"
                        />
                        <div
                          class="sc-RbTVP bCwGpS"
                        />
                      </div>
                    </button>
                  </div>
                </div>
                <div
                  class="sc-jUpvKA gAUqs"
                >
                  <div
                    class="sc-gGBfsJ bcyGFW"
                  >
                    <input
                      aria-labelledby="Select buy qty 01d63c4f4cb496829a6743f7b1805d086ea3877a1dd34b3f92ffba2c9c99f896"
                      class="sc-gxMtzJ dqortC"
                      max="888"
                      min="8"
                      name="Select buy qty 01d63c4f4cb496829a6743f7b1805d086ea3877a1dd34b3f92ffba2c9c99f896"
                      step="1"
                      type="range"
                      value="8"
                    />
                    <div
                      class="sc-lhVmIH kOeoRj"
                    />
                  </div>
                  <div
                    class="sc-hzNEM cYtJIu"
                  >
                    8
                     
                    <button
                      aria-label="Click for more info about agora partial sales"
                      class="sc-cMhqgX fkhNx"
                    >
                      <svg
                        title="More Info"
                      />
                    </button>
                  </div>
                  <div
                    class="sc-jdfcpN dJrnaT"
                  >
                    400.42k
                     XEC
                  </div>
                  <div
                    class="sc-jdfcpN dJrnaT"
                  >
                    $12.01 USD
                  </div>
                </div>
                <div
                  class="sc-fkyLDJ gZobKm"
                >
                  <button
                    class="sc-gwVKww sc-bsbRJL pTBjF"
                  >
                    Cancel your offer
                  </button>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div
          class="sc-crNyjn cQUqEl"
        >
          <button
            class="sc-AnqlK iRGchy"
          >
            <svg />
          </button>
          <button
            aria-label="Send Screen"
            class="sc-AnqlK iRGchy"
            style="padding-bottom: 10px;"
          >
            <div
              class="sc-iwsKbI cuDgAv"
            >
              <svg
                title="tx-sent"
              />
            </div>
          </button>
          <button
            aria-label="Tokens"
            class="sc-AnqlK iRGchy"
          >
            <svg
              title="Tokens"
            />
          </button>
          <button
            aria-label="Receive"
            class="sc-AnqlK iRGchy"
          >
            <svg
              title="tx-received"
            />
          </button>
          <div
            class="sc-cpHetk eGlqrn"
            title="Show Other Screens"
          >
            <span
              class="sc-nrwXf idwaAr"
            />
            <div
              class="sc-eitiEO kusZKh"
              title="Other Screens"
            >
              <button
                class="sc-bhlBdH fJIiVN"
              >
                 
                <p>
                  Wallet Backup
                </p>
                <svg
                  title="wallet"
                />
              </button>
              <button
                class="sc-bhlBdH fJIiVN"
              >
                 
                <p>
                  Wallets
                </p>
                <svg
                  title="wallets"
                />
              </button>
              <button
                class="sc-bhlBdH fJIiVN"
              >
                 
                <p>
                  Listed NFTs
                </p>
                <svg
                  title="NFT"
                />
              </button>
              <button
                class="sc-bhlBdH fJIiVN"
              >
                 
                <p>
                  Swap
                </p>
                <svg
                  title="Meme Agora"
                />
              </button>
              <button
                class="sc-bhlBdH fJIiVN"
              >
                 
                <p>
                  Contacts
                </p>
                <svg
                  title="Contact List"
                />
              </button>
              <button
                class="sc-bhlBdH fJIiVN"
              >
                 
                <p>
                  Airdrop
                </p>
                <svg
                  title="tx-airdrop"
                />
              </button>
              <button
                class="sc-bhlBdH fJIiVN"
              >
                 
                <p>
                  Rewards
                </p>
                <svg
                  title="Cashtab Rewards"
                />
              </button>
              <button
                class="sc-bhlBdH fJIiVN"
              >
                 
                <p>
                  Sideshift
                </p>
                <svg
                  title="swap"
                />
              </button>
              <button
                class="sc-bhlBdH fJIiVN"
              >
                <p>
                  Sign & Verify
                </p>
                <svg
                  class="sc-htpNat bPFBeM"
                />
              </button>
              <button
                class="sc-bhlBdH fJIiVN"
              >
                <p>
                  Settings
                </p>
                <svg
                  title="settings"
                />
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</body>
    at waitForWrapper (/work/cashtab/node_modules/@testing-library/dom/dist/wait-for.js:163:27)
    at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:86:33
    at Object.findByRole (/work/cashtab/src/components/Agora/__tests__/index.test.js:492:26)

Each failure log is accessible here:
CashTab Unit Tests: <Agora /> We can see multiple offers, some we made, others we did not, and we can cancel an offer

Failed tests logs:

====== CashTab Unit Tests: <Agora /> We can see multiple offers, some we made, others we did not, and we can cancel an offer ======
Error: Unable to find role="button" and name "Buy Cachet (CACHET)"

Ignored nodes: comments, script, style
<body>
  <div>
    <div
      class="sc-lcpuFF jfUAAN"
    >
      <div
        class="Toastify"
      />
      <div
        class="sc-bqjOQT ciCLHs"
      >
        <div
          class="sc-jkCMRl ctQUxv"
        >
          <div
            class="sc-jWojfa jGbtQf"
          >
            <img
              alt="cashtab"
              class="sc-kVrTmx cTxXsJ"
              src="test-file-stub"
            />
          </div>
          <div
            class="sc-kEmuub llfLwN"
          >
            <select
              class="sc-bbkauy bqCSoV"
              data-testid="wallet-select"
              id="wallets"
              name="wallets"
            >
              <option
                class="sc-fihHvN djDEBm"
                value="Agora Partial Alpha"
              >
                Agora Partial Alpha
              </option>
              <option
                class="sc-fihHvN djDEBm"
                value="Agora Partial Beta"
              >
                Agora Partial Beta
              </option>
            </select>
            <div
              class="sc-iuDHTM ljrTW"
            >
              <button
                aria-label="Copy ecash:qqpmsv8yh8wwx3lnf92rrc0e6yq97j6zqs8av8vx8h"
                class="sc-cMhqgX fkhNx"
              >
                <svg
                  title="copy-paste"
                />
              </button>
              <div
                class="sc-gFaPwZ bhfoic"
              >
                <div
                  class="sc-fhYwyz kXwmEk"
                >
                  <input
                    checked=""
                    class="sc-bMvGRv dnGmSn"
                    id="show-hide-balance"
                    name="show-hide-balance"
                    title="show-hide-balance"
                    type="checkbox"
                  />
                  <label
                    class="sc-jzgbtB hsNhPD"
                    for="show-hide-balance"
                  >
                    <span
                      class="sc-gJWqzi dYGNll"
                      data-off=""
                      data-on=""
                    />
                    <span
                      class="sc-rBLzX gWpmmy"
                    />
                  </label>
                </div>
              </div>
            </div>
          </div>
          <div
            class="sc-fKGOjr hMNNRp"
            title="Wallet Info"
          >
            <div
              class="sc-dznXNo jKtlQC"
              title="Balance in XEC"
            >
              4,200.00
               
              XEC
               
            </div>
            <div
              class="sc-ekulBa kTuluH"
              title="Balance in Local Currency"
            >
              $
              0.13
               
              USD
            </div>
            <p
              class="sc-ciodno cDVVai"
              title="Price in Local Currency"
            >
              1 
              XEC
               = 
              0.00003000
               
              USD
            </p>
          </div>
          <div
            class="sc-keFjpB hkQwbf"
          >
            <div
              class="sc-jGxEUC cbRPYv"
              title="Active Offers"
            >
              <div
                class="sc-clNaTc kXFjVl"
              >
                <div
                  class="sc-gFaPwZ bhfoic"
                >
                  <div
                    class="sc-fhYwyz kZTqdd"
                  >
                    <input
                      class="sc-bMvGRv dnGmSn"
                      id="Toggle Active Offers"
                      name="Toggle Active Offers"
                      title="Toggle Active Offers"
                      type="checkbox"
                    />
                    <label
                      class="sc-jzgbtB hsNhPD"
                      for="Toggle Active Offers"
                    >
                      <span
                        class="sc-gJWqzi gEydeL"
                        data-off=""
                        data-on=""
                      />
                      <span
                        class="sc-rBLzX hAekJS"
                      />
                    </label>
                  </div>
                </div>
                <div
                  class="sc-bAeIUo lmFIpi"
                >
                  Toggle Buy / Manage Listings
                </div>
              </div>
              <div
                class="sc-jdeSqf jExdeV"
              >
                Token Offers
              </div>
              <div
                class="sc-cBrjTV fueBIc"
              >
                <div
                  class="sc-fkyLDJ gZobKm"
                >
                  Cachet
                   (CACHET)
                </div>
                <div
                  class="sc-fkyLDJ gZobKm"
                >
                  <div
                    class="sc-eopZyb hfvbnD"
                  >
                    <button
                      aria-label="View detailed orderbook for Cachet"
                      class="sc-iCwjlJ eTBPhB"
                      size="64"
                      title="aed861a31b96934b88c0252ede135cb9700d7649f69191235087a3030e553cb1"
                    />
                    <div
                      class="sc-fkyLDJ gZobKm"
                    >
                      <div
                        class="sc-fOICqy jmYJDb"
                      >
                        <a
                          href="https://explorer.e.cash/tx/aed861a31b96934b88c0252ede135cb9700d7649f69191235087a3030e553cb1"
                          rel="noopener noreferrer"
                          target="_blank"
                        >
                          aed
                          ...
                          cb1
                        </a>
                        <button
                          class="sc-cMhqgX fkhNx"
                        >
                          <svg
                            title="copy-paste"
                          />
                        </button>
                      </div>
                    </div>
                  </div>
                  <div
                    class="sc-kNBZmU jpjTkc"
                  >
                    <button
                      class="sc-drlKqa digPev"
                    >
                      <div
                        class="sc-hMrMfs gUcTiO"
                      >
                        $0.00036 USD
                        <div
                          class="sc-eEieub dwJhxI"
                        />
                        <div
                          class="sc-RbTVP hIrcbO"
                        />
                      </div>
                    </button>
                    <button
                      class="sc-drlKqa BlxJE"
                    >
                      <div
                        class="sc-hMrMfs gUcTiO"
                      >
                        $0.0030 USD
                        <div
                          class="sc-eEieub fPfyBq"
                        />
                      </div>
                    </button>
                    <button
                      class="sc-drlKqa BlxJE"
                    >
                      <div
                        class="sc-hMrMfs gUcTiO"
                      >
                        $0.0036 USD
                        <div
                          class="sc-eEieub hoRYgL"
                        />
                      </div>
                    </button>
                  </div>
                </div>
                <div
                  class="sc-jUpvKA gAUqs"
                >
                  <div
                    class="sc-gGBfsJ bcyGFW"
                  >
                    <input
                      aria-labelledby="Select buy qty aed861a31b96934b88c0252ede135cb9700d7649f69191235087a3030e553cb1"
                      class="sc-gxMtzJ dqortC"
                      max="200"
                      min="0.2"
                      name="Select buy qty aed861a31b96934b88c0252ede135cb9700d7649f69191235087a3030e553cb1"
                      step="0.01"
                      type="range"
                      value=".20"
                    />
                    <div
                      class="sc-lhVmIH kOeoRj"
                    />
                  </div>
                  <div
                    class="sc-hzNEM cYtJIu"
                  >
                    .20
                     
                    <button
                      aria-label="Click for more info about agora partial sales"
                      class="sc-cMhqgX fkhNx"
                    >
                      <svg
                        title="More Info"
                      />
                    </button>
                  </div>
                  <div
                    class="sc-jdfcpN dJrnaT"
                  >
                    240.64
                     XEC
                  </div>
                  <div
                    class="sc-jdfcpN dJrnaT"
                  >
                    $0.0072 USD
                  </div>
                </div>
                <div
                  class="sc-fkyLDJ gZobKm"
                >
                  <button
                    class="sc-gwVKww sc-bsbRJL pTBjF"
                  >
                    Cancel your offer
                  </button>
                </div>
                <div
                  class="sc-fkyLDJ gZobKm"
                >
                  Bull
                   (BULL)
                </div>
                <div
                  class="sc-fkyLDJ gZobKm"
                >
                  <div
                    class="sc-eopZyb hfvbnD"
                  >
                    <button
                      aria-label="View detailed orderbook for Bull"
                      class="sc-iCwjlJ dutzjs"
                      size="64"
                      title="01d63c4f4cb496829a6743f7b1805d086ea3877a1dd34b3f92ffba2c9c99f896"
                    />
                    <div
                      class="sc-fkyLDJ gZobKm"
                    >
                      <div
                        class="sc-fOICqy jmYJDb"
                      >
                        <a
                          href="https://explorer.e.cash/tx/01d63c4f4cb496829a6743f7b1805d086ea3877a1dd34b3f92ffba2c9c99f896"
                          rel="noopener noreferrer"
                          target="_blank"
                        >
                          01d
                          ...
                          896
                        </a>
                        <button
                          class="sc-cMhqgX fkhNx"
                        >
                          <svg
                            title="copy-paste"
                          />
                        </button>
                      </div>
                    </div>
                  </div>
                  <div
                    class="sc-kNBZmU jpjTkc"
                  >
                    <button
                      class="sc-drlKqa digPev"
                    >
                      <div
                        class="sc-hMrMfs gUcTiO"
                      >
                        $1.50 USD
                        <div
                          class="sc-eEieub hoRYgL"
                        />
                        <div
                          class="sc-RbTVP bCwGpS"
                        />
                      </div>
                    </button>
                  </div>
                </div>
                <div
                  class="sc-jUpvKA gAUqs"
                >
                  <div
                    class="sc-gGBfsJ bcyGFW"
                  >
                    <input
                      aria-labelledby="Select buy qty 01d63c4f4cb496829a6743f7b1805d086ea3877a1dd34b3f92ffba2c9c99f896"
                      class="sc-gxMtzJ dqortC"
                      max="888"
                      min="8"
                      name="Select buy qty 01d63c4f4cb496829a6743f7b1805d086ea3877a1dd34b3f92ffba2c9c99f896"
                      step="1"
                      type="range"
                      value="8"
                    />
                    <div
                      class="sc-lhVmIH kOeoRj"
                    />
                  </div>
                  <div
                    class="sc-hzNEM cYtJIu"
                  >
                    8
                     
                    <button
                      aria-label="Click for more info about agora partial sales"
                      class="sc-cMhqgX fkhNx"
                    >
                      <svg
                        title="More Info"
                      />
                    </button>
                  </div>
                  <div
                    class="sc-jdfcpN dJrnaT"
                  >
                    400.42k
                     XEC
                  </div>
                  <div
                    class="sc-jdfcpN dJrnaT"
                  >
                    $12.01 USD
                  </div>
                </div>
                <div
                  class="sc-fkyLDJ gZobKm"
                >
                  <button
                    class="sc-gwVKww sc-bsbRJL pTBjF"
                  >
                    Cancel your offer
                  </button>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div
          class="sc-crNyjn cQUqEl"
        >
          <button
            class="sc-AnqlK iRGchy"
          >
            <svg />
          </button>
          <button
            aria-label="Send Screen"
            class="sc-AnqlK iRGchy"
            style="padding-bottom: 10px;"
          >
            <div
              class="sc-iwsKbI cuDgAv"
            >
              <svg
                title="tx-sent"
              />
            </div>
          </button>
          <button
            aria-label="Tokens"
            class="sc-AnqlK iRGchy"
          >
            <svg
              title="Tokens"
            />
          </button>
          <button
            aria-label="Receive"
            class="sc-AnqlK iRGchy"
          >
            <svg
              title="tx-received"
            />
          </button>
          <div
            class="sc-cpHetk eGlqrn"
            title="Show Other Screens"
          >
            <span
              class="sc-nrwXf idwaAr"
            />
            <div
              class="sc-eitiEO kusZKh"
              title="Other Screens"
            >
              <button
                class="sc-bhlBdH fJIiVN"
              >
                 
                <p>
                  Wallet Backup
                </p>
                <svg
                  title="wallet"
                />
              </button>
              <button
                class="sc-bhlBdH fJIiVN"
              >
                 
                <p>
                  Wallets
                </p>
                <svg
                  title="wallets"
                />
              </button>
              <button
                class="sc-bhlBdH fJIiVN"
              >
                 
                <p>
                  Listed NFTs
                </p>
                <svg
                  title="NFT"
                />
              </button>
              <button
                class="sc-bhlBdH fJIiVN"
              >
                 
                <p>
                  Swap
                </p>
                <svg
                  title="Meme Agora"
                />
              </button>
              <button
                class="sc-bhlBdH fJIiVN"
              >
                 
                <p>
                  Contacts
                </p>
                <svg
                  title="Contact List"
                />
              </button>
              <button
                class="sc-bhlBdH fJIiVN"
              >
                 
                <p>
                  Airdrop
                </p>
                <svg
                  title="tx-airdrop"
                />
              </button>
              <button
                class="sc-bhlBdH fJIiVN"
              >
                 
                <p>
                  Rewards
                </p>
                <svg
                  title="Cashtab Rewards"
                />
              </button>
              <button
                class="sc-bhlBdH fJIiVN"
              >
                 
                <p>
                  Sideshift
                </p>
                <svg
                  title="swap"
                />
              </button>
              <button
                class="sc-bhlBdH fJIiVN"
              >
                <p>
                  Sign & Verify
                </p>
                <svg
                  class="sc-htpNat bPFBeM"
                />
              </button>
              <button
                class="sc-bhlBdH fJIiVN"
              >
                <p>
                  Settings
                </p>
                <svg
                  title="settings"
                />
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</body>
    at waitForWrapper (/work/cashtab/node_modules/@testing-library/dom/dist/wait-for.js:163:27)
    at /work/cashtab/node_modules/@testing-library/dom/dist/query-helpers.js:86:33
    at Object.findByRole (/work/cashtab/src/components/Agora/__tests__/index.test.js:492:26)

Each failure log is accessible here:
CashTab Unit Tests: <Agora /> We can see multiple offers, some we made, others we did not, and we can cancel an offer

remove agora dir, use more auspicious const secret key, add more checks to integration test to confirm wallet switch and improve flakiness

sort listings by tokenId, improve formatting functions

Tail of the build log:

1 moderate severity vulnerability

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecash-agora@0.1.1 build
> tsc && tsc -p ./tsconfig.build.json

/work/cashtab /work/modules/ecash-agora /work/modules/ecash-lib /work/modules/ecash-lib-wasm /work/modules/ecash-script /work/modules/chronik-client /work/modules/mock-chronik-client /work/modules/ecashaddrjs /work/abc-ci-builds/cashtab-tests
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated @babel/plugin-proposal-private-methods@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.
npm warn deprecated @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
npm warn deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
npm warn deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm warn deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
npm warn deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
npm warn deprecated workbox-cacheable-response@6.6.0: workbox-background-sync@6.6.0
npm warn deprecated workbox-google-analytics@6.6.0: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained
npm warn deprecated domexception@4.0.0: Use your platform's native DOMException instead
npm warn deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
npm warn deprecated @babel/plugin-proposal-private-property-in-object@7.21.11: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead.
npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 1652 packages, and audited 1658 packages in 16s

269 packages are looking for funding
  run `npm fund` for details

8 low severity vulnerabilities

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

> cashtab@2.45.3 build
> node scripts/build.js

Creating an optimized production build...
Failed to compile.

[eslint] 
src/utils/formatting.js
  Line 7:10:  'supportedFiatCurrencies' is defined but never used  no-unused-vars

Search for the keywords to learn more about each error.


Build cashtab-tests failed with exit code 1

Failed tests logs:

====== CashTab Unit Tests: Correctly executes formatting functions We can determine how many decimal places we need to show at least 2 places of precision determinePrecision: Smallest supported price ======
Error: expect(received).toBe(expected) // Object.is equality

Expected: 21
Received: 20
    at Object.toBe (/work/cashtab/src/utils/__tests__/formatting.test.js:165:52)
    at Promise.then.completed (/work/cashtab/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/work/cashtab/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (/work/cashtab/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at _runTest (/work/cashtab/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (/work/cashtab/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (/work/cashtab/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (/work/cashtab/node_modules/jest-circus/build/run.js:121:9)
    at run (/work/cashtab/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (/work/cashtab/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/work/cashtab/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (/work/cashtab/node_modules/jest-runner/build/testWorker.js:106:12)
====== CashTab Unit Tests: Correctly executes formatting functions We can determine how many decimal places we need to show at least 2 places of precision determinePrecision: Going smaller, which would need 22 decimals to cover 2 precision digits, we still get 21 ======
Error: expect(received).toBe(expected) // Object.is equality

Expected: 21
Received: 20
    at Object.toBe (/work/cashtab/src/utils/__tests__/formatting.test.js:165:52)
    at Promise.then.completed (/work/cashtab/node_modules/jest-circus/build/utils.js:298:28)
    at new Promise (<anonymous>)
    at callAsyncCircusFn (/work/cashtab/node_modules/jest-circus/build/utils.js:231:10)
    at _callCircusTest (/work/cashtab/node_modules/jest-circus/build/run.js:316:40)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at _runTest (/work/cashtab/node_modules/jest-circus/build/run.js:252:3)
    at _runTestsForDescribeBlock (/work/cashtab/node_modules/jest-circus/build/run.js:126:9)
    at _runTestsForDescribeBlock (/work/cashtab/node_modules/jest-circus/build/run.js:121:9)
    at _runTestsForDescribeBlock (/work/cashtab/node_modules/jest-circus/build/run.js:121:9)
    at run (/work/cashtab/node_modules/jest-circus/build/run.js:71:3)
    at runAndTransformResultsToJestFormat (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)
    at jestAdapter (/work/cashtab/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)
    at runTestInternal (/work/cashtab/node_modules/jest-runner/build/runTest.js:367:16)
    at runTest (/work/cashtab/node_modules/jest-runner/build/runTest.js:444:34)
    at Object.worker (/work/cashtab/node_modules/jest-runner/build/testWorker.js:106:12)

Each failure log is accessible here:
CashTab Unit Tests: Correctly executes formatting functions We can determine how many decimal places we need to show at least 2 places of precision determinePrecision: Smallest supported price
CashTab Unit Tests: Correctly executes formatting functions We can determine how many decimal places we need to show at least 2 places of precision determinePrecision: Going smaller, which would need 22 decimals to cover 2 precision digits, we still get 21

lint (remove rebase-related duplicate key in test fixtures)

Tail of the build log:

60 packages are looking for funding
  run `npm fund` for details

1 moderate severity vulnerability

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecash-agora@0.1.1 build
> tsc && tsc -p ./tsconfig.build.json

/work/cashtab /work/modules/ecash-agora /work/modules/ecash-lib /work/modules/ecash-lib-wasm /work/modules/ecash-script /work/modules/chronik-client /work/modules/mock-chronik-client /work/modules/ecashaddrjs /work/abc-ci-builds/cashtab-tests
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated @babel/plugin-proposal-private-methods@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.
npm warn deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
npm warn deprecated @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
npm warn deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm warn deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
npm warn deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
npm warn deprecated workbox-cacheable-response@6.6.0: workbox-background-sync@6.6.0
npm warn deprecated workbox-google-analytics@6.6.0: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained
npm warn deprecated domexception@4.0.0: Use your platform's native DOMException instead
npm warn deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
npm warn deprecated @babel/plugin-proposal-private-property-in-object@7.21.11: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead.
npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 1652 packages, and audited 1658 packages in 16s

269 packages are looking for funding
  run `npm fund` for details

8 low severity vulnerabilities

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

> cashtab@2.45.10 build
> node scripts/build.js

Creating an optimized production build...
Failed to compile.

Attempted import error: 'modalScroll' is not exported from 'components/Common/Modal' (imported as 'modalScroll').


Build cashtab-tests failed with exit code 1

Tail of the build log:

60 packages are looking for funding
  run `npm fund` for details

1 moderate severity vulnerability

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecash-agora@0.1.1 build
> tsc && tsc -p ./tsconfig.build.json

/work/cashtab /work/modules/ecash-agora /work/modules/ecash-lib /work/modules/ecash-lib-wasm /work/modules/ecash-script /work/modules/chronik-client /work/modules/mock-chronik-client /work/modules/ecashaddrjs /work/abc-ci-builds/cashtab-tests
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated @babel/plugin-proposal-private-methods@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.
npm warn deprecated @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
npm warn deprecated @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
npm warn deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm warn deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
npm warn deprecated rollup-plugin-terser@7.0.2: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
npm warn deprecated workbox-cacheable-response@6.6.0: workbox-background-sync@6.6.0
npm warn deprecated workbox-google-analytics@6.6.0: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained
npm warn deprecated domexception@4.0.0: Use your platform's native DOMException instead
npm warn deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
npm warn deprecated @babel/plugin-proposal-private-property-in-object@7.21.11: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead.
npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 1652 packages, and audited 1658 packages in 16s

269 packages are looking for funding
  run `npm fund` for details

8 low severity vulnerabilities

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

> cashtab@2.45.10 build
> node scripts/build.js

Creating an optimized production build...
Failed to compile.

Attempted import error: 'modalScroll' is not exported from 'components/Common/Modal' (imported as 'modalScroll').


Build cashtab-tests failed with exit code 1

rebase, better price formatting

rebase, remove debug log and todo statements from PartialOffer.js, improve comments

support multiple inputs for agora accept or cancel txs

make sure we only use spendable utxos for txs

improve comments, remove debug logs, improve toastify for ad setup tx, diff cleanup

Failed tests logs:

====== CashTab Unit Tests: <Token /> available actions rendered We can list an SLP1 fungible token ======
Error: expect(element).toHaveValue(null)

Expected the element to have value:
  null
Received:
  0
    at Object.toHaveValue (/work/cashtab/src/components/Etokens/__tests__/TokenActions.test.js:365:28)

Each failure log is accessible here:
CashTab Unit Tests: <Token /> available actions rendered We can list an SLP1 fungible token

patch test with input type change

rebase, update OrderBook with updated ecash-agora

validation improvement, fix useEffect issues on OrderBook component (auto-select min buy amount when new offer selected)

remove TODO for things with diff up in ecash-agora, remove unrelated line break change

bytesofman edited the test plan for this revision. (Show Details)

patch bug in determining price validation error on min buy change

emack requested changes to this revision.Oct 22 2024, 12:44
emack added a subscriber: emack.

WSOD as per tg chat

This revision now requires changes to proceed.Oct 22 2024, 12:44

rebase, handle OrderBook rendering when token cache info is not available

emack requested changes to this revision.Oct 23 2024, 13:36

Pretty cool seeing an orderbook on ecash!

UI/UX

  • Buying a partial 1000 EWP shows up in tx history as having send 999M EWP, presumably this is the token change?
  • No error notification when attempting to buy with insufficient balance, only an exception thrown in console log
    image.png (234×517 px, 18 KB)
  • The listings on the Agora page would get really long within the first hour of launch. Even as an MVP it's going to be an issue that may turn people away from the feature. Have you considered a dropdown list of tokens which dynamically updates the slider, button...etc?
  • Right after listing a partial ad it's not intuitive to new users that they should navigate to Agora to see the listing. Perhaps auto route to the agora component upon successful tx broadcast?
  • It's also not intuitive that the Agora feature only extends to SLP1 tokens at the moment. Maybe for another diff, but worth redesigning navigation menus to make it obvious Agora belongs to tokens and Listed NFTs belongs to collections and NFTs.
  • Since there's the Buy/Manage toggle I don't think you need to display the wallet's own listings in the Buy list
  • is there meant to be the icon rendered here? Otherwise there's a lot of redundant space
    image.png (362×440 px, 62 KB)
  • can use an XEC/token rate beside the fiat/token rate
    image.png (134×505 px, 26 KB)
  • Let me know if you want a video guide on this for launch
cashtab/src/components/Agora/OrderBook.js
75 ↗(On Diff #50282)

I can't work out the context behind this. Is it because you don't have the sk/pk of the p2sh address?

cashtab/src/components/Agora/__tests__/index.test.js
673 ↗(On Diff #50282)

Needs:

  • buying with insufficient balance
  • buying with fresh new wallet with no UTXOs
This revision now requires changes to proceed.Oct 23 2024, 13:36
bytesofman marked 2 inline comments as done.

rebase, use hardcoded dummy sk pk for accepting agora, error notifications for unaffordable agora accepts and cancels, include icon in accept modal

Buying a partial 1000 EWP shows up in tx history as having send 999M EWP, presumably this is the token change?

I will need to go through and parse txs for a lot of this stuff. imo should be its own diff. I'm not sure what is going on in this specific tx, but that is probably the case. When you accept an agora tx, you get the txs you bought as an output to your address. The txs you didn't buy are sent back to a new agora partial. So, Cashtab is probably saying you sent those tokens -- since the sending addr of the buy address is you.

Will need a diff with tests + examples that parses this correctly as "bought 1000 ewp." It's ugly but I think we can launch with it...this is still a problem with NFTs too.

No error notification when attempting to buy with insufficient balance, only an exception thrown in console log

good catch, patched

The listings on the Agora page would get really long within the first hour of launch. Even as an MVP it's going to be an issue that may turn people away from the feature. Have you considered a dropdown list of tokens which dynamically updates the slider, button...etc?

Probably true. I don't think we can worry about this in the MVP though. Really if it is that popular, great. There are various approaches to optimizing the loadtime. The reason I haven't done it yet is bc I think the "right" way to do it is to sort by trading volume. But, I need to write methods to get volume. I think the price information is super important. We could speed it up, for example, by only showing the tokens that are for sale first, and then the user clicks to see them. But I think we need to show the spot price of the various offers for it to really be a market. So ... this is a known issue. Depending on the impact we see, we can mitigate quickly if needed.

Right after listing a partial ad it's not intuitive to new users that they should navigate to Agora to see the listing. Perhaps auto route to the agora component upon successful tx broadcast?

This makes it really annoying to make an orderbook as a seller. With an NFT, you list it --- now there is no NFT, no reason not to redirect. But in this case the user may wish to make multiple offers. We could have a pop-up but imo it's also annoying. It's the kind of thing I don't want to assume users wants, but can add later if it's an issue.

It's also not intuitive that the Agora feature only extends to SLP1 tokens at the moment. Maybe for another diff, but worth redesigning navigation menus to make it obvious Agora belongs to tokens and Listed NFTs belongs to collections and NFTs.

Yeah. Not sure best way to deal with this. I think going forward, "Agora" should be the master component. Then users can filter for tokens or NFTs. But I don't think this is practical to do until we have optimized loading for each, which is still pending getting volume and trading stats.

Since there's the Buy/Manage toggle I don't think you need to display the wallet's own listings in the Buy list

I considered hiding them but I think it is useful to see the whole orderbook. We are already loading them all. But yes, similar to above points -- should consider this when we start to optimize presentation. I think it's ok to leave this in the MVP.

is there meant to be the icon rendered here? Otherwise there's a lot of redundant space

good point. adjusted the size and added the icon:

image.png (288×309 px, 55 KB)

can use an XEC/token rate beside the fiat/token rate

I don't think there's room for this. IMO most people think about prices in fiat terms. The way it's set up now, prices appear in XEC if fiat rates fail to load. The confirmation modal shows the actual price in XEC and fiat.

Let me know if you want a video guide on this for launch

This would be useful. Mb at least explaining some key points

  • how to list
  • how and why listings are for weird amounts (usually not round numbers, usually not exactly matching user inputs)
  • how to accept and how to cancel

the agora screen itself will probably change, but the OrderBook component probably won't change too much.

cashtab/src/components/Agora/OrderBook.js
75 ↗(On Diff #50282)

artifact. removed now that dummy_sk and dummy_pk are defined in mocks.

Originally I had it here because you need to wait for ecc to be available to calculate the pk, assuming you don't have it stashed hardcoded somewhere.

You'll have to ping Tobias or do a deep dive to get into the rationale behind needing an arbitary (non-secret) keypair to accept agora offers. But he said using a constant was fine.

cashtab/src/components/Agora/__tests__/index.test.js
673 ↗(On Diff #50282)

Added a test for a wallet with no utxos, showing the expected error notification is triggered.

imo overkill to do multiple integration tests for the same condition (no utxos and not enough utxos) -- the unit tests for this function confirm the error, one integration test confirms the notification.

This revision is now accepted and ready to land.Oct 24 2024, 02:01

patch step size calculation for token listing input