From 5c9ec4ffadac26ac3395d220d88f876df7eff3d7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 27 Nov 2024 10:26:45 +0000 Subject: [PATCH] Deploy to GitHub pages --- .nojekyll | 1 + CNAME | 1 + assets/highlight.css | 85 + assets/icons.js | 15 + assets/icons.svg | 1 + assets/main.js | 59 + assets/navigation.js | 1 + assets/search.js | 1 + assets/style.css | 1412 +++++++++++++++++ ...maphore_protocol_data.SemaphoreEthers.html | 47 + ...phore_protocol_data.SemaphoreSubgraph.html | 47 + classes/_semaphore_protocol_group.Group.html | 59 + ..._semaphore_protocol_identity.Identity.html | 69 + ...emaphore_protocol_proof.generateProof.html | 20 + ...phore_protocol_proof.packGroth16Proof.html | 4 + ...ore_protocol_proof.unpackGroth16Proof.html | 4 + ..._semaphore_protocol_proof.verifyProof.html | 5 + ...emaphore_protocol_utils.decodeMessage.html | 9 + ...re_protocol_utils.getDeployedContract.html | 5 + ...ore_protocol_utils.getHardhatNetworks.html | 5 + ...ore_protocol_utils.isSupportedNetwork.html | 3 + index.html | 318 ++++ modules/_semaphore_protocol_data.html | 113 ++ modules/_semaphore_protocol_group.html | 95 ++ modules/_semaphore_protocol_identity.html | 87 + modules/_semaphore_protocol_proof.html | 84 + .../_semaphore_protocol_utils.constants.html | 5 + modules/_semaphore_protocol_utils.html | 70 + ...semaphore_protocol_data.EthersNetwork.html | 1 + ...semaphore_protocol_data.EthersOptions.html | 1 + ..._semaphore_protocol_data.GroupOptions.html | 1 + ...semaphore_protocol_data.GroupResponse.html | 1 + ..._semaphore_protocol_group.MerkleProof.html | 9 + types/_semaphore_protocol_identity.Point.html | 1 + ...semaphore_protocol_identity.Signature.html | 1 + ...maphore_protocol_proof.SemaphoreProof.html | 1 + ...phore_protocol_utils.SupportedNetwork.html | 1 + ...re_protocol_utils.constants.MAX_DEPTH.html | 1 + ...re_protocol_utils.constants.MIN_DEPTH.html | 1 + ...protocol_utils.constants.SemaphoreABI.html | 1 + ...col_utils.constants.SemaphoreBytecode.html | 1 + ...maphore_protocol_utils.defaultNetwork.html | 1 + ...hore_protocol_utils.deployedContracts.html | 1 + ...hore_protocol_utils.supportedNetworks.html | 1 + 44 files changed, 2649 insertions(+) create mode 100644 .nojekyll create mode 100644 CNAME create mode 100644 assets/highlight.css create mode 100644 assets/icons.js create mode 100644 assets/icons.svg create mode 100644 assets/main.js create mode 100644 assets/navigation.js create mode 100644 assets/search.js create mode 100644 assets/style.css create mode 100644 classes/_semaphore_protocol_data.SemaphoreEthers.html create mode 100644 classes/_semaphore_protocol_data.SemaphoreSubgraph.html create mode 100644 classes/_semaphore_protocol_group.Group.html create mode 100644 classes/_semaphore_protocol_identity.Identity.html create mode 100644 functions/_semaphore_protocol_proof.generateProof.html create mode 100644 functions/_semaphore_protocol_proof.packGroth16Proof.html create mode 100644 functions/_semaphore_protocol_proof.unpackGroth16Proof.html create mode 100644 functions/_semaphore_protocol_proof.verifyProof.html create mode 100644 functions/_semaphore_protocol_utils.decodeMessage.html create mode 100644 functions/_semaphore_protocol_utils.getDeployedContract.html create mode 100644 functions/_semaphore_protocol_utils.getHardhatNetworks.html create mode 100644 functions/_semaphore_protocol_utils.isSupportedNetwork.html create mode 100644 index.html create mode 100644 modules/_semaphore_protocol_data.html create mode 100644 modules/_semaphore_protocol_group.html create mode 100644 modules/_semaphore_protocol_identity.html create mode 100644 modules/_semaphore_protocol_proof.html create mode 100644 modules/_semaphore_protocol_utils.constants.html create mode 100644 modules/_semaphore_protocol_utils.html create mode 100644 types/_semaphore_protocol_data.EthersNetwork.html create mode 100644 types/_semaphore_protocol_data.EthersOptions.html create mode 100644 types/_semaphore_protocol_data.GroupOptions.html create mode 100644 types/_semaphore_protocol_data.GroupResponse.html create mode 100644 types/_semaphore_protocol_group.MerkleProof.html create mode 100644 types/_semaphore_protocol_identity.Point.html create mode 100644 types/_semaphore_protocol_identity.Signature.html create mode 100644 types/_semaphore_protocol_proof.SemaphoreProof.html create mode 100644 types/_semaphore_protocol_utils.SupportedNetwork.html create mode 100644 variables/_semaphore_protocol_utils.constants.MAX_DEPTH.html create mode 100644 variables/_semaphore_protocol_utils.constants.MIN_DEPTH.html create mode 100644 variables/_semaphore_protocol_utils.constants.SemaphoreABI.html create mode 100644 variables/_semaphore_protocol_utils.constants.SemaphoreBytecode.html create mode 100644 variables/_semaphore_protocol_utils.defaultNetwork.html create mode 100644 variables/_semaphore_protocol_utils.deployedContracts.html create mode 100644 variables/_semaphore_protocol_utils.supportedNetworks.html diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e2ac6616a --- /dev/null +++ b/.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/CNAME b/CNAME new file mode 100644 index 000000000..5c50c2ca6 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +js.semaphore.pse.dev \ No newline at end of file diff --git a/assets/highlight.css b/assets/highlight.css new file mode 100644 index 000000000..2da8aaf91 --- /dev/null +++ b/assets/highlight.css @@ -0,0 +1,85 @@ +:root { + --light-hl-0: #795E26; + --dark-hl-0: #DCDCAA; + --light-hl-1: #000000; + --dark-hl-1: #D4D4D4; + --light-hl-2: #A31515; + --dark-hl-2: #CE9178; + --light-hl-3: #008000; + --dark-hl-3: #6A9955; + --light-hl-4: #AF00DB; + --dark-hl-4: #C586C0; + --light-hl-5: #001080; + --dark-hl-5: #9CDCFE; + --light-hl-6: #0000FF; + --dark-hl-6: #569CD6; + --light-hl-7: #0070C1; + --dark-hl-7: #4FC1FF; + --light-hl-8: #098658; + --dark-hl-8: #B5CEA8; + --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/assets/icons.js b/assets/icons.js new file mode 100644 index 000000000..b79c9e89f --- /dev/null +++ b/assets/icons.js @@ -0,0 +1,15 @@ +(function(svg) { + svg.innerHTML = ``; + svg.style.display = 'none'; + if (location.protocol === 'file:') { + if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', updateUseElements); + else updateUseElements() + function updateUseElements() { + document.querySelectorAll('use').forEach(el => { + if (el.getAttribute('href').includes('#icon-')) { + el.setAttribute('href', el.getAttribute('href').replace(/.*#/, '#')); + } + }); + } + } +})(document.body.appendChild(document.createElementNS('http://www.w3.org/2000/svg', 'svg'))) \ No newline at end of file diff --git a/assets/icons.svg b/assets/icons.svg new file mode 100644 index 000000000..7dead6118 --- /dev/null +++ b/assets/icons.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/main.js b/assets/main.js new file mode 100644 index 000000000..d6f138860 --- /dev/null +++ b/assets/main.js @@ -0,0 +1,59 @@ +"use strict"; +"use strict";(()=>{var Ce=Object.create;var ne=Object.defineProperty;var Pe=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,Re=Object.prototype.hasOwnProperty;var Me=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Fe=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Oe(e))!Re.call(t,i)&&i!==n&&ne(t,i,{get:()=>e[i],enumerable:!(r=Pe(e,i))||r.enumerable});return t};var De=(t,e,n)=>(n=t!=null?Ce(_e(t)):{},Fe(e||!t||!t.__esModule?ne(n,"default",{value:t,enumerable:!0}):n,t));var ae=Me((se,oe)=>{(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),y=s.str.charAt(1),p;y in s.node.edges?p=s.node.edges[y]:(p=new t.TokenSet,s.node.edges[y]=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 se=="object"?oe.exports=n():e.lunr=n()}(this,function(){return t})})()});var re=[];function G(t,e){re.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){re.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&&(console.log("Show page"),document.body.style.removeProperty("display"),this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}scrollToHash(){if(location.hash){console.log("Scorlling");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&&!e.checkVisibility()){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").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&&n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let r=document.createElement("p");r.classList.add("warning"),r.textContent="This member is normally hidden due to your filter settings.",n.prepend(r)}}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="Copied!",e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent="Copy"},100)},1e3)})})}};var ie=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var de=De(ae());async function le(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=de.Index.load(i.index),e.classList.remove("loading"),e.classList.add("ready")}function he(){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",()=>{le(e,t)}),le(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");let s=!1;i.addEventListener("mousedown",()=>s=!0),i.addEventListener("mouseup",()=>{s=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{s||(s=!1,t.classList.remove("has-focus"))}),Ae(t,i,r,e)}function Ae(t,e,n,r){n.addEventListener("input",ie(()=>{Ve(t,e,n,r)},200));let i=!1;n.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Ne(e,n):s.key=="Escape"?n.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),n.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!n.matches(":focus")&&s.key==="/"&&(n.focus(),s.preventDefault())})}function Ve(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=ce(l.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(d+=` (score: ${s[o].score.toFixed(2)})`),l.parent&&(d=` + ${ce(l.parent,i)}.${d}`);let y=document.createElement("li");y.classList.value=l.classes??"";let p=document.createElement("a");p.href=r.base+l.url,p.innerHTML=u+d,y.append(p),e.appendChild(y)}}function ue(t,e){let n=t.querySelector(".current");if(!n)n=t.querySelector(e==1?"li:first-child":"li:last-child"),n&&n.classList.add("current");else{let r=n;if(e===1)do r=r.nextElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);else do r=r.previousElementSibling??void 0;while(r instanceof HTMLElement&&r.offsetParent==null);r&&(n.classList.remove("current"),r.classList.add("current"))}}function Ne(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),e.blur()}}function ce(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(K(t.substring(s,o)),`${K(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(K(t.substring(s))),i.join("")}var He={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>He[e])}var I=class{constructor(e){this.el=e.el,this.app=e.app}};var F="mousedown",fe="mousemove",H="mouseup",J={x:0,y:0},pe=!1,ee=!1,Be=!1,D=!1,me=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(me?"is-mobile":"not-mobile");me&&"ontouchstart"in document.documentElement&&(Be=!0,F="touchstart",fe="touchmove",H="touchend");document.addEventListener(F,t=>{ee=!0,D=!1;let e=F=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(fe,t=>{if(ee&&!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(H,()=>{ee=!1});document.addEventListener("click",t=>{pe&&(t.preventDefault(),t.stopImmediatePropagation(),pe=!1)});var X=class extends I{constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener(H,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(F,n=>this.onDocumentPointerDown(n)),document.addEventListener(H,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 te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var ye=document.head.appendChild(document.createElement("style"));ye.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()),ye.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 ge(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ve(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ve(t.value)})}function ve(t){document.documentElement.dataset.theme=t}var Le;function be(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",xe),xe())}async function xe(){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();Le=t.dataset.base+"/",t.innerHTML="";for(let s of i)we(s,t,[]);window.app.createComponents(t),window.app.showPage(),window.app.ensureActivePageVisible()}function we(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-index-accordion`:"tsd-index-accordion",s.dataset.key=i.join("$");let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.innerHTML='',Ee(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)we(u,l,i)}else Ee(t,r,t.class)}function Ee(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));r.href=Le+t.path,n&&(r.className=n),location.pathname===r.pathname&&r.classList.add("current"),t.kind&&(r.innerHTML=``),r.appendChild(document.createElement("span")).textContent=t.text}else e.appendChild(document.createElement("span")).textContent=t.text}G(X,"a[data-toggle]");G(Z,".tsd-index-accordion");G(Y,".tsd-filter-item input[type=checkbox]");var Se=document.getElementById("tsd-theme");Se&&ge(Se);var je=new U;Object.defineProperty(window,"app",{value:je});he();be();})(); +/*! 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/assets/navigation.js b/assets/navigation.js new file mode 100644 index 000000000..2323a4e42 --- /dev/null +++ b/assets/navigation.js @@ -0,0 +1 @@ +window.navigationData = "data:application/octet-stream;base64,H4sIAAAAAAAAA6WWUW/aMBSF/4ufoRu06zae1q4V5YEOjT5MqhBy40tiEWzLvumKpv73CbIEO86MA+/3nM8+PrnK8x+C8IZkRL4Z2FCVSQ19pSXKROakR5KM50yDIKPnepJRpKRHFMWMjMhGsiIH82FZ65eVfrmbvMhws3Nac8HIaNhuOa+095iBNgf3JKfGhNwbSpc2GH557/mQefGSaqqyUzCVNgQqj/II+Fvq9QGCWxVCOKpGah+/fh58GnqIHwq5FKYj4p/qGGKsZaG6EmxRFOAnGCWFgW6EStWOWFiQdDce19b9aFRdx65pqD2l6di3diszBb3OYaalXMUkUbpaotYgeuXJdk6G9bnpwxuCFjQnTkScgUCO27iUqumooCaedSir2nrSynATm0kuMCar2nWv6BqUtT54KigWOqqqNbRWnfNCyu1F6HlUSxuO7Nzo1pXeru7YR56CAE2xCVkVItkviQDIkbqc6ys7HZqsx1piNrg+gdJUN0FR3SjEeYfw9Scd4xU0X21P4FtCL2i7iAXy3MQVcT8aVcRECoNUYCfjWuQirtoR05tfy7v72dPDAfFKNacvsZDawMVd2lWfTh7PhFQGAUj99d3cTk7l2B4xqNstQiIZnM2rjDyo3bF5oZTUCKzDD1RJbCqP7SYGK1rk6HFibudqAykyULncAvsuBWqa2C2P4zTkAZRp3L8jypMHb7V7xykYQ1OI3TXVjSxpYK2ngHeNy3cDtRiEcQ9Us4yin14kraEPwLj5f8tjYL6+ZW0v3hd/Ac+m+CXfDQAA" \ No newline at end of file diff --git a/assets/search.js b/assets/search.js new file mode 100644 index 000000000..6ee21ddb7 --- /dev/null +++ b/assets/search.js @@ -0,0 +1 @@ +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA9VdXY/byLH9L/KrrFXzo0nO081mg42ROAnWi+ACA2PAkThjZvUFkpqsY/i/B91UU1XNKo5ENqnM04w93cVTdapPdRcp8dus2P+7nN3df5v9lu/WsztvPtul22x2N/u/Mtumhy/7Int/KPbVfrXf/LBOq3Q2nx2Lzexutt2vj5us/OGhGfhgBj6ogYsv1XYzm89Wm7Qss3J2N5t9n5vrCC9urvTJzP9T9SUryuYCp4n8BayJxAXns0NaZLuqy58zqFCc3V/td2VVHFfVvhgG6B22dB042yKM4NILGrQPq/2uKtJVNRArtHNGWpXr93n5/lDkL2mVOcW9y6p/74vfhsI+m5kE9f5Q5fvdwEx9B8yMhNqTnggCmNMukoTMEbdI3aQFlRVucbpJBCoPhuJcBmeBfc6qn4v98TAQJjAzLs4P66ERxZbGRfsx2z4OLlvv2tbGRf3PdJOv0ypb/6PY759coW9bHceLvATBGojdtuWuQlN7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HMlUqMv/DNn3L/HlHlG8J8pVtp5f5f/BWBdBimluSdU99MPWx/mAqIAYkvN+c9bnK07VfjWGMl1wRsi3gPg6snktOGKt8m5VVukWa7oNQsHvWZuZzhU9G8P4AJ27N5I01GTAXcIv+eFjrRkNLGQFsVm7sbj3sdpmcFKaF45kWjmdaOA2tgTnEB2Zw2HQPzWBpBkdmcGQGs7LfceL2AaNm3xdyufGSFfnT1/byBzYSLinquWpxpdURa6sE8+nM/jyfHfJDpo5Es7v7z9+//xejWfSQLMgAAA=="; \ No newline at end of file diff --git a/assets/style.css b/assets/style.css new file mode 100644 index 000000000..778b94927 --- /dev/null +++ b/assets/style.css @@ -0,0 +1,1412 @@ +:root { + /* Light */ + --light-color-background: #f2f4f8; + --light-color-background-secondary: #eff0f1; + --light-color-warning-text: #222; + --light-color-background-warning: #e6e600; + --light-color-icon-background: var(--light-color-background); + --light-color-accent: #c5c7c9; + --light-color-active-menu-item: var(--light-color-accent); + --light-color-text: #222; + --light-color-text-aside: #6e6e6e; + --light-color-link: #1f70c2; + + --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: var(--light-color-ts-class); + --light-color-ts-property: var(--light-color-ts-variable); + --light-color-ts-method: var(--light-color-ts-function); + --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: var(--light-color-ts-property); + --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-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-icon-background: var(--dark-color-background-secondary); + --dark-color-accent: #9096a2; + --dark-color-active-menu-item: #5d5d6a; + --dark-color-text: #f5f5f5; + --dark-color-text-aside: #dddddd; + --dark-color-link: #00aff4; + + --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: var(--dark-color-ts-class); + --dark-color-ts-property: var(--dark-color-ts-variable); + --dark-color-ts-method: var(--dark-color-ts-function); + --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: var(--dark-color-ts-property); + --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-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-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-link: var(--light-color-link); + + --color-ts-keyword: var(--light-color-ts-keyword); + --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-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); + + --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-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-link: var(--dark-color-link); + + --color-ts-keyword: var(--dark-color-ts-keyword); + --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-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); + + --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-link: var(--light-color-link); + + --color-ts-keyword: var(--light-color-ts-keyword); + --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-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); + + --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-link: var(--dark-color-link); + + --color-ts-keyword: var(--dark-color-ts-keyword); + --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-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); + + --external-icon: var(--dark-external-icon); + --color-scheme: var(--dark-color-scheme); +} + +.always-visible, +.always-visible .tsd-signatures { + display: inherit !important; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + line-height: 1.2; +} + +h1 > a:not(.link), +h2 > a:not(.link), +h3 > a:not(.link), +h4 > a:not(.link), +h5 > a:not(.link), +h6 > a:not(.link) { + text-decoration: none; + color: var(--color-text); +} + +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; +} + +.uppercase { + text-transform: uppercase; +} + +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; +} +.tsd-generator { + 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; +} + +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; + 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: fit-content; + width: -moz-fit-content; + align-items: center; + user-select: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-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 + svg { + transform: scale(0.95); +} +.tsd-filter-input input[type="checkbox"]:focus:not(:focus-visible) + svg { + transform: scale(1); +} +.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); +} + +.tsd-theme-toggle { + padding-top: 0.75rem; +} +.tsd-theme-toggle > h4 { + display: inline; + vertical-align: middle; + margin-right: 0.75rem; +} + +.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-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 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 { + user-select: none; + -moz-user-select: none; + -webkit-user-select: none; + -ms-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-index-accordion .tsd-accordion-summary > svg { + margin-left: 0.25rem; +} +.tsd-index-content > :not(:first-child) { + margin-top: 0.75rem; +} +.tsd-index-heading { + margin-top: 1.5rem; + margin-bottom: 0.75rem; +} + +.tsd-kind-icon { + margin-right: 0.5rem; + width: 1.25rem; + height: 1.25rem; + min-width: 1.25rem; + min-height: 1.25rem; +} +.tsd-kind-icon path { + transform-origin: center; + transform: scale(1.1); +} +.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: 4rem 0; +} +.tsd-panel-group.tsd-index-group { + margin: 2rem 0; +} +.tsd-panel-group.tsd-index-group details { + margin: 2rem 0; +} + +#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-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-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-literal { + color: var(--color-ts-type-literal); +} +.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%; + } +} + +/* 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 0; + } + + .page-menu, + .site-menu { + max-height: calc(100vh - 2rem - 42px); + overflow: auto; + position: sticky; + top: 42px; + } +} diff --git a/classes/_semaphore_protocol_data.SemaphoreEthers.html b/classes/_semaphore_protocol_data.SemaphoreEthers.html new file mode 100644 index 000000000..cc3b2ecce --- /dev/null +++ b/classes/_semaphore_protocol_data.SemaphoreEthers.html @@ -0,0 +1,47 @@ +SemaphoreEthers | Semaphore SDK

The SemaphoreEthers class provides a high-level interface to interact with the Semaphore smart contract +using the ethers.js library. It encapsulates all necessary functionalities to connect to Ethereum networks, +manage contract instances, and perform operations such as retrieving group information or checking group memberships. +This class simplifies the interaction with the Ethereum blockchain by abstracting the details of network connections +and contract interactions.

+

Constructors

  • Constructs a new SemaphoreEthers instance, initializing it with a network or a custom Ethereum node URL, +and optional configuration settings for the ethers provider and contract.

    +

    Parameters

    • networkOrEthereumURL: string = defaultNetwork

      The Ethereum network name or a custom JSON-RPC URL to connect to.

      +
    • options: EthersOptions = {}

      Configuration options for the ethers provider and the Semaphore contract.

      +

    Returns SemaphoreEthers

Properties

_contract: Contract
_network: string
_options: EthersOptions

Accessors

  • get contract(): Contract
  • Retrieves the ethers Contract instance used to interact with the Semaphore contract.

    +

    Returns Contract

    The Contract instance.

    +
  • get network(): string
  • Retrieves the Ethereum network or custom URL currently used by this instance.

    +

    Returns string

    The network or URL as a string.

    +

Methods

  • Retrieves detailed information about a specific group by its ID. This method queries the Semaphore contract +to get the group's admin, Merkle tree root, depth, and size.

    +

    Parameters

    • groupId: string

      The unique identifier of the group.

      +

    Returns Promise<GroupResponse>

    A promise that resolves to a GroupResponse object.

    +
  • Fetches the list of group IDs from the Semaphore contract by querying the "GroupCreated" events.

    +

    Returns Promise<string[]>

    A promise that resolves to an array of group IDs as strings.

    +
  • Fetches a list of members from a specific group. This method queries the Semaphore contract for events +related to member additions and updates, and constructs the list of current group members.

    +

    Parameters

    • groupId: string

      The unique identifier of the group.

      +

    Returns Promise<string[]>

    A promise that resolves to an array of member identity commitments as strings.

    +
  • Retrieves a list of validated proofs for a specific group. This method queries the Semaphore contract +for "ProofValidated" events and returns details about each proof.

    +

    Parameters

    • groupId: string

      The unique identifier of the group.

      +

    Returns Promise<any>

    A promise that resolves to an array of validated proofs.

    +
  • Checks whether a specific member is part of a group. This method queries the Semaphore contract +to determine if the provided identity commitment is a member of the specified group.

    +

    Parameters

    • groupId: string

      The unique identifier of the group.

      +
    • member: string

      The identity commitment of the member to check.

      +

    Returns Promise<boolean>

    A promise that resolves to true if the member is part of the group, otherwise false.

    +
\ No newline at end of file diff --git a/classes/_semaphore_protocol_data.SemaphoreSubgraph.html b/classes/_semaphore_protocol_data.SemaphoreSubgraph.html new file mode 100644 index 000000000..38ffb3a59 --- /dev/null +++ b/classes/_semaphore_protocol_data.SemaphoreSubgraph.html @@ -0,0 +1,47 @@ +SemaphoreSubgraph | Semaphore SDK

The SemaphoreSubgraph class provides an interface to interact with the Semaphore smart contract +via subgraph queries. It enables operations such as retrieving lists of group members and validated proofs, +as well as checking membership within groups. +Each group in Semaphore is represented as a LeanIMT +(Lean Incremental Merkle Tree). This class supports interaction through either a +SupportedNetwork or a direct URL to the subgraph. The subgraphs themselves are hosted on +The Graph protocol, facilitating efficient and decentralized query processing.

+

Constructors

  • Initializes the SemaphoreSubgraph instance with a supported network or a custom subgraph URL. +This allows to interact with the Semaphore smart contract through the specified endpoint.

    +

    Parameters

    • networkOrSubgraphURL: string = defaultNetwork

      Either a supported network identifier or a direct URL to the subgraph.

      +

    Returns SemaphoreSubgraph

Properties

_url: string

Accessors

  • get url(): string
  • Retrieves the URL of the subgraph currently being used by the instance. +This URL points to the specific subgraph where Semaphore data is stored.

    +

    Returns string

    The URL of the subgraph.

    +

Methods

  • Fetches detailed information about a specific group by its ID. This method can also retrieve +members and validated proofs for the group if requested via options.

    +

    Parameters

    • groupId: string

      The unique identifier of the group.

      +
    • options: Omit<GroupOptions, "filters"> = {}

      Configuration options to specify which details to fetch about the group.

      +

    Returns Promise<GroupResponse>

    A promise that resolves to the details of the specified group.

    +
  • Fetches a list of all group IDs from the subgraph. This method queries the subgraph to retrieve +identifiers for all groups managed by the Semaphore smart contract.

    +

    Returns Promise<string[]>

    A promise that resolves to an array of group IDs.

    +
  • Retrieves a list of members from a specific group.

    +

    Parameters

    • groupId: string

      The unique identifier of the group.

      +

    Returns Promise<string[]>

    A promise that resolves to an array of group members' identity commitments.

    +
  • Fetches a list of validated proofs for a specific group.

    +

    Parameters

    • groupId: string

      The unique identifier of the group.

      +

    Returns Promise<any[]>

    A promise that resolves to an array of validated proofs.

    +
  • Retrieves detailed information about groups from the subgraph based on the provided options. +This method can filter groups by various parameters and include additional details like members +and validated proofs if specified in the options.

    +

    Parameters

    • options: GroupOptions = {}

      Configuration options to filter groups and specify which additional details to fetch.

      +

    Returns Promise<GroupResponse[]>

    A promise that resolves to an array of group details.

    +
  • Determines whether a specific member is part of a group. This method queries the subgraph to check +if the provided member's identity commitment exists within the specified group.

    +

    Parameters

    • groupId: string

      The unique identifier of the group.

      +
    • member: string

      The identity commitment of the member to check.

      +

    Returns Promise<boolean>

    A promise that resolves to true if the member is part of the group, otherwise false.

    +
\ No newline at end of file diff --git a/classes/_semaphore_protocol_group.Group.html b/classes/_semaphore_protocol_group.Group.html new file mode 100644 index 000000000..aa4e51144 --- /dev/null +++ b/classes/_semaphore_protocol_group.Group.html @@ -0,0 +1,59 @@ +Group | Semaphore SDK

The Semaphore group is a LeanIMT +(Lean Incremental Merkle Tree), i.e. an optimized version of the incremental binary Merkle tree +used by Semaphore V3. The new tree does not use zero hashes, and its depth is dynamic. +The members of a Semaphore group, or the leaves of a tree, are the identity commitments. +Thanks to the properties of Merkle trees, it can be efficiently demonstrated that a group +member belongs to the group. +This class supports operations such as member addition, update, removal and Merkle proof +generation and verification. Groups can also be exported or imported.

+

Constructors

  • Creates a new instance of the Group. Optionally, a list of identity commitments can +be passed as a parameter. Adding members in chunks is more efficient than adding +them one by one with the addMember function.

    +

    Parameters

    • members: BigNumber[] = []

      A list of identity commitments.

      +

    Returns Group

Properties

leanIMT: LeanIMT<bigint>

Accessors

  • get members(): bigint[]
  • Returns the members (i.e. identity commitments) of the group.

    +

    Returns bigint[]

    The list of members of the group.

    +
  • get size(): number
  • Returns the size of the tree (i.e. number of leaves).

    +

    Returns number

    The tree size as a number.

    +

Methods

  • Adds a new member to the group.

    +

    Parameters

    • member: BigNumber

      The new member to be added.

      +

    Returns void

  • Adds new members to the group.

    +

    Parameters

    • members: BigNumber[]

      New members.

      +

    Returns void

  • Enables the conversion of the group into a JSON string that +can be re-used for future imports. This approach is beneficial for +large groups, as it avoids re-calculating the tree hashes.

    +

    Returns string

    The stringified JSON of the group.

    +
  • Returns the index of a member. If the member does not exist it returns -1.

    +

    Parameters

    • member: BigNumber

      A member of the group.

      +

    Returns number

    The index of the member, or -1 if it does not exist.

    +
  • Removes a member from the group.

    +

    Parameters

    • index: number

      The index of the member to be removed.

      +

    Returns void

  • Updates a member in the group.

    +

    Parameters

    • index: number

      Index of the member to be updated.

      +
    • member: BigNumber

      New member value.

      +

    Returns void

  • Imports an entire group by initializing the tree without calculating +any hashes. Note that it is crucial to ensure the integrity of the +exported group.

    +

    Parameters

    • nodes: string

      The stringified JSON of the group.

      +

    Returns Group

    The Group instance.

    +
\ No newline at end of file diff --git a/classes/_semaphore_protocol_identity.Identity.html b/classes/_semaphore_protocol_identity.Identity.html new file mode 100644 index 000000000..e02284f72 --- /dev/null +++ b/classes/_semaphore_protocol_identity.Identity.html @@ -0,0 +1,69 @@ +Identity | Semaphore SDK

The Semaphore identity is essentially an EdDSA +public/private key pair. The EdDSA implementation +in this library uses Baby Jubjub for public key generation +and Poseidon for signatures. +In addition, the commitment, i.e. the hash of the public key, is used to represent +Semaphore identities in groups, adding an additional layer of privacy and security. +The private key of the identity can be exported as a base64 string.

+

Constructors

  • Initializes the class attributes based on a given private key, which must be text or a buffer. +If the private key is not passed as a parameter, a random private key will be generated. +The EdDSAPoseidon class is used to generate the secret scalar and the public key. +Additionally, the constructor computes a commitment of the public key using a hash function (Poseidon).

    +

    Parameters

    • Optional privateKey: string | Buffer | Uint8Array

      The private key used to derive the public key (hexadecimal or string).

      +

    Returns Identity

    Example

    // Generates an identity.
    const { privateKey, publicKey, commitment } = new Identity("private-key") +
    +

    Example

    // Generates an identity with a random private key.
    const { privateKey, publicKey, commitment } = new Identity() +
    +

Properties

_commitment: bigint
_privateKey: string | Buffer | Uint8Array
_publicKey: Point<bigint>
_secretScalar: bigint

Accessors

  • get privateKey(): string | Buffer | Uint8Array
  • Returns the private key.

    +

    Returns string | Buffer | Uint8Array

    The private key as a buffer or text.

    +

Methods

  • Generates a signature for a given message using the private key. +This method demonstrates how to sign a message and could be used +for authentication or data integrity.

    +

    Parameters

    • message: BigNumberish

      The message to be signed.

      +

    Returns Signature<bigint>

    A Signature object containing the signature components.

    +

    Example

    const identity = new Identity()
    const signature = identity.signMessage("message") +
    +
  • Generates the commitment from the given public key. +This static method is particularly useful after signature verification, +as it allows retrieval of the corresponding commitment associated with the public key.

    +

    Parameters

    • publicKey: Point

      The public key to generate the commitment.

      +

    Returns bigint

    The Semaphore identity commitment.

    +

    Example

    const identity = new Identity()
    Identity.generateCommitment(identity.publicKey) +
    +
  • Returns a Semaphore identity based on a private key encoded as a base64 string. +The private key will be converted to a buffer, regardless of its original type.

    +

    Parameters

    • privateKey: string

      The private key as a base64 string.

      +

    Returns Identity

    The Semaphore identity.

    +
  • Verifies a signature against a given message and public key. +This static method allows for the verification of signatures without needing +an instance of the Identity class. It's useful for cases where you only have +the public key, the message and a signature, and need to verify if they match.

    +

    Parameters

    • message: BigNumberish

      The message that was signed.

      +
    • signature: Signature

      The signature to verify.

      +
    • publicKey: Point

      The public key to use for verification.

      +

    Returns boolean

    A boolean indicating whether the signature is valid.

    +

    Example

    const identity = new Identity()
    const signature = identity.signMessage("message")
    Identity.verifySignature("message", signature, identity.publicKey) +
    +
\ No newline at end of file diff --git a/functions/_semaphore_protocol_proof.generateProof.html b/functions/_semaphore_protocol_proof.generateProof.html new file mode 100644 index 000000000..a06a9f3b7 --- /dev/null +++ b/functions/_semaphore_protocol_proof.generateProof.html @@ -0,0 +1,20 @@ +generateProof | Semaphore SDK
  • It generates a Semaphore proof, i.e. a zero-knowledge proof that an identity that +is part of a group has shared an anonymous message. +The message may be any arbitrary user-defined value (e.g. a vote), or the hash of that value. +The scope is a value used like a topic on which users can generate a valid proof only once, +for example the id of an election in which voters can only vote once. +The hash of the identity's scope and secret scalar is called a nullifier and can be +used to verify whether that identity has already generated a valid proof in that scope. +The depth of the tree determines which zero-knowledge artifacts to use to generate the proof. +If it is not defined, it will be inferred from the group or Merkle proof passed as the second parameter. +Finally, the artifacts themselves can be passed manually with file paths, +or they will be automatically fetched. +Please keep in mind that groups with 1 member or 2 members cannot be considered anonymous.

    +

    Parameters

    • identity: Identity

      The Semaphore identity.

      +
    • groupOrMerkleProof: Group | MerkleProof

      The Semaphore group or its Merkle proof.

      +
    • message: Uint8Array | BigNumberish

      The Semaphore message.

      +
    • scope: Uint8Array | BigNumberish

      The Semaphore scope.

      +
    • Optional merkleTreeDepth: number

      The depth of the tree with which the circuit was compiled.

      +
    • Optional snarkArtifacts: SnarkArtifacts

    Returns Promise<SemaphoreProof>

    The Semaphore proof ready to be verified.

    +
\ No newline at end of file diff --git a/functions/_semaphore_protocol_proof.packGroth16Proof.html b/functions/_semaphore_protocol_proof.packGroth16Proof.html new file mode 100644 index 000000000..458478856 --- /dev/null +++ b/functions/_semaphore_protocol_proof.packGroth16Proof.html @@ -0,0 +1,4 @@ +packGroth16Proof | Semaphore SDK
  • Packs a Snarkjs Groth16 proof into a single list usable as calldata in Solidity (public signals are not included).

    +

    Parameters

    • proof: Groth16Proof

      The Groth16 proof generated with SnarkJS.

      +

    Returns PackedGroth16Proof

    Solidity calldata.

    +
\ No newline at end of file diff --git a/functions/_semaphore_protocol_proof.unpackGroth16Proof.html b/functions/_semaphore_protocol_proof.unpackGroth16Proof.html new file mode 100644 index 000000000..3cf065a36 --- /dev/null +++ b/functions/_semaphore_protocol_proof.unpackGroth16Proof.html @@ -0,0 +1,4 @@ +unpackGroth16Proof | Semaphore SDK
  • Unpacks a PackedGroth16Proof Solidity calldata into its original form which is a SnarkJS Groth16 proof.

    +

    Parameters

    • proof: PackedGroth16Proof

      Solidity calldata.

      +

    Returns Groth16Proof

    The Groth16 proof compatible with SnarkJS.

    +
\ No newline at end of file diff --git a/functions/_semaphore_protocol_proof.verifyProof.html b/functions/_semaphore_protocol_proof.verifyProof.html new file mode 100644 index 000000000..9a31fa895 --- /dev/null +++ b/functions/_semaphore_protocol_proof.verifyProof.html @@ -0,0 +1,5 @@ +verifyProof | Semaphore SDK
  • Verifies whether a Semaphore proof is valid. Depending on the depth of the tree used to +generate the proof, a different verification key will be used.

    +

    Parameters

    Returns Promise<boolean>

    True if the proof is valid, false otherwise.

    +
\ No newline at end of file diff --git a/functions/_semaphore_protocol_utils.decodeMessage.html b/functions/_semaphore_protocol_utils.decodeMessage.html new file mode 100644 index 000000000..c467dffe6 --- /dev/null +++ b/functions/_semaphore_protocol_utils.decodeMessage.html @@ -0,0 +1,9 @@ +decodeMessage | Semaphore SDK
  • Typically used for decoding on-chain Semaphore messages. +When Semaphore messages are text they are converted to bigints before +the proof is generated (and eventually sent on-chain). +This function help devs converting bigint messages to text again. +If the original message was not text the output of this +function won't probably be human-readable text.

    +

    Parameters

    • message: BigNumberish

      The Semaphore message as a bigint.

      +

    Returns string

    The Semaphore message as a text.

    +
\ No newline at end of file diff --git a/functions/_semaphore_protocol_utils.getDeployedContract.html b/functions/_semaphore_protocol_utils.getDeployedContract.html new file mode 100644 index 000000000..57ba9d7ec --- /dev/null +++ b/functions/_semaphore_protocol_utils.getDeployedContract.html @@ -0,0 +1,5 @@ +getDeployedContract | Semaphore SDK
  • Returns name, address and start block of a Semaphore contract deployed +on a specific supported network.

    +

    Parameters

    • supportedNetwork: "sepolia" | "arbitrum-sepolia" | "optimism-sepolia" | "matic-amoy" | "arbitrum" | "matic" | "optimism" | "base-sepolia" | "linea-sepolia" | "base" | "linea" | "scroll-sepolia"

      The network supported by Semaphore.

      +

    Returns {
        address: string;
        name: string;
        startBlock: number;
    }

    An object with name, address and start block of the deployed contract.

    +
    • address: string
    • name: string
    • startBlock: number
\ No newline at end of file diff --git a/functions/_semaphore_protocol_utils.getHardhatNetworks.html b/functions/_semaphore_protocol_utils.getHardhatNetworks.html new file mode 100644 index 000000000..2eda50b29 --- /dev/null +++ b/functions/_semaphore_protocol_utils.getHardhatNetworks.html @@ -0,0 +1,5 @@ +getHardhatNetworks | Semaphore SDK
  • Utility function to get an object compatible with the Hardhat 'networks' option. +If the private key is not defined it returns an empty object.

    +

    Parameters

    • Optional privateKey: string

      Private key to be used with networks.

      +

    Returns any

    An object compatible with the Hardhat 'networks' option.

    +
\ No newline at end of file diff --git a/functions/_semaphore_protocol_utils.isSupportedNetwork.html b/functions/_semaphore_protocol_utils.isSupportedNetwork.html new file mode 100644 index 000000000..61bb9108b --- /dev/null +++ b/functions/_semaphore_protocol_utils.isSupportedNetwork.html @@ -0,0 +1,3 @@ +isSupportedNetwork | Semaphore SDK
  • Returns true if a network is supported by Semaphore, false otherwise.

    +

    Parameters

    • supportedNetwork: string

      The network to be checked.

      +

    Returns boolean

\ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 000000000..176daacab --- /dev/null +++ b/index.html @@ -0,0 +1,318 @@ +Semaphore SDK

Semaphore SDK

+

+ + + + Semaphore icon + +

+

+ +

+ + + + + Github license + + + GitHub Workflow test + + + Coveralls + + + DeepScan grade + + + Linter eslint + + + Code style prettier + + Repository top language + + + + + Commitizen friendly + +

+ + + + + + + + + +
Semaphore is a generic privacy layer. Leveraging zero-knowledge technology, users can prove their membership in groups and send messages (extending from votes to endorsements) off-chain or across EVM-compatible blockchains, all without revealing their personal identity.
+

The core of the Semaphore protocol is in the circuit logic. However, Semaphore also provides Solidity contracts and JavaScript libraries to make the steps for offchain proof creation and onchain/offchain verification easier. To learn more about Semaphore visit semaphore.pse.dev.

+
+

[!IMPORTANT]
Help Semaphore prosper by sharing your ideas with the PSE acceleration program.

+
+

📦 Packages

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PackageVersionDownloads
+ + @semaphore-protocol/core + + + + + NPM version + + + + + Downloads + +
+ + @semaphore-protocol/contracts + + + + + NPM version + + + + + Downloads + +
+ + @semaphore-protocol/identity + + + (docs) + + + + + NPM version + + + + + Downloads + +
+ + @semaphore-protocol/group + + + (docs) + + + + + NPM version + + + + + Downloads + +
+ + @semaphore-protocol/proof + + + (docs) + + + + + NPM version + + + + + Downloads + +
+ + @semaphore-protocol/data + + + (docs) + + + + + NPM version + + + + + Downloads + +
+ + @semaphore-protocol/hardhat + + + + + NPM version + + + + + Downloads + +
+ + @semaphore-protocol/cli + + + + + NPM version + + + + + Downloads + +
+ + @semaphore-protocol/utils + + + (docs) + + + + + NPM version + + + + + Downloads + +
+ +

🛠 Install

Clone this repository:

+
git clone https://github.com/semaphore-protocol/semaphore.git
+
+

And install the dependencies:

+
cd semaphore && yarn
+
+

📜 Usage

Copy the .env.example file as .env:

+
cp .env.example .env
+
+

And add your environment variables.

+

Code quality and formatting

Run ESLint to analyze the code and catch bugs:

+
yarn lint
+
+

Run Prettier to check formatting rules:

+
yarn format
+
+

Or to automatically format the code:

+
yarn format:write
+
+

Conventional commits

Semaphore uses conventional commits. A command line utility to commit using the correct syntax can be used by running:

+
git commit
+
+

It will also automatically check that the modified files comply with ESLint and Prettier rules.

+

Testing

Run Jest to test the JS libraries:

+
yarn test:libraries
+
+

Run Mocha to test the contracts:

+
yarn test:contracts
+
+

Or test everything with:

+
yarn test
+
+

Build libraries & compile contracts

Run Rollup and TheGraph to build all the packages and the subgraph:

+
yarn build
+
+

Compile the smart contracts with Hardhat:

+
yarn compile:contracts
+
+

Documentation (JS libraries)

Run TypeDoc to generate a documentation website for each package:

+
yarn docs
+
+

The output will be placed on the docs folder.

+

Releases

Bump a new version with:

+
yarn version:bump <version>
# e.g. yarn version:bump 2.0.0 +
+

It will create a commit and a git tag that will need to be pushed on the main branch. A workflow will be triggered and will +publish the Semaphore packages on npm and release a new version on Github with its changelogs automatically.

+
\ No newline at end of file diff --git a/modules/_semaphore_protocol_data.html b/modules/_semaphore_protocol_data.html new file mode 100644 index 000000000..daf8adcee --- /dev/null +++ b/modules/_semaphore_protocol_data.html @@ -0,0 +1,113 @@ +@semaphore-protocol/data | Semaphore SDK

Module @semaphore-protocol/data

+

+ Semaphore data +

+

A library for querying Semaphore smart contract.

+

+ +

+ + + + + NPM license + + + NPM version + + + Downloads + + + Documentation typedoc + + + Linter eslint + + + Code style prettier + +

+ + + + + + + + + +
This library provides tools for querying and interacting with the Semaphore.sol smart contract. It supports both the Semaphore subgraph and direct Ethereum network connections via Ethers. Designed for use in both Node.js and browser environments, it facilitates the management of group data and verification processes within the Semaphore protocol.
+

🛠 Install

npm or yarn

Install the @semaphore-protocol/data package with npm:

+
npm i @semaphore-protocol/data
+
+

or yarn:

+
yarn add @semaphore-protocol/data
+
+

📜 Usage

For detailed information on the functions provided by @semaphore-protocol/data, please refer to the TypeDoc documentation.

+

Creating and Managing Subgraphs

Initialize a Semaphore Subgraph instance

+
import { SemaphoreSubgraph } from "@semaphore-protocol/data"

const semaphoreSubgraph = new SemaphoreSubgraph()

// or:
const semaphoreSubgraphOnArbitrum = new SemaphoreSubgraph("arbitrum")

// or:
const customSubgraph = new SemaphoreSubgraph(
"https://api.studio.thegraph.com/query/14377/<your-subgraph>/<your-version>"
) +
+

With your SemaphoreSubgraph, you can:

+

Query Group IDs

+
const groupIds = await semaphoreSubgraph.getGroupIds()
+
+

Query Group Details

+
const group = await semaphoreSubgraph.getGroup("42")
const { members, verifiedProofs } = await semaphoreSubgraph.getGroup("42", { members: true, verifiedProofs: true }) +
+

Query Group Members

+
const members = await semaphoreSubgraph.getGroupMembers("42")
+
+

Query Verified Proofs

+
const verifiedProofs = await semaphoreSubgraph.getGroupVerifiedProofs("42")
+
+

Check Group Membership

+
const isMember = await semaphoreSubgraph.isGroupMember(
"42",
"16948514235341957898454876473214737047419402240398321289450170535251226167324"
) +
+

Using Ethers for Direct Blockchain Interaction

Initialize a Semaphore Ethers instance

+
import { SemaphoreEthers } from "@semaphore-protocol/data"

const semaphoreEthers = new SemaphoreEthers()

// or:
const semaphoreEthersOnHomestead = new SemaphoreEthers("homestead", {
address: "semaphore-address",
startBlock: 0
})

// or:
const localEthersInstance = new SemaphoreEthers("http://localhost:8545", {
address: "semaphore-address"
}) +
+

With your SemaphoreEthers instance, you can:

+

Fetch Group IDs

+
const groupIds = await semaphoreEthers.getGroupIds()
+
+

Fetch Group Details

+
const group = await semaphoreEthers.getGroup("42")
+
+

Fetch Group Admin

+
const admin = await semaphoreEthers.getGroupAdmin("42")
+
+

Fetch Group Members

+
const members = await semaphoreEthers.getGroupMembers("42")
+
+

Fetch Verified Proofs

+
const verifiedProofs = await semaphoreEthers.getGroupVerifiedProofs("42")
+
+

Check Group Membership

+
const isMember = await semaphoreEthers.isGroupMember(
"42",
"16948514235341957898454876473214737047419402240398321289450170535251226167324"
) +
+

Index

Classes

Type Aliases

\ No newline at end of file diff --git a/modules/_semaphore_protocol_group.html b/modules/_semaphore_protocol_group.html new file mode 100644 index 000000000..cbc1c3e0a --- /dev/null +++ b/modules/_semaphore_protocol_group.html @@ -0,0 +1,95 @@ +@semaphore-protocol/group | Semaphore SDK

Module @semaphore-protocol/group

+

+ Semaphore group +

+

A library to create and manage Semaphore groups.

+

+ +

+ + + + + NPM license + + + NPM version + + + Downloads + + + Documentation typedoc + + + Linter eslint + + + Code style prettier + +

+ + + + + + + + + +
This library is an abstraction of the LeanIMT data structure (part of @zk-kit/imt). The main goal is to make it easier to create offchain groups, which are also used to generate Semaphore proofs. Semaphore groups are actually Merkle trees, and the group members are tree leaves.
+

🛠 Install

npm or yarn

Install the @semaphore-protocol/group package with npm:

+
npm i @semaphore-protocol/group
+
+

or yarn:

+
yarn add @semaphore-protocol/group
+
+

📜 Usage

For more information on the functions provided by @semaphore-protocol/group, please refer to the TypeDoc documentation.

+

# new Group(members: BigNumberish[] = []): Group

+
import { Group } from "@semaphore-protocol/group"
import { Identity } from "@semaphore-protocol/identity"

const group1 = new Group()

const identity1 = new Identity()
const identity2 = new Identity()

const group2 = new Group([identity1.commitment, identity2.commitment]) +
+

# addMember(member: BigNumberish)

+
import { Group } from "@semaphore-protocol/group"
import { Identity } from "@semaphore-protocol/identity"

const group = new Group()

const { commitment } = new Identity()

group.addMember(commitment)

// 12989101133047504182892154686643420754368236204022364847543591045056549053997n
console.log(group.members[0]) +
+

# addMembers(members: BigNumberish[])

+
import { Group } from "@semaphore-protocol/group"
import { Identity } from "@semaphore-protocol/identity"

const group = new Group()

const identity1 = new Identity()
const identity2 = new Identity()

group.addMembers([identity1.commitment, identity2.commitment]) +
+

# updateMember(index: number, member: BigNumberish)

+
import { Group } from "@semaphore-protocol/group"

const group = new Group([1n, 3n])

group.updateMember(0, 2)

console.log(group.members[0]) // "2n" +
+

# removeMember(index: number)

+
import { Group } from "@semaphore-protocol/group"

const group = new Group([1n, 3n])

group.removeMember(0)

console.log(group.members[0]) // 0n +
+

# indexOf(member: BigNumberish): number

+
import { Group } from "@semaphore-protocol/group"

const group = new Group([1n])

const index = group.indexOf(1)

console.log(index) // 0 +
+

# generateMerkleProof(index: number): MerkleProof

+
import { Group } from "@semaphore-protocol/group"

const group = new Group([1n, 3n])

const proof = group.generateMerkleProof(0)

console.log(proof)
/*
{
index: 0,
leaf: '1',
root: '21106761926285267690763443010820487107972411248208546226053195422384279971821',
siblings: [ '3' ]
}
*/ +
+

# export(): string

+
import { Group } from "@semaphore-protocol/group"

const group = new Group([1n, 2n, 3n])

const exportedGroup = group.export()

console.log(exportedGroup)
/*
[["1","2","3"],["7853200120776062878684798364095072458815029376092732009249414926327459813530","3"],["13816780880028945690020260331303642730075999758909899334839547418969502592169"]]
*/ +
+

# import(exportedGroup: string): Group

+
import { Group } from "@semaphore-protocol/group"

const group1 = new Group([1n, 2n, 3n])

const exportedGroup = group.export()

const group2 = Group.import(exportedGroup)

assert(group1.root === group2.root) +
+

Index

Classes

Type Aliases

\ No newline at end of file diff --git a/modules/_semaphore_protocol_identity.html b/modules/_semaphore_protocol_identity.html new file mode 100644 index 000000000..cde57f324 --- /dev/null +++ b/modules/_semaphore_protocol_identity.html @@ -0,0 +1,87 @@ +@semaphore-protocol/identity | Semaphore SDK

Module @semaphore-protocol/identity

+

+ Semaphore identity +

+

A library to create Semaphore identities.

+

+ +

+ + + + + NPM license + + + NPM version + + + Downloads + + + Documentation typedoc + + + Linter eslint + + + Code style prettier + +

+ + + + + + + + + +
This library provides a class that can be used to create identities compatible with the Semaphore circuits. Each identity contains an EdDSA private key, its public key, and the identity commitment, which is the Poseidon hash of the public key.
+

🛠 Install

npm or yarn

Install the @semaphore-protocol/identity package with npm:

+
npm i @semaphore-protocol/identity
+
+

or yarn:

+
yarn add @semaphore-protocol/identity
+
+

📜 Usage

For more information on the functions provided by @semaphore-protocol/identity, please refer to the TypeDoc documentation.

+

# new Identity(privateKey?: BigNumberish): Identity

+
import { Identity } from "@semaphore-protocol/identity"

// The identity will be generated randomly.
const { privateKey, publicKey, commitment } = new Identity()

// Alternatively, you can pass your private key.
const identity = new Identity("your-private-key") +
+

# identity.export(): string

+
import { Identity } from "@semaphore-protocol/identity"

const identity = new Identity()

const privateKey = identity.export() +
+

# identity.import(privateKey: string): Identity

+
import { Identity } from "@semaphore-protocol/identity"

const identity = new Identity()

const privateKey = identity.export()

const identity2 = Identity.import(privateKey) +
+

# identity.signMessage(message: BigNumberish): Signature<string>

+
import { Identity } from "@semaphore-protocol/identity"

const message = "message"
const identity = new Identity()

const signature = identity.signMessage(message) +
+

# Identity.verifySignature(message: BigNumberish, signature: Signature, publicKey: Point): boolean

+
import { Identity } from "@semaphore-protocol/identity"

const message = "message"
const identity = new Identity()

const signature = identity.signMessage(message)

Identity.verifySignature(message, signature, identity.publicKey) +
+

# Identity.generateCommitment(publicKey: Point): bigint

+
import { Identity } from "@semaphore-protocol/identity"

Identity.generateCommitment(identity.publicKey) +
+

Index

Classes

Type Aliases

\ No newline at end of file diff --git a/modules/_semaphore_protocol_proof.html b/modules/_semaphore_protocol_proof.html new file mode 100644 index 000000000..608bcb7e9 --- /dev/null +++ b/modules/_semaphore_protocol_proof.html @@ -0,0 +1,84 @@ +@semaphore-protocol/proof | Semaphore SDK

Module @semaphore-protocol/proof

+

+ Semaphore proof +

+

A library to generate and verify Semaphore proofs.

+

+ +

+ + + + + NPM license + + + NPM version + + + Downloads + + + Documentation typedoc + + + Linter eslint + + + Code style prettier + +

+ + + + + + + + + +
This library provides utility functions to generate and verify Semaphore proofs compatible with the Semaphore circuits. Generating valid zero-knowledge proofs requires files that can only be obtained in an attested trusted-setup ceremony.
+

🛠 Install

npm or yarn

Install the @semaphore-protocol/proof package and its peer dependencies with npm:

+
npm i @semaphore-protocol/identity @semaphore-protocol/group @semaphore-protocol/proof
+
+

or yarn:

+
yarn add @semaphore-protocol/identity @semaphore-protocol/group @semaphore-protocol/proof
+
+

📜 Usage

For more information on the functions provided by @semaphore-protocol/proof, please refer to the TypeDoc documentation.

+

# generateProof( +identity: Identity, +group: Group, +message: BigNumberish | Uint8Array | string, +scope: BigNumberish | Uint8Array | string, +merkleTreeDepth: number, +snarkArtifacts?: SnarkArtifacts +): Promise<_SemaphoreProof_>

+
import { Identity } from "@semaphore-protocol/identity"
import { Group } from "@semaphore-protocol/group"
import { generateProof } from "@semaphore-protocol/proof"

const identity1 = new Identity()
const identity2 = new Identity()
const identity3 = new Identity()

const group = new Group([identity1.commitment, identity2.commitment, identity3.commitment])

const message = "Hello world"
const scope = "Semaphore"

// snarkArtifacts are not provided.
// So they will be automatically downloaded (see https://github.com/privacy-scaling-explorations/snark-artifacts).
const proof1 = await generateProof(identity1, group, message, scope)

// You can also specify the maximum tree depth supported by the proof.
const proof2 = await generateProof(identity2, group, message, scope, 20)

// You can also override our default zkey/wasm files.
const proof3 = await generateProof(identity3, group, message, scope, 20, {
wasm: "./semaphore.wasm",
zkey: "./semaphore.zkey"
}) +
+

# verifyProof(semaphoreProof: SemaphoreProof): Promise<_boolean_>

+
import { verifyProof } from "@semaphore-protocol/proof"

await verifyProof(proof1) +
+

Index

Type Aliases

Functions

\ No newline at end of file diff --git a/modules/_semaphore_protocol_utils.constants.html b/modules/_semaphore_protocol_utils.constants.html new file mode 100644 index 000000000..98904cb32 --- /dev/null +++ b/modules/_semaphore_protocol_utils.constants.html @@ -0,0 +1,5 @@ +constants | Semaphore SDK
\ No newline at end of file diff --git a/modules/_semaphore_protocol_utils.html b/modules/_semaphore_protocol_utils.html new file mode 100644 index 000000000..470e6d1e7 --- /dev/null +++ b/modules/_semaphore_protocol_utils.html @@ -0,0 +1,70 @@ +@semaphore-protocol/utils | Semaphore SDK

Module @semaphore-protocol/utils

+

+ Semaphore utils +

+

A library to provide utility functions to the other Semaphore packages.

+

+ +

+ + + + + NPM license + + + NPM version + + + Downloads + + + Documentation typedoc + + + Linter eslint + + + Code style prettier + +

+ + + +

🛠 Install

npm or yarn

Install the @semaphore-protocol/utils package with npm:

+
npm i @semaphore-protocol/utils
+
+

or yarn:

+
yarn add @semaphore-protocol/utils
+
+

📜 Usage

For more information on the functions and modules provided by @semaphore-protocol/utils, please refer to the TypeDoc documentation.

+
// You can import functions/parameters from the main bundle.
import { supportedNetworks, decodeMessage } from "@semaphore-protocol/utils"

// Or by using conditional exports.
import supportedNetworks from "@semaphore-protocol/utils/supported-networks"
import decodeMessage from "@semaphore-protocol/utils/decode-message" +
+

Index

Namespaces

Type Aliases

Variables

Functions

\ No newline at end of file diff --git a/types/_semaphore_protocol_data.EthersNetwork.html b/types/_semaphore_protocol_data.EthersNetwork.html new file mode 100644 index 000000000..c12e50c7d --- /dev/null +++ b/types/_semaphore_protocol_data.EthersNetwork.html @@ -0,0 +1 @@ +EthersNetwork | Semaphore SDK
EthersNetwork: "mainnet" | "sepolia" | "matic" | "matic-amoy" | "arbitrum" | "arbitrum-sepolia" | "optimism" | "optimism-sepolia" | "base" | "base-sepolia" | "linea" | "linea-sepolia"
\ No newline at end of file diff --git a/types/_semaphore_protocol_data.EthersOptions.html b/types/_semaphore_protocol_data.EthersOptions.html new file mode 100644 index 000000000..ae20436a9 --- /dev/null +++ b/types/_semaphore_protocol_data.EthersOptions.html @@ -0,0 +1 @@ +EthersOptions | Semaphore SDK
EthersOptions: {
    address?: string;
    apiKey?: string;
    applicationId?: string;
    applicationSecret?: string;
    projectId?: string;
    projectSecret?: string;
    provider?: "etherscan" | "infura" | "alchemy" | "cloudflare" | "pocket" | "ankr";
    startBlock?: number;
}

Type declaration

  • Optional address?: string
  • Optional apiKey?: string
  • Optional applicationId?: string
  • Optional applicationSecret?: string
  • Optional projectId?: string
  • Optional projectSecret?: string
  • Optional provider?: "etherscan" | "infura" | "alchemy" | "cloudflare" | "pocket" | "ankr"
  • Optional startBlock?: number
\ No newline at end of file diff --git a/types/_semaphore_protocol_data.GroupOptions.html b/types/_semaphore_protocol_data.GroupOptions.html new file mode 100644 index 000000000..8be07b02e --- /dev/null +++ b/types/_semaphore_protocol_data.GroupOptions.html @@ -0,0 +1 @@ +GroupOptions | Semaphore SDK
GroupOptions: {
    filters?: {
        admin?: string;
        identityCommitment?: string;
        timestamp?: Date;
        timestampGte?: Date;
        timestampLte?: Date;
    };
    members?: boolean;
    validatedProofs?: boolean;
}

Type declaration

  • Optional filters?: {
        admin?: string;
        identityCommitment?: string;
        timestamp?: Date;
        timestampGte?: Date;
        timestampLte?: Date;
    }
    • Optional admin?: string
    • Optional identityCommitment?: string
    • Optional timestamp?: Date
    • Optional timestampGte?: Date
    • Optional timestampLte?: Date
  • Optional members?: boolean
  • Optional validatedProofs?: boolean
\ No newline at end of file diff --git a/types/_semaphore_protocol_data.GroupResponse.html b/types/_semaphore_protocol_data.GroupResponse.html new file mode 100644 index 000000000..db13b6837 --- /dev/null +++ b/types/_semaphore_protocol_data.GroupResponse.html @@ -0,0 +1 @@ +GroupResponse | Semaphore SDK
GroupResponse: {
    admin?: string;
    id: string;
    members?: string[];
    merkleTree: {
        depth: number;
        root: string;
        size: number;
    };
    validatedProofs?: {
        merkleTreeDepth: number;
        merkleTreeRoot: string;
        message: string;
        nullifier: string;
        points: string[];
        scope: string;
        timestamp?: string;
    }[];
}

Type declaration

  • Optional admin?: string
  • id: string
  • Optional members?: string[]
  • merkleTree: {
        depth: number;
        root: string;
        size: number;
    }
    • depth: number
    • root: string
    • size: number
  • Optional validatedProofs?: {
        merkleTreeDepth: number;
        merkleTreeRoot: string;
        message: string;
        nullifier: string;
        points: string[];
        scope: string;
        timestamp?: string;
    }[]
\ No newline at end of file diff --git a/types/_semaphore_protocol_group.MerkleProof.html b/types/_semaphore_protocol_group.MerkleProof.html new file mode 100644 index 000000000..24048503a --- /dev/null +++ b/types/_semaphore_protocol_group.MerkleProof.html @@ -0,0 +1,9 @@ +MerkleProof | Semaphore SDK
MerkleProof<N>: {
    index: number;
    leaf: N;
    root: N;
    siblings: N[];
}

The Merkle Proof contains the necessary parameters to enable the +verifier to be certain that a leaf belongs to the tree. Given the value +of the leaf and its index, it is possible to traverse the tree by +recalculating the hashes up to the root and using the node siblings. +If the calculated root matches the root in the proof, then the leaf +belongs to the tree. It's important to note that the function used +to generate the proof and the one used to verify it must use the +same hash function.

+

Type Parameters

  • N = bigint

Type declaration

  • index: number
  • leaf: N
  • root: N
  • siblings: N[]
\ No newline at end of file diff --git a/types/_semaphore_protocol_identity.Point.html b/types/_semaphore_protocol_identity.Point.html new file mode 100644 index 000000000..61fab59fb --- /dev/null +++ b/types/_semaphore_protocol_identity.Point.html @@ -0,0 +1 @@ +Point | Semaphore SDK
Point<N>: [N, N]

Type Parameters

  • N = BigNumber
\ No newline at end of file diff --git a/types/_semaphore_protocol_identity.Signature.html b/types/_semaphore_protocol_identity.Signature.html new file mode 100644 index 000000000..9a3807be9 --- /dev/null +++ b/types/_semaphore_protocol_identity.Signature.html @@ -0,0 +1 @@ +Signature | Semaphore SDK
Signature<N>: {
    R8: Point<N>;
    S: N;
}

Type Parameters

  • N = BigNumber

Type declaration

\ No newline at end of file diff --git a/types/_semaphore_protocol_proof.SemaphoreProof.html b/types/_semaphore_protocol_proof.SemaphoreProof.html new file mode 100644 index 000000000..3eaece922 --- /dev/null +++ b/types/_semaphore_protocol_proof.SemaphoreProof.html @@ -0,0 +1 @@ +SemaphoreProof | Semaphore SDK
SemaphoreProof: {
    merkleTreeDepth: number;
    merkleTreeRoot: NumericString;
    message: NumericString;
    nullifier: NumericString;
    points: PackedGroth16Proof;
    scope: NumericString;
}

Type declaration

  • merkleTreeDepth: number
  • merkleTreeRoot: NumericString
  • message: NumericString
  • nullifier: NumericString
  • points: PackedGroth16Proof
  • scope: NumericString
\ No newline at end of file diff --git a/types/_semaphore_protocol_utils.SupportedNetwork.html b/types/_semaphore_protocol_utils.SupportedNetwork.html new file mode 100644 index 000000000..a3c8a09c7 --- /dev/null +++ b/types/_semaphore_protocol_utils.SupportedNetwork.html @@ -0,0 +1 @@ +SupportedNetwork | Semaphore SDK
SupportedNetwork: keyof typeof supportedNetworks
\ No newline at end of file diff --git a/variables/_semaphore_protocol_utils.constants.MAX_DEPTH.html b/variables/_semaphore_protocol_utils.constants.MAX_DEPTH.html new file mode 100644 index 000000000..ae90ea935 --- /dev/null +++ b/variables/_semaphore_protocol_utils.constants.MAX_DEPTH.html @@ -0,0 +1 @@ +MAX_DEPTH | Semaphore SDK
MAX_DEPTH: 32 = 32
\ No newline at end of file diff --git a/variables/_semaphore_protocol_utils.constants.MIN_DEPTH.html b/variables/_semaphore_protocol_utils.constants.MIN_DEPTH.html new file mode 100644 index 000000000..de418ba5c --- /dev/null +++ b/variables/_semaphore_protocol_utils.constants.MIN_DEPTH.html @@ -0,0 +1 @@ +MIN_DEPTH | Semaphore SDK
MIN_DEPTH: 1 = 1
\ No newline at end of file diff --git a/variables/_semaphore_protocol_utils.constants.SemaphoreABI.html b/variables/_semaphore_protocol_utils.constants.SemaphoreABI.html new file mode 100644 index 000000000..67dbc31ae --- /dev/null +++ b/variables/_semaphore_protocol_utils.constants.SemaphoreABI.html @@ -0,0 +1 @@ +SemaphoreABI | Semaphore SDK
SemaphoreABI: ({
    anonymous?: undefined;
    inputs: {
        internalType: string;
        name: string;
        type: string;
    }[];
    name?: undefined;
    outputs?: undefined;
    stateMutability: string;
    type: string;
} | {
    anonymous?: undefined;
    inputs: never[];
    name: string;
    outputs?: undefined;
    stateMutability?: undefined;
    type: string;
} | {
    anonymous: boolean;
    inputs: {
        indexed: boolean;
        internalType: string;
        name: string;
        type: string;
    }[];
    name: string;
    outputs?: undefined;
    stateMutability?: undefined;
    type: string;
} | {
    anonymous?: undefined;
    inputs: ({
        components?: undefined;
        internalType: string;
        name: string;
        type: string;
    } | {
        components: {
            internalType: string;
            name: string;
            type: string;
        }[];
        internalType: string;
        name: string;
        type: string;
    })[];
    name: string;
    outputs: {
        internalType: string;
        name: string;
        type: string;
    }[];
    stateMutability: string;
    type: string;
})[] = _interface.abi
\ No newline at end of file diff --git a/variables/_semaphore_protocol_utils.constants.SemaphoreBytecode.html b/variables/_semaphore_protocol_utils.constants.SemaphoreBytecode.html new file mode 100644 index 000000000..7f8581405 --- /dev/null +++ b/variables/_semaphore_protocol_utils.constants.SemaphoreBytecode.html @@ -0,0 +1 @@ +SemaphoreBytecode | Semaphore SDK
SemaphoreBytecode: string = _interface.bytecode
\ No newline at end of file diff --git a/variables/_semaphore_protocol_utils.defaultNetwork.html b/variables/_semaphore_protocol_utils.defaultNetwork.html new file mode 100644 index 000000000..93a1a33c2 --- /dev/null +++ b/variables/_semaphore_protocol_utils.defaultNetwork.html @@ -0,0 +1 @@ +defaultNetwork | Semaphore SDK
defaultNetwork: SupportedNetwork = "sepolia"
\ No newline at end of file diff --git a/variables/_semaphore_protocol_utils.deployedContracts.html b/variables/_semaphore_protocol_utils.deployedContracts.html new file mode 100644 index 000000000..89592f747 --- /dev/null +++ b/variables/_semaphore_protocol_utils.deployedContracts.html @@ -0,0 +1 @@ +deployedContracts | Semaphore SDK
deployedContracts: {
    contracts: {
        address: string;
        name: string;
        startBlock: number;
    }[];
    network: string;
}[]

Type declaration

  • contracts: {
        address: string;
        name: string;
        startBlock: number;
    }[]
  • network: string
\ No newline at end of file diff --git a/variables/_semaphore_protocol_utils.supportedNetworks.html b/variables/_semaphore_protocol_utils.supportedNetworks.html new file mode 100644 index 000000000..7c7a0df74 --- /dev/null +++ b/variables/_semaphore_protocol_utils.supportedNetworks.html @@ -0,0 +1 @@ +supportedNetworks | Semaphore SDK
supportedNetworks: {
    arbitrum: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    };
    arbitrum-sepolia: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    };
    base: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    };
    base-sepolia: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    };
    linea: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    };
    linea-sepolia: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    };
    matic: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    };
    matic-amoy: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    };
    optimism: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    };
    optimism-sepolia: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    };
    scroll-sepolia: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    };
    sepolia: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    };
}

Type declaration

  • arbitrum: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    }
    • chainId: number
    • explorer: string
    • name: string
    • url: string
  • arbitrum-sepolia: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    }
    • chainId: number
    • explorer: string
    • name: string
    • url: string
  • base: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    }
    • chainId: number
    • explorer: string
    • name: string
    • url: string
  • base-sepolia: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    }
    • chainId: number
    • explorer: string
    • name: string
    • url: string
  • linea: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    }
    • chainId: number
    • explorer: string
    • name: string
    • url: string
  • linea-sepolia: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    }
    • chainId: number
    • explorer: string
    • name: string
    • url: string
  • matic: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    }
    • chainId: number
    • explorer: string
    • name: string
    • url: string
  • matic-amoy: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    }
    • chainId: number
    • explorer: string
    • name: string
    • url: string
  • optimism: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    }
    • chainId: number
    • explorer: string
    • name: string
    • url: string
  • optimism-sepolia: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    }
    • chainId: number
    • explorer: string
    • name: string
    • url: string
  • scroll-sepolia: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    }
    • chainId: number
    • explorer: string
    • name: string
    • url: string
  • sepolia: {
        chainId: number;
        explorer: string;
        name: string;
        url: string;
    }
    • chainId: number
    • explorer: string
    • name: string
    • url: string
\ No newline at end of file