allowDaccWallet_V2
A function Allow a Wallet access and Private key V2
The allowDaccWallet_V2 function is designed to decrypt an encrypted wallet and retrieve its credentials (address and private key) for use within the dacc-js ecosystem. This V2 version uses enhanced decryption logic that automatically handles different encryptMode settings used during wallet creation. This function allows users to access their wallet by daccPublickey encrypted with their password.
Import
import { allowDaccWallet_V2 } from 'dacc-js';Usage
import { allowDaccWallet_V2 } from 'dacc-js';
const allow = await allowDaccWallet_V2({
daccPublickey: 'daccPublickeyV2_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
| Parameter | Type | Description |
|---|---|---|
daccPublickey | string | Conditional: The encrypted wallet data to lookup address from createDaccWallet. |
address | 0x${string} | Conditional: Wallet address to lookup daccPublickey on-chain (createDaccWallet in publicEncryption: true Mode can use instead of daccPublickey). |
passwordSecretkey | string | The 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_V2({
daccPublickey: 'daccPublickeyV2_0x123_XxX...',
passwordSecretkey: 'my+Password#123...'
});address (conditional)
- Type:
0x${string}
Wallet address to lookup daccPublickey on-chain createDaccWallet_V2.
const allow = await allowDaccWallet_V2({
daccPublickey: 'daccPublickeyV2_0x123_XxX...',
address: '0x123address...',
passwordSecretkey: 'my+Password#123...'
});passwordSecretkey
- Type:
string
Your password secret is matched with the encryption.
const allow = await allowDaccWallet_V2({
daccPublickey: 'daccPublickeyV2_0x123_XxX...',
passwordSecretkey: 'my+Password#123...'
});