Skip to content

0dayfall/nordnet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nordnet

Build Status GoDoc Go Report Card

Go implementation of the Nordnet External API.

https://api.test.nordnet.se/api-docs/index.html

Installation

go get github.com/0dayfall/nordnet

Usage

REST API Client

package main

import (
	"fmt"
	"github.com/0dayfall/nordnet/api"
	"github.com/0dayfall/nordnet/util"
)

var (
	pemData = []byte(`-----BEGIN PUBLIC KEY-----`)
	user    = []byte(`...`)
	pass    = []byte(`...`)
)

func main() {
	cred, _ := util.GenerateCredentials(user, pass, pemData)
	client := api.NewAPIClient(cred)
	client.Login()

	fmt.Println(client.Accounts())
}

To use Nordnet test credentials, try client := api.NewAPITestClient(cred).

Feed Client

package main

import (
	"fmt"
	"github.com/0dayfall/nordnet/feed"
)

var (
	sessionKey = "..."
	address    = "..."
)

func main() {
	feed, _ := feed.NewPrivateFeed(address)
	feed.Login(sessionKey, nil)

	msgChan := make(chan *PrivateMsg)
	errChan := make(chan error)
	feed.Dispatch(msgChan, errChan)

	for _, msg := range msgChan {
		fmt.Println(msg)
	}
}

About

Nordnet API client

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.6%
  • Dockerfile 0.4%