solana-go/rpc/examples/getTokenLargestAccounts/getTokenLargestAccounts.go

26 lines
486 B
Go

package main
import (
"context"
"github.com/davecgh/go-spew/spew"
"github.com/gagliardetto/solana-go"
"github.com/gagliardetto/solana-go/rpc"
)
func main() {
endpoint := rpc.MainNetBeta_RPC
client := rpc.New(endpoint)
pubKey := solana.MustPublicKeyFromBase58("SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt") // serum token
out, err := client.GetTokenLargestAccounts(
context.TODO(),
pubKey,
rpc.CommitmentFinalized,
)
if err != nil {
panic(err)
}
spew.Dump(out)
}