Skip to content

allowDaccWallet

A function Allow a Wallet access and Private key

The allowDaccWallet function is designed to decrypt an encrypted wallet and retrieve its credentials (address and private key) for use within the dacc-js ecosystem. This function allows users to access their wallet by daccPublickey encrypted with their password.

Import

import { allowDaccWallet } from 'dacc-js';

Usage

import { allowDaccWallet } from 'dacc-js';
 
const allow = await allowDaccWallet({
 daccPublickey: 'daccPublickey_0x123_XxX...',
 passwordSecretkey: 'my+Password#123....',
});
 
console.log("allow:", allow); // {address, privateKey}
console.log("allow address:", allow?.address); // 0x123address... (recall)
console.log("allow privateKey:", allow?.privateKey); // 0xprivatekey... (secret)

Arguments

ParameterTypeDescription
daccPublickeystringConditional: The encrypted wallet data to lookup address from createDaccWallet.
address0x${string}Conditional: Wallet address to lookup daccPublickey on-chain (createDaccWallet in publicEncryption: true Mode can use instead of daccPublickey).
passwordSecretkeystringThe user's password used as the key for encryption.

Return Value

The response result is an object containing. {address, privateKey}.

Parameters

daccPublickey (conditional)

  • Type: string

The user's encrypted public key to address.

const allow = await allowDaccWallet({
 daccPublickey: 'daccPublickey_0x123_XxX...', 
 passwordSecretkey: 'my+Password#123...'
});

address (conditional)

  • Type: 0x${string}

Wallet address to lookup daccPublickey on-chain createDaccWallet.

const allow = await allowDaccWallet({
 daccPublickey: 'daccPublickey_0x123_XxX...', 
 address: '0x123address...', 
 passwordSecretkey: 'my+Password#123...'
});

passwordSecretkey

  • Type: string

Your password secret is matched with the encryption.

const allow = await allowDaccWallet({
 daccPublickey: 'daccPublickey_0x123_XxX...', 
 passwordSecretkey: 'my+Password#123...'
});