// NewAlgorandBufferFromEnv creates an AlgorandBuffer from environment variables.
// The environment variables contain configuration to connect to an Algorand node.
// You can find explanations in the README. Alternatively, check out the implementation
// in client.GetAlgorandEnvironmentVars. You can pass your own logger to be used. If you
// pass nil, no logging will occur.
//
// This method uses the client.CreateAlgorandClientWrapper implementation. If you want to
// use your own implementation of client.AlgorandClient, use NewAlgorandBuffer instead.
NewAlgorandBufferFromEnv creates an AlgorandBuffer from environment variables.
The environment variables contain configuration to connect to an Algorand node.
You can find explanations in the README. Alternatively, check out the implementation
in client.GetAlgorandEnvironmentVars. You can pass your own logger to be used. If you
pass nil, no logging will occur.

This method uses the client.CreateAlgorandClientWrapper implementation. If you want to
use your own implementation of client.AlgorandClient, use NewAlgorandBuffer instead.
// NewAlgorandBufferFromEnv creates an AlgorandBuffer from environment variables . // The environment variables contain configuration to connect to an Algorand node . // You can find explanations in the README . Alternatively check out the implementation // in client . GetAlgorandEnvironmentVars . You can pass your own logger to be used . If you // pass nil no logging will occur . // // This method uses the client . CreateAlgorandClientWrapper implementation . If you want to // use your own implementation of client . AlgorandClient use NewAlgorandBuffer instead .
func NewAlgorandBufferFromEnv() (*AlgorandBuffer, error) {
	if !client.HasEnvironmentVars() {
		return nil, errors.New("configuration variables are not set. See README")
	}
	url, token, base64key, headers := client.GetAlgorandEnvironmentVars()
	if len(headers) != 0 {
		a, err := client.NewClientWithHeaders(url, token, headers)
		if err != nil {
			return nil, err
		}
		return NewAlgorandBuffer(a, base64key)
	}
	a, err := client.CreateAlgorandClientWrapper(url, token)
	if err != nil {
		return nil, err
	}
	return NewAlgorandBuffer(a, base64key)
}
func NewAlgorandBufferFromEnv ( ) ( * AlgorandBuffer , error ) { if ! client . HasEnvironmentVars ( ) { return nil , errors . New ( " " ) } url , token , base64key , headers := client . GetAlgorandEnvironmentVars ( ) if len ( headers ) != 0 { a , err := client . NewClientWithHeaders ( url , token , headers ) if err != nil { return nil , err } return NewAlgorandBuffer ( a , base64key ) } a , err := client . CreateAlgorandClientWrapper ( url , token ) if err != nil { return nil , err } return NewAlgorandBuffer ( a , base64key ) }
NewAlgorandBufferFromEnv creates an AlgorandBuffer from environment variables.
NewAlgorandBufferFromEnv creates an AlgorandBuffer from environment variables .