Merge pull request #15 from MetricsDAO/transactions

Transactions
This commit is contained in:
Jack Forgash 2022-03-17 11:02:21 -06:00 committed by GitHub
commit 6963c3d9cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 68 additions and 0 deletions

View 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

View 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.