|
1 | 1 | # Solana SDK library for Go |
2 | 2 |
|
3 | | -[](https://pkg.go.dev/github.com/solana-foundation/solana-go@v1.16.0?tab=doc) |
4 | | -[](https://github.com/solana-foundation/solana-go/releases) |
5 | | -[](https://github.com/solana-foundation/solana-go/actions?query=branch%3Amain) |
6 | | -[](https://github.com/solana-foundation/solana-go/actions?query=branch%3Amain+workflow%3Alint) |
7 | | -[](https://www.tickgit.com/browse?repo=github.com/solana-foundation/solana-go&branch=main) |
8 | | -[](https://goreportcard.com/report/github.com/solana-foundation/solana-go) |
| 3 | +[](https://pkg.go.dev/github.com/solana-foundation/solana-go/v2@v1.16.0?tab=doc) |
| 4 | +[](https://github.com/solana-foundation/solana-go/v2/releases) |
| 5 | +[](https://github.com/solana-foundation/solana-go/v2/actions?query=branch%3Amain) |
| 6 | +[](https://github.com/solana-foundation/solana-go/v2/actions?query=branch%3Amain+workflow%3Alint) |
| 7 | +[](https://www.tickgit.com/browse?repo=github.com/solana-foundation/solana-go/v2&branch=main) |
| 8 | +[](https://goreportcard.com/report/github.com/solana-foundation/solana-go/v2) |
9 | 9 |
|
10 | 10 | Go library to interface with Solana JSON RPC and WebSocket interfaces. |
11 | 11 |
|
@@ -90,7 +90,7 @@ The RPC and WS client implementation is based on the [Solana RPC API documentati |
90 | 90 |
|
91 | 91 | ```bash |
92 | 92 | $ cd my-project |
93 | | -$ go get github.com/solana-foundation/solana-go@v1.16.0 |
| 93 | +$ go get github.com/solana-foundation/solana-go/v2@v1.16.0 |
94 | 94 | ``` |
95 | 95 |
|
96 | 96 | ## Pretty-Print transactions/instructions |
@@ -122,7 +122,7 @@ fmt.Println(tx.String()) |
122 | 122 |
|
123 | 123 | ## SendAndConfirmTransaction |
124 | 124 |
|
125 | | -You can wait for a transaction confirmation using the `github.com/solana-foundation/solana-go/rpc/sendAndConfirmTransaction` package tools (for a complete example: [see here](#transfer-sol-from-one-wallet-to-another-wallet)) |
| 125 | +You can wait for a transaction confirmation using the `github.com/solana-foundation/solana-go/v2/rpc/sendAndConfirmTransaction` package tools (for a complete example: [see here](#transfer-sol-from-one-wallet-to-another-wallet)) |
126 | 126 |
|
127 | 127 | ```go |
128 | 128 | // Send transaction, and wait for confirmation: |
@@ -153,9 +153,9 @@ import ( |
153 | 153 | "time" |
154 | 154 |
|
155 | 155 | "github.com/davecgh/go-spew/spew" |
156 | | - "github.com/solana-foundation/solana-go" |
157 | | - lookup "github.com/solana-foundation/solana-go/programs/address-lookup-table" |
158 | | - "github.com/solana-foundation/solana-go/rpc" |
| 156 | + "github.com/solana-foundation/solana-go/v2" |
| 157 | + lookup "github.com/solana-foundation/solana-go/v2/programs/address-lookup-table" |
| 158 | + "github.com/solana-foundation/solana-go/v2/rpc" |
159 | 159 | "golang.org/x/time/rate" |
160 | 160 | ) |
161 | 161 |
|
@@ -255,10 +255,10 @@ import ( |
255 | 255 |
|
256 | 256 | "github.com/davecgh/go-spew/spew" |
257 | 257 | bin "github.com/gagliardetto/binary" |
258 | | - "github.com/solana-foundation/solana-go" |
259 | | - "github.com/solana-foundation/solana-go/programs/system" |
260 | | - "github.com/solana-foundation/solana-go/rpc" |
261 | | - "github.com/solana-foundation/solana-go/text" |
| 258 | + "github.com/solana-foundation/solana-go/v2" |
| 259 | + "github.com/solana-foundation/solana-go/v2/programs/system" |
| 260 | + "github.com/solana-foundation/solana-go/v2/rpc" |
| 261 | + "github.com/solana-foundation/solana-go/v2/text" |
262 | 262 | ) |
263 | 263 |
|
264 | 264 | func main() { |
@@ -354,8 +354,8 @@ func decodeSystemTransfer(tx *solana.Transaction) { |
354 | 354 | // database/sql drivers: |
355 | 355 | // |
356 | 356 | // import ( |
357 | | - // _ "github.com/solana-foundation/solana-go/programs/system" |
358 | | - // _ "github.com/solana-foundation/solana-go/programs/token" |
| 357 | + // _ "github.com/solana-foundation/solana-go/v2/programs/system" |
| 358 | + // _ "github.com/solana-foundation/solana-go/v2/programs/token" |
359 | 359 | // // ...add more as needed |
360 | 360 | // ) |
361 | 361 | // |
@@ -462,7 +462,7 @@ import ( |
462 | 462 |
|
463 | 463 | "golang.org/x/time/rate" |
464 | 464 | "github.com/davecgh/go-spew/spew" |
465 | | - "github.com/solana-foundation/solana-go/rpc" |
| 465 | + "github.com/solana-foundation/solana-go/v2/rpc" |
466 | 466 | ) |
467 | 467 |
|
468 | 468 | func main() { |
@@ -493,7 +493,7 @@ import ( |
493 | 493 |
|
494 | 494 | "golang.org/x/time/rate" |
495 | 495 | "github.com/davecgh/go-spew/spew" |
496 | | - "github.com/solana-foundation/solana-go/rpc" |
| 496 | + "github.com/solana-foundation/solana-go/v2/rpc" |
497 | 497 | ) |
498 | 498 |
|
499 | 499 | func main() { |
@@ -541,8 +541,8 @@ import ( |
541 | 541 | "net/http" |
542 | 542 | "time" |
543 | 543 |
|
544 | | - "github.com/solana-foundation/solana-go/rpc" |
545 | | - "github.com/solana-foundation/solana-go/rpc/jsonrpc" |
| 544 | + "github.com/solana-foundation/solana-go/v2/rpc" |
| 545 | + "github.com/solana-foundation/solana-go/v2/rpc/jsonrpc" |
546 | 546 | ) |
547 | 547 |
|
548 | 548 | func NewHTTPTransport( |
@@ -609,8 +609,8 @@ import ( |
609 | 609 | "context" |
610 | 610 | "fmt" |
611 | 611 |
|
612 | | - "github.com/solana-foundation/solana-go" |
613 | | - "github.com/solana-foundation/solana-go/rpc" |
| 612 | + "github.com/solana-foundation/solana-go/v2" |
| 613 | + "github.com/solana-foundation/solana-go/v2/rpc" |
614 | 614 | ) |
615 | 615 |
|
616 | 616 | func main() { |
@@ -716,13 +716,13 @@ import ( |
716 | 716 | "time" |
717 | 717 |
|
718 | 718 | "github.com/davecgh/go-spew/spew" |
719 | | - "github.com/solana-foundation/solana-go" |
720 | | - "github.com/solana-foundation/solana-go/programs/system" |
721 | | - "github.com/solana-foundation/solana-go/rpc" |
722 | | - confirm "github.com/solana-foundation/solana-go/rpc/sendAndConfirmTransaction" |
723 | | - "github.com/solana-foundation/solana-go/rpc/jsonrpc" |
724 | | - "github.com/solana-foundation/solana-go/rpc/ws" |
725 | | - "github.com/solana-foundation/solana-go/text" |
| 719 | + "github.com/solana-foundation/solana-go/v2" |
| 720 | + "github.com/solana-foundation/solana-go/v2/programs/system" |
| 721 | + "github.com/solana-foundation/solana-go/v2/rpc" |
| 722 | + confirm "github.com/solana-foundation/solana-go/v2/rpc/sendAndConfirmTransaction" |
| 723 | + "github.com/solana-foundation/solana-go/v2/rpc/jsonrpc" |
| 724 | + "github.com/solana-foundation/solana-go/v2/rpc/ws" |
| 725 | + "github.com/solana-foundation/solana-go/v2/text" |
726 | 726 | ) |
727 | 727 |
|
728 | 728 | func main() { |
@@ -831,14 +831,14 @@ func main() { |
831 | 831 |
|
832 | 832 | All RPC methods from the [Solana JSON RPC API](https://solana.com/docs/rpc) are supported. |
833 | 833 | Each method has a testable example in [`rpc/example_test.go`](rpc/example_test.go) that is rendered on |
834 | | -[pkg.go.dev](https://pkg.go.dev/github.com/solana-foundation/solana-go@v1.16.0/rpc#pkg-examples). |
| 834 | +[pkg.go.dev](https://pkg.go.dev/github.com/solana-foundation/solana-go/v2@v1.16.0/rpc#pkg-examples). |
835 | 835 |
|
836 | 836 |
|
837 | 837 | ## WebSocket Subscriptions |
838 | 838 |
|
839 | 839 | All WebSocket subscriptions from the [Solana WebSocket API](https://solana.com/docs/rpc/websocket) are supported. |
840 | 840 | Each subscription has a testable example in [`rpc/ws/example_test.go`](rpc/ws/example_test.go) that is rendered on |
841 | | -[pkg.go.dev](https://pkg.go.dev/github.com/solana-foundation/solana-go@v1.16.0/rpc/ws#pkg-examples). |
| 841 | +[pkg.go.dev](https://pkg.go.dev/github.com/solana-foundation/solana-go/v2@v1.16.0/rpc/ws#pkg-examples). |
842 | 842 |
|
843 | 843 |
|
844 | 844 | ## Contributing |
|
0 commit comments