Coder Social home page Coder Social logo

go-coreapi's Introduction

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.

go-coreapi's People

Contributors

vottunio avatar ihernanv avatar aniolvottun avatar

Stargazers

Alex Lopez avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.