Skip to main content

EvmAddress

Represents an Ethereum Virtual Machine (EVM) address with validation and conversion utilities.

Constructor

new EvmAddress(inner: Address)
inner
Address
required
The Fusion SDK Address instance

Static Properties

ZERO
EvmAddress
Zero address constant (0x0000000000000000000000000000000000000000)
NATIVE
EvmAddress
Native currency address constant (0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)

Static Methods

fromBigInt

Create an EvmAddress from a bigint value.
EvmAddress.fromBigInt(val: bigint): EvmAddress
val
bigint
required
BigInt representation of the address

fromString

Create an EvmAddress from a string.
EvmAddress.fromString(address: string): EvmAddress
address
string
required
Hexadecimal string representation of the address

fromBuffer

Create an EvmAddress from a Buffer.
EvmAddress.fromBuffer(address: Buffer): EvmAddress
address
Buffer
required
Buffer containing the address bytes

fromUnknown

Create an EvmAddress from an unknown type with automatic type detection.
EvmAddress.fromUnknown(address: unknown): EvmAddress
address
unknown
required
Address in string, bigint, or numeric string format

Instance Methods

nativeAsZero

Convert native address to zero address. Returns the same address if non-native.
nativeAsZero(): EvmAddress

zeroAsNative

Convert zero address to native address (0xEE…EE). Returns the same address if non-zero.
zeroAsNative(): EvmAddress

toBuffer

Convert address to Buffer.
toBuffer(): Buffer

toHex

Convert address to hex string.
toHex(): HexString

equal

Check if this address equals another address.
equal(other: AddressLike): boolean
other
AddressLike
required
Address to compare with

isNative

Check if this is a native currency address.
isNative(): boolean

isZero

Check if this is a zero address.
isZero(): boolean

toBigint

Convert address to bigint.
toBigint(): bigint

toString

Convert address to string.
toString(): string

splitToParts

Split the address into complement (zero for EVM) and address parts.
splitToParts(): [AddressComplement, EvmAddress]

SolanaAddress

Represents a Solana address with base58 encoding and conversion utilities.

Constructor

new SolanaAddress(value: string)
value
string
required
Base58-encoded Solana address (must be 32 bytes when decoded)

Static Properties

ASSOCIATED_TOKEN_PROGRAM_ID
SolanaAddress
Associated Token Program address
TOKEN_PROGRAM_ID
SolanaAddress
SPL Token Program address
TOKEN_2022_PROGRAM_ID
SolanaAddress
Token-2022 Program address
SYSTEM_PROGRAM_ID
SolanaAddress
System Program address
SYSVAR_RENT_ID
SolanaAddress
Sysvar Rent address
ZERO
SolanaAddress
Zero address constant
WRAPPED_NATIVE
SolanaAddress
Wrapped SOL address
NATIVE
SolanaAddress
Native SOL address

Static Methods

fromString

Create a SolanaAddress from a base58 string.
SolanaAddress.fromString(str: string): SolanaAddress
str
string
required
Base58-encoded address string

fromParts

Create a SolanaAddress from address complement and EVM address parts.
SolanaAddress.fromParts(parts: [AddressComplement, EvmAddress]): SolanaAddress
parts
[AddressComplement, EvmAddress]
required
Tuple of high bits (complement) and low bits (EVM address)

fromUnknown

Create a SolanaAddress from an unknown type with automatic type detection.
SolanaAddress.fromUnknown(val: unknown): SolanaAddress
val
unknown
required
Address in string, bigint, buffer, or PublicKey format

fromPublicKey

Create a SolanaAddress from a Solana PublicKey.
SolanaAddress.fromPublicKey(publicKey: web3.PublicKey): SolanaAddress
publicKey
web3.PublicKey
required
Solana web3.js PublicKey instance

fromBuffer

Create a SolanaAddress from a Buffer or Uint8Array.
SolanaAddress.fromBuffer(buf: Buffer | Uint8Array): SolanaAddress
buf
Buffer | Uint8Array
required
Buffer containing 32 bytes of address data

fromBigInt

Create a SolanaAddress from a bigint value.
SolanaAddress.fromBigInt(val: bigint): SolanaAddress
val
bigint
required
256-bit bigint representation of the address

Instance Methods

toString

Convert address to base58 string.
toString(): string

toBuffer

Convert address to Buffer.
toBuffer(): Buffer

toHex

Convert address to hex string.
toHex(): HexString

toBigint

Convert address to bigint.
toBigint(): bigint

equal

Check if this address equals another address.
equal(other: AddressLike): boolean
other
AddressLike
required
Address to compare with

isNative

Check if this is a native SOL address.
isNative(): boolean

isZero

Check if this is a zero address.
isZero(): boolean

splitToParts

Split the 256-bit address into high 96 bits (complement) and low 160 bits (EVM-compatible address).
splitToParts(): [AddressComplement, EvmAddress]

Build docs developers (and LLMs) love