CREATE TABLE `nodely-data-pub.algorand_mainnet_daily.transactions`
block_number INT64 NOT NULL -- Number of the block in which this transaction was located.
block_timestamp TIMESTAMP NOT NULL -- Unix timestamp when the block was assembled
transaction_hash STRING NOT NULL -- Hash of the transaction
transaction_group BYTES -- Parent atomic group id (binary)
transaction_offset INT64 NOT NULL -- Transaction's index position in the block
transaction_type STRING NOT NULL -- One of acc_close acc_payment acc_payment_create app_call app_clear app_close app_delete app_optin app_update asa_clawback asa_config asa_create asa_destroy asa_freeze asa_optin asa_optout asa_transfer asa_unfreeze key_reg key_unreg stpf
from_addr_id INT64 -- Sender address id
to_addr_id INT64 -- Recipient address id
value_float FLOAT64 NOT NULL -- Decimal adjusted amount of Algo or token
value_int NUMERIC(20) NOT NULL -- Integer amount of Algo or Token without decimal shift
close_to_addr_id INT64 -- Address id of recipient of the closing balance
close_value_float FLOAT64 NOT NULL -- Closing balance amount, decimal adjusted
close_value_int NUMERIC(20) NOT NULL -- Closing balance amount without decimal shift
gas INT64 NOT NULL -- Transaction free in microAlgos
note STRING -- Optional note (up to 1KB)
rekey_to_addr_id INT64 -- Account rekey to address id
auth_by_addr_id INT64 -- Transaction authorized by this address id (if sender is rekeyed)
has_inners BOOL NOT NULL -- Transaction has inner transactions
is_inner BOOL NOT NULL -- Transaction is an inner transaction issued by smart contract
clawback_from_addr_id INT64 -- Address id of the account the token is clawed back from
token_cfg STRUCT<list ARRAY<STRUCT<element INT64>>> NOT NULL -- new address ids for reserve/clawback/freezer/manger in random order
token_id INT64 -- Asset id (token/nft)
token_total NUMERIC(20) -- Total number of assets minted
token_unit_name STRING -- Asset unit name
contract_id INT64 -- ID of the contract called
input STRING -- Extra TX data / app call input
root_offset INT64 -- transaction offset pointing to the root (outer) transation
parent_offset INT64 -- transaction offset pointing to parent transaction
depth INT64 -- the depth of the transaction in the tree
inners_all INT64 -- number of all inners spawned by this transaction (recursive)
inners_direct INT64 -- number of all direct (1st level) inners spawned by this transaction
PRIMARY KEY (block_number, transaction_offset) NOT ENFORCED,
FOREIGN KEY (from_addr_id) REFERENCES `nodely-data-pub.algorand_mainnet_daily.accounts`(addr_id) NOT ENFORCED,
FOREIGN KEY (to_addr_id) REFERENCES `nodely-data-pub.algorand_mainnet_daily.accounts`(addr_id) NOT ENFORCED,
FOREIGN KEY (close_to_addr_id) REFERENCES `nodely-data-pub.algorand_mainnet_daily.accounts`(addr_id) NOT ENFORCED,
FOREIGN KEY (rekey_to_addr_id) REFERENCES `nodely-data-pub.algorand_mainnet_daily.accounts`(addr_id) NOT ENFORCED,
FOREIGN KEY (from_addr_id) REFERENCES `nodely-data-pub.algorand_mainnet_daily.accounts`(addr_id) NOT ENFORCED,
FOREIGN KEY (to_addr_id) REFERENCES `nodely-data-pub.algorand_mainnet_daily.accounts`(addr_id) NOT ENFORCED,
FOREIGN KEY (close_to_addr_id) REFERENCES `nodely-data-pub.algorand_mainnet_daily.accounts`(addr_id) NOT ENFORCED,
FOREIGN KEY (rekey_to_addr_id) REFERENCES `nodely-data-pub.algorand_mainnet_daily.accounts`(addr_id) NOT ENFORCED,
FOREIGN KEY (auth_by_addr_id) REFERENCES `nodely-data-pub.algorand_mainnet_daily.accounts`(addr_id) NOT ENFORCED,
FOREIGN KEY (auth_by_addr_id) REFERENCES `nodely-data-pub.algorand_mainnet_daily.accounts`(addr_id) NOT ENFORCED,
FOREIGN KEY (clawback_from_addr_id) REFERENCES `nodely-data-pub.algorand_mainnet_daily.accounts`(addr_id) NOT ENFORCED,
FOREIGN KEY (token_id) REFERENCES `nodely-data-pub.algorand_mainnet_daily.tokens`(token_id) NOT ENFORCED
PARTITION BY TIMESTAMP_TRUNC(block_timestamp, MONTH)
CLUSTER BY block_number, transaction_offset
description="Algorand mainnet transactions. See: https://nodely.io/docs/public/bigquery",
labels=[("status", "production")]