personal

package
v0.0.0-...-ea3adbb Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Personal

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

Personal - The Personal Module

func NewPersonal

func NewPersonal(provider providers.ProviderInterface) *Personal

NewPersonal - Personal Module constructor to set the default provider

func (*Personal) ListAccounts

func (personal *Personal) ListAccounts() ([]string, error)

ListAccounts - Lists all stored accounts. Reference: https://github.com/paritytech/parity/wiki/JSONRPC-personal-module#personal_listaccounts Parameters:

  • none

Returns:

  • Array - A list of 20 byte account identifiers.

func (*Personal) NewAccount

func (personal *Personal) NewAccount(password string) (string, error)

NewAccount - Creates new account. Note: it becomes the new current unlocked account. There can only be one unlocked account at a time. Reference: https://github.com/paritytech/parity/wiki/JSONRPC-personal-module#personal_newaccount Parameters:

  • String - Password for the new account.

Returns:

  • Address - 20 Bytes - The identifier of the new account.

func (*Personal) SendTransaction

func (personal *Personal) SendTransaction(transaction *dto.TransactionParameters, password string) (string, error)

SendTransaction - Sends transaction and signs it in a single call. The account does not need to be unlocked to make this call, and will not be left unlocked after. Reference: https://github.com/paritytech/parity/wiki/JSONRPC-personal-module#personal_sendtransaction Parameters:

  1. Object - The transaction object - from: Address - 20 Bytes - The address the transaction is send from. - to: Address - (optional) 20 Bytes - The address the transaction is directed to. - gas: Quantity - (optional) Integer of the gas provided for the transaction execution. eth_call consumes zero gas, but this parameter may be needed by some executions. - gasPrice: Quantity - (optional) Integer of the gas price used for each paid gas. - value: Quantity - (optional) Integer of the value sent with this transaction. - data: Data - (optional) 4 byte hash of the method signature followed by encoded parameters. For details see Ethereum Contract ABI. - nonce: Quantity - (optional) Integer of a nonce. This allows to overwrite your own pending transactions that use the same nonce. - condition: Object - (optional) Conditional submission of the transaction. Can be either an integer block number { block: 1 } or UTC timestamp (in seconds) { time: 1491290692 } or null.
  2. String - Passphrase to unlock the from account.

Returns:

  • Data - 32 Bytes - the transaction hash, or the zero hash if the transaction is not yet available

func (*Personal) UnlockAccount

func (personal *Personal) UnlockAccount(address string, password string, duration uint64) (bool, error)

UnlockAccount - Unlocks specified account for use. Reference: https://github.com/paritytech/parity/wiki/JSONRPC-personal-module#personal_unlockaccount If permanent unlocking is disabled (the default) then the duration argument will be ignored, and the account will be unlocked for a single signing. With permanent locking enabled, the duration sets the number of seconds to hold the account open for. It will default to 300 seconds. Passing 0 unlocks the account indefinitely. There can only be one unlocked account at a time. Parameters:

  • Address - 20 Bytes - The address of the account to unlock.
  • String - Passphrase to unlock the account.
  • Quantity - (default: 300) Integer or null - Duration in seconds how long the account should remain unlocked for.

Returns:

  • Boolean - whether the call was successful

Jump to

Keyboard shortcuts

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