diff --git a/rc-v10.0.1/.nojekyll b/rc-v10.0.1/.nojekyll new file mode 100644 index 00000000..e2ac6616 --- /dev/null +++ b/rc-v10.0.1/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/rc-v10.0.1/assets/highlight.css b/rc-v10.0.1/assets/highlight.css new file mode 100644 index 00000000..40c1fc81 --- /dev/null +++ b/rc-v10.0.1/assets/highlight.css @@ -0,0 +1,85 @@ +:root { + --light-hl-0: #AF00DB; + --dark-hl-0: #C586C0; + --light-hl-1: #000000; + --dark-hl-1: #D4D4D4; + --light-hl-2: #001080; + --dark-hl-2: #9CDCFE; + --light-hl-3: #A31515; + --dark-hl-3: #CE9178; + --light-hl-4: #008000; + --dark-hl-4: #6A9955; + --light-hl-5: #0000FF; + --dark-hl-5: #569CD6; + --light-hl-6: #0070C1; + --dark-hl-6: #4FC1FF; + --light-hl-7: #098658; + --dark-hl-7: #B5CEA8; + --light-hl-8: #795E26; + --dark-hl-8: #DCDCAA; + --light-code-background: #FFFFFF; + --dark-code-background: #1E1E1E; +} + +@media (prefers-color-scheme: light) { :root { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); + --code-background: var(--light-code-background); +} } + +@media (prefers-color-scheme: dark) { :root { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); + --code-background: var(--dark-code-background); +} } + +:root[data-theme='light'] { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --hl-8: var(--light-hl-8); + --code-background: var(--light-code-background); +} + +:root[data-theme='dark'] { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --hl-8: var(--dark-hl-8); + --code-background: var(--dark-code-background); +} + +.hl-0 { color: var(--hl-0); } +.hl-1 { color: var(--hl-1); } +.hl-2 { color: var(--hl-2); } +.hl-3 { color: var(--hl-3); } +.hl-4 { color: var(--hl-4); } +.hl-5 { color: var(--hl-5); } +.hl-6 { color: var(--hl-6); } +.hl-7 { color: var(--hl-7); } +.hl-8 { color: var(--hl-8); } +pre, code { background: var(--code-background); } diff --git a/rc-v10.0.1/assets/icons.js b/rc-v10.0.1/assets/icons.js new file mode 100644 index 00000000..3dfbd322 --- /dev/null +++ b/rc-v10.0.1/assets/icons.js @@ -0,0 +1,18 @@ +(function() { + addIcons(); + function addIcons() { + if (document.readyState === "loading") return document.addEventListener("DOMContentLoaded", addIcons); + const svg = document.body.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg")); + svg.innerHTML = `MMNEPVFCICPMFPCPTTAAATR`; + svg.style.display = "none"; + if (location.protocol === "file:") updateUseElements(); + } + + function updateUseElements() { + document.querySelectorAll("use").forEach(el => { + if (el.getAttribute("href").includes("#icon-")) { + el.setAttribute("href", el.getAttribute("href").replace(/.*#/, "#")); + } + }); + } +})() \ No newline at end of file diff --git a/rc-v10.0.1/assets/icons.svg b/rc-v10.0.1/assets/icons.svg new file mode 100644 index 00000000..a19417dc --- /dev/null +++ b/rc-v10.0.1/assets/icons.svg @@ -0,0 +1 @@ +MMNEPVFCICPMFPCPTTAAATR \ No newline at end of file diff --git a/rc-v10.0.1/assets/main.js b/rc-v10.0.1/assets/main.js new file mode 100644 index 00000000..99097a05 --- /dev/null +++ b/rc-v10.0.1/assets/main.js @@ -0,0 +1,60 @@ +"use strict"; +window.translations={"copy":"Copy","copied":"Copied!","normally_hidden":"This member is normally hidden due to your filter settings."}; +"use strict";(()=>{var Pe=Object.create;var ie=Object.defineProperty;var Oe=Object.getOwnPropertyDescriptor;var _e=Object.getOwnPropertyNames;var Re=Object.getPrototypeOf,Me=Object.prototype.hasOwnProperty;var Fe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var De=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of _e(e))!Me.call(t,i)&&i!==n&&ie(t,i,{get:()=>e[i],enumerable:!(r=Oe(e,i))||r.enumerable});return t};var Ae=(t,e,n)=>(n=t!=null?Pe(Re(t)):{},De(e||!t||!t.__esModule?ie(n,"default",{value:t,enumerable:!0}):n,t));var ue=Fe((ae,le)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(n){e.console&&console.warn&&console.warn(n)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(n+=r[u+1]*i[d+1],u+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),m=s.str.charAt(1),p;m in s.node.edges?p=s.node.edges[m]:(p=new t.TokenSet,s.node.edges[m]=p),s.str.length==1&&(p.final=!0),i.push({node:p,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,n){typeof define=="function"&&define.amd?define(n):typeof ae=="object"?le.exports=n():e.lunr=n()}(this,function(){return t})})()});var se=[];function G(t,e){se.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible()),document.body.style.display||(this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}createComponents(e){se.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}showPage(){document.body.style.display&&(document.body.style.removeProperty("display"),this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}scrollToHash(){if(location.hash){let e=document.getElementById(location.hash.substring(1));if(!e)return;e.scrollIntoView({behavior:"instant",block:"start"})}}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e&&!Ve(e)){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r,document.querySelector(".col-sidebar").scrollTop=r}}updateIndexVisibility(){let e=document.querySelector(".tsd-index-content"),n=e?.open;e&&(e.open=!0),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let i=Array.from(r.querySelectorAll(".tsd-index-link")).every(s=>s.offsetParent==null);r.style.display=i?"none":"block"}),e&&(e.open=n)}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(!n)return;let r=n.offsetParent==null,i=n;for(;i!==document.body;)i instanceof HTMLDetailsElement&&(i.open=!0),i=i.parentElement;if(n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let s=document.createElement("p");s.classList.add("warning"),s.textContent=window.translations.normally_hidden,n.prepend(s)}r&&e.scrollIntoView()}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent=window.translations.copied,e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent=window.translations.copy},100)},1e3)})})}};function Ve(t){let e=t.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(e.bottom<0||e.top-n>=0)}var oe=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var pe=Ae(ue());async function ce(t,e){if(!window.searchData)return;let n=await fetch(window.searchData),r=new Blob([await n.arrayBuffer()]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();t.data=i,t.index=pe.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function fe(){let t=document.getElementById("tsd-search");if(!t)return;let e={base:t.dataset.base+"/"},n=document.getElementById("tsd-search-script");t.classList.add("loading"),n&&(n.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),n.addEventListener("load",()=>{ce(e,t)}),ce(e,t));let r=document.querySelector("#tsd-search input"),i=document.querySelector("#tsd-search .results");if(!r||!i)throw new Error("The input field or the result list wrapper was not found");i.addEventListener("mouseup",()=>{te(t)}),r.addEventListener("focus",()=>t.classList.add("has-focus")),He(t,i,r,e)}function He(t,e,n,r){n.addEventListener("input",oe(()=>{Ne(t,e,n,r)},200)),n.addEventListener("keydown",i=>{i.key=="Enter"?Be(e,t):i.key=="ArrowUp"?(de(e,n,-1),i.preventDefault()):i.key==="ArrowDown"&&(de(e,n,1),i.preventDefault())}),document.body.addEventListener("keypress",i=>{i.altKey||i.ctrlKey||i.metaKey||!n.matches(":focus")&&i.key==="/"&&(i.preventDefault(),n.focus())}),document.body.addEventListener("keyup",i=>{t.classList.contains("has-focus")&&(i.key==="Escape"||!e.matches(":focus-within")&&!n.matches(":focus"))&&(n.blur(),te(t))})}function te(t){t.classList.remove("has-focus")}function Ne(t,e,n,r){if(!r.index||!r.data)return;e.textContent="";let i=n.value.trim(),s;if(i){let o=i.split(" ").map(a=>a.length?`*${a}*`:"").join(" ");s=r.index.search(o)}else s=[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o`,d=he(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` + ${he(l.parent,i)}.${d}`);let m=document.createElement("li");m.classList.value=l.classes??"";let p=document.createElement("a");p.href=r.base+l.url,p.innerHTML=u+d,m.append(p),p.addEventListener("focus",()=>{e.querySelector(".current")?.classList.remove("current"),m.classList.add("current")}),e.appendChild(m)}}function de(t,e,n){let r=t.querySelector(".current");if(!r)r=t.querySelector(n==1?"li:first-child":"li:last-child"),r&&r.classList.add("current");else{let i=r;if(n===1)do i=i.nextElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);else do i=i.previousElementSibling??void 0;while(i instanceof HTMLElement&&i.offsetParent==null);i?(r.classList.remove("current"),i.classList.add("current")):n===-1&&(r.classList.remove("current"),e.focus())}}function Be(t,e){let n=t.querySelector(".current");if(n||(n=t.querySelector("li:first-child")),n){let r=n.querySelector("a");r&&(window.location.href=r.href),te(e)}}function he(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(ee(t.substring(s,o)),`${ee(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(ee(t.substring(s))),i.join("")}var je={"&":"&","<":"<",">":">","'":"'",'"':"""};function ee(t){return t.replace(/[&<>"'"]/g,e=>je[e])}var I=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",ye="mousemove",N="mouseup",J={x:0,y:0},me=!1,ne=!1,qe=!1,D=!1,ve=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(ve?"is-mobile":"not-mobile");ve&&"ontouchstart"in document.documentElement&&(qe=!0,F="touchstart",ye="touchmove",N="touchend");document.addEventListener(F,t=>{ne=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(ye,t=>{if(ne&&!D){let e=F=="touchstart"?t.targetTouches[0]:t,n=J.x-(e.pageX||0),r=J.y-(e.pageY||0);D=Math.sqrt(n*n+r*r)>10}});document.addEventListener(N,()=>{ne=!1});document.addEventListener("click",t=>{me&&(t.preventDefault(),t.stopImmediatePropagation(),me=!1)});var X=class extends I{constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener(N,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(F,n=>this.onDocumentPointerDown(n)),document.addEventListener(N,n=>this.onDocumentPointerUp(n))}setActive(e){if(this.active==e)return;this.active=e,document.documentElement.classList.toggle("has-"+this.className,e),this.el.classList.toggle("active",e);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(e){D||(this.setActive(!0),e.preventDefault())}onDocumentPointerDown(e){if(this.active){if(e.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(e){if(!D&&this.active&&e.target.closest(".col-sidebar")){let n=e.target.closest("a");if(n){let r=window.location.href;r.indexOf("#")!=-1&&(r=r.substring(0,r.indexOf("#"))),n.href.substring(0,r.length)==r&&setTimeout(()=>this.setActive(!1),250)}}}};var re;try{re=localStorage}catch{re={getItem(){return null},setItem(){}}}var Q=re;var ge=document.head.appendChild(document.createElement("style"));ge.dataset.for="filters";var Y=class extends I{constructor(e){super(e),this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),ge.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`,this.app.updateIndexVisibility()}fromLocalStorage(){let e=Q.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){Q.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),this.app.updateIndexVisibility()}};var Z=class extends I{constructor(e){super(e),this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update());let r=this.summary.querySelector("a");r&&r.addEventListener("click",()=>{location.assign(r.href)}),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function Ee(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,xe(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),xe(t.value)})}function xe(t){document.documentElement.dataset.theme=t}var K;function we(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",Le),Le())}async function Le(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let n=await(await fetch(window.navigationData)).arrayBuffer(),r=new Blob([n]).stream().pipeThrough(new DecompressionStream("gzip")),i=await new Response(r).json();K=t.dataset.base,K.endsWith("/")||(K+="/"),t.innerHTML="";for(let s of i)Se(s,t,[]);window.app.createComponents(t),window.app.showPage(),window.app.ensureActivePageVisible()}function Se(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-accordion`:"tsd-accordion";let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.dataset.key=i.join("$"),o.innerHTML='',be(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let l=a.appendChild(document.createElement("ul"));l.className="tsd-nested-navigation";for(let u of t.children)Se(u,l,i)}else be(t,r,t.class)}function be(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=K+t.path,n&&(r.className=n),location.pathname===r.pathname&&!r.href.includes("#")&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else{let r=e.appendChild(document.createElement("span"));r.innerHTML='',r.appendChild(document.createElement("span")).textContent=t.text}}G(X,"a[data-toggle]");G(Z,".tsd-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Te=document.getElementById("tsd-theme");Te&&Ee(Te);var $e=new U;Object.defineProperty(window,"app",{value:$e});fe();we();})(); +/*! Bundled license information: + +lunr/lunr.js: + (** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 + * Copyright (C) 2020 Oliver Nightingale + * @license MIT + *) + (*! + * lunr.utils + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Set + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.tokenizer + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Pipeline + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Vector + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.stemmer + * Copyright (C) 2020 Oliver Nightingale + * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt + *) + (*! + * lunr.stopWordFilter + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.trimmer + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.TokenSet + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Index + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Builder + * Copyright (C) 2020 Oliver Nightingale + *) +*/ diff --git a/rc-v10.0.1/assets/navigation.js b/rc-v10.0.1/assets/navigation.js new file mode 100644 index 00000000..68055591 --- /dev/null +++ b/rc-v10.0.1/assets/navigation.js @@ -0,0 +1 @@ +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA7Wab1PqOBSHv0tfO6tAUfEdQlFWL3ak7urc2WFqe4SOkHbS4Mrd2e++U1rpnyQniVve3jx9ktuc82tL/PmPxeCTWVcWhN1+vzOwTqzEZyvrytrE4XYN6Wkx8NuKbdbWifUekdC6sk+sYBWtQwrEuvp5kATxJqGQphC629d1FNzB7h7Ikq1K7YdPI/+1KpZeVJ+y1/33pJxoSz8AlWYAIgiBRh/wRFY+DYFAeAe7FPOJeES/8VMGdBaHcAMEqM+imMwTCLApZNcg0xB/g96FbBy5PKHRh89Aa5eaLKbV3/tEe8dTCCgwzJUTWNEUhXYos9L2tiVBdr/5qjzAdfG5XSsmI7UAR+RLYFrWKofoovQPfx2F7mE7MScHI+J8K4dhiAkPECf6q6Iq6Oso6XWlgbQfPVoq5fZjRFNhbjefcunxQyqfp/2kyr3txVXuO0pmFer2gisXKtPrdccg9eLZdvMK9N5BuiwXNnikc03Cq94X7YfjVyEfISFz9RFiMhebZOVmu2ZRst79GbHVtZ+CUt684H/mcLWGVWGcQpB0++fvHT6JD0Ptx3CpbjWDK9qWArg0HjF9y0lajN5S2kLulrJ2Q7fibSFxS1s7L4t8lbaYiNXKajMOS2+bWVhaW3tpbO69Kqmup65tj+KIeLsEshYppcHaT1NITzmkLux0L5s+xKO6fn4/dTtnYkE5hhmGYZjt+u3Y9dlqzmhElqWK7RJITwVI3dg9G1x0+tXSHpKY7DbRLwivp25vUF9gYeURlTUDuyLXYUDHIFyN0RoG+U2QesphDZttF/f3Dnbjfb5TgVRAabmrhTglDOibH4gWLSG15hhDUk3WinM/ounY93IUk6zIHpJ9e0qcAlJrDueTAQn3T01sAh7TsqvvsNGdHa18sgSsLXlC6Zy6vYwWFW51TOkpSgVdnYAx83rbZM0vk0d0rV5ctNCUhFEA3ObLOGM/uvA6pXTTXcLiJfWTVRRMvh5bnFtIqdyT7XqN3OnGsMp2W7ySSjOaA3SNWWViwq9xXZ/omVk3yp6cAifSASaVX2XPMNGZiamDmTompi5m6pqYepipZ2KyMZNtYupjpr6eSdhDBv3zexoT5O0y9wkhbTNq1DXJu6c+qnL98D/lLw+1QaUpIoipOqgyzYD9HdP3pqP4Z9XVrk9Z5GORyhPmTq6nBcg3rFzoiJhveHWW+431cnkkQMytXDYJEHMrl1MCxNzKZZYAMbeeq63n5tYLtfXC3Hqptl6aWwdq60BlfYxjBiESBBxgbOT6lSeMnVyv8oSxk2tUnjB2cm3KE8ZOrkl5wtjJtShP6Dnzp6qimhqQypzjWp/dCKo3i/rDW8bp+bP3jVFMUka3AYspOoeY1Z9H+okvQPSs2e0Uy7IRfYfonaw+qu8S1plphW2TJKYMwlH9qKSQ1UZVrvLIQ/p9KUD0rbJvTJ7Qd8rflEWM2ptQeIs+IRQbq6Mav1ctet3F7fBx7Myc8eJhMpk7nug0Q0wiZxrFBe7Qu108OjfOM2ItIZVwoCMc6AttezF6mM4W3ovrLMaO693KrDyJq23b3dIkTvdfZl78DkRi5kFM/OI588Wd87K4d2Y3ktU2GEQ3ym6X4pY2GUT3Y/i8KLZ0OhuLdU1GQ2fb8q1pMgrd0+xQwToLleDYJNOZes0NBtFlsbDonCm2iKcQ5dPMfXQm0+fy/4TLMV5vGm2/ljig4DPI/qpgcAe7CY03cwDhmZ6YRA9Ls/OUxiGLyCwE8WNS1QFPKZfCGhNwPy4LnuH8TPKr1Ce1+2fs/kcyWG6AMNE8EhT7oxUCm5hEgbuifgpefJ39gZFILQQ1xF4sq5o6wR8C/wdxav5BxywAAA==" \ No newline at end of file diff --git a/rc-v10.0.1/assets/search.js b/rc-v10.0.1/assets/search.js new file mode 100644 index 00000000..b8080f67 --- /dev/null +++ b/rc-v10.0.1/assets/search.js @@ -0,0 +1 @@ +window.searchData = "data:application/octet-stream;base64,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"; \ No newline at end of file diff --git a/rc-v10.0.1/assets/style.css b/rc-v10.0.1/assets/style.css new file mode 100644 index 00000000..178bfb02 --- /dev/null +++ b/rc-v10.0.1/assets/style.css @@ -0,0 +1,1493 @@ +:root { + /* Light */ + --light-color-background: #f2f4f8; + --light-color-background-secondary: #eff0f1; + --light-color-warning-text: #222; + --light-color-background-warning: #e6e600; + --light-color-accent: #c5c7c9; + --light-color-active-menu-item: var(--light-color-accent); + --light-color-text: #222; + --light-color-text-aside: #6e6e6e; + + --light-color-icon-background: var(--light-color-background); + --light-color-icon-text: var(--light-color-text); + + --light-color-comment-tag-text: var(--light-color-text); + --light-color-comment-tag: var(--light-color-background); + + --light-color-link: #1f70c2; + --light-color-focus-outline: #3584e4; + + --light-color-ts-keyword: #056bd6; + --light-color-ts-project: #b111c9; + --light-color-ts-module: var(--light-color-ts-project); + --light-color-ts-namespace: var(--light-color-ts-project); + --light-color-ts-enum: #7e6f15; + --light-color-ts-enum-member: var(--light-color-ts-enum); + --light-color-ts-variable: #4760ec; + --light-color-ts-function: #572be7; + --light-color-ts-class: #1f70c2; + --light-color-ts-interface: #108024; + --light-color-ts-constructor: #4d7fff; + --light-color-ts-property: #ff984d; + --light-color-ts-method: #ff4db8; + --light-color-ts-reference: #ff4d82; + --light-color-ts-call-signature: var(--light-color-ts-method); + --light-color-ts-index-signature: var(--light-color-ts-property); + --light-color-ts-constructor-signature: var(--light-color-ts-constructor); + --light-color-ts-parameter: var(--light-color-ts-variable); + /* type literal not included as links will never be generated to it */ + --light-color-ts-type-parameter: #a55c0e; + --light-color-ts-accessor: #ff4d4d; + --light-color-ts-get-signature: var(--light-color-ts-accessor); + --light-color-ts-set-signature: var(--light-color-ts-accessor); + --light-color-ts-type-alias: #d51270; + /* reference not included as links will be colored with the kind that it points to */ + --light-color-document: #000000; + + --light-external-icon: url("data:image/svg+xml;utf8,"); + --light-color-scheme: light; + + /* Dark */ + --dark-color-background: #2b2e33; + --dark-color-background-secondary: #1e2024; + --dark-color-background-warning: #bebe00; + --dark-color-warning-text: #222; + --dark-color-accent: #9096a2; + --dark-color-active-menu-item: #5d5d6a; + --dark-color-text: #f5f5f5; + --dark-color-text-aside: #dddddd; + + --dark-color-icon-background: var(--dark-color-background-secondary); + --dark-color-icon-text: var(--dark-color-text); + + --dark-color-comment-tag-text: var(--dark-color-text); + --dark-color-comment-tag: var(--dark-color-background); + + --dark-color-link: #00aff4; + --dark-color-focus-outline: #4c97f2; + + --dark-color-ts-keyword: #3399ff; + --dark-color-ts-project: #e358ff; + --dark-color-ts-module: var(--dark-color-ts-project); + --dark-color-ts-namespace: var(--dark-color-ts-project); + --dark-color-ts-enum: #f4d93e; + --dark-color-ts-enum-member: var(--dark-color-ts-enum); + --dark-color-ts-variable: #798dff; + --dark-color-ts-function: #a280ff; + --dark-color-ts-class: #8ac4ff; + --dark-color-ts-interface: #6cff87; + --dark-color-ts-constructor: #4d7fff; + --dark-color-ts-property: #ff984d; + --dark-color-ts-method: #ff4db8; + --dark-color-ts-reference: #ff4d82; + --dark-color-ts-call-signature: var(--dark-color-ts-method); + --dark-color-ts-index-signature: var(--dark-color-ts-property); + --dark-color-ts-constructor-signature: var(--dark-color-ts-constructor); + --dark-color-ts-parameter: var(--dark-color-ts-variable); + /* type literal not included as links will never be generated to it */ + --dark-color-ts-type-parameter: #e07d13; + --dark-color-ts-accessor: #ff4d4d; + --dark-color-ts-get-signature: var(--dark-color-ts-accessor); + --dark-color-ts-set-signature: var(--dark-color-ts-accessor); + --dark-color-ts-type-alias: #ff6492; + /* reference not included as links will be colored with the kind that it points to */ + --dark-color-document: #ffffff; + + --dark-external-icon: url("data:image/svg+xml;utf8,"); + --dark-color-scheme: dark; +} + +@media (prefers-color-scheme: light) { + :root { + --color-background: var(--light-color-background); + --color-background-secondary: var(--light-color-background-secondary); + --color-background-warning: var(--light-color-background-warning); + --color-warning-text: var(--light-color-warning-text); + --color-accent: var(--light-color-accent); + --color-active-menu-item: var(--light-color-active-menu-item); + --color-text: var(--light-color-text); + --color-text-aside: var(--light-color-text-aside); + + --color-icon-background: var(--light-color-icon-background); + --color-icon-text: var(--light-color-icon-text); + + --color-comment-tag-text: var(--light-color-text); + --color-comment-tag: var(--light-color-background); + + --color-link: var(--light-color-link); + --color-focus-outline: var(--light-color-focus-outline); + + --color-ts-keyword: var(--light-color-ts-keyword); + --color-ts-project: var(--light-color-ts-project); + --color-ts-module: var(--light-color-ts-module); + --color-ts-namespace: var(--light-color-ts-namespace); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-enum-member: var(--light-color-ts-enum-member); + --color-ts-variable: var(--light-color-ts-variable); + --color-ts-function: var(--light-color-ts-function); + --color-ts-class: var(--light-color-ts-class); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-constructor: var(--light-color-ts-constructor); + --color-ts-property: var(--light-color-ts-property); + --color-ts-method: var(--light-color-ts-method); + --color-ts-reference: var(--light-color-ts-reference); + --color-ts-call-signature: var(--light-color-ts-call-signature); + --color-ts-index-signature: var(--light-color-ts-index-signature); + --color-ts-constructor-signature: var( + --light-color-ts-constructor-signature + ); + --color-ts-parameter: var(--light-color-ts-parameter); + --color-ts-type-parameter: var(--light-color-ts-type-parameter); + --color-ts-accessor: var(--light-color-ts-accessor); + --color-ts-get-signature: var(--light-color-ts-get-signature); + --color-ts-set-signature: var(--light-color-ts-set-signature); + --color-ts-type-alias: var(--light-color-ts-type-alias); + --color-document: var(--light-color-document); + + --external-icon: var(--light-external-icon); + --color-scheme: var(--light-color-scheme); + } +} + +@media (prefers-color-scheme: dark) { + :root { + --color-background: var(--dark-color-background); + --color-background-secondary: var(--dark-color-background-secondary); + --color-background-warning: var(--dark-color-background-warning); + --color-warning-text: var(--dark-color-warning-text); + --color-accent: var(--dark-color-accent); + --color-active-menu-item: var(--dark-color-active-menu-item); + --color-text: var(--dark-color-text); + --color-text-aside: var(--dark-color-text-aside); + + --color-icon-background: var(--dark-color-icon-background); + --color-icon-text: var(--dark-color-icon-text); + + --color-comment-tag-text: var(--dark-color-text); + --color-comment-tag: var(--dark-color-background); + + --color-link: var(--dark-color-link); + --color-focus-outline: var(--dark-color-focus-outline); + + --color-ts-keyword: var(--dark-color-ts-keyword); + --color-ts-project: var(--dark-color-ts-project); + --color-ts-module: var(--dark-color-ts-module); + --color-ts-namespace: var(--dark-color-ts-namespace); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-enum-member: var(--dark-color-ts-enum-member); + --color-ts-variable: var(--dark-color-ts-variable); + --color-ts-function: var(--dark-color-ts-function); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-constructor: var(--dark-color-ts-constructor); + --color-ts-property: var(--dark-color-ts-property); + --color-ts-method: var(--dark-color-ts-method); + --color-ts-reference: var(--dark-color-ts-reference); + --color-ts-call-signature: var(--dark-color-ts-call-signature); + --color-ts-index-signature: var(--dark-color-ts-index-signature); + --color-ts-constructor-signature: var( + --dark-color-ts-constructor-signature + ); + --color-ts-parameter: var(--dark-color-ts-parameter); + --color-ts-type-parameter: var(--dark-color-ts-type-parameter); + --color-ts-accessor: var(--dark-color-ts-accessor); + --color-ts-get-signature: var(--dark-color-ts-get-signature); + --color-ts-set-signature: var(--dark-color-ts-set-signature); + --color-ts-type-alias: var(--dark-color-ts-type-alias); + --color-document: var(--dark-color-document); + + --external-icon: var(--dark-external-icon); + --color-scheme: var(--dark-color-scheme); + } +} + +html { + color-scheme: var(--color-scheme); +} + +body { + margin: 0; +} + +:root[data-theme="light"] { + --color-background: var(--light-color-background); + --color-background-secondary: var(--light-color-background-secondary); + --color-background-warning: var(--light-color-background-warning); + --color-warning-text: var(--light-color-warning-text); + --color-icon-background: var(--light-color-icon-background); + --color-accent: var(--light-color-accent); + --color-active-menu-item: var(--light-color-active-menu-item); + --color-text: var(--light-color-text); + --color-text-aside: var(--light-color-text-aside); + --color-icon-text: var(--light-color-icon-text); + + --color-comment-tag-text: var(--light-color-text); + --color-comment-tag: var(--light-color-background); + + --color-link: var(--light-color-link); + --color-focus-outline: var(--light-color-focus-outline); + + --color-ts-keyword: var(--light-color-ts-keyword); + --color-ts-project: var(--light-color-ts-project); + --color-ts-module: var(--light-color-ts-module); + --color-ts-namespace: var(--light-color-ts-namespace); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-enum-member: var(--light-color-ts-enum-member); + --color-ts-variable: var(--light-color-ts-variable); + --color-ts-function: var(--light-color-ts-function); + --color-ts-class: var(--light-color-ts-class); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-constructor: var(--light-color-ts-constructor); + --color-ts-property: var(--light-color-ts-property); + --color-ts-method: var(--light-color-ts-method); + --color-ts-reference: var(--light-color-ts-reference); + --color-ts-call-signature: var(--light-color-ts-call-signature); + --color-ts-index-signature: var(--light-color-ts-index-signature); + --color-ts-constructor-signature: var( + --light-color-ts-constructor-signature + ); + --color-ts-parameter: var(--light-color-ts-parameter); + --color-ts-type-parameter: var(--light-color-ts-type-parameter); + --color-ts-accessor: var(--light-color-ts-accessor); + --color-ts-get-signature: var(--light-color-ts-get-signature); + --color-ts-set-signature: var(--light-color-ts-set-signature); + --color-ts-type-alias: var(--light-color-ts-type-alias); + --color-document: var(--light-color-document); + + --external-icon: var(--light-external-icon); + --color-scheme: var(--light-color-scheme); +} + +:root[data-theme="dark"] { + --color-background: var(--dark-color-background); + --color-background-secondary: var(--dark-color-background-secondary); + --color-background-warning: var(--dark-color-background-warning); + --color-warning-text: var(--dark-color-warning-text); + --color-icon-background: var(--dark-color-icon-background); + --color-accent: var(--dark-color-accent); + --color-active-menu-item: var(--dark-color-active-menu-item); + --color-text: var(--dark-color-text); + --color-text-aside: var(--dark-color-text-aside); + --color-icon-text: var(--dark-color-icon-text); + + --color-comment-tag-text: var(--dark-color-text); + --color-comment-tag: var(--dark-color-background); + + --color-link: var(--dark-color-link); + --color-focus-outline: var(--dark-color-focus-outline); + + --color-ts-keyword: var(--dark-color-ts-keyword); + --color-ts-project: var(--dark-color-ts-project); + --color-ts-module: var(--dark-color-ts-module); + --color-ts-namespace: var(--dark-color-ts-namespace); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-enum-member: var(--dark-color-ts-enum-member); + --color-ts-variable: var(--dark-color-ts-variable); + --color-ts-function: var(--dark-color-ts-function); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-constructor: var(--dark-color-ts-constructor); + --color-ts-property: var(--dark-color-ts-property); + --color-ts-method: var(--dark-color-ts-method); + --color-ts-reference: var(--dark-color-ts-reference); + --color-ts-call-signature: var(--dark-color-ts-call-signature); + --color-ts-index-signature: var(--dark-color-ts-index-signature); + --color-ts-constructor-signature: var( + --dark-color-ts-constructor-signature + ); + --color-ts-parameter: var(--dark-color-ts-parameter); + --color-ts-type-parameter: var(--dark-color-ts-type-parameter); + --color-ts-accessor: var(--dark-color-ts-accessor); + --color-ts-get-signature: var(--dark-color-ts-get-signature); + --color-ts-set-signature: var(--dark-color-ts-set-signature); + --color-ts-type-alias: var(--dark-color-ts-type-alias); + --color-document: var(--dark-color-document); + + --external-icon: var(--dark-external-icon); + --color-scheme: var(--dark-color-scheme); +} + +*:focus-visible, +.tsd-accordion-summary:focus-visible svg { + outline: 2px solid var(--color-focus-outline); +} + +.always-visible, +.always-visible .tsd-signatures { + display: inherit !important; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + line-height: 1.2; +} + +h1 { + font-size: 1.875rem; + margin: 0.67rem 0; +} + +h2 { + font-size: 1.5rem; + margin: 0.83rem 0; +} + +h3 { + font-size: 1.25rem; + margin: 1rem 0; +} + +h4 { + font-size: 1.05rem; + margin: 1.33rem 0; +} + +h5 { + font-size: 1rem; + margin: 1.5rem 0; +} + +h6 { + font-size: 0.875rem; + margin: 2.33rem 0; +} + +dl, +menu, +ol, +ul { + margin: 1em 0; +} + +dd { + margin: 0 0 0 40px; +} + +.container { + max-width: 1700px; + padding: 0 2rem; +} + +/* Footer */ +footer { + border-top: 1px solid var(--color-accent); + padding-top: 1rem; + padding-bottom: 1rem; + max-height: 3.5rem; +} +footer > p { + margin: 0 1em; +} + +.container-main { + margin: 0 auto; + /* toolbar, footer, margin */ + min-height: calc(100vh - 41px - 56px - 4rem); +} + +@keyframes fade-in { + from { + opacity: 0; + } + to { + opacity: 1; + } +} +@keyframes fade-out { + from { + opacity: 1; + visibility: visible; + } + to { + opacity: 0; + } +} +@keyframes fade-in-delayed { + 0% { + opacity: 0; + } + 33% { + opacity: 0; + } + 100% { + opacity: 1; + } +} +@keyframes fade-out-delayed { + 0% { + opacity: 1; + visibility: visible; + } + 66% { + opacity: 0; + } + 100% { + opacity: 0; + } +} +@keyframes pop-in-from-right { + from { + transform: translate(100%, 0); + } + to { + transform: translate(0, 0); + } +} +@keyframes pop-out-to-right { + from { + transform: translate(0, 0); + visibility: visible; + } + to { + transform: translate(100%, 0); + } +} +body { + background: var(--color-background); + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", + Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; + font-size: 16px; + color: var(--color-text); +} + +a { + color: var(--color-link); + text-decoration: none; +} +a:hover { + text-decoration: underline; +} +a.external[target="_blank"] { + background-image: var(--external-icon); + background-position: top 3px right; + background-repeat: no-repeat; + padding-right: 13px; +} +a.tsd-anchor-link { + color: var(--color-text); +} + +code, +pre { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + padding: 0.2em; + margin: 0; + font-size: 0.875rem; + border-radius: 0.8em; +} + +pre { + position: relative; + white-space: pre-wrap; + word-wrap: break-word; + padding: 10px; + border: 1px solid var(--color-accent); +} +pre code { + padding: 0; + font-size: 100%; +} +pre > button { + position: absolute; + top: 10px; + right: 10px; + opacity: 0; + transition: opacity 0.1s; + box-sizing: border-box; +} +pre:hover > button, +pre > button.visible { + opacity: 1; +} + +blockquote { + margin: 1em 0; + padding-left: 1em; + border-left: 4px solid gray; +} + +.tsd-typography { + line-height: 1.333em; +} +.tsd-typography ul { + list-style: square; + padding: 0 0 0 20px; + margin: 0; +} +.tsd-typography .tsd-index-panel h3, +.tsd-index-panel .tsd-typography h3, +.tsd-typography h4, +.tsd-typography h5, +.tsd-typography h6 { + font-size: 1em; +} +.tsd-typography h5, +.tsd-typography h6 { + font-weight: normal; +} +.tsd-typography p, +.tsd-typography ul, +.tsd-typography ol { + margin: 1em 0; +} +.tsd-typography table { + border-collapse: collapse; + border: none; +} +.tsd-typography td, +.tsd-typography th { + padding: 6px 13px; + border: 1px solid var(--color-accent); +} +.tsd-typography thead, +.tsd-typography tr:nth-child(even) { + background-color: var(--color-background-secondary); +} + +.tsd-breadcrumb { + margin: 0; + padding: 0; + color: var(--color-text-aside); +} +.tsd-breadcrumb a { + color: var(--color-text-aside); + text-decoration: none; +} +.tsd-breadcrumb a:hover { + text-decoration: underline; +} +.tsd-breadcrumb li { + display: inline; +} +.tsd-breadcrumb li:after { + content: " / "; +} + +.tsd-comment-tags { + display: flex; + flex-direction: column; +} +dl.tsd-comment-tag-group { + display: flex; + align-items: center; + overflow: hidden; + margin: 0.5em 0; +} +dl.tsd-comment-tag-group dt { + display: flex; + margin-right: 0.5em; + font-size: 0.875em; + font-weight: normal; +} +dl.tsd-comment-tag-group dd { + margin: 0; +} +code.tsd-tag { + padding: 0.25em 0.4em; + border: 0.1em solid var(--color-accent); + margin-right: 0.25em; + font-size: 70%; +} +h1 code.tsd-tag:first-of-type { + margin-left: 0.25em; +} + +dl.tsd-comment-tag-group dd:before, +dl.tsd-comment-tag-group dd:after { + content: " "; +} +dl.tsd-comment-tag-group dd pre, +dl.tsd-comment-tag-group dd:after { + clear: both; +} +dl.tsd-comment-tag-group p { + margin: 0; +} + +.tsd-panel.tsd-comment .lead { + font-size: 1.1em; + line-height: 1.333em; + margin-bottom: 2em; +} +.tsd-panel.tsd-comment .lead:last-child { + margin-bottom: 0; +} + +.tsd-filter-visibility h4 { + font-size: 1rem; + padding-top: 0.75rem; + padding-bottom: 0.5rem; + margin: 0; +} +.tsd-filter-item:not(:last-child) { + margin-bottom: 0.5rem; +} +.tsd-filter-input { + display: flex; + width: -moz-fit-content; + width: fit-content; + align-items: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; +} +.tsd-filter-input input[type="checkbox"] { + cursor: pointer; + position: absolute; + width: 1.5em; + height: 1.5em; + opacity: 0; +} +.tsd-filter-input input[type="checkbox"]:disabled { + pointer-events: none; +} +.tsd-filter-input svg { + cursor: pointer; + width: 1.5em; + height: 1.5em; + margin-right: 0.5em; + border-radius: 0.33em; + /* Leaving this at full opacity breaks event listeners on Firefox. + Don't remove unless you know what you're doing. */ + opacity: 0.99; +} +.tsd-filter-input input[type="checkbox"]:focus-visible + svg { + outline: 2px solid var(--color-focus-outline); +} +.tsd-checkbox-background { + fill: var(--color-accent); +} +input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { + stroke: var(--color-text); +} +.tsd-filter-input input:disabled ~ svg > .tsd-checkbox-background { + fill: var(--color-background); + stroke: var(--color-accent); + stroke-width: 0.25rem; +} +.tsd-filter-input input:disabled ~ svg > .tsd-checkbox-checkmark { + stroke: var(--color-accent); +} + +.settings-label { + font-weight: bold; + text-transform: uppercase; + display: inline-block; +} + +.tsd-filter-visibility .settings-label { + margin: 0.75rem 0 0.5rem 0; +} + +.tsd-theme-toggle .settings-label { + margin: 0.75rem 0.75rem 0 0; +} + +.tsd-hierarchy { + list-style: square; + margin: 0; +} +.tsd-hierarchy .target { + font-weight: bold; +} + +.tsd-full-hierarchy:not(:last-child) { + margin-bottom: 1em; + padding-bottom: 1em; + border-bottom: 1px solid var(--color-accent); +} +.tsd-full-hierarchy, +.tsd-full-hierarchy ul { + list-style: none; + margin: 0; + padding: 0; +} +.tsd-full-hierarchy ul { + padding-left: 1.5rem; +} +.tsd-full-hierarchy a { + padding: 0.25rem 0 !important; + font-size: 1rem; + display: inline-flex; + align-items: center; + color: var(--color-text); +} + +.tsd-panel-group.tsd-index-group { + margin-bottom: 0; +} +.tsd-index-panel .tsd-index-list { + list-style: none; + line-height: 1.333em; + margin: 0; + padding: 0.25rem 0 0 0; + overflow: hidden; + display: grid; + grid-template-columns: repeat(3, 1fr); + column-gap: 1rem; + grid-template-rows: auto; +} +@media (max-width: 1024px) { + .tsd-index-panel .tsd-index-list { + grid-template-columns: repeat(2, 1fr); + } +} +@media (max-width: 768px) { + .tsd-index-panel .tsd-index-list { + grid-template-columns: repeat(1, 1fr); + } +} +.tsd-index-panel .tsd-index-list li { + -webkit-page-break-inside: avoid; + -moz-page-break-inside: avoid; + -ms-page-break-inside: avoid; + -o-page-break-inside: avoid; + page-break-inside: avoid; +} + +.tsd-flag { + display: inline-block; + padding: 0.25em 0.4em; + border-radius: 4px; + color: var(--color-comment-tag-text); + background-color: var(--color-comment-tag); + text-indent: 0; + font-size: 75%; + line-height: 1; + font-weight: normal; +} + +.tsd-anchor { + position: relative; + top: -100px; +} + +.tsd-member { + position: relative; +} +.tsd-member .tsd-anchor + h3 { + display: flex; + align-items: center; + margin-top: 0; + margin-bottom: 0; + border-bottom: none; +} + +.tsd-navigation.settings { + margin: 1rem 0; +} +.tsd-navigation > a, +.tsd-navigation .tsd-accordion-summary { + width: calc(100% - 0.25rem); + display: flex; + align-items: center; +} +.tsd-navigation a, +.tsd-navigation summary > span, +.tsd-page-navigation a { + display: flex; + width: calc(100% - 0.25rem); + align-items: center; + padding: 0.25rem; + color: var(--color-text); + text-decoration: none; + box-sizing: border-box; +} +.tsd-navigation a.current, +.tsd-page-navigation a.current { + background: var(--color-active-menu-item); +} +.tsd-navigation a:hover, +.tsd-page-navigation a:hover { + text-decoration: underline; +} +.tsd-navigation ul, +.tsd-page-navigation ul { + margin-top: 0; + margin-bottom: 0; + padding: 0; + list-style: none; +} +.tsd-navigation li, +.tsd-page-navigation li { + padding: 0; + max-width: 100%; +} +.tsd-navigation .tsd-nav-link { + display: none; +} +.tsd-nested-navigation { + margin-left: 3rem; +} +.tsd-nested-navigation > li > details { + margin-left: -1.5rem; +} +.tsd-small-nested-navigation { + margin-left: 1.5rem; +} +.tsd-small-nested-navigation > li > details { + margin-left: -1.5rem; +} + +.tsd-page-navigation-section { + margin-left: 10px; +} +.tsd-page-navigation-section > summary { + padding: 0.25rem; +} +.tsd-page-navigation-section > div { + margin-left: 20px; +} +.tsd-page-navigation ul { + padding-left: 1.75rem; +} + +#tsd-sidebar-links a { + margin-top: 0; + margin-bottom: 0.5rem; + line-height: 1.25rem; +} +#tsd-sidebar-links a:last-of-type { + margin-bottom: 0; +} + +a.tsd-index-link { + padding: 0.25rem 0 !important; + font-size: 1rem; + line-height: 1.25rem; + display: inline-flex; + align-items: center; + color: var(--color-text); +} +.tsd-accordion-summary { + list-style-type: none; /* hide marker on non-safari */ + outline: none; /* broken on safari, so just hide it */ +} +.tsd-accordion-summary::-webkit-details-marker { + display: none; /* hide marker on safari */ +} +.tsd-accordion-summary, +.tsd-accordion-summary a { + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + user-select: none; + + cursor: pointer; +} +.tsd-accordion-summary a { + width: calc(100% - 1.5rem); +} +.tsd-accordion-summary > * { + margin-top: 0; + margin-bottom: 0; + padding-top: 0; + padding-bottom: 0; +} +.tsd-accordion .tsd-accordion-summary > svg { + margin-left: 0.25rem; + vertical-align: text-top; +} +.tsd-index-content > :not(:first-child) { + margin-top: 0.75rem; +} +.tsd-index-heading { + margin-top: 1.5rem; + margin-bottom: 0.75rem; +} + +.tsd-no-select { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.tsd-kind-icon { + margin-right: 0.5rem; + width: 1.25rem; + height: 1.25rem; + min-width: 1.25rem; + min-height: 1.25rem; +} +.tsd-signature > .tsd-kind-icon { + margin-right: 0.8rem; +} + +.tsd-panel { + margin-bottom: 2.5rem; +} +.tsd-panel.tsd-member { + margin-bottom: 4rem; +} +.tsd-panel:empty { + display: none; +} +.tsd-panel > h1, +.tsd-panel > h2, +.tsd-panel > h3 { + margin: 1.5rem -1.5rem 0.75rem -1.5rem; + padding: 0 1.5rem 0.75rem 1.5rem; +} +.tsd-panel > h1.tsd-before-signature, +.tsd-panel > h2.tsd-before-signature, +.tsd-panel > h3.tsd-before-signature { + margin-bottom: 0; + border-bottom: none; +} + +.tsd-panel-group { + margin: 2rem 0; +} +.tsd-panel-group.tsd-index-group { + margin: 2rem 0; +} +.tsd-panel-group.tsd-index-group details { + margin: 2rem 0; +} +.tsd-panel-group > .tsd-accordion-summary { + margin-bottom: 1rem; +} + +#tsd-search { + transition: background-color 0.2s; +} +#tsd-search .title { + position: relative; + z-index: 2; +} +#tsd-search .field { + position: absolute; + left: 0; + top: 0; + right: 2.5rem; + height: 100%; +} +#tsd-search .field input { + box-sizing: border-box; + position: relative; + top: -50px; + z-index: 1; + width: 100%; + padding: 0 10px; + opacity: 0; + outline: 0; + border: 0; + background: transparent; + color: var(--color-text); +} +#tsd-search .field label { + position: absolute; + overflow: hidden; + right: -40px; +} +#tsd-search .field input, +#tsd-search .title, +#tsd-toolbar-links a { + transition: opacity 0.2s; +} +#tsd-search .results { + position: absolute; + visibility: hidden; + top: 40px; + width: 100%; + margin: 0; + padding: 0; + list-style: none; + box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); +} +#tsd-search .results li { + background-color: var(--color-background); + line-height: initial; + padding: 4px; +} +#tsd-search .results li:nth-child(even) { + background-color: var(--color-background-secondary); +} +#tsd-search .results li.state { + display: none; +} +#tsd-search .results li.current:not(.no-results), +#tsd-search .results li:hover:not(.no-results) { + background-color: var(--color-accent); +} +#tsd-search .results a { + display: flex; + align-items: center; + padding: 0.25rem; + box-sizing: border-box; +} +#tsd-search .results a:before { + top: 10px; +} +#tsd-search .results span.parent { + color: var(--color-text-aside); + font-weight: normal; +} +#tsd-search.has-focus { + background-color: var(--color-accent); +} +#tsd-search.has-focus .field input { + top: 0; + opacity: 1; +} +#tsd-search.has-focus .title, +#tsd-search.has-focus #tsd-toolbar-links a { + z-index: 0; + opacity: 0; +} +#tsd-search.has-focus .results { + visibility: visible; +} +#tsd-search.loading .results li.state.loading { + display: block; +} +#tsd-search.failure .results li.state.failure { + display: block; +} + +#tsd-toolbar-links { + position: absolute; + top: 0; + right: 2rem; + height: 100%; + display: flex; + align-items: center; + justify-content: flex-end; +} +#tsd-toolbar-links a { + margin-left: 1.5rem; +} +#tsd-toolbar-links a:hover { + text-decoration: underline; +} + +.tsd-signature { + margin: 0 0 1rem 0; + padding: 1rem 0.5rem; + border: 1px solid var(--color-accent); + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + font-size: 14px; + overflow-x: auto; +} + +.tsd-signature-keyword { + color: var(--color-ts-keyword); + font-weight: normal; +} + +.tsd-signature-symbol { + color: var(--color-text-aside); + font-weight: normal; +} + +.tsd-signature-type { + font-style: italic; + font-weight: normal; +} + +.tsd-signatures { + padding: 0; + margin: 0 0 1em 0; + list-style-type: none; +} +.tsd-signatures .tsd-signature { + margin: 0; + border-color: var(--color-accent); + border-width: 1px 0; + transition: background-color 0.1s; +} +.tsd-signatures .tsd-index-signature:not(:last-child) { + margin-bottom: 1em; +} +.tsd-signatures .tsd-index-signature .tsd-signature { + border-width: 1px; +} +.tsd-description .tsd-signatures .tsd-signature { + border-width: 1px; +} + +ul.tsd-parameter-list, +ul.tsd-type-parameter-list { + list-style: square; + margin: 0; + padding-left: 20px; +} +ul.tsd-parameter-list > li.tsd-parameter-signature, +ul.tsd-type-parameter-list > li.tsd-parameter-signature { + list-style: none; + margin-left: -20px; +} +ul.tsd-parameter-list h5, +ul.tsd-type-parameter-list h5 { + font-size: 16px; + margin: 1em 0 0.5em 0; +} +.tsd-sources { + margin-top: 1rem; + font-size: 0.875em; +} +.tsd-sources a { + color: var(--color-text-aside); + text-decoration: underline; +} +.tsd-sources ul { + list-style: none; + padding: 0; +} + +.tsd-page-toolbar { + position: sticky; + z-index: 1; + top: 0; + left: 0; + width: 100%; + color: var(--color-text); + background: var(--color-background-secondary); + border-bottom: 1px var(--color-accent) solid; + transition: transform 0.3s ease-in-out; +} +.tsd-page-toolbar a { + color: var(--color-text); + text-decoration: none; +} +.tsd-page-toolbar a.title { + font-weight: bold; +} +.tsd-page-toolbar a.title:hover { + text-decoration: underline; +} +.tsd-page-toolbar .tsd-toolbar-contents { + display: flex; + justify-content: space-between; + height: 2.5rem; + margin: 0 auto; +} +.tsd-page-toolbar .table-cell { + position: relative; + white-space: nowrap; + line-height: 40px; +} +.tsd-page-toolbar .table-cell:first-child { + width: 100%; +} +.tsd-page-toolbar .tsd-toolbar-icon { + box-sizing: border-box; + line-height: 0; + padding: 12px 0; +} + +.tsd-widget { + display: inline-block; + overflow: hidden; + opacity: 0.8; + height: 40px; + transition: + opacity 0.1s, + background-color 0.2s; + vertical-align: bottom; + cursor: pointer; +} +.tsd-widget:hover { + opacity: 0.9; +} +.tsd-widget.active { + opacity: 1; + background-color: var(--color-accent); +} +.tsd-widget.no-caption { + width: 40px; +} +.tsd-widget.no-caption:before { + margin: 0; +} + +.tsd-widget.options, +.tsd-widget.menu { + display: none; +} +input[type="checkbox"] + .tsd-widget:before { + background-position: -120px 0; +} +input[type="checkbox"]:checked + .tsd-widget:before { + background-position: -160px 0; +} + +img { + max-width: 100%; +} + +.tsd-anchor-icon { + display: inline-flex; + align-items: center; + margin-left: 0.5rem; + vertical-align: middle; + color: var(--color-text); +} + +.tsd-anchor-icon svg { + width: 1em; + height: 1em; + visibility: hidden; +} + +.tsd-anchor-link:hover > .tsd-anchor-icon svg { + visibility: visible; +} + +.deprecated { + text-decoration: line-through !important; +} + +.warning { + padding: 1rem; + color: var(--color-warning-text); + background: var(--color-background-warning); +} + +.tsd-kind-project { + color: var(--color-ts-project); +} +.tsd-kind-module { + color: var(--color-ts-module); +} +.tsd-kind-namespace { + color: var(--color-ts-namespace); +} +.tsd-kind-enum { + color: var(--color-ts-enum); +} +.tsd-kind-enum-member { + color: var(--color-ts-enum-member); +} +.tsd-kind-variable { + color: var(--color-ts-variable); +} +.tsd-kind-function { + color: var(--color-ts-function); +} +.tsd-kind-class { + color: var(--color-ts-class); +} +.tsd-kind-interface { + color: var(--color-ts-interface); +} +.tsd-kind-constructor { + color: var(--color-ts-constructor); +} +.tsd-kind-property { + color: var(--color-ts-property); +} +.tsd-kind-method { + color: var(--color-ts-method); +} +.tsd-kind-reference { + color: var(--color-ts-reference); +} +.tsd-kind-call-signature { + color: var(--color-ts-call-signature); +} +.tsd-kind-index-signature { + color: var(--color-ts-index-signature); +} +.tsd-kind-constructor-signature { + color: var(--color-ts-constructor-signature); +} +.tsd-kind-parameter { + color: var(--color-ts-parameter); +} +.tsd-kind-type-parameter { + color: var(--color-ts-type-parameter); +} +.tsd-kind-accessor { + color: var(--color-ts-accessor); +} +.tsd-kind-get-signature { + color: var(--color-ts-get-signature); +} +.tsd-kind-set-signature { + color: var(--color-ts-set-signature); +} +.tsd-kind-type-alias { + color: var(--color-ts-type-alias); +} + +/* if we have a kind icon, don't color the text by kind */ +.tsd-kind-icon ~ span { + color: var(--color-text); +} + +* { + scrollbar-width: thin; + scrollbar-color: var(--color-accent) var(--color-icon-background); +} + +*::-webkit-scrollbar { + width: 0.75rem; +} + +*::-webkit-scrollbar-track { + background: var(--color-icon-background); +} + +*::-webkit-scrollbar-thumb { + background-color: var(--color-accent); + border-radius: 999rem; + border: 0.25rem solid var(--color-icon-background); +} + +/* mobile */ +@media (max-width: 769px) { + .tsd-widget.options, + .tsd-widget.menu { + display: inline-block; + } + + .container-main { + display: flex; + } + html .col-content { + float: none; + max-width: 100%; + width: 100%; + } + html .col-sidebar { + position: fixed !important; + overflow-y: auto; + -webkit-overflow-scrolling: touch; + z-index: 1024; + top: 0 !important; + bottom: 0 !important; + left: auto !important; + right: 0 !important; + padding: 1.5rem 1.5rem 0 0; + width: 75vw; + visibility: hidden; + background-color: var(--color-background); + transform: translate(100%, 0); + } + html .col-sidebar > *:last-child { + padding-bottom: 20px; + } + html .overlay { + content: ""; + display: block; + position: fixed; + z-index: 1023; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.75); + visibility: hidden; + } + + .to-has-menu .overlay { + animation: fade-in 0.4s; + } + + .to-has-menu .col-sidebar { + animation: pop-in-from-right 0.4s; + } + + .from-has-menu .overlay { + animation: fade-out 0.4s; + } + + .from-has-menu .col-sidebar { + animation: pop-out-to-right 0.4s; + } + + .has-menu body { + overflow: hidden; + } + .has-menu .overlay { + visibility: visible; + } + .has-menu .col-sidebar { + visibility: visible; + transform: translate(0, 0); + display: flex; + flex-direction: column; + gap: 1.5rem; + max-height: 100vh; + padding: 1rem 2rem; + } + .has-menu .tsd-navigation { + max-height: 100%; + } + #tsd-toolbar-links { + display: none; + } + .tsd-navigation .tsd-nav-link { + display: flex; + } +} + +/* one sidebar */ +@media (min-width: 770px) { + .container-main { + display: grid; + grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); + grid-template-areas: "sidebar content"; + margin: 2rem auto; + } + + .col-sidebar { + grid-area: sidebar; + } + .col-content { + grid-area: content; + padding: 0 1rem; + } +} +@media (min-width: 770px) and (max-width: 1399px) { + .col-sidebar { + max-height: calc(100vh - 2rem - 42px); + overflow: auto; + position: sticky; + top: 42px; + padding-top: 1rem; + } + .site-menu { + margin-top: 1rem; + } +} + +/* two sidebars */ +@media (min-width: 1200px) { + .container-main { + grid-template-columns: minmax(0, 1fr) minmax(0, 2.5fr) minmax(0, 20rem); + grid-template-areas: "sidebar content toc"; + } + + .col-sidebar { + display: contents; + } + + .page-menu { + grid-area: toc; + padding-left: 1rem; + } + .site-menu { + grid-area: sidebar; + } + + .site-menu { + margin-top: 1rem; + } + + .page-menu, + .site-menu { + max-height: calc(100vh - 2rem - 42px); + overflow: auto; + position: sticky; + top: 42px; + } +} diff --git a/rc-v10.0.1/classes/BIP44CoinTypeNode.html b/rc-v10.0.1/classes/BIP44CoinTypeNode.html new file mode 100644 index 00000000..f39ce2e0 --- /dev/null +++ b/rc-v10.0.1/classes/BIP44CoinTypeNode.html @@ -0,0 +1,99 @@ +BIP44CoinTypeNode | @metamask/key-tree

A wrapper object for BIP-44 coin_type keys. coin_type is the index +specifying the protocol for which deeper keys are intended. For the +authoritative list of coin types, please see +SLIP-44.

+

Recall that a BIP-44 HD tree path consists of the following nodes:

+

m / 44' / coin_type' / account' / change / address_index

+

With the following depths:

+

0 / 1 / 2 / 3 / 4 / 5

+

Implements

Properties

coin_type: number
path: `m / bip32:${number}' / bip32:${number}'`

Accessors

  • get chainCode(): string
  • The hexadecimal string representation of the chain code for this node.

    +

    Returns string

  • get curve(): "ed25519" | "ed25519Bip32" | "secp256k1"
  • Returns "ed25519" | "ed25519Bip32" | "secp256k1"

  • get depth(): BIP44Depth
  • The 0-indexed BIP-44 path depth of this node.

    +

    A BIP-44 path is of the form:

    +

    m / 44' / coin_type' / account' / change / address_index

    +

    With the following depths:

    +

    0 / 1 / 2 / 3 / 4 / 5

    +

    Returns BIP44Depth

  • get index(): number
  • The index of the node, or 0 if this is a master node.

    +

    Returns number

  • get masterFingerprint(): undefined | number
  • The fingerprint of the master node, i.e., the node at depth 0. May be +undefined if this node was created from an extended key.

    +

    Returns undefined | number

  • get network(): Network
  • The network for the node. This is only used for extended keys, and defaults +to mainnet.

    +

    Returns Network

  • get parentFingerprint(): number
  • The fingerprint of the parent key, or 0 if this is a master node.

    +

    Returns number

  • get privateKey(): undefined | string
  • The hexadecimal string representation of the private key for this node. +May be undefined if the node is a public node.

    +

    Returns undefined | string

  • get publicKey(): string
  • The hexadecimal string representation of the public key for this node.

    +

    Returns string

Methods

  • Derives a BIP-44 address_index key corresponding to the path of this +node and the specified account, change, and address_index values. +address_index keys are normally the keys used to generate user account +addresses.

    +

    Recall that a BIP-44 HD tree path consists of the following nodes:

    +

    m / 44' / coin_type' / account' / change / address_index

    +

    With the following depths:

    +

    0 / 1 / 2 / 3 / 4 / 5

    +

    Parameters

    Returns Promise<BIP44Node>

    The derived BIP-44 address_index node.

    +
  • Constructs a BIP-44 coin_type node. coin_type is the index +specifying the protocol for which deeper keys are intended. For the +authoritative list of coin types, please see +SLIP-44.

    +

    Recall that a BIP-44 HD tree path consists of the following nodes:

    +

    m / 44' / coin_type' / account' / change / address_index

    +

    With the following depths:

    +

    0 / 1 / 2 / 3 / 4 / 5

    +

    Parameters

    • derivationPath: CoinTypeHDPathTuple

      The derivation path for the key of this node.

      +
    • Optionalnetwork: Network

      The network for the node. This is only used for extended +keys, and defaults to mainnet.

      +
    • OptionalcryptographicFunctions: CryptographicFunctions

      The cryptographic functions to use. If +provided, these will be used instead of the built-in implementations.

      +

    Returns Promise<BIP44CoinTypeNode>

    A BIP44CoinType node.

    +
  • Constructs a BIP-44 coin_type node. coin_type is the index +specifying the protocol for which deeper keys are intended. For the +authoritative list of coin types, please see +SLIP-44.

    +

    Recall that a BIP-44 HD tree path consists of the following nodes:

    +

    m / 44' / coin_type' / account' / change / address_index

    +

    With the following depths:

    +

    0 / 1 / 2 / 3 / 4 / 5

    +

    Parameters

    • json: JsonBIP44Node

      The JsonBIP44Node for the key of this node.

      +
    • coin_type: number

      The coin_type index of this node. Must be a non-negative +integer.

      +
    • OptionalcryptographicFunctions: CryptographicFunctions

      The cryptographic functions to use. If +provided, these will be used instead of the built-in implementations.

      +

    Returns Promise<BIP44CoinTypeNode>

    A BIP44CoinType node.

    +
  • Constructs a BIP-44 coin_type node. coin_type is the index +specifying the protocol for which deeper keys are intended. For the +authoritative list of coin types, please see +SLIP-44.

    +

    Recall that a BIP-44 HD tree path consists of the following nodes:

    +

    m / 44' / coin_type' / account' / change / address_index

    +

    With the following depths:

    +

    0 / 1 / 2 / 3 / 4 / 5

    +

    Parameters

    • node: BIP44Node

      The BIP44Node for the key of this node.

      +
    • coin_type: number

      The coin_type index of this node. Must be a non-negative +integer.

      +

    Returns Promise<BIP44CoinTypeNode>

    A BIP44CoinType node.

    +
diff --git a/rc-v10.0.1/classes/BIP44Node.html b/rc-v10.0.1/classes/BIP44Node.html new file mode 100644 index 00000000..b98b38ae --- /dev/null +++ b/rc-v10.0.1/classes/BIP44Node.html @@ -0,0 +1,90 @@ +BIP44Node | @metamask/key-tree

A wrapper for BIP-44 Hierarchical Deterministic (HD) tree nodes, i.e. +cryptographic keys used to generate keypairs and addresses for cryptocurrency +protocols.

+

This class contains methods and fields that may not serialize well. Use +BIP44Node.toJSON to get a JSON-compatible representation.

+

Implements

Constructors

Accessors

  • get chainCode(): string
  • The hexadecimal string representation of the chain code for this node.

    +

    Returns string

  • get curve(): "ed25519" | "ed25519Bip32" | "secp256k1"
  • Returns "ed25519" | "ed25519Bip32" | "secp256k1"

  • get depth(): BIP44Depth
  • The 0-indexed BIP-44 path depth of this node.

    +

    A BIP-44 path is of the form:

    +

    m / 44' / coin_type' / account' / change / address_index

    +

    With the following depths:

    +

    0 / 1 / 2 / 3 / 4 / 5

    +

    Returns BIP44Depth

  • get index(): number
  • The index of the node, or 0 if this is a master node.

    +

    Returns number

  • get masterFingerprint(): undefined | number
  • The fingerprint of the master node, i.e., the node at depth 0. May be +undefined if this node was created from an extended key.

    +

    Returns undefined | number

  • get network(): Network
  • The network for the node. This is only used for extended keys, and defaults +to mainnet.

    +

    Returns Network

  • get parentFingerprint(): number
  • The fingerprint of the parent key, or 0 if this is a master node.

    +

    Returns number

  • get privateKey(): undefined | string
  • The hexadecimal string representation of the private key for this node. +May be undefined if the node is a public node.

    +

    Returns undefined | string

  • get privateKeyBytes(): undefined | Uint8Array
  • Returns undefined | Uint8Array

  • get publicKey(): string
  • The hexadecimal string representation of the public key for this node.

    +

    Returns string

Methods

  • Derives a child of the key contains be this node and returns a new +BIP44Node containing the child key.

    +

    The specified path must be a valid HD path from this node, per BIP-44. +At present, this means that the path must consist of no more than 5 BIP-32 +nodes, depending on the depth of this node.

    +

    Recall that a BIP-44 HD tree path consists of the following nodes:

    +

    m / 44' / coin_type' / account' / change / address_index

    +

    With the following depths:

    +

    0 / 1 / 2 / 3 / 4 / 5

    +

    Parameters

    • path: PartialHDPathTuple

      The partial (non-rooted) BIP-44 HD tree path will be used +to derive a child key from the parent key contained within this node.

      +

    Returns Promise<BIP44Node>

    The BIP44Node corresponding to the derived child key.

    +
  • Create a new BIP-44 node from a derivation path. The derivation path +must be rooted, i.e. it must begin with a BIP-39 node, given as a string of +the form bip39:MNEMONIC, where MNEMONIC is a space-separated list of +BIP-39 seed phrase words.

    +

    All parameters are stringently validated, and an error is thrown if +validation fails.

    +

    Recall that a BIP-44 HD tree path consists of the following nodes:

    +

    m / 44' / coin_type' / account' / change / address_index

    +

    With the following depths:

    +

    0 / 1 / 2 / 3 / 4 / 5

    +

    Parameters

    • options: BIP44DerivationPathOptions

      An object containing the derivation path.

      +
    • OptionalcryptographicFunctions: CryptographicFunctions

      The cryptographic functions to use. If +provided, these will be used instead of the built-in implementations.

      +

    Returns Promise<BIP44Node>

    A BIP44 node.

    +
  • Create a new BIP-44 node from a key and chain code. You must specify +either a private key or a public key. When specifying a private key, +the public key will be derived from the private key.

    +

    All parameters are stringently validated, and an error is thrown if +validation fails.

    +

    Parameters

    • options: string | BIP44ExtendedKeyOptions

      An object containing the extended key, or an extended +public (xpub) or private (xprv) key.

      +
    • OptionalcryptographicFunctions: CryptographicFunctions

      The cryptographic functions to use. If +provided, these will be used instead of the built-in implementations.

      +

    Returns Promise<BIP44Node>

    A BIP44 node.

    +
  • Wrapper of the fromExtendedKey function. Refer to that function +for documentation.

    +

    Parameters

    • json: JsonBIP44Node

      The JSON representation of a SLIP-10 node.

      +
    • OptionalcryptographicFunctions: CryptographicFunctions

      The cryptographic functions to use. If +provided, these will be used instead of the built-in implementations.

      +

    Returns Promise<BIP44Node>

    A BIP44 node.

    +
diff --git a/rc-v10.0.1/classes/SLIP10Node.html b/rc-v10.0.1/classes/SLIP10Node.html new file mode 100644 index 00000000..d1e52100 --- /dev/null +++ b/rc-v10.0.1/classes/SLIP10Node.html @@ -0,0 +1,90 @@ +SLIP10Node | @metamask/key-tree

Implements

Properties

chainCodeBytes: Uint8Array
curve: "ed25519" | "ed25519Bip32" | "secp256k1"

The name of the curve used by the node.

+
depth: number

The 0-indexed path depth of this node.

+
index: number

The index of the node, or 0 if this is a master node.

+
masterFingerprint?: number

The fingerprint of the master node, i.e., the node at depth 0. May be +undefined if this node was created from an extended key.

+
network: Network

The network for the node. This is only used for extended keys, and defaults +to mainnet.

+
parentFingerprint: number

The fingerprint of the parent key, or 0 if this is a master node.

+
privateKeyBytes?: Uint8Array

The private key for this node, as a Uint8Array. +May be undefined if this node is a public key only node.

+
publicKeyBytes: Uint8Array

The public key for this node, as a Uint8Array.

+

Accessors

  • get chainCode(): string
  • The chain code of this node.

    +

    Returns string

  • get extendedKey(): string
  • Get the extended public or private key for the SLIP-10 node. SLIP-10 +doesn't specify a format for extended keys, so we use the BIP-32 format.

    +

    This property is only supported for secp256k1 nodes, as other curves +don't specify a standard format for extended keys.

    +

    Returns string

    The extended public or private key for the node.

    +
  • get privateKey(): undefined | string
  • The (optional) private key of this node.

    +

    Returns undefined | string

  • get publicKey(): string
  • The public key of this node.

    +

    Returns string

Methods

  • Derives a child of the key contains be this node and returns a new +SLIP10Node containing the child key.

    +

    The specified path must be a valid HD path from this node, per SLIP-10.

    +

    Parameters

    • path: SLIP10PathTuple

      The partial (non-rooted) SLIP-10 HD tree path will be used +to derive a child key from the parent key contained within this node.

      +

    Returns Promise<SLIP10Node>

    The SLIP10Node corresponding to the derived child key.

    +
  • Create a new SLIP-10 node from a derivation path. The derivation path +must be rooted, i.e. it must begin with a BIP-39 node, given as a string of +the form bip39:MNEMONIC, where MNEMONIC is a space-separated list of +BIP-39 seed phrase words.

    +

    All parameters are stringently validated, and an error is thrown if +validation fails.

    +

    Recall that a BIP-44 HD tree path consists of the following nodes:

    +

    m / 44' / coin_type' / account' / change / address_index

    +

    With the following depths:

    +

    0 / 1 / 2 / 3 / 4 / 5

    +

    Parameters

    Returns Promise<SLIP10Node>

    A new SLIP-10 node.

    +
  • Create a new SLIP-10 node from a BIP-32 serialised extended key string. +The key may be either public or private. Note that secp256k1 is assumed +as the curve for the key.

    +

    All parameters are stringently validated, and an error is thrown if +validation fails.

    +

    Parameters

    • extendedKey: string

      The BIP-32 extended key string.

      +
    • OptionalcryptographicFunctions: CryptographicFunctions

      The cryptographic functions to use. If +provided, these will be used instead of the built-in implementations.

      +

    Returns Promise<SLIP10Node>

    A SLIP10 node.

    +
  • Create a new SLIP-10 node from a key and chain code. You must specify +either a private key or a public key. When specifying a private key, +the public key will be derived from the private key.

    +

    All parameters are stringently validated, and an error is thrown if +validation fails.

    +

    Parameters

    Returns Promise<SLIP10Node>

    A SLIP10 node.

    +
diff --git a/rc-v10.0.1/functions/createBip39KeyFromSeed.html b/rc-v10.0.1/functions/createBip39KeyFromSeed.html new file mode 100644 index 00000000..87989564 --- /dev/null +++ b/rc-v10.0.1/functions/createBip39KeyFromSeed.html @@ -0,0 +1,10 @@ +createBip39KeyFromSeed | @metamask/key-tree

Function createBip39KeyFromSeed

  • Create a SLIP10Node from a BIP-39 seed.

    +

    Parameters

    • seed: Uint8Array

      The cryptographic seed bytes.

      +
    • curve: {
          compressedPublicKeyLength: number;
          compressPublicKey: ((publicKey: Uint8Array) => Uint8Array);
          curve: {
              n: bigint;
          };
          decompressPublicKey: ((publicKey: Uint8Array) => Uint8Array);
          deriveUnhardenedKeys: boolean;
          getPublicKey: ((privateKey: Uint8Array, compressed?: boolean) => Uint8Array | Promise<Uint8Array>);
          isValidPrivateKey: ((privateKey: Uint8Array) => boolean);
          privateKeyLength: number;
          publicAdd: ((publicKey: Uint8Array, tweak: Uint8Array) => Uint8Array);
          publicKeyLength: number;
          secret: Uint8Array;
      } & {
          masterNodeGenerationSpec: "slip10";
          name: "ed25519" | "secp256k1";
      }

      The curve to use.

      +
    • Optionalnetwork: Network

      The network for the node. This is only used for extended +keys, and defaults to mainnet.

      +
    • OptionalcryptographicFunctions: CryptographicFunctions

      The cryptographic functions to use. If +provided, these will be used instead of the built-in implementations.

      +

    Returns Promise<SLIP10Node>

    An object containing the corresponding BIP-39 master key and chain +code.

    +
diff --git a/rc-v10.0.1/functions/deriveBIP44AddressKey.html b/rc-v10.0.1/functions/deriveBIP44AddressKey.html new file mode 100644 index 00000000..d6f2447c --- /dev/null +++ b/rc-v10.0.1/functions/deriveBIP44AddressKey.html @@ -0,0 +1,12 @@ +deriveBIP44AddressKey | @metamask/key-tree

Function deriveBIP44AddressKey

  • Derives a BIP-44 address key corresponding to the specified derivation path, +given either by a BIP44CoinTypeNode or derivation path tuple.

    +

    Recall that a BIP-44 HD tree path consists of the following nodes:

    +

    m / 44' / coin_type' / account' / change / address_index

    +

    With the following depths:

    +

    0 / 1 / 2 / 3 / 4 / 5

    +

    Parameters

    Returns Promise<BIP44Node>

    The derived address_index key for the specified derivation path.

    +
diff --git a/rc-v10.0.1/functions/ed25519.compressPublicKey.html b/rc-v10.0.1/functions/ed25519.compressPublicKey.html new file mode 100644 index 00000000..1ab677d0 --- /dev/null +++ b/rc-v10.0.1/functions/ed25519.compressPublicKey.html @@ -0,0 +1 @@ +compressPublicKey | @metamask/key-tree
  • Parameters

    • publicKey: Uint8Array

    Returns Uint8Array

diff --git a/rc-v10.0.1/functions/ed25519.decompressPublicKey.html b/rc-v10.0.1/functions/ed25519.decompressPublicKey.html new file mode 100644 index 00000000..1ae27db3 --- /dev/null +++ b/rc-v10.0.1/functions/ed25519.decompressPublicKey.html @@ -0,0 +1 @@ +decompressPublicKey | @metamask/key-tree
  • Parameters

    • publicKey: Uint8Array

    Returns Uint8Array

diff --git a/rc-v10.0.1/functions/ed25519.getPublicKey.html b/rc-v10.0.1/functions/ed25519.getPublicKey.html new file mode 100644 index 00000000..8f833659 --- /dev/null +++ b/rc-v10.0.1/functions/ed25519.getPublicKey.html @@ -0,0 +1 @@ +getPublicKey | @metamask/key-tree
  • Parameters

    • privateKey: Uint8Array
    • Optional_compressed: boolean

    Returns Uint8Array

diff --git a/rc-v10.0.1/functions/ed25519.isValidPrivateKey.html b/rc-v10.0.1/functions/ed25519.isValidPrivateKey.html new file mode 100644 index 00000000..57b2189b --- /dev/null +++ b/rc-v10.0.1/functions/ed25519.isValidPrivateKey.html @@ -0,0 +1 @@ +isValidPrivateKey | @metamask/key-tree
  • Parameters

    • _privateKey: string | bigint | Uint8Array

    Returns boolean

diff --git a/rc-v10.0.1/functions/ed25519.publicAdd.html b/rc-v10.0.1/functions/ed25519.publicAdd.html new file mode 100644 index 00000000..e91325a3 --- /dev/null +++ b/rc-v10.0.1/functions/ed25519.publicAdd.html @@ -0,0 +1 @@ +publicAdd | @metamask/key-tree
  • Parameters

    • _publicKey: Uint8Array
    • _tweak: Uint8Array

    Returns Uint8Array

diff --git a/rc-v10.0.1/functions/ed25519Bip32.bytesToNumberLE.html b/rc-v10.0.1/functions/ed25519Bip32.bytesToNumberLE.html new file mode 100644 index 00000000..5a0d17db --- /dev/null +++ b/rc-v10.0.1/functions/ed25519Bip32.bytesToNumberLE.html @@ -0,0 +1,4 @@ +bytesToNumberLE | @metamask/key-tree

Converts a Uint8Array of bytes to a bigint in little-endian format.

+
  • Parameters

    • bytes: Uint8Array

      The Uint8Array of bytes to convert.

      +

    Returns bigint

    The converted bigint value.

    +
diff --git a/rc-v10.0.1/functions/ed25519Bip32.compressPublicKey.html b/rc-v10.0.1/functions/ed25519Bip32.compressPublicKey.html new file mode 100644 index 00000000..bcaf1ade --- /dev/null +++ b/rc-v10.0.1/functions/ed25519Bip32.compressPublicKey.html @@ -0,0 +1,4 @@ +compressPublicKey | @metamask/key-tree

Compresses an Ed25519 public key.

+
  • Parameters

    • publicKey: Uint8Array

      The public key to compress.

      +

    Returns Uint8Array

    The compressed public key.

    +
diff --git a/rc-v10.0.1/functions/ed25519Bip32.decompressPublicKey.html b/rc-v10.0.1/functions/ed25519Bip32.decompressPublicKey.html new file mode 100644 index 00000000..be38dfc9 --- /dev/null +++ b/rc-v10.0.1/functions/ed25519Bip32.decompressPublicKey.html @@ -0,0 +1,4 @@ +decompressPublicKey | @metamask/key-tree

Decompresses a compressed Ed25519Bip32 public key.

+
  • Parameters

    • publicKey: Uint8Array

      The compressed public key.

      +

    Returns Uint8Array

    The decompressed public key.

    +
diff --git a/rc-v10.0.1/functions/ed25519Bip32.getPublicKey.html b/rc-v10.0.1/functions/ed25519Bip32.getPublicKey.html new file mode 100644 index 00000000..52e1b7ea --- /dev/null +++ b/rc-v10.0.1/functions/ed25519Bip32.getPublicKey.html @@ -0,0 +1,5 @@ +getPublicKey | @metamask/key-tree

Calculates the public key corresponding to a given private key.

+
  • Parameters

    • privateKey: Uint8Array

      The private key.

      +
    • Optional_compressed: boolean

      Optional parameter to indicate if the public key should be compressed.

      +

    Returns Promise<Uint8Array>

    The public key.

    +
diff --git a/rc-v10.0.1/functions/ed25519Bip32.isValidPrivateKey.html b/rc-v10.0.1/functions/ed25519Bip32.isValidPrivateKey.html new file mode 100644 index 00000000..fd672b89 --- /dev/null +++ b/rc-v10.0.1/functions/ed25519Bip32.isValidPrivateKey.html @@ -0,0 +1,4 @@ +isValidPrivateKey | @metamask/key-tree

Check if a private key is valid.

+
  • Parameters

    • privateKey: Uint8Array

      The private key to check.

      +

    Returns boolean

    Whether the private key is valid.

    +
diff --git a/rc-v10.0.1/functions/ed25519Bip32.multiplyWithBase.html b/rc-v10.0.1/functions/ed25519Bip32.multiplyWithBase.html new file mode 100644 index 00000000..5f7e4302 --- /dev/null +++ b/rc-v10.0.1/functions/ed25519Bip32.multiplyWithBase.html @@ -0,0 +1,6 @@ +multiplyWithBase | @metamask/key-tree
  • Parameters

    • key: Uint8Array

      The key to multiply with the base point.

      +

    Returns Uint8Array

    The resulting point on the Edwards curve.

    +
diff --git a/rc-v10.0.1/functions/ed25519Bip32.publicAdd.html b/rc-v10.0.1/functions/ed25519Bip32.publicAdd.html new file mode 100644 index 00000000..2a09cc28 --- /dev/null +++ b/rc-v10.0.1/functions/ed25519Bip32.publicAdd.html @@ -0,0 +1,5 @@ +publicAdd | @metamask/key-tree

Adds a tweak to a public key.

+
  • Parameters

    • publicKey: Uint8Array

      The public key.

      +
    • tweak: Uint8Array

      The tweak to add.

      +

    Returns Uint8Array

    The resulting public key.

    +
diff --git a/rc-v10.0.1/functions/getBIP44AddressKeyDeriver.html b/rc-v10.0.1/functions/getBIP44AddressKeyDeriver.html new file mode 100644 index 00000000..c1e4cae2 --- /dev/null +++ b/rc-v10.0.1/functions/getBIP44AddressKeyDeriver.html @@ -0,0 +1,16 @@ +getBIP44AddressKeyDeriver | @metamask/key-tree

Function getBIP44AddressKeyDeriver

  • Creates a function that derives BIP-44 address keys corresponding to the +specified derivation path, given either by a BIP44CoinTypeNode or +derivation path tuple.

    +

    Recall that a BIP-44 HD tree path consists of the following nodes:

    +

    m / 44' / coin_type' / account' / change / address_index

    +

    With the following depths:

    +

    0 / 1 / 2 / 3 / 4 / 5

    +

    Parameters

    Returns Promise<BIP44AddressKeyDeriver>

    The deriver function for the derivation path specified by the +coin_type node, account, and change indices.

    +
diff --git a/rc-v10.0.1/functions/getBIP44CoinTypeToAddressPathTuple.html b/rc-v10.0.1/functions/getBIP44CoinTypeToAddressPathTuple.html new file mode 100644 index 00000000..17f56a1c --- /dev/null +++ b/rc-v10.0.1/functions/getBIP44CoinTypeToAddressPathTuple.html @@ -0,0 +1,6 @@ +getBIP44CoinTypeToAddressPathTuple | @metamask/key-tree

Function getBIP44CoinTypeToAddressPathTuple

  • Gets a BIP-44 path tuple of the form account' / change / address_index, +which can be used to derive address keys together with a coin_type key.

    +

    Parameters

    Returns CoinTypeToAddressTuple

    The account' / change / address_index path corresponding to the +specified indices.

    +
diff --git a/rc-v10.0.1/functions/isValidBIP32PathSegment.html b/rc-v10.0.1/functions/isValidBIP32PathSegment.html new file mode 100644 index 00000000..c35d4725 --- /dev/null +++ b/rc-v10.0.1/functions/isValidBIP32PathSegment.html @@ -0,0 +1,5 @@ +isValidBIP32PathSegment | @metamask/key-tree

Function isValidBIP32PathSegment

  • Check if the value is a valid BIP-32 path segment, i.e., a string of the form +0'.

    +

    Parameters

    • segment: string

      The BIP-32 path segment to test.

      +

    Returns segment is `${number}'`

    Whether the path segment is a valid BIP-32 path segment.

    +
diff --git a/rc-v10.0.1/functions/mnemonicPhraseToBytes.html b/rc-v10.0.1/functions/mnemonicPhraseToBytes.html new file mode 100644 index 00000000..19d29578 --- /dev/null +++ b/rc-v10.0.1/functions/mnemonicPhraseToBytes.html @@ -0,0 +1,8 @@ +mnemonicPhraseToBytes | @metamask/key-tree

Function mnemonicPhraseToBytes

  • Get a secret recovery phrase (or mnemonic phrase) in string form as a +Uint8Array. The secret recovery phrase is split into words, and each word +is converted to a number using the BIP-39 word list. The numbers are then +converted to bytes, and the bytes are concatenated into a single +Uint8Array.

    +

    Parameters

    • mnemonicPhrase: string

      The secret recovery phrase to convert.

      +

    Returns Uint8Array

    The Uint8Array corresponding to the secret recovery phrase.

    +
diff --git a/rc-v10.0.1/functions/mnemonicToSeed.html b/rc-v10.0.1/functions/mnemonicToSeed.html new file mode 100644 index 00000000..2e4d94d0 --- /dev/null +++ b/rc-v10.0.1/functions/mnemonicToSeed.html @@ -0,0 +1,9 @@ +mnemonicToSeed | @metamask/key-tree

Function mnemonicToSeed

  • Convert a BIP-39 mnemonic phrase to a seed.

    +

    Parameters

    • mnemonic: string | Uint8Array

      The BIP-39 mnemonic phrase to convert. If the mnemonic is a +Uint8Array, it is assumed to contain the indices of the words in the +English wordlist.

      +
    • passphrase: string = ''

      The passphrase to use.

      +
    • OptionalcryptographicFunctions: CryptographicFunctions

      The cryptographic functions to use. If +provided, these will be used instead of the built-in implementations.

      +

    Returns Promise<Uint8Array>

    The seed.

    +
diff --git a/rc-v10.0.1/functions/secp256k1.compressPublicKey.html b/rc-v10.0.1/functions/secp256k1.compressPublicKey.html new file mode 100644 index 00000000..d5e6ec1d --- /dev/null +++ b/rc-v10.0.1/functions/secp256k1.compressPublicKey.html @@ -0,0 +1 @@ +compressPublicKey | @metamask/key-tree
diff --git a/rc-v10.0.1/functions/secp256k1.decompressPublicKey.html b/rc-v10.0.1/functions/secp256k1.decompressPublicKey.html new file mode 100644 index 00000000..e2af3cac --- /dev/null +++ b/rc-v10.0.1/functions/secp256k1.decompressPublicKey.html @@ -0,0 +1 @@ +decompressPublicKey | @metamask/key-tree
diff --git a/rc-v10.0.1/functions/secp256k1.getPublicKey.html b/rc-v10.0.1/functions/secp256k1.getPublicKey.html new file mode 100644 index 00000000..ad5015dc --- /dev/null +++ b/rc-v10.0.1/functions/secp256k1.getPublicKey.html @@ -0,0 +1 @@ +getPublicKey | @metamask/key-tree
  • Parameters

    • privateKey: Uint8Array
    • compressed: boolean = false

    Returns Uint8Array

diff --git a/rc-v10.0.1/functions/secp256k1.isValidPrivateKey.html b/rc-v10.0.1/functions/secp256k1.isValidPrivateKey.html new file mode 100644 index 00000000..1131c83a --- /dev/null +++ b/rc-v10.0.1/functions/secp256k1.isValidPrivateKey.html @@ -0,0 +1 @@ +isValidPrivateKey | @metamask/key-tree
diff --git a/rc-v10.0.1/functions/secp256k1.publicAdd.html b/rc-v10.0.1/functions/secp256k1.publicAdd.html new file mode 100644 index 00000000..296c8bb1 --- /dev/null +++ b/rc-v10.0.1/functions/secp256k1.publicAdd.html @@ -0,0 +1 @@ +publicAdd | @metamask/key-tree
  • Parameters

    • publicKey: Uint8Array
    • tweak: Uint8Array

    Returns Uint8Array

diff --git a/rc-v10.0.1/index.html b/rc-v10.0.1/index.html new file mode 100644 index 00000000..6ef46f66 --- /dev/null +++ b/rc-v10.0.1/index.html @@ -0,0 +1,54 @@ +@metamask/key-tree

@metamask/key-tree

@metamask/key-tree

An interface over SLIP-10, BIP-32, and BIP-44 key derivation paths.

+

This library was audited by Cure53 in February 2023, and April 2024. The audit reports can be found here.

+

yarn add @metamask/key-tree

+

or

+

npm install @metamask/key-tree

+

This package is designed to accommodate the creation of keys for any level of a SLIP-10 or BIP-44 path. +Recall that a BIP-44 HD tree path consists of the following nodes (and depths):

+
+

m / 44' / coin_type' / account' / change / address_index

+

0 / 1 / 2 / 3 / 4 / 5

+
+

Where m is the "master" or seed node, coin_type indicates the protocol for which deeper keys are intended, +and address_index usually furnishes key pairs intended for user addresses / accounts. +For details, refer to the BIP-44 specification. +For the authoritative list of protocol coin_type indices, see SLIP-44.

+

The SLIP-10 interface provides a more generic way for deriving keys, which is not constrained to the BIP-44 path +nodes. Currently only Secp256k1 and Ed25519 are supported for SLIP-10, but NIST P-256 may be added if there is +sufficient demand for it.

+

This package exports a few classes intended to facilitate the creation of keys in contexts with different privileges. +They are used as follows.

+
import { BIP44CoinTypeNode } from '@metamask/key-tree';

// Per SLIP-44, Ethereum has a coin_type of 60.
// Ethereum is only used by way of example.
const coinType = 60;

// Imagine that this takes place in some privileged context with access to
// the user's secret recovery phrase.
const secretRecoveryPhrase = getSecretRecoveryPhrase();

const coinTypeNode = await BIP44CoinTypeNode.fromDerivationPath([
`bip39:${secretRecoveryPhrase}`,
`bip32:44'`, // By BIP-44, the "purpose" node must be "44'"
`bip32:${coinType}'`,
]);

// Imagine that this is some Node.js stream, but it could be anything that
// can transmit JSON messages, such as window.postMessage.
// Alternatively you can use `coinTypeNode.extendedKey` as well.
stream.write(coinTypeNode.toJSON());

//===============================
// Then, on the receiving end...
//===============================

import { getBIP44AddressKeyDeriver } from '@metamask/key-tree';

// Get the node sent from the privileged context.
// It will have the following shape:
// {
// privateKey, // A hexadecimal string of the private key
// publicKey, // A hexadecimal string of the public key
// chainCode, // A hexadecimal string of the chain code
// depth, // The number 2, which is the depth of coin_type nodes
// parentFingerprint, // The fingerprint of the parent node as number
// index, // The index of the node as number
// coin_type, // In this case, the number 60
// path, // For visualization only. In this case: m / 44' / 60'
// }
const coinTypeNode = await getCoinTypeNode();

// Get an address key deriver for the coin_type node.
// In this case, its path will be: m / 44' / 60' / 0' / 0 / address_index
// Alternatively you can use an extended key (`xprv`) as well.
const addressKeyDeriver = getBIP44AddressKeyDeriver(coinTypeNode);

// These are Uint8Array representations of the extended private keys for
// the respective addresses.

// m / 44' / 60' / 0' / 0 / 0
const addressKey0 = await addressKeyDeriver(0);

// m / 44' / 60' / 0' / 0 / 1
const addressKey1 = await addressKeyDeriver(1);

// m / 44' / 60' / 0' / 0 / 2'
const addressKey2 = await addressKeyDeriver(2, true);

// Now, the extended private keys can be used to derive the corresponding public
// keys and protocol addresses. +
+ +

You can derive SLIP-10 keys as follows.

+
import { SLIP10Node } from '@metamask/key-tree';

// Create a SLIP10Node from a derivation path. You can also specify a key and depth instead.
const node = await SLIP10Node.fromDerivationPath({
curve: 'secp256k1',
derivationPath: [`bip39:${secretRecoveryPhrase}`, `slip10:0'`],
});

// SLIP-10 supports Ed25519 as well.
const ed25519Node = await SLIP10Node.fromDerivationPath({
curve: 'ed25519',
derivationPath: [`bip39:${secretRecoveryPhrase}`, `slip10:0'`],
});

// Derive the child node at m / 0' / 1' / 2'. This results in a new SLIP10Node.
// Note that you cannot derive unhardened child nodes when using Ed25519.
const childNode = await node.derive([`slip10:1'`, `slip10:2'`]); +
+ +

The SLIP10Node class supports both bip32: and slip10: paths. While BIP-32 and SLIP-10 are mostly compatible with +each other, there are some differences:

+
    +
  • Ed25519 is only supported by SLIP-10, so you must use slip10: paths when deriving Ed25519 keys.
  • +
  • Key derivation errors (i.e., invalid keys being derived) are handled slightly different. While the chance of +encountering such an error is extremely low, it is possible.
  • +
+

If you require full compatibility with one or the other, you can choose between the bip32: and slip10: path types.

+

There are other ways of deriving keys in addition to the above example. +See the docstrings in the BIP44Node, BIP44CoinTypeNode and +SLIP10Node files for details.

+

This package also has methods for deriving arbitrary SLIP-10 and BIP-32 keys, and generating seeds from BIP-39 +secret recovery phrases. +These methods do not constitute a safe key derivation API, and their use is strongly discouraged. +Nevertheless, since those methods were the main exports of this package prior to version 3.0.0, consumers can +still access them by importing @metamask/key-tree/derivation.

+

This package is rigorously tested against reference implementations and the SLIP-10 and BIP-32 specifications. +See the reference implementation tests for details.

+ +
diff --git a/rc-v10.0.1/media/BIP44CoinTypeNode.ts b/rc-v10.0.1/media/BIP44CoinTypeNode.ts new file mode 100644 index 00000000..ab913fd4 --- /dev/null +++ b/rc-v10.0.1/media/BIP44CoinTypeNode.ts @@ -0,0 +1,525 @@ +import { assert } from '@metamask/utils'; + +import type { BIP44NodeInterface, JsonBIP44Node } from './BIP44Node'; +import { BIP44Node } from './BIP44Node'; +import type { + BIP39Node, + BIP44Depth, + BIP44PurposeNodeToken, + CoinTypeHDPathString, + HardenedBIP32Node, + Network, +} from './constants'; +import { BIP_32_HARDENED_OFFSET } from './constants'; +import type { CryptographicFunctions } from './cryptography'; +import type { SupportedCurve } from './curves'; +import { deriveChildNode } from './SLIP10Node'; +import type { CoinTypeToAddressIndices } from './utils'; +import { + getBIP32NodeToken, + getBIP44ChangePathString, + getBIP44CoinTypePathString, + getBIP44CoinTypeToAddressPathTuple, + getHardenedBIP32NodeToken, + getUnhardenedBIP32NodeToken, + hexStringToBytes, + nullableHexStringToBytes, +} from './utils'; + +export type CoinTypeHDPathTuple = [ + BIP39Node, + typeof BIP44PurposeNodeToken, + HardenedBIP32Node, +]; + +export const BIP_44_COIN_TYPE_DEPTH = 2; + +export type JsonBIP44CoinTypeNode = JsonBIP44Node & { + readonly coin_type: number; + readonly path: CoinTypeHDPathString; +}; + +export type BIP44CoinTypeNodeInterface = BIP44NodeInterface & { + readonly coin_type: number; + readonly path: CoinTypeHDPathString; +}; + +/** + * A wrapper object for BIP-44 `coin_type` keys. `coin_type` is the index + * specifying the protocol for which deeper keys are intended. For the + * authoritative list of coin types, please see + * [SLIP-44](https://github.com/satoshilabs/slips/blob/master/slip-0044.md). + * + * Recall that a BIP-44 HD tree path consists of the following nodes: + * + * `m / 44' / coin_type' / account' / change / address_index` + * + * With the following depths: + * + * `0 / 1 / 2 / 3 / 4 / 5` + * + */ +export class BIP44CoinTypeNode implements BIP44CoinTypeNodeInterface { + /** + * Constructs a BIP-44 `coin_type` node. `coin_type` is the index + * specifying the protocol for which deeper keys are intended. For the + * authoritative list of coin types, please see + * [SLIP-44](https://github.com/satoshilabs/slips/blob/master/slip-0044.md). + * + * Recall that a BIP-44 HD tree path consists of the following nodes: + * + * `m / 44' / coin_type' / account' / change / address_index` + * + * With the following depths: + * + * `0 / 1 / 2 / 3 / 4 / 5` + * + * @param json - The {@link JsonBIP44Node} for the key of this node. + * @param coin_type - The coin_type index of this node. Must be a non-negative + * integer. + * @param cryptographicFunctions - The cryptographic functions to use. If + * provided, these will be used instead of the built-in implementations. + * @returns A BIP44CoinType node. + */ + static async fromJSON( + json: JsonBIP44Node, + coin_type: number, + cryptographicFunctions?: CryptographicFunctions, + ): Promise { + validateCoinType(coin_type); + validateCoinTypeNodeDepth(json.depth); + + const node = await BIP44Node.fromExtendedKey( + { + depth: json.depth, + index: json.index, + network: json.network, + parentFingerprint: json.parentFingerprint, + chainCode: hexStringToBytes(json.chainCode), + privateKey: nullableHexStringToBytes(json.privateKey), + publicKey: hexStringToBytes(json.publicKey), + }, + cryptographicFunctions, + ); + + return new BIP44CoinTypeNode(node, coin_type); + } + + /** + * Constructs a BIP-44 `coin_type` node. `coin_type` is the index + * specifying the protocol for which deeper keys are intended. For the + * authoritative list of coin types, please see + * [SLIP-44](https://github.com/satoshilabs/slips/blob/master/slip-0044.md). + * + * Recall that a BIP-44 HD tree path consists of the following nodes: + * + * `m / 44' / coin_type' / account' / change / address_index` + * + * With the following depths: + * + * `0 / 1 / 2 / 3 / 4 / 5` + * + * @param derivationPath - The derivation path for the key of this node. + * @param network - The network for the node. This is only used for extended + * keys, and defaults to `mainnet`. + * @param cryptographicFunctions - The cryptographic functions to use. If + * provided, these will be used instead of the built-in implementations. + * @returns A BIP44CoinType node. + */ + static async fromDerivationPath( + derivationPath: CoinTypeHDPathTuple, + network?: Network | undefined, + cryptographicFunctions?: CryptographicFunctions, + ): Promise { + validateCoinTypeNodeDepth(derivationPath.length - 1); + + const node = await BIP44Node.fromDerivationPath( + { + derivationPath, + network, + }, + cryptographicFunctions, + ); + + // Split the bip32 string token and extract the coin_type index. + const pathPart = derivationPath[BIP_44_COIN_TYPE_DEPTH].split( + ':', + )[1]?.replace(`'`, ''); + + assert(pathPart, 'Invalid derivation path.'); + const coinType = Number.parseInt(pathPart, 10); + + return new BIP44CoinTypeNode(node, coinType); + } + + /** + * Constructs a BIP-44 `coin_type` node. `coin_type` is the index + * specifying the protocol for which deeper keys are intended. For the + * authoritative list of coin types, please see + * [SLIP-44](https://github.com/satoshilabs/slips/blob/master/slip-0044.md). + * + * Recall that a BIP-44 HD tree path consists of the following nodes: + * + * `m / 44' / coin_type' / account' / change / address_index` + * + * With the following depths: + * + * `0 / 1 / 2 / 3 / 4 / 5` + * + * @param node - The {@link BIP44Node} for the key of this node. + * @param coin_type - The coin_type index of this node. Must be a non-negative + * integer. + * @returns A BIP44CoinType node. + */ + static async fromNode( + node: BIP44Node, + coin_type: number, + ): Promise { + if (!(node instanceof BIP44Node)) { + throw new Error('Invalid node: Expected an instance of BIP44Node.'); + } + + validateCoinType(coin_type); + validateCoinTypeNodeDepth(node.depth); + + // TODO: Make this function not async in a future version. + return Promise.resolve(new BIP44CoinTypeNode(node, coin_type)); + } + + readonly #node: BIP44Node; + + public readonly path: CoinTypeHDPathString; + + public readonly coin_type: number; + + // Constructors cannot use hash names. + // eslint-disable-next-line no-restricted-syntax + private constructor(node: BIP44Node, coin_type: number) { + this.#node = node; + this.coin_type = coin_type; + this.path = getBIP44CoinTypePathString(coin_type); + + Object.freeze(this); + } + + public get depth(): BIP44Depth { + return this.#node.depth; + } + + public get privateKeyBytes(): Uint8Array | undefined { + return this.#node.privateKeyBytes; + } + + public get publicKeyBytes(): Uint8Array { + return this.#node.publicKeyBytes; + } + + public get chainCodeBytes(): Uint8Array { + return this.#node.chainCodeBytes; + } + + public get privateKey(): string | undefined { + return this.#node.privateKey; + } + + public get publicKey(): string { + return this.#node.publicKey; + } + + public get compressedPublicKey(): string { + return this.#node.compressedPublicKey; + } + + public get compressedPublicKeyBytes(): Uint8Array { + return this.#node.compressedPublicKeyBytes; + } + + public get chainCode(): string { + return this.#node.chainCode; + } + + public get address(): string { + return this.#node.address; + } + + public get masterFingerprint(): number | undefined { + return this.#node.masterFingerprint; + } + + public get parentFingerprint(): number { + return this.#node.parentFingerprint; + } + + public get fingerprint(): number { + return this.#node.fingerprint; + } + + public get index(): number { + return this.#node.index; + } + + public get network(): Network { + return this.#node.network; + } + + public get curve(): SupportedCurve { + return this.#node.curve; + } + + public get extendedKey(): string { + return this.#node.extendedKey; + } + + /** + * Derives a BIP-44 `address_index` key corresponding to the path of this + * node and the specified `account`, `change`, and `address_index` values. + * `address_index` keys are normally the keys used to generate user account + * addresses. + * + * Recall that a BIP-44 HD tree path consists of the following nodes: + * + * `m / 44' / coin_type' / account' / change / address_index` + * + * With the following depths: + * + * `0 / 1 / 2 / 3 / 4 / 5` + * + * @param indices - The BIP-44 index values to use in key derivation. + * @param indices.account - The `account` index. Default: `0` + * @param indices.change - The `change` index. Default: `0` + * @param indices.address_index - The `address_index` index. + * @returns The derived BIP-44 `address_index` node. + */ + async deriveBIP44AddressKey({ + account = 0, + change = 0, + address_index, + }: CoinTypeToAddressIndices): Promise { + return await this.#node.derive( + getBIP44CoinTypeToAddressPathTuple({ account, change, address_index }), + ); + } + + toJSON(): JsonBIP44CoinTypeNode { + return { + ...this.#node.toJSON(), + coin_type: this.coin_type, + path: this.path, + }; + } +} + +/** + * Validates the depth of a `coin_type` node. Simply, ensures that it is the + * number `2`. An error is thrown if validation fails. + * + * @param depth - The depth to validate. + */ +function validateCoinTypeNodeDepth(depth: number): void { + if (depth !== BIP_44_COIN_TYPE_DEPTH) { + throw new Error( + `Invalid depth: Coin type nodes must be of depth ${BIP_44_COIN_TYPE_DEPTH}. Received: "${depth}"`, + ); + } +} + +/** + * Validates that the coin type is a non-negative integer number. An error is + * thrown if validation fails. + * + * @param coin_type - The coin type to validate. + */ +function validateCoinType(coin_type: unknown): asserts coin_type is number { + if ( + typeof coin_type !== 'number' || + !Number.isInteger(coin_type) || + coin_type < 0 + ) { + throw new Error( + 'Invalid coin type: The specified coin type must be a non-negative integer number.', + ); + } +} + +/** + * Derives a BIP-44 address key corresponding to the specified derivation path, + * given either by a {@link BIP44CoinTypeNode} or derivation path tuple. + * + * Recall that a BIP-44 HD tree path consists of the following nodes: + * + * `m / 44' / coin_type' / account' / change / address_index` + * + * With the following depths: + * + * `0 / 1 / 2 / 3 / 4 / 5` + * + * @param parentKeyOrNode - The `coin_type` parent key to derive from. + * @param indices - The BIP-44 index values to use in key derivation. + * @param indices.account - The `account` index. Default: `0`. + * @param indices.change - The `change` index. Default: `0`. + * @param indices.address_index - The `address_index` index. + * @param cryptographicFunctions - The cryptographic functions to use. If + * provided, these will be used instead of the built-in implementations. + * @returns The derived `address_index` key for the specified derivation path. + */ +export async function deriveBIP44AddressKey( + parentKeyOrNode: BIP44CoinTypeNode | JsonBIP44CoinTypeNode | string, + { account = 0, change = 0, address_index }: CoinTypeToAddressIndices, + cryptographicFunctions?: CryptographicFunctions, +): Promise { + const path = getBIP44CoinTypeToAddressPathTuple({ + account, + change, + address_index, + }); + + const node = await getNode(parentKeyOrNode, cryptographicFunctions); + const childNode = await deriveChildNode( + { + path, + node, + }, + cryptographicFunctions, + ); + + return new BIP44Node(childNode); +} + +export type BIP44AddressKeyDeriver = { + /** + * @param address_index - The `address_index` value. + * @param isHardened - Whether the derived index is hardened. + * @returns The key corresponding to the path of this deriver and the + * specified `address_index` value. + */ + (address_index: number, isHardened?: boolean): Promise; + + /** + * A human-readable representation of the derivation path of this deriver + * function, excluding the `address_index`, which is parameterized. + * + * Recall that a BIP-44 HD tree path consists of the following nodes: + * + * `m / 44' / coin_type' / account' / change / address_index` + * + * With the following depths: + * + * `0 / 1 / 2 / 3 / 4 / 5` + */ + path: ReturnType; + + /** + * The `coin_type` index of addresses derived by this deriver function. + */ + coin_type: number; +}; + +/** + * Creates a function that derives BIP-44 address keys corresponding to the + * specified derivation path, given either by a {@link BIP44CoinTypeNode} or + * derivation path tuple. + * + * Recall that a BIP-44 HD tree path consists of the following nodes: + * + * `m / 44' / coin_type' / account' / change / address_index` + * + * With the following depths: + * + * `0 / 1 / 2 / 3 / 4 / 5` + * + * @param node - The {@link BIP44CoinTypeNode} to derive address keys from. + * This node contains a BIP-44 key of depth 2, `coin_type`. + * @param accountAndChangeIndices - The `account` and `change` indices that + * will be used to derive addresses. + * @param cryptographicFunctions - The cryptographic functions to use. If + * provided, these will be used instead of the built-in implementations. + * @returns The deriver function for the derivation path specified by the + * `coin_type` node, `account`, and `change` indices. + */ +export async function getBIP44AddressKeyDeriver( + node: BIP44CoinTypeNode | JsonBIP44CoinTypeNode | string, + accountAndChangeIndices?: Omit, + cryptographicFunctions?: CryptographicFunctions, +): Promise { + const { account = 0, change = 0 } = accountAndChangeIndices ?? {}; + + const actualNode = await getNode(node, cryptographicFunctions); + + const accountNode = getHardenedBIP32NodeToken(account); + const changeNode = getBIP32NodeToken(change); + + const bip44AddressKeyDeriver: BIP44AddressKeyDeriver = async ( + address_index: number, + isHardened = false, + ): Promise => { + const slip10Node = await deriveChildNode( + { + path: [ + accountNode, + changeNode, + isHardened + ? getHardenedBIP32NodeToken(address_index) + : getUnhardenedBIP32NodeToken(address_index), + ], + node: actualNode, + }, + cryptographicFunctions, + ); + + return new BIP44Node(slip10Node); + }; + + bip44AddressKeyDeriver.coin_type = actualNode.coin_type; + bip44AddressKeyDeriver.path = getBIP44ChangePathString(actualNode.path, { + account, + change, + }); + + Object.freeze(bip44AddressKeyDeriver); + + return bip44AddressKeyDeriver; +} + +/** + * Get a BIP-44 coin type node from a JSON node or extended key string. If an existing coin type + * node is provided, the same node is returned. + * + * The depth of the node is validated to be a valid coin type node. + * + * @param node - A BIP-44 coin type node, JSON node or extended key. + * @param cryptographicFunctions - The cryptographic functions to use. If + * provided, these will be used instead of the built-in implementations. This is + * only used if the node is an extended key string or JSON object. + * @returns A BIP44CoinType node. + */ +async function getNode( + node: BIP44CoinTypeNode | JsonBIP44CoinTypeNode | string, + cryptographicFunctions?: CryptographicFunctions, +): Promise { + if (node instanceof BIP44CoinTypeNode) { + validateCoinTypeNodeDepth(node.depth); + + return node; + } + + if (typeof node === 'string') { + const bip44Node = await BIP44Node.fromExtendedKey( + node, + cryptographicFunctions, + ); + const coinTypeNode = await BIP44CoinTypeNode.fromNode( + bip44Node, + bip44Node.index - BIP_32_HARDENED_OFFSET, + ); + + validateCoinTypeNodeDepth(coinTypeNode.depth); + + return coinTypeNode; + } + + return BIP44CoinTypeNode.fromJSON( + node, + node.coin_type, + cryptographicFunctions, + ); +} diff --git a/rc-v10.0.1/media/BIP44Node.ts b/rc-v10.0.1/media/BIP44Node.ts new file mode 100644 index 00000000..4cd6f506 --- /dev/null +++ b/rc-v10.0.1/media/BIP44Node.ts @@ -0,0 +1,499 @@ +import { assert } from '@metamask/utils'; + +import type { + BIP44Depth, + Network, + PartialHDPathTuple, + RootedSLIP10PathTuple, + SLIP10Path, +} from './constants'; +import { + BIP44PurposeNodeToken, + BIP_32_PATH_REGEX, + BIP_39_PATH_REGEX, + MAX_BIP_44_DEPTH, + MIN_BIP_44_DEPTH, +} from './constants'; +import type { CryptographicFunctions } from './cryptography'; +import type { SupportedCurve } from './curves'; +import { decodeExtendedKey } from './extended-keys'; +import { SLIP10Node, validateBIP32Depth } from './SLIP10Node'; +import { isHardened } from './utils'; + +export type BIP44ExtendedKeyOptions = { + readonly depth: number; + readonly parentFingerprint: number; + readonly index: number; + readonly network?: Network | undefined; + readonly chainCode: Uint8Array | string; + readonly privateKey?: Uint8Array | string | undefined; + readonly publicKey?: Uint8Array | string | undefined; +}; + +export type BIP44DerivationPathOptions = { + readonly derivationPath: RootedSLIP10PathTuple; + readonly network?: Network | undefined; +}; + +/** + * A wrapper for BIP-44 Hierarchical Deterministic (HD) tree nodes, i.e. + * cryptographic keys used to generate keypairs and addresses for cryptocurrency + * protocols. + */ +export type JsonBIP44Node = { + /** + * The 0-indexed BIP-44 path depth of this node. + * + * A BIP-44 path is of the form: + * + * `m / 44' / coin_type' / account' / change / address_index` + * + * With the following depths: + * + * `0 / 1 / 2 / 3 / 4 / 5` + */ + readonly depth: BIP44Depth; + + /** + * The fingerprint of the master node, i.e., the node at depth 0. May be + * undefined if this node was created from an extended key. + */ + readonly masterFingerprint?: number | undefined; + + /** + * The fingerprint of the parent key, or 0 if this is a master node. + */ + readonly parentFingerprint: number; + + /** + * The index of the node, or 0 if this is a master node. + */ + readonly index: number; + + /** + * The network for the node. This is only used for extended keys, and defaults + * to `mainnet`. + */ + readonly network?: Network | undefined; + + /** + * The hexadecimal string representation of the private key for this node. + * May be `undefined` if the node is a public node. + */ + readonly privateKey?: string | undefined; + + /** + * The hexadecimal string representation of the public key for this node. + */ + readonly publicKey: string; + + /** + * The hexadecimal string representation of the chain code for this node. + */ + readonly chainCode: string; +}; + +export type BIP44NodeInterface = JsonBIP44Node & { + /** + * @returns A JSON-compatible representation of this node's data fields. + */ + toJSON(): JsonBIP44Node; +}; + +/** + * A wrapper for BIP-44 Hierarchical Deterministic (HD) tree nodes, i.e. + * cryptographic keys used to generate keypairs and addresses for cryptocurrency + * protocols. + * + * This class contains methods and fields that may not serialize well. Use + * {@link BIP44Node.toJSON} to get a JSON-compatible representation. + */ +export class BIP44Node implements BIP44NodeInterface { + /** + * Wrapper of the {@link fromExtendedKey} function. Refer to that function + * for documentation. + * + * @param json - The JSON representation of a SLIP-10 node. + * @param cryptographicFunctions - The cryptographic functions to use. If + * provided, these will be used instead of the built-in implementations. + * @returns A BIP44 node. + */ + static async fromJSON( + json: JsonBIP44Node, + cryptographicFunctions?: CryptographicFunctions, + ): Promise { + return BIP44Node.fromExtendedKey(json, cryptographicFunctions); + } + + /** + * Create a new BIP-44 node from a key and chain code. You must specify + * either a private key or a public key. When specifying a private key, + * the public key will be derived from the private key. + * + * All parameters are stringently validated, and an error is thrown if + * validation fails. + * + * @param options - An object containing the extended key, or an extended + * public (xpub) or private (xprv) key. + * @param options.depth - The depth of the node. + * @param options.network - The network for the node. This is only used for + * extended keys, and defaults to `mainnet`. + * @param options.privateKey - The private key for the node. + * @param options.publicKey - The public key for the node. If a private key is + * specified, this parameter is ignored. + * @param options.chainCode - The chain code for the node. + * @param cryptographicFunctions - The cryptographic functions to use. If + * provided, these will be used instead of the built-in implementations. + * @returns A BIP44 node. + */ + static async fromExtendedKey( + options: BIP44ExtendedKeyOptions | string, + cryptographicFunctions?: CryptographicFunctions, + ): Promise { + if (typeof options === 'string') { + const extendedKey = decodeExtendedKey(options); + + const { type, chainCode, depth, parentFingerprint, index, network } = + extendedKey; + + if (type === 'private') { + const { privateKey } = extendedKey; + + return BIP44Node.fromExtendedKey( + { + depth, + parentFingerprint, + index, + network, + privateKey, + chainCode, + }, + cryptographicFunctions, + ); + } + + const { publicKey } = extendedKey; + + return BIP44Node.fromExtendedKey( + { + depth, + parentFingerprint, + index, + network, + publicKey, + chainCode, + }, + cryptographicFunctions, + ); + } + + const { + privateKey, + publicKey, + chainCode, + depth, + parentFingerprint, + index, + network, + } = options; + + validateBIP44Depth(depth); + + const node = await SLIP10Node.fromExtendedKey( + { + privateKey, + publicKey, + chainCode, + depth, + parentFingerprint, + index, + network, + curve: 'secp256k1', + }, + cryptographicFunctions, + ); + + return new BIP44Node(node); + } + + /** + * Create a new BIP-44 node from a derivation path. The derivation path + * must be rooted, i.e. it must begin with a BIP-39 node, given as a string of + * the form `bip39:MNEMONIC`, where `MNEMONIC` is a space-separated list of + * BIP-39 seed phrase words. + * + * All parameters are stringently validated, and an error is thrown if + * validation fails. + * + * Recall that a BIP-44 HD tree path consists of the following nodes: + * + * `m / 44' / coin_type' / account' / change / address_index` + * + * With the following depths: + * + * `0 / 1 / 2 / 3 / 4 / 5` + * + * @param options - An object containing the derivation path. + * @param options.derivationPath - The rooted HD tree path that will be used + * to derive the key of this node. + * @param options.network - The network for the node. This is only used for + * extended keys, and defaults to `mainnet`. + * @param cryptographicFunctions - The cryptographic functions to use. If + * provided, these will be used instead of the built-in implementations. + * @returns A BIP44 node. + */ + static async fromDerivationPath( + { derivationPath, network }: BIP44DerivationPathOptions, + cryptographicFunctions?: CryptographicFunctions, + ): Promise { + validateBIP44Depth(derivationPath.length - 1); + validateBIP44DerivationPath(derivationPath, MIN_BIP_44_DEPTH); + + const node = await SLIP10Node.fromDerivationPath( + { + derivationPath, + network, + curve: 'secp256k1', + }, + cryptographicFunctions, + ); + + return new BIP44Node(node); + } + + readonly #node: SLIP10Node; + + public get depth(): BIP44Depth { + return this.#node.depth as BIP44Depth; + } + + public get privateKeyBytes(): Uint8Array | undefined { + return this.#node.privateKeyBytes; + } + + public get publicKeyBytes(): Uint8Array { + return this.#node.publicKeyBytes; + } + + public get chainCodeBytes(): Uint8Array { + return this.#node.chainCodeBytes; + } + + public get privateKey(): string | undefined { + return this.#node.privateKey; + } + + public get publicKey(): string { + return this.#node.publicKey; + } + + public get compressedPublicKey(): string { + return this.#node.compressedPublicKey; + } + + public get compressedPublicKeyBytes(): Uint8Array { + return this.#node.compressedPublicKeyBytes; + } + + public get chainCode(): string { + return this.#node.chainCode; + } + + public get address(): string { + return this.#node.address; + } + + public get masterFingerprint(): number | undefined { + return this.#node.masterFingerprint; + } + + public get parentFingerprint(): number { + return this.#node.parentFingerprint; + } + + public get fingerprint(): number { + return this.#node.fingerprint; + } + + public get index(): number { + return this.#node.index; + } + + public get network(): Network { + return this.#node.network; + } + + public get extendedKey(): string { + return this.#node.extendedKey; + } + + public get curve(): SupportedCurve { + return this.#node.curve; + } + + constructor(node: SLIP10Node) { + this.#node = node; + + Object.freeze(this); + } + + /** + * Get a neutered version of this node, i.e. a node without a private key. + * + * @returns A neutered version of this node. + */ + public neuter(): BIP44Node { + const node = this.#node.neuter(); + return new BIP44Node(node); + } + + /** + * Derives a child of the key contains be this node and returns a new + * {@link BIP44Node} containing the child key. + * + * The specified path must be a valid HD path from this node, per BIP-44. + * At present, this means that the path must consist of no more than 5 BIP-32 + * nodes, depending on the depth of this node. + * + * Recall that a BIP-44 HD tree path consists of the following nodes: + * + * `m / 44' / coin_type' / account' / change / address_index` + * + * With the following depths: + * + * `0 / 1 / 2 / 3 / 4 / 5` + * + * @param path - The partial (non-rooted) BIP-44 HD tree path will be used + * to derive a child key from the parent key contained within this node. + * @returns The {@link BIP44Node} corresponding to the derived child key. + */ + public async derive(path: PartialHDPathTuple): Promise { + if (this.depth === MAX_BIP_44_DEPTH) { + throw new Error( + 'Illegal operation: This HD tree node is already a leaf node.', + ); + } + + const newDepth = this.depth + path.length; + + validateBIP44Depth(newDepth); + validateBIP44DerivationPath(path, (this.depth + 1) as BIP44Depth); + + const node = await this.#node.derive(path); + return new BIP44Node(node); + } + + // This is documented in the interface of this class. + public toJSON(): JsonBIP44Node { + return { + depth: this.depth, + masterFingerprint: this.masterFingerprint, + parentFingerprint: this.parentFingerprint, + index: this.index, + network: this.network, + privateKey: this.privateKey, + publicKey: this.publicKey, + chainCode: this.chainCode, + }; + } +} + +/** + * Validates a BIP-44 path depth. Effectively, asserts that the depth is an + * integer `number` N such that 0 <= N <= 5. Throws an error if validation + * fails. + * + * @param depth - The depth to validate. + */ +export function validateBIP44Depth( + depth: unknown, +): asserts depth is BIP44Depth { + validateBIP32Depth(depth); + + if (depth < MIN_BIP_44_DEPTH || depth > MAX_BIP_44_DEPTH) { + throw new Error( + `Invalid HD tree path depth: The depth must be a positive integer N such that 0 <= N <= 5. Received: "${depth}"`, + ); + } +} + +/** + * Ensures that the given derivation is valid by BIP-44. + * + * Recall that a BIP-44 HD tree path consists of the following nodes: + * + * `m / 44' / coin_type' / account' / change / address_index` + * + * With the following depths: + * + * `0 / 1 / 2 / 3 / 4 / 5` + * + * @param path - The path to validate. + * @param startingDepth - The depth of the first node of the derivation path. + */ +function validateBIP44DerivationPath( + path: SLIP10Path, + startingDepth: BIP44Depth, +): void { + path.forEach((nodeToken, index) => { + const currentDepth = startingDepth + index; + + if (currentDepth === MIN_BIP_44_DEPTH) { + if ( + !(nodeToken instanceof Uint8Array) && + !BIP_39_PATH_REGEX.test(nodeToken) + ) { + throw new Error( + 'Invalid derivation path: The "m" / seed node (depth 0) must be a BIP-39 node.', + ); + } + + return; + } + + assert(typeof nodeToken === 'string'); + + // eslint-disable-next-line default-case + switch (currentDepth) { + case 1: + if (nodeToken !== BIP44PurposeNodeToken) { + throw new Error( + `Invalid derivation path: The "purpose" node (depth 1) must be the string "${BIP44PurposeNodeToken}".`, + ); + } + break; + + case 2: + if (!BIP_32_PATH_REGEX.test(nodeToken) || !isHardened(nodeToken)) { + throw new Error( + 'Invalid derivation path: The "coin_type" node (depth 2) must be a hardened BIP-32 node.', + ); + } + break; + + case 3: + if (!BIP_32_PATH_REGEX.test(nodeToken) || !isHardened(nodeToken)) { + throw new Error( + 'Invalid derivation path: The "account" node (depth 3) must be a hardened BIP-32 node.', + ); + } + break; + + case 4: + if (!BIP_32_PATH_REGEX.test(nodeToken)) { + throw new Error( + 'Invalid derivation path: The "change" node (depth 4) must be a BIP-32 node.', + ); + } + break; + + case MAX_BIP_44_DEPTH: // 5 + if (!BIP_32_PATH_REGEX.test(nodeToken)) { + throw new Error( + 'Invalid derivation path: The "address_index" node (depth 5) must be a BIP-32 node.', + ); + } + break; + } + }); +} diff --git a/rc-v10.0.1/media/SLIP10Node.ts b/rc-v10.0.1/media/SLIP10Node.ts new file mode 100644 index 00000000..3357fd7e --- /dev/null +++ b/rc-v10.0.1/media/SLIP10Node.ts @@ -0,0 +1,733 @@ +import { assert, bytesToHex } from '@metamask/utils'; + +import type { BIP44CoinTypeNode } from './BIP44CoinTypeNode'; +import type { BIP44Node } from './BIP44Node'; +import type { + Network, + RootedSLIP10PathTuple, + SLIP10PathTuple, +} from './constants'; +import { BYTES_KEY_LENGTH } from './constants'; +import type { CryptographicFunctions } from './cryptography'; +import type { SupportedCurve } from './curves'; +import { getCurveByName } from './curves'; +import { deriveKeyFromPath } from './derivation'; +import { publicKeyToEthAddress } from './derivers/bip32'; +import { decodeExtendedKey, encodeExtendedKey } from './extended-keys'; +import { + getBytes, + getBytesUnsafe, + getFingerprint, + isValidInteger, + validateBIP32Index, + validateCurve, + validateNetwork, +} from './utils'; + +/** + * A wrapper for SLIP-10 Hierarchical Deterministic (HD) tree nodes, i.e. + * cryptographic keys used to generate key pairs and addresses for cryptocurrency + * protocols. + */ +export type JsonSLIP10Node = { + /** + * The 0-indexed path depth of this node. + */ + readonly depth: number; + + /** + * The fingerprint of the master node, i.e., the node at depth 0. May be + * undefined if this node was created from an extended key. + */ + readonly masterFingerprint?: number | undefined; + + /** + * The fingerprint of the parent key, or 0 if this is a master node. + */ + readonly parentFingerprint: number; + + /** + * The index of the node, or 0 if this is a master node. + */ + readonly index: number; + + /** + * The network for the node. This is only used for extended keys, and defaults + * to `mainnet`. + */ + readonly network?: Network | undefined; + + /** + * The (optional) private key of this node. + */ + readonly privateKey?: string | undefined; + + /** + * The public key of this node. + */ + readonly publicKey: string; + + /** + * The chain code of this node. + */ + readonly chainCode: string; + + /** + * The name of the curve used by the node. + */ + readonly curve: SupportedCurve; +}; + +export type SLIP10NodeInterface = JsonSLIP10Node & { + chainCodeBytes: Uint8Array; + + /** + * The private key for this node, as a {@link Uint8Array}. + * May be undefined if this node is a public key only node. + */ + privateKeyBytes?: Uint8Array | undefined; + + /** + * The public key for this node, as a {@link Uint8Array}. + */ + publicKeyBytes: Uint8Array; + + /** + * @returns A JSON-compatible representation of this node's data fields. + */ + toJSON(): JsonSLIP10Node; +}; + +export type SLIP10NodeConstructorOptions = { + readonly depth: number; + readonly masterFingerprint?: number | undefined; + readonly parentFingerprint: number; + readonly index: number; + readonly network?: Network | undefined; + readonly chainCode: Uint8Array; + readonly privateKey?: Uint8Array | undefined; + readonly publicKey: Uint8Array; + readonly curve: SupportedCurve; +}; + +export type SLIP10ExtendedKeyOptions = { + readonly depth: number; + readonly masterFingerprint?: number | undefined; + readonly parentFingerprint: number; + readonly index: number; + readonly network?: Network | undefined; + readonly chainCode: string | Uint8Array; + readonly privateKey?: string | Uint8Array | undefined; + readonly publicKey?: string | Uint8Array | undefined; + readonly curve: SupportedCurve; +}; + +export type SLIP10DerivationPathOptions = { + readonly derivationPath: RootedSLIP10PathTuple; + readonly network?: Network | undefined; + readonly curve: SupportedCurve; +}; + +export class SLIP10Node implements SLIP10NodeInterface { + /** + * Wrapper of the {@link fromExtendedKey} function. Refer to that function + * for documentation. + * + * @param json - The JSON representation of a SLIP-10 node. + * @param cryptographicFunctions - The cryptographic functions to use. If + * provided, these will be used instead of the built-in implementations. + * @returns A SLIP10 node. + */ + static async fromJSON( + json: JsonSLIP10Node, + cryptographicFunctions?: CryptographicFunctions, + ): Promise { + return SLIP10Node.fromExtendedKey(json, cryptographicFunctions); + } + + /** + * Create a new SLIP-10 node from a BIP-32 serialised extended key string. + * The key may be either public or private. Note that `secp256k1` is assumed + * as the curve for the key. + * + * All parameters are stringently validated, and an error is thrown if + * validation fails. + * + * @param extendedKey - The BIP-32 extended key string. + * @param cryptographicFunctions - The cryptographic functions to use. If + * provided, these will be used instead of the built-in implementations. + * @returns A SLIP10 node. + */ + static async fromExtendedKey( + extendedKey: string, + cryptographicFunctions?: CryptographicFunctions, + ): Promise; + + /** + * Create a new SLIP-10 node from a key and chain code. You must specify + * either a private key or a public key. When specifying a private key, + * the public key will be derived from the private key. + * + * All parameters are stringently validated, and an error is thrown if + * validation fails. + * + * @param options - The options for the new node. + * @param options.depth - The depth of the node. + * @param options.masterFingerprint - The fingerprint of the master node, i.e., the + * node at depth 0. May be undefined if this node was created from an extended + * key. + * @param options.parentFingerprint - The fingerprint of the parent key, or 0 if + * the node is a master node. + * @param options.index - The index of the node, or 0 if the node is a master node. + * @param options.privateKey - The private key for the node. + * @param options.publicKey - The public key for the node. If a private key is + * specified, this parameter is ignored. + * @param options.chainCode - The chain code for the node. + * @param options.curve - The curve used by the node. + * @param cryptographicFunctions - The cryptographic functions to use. If + * provided, these will be used instead of the built-in implementations. + * @returns A SLIP10 node. + */ + static async fromExtendedKey( + // These signatures could technically be combined, but it's easier to + // document them separately. + // eslint-disable-next-line @typescript-eslint/unified-signatures + options: SLIP10ExtendedKeyOptions, + cryptographicFunctions?: CryptographicFunctions, + ): Promise; + + /** + * Create a new SLIP-10 node from a key and chain code. You must specify + * either a private key or a public key. When specifying a private key, + * the public key will be derived from the private key. + * + * All parameters are stringently validated, and an error is thrown if + * validation fails. + * + * @param options - The options for the new node. This can be an object + * containing the extended key options, or a string containing the extended + * key. + * @param options.depth - The depth of the node. + * @param options.masterFingerprint - The fingerprint of the master node, i.e., the + * node at depth 0. May be undefined if this node was created from an extended + * key. + * @param options.parentFingerprint - The fingerprint of the parent key, or 0 if + * the node is a master node. + * @param options.index - The index of the node, or 0 if the node is a master node. + * @param options.privateKey - The private key for the node. + * @param options.publicKey - The public key for the node. If a private key is + * specified, this parameter is ignored. + * @param options.chainCode - The chain code for the node. + * @param options.curve - The curve used by the node. + * @param cryptographicFunctions - The cryptographic functions to use. If + * provided, these will be used instead of the built-in implementations. + * @returns A SLIP10 node. + */ + static async fromExtendedKey( + options: SLIP10ExtendedKeyOptions | string, + cryptographicFunctions?: CryptographicFunctions, + ): Promise { + if (typeof options === 'string') { + const extendedKey = decodeExtendedKey(options); + + const { chainCode, depth, parentFingerprint, index } = extendedKey; + + if (extendedKey.type === 'private') { + const { privateKey } = extendedKey; + + return SLIP10Node.fromExtendedKey( + { + depth, + parentFingerprint, + index, + privateKey, + chainCode, + // BIP-32 key serialisation assumes `secp256k1`. + curve: 'secp256k1', + }, + cryptographicFunctions, + ); + } + + const { publicKey } = extendedKey; + + return SLIP10Node.fromExtendedKey( + { + depth, + parentFingerprint, + index, + publicKey, + chainCode, + // BIP-32 key serialisation assumes `secp256k1`. + curve: 'secp256k1', + }, + cryptographicFunctions, + ); + } + + const { + depth, + masterFingerprint, + parentFingerprint, + index, + network, + privateKey, + publicKey, + chainCode, + curve, + } = options; + + const chainCodeBytes = getBytes(chainCode, BYTES_KEY_LENGTH); + + validateCurve(curve); + validateBIP32Depth(depth); + validateBIP32Index(index); + validateRootIndex(index, depth); + validateNetwork(network); + validateParentFingerprint(parentFingerprint, depth); + validateMasterParentFingerprint( + masterFingerprint, + parentFingerprint, + depth, + ); + + const curveObject = getCurveByName(curve); + + if (privateKey) { + const privateKeyBytes = getBytesUnsafe( + privateKey, + curveObject.privateKeyLength, + ); + assert( + curveObject.isValidPrivateKey(privateKeyBytes), + `Invalid private key: Value is not a valid ${curve} private key.`, + ); + + return new SLIP10Node( + { + depth, + masterFingerprint, + parentFingerprint, + index, + network, + chainCode: chainCodeBytes, + privateKey: privateKeyBytes, + publicKey: await curveObject.getPublicKey(privateKeyBytes), + curve, + }, + cryptographicFunctions, + this.#constructorGuard, + ); + } + + if (publicKey) { + const publicKeyBytes = getBytes(publicKey, curveObject.publicKeyLength); + + return new SLIP10Node( + { + depth, + masterFingerprint, + parentFingerprint, + index, + network, + chainCode: chainCodeBytes, + publicKey: publicKeyBytes, + curve, + }, + cryptographicFunctions, + this.#constructorGuard, + ); + } + + throw new Error( + 'Invalid options: Must provide either a private key or a public key.', + ); + } + + /** + * Create a new SLIP-10 node from a derivation path. The derivation path + * must be rooted, i.e. it must begin with a BIP-39 node, given as a string of + * the form `bip39:MNEMONIC`, where `MNEMONIC` is a space-separated list of + * BIP-39 seed phrase words. + * + * All parameters are stringently validated, and an error is thrown if + * validation fails. + * + * Recall that a BIP-44 HD tree path consists of the following nodes: + * + * `m / 44' / coin_type' / account' / change / address_index` + * + * With the following depths: + * + * `0 / 1 / 2 / 3 / 4 / 5` + * + * @param options - The options for the new node. + * @param options.derivationPath - The rooted HD tree path that will be used + * to derive the key of this node. + * @param options.curve - The curve used by the node. + * @param options.network - The network for the node. This is only used for + * extended keys, and defaults to `mainnet`. + * @param cryptographicFunctions - The cryptographic functions to use. If + * provided, these will be used instead of the built-in implementations. + * @returns A new SLIP-10 node. + */ + static async fromDerivationPath( + { derivationPath, network, curve }: SLIP10DerivationPathOptions, + cryptographicFunctions?: CryptographicFunctions, + ): Promise { + validateCurve(curve); + + if (!derivationPath) { + throw new Error('Invalid options: Must provide a derivation path.'); + } + + if (derivationPath.length === 0) { + throw new Error( + 'Invalid derivation path: May not specify an empty derivation path.', + ); + } + + return await deriveKeyFromPath( + { + path: derivationPath, + depth: derivationPath.length - 1, + network, + curve, + }, + cryptographicFunctions, + ); + } + + static readonly #constructorGuard = Symbol('SLIP10Node.constructor'); + + public readonly curve: SupportedCurve; + + public readonly depth: number; + + public readonly masterFingerprint?: number | undefined; + + public readonly parentFingerprint: number; + + public readonly index: number; + + public readonly network: Network; + + public readonly chainCodeBytes: Uint8Array; + + public readonly privateKeyBytes?: Uint8Array | undefined; + + public readonly publicKeyBytes: Uint8Array; + + readonly #cryptographicFunctions: CryptographicFunctions; + + // eslint-disable-next-line no-restricted-syntax + private constructor( + { + depth, + masterFingerprint, + parentFingerprint, + index, + network = 'mainnet', + chainCode, + privateKey, + publicKey, + curve, + }: SLIP10NodeConstructorOptions, + cryptographicFunctions: CryptographicFunctions = {}, + constructorGuard?: symbol, + ) { + assert( + constructorGuard === SLIP10Node.#constructorGuard, + 'SLIP10Node can only be constructed using `SLIP10Node.fromJSON`, `SLIP10Node.fromExtendedKey`, or `SLIP10Node.fromDerivationPath`.', + ); + + this.depth = depth; + this.masterFingerprint = masterFingerprint; + this.parentFingerprint = parentFingerprint; + this.index = index; + this.network = network; + this.chainCodeBytes = chainCode; + this.privateKeyBytes = privateKey; + this.publicKeyBytes = publicKey; + this.curve = curve; + this.#cryptographicFunctions = cryptographicFunctions; + + Object.freeze(this); + } + + public get chainCode(): string { + return bytesToHex(this.chainCodeBytes); + } + + public get privateKey(): string | undefined { + if (this.privateKeyBytes) { + return bytesToHex(this.privateKeyBytes); + } + + return undefined; + } + + public get publicKey(): string { + return bytesToHex(this.publicKeyBytes); + } + + public get compressedPublicKeyBytes(): Uint8Array { + return getCurveByName(this.curve).compressPublicKey(this.publicKeyBytes); + } + + public get compressedPublicKey(): string { + return bytesToHex(this.compressedPublicKeyBytes); + } + + public get address(): string { + if (this.curve !== 'secp256k1') { + throw new Error( + 'Unable to get address for this node: Only secp256k1 is supported.', + ); + } + + return bytesToHex(publicKeyToEthAddress(this.publicKeyBytes)); + } + + public get fingerprint(): number { + return getFingerprint( + this.compressedPublicKeyBytes, + getCurveByName(this.curve).compressedPublicKeyLength, + ); + } + + /** + * Get the extended public or private key for the SLIP-10 node. SLIP-10 + * doesn't specify a format for extended keys, so we use the BIP-32 format. + * + * This property is only supported for `secp256k1` nodes, as other curves + * don't specify a standard format for extended keys. + * + * @returns The extended public or private key for the node. + */ + public get extendedKey(): string { + assert( + this.curve === 'secp256k1', + 'Unable to get extended key for this node: Only secp256k1 is supported.', + ); + + const data = { + depth: this.depth, + parentFingerprint: this.parentFingerprint, + index: this.index, + network: this.network, + chainCode: this.chainCodeBytes, + }; + + if (this.privateKeyBytes) { + return encodeExtendedKey({ + ...data, + type: 'private', + privateKey: this.privateKeyBytes, + }); + } + + return encodeExtendedKey({ + ...data, + type: 'public', + publicKey: this.publicKeyBytes, + }); + } + + /** + * Get a neutered version of this node, i.e. a node without a private key. + * + * @returns A neutered version of this node. + */ + public neuter(): SLIP10Node { + return new SLIP10Node( + { + depth: this.depth, + masterFingerprint: this.masterFingerprint, + parentFingerprint: this.parentFingerprint, + index: this.index, + chainCode: this.chainCodeBytes, + publicKey: this.publicKeyBytes, + curve: this.curve, + network: this.network, + }, + this.#cryptographicFunctions, + SLIP10Node.#constructorGuard, + ); + } + + /** + * Derives a child of the key contains be this node and returns a new + * {@link SLIP10Node} containing the child key. + * + * The specified path must be a valid HD path from this node, per SLIP-10. + * + * @param path - The partial (non-rooted) SLIP-10 HD tree path will be used + * to derive a child key from the parent key contained within this node. + * @returns The {@link SLIP10Node} corresponding to the derived child key. + */ + public async derive(path: SLIP10PathTuple): Promise { + return await deriveChildNode( + { + path, + node: this, + }, + this.#cryptographicFunctions, + ); + } + + // This is documented in the interface of this class. + public toJSON(): JsonSLIP10Node { + return { + depth: this.depth, + masterFingerprint: this.masterFingerprint, + parentFingerprint: this.parentFingerprint, + index: this.index, + network: this.network, + curve: this.curve, + privateKey: this.privateKey, + publicKey: this.publicKey, + chainCode: this.chainCode, + }; + } +} + +/** + * Validates a BIP-32 path depth. Effectively, asserts that the depth is an + * integer `number`. Throws an error if validation fails. + * + * @param depth - The depth to validate. + */ +export function validateBIP32Depth(depth: unknown): asserts depth is number { + if (!isValidInteger(depth)) { + throw new Error( + `Invalid HD tree path depth: The depth must be a positive integer. Received: "${String( + depth, + )}".`, + ); + } +} + +/** + * Validates a BIP-32 parent fingerprint. Effectively, asserts that the fingerprint is an + * integer `number`. Throws an error if validation fails. + * + * @param parentFingerprint - The parent fingerprint to validate. + * @param depth - The depth of the node to validate. + * @throws If the parent fingerprint is not a positive integer, or invalid for + * the current depth. + */ +export function validateParentFingerprint( + parentFingerprint: unknown, + depth: number, +): asserts parentFingerprint is number { + if (!isValidInteger(parentFingerprint)) { + throw new Error( + `Invalid parent fingerprint: The fingerprint must be a positive integer. Received: "${String( + parentFingerprint, + )}".`, + ); + } + + if (depth === 0 && parentFingerprint !== 0) { + throw new Error( + `Invalid parent fingerprint: The fingerprint of the root node must be 0. Received: "${String( + parentFingerprint, + )}".`, + ); + } + + if (depth > 0 && parentFingerprint === 0) { + throw new Error( + `Invalid parent fingerprint: The fingerprint of a child node must not be 0. Received: "${String( + parentFingerprint, + )}".`, + ); + } +} + +/** + * Validate that a given combination of master fingerprint and parent + * fingerprint is valid for the given depth. + * + * @param masterFingerprint - The master fingerprint to validate. + * @param parentFingerprint - The parent fingerprint to validate. + * @param depth - The depth of the node to validate. + * @throws If the combination of master fingerprint and parent fingerprint is + * invalid for the given depth. + */ +export function validateMasterParentFingerprint( + masterFingerprint: number | undefined, + parentFingerprint: number, + depth: number, +): void { + // The master fingerprint is optional. + if (!masterFingerprint) { + return; + } + + if (depth >= 2 && masterFingerprint === parentFingerprint) { + throw new Error( + `Invalid parent fingerprint: The fingerprint of a child node cannot be equal to the master fingerprint. Received: "${String( + parentFingerprint, + )}".`, + ); + } +} + +/** + * Validate that the index is zero for the root node. + * + * @param index - The index to validate. + * @param depth - The depth of the node to validate. + * @throws If the index is not zero for the root node. + */ +export function validateRootIndex(index: number, depth: number): void { + if (depth === 0 && index !== 0) { + throw new Error( + `Invalid index: The index of the root node must be 0. Received: "${String( + index, + )}".`, + ); + } +} + +type DeriveChildNodeArgs = { + path: SLIP10PathTuple; + node: SLIP10Node | BIP44Node | BIP44CoinTypeNode; +}; + +/** + * Derives a child key from the given parent key. + * + * @param options - The options to use when deriving the child key. + * @param options.node - The node to derive from. + * @param options.path - The path to the child node / key. + * @param cryptographicFunctions - The cryptographic functions to use. If + * provided, these will be used instead of the built-in implementations. + * @returns The derived key and depth. + */ +export async function deriveChildNode( + { path, node }: DeriveChildNodeArgs, + cryptographicFunctions?: CryptographicFunctions, +): Promise { + if (path.length === 0) { + throw new Error( + 'Invalid HD tree derivation path: Deriving a path of length 0 is not defined.', + ); + } + + // Note that we do not subtract 1 from the length of the path to the child, + // unlike when we calculate the depth of a rooted path. + const newDepth = node.depth + path.length; + validateBIP32Depth(newDepth); + + return await deriveKeyFromPath( + { + path, + node, + depth: newDepth, + }, + cryptographicFunctions, + ); +} diff --git a/rc-v10.0.1/media/reference-implementations.test.ts b/rc-v10.0.1/media/reference-implementations.test.ts new file mode 100644 index 00000000..b3fdac83 --- /dev/null +++ b/rc-v10.0.1/media/reference-implementations.test.ts @@ -0,0 +1,648 @@ +// eslint-disable-next-line n/no-unsupported-features/node-builtins +import { webcrypto } from 'crypto'; + +import fixtures from './fixtures'; +import type { SLIP10Node, HDPathTuple } from '../src'; +import { BIP44Node, BIP44PurposeNodeToken } from '../src'; +import { ed25519, secp256k1 } from '../src/curves'; +import { deriveKeyFromPath } from '../src/derivation'; +import { createBip39KeyFromSeed } from '../src/derivers/bip39'; +import { + getBIP44CoinTypeToAddressPathTuple, + hexStringToBytes, +} from '../src/utils'; +import * as utils from '../src/utils'; + +// Node.js <20 doesn't have `globalThis.crypto`, so we need to define it. +// TODO: Remove this once we drop support for Node.js <20. +Object.defineProperty(globalThis, 'crypto', { value: webcrypto }); + +describe('reference implementation tests', () => { + describe('using web crypto API', () => { + beforeEach(() => { + jest.spyOn(utils, 'isWebCryptoSupported').mockReturnValue(false); + }); + + describe('local', () => { + const { addresses, mnemonic } = fixtures.local; + const mnemonicBip39Node = `bip39:${mnemonic}` as const; + + describe('BIP44Node', () => { + it('derives the expected keys', async () => { + // Ethereum coin type node + const node = await BIP44Node.fromDerivationPath({ + derivationPath: [ + mnemonicBip39Node, + BIP44PurposeNodeToken, + `bip32:60'`, + ], + }); + + for (let index = 0; index < addresses.length; index++) { + const expectedAddress = addresses[index]; + const childNode = await node.derive( + getBIP44CoinTypeToAddressPathTuple({ address_index: index }), + ); + + expect(childNode.address).toStrictEqual(expectedAddress); + } + }); + }); + + describe('deriveKeyFromPath', () => { + it('derives the expected keys', async () => { + // Ethereum coin type key + const node = await deriveKeyFromPath({ + path: [mnemonicBip39Node, BIP44PurposeNodeToken, `bip32:60'`], + curve: 'secp256k1', + }); + + for (let index = 0; index < addresses.length; index++) { + const expectedAddress = addresses[index]; + const { address } = await deriveKeyFromPath({ + path: getBIP44CoinTypeToAddressPathTuple({ + address_index: index, + }), + node, + }); + + expect(address).toStrictEqual(expectedAddress); + } + }); + }); + }); + + describe('eth-hd-keyring', () => { + const { mnemonic, addresses } = fixtures['eth-hd-keyring']; + const mnemonicBip39Node = `bip39:${mnemonic}` as const; + + describe('BIP44Node', () => { + it('derives the same keys as the reference implementation', async () => { + // Ethereum coin type node + const node = await BIP44Node.fromDerivationPath({ + derivationPath: [ + mnemonicBip39Node, + BIP44PurposeNodeToken, + `bip32:60'`, + ], + }); + + const numberOfAccounts = 5; + for (let i = 0; i < numberOfAccounts; i++) { + const path = getBIP44CoinTypeToAddressPathTuple({ + address_index: i, + }); + const address = await node + .derive(path) + .then((childNode) => childNode.address); + + expect(address).toBe(addresses[i]); + } + }); + + it('derives the same keys as the reference implementation using public key derivation', async () => { + // Ethereum coin type node + const node = await BIP44Node.fromDerivationPath({ + derivationPath: [ + mnemonicBip39Node, + BIP44PurposeNodeToken, + `bip32:60'`, + ], + }); + + const numberOfAccounts = 5; + for (let i = 0; i < numberOfAccounts; i++) { + const [account, change, index] = getBIP44CoinTypeToAddressPathTuple( + { + address_index: i, + }, + ); + const parentNode = await node.derive([account, change]); + + const address = await parentNode + .neuter() + .derive([index]) + .then((childNode) => childNode.address); + + expect(address).toBe(addresses[i]); + } + }); + }); + + describe('deriveKeyFromPath', () => { + it('derives the same keys as the reference implementation', async () => { + // Ethereum coin type key + const node = await deriveKeyFromPath({ + path: [mnemonicBip39Node, BIP44PurposeNodeToken, `bip32:60'`], + curve: 'secp256k1', + }); + + const numberOfAccounts = 5; + const ourAccounts = []; + for (let i = 0; i < numberOfAccounts; i++) { + ourAccounts.push( + await deriveKeyFromPath({ + path: getBIP44CoinTypeToAddressPathTuple({ address_index: i }), + node, + }).then(({ address }) => address), + ); + } + + expect(addresses).toStrictEqual(ourAccounts); + }); + }); + }); + + describe('ethereumjs-wallet', () => { + const { sampleAddressIndices, hexSeed, privateKey, address, path } = + fixtures['ethereumjs-wallet']; + const seed = hexStringToBytes(hexSeed); + + describe('BIP44Node', () => { + it('derives the same keys as the reference implementation', async () => { + const parentNode = await createBip39KeyFromSeed(seed, secp256k1); + const node = await parentNode.derive(path.ours.tuple); + + expect(node.privateKey).toStrictEqual(privateKey); + expect(node.address).toStrictEqual(address); + + for (const { index, address: theirAddress } of sampleAddressIndices) { + const ourAddress = await node + .derive([`bip32:${index}`]) + .then((childNode) => childNode.address); + + expect(ourAddress).toStrictEqual(theirAddress); + } + }); + + it('derives the same keys as the reference implementation using public key derivation', async () => { + const parentNode = await createBip39KeyFromSeed(seed, secp256k1); + const node = await parentNode.derive(path.ours.tuple); + + expect(node.privateKey).toStrictEqual(privateKey); + expect(node.address).toStrictEqual(address); + + for (const { index, address: theirAddress } of sampleAddressIndices) { + const ourAddress = await node + .neuter() + .derive([`bip32:${index}`]) + .then((childNode) => childNode.address); + + expect(ourAddress).toStrictEqual(theirAddress); + } + }); + }); + + describe('deriveKeyFromPath', () => { + it('derives the same keys as the reference implementation', async () => { + const node = await createBip39KeyFromSeed(seed, secp256k1); + const childNode = await deriveKeyFromPath({ + path: path.ours.tuple, + node, + }); + + expect(childNode.privateKey).toStrictEqual(privateKey); + expect(childNode.address).toStrictEqual(address); + + for (const { index, address: theirAddress } of sampleAddressIndices) { + const childChildNode = await deriveKeyFromPath({ + path: [`bip32:${index}`], + node: childNode, + }); + + expect(childChildNode.address).toStrictEqual(theirAddress); + } + }); + }); + }); + + describe('BIP-32 specification test vectors', () => { + const vectors = fixtures.bip32; + + // We only test the BIP-32 vectors with deriveKeyFromPath, since not all + // paths are BIP-44 compatible. + describe('deriveKeyFromPath', () => { + it('derives the test vector keys', async () => { + for (const vector of vectors) { + const seed = hexStringToBytes(vector.hexSeed); + const node = await createBip39KeyFromSeed(seed, secp256k1); + + for (const keyObj of vector.keys) { + const { path, privateKey } = keyObj; + + let targetNode: SLIP10Node; + + // If the path is empty, use the master node + if (path.ours.string === '') { + targetNode = node; + } else { + targetNode = await deriveKeyFromPath({ + path: path.ours.tuple as HDPathTuple, + node, + }); + } + + expect(targetNode.privateKey).toStrictEqual(privateKey); + } + } + }); + }); + }); + + describe('ed25519', () => { + describe('SLIP-10', () => { + const vectors = fixtures.ed25519.slip10; + + describe('deriveKeyFromPath', () => { + it('derives the test vector keys', async () => { + for (const { hexSeed, keys } of vectors) { + const node = await createBip39KeyFromSeed( + hexStringToBytes(hexSeed), + ed25519, + ); + + for (const { path, privateKey, publicKey } of keys) { + let targetNode: SLIP10Node; + if (path.ours.string === '') { + targetNode = node; + } else { + targetNode = await deriveKeyFromPath({ + path: path.ours.tuple, + node, + }); + } + + expect(targetNode.privateKey).toBe(privateKey); + expect(targetNode.publicKey).toBe(publicKey); + } + } + }); + }); + }); + + describe('ed25519-hd-key', () => { + const { sampleKeyIndices, hexSeed, privateKey, path } = + fixtures.ed25519['ed25519-hd-key']; + const seed = hexStringToBytes(hexSeed); + + describe('SLIP10Node', () => { + it('derives the same keys as the reference implementation', async () => { + // Ethereum coin type node + const parentNode = await createBip39KeyFromSeed(seed, ed25519); + const node = await parentNode.derive(path.ours.tuple); + + expect(node.privateKey).toStrictEqual(privateKey); + + for (const { + index, + privateKey: theirPrivateKey, + publicKey: theirPublicKey, + } of sampleKeyIndices) { + const childNode = await node.derive([`slip10:${index}'`]); + + expect(childNode.privateKey).toStrictEqual(theirPrivateKey); + expect(childNode.publicKey).toStrictEqual(theirPublicKey); + } + }); + }); + + describe('deriveKeyFromPath', () => { + it('derives the same keys as the reference implementation', async () => { + // Ethereum coin type key + const node = await createBip39KeyFromSeed(seed, ed25519); + const childNode = await deriveKeyFromPath({ + path: [`slip10:44'`, `slip10:0'`, `slip10:0'`, `slip10:1'`], + node, + }); + + for (const { + index, + privateKey: theirPrivateKey, + } of sampleKeyIndices) { + const { privateKey: ourPrivateKey } = await deriveKeyFromPath({ + path: [`slip10:${index}'`], + node: childNode, + }); + + expect(ourPrivateKey).toStrictEqual(theirPrivateKey); + } + }); + }); + }); + }); + }); + + describe('using built-in cryptography functions', () => { + beforeEach(() => { + jest.spyOn(utils, 'isWebCryptoSupported').mockReturnValue(false); + }); + + describe('local', () => { + const { addresses, mnemonic } = fixtures.local; + const mnemonicBip39Node = `bip39:${mnemonic}` as const; + + describe('BIP44Node', () => { + it('derives the expected keys', async () => { + // Ethereum coin type node + const node = await BIP44Node.fromDerivationPath({ + derivationPath: [ + mnemonicBip39Node, + BIP44PurposeNodeToken, + `bip32:60'`, + ], + }); + + for (let index = 0; index < addresses.length; index++) { + const expectedAddress = addresses[index]; + const childNode = await node.derive( + getBIP44CoinTypeToAddressPathTuple({ address_index: index }), + ); + + expect(childNode.address).toStrictEqual(expectedAddress); + } + }); + }); + + describe('deriveKeyFromPath', () => { + it('derives the expected keys', async () => { + // Ethereum coin type key + const node = await deriveKeyFromPath({ + path: [mnemonicBip39Node, BIP44PurposeNodeToken, `bip32:60'`], + curve: 'secp256k1', + }); + + for (let index = 0; index < addresses.length; index++) { + const expectedAddress = addresses[index]; + const { address } = await deriveKeyFromPath({ + path: getBIP44CoinTypeToAddressPathTuple({ + address_index: index, + }), + node, + }); + + expect(address).toStrictEqual(expectedAddress); + } + }); + }); + }); + + describe('eth-hd-keyring', () => { + const { mnemonic, addresses } = fixtures['eth-hd-keyring']; + const mnemonicBip39Node = `bip39:${mnemonic}` as const; + + describe('BIP44Node', () => { + it('derives the same keys as the reference implementation', async () => { + // Ethereum coin type node + const node = await BIP44Node.fromDerivationPath({ + derivationPath: [ + mnemonicBip39Node, + BIP44PurposeNodeToken, + `bip32:60'`, + ], + }); + + const numberOfAccounts = 5; + for (let i = 0; i < numberOfAccounts; i++) { + const path = getBIP44CoinTypeToAddressPathTuple({ + address_index: i, + }); + const address = await node + .derive(path) + .then((childNode) => childNode.address); + + expect(address).toBe(addresses[i]); + } + }); + + it('derives the same keys as the reference implementation using public key derivation', async () => { + // Ethereum coin type node + const node = await BIP44Node.fromDerivationPath({ + derivationPath: [ + mnemonicBip39Node, + BIP44PurposeNodeToken, + `bip32:60'`, + ], + }); + + const numberOfAccounts = 5; + for (let i = 0; i < numberOfAccounts; i++) { + const [account, change, index] = getBIP44CoinTypeToAddressPathTuple( + { + address_index: i, + }, + ); + const parentNode = await node.derive([account, change]); + + const address = await parentNode + .neuter() + .derive([index]) + .then((childNode) => childNode.address); + + expect(address).toBe(addresses[i]); + } + }); + }); + + describe('deriveKeyFromPath', () => { + it('derives the same keys as the reference implementation', async () => { + // Ethereum coin type key + const node = await deriveKeyFromPath({ + path: [mnemonicBip39Node, BIP44PurposeNodeToken, `bip32:60'`], + curve: 'secp256k1', + }); + + const numberOfAccounts = 5; + const ourAccounts = []; + for (let i = 0; i < numberOfAccounts; i++) { + ourAccounts.push( + await deriveKeyFromPath({ + path: getBIP44CoinTypeToAddressPathTuple({ address_index: i }), + node, + }).then(({ address }) => address), + ); + } + + expect(addresses).toStrictEqual(ourAccounts); + }); + }); + }); + + describe('ethereumjs-wallet', () => { + const { sampleAddressIndices, hexSeed, privateKey, address, path } = + fixtures['ethereumjs-wallet']; + const seed = hexStringToBytes(hexSeed); + + describe('BIP44Node', () => { + it('derives the same keys as the reference implementation', async () => { + const parentNode = await createBip39KeyFromSeed(seed, secp256k1); + const node = await parentNode.derive(path.ours.tuple); + + expect(node.privateKey).toStrictEqual(privateKey); + expect(node.address).toStrictEqual(address); + + for (const { index, address: theirAddress } of sampleAddressIndices) { + const ourAddress = await node + .derive([`bip32:${index}`]) + .then((childNode) => childNode.address); + + expect(ourAddress).toStrictEqual(theirAddress); + } + }); + + it('derives the same keys as the reference implementation using public key derivation', async () => { + const parentNode = await createBip39KeyFromSeed(seed, secp256k1); + const node = await parentNode.derive(path.ours.tuple); + + expect(node.privateKey).toStrictEqual(privateKey); + expect(node.address).toStrictEqual(address); + + for (const { index, address: theirAddress } of sampleAddressIndices) { + const ourAddress = await node + .neuter() + .derive([`bip32:${index}`]) + .then((childNode) => childNode.address); + + expect(ourAddress).toStrictEqual(theirAddress); + } + }); + }); + + describe('deriveKeyFromPath', () => { + it('derives the same keys as the reference implementation', async () => { + const node = await createBip39KeyFromSeed(seed, secp256k1); + const childNode = await deriveKeyFromPath({ + path: path.ours.tuple, + node, + }); + + expect(childNode.privateKey).toStrictEqual(privateKey); + expect(childNode.address).toStrictEqual(address); + + for (const { index, address: theirAddress } of sampleAddressIndices) { + const childChildNode = await deriveKeyFromPath({ + path: [`bip32:${index}`], + node: childNode, + }); + + expect(childChildNode.address).toStrictEqual(theirAddress); + } + }); + }); + }); + + describe('BIP-32 specification test vectors', () => { + const vectors = fixtures.bip32; + + // We only test the BIP-32 vectors with deriveKeyFromPath, since not all + // paths are BIP-44 compatible. + describe('deriveKeyFromPath', () => { + it('derives the test vector keys', async () => { + for (const vector of vectors) { + const seed = hexStringToBytes(vector.hexSeed); + const node = await createBip39KeyFromSeed(seed, secp256k1); + + for (const keyObj of vector.keys) { + const { path, privateKey } = keyObj; + + let targetNode: SLIP10Node; + + // If the path is empty, use the master node + if (path.ours.string === '') { + targetNode = node; + } else { + targetNode = await deriveKeyFromPath({ + path: path.ours.tuple as HDPathTuple, + node, + }); + } + + expect(targetNode.privateKey).toStrictEqual(privateKey); + } + } + }); + }); + }); + + describe('ed25519', () => { + describe('SLIP-10', () => { + const vectors = fixtures.ed25519.slip10; + + describe('deriveKeyFromPath', () => { + it('derives the test vector keys', async () => { + for (const { hexSeed, keys } of vectors) { + const node = await createBip39KeyFromSeed( + hexStringToBytes(hexSeed), + ed25519, + ); + + for (const { path, privateKey, publicKey } of keys) { + let targetNode: SLIP10Node; + if (path.ours.string === '') { + targetNode = node; + } else { + targetNode = await deriveKeyFromPath({ + path: path.ours.tuple, + node, + }); + } + + expect(targetNode.privateKey).toBe(privateKey); + expect(targetNode.publicKey).toBe(publicKey); + } + } + }); + }); + }); + + describe('ed25519-hd-key', () => { + const { sampleKeyIndices, hexSeed, privateKey, path } = + fixtures.ed25519['ed25519-hd-key']; + const seed = hexStringToBytes(hexSeed); + + describe('SLIP10Node', () => { + it('derives the same keys as the reference implementation', async () => { + // Ethereum coin type node + const parentNode = await createBip39KeyFromSeed(seed, ed25519); + const node = await parentNode.derive(path.ours.tuple); + + expect(node.privateKey).toStrictEqual(privateKey); + + for (const { + index, + privateKey: theirPrivateKey, + publicKey: theirPublicKey, + } of sampleKeyIndices) { + const childNode = await node.derive([`slip10:${index}'`]); + + expect(childNode.privateKey).toStrictEqual(theirPrivateKey); + expect(childNode.publicKey).toStrictEqual(theirPublicKey); + } + }); + }); + + describe('deriveKeyFromPath', () => { + it('derives the same keys as the reference implementation', async () => { + // Ethereum coin type key + const node = await createBip39KeyFromSeed(seed, ed25519); + const childNode = await deriveKeyFromPath({ + path: [`slip10:44'`, `slip10:0'`, `slip10:0'`, `slip10:1'`], + node, + }); + + for (const { + index, + privateKey: theirPrivateKey, + } of sampleKeyIndices) { + const { privateKey: ourPrivateKey } = await deriveKeyFromPath({ + path: [`slip10:${index}'`], + node: childNode, + }); + + expect(ourPrivateKey).toStrictEqual(theirPrivateKey); + } + }); + }); + }); + }); + }); +}); diff --git a/rc-v10.0.1/modules.html b/rc-v10.0.1/modules.html new file mode 100644 index 00000000..f080f85e --- /dev/null +++ b/rc-v10.0.1/modules.html @@ -0,0 +1,96 @@ +@metamask/key-tree

@metamask/key-tree

Index

Namespaces

Classes

Type Aliases

Variables

Functions

diff --git a/rc-v10.0.1/modules/ed25519.html b/rc-v10.0.1/modules/ed25519.html new file mode 100644 index 00000000..e52d2467 --- /dev/null +++ b/rc-v10.0.1/modules/ed25519.html @@ -0,0 +1,14 @@ +ed25519 | @metamask/key-tree
diff --git a/rc-v10.0.1/modules/ed25519Bip32.html b/rc-v10.0.1/modules/ed25519Bip32.html new file mode 100644 index 00000000..789b458c --- /dev/null +++ b/rc-v10.0.1/modules/ed25519Bip32.html @@ -0,0 +1,16 @@ +ed25519Bip32 | @metamask/key-tree
diff --git a/rc-v10.0.1/modules/secp256k1.html b/rc-v10.0.1/modules/secp256k1.html new file mode 100644 index 00000000..faefcab8 --- /dev/null +++ b/rc-v10.0.1/modules/secp256k1.html @@ -0,0 +1,14 @@ +secp256k1 | @metamask/key-tree
diff --git a/rc-v10.0.1/types/AddressHDPathString.html b/rc-v10.0.1/types/AddressHDPathString.html new file mode 100644 index 00000000..0aa6fb1c --- /dev/null +++ b/rc-v10.0.1/types/AddressHDPathString.html @@ -0,0 +1 @@ +AddressHDPathString | @metamask/key-tree

Type Alias AddressHDPathString

AddressHDPathString: HDPathString5
diff --git a/rc-v10.0.1/types/AnonymizedBIP39Node.html b/rc-v10.0.1/types/AnonymizedBIP39Node.html new file mode 100644 index 00000000..0172b55d --- /dev/null +++ b/rc-v10.0.1/types/AnonymizedBIP39Node.html @@ -0,0 +1 @@ +AnonymizedBIP39Node | @metamask/key-tree

Type Alias AnonymizedBIP39Node

AnonymizedBIP39Node
diff --git a/rc-v10.0.1/types/BIP32Node.html b/rc-v10.0.1/types/BIP32Node.html new file mode 100644 index 00000000..7d115461 --- /dev/null +++ b/rc-v10.0.1/types/BIP32Node.html @@ -0,0 +1 @@ +BIP32Node | @metamask/key-tree
diff --git a/rc-v10.0.1/types/BIP39Node.html b/rc-v10.0.1/types/BIP39Node.html new file mode 100644 index 00000000..5138deb9 --- /dev/null +++ b/rc-v10.0.1/types/BIP39Node.html @@ -0,0 +1 @@ +BIP39Node | @metamask/key-tree

Type Alias BIP39Node

BIP39Node: BIP39StringNode | Uint8Array
diff --git a/rc-v10.0.1/types/BIP39StringNode.html b/rc-v10.0.1/types/BIP39StringNode.html new file mode 100644 index 00000000..885c8767 --- /dev/null +++ b/rc-v10.0.1/types/BIP39StringNode.html @@ -0,0 +1 @@ +BIP39StringNode | @metamask/key-tree

Type Alias BIP39StringNode

BIP39StringNode: `bip39:${string}`
diff --git a/rc-v10.0.1/types/BIP44AddressKeyDeriver.html b/rc-v10.0.1/types/BIP44AddressKeyDeriver.html new file mode 100644 index 00000000..ae884d64 --- /dev/null +++ b/rc-v10.0.1/types/BIP44AddressKeyDeriver.html @@ -0,0 +1,12 @@ +BIP44AddressKeyDeriver | @metamask/key-tree

Type Alias BIP44AddressKeyDeriver

BIP44AddressKeyDeriver: {
    coin_type: number;
    path: ReturnType<typeof getBIP44ChangePathString>;
    (address_index: number, isHardened?: boolean): Promise<BIP44Node>;
}

Type declaration

    • (address_index, isHardened?): Promise<BIP44Node>
    • Parameters

      • address_index: number

        The address_index value.

        +
      • OptionalisHardened: boolean

        Whether the derived index is hardened.

        +

      Returns Promise<BIP44Node>

      The key corresponding to the path of this deriver and the +specified address_index value.

      +
  • coin_type: number

    The coin_type index of addresses derived by this deriver function.

    +
  • path: ReturnType<typeof getBIP44ChangePathString>

    A human-readable representation of the derivation path of this deriver +function, excluding the address_index, which is parameterized.

    +

    Recall that a BIP-44 HD tree path consists of the following nodes:

    +

    m / 44' / coin_type' / account' / change / address_index

    +

    With the following depths:

    +

    0 / 1 / 2 / 3 / 4 / 5

    +
diff --git a/rc-v10.0.1/types/BIP44CoinTypeNodeInterface.html b/rc-v10.0.1/types/BIP44CoinTypeNodeInterface.html new file mode 100644 index 00000000..09285f77 --- /dev/null +++ b/rc-v10.0.1/types/BIP44CoinTypeNodeInterface.html @@ -0,0 +1 @@ +BIP44CoinTypeNodeInterface | @metamask/key-tree

Type Alias BIP44CoinTypeNodeInterface

BIP44CoinTypeNodeInterface: BIP44NodeInterface & {
    coin_type: number;
    path: CoinTypeHDPathString;
}
diff --git a/rc-v10.0.1/types/BIP44Depth.html b/rc-v10.0.1/types/BIP44Depth.html new file mode 100644 index 00000000..ba101c0c --- /dev/null +++ b/rc-v10.0.1/types/BIP44Depth.html @@ -0,0 +1 @@ +BIP44Depth | @metamask/key-tree

Type Alias BIP44Depth

BIP44Depth:
    | MinBIP44Depth
    | 1
    | 2
    | 3
    | 4
    | MaxBIP44Depth
diff --git a/rc-v10.0.1/types/BIP44DerivationPathOptions.html b/rc-v10.0.1/types/BIP44DerivationPathOptions.html new file mode 100644 index 00000000..b49acddc --- /dev/null +++ b/rc-v10.0.1/types/BIP44DerivationPathOptions.html @@ -0,0 +1 @@ +BIP44DerivationPathOptions | @metamask/key-tree

Type Alias BIP44DerivationPathOptions

BIP44DerivationPathOptions: {
    derivationPath: RootedSLIP10PathTuple;
    network?: Network;
}
diff --git a/rc-v10.0.1/types/BIP44ExtendedKeyOptions.html b/rc-v10.0.1/types/BIP44ExtendedKeyOptions.html new file mode 100644 index 00000000..2fd5cb41 --- /dev/null +++ b/rc-v10.0.1/types/BIP44ExtendedKeyOptions.html @@ -0,0 +1 @@ +BIP44ExtendedKeyOptions | @metamask/key-tree

Type Alias BIP44ExtendedKeyOptions

BIP44ExtendedKeyOptions: {
    chainCode: Uint8Array | string;
    depth: number;
    index: number;
    network?: Network;
    parentFingerprint: number;
    privateKey?: Uint8Array | string;
    publicKey?: Uint8Array | string;
}
diff --git a/rc-v10.0.1/types/BIP44NodeInterface.html b/rc-v10.0.1/types/BIP44NodeInterface.html new file mode 100644 index 00000000..2c35c3c2 --- /dev/null +++ b/rc-v10.0.1/types/BIP44NodeInterface.html @@ -0,0 +1,2 @@ +BIP44NodeInterface | @metamask/key-tree

Type Alias BIP44NodeInterface

BIP44NodeInterface: JsonBIP44Node & {
    toJSON(): JsonBIP44Node;
}

Type declaration

diff --git a/rc-v10.0.1/types/CIP3PathNode.html b/rc-v10.0.1/types/CIP3PathNode.html new file mode 100644 index 00000000..04afa96c --- /dev/null +++ b/rc-v10.0.1/types/CIP3PathNode.html @@ -0,0 +1 @@ +CIP3PathNode | @metamask/key-tree
diff --git a/rc-v10.0.1/types/ChangeHDPathString.html b/rc-v10.0.1/types/ChangeHDPathString.html new file mode 100644 index 00000000..401e3555 --- /dev/null +++ b/rc-v10.0.1/types/ChangeHDPathString.html @@ -0,0 +1 @@ +ChangeHDPathString | @metamask/key-tree

Type Alias ChangeHDPathString

ChangeHDPathString: HDPathString4
diff --git a/rc-v10.0.1/types/CoinTypeHDPathString.html b/rc-v10.0.1/types/CoinTypeHDPathString.html new file mode 100644 index 00000000..781456ad --- /dev/null +++ b/rc-v10.0.1/types/CoinTypeHDPathString.html @@ -0,0 +1 @@ +CoinTypeHDPathString | @metamask/key-tree

Type Alias CoinTypeHDPathString

CoinTypeHDPathString: HDPathString2
diff --git a/rc-v10.0.1/types/CoinTypeHDPathTuple.html b/rc-v10.0.1/types/CoinTypeHDPathTuple.html new file mode 100644 index 00000000..560f1837 --- /dev/null +++ b/rc-v10.0.1/types/CoinTypeHDPathTuple.html @@ -0,0 +1 @@ +CoinTypeHDPathTuple | @metamask/key-tree

Type Alias CoinTypeHDPathTuple

CoinTypeHDPathTuple: [BIP39Node, typeof BIP44PurposeNodeToken, HardenedBIP32Node]
diff --git a/rc-v10.0.1/types/CoinTypeToAddressIndices.html b/rc-v10.0.1/types/CoinTypeToAddressIndices.html new file mode 100644 index 00000000..1a92e099 --- /dev/null +++ b/rc-v10.0.1/types/CoinTypeToAddressIndices.html @@ -0,0 +1 @@ +CoinTypeToAddressIndices | @metamask/key-tree

Type Alias CoinTypeToAddressIndices

CoinTypeToAddressIndices: Pick<BIP44PathIndices, "account" | "change" | "address_index">
diff --git a/rc-v10.0.1/types/CoinTypeToAddressTuple.html b/rc-v10.0.1/types/CoinTypeToAddressTuple.html new file mode 100644 index 00000000..db1b0883 --- /dev/null +++ b/rc-v10.0.1/types/CoinTypeToAddressTuple.html @@ -0,0 +1 @@ +CoinTypeToAddressTuple | @metamask/key-tree

Type Alias CoinTypeToAddressTuple

CoinTypeToAddressTuple: PartialHDPathTuple8
diff --git a/rc-v10.0.1/types/CryptographicFunctions.html b/rc-v10.0.1/types/CryptographicFunctions.html new file mode 100644 index 00000000..2334e6fc --- /dev/null +++ b/rc-v10.0.1/types/CryptographicFunctions.html @@ -0,0 +1,12 @@ +CryptographicFunctions | @metamask/key-tree

Type Alias CryptographicFunctions

CryptographicFunctions: {
    hmacSha512?: ((key: Uint8Array, data: Uint8Array) => Promise<Uint8Array>);
    pbkdf2Sha512?: ((password: Uint8Array, salt: Uint8Array, iterations: number, keyLength: number) => Promise<Uint8Array>);
}

Type declaration

  • OptionalhmacSha512?: ((key: Uint8Array, data: Uint8Array) => Promise<Uint8Array>)

    Compute the HMAC-SHA-512 of the given data using the given key.

    +
      • (key, data): Promise<Uint8Array>
      • Parameters

        • key: Uint8Array

          The key to use.

          +
        • data: Uint8Array

          The data to hash.

          +

        Returns Promise<Uint8Array>

        The HMAC-SHA-512 of the data.

        +
  • Optionalpbkdf2Sha512?: ((password: Uint8Array, salt: Uint8Array, iterations: number, keyLength: number) => Promise<Uint8Array>)

    Compute the PBKDF2 of the given password, salt, iterations, and key length. +The hash function used is SHA-512.

    +
      • (password, salt, iterations, keyLength): Promise<Uint8Array>
      • Parameters

        • password: Uint8Array

          The password to hash.

          +
        • salt: Uint8Array

          The salt to use.

          +
        • iterations: number

          The number of iterations.

          +
        • keyLength: number

          The desired key length in bytes.

          +

        Returns Promise<Uint8Array>

        The PBKDF2 of the password.

        +
diff --git a/rc-v10.0.1/types/FullHDPathTuple.html b/rc-v10.0.1/types/FullHDPathTuple.html new file mode 100644 index 00000000..66166d4e --- /dev/null +++ b/rc-v10.0.1/types/FullHDPathTuple.html @@ -0,0 +1 @@ +FullHDPathTuple | @metamask/key-tree

Type Alias FullHDPathTuple

FullHDPathTuple: RootedHDPathTuple5
diff --git a/rc-v10.0.1/types/HDPathString.html b/rc-v10.0.1/types/HDPathString.html new file mode 100644 index 00000000..6829f9ff --- /dev/null +++ b/rc-v10.0.1/types/HDPathString.html @@ -0,0 +1 @@ +HDPathString | @metamask/key-tree

Type Alias HDPathString

HDPathString:
    | HDPathString0
    | HDPathString1
    | HDPathString2
    | HDPathString3
    | HDPathString4
    | HDPathString5
diff --git a/rc-v10.0.1/types/HDPathString0.html b/rc-v10.0.1/types/HDPathString0.html new file mode 100644 index 00000000..4dab2320 --- /dev/null +++ b/rc-v10.0.1/types/HDPathString0.html @@ -0,0 +1 @@ +HDPathString0 | @metamask/key-tree

Type Alias HDPathString0

HDPathString0: AnonymizedBIP39Node
diff --git a/rc-v10.0.1/types/HDPathString1.html b/rc-v10.0.1/types/HDPathString1.html new file mode 100644 index 00000000..f895bb40 --- /dev/null +++ b/rc-v10.0.1/types/HDPathString1.html @@ -0,0 +1 @@ +HDPathString1 | @metamask/key-tree

Type Alias HDPathString1

HDPathString1: `${HDPathString0} / ${HardenedBIP32Node}`
diff --git a/rc-v10.0.1/types/HDPathString2.html b/rc-v10.0.1/types/HDPathString2.html new file mode 100644 index 00000000..4c588a99 --- /dev/null +++ b/rc-v10.0.1/types/HDPathString2.html @@ -0,0 +1 @@ +HDPathString2 | @metamask/key-tree

Type Alias HDPathString2

HDPathString2: `${HDPathString1} / ${HardenedBIP32Node}`
diff --git a/rc-v10.0.1/types/HDPathString3.html b/rc-v10.0.1/types/HDPathString3.html new file mode 100644 index 00000000..0efd2f0e --- /dev/null +++ b/rc-v10.0.1/types/HDPathString3.html @@ -0,0 +1 @@ +HDPathString3 | @metamask/key-tree

Type Alias HDPathString3

HDPathString3: `${HDPathString2} / ${HardenedBIP32Node}`
diff --git a/rc-v10.0.1/types/HDPathString4.html b/rc-v10.0.1/types/HDPathString4.html new file mode 100644 index 00000000..657ce53b --- /dev/null +++ b/rc-v10.0.1/types/HDPathString4.html @@ -0,0 +1 @@ +HDPathString4 | @metamask/key-tree

Type Alias HDPathString4

HDPathString4: `${HDPathString3} / ${BIP32Node}`
diff --git a/rc-v10.0.1/types/HDPathString5.html b/rc-v10.0.1/types/HDPathString5.html new file mode 100644 index 00000000..855994d4 --- /dev/null +++ b/rc-v10.0.1/types/HDPathString5.html @@ -0,0 +1 @@ +HDPathString5 | @metamask/key-tree

Type Alias HDPathString5

HDPathString5: `${HDPathString4} / ${BIP32Node}`
diff --git a/rc-v10.0.1/types/HDPathTuple.html b/rc-v10.0.1/types/HDPathTuple.html new file mode 100644 index 00000000..41b360c0 --- /dev/null +++ b/rc-v10.0.1/types/HDPathTuple.html @@ -0,0 +1,2 @@ +HDPathTuple | @metamask/key-tree

Type Alias HDPathTuple

Every ordered subset of a full HD path tuple.

+
diff --git a/rc-v10.0.1/types/HardenedBIP32Node.html b/rc-v10.0.1/types/HardenedBIP32Node.html new file mode 100644 index 00000000..d93de830 --- /dev/null +++ b/rc-v10.0.1/types/HardenedBIP32Node.html @@ -0,0 +1 @@ +HardenedBIP32Node | @metamask/key-tree

Type Alias HardenedBIP32Node

HardenedBIP32Node: `bip32:${number}'`
diff --git a/rc-v10.0.1/types/HardenedCIP3Node.html b/rc-v10.0.1/types/HardenedCIP3Node.html new file mode 100644 index 00000000..937717eb --- /dev/null +++ b/rc-v10.0.1/types/HardenedCIP3Node.html @@ -0,0 +1 @@ +HardenedCIP3Node | @metamask/key-tree

Type Alias HardenedCIP3Node

HardenedCIP3Node: `cip3:${number}'`
diff --git a/rc-v10.0.1/types/HardenedSLIP10Node.html b/rc-v10.0.1/types/HardenedSLIP10Node.html new file mode 100644 index 00000000..f623cc62 --- /dev/null +++ b/rc-v10.0.1/types/HardenedSLIP10Node.html @@ -0,0 +1 @@ +HardenedSLIP10Node | @metamask/key-tree

Type Alias HardenedSLIP10Node

HardenedSLIP10Node: `slip10:${number}'`
diff --git a/rc-v10.0.1/types/JsonBIP44CoinTypeNode.html b/rc-v10.0.1/types/JsonBIP44CoinTypeNode.html new file mode 100644 index 00000000..c6918f04 --- /dev/null +++ b/rc-v10.0.1/types/JsonBIP44CoinTypeNode.html @@ -0,0 +1 @@ +JsonBIP44CoinTypeNode | @metamask/key-tree

Type Alias JsonBIP44CoinTypeNode

JsonBIP44CoinTypeNode: JsonBIP44Node & {
    coin_type: number;
    path: CoinTypeHDPathString;
}
diff --git a/rc-v10.0.1/types/JsonBIP44Node.html b/rc-v10.0.1/types/JsonBIP44Node.html new file mode 100644 index 00000000..fcf8a60a --- /dev/null +++ b/rc-v10.0.1/types/JsonBIP44Node.html @@ -0,0 +1,19 @@ +JsonBIP44Node | @metamask/key-tree

Type Alias JsonBIP44Node

JsonBIP44Node: {
    chainCode: string;
    depth: BIP44Depth;
    index: number;
    masterFingerprint?: number;
    network?: Network;
    parentFingerprint: number;
    privateKey?: string;
    publicKey: string;
}

A wrapper for BIP-44 Hierarchical Deterministic (HD) tree nodes, i.e. +cryptographic keys used to generate keypairs and addresses for cryptocurrency +protocols.

+

Type declaration

  • ReadonlychainCode: string

    The hexadecimal string representation of the chain code for this node.

    +
  • Readonlydepth: BIP44Depth

    The 0-indexed BIP-44 path depth of this node.

    +

    A BIP-44 path is of the form:

    +

    m / 44' / coin_type' / account' / change / address_index

    +

    With the following depths:

    +

    0 / 1 / 2 / 3 / 4 / 5

    +
  • Readonlyindex: number

    The index of the node, or 0 if this is a master node.

    +
  • Optional ReadonlymasterFingerprint?: number

    The fingerprint of the master node, i.e., the node at depth 0. May be +undefined if this node was created from an extended key.

    +
  • Optional Readonlynetwork?: Network

    The network for the node. This is only used for extended keys, and defaults +to mainnet.

    +
  • ReadonlyparentFingerprint: number

    The fingerprint of the parent key, or 0 if this is a master node.

    +
  • Optional ReadonlyprivateKey?: string

    The hexadecimal string representation of the private key for this node. +May be undefined if the node is a public node.

    +
  • ReadonlypublicKey: string

    The hexadecimal string representation of the public key for this node.

    +
diff --git a/rc-v10.0.1/types/JsonSLIP10Node.html b/rc-v10.0.1/types/JsonSLIP10Node.html new file mode 100644 index 00000000..06e93bf5 --- /dev/null +++ b/rc-v10.0.1/types/JsonSLIP10Node.html @@ -0,0 +1,15 @@ +JsonSLIP10Node | @metamask/key-tree

Type Alias JsonSLIP10Node

JsonSLIP10Node: {
    chainCode: string;
    curve: SupportedCurve;
    depth: number;
    index: number;
    masterFingerprint?: number;
    network?: Network;
    parentFingerprint: number;
    privateKey?: string;
    publicKey: string;
}

A wrapper for SLIP-10 Hierarchical Deterministic (HD) tree nodes, i.e. +cryptographic keys used to generate key pairs and addresses for cryptocurrency +protocols.

+

Type declaration

  • ReadonlychainCode: string

    The chain code of this node.

    +
  • Readonlycurve: SupportedCurve

    The name of the curve used by the node.

    +
  • Readonlydepth: number

    The 0-indexed path depth of this node.

    +
  • Readonlyindex: number

    The index of the node, or 0 if this is a master node.

    +
  • Optional ReadonlymasterFingerprint?: number

    The fingerprint of the master node, i.e., the node at depth 0. May be +undefined if this node was created from an extended key.

    +
  • Optional Readonlynetwork?: Network

    The network for the node. This is only used for extended keys, and defaults +to mainnet.

    +
  • ReadonlyparentFingerprint: number

    The fingerprint of the parent key, or 0 if this is a master node.

    +
  • Optional ReadonlyprivateKey?: string

    The (optional) private key of this node.

    +
  • ReadonlypublicKey: string

    The public key of this node.

    +
diff --git a/rc-v10.0.1/types/MaxBIP44Depth.html b/rc-v10.0.1/types/MaxBIP44Depth.html new file mode 100644 index 00000000..79de91f7 --- /dev/null +++ b/rc-v10.0.1/types/MaxBIP44Depth.html @@ -0,0 +1 @@ +MaxBIP44Depth | @metamask/key-tree

Type Alias MaxBIP44Depth

MaxBIP44Depth: typeof MAX_BIP_44_DEPTH
diff --git a/rc-v10.0.1/types/MinBIP44Depth.html b/rc-v10.0.1/types/MinBIP44Depth.html new file mode 100644 index 00000000..50935c0d --- /dev/null +++ b/rc-v10.0.1/types/MinBIP44Depth.html @@ -0,0 +1 @@ +MinBIP44Depth | @metamask/key-tree

Type Alias MinBIP44Depth

MinBIP44Depth: typeof MIN_BIP_44_DEPTH
diff --git a/rc-v10.0.1/types/Network.html b/rc-v10.0.1/types/Network.html new file mode 100644 index 00000000..fb0630b9 --- /dev/null +++ b/rc-v10.0.1/types/Network.html @@ -0,0 +1,2 @@ +Network | @metamask/key-tree

Type Alias Network

Network: "mainnet" | "testnet"

The network for which the HD path is intended.

+
diff --git a/rc-v10.0.1/types/PartialHDPathTuple.html b/rc-v10.0.1/types/PartialHDPathTuple.html new file mode 100644 index 00000000..81dd16bc --- /dev/null +++ b/rc-v10.0.1/types/PartialHDPathTuple.html @@ -0,0 +1 @@ +PartialHDPathTuple | @metamask/key-tree
diff --git a/rc-v10.0.1/types/PartialHDPathTuple1.html b/rc-v10.0.1/types/PartialHDPathTuple1.html new file mode 100644 index 00000000..e3ae7182 --- /dev/null +++ b/rc-v10.0.1/types/PartialHDPathTuple1.html @@ -0,0 +1 @@ +PartialHDPathTuple1 | @metamask/key-tree

Type Alias PartialHDPathTuple1

PartialHDPathTuple1: readonly [HardenedBIP32Node]
diff --git a/rc-v10.0.1/types/PartialHDPathTuple10.html b/rc-v10.0.1/types/PartialHDPathTuple10.html new file mode 100644 index 00000000..85c4d416 --- /dev/null +++ b/rc-v10.0.1/types/PartialHDPathTuple10.html @@ -0,0 +1 @@ +PartialHDPathTuple10 | @metamask/key-tree

Type Alias PartialHDPathTuple10

PartialHDPathTuple10: readonly [HardenedBIP32Node, HardenedBIP32Node, BIP32Node]
diff --git a/rc-v10.0.1/types/PartialHDPathTuple11.html b/rc-v10.0.1/types/PartialHDPathTuple11.html new file mode 100644 index 00000000..0d0e6e4b --- /dev/null +++ b/rc-v10.0.1/types/PartialHDPathTuple11.html @@ -0,0 +1 @@ +PartialHDPathTuple11 | @metamask/key-tree

Type Alias PartialHDPathTuple11

PartialHDPathTuple11: readonly [HardenedBIP32Node, HardenedBIP32Node, BIP32Node, BIP32Node]
diff --git a/rc-v10.0.1/types/PartialHDPathTuple2.html b/rc-v10.0.1/types/PartialHDPathTuple2.html new file mode 100644 index 00000000..59758088 --- /dev/null +++ b/rc-v10.0.1/types/PartialHDPathTuple2.html @@ -0,0 +1 @@ +PartialHDPathTuple2 | @metamask/key-tree

Type Alias PartialHDPathTuple2

PartialHDPathTuple2: readonly [...PartialHDPathTuple1, HardenedBIP32Node]
diff --git a/rc-v10.0.1/types/PartialHDPathTuple3.html b/rc-v10.0.1/types/PartialHDPathTuple3.html new file mode 100644 index 00000000..4f98382b --- /dev/null +++ b/rc-v10.0.1/types/PartialHDPathTuple3.html @@ -0,0 +1 @@ +PartialHDPathTuple3 | @metamask/key-tree

Type Alias PartialHDPathTuple3

PartialHDPathTuple3: readonly [...PartialHDPathTuple2, HardenedBIP32Node]
diff --git a/rc-v10.0.1/types/PartialHDPathTuple4.html b/rc-v10.0.1/types/PartialHDPathTuple4.html new file mode 100644 index 00000000..2be602da --- /dev/null +++ b/rc-v10.0.1/types/PartialHDPathTuple4.html @@ -0,0 +1 @@ +PartialHDPathTuple4 | @metamask/key-tree

Type Alias PartialHDPathTuple4

PartialHDPathTuple4: readonly [...PartialHDPathTuple3, BIP32Node]
diff --git a/rc-v10.0.1/types/PartialHDPathTuple5.html b/rc-v10.0.1/types/PartialHDPathTuple5.html new file mode 100644 index 00000000..cfe5c57f --- /dev/null +++ b/rc-v10.0.1/types/PartialHDPathTuple5.html @@ -0,0 +1 @@ +PartialHDPathTuple5 | @metamask/key-tree

Type Alias PartialHDPathTuple5

PartialHDPathTuple5: readonly [...PartialHDPathTuple4, BIP32Node]
diff --git a/rc-v10.0.1/types/PartialHDPathTuple6.html b/rc-v10.0.1/types/PartialHDPathTuple6.html new file mode 100644 index 00000000..eb36aad6 --- /dev/null +++ b/rc-v10.0.1/types/PartialHDPathTuple6.html @@ -0,0 +1 @@ +PartialHDPathTuple6 | @metamask/key-tree

Type Alias PartialHDPathTuple6

PartialHDPathTuple6: readonly [BIP32Node]
diff --git a/rc-v10.0.1/types/PartialHDPathTuple7.html b/rc-v10.0.1/types/PartialHDPathTuple7.html new file mode 100644 index 00000000..666c60c1 --- /dev/null +++ b/rc-v10.0.1/types/PartialHDPathTuple7.html @@ -0,0 +1 @@ +PartialHDPathTuple7 | @metamask/key-tree

Type Alias PartialHDPathTuple7

PartialHDPathTuple7: readonly [BIP32Node, BIP32Node]
diff --git a/rc-v10.0.1/types/PartialHDPathTuple8.html b/rc-v10.0.1/types/PartialHDPathTuple8.html new file mode 100644 index 00000000..44f490e0 --- /dev/null +++ b/rc-v10.0.1/types/PartialHDPathTuple8.html @@ -0,0 +1 @@ +PartialHDPathTuple8 | @metamask/key-tree

Type Alias PartialHDPathTuple8

PartialHDPathTuple8: readonly [HardenedBIP32Node, BIP32Node, BIP32Node]
diff --git a/rc-v10.0.1/types/PartialHDPathTuple9.html b/rc-v10.0.1/types/PartialHDPathTuple9.html new file mode 100644 index 00000000..f1b3b084 --- /dev/null +++ b/rc-v10.0.1/types/PartialHDPathTuple9.html @@ -0,0 +1 @@ +PartialHDPathTuple9 | @metamask/key-tree

Type Alias PartialHDPathTuple9

PartialHDPathTuple9: readonly [HardenedBIP32Node, BIP32Node]
diff --git a/rc-v10.0.1/types/RootedHDPathTuple.html b/rc-v10.0.1/types/RootedHDPathTuple.html new file mode 100644 index 00000000..c7775de1 --- /dev/null +++ b/rc-v10.0.1/types/RootedHDPathTuple.html @@ -0,0 +1 @@ +RootedHDPathTuple | @metamask/key-tree

Type Alias RootedHDPathTuple

RootedHDPathTuple:
    | RootedHDPathTuple0
    | RootedHDPathTuple1
    | RootedHDPathTuple2
    | RootedHDPathTuple3
    | RootedHDPathTuple4
    | RootedHDPathTuple5
diff --git a/rc-v10.0.1/types/RootedHDPathTuple0.html b/rc-v10.0.1/types/RootedHDPathTuple0.html new file mode 100644 index 00000000..6f3432ff --- /dev/null +++ b/rc-v10.0.1/types/RootedHDPathTuple0.html @@ -0,0 +1 @@ +RootedHDPathTuple0 | @metamask/key-tree

Type Alias RootedHDPathTuple0

RootedHDPathTuple0: readonly [BIP39Node]
diff --git a/rc-v10.0.1/types/RootedHDPathTuple1.html b/rc-v10.0.1/types/RootedHDPathTuple1.html new file mode 100644 index 00000000..00ebaaec --- /dev/null +++ b/rc-v10.0.1/types/RootedHDPathTuple1.html @@ -0,0 +1 @@ +RootedHDPathTuple1 | @metamask/key-tree

Type Alias RootedHDPathTuple1

RootedHDPathTuple1: readonly [...RootedHDPathTuple0, HardenedBIP32Node]
diff --git a/rc-v10.0.1/types/RootedHDPathTuple2.html b/rc-v10.0.1/types/RootedHDPathTuple2.html new file mode 100644 index 00000000..314985ee --- /dev/null +++ b/rc-v10.0.1/types/RootedHDPathTuple2.html @@ -0,0 +1 @@ +RootedHDPathTuple2 | @metamask/key-tree

Type Alias RootedHDPathTuple2

RootedHDPathTuple2: readonly [...RootedHDPathTuple1, HardenedBIP32Node]
diff --git a/rc-v10.0.1/types/RootedHDPathTuple3.html b/rc-v10.0.1/types/RootedHDPathTuple3.html new file mode 100644 index 00000000..83779579 --- /dev/null +++ b/rc-v10.0.1/types/RootedHDPathTuple3.html @@ -0,0 +1 @@ +RootedHDPathTuple3 | @metamask/key-tree

Type Alias RootedHDPathTuple3

RootedHDPathTuple3: readonly [...RootedHDPathTuple2, HardenedBIP32Node]
diff --git a/rc-v10.0.1/types/RootedHDPathTuple4.html b/rc-v10.0.1/types/RootedHDPathTuple4.html new file mode 100644 index 00000000..59c8808f --- /dev/null +++ b/rc-v10.0.1/types/RootedHDPathTuple4.html @@ -0,0 +1 @@ +RootedHDPathTuple4 | @metamask/key-tree

Type Alias RootedHDPathTuple4

RootedHDPathTuple4: readonly [...RootedHDPathTuple3, BIP32Node]
diff --git a/rc-v10.0.1/types/RootedHDPathTuple5.html b/rc-v10.0.1/types/RootedHDPathTuple5.html new file mode 100644 index 00000000..972d1e16 --- /dev/null +++ b/rc-v10.0.1/types/RootedHDPathTuple5.html @@ -0,0 +1 @@ +RootedHDPathTuple5 | @metamask/key-tree

Type Alias RootedHDPathTuple5

RootedHDPathTuple5: readonly [...RootedHDPathTuple4, BIP32Node]
diff --git a/rc-v10.0.1/types/RootedSLIP10PathTuple.html b/rc-v10.0.1/types/RootedSLIP10PathTuple.html new file mode 100644 index 00000000..b9dce7fe --- /dev/null +++ b/rc-v10.0.1/types/RootedSLIP10PathTuple.html @@ -0,0 +1 @@ +RootedSLIP10PathTuple | @metamask/key-tree

Type Alias RootedSLIP10PathTuple

RootedSLIP10PathTuple: readonly [BIP39Node, ...BIP32Node[] | SLIP10PathNode[] | CIP3PathNode[]]
diff --git a/rc-v10.0.1/types/SLIP10DerivationPathOptions.html b/rc-v10.0.1/types/SLIP10DerivationPathOptions.html new file mode 100644 index 00000000..bbbe0ef3 --- /dev/null +++ b/rc-v10.0.1/types/SLIP10DerivationPathOptions.html @@ -0,0 +1 @@ +SLIP10DerivationPathOptions | @metamask/key-tree

Type Alias SLIP10DerivationPathOptions

SLIP10DerivationPathOptions: {
    curve: SupportedCurve;
    derivationPath: RootedSLIP10PathTuple;
    network?: Network;
}
diff --git a/rc-v10.0.1/types/SLIP10ExtendedKeyOptions.html b/rc-v10.0.1/types/SLIP10ExtendedKeyOptions.html new file mode 100644 index 00000000..03b29c3b --- /dev/null +++ b/rc-v10.0.1/types/SLIP10ExtendedKeyOptions.html @@ -0,0 +1 @@ +SLIP10ExtendedKeyOptions | @metamask/key-tree

Type Alias SLIP10ExtendedKeyOptions

SLIP10ExtendedKeyOptions: {
    chainCode: string | Uint8Array;
    curve: SupportedCurve;
    depth: number;
    index: number;
    masterFingerprint?: number;
    network?: Network;
    parentFingerprint: number;
    privateKey?: string | Uint8Array;
    publicKey?: string | Uint8Array;
}
diff --git a/rc-v10.0.1/types/SLIP10NodeConstructorOptions.html b/rc-v10.0.1/types/SLIP10NodeConstructorOptions.html new file mode 100644 index 00000000..9d51a3d8 --- /dev/null +++ b/rc-v10.0.1/types/SLIP10NodeConstructorOptions.html @@ -0,0 +1 @@ +SLIP10NodeConstructorOptions | @metamask/key-tree

Type Alias SLIP10NodeConstructorOptions

SLIP10NodeConstructorOptions: {
    chainCode: Uint8Array;
    curve: SupportedCurve;
    depth: number;
    index: number;
    masterFingerprint?: number;
    network?: Network;
    parentFingerprint: number;
    privateKey?: Uint8Array;
    publicKey: Uint8Array;
}
diff --git a/rc-v10.0.1/types/SLIP10NodeInterface.html b/rc-v10.0.1/types/SLIP10NodeInterface.html new file mode 100644 index 00000000..d8c9e5ea --- /dev/null +++ b/rc-v10.0.1/types/SLIP10NodeInterface.html @@ -0,0 +1,5 @@ +SLIP10NodeInterface | @metamask/key-tree

Type Alias SLIP10NodeInterface

SLIP10NodeInterface: JsonSLIP10Node & {
    chainCodeBytes: Uint8Array;
    privateKeyBytes?: Uint8Array;
    publicKeyBytes: Uint8Array;
    toJSON(): JsonSLIP10Node;
}

Type declaration

  • chainCodeBytes: Uint8Array
  • OptionalprivateKeyBytes?: Uint8Array

    The private key for this node, as a Uint8Array. +May be undefined if this node is a public key only node.

    +
  • publicKeyBytes: Uint8Array

    The public key for this node, as a Uint8Array.

    +
  • toJSON:function
diff --git a/rc-v10.0.1/types/SLIP10Path.html b/rc-v10.0.1/types/SLIP10Path.html new file mode 100644 index 00000000..c7106a29 --- /dev/null +++ b/rc-v10.0.1/types/SLIP10Path.html @@ -0,0 +1 @@ +SLIP10Path | @metamask/key-tree
diff --git a/rc-v10.0.1/types/SLIP10PathNode.html b/rc-v10.0.1/types/SLIP10PathNode.html new file mode 100644 index 00000000..824ccddc --- /dev/null +++ b/rc-v10.0.1/types/SLIP10PathNode.html @@ -0,0 +1 @@ +SLIP10PathNode | @metamask/key-tree
diff --git a/rc-v10.0.1/types/SLIP10PathTuple.html b/rc-v10.0.1/types/SLIP10PathTuple.html new file mode 100644 index 00000000..2e931f55 --- /dev/null +++ b/rc-v10.0.1/types/SLIP10PathTuple.html @@ -0,0 +1 @@ +SLIP10PathTuple | @metamask/key-tree

Type Alias SLIP10PathTuple

SLIP10PathTuple: readonly BIP32Node[] | readonly SLIP10PathNode[] | readonly CIP3PathNode[]
diff --git a/rc-v10.0.1/types/SupportedCurve.html b/rc-v10.0.1/types/SupportedCurve.html new file mode 100644 index 00000000..3d724f33 --- /dev/null +++ b/rc-v10.0.1/types/SupportedCurve.html @@ -0,0 +1 @@ +SupportedCurve | @metamask/key-tree

Type Alias SupportedCurve

SupportedCurve: keyof typeof curves
diff --git a/rc-v10.0.1/types/UnhardenedBIP32Node.html b/rc-v10.0.1/types/UnhardenedBIP32Node.html new file mode 100644 index 00000000..eb4ee80a --- /dev/null +++ b/rc-v10.0.1/types/UnhardenedBIP32Node.html @@ -0,0 +1 @@ +UnhardenedBIP32Node | @metamask/key-tree

Type Alias UnhardenedBIP32Node

UnhardenedBIP32Node: `bip32:${number}`
diff --git a/rc-v10.0.1/types/UnhardenedCIP3Node.html b/rc-v10.0.1/types/UnhardenedCIP3Node.html new file mode 100644 index 00000000..1d388516 --- /dev/null +++ b/rc-v10.0.1/types/UnhardenedCIP3Node.html @@ -0,0 +1 @@ +UnhardenedCIP3Node | @metamask/key-tree

Type Alias UnhardenedCIP3Node

UnhardenedCIP3Node: `cip3:${number}`
diff --git a/rc-v10.0.1/types/UnhardenedSLIP10Node.html b/rc-v10.0.1/types/UnhardenedSLIP10Node.html new file mode 100644 index 00000000..dda9c68c --- /dev/null +++ b/rc-v10.0.1/types/UnhardenedSLIP10Node.html @@ -0,0 +1 @@ +UnhardenedSLIP10Node | @metamask/key-tree

Type Alias UnhardenedSLIP10Node

UnhardenedSLIP10Node: `slip10:${number}`
diff --git a/rc-v10.0.1/types/UnprefixedNode.html b/rc-v10.0.1/types/UnprefixedNode.html new file mode 100644 index 00000000..39ca3a40 --- /dev/null +++ b/rc-v10.0.1/types/UnprefixedNode.html @@ -0,0 +1 @@ +UnprefixedNode | @metamask/key-tree

Type Alias UnprefixedNode

UnprefixedNode: `${number}'`
diff --git a/rc-v10.0.1/variables/BIP44PurposeNodeToken.html b/rc-v10.0.1/variables/BIP44PurposeNodeToken.html new file mode 100644 index 00000000..955a28b0 --- /dev/null +++ b/rc-v10.0.1/variables/BIP44PurposeNodeToken.html @@ -0,0 +1 @@ +BIP44PurposeNodeToken | @metamask/key-tree

Variable BIP44PurposeNodeTokenConst

BIP44PurposeNodeToken: "bip32:44'" = ...
diff --git a/rc-v10.0.1/variables/BIP_32_HARDENED_OFFSET.html b/rc-v10.0.1/variables/BIP_32_HARDENED_OFFSET.html new file mode 100644 index 00000000..89a4baf1 --- /dev/null +++ b/rc-v10.0.1/variables/BIP_32_HARDENED_OFFSET.html @@ -0,0 +1 @@ +BIP_32_HARDENED_OFFSET | @metamask/key-tree

Variable BIP_32_HARDENED_OFFSETConst

BIP_32_HARDENED_OFFSET: 2147483648 = 0x80000000
diff --git a/rc-v10.0.1/variables/BIP_32_PATH_REGEX.html b/rc-v10.0.1/variables/BIP_32_PATH_REGEX.html new file mode 100644 index 00000000..7b1c5a17 --- /dev/null +++ b/rc-v10.0.1/variables/BIP_32_PATH_REGEX.html @@ -0,0 +1,6 @@ +BIP_32_PATH_REGEX | @metamask/key-tree

Variable BIP_32_PATH_REGEXConst

BIP_32_PATH_REGEX: RegExp = ...

e.g.

+
    +
  • bip32:0
  • +
  • bip32:0'
  • +
+
diff --git a/rc-v10.0.1/variables/BIP_39_PATH_REGEX.html b/rc-v10.0.1/variables/BIP_39_PATH_REGEX.html new file mode 100644 index 00000000..937f966a --- /dev/null +++ b/rc-v10.0.1/variables/BIP_39_PATH_REGEX.html @@ -0,0 +1,3 @@ +BIP_39_PATH_REGEX | @metamask/key-tree

Variable BIP_39_PATH_REGEXConst

BIP_39_PATH_REGEX: RegExp = ...

bip39:<SPACE_DELMITED_SEED_PHRASE>

+

The seed phrase must consist of 12 <= 24 words.

+
diff --git a/rc-v10.0.1/variables/BIP_44_COIN_TYPE_DEPTH.html b/rc-v10.0.1/variables/BIP_44_COIN_TYPE_DEPTH.html new file mode 100644 index 00000000..dfb4c751 --- /dev/null +++ b/rc-v10.0.1/variables/BIP_44_COIN_TYPE_DEPTH.html @@ -0,0 +1 @@ +BIP_44_COIN_TYPE_DEPTH | @metamask/key-tree

Variable BIP_44_COIN_TYPE_DEPTHConst

BIP_44_COIN_TYPE_DEPTH = 2
diff --git a/rc-v10.0.1/variables/BYTES_KEY_LENGTH.html b/rc-v10.0.1/variables/BYTES_KEY_LENGTH.html new file mode 100644 index 00000000..027977b0 --- /dev/null +++ b/rc-v10.0.1/variables/BYTES_KEY_LENGTH.html @@ -0,0 +1 @@ +BYTES_KEY_LENGTH | @metamask/key-tree

Variable BYTES_KEY_LENGTHConst

BYTES_KEY_LENGTH = 32
diff --git a/rc-v10.0.1/variables/CIP_3_PATH_REGEX.html b/rc-v10.0.1/variables/CIP_3_PATH_REGEX.html new file mode 100644 index 00000000..4073c0c7 --- /dev/null +++ b/rc-v10.0.1/variables/CIP_3_PATH_REGEX.html @@ -0,0 +1,6 @@ +CIP_3_PATH_REGEX | @metamask/key-tree

Variable CIP_3_PATH_REGEXConst

CIP_3_PATH_REGEX: RegExp = ...

e.g.

+
    +
  • cip3:0
  • +
  • cip3:0'
  • +
+
diff --git a/rc-v10.0.1/variables/MAX_BIP_32_INDEX.html b/rc-v10.0.1/variables/MAX_BIP_32_INDEX.html new file mode 100644 index 00000000..e7c3d058 --- /dev/null +++ b/rc-v10.0.1/variables/MAX_BIP_32_INDEX.html @@ -0,0 +1 @@ +MAX_BIP_32_INDEX | @metamask/key-tree

Variable MAX_BIP_32_INDEXConst

MAX_BIP_32_INDEX: 4294967295 = 0xffffffff
diff --git a/rc-v10.0.1/variables/MAX_BIP_44_DEPTH.html b/rc-v10.0.1/variables/MAX_BIP_44_DEPTH.html new file mode 100644 index 00000000..e79c5ea9 --- /dev/null +++ b/rc-v10.0.1/variables/MAX_BIP_44_DEPTH.html @@ -0,0 +1 @@ +MAX_BIP_44_DEPTH | @metamask/key-tree

Variable MAX_BIP_44_DEPTHConst

MAX_BIP_44_DEPTH = 5
diff --git a/rc-v10.0.1/variables/MAX_UNHARDENED_BIP_32_INDEX.html b/rc-v10.0.1/variables/MAX_UNHARDENED_BIP_32_INDEX.html new file mode 100644 index 00000000..2804f206 --- /dev/null +++ b/rc-v10.0.1/variables/MAX_UNHARDENED_BIP_32_INDEX.html @@ -0,0 +1 @@ +MAX_UNHARDENED_BIP_32_INDEX | @metamask/key-tree

Variable MAX_UNHARDENED_BIP_32_INDEXConst

MAX_UNHARDENED_BIP_32_INDEX: 2147483647 = 0x7fffffff
diff --git a/rc-v10.0.1/variables/MIN_BIP_44_DEPTH.html b/rc-v10.0.1/variables/MIN_BIP_44_DEPTH.html new file mode 100644 index 00000000..81863866 --- /dev/null +++ b/rc-v10.0.1/variables/MIN_BIP_44_DEPTH.html @@ -0,0 +1 @@ +MIN_BIP_44_DEPTH | @metamask/key-tree

Variable MIN_BIP_44_DEPTHConst

MIN_BIP_44_DEPTH = 0
diff --git a/rc-v10.0.1/variables/SLIP_10_PATH_REGEX.html b/rc-v10.0.1/variables/SLIP_10_PATH_REGEX.html new file mode 100644 index 00000000..a3d8607c --- /dev/null +++ b/rc-v10.0.1/variables/SLIP_10_PATH_REGEX.html @@ -0,0 +1,6 @@ +SLIP_10_PATH_REGEX | @metamask/key-tree

Variable SLIP_10_PATH_REGEXConst

SLIP_10_PATH_REGEX: RegExp = ...

e.g.

+
    +
  • slip10:0
  • +
  • slip10:0'
  • +
+
diff --git a/rc-v10.0.1/variables/UNPREFIXED_BIP_32_PATH_REGEX.html b/rc-v10.0.1/variables/UNPREFIXED_BIP_32_PATH_REGEX.html new file mode 100644 index 00000000..5cd4aa2d --- /dev/null +++ b/rc-v10.0.1/variables/UNPREFIXED_BIP_32_PATH_REGEX.html @@ -0,0 +1,6 @@ +UNPREFIXED_BIP_32_PATH_REGEX | @metamask/key-tree

Variable UNPREFIXED_BIP_32_PATH_REGEXConst

UNPREFIXED_BIP_32_PATH_REGEX: RegExp = ...

e.g.

+
    +
  • 0
  • +
  • 0'
  • +
+
diff --git a/rc-v10.0.1/variables/UNPREFIXED_PATH_REGEX.html b/rc-v10.0.1/variables/UNPREFIXED_PATH_REGEX.html new file mode 100644 index 00000000..38b0f054 --- /dev/null +++ b/rc-v10.0.1/variables/UNPREFIXED_PATH_REGEX.html @@ -0,0 +1 @@ +UNPREFIXED_PATH_REGEX | @metamask/key-tree

Variable UNPREFIXED_PATH_REGEXConst

UNPREFIXED_PATH_REGEX: RegExp = ...
diff --git a/rc-v10.0.1/variables/ed25519.compressedPublicKeyLength.html b/rc-v10.0.1/variables/ed25519.compressedPublicKeyLength.html new file mode 100644 index 00000000..73f4a220 --- /dev/null +++ b/rc-v10.0.1/variables/ed25519.compressedPublicKeyLength.html @@ -0,0 +1 @@ +compressedPublicKeyLength | @metamask/key-tree

Variable compressedPublicKeyLengthConst

compressedPublicKeyLength = 33
diff --git a/rc-v10.0.1/variables/ed25519.curve.html b/rc-v10.0.1/variables/ed25519.curve.html new file mode 100644 index 00000000..5b220581 --- /dev/null +++ b/rc-v10.0.1/variables/ed25519.curve.html @@ -0,0 +1 @@ +curve | @metamask/key-tree
curve: Readonly<{
    a: bigint;
    adjustScalarBytes?: ((bytes: Uint8Array) => Uint8Array);
    allowInfinityPoint?: boolean;
    d: bigint;
    domain?: ((data: Uint8Array, ctx: Uint8Array, phflag: boolean) => Uint8Array);
    Fp: IField<bigint>;
    Gx: bigint;
    Gy: bigint;
    h: bigint;
    hash: FHash;
    hEff?: bigint;
    mapToCurve?: ((scalar: bigint[]) => AffinePoint<bigint>);
    n: bigint;
    nBitLength: number;
    nByteLength: number;
    p: bigint;
    prehash?: FHash;
    randomBytes: ((bytesLength?: number) => Uint8Array);
    uvRatio?: ((u: bigint, v: bigint) => {
        isValid: boolean;
        value: bigint;
    });
}> = ed25519.CURVE
diff --git a/rc-v10.0.1/variables/ed25519.deriveUnhardenedKeys.html b/rc-v10.0.1/variables/ed25519.deriveUnhardenedKeys.html new file mode 100644 index 00000000..65ae51a9 --- /dev/null +++ b/rc-v10.0.1/variables/ed25519.deriveUnhardenedKeys.html @@ -0,0 +1 @@ +deriveUnhardenedKeys | @metamask/key-tree

Variable deriveUnhardenedKeysConst

deriveUnhardenedKeys = false
diff --git a/rc-v10.0.1/variables/ed25519.masterNodeGenerationSpec.html b/rc-v10.0.1/variables/ed25519.masterNodeGenerationSpec.html new file mode 100644 index 00000000..7389ff65 --- /dev/null +++ b/rc-v10.0.1/variables/ed25519.masterNodeGenerationSpec.html @@ -0,0 +1 @@ +masterNodeGenerationSpec | @metamask/key-tree

Variable masterNodeGenerationSpecConst

masterNodeGenerationSpec: "slip10" = 'slip10'
diff --git a/rc-v10.0.1/variables/ed25519.name.html b/rc-v10.0.1/variables/ed25519.name.html new file mode 100644 index 00000000..c8cc6591 --- /dev/null +++ b/rc-v10.0.1/variables/ed25519.name.html @@ -0,0 +1 @@ +name | @metamask/key-tree
name: "ed25519" = 'ed25519'
diff --git a/rc-v10.0.1/variables/ed25519.privateKeyLength.html b/rc-v10.0.1/variables/ed25519.privateKeyLength.html new file mode 100644 index 00000000..ee3a7664 --- /dev/null +++ b/rc-v10.0.1/variables/ed25519.privateKeyLength.html @@ -0,0 +1 @@ +privateKeyLength | @metamask/key-tree

Variable privateKeyLengthConst

privateKeyLength = 32
diff --git a/rc-v10.0.1/variables/ed25519.publicKeyLength.html b/rc-v10.0.1/variables/ed25519.publicKeyLength.html new file mode 100644 index 00000000..d0082b7c --- /dev/null +++ b/rc-v10.0.1/variables/ed25519.publicKeyLength.html @@ -0,0 +1 @@ +publicKeyLength | @metamask/key-tree

Variable publicKeyLengthConst

publicKeyLength = 33
diff --git a/rc-v10.0.1/variables/ed25519.secret.html b/rc-v10.0.1/variables/ed25519.secret.html new file mode 100644 index 00000000..35fa8479 --- /dev/null +++ b/rc-v10.0.1/variables/ed25519.secret.html @@ -0,0 +1 @@ +secret | @metamask/key-tree
secret: Uint8Array = ...
diff --git a/rc-v10.0.1/variables/ed25519Bip32.compressedPublicKeyLength.html b/rc-v10.0.1/variables/ed25519Bip32.compressedPublicKeyLength.html new file mode 100644 index 00000000..9d45150e --- /dev/null +++ b/rc-v10.0.1/variables/ed25519Bip32.compressedPublicKeyLength.html @@ -0,0 +1 @@ +compressedPublicKeyLength | @metamask/key-tree

Variable compressedPublicKeyLengthConst

compressedPublicKeyLength = 32
diff --git a/rc-v10.0.1/variables/ed25519Bip32.curve.html b/rc-v10.0.1/variables/ed25519Bip32.curve.html new file mode 100644 index 00000000..af4be601 --- /dev/null +++ b/rc-v10.0.1/variables/ed25519Bip32.curve.html @@ -0,0 +1 @@ +curve | @metamask/key-tree
curve: Readonly<{
    a: bigint;
    adjustScalarBytes?: ((bytes: Uint8Array) => Uint8Array);
    allowInfinityPoint?: boolean;
    d: bigint;
    domain?: ((data: Uint8Array, ctx: Uint8Array, phflag: boolean) => Uint8Array);
    Fp: IField<bigint>;
    Gx: bigint;
    Gy: bigint;
    h: bigint;
    hash: FHash;
    hEff?: bigint;
    mapToCurve?: ((scalar: bigint[]) => AffinePoint<bigint>);
    n: bigint;
    nBitLength: number;
    nByteLength: number;
    p: bigint;
    prehash?: FHash;
    randomBytes: ((bytesLength?: number) => Uint8Array);
    uvRatio?: ((u: bigint, v: bigint) => {
        isValid: boolean;
        value: bigint;
    });
}> = ed25519.CURVE
diff --git a/rc-v10.0.1/variables/ed25519Bip32.deriveUnhardenedKeys.html b/rc-v10.0.1/variables/ed25519Bip32.deriveUnhardenedKeys.html new file mode 100644 index 00000000..2586831c --- /dev/null +++ b/rc-v10.0.1/variables/ed25519Bip32.deriveUnhardenedKeys.html @@ -0,0 +1 @@ +deriveUnhardenedKeys | @metamask/key-tree

Variable deriveUnhardenedKeysConst

deriveUnhardenedKeys = true
diff --git a/rc-v10.0.1/variables/ed25519Bip32.masterNodeGenerationSpec.html b/rc-v10.0.1/variables/ed25519Bip32.masterNodeGenerationSpec.html new file mode 100644 index 00000000..653ab172 --- /dev/null +++ b/rc-v10.0.1/variables/ed25519Bip32.masterNodeGenerationSpec.html @@ -0,0 +1 @@ +masterNodeGenerationSpec | @metamask/key-tree

Variable masterNodeGenerationSpecConst

masterNodeGenerationSpec: "cip3" = 'cip3'
diff --git a/rc-v10.0.1/variables/ed25519Bip32.name.html b/rc-v10.0.1/variables/ed25519Bip32.name.html new file mode 100644 index 00000000..913fb765 --- /dev/null +++ b/rc-v10.0.1/variables/ed25519Bip32.name.html @@ -0,0 +1,5 @@ +name | @metamask/key-tree
name: "ed25519Bip32" = 'ed25519Bip32'

Named after whitepaper: BIP32-Ed25519 Hierarchical Deterministic Keys over a Non-linear Keyspace +https://input-output-hk.github.io/adrestia/static/Ed25519_BIP.pdf +"vanilla" "ed25519" curve follows SLIP10: https://tezos.stackexchange.com/questions/2837/can-i-use-bip32-hd-key-pairs-to-derive-ed25519-addresses +note that that the important difference of the "bip32" version is that it allows unhardened key derivation

+
diff --git a/rc-v10.0.1/variables/ed25519Bip32.privateKeyLength.html b/rc-v10.0.1/variables/ed25519Bip32.privateKeyLength.html new file mode 100644 index 00000000..24f713ae --- /dev/null +++ b/rc-v10.0.1/variables/ed25519Bip32.privateKeyLength.html @@ -0,0 +1 @@ +privateKeyLength | @metamask/key-tree
privateKeyLength = 64
diff --git a/rc-v10.0.1/variables/ed25519Bip32.publicKeyLength.html b/rc-v10.0.1/variables/ed25519Bip32.publicKeyLength.html new file mode 100644 index 00000000..716cdef3 --- /dev/null +++ b/rc-v10.0.1/variables/ed25519Bip32.publicKeyLength.html @@ -0,0 +1 @@ +publicKeyLength | @metamask/key-tree
publicKeyLength = 32
diff --git a/rc-v10.0.1/variables/ed25519Bip32.secret.html b/rc-v10.0.1/variables/ed25519Bip32.secret.html new file mode 100644 index 00000000..caa865f0 --- /dev/null +++ b/rc-v10.0.1/variables/ed25519Bip32.secret.html @@ -0,0 +1 @@ +secret | @metamask/key-tree
secret: Uint8Array = ...
diff --git a/rc-v10.0.1/variables/secp256k1.compressedPublicKeyLength.html b/rc-v10.0.1/variables/secp256k1.compressedPublicKeyLength.html new file mode 100644 index 00000000..9916939d --- /dev/null +++ b/rc-v10.0.1/variables/secp256k1.compressedPublicKeyLength.html @@ -0,0 +1 @@ +compressedPublicKeyLength | @metamask/key-tree

Variable compressedPublicKeyLengthConst

compressedPublicKeyLength = 33
diff --git a/rc-v10.0.1/variables/secp256k1.curve.html b/rc-v10.0.1/variables/secp256k1.curve.html new file mode 100644 index 00000000..e216b84f --- /dev/null +++ b/rc-v10.0.1/variables/secp256k1.curve.html @@ -0,0 +1 @@ +curve | @metamask/key-tree
curve: Readonly<{
    a: bigint;
    allowedPrivateKeyLengths?: readonly number[];
    allowInfinityPoint?: boolean;
    b: bigint;
    bits2int?: ((bytes: Uint8Array) => bigint);
    bits2int_modN?: ((bytes: Uint8Array) => bigint);
    clearCofactor?: ((c: ProjConstructor<bigint>, point: ProjPointType<bigint>) => ProjPointType<bigint>);
    endo?: {
        beta: bigint;
        splitScalar: ((k: bigint) => {
            k1: bigint;
            k1neg: boolean;
            k2: bigint;
            k2neg: boolean;
        });
    };
    Fp: IField<bigint>;
    Gx: bigint;
    Gy: bigint;
    h: bigint;
    hash: CHash;
    hEff?: bigint;
    hmac: ((key: Uint8Array, ...messages: Uint8Array[]) => Uint8Array);
    isTorsionFree?: ((c: ProjConstructor<bigint>, point: ProjPointType<bigint>) => boolean);
    lowS: boolean;
    n: bigint;
    nBitLength: number;
    nByteLength: number;
    p: bigint;
    randomBytes: ((bytesLength?: number) => Uint8Array);
    wrapPrivateKey?: boolean;
}> = secp256k1.CURVE
diff --git a/rc-v10.0.1/variables/secp256k1.deriveUnhardenedKeys.html b/rc-v10.0.1/variables/secp256k1.deriveUnhardenedKeys.html new file mode 100644 index 00000000..7639cd68 --- /dev/null +++ b/rc-v10.0.1/variables/secp256k1.deriveUnhardenedKeys.html @@ -0,0 +1 @@ +deriveUnhardenedKeys | @metamask/key-tree

Variable deriveUnhardenedKeysConst

deriveUnhardenedKeys = true
diff --git a/rc-v10.0.1/variables/secp256k1.masterNodeGenerationSpec.html b/rc-v10.0.1/variables/secp256k1.masterNodeGenerationSpec.html new file mode 100644 index 00000000..83bb732b --- /dev/null +++ b/rc-v10.0.1/variables/secp256k1.masterNodeGenerationSpec.html @@ -0,0 +1 @@ +masterNodeGenerationSpec | @metamask/key-tree

Variable masterNodeGenerationSpecConst

masterNodeGenerationSpec: "slip10" = 'slip10'
diff --git a/rc-v10.0.1/variables/secp256k1.name.html b/rc-v10.0.1/variables/secp256k1.name.html new file mode 100644 index 00000000..9cc1f179 --- /dev/null +++ b/rc-v10.0.1/variables/secp256k1.name.html @@ -0,0 +1 @@ +name | @metamask/key-tree
name: "secp256k1" = 'secp256k1'
diff --git a/rc-v10.0.1/variables/secp256k1.privateKeyLength.html b/rc-v10.0.1/variables/secp256k1.privateKeyLength.html new file mode 100644 index 00000000..07f98df0 --- /dev/null +++ b/rc-v10.0.1/variables/secp256k1.privateKeyLength.html @@ -0,0 +1 @@ +privateKeyLength | @metamask/key-tree

Variable privateKeyLengthConst

privateKeyLength = 32
diff --git a/rc-v10.0.1/variables/secp256k1.publicKeyLength.html b/rc-v10.0.1/variables/secp256k1.publicKeyLength.html new file mode 100644 index 00000000..4f23563e --- /dev/null +++ b/rc-v10.0.1/variables/secp256k1.publicKeyLength.html @@ -0,0 +1 @@ +publicKeyLength | @metamask/key-tree

Variable publicKeyLengthConst

publicKeyLength = 65
diff --git a/rc-v10.0.1/variables/secp256k1.secret.html b/rc-v10.0.1/variables/secp256k1.secret.html new file mode 100644 index 00000000..a48dfc27 --- /dev/null +++ b/rc-v10.0.1/variables/secp256k1.secret.html @@ -0,0 +1 @@ +secret | @metamask/key-tree
secret: Uint8Array = ...