Skip to main content

Class: EthereumKeyPairIdentity

An Identity that derives an Ethereum address from a secp256k1 private key and uses that as the UserID instead of the actual public key.

Extends

  • KeyPairIdentity

Constructors

new EthereumKeyPairIdentity()

new EthereumKeyPairIdentity(privateKey, address?): EthereumKeyPairIdentity

Parameters

privateKey

string

address?

string

Returns

EthereumKeyPairIdentity

Overrides

KeyPairIdentity.constructor

Properties

privateKey

readonly privateKey: Uint8Array

Inherited from

KeyPairIdentity.privateKey


publicKey

readonly publicKey: UserIDRaw

Inherited from

KeyPairIdentity.publicKey


publicKeyString

readonly publicKeyString: UserID

Inherited from

KeyPairIdentity.publicKeyString

Methods

assertKeyPairIsValid()

assertKeyPairIsValid(): void

Should throw if the publicKey and privateKey don't match each other

Returns

void

Overrides

KeyPairIdentity.assertKeyPairIsValid


createMessageSignature()

createMessageSignature(payload): Promise<Uint8Array<ArrayBufferLike>>

Parameters

payload

Uint8Array

Returns

Promise<Uint8Array<ArrayBufferLike>>

Overrides

KeyPairIdentity.createMessageSignature


getExpectedPrivateKeyLength()

getExpectedPrivateKeyLength(): number

Returns

number

Overrides

KeyPairIdentity.getExpectedPrivateKeyLength


getExpectedPublicKeyLength()

getExpectedPublicKeyLength(): number

Returns

number

Overrides

KeyPairIdentity.getExpectedPublicKeyLength


getPrivateKey()

getPrivateKey(): Promise<Uint8Array<ArrayBufferLike>>

Returns

Promise<Uint8Array<ArrayBufferLike>>

Inherited from

KeyPairIdentity.getPrivateKey


getSignatureType()

getSignatureType(): SignatureType

Returns

SignatureType

Overrides

KeyPairIdentity.getSignatureType


getTransactionSigner()

getTransactionSigner(rpcProviderSource): Promise<SignerWithProvider>

Parameters

rpcProviderSource

RpcProviderSource

Returns

Promise<SignerWithProvider>

Overrides

KeyPairIdentity.getTransactionSigner


getUserId()

getUserId(): Promise<UserID>

Returns

Promise<UserID>

Inherited from

KeyPairIdentity.getUserId


getUserIdRaw()

getUserIdRaw(): Promise<UserIDRaw>

Returns

Promise<UserIDRaw>

Inherited from

KeyPairIdentity.getUserIdRaw


fromConfig()

static fromConfig(config): EthereumKeyPairIdentity

Parameters

config

Pick<StrictStreamrClientConfig, "auth">

Returns

EthereumKeyPairIdentity


generate()

static generate(): EthereumKeyPairIdentity

Returns

EthereumKeyPairIdentity


getKeyPairFromConfig()

static getKeyPairFromConfig(config): KeyPairIdentityConfig

Parameters

config

Pick<StrictStreamrClientConfig, "auth">

Returns

KeyPairIdentityConfig

Inherited from

KeyPairIdentity.getKeyPairFromConfig