优化 Solana 交易以最小化确认延迟并最大化交付率。优先费用、计算单元和可靠交易的最佳实践。
npm update helius-sdk
。
以下示例将 SOL 转移到您选择的账户。它利用 sendSmartTransaction 发送一个不跳过预检检查的优化交易:
cargo update helius
。
以下示例将 0.01 SOL 转移到您选择的账户。它利用 send_smart_transaction 发送一个跳过预检检查并在必要时重试两次的优化交易:
bs58.encode(txt.serialize());
txtSig
被设置为刚刚发送的交易的签名。然后,该方法使用 pollTransactionConfirmation()
方法轮询交易的确认状态。此方法每五秒检查一次交易状态,最多检查三次。
如果在此期间交易未被确认,则返回错误: