Skip to content

Go SDK - Examples

For sample code which explains the core concepts of how to use the SDK, see:

Below are additional resources which may be more suited for your individual use case.

The examples folder in the SDK repo has many code snippets you can customize to your needs.

To run one of the example scripts:

  1. Clone the

    Terminal window
    git clone https://github.com/aptos-labs/aptos-go-sdk.git
  2. From the top-level of the package, install all dependencies.

    Terminal window
    go install
  3. Build the package.

    Terminal window
    go build ./...
  4. Run an example

    Terminal window
    go run examples/transfer_coin/main.go
  • SDK source code - This has in-line comments explaining what each function does.
  • SDK reference docs - These are another way to view the in-line documentation with built-in search.