service

package
v0.0.0-...-a173fca Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: LGPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RPERMISSION = iota //read
	WPERMISSION        //write
)
View Source
const (
	LOCKED   = iota //locked
	UNLOCKED        //unlocked
)
View Source
const (
	MODULENAME = "accounts"
)

Variables

View Source
var (
	ErrExistKeystore   = errors.New("exist keystore")
	ErrClosedWallet    = errors.New("wallet is not open")
	ErrLockedWallet    = errors.New("wallet is already locked")
	ErrNotAHash        = errors.New("msg is not a hash")
	ErrAlreadyUnLocked = errors.New("wallet is already unlocked")
	ErrExistKey        = errors.New("privkey is exist")
	ErrMissingKeystore = errors.New("not found keystore")
	ErrAccountExist    = errors.New("addr is not exist")
	ErrMissingPath     = errors.New("not found path")
)
View Source
var (
	KeyStoreDirFlag = common.DirectoryFlag{
		Name:  "keystore",
		Usage: "Directory for the keystore (default = inside the homedir)",
	}

	WalletPasswordFlag = cli.StringFlag{
		Name:  "walletpassword",
		Usage: "keep wallet open",
	}

	EnableWalletFlag = cli.BoolFlag{
		Name:  "enableWallet",
		Usage: "is wallet flag",
	}

	DefaultConfig = &accountTypes.Config{
		Enable:      true,
		Type:        "filestore",
		KeyStoreDir: "keystore",
	}
)

Functions

This section is empty.

Types

type AccountApi

type AccountApi struct {
	EvmService *evm.EvmService
	Wallet     *Wallet
	// contains filtered or unexported fields
}

name: Account RPC interface usage: Address management and initiate simple transactions prefix:account

func (*AccountApi) CancelCandidateCredit

func (accountapi *AccountApi) CancelCandidateCredit(from crypto.CommonAddress, amount, gasprice, gaslimit *common.Big) (string, error)
 name: CancelCandidateCredit
 usage: To cancel the candidate
 params:
	1. The address at which the transfer was cancel
	2. address of candidate
	3. amount
	4. gas price
	5. gas limit

 return: transaction hash
 example:   curl -H "Content-Type: application/json" -X post --data '{"jsonrpc":"2.0","method":"account_cancelCandidateCredit","params":["0x3ebcbe7cb440dd8c52940a2963472380afbb56c5","0x111","0x110","0x30000",""],"id":1}' http://127.0.0.1:10085
 response:
	 {"jsonrpc":"2.0","id":1,"result":"0x3a3b59f90a21c2fd1b690aa3a2bc06dc2d40eb5bdc26fdd7ecb7e1105af2638e"}

func (*AccountApi) CancelVoteCredit

func (accountapi *AccountApi) CancelVoteCredit(from crypto.CommonAddress, to crypto.CommonAddress, amount, gasprice, gaslimit *common.Big) (string, error)
 name: CancelVoteCredit
 usage:
 params:
	1. address of voter
	2. address of candidate
	3. amount
	4. gas price
	5. gas limit
	6. 备注
 return: transaction hash
 example:   curl -H "Content-Type: application/json" -X post --data '{"jsonrpc":"2.0","method":"account_cancelVoteCredit","params":["0x3ebcbe7cb440dd8c52940a2963472380afbb56c5","0x3ebcbe7cb440dd8c52940a2963472380afbb56c5","0x111","0x110","0x30000"],"id":1}' http://127.0.0.1:10085
 response:
	 {"jsonrpc":"2.0","id":1,"result":"0x3a3b59f90a21c2fd1b690aa3a2bc06dc2d40eb5bdc26fdd7ecb7e1105af2638e"}

func (*AccountApi) CandidateCredit

func (accountapi *AccountApi) CandidateCredit(from crypto.CommonAddress, amount, gasprice, gaslimit *common.Big, data string) (string, error)
 name: CandidateCredit
 usage: Candidate node pledge
 params:
	1. The address of the pledger
	2. The pledge amount
	3. gas price
	4. gas limit
	5. The pubkey corresponding to the address of the pledger, and the P2p information of the pledger
 return: transaction hash
 example:   curl -H "Content-Type: application/json" -X post --data '{"jsonrpc":"2.0","method":"account_candidateCredit","params":["0x3ebcbe7cb440dd8c52940a2963472380afbb56c5","0x111","0x110","0x30000","{\"Pubkey\":\"0x020e233ebaed5ade5e48d7ee7a999e173df054321f4ddaebecdb61756f8a43e91c\",\"Node\":\"enode://3f05da2475bf09ce20b790d76b42450996bc1d3c113a1848be1960171f9851c0@149.129.172.91:44444\"}"],"id":1}' http://127.0.0.1:10085
 response:
	 {"jsonrpc":"2.0","id":1,"result":"0x3a3b59f90a21c2fd1b690aa3a2bc06dc2d40eb5bdc26fdd7ecb7e1105af2638e"}

func (*AccountApi) CloseWallet

func (accountapi *AccountApi) CloseWallet()
 name: closeWallet
 usage: close wallet
 params:
 return: none
 example:   curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"account_closeWallet","params":[], "id": 3}' -H "Content-Type:application/json"
 response:
	 {"jsonrpc":"2.0","id":3,"result":null}

func (*AccountApi) CreateAccount

func (accountapi *AccountApi) CreateAccount(password string) (*crypto.CommonAddress, error)
 name: createAccount
 usage: Create a local account
 params:
	1. password
 return: New account address information
 example:   curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"account_createAccount","params":["123456"], "id": 3}' -H "Content-Type:application/json"
 response:
	  {"jsonrpc":"2.0","id":3,"result":"0x2944c15c466fad03ec1282bab579dec5a0cf0fa3"}

func (*AccountApi) CreateCode

func (accountapi *AccountApi) CreateCode(from crypto.CommonAddress, byteCode common.Bytes, gasprice, gaslimit *common.Big) (string, error)
 name: createCode
 usage: Deployment of contract
 params:
	1. The account address of the deployment contract
	2. Content of the contract
	3. gas price
	4. gas limit
 return: transaction hash
 example:
 	curl -H "Content-Type: application/json" -X post --data '{"jsonrpc":"2.0","method":"account_createCode","params":["0x3ebcbe7cb440dd8c52940a2963472380afbb56c5","0x608060405234801561001057600080fd5b5061018c806100206000396000f3fe608060405260043610610051576000357c0100000000000000000000000000000000000000000000000000000000900480634f2be91f146100565780636d4ce63c1461006d578063db7208e31461009e575b600080fd5b34801561006257600080fd5b5061006b6100dc565b005b34801561007957600080fd5b5061008261011c565b604051808260070b60070b815260200191505060405180910390f35b3480156100aa57600080fd5b506100da600480360360208110156100c157600080fd5b81019080803560070b9060200190929190505050610132565b005b60016000808282829054906101000a900460070b0192506101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff160217905550565b60008060009054906101000a900460070b905090565b806000806101000a81548167ffffffffffffffff021916908360070b67ffffffffffffffff1602179055505056fea165627a7a723058204b651e4313ab6bc4eda61084cac1f805699cefbb979ddfd3a2d7f970903307cd0029","0x111","0x110","0x30000"],"id":1}' http://127.0.0.1:10085
 response:
	 {"jsonrpc":"2.0","id":1,"result":"0x9a8d8d5d7d00bbe0eb1b9431a13a7219008e352241b751b177bfb29e4e75b0d1"}

func (*AccountApi) CreateWallet

func (accountapi *AccountApi) CreateWallet(password string) error
 name: createWallet
 usage: Create a local wallet
 params:
	1. The wallet password
 return:  Failure returns the reason for the error, and success returns no information
 example:   curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"account_createWallet","params":["123"], "id": 3}' -H "Content-Type:application/json"
 response:
	  {"jsonrpc":"2.0","id":3,"result":null}

func (*AccountApi) DumpPrivkey

func (accountapi *AccountApi) DumpPrivkey(address *crypto.CommonAddress) (*secp256k1.PrivateKey, error)
 name: dumpPrivkey
 usage: The private key corresponding to the export address
 params:
	1.address
 return: private key
 example:   curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"account_dumpPrivkey","params":["0x3ebcbe7cb440dd8c52940a2963472380afbb56c5"], "id": 3}' -H "Content-Type:application/json"
 response:
	 {"jsonrpc":"2.0","id":3,"result":"0x270f4b122603999d1c07aec97e972a2ddf7bd8b5bfe3543c10814e6a19f13aaf"}

func (*AccountApi) DumpPubkey

func (accountapi *AccountApi) DumpPubkey(address *crypto.CommonAddress) (*secp256k1.PublicKey, error)
 name: DumpPubkey
 usage: Export the public key corresponding to the address
 params:
	1.address
 return: public key
 example:   curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"account_dumpPubkey","params":["0x3ebcbe7cb440dd8c52940a2963472380afbb56c5"], "id": 3}' -H "Content-Type:application/json"
 response:
	 {"jsonrpc":"2.0","id":3,"result":"0x270f4b122603999d1c07aec97e972a2ddf7bd8b5bfe3543c10814e6a19f13aaf"}

func (*AccountApi) EstimateGas

func (accountapi *AccountApi) EstimateGas(from crypto.CommonAddress, amount *common.Big, data common.Bytes, to *crypto.CommonAddress) (uint64, error)
 name: estimateGas
 usage: Estimate how much gas is needed for the transaction
 params:
	1. The address at which the transfer was initiated
	2. amount
	3. commit
	4. Address of recipient
 return: Evaluate the result, failure returns an error
 example:
	curl -H "Content-Type: application/json" -X post --data '{"jsonrpc":"2.0","method":"account_estimateGas","params":["0xec61c03f719a5c214f60719c3f36bb362a202125","0xecfb51e10aa4c146bf6c12eee090339c99841efc","0x6d4ce63c","0x110","0x30000"],"id":1}' http://127.0.0.1:10085
 response:
	 {"jsonrpc":"2.0","id":1,"result":"0x5d74aba54ace5f01a5f0057f37bfddbbe646ea6de7265b368e2e7d17d9cdeb9c"}

func (*AccountApi) ExecuteContract

func (accountapi *AccountApi) ExecuteContract(from crypto.CommonAddress, to crypto.CommonAddress, input common.Bytes, gasprice, gaslimit *common.Big) (string, error)
 name: executeContract
 usage: Execute smart contract (cause data to be modified)
 params:
	1. The address of the caller
	2. Contract address
	3. Contract code
	3. gas price
	4. gas limit
 return: transaction hash
 example:
	curl -H "Content-Type: application/json" -X post --data '{"jsonrpc":"2.0","method":"account_executeContract","params":["0xec61c03f719a5c214f60719c3f36bb362a202125","0xecfb51e10aa4c146bf6c12eee090339c99841efc","0x6d4ce63c","0x110","0x30000"],"id":1}' http://127.0.0.1:10085
 response:
	 {"jsonrpc":"2.0","id":1,"result":"0x5d74aba54ace5f01a5f0057f37bfddbbe646ea6de7265b368e2e7d17d9cdeb9c"}

func (*AccountApi) GenerateAddresses

func (accountapi *AccountApi) GenerateAddresses(address crypto.CommonAddress) (*RpcAddresses, error)
 name: generateAddresses
 usage: Generate the addresses of the other chains
 params:
	1. address of drep
 return: {BTCaddress, ethAddress, neoAddress}
 example:
	curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"account_generateAddresses","params":["0x3ebcbe7cb440dd8c52940a2963472380afbb56c5"], "id": 3}' -H "Content-Type:application/json"

response:

{"jsonrpc":"2.0","id":3,"result":""}

func (*AccountApi) GetKeyStores

func (accountapi *AccountApi) GetKeyStores() string
 name: getKeyStores
 usage: get ketStores path
 params:

 return: path of keystore
 example:
	curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"account_getKeyStores","params":[], "id": 3}' -H "Content-Type:application/json"

response:

{"jsonrpc":"2.0","id":3,"result":"'path of keystores is: C:\\Users\\Kun\\AppData\\Local\\Drep\\keystore'"}

func (*AccountApi) ImportKeyStore

func (accountapi *AccountApi) ImportKeyStore(path, password string) ([]*crypto.CommonAddress, error)
 name: importKeyStore
 usage: import keystore
 params:
	1.path
	2.password
 return: address list
 example:
	 curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"account_importKeyStore","params":["path","123"], "id": 3}' -H "Content-Type:application/json"

response:

{"jsonrpc":"2.0","id":3,"result":["0x4082c96e38def8f3851831940485066234fe07b8"]}

func (*AccountApi) ImportPrivkey

func (accountapi *AccountApi) ImportPrivkey(privBytes common.Bytes, password string) (*crypto.CommonAddress, error)
 name: importPrivkey
 usage: import private key
 params:
	1.privkey(compress hex)
	2.password
 return: address
 example:
	curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"account_importPrivkey","params":["0xe5510b32854ca52e7d7d41bb3196fd426d551951e2fd5f6b559a62889d87926c"], "id": 3}' -H "Content-Type:application/json"

response:

{"jsonrpc":"2.0","id":3,"result":"0x748eb65493a964e568800c3c2885c63a0de9f9ae"}

func (*AccountApi) ListAddress

func (accountapi *AccountApi) ListAddress() ([]string, error)

name: listAddress usage: Lists all local addresses return: Address of the array example: curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"account_listAddress","params":[], "id": 3}' -H "Content-Type:application/json" response:

{"jsonrpc":"2.0","id":3,"result":["0x3296d3336895b5baaa0eca3df911741bd0681c3f","0x3ebcbe7cb440dd8c52940a2963472380afbb56c5"]}

func (*AccountApi) LockAccount

func (accountapi *AccountApi) LockAccount(addr crypto.CommonAddress) error
 name: lockAccount
 usage: Lock the account
 params:
 return:  Failure returns the reason for the error, and success returns no information
 example:   curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"account_lockAccount","params":["0x518b3fefa3fb9a72753c6ad10a2b68cc034ec391"], "id": 3}' -H "Content-Type:application/json"
 response:
	 {"jsonrpc":"2.0","id":3,"result":null}

func (*AccountApi) OpenWallet

func (accountapi *AccountApi) OpenWallet(password string) error
 name: openWallet
 usage: Open my wallet
 params:
	1. The wallet password
 return: error or none
 example:   curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"account_openWallet","params":["123"], "id": 3}' -H "Content-Type:application/json"
 response:
	 {"jsonrpc":"2.0","id":3,"result":null}

func (*AccountApi) ReadContract

func (accountapi *AccountApi) ReadContract(from, to crypto.CommonAddress, input common.Bytes) (common.Bytes, error)
 name: readContract
 usage: Read smart contract (no data modified)
 params:
    1. The account address of the transaction
	2. Contract address
	3. Contract api
 return: The query results
 example:
	curl -H "Content-Type: application/json" -X post --data '{"jsonrpc":"2.0","method":"account_readContract","params":["0xec61c03f719a5c214f60719c3f36bb362a202125","0xecfb51e10aa4c146bf6c12eee090339c99841efc","0x6d4ce63c"],"id":1}' http://127.0.0.1:10085
 response:
	 {"jsonrpc":"2.0","id":1,"result":""}

func (*AccountApi) SetAlias

func (accountapi *AccountApi) SetAlias(srcAddr crypto.CommonAddress, alias string, gasprice, gaslimit *common.Big) (string, error)
 name: setAlias
 usage: Set an alias
 params:
	1. address
	2. alias
	3. gas price
	4. gas lowLimit
 return: transaction hash
 example:
	curl -H "Content-Type: application/json" -X post --data '{"jsonrpc":"2.0","method":"account_setAlias","params":["0x3ebcbe7cb440dd8c52940a2963472380afbb56c5","AAAAA","0x110","0x30000"],"id":1}' http://127.0.0.1:10085

response:

{"jsonrpc":"2.0","id":1,"result":"0x5adb248f2943e12fb91c140bd3d0df6237712061e9abae97345b0869c3daa749"}

func (*AccountApi) Sign

func (accountapi *AccountApi) Sign(address crypto.CommonAddress, hash common.Bytes) (common.Bytes, error)
 name: sign
 usage: Signature transaction
 params:
	1.account of sig
	2.msg for sig
 return: private key
 example:
	curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"account_sign","params":["0x3ebcbe7cb440dd8c52940a2963472380afbb56c5", "0x00001c9b8c8fdb1f53faf02321f76253704123e2b56cce065852bab93e526ae2"], "id": 3}' -H "Content-Type:application/json"

response:

{"jsonrpc":"2.0","id":3,"result":"0x1f1d16412468dd9b67b568d31839ac608bdfddf2580666db4d364eefbe285fdaed569a3c8fa1decfebbfa0ed18b636059dbbf4c2106c45fc8846909833ef2cb1de"}

func (*AccountApi) Transfer

func (accountapi *AccountApi) Transfer(from crypto.CommonAddress, to crypto.CommonAddress, amount, gasprice, gaslimit *common.Big, data common.Bytes) (string, error)
 name: transfer
 usage: transfer
 params:
	1. The address at which the transfer was initiated
	2. Recipient's address
	3. Mount
	4. gas price
	5. gas limit
	6. commit
 return: transaction hash
 example:   curl -H "Content-Type: application/json" -X post --data '{"jsonrpc":"2.0","method":"account_transfer","params":["0x3ebcbe7cb440dd8c52940a2963472380afbb56c5","0x3ebcbe7cb440dd8c52940a2963472380afbb56c5","0x111","0x110","0x30000",""],"id":1}' http://127.0.0.1:10085
 response:
	 {"jsonrpc":"2.0","id":1,"result":"0x3a3b59f90a21c2fd1b690aa3a2bc06dc2d40eb5bdc26fdd7ecb7e1105af2638e"}

func (*AccountApi) TransferWithNonce

func (accountapi *AccountApi) TransferWithNonce(from crypto.CommonAddress, to crypto.CommonAddress, amount, gasprice, gaslimit *common.Big, data common.Bytes, nonce uint64) (string, error)
 name: transferWithNonce
 usage: transfer with nonce
 params:
	1. The address at which the transfer was initiated
	2. Recipient's address
	3. Mount
	4. gas price
	5. gas limit
	6. commit
    7. nonce
 return: transaction hash
 example:   curl -H "Content-Type: application/json" -X post --data '{"jsonrpc":"2.0","method":"account_transferWithNonce","params":["0x3ebcbe7cb440dd8c52940a2963472380afbb56c5","0x3ebcbe7cb440dd8c52940a2963472380afbb56c5","0x111","0x110","0x30000","",1],"id":1}' http://127.0.0.1:10085
 response:
	 {"jsonrpc":"2.0","id":1,"result":"0x3a3b59f90a21c2fd1b690aa3a2bc06dc2d40eb5bdc26fdd7ecb7e1105af2638e"}

func (*AccountApi) UnlockAccount

func (accountapi *AccountApi) UnlockAccount(addr crypto.CommonAddress, password string) error
 name: account_unlockAccount
 usage: Unlock the account
 params:
	1. The account address
	2. password
 return: Failure returns the reason for the error, and success returns no information
 example:   curl http://localhost:10085 -X POST --data '{"jsonrpc":"2.0","method":"account_unlockAccount","params":["0x518b3fefa3fb9a72753c6ad10a2b68cc034ec391", "123456"], "id": 3}' -H "Content-Type:application/json"
 response:
	 {"jsonrpc":"2.0","id":3,"result":null}

func (*AccountApi) VoteCredit

func (accountapi *AccountApi) VoteCredit(from crypto.CommonAddress, to crypto.CommonAddress, amount, gasprice, gaslimit *common.Big) (string, error)
 name: VoteCredit
 usage: vote credit to candidate
 params:
	1. address of voter
	2. address of candidate
	3. amount
	4. gas price
	5. gas uplimit of transaction
 return: transaction hash
 example:   curl -H "Content-Type: application/json" -X post --data '{"jsonrpc":"2.0","method":"account_voteCredit","params":["0x3ebcbe7cb440dd8c52940a2963472380afbb56c5","0x3ebcbe7cb440dd8c52940a2963472380afbb56c5","0x111","0x110","0x30000"],"id":1}' http://127.0.0.1:10085
 response:
	 {"jsonrpc":"2.0","id":1,"result":"0x3a3b59f90a21c2fd1b690aa3a2bc06dc2d40eb5bdc26fdd7ecb7e1105af2638e"}

type AccountService

type AccountService struct {
	EvmService         *evm.EvmService             `service:"vm"`
	DatabaseService    *database.DatabaseService   `service:"database"`
	Chain              chain.ChainServiceInterface `service:"chain"`
	PoolQuery          blockmgr.IBlockMgrPool      `service:"blockmgr"`
	MessageBroadCastor blockmgr.ISendMessage       `service:"blockmgr"`
	Config             *accountTypes.Config
	Wallet             *Wallet
	// contains filtered or unexported fields
}

AccountService

func (*AccountService) Api

func (accountService *AccountService) Api() []app.API

Api api none

func (*AccountService) CommandFlags

func (accountService *AccountService) CommandFlags() ([]cli.Command, []cli.Flag)

Flags flags enable load js and execute before run

func (*AccountService) CreateWallet

func (accountService *AccountService) CreateWallet(password string) error

func (*AccountService) DefaultConfig

func (accountService *AccountService) DefaultConfig(netType params.NetType) *accountTypes.Config

func (*AccountService) Init

func (accountService *AccountService) Init(executeContext *app.ExecuteContext) error

Init set console Config

func (*AccountService) Name

func (accountService *AccountService) Name() string

Name service name

func (*AccountService) P2pMessages

func (accountService *AccountService) P2pMessages() map[int]interface{}

func (*AccountService) Receive

func (accountService *AccountService) Receive(context actor.Context)

func (*AccountService) Start

func (accountService *AccountService) Start(executeContext *app.ExecuteContext) error

func (*AccountService) Stop

func (accountService *AccountService) Stop(executeContext *app.ExecuteContext) error

type RpcAccount

type RpcAccount struct {
	Addr   *crypto.CommonAddress
	Pubkey string
}

type RpcAddresses

type RpcAddresses struct {
	BtcAddress      string
	EthAddress      string
	NeoAddress      string
	RippleAddress   string
	DashAddress     string
	DogeCoinAddress string
	LiteCoinAddress string
	CosmosAddress   string
	TronAddress     string
}

type Wallet

type Wallet struct {
	// contains filtered or unexported fields
}

Wallet is used to manage private keys, build simple transactions and other functions.

func NewWallet

func NewWallet(config *accountTypes.Config, chainId types.ChainIdType) (*Wallet, error)

NewWallet based in config

func (*Wallet) Close

func (wallet *Wallet) Close()

Close wallet to disable wallet

func (*Wallet) DumpPrivateKey

func (wallet *Wallet) DumpPrivateKey(addr *crypto.CommonAddress) (*secp256k1.PrivateKey, error)

DumpPrivateKey query private key by address

func (*Wallet) GetAccountByAddress

func (wallet *Wallet) GetAccountByAddress(addr *crypto.CommonAddress) (*types.Node, error)

GetAccountByAddress query account according to address

func (*Wallet) GetAccountByPubkey

func (wallet *Wallet) GetAccountByPubkey(pubkey *secp256k1.PublicKey) (*types.Node, error)

GetAccountByAddress query account according to public key

func (*Wallet) ImportKeyStore

func (wallet *Wallet) ImportKeyStore(path, password string) ([]*crypto.CommonAddress, error)

func (*Wallet) ImportPrivKey

func (wallet *Wallet) ImportPrivKey(key *secp256k1.PrivateKey, password string) (*types.Node, error)

func (*Wallet) IsLock

func (wallet *Wallet) IsLock() bool

IsLock query current lock state 0 is locked 1 is unlock

func (*Wallet) IsOpen

func (wallet *Wallet) IsOpen() bool

IsOpen query current wallet open state

func (*Wallet) ListAddress

func (wallet *Wallet) ListAddress() ([]string, error)

ListAddress get all address in wallet

func (*Wallet) Lock

func (wallet *Wallet) Lock(addr *crypto.CommonAddress) error

Lock wallet to disable private key

func (*Wallet) NewAccount

func (wallet *Wallet) NewAccount(password string) (*types.Node, error)

NewAccount create new address

func (*Wallet) OpenWallet

func (wallet *Wallet) OpenWallet(password string) error

OpenWallet wallet to use wallet

func (*Wallet) Sign

func (wallet *Wallet) Sign(addr *crypto.CommonAddress, msg []byte) ([]byte, error)

Sign sign a message using key in wallet

func (*Wallet) UnLock

func (wallet *Wallet) UnLock(addr *crypto.CommonAddress, password string) error

UnLock wallet to enable private key

func (*Wallet) UnlockAccount

func (wallet *Wallet) UnlockAccount(addr *crypto.CommonAddress, password string) error

Jump to

Keyboard shortcuts

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