Interface TransferService

  • All Known Implementing Classes:
    NoopTransferService

    public interface TransferService
    Implemented by a bank to support Token integration.
    • Method Detail

      • createTransfer

        default TransferResult createTransfer​(TransferRequest transferRequest)
        Creates a transaction for the specified transfer request.
        Parameters:
        transferRequest - the token transfer request
        Returns:
        instance of TransferResult
        Throws:
        TransferException - in case transfer fails
      • transfer

        @Deprecated
        java.lang.String transfer​(Transfer transfer)
                           throws TransferException
        Deprecated.
        DEPRECATED: implement createTransfer(TransferRequest transferRequest) instead.

        Creates a transaction for the specified transfer request.

        Parameters:
        transfer - the token transfer request
        Returns:
        bank transaction id for the requested transfer
        Throws:
        TransferException - in case transfer fails
      • createBulkTransfer

        default BulkTransferResult createBulkTransfer​(BulkTransferRequest request)
        Creates a bulk transfer for the specified request.
        Parameters:
        request - the Token bulk transfer request
        Returns:
        bank-defined ID for the bulk transfer and status
      • createStandingOrder

        default StandingOrderResult createStandingOrder​(StandingOrderRequest request)
        Creates a standing order for the specified request.
        Parameters:
        request - the Token standing order request
        Returns:
        bank standing order ID for the request
      • batchTransfer

        default java.lang.String batchTransfer​(java.util.List<Transfer> transfers)
                                        throws TransferException
        Creates a batch of transactions for the specified transfer request that must either all succeed or all fail. Implementation is only required if the bank writes a Smart Contract that requests a batch of transfers to be executed.
        Parameters:
        transfers - the token transfer requests
        Returns:
        bank transaction id for the requested transfers
        Throws:
        TransferException - in case transfer fails
      • getTransferStatus

        default io.token.proto.common.transaction.TransactionProtos.TransactionStatus getTransferStatus​(java.lang.String transferId)
        Gets the latest status of a transfer. This method only should be implemented when the transaction id is not returned by transfer(io.token.sdk.api.Transfer).
        Parameters:
        transferId - the transfer id
        Returns:
        latest status of the transfer
        Throws:
        TransferException - in case transfer fails
      • getBulkTransfer

        default java.util.List<io.token.proto.bankapi.Bankapi.BulkTransaction> getBulkTransfer​(java.lang.String bulkTransferId)
        Gets transactions associated with a bulk transfer.
        Parameters:
        bulkTransferId - bulk transfer ID set by the bank
        Returns:
        list of transactions associated with the bulk transfer