mirror of
https://github.com/FlipsideCrypto/near-models.git
synced 2026-02-06 13:56:44 +00:00
commit
6963c3d9cc
29
models/core/transactions.sql
Normal file
29
models/core/transactions.sql
Normal file
@ -0,0 +1,29 @@
|
||||
{{
|
||||
config(
|
||||
materialized='incremental',
|
||||
unique_key= 'tx_id',
|
||||
incremental_strategy = 'delete+insert',
|
||||
tags=['core', 'transactions'],
|
||||
cluster_by = ['block_timestamp']
|
||||
)
|
||||
}}
|
||||
|
||||
with transactions as (
|
||||
|
||||
select
|
||||
|
||||
block_id,
|
||||
tx_id,
|
||||
block_timestamp,
|
||||
tx,
|
||||
tx:outcome as tx_outcome,
|
||||
tx:receipt as tx_receipt,
|
||||
tx:receiver_id::string as tx_receiver,
|
||||
tx:signer_id::string as tx_signer
|
||||
|
||||
from {{ ref('stg_txs') }}
|
||||
where {{ incremental_load_filter("block_timestamp") }}
|
||||
|
||||
)
|
||||
|
||||
select * from transactions
|
||||
39
models/core/transactions.yml
Normal file
39
models/core/transactions.yml
Normal file
@ -0,0 +1,39 @@
|
||||
|
||||
version: 2
|
||||
|
||||
models:
|
||||
- name: transactions
|
||||
description: "Near transactions."
|
||||
|
||||
columns:
|
||||
- name: block_id
|
||||
description: The block ID.
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
- name: tx_id
|
||||
description: The transaction hash.
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
- name: block_timestamp
|
||||
description: The time the block was minted.
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
- name: tx
|
||||
description: The transaction's information.
|
||||
tests:
|
||||
- not_null
|
||||
|
||||
- name: tx_outcome
|
||||
description: The transaction outcome.
|
||||
|
||||
- name: tx_receipt
|
||||
description: The transaction receipt.
|
||||
|
||||
- name: tx_receiver
|
||||
description: The transaction receiver.
|
||||
|
||||
- name: tx_signer
|
||||
description: The transaction signer.
|
||||
Loading…
Reference in New Issue
Block a user