i stopped properly committing my work
This commit is contained in:
parent
18d1a02e98
commit
339c98545e
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "zkl-kds"]
|
||||
path = zkl-kds
|
||||
url = https://git.fybx.dev/fyb/zkl-kds
|
2
dist/bundle.js
vendored
2
dist/bundle.js
vendored
File diff suppressed because one or more lines are too long
196
dist/bundle.js.LICENSE.txt
vendored
196
dist/bundle.js.LICENSE.txt
vendored
@ -1,3 +1,7 @@
|
||||
/*!*****************!*\
|
||||
!*** ./user.js ***!
|
||||
\*****************/
|
||||
|
||||
/*!******************!*\
|
||||
!*** ./index.js ***!
|
||||
\******************/
|
||||
@ -6,6 +10,10 @@
|
||||
!*** ./roadhog.js ***!
|
||||
\********************/
|
||||
|
||||
/*!************************!*\
|
||||
!*** ./zkl-kds/key.js ***!
|
||||
\************************/
|
||||
|
||||
/*!************************!*\
|
||||
!*** buffer (ignored) ***!
|
||||
\************************/
|
||||
@ -14,6 +22,10 @@
|
||||
!*** crypto (ignored) ***!
|
||||
\************************/
|
||||
|
||||
/*!***********************************!*\
|
||||
!*** ./zkl-kds/key-derivation.js ***!
|
||||
\***********************************/
|
||||
|
||||
/*!******************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/bs58@4.0.1/node_modules/bs58/index.js ***!
|
||||
\******************************************************************/
|
||||
@ -58,6 +70,10 @@
|
||||
!*** ./node_modules/.pnpm/base-x@5.0.0/node_modules/base-x/src/esm/index.js ***!
|
||||
\******************************************************************************/
|
||||
|
||||
/*!******************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/bn.js@4.12.0/node_modules/bn.js/lib/bn.js ***!
|
||||
\******************************************************************************/
|
||||
|
||||
/*!********************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/apg-js@4.4.0/node_modules/apg-js/src/apg-api/api.js ***!
|
||||
\********************************************************************************/
|
||||
@ -86,6 +102,10 @@
|
||||
!*** ./node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/v5.js ***!
|
||||
\********************************************************************************/
|
||||
|
||||
/*!********************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/brorand@1.1.0/node_modules/brorand/index.js ***!
|
||||
\********************************************************************************/
|
||||
|
||||
/*!*********************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/md5.js ***!
|
||||
\*********************************************************************************/
|
||||
@ -158,6 +178,10 @@
|
||||
!*** ./node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/regex.js ***!
|
||||
\***********************************************************************************/
|
||||
|
||||
/*!***********************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash.js ***!
|
||||
\***********************************************************************************/
|
||||
|
||||
/*!************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/@noble+hashes@1.3.2/node_modules/@noble/hashes/_sha2.js ***!
|
||||
\************************************************************************************/
|
||||
@ -238,6 +262,10 @@
|
||||
!*** ./node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/validate.js ***!
|
||||
\**************************************************************************************/
|
||||
|
||||
/*!**************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/package.json ***!
|
||||
\**************************************************************************************/
|
||||
|
||||
/*!***************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/@noble+hashes@1.3.2/node_modules/@noble/hashes/esm/_u64.js ***!
|
||||
\***************************************************************************************/
|
||||
@ -274,6 +302,10 @@
|
||||
!*** ./node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/esm-browser/stringify.js ***!
|
||||
\***************************************************************************************/
|
||||
|
||||
/*!***************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha.js ***!
|
||||
\***************************************************************************************/
|
||||
|
||||
/*!****************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/@noble+curves@1.2.0/node_modules/@noble/curves/secp256k1.js ***!
|
||||
\****************************************************************************************/
|
||||
@ -306,6 +338,10 @@
|
||||
!*** ./node_modules/.pnpm/apg-js@4.4.0/node_modules/apg-js/src/apg-lib/identifiers.js ***!
|
||||
\****************************************************************************************/
|
||||
|
||||
/*!****************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/hmac.js ***!
|
||||
\****************************************************************************************/
|
||||
|
||||
/*!*****************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/@noble+hashes@1.3.2/node_modules/@noble/hashes/esm/crypto.js ***!
|
||||
\*****************************************************************************************/
|
||||
@ -342,6 +378,18 @@
|
||||
!*** ./node_modules/.pnpm/apg-js@4.4.0/node_modules/apg-js/src/apg-lib/node-exports.js ***!
|
||||
\*****************************************************************************************/
|
||||
|
||||
/*!*****************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic.js ***!
|
||||
\*****************************************************************************************/
|
||||
|
||||
/*!*****************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/1.js ***!
|
||||
\*****************************************************************************************/
|
||||
|
||||
/*!*****************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/utils.js ***!
|
||||
\*****************************************************************************************/
|
||||
|
||||
/*!******************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/@noble+curves@1.6.0/node_modules/@noble/curves/esm/ed25519.js ***!
|
||||
\******************************************************************************************/
|
||||
@ -362,6 +410,14 @@
|
||||
!*** ./node_modules/.pnpm/apg-js@4.4.0/node_modules/apg-js/src/apg-api/sabnf-grammar.js ***!
|
||||
\******************************************************************************************/
|
||||
|
||||
/*!******************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/common.js ***!
|
||||
\******************************************************************************************/
|
||||
|
||||
/*!******************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/ripemd.js ***!
|
||||
\******************************************************************************************/
|
||||
|
||||
/*!*******************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/@stablelib+wipe@1.0.1/node_modules/@stablelib/wipe/lib/wipe.js ***!
|
||||
\*******************************************************************************************/
|
||||
@ -374,6 +430,22 @@
|
||||
!*** ./node_modules/.pnpm/bigint-buffer@1.1.5/node_modules/bigint-buffer/dist/browser.js ***!
|
||||
\*******************************************************************************************/
|
||||
|
||||
/*!*******************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/224.js ***!
|
||||
\*******************************************************************************************/
|
||||
|
||||
/*!*******************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/256.js ***!
|
||||
\*******************************************************************************************/
|
||||
|
||||
/*!*******************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/384.js ***!
|
||||
\*******************************************************************************************/
|
||||
|
||||
/*!*******************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/512.js ***!
|
||||
\*******************************************************************************************/
|
||||
|
||||
/*!********************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/@noble+curves@1.2.0/node_modules/@noble/curves/_shortw_utils.js ***!
|
||||
\********************************************************************************************/
|
||||
@ -402,6 +474,10 @@
|
||||
!*** ./node_modules/.pnpm/apg-js@4.4.0/node_modules/apg-js/src/apg-lib/circular-buffer.js ***!
|
||||
\********************************************************************************************/
|
||||
|
||||
/*!********************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/hmac-drbg@1.0.1/node_modules/hmac-drbg/lib/hmac-drbg.js ***!
|
||||
\********************************************************************************************/
|
||||
|
||||
/*!*********************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/@noble+curves@1.2.0/node_modules/@noble/curves/abstract/curve.js ***!
|
||||
\*********************************************************************************************/
|
||||
@ -434,6 +510,10 @@
|
||||
!*** ./node_modules/.pnpm/apg-js@4.4.0/node_modules/apg-js/src/apg-api/syntax-callbacks.js ***!
|
||||
\*********************************************************************************************/
|
||||
|
||||
/*!*********************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js ***!
|
||||
\*********************************************************************************************/
|
||||
|
||||
/*!**********************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/apg-js@4.4.0/node_modules/apg-js/src/apg-api/rule-dependencies.js ***!
|
||||
\**********************************************************************************************/
|
||||
@ -446,6 +526,18 @@
|
||||
!*** ./node_modules/.pnpm/apg-js@4.4.0/node_modules/apg-js/src/apg-conv-api/transformers.js ***!
|
||||
\**********************************************************************************************/
|
||||
|
||||
/*!**********************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/@noble+hashes@1.5.0/node_modules/@noble/hashes/esm/_md.js ***!
|
||||
\**********************************************************************************************/
|
||||
|
||||
/*!**********************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/@scure+bip39@1.4.0/node_modules/@scure/bip39/esm/index.js ***!
|
||||
\**********************************************************************************************/
|
||||
|
||||
/*!**********************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/common.js ***!
|
||||
\**********************************************************************************************/
|
||||
|
||||
/*!***********************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/@noble+curves@1.2.0/node_modules/@noble/curves/abstract/modular.js ***!
|
||||
\***********************************************************************************************/
|
||||
@ -454,6 +546,18 @@
|
||||
!*** ./node_modules/.pnpm/apg-js@4.4.0/node_modules/apg-js/src/apg-api/semantic-callbacks.js ***!
|
||||
\***********************************************************************************************/
|
||||
|
||||
/*!***********************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/@noble+hashes@1.5.0/node_modules/@noble/hashes/esm/_u64.js ***!
|
||||
\***********************************************************************************************/
|
||||
|
||||
/*!***********************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/@noble+hashes@1.5.0/node_modules/@noble/hashes/esm/hmac.js ***!
|
||||
\***********************************************************************************************/
|
||||
|
||||
/*!***********************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/utils.js ***!
|
||||
\***********************************************************************************************/
|
||||
|
||||
/*!************************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/@noble+curves@1.2.0/node_modules/@noble/curves/esm/_shortw_utils.js ***!
|
||||
\************************************************************************************************/
|
||||
@ -462,6 +566,22 @@
|
||||
!*** ./node_modules/.pnpm/@noble+curves@1.6.0/node_modules/@noble/curves/esm/_shortw_utils.js ***!
|
||||
\************************************************************************************************/
|
||||
|
||||
/*!************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/@noble+hashes@1.5.0/node_modules/@noble/hashes/esm/utils.js ***!
|
||||
\************************************************************************************************/
|
||||
|
||||
/*!************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/@scure+base@1.1.9/node_modules/@scure/base/lib/esm/index.js ***!
|
||||
\************************************************************************************************/
|
||||
|
||||
/*!************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/curves.js ***!
|
||||
\************************************************************************************************/
|
||||
|
||||
/*!************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/ec/key.js ***!
|
||||
\************************************************************************************************/
|
||||
|
||||
/*!*************************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/@noble+curves@1.2.0/node_modules/@noble/curves/esm/abstract/curve.js ***!
|
||||
\*************************************************************************************************/
|
||||
@ -486,6 +606,30 @@
|
||||
!*** ./node_modules/.pnpm/@stablelib+random@1.0.2/node_modules/@stablelib/random/lib/random.js ***!
|
||||
\*************************************************************************************************/
|
||||
|
||||
/*!*************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/@noble+hashes@1.5.0/node_modules/@noble/hashes/esm/crypto.js ***!
|
||||
\*************************************************************************************************/
|
||||
|
||||
/*!*************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/@noble+hashes@1.5.0/node_modules/@noble/hashes/esm/pbkdf2.js ***!
|
||||
\*************************************************************************************************/
|
||||
|
||||
/*!*************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/@noble+hashes@1.5.0/node_modules/@noble/hashes/esm/sha256.js ***!
|
||||
\*************************************************************************************************/
|
||||
|
||||
/*!*************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/@noble+hashes@1.5.0/node_modules/@noble/hashes/esm/sha512.js ***!
|
||||
\*************************************************************************************************/
|
||||
|
||||
/*!**************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/@noble+hashes@1.5.0/node_modules/@noble/hashes/esm/_assert.js ***!
|
||||
\**************************************************************************************************/
|
||||
|
||||
/*!**************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/ec/index.js ***!
|
||||
\**************************************************************************************************/
|
||||
|
||||
/*!***************************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/@noble+curves@1.2.0/node_modules/@noble/curves/abstract/weierstrass.js ***!
|
||||
\***************************************************************************************************/
|
||||
@ -502,14 +646,38 @@
|
||||
!*** ./node_modules/.pnpm/@noble+curves@1.6.0/node_modules/@noble/curves/esm/abstract/modular.js ***!
|
||||
\***************************************************************************************************/
|
||||
|
||||
/*!***************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/eddsa/key.js ***!
|
||||
\***************************************************************************************************/
|
||||
|
||||
/*!****************************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/rpc-websockets@9.0.4/node_modules/rpc-websockets/dist/index.browser.mjs ***!
|
||||
\****************************************************************************************************/
|
||||
|
||||
/*!****************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/curve/base.js ***!
|
||||
\****************************************************************************************************/
|
||||
|
||||
/*!****************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/curve/mont.js ***!
|
||||
\****************************************************************************************************/
|
||||
|
||||
/*!*****************************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/@noble+curves@1.2.0/node_modules/@noble/curves/abstract/hash-to-curve.js ***!
|
||||
\*****************************************************************************************************/
|
||||
|
||||
/*!*****************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/curve/index.js ***!
|
||||
\*****************************************************************************************************/
|
||||
|
||||
/*!*****************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/curve/short.js ***!
|
||||
\*****************************************************************************************************/
|
||||
|
||||
/*!*****************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/eddsa/index.js ***!
|
||||
\*****************************************************************************************************/
|
||||
|
||||
/*!******************************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/@noble+curves@1.6.0/node_modules/@noble/curves/esm/abstract/montgomery.js ***!
|
||||
\******************************************************************************************************/
|
||||
@ -518,6 +686,10 @@
|
||||
!*** ./node_modules/.pnpm/@stablelib+random@1.0.2/node_modules/@stablelib/random/lib/source/node.js ***!
|
||||
\******************************************************************************************************/
|
||||
|
||||
/*!******************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/ec/signature.js ***!
|
||||
\******************************************************************************************************/
|
||||
|
||||
/*!*******************************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/@noble+curves@1.2.0/node_modules/@noble/curves/esm/abstract/weierstrass.js ***!
|
||||
\*******************************************************************************************************/
|
||||
@ -526,6 +698,10 @@
|
||||
!*** ./node_modules/.pnpm/@noble+curves@1.6.0/node_modules/@noble/curves/esm/abstract/weierstrass.js ***!
|
||||
\*******************************************************************************************************/
|
||||
|
||||
/*!*******************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/curve/edwards.js ***!
|
||||
\*******************************************************************************************************/
|
||||
|
||||
/*!********************************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/@spruceid+siwe-parser@2.1.2/node_modules/@spruceid/siwe-parser/dist/abnf.js ***!
|
||||
\********************************************************************************************************/
|
||||
@ -534,6 +710,10 @@
|
||||
!*** ./node_modules/.pnpm/@stablelib+random@1.0.2/node_modules/@stablelib/random/lib/source/system.js ***!
|
||||
\********************************************************************************************************/
|
||||
|
||||
/*!********************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/minimalistic-assert@1.0.1/node_modules/minimalistic-assert/index.js ***!
|
||||
\********************************************************************************************************/
|
||||
|
||||
/*!*********************************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/@noble+curves@1.2.0/node_modules/@noble/curves/esm/abstract/hash-to-curve.js ***!
|
||||
\*********************************************************************************************************/
|
||||
@ -554,6 +734,14 @@
|
||||
!*** ./node_modules/.pnpm/@stablelib+random@1.0.2/node_modules/@stablelib/random/lib/source/browser.js ***!
|
||||
\*********************************************************************************************************/
|
||||
|
||||
/*!*********************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/eddsa/signature.js ***!
|
||||
\*********************************************************************************************************/
|
||||
|
||||
/*!**********************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/@scure+bip39@1.4.0/node_modules/@scure/bip39/esm/wordlists/english.js ***!
|
||||
\**********************************************************************************************************/
|
||||
|
||||
/*!***********************************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/@spruceid+siwe-parser@2.1.2/node_modules/@spruceid/siwe-parser/dist/parsers.js ***!
|
||||
\***********************************************************************************************************/
|
||||
@ -570,10 +758,18 @@
|
||||
!*** ./node_modules/.pnpm/@adraffy+ens-normalize@1.10.1/node_modules/@adraffy/ens-normalize/dist/index.mjs ***!
|
||||
\*************************************************************************************************************/
|
||||
|
||||
/*!***************************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js ***!
|
||||
\***************************************************************************************************************/
|
||||
|
||||
/*!************************************************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/ethers@6.13.3_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/hash/id.js ***!
|
||||
\************************************************************************************************************************/
|
||||
|
||||
/*!************************************************************************************************************************!*\
|
||||
!*** ./zkl-kds/node_modules/.pnpm/minimalistic-crypto-utils@1.0.1/node_modules/minimalistic-crypto-utils/lib/utils.js ***!
|
||||
\************************************************************************************************************************/
|
||||
|
||||
/*!*************************************************************************************************************************!*\
|
||||
!*** ./node_modules/.pnpm/ethers@6.13.3_bufferutil@4.0.8_utf-8-validate@5.0.10/node_modules/ethers/lib.esm/_version.js ***!
|
||||
\*************************************************************************************************************************/
|
||||
|
12
index.js
12
index.js
@ -1,15 +1,21 @@
|
||||
import { signIn as _signIn } from './roadhog.js';
|
||||
import { createUser } from './user.js';
|
||||
|
||||
const endpoint = "http://localhost:3000";
|
||||
|
||||
let address = '';
|
||||
let networkType = '';
|
||||
|
||||
async function signIn(type) {
|
||||
try {
|
||||
const result = await _signIn(type);
|
||||
if (result.success) {
|
||||
console.log('Successfully signed in with', type);
|
||||
address = result.address;
|
||||
networkType = type;
|
||||
const b = document.createElement('button');
|
||||
b.innerText = 'Click to access protected';
|
||||
b.setAttribute('onclick', 'fetchProtected()');
|
||||
b.setAttribute('onclick', 'doStuff()');
|
||||
document.body.appendChild(b);
|
||||
} else {
|
||||
console.error('Sign-in failed:', result.error);
|
||||
@ -20,11 +26,13 @@ async function signIn(type) {
|
||||
}
|
||||
|
||||
async function signOff() {
|
||||
|
||||
}
|
||||
|
||||
window.signIn = signIn;
|
||||
window.signOff = signOff;
|
||||
window.doStuff = async function doStuff(type) {
|
||||
await createUser('test user', networkType, address);
|
||||
}
|
||||
|
||||
function init() {
|
||||
console.log('start');
|
||||
|
101
roadhog.js
101
roadhog.js
@ -1,88 +1,97 @@
|
||||
import { SiweMessage } from 'siwe';
|
||||
import { BrowserProvider, JsonRpcSigner } from 'ethers';
|
||||
import * as solanaWeb3 from '@solana/web3.js';
|
||||
import bs58 from 'bs58';
|
||||
import { SiweMessage } from "siwe";
|
||||
import { BrowserProvider, JsonRpcSigner } from "ethers";
|
||||
import * as solanaWeb3 from "@solana/web3.js";
|
||||
import bs58 from "bs58";
|
||||
|
||||
const endpoint = 'http://localhost:3000';
|
||||
const ENDPOINT = "http://localhost:3000";
|
||||
|
||||
const getNonce = async (walletAddress, networkType) => {
|
||||
const nonceResponse = await fetch(
|
||||
`${ENDPOINT}/auth/nonce?address=${walletAddress}&type=${networkType}`,
|
||||
);
|
||||
const { nonce } = await nonceResponse.json();
|
||||
return nonce;
|
||||
};
|
||||
|
||||
export async function signIn(type) {
|
||||
let address, signature, message;
|
||||
|
||||
if (type === 'ethereum') {
|
||||
await window.ethereum.request({ method: 'eth_requestAccounts' });
|
||||
message = {
|
||||
domain: window.location.host,
|
||||
statement: "Sign in to zk-Lokomotive",
|
||||
uri: window.location.origin,
|
||||
version: "1",
|
||||
};
|
||||
|
||||
if (type === "ethereum") {
|
||||
await window.ethereum.request({ method: "eth_requestAccounts" });
|
||||
const provider = new BrowserProvider(window.ethereum);
|
||||
const signer = await provider.getSigner();
|
||||
address = await signer.getAddress();
|
||||
|
||||
const nonceResponse = await fetch(`${endpoint}/auth/nonce?address=${address}&type=ethereum`);
|
||||
const { nonce } = await nonceResponse.json();
|
||||
|
||||
const siweMessage = new SiweMessage({
|
||||
domain: window.location.host,
|
||||
address: address,
|
||||
statement: 'Sign in with Ethereum to zk-Lokomotive.',
|
||||
uri: window.location.origin,
|
||||
version: '1',
|
||||
chainId: 1,
|
||||
nonce: nonce
|
||||
});
|
||||
|
||||
message = siweMessage.prepareMessage();
|
||||
const nonce = await getNonce(address, type);
|
||||
message = new SiweMessage({ ...message, address, chainId: 1, nonce });
|
||||
message = message.prepareMessage();
|
||||
signature = await signer.signMessage(message);
|
||||
} else if (type === 'solana') {
|
||||
} else if (type === "solana") {
|
||||
const provider = window.solana;
|
||||
await provider.connect();
|
||||
address = provider.publicKey.toString();
|
||||
|
||||
const nonceResponse = await fetch(`${endpoint}/auth/nonce?address=${address}&type=solana`);
|
||||
const { nonce } = await nonceResponse.json();
|
||||
|
||||
const encodedMessage = new TextEncoder().encode(nonce);
|
||||
const signatureBytes = await provider.signMessage(encodedMessage, 'utf8');
|
||||
const nonce = await getNonce(address, type);
|
||||
const encodedMessage = new TextEncoder().encode(
|
||||
JSON.stringify({ ...message, address, nonce, chainId: 900 }),
|
||||
);
|
||||
const signatureBytes = await provider.signMessage(encodedMessage, "utf8");
|
||||
signature = bs58.encode(signatureBytes.signature);
|
||||
} else {
|
||||
throw new Error('Invalid type');
|
||||
console.error(
|
||||
'roadhog/signIn: parameter type can be "ethereum" or "solana"',
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch(`${endpoint}/auth/verify`, {
|
||||
method: 'POST',
|
||||
const response = await fetch(`${ENDPOINT}/auth/verify`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({ type, message, address, signature }),
|
||||
body: JSON.stringify({
|
||||
message,
|
||||
walletAddress: address,
|
||||
signature,
|
||||
}),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error((await response.json()).error);
|
||||
}
|
||||
|
||||
const { auth_token } = await response.json();
|
||||
const { authToken } = await response.json();
|
||||
|
||||
localStorage.setItem('auth_token', auth_token);
|
||||
localStorage.setItem('auth_type', type);
|
||||
localStorage.setItem("authToken", authToken);
|
||||
localStorage.setItem("networkType", type);
|
||||
|
||||
return { success: true, auth_token };
|
||||
return { success: true, authToken, address };
|
||||
} catch (error) {
|
||||
console.error('Authentication error:', error);
|
||||
console.error("Authentication error:", error);
|
||||
return { success: false, error: error.message };
|
||||
}
|
||||
}
|
||||
|
||||
export async function signOff() {
|
||||
const auth_token = localStorage.getItem('auth_token');
|
||||
const response = await fetch(`${endpoint}/auth/signoff`, {
|
||||
method: 'DELETE',
|
||||
const authToken = localStorage.getItem("authToken");
|
||||
const response = await fetch(`${ENDPOINT}/auth/signoff`, {
|
||||
method: "DELETE",
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': `Bearer ${auth_token}`
|
||||
}
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `Bearer ${authToken}`,
|
||||
},
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
throw new Error((await response.json()).error);
|
||||
} else {
|
||||
localStorage.removeItem('auth_token');
|
||||
localStorage.removeItem("authToken");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
59
user.js
Normal file
59
user.js
Normal file
@ -0,0 +1,59 @@
|
||||
import { Key } from "./zkl-kds/key.js";
|
||||
import { generateKeypair, generateMnemonic } from "./zkl-kds/key-derivation.js";
|
||||
|
||||
const endpoint = "http://localhost:3000";
|
||||
|
||||
export const createUser = async function (name, networkType, walletAddress) {
|
||||
const authToken = localStorage.getItem("authToken");
|
||||
const mnemonic = generateMnemonic();
|
||||
const { publicKey, privateKey } = await generateKeypair(mnemonic);
|
||||
|
||||
const response = await fetch(`${endpoint}/users`, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
Authorization: `Bearer ${authToken}`,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
profileName: name,
|
||||
networkType,
|
||||
publicKey: publicKey.asHexString,
|
||||
walletAddress,
|
||||
}),
|
||||
});
|
||||
|
||||
if (response.ok) return;
|
||||
|
||||
console.error("Backend error:", (await response.json()).error);
|
||||
};
|
||||
|
||||
export const updateUser = async function (publicKey, updates = {}) {
|
||||
const allowedParams = ["profileName", "networkType", "address"];
|
||||
const body = {};
|
||||
|
||||
for (const key of allowedParams) {
|
||||
if (key in updates) {
|
||||
body[key] = updates[key];
|
||||
}
|
||||
}
|
||||
|
||||
if (Object.keys(body).length === 0) {
|
||||
console.error("No valid fields to update");
|
||||
return;
|
||||
}
|
||||
|
||||
const response = await fetch(`${endpoint}/users/${publicKey}`, {
|
||||
method: "PUT",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify(body),
|
||||
});
|
||||
|
||||
if (response.ok) {
|
||||
const updatedUser = await response.json();
|
||||
console.log("User updated successfully:", updatedUser);
|
||||
} else {
|
||||
console.error((await response.json()).error);
|
||||
}
|
||||
};
|
@ -11,11 +11,13 @@ module.exports = {
|
||||
plugins: [
|
||||
new TerserPlugin({
|
||||
terserOptions: {
|
||||
keep_fnames: ['signIn', 'fetchProtected'],
|
||||
keep_fnames: ['signIn', 'fetchProtected', 'createUser', 'updateUser'],
|
||||
mangle: {
|
||||
reserved: [
|
||||
"signIn",
|
||||
"fetchProtected"
|
||||
"fetchProtected",
|
||||
"createUser",
|
||||
"updateUser"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
1
zkl-kds
Submodule
1
zkl-kds
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit a25028b37c939487c55c145779752985b0267328
|
Loading…
x
Reference in New Issue
Block a user