Skip to main content

Class: WalletConnectSigner

Signer that use the WalletConnect protocol to sign a transaction.

Hierarchy

  • Signer

    WalletConnectSigner

Constructors

constructor

new WalletConnectSigner(client, options): WalletConnectSigner

Parameters

NameType
clientSignClient
optionsWalletConnectSignerOptions

Returns

WalletConnectSigner

Overrides

Signer.constructor

Defined in

packages/walletconnect-v2/src/signer.ts:73

Properties

accountData

Private accountData: undefined | AccountData

Defined in

packages/walletconnect-v2/src/signer.ts:56


chain

Private chain: string

Defined in

packages/walletconnect-v2/src/signer.ts:54


client

Private Readonly client: SignClient

Defined in

packages/walletconnect-v2/src/signer.ts:52


qrCodeModalController

Private Readonly qrCodeModalController: QrCodeModalController

Defined in

packages/walletconnect-v2/src/signer.ts:60


sessionsCache

Private Readonly sessionsCache: WalletConnectSessionCache

Defined in

packages/walletconnect-v2/src/signer.ts:62


signingMode

signingMode: SigningMode = SigningMode.AMINO

Overrides

Signer.signingMode

Defined in

packages/walletconnect-v2/src/signer.ts:50


walletConnectSession

Private walletConnectSession: undefined | Struct

Defined in

packages/walletconnect-v2/src/signer.ts:58

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


session

get session(): Struct

Gets the WalletConnect session that is being used by the signer to interact with the wallet.

NOTE: The signer must be connected to get the current WalletConnect session.

Returns

Struct

Defined in

packages/walletconnect-v2/src/signer.ts:392


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

NameTypeDescription
observerSignerObserverThe 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


clearSessionDependentResources

clearSessionDependentResources(sessionTopic): void

Release all the resources related to the current session.

Parameters

NameTypeDescription
sessionTopicstringTopic of the WalletConnect session.

Returns

void

Defined in

packages/walletconnect-v2/src/signer.ts:113


connect

connect(): Promise<void>

Implements Signer.

Returns

Promise<void>

Overrides

Signer.connect

Defined in

packages/walletconnect-v2/src/signer.ts:202


connectToSession

connectToSession(session): Promise<void>

Connect the signer to a previously established session. This can be called only if the signer is not connected.

Parameters

NameTypeDescription
sessionStructThe previously established session.

Returns

Promise<void>

Defined in

packages/walletconnect-v2/src/signer.ts:124


disconnect

disconnect(): Promise<void>

Implements Signer.

Returns

Promise<void>

Overrides

Signer.disconnect

Defined in

packages/walletconnect-v2/src/signer.ts:288


getAccounts

getAccounts(): Promise<readonly AccountData[]>

Implements Signer.

NOTE: This method might never return anything if the wallet is currently closed, due to the fact that all WalletConnect requests are asynchronous and complete only when the associated wallet is opened. If you want to get the currently used account, use getCurrentAccount instead.

Returns

Promise<readonly AccountData[]>

Overrides

Signer.getAccounts

Defined in

packages/walletconnect-v2/src/signer.ts:329


getCurrentAccount

getCurrentAccount(): Promise<undefined | AccountData>

Implements Signer.

NOTE: The returned AccountData will contain an empty public key and a default algorithm set to "secp256k1". This is because WalletConnect does not return the public key nor the algorithm used after the connection.

Returns

Promise<undefined | AccountData>

Overrides

Signer.getCurrentAccount

Defined in

packages/walletconnect-v2/src/signer.ts:318


removeStatusListener

removeStatusListener(observer): void

Removes an observer so that it will not be called when the status changes.

Parameters

NameTypeDescription
observerSignerObserverThe observer to be removed.

Returns

void

Inherited from

Signer.removeStatusListener

Defined in

packages/core/build/signers/signer.d.ts:57


sessionDeleteListener

sessionDeleteListener(event): void

Parameters

NameType
eventOmit<BaseEventArgs<unknown>, "params">

Returns

void

Defined in

packages/walletconnect-v2/src/signer.ts:64


signAmino

signAmino(signerAddress, signDoc): Promise<AminoSignResponse>

Implements OfflineDirectSigner.

Parameters

NameType
signerAddressstring
signDocStdSignDoc

Returns

Promise<AminoSignResponse>

Overrides

Signer.signAmino

Defined in

packages/walletconnect-v2/src/signer.ts:364


signDirect

signDirect(signerAddress, signDoc): Promise<DirectSignResponse>

Implements OfflineDirectSigner.

Parameters

NameType
signerAddressstring
signDocSignDoc

Returns

Promise<DirectSignResponse>

Overrides

Signer.signDirect

Defined in

packages/walletconnect-v2/src/signer.ts:340


subscribeToEvents

subscribeToEvents(): void

Subscribes to all the WalletConnect events.

Returns

void

Defined in

packages/walletconnect-v2/src/signer.ts:95


unsubscribeEvents

unsubscribeEvents(): void

Unsubscribe all the WalletConnect events.

Returns

void

Defined in

packages/walletconnect-v2/src/signer.ts:104


updateStatus

updateStatus(newStatus): void

Updates the signer status and notifies the observers.

Parameters

NameTypeDescription
newStatusSignerStatusThe new signer status.

Returns

void

Inherited from

Signer.updateStatus

Defined in

packages/core/build/signers/signer.d.ts:42