Skip to content

0xcregis/cregis-go-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cregis-sdk-go

The sdk of cregis by golang is used to cregis server

Getting started

Prerequisites

  • Go: go version >=1.20

Getting SDK

With Go module support, simply add the following import

import "github.com/0xcregis/cregis-go-sdk"

to your code, and then go [build|run|test] will automatically fetch the necessary dependencies.

Otherwise, run the following Go command to install the sdk package:

$ go get -u github.com/0xcregis/cregis-go-sdk

Using SDK

First you need to import sdk package for using, one simplest example likes the follow example.go:

package main

import (
	"fmt"

	sdk "github.com/0xcregis/cregis-go-sdk"
)

func main() {
	c := sdk.NewClient("http://a0c1369e-12ec-467f-9989-7aba384a25e3.apple806.cc:81", "a4b0e563414a4e4dbeb407c89ce2f127", 1388205706190848)
	r, err := c.AddressLegal("195", "TXsmKpEuW7qWnXzJLGP9eDLvWPR2GRn1FS")
	if err != nil {
		fmt.Printf("err:%v", err.Error())
	} else {
		fmt.Printf("%+v", r)
	}
}

Learn more examples

Learn and practice more examples, please read the Test Case .

Documentation

See API documentation and descriptions for package.