Page MenuHomePhabricator

[Cashtab] Convert Token, validation, and other deps to ts
DraftPublic

Authored by bytesofman on Sat, Nov 16, 15:25.
This is a draft revision that has not yet been submitted for review.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

Convert Token screen to ts as prep for refactor to improve extensability to other token types.

Implement ts in deps important to this conversion, like validation, and its deps.

Test Plan

npm test

Diff Detail

Repository
rABC Bitcoin ABC
Branch
token-to-ts
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 31176
Build 61852: Build Diffcashtab-tests
Build 61851: arc lint + arc unit

Event Timeline

Tail of the build log:

1 moderate severity vulnerability

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecash-lib@0.2.1 build
> tsc && tsc -p ./tsconfig.build.json && cp -r ./src/ffi ./dist

Installing ecash-agora dependencies...
/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

added 364 packages, and audited 367 packages in 2s

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

added 1483 packages, and audited 3329 packages in 25s

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

3 vulnerabilities (2 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

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

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

TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
  Type 'undefined' is not assignable to type 'string'.
    299 |     // Check if the user has mint batons for this token
    300 |     // If they don't, disable the mint switch and label why
  > 301 |     const mintBatons = getMintBatons(wallet.state.slpUtxos, tokenId);
        |                                                             ^^^^^^^
    302 |
    303 |     // Load with QR code open if device is mobile
    304 |     const openWithScanner =


Build cashtab-tests failed with exit code 1