MCPcopy Index your code
hub / github.com/chain/Core / addKey

Method addKey

sdk/node/src/hsmSigner.js:30–41  ·  view source on GitHub ↗

* addKey - Add a new key/signer pair to the HSM signer. * * @param {Object|String} key - An object with an xpub key, or an xpub as a string. * @param {Connection} connection - Authenticated connection to a specific HSM instance. * @returns {void}

(key, connection)

Source from the content-addressed store, hash-verified

28 * @returns {void}
29 */
30 addKey(key, connection) {
31 const id = `${connection.baseUrl}-${connection.token || 'noauth'}`
32 let signer = this.signers[id]
33 if (!signer) {
34 signer = this.signers[id] = {
35 connection: connection,
36 xpubs: []
37 }
38 }
39
40 signer.xpubs.push(typeof key == 'string' ? key : key.xpub)
41 }
42
43 /**
44 * sign - Sign a single transaction.

Callers 15

mainMethod · 0.95
loadKeysMethod · 0.95
loadKeysMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
setupMethod · 0.95
setupMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
mainMethod · 0.95
setupMethod · 0.95

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected