sdks

package
v1.2.89 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ClientID        string
	ClientPublicKey string
	BaseURL         string
}

Client a client instance of restful api

func NewClient

func NewClient(clientID, clientPublicKey, baseURL string) (Client, error)

create client instance

func (*Client) SignRequest

func (c *Client) SignRequest(req *http.Request, allocation string) error

type ZBox

type ZBox struct {
	// ClientID client id
	ClientID string
	// ClientKey client key
	ClientKey string
	// SignatureScheme signature scheme
	SignatureScheme string

	// Wallet wallet
	Wallet zcncrypto.Wallet

	// NewRequest create http request
	NewRequest func(method, url string, body io.Reader) (*http.Request, error)
}

ZBox sdk client instance

func New

func New(clientID, clientKey, signatureScheme string) *ZBox

New create a sdk client instance

func (*ZBox) InitWallet

func (z *ZBox) InitWallet(js string) error

InitWallet init wallet from json

func (*ZBox) SignRequest

func (z *ZBox) SignRequest(req *http.Request, allocationID string) error

SignRequest sign request with client_id, client_key and sign

Directories

Path Synopsis
package blobber wrap blobber's apis as sdk client
package blobber wrap blobber's apis as sdk client

Jump to

Keyboard shortcuts

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