import { MerkleTreeJson } from '../data-structures/merkle-tree/MerkleTree';
import { TokenAmountInfo } from './activities.types';
import { EncryptedOutputWithSign } from './commitments.types';
import { ExternalActionId } from './external-action.types';
import { FeeStructure, IntegrationProvider } from './hinkal.types';
import { SubAccount } from './proxy.types';
import { ERC20Token, TokenChanges } from './token.types';
import { AppMetaData, WCTransactionParameters } from './wc.types';
import { WithId } from './with-id.types';
import { AdminTransactionType } from './admin.types';
export declare enum TransactionRequestType {
    ReceiveFromShieldedAccount = "ReceiveFromShieldedAccount",
    SwapTokens = "SwapTokens",
    PrivateTransactionFromProxy = "PrivateTransactionFromProxy",
    ProxySend = "ProxySend",
    Send = "Send",
    Fund = "Fund",
    ProxySwapTokens = "ProxySwapTokens",
    BatchTransaction = "BatchTransaction",
    SignSolanaTransaction = "SignSolanaTransaction",
    SignAndSendSolanaTransaction = "SignAndSendSolanaTransaction"
}
export interface TransferTokenRequest {
    type: TransactionRequestType.Send | TransactionRequestType.Fund;
    amounts: bigint[];
    erc20Tokens: ERC20Token[];
    to: string;
    isRelayerOff: boolean;
    action: AdminTransactionType;
    feeToken?: string;
    feeStructure?: FeeStructure;
}
export interface PrivateTransactionBaseRequest {
    appMetaData: AppMetaData;
    from: string;
    feeStructure?: FeeStructure;
}
export interface PrivateTransactionFromProxyRequest extends PrivateTransactionBaseRequest {
    type: TransactionRequestType.PrivateTransactionFromProxy;
    subAccount: SubAccount;
    tokenChanges: TokenChanges<bigint>[];
    proxyApprovalData?: {
        approvalToken: ERC20Token;
        approvalAmount: string;
    };
    txParams: WCTransactionParameters;
    autoDepositBack: boolean;
    maxGasInDollar?: string;
}
export interface BatchTransactionRequest extends PrivateTransactionBaseRequest {
    type: TransactionRequestType.BatchTransaction;
    tokenChanges: TokenChanges<bigint>[];
    batchCalls: WCTransactionParameters[];
    subAccount: SubAccount;
    revokedTokens?: TokenAmountInfo[];
    autoDepositBack?: boolean;
    maxGasInDollar?: string;
}
export interface SignSolanaTransactionRequest extends PrivateTransactionBaseRequest {
    type: TransactionRequestType.SignSolanaTransaction;
    subAccount: SubAccount;
    tokenChanges: TokenChanges<bigint>[];
    txParams: WCTransactionParameters;
    serializedTx: string;
    signature: string;
}
export interface SignAndSendSolanaTransactionRequest extends PrivateTransactionBaseRequest {
    type: TransactionRequestType.SignAndSendSolanaTransaction;
    subAccount: SubAccount;
    tokenChanges: TokenChanges<bigint>[];
    txParams: WCTransactionParameters;
    serializedTx: string;
}
export interface ReceiveFromSubAccountRequest {
    type: TransactionRequestType.ReceiveFromShieldedAccount;
    from: string;
    amounts: bigint[];
    erc20Tokens: ERC20Token[];
    subAccount: SubAccount;
    feeToken?: string;
    feeStructure?: FeeStructure;
}
export interface SwapTokensRequest {
    type: TransactionRequestType.SwapTokens;
    from: string;
    amountChanges: bigint[];
    erc20Tokens: ERC20Token[];
    externalActionId: ExternalActionId;
    swapData: string;
    integrationProvider: IntegrationProvider;
    action: AdminTransactionType;
    feeToken?: string;
    feeStructure?: FeeStructure;
    bridgedToken?: ERC20Token;
    bridgedTokenAmount?: bigint;
    extraNativeTokenFee?: bigint;
}
export interface ProxySwapTokensRequest {
    type: TransactionRequestType.ProxySwapTokens;
    from: string;
    amountChanges: bigint[];
    erc20Tokens: ERC20Token[];
    externalActionId: ExternalActionId;
    swapData: string;
    isTheSameChainSwap: boolean;
    integrationProvider: IntegrationProvider;
    subAccount: SubAccount;
    action: AdminTransactionType;
    feeToken?: string;
    feeStructure?: FeeStructure;
    bridgedToken?: ERC20Token;
    bridgedTokenAmount?: bigint;
    extraNativeTokenFee?: bigint;
    autoDepositBack?: boolean;
    maxGasInDollar?: string;
}
export interface SendProxySendRequest {
    type: TransactionRequestType.ProxySend;
    from: string;
    amounts: bigint[];
    erc20Tokens: ERC20Token[];
    to: string;
    subAccount: SubAccount;
    action: AdminTransactionType;
    feeToken?: string;
    feeStructure?: FeeStructure;
}
export interface PrepareHinkalFromSerializedArgs {
    signature: string;
    ethereumAddress: string;
    chainId: number;
    nullifiers: string[];
    merkleTreeHinkal: MerkleTreeJson;
    encryptedOutputs: EncryptedOutputWithSign<boolean>[];
    generateProofRemotely: boolean;
    serializedCache: Record<string, string>;
    stealthPairCache: Record<string, string>;
    stealthAddressCache: Record<string, string>;
}
export type TransactionRequest = (TransferTokenRequest | ReceiveFromSubAccountRequest | SwapTokensRequest | PrivateTransactionFromProxyRequest | SendProxySendRequest | ProxySwapTokensRequest | BatchTransactionRequest | SignAndSendSolanaTransactionRequest) & {
    prepareHinkalArgs: PrepareHinkalFromSerializedArgs;
};
export type TransactionRuntimeMessageHandler = (message: WithId<TransactionRequest>) => Promise<{
    result: string;
} | undefined>;
export interface TransactionResponseError {
    id: number;
    success: false;
    error: Error;
    erroredTx?: string;
}
export interface TransactionResponseBase {
    id: number;
    success: true;
}
export interface TransactionResponseTx extends TransactionResponseBase {
    txHash: string;
}
export type TransactionResponseSuccess = TransactionResponseTx;
export type TransactionResponse = TransactionResponseError | TransactionResponseSuccess;
