Open LiuBoPOP opened 3 weeks ago
@LiuBoPOP
solanaWeb.solanaTransfer(privateKey: privateKey,
toAddress: toAddress,
amount: amount,
endpoint: SolanaMainNetValue) { [weak self] state, txid, error in
guard let self = self else { return }
print("state = \(state)")
print("txid = \(txid)")
if state {
self.hashLabel.text = txid
} else {
self.hashLabel.text = error
}
}
In this code, replace SolanaMainNetValue with the desired Solana endpoint URL, such as a mainnet or testnet endpoint, to change the network environment where the transfer will be sent. YOU SHOULD BUY Solana endpoint URL IN https://www.quicknode.com/
Let me know if you'd like further customization!
error = "Error: failed to get recent blockhash: TypeError: Load failed" 好像是Sol的获取recent blockhash 的节点更换了 但是我一直没有找到这个节点应该在哪里替换?