dragonchain/webserver/lib/transactions.py
def submit_transaction_v1(transaction: Dict[str, Any], callback_url: Optional[str], api_key: "api_key_model.APIKeyModel") -> Dict[str, str]:
    """Formats and enqueues individual transaction (from user input) to the webserver queue
    Returns:
        String of the submitted transaction id
    """
    _log.info("[TRANSACTION] Parsing and loading user input")
    txn_model = _generate_transaction_model(transaction)

    # Check if allowed to create transaction of this type
    if not api_key.is_key_allowed("transactions", "create", "create_transaction", False, extra_data={"requested_types": {txn_model.txn_type}}):
        raise exceptions.ActionForbidden(f"API Key is not allowed to create transaction of type {txn_model.txn_type}")

    _log.info("[TRANSACTION] Txn valid. Queueing txn object")
    queue.enqueue_item(txn_model.export_as_queue_task())

    if callback_url:
        _log.info("[TRANSACTION] Registering callback for queued txn")
        callback.register_callback(txn_model.txn_id, callback_url)

    return {"transaction_id": txn_model.txn_id}
Formats and enqueues individual transaction (from user input) to the webserver queue
    Returns:
        String of the submitted transaction id
    
Formats and enqueues individual transaction (from user input) to the webserver queue
Formats and enqueues individual transaction ( from user input ) to the webserver queue
def submit_transaction_v1(transaction: Dict[str, Any], callback_url: Optional[str], api_key: "api_key_model.APIKeyModel") -> Dict[str, str]:
    _log.info("[TRANSACTION] Parsing and loading user input")
    txn_model = _generate_transaction_model(transaction)
    if not api_key.is_key_allowed("transactions", "create", "create_transaction", False, extra_data={"requested_types": {txn_model.txn_type}}):
        raise exceptions.ActionForbidden(f"API Key is not allowed to create transaction of type {txn_model.txn_type}")
    _log.info("[TRANSACTION] Txn valid. Queueing txn object")
    queue.enqueue_item(txn_model.export_as_queue_task())
    if callback_url:
        _log.info("[TRANSACTION] Registering callback for queued txn")
        callback.register_callback(txn_model.txn_id, callback_url)
    return {"transaction_id": txn_model.txn_id}
def submit_transaction_v1 ( transaction : Dict [ str , Any ] , callback_url : Optional [ str ] , api_key : "api_key_model.APIKeyModel" ) -> Dict [ str , str ] : _log . info ( "[TRANSACTION] Parsing and loading user input" ) txn_model = _generate_transaction_model ( transaction ) if not api_key . is_key_allowed ( "transactions" , "create" , "create_transaction" , False , extra_data = { "requested_types" : { txn_model . txn_type } } ) : raise exceptions . ActionForbidden ( f"API Key is not allowed to create transaction of type {txn_model.txn_type}" ) _log . info ( "[TRANSACTION] Txn valid. Queueing txn object" ) queue . enqueue_item ( txn_model . export_as_queue_task ( ) ) if callback_url : _log . info ( "[TRANSACTION] Registering callback for queued txn" ) callback . register_callback ( txn_model . txn_id , callback_url ) return { "transaction_id" : txn_model . txn_id }
Formats and enqueues individual transaction (from user input) to the webserver queue
Formats and enqueues individual transaction ( from user input ) to the webserver queue
"""Formats and enqueues individual transaction (from user input) to the webserver queue
    Returns:
        String of the submitted transaction id
    """ # Check if allowed to create transaction of this type
String of the submitted transaction id
String of the submitted transaction id
transaction
Dict[str, Any]
callback_url
Optional[str]
api_key
"api_key_model.APIKeyModel"