Skip to main content

setSignProgressListener

v2 new

Registers a callback that fires once per device signature while a Cardano transaction is signed through the CBOR signer (txCbor and the structured operations that use the same signer) — up to three for CIP-95 governance / voting. A one-signature transaction still sends a single { step: 1, total: 1 }. Use it to show "1 of 2" progress instead of a frozen spinner.

Signature​

dcent.setSignProgressListener(listener: (info: SignProgressInfo) => void): void

Parameters​

FieldTypeDescription
listener(info: SignProgressInfo) ⇒ voidCalled once per progress signal. It is never called for the final result — await dcent.sign(...) resolves exactly as before.

SignProgressInfo​

FieldTypeDescription
requestIdstringId of the in-flight request the progress belongs to.
stepnumber1-based index of the signature currently being produced.
totalnumberTotal number of signatures this request requires.
rolestring | undefinedOpaque hint about the key being used (e.g. 'payment', 'stake'). The connector never interprets it — treat unknown values as display-only.

Example​

dcent.setSignProgressListener((info) => {
showProgress('Signing ' + info.step + ' / ' + info.total)
})

const res = await dcent.sign({
method: 'signTransaction',
chainId: 'cip34:1-764824073',
// CIP-95 governance / voting CBOR — the multi-signature (up to three) case this listener is for
payload: { keyPath: "m/1852'/1815'/0'/0/0", transaction: { txCbor: '…' } }
})

Notes​

  • The listener is cached and re-registered automatically after the transport is reset (popupWindowClose + reconnect) — same lifecycle as setConnectionListener.

  • Registering several listeners subscribes them all; every listener receives every signal. Registering the exact same function reference twice is a no-op — it stays subscribed once.

  • Progress signals are a separate channel from the request/response flow. They never resolve or reject your pending call.

  • Bridge popups that do not emit progress simply never call the listener — signing keeps working unchanged.

  • setConnectionListener

  • Cardano

  • popupWindowClose