/nem2-sdk-go

Official Go SDK for ProximaX/NEM Catapult

Primary LanguageGoApache License 2.0Apache-2.0

nem2-sdk-go

nem2-sdk-go is a Golang client library for Catapult API

Usage

import "github.com/proximax-storage/nem2-sdk-go/sdk"

Create a Catapult network configuration

Using the Testnet network

conf, err := sdk.NewConfig("http://localhost:3000",sdk.Testnet)

Or using the Mainnet network

conf, err := sdk.NewConfig("http://localhost:3000",sdk.Mainnet)

Construct a new Catapult client

client := sdk.NewClient(nil, conf)

Using the client to call a method from a Service API

// Get the chain height
chainHeight, err := client.Blockchain.GetChainHeight(context.Background())

Context

A Context type is the first argument in any service method for specifying deadlines, cancelation signals, and other request-scoped values

// Get the chain height
chainHeight, err := client.Blockchain.GetChainHeight(context.Background())

Wiki / Examples

Examples are in the examples folder

For more examples, go to our wiki

Core Contributors

Contribution

We'd love to get more people involved in the project. Please feel free to raise any issues or PR and we'll review your contribution.

Copyright (c) 2018 ProximaX Limited