import { Numeric } from '@faast/ts-common' ; import { BalanceResult , BaseUnsignedTransaction , BaseSignedTransaction , BaseTransactionInfo , BaseBroadcastResult , CreateTransactionOptions , FeeOption , ResolvedFeeOption , BaseConfig , Payport , FromTo , ResolveablePayport , UtxoInfo , PayportOutput , } from './types' ; import { PaymentsUtils } from './PaymentsUtils' ; /**
 * An interface that provides the necessary tools for accepting and sending payments for a currency.
 */ export interface BasePayments < Config extends BaseConfig , UnsignedTransaction extends BaseUnsignedTransaction , SignedTransaction extends BaseSignedTransaction , BroadcastResult extends BaseBroadcastResult , TransactionInfo extends BaseTransactionInfo > extends PaymentsUtils { /** Establishes any connections necessary for use */ init ( ) : Promise < void > ; /** Closes any connections that were opened in `init` */ destroy ( ) : Promise < void > ; /**
     * Returns the full config used to instantiate this payments instance as is.
     */ getFullConfig ( ) : Config ; /**
     * Returns the full config with private keys substituted with their public equivalent.
     * (e.g. xpub/addresses instead of xprv/private keys)
     */ getPublicConfig ( ) : Config ; /**
     * Return payport at index, or the payport itself.
     */ resolvePayport < O extends object > ( payport , options ? ) : Promise < Payport > ; /**
     * Resolve the from/to params of a transaction for the given payports.
     */ resolveFromTo < O extends object > ( from , to , options ? ) : Promise < FromTo > ; /**
     * Resolve the fee option to a defined fee amount. Used when creating a transaction. Usually
     * involves looking up current blockchain fee averages with an external service.
     */ resolveFeeOption < O extends FeeOption > ( feeOption ) : Promise < ResolvedFeeOption > ; /**
     * Return identifiers for all accounts configured.
     */ getAccountIds ( ) : string [ ] ; param index getAccountId ( index ) : string ; /**
     * Return true if external balance tracking is required for payports with an extraId
     */ requiresBalanceMonitor ( ) : boolean ; param index return throws getPayport < O extends object > ( index , options ? ) : Promise < Payport > ; param payport return getBalance < O extends object > ( payport , options ? ) : Promise < BalanceResult > ; /**
     * Returns true if the payport could be swept at the specified balance. Useful when using BalanceMonitor to
     * externally track balances. If payport is unspecified assume it applies to a deposit payport rather than
     * a hot wallet.
     */ isSweepableBalance ( balance , payport ? ) : Promise < boolean > | boolean ; usesUtxos ( ) : boolean ; /**
     * Get the unspent transaction outputs for the provided payport/address. Returns an empty list if utxos
     * not used by the network.
     */ getUtxos ( payport ) : Promise < UtxoInfo [ ] > ; usesSequenceNumber ( ) : boolean ; returns getNextSequenceNumber ( payport ) : Promise < string | null > ; param from param to param amount returns createTransaction < O extends CreateTransactionOptions > ( from , to , amount , options ? ) : Promise < UnsignedTransaction > ; /**
     * Creates a new payment transaction sending the entire balance of payport `from` to payport `to`.
     */ createSweepTransaction < O extends CreateTransactionOptions > ( from , to , options ? ) : Promise < UnsignedTransaction > ; /**
     * Creates a new service transaction (ie contract deploy, change settings)
     */ createServiceTransaction < O extends CreateTransactionOptions > ( from ? , options ? ) : Promise < UnsignedTransaction | null > ; param from param to param options returns createMultiOutputTransaction < O extends CreateTransactionOptions > ( from , to , options ? ) : Promise < UnsignedTransaction | null > ; param from param to param options returns createMultiInputTransaction < O extends CreateTransactionOptions > ( from , to , options ? ) : Promise < UnsignedTransaction | null > ; param from param to param amount returns signTransaction < O extends object > ( unsignedTx , options ? ) : Promise < SignedTransaction > ; return throws broadcastTransaction < O extends object > ( signedTx , options ? ) : Promise < BroadcastResult > ; } export type AnyPayments < C extends object = any > = BasePayments < C , BaseUnsignedTransaction , BaseSignedTransaction , BaseBroadcastResult , BaseTransactionInfo > ;