@hinkal/common 0.2.4 → 0.2.6

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("axios"),t=require("../constants/server.constants.cjs"),n=require("./getServerURL.cjs"),c=async(e,r,s,o)=>(await a.post(`${n.getServerURL(e)}${t.API_CONFIG.ROUTES.addNickname}`,{ethereumAddress:r,nickname:s,action:o})).data,d=async(e,r)=>(await a.get(`${n.getServerURL(e)}${t.API_CONFIG.ROUTES.getNickname(r)}`)).data,i=async(e,r,s)=>(await a.get(`${n.getServerURL(r)}${t.API_CONFIG.ROUTES.points(e,s)}`)).data,g=async(e,r)=>(await a.get(`${n.getServerURL(e)}${t.API_CONFIG.ROUTES.leaderboard(r)}`)).data,p=async(e,r)=>(await a.get(`${n.getServerURL(e)}${t.API_CONFIG.ROUTES.seasonLeaderboard(r)}`)).data;exports.addNickname=c;exports.getNickname=d;exports.leaderboard=g;exports.points=i;exports.seasonLeaderboard=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("axios"),t=require("../constants/server.constants.cjs"),n=require("./getServerURL.cjs"),c=async(e,r,s,o)=>(await a.post(`${n.getServerURL(e)}${t.API_CONFIG.ROUTES.addNickname}`,{ethereumAddress:r,nickname:s,action:o})).data,d=async(e,r)=>(await a.get(`${n.getServerURL(e)}${t.API_CONFIG.ROUTES.getNickname(r)}`)).data,i=async(e,r,s)=>(await a.get(`${n.getServerURL(r)}${t.API_CONFIG.ROUTES.points(e,s)}`)).data,g=async(e,r)=>(await a.get(`${n.getServerURL(e)}${t.API_CONFIG.ROUTES.leaderboard(r)}`)).data,p=async e=>(await a.get(`${n.getServerURL(e)}${t.API_CONFIG.ROUTES.seasonLeaderboard}`)).data;exports.addNickname=c;exports.getNickname=d;exports.leaderboard=g;exports.points=i;exports.seasonLeaderboard=p;
@@ -4,7 +4,7 @@ interface IGetNickname {
4
4
  nickname: string | undefined;
5
5
  }
6
6
  export declare const getNickname: (chainId: number, ethereumAddress: string) => Promise<IGetNickname>;
7
- export declare const points: (ethereumAddress: string, chainId: number, isWeek: boolean) => Promise<LeaderBoardItem[]>;
8
- export declare const leaderboard: (chainId: number, ethereumAddress: string) => Promise<LeaderboardEntry[]>;
9
- export declare const seasonLeaderboard: (chainId: number, ethereumAddress: string) => Promise<LeaderboardEntry[]>;
7
+ export declare const points: (ethereumAddress: string, chainId: number, week?: number) => Promise<LeaderBoardItem[]>;
8
+ export declare const leaderboard: (chainId: number, week?: number) => Promise<LeaderboardEntry[]>;
9
+ export declare const seasonLeaderboard: (chainId: number) => Promise<LeaderboardEntry[]>;
10
10
  export {};
@@ -5,9 +5,7 @@ const m = async (e, s, a, r) => (await t.post(`${o(e)}${n.ROUTES.addNickname}`,
5
5
  ethereumAddress: s,
6
6
  nickname: a,
7
7
  action: r
8
- })).data, $ = async (e, s) => (await t.get(`${o(e)}${n.ROUTES.getNickname(s)}`)).data, g = async (e, s, a) => (await t.get(`${o(s)}${n.ROUTES.points(e, a)}`)).data, O = async (e, s) => (await t.get(`${o(e)}${n.ROUTES.leaderboard(s)}`)).data, R = async (e, s) => (await t.get(
9
- `${o(e)}${n.ROUTES.seasonLeaderboard(s)}`
10
- )).data;
8
+ })).data, $ = async (e, s) => (await t.get(`${o(e)}${n.ROUTES.getNickname(s)}`)).data, g = async (e, s, a) => (await t.get(`${o(s)}${n.ROUTES.points(e, a)}`)).data, O = async (e, s) => (await t.get(`${o(e)}${n.ROUTES.leaderboard(s)}`)).data, R = async (e) => (await t.get(`${o(e)}${n.ROUTES.seasonLeaderboard}`)).data;
11
9
  export {
12
10
  m as addNickname,
13
11
  $ as getNickname,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=(e,n)=>`${e}${n!==void 0?`?week=${n}`:""}`,l={ROUTES:{checkKycStatus:"/check-kyc-status",getUserSignature:"/signature-request",startReclaimVerification:"/start-reclaim-verification",startUserVerification:"/start-aiprise-verification",zkMeAccessToken:"/zkMeAccessToken",getCommitmentsSnapshot:"/snapshots/commitments",getAccessTokenSnapshot:"/snapshots/access-tokens",callOdosAPI:"/OdosSwapData",callOneInchAPI:"/OneInchSwapData",getOdosPriceForToken:e=>`/getOdosPriceForToken/${e}`,getNullifiers:"/snapshots/nullifiers",axelarGasEstimate:(e,n,i,o)=>`/axelarGasEstimate/${e}/${n}/${i}/${o}`,userHasAccessToken:e=>`/user-has-access-token/${e}`,afterKycCall:"/after-kyc-callback",restoreSnapshots:"/snapshots/restore",beefyGraphAPI:"/BeefyGraphData",monitor:"/monitor",checkRisk:e=>`/check-risk/${e}`,userVerifyTransactions:"/user-verify-transactions",userGetLatestCertifiedHashes:e=>`/user-get-latest-certified-hashes/${e}`,userGetHasCerified:e=>`/user-get-has-certified/${e}`,userGetTransactions:(e,n,i)=>`/user-get-transactions/${e}/${n}/${i}`,getActiveCode:e=>`/get-active-code/${e}`,updateActiveCode:"/update-active-code",getWeeklyReferralCodes:(e,n)=>`/get-weekly-referral-codes/${e}/${n}`,getReferralCodes:e=>s(`/get-referral-codes/${e}`),getRewardsHistory:e=>`/get-rewards-history/${e}`,addReferralCode:"/update-referral-code",getLpProgram:e=>s(`/getLpProgram/${e}`),points:(e,n)=>`/points/${e}/${n}`,leaderboard:e=>`/leaderboard/${e}`,setRewardsReceivingData:"/set-user-rewards-receiving-data",getRewardsReceivingData:e=>`/get-user-rewards-receiving-data/${e}`,seasonLeaderboard:e=>`/season-leaderboard/${e}`,getUserAnonymityStakingPoints:e=>`/hinkal-points/${e}`,getLimitedAnonymityStakingPoints:e=>`/hinkal-points/limited/${e}`,getUserAnonymityStakingReferralPoints:e=>`/hinkal-referral-codes-info/${e}`,userHasPassword:e=>`/user-has-password/${e}`,userRegisterPassword:"/user-register-password",getNickname:e=>`/get-nickname/${e}`,addNickname:"/update-nickname",getLidoDefiData:"lido/defi",getLidoStats:"lido/stats",getLidoEthStats:"lido/eth-stats",getLidoDiscount:"lido/discount",getLidoRequestTime:"lido/request-time",getLidoMaticReward:"lido/matic-rewards",pendleAddLiquiditySingleToken:"pendle/addLiquiditySingleToken",pendleAddLiquiditySingleSy:"pendle/addLiquiditySingleSy",pendleAddLiquiditySinglePt:"pendle/addLiquiditySinglePt",pendleAddLiquidityDualTokenAndPt:"pendle/addLiquidityDualTokenAndPt",pendleAddLiquidityDualSyAndPt:"pendle/addLiquidityDualSyAndPt",pendleAddLiquiditySingleTokenKeepYt:"pendle/addLiquiditySingleTokenKeepYt",pendleRemoveLiquiditySingleToken:"pendle/removeLiquiditySingleToken",pendleRemoveLiquiditySingleSy:"pendle/removeLiquiditySingleSy",pendleRemoveLiquiditySinglePt:"pendle/removeLiquiditySinglePt",pendleRemoveLiquidityDualTokenAndPt:"pendle/removeLiquidityDualTokenAndPt",pendleRemoveLiquidityDualSyAndPt:"pendle/removeLiquidityDualSyAndPt",pendleMintPyFromToken:"pendle/mintPyFromToken",pendlRedeemPyToToken:"pendle/redeemPyToToken",removeLiquidityDualTokenAndPt:"pendle/removeLiquidityDualTokenAndPt",removeLiquiditySinglePt:"pendle/removeLiquiditySinglePt",pendleSwapExactTokenForYT:"pendle/swapExactTokenForYt",pendleSwapExactTokenForPt:"pendle/swapExactTokenForPt",pendleSwapExactPtForToken:"pendle/swapExactPtForToken",pendleSwapExactPtForYt:"pendle/swapExactPtForYt",pendleSwapExactYtForToken:"pendle/swapExactYtForToken",pendleSwapExactYtForPt:"pendle/swapExactYtForPt",pendleSyTokenInOut:"pendle/syTokenInOut",connextReceiveFee:(e,n)=>`/connextEstimateReceive/${e}/${n}`,stakedYield:"/staked-yield",getPublicWalletInformation:e=>`/get-public-wallet-data/${e}`}},d={getGasEstimate:(e,n,i,o,r)=>`/gas-estimation/${e}/${o}/${n}/${i}/${r}`,getTokenPrice:"/get-token-price",getTokenPriceEth:e=>`/get-token-price-in-eth/${e}`,getTokenPrices:"/get-token-prices",TRANSACT:"/general-transact",getIdleRelay:"/get-idle-relay"},p={getUserPoints:e=>`/user-points/${e}`},t="http://ec2-54-241-116-187.us-west-1.compute.amazonaws.com",a="http://ec2-18-144-10-166.us-west-1.compute.amazonaws.com",c="https://ethMainnet-data-server.hinkal.pro",R="http://localhost",h=7090,g={polygon:"https://polygon.server.hinkal.pro",arbMainnet:"https://arbMainnet.server.hinkal.pro",ethMainnet:"https://ethMainnet.server.hinkal.pro",bnbMainnet:"https://bnbMainnet.server.hinkal.pro",avalanche:"https://avalanche.server.hinkal.pro",optimism:"https://optimism.server.hinkal.pro",base:"https://base.server.hinkal.pro",localhost:"http://localhost:7072"},k={polygon:`${t}:7072`,arbMainnet:`${t}:7070`,ethMainnet:`${t}:7080`,bnbMainnet:`${t}:7076`,avalanche:`${t}:7078`,optimism:`${t}:7082`,base:`${t}:7084`,localhost:"http://localhost:7072"},u={polygon:`${a}:7072`,arbMainnet:`${a}:7070`,ethMainnet:`${a}:7080`,bnbMainnet:`${a}:7076`,avalanche:`${a}:7078`,optimism:`${a}:7082`,base:`${a}:7084`,localhost:"http://localhost:7072"},y={polygon:"https://polygon.relayer.hinkal.pro",arbMainnet:"https://arbMainnet.relayer.hinkal.pro",ethMainnet:"https://ethMainnet.relayer.hinkal.pro",bnbMainnet:"https://bnbMainnet.relayer.hinkal.pro",avalanche:"https://avalanche.relayer.hinkal.pro",optimism:"https://optimism.relayer.hinkal.pro",base:"https://base.relayer.hinkal.pro",localhost:"http://localhost:7073"},S={polygon:`${t}:7073`,arbMainnet:`${t}:7071`,ethMainnet:`${t}:7081`,bnbMainnet:`${t}:7077`,avalanche:`${t}:7079`,optimism:`${t}:7083`,base:`${t}:7085`,localhost:"http://localhost:7073"},L={polygon:`${a}:7073`,arbMainnet:`${a}:7071`,ethMainnet:`${a}:7081`,bnbMainnet:`${a}:7077`,avalanche:`${a}:7079`,optimism:`${a}:7083`,base:`${a}:7085`,localhost:"http://localhost:7073"};exports.API_CONFIG=l;exports.DATA_SERVER_CONFIG=p;exports.DATA_SERVER_PORT=h;exports.DATA_SERVER_URL_LOCAL=R;exports.DATA_SERVER_URL_PRODUCTION=c;exports.PLAYGROUND_RELAYER_URLS=L;exports.PLAYGROUND_SERVER_URLS=u;exports.PLAYGROUND_URL=a;exports.RELAYER_CONFIG=d;exports.RELAYER_URLS=y;exports.SERVER_URLS=g;exports.STAGING_RELAYER_URLS=S;exports.STAGING_SERVER_URLS=k;exports.STAGING_URL=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=(e,n)=>`${e}${n!==void 0?`?week=${n}`:""}`,l={ROUTES:{checkKycStatus:"/check-kyc-status",getUserSignature:"/signature-request",startReclaimVerification:"/start-reclaim-verification",startUserVerification:"/start-aiprise-verification",zkMeAccessToken:"/zkMeAccessToken",getCommitmentsSnapshot:"/snapshots/commitments",getAccessTokenSnapshot:"/snapshots/access-tokens",callOdosAPI:"/OdosSwapData",callOneInchAPI:"/OneInchSwapData",getOdosPriceForToken:e=>`/getOdosPriceForToken/${e}`,getNullifiers:"/snapshots/nullifiers",axelarGasEstimate:(e,n,i,o)=>`/axelarGasEstimate/${e}/${n}/${i}/${o}`,userHasAccessToken:e=>`/user-has-access-token/${e}`,afterKycCall:"/after-kyc-callback",restoreSnapshots:"/snapshots/restore",beefyGraphAPI:"/BeefyGraphData",monitor:"/monitor",checkRisk:e=>`/check-risk/${e}`,userVerifyTransactions:"/user-verify-transactions",userGetLatestCertifiedHashes:e=>`/user-get-latest-certified-hashes/${e}`,userGetHasCerified:e=>`/user-get-has-certified/${e}`,userGetTransactions:(e,n,i)=>`/user-get-transactions/${e}/${n}/${i}`,getActiveCode:e=>`/get-active-code/${e}`,updateActiveCode:"/update-active-code",getWeeklyReferralCodes:(e,n)=>`/get-weekly-referral-codes/${e}/${n}`,getReferralCodes:e=>s(`/get-referral-codes/${e}`),getRewardsHistory:e=>`/get-rewards-history/${e}`,addReferralCode:"/update-referral-code",getLpProgram:e=>s(`/getLpProgram/${e}`),points:(e,n)=>`/points/${e}/${n}`,leaderboard:e=>`/leaderboard/${e}`,setRewardsReceivingData:"/set-user-rewards-receiving-data",getRewardsReceivingData:e=>`/get-user-rewards-receiving-data/${e}`,seasonLeaderboard:"/season-leaderboard",getUserAnonymityStakingPoints:e=>`/hinkal-points/${e}`,getLimitedAnonymityStakingPoints:e=>`/hinkal-points/limited/${e}`,getUserAnonymityStakingReferralPoints:e=>`/hinkal-referral-codes-info/${e}`,userHasPassword:e=>`/user-has-password/${e}`,userRegisterPassword:"/user-register-password",getNickname:e=>`/get-nickname/${e}`,addNickname:"/update-nickname",getLidoDefiData:"lido/defi",getLidoStats:"lido/stats",getLidoEthStats:"lido/eth-stats",getLidoDiscount:"lido/discount",getLidoRequestTime:"lido/request-time",getLidoMaticReward:"lido/matic-rewards",pendleAddLiquiditySingleToken:"pendle/addLiquiditySingleToken",pendleAddLiquiditySingleSy:"pendle/addLiquiditySingleSy",pendleAddLiquiditySinglePt:"pendle/addLiquiditySinglePt",pendleAddLiquidityDualTokenAndPt:"pendle/addLiquidityDualTokenAndPt",pendleAddLiquidityDualSyAndPt:"pendle/addLiquidityDualSyAndPt",pendleAddLiquiditySingleTokenKeepYt:"pendle/addLiquiditySingleTokenKeepYt",pendleRemoveLiquiditySingleToken:"pendle/removeLiquiditySingleToken",pendleRemoveLiquiditySingleSy:"pendle/removeLiquiditySingleSy",pendleRemoveLiquiditySinglePt:"pendle/removeLiquiditySinglePt",pendleRemoveLiquidityDualTokenAndPt:"pendle/removeLiquidityDualTokenAndPt",pendleRemoveLiquidityDualSyAndPt:"pendle/removeLiquidityDualSyAndPt",pendleMintPyFromToken:"pendle/mintPyFromToken",pendlRedeemPyToToken:"pendle/redeemPyToToken",removeLiquidityDualTokenAndPt:"pendle/removeLiquidityDualTokenAndPt",removeLiquiditySinglePt:"pendle/removeLiquiditySinglePt",pendleSwapExactTokenForYT:"pendle/swapExactTokenForYt",pendleSwapExactTokenForPt:"pendle/swapExactTokenForPt",pendleSwapExactPtForToken:"pendle/swapExactPtForToken",pendleSwapExactPtForYt:"pendle/swapExactPtForYt",pendleSwapExactYtForToken:"pendle/swapExactYtForToken",pendleSwapExactYtForPt:"pendle/swapExactYtForPt",pendleSyTokenInOut:"pendle/syTokenInOut",connextReceiveFee:(e,n)=>`/connextEstimateReceive/${e}/${n}`,stakedYield:"/staked-yield",getPublicWalletInformation:e=>`/get-public-wallet-data/${e}`}},d={getGasEstimate:(e,n,i,o,r)=>`/gas-estimation/${e}/${o}/${n}/${i}/${r}`,getTokenPrice:"/get-token-price",getTokenPriceEth:e=>`/get-token-price-in-eth/${e}`,getTokenPrices:"/get-token-prices",TRANSACT:"/general-transact",getIdleRelay:"/get-idle-relay"},p={getUserPoints:e=>`/user-points/${e}`},t="http://ec2-54-241-116-187.us-west-1.compute.amazonaws.com",a="http://ec2-18-144-10-166.us-west-1.compute.amazonaws.com",c="https://ethMainnet-data-server.hinkal.pro",R="http://localhost",h=7090,g={polygon:"https://polygon.server.hinkal.pro",arbMainnet:"https://arbMainnet.server.hinkal.pro",ethMainnet:"https://ethMainnet.server.hinkal.pro",bnbMainnet:"https://bnbMainnet.server.hinkal.pro",avalanche:"https://avalanche.server.hinkal.pro",optimism:"https://optimism.server.hinkal.pro",base:"https://base.server.hinkal.pro",localhost:"http://localhost:7072"},k={polygon:`${t}:7072`,arbMainnet:`${t}:7070`,ethMainnet:`${t}:7080`,bnbMainnet:`${t}:7076`,avalanche:`${t}:7078`,optimism:`${t}:7082`,base:`${t}:7084`,localhost:"http://localhost:7072"},u={polygon:`${a}:7072`,arbMainnet:`${a}:7070`,ethMainnet:`${a}:7080`,bnbMainnet:`${a}:7076`,avalanche:`${a}:7078`,optimism:`${a}:7082`,base:`${a}:7084`,localhost:"http://localhost:7072"},y={polygon:"https://polygon.relayer.hinkal.pro",arbMainnet:"https://arbMainnet.relayer.hinkal.pro",ethMainnet:"https://ethMainnet.relayer.hinkal.pro",bnbMainnet:"https://bnbMainnet.relayer.hinkal.pro",avalanche:"https://avalanche.relayer.hinkal.pro",optimism:"https://optimism.relayer.hinkal.pro",base:"https://base.relayer.hinkal.pro",localhost:"http://localhost:7073"},S={polygon:`${t}:7073`,arbMainnet:`${t}:7071`,ethMainnet:`${t}:7081`,bnbMainnet:`${t}:7077`,avalanche:`${t}:7079`,optimism:`${t}:7083`,base:`${t}:7085`,localhost:"http://localhost:7073"},L={polygon:`${a}:7073`,arbMainnet:`${a}:7071`,ethMainnet:`${a}:7081`,bnbMainnet:`${a}:7077`,avalanche:`${a}:7079`,optimism:`${a}:7083`,base:`${a}:7085`,localhost:"http://localhost:7073"};exports.API_CONFIG=l;exports.DATA_SERVER_CONFIG=p;exports.DATA_SERVER_PORT=h;exports.DATA_SERVER_URL_LOCAL=R;exports.DATA_SERVER_URL_PRODUCTION=c;exports.PLAYGROUND_RELAYER_URLS=L;exports.PLAYGROUND_SERVER_URLS=u;exports.PLAYGROUND_URL=a;exports.RELAYER_CONFIG=d;exports.RELAYER_URLS=y;exports.SERVER_URLS=g;exports.STAGING_RELAYER_URLS=S;exports.STAGING_SERVER_URLS=k;exports.STAGING_URL=t;
@@ -30,11 +30,11 @@ export declare const API_CONFIG: {
30
30
  getRewardsHistory: (ethereumAddress: string) => string;
31
31
  addReferralCode: string;
32
32
  getLpProgram: (ethereumAddress: string) => string;
33
- points: (ethereumAddress: string, isWeek: boolean) => string;
34
- leaderboard: (ethereumAddress: string) => string;
33
+ points: (ethereumAddress: string, week?: number) => string;
34
+ leaderboard: (week?: number) => string;
35
35
  setRewardsReceivingData: string;
36
36
  getRewardsReceivingData: (ethereumAddress: string) => string;
37
- seasonLeaderboard: (ethereumAddress: string) => string;
37
+ seasonLeaderboard: string;
38
38
  getUserAnonymityStakingPoints: (ethereumAddress: string) => string;
39
39
  getLimitedAnonymityStakingPoints: (ethereumAddress: string) => string;
40
40
  getUserAnonymityStakingReferralPoints: (ethereumAddress: string) => string;
@@ -33,7 +33,7 @@ const s = (e, t) => `${e}${t !== void 0 ? `?week=${t}` : ""}`, l = {
33
33
  leaderboard: (e) => `/leaderboard/${e}`,
34
34
  setRewardsReceivingData: "/set-user-rewards-receiving-data",
35
35
  getRewardsReceivingData: (e) => `/get-user-rewards-receiving-data/${e}`,
36
- seasonLeaderboard: (e) => `/season-leaderboard/${e}`,
36
+ seasonLeaderboard: "/season-leaderboard",
37
37
  getUserAnonymityStakingPoints: (e) => `/hinkal-points/${e}`,
38
38
  getLimitedAnonymityStakingPoints: (e) => `/hinkal-points/limited/${e}`,
39
39
  getUserAnonymityStakingReferralPoints: (e) => `/hinkal-referral-codes-info/${e}`,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../types/hinkal.types.cjs"),h=require("../../types/ethereum-network.types.cjs"),a=require("../../functions/web3/functionCalls/accessTokenCalls.cjs"),y=require("../../functions/web3/events/getShieldedBalance.cjs"),o=require("../crypto-keys/keys.cjs"),A=require("./hinkalActionBeefy.cjs"),C=require("./hinkalActionConvex.cjs"),P=require("./hinkalActionCurve.cjs"),w=require("./hinkalActionPendle.cjs"),d=require("./hinkalDeposit.cjs"),m=require("./hinkalSwap.cjs"),T=require("./hinkalWithdraw.cjs"),q=require("./resetMerkleTrees.cjs"),l=require("../merkle-tree/MerkleTree.cjs"),u=require("../../crypto/poseidon.cjs");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");const S=require("../../constants/chains.constants.cjs"),g=require("../../error-handling/error-codes.constants.cjs"),f=require("../../API/callMonitor.cjs"),E=require("./hinkalActionLidoEth.cjs");require("../../constants/vite.constants.cjs");require("axios");require("../../constants/coingecko.constants.cjs");const F=require("../../API/getAxelarGasEstimate.cjs"),p=require("../../API/API.cjs");require("ethers");require("../../types/curve.types.cjs");require("../../constants/token-data/index.cjs");require("../../constants/contracts.constants.cjs");const I=require("../../constants/kyc.constants.cjs");require("../../constants/axelar.constants.cjs");require("../../constants/rewards.constants.cjs");require("../../constants/reorg-depths.constants.cjs");const H=require("../transactions-manager/TransactionsManager.cjs");require("../../functions/utils/external-action.utils.cjs");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");const M=require("../../functions/utils/reloadPage.cjs"),R=require("./hinkalActionVolatile.cjs"),k=require("./hinkalActionPendleLP.cjs"),W=require("../../API/getConnextReceiveFee.cjs"),L=require("./hinkalActionStake.cjs"),x=require("../MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs"),B=require("./hinkalPrivateWallet.cjs"),K=require("../../functions/utils/cacheFunctions.cjs"),N=require("../../functions/utils/cacheDevice.utils.cjs"),U=require("../../functions/web3/getContractMetadata.cjs");class D{providerAdapter;userKeys;signingMessage="Login to Hinkal Protocol";merkleTreeHinkal;merkleTreeAccessToken;nullifiers;encryptedOutputs;commitmentsSnapshotService;nullifierSnapshotService;accessTokenSnapshotService;transactionsManager;utxoUtils;cacheDevice;generateProofRemotely;constructor(e){this.userKeys=new o.UserKeys(void 0),this.merkleTreeHinkal=l.MerkleTree.create(u.poseidonFunction,25n,0n),this.merkleTreeAccessToken=l.MerkleTree.create(u.poseidonFunction,25n,0n),this.nullifiers=new Set,this.encryptedOutputs=[],this.transactionsManager=new H.TransactionsManager,this.generateProofRemotely=e?.generateProofRemotely??!1,this.utxoUtils=new x.MultiThreadedUtxoUtils,this.cacheDevice=N.createCacheDevice(e)}async initProviderAdapter(e,t){await this.updateProviderAdapter(t),this.providerAdapter?.initConnector(e);const r=await this.connectAndPatchProvider(e);await t.init(r),await this.setListeners()}async initUserKeys(){this.userKeys=new o.UserKeys(await this.getProviderAdapter().signMessage(this.signingMessage))}async initUserKeysWithPassword(e){this.userKeys=new o.UserKeys(e)}async resetMerkle(){this.isSelectedNetworkSupported()&&await q.resetMerkleTrees(this)}getProviderAdapter(){if(!this.providerAdapter)throw new Error("ProviderAdapter is not initialized");return this.providerAdapter}async waitForTransaction(e,t=1){return!!await this.providerAdapter?.waitForTransaction(e,t)}getContractMetadata(e,t){return this.getProviderAdapter().getContractMetadata(e,t)}getContract(e,t=void 0,r){return this.getProviderAdapter().getContract(e,t,r)}getContractWithFetcherByChainId(e,t,r=void 0){return U.getContractWithFetcherByChainId(e,t,r)}async signMessage(e){return await this.getProviderAdapter().signMessage(e)}async signTypedData(e,t,r){return await this.getProviderAdapter().signTypedData(e,t,r)}getContractWithSigner(e,t=""){return this.getProviderAdapter().getContractWithSigner(e,t)}getContractWithFetcher(e,t=""){return this.getProviderAdapter().getContractWithFetcher(e,t)}getContractWithFetcherForEthereum(e,t){return this.getProviderAdapter().getContractWithFetcherForEthereum(e,t)}isSelectedNetworkSupported(){return!!S.networkRegistry[this.getCurrentChainId()]}async switchNetwork(e){try{await this.getProviderAdapter().switchNetwork(e)}catch{throw new Error(g.transactionErrorCodes.FAILED_TO_SWITCH_NETWORKS)}}getCurrentChainId(){const{chainId:e}=this.getProviderAdapter();if(!e)throw new Error("Illegal State: no chainId");return e}getSelectedNetwork(){return this.providerAdapter?.getSelectedNetwork()}isPermitterAvailable(){return this.getProviderAdapter().isPermitterAvailable()}async connectAndPatchProvider(e){return await this.getProviderAdapter().connectAndPatchProvider(e)}async disconnectFromConnector(){await this.getProviderAdapter().disconnectFromConnector()}async updateProviderAdapter(e){try{this.providerAdapter&&this.providerAdapter.release(),this.providerAdapter=e}catch(t){throw console.error(t),Error("updateProviderAdapter failed, please try again.")}}async setListeners(){this.providerAdapter?.setChainEventListener({onAccountChanged:()=>{this.onAccountChanged()},onChainChanged:e=>{this.onChainChanged(e)}})}async onAccountChanged(){await this.getProviderAdapter().onAccountChanged();const e=c.EventType.AccountChanged;typeof document<"u"?document?.dispatchEvent(new Event(e)):process?.emit("message",e,void 0)}async onChainChanged(e){if(e){await this.getProviderAdapter().onChainChanged(e);const t=c.EventType.NetworkChange;typeof document<"u"?document.dispatchEvent(new Event(t)):process?.emit("message",t,void 0)}else await this.disconnectFromConnector(),M.reloadPage()}async monitorConnectedAddress(){f.monitor(await this.getEthereumAddress(),this.getCurrentChainId())}async getBalances(){return y.getShieldedBalance(this)}getSupportedPassportLinks(){return I.supportedPassportLinks}checkAccessToken(){return a.checkHinkalAccessToken(this)}async getAxelarEstimate(e,t,r,n){return F.getAxelarGasEstimate(e,t,r,n,this.userKeys.getAccessKey())}async getConnextReceiveFee(e,t){return W.getConnextReceiveFee(this.getCurrentChainId(),e,t)}async mintHinkalAccessToken(e){return a.mintAccessToken(this,e)}async mintHinkalAccessTokenCrossChain(e,t){return a.mintTokenCrossChain(this,e,t)}async getHinkalTreeRootHash(){return this.getContractWithFetcher(h.ContractType.HinkalContract).getRootHash()}async getAccessTokenTreeRootHash(){return this.getContractWithFetcher(h.ContractType.CrossChainAccessTokenContract).getRootHash()}async resetMerkleTreesIfNecessary(){if(!this.isSelectedNetworkSupported())throw new Error(g.transactionErrorCodes.UNSUPPORTED_NETWORK);const[e,t]=await Promise.all([this.getHinkalTreeRootHash(),this.getAccessTokenTreeRootHash()]);(e.toBigInt()!==this.merkleTreeHinkal.getRootHash()||t.toBigInt()!==this.merkleTreeAccessToken.getRootHash())&&await this.resetMerkle()}async getEventsFromHinkal(){await Promise.all([this.accessTokenSnapshotService?.retrieveEventsFromLatestBlock(),this.commitmentsSnapshotService?.retrieveEventsFromLatestBlock(),this.nullifierSnapshotService?.retrieveEventsFromLatestBlock()])}getEthereumAddress(){return this.getProviderAdapter().getAddress()}async getRandomRelay(){return(await p.API.getIdleRelay(this.getCurrentChainId())).relay}getGasPrice(){if(!this.providerAdapter?.chainId)throw new Error("Illegal State of providerAdapter in Hinkal: no chainId");return this.providerAdapter.getGasPrice()}getAPI(){return p.API}resetCache(){K.resetCache(this)}snapshotsClearInterval(){this.commitmentsSnapshotService?.intervalClear(),this.accessTokenSnapshotService?.intervalClear(),this.nullifierSnapshotService?.intervalClear()}async deposit(e,t){return d.hinkalDeposit(this,e,t)}async depositForOther(e,t,r){return d.hinkalDepositForOther(this,e,t,r)}async withdraw(e,t,r,n,i=!1){return T.hinkalWithdraw(this,e,t,r,n,i)}async swap(e,t,r,n,i=!1,s=!1){return m.hinkalSwap(this,e,t,r,n,i,s)}async actionCurve(e,t,r,n,i,s=!1){return P.hinkalActionCurve(this,e,t,r,n,i,s)}async actionConvex(e,t,r,n,i=!1){return C.hinkalActionConvex(this,e,t,r,n,i)}async actionBeefy(e,t,r,n,i,s,v=!1){return A.hinkalActionBeefy(this,e,t,r,n,i,s,v)}async actionLido(e,t,r,n,i,s=!1){return E.hinkalActionLido(this,e,t,r,n,i,s)}async actionPendle(e,t,r,n,i=!1){return w.hinkalActionPendle(this,e,t,r,n,i)}async actionPendleLP(e,t,r,n,i=!1){return k.hinkalActionPendleLP(this,e,t,r,n,i)}async actionVolatile(e,t,r,n=!1){return R.hinkalActionVolatile(this,e,t,r,n)}async actionStake(e,t,r,n){return L.hinkalActionStake(this,e,t,r,n)}async actionPrivateWallet(e,t,r,n=[],i,s=!1){return B.hinkalPrivateWallet(this,e,t,r,n,i,s)}async getPendleLPClaimableParams(e,t){return k.hinkalGetPendleLPClaimableParams(this,e,t)}}exports.Hinkal=D;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../types/hinkal.types.cjs"),h=require("../../types/ethereum-network.types.cjs"),a=require("../../functions/web3/functionCalls/accessTokenCalls.cjs"),y=require("../../functions/web3/events/getShieldedBalance.cjs"),o=require("../crypto-keys/keys.cjs"),A=require("./hinkalActionBeefy.cjs"),C=require("./hinkalActionConvex.cjs"),P=require("./hinkalActionCurve.cjs"),w=require("./hinkalActionPendle.cjs"),d=require("./hinkalDeposit.cjs"),m=require("./hinkalSwap.cjs"),T=require("./hinkalWithdraw.cjs"),q=require("./resetMerkleTrees.cjs"),l=require("../merkle-tree/MerkleTree.cjs"),u=require("../../crypto/poseidon.cjs");require("circomlibjs-hinkal-fork");require("libsodium-wrappers");require("process");require("buffer");const S=require("../../constants/chains.constants.cjs"),g=require("../../error-handling/error-codes.constants.cjs"),f=require("../../API/callMonitor.cjs"),E=require("./hinkalActionLidoEth.cjs");require("../../constants/vite.constants.cjs");require("axios");require("../../constants/coingecko.constants.cjs");const I=require("../../API/getAxelarGasEstimate.cjs"),p=require("../../API/API.cjs");require("ethers");require("../../types/curve.types.cjs");require("../../constants/token-data/index.cjs");require("../../constants/contracts.constants.cjs");const F=require("../../constants/kyc.constants.cjs");require("../../constants/axelar.constants.cjs");require("../../constants/rewards.constants.cjs");require("../../constants/reorg-depths.constants.cjs");const R=require("../transactions-manager/TransactionsManager.cjs");require("../../functions/utils/external-action.utils.cjs");require("../../types/circom-data.types.cjs");require("../../types/transactions.types.cjs");const H=require("../../functions/utils/reloadPage.cjs"),M=require("./hinkalActionVolatile.cjs"),k=require("./hinkalActionPendleLP.cjs"),W=require("../../API/getConnextReceiveFee.cjs"),L=require("./hinkalActionStake.cjs"),x=require("../MultiThreadedUtxoUtils/MultiThreadedUtxoUtils.cjs"),B=require("./hinkalPrivateWallet.cjs"),K=require("../../functions/utils/cacheFunctions.cjs"),N=require("../../functions/utils/cacheDevice.utils.cjs"),U=require("../../functions/web3/getContractMetadata.cjs"),D=require("./hinkalGetRecipientInfo.cjs");class O{providerAdapter;userKeys;signingMessage="Login to Hinkal Protocol";merkleTreeHinkal;merkleTreeAccessToken;nullifiers;encryptedOutputs;commitmentsSnapshotService;nullifierSnapshotService;accessTokenSnapshotService;transactionsManager;utxoUtils;cacheDevice;generateProofRemotely;constructor(e){this.userKeys=new o.UserKeys(void 0),this.merkleTreeHinkal=l.MerkleTree.create(u.poseidonFunction,25n,0n),this.merkleTreeAccessToken=l.MerkleTree.create(u.poseidonFunction,25n,0n),this.nullifiers=new Set,this.encryptedOutputs=[],this.transactionsManager=new R.TransactionsManager,this.generateProofRemotely=e?.generateProofRemotely??!1,this.utxoUtils=new x.MultiThreadedUtxoUtils,this.cacheDevice=N.createCacheDevice(e)}async initProviderAdapter(e,t){await this.updateProviderAdapter(t),this.providerAdapter?.initConnector(e);const r=await this.connectAndPatchProvider(e);await t.init(r),await this.setListeners()}async initUserKeys(){this.userKeys=new o.UserKeys(await this.getProviderAdapter().signMessage(this.signingMessage))}async initUserKeysWithPassword(e){this.userKeys=new o.UserKeys(e)}async resetMerkle(){this.isSelectedNetworkSupported()&&await q.resetMerkleTrees(this)}getProviderAdapter(){if(!this.providerAdapter)throw new Error("ProviderAdapter is not initialized");return this.providerAdapter}async waitForTransaction(e,t=1){return!!await this.providerAdapter?.waitForTransaction(e,t)}getContractMetadata(e,t){return this.getProviderAdapter().getContractMetadata(e,t)}getContract(e,t=void 0,r){return this.getProviderAdapter().getContract(e,t,r)}getContractWithFetcherByChainId(e,t,r=void 0){return U.getContractWithFetcherByChainId(e,t,r)}async signMessage(e){return await this.getProviderAdapter().signMessage(e)}async signTypedData(e,t,r){return await this.getProviderAdapter().signTypedData(e,t,r)}getContractWithSigner(e,t=""){return this.getProviderAdapter().getContractWithSigner(e,t)}getContractWithFetcher(e,t=""){return this.getProviderAdapter().getContractWithFetcher(e,t)}getContractWithFetcherForEthereum(e,t){return this.getProviderAdapter().getContractWithFetcherForEthereum(e,t)}isSelectedNetworkSupported(){return!!S.networkRegistry[this.getCurrentChainId()]}async switchNetwork(e){try{await this.getProviderAdapter().switchNetwork(e)}catch{throw new Error(g.transactionErrorCodes.FAILED_TO_SWITCH_NETWORKS)}}getCurrentChainId(){const{chainId:e}=this.getProviderAdapter();if(!e)throw new Error("Illegal State: no chainId");return e}getSelectedNetwork(){return this.providerAdapter?.getSelectedNetwork()}isPermitterAvailable(){return this.getProviderAdapter().isPermitterAvailable()}async connectAndPatchProvider(e){return await this.getProviderAdapter().connectAndPatchProvider(e)}async disconnectFromConnector(){await this.getProviderAdapter().disconnectFromConnector()}async updateProviderAdapter(e){try{this.providerAdapter&&this.providerAdapter.release(),this.providerAdapter=e}catch(t){throw console.error(t),Error("updateProviderAdapter failed, please try again.")}}async setListeners(){this.providerAdapter?.setChainEventListener({onAccountChanged:()=>{this.onAccountChanged()},onChainChanged:e=>{this.onChainChanged(e)}})}async onAccountChanged(){await this.getProviderAdapter().onAccountChanged();const e=c.EventType.AccountChanged;typeof document<"u"?document?.dispatchEvent(new Event(e)):process?.emit("message",e,void 0)}async onChainChanged(e){if(e){await this.getProviderAdapter().onChainChanged(e);const t=c.EventType.NetworkChange;typeof document<"u"?document.dispatchEvent(new Event(t)):process?.emit("message",t,void 0)}else await this.disconnectFromConnector(),H.reloadPage()}async monitorConnectedAddress(){f.monitor(await this.getEthereumAddress(),this.getCurrentChainId())}async getBalances(){return y.getShieldedBalance(this)}getSupportedPassportLinks(){return F.supportedPassportLinks}checkAccessToken(){return a.checkHinkalAccessToken(this)}async getAxelarEstimate(e,t,r,n){return I.getAxelarGasEstimate(e,t,r,n,this.userKeys.getAccessKey())}async getConnextReceiveFee(e,t){return W.getConnextReceiveFee(this.getCurrentChainId(),e,t)}async mintHinkalAccessToken(e){return a.mintAccessToken(this,e)}async mintHinkalAccessTokenCrossChain(e,t){return a.mintTokenCrossChain(this,e,t)}async getHinkalTreeRootHash(){return this.getContractWithFetcher(h.ContractType.HinkalContract).getRootHash()}async getAccessTokenTreeRootHash(){return this.getContractWithFetcher(h.ContractType.CrossChainAccessTokenContract).getRootHash()}async resetMerkleTreesIfNecessary(){if(!this.isSelectedNetworkSupported())throw new Error(g.transactionErrorCodes.UNSUPPORTED_NETWORK);const[e,t]=await Promise.all([this.getHinkalTreeRootHash(),this.getAccessTokenTreeRootHash()]);(e.toBigInt()!==this.merkleTreeHinkal.getRootHash()||t.toBigInt()!==this.merkleTreeAccessToken.getRootHash())&&await this.resetMerkle()}async getEventsFromHinkal(){await Promise.all([this.accessTokenSnapshotService?.retrieveEventsFromLatestBlock(),this.commitmentsSnapshotService?.retrieveEventsFromLatestBlock(),this.nullifierSnapshotService?.retrieveEventsFromLatestBlock()])}getEthereumAddress(){return this.getProviderAdapter().getAddress()}async getRandomRelay(){return(await p.API.getIdleRelay(this.getCurrentChainId())).relay}getGasPrice(){if(!this.providerAdapter?.chainId)throw new Error("Illegal State of providerAdapter in Hinkal: no chainId");return this.providerAdapter.getGasPrice()}getAPI(){return p.API}resetCache(){K.resetCache(this)}snapshotsClearInterval(){this.commitmentsSnapshotService?.intervalClear(),this.accessTokenSnapshotService?.intervalClear(),this.nullifierSnapshotService?.intervalClear()}getRecipientInfo(){return D.getRecipientInfo(this)}async deposit(e,t){return d.hinkalDeposit(this,e,t)}async depositForOther(e,t,r){return d.hinkalDepositForOther(this,e,t,r)}async withdraw(e,t,r,n,i=!1){return T.hinkalWithdraw(this,e,t,r,n,i)}async swap(e,t,r,n,i=!1,s=!1){return m.hinkalSwap(this,e,t,r,n,i,s)}async actionCurve(e,t,r,n,i,s=!1){return P.hinkalActionCurve(this,e,t,r,n,i,s)}async actionConvex(e,t,r,n,i=!1){return C.hinkalActionConvex(this,e,t,r,n,i)}async actionBeefy(e,t,r,n,i,s,v=!1){return A.hinkalActionBeefy(this,e,t,r,n,i,s,v)}async actionLido(e,t,r,n,i,s=!1){return E.hinkalActionLido(this,e,t,r,n,i,s)}async actionPendle(e,t,r,n,i=!1){return w.hinkalActionPendle(this,e,t,r,n,i)}async actionPendleLP(e,t,r,n,i=!1){return k.hinkalActionPendleLP(this,e,t,r,n,i)}async actionVolatile(e,t,r,n=!1){return M.hinkalActionVolatile(this,e,t,r,n)}async actionStake(e,t,r,n){return L.hinkalActionStake(this,e,t,r,n)}async actionPrivateWallet(e,t,r,n=[],i,s=!1){return B.hinkalPrivateWallet(this,e,t,r,n,i,s)}async getPendleLPClaimableParams(e,t){return k.hinkalGetPendleLPClaimableParams(this,e,t)}}exports.Hinkal=O;
@@ -79,6 +79,7 @@ export declare class Hinkal<ConnectorType> implements IHinkal {
79
79
  getAPI(): IAPI;
80
80
  resetCache(): void;
81
81
  snapshotsClearInterval(): void;
82
+ getRecipientInfo(): string;
82
83
  deposit(erc20Addresses: string[], amountChanges: bigint[]): Promise<ethers.ContractTransaction>;
83
84
  depositForOther(erc20Addresses: string[], amountChanges: bigint[], recipientInfo: string): Promise<ethers.ContractTransaction>;
84
85
  withdraw(erc20Addresses: string[], amountChanges: bigint[], recipientAddress: string, isRelayerOff: boolean, onlyGasEstimate?: boolean): Promise<ethers.ContractTransaction | RelayerTransaction | bigint>;
@@ -2,11 +2,11 @@ import { EventType as s } from "../../types/hinkal.types.mjs";
2
2
  import { ContractType as c } from "../../types/ethereum-network.types.mjs";
3
3
  import { checkHinkalAccessToken as g, mintAccessToken as u, mintTokenCrossChain as v } from "../../functions/web3/functionCalls/accessTokenCalls.mjs";
4
4
  import { getShieldedBalance as k } from "../../functions/web3/events/getShieldedBalance.mjs";
5
- import { UserKeys as o } from "../crypto-keys/keys.mjs";
5
+ import { UserKeys as a } from "../crypto-keys/keys.mjs";
6
6
  import { hinkalActionBeefy as y } from "./hinkalActionBeefy.mjs";
7
- import { hinkalActionConvex as A } from "./hinkalActionConvex.mjs";
8
- import { hinkalActionCurve as C } from "./hinkalActionCurve.mjs";
9
- import { hinkalActionPendle as f } from "./hinkalActionPendle.mjs";
7
+ import { hinkalActionConvex as f } from "./hinkalActionConvex.mjs";
8
+ import { hinkalActionCurve as A } from "./hinkalActionCurve.mjs";
9
+ import { hinkalActionPendle as C } from "./hinkalActionPendle.mjs";
10
10
  import { hinkalDeposit as P, hinkalDepositForOther as w } from "./hinkalDeposit.mjs";
11
11
  import { hinkalSwap as T } from "./hinkalSwap.mjs";
12
12
  import { hinkalWithdraw as S } from "./hinkalWithdraw.mjs";
@@ -17,10 +17,10 @@ import "circomlibjs-hinkal-fork";
17
17
  import "libsodium-wrappers";
18
18
  import "process";
19
19
  import "buffer";
20
- import { networkRegistry as F } from "../../constants/chains.constants.mjs";
20
+ import { networkRegistry as I } from "../../constants/chains.constants.mjs";
21
21
  import { transactionErrorCodes as p } from "../../error-handling/error-codes.constants.mjs";
22
- import { monitor as H } from "../../API/callMonitor.mjs";
23
- import { hinkalActionLido as I } from "./hinkalActionLidoEth.mjs";
22
+ import { monitor as F } from "../../API/callMonitor.mjs";
23
+ import { hinkalActionLido as H } from "./hinkalActionLidoEth.mjs";
24
24
  import "../../constants/vite.constants.mjs";
25
25
  import "axios";
26
26
  import "../../constants/coingecko.constants.mjs";
@@ -48,7 +48,8 @@ import { hinkalPrivateWallet as U } from "./hinkalPrivateWallet.mjs";
48
48
  import { resetCache as b } from "../../functions/utils/cacheFunctions.mjs";
49
49
  import { createCacheDevice as G } from "../../functions/utils/cacheDevice.utils.mjs";
50
50
  import { getContractWithFetcherByChainId as _ } from "../../functions/web3/getContractMetadata.mjs";
51
- class be {
51
+ import { getRecipientInfo as j } from "./hinkalGetRecipientInfo.mjs";
52
+ class _e {
52
53
  providerAdapter;
53
54
  userKeys;
54
55
  signingMessage = "Login to Hinkal Protocol";
@@ -64,7 +65,7 @@ class be {
64
65
  cacheDevice;
65
66
  generateProofRemotely;
66
67
  constructor(e) {
67
- this.userKeys = new o(void 0), this.merkleTreeHinkal = h.create(d, 25n, 0n), this.merkleTreeAccessToken = h.create(d, 25n, 0n), this.nullifiers = /* @__PURE__ */ new Set(), this.encryptedOutputs = [], this.transactionsManager = new L(), this.generateProofRemotely = e?.generateProofRemotely ?? !1, this.utxoUtils = new D(), this.cacheDevice = G(e);
68
+ this.userKeys = new a(void 0), this.merkleTreeHinkal = h.create(d, 25n, 0n), this.merkleTreeAccessToken = h.create(d, 25n, 0n), this.nullifiers = /* @__PURE__ */ new Set(), this.encryptedOutputs = [], this.transactionsManager = new L(), this.generateProofRemotely = e?.generateProofRemotely ?? !1, this.utxoUtils = new D(), this.cacheDevice = G(e);
68
69
  }
69
70
  async initProviderAdapter(e, t) {
70
71
  await this.updateProviderAdapter(t), this.providerAdapter?.initConnector(e);
@@ -72,10 +73,10 @@ class be {
72
73
  await t.init(r), await this.setListeners();
73
74
  }
74
75
  async initUserKeys() {
75
- this.userKeys = new o(await this.getProviderAdapter().signMessage(this.signingMessage));
76
+ this.userKeys = new a(await this.getProviderAdapter().signMessage(this.signingMessage));
76
77
  }
77
78
  async initUserKeysWithPassword(e) {
78
- this.userKeys = new o(e);
79
+ this.userKeys = new a(e);
79
80
  }
80
81
  async resetMerkle() {
81
82
  this.isSelectedNetworkSupported() && await E(this);
@@ -113,7 +114,7 @@ class be {
113
114
  return this.getProviderAdapter().getContractWithFetcherForEthereum(e, t);
114
115
  }
115
116
  isSelectedNetworkSupported() {
116
- return !!F[this.getCurrentChainId()];
117
+ return !!I[this.getCurrentChainId()];
117
118
  }
118
119
  async switchNetwork(e) {
119
120
  try {
@@ -171,7 +172,7 @@ class be {
171
172
  await this.disconnectFromConnector(), M();
172
173
  }
173
174
  async monitorConnectedAddress() {
174
- H(await this.getEthereumAddress(), this.getCurrentChainId());
175
+ F(await this.getEthereumAddress(), this.getCurrentChainId());
175
176
  }
176
177
  async getBalances() {
177
178
  return k(this);
@@ -242,6 +243,9 @@ class be {
242
243
  snapshotsClearInterval() {
243
244
  this.commitmentsSnapshotService?.intervalClear(), this.accessTokenSnapshotService?.intervalClear(), this.nullifierSnapshotService?.intervalClear();
244
245
  }
246
+ getRecipientInfo() {
247
+ return j(this);
248
+ }
245
249
  async deposit(e, t) {
246
250
  return P(this, e, t);
247
251
  }
@@ -254,7 +258,7 @@ class be {
254
258
  async withdraw(e, t, r, i, n = !1) {
255
259
  return S(this, e, t, r, i, n);
256
260
  }
257
- async swap(e, t, r, i, n = !1, a = !1) {
261
+ async swap(e, t, r, i, n = !1, o = !1) {
258
262
  return T(
259
263
  this,
260
264
  e,
@@ -262,16 +266,16 @@ class be {
262
266
  r,
263
267
  i,
264
268
  n,
265
- a
269
+ o
266
270
  );
267
271
  }
268
- async actionCurve(e, t, r, i, n, a = !1) {
269
- return C(this, e, t, r, i, n, a);
272
+ async actionCurve(e, t, r, i, n, o = !1) {
273
+ return A(this, e, t, r, i, n, o);
270
274
  }
271
275
  async actionConvex(e, t, r, i, n = !1) {
272
- return A(this, e, t, r, i, n);
276
+ return f(this, e, t, r, i, n);
273
277
  }
274
- async actionBeefy(e, t, r, i, n, a, m = !1) {
278
+ async actionBeefy(e, t, r, i, n, o, m = !1) {
275
279
  return y(
276
280
  this,
277
281
  e,
@@ -279,15 +283,15 @@ class be {
279
283
  r,
280
284
  i,
281
285
  n,
282
- a,
286
+ o,
283
287
  m
284
288
  );
285
289
  }
286
- async actionLido(e, t, r, i, n, a = !1) {
287
- return I(this, e, t, r, i, n, a);
290
+ async actionLido(e, t, r, i, n, o = !1) {
291
+ return H(this, e, t, r, i, n, o);
288
292
  }
289
293
  async actionPendle(e, t, r, i, n = !1) {
290
- return f(this, e, t, r, i, n);
294
+ return C(this, e, t, r, i, n);
291
295
  }
292
296
  async actionPendleLP(e, t, r, i, n = !1) {
293
297
  return B(
@@ -305,13 +309,13 @@ class be {
305
309
  async actionStake(e, t, r, i) {
306
310
  return O(this, e, t, r, i);
307
311
  }
308
- async actionPrivateWallet(e, t, r, i = [], n, a = !1) {
309
- return U(this, e, t, r, i, n, a);
312
+ async actionPrivateWallet(e, t, r, i = [], n, o = !1) {
313
+ return U(this, e, t, r, i, n, o);
310
314
  }
311
315
  async getPendleLPClaimableParams(e, t) {
312
316
  return K(this, e, t);
313
317
  }
314
318
  }
315
319
  export {
316
- be as Hinkal
320
+ _e as Hinkal
317
321
  };
@@ -49,6 +49,7 @@ export interface IHinkal<ConnectorType = unknown> {
49
49
  getAPI(): IAPI;
50
50
  resetCache(): void;
51
51
  snapshotsClearInterval(): void;
52
+ getRecipientInfo(): string;
52
53
  deposit(erc20Addresses: string[], amountChanges: bigint[]): Promise<ethers.ContractTransaction>;
53
54
  depositForOther(erc20Addresses: string[], amountChanges: bigint[], recepinetInfo: string): Promise<ethers.ContractTransaction>;
54
55
  withdraw(erc20Addresses: string[], amountChanges: bigint[], recipientAddress: string, isRelayerOff: boolean, onlyGasEstimate?: boolean): Promise<ethers.ContractTransaction | RelayerTransaction | bigint>;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../utxo/Utxo.cjs");require("ethers");const d=require("../crypto-keys/keys.cjs");require("libsodium-wrappers");const a=require("../../node_modules/viem/_esm/constants/address.cjs"),u=e=>{if(!e)throw Error("No hinkal provided");const{userKeys:s}=e,t=s.getShieldedPrivateKey(),r=d.UserKeys.getEncryptionKeyPair(t).publicKey,o=new c.Utxo({amount:0n,erc20TokenAddress:a.zeroAddress,shieldedPrivateKey:t}),{randomization:n}=o,i=o.getStealthAddress();if(!n||!i||!r)throw Error("Cannot get recipient information");return`${n},${i},${r}`};exports.getRecipientInfo=u;
@@ -0,0 +1,2 @@
1
+ import { IHinkal } from './IHinkal';
2
+ export declare const getRecipientInfo: (hinkal: IHinkal) => string;
@@ -0,0 +1,16 @@
1
+ import { Utxo as d } from "../utxo/Utxo.mjs";
2
+ import "ethers";
3
+ import { UserKeys as c } from "../crypto-keys/keys.mjs";
4
+ import "libsodium-wrappers";
5
+ import { zeroAddress as p } from "../../node_modules/viem/_esm/constants/address.mjs";
6
+ const h = (e) => {
7
+ if (!e)
8
+ throw Error("No hinkal provided");
9
+ const { userKeys: s } = e, t = s.getShieldedPrivateKey(), r = c.getEncryptionKeyPair(t).publicKey, o = new d({ amount: 0n, erc20TokenAddress: p, shieldedPrivateKey: t }), { randomization: n } = o, i = o.getStealthAddress();
10
+ if (!n || !i || !r)
11
+ throw Error("Cannot get recipient information");
12
+ return `${n},${i},${r}`;
13
+ };
14
+ export {
15
+ h as getRecipientInfo
16
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hinkal/common",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "homepage": "hinkal.pro",
5
5
  "author": {
6
6
  "name": "Hinkal Protocol"
@@ -223,3 +223,7 @@ export type HashInfoByChain = Record<keyof typeof networkRegistry, {
223
223
  lastCertifiedHash: string;
224
224
  week: number;
225
225
  }>;
226
+ export type WeekOption = {
227
+ value: number;
228
+ label: string;
229
+ };
@@ -1 +1 @@
1
- "use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/snarkjsWorkerLauncher-VrNXXTje.js").href:new URL("../../assets/snarkjsWorkerLauncher-VrNXXTje.js",document.currentScript&&document.currentScript.src||document.baseURI).href);module.exports=e;
1
+ "use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/snarkjsWorkerLauncher-DS9mXD9U.js").href:new URL("../../assets/snarkjsWorkerLauncher-DS9mXD9U.js",document.currentScript&&document.currentScript.src||document.baseURI).href);module.exports=e;
@@ -1,4 +1,4 @@
1
- const r = "" + new URL("../../assets/snarkjsWorkerLauncher-VrNXXTje.js", import.meta.url).href;
1
+ const r = "" + new URL("../../assets/snarkjsWorkerLauncher-DS9mXD9U.js", import.meta.url).href;
2
2
  export {
3
3
  r as default
4
4
  };