UNPKG

@relayprotocol/relay-svm-wallet-adapter

Version:

An SVM (Solana Virtual Machine) adapter for use in @relayprotocol/relay-sdk

15 lines 1.29 kB
import { Connection, TransactionInstruction, VersionedTransaction, type SendOptions, type TransactionSignature } from '@solana/web3.js'; import { type AdaptedWallet, type TransactionStepItem } from '@relayprotocol/relay-sdk'; /** * Adapts a Solana wallet to work with the Relay SDK * @param walletAddress - The public key address of the Solana wallet * @param chainId - The chain ID for the Solana network (e.g., 101 for mainnet, 102 for testnet) * @param connection - The Solana web3.js Connection instance for interacting with the network * @param signAndSendTransaction - Function to sign and send a transaction, returning a promise with the transaction signature * @param payerKey - Optional public key of the account that will pay for transaction fees (defaults to walletAddress) * @returns An AdaptedWallet object that conforms to the Relay SDK interface */ export declare const adaptSolanaWallet: (walletAddress: string, chainId: number, connection: Connection, signAndSendTransaction: (transaction: VersionedTransaction, options?: SendOptions, instructions?: TransactionInstruction[], rawInstructions?: TransactionStepItem['data']['instructions']) => Promise<{ signature: TransactionSignature; }>, payerKey?: string) => AdaptedWallet; //# sourceMappingURL=adapter.d.ts.map