66 lines
1.6 KiB
TypeScript
66 lines
1.6 KiB
TypeScript
// Interfaces which define how a user interacts with the Tornado Cash protocol.
|
|
// We are dealing with both Tornado Cash Classic & Nova, yet we still want to keep
|
|
// the interfaces simple.
|
|
//
|
|
// Several of the interfaces are aliased to provide the developer some shortcuts
|
|
// instead of having to specify exactly what type he is constructing.
|
|
|
|
import { TransactionRequest } from '@ethersproject/abstract-provider'
|
|
import { BigNumber } from 'ethers'
|
|
import { RelayerProperties as RelayerDataProperties } from 'types/sdk/data'
|
|
|
|
export namespace Options {
|
|
export namespace Cache {
|
|
export interface Database {
|
|
adapter?: string
|
|
persistent?: boolean
|
|
}
|
|
export interface Sync {
|
|
concurrencyLimit?: number
|
|
listen?: boolean
|
|
}
|
|
}
|
|
|
|
export namespace Core {
|
|
export interface Sync {
|
|
deposit?: boolean
|
|
withdrawal?: boolean
|
|
blocks?: {
|
|
startBlock?: number
|
|
targetBlock?: number
|
|
blockDelta?: number
|
|
}
|
|
cache?: {
|
|
sync?: Cache.Sync
|
|
db?: Cache.Database
|
|
}
|
|
}
|
|
|
|
export interface Deposit {
|
|
depositsPerInstance?: Array<number>
|
|
doNotPopulate?: boolean
|
|
backup?: {
|
|
invoices?: boolean
|
|
notes?: boolean
|
|
}
|
|
}
|
|
|
|
export type Invoice = Deposit
|
|
|
|
export interface BuildDepositProof {
|
|
ethPurchaseAmounts?: Array<BigNumber>
|
|
merkleTreeHeight?: number
|
|
checkNotesSpent?: boolean
|
|
}
|
|
}
|
|
}
|
|
|
|
export namespace Transactions {
|
|
export interface Deposit {
|
|
request: TransactionRequest
|
|
invoice?: string
|
|
note?: string
|
|
}
|
|
export type Invoice = Deposit
|
|
}
|