Class: KeplrSigner
Signer that use Keplr to sign a transaction.
Hierarchy
Signer
↳
KeplrSigner
Constructors
constructor
• new KeplrSigner(keplrClient
, options
): KeplrSigner
Parameters
Name | Type |
---|---|
keplrClient | Keplr |
options | KeplrSignerOptions |
Returns
Overrides
Signer.constructor
Defined in
packages/keplr/src/signer.ts:43
Properties
accountData
• Private
accountData: undefined
| AccountData
Defined in
packages/keplr/src/signer.ts:33
chainInfo
• Private
chainInfo: ChainInfo
= DesmosMainnet
Defined in
packages/keplr/src/signer.ts:35
client
• Private
Readonly
client: Keplr
Defined in
packages/keplr/src/signer.ts:31
keplrChainInfo
• Private
keplrChainInfo: undefined
| ChainInfo
Defined in
packages/keplr/src/signer.ts:37
signingMode
• Readonly
signingMode: SigningMode
= SigningMode.DIRECT
Overrides
Signer.signingMode
Defined in
packages/keplr/src/signer.ts:29
Accessors
isConnected
• get
isConnected(): boolean
Tells whether the signer is connected or not.
Returns
boolean
Inherited from
Signer.isConnected
Defined in
packages/core/build/signers/signer.d.ts:65
status
• get
status(): SignerStatus
Gets the current signer status.
Returns
SignerStatus
Inherited from
Signer.status
Defined in
packages/core/build/signers/signer.d.ts:61
Methods
addStatusListener
▸ addStatusListener(observer
): void
Adds an observer that will be called each time the signer changes state.
Parameters
Name | Type | Description |
---|---|---|
observer | SignerObserver | The observer to be called. |
Returns
void
Inherited from
Signer.addStatusListener
Defined in
packages/core/build/signers/signer.d.ts:52
assertConnected
▸ assertConnected(): void
Checks if the signer is connected and if not throws a SignerNotConnected exception.
Returns
void
Inherited from
Signer.assertConnected
Defined in
packages/core/build/signers/signer.d.ts:47
connect
▸ connect(): Promise
<void
>
Implements Signer.
Returns
Promise
<void
>
Overrides
Signer.connect
Defined in
packages/keplr/src/signer.ts:93
disconnect
▸ disconnect(): Promise
<void
>
Implements Signer.
Returns
Promise
<void
>
Overrides
Signer.disconnect
Defined in
packages/keplr/src/signer.ts:122
getAccounts
▸ getAccounts(): Promise
<readonly AccountData
[]>
Implements Signer.
Returns
Promise
<readonly AccountData
[]>
Overrides
Signer.getAccounts
Defined in
packages/keplr/src/signer.ts:144
getChainInfo
▸ getChainInfo(): Promise
<ChainInfo
>
Returns the Keplr ChainInfo instance to be used.
Returns
Promise
<ChainInfo
>
Defined in
packages/keplr/src/signer.ts:83
getCurrentAccount
▸ getCurrentAccount(): Promise
<undefined
| AccountData
>
Implements Signer.
Returns
Promise
<undefined
| AccountData
>
Overrides
Signer.getCurrentAccount
Defined in
packages/keplr/src/signer.ts:136
getCurrentChainInfo
▸ getCurrentChainInfo(): undefined
| ChainInfo
Get the current Keplr ChainInfo. NOTE: This can be undefined if the client has not connected yet.
Returns
undefined
| ChainInfo
Defined in
packages/keplr/src/signer.ts:221
getCurrentChainNetwork
▸ getCurrentChainNetwork(): ChainInfo
Get the current Desmos ChainInfo.
Returns
ChainInfo
Defined in
packages/keplr/src/signer.ts:213
handleKeyStoreChange
▸ handleKeyStoreChange(): Promise
<void
>
Handle the Keplr keystore change event.
Returns
Promise
<void
>
Defined in
packages/keplr/src/signer.ts:71
onKeystoreChange
▸ onKeystoreChange(): void
Returns
void
Defined in
packages/keplr/src/signer.ts:39
removeStatusListener
▸ removeStatusListener(observer
): void
Removes an observer so that it will not be called when the status changes.
Parameters
Name | Type | Description |
---|---|---|
observer | SignerObserver | The observer to be removed. |
Returns
void
Inherited from
Signer.removeStatusListener
Defined in
packages/core/build/signers/signer.d.ts:57
signAmino
▸ signAmino(signerAddress
, signDoc
): Promise
<AminoSignResponse
>
Implements OfflineDirectSigner.
Parameters
Name | Type |
---|---|
signerAddress | string |
signDoc | StdSignDoc |
Returns
Promise
<AminoSignResponse
>
Overrides
Signer.signAmino
Defined in
packages/keplr/src/signer.ts:176
signDirect
▸ signDirect(signerAddress
, signDoc
): Promise
<DirectSignResponse
>
Implements OfflineDirectSigner.
Parameters
Name | Type |
---|---|
signerAddress | string |
signDoc | SignDoc |
Returns
Promise
<DirectSignResponse
>
Overrides
Signer.signDirect
Defined in
packages/keplr/src/signer.ts:163
subscribeToEvents
▸ subscribeToEvents(): void
Subscribes to Keplr events.
Returns
void
Defined in
packages/keplr/src/signer.ts:54
switchChainNetwork
▸ switchChainNetwork(chainInfo
): Promise
<void
>
Switch to the given ChainInfo.
Parameters
Name | Type | Description |
---|---|---|
chainInfo | ChainInfo | chain configuration |
Returns
Promise
<void
>
Defined in
packages/keplr/src/signer.ts:199
unsubscribeFromEvents
▸ unsubscribeFromEvents(): void
Unsubscribes from Keplr events.
Returns
void
Defined in
packages/keplr/src/signer.ts:63
updateStatus
▸ updateStatus(newStatus
): void
Updates the signer status and notifies the observers.
Parameters
Name | Type | Description |
---|---|---|
newStatus | SignerStatus | The new signer status. |
Returns
void
Inherited from
Signer.updateStatus
Defined in
packages/core/build/signers/signer.d.ts:42
setupChainNetwork
▸ setupChainNetwork(chainInfo
): Promise
<void
>
Prompt a new Keplr Chain configuration.
Parameters
Name | Type | Description |
---|---|---|
chainInfo | ChainInfo | new chain configuration |
Returns
Promise
<void
>