How to use the @polkadot/keyring.encodeAddress function in @polkadot/keyring

To help you get started, we’ve selected a few @polkadot/keyring examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github polkadot-js / common / docs / examples / keyring / 03_validate_address / index.js View on Github external
const isValidAddressPolkadotAddress = () => {
  try {
    encodeAddress(isHex(address) ? hexToU8a(address) : decodeAddress(address));
    return true;
  } catch (error) {
    return false;
  }
};
github polkadot-js / api / packages / types / src / AccountId.ts View on Github external
static encode (value: Uint8Array): string {
    return encodeAddress(value);
  }
github polkadot-js / api / packages / types / src / AccountIndex.ts View on Github external
toString (): string {
    const length = AccountIndex.calcLength(this.raw);

    return encodeAddress(this.toU8a().subarray(0, length));
  }

@polkadot/keyring

Keyring management

Apache-2.0
Latest version published 8 days ago

Package Health Score

84 / 100
Full package analysis

Similar packages