Categorygithub.com/vottunio/go-coreapi
module
0.2.25
Repository: https://github.com/vottunio/go-coreapi.git
Documentation: pkg.go.dev

# README

sdk-core-go

License: MIT Go Reference Build Status Go Report Card

Discord Twitter

Vottun Core API SDK For Golang

This repository contains an SDK with the necessary functions to make calls to the Vottun Core Blockchain API.

Requires Go version 1.18 or higher.

Installation

go get github.com/vottunio/sdk-core-go

Usage

To use the Core API, first import the dependency into your .go file:

import "github.com/vottunio/sdk-core-go/coreapi"

Build a CoreApi client to use all the API calls. For that, you'll need to obtain a token and an application identifier. You can obtain them at https://apis.vottun.tech/trial. You'll also need the root URL of the application, which will be published very soon.

An example of creating a client would be:

coreApiClient := coreapi.New(<TOKEN_AUTH>, <APP_ID>, <ENV_ROOT_URL>)

Where coreApiClient is the new client that allows you to call different functions of the Core API.

The following example allows us to make a call to create a new custodied wallet for a user:

newWalletRequest := &coreapi.NewWalletRequestDTO{User: "nameATmail.example", Pin: "6666666"}
if res, err := coa.CreateNewCustodiedWallet(newWalletRequest); err != nil {
    fmt.Printf("err: %v\n", err)
} else {
    fmt.Printf("res: %+v\n", res)
}

Please note that the example assumes you have already created an instance of coreApiClient at the previous step.

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author