WXL
3 天以前 4d9da000fbe74d344e0e4580b138e79d4ad98ede
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.constructAuthFromWallet = void 0;
async function constructAuthFromWallet(wallet, config) {
    const account = await wallet.getAccount();
    const isPubkeyCompressed = config.publicKey.isCompressed;
    const auth = {
        algo: account.algo,
        getPublicKey(isCompressed) {
            if (isCompressed && isPubkeyCompressed) {
                return account.publicKey;
            }
            if (!isCompressed && !isPubkeyCompressed) {
                return account.publicKey;
            }
            throw new Error(`Failed to get ${isCompressed ? "compressed" : "uncompressed"} public key`);
        },
        sign(_data) {
            throw new Error("Not implemented yet");
        },
    };
    return auth;
}
exports.constructAuthFromWallet = constructAuthFromWallet;
//# sourceMappingURL=auth.js.map