import { Transaction } from '@solana/web3.js'; import { MintNeonTransactionParams, MintTransferParams } from 'token-transfer-core-2022'; import { JsonRpcProvider, TransactionRequest, Wallet } from 'ethers'; /** * Creates and executes a Neon Transfer Mint Transaction using ethers.js. * * This function is intended for the transfer of SPL tokens to Neon EVM by generating a transaction * signed using ethers.js, using the wallet signer. * * @template W - The wallet signer, generally an instance of the `Wallet` class from ethers.js. * * @param {MintTransferParams} params - The parameters required to create and execute the mint transaction. * @param {Connection} params.connection - The Solana connection object used to interact with the blockchain. * @param {ProxyApi} params.proxyApi - The proxy API used for interacting with the blockchain. * @param {PublicKey} params.neonEvmProgram - The public key of the Neon EVM program on Solana. * @param {PublicKey} params.solanaWallet - The public key of the user's Solana wallet, used as the fee payer. * @param {string} params.neonWallet - The address of the Neon wallet. * @param {W} params.walletSigner - The wallet signer from ethers.js, used for signing the transaction. * @param {SPLToken} params.splToken - The SPL token object representing the token being transferred. * @param {Amount} params.amount - The amount of tokens to be transferred. * @param {number} params.chainId - Neon EVM chain ID for which the transaction is being created. * @param {number} [params.neonHeapFrame=NEON_HEAP_FRAME] - The heap frame value for computing the budget program. * * @returns {Promise} - A Promise that resolves to the result of the Neon mint transaction. * * @example * ```typescript * const connection = new Connection("https://api.devnet.solana.com"); * const proxyApi = new ProxyApi("https://devnet.neonevm.org"); * const neonEvmProgram = new PublicKey("neon_evm_program_public_key"); * const solanaWallet = new PublicKey("your_solana_wallet_public_key"); * const neonWallet = "neon_wallet_address"; * const walletSigner = new Wallet(keccak256(Buffer.from(`${neonWallet.slice(2)}${solanaWallet.toBase58()}`, 'utf-8')), new JsonRpcProvider("https://devnet.neonevm.org")); * const splToken: SPLToken = { * address: "token_address", * address_spl: "address_spl_value", * chainId: 245022926, * decimals: 9, * logoURI: "logo_url", * name: "USDT Token", * symbol: "USDT", * }; * * const transactionResult = await neonTransferMintTransactionEthers({ * connection, * proxyApi, * neonEvmProgram, * solanaWallet, * neonWallet, * walletSigner, * splToken, * amount: 1, * chainId: 245022926 * }); * console.log("Transaction executed successfully:", transactionResult); * ``` */ export declare function neonTransferMintTransactionEthers(params: MintTransferParams): Promise; /** * Creates a transaction request for transfer ERC20 tokens from Neon EVM to Solana. * This function is used for all ERC20 token transactions, including wSOL. * It estimates the gas limit and fee required for the transaction, * then returns the configured transaction request. * * @param {MintNeonTransactionParams} params - The parameters for creating a mint NEON transaction. * @param {JsonRpcProvider} params.provider - The ethers.js provider to interact with the blockchain. * Example: `new ethers.providers.JsonRpcProvider("")` * @param {string} params.neonWallet - The address of the Neon wallet initiating the transaction. * @param {string} params.associatedToken - The associated token address to receive the minted tokens. * @param {SPLToken} params.splToken - The SPL token information representing the token being received. * @param {Amount} params.amount - The amount of tokens to be minted. * @param {bigint} [params.gasLimit=BigInt(5e4)] - The optional gas limit for the transaction. * * @returns {Promise} - The configured transaction request for tokens transfer. * * @example * const provider = new JsonRpcProvider(""); * const transactionRequest = await createMintNeonTransactionEthers({ * provider, * neonWallet: "0xNeonWalletAddress", * associatedToken: "AssociatedTokenAddressOnSolana", * splToken: { * address: "erc20_token_address", * address_spl: "spl_token_address", * chainId: 245022926, * decimals: 9, * logoURI: "https://example.com/logo.png", * name: "USDT Token", * symbol: "USDT" * }, * amount: 1 * }); */ export declare function createMintNeonTransactionEthers({ provider, neonWallet, associatedToken, splToken, amount, gasLimit }: MintNeonTransactionParams): Promise; /** * Creates a Solana transaction to wrap SOL into wSOL and transfer it to Neon EVM. * * This function performs the following operations: * 1. Wraps **SOL into wSOL** by creating an associated token account (if necessary), * transferring SOL, and syncing the native balance. * 2. **Generates a Neon transaction** to transfer **0.1 wSOL** from Solana to Neon. * 3. **Creates and signs a transaction** using an Ethers wallet for Neon EVM. * 4. **Adds all necessary instructions** to the Solana transaction and returns it. * * @param {MintTransferParams} params - The parameters required for the transaction. * @param {Connection} params.connection - The Solana blockchain connection. * @param {ProxyApi} params.proxyApi - The API interface for interacting with the proxy. * @param {PublicKey} params.neonEvmProgram - The public key of the Neon EVM program. * @param {PublicKey} params.solanaWallet - The Solana wallet public key initiating the transfer. * @param {string} params.neonWallet - The Ethereum-style Neon wallet address. * @param {Wallet} params.walletSigner - The Ethers.js wallet used for signing Neon transactions - private key for a signer based on the Neon and Solana wallet addresses. * @param {SPLToken} params.splToken - The SPL token details for wSOL. * @param {Amount} params.amount - The amount of wSOL to transfer (expected to be **0.1 wSOL**). * @param {number} params.chainId - The chain ID of the target blockchain. * @param {number} [params.neonHeapFrame=NEON_HEAP_FRAME] - The heap frame size for Neon transaction execution. * @returns {Promise} A Solana `Transaction` that wraps SOL to wSOL and transfers it to Neon. * * @example * ```typescript * const transaction = await createWrapAndTransferSOLTransaction({ * connection, * proxyApi, * neonEvmProgram, * solanaWallet: userWallet, * neonWallet: "0xNeonWalletAddress", * walletSigner: ethersSigner, * splToken: wSolToken, * amount: "0.1", * chainId: 245022926 * }); * ``` */ export declare function createWrapAndTransferSOLTransaction(params: MintTransferParams): Promise; //# sourceMappingURL=mint-transfer.d.ts.map