UNPKG

@test-org122/hypernet-core

Version:

Hypernet Core. Represents the SDK for running the Hypernet Protocol.

94 lines (84 loc) 2.48 kB
import { BigNumber, IHypernetOfferDetails, PublicKey, ResultAsync } from "@interfaces/objects"; import { CoreUninitializedError, InvalidParametersError, RouterChannelUnknownError, TransferCreationError, TransferResolutionError, } from "@interfaces/objects/errors"; import { IHypernetPullPaymentDetails } from "@interfaces/objects/HypernetPullPaymentDetails"; import { EPaymentType, ETransferState } from "@interfaces/types"; import { IBasicTransferResponse, IFullTransferState } from "./IBrowserNode"; /** * */ export interface IVectorUtils { /** * */ getRouterChannelAddress(): ResultAsync<string, RouterChannelUnknownError | CoreUninitializedError>; /** * * @param transferId */ resolveMessageTransfer(transferId: string): ResultAsync<IBasicTransferResponse, TransferResolutionError>; resolvePaymentTransfer( transferId: string, paymentId: string, amount: string, ): ResultAsync<IBasicTransferResponse, TransferResolutionError>; /** * * @param transferId * @param paymentId * @param mediatorSignature * @param amount */ resolveInsuranceTransfer( transferId: string, paymentId: string, mediatorSignature?: string, amount?: BigNumber, ): ResultAsync<IBasicTransferResponse, TransferResolutionError>; /** * */ createOfferTransfer( toAddress: string, message: IHypernetOfferDetails, ): ResultAsync<IBasicTransferResponse, TransferCreationError>; createPullNotificationTransfer( toAddress: string, message: IHypernetPullPaymentDetails, ): ResultAsync<IBasicTransferResponse, TransferCreationError | InvalidParametersError>; /** * * @param amount * @param assetAddress */ createPaymentTransfer( type: EPaymentType, toAddress: string, amount: BigNumber, assetAddress: string, UUID: string, start: number, expiration: number, deltaTime?: number, deltaAmount?: string, ): ResultAsync<IBasicTransferResponse, TransferCreationError | InvalidParametersError>; /** * * @param toAddress * @param amount */ createInsuranceTransfer( toAddress: string, mediatorPublicKey: PublicKey, amount: BigNumber, expiration: number, UUID: string, ): ResultAsync<IBasicTransferResponse, TransferCreationError | InvalidParametersError>; getTimestampFromTransfer(transfer: IFullTransferState): number; getTransferStateFromTransfer(transfer: IFullTransferState): ETransferState; }