Skip to content

Commit 34d3759

Browse files
committed
docs: added docstring to requests
1 parent 7d9f050 commit 34d3759

File tree

1 file changed

+31
-4
lines changed

1 file changed

+31
-4
lines changed

src/sagas/walletConnect.js

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ import {
9393
setNewNanoContractStatusSuccess,
9494
} from '../actions';
9595
import { checkForFeatureFlag, getNetworkSettings, showPinScreenForResult } from './helpers';
96+
import { logger } from '../logger';
97+
98+
const log = logger('walletConnect');
9699

97100
const AVAILABLE_METHODS = {
98101
HATHOR_SIGN_MESSAGE: 'htr_signWithAddress',
@@ -429,17 +432,25 @@ const promptHandler = (dispatch) => (request, requestMetadata) =>
429432
* This saga will be called (dispatched from the event listener) when a sign
430433
* message RPC is published from a dApp
431434
*
432-
* @param {String} data.requestId Unique identifier of the request
433-
* @param {String} data.topic Unique identifier of the connected session
434-
* @param {String} data.message Message the dApp requested a signature for
435+
* @param {String} payload.data.requestId Unique identifier of the request
436+
* @param {String} payload.data.topic Unique identifier of the connected session
437+
* @param {String} payload.data.message Message the dApp requested a signature for
438+
* @param {String} payload.dapp.icon The icon sent by the dApp
439+
* @param {String} payload.dapp.proposer The proposer name sent by the dapp
440+
* @param {String} payload.dapp.url The url sent by the dApp
441+
* @param {String} payload.dapp.description The description sent by the dApp
442+
* @param {String} payload.accept A callback function to indicate that the
443+
* request has been accepted.
444+
* @param {String} payload.deny A callback function to indicate that the request
445+
* has been denied.
435446
*/
436447
export function* onSignMessageRequest({ payload }) {
437448
const { accept, deny: denyCb, data, dapp } = payload;
438449

439450
const wallet = yield select((state) => state.wallet);
440451

441452
if (!wallet.isReady()) {
442-
console.error('Got a session request but wallet is not ready, ignoring..');
453+
log.error('Got a session request but wallet is not ready, ignoring..');
443454
return;
444455
}
445456

@@ -466,6 +477,22 @@ export function* onSignMessageRequest({ payload }) {
466477
accept();
467478
}
468479

480+
/**
481+
* This saga will be called (dispatched from the event listener) when a
482+
* sendNanoContractTx message RPC is published from a dApp
483+
*
484+
* @param {String} payload.data.requestId Unique identifier of the request
485+
* @param {String} payload.data.topic Unique identifier of the connected session
486+
* @param {String} payload.data.message Message the dApp requested a signature for
487+
* @param {String} payload.dapp.icon The icon sent by the dApp
488+
* @param {String} payload.dapp.proposer The proposer name sent by the dapp
489+
* @param {String} payload.dapp.url The url sent by the dApp
490+
* @param {String} payload.dapp.description The description sent by the dApp
491+
* @param {String} payload.accept A callback function to indicate that the
492+
* request has been accepted.
493+
* @param {String} payload.deny A callback function to indicate that the request
494+
* has been denied.
495+
*/
469496
export function* onSendNanoContractTxRequest({ payload }) {
470497
const { accept: acceptCb, deny: denyCb, nc, dapp } = payload;
471498

0 commit comments

Comments
 (0)