scottincryptoShuttle Bridge Transactions harm
    Updated 2021-11-17
    --receive native from harmony bridge
    select
    block_id
    , block_timestamp
    , chain_id
    , event_attributes:amount[0]:amount::numeric / 1e6 as amount
    , event_attributes:amount[0]:denom::string as denom
    , event_attributes:recipient::string as user
    , 'receive' as tx_direction
    , 'native' as token_type
    , 6 as shuttle_chain_id
    from terra.msg_events
    where event_attributes:sender::string = 'terra1rtn03a9l3qsc0a9verxwj00afs93mlm0yr7chk'
    and event_type = 'transfer'
    and tx_status = 'SUCCEEDED'
    and chain_id = 'columbus-5'
    and msg_type = 'bank/MsgSend'

    union all

    --receive non_native from harmony bridge
    select
    block_id
    , block_timestamp
    , chain_id
    , coalesce(event_attributes:"0_amount"::numeric, event_attributes:amount::numeric) / 1e6 as amount
    , coalesce(event_attributes:"0_contract_address"::string, event_attributes:contract_address::string) as denom
    , event_attributes:to::string as user
    , 'receive' as tx_direction
    , 'non_native' as token_type
    , 6 as shuttle_chain_id
    from terra.msg_events
    where event_attributes:from::string = 'terra1rtn03a9l3qsc0a9verxwj00afs93mlm0yr7chk'
    and event_type = 'wasm'
    and tx_status = 'SUCCEEDED'
    and chain_id = 'columbus-5'
    Run a query to Download Data