Skip to content

readDaccWallet

A function Search a Wallet information.

The readDaccWallet function is designed to retrieve information about a specific wallet within the dacc-js library.

Import

import { readDaccWallet } from 'dacc-js';

Usage

import { readDaccWallet } from 'dacc-js';
 
const info = await readDaccWallet({
  address: "0x1234abcd...",
//   dataStorageNetwork: "opSepolia",
//   result: "daccPublickey"
});
 
console.log("info:", info); 
// { dataStorageNetwork: "opSepolia", daccPublickey: "daccPublickey_0x123_XxX..." }
const info = await readDaccWallet({
  address: "0x1234abcd...",
  dataStorageNetwork: "opSepolia",
  result: "daccPublickey"
});
 
console.log("info:", info); 
// { daccPublickey: "daccPublickey_0x123_XxX..." }

Find daccPublickey by address

const info = await readDaccWallet({
  address: "0x1234abcd..."
});
 
console.log("info:", info); 
// { dataStorageNetwork: "opSepolia", daccPublickey: "daccPublickey_0x123_XxX..." }

Find address by daccPublickey

const info = await readDaccWallet({
  daccPublickey: "daccPublickey_0x123_XxX..."
});
 
console.log("info:", info); 
// { dataStorageNetwork: "opSepolia", address: "0x1234abcd..." }

Explicitly specifying options will speed up searches.

Arguments

ParameterTypeDescription
daccPublickeystringEncrypted public key to find associated address
address0x${string}Wallet address to find associated encrypted public key
dataStorageNetworkstring | "all"Network to query. Defaults to "all"
result"address" | "daccPublickey" | "all"Specify return data type

Either address or daccPublickey must be provided.

Return Values

The return value depends on the result parameter and dataStorageNetwork setting:

When querying all networks (dataStorageNetwork: "all")

// Returns with network information
{
  dataStorageNetwork: string;
  address?: `0x${string}`;
  daccPublickey?: string;
}

When querying specific network

// Returns without network information
{
  address?: `0x${string}`;
  daccPublickey?: string;
}

Parameters

daccPublickey (conditional)

  • Type: string

Encrypted public key of the wallet to look up.

const info = await readDaccWallet({
  daccPublickey: "daccPublickey_0x123_XxX..."
});

address (conditional)

  • Type: 0x${string}

address of the wallet to look up.

const info = await readDaccWallet({
  address: "0x1234abcd...", 
});

dataStorageNetwork (optional)

  • Type: string (keyof)
  • Default: "all"

Specify which blockchain network to query.

const info = await readDaccWallet({
  daccPublickey: "daccPublickey_0x123_XxX...",
  // address: "0x1234abcd...",
  dataStorageNetwork: "opSepolia"
//   dataStorageNetwork: { 
//     customChain: { // For Custom Chain Network
//       chain: myCustomChain, 
//       contract: "0xYourDeployDaccWalletStorageOnChainAddress..",
//     }, 
//   },
});

Specifying a network will make searches more precise and faster.

result (optional)

  • Type: string (keyof)
  • Default: "all"

result type to return.

const info = await readDaccWallet({
  daccPublickey: "daccPublickey_0x123_XxX...",
  // address: "0x1234abcd...",
  dataStorageNetwork: "all",
  result: "daccPublickey"
});