// NewAlgorandBuffer creates a new instance of AlgorandBuffer. The buffer requires an
// client.AlgorandClient to perform persistence and setup operations on the Algorand blockchain.
// base64key is the base64-encoded private key of the 'target account'. The target account
// creates and maintains the applications state on the blockchain.
NewAlgorandBuffer creates a new instance of AlgorandBuffer. The buffer requires an
client.AlgorandClient to perform persistence and setup operations on the Algorand blockchain.
base64key is the base64-encoded private key of the 'target account'. The target account
creates and maintains the applications state on the blockchain.
// NewAlgorandBuffer creates a new instance of AlgorandBuffer . The buffer requires an // client . AlgorandClient to perform persistence and setup operations on the Algorand blockchain . // base64key is the base64 - encoded private key of the ' target account ' . The target account // creates and maintains the applications state on the blockchain .
func NewAlgorandBuffer(c client.AlgorandClient, b64key string) (*AlgorandBuffer, error) {
	pk, err := base64.StdEncoding.DecodeString(b64key)
	if err != nil {
		return nil, err
	}
	account, err := crypto.AccountFromPrivateKey(pk)
	if err != nil {
		return nil, err
	}
	buffer := &AlgorandBuffer{
		Client:          c,
		AccountCrypt:    account,
		deleteArguments: make(chan string, 64),
		storeArguments:  make(chan models.TealKeyValue, 64),
		timeoutLength:   client.AlgorandDefaultTimeout,
	}
	ctx, cancel := context.WithTimeout(context.Background(), client.AlgorandDefaultTimeout)
	err = buffer.ensureRemoteValid(ctx)
	cancel()
	if err != nil {
		return buffer, err
	}
	return buffer, err
}
func NewAlgorandBuffer ( c client . AlgorandClient , b64key string ) ( * AlgorandBuffer , error ) { pk , err := base64 . StdEncoding . DecodeString ( b64key ) if err != nil { return nil , err } account , err := crypto . AccountFromPrivateKey ( pk ) if err != nil { return nil , err } buffer := & AlgorandBuffer { Client : c , AccountCrypt : account , deleteArguments : make ( chan string , 64 ) , storeArguments : make ( chan models . TealKeyValue , 64 ) , timeoutLength : client . AlgorandDefaultTimeout , } ctx , cancel := context . WithTimeout ( context . Background ( ) , client . AlgorandDefaultTimeout ) err = buffer . ensureRemoteValid ( ctx ) cancel ( ) if err != nil { return buffer , err } return buffer , err }
NewAlgorandBuffer creates a new instance of AlgorandBuffer.
NewAlgorandBuffer creates a new instance of AlgorandBuffer .
// Decode Base64 private key