Skip to content

Commit

Permalink
Update examples to use GetLatestBlockhash instead of `GetRecentBloc…
Browse files Browse the repository at this point in the history
…khash`
  • Loading branch information
gagliardetto committed Nov 14, 2024
1 parent 9361006 commit f286256
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ func main() {
}
//---------------

recent, err := rpcClient.GetRecentBlockhash(context.TODO(), rpc.CommitmentFinalized)
recent, err := rpcClient.GetLatestBlockhash(context.TODO(), rpc.CommitmentFinalized)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -1072,7 +1072,7 @@ func main() {
endpoint := rpc.TestNet_RPC
client := rpc.New(endpoint)

example, err := client.GetRecentBlockhash(context.TODO(), rpc.CommitmentFinalized)
example, err := client.GetLatestBlockhash(context.TODO(), rpc.CommitmentFinalized)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -1125,7 +1125,7 @@ func main() {
endpoint := rpc.TestNet_RPC
client := rpc.New(endpoint)

example, err := client.GetRecentBlockhash(context.TODO(), rpc.CommitmentFinalized)
example, err := client.GetLatestBlockhash(context.TODO(), rpc.CommitmentFinalized)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -1227,7 +1227,7 @@ func main() {
endpoint := rpc.TestNet_RPC
client := rpc.New(endpoint)

example, err := client.GetRecentBlockhash(
example, err := client.GetLatestBlockhash(
context.TODO(),
rpc.CommitmentFinalized,
)
Expand Down Expand Up @@ -1263,7 +1263,7 @@ func main() {
endpoint := rpc.TestNet_RPC
client := rpc.New(endpoint)

example, err := client.GetRecentBlockhash(
example, err := client.GetLatestBlockhash(
context.TODO(),
rpc.CommitmentFinalized,
)
Expand Down Expand Up @@ -1301,7 +1301,7 @@ func main() {
endpoint := rpc.TestNet_RPC
client := rpc.New(endpoint)

example, err := client.GetRecentBlockhash(
example, err := client.GetLatestBlockhash(
context.TODO(),
rpc.CommitmentFinalized,
)
Expand Down Expand Up @@ -1367,7 +1367,7 @@ func main() {
endpoint := rpc.TestNet_RPC
client := rpc.New(endpoint)

example, err := client.GetRecentBlockhash(
example, err := client.GetLatestBlockhash(
context.TODO(),
rpc.CommitmentFinalized,
)
Expand Down Expand Up @@ -1424,7 +1424,7 @@ func main() {
endpoint := rpc.TestNet_RPC
client := rpc.New(endpoint)

example, err := client.GetRecentBlockhash(
example, err := client.GetLatestBlockhash(
context.TODO(),
rpc.CommitmentFinalized,
)
Expand Down Expand Up @@ -1465,7 +1465,7 @@ func main() {
endpoint := rpc.TestNet_RPC
client := rpc.New(endpoint)

example, err := client.GetRecentBlockhash(
example, err := client.GetLatestBlockhash(
context.TODO(),
rpc.CommitmentFinalized,
)
Expand Down Expand Up @@ -1631,7 +1631,7 @@ func main() {
endpoint := rpc.TestNet_RPC
client := rpc.New(endpoint)

example, err := client.GetRecentBlockhash(
example, err := client.GetLatestBlockhash(
context.TODO(),
rpc.CommitmentFinalized,
)
Expand Down Expand Up @@ -2212,6 +2212,7 @@ func main() {
endpoint := rpc.TestNet_RPC
client := rpc.New(endpoint)

// DEPRECATED: This method is only available in solana-core v1.8 or older. Please use getLatestBlockhash for solana-core v1.9 or newer.
recent, err := client.GetRecentBlockhash(
context.TODO(),
rpc.CommitmentFinalized,
Expand Down Expand Up @@ -2409,7 +2410,7 @@ func main() {
endpoint := rpc.TestNet_RPC
client := rpc.New(endpoint)

recent, err := client.GetRecentBlockhash(
recent, err := client.GetLatestBlockhash(
context.TODO(),
rpc.CommitmentFinalized,
)
Expand Down

0 comments on commit f286256

Please sign in to comment.