Represents a connection to the Tron network.

Hierarchy

  • TronConnect

Constructors

Properties

__bridge: any
__tronConfig: TronConfig
__tronWeb: any
__usdc: any

Accessors

Methods

  • Bridges a specific token from the source wallet to the destination wallet on the specified network.

    Method

    bridge

    Async

    Returns

    • A Promise that resolves to the transaction hash or identifier for the bridge transaction.

    Parameters

    • sourceWallet: string

      The source wallet from which to bridge the token.

    • destinationWallet: string | default | PublicKey

      The destination wallet or account to receive the bridged token.

    • destination: BridgeNetworks

      The destination network for the bridged token.

    • tokenSymbol: string

      The symbol of the token to bridge.

    • amount: string | BigNumber

      The amount of the token to bridge.

    • privateKey: string

      The private key of the source wallet.

    Returns Promise<string>

  • Bridges a specific token from the source wallet to the destination wallet on the specified network using a web interface.

    Method

    bridgeWeb

    Async

    Returns

    • A Promise that resolves to the transaction hash or identifier for the bridge transaction.

    Parameters

    • destination: BridgeNetworks

      The destination network for the bridged token.

    • tokenSymbol: string

      The symbol of the token to bridge.

    • amount: string | BigNumber

      The amount of the token to bridge.

    • destinationWallet: string | default | PublicKey

      The destination wallet or account to receive the bridged token.

    • sourceWallet: string

      The source wallet from which to bridge the token.

    • trWeb: any

      The web interface for interacting with the bridge.

    Returns Promise<string>

  • Deserializes the deposit event data based on the deposit transaction hash.

    Method

    deSerializeDepositEvent

    Async

    Returns

    • A Promise that resolves to an object containing the deserialized deposit event data.

    Parameters

    • depositTxHash: string

      The deposit transaction hash.

    Returns Promise<null | {
        amount: string;
        destination: {
            address: string;
            chain: BridgeNetworks;
        };
    }>

  • Retrieves the address associated with a specific entity.

    Method

    getAddress

    Returns

    • The address associated with the specified entity.

    Parameters

    • entity: "tokens" | "bridge" | "depositWallet" | "releaseWallet"

      The entity for which to retrieve the address.

    • Optional tokenSymbol: string

      The symbol of the token associated with the address (optional).

    Returns string

  • Provide address of bridge entity

    Returns

    The hex address of the requested address entity

    Parameters

    • entity: "tokens" | "bridge" | "depositWallet" | "releaseWallet"

      the bridge entity to get address of

    • Optional tokenSymbol: string

      only USDC for now

    Returns string

  • Retrieves the token balance of a specific address on the network.

    Method

    getTokenBalanceOnNetwork

    Async

    Returns

    • A Promise that resolves to the token balance as a BigNumber.

    Parameters

    • tokenSymbol: string

      The symbol of the token for which to retrieve the balance.

    • address: string

      The address for which to retrieve the token balance.

    Returns Promise<BigNumber>

  • Provide address of bridge entity

    Returns

    The hex address of the requested address entity

    Parameters

    • entity: "tokens" | "bridge" | "depositWallet" | "releaseWallet"

      the bridge entity to get address of

    • Optional tokenSymbol: string

      only USDC for now

    Returns string

  • Retrieves the hashed transaction ID.

    Method

    getTxnHashed

    Returns

    • The hashed transaction ID.

    Parameters

    • txnID: string

      The transaction ID.

    Returns string

  • Checks if a token symbol is valid.

    Method

    isValidToken

    Returns

    • A boolean indicating whether the token symbol is valid.

    Parameters

    • tokenSymbol: string

      The token symbol to check.

    Returns boolean

  • Sets the API key to be used for the Tron connection.

    Method

    setApiKey

    Returns

    Parameters

    • apiKey: string

      The API key to be set.

    Returns void

Generated using TypeDoc