- Preparing search index...
- The search index is not available
sotez
Constructors
constructor
- new Key(__namedParameters?: { email?: string; key?: string; ledgerCurve?: string; ledgerPath?: string; ledgerTransport?: any; passphrase?: string }): Key
-
Parameters
-
__namedParameters: { email?: string; key?: string; ledgerCurve?: string; ledgerPath?: string; ledgerTransport?: any; passphrase?: string } = {}
-
Optional
email?: string
-
Optional
key?: string
-
Optional
ledgerCurve?: string
-
Optional
ledgerPath?: string
-
Optional
ledgerTransport?: any
-
Optional
passphrase?: string
Returns Key
Properties
_isLedger
_isLedger: boolean
_isSecret
_isSecret: boolean
_ledgerCurve
_ledgerCurve: string
_ledgerPath
_ledgerPath: string
_ledgerTransport
_ledgerTransport: any
_publicKey
_publicKey: Uint8Array
Optional
_secretKey
_secretKey?: Uint8Array
ready
ready: Promise<boolean>
Accessors
curve
- get curve(): string
-
Returns string
isLedger
- get isLedger(): boolean
-
Returns boolean
- set isLedger(value: boolean): void
-
Returns void
ledgerCurve
- get ledgerCurve(): string
-
Returns string
- set ledgerCurve(value: string): void
-
Returns void
ledgerPath
- get ledgerPath(): string
-
Returns string
- set ledgerPath(value: string): void
-
Returns void
Methods
initialize
- initialize(__namedParameters: { email?: string; key?: string; passphrase?: string }, setInit: ((value: boolean) => void)): Promise<void>
-
Parameters
-
__namedParameters: { email?: string; key?: string; passphrase?: string }
-
Optional
email?: string
-
Optional
key?: string
-
Optional
passphrase?: string
-
setInit: ((value: boolean) => void)
-
- (value: boolean): void
-
Returns void
Returns Promise<void>
publicKey
- publicKey(): Promise<string>
-
Returns Promise<string>
publicKeyHash
- publicKeyHash(): Promise<string>
-
Returns Promise<string>
secretKey
- secretKey(passphrase?: string): Promise<string>
-
Parameters
-
Optional
passphrase: string
Returns Promise<string>
sign
- sign(bytes: string, magicBytes?: Uint8Array): Promise<{ bytes: string; magicBytes: string; prefixSig: string; sbytes: string; sig: string }>
-
Parameters
-
bytes: string
-
Optional
magicBytes: Uint8Array
Returns Promise<{ bytes: string; magicBytes: string; prefixSig: string; sbytes: string; sig: string }>
verify
- verify(bytes: string, signature: string, publicKey: string): Promise<boolean>
-
Parameters
-
bytes: string
-
signature: string
-
publicKey: string
Returns Promise<boolean>
Creates a key object from a base58 encoded key.
Param
Param
A public or secret key in base58 encoding, or a 15 word bip39 english mnemonic string. Not providing a key will import a ledger public key.
Param
The passphrase used if the key provided is an encrypted private key or a fundraiser key
Param
Email used if a fundraiser key is passed
Param
Ledger derivation path
Param
Ledger curve
Param
Ledger transport
Example