Skip to content

v1.4.0

Compare
Choose a tag to compare
@yihau yihau released this 29 Aug 16:19
· 296 commits to main since this release

What's new

RPC

make api interface more friendly

  • getBalance
  • getAccountInfo
  • getRecentBlockhash
  • sendTransaction

Client

add a more quick send tx func, sendTransaction
now you can send tx like

	c := client.NewClient(rpc.DevnetRPCEndpoint)
	sig, err := c.SendTransaction(
		context.Background(),
		client.SendTransactionParam{
			Instructions: []types.Instruction{
				sysprog.Transfer(
					feePayer.PublicKey,
					to.PublicKey,
					1, // 1 lamports
				),
			},
			Signers:  []types.Account{feePayer},
			FeePayer: feePayer.PublicKey,
		},
	)

I will wrap tx for you in the client 🎉
If you need more custom way, you can also use c.RpcClient.SendTransaction or c.RpcClient.SendTransactionWithConfig to send !