Class: InMemorySigner
signer.InMemorySigner
Signs using in memory key store.
Hierarchy
↳
InMemorySigner
Constructors
constructor
new InMemorySigner(keyStore)
Parameters
| Name | Type |
|---|---|
keyStore | KeyStore |
Overrides
Defined in
Properties
keyStore
Readonly keyStore: KeyStore
Defined in
Methods
createKey
createKey(accountId, networkId): Promise<PublicKey>
Creates a public key for the account given
Parameters
| Name | Type | Description |
|---|---|---|
accountId | string | The NEAR account to assign a public key to |
networkId | string | The targeted network. (ex. default, betanet, etc…) |
Returns
Promise<PublicKey>
Overrides
Defined in
getPublicKey
getPublicKey(accountId?, networkId?): Promise<PublicKey>
Gets the existing public key for a given account
Parameters
| Name | Type | Description |
|---|---|---|
accountId? | string | The NEAR account to assign a public key to |
networkId? | string | The targeted network. (ex. default, betanet, etc…) |
Returns
Promise<PublicKey>
Returns the public key or null if not found
Overrides
Defined in
signMessage
signMessage(message, accountId?, networkId?): Promise<Signature>
Parameters
| Name | Type | Description |
|---|---|---|
message | Uint8Array | A message to be signed, typically a serialized transaction |
accountId? | string | the NEAR account signing the message |
networkId? | string | The targeted network. (ex. default, betanet, etc…) |
Returns
Promise<Signature>
Overrides
Defined in
toString
toString(): string
Returns
string
Defined in
fromKeyPair
Static fromKeyPair(networkId, accountId, keyPair): Promise<Signer>
Creates a single account Signer instance with account, network and keyPair provided.
Intended to be useful for temporary keys (e.g. claiming a Linkdrop).
Parameters
| Name | Type | Description |
|---|---|---|
networkId | string | The targeted network. (ex. default, betanet, etc…) |
accountId | string | The NEAR account to assign the key pair to |
keyPair | KeyPair | The keyPair to use for signing |
Returns
Promise<Signer>