wallet

package
v1.17.6 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Methods and types to represent client's wallet.

Index

Constants

View Source
const (
	ZCNSCSmartContractAddress = "6dba10422e368813802877a85039d3985d96760ed844092319743fb3a76712e0"
	MintFunc                  = "mint"
	BurnFunc                  = "burn"
	BurnWzcnTicketPath        = "/v1/ether/burnticket/"
	BurnWzcnBurnEventsPath    = "/v1/ether/burnevents/"
	BurnNativeTicketPath      = "/v1/0chain/burnticket/"
)

Variables

Functions

func ExitWithError

func ExitWithError(v ...interface{})

func PrintError

func PrintError(v ...interface{})

Types

type ZCNStatus

type ZCNStatus struct {
	Wg      *sync.WaitGroup
	Success bool
	Err     error
	// contains filtered or unexported fields
}

ZCNStatus represents the status of a ZCN operation.

func NewZCNStatus

func NewZCNStatus(value interface{}) (zcns *ZCNStatus)

NewZCNStatus creates a new ZCNStatus instance.

  • value: value to be stored in the ZCNStatus instance

func (*ZCNStatus) Begin

func (zcn *ZCNStatus) Begin()

Begin starts the wait group

func (*ZCNStatus) OnAuthComplete

func (zcn *ZCNStatus) OnAuthComplete(_ *zcncore.Transaction, status int)

OnTransferComplete callback when a transfer is completed. Not used in this implementation

func (*ZCNStatus) OnAuthorizeSendComplete

func (zcn *ZCNStatus) OnAuthorizeSendComplete(status int, _ string, _ int64, _ string, creationDate int64, signature string)

OnAuthorizeSendComplete callback when authorization is completed

  • status: status of the operation
  • 2nd parameter is not used, it is kept for compatibility
  • 3rd parameter is not used, it is kept for compatibility
  • 4th parameter is not used, it is kept for compatibility
  • creationDate: timestamp of the creation date
  • signature: signature of the operation

func (*ZCNStatus) OnBalanceAvailable

func (zcn *ZCNStatus) OnBalanceAvailable(status int, value int64, _ string)

OnBalanceAvailable callback when balance is available

  • status: status of the operation
  • value: balance value
  • third parameter is not used, it is kept for compatibility

func (*ZCNStatus) OnInfoAvailable

func (zcn *ZCNStatus) OnInfoAvailable(op int, status int, info string, err string)

OnInfoAvailable callback when information is available

  • op`: operation type (check `zcncore.Op* constants)
  • status: status of the operation
  • info: information represneted as a string
  • err: error message

func (*ZCNStatus) OnSetupComplete

func (zcn *ZCNStatus) OnSetupComplete(_ int, _ string)

OnSetupComplete callback when setup is completed. Paramters are not used in this implementation, just kept for compatibility.

func (*ZCNStatus) OnTransactionComplete

func (zcn *ZCNStatus) OnTransactionComplete(t *zcncore.Transaction, status int)

OnTransactionComplete callback when a transaction is completed

  • t: transaction object
  • status: status of the transaction

func (*ZCNStatus) OnVerifyComplete

func (zcn *ZCNStatus) OnVerifyComplete(t *zcncore.Transaction, status int)

OnVerifyComplete callback when a transaction is verified

  • t: transaction object
  • status: status of the transaction

func (*ZCNStatus) OnVoteComplete

func (zcn *ZCNStatus) OnVoteComplete(status int, proposal string, err string)

OnVoteComplete callback when a multisig vote is completed

  • status: status of the operation
  • proposal: proposal json string
  • err: error message

func (*ZCNStatus) OnWalletCreateComplete

func (zcn *ZCNStatus) OnWalletCreateComplete(status int, wallet string, err string)

OnWalletCreateComplete callback when a wallet is created

  • status: status of the operation
  • wallet: wallet json string

func (*ZCNStatus) Wait

func (zcn *ZCNStatus) Wait() error

Wait waits for the wait group to finish

Jump to

Keyboard shortcuts

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