@hinkal/common 0.2.37 → 0.2.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/API/API.cjs +1 -1
- package/API/API.d.ts +0 -5
- package/API/API.mjs +112 -117
- package/README.md +184 -32
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.mjs +2 -1
- package/constants/index.cjs +1 -1
- package/constants/index.d.ts +0 -2
- package/constants/index.mjs +0 -2
- package/constants/mediaUrls.constants.cjs +1 -1
- package/constants/mediaUrls.constants.d.ts +0 -1
- package/constants/mediaUrls.constants.mjs +0 -1
- package/constants/rewards.constants.cjs +1 -1
- package/constants/rewards.constants.d.ts +0 -2
- package/constants/rewards.constants.mjs +2 -2
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +0 -4
- package/constants/server.constants.mjs +0 -5
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +0 -3
- package/data-structures/Hinkal/Hinkal.mjs +69 -80
- package/data-structures/Hinkal/IHinkal.d.ts +0 -3
- package/data-structures/TokenDBs/PublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/PublicTokensDB.mjs +22 -21
- package/data-structures/TokenDBs/TempoPublicTokensDB.cjs +1 -0
- package/data-structures/TokenDBs/TempoPublicTokensDB.d.ts +9 -0
- package/data-structures/TokenDBs/TempoPublicTokensDB.mjs +42 -0
- package/data-structures/TokenDBs/index.cjs +1 -1
- package/data-structures/TokenDBs/index.d.ts +1 -0
- package/data-structures/TokenDBs/index.mjs +1 -0
- package/data-structures/index.cjs +1 -1
- package/data-structures/index.mjs +1 -0
- package/error-handling/error-codes.constants.cjs +1 -1
- package/error-handling/error-codes.constants.d.ts +0 -5
- package/error-handling/error-codes.constants.mjs +0 -5
- package/externalABIs/index.cjs +1 -1
- package/externalABIs/index.d.ts +1 -36
- package/externalABIs/index.mjs +2 -4
- package/functions/index.cjs +1 -1
- package/functions/index.d.ts +0 -1
- package/functions/index.mjs +0 -4
- package/index.cjs +1 -1
- package/index.mjs +314 -319
- package/package.json +2 -2
- package/types/cache.types.cjs +1 -1
- package/types/cache.types.d.ts +1 -0
- package/types/cache.types.mjs +1 -1
- package/types/commitments.types.d.ts +0 -10
- package/types/hinkal.types.cjs +1 -1
- package/types/hinkal.types.d.ts +0 -7
- package/types/hinkal.types.mjs +2 -4
- package/types/index.cjs +1 -1
- package/types/index.d.ts +0 -1
- package/types/index.mjs +0 -1
- package/types/new-rewards.type.cjs +1 -1
- package/types/new-rewards.type.d.ts +0 -1
- package/types/new-rewards.type.mjs +1 -1
- package/webworker/{logError-B1LyaM6e.js → logError-CU_5hb0O.js} +1 -1
- package/webworker/package.json +2 -2
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.ts?worker&url.mjs +1 -1
- package/webworker/snarkjsWorkerNode.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.ts?worker&url.mjs +1 -1
- package/webworker/utxoWorkerNode.cjs +1 -1
- package/webworker/viteWorkerURL.constant.cjs +3 -3
- package/webworker/viteWorkerURL.constant.mjs +3 -3
- package/webworker/{workerProxy-UUs7pDb1.js → workerProxy-JYVsEgnC.js} +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url.mjs +1 -1
- package/webworker/zkProofWorkerNode.cjs +1 -1
- package/API/kycCalls.cjs +0 -1
- package/API/kycCalls.d.ts +0 -14
- package/API/kycCalls.mjs +0 -26
- package/constants/assets.constants.cjs +0 -1
- package/constants/assets.constants.d.ts +0 -13
- package/constants/assets.constants.mjs +0 -16
- package/constants/kyc.constants.cjs +0 -1
- package/constants/kyc.constants.d.ts +0 -29
- package/constants/kyc.constants.mjs +0 -126
- package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +0 -1
- package/data-structures/Hinkal/hinkalGetZkMeProvider.d.ts +0 -28
- package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +0 -22
- package/externalABIs/BabPassport.json.cjs +0 -1
- package/externalABIs/BabPassport.json.mjs +0 -20
- package/externalABIs/GalxePassport.json.cjs +0 -1
- package/externalABIs/GalxePassport.json.mjs +0 -37
- package/functions/kyc/aiPriseHelper.d.ts +0 -0
- package/functions/kyc/checkTokenLimitsUSD.cjs +0 -1
- package/functions/kyc/checkTokenLimitsUSD.d.ts +0 -1
- package/functions/kyc/checkTokenLimitsUSD.mjs +0 -29
- package/functions/kyc/index.cjs +0 -1
- package/functions/kyc/index.d.ts +0 -3
- package/functions/kyc/index.mjs +0 -3
- package/functions/kyc/openDefaultPassportWindow.cjs +0 -1
- package/functions/kyc/openDefaultPassportWindow.d.ts +0 -1
- package/functions/kyc/openDefaultPassportWindow.mjs +0 -7
- package/functions/kyc/passportHelper.cjs +0 -1
- package/functions/kyc/passportHelper.d.ts +0 -3
- package/functions/kyc/passportHelper.mjs +0 -9
- package/functions/kyc/zkMeHelper.cjs +0 -1
- package/functions/kyc/zkMeHelper.d.ts +0 -4
- package/functions/kyc/zkMeHelper.mjs +0 -42
- package/types/kyc.types.cjs +0 -1
- package/types/kyc.types.d.ts +0 -41
- package/types/kyc.types.mjs +0 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=``+(typeof document>`u`?require(`url`).pathToFileURL(__dirname+`/../../assets/zkProofWorkerLauncher-
|
|
1
|
+
var e=``+(typeof document>`u`?require(`url`).pathToFileURL(__dirname+`/../../assets/zkProofWorkerLauncher-DFP655bn.js`).href:new URL(`../../assets/zkProofWorkerLauncher-DFP655bn.js`,document.currentScript&&document.currentScript.tagName.toUpperCase()===`SCRIPT`&&document.currentScript.src||document.baseURI).href);exports.default=e;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
//#region libs/shared/common/src/webworker/zkProofWorker/zkProofWorkerLauncher.ts?worker&url
|
|
2
|
-
var e = "" + new URL("../../assets/zkProofWorkerLauncher-
|
|
2
|
+
var e = "" + new URL("../../assets/zkProofWorkerLauncher-DFP655bn.js", import.meta.url).href;
|
|
3
3
|
//#endregion
|
|
4
4
|
export { e as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require(`./workerProxy-
|
|
1
|
+
const e=require(`./workerProxy-JYVsEgnC.js`),t=require(`./logError-CU_5hb0O.js`);let n=require(`worker_threads`),r=require(`buffer`);var i=e.x(e.g());Object.values({preHookContract:`0x0000000000000000000000000000000000000000`,hookContract:`0x0000000000000000000000000000000000000000`,preHookMetadata:`0x00`,postHookMetadata:`0x00`});var a=(e,t)=>{let n=[];for(let r=0;r<e.length;r+=1){n.push([]);for(let i=0;i<e[r].length;i+=1)n[r][i]=t.getSiblingHashesForVerification(BigInt(e[r][i].getCommitment())).map(e=>e.toString())}let r=[];for(let n=0;n<e.length;n+=1){r.push([]);for(let i=0;i<e[n].length;i+=1)r[n][i]=t.getSiblingSides(BigInt(e[n][i].getCommitment())).map(e=>e.toString())}return{inCommitmentSiblings:n,inCommitmentSiblingSides:r}},o=function(e){return e[e.CALC_COMMITMENTS_SIBLING_AND_SIDES=0]=`CALC_COMMITMENTS_SIBLING_AND_SIDES`,e[e.BUILD_IN_NULLIFIERS=1]=`BUILD_IN_NULLIFIERS`,e}({}),s=class extends Error{constructor(){super(`Merkle tree is incomplete`),this.name=`MerkleTreeIncompleteError`}},c=class e{tree;count;index;reverseTree;static createWithData(t,n,r,i,a,o,s){return new e(a,o,s,t,n,r,i)}static create(n,r,i=t.u){return new e(n,i,r)}createReverseTree(){let e=new Map;for(let t=this.getStartIndex();t<this.getStartIndex()+this.count;t+=1n){let n=this.tree.get(t);n!==void 0&&e.set(n,t)}return e}constructor(e,t,n,r,i,a,o){this.hashFunction=e,this.levels=t,this.defaultNodeValue=n,this.tree=r??new Map,this.count=o??0n,this.index=a??2n**(t-1n),i?this.reverseTree=i:this.reverseTree=this.createReverseTree()}getStartIndex(){return 2n**(this.levels-1n)}logarithm2(e){let t=0n;for(;2n**t<e;)t+=1n;return t}bigIntMax(e,t){return e>t?e:t}forceInsert(e,t){if(t<this.getStartIndex())throw RangeError();this.tree.set(t,e),this.reverseTree.set(e,t);let n=this.index-this.getStartIndex(),r=this.logarithm2(n),i=t;for(let e=1n;e<=r;e+=1n){i/=2n;let e=this.hashFunction(this.tree.get(i*2n)||this.defaultNodeValue,this.tree.get(i*2n+1n)||this.defaultNodeValue);this.tree.set(i,e)}}insert(e,n){let r=!1;this.tree.has(n)&&(r=!0,t.t(`Editing commitment index: ${n} `)),r||(this.count+=1n),this.index=this.bigIntMax(this.index,n+1n),this.forceInsert(e,n)}remove(e){this.forceInsert(this.defaultNodeValue,e)}completenessCheck(){if(this.count!==this.index-this.getStartIndex())throw new s}getRootHash(){this.completenessCheck();for(let e=1n;e<2n**this.levels;e*=2n)if(this.tree.get(e))return this.tree.get(e);return this.defaultNodeValue}getMerkleData(){return this.completenessCheck(),new Map(this.tree)}getValue(e){return this.tree.get(e)}getSiblingIndex(e){return e===1n?1n:e%2n==1n?e-1n:e+1n}getSiblingHashesForVerification(e){this.completenessCheck();let t=this.reverseTree.get(e);if(t===void 0)return Array(25).fill(0n);let n=[];for(;t!==0n;)n.push(this.tree.get(this.getSiblingIndex(t))||this.defaultNodeValue),t/=2n;return n.slice(0,25)}getSiblingSides(e){this.completenessCheck();let t=this.reverseTree.get(e);if(t===void 0)return Array(25).fill(0n);let n=[];for(;t!==0n;){let e=t%2n==0n?0n:1n;n.push(e),t/=2n}return n.slice(0,25)}toJSON(){let{tree:e,reverseTree:t,count:n,index:r}=this;return{tree:Object.fromEntries(e),reverseTree:Object.fromEntries(t),count:n.toString(),index:r.toString()}}toJSONLite(){let{tree:e,count:t,index:n}=this;return{tree:Object.fromEntries(e),count:t.toString(),index:n.toString()}}clone(){return e.createWithData(new Map(this.tree),new Map(this.reverseTree),this.index,this.count,this.hashFunction,this.levels,this.defaultNodeValue)}getIndex(){return this.index}},l=e=>new Map(Object.entries(e).map(([e,t])=>[BigInt(e),BigInt(t)])),u=e=>{let n=l(e.tree),r=e.reverseTree?l(e.reverseTree):void 0;return c.createWithData(n,r,BigInt(e.index),BigInt(e.count),t.p,t.u,0n)},d=new e.t,f=e=>{let{inputUtxosSerialized:n,merkleTreeSerialized:r}=e.data,i=u(r),{inCommitmentSiblings:o,inCommitmentSiblingSides:s}=a(n.map(e=>e.map(e=>new t.o(e))),i);d.postMessageToMainThread({inCommitmentSiblings:o,inCommitmentSiblingSides:s})},p=e=>{let{inputUtxosSerialized:n}=e.data,r=n.map(e=>e.map(e=>new t.o(e))).map(e=>e.map(e=>e.amount===0n?`0`:e.getNullifier()));d.postMessageToMainThread(r)},m=async e=>{try{await t.f(!0);let{type:n}=e.payload;switch(n){case o.CALC_COMMITMENTS_SIBLING_AND_SIDES:f(e.payload);return;case o.BUILD_IN_NULLIFIERS:p(e.payload);return;default:throw Error(`Unknown worker message type ${n}`)}}catch(e){console.error(`zk proof worker message failed`,e),d.postErrorToMainThread(e)}};globalThis.process=i.default,globalThis.Buffer=r.Buffer,n.parentPort.on(`message`,async e=>{await m(e)});
|
package/API/kycCalls.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../constants/server.constants.cjs`),t=require(`./getServerURL.cjs`),n=require(`../data-structures/http/HttpClient.cjs`);require(`../data-structures/http/index.cjs`);async function r(r){return n.httpClient.post(`${t.SERVER_URL}${e.API_CONFIG.ROUTES.checkKycStatus}`,{ethereumAddress:r})}async function i(r,i,a){return n.httpClient.post(`${t.SERVER_URL}${e.API_CONFIG.ROUTES.startUserVerification}`,{ethereumAddress:r,verificationSessionId:i,verificationType:a})}async function a(r,i,a,o){return n.httpClient.post(`${t.SERVER_URL}${e.API_CONFIG.ROUTES.startReclaimVerification}`,{ethereumAddress:i,providerId:r,userSignature:a,withSignature:o})}var o=async()=>(await n.httpClient.get(`${t.SERVER_URL}${e.API_CONFIG.ROUTES.zkMeAccessToken}`)).accessToken;exports.getReclaimVerificationRequest=a,exports.getUserKycStatus=r,exports.getZkMeAccessToken=o,exports.setAiPriseVerificationUrl=i;
|
package/API/kycCalls.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { KycVerificationResult, Passports, VERIFICATION_TYPE } from '../types/kyc.types';
|
|
2
|
-
interface IGetKycStatus {
|
|
3
|
-
verificationResult: KycVerificationResult;
|
|
4
|
-
passportIds?: Passports[];
|
|
5
|
-
}
|
|
6
|
-
export declare function getUserKycStatus(ethereumOrSolanaAddress: string): Promise<IGetKycStatus>;
|
|
7
|
-
export declare function setAiPriseVerificationUrl(ethereumAddress: string, verificationSessionId: string, verificationType: VERIFICATION_TYPE): Promise<any>;
|
|
8
|
-
interface ReclaimVerificationRequestResponse {
|
|
9
|
-
reclaimProofRequestConfig: string;
|
|
10
|
-
message?: string;
|
|
11
|
-
}
|
|
12
|
-
export declare function getReclaimVerificationRequest(providerId: string, ethereumAddress: string, userSignature: string, withSignature: boolean): Promise<ReclaimVerificationRequestResponse>;
|
|
13
|
-
export declare const getZkMeAccessToken: () => Promise<any>;
|
|
14
|
-
export {};
|
package/API/kycCalls.mjs
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { API_CONFIG as e } from "../constants/server.constants.mjs";
|
|
2
|
-
import { SERVER_URL as t } from "./getServerURL.mjs";
|
|
3
|
-
import { httpClient as n } from "../data-structures/http/HttpClient.mjs";
|
|
4
|
-
import "../data-structures/http/index.mjs";
|
|
5
|
-
//#region libs/shared/common/src/API/kycCalls.ts
|
|
6
|
-
async function r(r) {
|
|
7
|
-
return n.post(`${t}${e.ROUTES.checkKycStatus}`, { ethereumAddress: r });
|
|
8
|
-
}
|
|
9
|
-
async function i(r, i, a) {
|
|
10
|
-
return n.post(`${t}${e.ROUTES.startUserVerification}`, {
|
|
11
|
-
ethereumAddress: r,
|
|
12
|
-
verificationSessionId: i,
|
|
13
|
-
verificationType: a
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
async function a(r, i, a, o) {
|
|
17
|
-
return n.post(`${t}${e.ROUTES.startReclaimVerification}`, {
|
|
18
|
-
ethereumAddress: i,
|
|
19
|
-
providerId: r,
|
|
20
|
-
userSignature: a,
|
|
21
|
-
withSignature: o
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
var o = async () => (await n.get(`${t}${e.ROUTES.zkMeAccessToken}`)).accessToken;
|
|
25
|
-
//#endregion
|
|
26
|
-
export { a as getReclaimVerificationRequest, r as getUserKycStatus, o as getZkMeAccessToken, i as setAiPriseVerificationUrl };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=`https://storage.googleapis.com/hinkal-s3-assets/assets/`,t={CHEVRON:`${e}Chevron.svg`,MOON:`${e}Moon.svg`,SUN:`${e}Sun.svg`,ARROW_LEFT:`${e}ArrowLeft.svg`,AUTHENTO_LIGHT:`${e}AuthentoLogoLight.png`,AUTHENTO_DARK:`${e}AuthentoLogoDark.png`,KING:`${e}King.svg`,CIRCLE_STRIKETHROUGH:`${e}CircleStrikethrough.svg`,RIGHT_SQUARE:`${e}RightSquare.svg`,COINBASE_DARK:`${e}CoinbaseDark.png`,COINBASE_LIGHT:`${e}CoinbaseLight.png`};exports.IMAGE_PATHS=t;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const IMAGE_PATHS: {
|
|
2
|
-
CHEVRON: string;
|
|
3
|
-
MOON: string;
|
|
4
|
-
SUN: string;
|
|
5
|
-
ARROW_LEFT: string;
|
|
6
|
-
AUTHENTO_LIGHT: string;
|
|
7
|
-
AUTHENTO_DARK: string;
|
|
8
|
-
KING: string;
|
|
9
|
-
CIRCLE_STRIKETHROUGH: string;
|
|
10
|
-
RIGHT_SQUARE: string;
|
|
11
|
-
COINBASE_DARK: string;
|
|
12
|
-
COINBASE_LIGHT: string;
|
|
13
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//#region libs/shared/common/src/constants/assets.constants.ts
|
|
2
|
-
var e = "https://storage.googleapis.com/hinkal-s3-assets/assets/", t = {
|
|
3
|
-
CHEVRON: `${e}Chevron.svg`,
|
|
4
|
-
MOON: `${e}Moon.svg`,
|
|
5
|
-
SUN: `${e}Sun.svg`,
|
|
6
|
-
ARROW_LEFT: `${e}ArrowLeft.svg`,
|
|
7
|
-
AUTHENTO_LIGHT: `${e}AuthentoLogoLight.png`,
|
|
8
|
-
AUTHENTO_DARK: `${e}AuthentoLogoDark.png`,
|
|
9
|
-
KING: `${e}King.svg`,
|
|
10
|
-
CIRCLE_STRIKETHROUGH: `${e}CircleStrikethrough.svg`,
|
|
11
|
-
RIGHT_SQUARE: `${e}RightSquare.svg`,
|
|
12
|
-
COINBASE_DARK: `${e}CoinbaseDark.png`,
|
|
13
|
-
COINBASE_LIGHT: `${e}CoinbaseLight.png`
|
|
14
|
-
};
|
|
15
|
-
//#endregion
|
|
16
|
-
export { t as IMAGE_PATHS };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./vite.constants.cjs`),t=require(`./chains.constants.cjs`),n=require(`../types/kyc.types.cjs`),r=require(`../functions/kyc/zkMeHelper.cjs`);var i=`https://onboard.aiprise.com`,a=`https://onboard-sandbox.aiprise.com`,o={[n.Passports.AiPriseKyc]:{id:n.Passports.AiPriseKyc,shortName:`AiPrise`,fullName:`AiPrice Kyc`,apiURL:``,onboardURL:``,supportedChainIds:[],supportsAllChains:!0},[n.Passports.AiPriseKyb]:{id:n.Passports.AiPriseKyb,shortName:`AiPrise`,fullName:`AiPrice Kyb`,apiURL:``,onboardURL:``,supportedChainIds:[],supportsAllChains:!0},[n.Passports.BABPassport]:{id:n.Passports.BABPassport,shortName:`Bab`,fullName:`Bab Token`,apiURL:`BabPassport`,onboardURL:`https://www.binance.com/en/BABT`,supportedChainIds:[t.chainIds.bnbMainnet]},[n.Passports.GalxePassport]:{id:n.Passports.GalxePassport,shortName:`Galxe`,fullName:`Galxe Passport`,apiURL:`GalxePassport`,onboardURL:`https://galxe.com/passport`,supportedChainIds:[t.chainIds.bnbMainnet]},[n.Passports.ZkMePassport]:{id:n.Passports.ZkMePassport,shortName:`zkMe`,fullName:`zkMe Passport`,apiURL:`ZkMePassport`,onboardURL:`https://widget.zk.me/`,customHandleKYC:(e,t,n)=>r.zkMeKycHandler(e,t,n,{merchId:`M2023090671844574053042402155408`}),supportedChainIds:[],supportsAllChains:!0},[n.Passports.CoinbasePassport]:{id:n.Passports.CoinbasePassport,shortName:`coinbase`,fullName:`coinbase Passport`,apiURL:`coinbasePassport`,onboardURL:`https://www.coinbase.com/onchain-verify`,supportedChainIds:[],supportsAllChains:!0}},s={[n.Passports.ReclaimCoinbasePassport]:{id:n.Passports.ReclaimCoinbasePassport,shortName:`Coinbase`,fullName:`Coinbase`,apiURL:``,onboardURL:``,supportedChainIds:[],supportsAllChains:!0,params:{providerId:`4ee4ebac-3012-4842-8b7b-e73f3293c97d`}},[n.Passports.ReclaimBNBPassport]:{id:n.Passports.ReclaimBNBPassport,shortName:`Binance`,fullName:`BNB`,apiURL:``,onboardURL:``,supportedChainIds:[],supportsAllChains:!0,params:{providerId:`9a8127e6-c5c1-4336-bc49-24a0197f6c56`}},[n.Passports.ReclaimOKXPassport]:{id:n.Passports.ReclaimOKXPassport,shortName:`OKX`,fullName:`OKX`,apiURL:``,onboardURL:``,supportedChainIds:[],supportsAllChains:!0,params:{providerId:`4f464d13-d3b0-45b9-bed9-db160a1a5426`}},[n.Passports.ReclaimGatePassport]:{id:n.Passports.ReclaimGatePassport,shortName:`Gate.io`,fullName:`Gate`,apiURL:``,onboardURL:``,supportedChainIds:[],supportsAllChains:!0,params:{providerId:`a824a912-52ad-4a84-a096-55728518c3d5`}},[n.Passports.ReclaimMexcPassport]:{id:n.Passports.ReclaimMexcPassport,shortName:`Mexc`,fullName:`Mexc`,apiURL:``,onboardURL:``,supportedChainIds:[],supportsAllChains:!0,params:{providerId:`b9a7fa32-41f3-4708-bebf-18869b96bf41`}},[n.Passports.ReclaimHtxPassport]:{id:n.Passports.ReclaimHtxPassport,shortName:`HTX`,fullName:`HTX`,apiURL:``,onboardURL:``,supportedChainIds:[],supportsAllChains:!0,params:{providerId:`2fc15466-9106-4a80-b6f3-d21a77445c0a`}}},c={...o,...s},l=Object.values(c).filter((e,t)=>e.onboardURL?.length>0&&Object.values(c).indexOf(e)===t).map(e=>e.onboardURL),u=`dbda56e5-31f5-4a37-a895-d4adca6c53fd`,d=`96050d8d-23c9-4908-b285-2e6dec4c020b`,f=`Approve Integrity Status proof generation using Reclaim Protocol.`,p=e.isNotProduction?2:1e4;exports.AIPRISE_KYB_TEMPLATE_ID_PROD=d,exports.AIPRISE_KYC_TEMPLATE_ID_PROD=u,exports.KYC_LIMIT=p,exports.RECLAIM_MESSAGE_TO_SIGN=f,exports.ReclaimPassports=s,exports.StandardPassports=o,exports.SupportedPassports=c,exports.aipriseBaseOnboardingProductionUrl=i,exports.aipriseBaseOnboardingSandboxUrl=a,exports.supportedPassportLinks=l;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { IHinkal } from '../data-structures/Hinkal/IHinkal';
|
|
2
|
-
import { Passports } from '../types/kyc.types';
|
|
3
|
-
export declare const aipriseBaseOnboardingProductionUrl = "https://onboard.aiprise.com";
|
|
4
|
-
export declare const aipriseBaseOnboardingSandboxUrl = "https://onboard-sandbox.aiprise.com";
|
|
5
|
-
export type PassportDetails = {
|
|
6
|
-
id: Passports;
|
|
7
|
-
shortName: string;
|
|
8
|
-
fullName: string;
|
|
9
|
-
apiURL: string;
|
|
10
|
-
onboardURL: string;
|
|
11
|
-
customHandleKYC?: (hinkal: IHinkal, shortName: string, onboardURL: string) => Promise<void>;
|
|
12
|
-
params?: Record<string, number | string>;
|
|
13
|
-
supportsAllChains?: boolean;
|
|
14
|
-
supportedChainIds: number[];
|
|
15
|
-
};
|
|
16
|
-
export declare const StandardPassports: {
|
|
17
|
-
[passport: number]: PassportDetails;
|
|
18
|
-
};
|
|
19
|
-
export declare const ReclaimPassports: {
|
|
20
|
-
[passport: number]: PassportDetails;
|
|
21
|
-
};
|
|
22
|
-
export declare const SupportedPassports: {
|
|
23
|
-
[x: number]: PassportDetails;
|
|
24
|
-
};
|
|
25
|
-
export declare const supportedPassportLinks: string[];
|
|
26
|
-
export declare const AIPRISE_KYC_TEMPLATE_ID_PROD = "dbda56e5-31f5-4a37-a895-d4adca6c53fd";
|
|
27
|
-
export declare const AIPRISE_KYB_TEMPLATE_ID_PROD = "96050d8d-23c9-4908-b285-2e6dec4c020b";
|
|
28
|
-
export declare const RECLAIM_MESSAGE_TO_SIGN = "Approve Integrity Status proof generation using Reclaim Protocol.";
|
|
29
|
-
export declare const KYC_LIMIT: number;
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { isNotProduction as e } from "./vite.constants.mjs";
|
|
2
|
-
import { chainIds as t } from "./chains.constants.mjs";
|
|
3
|
-
import { Passports as n } from "../types/kyc.types.mjs";
|
|
4
|
-
import { zkMeKycHandler as r } from "../functions/kyc/zkMeHelper.mjs";
|
|
5
|
-
//#region libs/shared/common/src/constants/kyc.constants.ts
|
|
6
|
-
var i = "https://onboard.aiprise.com", a = "https://onboard-sandbox.aiprise.com", o = {
|
|
7
|
-
[n.AiPriseKyc]: {
|
|
8
|
-
id: n.AiPriseKyc,
|
|
9
|
-
shortName: "AiPrise",
|
|
10
|
-
fullName: "AiPrice Kyc",
|
|
11
|
-
apiURL: "",
|
|
12
|
-
onboardURL: "",
|
|
13
|
-
supportedChainIds: [],
|
|
14
|
-
supportsAllChains: !0
|
|
15
|
-
},
|
|
16
|
-
[n.AiPriseKyb]: {
|
|
17
|
-
id: n.AiPriseKyb,
|
|
18
|
-
shortName: "AiPrise",
|
|
19
|
-
fullName: "AiPrice Kyb",
|
|
20
|
-
apiURL: "",
|
|
21
|
-
onboardURL: "",
|
|
22
|
-
supportedChainIds: [],
|
|
23
|
-
supportsAllChains: !0
|
|
24
|
-
},
|
|
25
|
-
[n.BABPassport]: {
|
|
26
|
-
id: n.BABPassport,
|
|
27
|
-
shortName: "Bab",
|
|
28
|
-
fullName: "Bab Token",
|
|
29
|
-
apiURL: "BabPassport",
|
|
30
|
-
onboardURL: "https://www.binance.com/en/BABT",
|
|
31
|
-
supportedChainIds: [t.bnbMainnet]
|
|
32
|
-
},
|
|
33
|
-
[n.GalxePassport]: {
|
|
34
|
-
id: n.GalxePassport,
|
|
35
|
-
shortName: "Galxe",
|
|
36
|
-
fullName: "Galxe Passport",
|
|
37
|
-
apiURL: "GalxePassport",
|
|
38
|
-
onboardURL: "https://galxe.com/passport",
|
|
39
|
-
supportedChainIds: [t.bnbMainnet]
|
|
40
|
-
},
|
|
41
|
-
[n.ZkMePassport]: {
|
|
42
|
-
id: n.ZkMePassport,
|
|
43
|
-
shortName: "zkMe",
|
|
44
|
-
fullName: "zkMe Passport",
|
|
45
|
-
apiURL: "ZkMePassport",
|
|
46
|
-
onboardURL: "https://widget.zk.me/",
|
|
47
|
-
customHandleKYC: (e, t, n) => r(e, t, n, { merchId: "M2023090671844574053042402155408" }),
|
|
48
|
-
supportedChainIds: [],
|
|
49
|
-
supportsAllChains: !0
|
|
50
|
-
},
|
|
51
|
-
[n.CoinbasePassport]: {
|
|
52
|
-
id: n.CoinbasePassport,
|
|
53
|
-
shortName: "coinbase",
|
|
54
|
-
fullName: "coinbase Passport",
|
|
55
|
-
apiURL: "coinbasePassport",
|
|
56
|
-
onboardURL: "https://www.coinbase.com/onchain-verify",
|
|
57
|
-
supportedChainIds: [],
|
|
58
|
-
supportsAllChains: !0
|
|
59
|
-
}
|
|
60
|
-
}, s = {
|
|
61
|
-
[n.ReclaimCoinbasePassport]: {
|
|
62
|
-
id: n.ReclaimCoinbasePassport,
|
|
63
|
-
shortName: "Coinbase",
|
|
64
|
-
fullName: "Coinbase",
|
|
65
|
-
apiURL: "",
|
|
66
|
-
onboardURL: "",
|
|
67
|
-
supportedChainIds: [],
|
|
68
|
-
supportsAllChains: !0,
|
|
69
|
-
params: { providerId: "4ee4ebac-3012-4842-8b7b-e73f3293c97d" }
|
|
70
|
-
},
|
|
71
|
-
[n.ReclaimBNBPassport]: {
|
|
72
|
-
id: n.ReclaimBNBPassport,
|
|
73
|
-
shortName: "Binance",
|
|
74
|
-
fullName: "BNB",
|
|
75
|
-
apiURL: "",
|
|
76
|
-
onboardURL: "",
|
|
77
|
-
supportedChainIds: [],
|
|
78
|
-
supportsAllChains: !0,
|
|
79
|
-
params: { providerId: "9a8127e6-c5c1-4336-bc49-24a0197f6c56" }
|
|
80
|
-
},
|
|
81
|
-
[n.ReclaimOKXPassport]: {
|
|
82
|
-
id: n.ReclaimOKXPassport,
|
|
83
|
-
shortName: "OKX",
|
|
84
|
-
fullName: "OKX",
|
|
85
|
-
apiURL: "",
|
|
86
|
-
onboardURL: "",
|
|
87
|
-
supportedChainIds: [],
|
|
88
|
-
supportsAllChains: !0,
|
|
89
|
-
params: { providerId: "4f464d13-d3b0-45b9-bed9-db160a1a5426" }
|
|
90
|
-
},
|
|
91
|
-
[n.ReclaimGatePassport]: {
|
|
92
|
-
id: n.ReclaimGatePassport,
|
|
93
|
-
shortName: "Gate.io",
|
|
94
|
-
fullName: "Gate",
|
|
95
|
-
apiURL: "",
|
|
96
|
-
onboardURL: "",
|
|
97
|
-
supportedChainIds: [],
|
|
98
|
-
supportsAllChains: !0,
|
|
99
|
-
params: { providerId: "a824a912-52ad-4a84-a096-55728518c3d5" }
|
|
100
|
-
},
|
|
101
|
-
[n.ReclaimMexcPassport]: {
|
|
102
|
-
id: n.ReclaimMexcPassport,
|
|
103
|
-
shortName: "Mexc",
|
|
104
|
-
fullName: "Mexc",
|
|
105
|
-
apiURL: "",
|
|
106
|
-
onboardURL: "",
|
|
107
|
-
supportedChainIds: [],
|
|
108
|
-
supportsAllChains: !0,
|
|
109
|
-
params: { providerId: "b9a7fa32-41f3-4708-bebf-18869b96bf41" }
|
|
110
|
-
},
|
|
111
|
-
[n.ReclaimHtxPassport]: {
|
|
112
|
-
id: n.ReclaimHtxPassport,
|
|
113
|
-
shortName: "HTX",
|
|
114
|
-
fullName: "HTX",
|
|
115
|
-
apiURL: "",
|
|
116
|
-
onboardURL: "",
|
|
117
|
-
supportedChainIds: [],
|
|
118
|
-
supportsAllChains: !0,
|
|
119
|
-
params: { providerId: "2fc15466-9106-4a80-b6f3-d21a77445c0a" }
|
|
120
|
-
}
|
|
121
|
-
}, c = {
|
|
122
|
-
...o,
|
|
123
|
-
...s
|
|
124
|
-
}, l = Object.values(c).filter((e, t) => e.onboardURL?.length > 0 && Object.values(c).indexOf(e) === t).map((e) => e.onboardURL), u = "dbda56e5-31f5-4a37-a895-d4adca6c53fd", d = "96050d8d-23c9-4908-b285-2e6dec4c020b", f = "Approve Integrity Status proof generation using Reclaim Protocol.", p = e ? 2 : 1e4;
|
|
125
|
-
//#endregion
|
|
126
|
-
export { d as AIPRISE_KYB_TEMPLATE_ID_PROD, u as AIPRISE_KYC_TEMPLATE_ID_PROD, p as KYC_LIMIT, f as RECLAIM_MESSAGE_TO_SIGN, s as ReclaimPassports, o as StandardPassports, c as SupportedPassports, i as aipriseBaseOnboardingProductionUrl, a as aipriseBaseOnboardingSandboxUrl, l as supportedPassportLinks };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../../API/API.cjs`);var t=t=>({async getAccessToken(){return e.API.getZkMeAccessToken()},async getUserAccounts(){return[await t.getEthereumAddress()]},async delegateTransaction(e){let n=t.getProviderAdapter(Number(e.chainId)),r={...e,chainId:Number(e.chainId),type:e.type?e.type:void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?e.maxPriorityFeePerGas:void 0,maxFeePerGas:e.maxFeePerGas?e.maxFeePerGas:void 0};return(await n.sendTransaction(r)).hash}});exports.getHinkalZkMeProvider=t;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { IHinkal } from './IHinkal';
|
|
2
|
-
export type ZkMeTransactionRequest = {
|
|
3
|
-
type: null | number;
|
|
4
|
-
from: string;
|
|
5
|
-
to: string;
|
|
6
|
-
data: string;
|
|
7
|
-
chainId: string;
|
|
8
|
-
gasLimit: string;
|
|
9
|
-
gasPrice: string;
|
|
10
|
-
maxFeePerGas: string | null;
|
|
11
|
-
maxPriorityFeePerGas: string | null;
|
|
12
|
-
};
|
|
13
|
-
export declare const getHinkalZkMeProvider: (hinkal: IHinkal) => {
|
|
14
|
-
getAccessToken(): Promise<any>;
|
|
15
|
-
getUserAccounts(): Promise<string[]>;
|
|
16
|
-
delegateTransaction(tx: ZkMeTransactionRequest): Promise<string>;
|
|
17
|
-
};
|
|
18
|
-
export type ZkMeProvider = ReturnType<typeof getHinkalZkMeProvider>;
|
|
19
|
-
export type ZkMeWidgetMessageBody = {
|
|
20
|
-
id?: string;
|
|
21
|
-
channelId: string;
|
|
22
|
-
method?: 'getUserAccounts' | 'delegateTransaction' | 'signMessage' | 'getAccessToken';
|
|
23
|
-
params?: ZkMeTransactionRequest | string;
|
|
24
|
-
kycResults?: 'matching' | 'mismatch';
|
|
25
|
-
verifiedAddress?: string;
|
|
26
|
-
event?: 'close' | 'finished';
|
|
27
|
-
email?: string;
|
|
28
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { API as e } from "../../API/API.mjs";
|
|
2
|
-
//#region libs/shared/common/src/data-structures/Hinkal/hinkalGetZkMeProvider.ts
|
|
3
|
-
var t = (t) => ({
|
|
4
|
-
async getAccessToken() {
|
|
5
|
-
return e.getZkMeAccessToken();
|
|
6
|
-
},
|
|
7
|
-
async getUserAccounts() {
|
|
8
|
-
return [await t.getEthereumAddress()];
|
|
9
|
-
},
|
|
10
|
-
async delegateTransaction(e) {
|
|
11
|
-
let n = t.getProviderAdapter(Number(e.chainId)), r = {
|
|
12
|
-
...e,
|
|
13
|
-
chainId: Number(e.chainId),
|
|
14
|
-
type: e.type ? e.type : void 0,
|
|
15
|
-
maxPriorityFeePerGas: e.maxPriorityFeePerGas ? e.maxPriorityFeePerGas : void 0,
|
|
16
|
-
maxFeePerGas: e.maxFeePerGas ? e.maxFeePerGas : void 0
|
|
17
|
-
};
|
|
18
|
-
return (await n.sendTransaction(r)).hash;
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
//#endregion
|
|
22
|
-
export { t as getHinkalZkMeProvider };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={contractName:`SBT`,abi:[{inputs:[{internalType:`address`,name:`owner`,type:`address`}],name:`balanceOf`,outputs:[{internalType:`uint256`,name:``,type:`uint256`}],stateMutability:`view`,type:`function`}]};exports.default=e;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
var e = {
|
|
2
|
-
contractName: "SBT",
|
|
3
|
-
abi: [{
|
|
4
|
-
inputs: [{
|
|
5
|
-
internalType: "address",
|
|
6
|
-
name: "owner",
|
|
7
|
-
type: "address"
|
|
8
|
-
}],
|
|
9
|
-
name: "balanceOf",
|
|
10
|
-
outputs: [{
|
|
11
|
-
internalType: "uint256",
|
|
12
|
-
name: "",
|
|
13
|
-
type: "uint256"
|
|
14
|
-
}],
|
|
15
|
-
stateMutability: "view",
|
|
16
|
-
type: "function"
|
|
17
|
-
}]
|
|
18
|
-
};
|
|
19
|
-
//#endregion
|
|
20
|
-
export { e as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e={contractName:`GalxePassport`,abi:[{inputs:[{internalType:`address`,name:`owner`,type:`address`}],name:`getAddressPassport`,outputs:[{components:[{internalType:`uint160`,name:`owner`,type:`uint160`},{internalType:`uint64`,name:`cid`,type:`uint64`},{internalType:`uint32`,name:`status`,type:`uint32`}],internalType:`struct GalxePassport.Passport`,name:``,type:`tuple`}],stateMutability:`view`,type:`function`}]};exports.default=e;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
var e = {
|
|
2
|
-
contractName: "GalxePassport",
|
|
3
|
-
abi: [{
|
|
4
|
-
inputs: [{
|
|
5
|
-
internalType: "address",
|
|
6
|
-
name: "owner",
|
|
7
|
-
type: "address"
|
|
8
|
-
}],
|
|
9
|
-
name: "getAddressPassport",
|
|
10
|
-
outputs: [{
|
|
11
|
-
components: [
|
|
12
|
-
{
|
|
13
|
-
internalType: "uint160",
|
|
14
|
-
name: "owner",
|
|
15
|
-
type: "uint160"
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
internalType: "uint64",
|
|
19
|
-
name: "cid",
|
|
20
|
-
type: "uint64"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
internalType: "uint32",
|
|
24
|
-
name: "status",
|
|
25
|
-
type: "uint32"
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
internalType: "struct GalxePassport.Passport",
|
|
29
|
-
name: "",
|
|
30
|
-
type: "tuple"
|
|
31
|
-
}],
|
|
32
|
-
stateMutability: "view",
|
|
33
|
-
type: "function"
|
|
34
|
-
}]
|
|
35
|
-
};
|
|
36
|
-
//#endregion
|
|
37
|
-
export { e as default };
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`../../API/getTokenPrice.cjs`),t=require(`../../constants/kyc.constants.cjs`),n=require(`../../error-handling/error-codes.constants.cjs`),r=require(`../web3/etherFunctions.cjs`),i=require(`../utils/erc20tokenFunctions.cjs`);require(`../../constants/index.cjs`),require(`../../API/index.cjs`),require(`../../error-handling/index.cjs`),require(`../utils/index.cjs`),require(`../web3/index.cjs`);var a=async(a,o,s)=>{if(!o.length||!s.length)return!1;let c=o.map(e=>i.getERC20Token(e,a)),l=[];try{l=(await e.getTokenPrices(a,o)).prices||[]}catch{throw Error(n.transactionErrorCodes.KYC_PRICE_FETCH_FAILED)}for(let e=0;e<o.length;e++){let n=c[e],i=s[e],a=l[e];if(!n||i===0n||!a)continue;let o=r.getAmountInToken(n,i);if(Number(o)*a>t.KYC_LIMIT)return!0}return!1};exports.checkTokenLimitsUSD=a;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const checkTokenLimitsUSD: (chainId: number, tokenAddresses: string[], amounts: bigint[]) => Promise<boolean>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { getTokenPrices as e } from "../../API/getTokenPrice.mjs";
|
|
2
|
-
import { KYC_LIMIT as t } from "../../constants/kyc.constants.mjs";
|
|
3
|
-
import { transactionErrorCodes as n } from "../../error-handling/error-codes.constants.mjs";
|
|
4
|
-
import { getAmountInToken as r } from "../web3/etherFunctions.mjs";
|
|
5
|
-
import { getERC20Token as i } from "../utils/erc20tokenFunctions.mjs";
|
|
6
|
-
import "../../constants/index.mjs";
|
|
7
|
-
import "../../API/index.mjs";
|
|
8
|
-
import "../../error-handling/index.mjs";
|
|
9
|
-
import "../utils/index.mjs";
|
|
10
|
-
import "../web3/index.mjs";
|
|
11
|
-
//#region libs/shared/common/src/functions/kyc/checkTokenLimitsUSD.ts
|
|
12
|
-
var a = async (a, o, s) => {
|
|
13
|
-
if (!o.length || !s.length) return !1;
|
|
14
|
-
let c = o.map((e) => i(e, a)), l = [];
|
|
15
|
-
try {
|
|
16
|
-
l = (await e(a, o)).prices || [];
|
|
17
|
-
} catch {
|
|
18
|
-
throw Error(n.KYC_PRICE_FETCH_FAILED);
|
|
19
|
-
}
|
|
20
|
-
for (let e = 0; e < o.length; e++) {
|
|
21
|
-
let n = c[e], i = s[e], a = l[e];
|
|
22
|
-
if (!n || i === 0n || !a) continue;
|
|
23
|
-
let o = r(n, i);
|
|
24
|
-
if (Number(o) * a > t) return !0;
|
|
25
|
-
}
|
|
26
|
-
return !1;
|
|
27
|
-
};
|
|
28
|
-
//#endregion
|
|
29
|
-
export { a as checkTokenLimitsUSD };
|
package/functions/kyc/index.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`./openDefaultPassportWindow.cjs`),require(`./passportHelper.cjs`),require(`./checkTokenLimitsUSD.cjs`);
|
package/functions/kyc/index.d.ts
DELETED
package/functions/kyc/index.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=(e,t,n=650,r=400)=>{let i=window.top.outerHeight/2+window.top.screenY-n/2,a=window.top.outerWidth/2+window.top.screenX-r/2;window.open(e,t,`toolbar=no, menubar=no, width=${r}, height=${n}, top=${i}, left=${a}`)};exports.openDefaultPassportWindow=e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const openDefaultPassportWindow: (onboardURL: string, shortName: string, height?: number, width?: number) => void;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
//#region libs/shared/common/src/functions/kyc/openDefaultPassportWindow.ts
|
|
2
|
-
var e = (e, t, n = 650, r = 400) => {
|
|
3
|
-
let i = window.top.outerHeight / 2 + window.top.screenY - n / 2, a = window.top.outerWidth / 2 + window.top.screenX - r / 2;
|
|
4
|
-
window.open(e, t, `toolbar=no, menubar=no, width=${r}, height=${n}, top=${i}, left=${a}`);
|
|
5
|
-
};
|
|
6
|
-
//#endregion
|
|
7
|
-
export { e as openDefaultPassportWindow };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require(`./openDefaultPassportWindow.cjs`),t=require(`../../constants/kyc.constants.cjs`);var n=(n,r,i=650,a=400)=>{let{onboardURL:o,shortName:s,customHandleKYC:c}=t.SupportedPassports[n];c?c(r,s,o):e.openDefaultPassportWindow(o,s,i,a)};exports.openPassportWindow=n;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { openDefaultPassportWindow as e } from "./openDefaultPassportWindow.mjs";
|
|
2
|
-
import { SupportedPassports as t } from "../../constants/kyc.constants.mjs";
|
|
3
|
-
//#region libs/shared/common/src/functions/kyc/passportHelper.ts
|
|
4
|
-
var n = (n, r, i = 650, a = 400) => {
|
|
5
|
-
let { onboardURL: o, shortName: s, customHandleKYC: c } = t[n];
|
|
6
|
-
c ? c(r, s, o) : e(o, s, i, a);
|
|
7
|
-
};
|
|
8
|
-
//#endregion
|
|
9
|
-
export { n as openPassportWindow };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../constants/chains.constants.cjs`),t=require(`../../data-structures/Hinkal/hinkalGetZkMeProvider.cjs`),n=require(`./openDefaultPassportWindow.cjs`);let r=require(`ethers`);async function i(e,t){if(e.origin===`https://widget.zk.me`){if(e.data.method===`getUserAccounts`){let n=await t.getUserAccounts();e.source?.postMessage({id:e.data.id,message:`ok`,data:n},{targetOrigin:e.origin})}if(e.data.method===`getAccessToken`){let n=await t.getAccessToken();e.source?.postMessage({id:e.data.id,message:`ok`,data:n},{targetOrigin:e.origin})}if(e.data.method===`delegateTransaction`){let n=e.data.params;if(t.delegateTransaction){let r=await t.delegateTransaction(n);e.source?.postMessage({id:e.data.id,message:`ok`,data:r},{targetOrigin:e.origin})}}}}var a=async(a,o,s,c)=>{let l=t.getHinkalZkMeProvider(a),u=await l.getAccessToken(),d=r.ethers.toBeHex(e.chainIds.polygon);window.addEventListener(`message`,e=>i(e,l)),n.openDefaultPassportWindow(`${s}?mchNo=${c.merchId}&name=HinkalProtocol&chainId=${d}&accessToken=${u}`,o,700,510)};exports.zkMeKycHandler=a;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { chainIds as e } from "../../constants/chains.constants.mjs";
|
|
2
|
-
import { getHinkalZkMeProvider as t } from "../../data-structures/Hinkal/hinkalGetZkMeProvider.mjs";
|
|
3
|
-
import { openDefaultPassportWindow as n } from "./openDefaultPassportWindow.mjs";
|
|
4
|
-
import { ethers as r } from "ethers";
|
|
5
|
-
//#region libs/shared/common/src/functions/kyc/zkMeHelper.ts
|
|
6
|
-
async function i(e, t) {
|
|
7
|
-
if (e.origin === "https://widget.zk.me") {
|
|
8
|
-
if (e.data.method === "getUserAccounts") {
|
|
9
|
-
let n = await t.getUserAccounts();
|
|
10
|
-
e.source?.postMessage({
|
|
11
|
-
id: e.data.id,
|
|
12
|
-
message: "ok",
|
|
13
|
-
data: n
|
|
14
|
-
}, { targetOrigin: e.origin });
|
|
15
|
-
}
|
|
16
|
-
if (e.data.method === "getAccessToken") {
|
|
17
|
-
let n = await t.getAccessToken();
|
|
18
|
-
e.source?.postMessage({
|
|
19
|
-
id: e.data.id,
|
|
20
|
-
message: "ok",
|
|
21
|
-
data: n
|
|
22
|
-
}, { targetOrigin: e.origin });
|
|
23
|
-
}
|
|
24
|
-
if (e.data.method === "delegateTransaction") {
|
|
25
|
-
let n = e.data.params;
|
|
26
|
-
if (t.delegateTransaction) {
|
|
27
|
-
let r = await t.delegateTransaction(n);
|
|
28
|
-
e.source?.postMessage({
|
|
29
|
-
id: e.data.id,
|
|
30
|
-
message: "ok",
|
|
31
|
-
data: r
|
|
32
|
-
}, { targetOrigin: e.origin });
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
var a = async (a, o, s, c) => {
|
|
38
|
-
let l = t(a), u = await l.getAccessToken(), d = r.toBeHex(e.polygon);
|
|
39
|
-
window.addEventListener("message", (e) => i(e, l)), n(`${s}?mchNo=${c.merchId}&name=HinkalProtocol&chainId=${d}&accessToken=${u}`, o, 700, 510);
|
|
40
|
-
};
|
|
41
|
-
//#endregion
|
|
42
|
-
export { a as zkMeKycHandler };
|
package/types/kyc.types.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=function(e){return e.USER=`USER`,e.BUSINESS=`BUSINESS`,e}({}),t=[e.USER,e.BUSINESS],n=function(e){return e[e.AiPriseKyc=0]=`AiPriseKyc`,e[e.AiPriseKyb=1]=`AiPriseKyb`,e[e.BABPassport=2]=`BABPassport`,e[e.GalxePassport=3]=`GalxePassport`,e[e.ZkMePassport=4]=`ZkMePassport`,e[e.CoinbasePassport=5]=`CoinbasePassport`,e[e.AuthentoPassport=6]=`AuthentoPassport`,e[e.AuthentoPassportKyb=7]=`AuthentoPassportKyb`,e[e.ReclaimCoinbasePassport=8]=`ReclaimCoinbasePassport`,e[e.ReclaimBNBPassport=9]=`ReclaimBNBPassport`,e[e.ReclaimOKXPassport=10]=`ReclaimOKXPassport`,e[e.ReclaimGatePassport=11]=`ReclaimGatePassport`,e[e.ReclaimMexcPassport=12]=`ReclaimMexcPassport`,e[e.ReclaimHtxPassport=13]=`ReclaimHtxPassport`,e}({}),r=function(e){return e.APPROVED=`APPROVED`,e.DECLINED=`DECLINED`,e.REVIEW=`REVIEW`,e.UNKNOWN=`UNKNOWN`,e}({}),i=function(e){return e.COMPLETED=`COMPLETED`,e.FAILED=`FAILED`,e.PENDING=`PENDING`,e.RUNNING=`RUNNING`,e.NOT_STARTED=`NOT_STARTED`,e}({});exports.KycVerificationResult=r,exports.KycVerificationStatus=i,exports.Passports=n,exports.VERIFICATION_TYPE=e,exports.VerificationTypes=t;
|
package/types/kyc.types.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export declare enum VERIFICATION_TYPE {
|
|
2
|
-
USER = "USER",
|
|
3
|
-
BUSINESS = "BUSINESS"
|
|
4
|
-
}
|
|
5
|
-
export declare const VerificationTypes: VERIFICATION_TYPE[];
|
|
6
|
-
export declare enum Passports {
|
|
7
|
-
AiPriseKyc = 0,
|
|
8
|
-
AiPriseKyb = 1,
|
|
9
|
-
BABPassport = 2,
|
|
10
|
-
GalxePassport = 3,
|
|
11
|
-
ZkMePassport = 4,
|
|
12
|
-
CoinbasePassport = 5,
|
|
13
|
-
AuthentoPassport = 6,
|
|
14
|
-
AuthentoPassportKyb = 7,
|
|
15
|
-
ReclaimCoinbasePassport = 8,
|
|
16
|
-
ReclaimBNBPassport = 9,
|
|
17
|
-
ReclaimOKXPassport = 10,
|
|
18
|
-
ReclaimGatePassport = 11,
|
|
19
|
-
ReclaimMexcPassport = 12,
|
|
20
|
-
ReclaimHtxPassport = 13
|
|
21
|
-
}
|
|
22
|
-
export declare enum KycVerificationResult {
|
|
23
|
-
APPROVED = "APPROVED",// The user is verified. The verification process successfully completed.
|
|
24
|
-
DECLINED = "DECLINED",// The user is not verified. The verification process successfully completed.
|
|
25
|
-
REVIEW = "REVIEW",// The end user or business needs to be manually looked at. The verification process successfully completed.
|
|
26
|
-
UNKNOWN = "UNKNOWN"
|
|
27
|
-
}
|
|
28
|
-
export declare enum KycVerificationStatus {
|
|
29
|
-
COMPLETED = "COMPLETED",// The verification process successfully completed.
|
|
30
|
-
FAILED = "FAILED",// The verification process failed. status_reasons(explained below) should have more details.
|
|
31
|
-
PENDING = "PENDING",// The verification process is waiting for a third-party API to complete its processing.
|
|
32
|
-
RUNNING = "RUNNING",// The verification process is running.
|
|
33
|
-
NOT_STARTED = "NOT_STARTED"
|
|
34
|
-
}
|
|
35
|
-
export interface VerificationData {
|
|
36
|
-
verificationResult: KycVerificationResult | null;
|
|
37
|
-
verificationStatus: KycVerificationStatus | null;
|
|
38
|
-
countryCode: string | null;
|
|
39
|
-
fullName: string | null;
|
|
40
|
-
idNumber: string | null;
|
|
41
|
-
}
|
package/types/kyc.types.mjs
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
//#region libs/shared/common/src/types/kyc.types.ts
|
|
2
|
-
var e = /* @__PURE__ */ function(e) {
|
|
3
|
-
return e.USER = "USER", e.BUSINESS = "BUSINESS", e;
|
|
4
|
-
}({}), t = [e.USER, e.BUSINESS], n = /* @__PURE__ */ function(e) {
|
|
5
|
-
return e[e.AiPriseKyc = 0] = "AiPriseKyc", e[e.AiPriseKyb = 1] = "AiPriseKyb", e[e.BABPassport = 2] = "BABPassport", e[e.GalxePassport = 3] = "GalxePassport", e[e.ZkMePassport = 4] = "ZkMePassport", e[e.CoinbasePassport = 5] = "CoinbasePassport", e[e.AuthentoPassport = 6] = "AuthentoPassport", e[e.AuthentoPassportKyb = 7] = "AuthentoPassportKyb", e[e.ReclaimCoinbasePassport = 8] = "ReclaimCoinbasePassport", e[e.ReclaimBNBPassport = 9] = "ReclaimBNBPassport", e[e.ReclaimOKXPassport = 10] = "ReclaimOKXPassport", e[e.ReclaimGatePassport = 11] = "ReclaimGatePassport", e[e.ReclaimMexcPassport = 12] = "ReclaimMexcPassport", e[e.ReclaimHtxPassport = 13] = "ReclaimHtxPassport", e;
|
|
6
|
-
}({}), r = /* @__PURE__ */ function(e) {
|
|
7
|
-
return e.APPROVED = "APPROVED", e.DECLINED = "DECLINED", e.REVIEW = "REVIEW", e.UNKNOWN = "UNKNOWN", e;
|
|
8
|
-
}({}), i = /* @__PURE__ */ function(e) {
|
|
9
|
-
return e.COMPLETED = "COMPLETED", e.FAILED = "FAILED", e.PENDING = "PENDING", e.RUNNING = "RUNNING", e.NOT_STARTED = "NOT_STARTED", e;
|
|
10
|
-
}({});
|
|
11
|
-
//#endregion
|
|
12
|
-
export { r as KycVerificationResult, i as KycVerificationStatus, n as Passports, e as VERIFICATION_TYPE, t as VerificationTypes };
|