Import
createSolanaBuilder
Factory function to create a Solana instruction builder.Signature
Parameters
SolanaBuilderConfig
required
Returns
object
A builder instance with methods for creating Solana transaction instructions.
Example
SolanaBuilder Methods
buildTransfer
Builds transfer instructions for bridging tokens from Solana to another chain.Signature
Parameters
ValidatedTransfer
required
The validated transfer from
bridge.validateTransfer(). Must have sourceChain set to ChainKind.Sol.PublicKey
required
The public key of the account that owns the tokens and authorizes the transfer (signs the token transfer/burn).
PublicKey
Optional public key of the account paying for Wormhole fees and rent. Defaults to
user if not provided. This allows a gas refiller to pay fees on behalf of the user.Returns
TransactionInstruction[]
Array of Solana transaction instructions. Typically contains a single instruction for either
initTransfer (SPL tokens) or initTransferSol (native SOL).Example
Native SOL Transfers
For native SOL transfers, use the zero address as the token:buildFinalization
Builds finalization instructions for receiving tokens on Solana from another chain.Signature
Parameters
SolanaTransferMessagePayload
required
The transfer message payload containing destination nonce, transfer ID, token address, amount, and recipient.
SolanaMPCSignature
required
The MPC signature authorizing the finalization. Must implement
toBytes() method returning a Uint8Array.PublicKey
required
The public key of the account paying for the transaction.
Returns
TransactionInstruction[]
Array of Solana transaction instructions for finalizing the transfer. This will mint tokens (for bridged tokens) or release tokens from the vault (for native Solana tokens).
Example
buildLogMetadata
Builds instructions for logging token metadata to register a Solana token with the bridge.Signature
Parameters
PublicKey
required
The public key of the SPL token mint to register.
PublicKey
required
The public key of the account paying for the transaction.
Returns
TransactionInstruction[]
Array of Solana transaction instructions that emit the token’s metadata (name, symbol, decimals) via Wormhole for cross-chain registration.
Example
This creates a vault for the token if it doesn’t exist and emits metadata via Wormhole. The metadata can then be used to deploy a wrapped version of this token on other chains.
buildDeployToken
Builds instructions for deploying a wrapped token on Solana for a token from another chain.Signature
Parameters
SolanaMPCSignature
required
The MPC signature authorizing the token deployment.
SolanaTokenMetadata
required
PublicKey
required
The public key of the account paying for the transaction.
Returns
TransactionInstruction[]
Array of Solana transaction instructions that create a new wrapped token mint PDA and set up its metadata.
Example
PDA Derivation Methods
deriveConfig
Derives the bridge configuration PDA.Signature
Returns
PublicKey
The config PDA used as the Wormhole message emitter.
Example
deriveAuthority
Derives the program authority PDA.Signature
Returns
PublicKey
The authority PDA that has mint/burn authority over bridged tokens and controls token vaults.
Example
deriveSolVault
Derives the native SOL vault PDA.Signature
Returns
PublicKey
The SOL vault PDA that holds native SOL for bridging.
Example
deriveVault
Derives the token vault PDA for a specific SPL token mint.Signature
Parameters
PublicKey
required
The public key of the SPL token mint.
Returns
PublicKey
The vault PDA that holds tokens of this mint for bridging.
Example
deriveWrappedMint
Derives the wrapped token mint PDA for a token from another chain.Signature
Parameters
string
required
The original token address on the source chain. For tokens longer than 32 bytes, the address is hashed with SHA-256.
Returns
PublicKey
The wrapped mint PDA for the bridged token.
Example
PDA Seeds Reference
For reference only - always use the derive methods above.Types
SolanaBuilderConfig
Configuration for creating a Solana builder.SolanaBuilder
The Solana instruction builder interface.SolanaTransferMessagePayload
Payload for finalizing a transfer to Solana.bigint | number
required
The nonce assigned to this transfer on the destination chain.
object
required
string
required
The OmniAddress of the token on Solana (e.g.,
"sol:EPjFWdd5...").bigint | string
required
The amount to transfer in the smallest unit.
string
required
The OmniAddress of the recipient on Solana (e.g.,
"sol:RecipientPubkey...").string | null
Optional OmniAddress of the fee recipient (typically the relayer).
SolanaMPCSignature
Interface for MPC signatures used in finalization and token deployment.() => Uint8Array
required
Returns the signature as a byte array. The signature is typically 64 bytes (Ed25519).
SolanaTokenMetadata
Token metadata for deploying wrapped tokens.string
required
The original token address on the source chain (e.g.,
"near:wrap.near").string
required
The name for the wrapped token.
string
required
The symbol for the wrapped token.
number
required
The number of decimals for the wrapped token.
SolanaTransferId
Transfer ID for cross-chain transfers (Solana-specific).ChainKind | number
required
The chain where the transfer originated.
bigint | BN
required
The nonce of the transfer on the origin chain.
SolanaDepositPayload
Internal payload used for finalize transfer operations.BN
required
The destination nonce as a BN (bn.js) instance.
object
required
BN
required
The transfer amount as a BN instance.
string
required
The fee recipient address (empty string if none).
BridgeTokenFactory
The Anchor IDL type for the bridge program. This is exported for advanced use cases that need direct program interaction.Complete Example
Related
- Core Package - Validation, types, and API client
- EVM Package - EVM transaction builder
- NEAR Package - NEAR transaction builder
- Bitcoin Package - Bitcoin/Zcash UTXO builder