zboxapi

package
v1.17.0-RC5 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Subpackage to provide interface for zboxapi SDK (dealing with apps backend) to be used to build the mobile SDK.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrZboxApiNotInitialized = errors.New("zboxapi: zboxapi client is not initialized")
	ErrZboxApiInvalidWallet  = errors.New("zboxapi: invalid wallet")
)

Functions

func CreateJwtSession

func CreateJwtSession(phoneNumber string) (int64, error)

CreateJwtSession create a jwt session for the given phone number

  • phoneNumber is the phone number

func CreateJwtToken

func CreateJwtToken(phoneNumber string, jwtSessionID int64, otp string) (string, error)

CreateJwtToken create a fresh jwt token for the given phone number

  • phoneNumber is the phone number
  • jwtSessionID is the jwt session id
  • otp is the one time password

func GetCsrfToken

func GetCsrfToken() (string, error)

GetCsrfToken create a fresh CSRF token

func Init

func Init(baseUrl, appType string)

Init initialize the zbox api client for the mobile sdk

  • baseUrl is the base url of the server
  • appType is the type of the application

func RefreshJwtToken

func RefreshJwtToken(phoneNumber string, token string) (string, error)

RefreshJwtToken refresh jwt token

  • phoneNumber is the phone number for which the token is to be refreshed
  • token is the token to be refreshed

func SetWallet

func SetWallet(clientID, clientPrivateKey, clientPublicKey string) error

SetWallet set the client's wallet information for the zbox api client

  • clientID is the client id
  • clientPrivateKey is the client private key
  • clientPublicKey is the client public key

Types

This section is empty.

Jump to

Keyboard shortcuts

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