Module diem.offchain

This package provides data structures and utilities for implementing Diem Offchain API Service.

See Diem Offchain API for more details.

Expand source code
# Copyright (c) The Diem Core Contributors
# SPDX-License-Identifier: Apache-2.0

""" This package provides data structures and utilities for implementing Diem Offchain API Service.

See [Diem Offchain API](https://dip.diem.com/dip-1/) for more details.

"""

from .types import (
    AbortCode,
    CommandType,
    CommandResponseStatus,
    OffChainErrorType,
    ErrorCode,
    PaymentCommandObject,
    CommandRequestObject,
    CommandResponseObject,
    OffChainErrorObject,
    PaymentObject,
    PaymentActorObject,
    PaymentActionObject,
    ReferenceIDCommandResultObject,
    ReferenceIDCommandObject,
    Status,
    StatusObject,
    KycDataObjectType,
    NationalIdObject,
    AddressObject,
    KycDataObject,
    FieldError,
    InvalidOverwriteError,
    new_payment_object,
    new_payment_request,
    replace_payment_actor,
    reply_request,
    individual_kyc_data,
    entity_kyc_data,
    to_json,
    to_dict,
    from_json,
    from_dict,
    validate_write_once_fields,
    UUID_REGEX,
)
from .http_header import X_REQUEST_ID, X_REQUEST_SENDER_ADDRESS
from .action import Action
from .error import command_error, protocol_error, Error
from .command import Command
from .payment_command import PaymentCommand
from .client import Client, CommandResponseError

from . import jws, http_server, state, payment_state

import typing

Sub-modules

diem.offchain.action

This module defines action enum for flagging what should be follow up action of a PaymentCommand

diem.offchain.client
diem.offchain.command
diem.offchain.error
diem.offchain.http_header
diem.offchain.http_server

This module defines util functions for testing offchain inbound request processor with http server …

diem.offchain.jws

This module defines util functions for encoding and decoding offchain specific JWS messages …

diem.offchain.payment_command

This module defines PaymentCommand class provides utils for processing PaymentCommand properly.

diem.offchain.payment_state

This module defines states of PaymentCommand / PaymentObject for validating transitions when an actor tries to update the PaymentObject.

diem.offchain.reference_id_command

This module defines ReferenceIDCommand class provides utils for processing ReferenceIDCommand properly.

diem.offchain.state

This module defines a state machine and data match utils classes for creating conditional states.

diem.offchain.types

This module defines off-chain protocol data structures and PaymentCommand data structures …