@hinkal/common 0.2.36 → 0.2.38
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/API/enclaveUtxoCalls.cjs +1 -1
- package/API/enclaveUtxoCalls.mjs +6 -7
- package/README.md +0 -22
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.mjs +2 -1
- package/constants/events.constants.cjs +1 -1
- package/constants/events.constants.mjs +3 -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 +1 -5
- package/constants/server.constants.mjs +1 -6
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -1
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +13 -13
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +5 -3
- package/data-structures/Hinkal/Hinkal.mjs +98 -99
- package/data-structures/Hinkal/IHinkal.d.ts +5 -3
- package/data-structures/Hinkal/hinkalDepositAndBridge.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositAndBridge.d.ts +2 -2
- package/data-structures/Hinkal/hinkalDepositAndBridge.mjs +8 -5
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.d.ts +2 -2
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +4 -1
- package/data-structures/Hinkal/hinkalNearDepositAndBridge.cjs +1 -1
- package/data-structures/Hinkal/hinkalNearDepositAndBridge.mjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.d.ts +2 -2
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +4 -1
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +12 -12
- package/data-structures/TokenDBs/AlchemyPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/AlchemyPublicTokensDB.mjs +3 -2
- package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/EventsPublicTokensDB.d.ts +0 -1
- package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +27 -36
- package/data-structures/TokenDBs/PublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/PublicTokensDB.mjs +23 -20
- 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/TronPublicTokensDB.cjs +1 -0
- package/data-structures/TokenDBs/TronPublicTokensDB.d.ts +9 -0
- package/data-structures/TokenDBs/TronPublicTokensDB.mjs +47 -0
- package/data-structures/TokenDBs/index.cjs +1 -1
- package/data-structures/TokenDBs/index.d.ts +2 -0
- package/data-structures/TokenDBs/index.mjs +2 -0
- package/data-structures/index.cjs +1 -1
- package/data-structures/index.mjs +2 -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 +1 -4
- package/functions/pre-transaction/sendV0Transaction.cjs +2 -2
- package/functions/pre-transaction/sendV0Transaction.mjs +69 -57
- package/functions/snarkjs/common.snarkjs.cjs +1 -1
- package/functions/snarkjs/common.snarkjs.mjs +2 -2
- package/functions/snarkjs/constant.cjs +1 -1
- package/functions/snarkjs/constant.mjs +1 -1
- package/functions/utils/enclaveHandshakeService.cjs +1 -0
- package/functions/utils/enclaveHandshakeService.d.ts +10 -0
- package/functions/utils/enclaveHandshakeService.mjs +22 -0
- package/functions/utils/encryptInputForEnclave.cjs +1 -1
- package/functions/utils/encryptInputForEnclave.mjs +23 -25
- package/functions/utils/index.cjs +1 -1
- package/functions/utils/index.d.ts +1 -0
- package/functions/utils/index.mjs +1 -0
- package/functions/utils/tron.utils.cjs +1 -1
- package/functions/utils/tron.utils.d.ts +1 -0
- package/functions/utils/tron.utils.mjs +1 -1
- package/index.cjs +1 -1
- package/index.mjs +314 -317
- package/package.json +2 -2
- package/types/cache.types.cjs +1 -1
- package/types/cache.types.d.ts +2 -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/types/scheduled-transactions.types.d.ts +4 -0
- 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
|
@@ -3,10 +3,6 @@ import { TaskTypes as n } from "../types/new-rewards.type.mjs";
|
|
|
3
3
|
import "../types/index.mjs";
|
|
4
4
|
//#region libs/shared/common/src/constants/server.constants.ts
|
|
5
5
|
var r = { ROUTES: {
|
|
6
|
-
checkKycStatus: "/check-kyc-status",
|
|
7
|
-
startReclaimVerification: "/start-reclaim-verification",
|
|
8
|
-
startUserVerification: "/start-aiprise-verification",
|
|
9
|
-
zkMeAccessToken: "/zkMeAccessToken",
|
|
10
6
|
getSnapshots: (e) => `/snapshots/${e}`,
|
|
11
7
|
getMerkleTreeSiblings: "/merkle-tree-siblings",
|
|
12
8
|
getSnapshotServerEvents: "/events",
|
|
@@ -77,7 +73,6 @@ var r = { ROUTES: {
|
|
|
77
73
|
savePrivacyScoreAndGetPrivacyRank: "/save-privacy-score-and-get-privacy-rank"
|
|
78
74
|
}, a = [
|
|
79
75
|
n.firstSwap,
|
|
80
|
-
n.reclaim,
|
|
81
76
|
n.dailySwap,
|
|
82
77
|
n.dailyDappTx,
|
|
83
78
|
n.createOrJoinBH,
|
|
@@ -128,6 +123,6 @@ var r = { ROUTES: {
|
|
|
128
123
|
webflowBlogPosts: "/webflow-blog-posts",
|
|
129
124
|
brevoSubscribe: "/brevo-subscribe",
|
|
130
125
|
versionChecker: (e) => `/version-checker/${e}`
|
|
131
|
-
}, c = "v12", l = t ? e : `${e}v12`, u = "https://wallet-playground.hinkal.io", d = "https://wallet-staging.hinkal.io", f = "https://wallet-prodv12.hinkal.io", p = "http://localhost:7072", m = "/server", h = "http://localhost:7073", g = "/relayer", _ = "http://localhost:7074", v = "/snapshot-server", y = "http://localhost:7090", b = "/data-server", x = "http://localhost:7075", S = "/compliance-server", C = "http://localhost:7077", w = "https://api-staging.hinkal.io", T = "https://api.hinkal.io";
|
|
126
|
+
}, c = "v12", l = t ? e : `${e}v12`, u = "https://wallet-playground.hinkal.io", d = "https://wallet-staging-v2.hinkal.io", f = "https://wallet-prodv12.hinkal.io", p = "http://localhost:7072", m = "/server", h = "http://localhost:7073", g = "/relayer", _ = "http://localhost:7074", v = "/snapshot-server", y = "http://localhost:7090", b = "/data-server", x = "http://localhost:7075", S = "/compliance-server", C = "http://localhost:7077", w = "https://api-staging.hinkal.io", T = "https://api.hinkal.io";
|
|
132
127
|
//#endregion
|
|
133
128
|
export { r as API_CONFIG, s as DATA_SERVER_CONFIG, b as DATA_SERVER_URL_ENDPOINT, y as DATA_SERVER_URL_LOCAL, T as ENCLAVE_API_PRODUCTION_URL, w as ENCLAVE_API_STAGING_URL, C as ENCLAVE_API_URL_LOCAL, S as FUND_COMPLIANCE_URL_ENDPOINT, x as FUND_COMPLIANCE_URL_LOCAL, u as PLAYGROUND_URL, f as PRODUCTION_URL, i as RELAYER_CONFIG, g as RELAYER_URL_ENDPOINT, h as RELAYER_URL_LOCAL, m as SERVER_URL_ENDPOINT, p as SERVER_URL_LOCAL, v as SNAPSHOT_SERVER_URL_ENDPOINT, _ as SNAPSHOT_SERVER_URL_LOCAL, d as STAGING_URL, o as VERIFICATION_ROUTES, a as WALLET_TASK_VERIFICATION_TYPES, c as backendVersion, l as deploymentModeWithVersion };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../types/approvals.types.cjs`),t=require(`../../constants/chains.constants.cjs`),n=require(`../../constants/protocol.constants.cjs`),r=require(`../../types/cache.types.cjs`),i=require(`../http/HttpClient.cjs`),a=require(`../../functions/utils/caseInsensitive.utils.cjs`),o=require(`../../API/API.cjs`),s=require(`../../functions/utils/erc20tokenFunctions.cjs`),c=require(`../../constants/events.constants.cjs`),l=require(`../../error-handling/logger.cjs`),u=require(`../../functions/utils/string.utils.cjs`),d=require(`../../functions/utils/create-provider.cjs`);let f=require(`
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../types/approvals.types.cjs`),t=require(`../../constants/chains.constants.cjs`),n=require(`../../constants/protocol.constants.cjs`),r=require(`../../types/cache.types.cjs`),i=require(`../http/HttpClient.cjs`),a=require(`../../functions/utils/caseInsensitive.utils.cjs`),o=require(`../../API/API.cjs`),s=require(`../../functions/utils/erc20tokenFunctions.cjs`),c=require(`../../constants/events.constants.cjs`),l=require(`../../error-handling/logger.cjs`),u=require(`../../functions/utils/string.utils.cjs`),d=require(`../../functions/utils/create-provider.cjs`);let f=require(`ethers`),p=require(`idb-keyval`),m=require(`async-mutex`);var h=class{updateMutexes={};approvalTopic=f.ethers.id(`Approval(address,address,uint256)`);approvalForAllTopic=f.ethers.id(`ApprovalForAll(address,address,bool)`);getApprovedSelector=f.ethers.id(`getApproved(uint256)`).substring(0,10);isApprovedForAllSelector=f.ethers.id(`isApprovedForAll(address,address)`).substring(0,10);ALCHEMY_URLS={[t.chainIds.ethMainnet]:`eth-mainnet`,[t.chainIds.polygon]:`polygon-mainnet`,[t.chainIds.arbMainnet]:`arb-mainnet`,[t.chainIds.optimism]:`opt-mainnet`,[t.chainIds.base]:`base-mainnet`,[t.chainIds.arcTestnet]:`arc-testnet`};getMutex(e){return this.updateMutexes[e]||(this.updateMutexes[e]=new m.Mutex),this.updateMutexes[e]}getAlchemyUrl(e){let n=this.ALCHEMY_URLS[e];if(!n)throw Error(`Unsupported chainId for Alchemy: ${e}`);return`https://${n}.g.alchemy.com/v2/${t.ALCHEMY_API_KEY}`}async getApprovals(e,t){let n=u.getStateKey(t,e);return(await(0,p.get)(r.StorageKeys.EVENTS_PUBLIC_APPROVALS))?.[n]||[]}async getLastProcessedBlock(e,t){return(await(0,p.get)(r.StorageKeys.PUBLIC_APPROVALS_LAST_PROCESSED_BLOCKS)||{})[u.getStateKey(t,e)]||c.EVENTS_INITIAL_BLOCKS[e]}async updateLastProcessedBlock(e,t,n){await(0,p.update)(r.StorageKeys.PUBLIC_APPROVALS_LAST_PROCESSED_BLOCKS,(r={})=>{let i=u.getStateKey(t,e);return{...r,[i]:n}})}async getApprovalEvents(e,t){try{let n=d.createJsonRpcProvider(t),r=await this.getLastProcessedBlock(t,e)+1,i=await n.getBlockNumber();if(r>i)return{approvalEvents:[],latestBlock:i};let a=f.ethers.zeroPadValue(e.toLowerCase(),32),o={topics:[[this.approvalTopic,this.approvalForAllTopic],a],fromBlock:r,toBlock:i};return{approvalEvents:await n.getLogs(o),latestBlock:i}}catch(e){return l.Logger.error(`Failed to fetch approval events`,e),{approvalEvents:[],latestBlock:void 0}}}async checkCurrentAllowances(t,r,c){let u=this.getAlchemyUrl(t),d=`0x${r.substring(2).padStart(64,`0`)}`,f=[...new Set(c.map(e=>e.contractAddress))],p=(await o.API.tokensInfoCall(t,f)).filter(e=>!!e),m=new Map(p.map(e=>[e.erc20TokenAddress.toLowerCase(),e])),h=[],g=[];if(c.forEach((t,n)=>{let i=m.get(t.contractAddress.toLowerCase());if(i)if(!s.isNFTToken(i))h.push({jsonrpc:`2.0`,id:h.length,method:`alchemy_getTokenAllowance`,params:[{contract:t.contractAddress,owner:r,spender:t.spenderAddress}]}),g.push({pairIndex:n,type:e.RevokeType.ERC20});else{let r=`0x${t.spenderAddress.substring(2).padStart(64,`0`)}`,i=`${this.isApprovedForAllSelector}${d.substring(2)}${r.substring(2)}`;h.push({jsonrpc:`2.0`,id:h.length,method:`eth_call`,params:[{to:t.contractAddress,data:i},`latest`]}),g.push({pairIndex:n,type:e.RevokeType.approvedForAll}),t.tokenIds&&t.tokenIds.size>0&&t.tokenIds.forEach(r=>{let i=BigInt(r).toString(16).padStart(64,`0`),a=`${this.getApprovedSelector}${i}`;h.push({jsonrpc:`2.0`,id:h.length,method:`eth_call`,params:[{to:t.contractAddress,data:a},`latest`]}),g.push({pairIndex:n,type:e.RevokeType.tokenId,tokenId:r})})}}),h.length===0)return[];let _=await i.httpClient.post(u,h),v=[],y=new Set;return _.forEach((t,r)=>{let i=g[r];if(!i)return;let o=c[i.pairIndex],s=m.get(o.contractAddress.toLowerCase());if(!(!s||a.caseInsensitiveEqual(o.spenderAddress,n.zeroAddress))&&!t?.error&&t?.result&&t.result!==`0x`)try{if(i.type===e.RevokeType.ERC20&&BigInt(t.result)>0n)v.push({token:s,spenderAddress:o.spenderAddress,allowance:BigInt(t.result)});else if(i.type===e.RevokeType.approvedForAll&&BigInt(t.result)===1n)y.add(i.pairIndex),v.push({token:s,spenderAddress:o.spenderAddress,allowance:1n});else if(i.type===e.RevokeType.tokenId&&!y.has(i.pairIndex)){let e=`0x${t.result.substring(26)}`.toLowerCase();!a.caseInsensitiveEqual(e,n.zeroAddress)&&a.caseInsensitiveEqual(e,o.spenderAddress)&&v.push({token:s,spenderAddress:o.spenderAddress,allowance:1n,tokenId:i.tokenId})}}catch(e){l.Logger.error(`Error processing approval response`,e)}}),v}async fetchAndUpdatePublicApprovals(e,t){let i=u.getStateKey(e,t);await this.getMutex(i).runExclusive(async()=>{try{let{approvalEvents:o,latestBlock:s}=await this.getApprovalEvents(e,t);if(!s)return;let c=await this.getApprovals(t,e),l=new Map;if(c.forEach(e=>{let t=e.token.erc20TokenAddress.toLowerCase(),n=e.spenderAddress.toLowerCase(),r=`${t}_${n}`,i=l.get(r);i||(i={contractAddress:t,spenderAddress:n,tokenIds:new Set},l.set(r,i)),e.tokenId&&i.tokenIds&&i.tokenIds.add(e.tokenId)}),o.forEach(e=>{if(!e.topics[2])return;let t=e.address.toLowerCase(),r=`0x${e.topics[2].substring(26)}`.toLowerCase();if(a.caseInsensitiveEqual(r,n.zeroAddress))return;let i=`${t}_${r}`,o=l.get(i);if(o||(o={contractAddress:t,spenderAddress:r,tokenIds:new Set},l.set(i,o)),e.topics.length===4&&o.tokenIds){let t=BigInt(e.topics[3]).toString();o.tokenIds.add(t)}}),l.size===0){await this.updateLastProcessedBlock(t,e,s);return}let u=Array.from(l.values()),d=await this.checkCurrentAllowances(t,e,u);await(0,p.update)(r.StorageKeys.EVENTS_PUBLIC_APPROVALS,(e={})=>({...e,[i]:d})),await this.updateLastProcessedBlock(t,e,s)}catch(e){l.Logger.error(`Failed to sync approvals`,e)}})}},g=new h;exports.EventsPublicApprovalsDB=h,exports.eventsPublicApprovalsDB=g;
|
|
@@ -10,16 +10,16 @@ import { EVENTS_INITIAL_BLOCKS as l } from "../../constants/events.constants.mjs
|
|
|
10
10
|
import { Logger as u } from "../../error-handling/logger.mjs";
|
|
11
11
|
import { getStateKey as d } from "../../functions/utils/string.utils.mjs";
|
|
12
12
|
import { createJsonRpcProvider as f } from "../../functions/utils/create-provider.mjs";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
13
|
+
import { ethers as p } from "ethers";
|
|
14
|
+
import { get as m, update as h } from "idb-keyval";
|
|
15
|
+
import { Mutex as g } from "async-mutex";
|
|
16
16
|
//#region libs/shared/common/src/data-structures/ApprovalDBs/EventsPublicApprovalsDB.ts
|
|
17
17
|
var _ = class {
|
|
18
18
|
updateMutexes = {};
|
|
19
|
-
approvalTopic =
|
|
20
|
-
approvalForAllTopic =
|
|
21
|
-
getApprovedSelector =
|
|
22
|
-
isApprovedForAllSelector =
|
|
19
|
+
approvalTopic = p.id("Approval(address,address,uint256)");
|
|
20
|
+
approvalForAllTopic = p.id("ApprovalForAll(address,address,bool)");
|
|
21
|
+
getApprovedSelector = p.id("getApproved(uint256)").substring(0, 10);
|
|
22
|
+
isApprovedForAllSelector = p.id("isApprovedForAll(address,address)").substring(0, 10);
|
|
23
23
|
ALCHEMY_URLS = {
|
|
24
24
|
[n.ethMainnet]: "eth-mainnet",
|
|
25
25
|
[n.polygon]: "polygon-mainnet",
|
|
@@ -29,7 +29,7 @@ var _ = class {
|
|
|
29
29
|
[n.arcTestnet]: "arc-testnet"
|
|
30
30
|
};
|
|
31
31
|
getMutex(e) {
|
|
32
|
-
return this.updateMutexes[e] || (this.updateMutexes[e] = new
|
|
32
|
+
return this.updateMutexes[e] || (this.updateMutexes[e] = new g()), this.updateMutexes[e];
|
|
33
33
|
}
|
|
34
34
|
getAlchemyUrl(e) {
|
|
35
35
|
let n = this.ALCHEMY_URLS[e];
|
|
@@ -38,13 +38,13 @@ var _ = class {
|
|
|
38
38
|
}
|
|
39
39
|
async getApprovals(e, t) {
|
|
40
40
|
let n = d(t, e);
|
|
41
|
-
return (await
|
|
41
|
+
return (await m(i.EVENTS_PUBLIC_APPROVALS))?.[n] || [];
|
|
42
42
|
}
|
|
43
43
|
async getLastProcessedBlock(e, t) {
|
|
44
|
-
return (await
|
|
44
|
+
return (await m(i.PUBLIC_APPROVALS_LAST_PROCESSED_BLOCKS) || {})[d(t, e)] || l[e];
|
|
45
45
|
}
|
|
46
46
|
async updateLastProcessedBlock(e, t, n) {
|
|
47
|
-
await
|
|
47
|
+
await h(i.PUBLIC_APPROVALS_LAST_PROCESSED_BLOCKS, (r = {}) => {
|
|
48
48
|
let i = d(t, e);
|
|
49
49
|
return {
|
|
50
50
|
...r,
|
|
@@ -59,7 +59,7 @@ var _ = class {
|
|
|
59
59
|
approvalEvents: [],
|
|
60
60
|
latestBlock: i
|
|
61
61
|
};
|
|
62
|
-
let a =
|
|
62
|
+
let a = p.zeroPadValue(e.toLowerCase(), 32), o = {
|
|
63
63
|
topics: [[this.approvalTopic, this.approvalForAllTopic], a],
|
|
64
64
|
fromBlock: r,
|
|
65
65
|
toBlock: i
|
|
@@ -185,7 +185,7 @@ var _ = class {
|
|
|
185
185
|
return;
|
|
186
186
|
}
|
|
187
187
|
let u = Array.from(l.values()), d = await this.checkCurrentAllowances(t, e, u);
|
|
188
|
-
await
|
|
188
|
+
await h(i.EVENTS_PUBLIC_APPROVALS, (e = {}) => ({
|
|
189
189
|
...e,
|
|
190
190
|
[n]: d
|
|
191
191
|
})), await this.updateLastProcessedBlock(t, e, s);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../types/ethereum-network.types.cjs`),t=require(`../../functions/utils/serialize.utils.cjs`),n=require(`../../constants/vite.constants.cjs`),r=require(`../../constants/chains.constants.cjs`),i=require(`../../constants/protocol.constants.cjs`),a=require(`../../types/hinkal.types.cjs`),o=require(`../../API/API.cjs`),s=require(`../../constants/kyc.constants.cjs`),c=require(`../../error-handling/error-codes.constants.cjs`),l=require(`../../functions/utils/erc20tokenFunctions.cjs`);require(`../../API/index.cjs`);const u=require(`../../crypto/poseidon.cjs`),d=require(`../crypto-keys/keys.cjs`),f=require(`../../functions/utils/token-check.utils.cjs`),p=require(`../TokenDBs/PrivateTokensDB.cjs`),m=require(`../../functions/web3/events/getShieldedBalance.cjs`),h=require(`../../functions/pre-transaction/solana.cjs`),ee=require(`../../functions/web3/getContractMetadata.cjs`),g=require(`../../functions/utils/reloadPage.cjs`),_=require(`../../functions/utils/cacheDevice.utils.cjs`),v=require(`../../providers/SolanaProviderAdapter.cjs`),te=require(`../../functions/utils/enclave-signature-storage.cjs`),y=require(`../../functions/utils/mnemonics.cjs`),b=require(`../../functions/web3/fetchSolanaMerkleTreeRootHash.cjs`),x=require(`../../functions/private-wallet/emporium.helpers.cjs`),S=require(`./hinkalDeposit.cjs`),C=require(`../../functions/kyc/checkTokenLimitsUSD.cjs`),w=require(`./hinkalDepositAndWithdraw.cjs`),T=require(`./hinkalSolanaDeposit.cjs`),E=require(`./hinkalSwap.cjs`),D=require(`./hinkalWithdraw.cjs`),O=require(`../merkle-tree/MerkleTree.cjs`);require(`../merkle-tree/index.cjs`);const k=require(`./resetMerkleTrees.cjs`),A=require(`../MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs`),j=require(`./hinkalPrivateWallet.cjs`),M=require(`./hinkalGetRecipientInfo.cjs`),N=require(`./hinkalSignSubAccount.cjs`),P=require(`./hinkalActionReceive.cjs`);require(`../TokenDBs/index.cjs`);const F=require(`./hinkalProoflessDeposit.cjs`),I=require(`./hinkalProxySwap.cjs`),L=require(`./hinkalMultiSend.cjs`),R=require(`./hinkalTransfer.cjs`),z=require(`./hinkalProxyToPrivate.cjs`),B=require(`../../providers/TronProviderAdapter.cjs`),V=require(`./hinkalSolanaDepositAndWithdraw.cjs`),H=require(`./hinkalSolanaWithdraw.cjs`),U=require(`./hinkalSolanaTransfer.cjs`),W=require(`./hinkalSolanaSwap.cjs`),G=require(`./hinkalSolanaProxySend.cjs`),K=require(`./hinkalSolanaProxySwap.cjs`),q=require(`./hinkalSolanaProxyShield.cjs`),J=require(`./hinkalDepositAndBridge.cjs`),Y=require(`./hinkalNearDepositAndBridge.cjs`),X=require(`./hinkalClaimUtxo.cjs`),Z=require(`./hinkalSolanaProoflessDeposit.cjs`),Q=require(`./hinkalSolanaClaimUtxo.cjs`),ne=require(`./hinkalWithdrawStuckUtxos.cjs`);let $=require(`@solana/web3.js`);var re=class{ethereumProviderAdapter;solanaProviderAdapter;tronProviderAdapter;userKeys;signingMessage=`Login to Hinkal Protocol`;privateTransferSigningMessage=`Login to Hinkal's Private Transfer App`;merkleTreeHinkalByChain={};nullifiersByChain={};encryptedOutputsByChain={};commitmentsSnapshotServiceByChain={};nullifierSnapshotServiceByChain={};utxoUtils;lastCallState=new Map;cacheDevice;generateProofRemotely;disableMerkleTreeUpdates;constructor(e){this.userKeys=new d.UserKeys(void 0),e?.tronChainOverride&&r.setHinkalTronChainId(e.tronChainOverride),r.HINKAL_SUPPORTED_CHAINS.forEach(e=>{this.merkleTreeHinkalByChain[e]=O.MerkleTree.create(u.poseidonFunction,0n),this.nullifiersByChain[e]=new Set,this.encryptedOutputsByChain[e]=[]}),this.generateProofRemotely=e?.generateProofRemotely??!0,this.utxoUtils=new A.MultiThreadedUtxoUtils,this.cacheDevice=_.createCacheDevice(e),this.disableMerkleTreeUpdates=e?.disableMerkleTreeUpdates??!1}enforceRateLimit(e,n,r=1e3){let i=Date.now(),a=t.CustomJSONStringify(n),o=this.lastCallState.get(e);if(o&&o.argsKey===a&&i-o.timestamp<r)throw Error(`${e} was already called with the same arguments`);this.lastCallState.set(e,{timestamp:i,argsKey:a})}getProviderAdapter(e){let t=e;t||=this.ethereumProviderAdapter?r.chainIds.ethMainnet:this.solanaProviderAdapter?r.currentSolanaChainId:r.chainIds.tronMainnet;let n;if(n=r.isSolanaLike(t)?this.solanaProviderAdapter:r.isTronLike(t)?this.tronProviderAdapter:this.ethereumProviderAdapter,!n)throw Error(`ProviderAdapter is not initialized`);return n}async initProviderAdapter(e,t){let n=r.chainIds.ethMainnet;t instanceof v.SolanaProviderAdapter?n=r.currentSolanaChainId:t instanceof B.TronProviderAdapter&&(n=r.currentTronChainId),await this.updateProviderAdapter(n,t),t.initConnector(e);let i=await t.connectAndPatchProvider(e);await t.init(i),await this.setListeners()}getSigningMessage(e=a.LoginMessageMode.PROTOCOL){switch(e){case a.LoginMessageMode.PRIVATE_TRANSFER:return this.privateTransferSigningMessage;case a.LoginMessageMode.PROTOCOL:default:return this.signingMessage}}async signHinkalMessage(e=a.LoginMessageMode.PROTOCOL){let t=this.getSigningMessage(e);return this.getProviderAdapter().signMessage(t)}async signSolanaLedgerMessage(){let e=new $.Transaction({blockhash:i.DETERMINISTIC_SOLANA_LEDGER_BLOCKHASH,lastValidBlockHeight:i.DETERMINISTIC_SOLANA_LEDGER_LAST_VALID_BLOCK_HEIGHT,feePayer:this.getSolanaPublicKey()}),t=await this.getProviderAdapter().signTransactionWithoutBroadcast?.(e);if(!t)throw Error(`Failed to sign transaction without broadcast`);return{signature:t.signature,txMessageForSolanaLedger:t.transactionMessageB64}}async initUserKeys(e=a.LoginMessageMode.PROTOCOL){this.userKeys=new d.UserKeys(await this.signHinkalMessage(e))}initUserKeysWithSignature(e){this.userKeys=new d.UserKeys(e)}async initUserKeysFromSeedPhrases(e){let t=y.generateHashFromSeedPhrases(e);this.userKeys=new d.UserKeys(t)}async storeAndGetInitialSignature(e,t=!1,n){let r=await this.getEthereumAddress();if(!r)throw Error(`Connected address not found`);return await te.storeAndGetSignatureFromEnclave(r,e,t,n)}async resetMerkle(e){this.disableMerkleTreeUpdates||(e?.every(e=>this.isSelectedNetworkSupported(e))??!0)&&await k.resetMerkleTrees(this,e)}getTronWeb(){let e=this.tronProviderAdapter;if(!e)throw Error(`Tron provider adapter not initialized`);if(!(e instanceof B.TronProviderAdapter))throw Error(`Tron provider adapter is not a TronProviderAdapter`);let t=e.getTronWeb();if(!t)throw Error(`TronWeb not available`);return t}getSupportedChains(){return this.ethereumProviderAdapter&&this.solanaProviderAdapter?r.WALLET_SUPPORTED_CHAINS:this.ethereumProviderAdapter?r.HINKAL_SUPPORTED_CHAINS.filter(e=>!r.isSolanaLike(e)&&!r.isTronLike(e)):this.solanaProviderAdapter?r.HINKAL_SUPPORTED_CHAINS.filter(e=>r.isSolanaLike(e)):this.tronProviderAdapter?[r.currentTronChainId]:[]}async waitForTransaction(e,t,n=1){return!!await this.getProviderAdapter(e).waitForTransaction(e,t,n)}getContract(e,t,n=void 0){return this.getProviderAdapter(e).getContract(e,t,n)}getContractWithFetcherByChainId(e,t,n=void 0){return ee.getContractWithFetcherByChainId(e,t,n)}async signMessage(e){return await this.getProviderAdapter().signMessage(e)}async signTypedData(e,t,n){return await this.getProviderAdapter().signTypedData(e,t,n)}async signWithSubAccount(e,t,n,r){return N.hinkalSignSubAccount(e,t,n,r)}getContractWithSigner(e,t,n=``){return this.getProviderAdapter(e).getContractWithSigner(e,t,n)}getContractWithFetcher(e,t,n=``){return this.getProviderAdapter(e).getContractWithFetcher(e,t,n)}isSelectedNetworkSupported(e){return!!r.networkRegistry[e]}async switchNetwork(e){let t=this.getProviderAdapter(),n=t.getChainId(),i=n!==void 0&&r.isSameOnchainNetwork(e.chainId,n);if(!(e.chainId===n||i))try{await t.switchNetwork(e)}catch{throw Error(c.transactionErrorCodes.FAILED_TO_SWITCH_NETWORKS)}}isPermitterAvailable(e){return this.getProviderAdapter(e).isPermitterAvailable()}async disconnectFromConnector(){await this.ethereumProviderAdapter?.disconnectFromConnector(),await this.solanaProviderAdapter?.disconnectFromConnector(),await this.tronProviderAdapter?.disconnectFromConnector()}async resetProviderAdapters(){this.ethereumProviderAdapter=void 0,this.solanaProviderAdapter=void 0,this.tronProviderAdapter=void 0}async updateProviderAdapter(e,t){try{r.isSolanaLike(e)?(this.solanaProviderAdapter&&this.solanaProviderAdapter.release(),this.solanaProviderAdapter=t):r.isTronLike(e)?(this.tronProviderAdapter&&this.tronProviderAdapter.release(),this.tronProviderAdapter=t):(this.ethereumProviderAdapter&&this.ethereumProviderAdapter.release(),this.ethereumProviderAdapter=t)}catch(e){throw console.error(e),Error(`updateProviderAdapter failed, please try again.`)}}async setListeners(){this.ethereumProviderAdapter?.setChainEventListener({onAccountChanged:()=>{this.onAccountChanged()},onChainChanged:e=>{this.onChainChanged(e)}}),this.solanaProviderAdapter?.setChainEventListener({onAccountChanged:()=>{this.onAccountChanged()},onChainChanged:e=>{this.onChainChanged(e)}}),this.tronProviderAdapter?.setChainEventListener({onAccountChanged:()=>{this.onAccountChanged()},onChainChanged:e=>{this.onChainChanged(e)}})}async onAccountChanged(){await this.ethereumProviderAdapter?.onAccountChanged(),await this.solanaProviderAdapter?.onAccountChanged(),await this.tronProviderAdapter?.onAccountChanged();let e=a.EventType.AccountChanged;typeof document<`u`?document?.dispatchEvent(new Event(e)):process?.emit(`message`,e,void 0)}async onChainChanged(e){e?await this.getProviderAdapter(e).onChainChanged(e):(await this.disconnectFromConnector(),g.reloadPage())}async monitorConnectedAddress(e){await o.API.monitor(await this.getEthereumAddressByChain(e))}async getBalances(e,t,n,r,i=!1,a,o=!1){return m.getShieldedBalance(this,e,t,n,r,i,this.generateProofRemotely,a,o)}async getTotalBalance(e,t,r,i=!1,a,o=!1){let s=r??await this.getEthereumAddressByChain(e),c=t??this.userKeys,u=await this.getBalances(e,c.getShieldedPrivateKey(),c.getShieldedPublicKey(),s,i,a,o),d=n.isExtension?await p.privateTokensDB.getPrivateTokens(e,s):l.getErc20TokensForChain(e),f=[];return d.forEach(e=>{let t=e.erc20TokenAddress.toLowerCase(),n=u.get(t),r={token:e,balance:n?.balance??0n,timestamp:n?.timestamp||`0`,nfts:n?.nfts||[]};f.push(r)}),f}async getStuckShieldedBalances(e,t,n){return(await this.getTotalBalance(e,t,n,!1,!1,!0)).filter(e=>e.balance>0n)}getSupportedPassportLinks(){return s.supportedPassportLinks}checkAccessToken(e,t){return Promise.resolve(!0)}checkExternalTokenLimitsUSD(e,t,n){return C.checkTokenLimitsUSD(e,t,n)}async getHinkalTreeRootHash(t){if(r.isSolanaLike(t)){let{hinkalIdl:e,hinkalAddress:n,originalDeployer:i}=r.networkRegistry[t].contractData;if(!e||!n||!i)throw Error(`Missing Solana configuration for chain ${t}`);let a=new $.PublicKey(i),o=h.getMerkleAccountPublicKey(new $.PublicKey(n),a);return b.fetchSolanaMerkleTreeRootHash(this.getSolanaProgram(e),o)}return this.getContractWithFetcherByChainId(t,e.ContractType.HinkalContract).getRootHash()}async resetMerkleTreesIfNecessary(e){let t=(await Promise.all((e??this.getSupportedChains()).map(async e=>{let t=await this.getHinkalTreeRootHash(e);return{chainId:e,needsReset:BigInt(t)!==this.merkleTreeHinkalByChain[e].getRootHash()}}))).filter(e=>e.needsReset).map(e=>e.chainId);t.length>0&&(console.log(`resetting merkle tree in resetMerkleTreesIfNecessary for chains:`,t),await this.resetMerkle(t))}async getEthereumAddress(){let e=this.ethereumProviderAdapter??this.solanaProviderAdapter??this.tronProviderAdapter;if(!e)throw Error(`No provider adapter initialized`);return e.getAddress()}getEthereumAddressByChain(e){return this.getProviderAdapter(e).getAddress()}async getRandomRelay(e,t=!1){return(await o.API.getIdleRelay(e,t)).relay}getGasPrice(e){let t=this.getProviderAdapter(e);if(!t)throw Error(`Illegal State of providerAdapter in Hinkal: no providerAdapter initialized`);return t.getGasPrice(e)}getAPI(){return o.API}snapshotsClearInterval(){this.getSupportedChains().forEach(e=>{this.commitmentsSnapshotServiceByChain[e]?.intervalClear(),this.nullifierSnapshotServiceByChain[e]?.intervalClear()})}getRecipientInfo(){return M.getRecipientInfo(this)}async deposit(e,t,n=!0,r=!1){return S.hinkalDeposit(this,e,t,n,r)}async depositSolana(e,t,n=!1){return T.hinkalSolanaDeposit(this,e,t,n)}async depositForOther(e,t,n,r=!0,i=!1,a){return this.enforceRateLimit(this.depositForOther.name,[e,t,n]),S.hinkalDepositForOther(this,e,t,n,r,i,a)}async depositSolanaForOther(e,t,n,r=!1,i){return this.enforceRateLimit(this.depositSolanaForOther.name,[e,t,n]),T.hinkalSolanaDepositForOther(this,e,t,n,r,i)}async depositAndWithdraw(e,t,n,i,a,o,s,c,l=!0){return r.isSolanaLike(f.validateAndGetChainId([e]))?V.hinkalSolanaDepositAndWithdraw(this,e,t,n,i,a,o,s,c):w.hinkalDepositAndWithdraw(this,e,t,n,i,a,o,s,c,l)}async claimUtxo(e,t,n,i){return r.isSolanaLike(f.validateAndGetChainId([e]))?Q.hinkalSolanaClaimUtxo(this,e,t,n,i):X.hinkalClaimUtxo(this,e,t,n,i)}async depositAndBridge(e,t,n,r,i,a,o,s=!0){return J.hinkalDepositAndBridge(this,e,t,n,r,i,a,o,s)}async nearDepositAndBridge(e,t,n,r,i,a,o,s,c){return this.enforceRateLimit(this.nearDepositAndBridge.name,[e,t,n,r]),Y.hinkalNearDepositAndBridge(this,e,t,n,r,i,a,o,s,c)}async prooflessDeposit(e,t,n,i,a=!1){return r.isSolanaLike(f.validateAndGetChainId(e))?Z.hinkalSolanaProoflessDeposit(this,e,t,n,i,a):F.hinkalProoflessDeposit(this,e,t,n,i,a)}async prooflessDepositWithPublicFee(e,t,n,i,a){let o=f.validateAndGetChainId([e]);return r.isSolanaLike(o)?T.hinkalSolanaProoflessDepositWithPublicFee(this,e,t,n,i,a):F.hinkalProoflessDepositWithPublicFee(this,o,e,t,n,i,a)}getSolanaProgram(e){if(!this.solanaProviderAdapter)throw Error(`No provider adapter initialized`);if(!(`getSolanaProgram`in this.solanaProviderAdapter))throw Error(`Current provider adapter is not a Solana provider adapter`);return this.solanaProviderAdapter.getSolanaProgram(e)}getSolanaPublicKey(){if(!this.solanaProviderAdapter)throw Error(`No provider adapter initialized`);if(!(`getSolanaPublicKey`in this.solanaProviderAdapter))throw Error(`Current provider adapter is not a Solana provider adapter`);return this.solanaProviderAdapter.getSolanaPublicKey()}async transfer(e,t,n,i,a,o){return this.enforceRateLimit(this.transfer.name,[e,t,n]),r.isSolanaLike(f.validateAndGetChainId(e))?U.hinkalSolanaTransfer(this,e,t,n,i,a,o):R.hinkalTransfer(this,e,t,n,i,a,o)}async withdraw(e,t,n,i,a,o,s){return r.isSolanaLike(f.validateAndGetChainId(e))?H.hinkalSolanaWithdraw(this,e,t,n,a,o,s):D.hinkalWithdraw(this,e,t,n,i,a,o,s)}async withdrawStuckUtxos(e,t){return ne.hinkalWithdrawStuckUtxos(this,e,t)}async swap(e,t,n,i,a,o,s){return r.isSolanaLike(f.validateAndGetChainId(e))?this.swapSolana(e,t,i,a,o,s):E.hinkalSwap(this,e,t,n,i,a,o,s)}async swapSolana(e,t,n,r,i,a){let o=JSON.parse(n),s=BigInt(o.swapperAccountSalt),{instructionLists:c,addressLookupTableAccount:l}=o.data;return W.hinkalSolanaSwap(this,e,t,s,c,l,r,i,a)}async actionReceive(e,t,n,i,a,o){if(!a)throw Error(`subAccount is required`);return r.isSolanaLike(f.validateAndGetChainId(e))?q.hinkalSolanaProxyShield(this,e[0],t[0],a,void 0,o):P.hinkalActionReceive(this,e,t,n,i,a,o)}async actionPrivateWallet(e,t,n,r,i,a,o,s,c,l,u=!1,d,f,p){return this.enforceRateLimit(this.actionPrivateWallet.name,[e,t,n,r,i,a,o,s,c,p]),j.hinkalPrivateWallet(this,e,t,n,r,i,a,o,s,c,l,u,d,f,p)}async proxySwap(e,t,n,i,a,o,s,c,l=!1,u,d){return r.isSolanaLike(f.validateAndGetChainId(e))?K.hinkalSolanaProxySwap(this,e,t,i,o,n,s,c,d):I.hinkalProxySwap(this,e,t,n,i,a,o,s,c,l,u,d)}async proxyToPrivate(e,t,n,i,a,o,s){return r.isSolanaLike(f.validateAndGetChainId(e))?(this.enforceRateLimit(this.proxyToPrivate.name,[e[0],t[0],n,i]),q.hinkalSolanaProxyShield(this,e[0],t[0],n,i,s)):z.hinkalProxyToPrivate(this,e,t,i,a,o,n,s)}async proxySend(e,t,n,i,a,o,s){let c=f.validateAndGetChainId(e);if(r.isSolanaLike(c))return G.hinkalSolanaProxySend(this,e[0],t[0],n,i,s);let l=x.createTransaferEmporiumOpsBatch(this,c,e.map(e=>e.erc20TokenAddress),t,i),u=e.map((e,n)=>({token:e,amount:-1n*t[n]}));return await this.actionPrivateWallet(c,[],[],[],l,u,n,a,o,void 0,void 0,void 0,s,void 0)}async multiSendPrivateRecipients(e,t,n){return this.enforceRateLimit(this.multiSendPrivateRecipients.name,[e,t,n]),L.hinkalMultiSendPrivateRecipients(this,e,t,n)}areMerkleTreeUpdatesDisabled(){return this.disableMerkleTreeUpdates}updateMerkleTreeUpdates(e){this.disableMerkleTreeUpdates=e}};exports.Hinkal=re;
|
|
1
|
+
require(`../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../types/ethereum-network.types.cjs`),t=require(`../../functions/utils/serialize.utils.cjs`),n=require(`../../constants/vite.constants.cjs`),r=require(`../../constants/chains.constants.cjs`),i=require(`../../constants/protocol.constants.cjs`),a=require(`../../types/hinkal.types.cjs`),o=require(`../../API/scheduled-transactions-calls.cjs`),s=require(`../../API/API.cjs`),c=require(`../../error-handling/error-codes.constants.cjs`),l=require(`../../functions/utils/erc20tokenFunctions.cjs`);require(`../../API/index.cjs`);const u=require(`../../crypto/poseidon.cjs`),d=require(`../crypto-keys/keys.cjs`),f=require(`../../functions/utils/token-check.utils.cjs`),p=require(`../TokenDBs/PrivateTokensDB.cjs`),m=require(`../../functions/web3/events/getShieldedBalance.cjs`),h=require(`../../functions/pre-transaction/solana.cjs`),g=require(`../../functions/web3/getContractMetadata.cjs`),_=require(`../../functions/utils/reloadPage.cjs`),v=require(`../../functions/utils/cacheDevice.utils.cjs`),y=require(`../../providers/SolanaProviderAdapter.cjs`),ee=require(`../../functions/utils/enclave-signature-storage.cjs`),b=require(`../../functions/utils/mnemonics.cjs`),x=require(`../../functions/web3/fetchSolanaMerkleTreeRootHash.cjs`),S=require(`../../functions/private-wallet/emporium.helpers.cjs`),C=require(`./hinkalDeposit.cjs`),w=require(`./hinkalDepositAndWithdraw.cjs`),T=require(`./hinkalSolanaDeposit.cjs`),E=require(`./hinkalSwap.cjs`),D=require(`./hinkalWithdraw.cjs`),O=require(`../merkle-tree/MerkleTree.cjs`);require(`../merkle-tree/index.cjs`);const k=require(`./resetMerkleTrees.cjs`),A=require(`../MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs`),j=require(`./hinkalPrivateWallet.cjs`),M=require(`./hinkalGetRecipientInfo.cjs`),N=require(`./hinkalSignSubAccount.cjs`),P=require(`./hinkalActionReceive.cjs`);require(`../TokenDBs/index.cjs`);const F=require(`./hinkalProoflessDeposit.cjs`),te=require(`./hinkalProxySwap.cjs`),I=require(`./hinkalMultiSend.cjs`),L=require(`./hinkalTransfer.cjs`),R=require(`./hinkalProxyToPrivate.cjs`),z=require(`../../providers/TronProviderAdapter.cjs`),B=require(`./hinkalSolanaDepositAndWithdraw.cjs`),V=require(`./hinkalSolanaWithdraw.cjs`),H=require(`./hinkalSolanaTransfer.cjs`),U=require(`./hinkalSolanaSwap.cjs`),W=require(`./hinkalSolanaProxySend.cjs`),G=require(`./hinkalSolanaProxySwap.cjs`),K=require(`./hinkalSolanaProxyShield.cjs`),q=require(`./hinkalDepositAndBridge.cjs`),J=require(`./hinkalNearDepositAndBridge.cjs`),Y=require(`./hinkalClaimUtxo.cjs`),X=require(`./hinkalSolanaProoflessDeposit.cjs`),Z=require(`./hinkalSolanaClaimUtxo.cjs`),Q=require(`./hinkalWithdrawStuckUtxos.cjs`);let $=require(`@solana/web3.js`);var ne=class{ethereumProviderAdapter;solanaProviderAdapter;tronProviderAdapter;userKeys;signingMessage=`Login to Hinkal Protocol`;privateTransferSigningMessage=`Login to Hinkal's Private Transfer App`;merkleTreeHinkalByChain={};nullifiersByChain={};encryptedOutputsByChain={};commitmentsSnapshotServiceByChain={};nullifierSnapshotServiceByChain={};utxoUtils;lastCallState=new Map;cacheDevice;generateProofRemotely;disableMerkleTreeUpdates;constructor(e){this.userKeys=new d.UserKeys(void 0),e?.tronChainOverride&&r.setHinkalTronChainId(e.tronChainOverride),r.HINKAL_SUPPORTED_CHAINS.forEach(e=>{this.merkleTreeHinkalByChain[e]=O.MerkleTree.create(u.poseidonFunction,0n),this.nullifiersByChain[e]=new Set,this.encryptedOutputsByChain[e]=[]}),this.generateProofRemotely=e?.generateProofRemotely??!0,this.utxoUtils=new A.MultiThreadedUtxoUtils,this.cacheDevice=v.createCacheDevice(e),this.disableMerkleTreeUpdates=e?.disableMerkleTreeUpdates??!1}enforceRateLimit(e,n,r=1e3){let i=Date.now(),a=t.CustomJSONStringify(n),o=this.lastCallState.get(e);if(o&&o.argsKey===a&&i-o.timestamp<r)throw Error(`${e} was already called with the same arguments`);this.lastCallState.set(e,{timestamp:i,argsKey:a})}getProviderAdapter(e){let t=e;t||=this.ethereumProviderAdapter?r.chainIds.ethMainnet:this.solanaProviderAdapter?r.currentSolanaChainId:r.chainIds.tronMainnet;let n;if(n=r.isSolanaLike(t)?this.solanaProviderAdapter:r.isTronLike(t)?this.tronProviderAdapter:this.ethereumProviderAdapter,!n)throw Error(`ProviderAdapter is not initialized`);return n}async initProviderAdapter(e,t){let n=r.chainIds.ethMainnet;t instanceof y.SolanaProviderAdapter?n=r.currentSolanaChainId:t instanceof z.TronProviderAdapter&&(n=r.currentTronChainId),await this.updateProviderAdapter(n,t),t.initConnector(e);let i=await t.connectAndPatchProvider(e);await t.init(i),await this.setListeners()}getSigningMessage(e=a.LoginMessageMode.PROTOCOL){switch(e){case a.LoginMessageMode.PRIVATE_TRANSFER:return this.privateTransferSigningMessage;case a.LoginMessageMode.PROTOCOL:default:return this.signingMessage}}async signHinkalMessage(e=a.LoginMessageMode.PROTOCOL){let t=this.getSigningMessage(e);return this.getProviderAdapter().signMessage(t)}async signSolanaLedgerMessage(){let e=new $.Transaction({blockhash:i.DETERMINISTIC_SOLANA_LEDGER_BLOCKHASH,lastValidBlockHeight:i.DETERMINISTIC_SOLANA_LEDGER_LAST_VALID_BLOCK_HEIGHT,feePayer:this.getSolanaPublicKey()}),t=await this.getProviderAdapter().signTransactionWithoutBroadcast?.(e);if(!t)throw Error(`Failed to sign transaction without broadcast`);return{signature:t.signature,txMessageForSolanaLedger:t.transactionMessageB64}}async initUserKeys(e=a.LoginMessageMode.PROTOCOL){this.userKeys=new d.UserKeys(await this.signHinkalMessage(e))}initUserKeysWithSignature(e){this.userKeys=new d.UserKeys(e)}async initUserKeysFromSeedPhrases(e){let t=b.generateHashFromSeedPhrases(e);this.userKeys=new d.UserKeys(t)}async storeAndGetInitialSignature(e,t=!1,n){let r=await this.getEthereumAddress();if(!r)throw Error(`Connected address not found`);return await ee.storeAndGetSignatureFromEnclave(r,e,t,n)}async resetMerkle(e){this.disableMerkleTreeUpdates||(e?.every(e=>this.isSelectedNetworkSupported(e))??!0)&&await k.resetMerkleTrees(this,e)}getTronWeb(){let e=this.tronProviderAdapter;if(!e)throw Error(`Tron provider adapter not initialized`);if(!(e instanceof z.TronProviderAdapter))throw Error(`Tron provider adapter is not a TronProviderAdapter`);let t=e.getTronWeb();if(!t)throw Error(`TronWeb not available`);return t}getSupportedChains(){return this.ethereumProviderAdapter&&this.solanaProviderAdapter?r.WALLET_SUPPORTED_CHAINS:this.ethereumProviderAdapter?r.HINKAL_SUPPORTED_CHAINS.filter(e=>!r.isSolanaLike(e)&&!r.isTronLike(e)):this.solanaProviderAdapter?r.HINKAL_SUPPORTED_CHAINS.filter(e=>r.isSolanaLike(e)):this.tronProviderAdapter?[r.currentTronChainId]:[]}async waitForTransaction(e,t,n=1){return!!await this.getProviderAdapter(e).waitForTransaction(e,t,n)}getContract(e,t,n=void 0){return this.getProviderAdapter(e).getContract(e,t,n)}getContractWithFetcherByChainId(e,t,n=void 0){return g.getContractWithFetcherByChainId(e,t,n)}async signMessage(e){return await this.getProviderAdapter().signMessage(e)}async signTypedData(e,t,n){return await this.getProviderAdapter().signTypedData(e,t,n)}async signWithSubAccount(e,t,n,r){return N.hinkalSignSubAccount(e,t,n,r)}getContractWithSigner(e,t,n=``){return this.getProviderAdapter(e).getContractWithSigner(e,t,n)}getContractWithFetcher(e,t,n=``){return this.getProviderAdapter(e).getContractWithFetcher(e,t,n)}isSelectedNetworkSupported(e){return!!r.networkRegistry[e]}async switchNetwork(e){let t=this.getProviderAdapter(),n=t.getChainId(),i=n!==void 0&&r.isSameOnchainNetwork(e.chainId,n);if(!(e.chainId===n||i))try{await t.switchNetwork(e)}catch{throw Error(c.transactionErrorCodes.FAILED_TO_SWITCH_NETWORKS)}}isPermitterAvailable(e){return this.getProviderAdapter(e).isPermitterAvailable()}async disconnectFromConnector(){await this.ethereumProviderAdapter?.disconnectFromConnector(),await this.solanaProviderAdapter?.disconnectFromConnector(),await this.tronProviderAdapter?.disconnectFromConnector()}async resetProviderAdapters(){this.ethereumProviderAdapter=void 0,this.solanaProviderAdapter=void 0,this.tronProviderAdapter=void 0}async updateProviderAdapter(e,t){try{r.isSolanaLike(e)?(this.solanaProviderAdapter&&this.solanaProviderAdapter.release(),this.solanaProviderAdapter=t):r.isTronLike(e)?(this.tronProviderAdapter&&this.tronProviderAdapter.release(),this.tronProviderAdapter=t):(this.ethereumProviderAdapter&&this.ethereumProviderAdapter.release(),this.ethereumProviderAdapter=t)}catch(e){throw console.error(e),Error(`updateProviderAdapter failed, please try again.`)}}async setListeners(){this.ethereumProviderAdapter?.setChainEventListener({onAccountChanged:()=>{this.onAccountChanged()},onChainChanged:e=>{this.onChainChanged(e)}}),this.solanaProviderAdapter?.setChainEventListener({onAccountChanged:()=>{this.onAccountChanged()},onChainChanged:e=>{this.onChainChanged(e)}}),this.tronProviderAdapter?.setChainEventListener({onAccountChanged:()=>{this.onAccountChanged()},onChainChanged:e=>{this.onChainChanged(e)}})}async onAccountChanged(){await this.ethereumProviderAdapter?.onAccountChanged(),await this.solanaProviderAdapter?.onAccountChanged(),await this.tronProviderAdapter?.onAccountChanged();let e=a.EventType.AccountChanged;typeof document<`u`?document?.dispatchEvent(new Event(e)):process?.emit(`message`,e,void 0)}async onChainChanged(e){e?await this.getProviderAdapter(e).onChainChanged(e):(await this.disconnectFromConnector(),_.reloadPage())}async monitorConnectedAddress(e){await s.API.monitor(await this.getEthereumAddressByChain(e))}async getBalances(e,t,n,r,i=!1,a,o=!1){return m.getShieldedBalance(this,e,t,n,r,i,this.generateProofRemotely,a,o)}async getTotalBalance(e,t,r,i=!1,a,o=!1){let s=r??await this.getEthereumAddressByChain(e),c=t??this.userKeys,u=await this.getBalances(e,c.getShieldedPrivateKey(),c.getShieldedPublicKey(),s,i,a,o),d=n.isExtension?await p.privateTokensDB.getPrivateTokens(e,s):l.getErc20TokensForChain(e),f=[];return d.forEach(e=>{let t=e.erc20TokenAddress.toLowerCase(),n=u.get(t),r={token:e,balance:n?.balance??0n,timestamp:n?.timestamp||`0`,nfts:n?.nfts||[]};f.push(r)}),f}async getStuckShieldedBalances(e,t,n){return(await this.getTotalBalance(e,t,n,!1,!1,!0)).filter(e=>e.balance>0n)}async getHinkalTreeRootHash(t){if(r.isSolanaLike(t)){let{hinkalIdl:e,hinkalAddress:n,originalDeployer:i}=r.networkRegistry[t].contractData;if(!e||!n||!i)throw Error(`Missing Solana configuration for chain ${t}`);let a=new $.PublicKey(i),o=h.getMerkleAccountPublicKey(new $.PublicKey(n),a);return x.fetchSolanaMerkleTreeRootHash(this.getSolanaProgram(e),o)}return this.getContractWithFetcherByChainId(t,e.ContractType.HinkalContract).getRootHash()}async resetMerkleTreesIfNecessary(e){let t=(await Promise.all((e??this.getSupportedChains()).map(async e=>{let t=await this.getHinkalTreeRootHash(e);return{chainId:e,needsReset:BigInt(t)!==this.merkleTreeHinkalByChain[e].getRootHash()}}))).filter(e=>e.needsReset).map(e=>e.chainId);t.length>0&&(console.log(`resetting merkle tree in resetMerkleTreesIfNecessary for chains:`,t),await this.resetMerkle(t))}async getEthereumAddress(){let e=this.ethereumProviderAdapter??this.solanaProviderAdapter??this.tronProviderAdapter;if(!e)throw Error(`No provider adapter initialized`);return e.getAddress()}getEthereumAddressByChain(e){return this.getProviderAdapter(e).getAddress()}async getRandomRelay(e,t=!1){return(await s.API.getIdleRelay(e,t)).relay}getGasPrice(e){let t=this.getProviderAdapter(e);if(!t)throw Error(`Illegal State of providerAdapter in Hinkal: no providerAdapter initialized`);return t.getGasPrice(e)}getAPI(){return s.API}snapshotsClearInterval(){this.getSupportedChains().forEach(e=>{this.commitmentsSnapshotServiceByChain[e]?.intervalClear(),this.nullifierSnapshotServiceByChain[e]?.intervalClear()})}getRecipientInfo(){return M.getRecipientInfo(this)}async deposit(e,t,n=!0,r=!1){return C.hinkalDeposit(this,e,t,n,r)}async depositSolana(e,t,n=!1){return T.hinkalSolanaDeposit(this,e,t,n)}async depositForOther(e,t,n,r=!0,i=!1,a){return this.enforceRateLimit(this.depositForOther.name,[e,t,n]),C.hinkalDepositForOther(this,e,t,n,r,i,a)}async depositSolanaForOther(e,t,n,r=!1,i){return this.enforceRateLimit(this.depositSolanaForOther.name,[e,t,n]),T.hinkalSolanaDepositForOther(this,e,t,n,r,i)}async depositAndWithdraw(e,t,n,r,i,a,o,s,c=!0){return(await this.depositAndWithdrawExtended(e,t,n,r,i,a,o,s,c)).depositTxHash}async depositAndWithdrawExtended(e,t,n,i,a,o,s,c,l=!0){return r.isSolanaLike(f.validateAndGetChainId([e]))?B.hinkalSolanaDepositAndWithdraw(this,e,t,n,i,a,o,s,c):w.hinkalDepositAndWithdraw(this,e,t,n,i,a,o,s,c,l)}async claimUtxo(e,t,n,i){return r.isSolanaLike(f.validateAndGetChainId([e]))?Z.hinkalSolanaClaimUtxo(this,e,t,n,i):Y.hinkalClaimUtxo(this,e,t,n,i)}async depositAndBridge(e,t,n,r,i,a,o,s=!0){return(await this.depositAndBridgeExtended(e,t,n,r,i,a,o,s)).depositTxHash}async depositAndBridgeExtended(e,t,n,r,i,a,o,s=!0){return q.hinkalDepositAndBridge(this,e,t,n,r,i,a,o,s)}async checkSendTransactionStatus(e){return o.getScheduledTransactionById(e)}async nearDepositAndBridge(e,t,n,r,i,a,o,s,c){return this.enforceRateLimit(this.nearDepositAndBridge.name,[e,t,n,r]),J.hinkalNearDepositAndBridge(this,e,t,n,r,i,a,o,s,c)}async prooflessDeposit(e,t,n,i,a=!1){return r.isSolanaLike(f.validateAndGetChainId(e))?X.hinkalSolanaProoflessDeposit(this,e,t,n,i,a):F.hinkalProoflessDeposit(this,e,t,n,i,a)}async prooflessDepositWithPublicFee(e,t,n,i,a){let o=f.validateAndGetChainId([e]);return r.isSolanaLike(o)?T.hinkalSolanaProoflessDepositWithPublicFee(this,e,t,n,i,a):F.hinkalProoflessDepositWithPublicFee(this,o,e,t,n,i,a)}getSolanaProgram(e){if(!this.solanaProviderAdapter)throw Error(`No provider adapter initialized`);if(!(`getSolanaProgram`in this.solanaProviderAdapter))throw Error(`Current provider adapter is not a Solana provider adapter`);return this.solanaProviderAdapter.getSolanaProgram(e)}getSolanaPublicKey(){if(!this.solanaProviderAdapter)throw Error(`No provider adapter initialized`);if(!(`getSolanaPublicKey`in this.solanaProviderAdapter))throw Error(`Current provider adapter is not a Solana provider adapter`);return this.solanaProviderAdapter.getSolanaPublicKey()}async transfer(e,t,n,i,a,o){return this.enforceRateLimit(this.transfer.name,[e,t,n]),r.isSolanaLike(f.validateAndGetChainId(e))?H.hinkalSolanaTransfer(this,e,t,n,i,a,o):L.hinkalTransfer(this,e,t,n,i,a,o)}async withdraw(e,t,n,i,a,o,s){return r.isSolanaLike(f.validateAndGetChainId(e))?V.hinkalSolanaWithdraw(this,e,t,n,a,o,s):D.hinkalWithdraw(this,e,t,n,i,a,o,s)}async withdrawStuckUtxos(e,t){return Q.hinkalWithdrawStuckUtxos(this,e,t)}async swap(e,t,n,i,a,o,s){return r.isSolanaLike(f.validateAndGetChainId(e))?this.swapSolana(e,t,i,a,o,s):E.hinkalSwap(this,e,t,n,i,a,o,s)}async swapSolana(e,t,n,r,i,a){let o=JSON.parse(n),s=BigInt(o.swapperAccountSalt),{instructionLists:c,addressLookupTableAccount:l}=o.data;return U.hinkalSolanaSwap(this,e,t,s,c,l,r,i,a)}async actionReceive(e,t,n,i,a,o){if(!a)throw Error(`subAccount is required`);return r.isSolanaLike(f.validateAndGetChainId(e))?K.hinkalSolanaProxyShield(this,e[0],t[0],a,void 0,o):P.hinkalActionReceive(this,e,t,n,i,a,o)}async actionPrivateWallet(e,t,n,r,i,a,o,s,c,l,u=!1,d,f,p){return this.enforceRateLimit(this.actionPrivateWallet.name,[e,t,n,r,i,a,o,s,c,p]),j.hinkalPrivateWallet(this,e,t,n,r,i,a,o,s,c,l,u,d,f,p)}async proxySwap(e,t,n,i,a,o,s,c,l=!1,u,d){return r.isSolanaLike(f.validateAndGetChainId(e))?G.hinkalSolanaProxySwap(this,e,t,i,o,n,s,c,d):te.hinkalProxySwap(this,e,t,n,i,a,o,s,c,l,u,d)}async proxyToPrivate(e,t,n,i,a,o,s){return r.isSolanaLike(f.validateAndGetChainId(e))?(this.enforceRateLimit(this.proxyToPrivate.name,[e[0],t[0],n,i]),K.hinkalSolanaProxyShield(this,e[0],t[0],n,i,s)):R.hinkalProxyToPrivate(this,e,t,i,a,o,n,s)}async proxySend(e,t,n,i,a,o,s){let c=f.validateAndGetChainId(e);if(r.isSolanaLike(c))return W.hinkalSolanaProxySend(this,e[0],t[0],n,i,s);let l=S.createTransaferEmporiumOpsBatch(this,c,e.map(e=>e.erc20TokenAddress),t,i),u=e.map((e,n)=>({token:e,amount:-1n*t[n]}));return await this.actionPrivateWallet(c,[],[],[],l,u,n,a,o,void 0,void 0,void 0,s,void 0)}async multiSendPrivateRecipients(e,t,n){return this.enforceRateLimit(this.multiSendPrivateRecipients.name,[e,t,n]),I.hinkalMultiSendPrivateRecipients(this,e,t,n)}areMerkleTreeUpdatesDisabled(){return this.disableMerkleTreeUpdates}updateMerkleTreeUpdates(e){this.disableMerkleTreeUpdates=e}};exports.Hinkal=ne;
|
|
@@ -21,6 +21,8 @@ import { PublicKey } from '@solana/web3.js';
|
|
|
21
21
|
import { BridgeRecipient } from '../../types/bridging-tx.types';
|
|
22
22
|
import { NearBridgeParams, NearBridgeResult } from '../../types/near-intents.types';
|
|
23
23
|
import { Utxo } from '../utxo/Utxo';
|
|
24
|
+
import { ScheduledTransactionByIdResponse } from '../../API/scheduled-transactions-calls';
|
|
25
|
+
import { DepositAndSendExtendedResult } from '../../types';
|
|
24
26
|
export declare class Hinkal<ConnectorType> implements IHinkal {
|
|
25
27
|
private ethereumProviderAdapter?;
|
|
26
28
|
private solanaProviderAdapter?;
|
|
@@ -76,9 +78,6 @@ export declare class Hinkal<ConnectorType> implements IHinkal {
|
|
|
76
78
|
getBalances(chainId: number, passedShieldedPrivateKey: string, passedShieldedPublicKey: string, ethAddress: string, resetCacheBefore?: boolean, updateTokensListBefore?: boolean, useBlockedUtxos?: boolean): Promise<Map<string, TokenBalance>>;
|
|
77
79
|
getTotalBalance(chainId: number, _userKeys?: UserKeys, _ethAddress?: string, resetCacheBefore?: boolean, updateTokensListBefore?: boolean, useBlockedUtxos?: boolean): Promise<TokenBalance[]>;
|
|
78
80
|
getStuckShieldedBalances(chainId: number, _userKeys?: UserKeys, _ethAddress?: string): Promise<TokenBalance[]>;
|
|
79
|
-
getSupportedPassportLinks(): string[];
|
|
80
|
-
checkAccessToken(_chainId: number, _accessKeyOverride?: string): Promise<boolean>;
|
|
81
|
-
checkExternalTokenLimitsUSD(chainId: number, tokenAddresses: string[], amounts: bigint[]): Promise<boolean>;
|
|
82
81
|
getHinkalTreeRootHash(chainId: number): Promise<any>;
|
|
83
82
|
resetMerkleTreesIfNecessary(chainIdsToCheck?: number[]): Promise<void>;
|
|
84
83
|
getEthereumAddress(): Promise<string>;
|
|
@@ -93,8 +92,11 @@ export declare class Hinkal<ConnectorType> implements IHinkal {
|
|
|
93
92
|
depositForOther(erc20Tokens: ERC20Token[], amountChanges: bigint[], recipientInfo: string, preEstimateGas?: boolean, returnTxData?: boolean, action?: AdminTransactionType): Promise<ethers.TransactionResponse | ethers.TransactionRequest | string | TronWebTypes.Transaction<TronWebTypes.TriggerSmartContract>>;
|
|
94
93
|
depositSolanaForOther(amount: bigint, token: ERC20Token, recipientInfo: string, returnTxData?: boolean, action?: AdminTransactionType): Promise<string>;
|
|
95
94
|
depositAndWithdraw(erc20Token: ERC20Token, recipientAmounts: bigint[], recipientAddresses: string[], txCompletionTime?: number, feeStructureOverride?: FeeStructure, ref?: string, action?: AdminTransactionType, dashboardAccountId?: string, preEstimateGas?: boolean): Promise<string>;
|
|
95
|
+
depositAndWithdrawExtended(erc20Token: ERC20Token, recipientAmounts: bigint[], recipientAddresses: string[], txCompletionTime?: number, feeStructureOverride?: FeeStructure, ref?: string, action?: AdminTransactionType, dashboardAccountId?: string, preEstimateGas?: boolean): Promise<DepositAndSendExtendedResult>;
|
|
96
96
|
claimUtxo(erc20Token: ERC20Token, utxo: Utxo, feeStructureOverride?: FeeStructure, claimableSignature?: string): Promise<string>;
|
|
97
97
|
depositAndBridge(erc20Token: ERC20Token, recipientBridges: BridgeRecipient[], txCompletionTime?: number, feeStructureOverride?: FeeStructure, ref?: string, action?: AdminTransactionType, dashboardAccountId?: string, preEstimateGas?: boolean): Promise<string>;
|
|
98
|
+
depositAndBridgeExtended(erc20Token: ERC20Token, recipientBridges: BridgeRecipient[], txCompletionTime?: number, feeStructureOverride?: FeeStructure, ref?: string, action?: AdminTransactionType, dashboardAccountId?: string, preEstimateGas?: boolean): Promise<DepositAndSendExtendedResult>;
|
|
99
|
+
checkSendTransactionStatus(scheduleId: string): Promise<ScheduledTransactionByIdResponse>;
|
|
98
100
|
nearDepositAndBridge(erc20Token: ERC20Token, recipientAmounts: bigint[], recipientAddresses: string[], params: NearBridgeParams, txCompletionTime?: number, feeStructureOverride?: FeeStructure, ref?: string, action?: AdminTransactionType, dashboardAccountId?: string): Promise<NearBridgeResult>;
|
|
99
101
|
prooflessDeposit(erc20Tokens: ERC20Token[], amountChanges: bigint[], stealthAddressStructures?: StealthAddressStructure[], action?: AdminTransactionType, returnTxData?: boolean): Promise<string | ethers.TransactionRequest | TronWebTypes.Transaction<TronWebTypes.TriggerSmartContract>>;
|
|
100
102
|
prooflessDepositWithPublicFee(erc20Token: ERC20Token, amounts: bigint[], stealthAddressStructures: StealthAddressStructure[], feeAmount: bigint, action?: AdminTransactionType): Promise<string>;
|