@hinkal/common 0.2.22 → 0.2.23
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/proxyAccountsCalls.cjs +1 -1
- package/API/proxyAccountsCalls.mjs +13 -13
- package/README.md +63 -267
- package/constants/activity.constants.cjs +1 -1
- package/constants/activity.constants.mjs +0 -1
- package/constants/addresses.constants.cjs +1 -1
- package/constants/addresses.constants.mjs +9 -10
- package/constants/contracts.constants.cjs +1 -1
- package/constants/contracts.constants.d.ts +3 -3
- package/constants/contracts.constants.mjs +29 -29
- package/constants/server.constants.cjs +1 -1
- package/constants/server.constants.mjs +28 -29
- package/constants/tasks.constants.cjs +1 -1
- package/constants/tasks.constants.mjs +4 -5
- package/crypto/poseidon.cjs +1 -1
- package/crypto/poseidon.mjs +10 -10
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.cjs +1 -1
- package/data-structures/ApprovalDBs/EventsPublicApprovalsDB.mjs +24 -24
- package/data-structures/Hinkal/Hinkal.cjs +1 -1
- package/data-structures/Hinkal/Hinkal.mjs +4 -5
- package/data-structures/Hinkal/IHinkal.d.ts +2 -2
- package/data-structures/Hinkal/hinkalApprove.cjs +1 -1
- package/data-structures/Hinkal/hinkalApprove.mjs +40 -40
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.cjs +1 -1
- package/data-structures/Hinkal/hinkalCheckTokenRegistry.mjs +7 -8
- package/data-structures/Hinkal/hinkalDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalDeposit.mjs +4 -5
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositAndWithdraw.mjs +2 -3
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepositOnChainUtxos.mjs +18 -19
- package/data-structures/Hinkal/hinkalDepostAndBridge.cjs +1 -1
- package/data-structures/Hinkal/hinkalDepostAndBridge.mjs +3 -4
- package/data-structures/Hinkal/hinkalInsideTransact.cjs +1 -1
- package/data-structures/Hinkal/hinkalInsideTransact.mjs +14 -13
- package/data-structures/Hinkal/hinkalPrivateWallet.cjs +1 -1
- package/data-structures/Hinkal/hinkalPrivateWallet.mjs +2 -3
- package/data-structures/Hinkal/hinkalProoflessDeposit.cjs +1 -1
- package/data-structures/Hinkal/hinkalProoflessDeposit.mjs +27 -26
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaDepositAndWithdraw.mjs +38 -39
- package/data-structures/Hinkal/hinkalSolanaSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaSwap.mjs +16 -17
- package/data-structures/Hinkal/hinkalSolanaTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaTransfer.mjs +24 -25
- package/data-structures/Hinkal/hinkalSolanaWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalSolanaWithdraw.mjs +15 -16
- package/data-structures/Hinkal/hinkalSwap.cjs +1 -1
- package/data-structures/Hinkal/hinkalSwap.mjs +2 -3
- package/data-structures/Hinkal/hinkalTransfer.cjs +1 -1
- package/data-structures/Hinkal/hinkalTransfer.mjs +2 -3
- package/data-structures/Hinkal/hinkalWithdraw.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdraw.mjs +9 -10
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.cjs +1 -1
- package/data-structures/Hinkal/hinkalWithdrawStuckUtxos.mjs +8 -9
- package/data-structures/Hinkal/resetMerkleTrees.cjs +1 -1
- package/data-structures/Hinkal/resetMerkleTrees.mjs +10 -10
- package/data-structures/IndexedDB/activity-db.cjs +1 -1
- package/data-structures/IndexedDB/activity-db.mjs +39 -41
- package/data-structures/IndexedDB/balances-db.cjs +1 -1
- package/data-structures/IndexedDB/balances-db.mjs +8 -9
- package/data-structures/IndexedDB/contact-db.cjs +1 -1
- package/data-structures/IndexedDB/contact-db.mjs +21 -23
- package/data-structures/IndexedDB/signatures-db.cjs +1 -1
- package/data-structures/IndexedDB/signatures-db.mjs +2 -3
- package/data-structures/TokenDBs/EventsPublicTokensDB.cjs +1 -1
- package/data-structures/TokenDBs/EventsPublicTokensDB.mjs +34 -36
- package/data-structures/crypto-keys/decodeUTXO.cjs +1 -1
- package/data-structures/crypto-keys/decodeUTXO.mjs +45 -45
- package/data-structures/crypto-keys/encryptDecryptUtxo.cjs +1 -1
- package/data-structures/crypto-keys/encryptDecryptUtxo.mjs +28 -27
- package/data-structures/crypto-keys/keys.cjs +1 -1
- package/data-structures/crypto-keys/keys.d.ts +2 -3
- package/data-structures/crypto-keys/keys.mjs +56 -57
- package/data-structures/event-service/evm/AbstractEventService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractEventService.mjs +14 -14
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.d.ts +2 -3
- package/data-structures/event-service/evm/AbstractNullifierSnapshotService.mjs +5 -4
- package/data-structures/event-service/evm/AbstractSnapshotService.cjs +1 -1
- package/data-structures/event-service/evm/AbstractSnapshotService.mjs +6 -3
- package/data-structures/event-service/evm/BlockchainEventEmitter.cjs +1 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.d.ts +1 -1
- package/data-structures/event-service/evm/BlockchainEventEmitter.mjs +22 -18
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.cjs +1 -1
- package/data-structures/event-service/solana/AbstractSolanaNullifierSnapshotService.mjs +2 -2
- package/data-structures/presale/PresaleContractWrapper.cjs +1 -1
- package/data-structures/presale/PresaleContractWrapper.d.ts +3 -3
- package/data-structures/presale/PresaleContractWrapper.mjs +10 -10
- package/data-structures/provider-adapter/IProviderAdapter.d.ts +7 -7
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientAccessTokenSnapshotService.mjs +16 -14
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.cjs +1 -1
- package/data-structures/snapshot/evm-snapshots/ClientApprovalsSnapshotService.mjs +7 -5
- package/error-handling/get-error.message.cjs +1 -1
- package/error-handling/get-error.message.mjs +2 -3
- package/functions/kyc/zkMeHelper.cjs +1 -1
- package/functions/kyc/zkMeHelper.mjs +3 -3
- package/functions/pre-transaction/getFlatFees.cjs +1 -1
- package/functions/pre-transaction/getFlatFees.mjs +2 -3
- package/functions/pre-transaction/getSolanaCalldataHash.cjs +1 -1
- package/functions/pre-transaction/getSolanaCalldataHash.mjs +21 -21
- package/functions/pre-transaction/getVolatileTransferAmount.cjs +1 -1
- package/functions/pre-transaction/getVolatileTransferAmount.mjs +2 -3
- package/functions/pre-transaction/interaction-to-action.cjs +1 -1
- package/functions/pre-transaction/interaction-to-action.mjs +2 -3
- package/functions/private-wallet/emporium.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.helpers.d.ts +6 -7
- package/functions/private-wallet/emporium.helpers.mjs +104 -105
- package/functions/private-wallet/emporium.swap.helpers.cjs +1 -1
- package/functions/private-wallet/emporium.swap.helpers.mjs +44 -43
- package/functions/private-wallet/opProducer.cjs +1 -1
- package/functions/private-wallet/opProducer.mjs +1 -1
- package/functions/snarkjs/common.snarkjs.cjs +1 -1
- package/functions/snarkjs/common.snarkjs.mjs +21 -18
- package/functions/snarkjs/constructSolanaZkProof.cjs +1 -1
- package/functions/snarkjs/constructSolanaZkProof.mjs +11 -12
- package/functions/utils/addresses.cjs +1 -1
- package/functions/utils/addresses.mjs +6 -6
- package/functions/utils/cacheFunctions.cjs +1 -1
- package/functions/utils/cacheFunctions.d.ts +1 -1
- package/functions/utils/cacheFunctions.mjs +55 -54
- package/functions/utils/convertEmporiumOpToCallInfo.cjs +1 -1
- package/functions/utils/convertEmporiumOpToCallInfo.mjs +5 -5
- package/functions/utils/create-provider.cjs +1 -1
- package/functions/utils/create-provider.d.ts +2 -2
- package/functions/utils/create-provider.mjs +5 -5
- package/functions/utils/encryptInputForEnclave.cjs +1 -1
- package/functions/utils/encryptInputForEnclave.mjs +9 -9
- package/functions/utils/ethers-formatter.utils.d.ts +1 -1
- package/functions/utils/external-action.utils.cjs +1 -1
- package/functions/utils/external-action.utils.mjs +2 -2
- package/functions/utils/getContractAddress.cjs +1 -0
- package/functions/utils/getContractAddress.d.ts +2 -0
- package/functions/utils/getContractAddress.mjs +9 -0
- package/functions/utils/getDataFromTransaction.cjs +1 -1
- package/functions/utils/getDataFromTransaction.d.ts +0 -11
- package/functions/utils/getDataFromTransaction.mjs +26 -50
- package/functions/utils/getRecipientInfoFromUserKeys.cjs +1 -1
- package/functions/utils/getRecipientInfoFromUserKeys.mjs +1 -1
- package/functions/utils/getSignerFromContract.cjs +1 -0
- package/functions/utils/getSignerFromContract.d.ts +3 -0
- package/functions/utils/getSignerFromContract.mjs +16 -0
- package/functions/utils/getUtxosFromReceipt.utils.cjs +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.d.ts +1 -1
- package/functions/utils/getUtxosFromReceipt.utils.mjs +15 -16
- package/functions/utils/inLogicMetadata.cjs +1 -1
- package/functions/utils/inLogicMetadata.mjs +2 -2
- package/functions/utils/nftTokenFunctions.cjs +1 -1
- package/functions/utils/nftTokenFunctions.mjs +2 -3
- package/functions/utils/publicBalance.utils.cjs +1 -1
- package/functions/utils/publicBalance.utils.d.ts +1 -1
- package/functions/utils/publicBalance.utils.mjs +42 -42
- package/functions/utils/rpc-int-encode.cjs +1 -1
- package/functions/utils/rpc-int-encode.d.ts +1 -2
- package/functions/utils/rpc-int-encode.mjs +3 -6
- package/functions/utils/solanaMint.utils.cjs +1 -1
- package/functions/utils/solanaMint.utils.mjs +6 -6
- package/functions/web3/EIP-712.cjs +1 -1
- package/functions/web3/EIP-712.d.ts +4 -4
- package/functions/web3/EIP-712.mjs +1 -1
- package/functions/web3/etherFunctions.cjs +1 -1
- package/functions/web3/etherFunctions.mjs +32 -29
- package/functions/web3/events/balanceChangedCustomHandler.cjs +1 -1
- package/functions/web3/events/balanceChangedCustomHandler.mjs +4 -5
- package/functions/web3/events/balanceChangedHandler.cjs +1 -1
- package/functions/web3/events/balanceChangedHandler.mjs +2 -3
- package/functions/web3/events/getApprovedBalance.cjs +1 -1
- package/functions/web3/events/getApprovedBalance.mjs +1 -1
- package/functions/web3/events/getInputUtxosEnclave.cjs +1 -1
- package/functions/web3/events/getInputUtxosEnclave.mjs +20 -20
- package/functions/web3/events/getTransactionLogEvents.cjs +1 -1
- package/functions/web3/events/getTransactionLogEvents.d.ts +3 -3
- package/functions/web3/events/getTransactionLogEvents.mjs +6 -5
- package/functions/web3/events/index.d.ts +0 -1
- package/functions/web3/fetchSolanaMerkleTreeRootHash.cjs +1 -1
- package/functions/web3/fetchSolanaMerkleTreeRootHash.d.ts +1 -2
- package/functions/web3/fetchSolanaMerkleTreeRootHash.mjs +4 -5
- package/functions/web3/functionCalls/accessTokenCalls.cjs +1 -1
- package/functions/web3/functionCalls/accessTokenCalls.mjs +10 -11
- package/functions/web3/functionCalls/approveToken.cjs +1 -1
- package/functions/web3/functionCalls/approveToken.mjs +61 -58
- package/functions/web3/functionCalls/constructBatchCall.cjs +1 -1
- package/functions/web3/functionCalls/constructBatchCall.d.ts +2 -2
- package/functions/web3/functionCalls/constructBatchCall.mjs +10 -9
- package/functions/web3/functionCalls/estimateGasRelayer.cjs +1 -1
- package/functions/web3/functionCalls/estimateGasRelayer.mjs +1 -1
- package/functions/web3/functionCalls/inHinkalApprovalCalls.cjs +1 -1
- package/functions/web3/functionCalls/inHinkalApprovalCalls.mjs +18 -21
- package/functions/web3/functionCalls/recoverTransactionFromError.d.ts +1 -1
- package/functions/web3/functionCalls/transactCallDirect.cjs +1 -1
- package/functions/web3/functionCalls/transactCallDirect.mjs +38 -34
- package/functions/web3/functionCalls/transactCallRelayer.cjs +1 -1
- package/functions/web3/functionCalls/transactCallRelayer.mjs +8 -10
- package/functions/web3/getContractMetadata.cjs +1 -1
- package/functions/web3/getContractMetadata.d.ts +1 -1
- package/functions/web3/getContractMetadata.mjs +25 -25
- package/functions/web3/getPublicAddressBalance.cjs +1 -1
- package/functions/web3/getPublicAddressBalance.mjs +7 -6
- package/functions/web3/getTokenHolder.cjs +1 -1
- package/functions/web3/getTokenHolder.mjs +16 -15
- package/functions/web3/odosAPI.cjs +1 -1
- package/functions/web3/odosAPI.mjs +6 -7
- package/functions/web3/oneInchAPI.cjs +1 -1
- package/functions/web3/oneInchAPI.mjs +2 -3
- package/functions/web3/runContractFunction.cjs +1 -1
- package/functions/web3/runContractFunction.d.ts +6 -5
- package/functions/web3/runContractFunction.mjs +41 -45
- package/functions/web3/uniswapAPI.cjs +1 -1
- package/functions/web3/uniswapAPI.d.ts +2 -2
- package/functions/web3/uniswapAPI.mjs +23 -24
- package/index.cjs +1 -1
- package/index.mjs +336 -340
- package/package.json +3 -4
- package/providers/CustomEthersProvider.d.ts +1 -1
- package/providers/EthersProviderAdapter.cjs +1 -1
- package/providers/EthersProviderAdapter.d.ts +7 -7
- package/providers/EthersProviderAdapter.mjs +46 -44
- package/providers/SolanaProviderAdapter.d.ts +1 -1
- package/providers/WagmiProviderAdapter.cjs +1 -1
- package/providers/WagmiProviderAdapter.d.ts +5 -5
- package/providers/WagmiProviderAdapter.mjs +37 -33
- package/providers/prepareEthersHinkal.cjs +1 -1
- package/providers/prepareEthersHinkal.d.ts +2 -2
- package/providers/prepareEthersHinkal.mjs +3 -5
- package/providers/prepareWagmiHinkal.cjs +1 -1
- package/providers/prepareWagmiHinkal.mjs +3 -5
- package/types/activities.types.d.ts +2 -3
- package/types/big-intable.types.d.ts +3 -2
- package/types/ethereum-network.types.d.ts +10 -10
- package/types/transactions.types.cjs +1 -1
- package/types/transactions.types.d.ts +2 -3
- package/types/transactions.types.mjs +6 -7
- package/webworker/utxoWorker/utxoWorkerLauncher.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLauncher.mjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLogic.cjs +1 -1
- package/webworker/utxoWorker/utxoWorkerLogic.mjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.cjs +1 -1
- package/webworker/zkProofWorker/zkProofWorkerLauncher.mjs +1 -1
- package/functions/web3/events/web3RetrieveEvents.cjs +0 -1
- package/functions/web3/events/web3RetrieveEvents.d.ts +0 -14
- package/functions/web3/events/web3RetrieveEvents.mjs +0 -9
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IntegrationProvider } from './hinkal.types';
|
|
2
2
|
import { ERC20Token } from './token.types';
|
|
3
|
-
import { BigNumber } from 'ethers';
|
|
4
3
|
export declare enum ActivityStatus {
|
|
5
4
|
PENDING = "PENDING",
|
|
6
5
|
SUCCESSFUL = "SUCCESSFUL",
|
|
@@ -51,8 +50,8 @@ export interface ActivityAddRequest {
|
|
|
51
50
|
value?: string;
|
|
52
51
|
status?: ActivityStatus;
|
|
53
52
|
txHash?: string;
|
|
54
|
-
gas?:
|
|
55
|
-
gasPrice?:
|
|
53
|
+
gas?: bigint;
|
|
54
|
+
gasPrice?: bigint;
|
|
56
55
|
gasInDollar?: string;
|
|
57
56
|
tokensReceive?: TokenAmountInfo[];
|
|
58
57
|
tokensSpend?: TokenAmountInfo[];
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export type BigIntable = string | number | boolean | bigint | {
|
|
2
|
+
toBigInt: () => bigint;
|
|
3
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { InterfaceAbi } from 'ethers';
|
|
2
2
|
import type { Idl } from '@coral-xyz/anchor';
|
|
3
3
|
export type ContractMetadata = {
|
|
4
|
-
abi?:
|
|
4
|
+
abi?: InterfaceAbi;
|
|
5
5
|
address?: string;
|
|
6
6
|
};
|
|
7
7
|
export declare enum ContractType {
|
|
@@ -26,27 +26,27 @@ export declare enum ContractType {
|
|
|
26
26
|
}
|
|
27
27
|
export interface ContractData {
|
|
28
28
|
hinkalAddress: string;
|
|
29
|
-
hinkalABI?:
|
|
29
|
+
hinkalABI?: InterfaceAbi;
|
|
30
30
|
hinkalIdl?: Idl;
|
|
31
31
|
hinkalHelperAddress?: string;
|
|
32
|
-
hinkalHelperABI?:
|
|
32
|
+
hinkalHelperABI?: InterfaceAbi;
|
|
33
33
|
accessTokenAddress?: string;
|
|
34
|
-
accessTokenABI?:
|
|
34
|
+
accessTokenABI?: InterfaceAbi;
|
|
35
35
|
permitterAddress?: string;
|
|
36
|
-
permitterABI?:
|
|
36
|
+
permitterABI?: InterfaceAbi;
|
|
37
37
|
uniswapExternalActionAddress?: string;
|
|
38
38
|
odosExternalActionInstanceAddress?: string;
|
|
39
39
|
oneInchExternalActionInstanceAddress?: string;
|
|
40
|
-
waTokenABI?:
|
|
40
|
+
waTokenABI?: InterfaceAbi;
|
|
41
41
|
hinkalWrapperAddress?: string;
|
|
42
42
|
hinkalWrapper2Address?: string;
|
|
43
|
-
hinkalWrapperABI?:
|
|
44
|
-
HinkalWrapper2ABI?:
|
|
43
|
+
hinkalWrapperABI?: InterfaceAbi;
|
|
44
|
+
HinkalWrapper2ABI?: InterfaceAbi;
|
|
45
45
|
emporiumAddress?: string;
|
|
46
46
|
hinkalWalletAddress?: string;
|
|
47
47
|
originalDeployer?: string;
|
|
48
48
|
depositOnChainUtxosExternalActionAddress?: string;
|
|
49
|
-
depositOnChainUtxosExternalActionABI?:
|
|
49
|
+
depositOnChainUtxosExternalActionABI?: InterfaceAbi;
|
|
50
50
|
}
|
|
51
51
|
export interface EthereumNetwork {
|
|
52
52
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=0n,p={blockNumber:0,timeStamp:0,methodId:"",input:"",decodedInput:{erc20TokenAddresses:[],amountChanges:[],flatFees:[0n,0n],externalActionId:r,externalActionMetadata:"",encryptedOutputs:[],hookData:{hookContract:"",preHookContract:"",preHookMetadata:"",postHookMetadata:""},stealthAddressStructure:{extraRandomization:0n,stealthAddress:0n,H0:0n,H1:0n}},logs:[],hash:"",gas:0,gasPrice:0,isError:"",status:""};var d=(e=>(e[e.NotStarted=0]="NotStarted",e[e.Loading=1]="Loading",e[e.Confirmed=2]="Confirmed",e[e.Failed=3]="Failed",e))(d||{}),l=(e=>(e[e.None=0]="None",e[e.Deposit=1]="Deposit",e[e.Mint=2]="Mint",e[e.PoolAdd=3]="PoolAdd",e[e.PoolRemove=4]="PoolRemove",e[e.Redeem=5]="Redeem",e[e.Swap=6]="Swap",e[e.Bridge=7]="Bridge",e[e.Transfer=8]="Transfer",e[e.Withdraw=9]="Withdraw",e[e.Send=10]="Send",e[e.Fund=11]="Fund",e[e.Receive=12]="Receive",e))(l||{}),m=(e=>(e[e.Failed=0]="Failed",e[e.Succeeded=1]="Succeeded",e))(m||{});exports.TransactionAction=l;exports.TransactionReceiptStatus=m;exports.TransactionStatus=d;exports.emptyDecodedTx=p;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BigNumber } from 'ethers';
|
|
2
1
|
import { HookDataType, StealthAddressStructure } from './circom-data.types';
|
|
3
2
|
export interface RawTx {
|
|
4
3
|
blockNumber: number;
|
|
@@ -29,7 +28,7 @@ export interface EventLog {
|
|
|
29
28
|
transactionHash: string;
|
|
30
29
|
transactionIndex: string;
|
|
31
30
|
}
|
|
32
|
-
export interface DecodedTx<T = bigint, K =
|
|
31
|
+
export interface DecodedTx<T = bigint, K = bigint> extends RawTx {
|
|
33
32
|
decodedInput: {
|
|
34
33
|
erc20TokenAddresses: string[];
|
|
35
34
|
amountChanges: K[];
|
|
@@ -42,7 +41,7 @@ export interface DecodedTx<T = bigint, K = BigNumber> extends RawTx {
|
|
|
42
41
|
};
|
|
43
42
|
status: string;
|
|
44
43
|
}
|
|
45
|
-
export interface DecodedTxWithUtxos<T = bigint, K =
|
|
44
|
+
export interface DecodedTxWithUtxos<T = bigint, K = bigint> extends DecodedTx<T, K> {
|
|
46
45
|
utxosArray?: OnChainUtxo<T>[];
|
|
47
46
|
}
|
|
48
47
|
export type OnChainUtxo<AmountType = bigint> = {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const m = d.from(0), h = {
|
|
1
|
+
const d = 0n, h = {
|
|
3
2
|
blockNumber: 0,
|
|
4
3
|
timeStamp: 0,
|
|
5
4
|
methodId: "",
|
|
@@ -7,8 +6,8 @@ const m = d.from(0), h = {
|
|
|
7
6
|
decodedInput: {
|
|
8
7
|
erc20TokenAddresses: [],
|
|
9
8
|
amountChanges: [],
|
|
10
|
-
flatFees: [0n, 0n]
|
|
11
|
-
externalActionId:
|
|
9
|
+
flatFees: [0n, 0n],
|
|
10
|
+
externalActionId: d,
|
|
12
11
|
externalActionMetadata: "",
|
|
13
12
|
encryptedOutputs: [],
|
|
14
13
|
hookData: {
|
|
@@ -31,10 +30,10 @@ const m = d.from(0), h = {
|
|
|
31
30
|
isError: "",
|
|
32
31
|
status: ""
|
|
33
32
|
};
|
|
34
|
-
var l = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.Loading = 1] = "Loading", e[e.Confirmed = 2] = "Confirmed", e[e.Failed = 3] = "Failed", e))(l || {}),
|
|
33
|
+
var l = /* @__PURE__ */ ((e) => (e[e.NotStarted = 0] = "NotStarted", e[e.Loading = 1] = "Loading", e[e.Confirmed = 2] = "Confirmed", e[e.Failed = 3] = "Failed", e))(l || {}), m = /* @__PURE__ */ ((e) => (e[e.None = 0] = "None", e[e.Deposit = 1] = "Deposit", e[e.Mint = 2] = "Mint", e[e.PoolAdd = 3] = "PoolAdd", e[e.PoolRemove = 4] = "PoolRemove", e[e.Redeem = 5] = "Redeem", e[e.Swap = 6] = "Swap", e[e.Bridge = 7] = "Bridge", e[e.Transfer = 8] = "Transfer", e[e.Withdraw = 9] = "Withdraw", e[e.Send = 10] = "Send", e[e.Fund = 11] = "Fund", e[e.Receive = 12] = "Receive", e))(m || {}), p = /* @__PURE__ */ ((e) => (e[e.Failed = 0] = "Failed", e[e.Succeeded = 1] = "Succeeded", e))(p || {});
|
|
35
34
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
m as TransactionAction,
|
|
36
|
+
p as TransactionReceiptStatus,
|
|
38
37
|
l as TransactionStatus,
|
|
39
38
|
h as emptyDecodedTx
|
|
40
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/utxoWorkerLauncher-
|
|
1
|
+
"use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/utxoWorkerLauncher-DIu_LMBb.js").href:new URL("../../assets/utxoWorkerLauncher-DIu_LMBb.js",document.currentScript&&document.currentScript.src||document.baseURI).href);module.exports=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("../../crypto/preProcessing.cjs"),l=require("../../data-structures/crypto-keys/keys.cjs"),f=require("../../data-structures/utxo/Utxo.cjs"),h=require("../../data-structures/crypto-keys/encryptDecryptUtxo.cjs"),y=require("../../data-structures/crypto-keys/decodeUTXO.cjs"),T=require("../../error-handling/logger.cjs"),w=require("../workerProxy.cjs"),d=require("./utxoWorker.types.cjs"),n=new w.WorkerProxy,p=async({data:e})=>{const{utxos:t,nullifiers:s}=e,i=t.filter(r=>{const c=new f.Utxo(r);return!s.has(c.getNullifier())});n.postMessageToMainThread({utxoConstructors:i,stealthPairCache:l.stealthPairCacheDevice.serialize(),stealthAddressCache:l.stealthAddressCacheDevice.serialize()})},g=async({data:e})=>{const t=new l.UserKeys(e.signature),s=t.getShieldedPrivateKey(),i=e.encryptedOutputs.map(r=>{try{const c=r.isPositive?h.decryptUtxoConstructorArgs(Buffer.from(r.value.slice(2),"hex"),t):y.decodeUtxoConstructorArgs(r.value,s,e.chainId);return c.isBlocked=r.isBlocked,c}catch{return}}).filter(r=>r!==void 0&&r.amount!==0n);n.postMessageToMainThread(i)},x=async({data:e})=>{const t=new l.UserKeys(e.signature),s=[],{encryptedOutputs:i}=e;let{lastOutput:r}=e;const c=t.getShieldedPrivateKey();for(let u=0;u<i.length;u+=1){const a=i[u];if(r=a.value,a.isPositive)try{const o=h.decryptUtxo(Buffer.from(r.slice(2),"hex"),t);if(o.isBlocked=a.isBlocked,!o.erc20TokenAddress||!o.amount||!o.stealthAddress)throw Error("bruh");s.push(a)}catch{}else try{y.checkUtxoSignature(r,c,e.chainId)&&s.push(a)}catch{}}n.postMessageToMainThread({additionalEncryptedOutputs:s,lastOutput:r})},U=async e=>{try{await k.preProcessing();const{type:t}=e.payload;switch(t){case d.UtxoWorkerActionType.BATCH_FILTER_UTXOS_WITH_NULLIFIER:await p(e.payload);return;case d.UtxoWorkerActionType.BUILD_UTXOS:await g(e.payload);return;case d.UtxoWorkerActionType.DECIPHER_OUTPUTS:await x(e.payload);return;default:throw Error(`Unknown worker message type ${t}`)}}catch(t){T.Logger.error("utxo worker message failed",t),n.postErrorToMainThread(t)}};n.attachWorkerSideOnMessage(U);exports.default=n;exports.handleBuildUtxosMessage=g;exports.handleDecipherMessage=x;exports.handleFilterUtxosWithNullifier=p;exports.onWorkerMessage=U;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("../../crypto/preProcessing.cjs"),l=require("../../data-structures/crypto-keys/keys.cjs"),f=require("../../data-structures/utxo/Utxo.cjs"),h=require("../../data-structures/crypto-keys/encryptDecryptUtxo.cjs"),y=require("../../data-structures/crypto-keys/decodeUTXO.cjs"),T=require("../../error-handling/logger.cjs"),w=require("../workerProxy.cjs"),d=require("./utxoWorker.types.cjs"),n=new w.WorkerProxy,p=async({data:e})=>{const{utxos:t,nullifiers:s}=e,i=t.filter(r=>{const c=new f.Utxo(r);return!s.has(c.getNullifier())});n.postMessageToMainThread({utxoConstructors:i,stealthPairCache:l.stealthPairCacheDevice.serialize(),stealthAddressCache:l.stealthAddressCacheDevice.serialize()})},g=async({data:e})=>{const t=new l.UserKeys(e.signature),s=t.getShieldedPrivateKey(),i=e.encryptedOutputs.map(r=>{try{const c=r.isPositive?h.decryptUtxoConstructorArgs(Buffer.from(r.value.slice(2),"hex"),t):y.decodeUtxoConstructorArgs(r.value,s,e.chainId);return c.isBlocked=r.isBlocked,c}catch{return}}).filter(r=>r!==void 0&&r.amount!==0n);n.postMessageToMainThread(i)},x=async({data:e})=>{const t=new l.UserKeys(e.signature),s=[],{encryptedOutputs:i}=e;let{lastOutput:r}=e;const c=t.getShieldedPrivateKey();for(let u=0;u<i.length;u+=1){const a=i[u];if(r=a.value,a.isPositive)try{const o=h.decryptUtxo(Buffer.from(r.slice(2),"hex"),t);if(o.isBlocked=a.isBlocked,!o.erc20TokenAddress||!o.amount||!o.stealthAddress)throw Error("bruh");s.push(a)}catch{}else try{y.checkUtxoSignature(r,c,e.chainId)&&s.push(a)}catch{}}n.postMessageToMainThread({additionalEncryptedOutputs:s,lastOutput:r})},U=async e=>{try{await k.preProcessing();const{type:t}=e.payload;switch(t){case d.UtxoWorkerActionType.BATCH_FILTER_UTXOS_WITH_NULLIFIER:await p(e.payload);return;case d.UtxoWorkerActionType.BUILD_UTXOS:await g(e.payload);return;case d.UtxoWorkerActionType.DECIPHER_OUTPUTS:await x(e.payload);return;default:throw Error(`Unknown worker message type ${t}`)}}catch(t){T.Logger.error("utxo worker message failed",t,e),n.postErrorToMainThread(t)}};n.attachWorkerSideOnMessage(U);exports.default=n;exports.handleBuildUtxosMessage=g;exports.handleDecipherMessage=x;exports.handleFilterUtxosWithNullifier=p;exports.onWorkerMessage=U;
|
|
@@ -65,7 +65,7 @@ const n = new k(), w = async ({ data: e }) => {
|
|
|
65
65
|
throw Error(`Unknown worker message type ${t}`);
|
|
66
66
|
}
|
|
67
67
|
} catch (t) {
|
|
68
|
-
T.error("utxo worker message failed", t), n.postErrorToMainThread(t);
|
|
68
|
+
T.error("utxo worker message failed", t, e), n.postErrorToMainThread(t);
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
n.attachWorkerSideOnMessage(M);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/zkProofWorkerLauncher-
|
|
1
|
+
"use strict";const e=""+(typeof document>"u"?require("url").pathToFileURL(__dirname+"/../../assets/zkProofWorkerLauncher-EF0nGZ3A.js").href:new URL("../../assets/zkProofWorkerLauncher-EF0nGZ3A.js",document.currentScript&&document.currentScript.src||document.baseURI).href);module.exports=e;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=async(e,s,...r)=>{if(!e.filters?.[s])throw new Error("Contract Event not found");return await e.queryFilter(e.filters?.[s](...r),39561411)},o=async(e,s)=>(await n(e,"NewTransaction")).map(t=>t.args[1]===s&&BigInt(t.args[2])>=0n?new Date(t.args[0]*1e3):new Date(0)).filter(t=>t.getTime()!==0);exports.getDepositEvents=o;exports.retrieveEvents=n;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Contract, ethers } from 'ethers';
|
|
2
|
-
/**
|
|
3
|
-
* to get contract events
|
|
4
|
-
* @param eventName to retrieve specific events
|
|
5
|
-
* @param eventArgs event arguments
|
|
6
|
-
* @returns array of the specific events
|
|
7
|
-
*/
|
|
8
|
-
export declare const retrieveEvents: (hinkalContract: ethers.Contract, eventName: string, ...eventArgs: unknown[]) => Promise<ethers.Event[]>;
|
|
9
|
-
/**
|
|
10
|
-
*
|
|
11
|
-
* @param web3Provider instance to get hinkal contract
|
|
12
|
-
* @returns array of deposit timestamps in JS new Date format
|
|
13
|
-
*/
|
|
14
|
-
export declare const getDepositEvents: (hinkalContract: Contract, erc20TokenAddress: string) => Promise<Date[]>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
const i = async (e, s, ...n) => {
|
|
2
|
-
if (!e.filters?.[s])
|
|
3
|
-
throw new Error("Contract Event not found");
|
|
4
|
-
return await e.queryFilter(e.filters?.[s](...n), 39561411);
|
|
5
|
-
}, o = async (e, s) => (await i(e, "NewTransaction")).map((t) => t.args[1] === s && BigInt(t.args[2]) >= 0n ? new Date(t.args[0] * 1e3) : /* @__PURE__ */ new Date(0)).filter((t) => t.getTime() !== 0);
|
|
6
|
-
export {
|
|
7
|
-
o as getDepositEvents,
|
|
8
|
-
i as retrieveEvents
|
|
9
|
-
};
|