golana

package module
v0.0.0-...-ceffd7b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

README

golana

Solana SDK library written in Go

package main

import (
  "fmt"

  "github.com/OnlyF0uR/golana"
)

func main() {
  // Create account
	acc, err := golana.CreateAccount()
	if err != nil {
		panic(err)
	}

	// Sign a message
	msg := []byte("Hello, world!")
	sig, err := acc.SignMessage(msg)
	if err != nil {
		panic(err)
	}

	// Log the signature
	fmt.Printf("Signature: %s\n", sig)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	// contains filtered or unexported fields
}

func AccountFromPrivateKey

func AccountFromPrivateKey(privateKey []byte) *Account

func AccountFromPrivateKeyBase58

func AccountFromPrivateKeyBase58(privateKey string) (*Account, error)

func CreateAccount

func CreateAccount() (*Account, error)

func (*Account) PrivateKey

func (a *Account) PrivateKey() string

func (*Account) PublicKey

func (a *Account) PublicKey() string

func (*Account) SignMessage

func (a *Account) SignMessage(payload []byte) (string, error)

func (*Account) VerifySignature

func (a *Account) VerifySignature(payload []byte, signature string) (bool, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL