Interface for local sdk exclusive methods

Hierarchy (view full)

Implements

Constructors

Properties

connected: boolean = false
name: string = ""
provider: TronWeb
rpc_url: string = ""
signer: any = null
wallet: TronWeb
SUN_PER_TRX: 1000000 = 1_000_000

Methods

  • Creates a new TRON wallet

    Parameters

    • _password: string

      Password parameter (reserved for future encryption support)

    Returns Promise<{
        address: string;
        privateKey: string;
    }>

    Object containing the wallet address and private key

    Currently returns unencrypted private key. Password parameter is accepted for interface compatibility but not yet used for encryption.

  • Prepare a TRX transfer transaction

    Parameters

    • receiver: string

      Recipient address (base58 format)

    • amount: string

      Amount in SUN (1 TRX = 1,000,000 SUN)

    • Optionaloptions: {
          privateKey?: string;
      }

      Options including optional privateKey

      • OptionalprivateKey?: string

    Returns Promise<any>

    Signed transaction ready to broadcast

  • Signs a list of transactions using the connected wallet. The transaction nonce is incremented for each transaction in order of appearance.

    Parameters

    • transactions: any[]

      A list of transactions to sign

    • Optionaloptions: {
          privateKey?: string;
      }

      Options

      • OptionalprivateKey?: string

    Returns Promise<any[]>

  • Convert SUN to TRX with full precision preservation

    Parameters

    • sun: bigint

      Amount in SUN as bigint

    Returns string

    Amount in TRX as a decimal string (e.g., "123.456789")

    This method returns a string to preserve precision for large values. For display purposes, you may want to parse this with a BigNumber library.

  • Convert TRX to SUN

    Parameters

    • trx: string | number

      Amount in TRX

    Returns bigint

    Amount in SUN as bigint