Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • AddressTranslator

Index

Constructors

Properties

chainId: ChainId

Methods

  • accountIdToAddress(accountId: AccountId): string
  • Transforms account ID object to address.

    Parameters

    • accountId: AccountId

      Account ID.

    Returns string

  • addressToAccountId(address: string): AccountId
  • Transforms address to account ID object.

    Parameters

    • address: string

      Address.

    Returns AccountId

  • addressToAssetType(address: string, namespace: string): AssetType
  • Transforms address to asset type object.

    Parameters

    • address: string

      Asset address.

    • namespace: string

      Asset namespace.

    Returns AssetType

  • assertSameChainId(chainId: ChainId): void
  • Asserts that given chain ID matches with the configured chain ID.

    Parameters

    • chainId: ChainId

      Chain ID.

    Returns void

  • assetIdToAddress(assetId: AssetId): string
  • Transforms asset ID object to address.

    Parameters

    • assetId: AssetId

      Asset ID.

    Returns string

  • assetTypeToAddress(assetType: AssetType): string
  • Tranforms asset type object to address.

    Parameters

    • assetType: AssetType

      Asset type.

    Returns string

  • optionalAccountIdToAddress(accountId?: AccountId): undefined | string
  • Transforms account ID object to address or undefined.

    Parameters

    • Optional accountId: AccountId

      Account ID.

    Returns undefined | string

  • assertSameAssetType(assetId: AssetId, assetType: AssetType): void
  • Asserts that given asset ID and asset type objects have the same namespace.

    Parameters

    • assetId: AssetId
    • assetType: AssetType

    Returns void

  • assertSameChainId(chainId: ChainId, expectedChainId: ChainId): void
  • Asserts that given chain IDs match.

    Parameters

    • chainId: ChainId
    • expectedChainId: ChainId

    Returns void

  • assertTypeERC20(asset: AssetType | AssetId): void
  • assertTypeERC721(asset: AssetType | AssetId): void
  • Asserts that given asset is ERC721.

    Parameters

    • asset: AssetType | AssetId

    Returns void

  • createAssetId(accountId: AccountId, namespace: AssetNamespace, tokenId: string): AssetId
  • Creates Asset ID object.

    Parameters

    • accountId: AccountId

      Asset account ID.

    • namespace: AssetNamespace

      Asset namespace.

    • tokenId: string

      Asset token ID.

    Returns AssetId

  • createAssetType(accountId: AccountId, namespace: AssetNamespace): AssetType

Generated using TypeDoc