All Projects → fox-one → mixin-sdk-go

fox-one / mixin-sdk-go

Licence: MIT License
Golang sdk for Mixin Network & Mixin Messenger

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to mixin-sdk-go

vue-mixin-tween
Vue mixin factory to tween component numerical data
Stars: ✭ 25 (-30.56%)
Mutual labels:  mixin
scss-font-lock
This is a SCSS mixin used to create CSS locks for responsive typography. To make in convenient to use it allows you to use both px and em as units and if anything goes wrong, it will let you know during the compile using scss @warn and also print an error message on top of the text in the application or website.
Stars: ✭ 18 (-50%)
Mutual labels:  mixin
ClientAPI
API designed to make Minecraft "Utility Mods" have Universal Support
Stars: ✭ 58 (+61.11%)
Mutual labels:  mixin
sloped-edge
Sass mixin that helps you build sloped section edges with a consistent angle.
Stars: ✭ 85 (+136.11%)
Mutual labels:  mixin
vue-component-style
A Vue mixin to add style section to components.
Stars: ✭ 16 (-55.56%)
Mutual labels:  mixin
vue-in-viewport-mixin
Vue 2 mixin to determine when a DOM element is visible in the client window
Stars: ✭ 99 (+175%)
Mutual labels:  mixin
ModernUI
Modern desktop framework from low-level 3D graphics API to high-level view model, for development of 2D/3D rendering software or game engine, with internationalization support and many new technologies.
Stars: ✭ 168 (+366.67%)
Mutual labels:  mixin
mixin bot
A simple API wrapper for Mixin Network in Ruby
Stars: ✭ 12 (-66.67%)
Mutual labels:  mixin
python-pyfields
Define fields in python classes. Easily.
Stars: ✭ 39 (+8.33%)
Mutual labels:  mixin
helm2-mixin
Helm mixin for Porter
Stars: ✭ 14 (-61.11%)
Mutual labels:  mixin
vertical-rhythm-reset
A Sass/SCSS library for responsive vertical rhythm grids, modular scale typography, and CSS normalization.
Stars: ✭ 65 (+80.56%)
Mutual labels:  mixin
bot-api-go-client
🤖️ Mixin API for Go
Stars: ✭ 65 (+80.56%)
Mutual labels:  mixin
go-traits
A concept package that helps implement mixin behavior using embedded structs and hook interfaces.
Stars: ✭ 21 (-41.67%)
Mutual labels:  mixin
hacker-news-mixin-bot
Post new hot stories from Hacker News to Mixin bot (Mixin ID: 7000100124)
Stars: ✭ 19 (-47.22%)
Mutual labels:  mixin
mixomatic
Create mixins which work with instanceof (friendly for unit tests).
Stars: ✭ 21 (-41.67%)
Mutual labels:  mixin
pando
Pando is a decentralized financial network built with the MTG technology, and its underlying financial algorithm is inspired by Maker and Synthetix.
Stars: ✭ 12 (-66.67%)
Mutual labels:  mixin
flexbox-grid-mixins
Sass Mixins to generate Flexbox grid
Stars: ✭ 67 (+86.11%)
Mutual labels:  mixin
mixin-node-client
More developer friendly Node.js SDK for Mixin network
Stars: ✭ 15 (-58.33%)
Mutual labels:  mixin-network

mixin-sdk-go

Golang sdk for Mixin Network & Mixin Messenger

Install

go get -u github.com/fox-one/mixin-sdk-go

Features

  • Comprehensive most of the Mixin Network & Mixin Messenger api supported
  • Security verify Response X-Request-ID & signature automatically
  • Flexible initialize Client from keystore, ed25519_oauth_token or access_token

Examples

See _examples/ for a variety of examples.

Quick Start

package main

import (
	"context"
	"log"

	"github.com/fox-one/mixin-sdk-go"
)

func main() {
	ctx := context.Background()
	s := &mixin.Keystore{
		ClientID:   "",
		SessionID:  "",
		PrivateKey: "",
		PinToken: "",
	}

	client, err := mixin.NewFromKeystore(s)
	if err != nil {
		log.Panicln(err)
	}

	user, err := client.UserMe(ctx)
	if err != nil {
		log.Printf("UserMe: %v", err)
		return
	}

	log.Println("user id", user.UserID)
}

Error handling?

check error code by mixin.IsErrorCodes

if _, err := client.UserMe(ctx); err != nil {
    switch {
    case mixin.IsErrorCodes(err,mixin.Unauthorized,mixin.EndpointNotFound):
    	// handle unauthorized error
    case mixin.IsErrorCodes(err,mixin.InsufficientBalance):
        // handle insufficient balance error
    default:
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].