diff --git a/docs/composability/SDK - Solana Native.md b/docs/composability/SDK - Solana Native.md deleted file mode 100644 index 462eb382..00000000 --- a/docs/composability/SDK - Solana Native.md +++ /dev/null @@ -1,193 +0,0 @@ ---- -title: SDK Solana Native -proofedDate: 20241312 -iterationBy: na -includedInSite: false -approvedBy: na -comment: ---- - -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; - -Library for Scheduled Neon EVM Transactions -Note: This package is under development, runs on the Neon test environment, and is not ready for production use. - -[Solana Signer SDK Documentation](http://solana-signer.sdk.neonevm.org/) - -### Installation and Testing -#### Install dependencies: -``` -yarn install -``` -#### Build the project: -``` -yarn build -``` -#### Run Tests: -Navigate to the packages/core folder and run: -``` -yarn test -``` -### Usage -#### Initialization - -#### Setup Solana and Neon Providers: -``` -const result = await getProxyState(''); -const token = getGasToken(result.tokensList, NeonChainId.testnetSol); - -const connection = new Connection('', 'confirmed'); -const provider = new JsonRpcProvider(''); -const neonClientApi = new NeonClientApi(''); -const neonProxyRpcApi = result.proxyApi; -const neonEvmProgram = result.evmProgramAddress; - -const chainId = Number(token.gasToken.tokenChainId); -const chainTokenMint = new PublicKey(token.gasToken.tokenMint); -``` -#### Connect a Solana Wallet: -Example using Keypair: - -``` -const solanaPrivateKey = bs58.decode(''); -const keypair = Keypair.fromSecretKey(solanaPrivateKey); -const solanaUser = SolanaNeonAccount.fromKeypair( - keypair, - neonEvmProgram, - chainTokenMint, - chainId -); -await solanaAirdrop(connection, solanaUser.publicKey, 1e9); -``` -### Creating and Sending a Scheduled Transaction -#### Retrieve Nonce for Neon Wallet: -``` -const nonce = Number(await neonProxyRpcApi.getTransactionCount(solanaUser.neonWallet)); -``` -#### Create a Scheduled Transaction: -``` -const scheduledTransaction = new ScheduledTransaction({ - nonce: toBeHex(nonce), - payer: solanaUser.neonWallet, - target: '', - callData: '', - maxFeePerGas: toBeHex(0x77359400), - chainId: toBeHex(NeonChainId.testnetSol) -}); -``` -#### Prepare Solana Transaction: -``` -const transaction = await createScheduledNeonEvmTransaction({ - chainId, - signerAddress: solanaUser.publicKey, - tokenMintAddress: solanaUser.tokenMint, - neonEvmProgram, - neonWallet: solanaUser.neonWallet, - neonWalletNonce: nonce, - neonTransaction: scheduledTransaction.serialize() -}); -``` -#### Ensure Solana Balance Account is Initialized: -``` -const account = await connection.getAccountInfo(solanaUser.balanceAddress); -if (account === null) { - transaction.instructions.unshift( - createBalanceAccountInstruction( - neonEvmProgram, - solanaUser.publicKey, - solanaUser.neonWallet, - solanaUser.chainId - ) - ); -} -``` -#### Sign and Send the Transaction: -``` -const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash(); -transaction.recentBlockhash = blockhash; -transaction.sign({ - publicKey: solanaUser.publicKey, - secretKey: solanaUser.keypair -}); -const signature = await connection.sendRawTransaction(transaction.serialize()); -console.log('Transaction signature', signature); -``` -#### Monitor Scheduled Transaction Execution: -``` -const [transaction] = await neonClientApi.waitTransactionTreeExecution( - solanaUser.neonWallet, - nonce, - 5e3 -); -const { status, transaction_hash, result_hash } = transaction; -console.log('Scheduled transaction result', transaction); -console.log(await neonProxyRpcApi.getTransactionReceipt(`0x${transaction_hash}`)); -``` -### Building Documentation -To generate the documentation using TypeDoc: - -#### Build All Packages: -``` -yarn build:all -``` -#### Generate Documentation: -``` -yarn build:docs -``` - -### Components -#### Contracts - -Initialization: - • Deploy contracts using: -``` -yarn setup -``` -• Define and initialize contracts for scheduled transactions: -``` -const baseContract = new BaseContract(chainId); -``` -#### Example: -``` -const scheduledTransaction = new ScheduledTransaction({ - nonce: toBeHex(nonce), - payer: solanaUser.neonWallet, - target: baseContract.address, - callData: baseContract.transactionData(solanaUser.publicKey), - chainId: toBeHex(NeonChainId.testnetSol) -}); -``` -#### Core -• Provides functions for creating and sending Scheduled transactions. -Tests: -Navigate to packages/core and execute: -``` -yarn test -``` -#### UI -Configuration: -Define .env variables: -``` -REACT_APP_SOLANA_URL= -REACT_APP_NEON_CORE_API_RPC_URL= -REACT_APP_NEON_CORE_API_URL= -``` -Run the Project: -``` -yarn install -yarn start -``` -#### Configuration -Utilize tsconfig files to specify build targets and module configurations. - -### Contributors -• @oable (Igor Prokopev) -• @eubash (Evgeniya) - -### Languages -• TypeScript: 59.6% -• Solidity: 40.2% -• JavaScript: 0.2% - -For detailed implementation and updates, refer to the GitHub repository (https://github.com/neonlabsorg/neon-solana-signer) diff --git a/docs/developing/integrate/wallets/EIP_1559.md b/docs/developing/integrate/wallets/EIP_1559.md new file mode 100644 index 00000000..cac3c746 --- /dev/null +++ b/docs/developing/integrate/wallets/EIP_1559.md @@ -0,0 +1,68 @@ +--- +title: EIP-1599 +proofedDate: 20252901 +iterationBy: na +includedInSite: false +approvedBy: na +comment: +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +## Overview + +EIP-1559 introduces a more predictable and efficient transaction fee mechanism. Neon EVM supports EIP-1559, aligning its fee model with Ethereum’s ecosystem and improving the user experience. + +## Key Features +### Base fee + +- **Dynamic adjustment**: The base fee adjusts automatically based on network demand, increasing when blocks are more than 50% full and decreasing when they are less. +- **Burn mechanism**: The base fee is burned, reducing the total token supply and creating a deflationary effect. + +### Priority fee (Tip) + +- Users can include a tip to incentivize validators to prioritize their transactions. +- Higher tips can expedite transaction confirmation during periods of high network demand. + +### Improved predictability + +- The base fee mechanism minimizes gas price volatility, making transaction costs easier to estimate. + +## Using MetaMask with EIP-1559 +### Step-by-Step Guide + +1. **Initiate a transaction** + - Open your dApp or wallet and start a transaction (e.g., transferring tokens). + - MetaMask will display a transaction prompt. + +
+ +![](img/eip1.png) + +
+ +2. **Edit gas settings** + - Click **Edit** or **Settings** to modify gas parameters. + +
+ +![](img/eip2.png) + +
+ +3. **Set base fee and priority fee** + - **Max fee**: The maximum amount per gas unit (Base Fee + Priority Fee). + - **Priority fee (Tip)**: Optional fee to speed up transaction processing. + +
+ +![](img/eip3.png) + +
+ +4. **Confirm and submit** + - Save your settings and confirm the transaction. + +5. **Monitor the transaction** + - Use MetaMask or a block explorer like [Neonscan](https://neonscan.io/) to track transaction status. Adjust the Priority Fee if necessary. diff --git a/docs/developing/integrate/wallets/img/eip1.png b/docs/developing/integrate/wallets/img/eip1.png new file mode 100644 index 00000000..3a7d7310 Binary files /dev/null and b/docs/developing/integrate/wallets/img/eip1.png differ diff --git a/docs/developing/integrate/wallets/img/eip2.png b/docs/developing/integrate/wallets/img/eip2.png new file mode 100644 index 00000000..2db55880 Binary files /dev/null and b/docs/developing/integrate/wallets/img/eip2.png differ diff --git a/docs/developing/integrate/wallets/img/eip3.png b/docs/developing/integrate/wallets/img/eip3.png new file mode 100644 index 00000000..28bdf0d5 Binary files /dev/null and b/docs/developing/integrate/wallets/img/eip3.png differ diff --git a/sidebars.js b/sidebars.js index c4aa74be..e6b11bab 100644 --- a/sidebars.js +++ b/sidebars.js @@ -77,6 +77,7 @@ const sidebars = { items: [ 'developing/integrate/wallets/integrating_metamask_into_your_dapp', 'developing/integrate/wallets/integrating_walletconnect', + 'developing/integrate/wallets/EIP_1559', 'developing/integrate/wallets/safe', 'developing/integrate/wallets/safe_cli', 'developing/integrate/wallets/integrating_web3auth',