Javascript 在脚本中使用@waves/waves crypto在waves区块链上创建加密地址时出错

Javascript 在脚本中使用@waves/waves crypto在waves区块链上创建加密地址时出错,javascript,html,typescript,wavesplatform,Javascript,Html,Typescript,Wavesplatform,接收误差 在@waves/waves crypto中找不到crypto js。我已尝试通过npm卸载和重新安装模块,并已使用*wavesCrypto导入模块,但模块本身文件index.d.ts中仍然存在错误 我正在尝试创建钱包地址、公钥和私钥,并在测试网上查看,这样我就可以尝试发送我自己的新硬币,先生。我真的需要帮助,请怜悯我的灵魂,赞美上帝 import { Component, ElementRef, ViewChild } from "@angular/core"; import

接收误差 在@waves/waves crypto中找不到crypto js。我已尝试通过npm卸载和重新安装模块,并已使用*wavesCrypto导入模块,但模块本身文件index.d.ts中仍然存在错误

我正在尝试创建钱包地址、公钥和私钥,并在测试网上查看,这样我就可以尝试发送我自己的新硬币,先生。我真的需要帮助,请怜悯我的灵魂,赞美上帝

import { Component, ElementRef, ViewChild } from "@angular/core";
    import { Router } from "@angular/router";
    import { alert, prompt } from "tns-core-modules/ui/dialogs";
    import { Page } from "tns-core-modules/ui/page";
    import { Routes } from "@angular/router";
    import { publicKey, verifySignature, signBytes, address,     keyPair,         privateKey } from "../@waves/waves-crypto"

    import { User } from "../shared/user.model";
import { UserService } from "../shared/user.service";

@Component({
    selector: "app-login",
    moduleId: module.id,
    templateUrl: "./login.component.html",
    styleUrls: ['./login.component.css']
})
export class LoginComponent {
    isLoggingIn = true;
    user: User;
    @ViewChild("password") password: ElementRef;
    @ViewChild("confirmPassword") confirmPassword: ElementRef;
    @ViewChild("waves") waves: ElementRef;

    constructor(private page: Page, private userService: UserService, private router: Router) {
        this.page.actionBarHidden = true;
        this.user = new User();
        // this.user.email = "foo2@foo.com";
        // this.user.password = "foo";
        const seed = 'magicseed';
        const pubKey = publicKey(seed);
        const bytes = Uint8Array.from([1, 2, 3, 4]);
        const sig = signBytes(bytes, seed);
        const isValid = verifySignature(pubKey, bytes, sig)
    }

    wallet() {
        let walletAddress = address('seed', 'T');
        keyPair('seed');
        publicKey('seed');
        privateKey('seed');
        alert(walletAddress);
        console.log(walletAddress);
        console.log(keyPair);
    }

    toggleForm() {
        this.isLoggingIn = !this.isLoggingIn;
    }

    submit() {
        if (!this.user.email || !this.user.password) {
            this.alert("Please provide both an email address and password.");
            return;
        }

        if (this.isLoggingIn) {
            this.login();
        } else {
            this.register();
        }
    }

    login() {
        this.userService.login(this.user)
            .then(() => {
                this.router.navigate(["/home"]);
            })
            .catch(() => {
                this.alert("Unfortunately we could not find your account.");
            });
    }

    register() {
        if (this.user.password != this.user.confirmPassword) {
            this.alert("Your passwords do not match.");
            return;
        }
        this.userService.register(this.user)
            .then(() => {
                this.alert("Your account was successfully created.");
                this.isLoggingIn = true;
            })
            .catch(() => {
                this.alert("Unfortunately we were unable to create your account.");
            });
    }

    forgotPassword() {
        prompt({
            title: "Forgot Password",
            message: "Enter the email address you used to register for APP NAME to reset your password.",
            inputType: "email",
            defaultText: "",
            okButtonText: "Ok",
            cancelButtonText: "Cancel"
        }).then((data) => {
            if (data.result) {
                this.userService.resetPassword(data.text.trim())
                    .then(() => {
                        this.alert("Your password was successfully reset. Please check your email for instructions on choosing a new password.");
                    }).catch(() => {
                        this.alert("Unfortunately, an error occurred resetting your password.");
                    });
            }
        });
    }

    focusPassword() {
        this.password.nativeElement.focus();
    }
    focusConfirmPassword() {
        if (!this.isLoggingIn) {
            this.confirmPassword.nativeElement.focus();
        }
    }

    alert(message: string) {
        return alert({
            title: "APP NAME",
            okButtonText: "OK",
            message: message
        });
    }
}

正如我已经回答的那样

从@waves/waves crypto导入{publicKey,verifySignature} 而不是

从../@waves/waves crypto导入{publicKey,verifySignature}