@tangany/waas
Version:
node.js SDK for Tangany Wallet as a Service API
24 lines (23 loc) • 1.35 kB
TypeScript
import { IBitcoinTransaction } from "../interfaces/bitcoin";
import { IAsyncRequestStatus, IWaasError } from "../interfaces/common";
import { IEthereumTransaction } from "../interfaces/ethereum";
import { IContractCallResponse } from "../interfaces/ethereum-contract";
/**
* General purpose utility type to specify only some properties of T as optional (in contrast to Partial<T>)
*/
export declare type Optional<T, K extends keyof T> = Omit<T, K> & Partial<T>;
/**
* Constructs a type where all properties of the passed `T` are optional, but at least one of them must be set.
* In contrast to `Partial<T>` the value `{}` is not allowed.
* The generic type `U` must not be set, because it is only an auxiliary construction.
* @see https://stackoverflow.com/a/48244432
*/
export declare type AtLeastOne<T, U = {
[K in keyof Required<T>]: Pick<Required<T>, K>;
}> = Partial<T> & U[keyof U];
export declare type TransactionStatus = "unknown" | "pending" | "confirmed" | "error";
export declare type NodeStatus = "live" | "unavailable" | "faulty";
export declare type SignatureEncoding = "der" | "ieee-p1363";
export declare type Transaction = IEthereumTransaction | IBitcoinTransaction;
export declare type WaasErrorResponse = IWaasError | IAsyncRequestStatus<IWaasError>;
export declare type ContractCallResult = IContractCallResponse["list"];