Messina SDK
  • Introduction
    • Introduction
  • SETTING UP
    • Installation
  • Contracts
    • Contracts
  • METHODS
    • Algorand
      • transferFromAlgorand()
      • getEmitterAddressAlgorand()
      • parseSequenceFromLogAlgorand()
      • redeemOnAlgorand()
    • EVM
      • getAllowanceEth()
      • approveEth()
      • transferFromEth()
      • getEmitterAddressEth()
      • parseSequenceFromLogEth()
      • redeemOnEth()
      • redeemOnEthWithType()
    • Guardian
      • getSignedVAA()
    • Utils
      • nativeToHexString()
  • Bridging
    • Algorand -> Ethereum
    • Ethereum -> Algorand
  • Contact
    • Email
    • Discord
    • Telegram
    • Twitter
Powered by GitBook
On this page
  • Method Parameters
  • Returns
  • Usage
  1. METHODS
  2. Utils

nativeToHexString()

To convert an address in a chain's native representation into a 32-byte hex string

Method Parameters

address: string | undefined

Destination address

chain: ChainId | ChainName

Destination chain

Returns

Returns hex address string

Usage

import { ethers } from "ethers";
import { nativeToHexString, CHAIN_ID_ETH } from "@algo-foundry/messina-sdk";

const provider = new ethers.providers.WebSocketProvider(
      <ETH_NODE_URL>
    ) as any;   
const signer = new ethers.Wallet(<ETH_PRIVATE_KEY>, provider);

const hexStr = nativeToHexString(
      signer.address,
      CHAIN_ID_ETH
    );
PreviousUtilsNextAlgorand -> Ethereum

Last updated 6 months ago