@hinkal/common 0.2.19 → 0.2.21
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 +6 -1
- package/API/API.mjs +48 -41
- package/API/enclaveCalls.cjs +1 -1
- package/API/enclaveCalls.mjs +5 -4
- package/API/index.d.ts +1 -0
- package/API/proxyAccountsCalls.cjs +1 -1
- package/API/proxyAccountsCalls.d.ts +7 -2
- package/API/proxyAccountsCalls.mjs +26 -20
- package/API/temporaryWalletCalls.cjs +1 -0
- package/API/temporaryWalletCalls.d.ts +13 -0
- package/API/temporaryWalletCalls.mjs +20 -0
- package/API/unspent-utxos-calls.cjs +1 -1
- package/API/unspent-utxos-calls.d.ts +1 -1
- package/API/unspent-utxos-calls.mjs +16 -14
- package/README.md +36 -13
- package/constants/chains.constants.cjs +1 -1
- package/constants/chains.constants.d.ts +1 -1
- package/constants/chains.constants.mjs +69 -51
- package/constants/deploy-data/deploy-data-solana.json.cjs +1 -1
- package/constants/deploy-data/deploy-data-solana.json.mjs +28 -2
- package/constants/kyc.constants.cjs +1 -1
- package/constants/kyc.constants.mjs +39 -40
- package/constants/mediaUrls.constants.cjs +1 -1
- package/constants/mediaUrls.constants.d.ts +1 -0
- package/constants/mediaUrls.constants.mjs +2 -1
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.d.ts +6 -1
- package/constants/server.constants.mjs +37 -32
- package/constants/token-data/polygonRegistry.json.cjs +1 -1
- package/constants/token-data/polygonRegistry.json.mjs +4 -4
- package/constants/token-data/polygonRegistryFixed.json.cjs +1 -1
- package/constants/token-data/polygonRegistryFixed.json.mjs +4 -4
- package/data-structures/AccountActions/AccountActions.cjs +1 -0
- package/data-structures/AccountActions/AccountActions.d.ts +18 -0
- package/data-structures/AccountActions/AccountActions.mjs +78 -0
- package/data-structures/AccountActions/index.d.ts +1 -0
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -1
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +68 -71
- package/data-structures/BlockchainEvent/BlockchainEvent.cjs +1 -0
- package/data-structures/BlockchainEvent/BlockchainEvent.d.ts +14 -0
- package/data-structures/BlockchainEvent/BlockchainEvent.mjs +41 -0
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.d.ts +14 -8
- package/data-structures/Hinkal/Hinkal.mjs +215 -179
- package/data-structures/Hinkal/IHinkal.d.ts +9 -6
- package/data-structures/Hinkal/handleAutoDepositBack.cjs +1 -1
- package/data-structures/Hinkal/handleAutoDepositBack.mjs +47 -48
- package/data-structures/Hinkal/hinkalActionReceive.cjs +1 -1
- package/data-structures/Hinkal/hinkalActionReceive.mjs +25 -22
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +12 -12
- package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalDeposit.mjs +63 -63
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +60 -147
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -0
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.d.ts +4 -0
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +103 -0
- package/data-structures/Hinkal/hinkalDepostAndBridge.cjs +1 -0
- package/data-structures/Hinkal/hinkalDepostAndBridge.d.ts +4 -0
- package/data-structures/Hinkal/hinkalDepostAndBridge.mjs +214 -0
- package/data-structures/Hinkal/hinkalGetZkMeProvider.cjs +1 -1
- package/data-structures/Hinkal/hinkalGetZkMeProvider.mjs +4 -4
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.d.ts +2 -2
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +103 -99
- package/data-structures/Hinkal/hinkalProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxySwap.mjs +44 -41
- package/data-structures/Hinkal/hinkalProxyToPrivate.cjs +1 -1
- package/data-structures/Hinkal/hinkalProxyToPrivate.mjs +31 -28
- package/data-structures/Hinkal/hinkalSignSubAccount.cjs +1 -1
- package/data-structures/Hinkal/hinkalSignSubAccount.mjs +16 -13
- package/data-structures/Hinkal/hinkalSolanaDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDeposit.mjs +34 -34
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +67 -65
- package/data-structures/Hinkal/hinkalSolanaProxySend.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySend.mjs +35 -32
- package/data-structures/Hinkal/hinkalSolanaProxyShield.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxyShield.mjs +59 -56
- package/data-structures/Hinkal/hinkalSolanaProxySwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaProxySwap.mjs +35 -32
- package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.mjs +10 -10
- package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +25 -25
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +34 -30
- package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalTransfer.mjs +43 -39
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +47 -43
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +50 -46
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +36 -34
- package/data-structures/IndexedDB/activity-db.cjs +1 -1
- package/data-structures/IndexedDB/activity-db.d.ts +1 -0
- package/data-structures/IndexedDB/activity-db.mjs +86 -70
- package/data-structures/IndexedDB/balances-db.cjs +1 -1
- package/data-structures/IndexedDB/balances-db.mjs +33 -30
- package/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/data-structures/IndexedDB/contact-db.mjs +9 -6
- package/data-structures/PublicBalance/PublicBalanceWatcher.cjs +1 -0
- package/data-structures/PublicBalance/PublicBalanceWatcher.d.ts +20 -0
- package/data-structures/PublicBalance/PublicBalanceWatcher.mjs +124 -0
- package/data-structures/PublicBalance/SolanaPublicBalancerWatcher.cjs +1 -0
- package/data-structures/PublicBalance/SolanaPublicBalancerWatcher.d.ts +15 -0
- package/data-structures/PublicBalance/SolanaPublicBalancerWatcher.mjs +64 -0
- package/data-structures/PublicBalance/index.d.ts +2 -0
- package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +77 -78
- package/data-structures/crypto-keys/keys.cjs +1 -1
- package/data-structures/crypto-keys/keys.d.ts +0 -11
- package/data-structures/crypto-keys/keys.mjs +47 -107
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.d.ts +3 -2
- package/data-structures/event-service/evm/AbstractAccessTokenSnapshotService.mjs +9 -9
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.d.ts +3 -2
- package/data-structures/event-service/evm/AbstractApprovalsSnapshotService.mjs +5 -5
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.d.ts +3 -2
- package/data-structures/event-service/evm/AbstractCommitmentsSnapshotService.mjs +6 -6
- package/data-structures/event-service/evm/AbstractEventService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractEventService.d.ts +3 -2
- package/data-structures/event-service/evm/AbstractEventService.mjs +16 -19
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.d.ts +3 -3
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.mjs +6 -5
- package/data-structures/event-service/evm/AbstractSnapshotService.d.ts +1 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +7 -4
- package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +35 -34
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.d.ts +11 -0
- package/data-structures/event-service/evm/ClientBlockchainEventEmitter.mjs +21 -0
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.d.ts +6 -0
- package/data-structures/event-service/evm/PollingBlockchainEventEmitter.mjs +16 -0
- package/data-structures/event-service/helpers/ClientEventHelper.cjs +1 -0
- package/data-structures/event-service/helpers/ClientEventHelper.d.ts +11 -0
- package/data-structures/event-service/helpers/ClientEventHelper.mjs +26 -0
- package/data-structures/event-service/helpers/PollingEventHelper.cjs +1 -0
- package/data-structures/event-service/helpers/PollingEventHelper.d.ts +5 -0
- package/data-structures/event-service/helpers/PollingEventHelper.mjs +14 -0
- package/data-structures/event-service/index.d.ts +4 -0
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.d.ts +3 -2
- package/data-structures/event-service/solana/AbstractSolanaAccessTokenSnapshotService.mjs +6 -6
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.d.ts +4 -3
- package/data-structures/event-service/solana/AbstractSolanaCommitmentsSnapshotService.mjs +8 -8
- package/data-structures/event-service/solana/AbstractSolanaEventService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaEventService.d.ts +3 -10
- package/data-structures/event-service/solana/AbstractSolanaEventService.mjs +5 -5
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.d.ts +3 -2
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.mjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaSnapshotService.d.ts +1 -1
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.d.ts +11 -0
- package/data-structures/event-service/solana/ClientSolanaBlockchainEventEmitter.mjs +22 -0
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.cjs +1 -0
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.d.ts +6 -0
- package/data-structures/event-service/solana/PollingSolanaBlockchainEventEmitter.mjs +16 -0
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.d.ts +8 -14
- package/data-structures/event-service/solana/SolanaBlockchainEventEmitter.mjs +68 -67
- package/data-structures/index.d.ts +3 -0
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +5 -2
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +5 -2
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientCommitmentsSnapshotService.mjs +5 -2
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientNullifierSnapshotService.mjs +5 -2
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaAccessTokenSnapshotService.mjs +5 -2
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaCommitmentsSnapshotService.mjs +5 -2
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.cjs +1 -1
- package/data-structures/snapshot/solana-snapshots/ClientSolanaNullifierSnapshotService.mjs +5 -2
- package/data-structures/utxo/Utxo.cjs +1 -1
- package/data-structures/utxo/Utxo.d.ts +1 -0
- package/data-structures/utxo/Utxo.mjs +18 -4
- package/error-handling/error-codes.constants.cjs +1 -1
- package/error-handling/error-codes.constants.mjs +2 -2
- package/functions/pre-transaction/getSolanaCalldataHash.cjs +1 -1
- package/functions/pre-transaction/getSolanaCalldataHash.mjs +22 -22
- package/functions/pre-transaction/sendV0Transaction.cjs +1 -1
- package/functions/pre-transaction/sendV0Transaction.mjs +53 -50
- package/functions/pre-transaction/solana.cjs +1 -1
- package/functions/pre-transaction/solana.mjs +93 -93
- package/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.helpers.d.ts +3 -2
- package/functions/private-wallet/emporium.helpers.mjs +118 -93
- package/functions/snarkjs/constructEmporiumProof.cjs +1 -1
- package/functions/snarkjs/constructEmporiumProof.d.ts +1 -2
- package/functions/snarkjs/constructEmporiumProof.mjs +89 -89
- package/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
- package/functions/snarkjs/constructSolanaZkProof.mjs +6 -2
- package/functions/utils/bytes32.utils.cjs +1 -1
- package/functions/utils/bytes32.utils.mjs +8 -7
- package/functions/utils/create-provider.cjs +1 -1
- package/functions/utils/create-provider.d.ts +1 -1
- package/functions/utils/create-provider.mjs +13 -9
- package/functions/utils/index.d.ts +0 -1
- package/functions/utils/prepareHinkal.cjs +1 -1
- package/functions/utils/prepareHinkal.d.ts +6 -7
- package/functions/utils/prepareHinkal.mjs +45 -53
- package/functions/utils/publicBalance.utils.cjs +1 -1
- package/functions/utils/publicBalance.utils.mjs +49 -54
- package/functions/utils/socket.utils.cjs +1 -0
- package/functions/utils/socket.utils.d.ts +1 -0
- package/functions/utils/socket.utils.mjs +12 -0
- package/functions/utils/string.utils.cjs +1 -1
- package/functions/utils/string.utils.d.ts +1 -0
- package/functions/utils/string.utils.mjs +18 -14
- package/functions/utils/walletBalances.utils.cjs +1 -1
- package/functions/utils/walletBalances.utils.d.ts +1 -1
- package/functions/utils/walletBalances.utils.mjs +4 -4
- package/functions/web3/crypto.cjs +1 -0
- package/functions/web3/crypto.d.ts +1 -0
- package/functions/web3/crypto.mjs +7 -0
- package/functions/web3/events/getApprovedBalance.cjs +1 -1
- package/functions/web3/events/getApprovedBalance.mjs +14 -14
- package/functions/web3/events/getInputUtxoAndBalance.cjs +1 -1
- package/functions/web3/events/getInputUtxoAndBalance.mjs +61 -59
- package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
- package/functions/web3/events/getTransactionLogEvents.mjs +32 -32
- package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
- package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +6 -3
- package/functions/web3/functionCalls/approveToken.cjs +1 -1
- package/functions/web3/functionCalls/approveToken.mjs +17 -17
- package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
- package/functions/web3/functionCalls/transactCallDirect.mjs +16 -16
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.mjs +13 -11
- package/functions/web3/getContractMetadata.cjs +1 -1
- package/functions/web3/getContractMetadata.mjs +17 -22
- package/functions/web3/getTokenHolder.cjs +1 -1
- package/functions/web3/getTokenHolder.mjs +20 -20
- package/functions/web3/index.d.ts +1 -0
- package/index.cjs +1 -1
- package/index.mjs +913 -890
- package/package.json +3 -2
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.mjs +2 -5
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.mjs +11 -4
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +11 -4
- package/types/activities.types.d.ts +2 -0
- package/types/bridging-tx.types.d.ts +17 -0
- package/types/cache.types.cjs +1 -1
- package/types/cache.types.d.ts +5 -1
- package/types/cache.types.mjs +1 -1
- package/types/ethereum-network.types.d.ts +1 -0
- package/types/events.types.cjs +1 -0
- package/types/events.types.d.ts +9 -0
- package/types/events.types.mjs +5 -0
- package/types/index.d.ts +2 -0
- package/types/proxy.types.d.ts +11 -4
- package/types/sandbox.types.d.ts +2 -0
- package/types/solana.types.d.ts +8 -0
- package/types/token.types.d.ts +5 -0
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.cjs +1 -1
- package/webworker/snarkjsWorker/snarkjsWorkerLauncher.mjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +1 -1
- package/functions/kyc/authentoHelper.cjs +0 -1
- package/functions/kyc/authentoHelper.d.ts +0 -12
- package/functions/kyc/authentoHelper.mjs +0 -30
- package/functions/utils/get-hinkal-approvals.cjs +0 -1
- package/functions/utils/get-hinkal-approvals.d.ts +0 -3
- package/functions/utils/get-hinkal-approvals.mjs +0 -38
package/API/API.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("./relayCalls.cjs"),i=require("./getTokenPrice.cjs"),r=require("./kycCalls.cjs"),P=require("./callOdosAPI.cjs"),U=require("./is-tx-stateless.cjs"),y=require("./simulate-batch-tx.cjs"),k=require("./token-calls.cjs"),p=require("./get-token-data.cjs"),A=require("./enclaveCalls.cjs"),d=require("./generate-trading-points.cjs"),e=require("./brotherhoodCalls.cjs"),g=require("./leaderboardCalls.cjs"),o=require("./referralsCalls.cjs"),u=require("./accessCodeCalls.cjs"),t=require("./rewardsUserCalls.cjs"),h=require("./weeklyAnalyticCalls.cjs"),m=require("./send-telegram-callback.cjs"),a=require("./proxyAccountsCalls.cjs"),B=require("./callMonitor.cjs"),n=require("./solana-calls.cjs"),q=require("./callRelayer.cjs"),s=require("./seedless-calls.cjs"),S=require("./scheduled-transactions-calls.cjs"),l=require("./unspent-utxos-calls.cjs"),c=require("./temporaryWalletCalls.cjs"),C=require("./onrampCalls.cjs"),f=require("./get-token-price-chart-data.cjs"),x={getUserKycStatus:r.getUserKycStatus,setAiPriseVerificationUrl:r.setAiPriseVerificationUrl,getAccessTokenSignature:r.getAccessTokenSignature,getReclaimVerificationRequest:r.getReclaimVerificationRequest,getZkMeAccessToken:r.getZkMeAccessToken,getTokenPrices:i.getTokenPrices,getOdosPriceForToken:P.getOdosPriceForToken,getTokenPriceChartData:f.getTokenPriceChartData,getTokenPreviousDayPrices:i.getTokenPreviousDayPrices,getIdleRelay:T.getIdleRelay,generateTradingPoints:d.generateTradingPoints,generateAumPoints:d.generateAumPoints,getBrotherhoodUsers:e.getBrotherhoodUsers,getCurrentUserBrotherhoodUsers:e.getCurrentUserBrotherhoodUsers,getBrotherhood:e.getBrotherhood,editBrotherhood:e.editBrotherhood,createBrotherhood:e.createBrotherhood,getCurrentUserBrotherhood:e.getCurrentUserBrotherhood,getPublicBrotherhoods:e.getPublicBrotherhoods,leaveBrotherhood:e.leaveBrotherhood,joinBrotherhood:e.joinBrotherhood,getUserAnalytics:h.getUserAnalytics,getBrotherhoodAnalytics:h.getBrotherhoodAnalytics,connectRewardsUser:t.connectRewardsUser,updateRewardsUser:t.updateRewardsUser,disconnectSocialNetwork:t.disconnectSocialNetwork,getUserCurrentLeaderboard:g.getUserCurrentLeaderboard,getBrotherhoodsLeaderboard:g.getBrotherhoodsLeaderboard,getCurrentUserReferral:o.getCurrentUserReferral,submitReferralCode:o.submitReferralCode,getCurrentUserAppliedReferralCode:o.getCurrentUserAppliedReferralCode,submitAccessCode:u.submitAccessCode,getAccessCodeBenefits:u.getAccessCodeBenefits,isTxStateless:U.isTxStateless,simulateBatchTx:y.simulateBatchTx,tokensInfoCall:k.tokensInfoCall,getTokenData:p.getTokenData,decryptUtxoEnclaveCall:A.decryptUtxoEnclaveCall,sendTelegramCallback:m.sendTelegramCallback,getTasksProgress:t.getTasksProgress,getSwapStreak:t.getSwapStreak,getProxyAccounts:a.getProxyAccounts,updateProxyAccounts:a.updateProxyAccounts,getNftMultiplier:t.getNftMultiplier,monitor:B.monitor,generateProoflessDepositLimitless:n.generateProoflessDepositLimitless,generateMultiPaymentDepositLimitless:n.generateMultiPaymentDepositLimitless,generateAddAccessToken:n.generateAddAccessToken,callRelayerSolanaTransactBatchAPI:q.callRelayerSolanaTransactBatchAPI,seedlessInit:s.seedlessInit,seedlessBackup:s.seedlessBackup,seedlessCheckPassword:s.seedlessCheckPassword,seedlessStatus:s.seedlessStatus,seedlessSalt:s.seedlessSalt,getScheduledTransactions:S.getScheduledTransactions,storeUnspentUtxos:l.storeUnspentUtxos,deleteUnspentUtxos:l.deleteUnspentUtxos,getUnspentUtxos:l.getUnspentUtxos,getTemporaryWalletNonces:c.getTemporaryWalletNonces,addTemporaryWalletNonce:c.addTemporaryWalletNonce,removeTemporaryWalletNonce:c.removeTemporaryWalletNonce,encodeMoonPayBuyUrl:C.encodeMoonPayBuyUrl,generateMoonPayQuote:C.generateMoonPayQuote,isVersion1Account:a.isVersion1Account};exports.API=x;
|
package/API/API.d.ts
CHANGED
|
@@ -15,13 +15,14 @@ import { getAccessCodeBenefits, submitAccessCode } from './accessCodeCalls';
|
|
|
15
15
|
import { connectRewardsUser, disconnectSocialNetwork, getNftMultiplier, getSwapStreak, getTasksProgress, updateRewardsUser } from './rewardsUserCalls';
|
|
16
16
|
import { getBrotherhoodAnalytics, getUserAnalytics } from './weeklyAnalyticCalls';
|
|
17
17
|
import { sendTelegramCallback } from './send-telegram-callback';
|
|
18
|
-
import { getProxyAccounts, updateProxyAccounts } from './proxyAccountsCalls';
|
|
18
|
+
import { getProxyAccounts, isVersion1Account, updateProxyAccounts } from './proxyAccountsCalls';
|
|
19
19
|
import { monitor } from './callMonitor';
|
|
20
20
|
import { generateAddAccessToken, generateMultiPaymentDepositLimitless, generateProoflessDepositLimitless } from './solana-calls';
|
|
21
21
|
import { callRelayerSolanaTransactBatchAPI } from './callRelayer';
|
|
22
22
|
import { seedlessBackup, seedlessCheckPassword, seedlessInit, seedlessSalt, seedlessStatus } from './seedless-calls';
|
|
23
23
|
import { getScheduledTransactions } from './scheduled-transactions-calls';
|
|
24
24
|
import { deleteUnspentUtxos, getUnspentUtxos, storeUnspentUtxos } from './unspent-utxos-calls';
|
|
25
|
+
import { addTemporaryWalletNonce, getTemporaryWalletNonces, removeTemporaryWalletNonce } from './temporaryWalletCalls';
|
|
25
26
|
import { encodeMoonPayBuyUrl, generateMoonPayQuote } from './onrampCalls';
|
|
26
27
|
import { getTokenPriceChartData } from './get-token-price-chart-data';
|
|
27
28
|
export type IAPI = {
|
|
@@ -83,7 +84,11 @@ export type IAPI = {
|
|
|
83
84
|
storeUnspentUtxos: typeof storeUnspentUtxos;
|
|
84
85
|
deleteUnspentUtxos: typeof deleteUnspentUtxos;
|
|
85
86
|
getUnspentUtxos: typeof getUnspentUtxos;
|
|
87
|
+
getTemporaryWalletNonces: typeof getTemporaryWalletNonces;
|
|
88
|
+
addTemporaryWalletNonce: typeof addTemporaryWalletNonce;
|
|
89
|
+
removeTemporaryWalletNonce: typeof removeTemporaryWalletNonce;
|
|
86
90
|
encodeMoonPayBuyUrl: typeof encodeMoonPayBuyUrl;
|
|
87
91
|
generateMoonPayQuote: typeof generateMoonPayQuote;
|
|
92
|
+
isVersion1Account: typeof isVersion1Account;
|
|
88
93
|
};
|
|
89
94
|
export declare const API: IAPI;
|
package/API/API.mjs
CHANGED
|
@@ -3,28 +3,29 @@ import { getTokenPrices as r, getTokenPreviousDayPrices as o } from "./getTokenP
|
|
|
3
3
|
import { getUserKycStatus as t, setAiPriseVerificationUrl as s, getAccessTokenSignature as i, getReclaimVerificationRequest as a, getZkMeAccessToken as m } from "./kycCalls.mjs";
|
|
4
4
|
import { getOdosPriceForToken as n } from "./callOdosAPI.mjs";
|
|
5
5
|
import { isTxStateless as c } from "./is-tx-stateless.mjs";
|
|
6
|
-
import { simulateBatchTx as
|
|
7
|
-
import { tokensInfoCall as
|
|
6
|
+
import { simulateBatchTx as l } from "./simulate-batch-tx.mjs";
|
|
7
|
+
import { tokensInfoCall as d } from "./token-calls.mjs";
|
|
8
8
|
import { getTokenData as p } from "./get-token-data.mjs";
|
|
9
9
|
import { decryptUtxoEnclaveCall as g } from "./enclaveCalls.mjs";
|
|
10
10
|
import { generateTradingPoints as f, generateAumPoints as h } from "./generate-trading-points.mjs";
|
|
11
|
-
import { getBrotherhoodUsers as u, getCurrentUserBrotherhoodUsers as U, getBrotherhood as P, editBrotherhood as
|
|
11
|
+
import { getBrotherhoodUsers as u, getCurrentUserBrotherhoodUsers as U, getBrotherhood as P, editBrotherhood as T, createBrotherhood as k, getCurrentUserBrotherhood as y, getPublicBrotherhoods as A, leaveBrotherhood as B, joinBrotherhood as C } from "./brotherhoodCalls.mjs";
|
|
12
12
|
import { getUserCurrentLeaderboard as S, getBrotherhoodsLeaderboard as x } from "./leaderboardCalls.mjs";
|
|
13
13
|
import { getCurrentUserReferral as R, submitReferralCode as b, getCurrentUserAppliedReferralCode as w } from "./referralsCalls.mjs";
|
|
14
14
|
import { submitAccessCode as D, getAccessCodeBenefits as I } from "./accessCodeCalls.mjs";
|
|
15
|
-
import { connectRewardsUser as M, updateRewardsUser as
|
|
16
|
-
import { getUserAnalytics as
|
|
17
|
-
import { sendTelegramCallback as
|
|
18
|
-
import { getProxyAccounts as
|
|
15
|
+
import { connectRewardsUser as M, updateRewardsUser as N, disconnectSocialNetwork as v, getTasksProgress as L, getSwapStreak as V, getNftMultiplier as W } from "./rewardsUserCalls.mjs";
|
|
16
|
+
import { getUserAnalytics as j, getBrotherhoodAnalytics as q } from "./weeklyAnalyticCalls.mjs";
|
|
17
|
+
import { sendTelegramCallback as E } from "./send-telegram-callback.mjs";
|
|
18
|
+
import { getProxyAccounts as F, updateProxyAccounts as K, isVersion1Account as O } from "./proxyAccountsCalls.mjs";
|
|
19
19
|
import { monitor as Q } from "./callMonitor.mjs";
|
|
20
20
|
import { generateProoflessDepositLimitless as Z, generateMultiPaymentDepositLimitless as z, generateAddAccessToken as G } from "./solana-calls.mjs";
|
|
21
21
|
import { callRelayerSolanaTransactBatchAPI as H } from "./callRelayer.mjs";
|
|
22
|
-
import { seedlessInit as J, seedlessBackup as
|
|
23
|
-
import { getScheduledTransactions as
|
|
24
|
-
import { storeUnspentUtxos as
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
|
|
22
|
+
import { seedlessInit as J, seedlessBackup as X, seedlessCheckPassword as Y, seedlessStatus as _, seedlessSalt as $ } from "./seedless-calls.mjs";
|
|
23
|
+
import { getScheduledTransactions as ee } from "./scheduled-transactions-calls.mjs";
|
|
24
|
+
import { storeUnspentUtxos as re, deleteUnspentUtxos as oe, getUnspentUtxos as te } from "./unspent-utxos-calls.mjs";
|
|
25
|
+
import { getTemporaryWalletNonces as se, addTemporaryWalletNonce as ie, removeTemporaryWalletNonce as ae } from "./temporaryWalletCalls.mjs";
|
|
26
|
+
import { encodeMoonPayBuyUrl as me, generateMoonPayQuote as ne } from "./onrampCalls.mjs";
|
|
27
|
+
import { getTokenPriceChartData as ce } from "./get-token-price-chart-data.mjs";
|
|
28
|
+
const We = {
|
|
28
29
|
// KYC
|
|
29
30
|
getUserKycStatus: t,
|
|
30
31
|
setAiPriseVerificationUrl: s,
|
|
@@ -34,7 +35,7 @@ const Me = {
|
|
|
34
35
|
// Prices
|
|
35
36
|
getTokenPrices: r,
|
|
36
37
|
getOdosPriceForToken: n,
|
|
37
|
-
getTokenPriceChartData:
|
|
38
|
+
getTokenPriceChartData: ce,
|
|
38
39
|
getTokenPreviousDayPrices: o,
|
|
39
40
|
// relay
|
|
40
41
|
getIdleRelay: e,
|
|
@@ -45,18 +46,18 @@ const Me = {
|
|
|
45
46
|
getBrotherhoodUsers: u,
|
|
46
47
|
getCurrentUserBrotherhoodUsers: U,
|
|
47
48
|
getBrotherhood: P,
|
|
48
|
-
editBrotherhood:
|
|
49
|
-
createBrotherhood:
|
|
50
|
-
getCurrentUserBrotherhood:
|
|
51
|
-
getPublicBrotherhoods:
|
|
52
|
-
leaveBrotherhood:
|
|
53
|
-
joinBrotherhood:
|
|
49
|
+
editBrotherhood: T,
|
|
50
|
+
createBrotherhood: k,
|
|
51
|
+
getCurrentUserBrotherhood: y,
|
|
52
|
+
getPublicBrotherhoods: A,
|
|
53
|
+
leaveBrotherhood: B,
|
|
54
|
+
joinBrotherhood: C,
|
|
54
55
|
// weekly analytics
|
|
55
|
-
getUserAnalytics:
|
|
56
|
-
getBrotherhoodAnalytics:
|
|
56
|
+
getUserAnalytics: j,
|
|
57
|
+
getBrotherhoodAnalytics: q,
|
|
57
58
|
// rewards user
|
|
58
59
|
connectRewardsUser: M,
|
|
59
|
-
updateRewardsUser:
|
|
60
|
+
updateRewardsUser: N,
|
|
60
61
|
disconnectSocialNetwork: v,
|
|
61
62
|
// leaderboard
|
|
62
63
|
getUserCurrentLeaderboard: S,
|
|
@@ -70,23 +71,23 @@ const Me = {
|
|
|
70
71
|
getAccessCodeBenefits: I,
|
|
71
72
|
// tenderly
|
|
72
73
|
isTxStateless: c,
|
|
73
|
-
simulateBatchTx:
|
|
74
|
+
simulateBatchTx: l,
|
|
74
75
|
// token calls
|
|
75
|
-
tokensInfoCall:
|
|
76
|
+
tokensInfoCall: d,
|
|
76
77
|
getTokenData: p,
|
|
77
78
|
// enclave
|
|
78
79
|
decryptUtxoEnclaveCall: g,
|
|
79
80
|
// callbacks
|
|
80
|
-
sendTelegramCallback:
|
|
81
|
+
sendTelegramCallback: E,
|
|
81
82
|
// tasks
|
|
82
|
-
getTasksProgress:
|
|
83
|
+
getTasksProgress: L,
|
|
83
84
|
// swap streak
|
|
84
85
|
getSwapStreak: V,
|
|
85
86
|
// proxy accounts
|
|
86
|
-
getProxyAccounts:
|
|
87
|
-
updateProxyAccounts:
|
|
87
|
+
getProxyAccounts: F,
|
|
88
|
+
updateProxyAccounts: K,
|
|
88
89
|
// nft multiplier
|
|
89
|
-
getNftMultiplier:
|
|
90
|
+
getNftMultiplier: W,
|
|
90
91
|
// hexagate
|
|
91
92
|
monitor: Q,
|
|
92
93
|
// solana
|
|
@@ -96,20 +97,26 @@ const Me = {
|
|
|
96
97
|
callRelayerSolanaTransactBatchAPI: H,
|
|
97
98
|
// seedless
|
|
98
99
|
seedlessInit: J,
|
|
99
|
-
seedlessBackup:
|
|
100
|
-
seedlessCheckPassword:
|
|
101
|
-
seedlessStatus:
|
|
102
|
-
seedlessSalt:
|
|
100
|
+
seedlessBackup: X,
|
|
101
|
+
seedlessCheckPassword: Y,
|
|
102
|
+
seedlessStatus: _,
|
|
103
|
+
seedlessSalt: $,
|
|
103
104
|
// scheduled transactions
|
|
104
|
-
getScheduledTransactions:
|
|
105
|
+
getScheduledTransactions: ee,
|
|
105
106
|
// unspent utxos
|
|
106
|
-
storeUnspentUtxos:
|
|
107
|
-
deleteUnspentUtxos:
|
|
108
|
-
getUnspentUtxos:
|
|
107
|
+
storeUnspentUtxos: re,
|
|
108
|
+
deleteUnspentUtxos: oe,
|
|
109
|
+
getUnspentUtxos: te,
|
|
110
|
+
// temporary wallets
|
|
111
|
+
getTemporaryWalletNonces: se,
|
|
112
|
+
addTemporaryWalletNonce: ie,
|
|
113
|
+
removeTemporaryWalletNonce: ae,
|
|
109
114
|
// onramp
|
|
110
|
-
encodeMoonPayBuyUrl:
|
|
111
|
-
generateMoonPayQuote:
|
|
115
|
+
encodeMoonPayBuyUrl: me,
|
|
116
|
+
generateMoonPayQuote: ne,
|
|
117
|
+
// version1 account
|
|
118
|
+
isVersion1Account: O
|
|
112
119
|
};
|
|
113
120
|
export {
|
|
114
|
-
|
|
121
|
+
We as API
|
|
115
122
|
};
|
package/API/enclaveCalls.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../functions/snarkjs/constant.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../functions/snarkjs/constant.cjs"),r=require("../data-structures/http/HttpClient.cjs");require("axios");const s=require("async-mutex"),o=new s.Mutex,u=async(e,t,n)=>o.runExclusive(async()=>await r.httpClient.post(`${c.ENCLAVE_EC2_URL}/decrypt-utxos`,{chainId:e,input:n,key:t}));exports.decryptUtxoEnclaveCall=u;
|
package/API/enclaveCalls.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { ENCLAVE_EC2_URL as n } from "../functions/snarkjs/constant.mjs";
|
|
2
|
-
import { httpClient as
|
|
2
|
+
import { httpClient as r } from "../data-structures/http/HttpClient.mjs";
|
|
3
3
|
import "axios";
|
|
4
|
-
|
|
4
|
+
import { Mutex as p } from "async-mutex";
|
|
5
|
+
const s = new p(), m = async (t, e, o) => s.runExclusive(async () => await r.post(`${n}/decrypt-utxos`, {
|
|
5
6
|
chainId: t,
|
|
6
7
|
input: o,
|
|
7
8
|
key: e
|
|
8
|
-
});
|
|
9
|
+
}));
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
+
m as decryptUtxoEnclaveCall
|
|
11
12
|
};
|
package/API/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../constants/server.constants.cjs"),n=require("./getServerURL.cjs"),a=require("ethers"),A=require("../functions/utils/addresses.cjs"),c=require("../data-structures/http/HttpClient.cjs");require("axios");const i=(e,t)=>{const s=t.getShieldedPrivateKey(),r=`HinkalProxyAccounts|${e.toLowerCase()}|${s}`;return a.ethers.utils.keccak256(a.ethers.utils.toUtf8Bytes(r))},p=async(e,t)=>{const s=i(e,t);return await c.httpClient.get(`${n.SERVER_URL}${o.API_CONFIG.ROUTES.getProxyAccounts(s)}`)},P=async(e,t,s,r,u)=>{const y=i(e,t),d=A.hashEthereumAddress(e);return await c.httpClient.post(`${n.SERVER_URL}${o.API_CONFIG.ROUTES.updateProxyAccounts}`,{secureKey:y,hashedEthereumAddress:d,proxyAccounts:s,...r!==void 0&&{username:r},...u!==void 0&&{profileImage:u}})},h=async(e,t)=>{const s=i(e,t);return(await c.httpClient.get(`${n.SERVER_URL}${o.API_CONFIG.ROUTES.isVersion1Account(s)}`)).isVersion1Account};exports.getProxyAccounts=p;exports.isVersion1Account=h;exports.updateProxyAccounts=P;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { SubAccountLight } from '../types/proxy.types';
|
|
2
2
|
import { UserKeys } from '../data-structures/crypto-keys';
|
|
3
|
-
export declare const getProxyAccounts: (ethereumAddress: string, userKeys: UserKeys) => Promise<
|
|
4
|
-
|
|
3
|
+
export declare const getProxyAccounts: (ethereumAddress: string, userKeys: UserKeys) => Promise<{
|
|
4
|
+
proxyAccounts: SubAccountLight[];
|
|
5
|
+
username?: string | undefined;
|
|
6
|
+
profileImage?: string | undefined;
|
|
7
|
+
}>;
|
|
8
|
+
export declare const updateProxyAccounts: (ethereumAddress: string, userKeys: UserKeys, proxyAccounts: SubAccountLight[], username?: string, profileImage?: string) => Promise<any>;
|
|
9
|
+
export declare const isVersion1Account: (ethereumAddress: string, userKeys: UserKeys) => Promise<boolean>;
|
|
@@ -1,26 +1,32 @@
|
|
|
1
|
-
import { API_CONFIG as
|
|
2
|
-
import { SERVER_URL as
|
|
3
|
-
import { ethers as
|
|
4
|
-
import { hashEthereumAddress as
|
|
5
|
-
import { httpClient as
|
|
1
|
+
import { API_CONFIG as r } from "../constants/server.constants.mjs";
|
|
2
|
+
import { SERVER_URL as n } from "./getServerURL.mjs";
|
|
3
|
+
import { ethers as a } from "ethers";
|
|
4
|
+
import { hashEthereumAddress as d } from "../functions/utils/addresses.mjs";
|
|
5
|
+
import { httpClient as c } from "../data-structures/http/HttpClient.mjs";
|
|
6
6
|
import "axios";
|
|
7
|
-
const
|
|
8
|
-
const o =
|
|
9
|
-
return
|
|
10
|
-
},
|
|
11
|
-
const o =
|
|
12
|
-
return await
|
|
13
|
-
|
|
14
|
-
);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
7
|
+
const i = (t, e) => {
|
|
8
|
+
const o = e.getShieldedPrivateKey(), s = `HinkalProxyAccounts|${t.toLowerCase()}|${o}`;
|
|
9
|
+
return a.utils.keccak256(a.utils.toUtf8Bytes(s));
|
|
10
|
+
}, S = async (t, e) => {
|
|
11
|
+
const o = i(t, e);
|
|
12
|
+
return await c.get(`${n}${r.ROUTES.getProxyAccounts(o)}`);
|
|
13
|
+
}, g = async (t, e, o, s, u) => {
|
|
14
|
+
const p = i(t, e), y = d(t);
|
|
15
|
+
return await c.post(`${n}${r.ROUTES.updateProxyAccounts}`, {
|
|
16
|
+
secureKey: p,
|
|
17
|
+
hashedEthereumAddress: y,
|
|
18
|
+
proxyAccounts: o,
|
|
19
|
+
...s !== void 0 && { username: s },
|
|
20
|
+
...u !== void 0 && { profileImage: u }
|
|
21
21
|
});
|
|
22
|
+
}, K = async (t, e) => {
|
|
23
|
+
const o = i(t, e);
|
|
24
|
+
return (await c.get(
|
|
25
|
+
`${n}${r.ROUTES.isVersion1Account(o)}`
|
|
26
|
+
)).isVersion1Account;
|
|
22
27
|
};
|
|
23
28
|
export {
|
|
24
|
-
|
|
29
|
+
S as getProxyAccounts,
|
|
30
|
+
K as isVersion1Account,
|
|
25
31
|
g as updateProxyAccounts
|
|
26
32
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../constants/server.constants.cjs"),n=require("../data-structures/http/HttpClient.cjs");require("axios");const a=require("./getServerURL.cjs"),l=async(e,t)=>n.httpClient.get(`${a.SERVER_URL}${o.API_CONFIG.ROUTES.getTemporaryWalletNonces(t,e)}`),c=async(e,t,r)=>n.httpClient.post(`${a.SERVER_URL}${o.API_CONFIG.ROUTES.addTemporaryWalletNonce}`,{hashedEthereumAddress:t,chainId:e,nonce:r}),s=async(e,t,r)=>n.httpClient.post(`${a.SERVER_URL}${o.API_CONFIG.ROUTES.removeTemporaryWalletNonce}`,{hashedEthereumAddress:t,chainId:e,nonce:r});exports.addTemporaryWalletNonce=c;exports.getTemporaryWalletNonces=l;exports.removeTemporaryWalletNonce=s;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface IGetTemporaryWalletNonces {
|
|
2
|
+
nonces: number[];
|
|
3
|
+
}
|
|
4
|
+
export declare const getTemporaryWalletNonces: (chainId: number, hashedEthereumAddress: string) => Promise<IGetTemporaryWalletNonces>;
|
|
5
|
+
interface IAddTemporaryWalletNonce {
|
|
6
|
+
success: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const addTemporaryWalletNonce: (chainId: number, hashedEthereumAddress: string, nonce: number) => Promise<IAddTemporaryWalletNonce>;
|
|
9
|
+
interface IRemoveTemporaryWalletNonce {
|
|
10
|
+
success: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const removeTemporaryWalletNonce: (chainId: number, hashedEthereumAddress: string, nonce: number) => Promise<IRemoveTemporaryWalletNonce>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { API_CONFIG as t } from "../constants/server.constants.mjs";
|
|
2
|
+
import { httpClient as a } from "../data-structures/http/HttpClient.mjs";
|
|
3
|
+
import "axios";
|
|
4
|
+
import { SERVER_URL as n } from "./getServerURL.mjs";
|
|
5
|
+
const s = async (e, r) => a.get(
|
|
6
|
+
`${n}${t.ROUTES.getTemporaryWalletNonces(r, e)}`
|
|
7
|
+
), y = async (e, r, o) => a.post(`${n}${t.ROUTES.addTemporaryWalletNonce}`, {
|
|
8
|
+
hashedEthereumAddress: r,
|
|
9
|
+
chainId: e,
|
|
10
|
+
nonce: o
|
|
11
|
+
}), T = async (e, r, o) => a.post(`${n}${t.ROUTES.removeTemporaryWalletNonce}`, {
|
|
12
|
+
hashedEthereumAddress: r,
|
|
13
|
+
chainId: e,
|
|
14
|
+
nonce: o
|
|
15
|
+
});
|
|
16
|
+
export {
|
|
17
|
+
y as addTemporaryWalletNonce,
|
|
18
|
+
s as getTemporaryWalletNonces,
|
|
19
|
+
T as removeTemporaryWalletNonce
|
|
20
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../constants/server.constants.cjs"),o=require("./getServerURL.cjs"),r=require("../data-structures/http/HttpClient.cjs"),U=t=>{const e=t.getBasicUtxoParams(),n=t.getCommitment(),i=t.getNullifier();return{...e,amount:e.amount.toString(),randomization:e.randomization?.toString(),commitment:n,nullifier:i}},a=t=>r.httpClient.post(`${o.RELAYER_URL}${s.RELAYER_CONFIG.storeUnspentUtxos}`,{hashedEthereumAddress:t.hashedEthereumAddress,chainId:t.chainId,utxos:t.utxos.map(e=>U(e))}),p=(t,e)=>r.httpClient.get(`${o.RELAYER_URL}${s.RELAYER_CONFIG.getUnspentUtxos(t,e)}`),c=(t,e,n)=>r.httpClient.delete(`${o.RELAYER_URL}${s.RELAYER_CONFIG.deleteUnspentUtxos}`,{data:{hashedEthereumAddress:e,nullifiers:n,chainId:t}});exports.deleteUnspentUtxos=c;exports.getUnspentUtxos=p;exports.storeUnspentUtxos=a;
|
|
@@ -11,7 +11,7 @@ interface StoreUnspentUtxosResponse {
|
|
|
11
11
|
export declare const storeUnspentUtxos: (body: StoreUnspentUtxosRequestBody) => Promise<StoreUnspentUtxosResponse>;
|
|
12
12
|
interface UnspentUtxo {
|
|
13
13
|
id: string;
|
|
14
|
-
utxo: IUtxoConstructor<string>;
|
|
14
|
+
utxo: Omit<IUtxoConstructor<string>, 'shieldedPrivateKey' | 'encryptionKey'>;
|
|
15
15
|
}
|
|
16
16
|
interface GetUnspentUtxosResponse {
|
|
17
17
|
status: string;
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import { RELAYER_CONFIG as
|
|
2
|
-
import { RELAYER_URL as
|
|
3
|
-
import { httpClient as
|
|
4
|
-
const
|
|
5
|
-
const e = t.
|
|
1
|
+
import { RELAYER_CONFIG as o } from "../constants/server.constants.mjs";
|
|
2
|
+
import { RELAYER_URL as s } from "./getServerURL.mjs";
|
|
3
|
+
import { httpClient as r } from "../data-structures/http/HttpClient.mjs";
|
|
4
|
+
const m = (t) => {
|
|
5
|
+
const e = t.getBasicUtxoParams(), n = t.getCommitment(), i = t.getNullifier();
|
|
6
6
|
return {
|
|
7
7
|
...e,
|
|
8
8
|
amount: e.amount.toString(),
|
|
9
|
-
randomization: e.randomization?.toString()
|
|
9
|
+
randomization: e.randomization?.toString(),
|
|
10
|
+
commitment: n,
|
|
11
|
+
nullifier: i
|
|
10
12
|
};
|
|
11
|
-
},
|
|
13
|
+
}, d = (t) => r.post(`${s}${o.storeUnspentUtxos}`, {
|
|
12
14
|
hashedEthereumAddress: t.hashedEthereumAddress,
|
|
13
15
|
chainId: t.chainId,
|
|
14
|
-
utxos: t.utxos.map((e) =>
|
|
15
|
-
}),
|
|
16
|
-
`${
|
|
17
|
-
), u = (t, e,
|
|
18
|
-
data: { hashedEthereumAddress: e, nullifiers:
|
|
16
|
+
utxos: t.utxos.map((e) => m(e))
|
|
17
|
+
}), c = (t, e) => r.get(
|
|
18
|
+
`${s}${o.getUnspentUtxos(t, e)}`
|
|
19
|
+
), u = (t, e, n) => r.delete(`${s}${o.deleteUnspentUtxos}`, {
|
|
20
|
+
data: { hashedEthereumAddress: e, nullifiers: n, chainId: t }
|
|
19
21
|
});
|
|
20
22
|
export {
|
|
21
23
|
u as deleteUnspentUtxos,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
c as getUnspentUtxos,
|
|
25
|
+
d as storeUnspentUtxos
|
|
24
26
|
};
|
package/README.md
CHANGED
|
@@ -10,6 +10,13 @@ With Hinkal SDK, developers can:
|
|
|
10
10
|
• Route transactions through Hinkal’s privacy contracts without exposing sender, recipient, or amounts
|
|
11
11
|
• Maintain non-custodial control with optional compliance visibility via viewing keys
|
|
12
12
|
|
|
13
|
+
## Compatibility
|
|
14
|
+
|
|
15
|
+
| Environment | Supported | Notes |
|
|
16
|
+
|-------------|-----------|-------|
|
|
17
|
+
| Node.js | ✅ | v18+ |
|
|
18
|
+
| Browser | ✅ | React, Next.js, vanilla JS |
|
|
19
|
+
|
|
13
20
|
## Installation
|
|
14
21
|
|
|
15
22
|
Using npm:
|
|
@@ -55,23 +62,22 @@ const hinkal = await prepareWagmiHinkal(connector, wagmiConfig, hinkalConfig);
|
|
|
55
62
|
The `hinkalConfig` is defined as follows:
|
|
56
63
|
```typescript
|
|
57
64
|
type HinkalConfig = {
|
|
65
|
+
/** Disables caching in browser localStorage, storing data only in memory. Front-end only. Defaults to false. */
|
|
66
|
+
disableCaching?: boolean;
|
|
67
|
+
|
|
68
|
+
/** If true, allows caching in a file locally. Node.js only. Defaults to false. */
|
|
69
|
+
useFileCache?: boolean;
|
|
70
|
+
|
|
58
71
|
/**
|
|
59
|
-
* Path to the cache file used for storing temporary data.
|
|
60
|
-
* It should be a valid file path string.
|
|
72
|
+
* Path to the cache file used for storing temporary data. Node.js only.
|
|
73
|
+
* It should be a valid file path string. Defaults to hinkalCache.json in the current working directory.
|
|
61
74
|
*/
|
|
62
75
|
cacheFilePath?: string;
|
|
76
|
+
|
|
63
77
|
/**
|
|
64
|
-
* Indicator
|
|
65
|
-
* Node only.
|
|
66
|
-
*/
|
|
67
|
-
useFileCache?: boolean;
|
|
68
|
-
disableCaching?: boolean;
|
|
69
|
-
serializedCache?: Record<string, string>;
|
|
70
|
-
/**
|
|
71
|
-
* Indicator controlling wether the proof should be constructed remotely in secure enclave.
|
|
78
|
+
* Indicator controlling wether the proof should be constructed remotely in secure enclave. Defaults to true.
|
|
72
79
|
*/
|
|
73
80
|
generateProofRemotely?: boolean;
|
|
74
|
-
disableMerkleTreeUpdates?: boolean;
|
|
75
81
|
};
|
|
76
82
|
```
|
|
77
83
|
|
|
@@ -162,7 +168,7 @@ A user can perform a private transfer between public addresses using:
|
|
|
162
168
|
```typescript
|
|
163
169
|
function depositAndWithdraw(
|
|
164
170
|
erc20Token: ERC20Token,
|
|
165
|
-
|
|
171
|
+
recipientAmounts: bigint[],
|
|
166
172
|
recipientAddresses: string[],
|
|
167
173
|
txCompletionTime?: number,
|
|
168
174
|
): Promise<RelayerTransaction>;
|
|
@@ -229,7 +235,7 @@ The SDK lets you interact with any smart contract on the blockchain while keepin
|
|
|
229
235
|
```typescript
|
|
230
236
|
function actionPrivateWallet(
|
|
231
237
|
chainId:number,
|
|
232
|
-
|
|
238
|
+
erc20Tokens: ERC20Token[],
|
|
233
239
|
deltaAmounts: bigint[],
|
|
234
240
|
onChainCreation: boolean[],
|
|
235
241
|
ops: string[],
|
|
@@ -331,6 +337,23 @@ function getSupportedPassportLinks(): string[];
|
|
|
331
337
|
|
|
332
338
|
After passing the compliance check with one of the supported providers, the access token will be automatically minted during the user's first transaction with Hinkal. This token is stored on-chain and grants the user permission to interact with Hinkal's privacy contracts.
|
|
333
339
|
|
|
340
|
+
## Supported Chains
|
|
341
|
+
|
|
342
|
+
Hinkal SDK is available on the following blockchain networks:
|
|
343
|
+
|
|
344
|
+
| Chain | Chain ID | Status |
|
|
345
|
+
|-------|----------|--------|
|
|
346
|
+
| Ethereum | 1 | ✅ Live |
|
|
347
|
+
| Polygon | 137 | ✅ Live |
|
|
348
|
+
| Base | 8453 | ✅ Live |
|
|
349
|
+
| Arbitrum | 42161 | ✅ Live |
|
|
350
|
+
| Optimism | 10 | ✅ Live |
|
|
351
|
+
| Solana | - | 🚧 In Progress |
|
|
352
|
+
|
|
353
|
+
Each chain supports the full suite of Hinkal privacy features including shielding, transfers, and confidential interactions with DeFi protocols.
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
|
|
334
357
|
## References
|
|
335
358
|
|
|
336
359
|
Wallet: [Hinkal Wallet](https://chromewebstore.google.com/detail/hinkal-wallet/khfjgapjfcdoffmklchibpepboholpbe)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./deploy-data/deploy-data-bnbMainnet.json.cjs"),d=require("./deploy-data/deploy-data-arbMainnet.json.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./deploy-data/deploy-data-bnbMainnet.json.cjs"),d=require("./deploy-data/deploy-data-arbMainnet.json.cjs"),m=require("./deploy-data/deploy-data-ethMainnet.json.cjs"),h=require("./deploy-data/deploy-data-optimism.json.cjs"),u=require("./deploy-data/deploy-data-polygon.json.cjs"),y=require("./deploy-data/deploy-data-avalanche.json.cjs"),b=require("./deploy-data/deploy-data-base.json.cjs"),f=require("./deploy-data/deploy-data-localhost.json.cjs"),A=require("./deploy-data/deploy-data-arcTestnet.json.cjs"),o=require("./deploy-data/deploy-data-solana.json.cjs"),s=require("./vite.constants.cjs"),t={polygon:137,arbMainnet:42161,ethMainnet:1,avalanche:43114,bnbMainnet:56,optimism:10,base:8453,localhost:31337,arcTestnet:5042002,solanaMainnet:501,solanaLocalnet:102},D="4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ",n=t.ethMainnet,r=e=>!![t.localhost].includes(e),g=e=>e?r(e)?n:e:n,i="X4IiEZsSzGOrJq8tzq7Y3",a=s.isNotProduction?i:"XzUgeU8YiIIzkD7j2GWnTsFUck7wGgK9",E="https://mainnet.helius-rpc.com/?api-key=24718f72-c710-45d6-853e-d447cf530579",c={[t.ethMainnet]:{name:"Ethereum",chainId:t.ethMainnet,rpcUrl:"https://rpc.ankr.com/eth",fetchRpcUrl:`https://eth-mainnet.g.alchemy.com/v2/${a}`,wsRpcUrl:`wss://eth-mainnet.g.alchemy.com/v2/${a}`,supported:!0,contractData:m.default,quoterV2Address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",uniswapV3FactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",priority:1,privateMempoolRpcUrl:"https://relay.flashbots.net",maxPageSize:9e5},[t.arbMainnet]:{name:"Arbitrum",chainId:t.arbMainnet,rpcUrl:"https://endpoints.omniatech.io/v1/arbitrum/one/public",fetchRpcUrl:`https://arb-mainnet.g.alchemy.com/v2/${a}`,wsRpcUrl:`wss://arb-mainnet.g.alchemy.com/v2/${a}`,supported:!0,contractData:d.default,quoterV2Address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",uniswapV3FactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",priority:2,maxPageSize:5e5},[t.optimism]:{name:"Optimism",chainId:t.optimism,rpcUrl:"https://optimism-mainnet.infura.io/v3/c26b99456bb6464bb498926ff5162903",fetchRpcUrl:`https://opt-mainnet.g.alchemy.com/v2/${a}`,wsRpcUrl:`wss://opt-mainnet.g.alchemy.com/v2/${a}`,supported:!0,contractData:h.default,quoterV2Address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",uniswapV3FactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",priority:3,maxPageSize:9e5},[t.polygon]:{name:"Polygon",chainId:t.polygon,rpcUrl:"https://polygon-rpc.com",fetchRpcUrl:`https://polygon-mainnet.g.alchemy.com/v2/${a}`,wsRpcUrl:`wss://polygon-mainnet.g.alchemy.com/v2/${a}`,supported:!0,contractData:u.default,quoterV2Address:"0x61fFE014bA17989E743c5F6cB21bF9697530B21e",uniswapV3FactoryAddress:"0x1F98431c8aD98523631AE4a59f267346ea31F984",priority:4,maxPageSize:9e5},[t.avalanche]:{name:"Avalanche",chainId:t.avalanche,rpcUrl:"https://api.avax.network/ext/bc/C/rpc",fetchRpcUrl:`https://avax-mainnet.g.alchemy.com/v2/${a}`,wsRpcUrl:`wss://avax-mainnet.g.alchemy.com/v2/${a}`,supported:!0,contractData:y.default,quoterV2Address:"0xbe0F5544EC67e9B3b2D979aaA43f18Fd87E6257F",uniswapV3FactoryAddress:"0x740b1c1de25031C31FF4fC9A62f554A55cdC1baD",priority:5},[t.bnbMainnet]:{name:"BNB Chain",chainId:t.bnbMainnet,rpcUrl:"https://bsc-dataseed.binance.org",fetchRpcUrl:`https://bnb-mainnet.g.alchemy.com/v2/${a}`,wsRpcUrl:`wss://bnb-mainnet.g.alchemy.com/v2/${a}`,supported:!0,contractData:l.default,quoterV2Address:"0x78D78E420Da98ad378D7799bE8f4AF69033EB077",uniswapV3FactoryAddress:"0xdB1d10011AD0Ff90774D0C6Bb92e5C5c8b4461F7",priority:6},[t.base]:{name:"Base",chainId:t.base,rpcUrl:"https://mainnet.base.org/",fetchRpcUrl:`https://base-mainnet.g.alchemy.com/v2/${a}`,wsRpcUrl:`wss://base-mainnet.g.alchemy.com/v2/${a}`,supported:!0,contractData:b.default,quoterV2Address:"0x3d4e44Eb1374240CE5F1B871ab261CD16335B76a",uniswapV3FactoryAddress:"0x33128a8fC17869897dcE68Ed026d694621f6FDfD",priority:7,maxPageSize:5e5},[t.arcTestnet]:{name:"Arc Testnet",chainId:t.arcTestnet,rpcUrl:`https://arc-testnet.g.alchemy.com/v2/${a}`,fetchRpcUrl:`https://arc-testnet.g.alchemy.com/v2/${a}`,wsRpcUrl:`wss://arc-testnet.g.alchemy.com/v2/${a}`,supported:!0,contractData:A.default,priority:8,maxPageSize:9999},[t.solanaMainnet]:{name:"Solana",chainId:t.solanaMainnet,rpcUrl:"https://api.mainnet-beta.solana.com",fetchRpcUrl:"https://mainnet.helius-rpc.com/?api-key=54ad9ec9-dad6-41de-b961-e3e8ea7a7188",supported:!0,contractData:o.default,priority:8},[t.solanaLocalnet]:{name:"Solana Localnet",chainId:t.solanaLocalnet,rpcUrl:"http://127.0.0.1:8899",fetchRpcUrl:"http://127.0.0.1:8899",supported:!0,contractData:o.default,priority:9},...s.isDevelopment?{}:{}},U={name:"Localhost",chainId:t.localhost,rpcUrl:"http://127.0.0.1:8545",fetchRpcUrl:"http://127.0.0.1:8545",supported:!0,contractData:f.default,quoterV2Address:c[n].quoterV2Address,uniswapV3FactoryAddress:c[n].uniswapV3FactoryAddress,priority:7};s.isDevelopment&&(c[t.localhost]=U);var p=(e=>(e.Mainnet="Mainnet",e.Testnet="Testnet",e.Local="Local",e))(p||{});const F={Mainnet:[t.polygon,t.arbMainnet,t.ethMainnet,t.bnbMainnet,t.optimism,t.avalanche,t.base],Testnet:[t.arcTestnet],Local:[t.localhost]},M=e=>[t.optimism,t.base].includes(e),v=e=>[t.solanaMainnet,t.solanaLocalnet].includes(e),w=[t.ethMainnet,t.optimism,t.base,t.polygon,t.arbMainnet,t.arcTestnet,t.solanaMainnet],R=[t.ethMainnet,t.optimism,t.base,t.polygon,t.arbMainnet];exports.ALCHEMY_API_KEY=a;exports.ALCHEMY_TEST_KEY=i;exports.BRIDGE_SUPPORTED_CHAINS=R;exports.EthereumNetworkType=p;exports.HELIUS_RPC_URL=E;exports.WALLET_SUPPORTED_CHAINS=w;exports.chainIds=t;exports.chainIdsByType=F;exports.getNonLocalhostChainId=g;exports.isLocalNetwork=r;exports.isOptimismLike=M;exports.isSolanaLike=v;exports.localhostNetwork=n;exports.networkRegistry=c;exports.solanaChainIdStr=D;
|
|
@@ -32,5 +32,5 @@ export declare const chainIdsByType: {
|
|
|
32
32
|
};
|
|
33
33
|
export declare const isOptimismLike: (chainId: number) => boolean;
|
|
34
34
|
export declare const isSolanaLike: (chainId: number) => boolean;
|
|
35
|
-
export declare const WALLET_INITIAL_CHAIN_ID: number;
|
|
36
35
|
export declare const WALLET_SUPPORTED_CHAINS: number[];
|
|
36
|
+
export declare const BRIDGE_SUPPORTED_CHAINS: number[];
|