UNPKG

@atomiqlabs/sdk

Version:

atomiq labs SDK for cross-chain swaps between smart chains and bitcoin

31 lines (26 loc) 804 B
/** * Type guard to check if an object is an {@link IAddressSwap} * * @category Swaps/Types */ export function isIAddressSwap(obj: any): obj is IAddressSwap { return obj!=null && typeof(obj.getAddress) === "function" && typeof(obj.getHyperlink) === "function"; } /** * Interface for swaps which require a user to send funds to a specific address * * @category Swaps/Types */ export interface IAddressSwap { /** * An address to which the user needs to send funds on the source chain */ getAddress(): string; /** * A hyperlink representation of the address + amount that the user needs to sends on the source chain. * This is suitable to be displayed in a form of QR code. */ getHyperlink(): string; }