Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(toSlpRegtestAddress): #37

Closed

Conversation

SuperCipher
Copy link

exposing toSlpRegtestAddress from bchaddrjs-slp

@@ -1,4 +1,4 @@
import * as Bchaddr from "bchaddrjs-slp";
import * as Bchaddr from "bchaddrjs-slp-2";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this library being used? Afaict there isn't any difference other than the -2 version is behind by 1 commit.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the current bchaddrjs-slp don't have toSlpRegtestAddress.

npm run build                                                                                                    ⮂

> [email protected] build /Users/naach/dev/af/slpjs
> tsc && mkdirp dist && browserify index.js --standalone slpjs > dist/slpjs.js && uglifyjs dist/slpjs.js > dist/slpjs.min.js

lib/utils.ts:42:24 - error TS2339: Property 'toSlpRegtestAddress' does not exist on type 'typeof import("bchaddrjs-slp")'.

42         return Bchaddr.toSlpRegtestAddress(address);
                          ~~~~~~~~~~~~~~~~~~~


Found 1 error.

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] build: `tsc && mkdirp dist && browserify index.js --standalone slpjs > dist/slpjs.js && uglifyjs dist/slpjs.js > dist/slpjs.min.js`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/naach/.npm/_logs/2021-03-01T09_39_56_001Z-debug.log

(base)  ~/dev/af/slpjs ⮀ feature/toSlpRegtestAddress● ⮀ 116d2h59m ⮀ node -v                                                                                                          ⮂
v12.21.0

but I was able to get toSlpRegtestAddress working here for some reason
https://repl.it/@SuperCipher/bchaddr-test#index.js

@@ -6,15 +6,16 @@
"downlevelIteration": true,
"moduleResolution": "node",
"esModuleInterop": true,
"lib":[ "es2017" ],
"lib":[ "es2017","dom" ],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is "dom" being included?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a fix for an error tsc can't find element
https://stackoverflow.com/questions/57999416/typescript-puppeteer-library-error-cannot-find-name-element

npm run build                                                                                                                             ⮂

> [email protected] build /Users/naach/dev/af/slpjs
> npx tsc && mkdirp dist && browserify index.js --standalone slpjs > dist/slpjs.js && uglifyjs dist/slpjs.js > dist/slpjs.min.js

../../node_modules/@types/sizzle/index.d.ts:14:35 - error TS2304: Cannot find name 'Element'.

14     <TArrayLike extends ArrayLike<Element>>(selector: string, context: Element | Document | DocumentFragment, results: TArrayLike): TArrayLike;
                                     ~~~~~~~

../../node_modules/@types/sizzle/index.d.ts:14:72 - error TS2304: Cannot find name 'Element'.

14     <TArrayLike extends ArrayLike<Element>>(selector: string, context: Element | Document | DocumentFragment, results: TArrayLike): TArrayLike;
                                                                          ~~~~~~~

../../node_modules/@types/sizzle/index.d.ts:14:82 - error TS2304: Cannot find name 'Document'.

14     <TArrayLike extends ArrayLike<Element>>(selector: string, context: Element | Document | DocumentFragment, results: TArrayLike): TArrayLike;
                                                                                    ~~~~~~~~

../../node_modules/@types/sizzle/index.d.ts:14:93 - error TS2304: Cannot find name 'DocumentFragment'.

14     <TArrayLike extends ArrayLike<Element>>(selector: string, context: Element | Document | DocumentFragment, results: TArrayLike): TArrayLike;
                                                                                               ~~~~~~~~~~~~~~~~

../../node_modules/@types/sizzle/index.d.ts:15:34 - error TS2304: Cannot find name 'Element'.

15     (selector: string, context?: Element | Document | DocumentFragment): Element[];
                                    ~~~~~~~

../../node_modules/@types/sizzle/index.d.ts:15:44 - error TS2304: Cannot find name 'Document'.

15     (selector: string, context?: Element | Document | DocumentFragment): Element[];
                                              ~~~~~~~~

../../node_modules/@types/sizzle/index.d.ts:15:55 - error TS2304: Cannot find name 'DocumentFragment'.

15     (selector: string, context?: Element | Document | DocumentFragment): Element[];
                                                         ~~~~~~~~~~~~~~~~

../../node_modules/@types/sizzle/index.d.ts:15:74 - error TS2304: Cannot find name 'Element'.

15     (selector: string, context?: Element | Document | DocumentFragment): Element[];
                                                                            ~~~~~~~

../../node_modules/@types/sizzle/index.d.ts:18:28 - error TS2304: Cannot find name 'Element'.

18     matchSelector(element: Element, selector: string): boolean;
                              ~~~~~~~

../../node_modules/@types/sizzle/index.d.ts:19:41 - error TS2304: Cannot find name 'Element'.

"declaration": true,
"sourceMap": true,
"plugins": [
{ "name": "typescript-tslint-plugin" }
]
},
"include": [
"lib/**/*.ts"
"lib/**/*.ts",
"./typings-custom/**/*.ts"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not able to find any "typings-custom" files. Why is this needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I forgot to remove that, it's actually not necessary.

@jcramer
Copy link
Contributor

jcramer commented Apr 11, 2021

Closing this, as we've discussed elsewhere. See simpleledger/SLPDB#82.

@jcramer jcramer closed this Apr 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants