From b13f7af05dc992d1f4716d9e4a58a402d66baa41 Mon Sep 17 00:00:00 2001 From: Shane O'Brien Date: Tue, 17 Sep 2024 14:03:40 -0400 Subject: [PATCH] Adding more detail and notes to the examples --- examples/eth/build-staking-operation/main.go | 7 ++++++- examples/solana/build-staking-operation/main.go | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/examples/eth/build-staking-operation/main.go b/examples/eth/build-staking-operation/main.go index 7ca2e46..de939c3 100644 --- a/examples/eth/build-staking-operation/main.go +++ b/examples/eth/build-staking-operation/main.go @@ -11,6 +11,11 @@ import ( "github.com/coinbase/coinbase-sdk-go/pkg/coinbase" ) +/* + * This example code stakes ETH on the Holesky network. + * Run the code with 'go run examples/ethereum/build-staking-operation/main.go ' + */ + func main() { ctx := context.Background() @@ -21,7 +26,7 @@ func main() { log.Fatalf("error creating coinbase client: %v", err) } - address := coinbase.NewExternalAddress("ethereum-holesky", "0x57a063e1df096aaA6b2068C3C7FE6Ac4BC3c4F58") + address := coinbase.NewExternalAddress("ethereum-holesky", os.Args[2]) stakeableBalance, err := client.GetStakeableBalance(ctx, coinbase.Eth, address, coinbase.WithStakingBalanceMode(coinbase.StakingOperationModePartial)) if err != nil { diff --git a/examples/solana/build-staking-operation/main.go b/examples/solana/build-staking-operation/main.go index 1d58b76..5e740eb 100644 --- a/examples/solana/build-staking-operation/main.go +++ b/examples/solana/build-staking-operation/main.go @@ -25,6 +25,11 @@ var ( defaultPrivKeyPath = filepath.Join(home(), ".config/solana/id.json") ) +/* + * This example code stakes SOL on the devnet network. + * Run the code with 'go run examples/solana/build-staking-operation/main.go ' + */ + func main() { ctx := context.Background()