Closed ItsMisterP closed 1 month ago
Sorry I can't help you with these issues @ItsMisterP, but I'm interested in following the conversation so I'm commenting here.
Also, if you're in the Dash Discord, please DM me. I need an Angular dev for one of our new Dash Incubator projects which we'll be discussing in this Monday's Incubator Weekly show (on YouTube).
i changed import Dash from 'dash' to const Dash = require('dash') .
Errors are gone, but when i try to do something with sdk, i got the following error: core.mjs:10141 ERROR Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'hi') TypeError: Cannot read properties of undefined (reading 'hi') at N (dash.min.js:2:873215) at M (dash.min.js:2:874300) at J (dash.min.js:2:875003) at F (dash.min.js:2:875252) at A.exports (dash.min.js:2:876036) at A.exports.digest (dash.min.js:2:824830) at i.x11 (dash.min.js:2:501712) at k._getHash (dash.min.js:2:483937) at A.get (dash.min.js:2:484024) at new o (dash.min.js:2:2507028) at resolvePromise (zone.js:1193:31) at resolvePromise (zone.js:1147:17) at zone.js:1260:17 at _ZoneDelegate.invokeTask (zone.js:402:31) at core.mjs:25803:55 at AsyncStackTaggingZoneSpec.onInvokeTask (core.mjs:25803:36) at _ZoneDelegate.invokeTask (zone.js:401:60) at Object.onInvokeTask (core.mjs:26104:33) at _ZoneDelegate.invokeTask (zone.js:401:60) at Zone.runTask (zone.js:171:47)
I don't think you can use require
in the web browser environment. Can you share any code that is causing such errors?
It seems not actual. Please reopen otherwise.
I am in the process of creating the password manager on Dash platform. For this purpose, I want to include Dash SDK in the app. Here come some errors, due to which the app does not compile.
Expected Behavior
Can use the sdk without problems and ts can compile the app
Current Behavior
the following errors prevent Typescript from compiling the code:
Error: node_modules/@dashevo/dashcore-lib/typings/transaction/Transaction.d.ts:366:15 - error TS7006: Parameter 'txId' implicitly has an 'any' type.
366 removeInput(txId, outputIndex): void;
Error: node_modules/@dashevo/dashcore-lib/typings/transaction/Transaction.d.ts:413:20 - error TS7006: Parameter 'signature' implicitly has an 'any' type.
413 isValidSignature(signature): boolean;
Error: node_modules/@dashevo/wallet-lib/src/index.d.ts:11:20 - error TS7016: Could not find a declaration file for module './EVENTS'. '/home/philip/Projekte/Privat/AngularTutorial/node_modules/@dashevo/wallet-lib/src/EVENTS.js' implicitly has an 'any' type.
11 import EVENTS from "./EVENTS";
Error: node_modules/@dashevo/wallet-lib/src/index.d.ts:13:21 - error TS7016: Could not find a declaration file for module './plugins'. '/home/philip/Projekte/Privat/AngularTutorial/node_modules/@dashevo/wallet-lib/src/plugins/index.js' implicitly has an 'any' type.
13 import plugins from "./plugins";
Error: node_modules/@dashevo/wallet-lib/src/transport/Transport.d.ts:4:5 - error TS7010: 'announce', which lacks return-type annotation, implicitly has an 'any' return type.
4 announce(eventName, args)
Error: node_modules/@dashevo/wallet-lib/src/transport/Transport.d.ts:4:25 - error TS7006: Parameter 'args' implicitly has an 'any' type.
4 announce(eventName, args)
Error: node_modules/@dashevo/wallet-lib/src/transport/Transport.d.ts:16:20 - error TS7006: Parameter 'hash' implicitly has an 'any' type.
16 getBlockByHash(hash): Promise
Error: node_modules/@dashevo/wallet-lib/src/transport/Transport.d.ts:20:26 - error TS7006: Parameter 'hash' implicitly has an 'any' type.
20 getBlockHeaderByHash(hash): Promise
Error: node_modules/@dashevo/wallet-lib/src/transport/Transport.d.ts:28:20 - error TS7006: Parameter 'txid' implicitly has an 'any' type.
28 getTransaction(txid): Promise
Error: node_modules/@dashevo/wallet-lib/src/transport/Transport.d.ts:32:5 - error TS7010: 'subscribeToAddressesTransactions', which lacks return-type annotation, implicitly has an 'any' return type.
32 subscribeToAddressesTransactions()
Error: node_modules/@dashevo/wallet-lib/src/types/Account/Account.d.ts:21:25 - error TS7016: Could not find a declaration file for module '../Storage/Storage'. '/home/philip/Projekte/Privat/AngularTutorial/node_modules/@dashevo/wallet-lib/src/types/Storage/Storage.js' implicitly has an 'any' type.
21 import { Storage } from "../Storage/Storage";
Error: node_modules/@dashevo/wallet-lib/src/types/Account/Account.d.ts:73:17 - error TS7031: Binding element 'Plugin' implicitly has an 'any' type.
73 hasPlugins([Plugin]): {found:Boolean, results:[{name: string}]};
node_modules/typescript/lib/lib.es5.d.ts:319:13 319 declare var Function: FunctionConstructor;
node_modules/typescript/lib/lib.es5.d.ts:319:13 319 declare var Function: FunctionConstructor;
Error: node_modules/@dashevo/wallet-lib/src/types/DerivableKeyChain/DerivableKeyChain.d.ts:2:41 - error TS7016: Could not find a declaration file for module '@dashevo/dashcore-lib'. '/home/philip/Projekte/Privat/AngularTutorial/node_modules/@dashevo/dashcore-lib/index.js' implicitly has an 'any' type. If the '@dashevo/dashcore-lib' package actually exposes this module, try adding a new declaration (.d.ts) file containing
declare module '@dashevo/dashcore-lib';
2 import {HDPrivateKey, HDPublicKey} from "@dashevo/dashcore-lib";
Error: node_modules/@dashevo/wallet-lib/src/types/Identities/Identities.d.ts:2:30 - error TS7016: Could not find a declaration file for module '@dashevo/dashcore-lib'. '/home/philip/Projekte/Privat/AngularTutorial/node_modules/@dashevo/dashcore-lib/index.js' implicitly has an 'any' type. If the '@dashevo/dashcore-lib' package actually exposes this module, try adding a new declaration (.d.ts) file containing
declare module '@dashevo/dashcore-lib';
2 import { HDPrivateKey } from "@dashevo/dashcore-lib";
Error: node_modules/@dashevo/wallet-lib/src/types/Wallet/Wallet.d.ts:4:30 - error TS7016: Could not find a declaration file for module '@dashevo/dashcore-lib'. '/home/philip/Projekte/Privat/AngularTutorial/node_modules/@dashevo/dashcore-lib/index.js' implicitly has an 'any' type. If the '@dashevo/dashcore-lib' package actually exposes this module, try adding a new declaration (.d.ts) file containing
declare module '@dashevo/dashcore-lib';
4 import { HDPrivateKey } from "@dashevo/dashcore-lib";
Error: node_modules/dash/dist/src/SDK/Client/Client.d.ts:5:24 - error TS7016: Could not find a declaration file for module '@dashevo/dapi-client'. '/home/philip/Projekte/Privat/AngularTutorial/node_modules/@dashevo/dapi-client/lib/index.js' implicitly has an 'any' type. Try
npm i --save-dev @types/dashevo__dapi-client
if it exists or add a new declaration (.d.ts) file containingdeclare module '@dashevo/dapi-client';
5 import DAPIClient from '@dashevo/dapi-client';
Error: node_modules/dash/dist/src/SDK/SDK.d.ts:110:43 - error TS2307: Cannot find module '@dashevo/wallet-libsrc/plugins/StandardPlugin' or its corresponding type declarations.
110 StandardPlugin: typeof import("@dashevo/wallet-libsrc/plugins/StandardPlugin");
Error: node_modules/dash/dist/src/SDK/SDK.d.ts:116:53 - error TS2307: Cannot find module '@dashevo/wallet-libsrc/utils/calculateTransactionFees' or its corresponding type declarations.
116 calculateTransactionFees: typeof import("@dashevo/wallet-libsrc/utils/calculateTransactionFees");
Error: node_modules/dash/dist/src/SDK/SDK.d.ts:127:47 - error TS2307: Cannot find module '@dashevo/wallet-libsrc/utils/filterTransactions' or its corresponding type declarations.
127 filterTransactions: typeof import("@dashevo/wallet-libsrc/utils/filterTransactions");
Error: node_modules/dash/dist/src/SDK/SDK.d.ts:148:40 - error TS2307: Cannot find module '@dashevo/wallet-libsrc/utils/dashToDuffs' or its corresponding type declarations.
148 dashToDuffs: typeof import("@dashevo/wallet-libsrc/utils/dashToDuffs");
Error: node_modules/dash/dist/src/SDK/SDK.d.ts:150:39 - error TS2307: Cannot find module '@dashevo/wallet-libsrc/utils/fundWallet' or its corresponding type declarations.
150 fundWallet: typeof import("@dashevo/wallet-libsrc/utils/fundWallet");
Error: node_modules/dash/dist/src/SDK/SDK.d.ts:152:38 - error TS2307: Cannot find module '@dashevo/wallet-libsrc/utils/hasMethod' or its corresponding type declarations.
152 hasMethod: typeof import("@dashevo/wallet-libsrc/utils/hasMethod");