Skip to main content

libraries/eosiolib/capi/eosio/transaction.h

More...

Functions

Name
attribute((eosio_wasm_import) ) const
Cancels a deferred transaction.

Attributes

Name
capi_namepayer
capi_name const char *serialized_transaction
capi_name const char size_tsize
capi_name const char size_t uint32_treplace_existing
uint32_tindex
uint32_t char *buff

Detailed Description

Copyright: defined in eos/LICENSE

Functions Documentation

function attribute

__attribute__(
(eosio_wasm_import)
) const

Cancels a deferred transaction.

Parameters:

  • sender_id - ID of sender
  • payer - Account paying for RAM
  • serialized_transaction - Pointer of serialized transaction to be deferred
  • size - Size to reserve
  • replace_existing - f this is 0 then if the provided sender_id is already in use by an in-flight transaction from this contract, which will be a failing assert. If 1 then transaction will atomically cancel/replace the inflight transaction
  • sender_id - The id of the sender
  • buffer - a buffer to write the current transaction to
  • size - the size of the buffer, 0 to return required size
  • type - 0 for context free action, 1 for action
  • index - the index of the requested action
  • buff - output packed buff of the action
  • size - amount of buff read, pass 0 to have size returned
  • index - the index of the context_free_data entry to retrieve
  • buff - output buff of the context_free_data entry
  • size - amount of context_free_data[index] to retrieve into buff, 0 to report required size

Return:

  • 1 if transaction was canceled, 0 if transaction was not found
  • the size of the transaction written to the buffer, or number of bytes that can be copied if size==0 passed
  • size of the currently executing transaction
  • block number used for TAPOS on the currently executing transaction Example:
int tbn = tapos_block_num();
  • block prefix used for TAPOS on the currently executing transaction Example:
int tbp = tapos_block_prefix();
  • expiration of the currently executing transaction in seconds since Unix epoch Example:
uint32_t tm = expiration();
eosio_print(tm);
  • the size of the action, -1 on failure
  • size copied, or context_free_data[index].size() if 0 passed for size, or -1 if index not valid

Precondition:

  • The deferred transaction ID exists.
  • The deferred transaction ID has not yet been published.

Postcondition: Deferred transaction canceled.

Retrieve the signed_transaction.context_free_data[index].

Retrieves the indicated action from the active transaction.

Gets the expiration of the currently executing transaction.

Gets the block prefix used for TAPOS on the currently executing transaction.

Gets the block number used for TAPOS on the currently executing transaction.

Gets the size of the currently executing transaction.

Access a copy of the currently executing transaction.

Sends a deferred transaction.

Cancels a deferred transaction.

Example:

id = 0xffffffffffffffff
cancel_deferred( id );

Access a copy of the currently executing transaction.

Gets the size of the currently executing transaction.

Gets the block number used for TAPOS on the currently executing transaction.

Gets the block prefix used for TAPOS on the currently executing transaction.

Gets the expiration of the currently executing transaction.

Retrieves the indicated action from the active transaction.

Retrieve the signed_transaction.context_free_data[index].

Attributes Documentation

variable payer

capi_name payer;

variable serialized_transaction

capi_name const char * serialized_transaction;

variable size

capi_name const char size_t size;

variable replace_existing

capi_name const char size_t uint32_t replace_existing;

variable index

uint32_t index;

variable buff

uint32_t char * buff;

Source code


#pragma once
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif

__attribute__((eosio_wasm_import))
void send_deferred(const uint128_t* sender_id, capi_name payer, const char *serialized_transaction, size_t size, uint32_t replace_existing);

__attribute__((eosio_wasm_import))
int cancel_deferred(const uint128_t* sender_id);

__attribute__((eosio_wasm_import))
size_t read_transaction(char *buffer, size_t size);

__attribute__((eosio_wasm_import))
size_t transaction_size( void );

__attribute__((eosio_wasm_import))
int tapos_block_num( void );

__attribute__((eosio_wasm_import))
int tapos_block_prefix( void );

__attribute__((eosio_wasm_import))
uint32_t expiration( void );

__attribute__((eosio_wasm_import))
int get_action( uint32_t type, uint32_t index, char* buff, size_t size );

__attribute__((eosio_wasm_import))
int get_context_free_data( uint32_t index, char* buff, size_t size );

#ifdef __cplusplus
}
#endif

Updated on 2022-12-05 at 15:38:08 +0000