wallet

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NB_INITIAL_HASHES int = 10000000

	WALLET_TYPE_SEQUENTIAL         uint32 = 1
	WALLET_TYPE_SEQUENTIAL_VERSION uint32 = 1
)

Variables

This section is empty.

Functions

func GenerateRandomSeedString added in v0.2.2

func GenerateRandomSeedString() string

func Gensequentialwallet added in v0.2.3

func Gensequentialwallet(wlt *Wallet, seedString string)

func SerializeRSAPrivateKey added in v0.2.4

func SerializeRSAPrivateKey(privateKey *rsa.PrivateKey) ([]byte, error)

func SerializeRSAPublicKey added in v0.2.4

func SerializeRSAPublicKey(publicKey *rsa.PublicKey) ([]byte, error)

func UnserializeRSAPrivateKey added in v0.2.4

func UnserializeRSAPrivateKey(privkeyBytes []byte) (rsa.PrivateKey, error)

func UnserializeRSAPublicKey added in v0.2.4

func UnserializeRSAPublicKey(pubkeyBytes []byte) (rsa.PublicKey, error)

func VerifyRSASignature added in v0.2.4

func VerifyRSASignature(encryptedBytes []byte, sendersignature []byte, senderpublickeyBytes []byte) error

Types

type Asset

type Asset struct {
	Hash            utility.Hash
	Index           uint32
	Value           uint64
	Privatekeyindex uint32
	StateString     string
	SpendingTxHash  utility.Hash
	SpendingIndex   uint32
}

type Broadcastedtx

type Broadcastedtx struct {
	Tx                 utility.Transaction
	ConfirmationString string
}

type Commcredential added in v0.2.4

type Commcredential struct {
	Name             string
	RSAPrivateKey    rsa.PrivateKey
	RSAPublicKeyHash utility.Hash
}

type Contact

type Contact struct {
	Name         string
	AddrString   string
	GroupIdArray []uint32
}

type PrivateKeyBytes

type PrivateKeyBytes []byte

type Wallet

type Wallet struct {
	//HotWallet bool
	//Hotaddresses HotAddresses
	//Chain []byte
	Walletloaded        bool
	Walletstate         string
	Path                string
	Type                uint32
	Version             uint32
	Privatekeyarray     []*btcec.PrivateKey
	Assetarray          []Asset
	Lastknownblock      uint64
	Broadcastedtxarray  []Broadcastedtx
	Commcredentialarray []Commcredential
	Groupnamearray      []string
	Contactarray        []Contact
	// contains filtered or unexported fields
}

func Newsequentialwallet added in v0.2.3

func Newsequentialwallet(seedString string) *Wallet

func (*Wallet) AddAsset

func (wlt *Wallet) AddAsset(txhash utility.Hash, index uint32, value uint64, privkeyindex uint32, assetstate string)

func (*Wallet) AddBroadcastedtx

func (wlt *Wallet) AddBroadcastedtx(tx utility.Transaction)

func (*Wallet) AddContact

func (wlt *Wallet) AddContact(tmpname string, tmpaddrstring string, tmpgroupidarray []uint32)

func (*Wallet) ComputeBalance

func (wlt *Wallet) ComputeBalance() uint64

func (*Wallet) DecryptCommText added in v0.2.4

func (wlt *Wallet) DecryptCommText(encryptedBytes []byte, recepientpublickeyhash utility.Hash) ([]byte, error)

func (*Wallet) EncryptCommText added in v0.2.4

func (wlt *Wallet) EncryptCommText(tmptext []byte, recipientPubkeyBytes []byte, sendername []byte) ([]byte, []byte, error)

func (*Wallet) GenerateCommKey added in v0.2.4

func (wlt *Wallet) GenerateCommKey(tmpname []byte) []byte

func (*Wallet) GenerateKeyPair

func (wlt *Wallet) GenerateKeyPair() utility.Hash

func (*Wallet) GenerateKeyPairs added in v0.2.3

func (wlt *Wallet) GenerateKeyPairs(nbkeypair int)

func (*Wallet) GetAddress

func (wlt *Wallet) GetAddress(i uint) utility.Hash

func (*Wallet) GetAddressesDetails

func (wlt *Wallet) GetAddressesDetails() []string

func (*Wallet) GetAssetFromRegisteredName

func (wlt *Wallet) GetAssetFromRegisteredName(name string) (*Asset, error)

func (*Wallet) GetAssetsDetails

func (wlt *Wallet) GetAssetsDetails() []string

func (*Wallet) GetLastAddress

func (wlt *Wallet) GetLastAddress() utility.Hash

func (*Wallet) GetNbAddresses

func (wlt *Wallet) GetNbAddresses() int

func (*Wallet) GetNbAssets

func (wlt *Wallet) GetNbAssets() int
func (wlt *Wallet) GetAssetInfo(int i) ([]byte,value){
	return len(wlt.Assetarray)
}

func (*Wallet) GetPrivatekeyindexFromAddress

func (wlt *Wallet) GetPrivatekeyindexFromAddress(addr utility.Hash) int

func (*Wallet) GetRegisteredNames

func (wlt *Wallet) GetRegisteredNames() []string

func (*Wallet) GetUnconfirmedBroadcastedTxs

func (wlt *Wallet) GetUnconfirmedBroadcastedTxs() []*utility.Transaction

func (*Wallet) LoadJSONWalletFile added in v0.2.2

func (wlt *Wallet) LoadJSONWalletFile(path string, key []byte) error

func (*Wallet) Lock

func (wlt *Wallet) Lock()

func (*Wallet) SaveJSONWalletFile added in v0.2.3

func (wlt *Wallet) SaveJSONWalletFile(walletfilepath string, key []byte)

func (*Wallet) SetupTransactionAmount

func (wlt *Wallet) SetupTransactionAmount(amount uint64, fee uint64, txin *utility.TxIn, txout *utility.TxOut) (*utility.Transaction, error)

func (*Wallet) SetupTransactionForNameRegistration

func (wlt *Wallet) SetupTransactionForNameRegistration(name []byte, pubkeyhash utility.Hash, amount uint64, fee uint64) (*utility.Transaction, error)

func (*Wallet) SetupTransactionForNameUnregistration

func (wlt *Wallet) SetupTransactionForNameUnregistration(name string, fee uint64) (*utility.Transaction, error)

func (*Wallet) SetupTransactionForRegistredNameCommit added in v0.2.3

func (wlt *Wallet) SetupTransactionForRegistredNameCommit(name string, commitbytes []byte, fee uint64) (*utility.Transaction, error)

func (*Wallet) SetupTransactionToPublicKeyHash

func (wlt *Wallet) SetupTransactionToPublicKeyHash(pubkeyhash utility.Hash, amount uint64, fee uint64) (*utility.Transaction, error)

func (*Wallet) SetupTransactionToPublicKeyHashArray

func (wlt *Wallet) SetupTransactionToPublicKeyHashArray(pubkeyhasharray []utility.Hash, amountarray []uint64, fee uint64) (*utility.Transaction, error)

func (*Wallet) Unlock

func (wlt *Wallet) Unlock()

type Walletfile

type Walletfile struct {
	//Path string
	//Chain []byte
	//
	Privatekeyarray []PrivateKeyBytes

	Assetarray         []Asset
	Lastknownblock     uint64
	Broadcastedtxarray []Broadcastedtx
	Groupnamearray     []string
	Contactarray       []Contact
}

Jump to

Keyboard shortcuts

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