mirror of
https://github.com/FlipsideCrypto/ethscore.git
synced 2026-02-06 10:48:05 +00:00
52 lines
1.7 KiB
R
52 lines
1.7 KiB
R
% Generated by roxygen2: do not edit by hand
|
|
% Please edit documentation in R/address_token_balance.R
|
|
\name{address_token_balance}
|
|
\alias{address_token_balance}
|
|
\title{Address Token Balance}
|
|
\usage{
|
|
address_token_balance(
|
|
token_address,
|
|
min_tokens = 0.01,
|
|
block_max,
|
|
api_key = api_key
|
|
)
|
|
}
|
|
\arguments{
|
|
\item{token_address}{ERC20 token contract address to assess balance}
|
|
|
|
\item{min_tokens}{Minimum amount of tokens acknowledged. Already decimal adjusted, useful for
|
|
ignoring dust balances.}
|
|
|
|
\item{block_max}{The block height to assess balance at (for reproducibility)}
|
|
|
|
\item{api_key}{Flipside Crypto ShroomDK API Key to create and access SQL queries.}
|
|
}
|
|
\value{
|
|
Data frame of form:\tabular{lc}{
|
|
\tab \cr
|
|
BLOCK \tab Block where user last changed their balance (traded or transferred) \cr
|
|
TOKEN_ADDRESS \tab ERC20 address provided \cr
|
|
ADDRESS \tab The EOA or contract that holds the balance \cr
|
|
OLD_VALUE \tab Amount of token before latest trade or transfer \cr
|
|
NEW_VALUE \tab Amount of token as of BLOCK, i.e. balance after their latest trade or transfer \cr
|
|
ADDRESS_TYPE \tab If ADDRESS is known to be 'contract address' or 'gnosis safe address'. \cr
|
|
If neither it is assumed to be an 'EOA'. Some EOAs may have a balance but have never initiated a transaction \tab \cr
|
|
These are noted as 'EOA-0tx' Note: contracts, including gnosis safes may not have consistent owners across different EVM chains. \tab \cr
|
|
}
|
|
}
|
|
\description{
|
|
Token balance of an address at a specific block height.
|
|
Alice held 20 UNI at block 15,000,000.
|
|
}
|
|
\examples{
|
|
\dontrun{
|
|
address_token_balance(
|
|
token_address = tolower("0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984"), #UNI token
|
|
min_tokens = 0.01,
|
|
block_max = 15000000,
|
|
api_key = readLines("api_key.txt")
|
|
)
|
|
}
|
|
|
|
}
|