Files

3796 lines
94 KiB
TypeScript

// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
import {
TypedMap,
Entity,
Value,
ValueKind,
store,
Bytes,
BigInt,
BigDecimal,
} from "@graphprotocol/graph-ts";
export class Factory extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id != null, "Cannot save Factory entity without an ID");
if (id) {
assert(
id.kind == ValueKind.STRING,
`Entities of type Factory must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
);
store.set("Factory", id.toString(), this);
}
}
static loadInBlock(id: string): Factory | null {
return changetype<Factory | null>(store.get_in_block("Factory", id));
}
static load(id: string): Factory | null {
return changetype<Factory | null>(store.get("Factory", id));
}
get id(): string {
let value = this.get("id");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get poolCount(): BigInt {
let value = this.get("poolCount");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set poolCount(value: BigInt) {
this.set("poolCount", Value.fromBigInt(value));
}
get txCount(): BigInt {
let value = this.get("txCount");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set txCount(value: BigInt) {
this.set("txCount", Value.fromBigInt(value));
}
get totalVolumeUSD(): BigDecimal {
let value = this.get("totalVolumeUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalVolumeUSD(value: BigDecimal) {
this.set("totalVolumeUSD", Value.fromBigDecimal(value));
}
get totalVolumeETH(): BigDecimal {
let value = this.get("totalVolumeETH");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalVolumeETH(value: BigDecimal) {
this.set("totalVolumeETH", Value.fromBigDecimal(value));
}
get totalFeesUSD(): BigDecimal {
let value = this.get("totalFeesUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalFeesUSD(value: BigDecimal) {
this.set("totalFeesUSD", Value.fromBigDecimal(value));
}
get totalFeesETH(): BigDecimal {
let value = this.get("totalFeesETH");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalFeesETH(value: BigDecimal) {
this.set("totalFeesETH", Value.fromBigDecimal(value));
}
get untrackedVolumeUSD(): BigDecimal {
let value = this.get("untrackedVolumeUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set untrackedVolumeUSD(value: BigDecimal) {
this.set("untrackedVolumeUSD", Value.fromBigDecimal(value));
}
get totalValueLockedUSD(): BigDecimal {
let value = this.get("totalValueLockedUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalValueLockedUSD(value: BigDecimal) {
this.set("totalValueLockedUSD", Value.fromBigDecimal(value));
}
get totalValueLockedETH(): BigDecimal {
let value = this.get("totalValueLockedETH");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalValueLockedETH(value: BigDecimal) {
this.set("totalValueLockedETH", Value.fromBigDecimal(value));
}
get totalValueLockedUSDUntracked(): BigDecimal {
let value = this.get("totalValueLockedUSDUntracked");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalValueLockedUSDUntracked(value: BigDecimal) {
this.set("totalValueLockedUSDUntracked", Value.fromBigDecimal(value));
}
get totalValueLockedETHUntracked(): BigDecimal {
let value = this.get("totalValueLockedETHUntracked");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalValueLockedETHUntracked(value: BigDecimal) {
this.set("totalValueLockedETHUntracked", Value.fromBigDecimal(value));
}
get owner(): string {
let value = this.get("owner");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set owner(value: string) {
this.set("owner", Value.fromString(value));
}
}
export class Bundle extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id != null, "Cannot save Bundle entity without an ID");
if (id) {
assert(
id.kind == ValueKind.STRING,
`Entities of type Bundle must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
);
store.set("Bundle", id.toString(), this);
}
}
static loadInBlock(id: string): Bundle | null {
return changetype<Bundle | null>(store.get_in_block("Bundle", id));
}
static load(id: string): Bundle | null {
return changetype<Bundle | null>(store.get("Bundle", id));
}
get id(): string {
let value = this.get("id");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get ethPriceUSD(): BigDecimal {
let value = this.get("ethPriceUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set ethPriceUSD(value: BigDecimal) {
this.set("ethPriceUSD", Value.fromBigDecimal(value));
}
}
export class Token extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id != null, "Cannot save Token entity without an ID");
if (id) {
assert(
id.kind == ValueKind.STRING,
`Entities of type Token must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
);
store.set("Token", id.toString(), this);
}
}
static loadInBlock(id: string): Token | null {
return changetype<Token | null>(store.get_in_block("Token", id));
}
static load(id: string): Token | null {
return changetype<Token | null>(store.get("Token", id));
}
get id(): string {
let value = this.get("id");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get symbol(): string {
let value = this.get("symbol");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set symbol(value: string) {
this.set("symbol", Value.fromString(value));
}
get name(): string {
let value = this.get("name");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set name(value: string) {
this.set("name", Value.fromString(value));
}
get decimals(): BigInt {
let value = this.get("decimals");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set decimals(value: BigInt) {
this.set("decimals", Value.fromBigInt(value));
}
get totalSupply(): BigInt {
let value = this.get("totalSupply");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set totalSupply(value: BigInt) {
this.set("totalSupply", Value.fromBigInt(value));
}
get volume(): BigDecimal {
let value = this.get("volume");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set volume(value: BigDecimal) {
this.set("volume", Value.fromBigDecimal(value));
}
get volumeUSD(): BigDecimal {
let value = this.get("volumeUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set volumeUSD(value: BigDecimal) {
this.set("volumeUSD", Value.fromBigDecimal(value));
}
get untrackedVolumeUSD(): BigDecimal {
let value = this.get("untrackedVolumeUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set untrackedVolumeUSD(value: BigDecimal) {
this.set("untrackedVolumeUSD", Value.fromBigDecimal(value));
}
get feesUSD(): BigDecimal {
let value = this.get("feesUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set feesUSD(value: BigDecimal) {
this.set("feesUSD", Value.fromBigDecimal(value));
}
get txCount(): BigInt {
let value = this.get("txCount");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set txCount(value: BigInt) {
this.set("txCount", Value.fromBigInt(value));
}
get poolCount(): BigInt {
let value = this.get("poolCount");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set poolCount(value: BigInt) {
this.set("poolCount", Value.fromBigInt(value));
}
get totalValueLocked(): BigDecimal {
let value = this.get("totalValueLocked");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalValueLocked(value: BigDecimal) {
this.set("totalValueLocked", Value.fromBigDecimal(value));
}
get totalValueLockedUSD(): BigDecimal {
let value = this.get("totalValueLockedUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalValueLockedUSD(value: BigDecimal) {
this.set("totalValueLockedUSD", Value.fromBigDecimal(value));
}
get totalValueLockedUSDUntracked(): BigDecimal {
let value = this.get("totalValueLockedUSDUntracked");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalValueLockedUSDUntracked(value: BigDecimal) {
this.set("totalValueLockedUSDUntracked", Value.fromBigDecimal(value));
}
get derivedETH(): BigDecimal {
let value = this.get("derivedETH");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set derivedETH(value: BigDecimal) {
this.set("derivedETH", Value.fromBigDecimal(value));
}
get whitelistPools(): Array<string> {
let value = this.get("whitelistPools");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toStringArray();
}
}
set whitelistPools(value: Array<string>) {
this.set("whitelistPools", Value.fromStringArray(value));
}
get tokenDayData(): TokenDayDataLoader {
return new TokenDayDataLoader(
"Token",
this.get("id")!.toString(),
"tokenDayData",
);
}
get tokenHourData(): TokenHourDataLoader {
return new TokenHourDataLoader(
"Token",
this.get("id")!.toString(),
"tokenHourData",
);
}
get token5MinData(): Token5MinDataLoader {
return new Token5MinDataLoader(
"Token",
this.get("id")!.toString(),
"token5MinData",
);
}
}
export class Pool extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id != null, "Cannot save Pool entity without an ID");
if (id) {
assert(
id.kind == ValueKind.STRING,
`Entities of type Pool must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
);
store.set("Pool", id.toString(), this);
}
}
static loadInBlock(id: string): Pool | null {
return changetype<Pool | null>(store.get_in_block("Pool", id));
}
static load(id: string): Pool | null {
return changetype<Pool | null>(store.get("Pool", id));
}
get id(): string {
let value = this.get("id");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get createdAtTimestamp(): BigInt {
let value = this.get("createdAtTimestamp");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set createdAtTimestamp(value: BigInt) {
this.set("createdAtTimestamp", Value.fromBigInt(value));
}
get createdAtBlockNumber(): BigInt {
let value = this.get("createdAtBlockNumber");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set createdAtBlockNumber(value: BigInt) {
this.set("createdAtBlockNumber", Value.fromBigInt(value));
}
get token0(): string {
let value = this.get("token0");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set token0(value: string) {
this.set("token0", Value.fromString(value));
}
get token1(): string {
let value = this.get("token1");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set token1(value: string) {
this.set("token1", Value.fromString(value));
}
get feeTier(): BigInt {
let value = this.get("feeTier");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set feeTier(value: BigInt) {
this.set("feeTier", Value.fromBigInt(value));
}
get liquidity(): BigInt {
let value = this.get("liquidity");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set liquidity(value: BigInt) {
this.set("liquidity", Value.fromBigInt(value));
}
get sqrtPrice(): BigInt {
let value = this.get("sqrtPrice");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set sqrtPrice(value: BigInt) {
this.set("sqrtPrice", Value.fromBigInt(value));
}
get token0Price(): BigDecimal {
let value = this.get("token0Price");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set token0Price(value: BigDecimal) {
this.set("token0Price", Value.fromBigDecimal(value));
}
get token1Price(): BigDecimal {
let value = this.get("token1Price");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set token1Price(value: BigDecimal) {
this.set("token1Price", Value.fromBigDecimal(value));
}
get tick(): BigInt | null {
let value = this.get("tick");
if (!value || value.kind == ValueKind.NULL) {
return null;
} else {
return value.toBigInt();
}
}
set tick(value: BigInt | null) {
if (!value) {
this.unset("tick");
} else {
this.set("tick", Value.fromBigInt(<BigInt>value));
}
}
get observationIndex(): BigInt {
let value = this.get("observationIndex");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set observationIndex(value: BigInt) {
this.set("observationIndex", Value.fromBigInt(value));
}
get volumeToken0(): BigDecimal {
let value = this.get("volumeToken0");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set volumeToken0(value: BigDecimal) {
this.set("volumeToken0", Value.fromBigDecimal(value));
}
get volumeToken1(): BigDecimal {
let value = this.get("volumeToken1");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set volumeToken1(value: BigDecimal) {
this.set("volumeToken1", Value.fromBigDecimal(value));
}
get volumeUSD(): BigDecimal {
let value = this.get("volumeUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set volumeUSD(value: BigDecimal) {
this.set("volumeUSD", Value.fromBigDecimal(value));
}
get untrackedVolumeUSD(): BigDecimal {
let value = this.get("untrackedVolumeUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set untrackedVolumeUSD(value: BigDecimal) {
this.set("untrackedVolumeUSD", Value.fromBigDecimal(value));
}
get feesUSD(): BigDecimal {
let value = this.get("feesUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set feesUSD(value: BigDecimal) {
this.set("feesUSD", Value.fromBigDecimal(value));
}
get txCount(): BigInt {
let value = this.get("txCount");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set txCount(value: BigInt) {
this.set("txCount", Value.fromBigInt(value));
}
get collectedFeesToken0(): BigDecimal {
let value = this.get("collectedFeesToken0");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set collectedFeesToken0(value: BigDecimal) {
this.set("collectedFeesToken0", Value.fromBigDecimal(value));
}
get collectedFeesToken1(): BigDecimal {
let value = this.get("collectedFeesToken1");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set collectedFeesToken1(value: BigDecimal) {
this.set("collectedFeesToken1", Value.fromBigDecimal(value));
}
get collectedFeesUSD(): BigDecimal {
let value = this.get("collectedFeesUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set collectedFeesUSD(value: BigDecimal) {
this.set("collectedFeesUSD", Value.fromBigDecimal(value));
}
get totalValueLockedToken0(): BigDecimal {
let value = this.get("totalValueLockedToken0");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalValueLockedToken0(value: BigDecimal) {
this.set("totalValueLockedToken0", Value.fromBigDecimal(value));
}
get totalValueLockedToken1(): BigDecimal {
let value = this.get("totalValueLockedToken1");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalValueLockedToken1(value: BigDecimal) {
this.set("totalValueLockedToken1", Value.fromBigDecimal(value));
}
get totalValueLockedETH(): BigDecimal {
let value = this.get("totalValueLockedETH");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalValueLockedETH(value: BigDecimal) {
this.set("totalValueLockedETH", Value.fromBigDecimal(value));
}
get totalValueLockedUSD(): BigDecimal {
let value = this.get("totalValueLockedUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalValueLockedUSD(value: BigDecimal) {
this.set("totalValueLockedUSD", Value.fromBigDecimal(value));
}
get totalValueLockedUSDUntracked(): BigDecimal {
let value = this.get("totalValueLockedUSDUntracked");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalValueLockedUSDUntracked(value: BigDecimal) {
this.set("totalValueLockedUSDUntracked", Value.fromBigDecimal(value));
}
get liquidityProviderCount(): BigInt {
let value = this.get("liquidityProviderCount");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set liquidityProviderCount(value: BigInt) {
this.set("liquidityProviderCount", Value.fromBigInt(value));
}
get poolHourData(): PoolHourDataLoader {
return new PoolHourDataLoader(
"Pool",
this.get("id")!.toString(),
"poolHourData",
);
}
get poolDayData(): PoolDayDataLoader {
return new PoolDayDataLoader(
"Pool",
this.get("id")!.toString(),
"poolDayData",
);
}
get mints(): MintLoader {
return new MintLoader("Pool", this.get("id")!.toString(), "mints");
}
get burns(): BurnLoader {
return new BurnLoader("Pool", this.get("id")!.toString(), "burns");
}
get swaps(): SwapLoader {
return new SwapLoader("Pool", this.get("id")!.toString(), "swaps");
}
get collects(): CollectLoader {
return new CollectLoader("Pool", this.get("id")!.toString(), "collects");
}
get ticks(): TickLoader {
return new TickLoader("Pool", this.get("id")!.toString(), "ticks");
}
}
export class Tick extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id != null, "Cannot save Tick entity without an ID");
if (id) {
assert(
id.kind == ValueKind.STRING,
`Entities of type Tick must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
);
store.set("Tick", id.toString(), this);
}
}
static loadInBlock(id: string): Tick | null {
return changetype<Tick | null>(store.get_in_block("Tick", id));
}
static load(id: string): Tick | null {
return changetype<Tick | null>(store.get("Tick", id));
}
get id(): string {
let value = this.get("id");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get poolAddress(): string | null {
let value = this.get("poolAddress");
if (!value || value.kind == ValueKind.NULL) {
return null;
} else {
return value.toString();
}
}
set poolAddress(value: string | null) {
if (!value) {
this.unset("poolAddress");
} else {
this.set("poolAddress", Value.fromString(<string>value));
}
}
get tickIdx(): BigInt {
let value = this.get("tickIdx");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set tickIdx(value: BigInt) {
this.set("tickIdx", Value.fromBigInt(value));
}
get pool(): string {
let value = this.get("pool");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set pool(value: string) {
this.set("pool", Value.fromString(value));
}
get liquidityGross(): BigInt {
let value = this.get("liquidityGross");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set liquidityGross(value: BigInt) {
this.set("liquidityGross", Value.fromBigInt(value));
}
get liquidityNet(): BigInt {
let value = this.get("liquidityNet");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set liquidityNet(value: BigInt) {
this.set("liquidityNet", Value.fromBigInt(value));
}
get price0(): BigDecimal {
let value = this.get("price0");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set price0(value: BigDecimal) {
this.set("price0", Value.fromBigDecimal(value));
}
get price1(): BigDecimal {
let value = this.get("price1");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set price1(value: BigDecimal) {
this.set("price1", Value.fromBigDecimal(value));
}
get createdAtTimestamp(): BigInt {
let value = this.get("createdAtTimestamp");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set createdAtTimestamp(value: BigInt) {
this.set("createdAtTimestamp", Value.fromBigInt(value));
}
get createdAtBlockNumber(): BigInt {
let value = this.get("createdAtBlockNumber");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set createdAtBlockNumber(value: BigInt) {
this.set("createdAtBlockNumber", Value.fromBigInt(value));
}
}
export class Transaction extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id != null, "Cannot save Transaction entity without an ID");
if (id) {
assert(
id.kind == ValueKind.STRING,
`Entities of type Transaction must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
);
store.set("Transaction", id.toString(), this);
}
}
static loadInBlock(id: string): Transaction | null {
return changetype<Transaction | null>(
store.get_in_block("Transaction", id),
);
}
static load(id: string): Transaction | null {
return changetype<Transaction | null>(store.get("Transaction", id));
}
get id(): string {
let value = this.get("id");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get blockNumber(): BigInt {
let value = this.get("blockNumber");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set blockNumber(value: BigInt) {
this.set("blockNumber", Value.fromBigInt(value));
}
get timestamp(): BigInt {
let value = this.get("timestamp");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set timestamp(value: BigInt) {
this.set("timestamp", Value.fromBigInt(value));
}
get gasUsed(): BigInt {
let value = this.get("gasUsed");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set gasUsed(value: BigInt) {
this.set("gasUsed", Value.fromBigInt(value));
}
get gasPrice(): BigInt {
let value = this.get("gasPrice");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set gasPrice(value: BigInt) {
this.set("gasPrice", Value.fromBigInt(value));
}
get mints(): MintLoader {
return new MintLoader("Transaction", this.get("id")!.toString(), "mints");
}
get burns(): BurnLoader {
return new BurnLoader("Transaction", this.get("id")!.toString(), "burns");
}
get swaps(): SwapLoader {
return new SwapLoader("Transaction", this.get("id")!.toString(), "swaps");
}
get flashed(): FlashLoader {
return new FlashLoader(
"Transaction",
this.get("id")!.toString(),
"flashed",
);
}
get collects(): CollectLoader {
return new CollectLoader(
"Transaction",
this.get("id")!.toString(),
"collects",
);
}
}
export class Mint extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id != null, "Cannot save Mint entity without an ID");
if (id) {
assert(
id.kind == ValueKind.STRING,
`Entities of type Mint must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
);
store.set("Mint", id.toString(), this);
}
}
static loadInBlock(id: string): Mint | null {
return changetype<Mint | null>(store.get_in_block("Mint", id));
}
static load(id: string): Mint | null {
return changetype<Mint | null>(store.get("Mint", id));
}
get id(): string {
let value = this.get("id");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get transaction(): string {
let value = this.get("transaction");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set transaction(value: string) {
this.set("transaction", Value.fromString(value));
}
get timestamp(): BigInt {
let value = this.get("timestamp");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set timestamp(value: BigInt) {
this.set("timestamp", Value.fromBigInt(value));
}
get pool(): string {
let value = this.get("pool");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set pool(value: string) {
this.set("pool", Value.fromString(value));
}
get token0(): string {
let value = this.get("token0");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set token0(value: string) {
this.set("token0", Value.fromString(value));
}
get token1(): string {
let value = this.get("token1");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set token1(value: string) {
this.set("token1", Value.fromString(value));
}
get owner(): Bytes {
let value = this.get("owner");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBytes();
}
}
set owner(value: Bytes) {
this.set("owner", Value.fromBytes(value));
}
get sender(): Bytes | null {
let value = this.get("sender");
if (!value || value.kind == ValueKind.NULL) {
return null;
} else {
return value.toBytes();
}
}
set sender(value: Bytes | null) {
if (!value) {
this.unset("sender");
} else {
this.set("sender", Value.fromBytes(<Bytes>value));
}
}
get origin(): Bytes {
let value = this.get("origin");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBytes();
}
}
set origin(value: Bytes) {
this.set("origin", Value.fromBytes(value));
}
get amount(): BigInt {
let value = this.get("amount");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set amount(value: BigInt) {
this.set("amount", Value.fromBigInt(value));
}
get amount0(): BigDecimal {
let value = this.get("amount0");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set amount0(value: BigDecimal) {
this.set("amount0", Value.fromBigDecimal(value));
}
get amount1(): BigDecimal {
let value = this.get("amount1");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set amount1(value: BigDecimal) {
this.set("amount1", Value.fromBigDecimal(value));
}
get amountUSD(): BigDecimal | null {
let value = this.get("amountUSD");
if (!value || value.kind == ValueKind.NULL) {
return null;
} else {
return value.toBigDecimal();
}
}
set amountUSD(value: BigDecimal | null) {
if (!value) {
this.unset("amountUSD");
} else {
this.set("amountUSD", Value.fromBigDecimal(<BigDecimal>value));
}
}
get tickLower(): BigInt {
let value = this.get("tickLower");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set tickLower(value: BigInt) {
this.set("tickLower", Value.fromBigInt(value));
}
get tickUpper(): BigInt {
let value = this.get("tickUpper");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set tickUpper(value: BigInt) {
this.set("tickUpper", Value.fromBigInt(value));
}
get logIndex(): BigInt | null {
let value = this.get("logIndex");
if (!value || value.kind == ValueKind.NULL) {
return null;
} else {
return value.toBigInt();
}
}
set logIndex(value: BigInt | null) {
if (!value) {
this.unset("logIndex");
} else {
this.set("logIndex", Value.fromBigInt(<BigInt>value));
}
}
}
export class Burn extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id != null, "Cannot save Burn entity without an ID");
if (id) {
assert(
id.kind == ValueKind.STRING,
`Entities of type Burn must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
);
store.set("Burn", id.toString(), this);
}
}
static loadInBlock(id: string): Burn | null {
return changetype<Burn | null>(store.get_in_block("Burn", id));
}
static load(id: string): Burn | null {
return changetype<Burn | null>(store.get("Burn", id));
}
get id(): string {
let value = this.get("id");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get transaction(): string {
let value = this.get("transaction");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set transaction(value: string) {
this.set("transaction", Value.fromString(value));
}
get pool(): string {
let value = this.get("pool");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set pool(value: string) {
this.set("pool", Value.fromString(value));
}
get token0(): string {
let value = this.get("token0");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set token0(value: string) {
this.set("token0", Value.fromString(value));
}
get token1(): string {
let value = this.get("token1");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set token1(value: string) {
this.set("token1", Value.fromString(value));
}
get timestamp(): BigInt {
let value = this.get("timestamp");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set timestamp(value: BigInt) {
this.set("timestamp", Value.fromBigInt(value));
}
get owner(): Bytes | null {
let value = this.get("owner");
if (!value || value.kind == ValueKind.NULL) {
return null;
} else {
return value.toBytes();
}
}
set owner(value: Bytes | null) {
if (!value) {
this.unset("owner");
} else {
this.set("owner", Value.fromBytes(<Bytes>value));
}
}
get origin(): Bytes {
let value = this.get("origin");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBytes();
}
}
set origin(value: Bytes) {
this.set("origin", Value.fromBytes(value));
}
get amount(): BigInt {
let value = this.get("amount");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set amount(value: BigInt) {
this.set("amount", Value.fromBigInt(value));
}
get amount0(): BigDecimal {
let value = this.get("amount0");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set amount0(value: BigDecimal) {
this.set("amount0", Value.fromBigDecimal(value));
}
get amount1(): BigDecimal {
let value = this.get("amount1");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set amount1(value: BigDecimal) {
this.set("amount1", Value.fromBigDecimal(value));
}
get amountUSD(): BigDecimal | null {
let value = this.get("amountUSD");
if (!value || value.kind == ValueKind.NULL) {
return null;
} else {
return value.toBigDecimal();
}
}
set amountUSD(value: BigDecimal | null) {
if (!value) {
this.unset("amountUSD");
} else {
this.set("amountUSD", Value.fromBigDecimal(<BigDecimal>value));
}
}
get tickLower(): BigInt {
let value = this.get("tickLower");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set tickLower(value: BigInt) {
this.set("tickLower", Value.fromBigInt(value));
}
get tickUpper(): BigInt {
let value = this.get("tickUpper");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set tickUpper(value: BigInt) {
this.set("tickUpper", Value.fromBigInt(value));
}
get logIndex(): BigInt | null {
let value = this.get("logIndex");
if (!value || value.kind == ValueKind.NULL) {
return null;
} else {
return value.toBigInt();
}
}
set logIndex(value: BigInt | null) {
if (!value) {
this.unset("logIndex");
} else {
this.set("logIndex", Value.fromBigInt(<BigInt>value));
}
}
}
export class Swap extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id != null, "Cannot save Swap entity without an ID");
if (id) {
assert(
id.kind == ValueKind.STRING,
`Entities of type Swap must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
);
store.set("Swap", id.toString(), this);
}
}
static loadInBlock(id: string): Swap | null {
return changetype<Swap | null>(store.get_in_block("Swap", id));
}
static load(id: string): Swap | null {
return changetype<Swap | null>(store.get("Swap", id));
}
get id(): string {
let value = this.get("id");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get transaction(): string {
let value = this.get("transaction");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set transaction(value: string) {
this.set("transaction", Value.fromString(value));
}
get timestamp(): BigInt {
let value = this.get("timestamp");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set timestamp(value: BigInt) {
this.set("timestamp", Value.fromBigInt(value));
}
get pool(): string {
let value = this.get("pool");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set pool(value: string) {
this.set("pool", Value.fromString(value));
}
get token0(): string {
let value = this.get("token0");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set token0(value: string) {
this.set("token0", Value.fromString(value));
}
get token1(): string {
let value = this.get("token1");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set token1(value: string) {
this.set("token1", Value.fromString(value));
}
get sender(): Bytes {
let value = this.get("sender");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBytes();
}
}
set sender(value: Bytes) {
this.set("sender", Value.fromBytes(value));
}
get recipient(): Bytes {
let value = this.get("recipient");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBytes();
}
}
set recipient(value: Bytes) {
this.set("recipient", Value.fromBytes(value));
}
get origin(): Bytes {
let value = this.get("origin");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBytes();
}
}
set origin(value: Bytes) {
this.set("origin", Value.fromBytes(value));
}
get amount0(): BigDecimal {
let value = this.get("amount0");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set amount0(value: BigDecimal) {
this.set("amount0", Value.fromBigDecimal(value));
}
get amount1(): BigDecimal {
let value = this.get("amount1");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set amount1(value: BigDecimal) {
this.set("amount1", Value.fromBigDecimal(value));
}
get amountUSD(): BigDecimal {
let value = this.get("amountUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set amountUSD(value: BigDecimal) {
this.set("amountUSD", Value.fromBigDecimal(value));
}
get sqrtPriceX96(): BigInt {
let value = this.get("sqrtPriceX96");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set sqrtPriceX96(value: BigInt) {
this.set("sqrtPriceX96", Value.fromBigInt(value));
}
get tick(): BigInt {
let value = this.get("tick");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set tick(value: BigInt) {
this.set("tick", Value.fromBigInt(value));
}
get logIndex(): BigInt | null {
let value = this.get("logIndex");
if (!value || value.kind == ValueKind.NULL) {
return null;
} else {
return value.toBigInt();
}
}
set logIndex(value: BigInt | null) {
if (!value) {
this.unset("logIndex");
} else {
this.set("logIndex", Value.fromBigInt(<BigInt>value));
}
}
}
export class Collect extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id != null, "Cannot save Collect entity without an ID");
if (id) {
assert(
id.kind == ValueKind.STRING,
`Entities of type Collect must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
);
store.set("Collect", id.toString(), this);
}
}
static loadInBlock(id: string): Collect | null {
return changetype<Collect | null>(store.get_in_block("Collect", id));
}
static load(id: string): Collect | null {
return changetype<Collect | null>(store.get("Collect", id));
}
get id(): string {
let value = this.get("id");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get transaction(): string {
let value = this.get("transaction");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set transaction(value: string) {
this.set("transaction", Value.fromString(value));
}
get timestamp(): BigInt {
let value = this.get("timestamp");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set timestamp(value: BigInt) {
this.set("timestamp", Value.fromBigInt(value));
}
get pool(): string {
let value = this.get("pool");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set pool(value: string) {
this.set("pool", Value.fromString(value));
}
get owner(): Bytes | null {
let value = this.get("owner");
if (!value || value.kind == ValueKind.NULL) {
return null;
} else {
return value.toBytes();
}
}
set owner(value: Bytes | null) {
if (!value) {
this.unset("owner");
} else {
this.set("owner", Value.fromBytes(<Bytes>value));
}
}
get amount0(): BigDecimal {
let value = this.get("amount0");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set amount0(value: BigDecimal) {
this.set("amount0", Value.fromBigDecimal(value));
}
get amount1(): BigDecimal {
let value = this.get("amount1");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set amount1(value: BigDecimal) {
this.set("amount1", Value.fromBigDecimal(value));
}
get amountUSD(): BigDecimal | null {
let value = this.get("amountUSD");
if (!value || value.kind == ValueKind.NULL) {
return null;
} else {
return value.toBigDecimal();
}
}
set amountUSD(value: BigDecimal | null) {
if (!value) {
this.unset("amountUSD");
} else {
this.set("amountUSD", Value.fromBigDecimal(<BigDecimal>value));
}
}
get tickLower(): BigInt {
let value = this.get("tickLower");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set tickLower(value: BigInt) {
this.set("tickLower", Value.fromBigInt(value));
}
get tickUpper(): BigInt {
let value = this.get("tickUpper");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set tickUpper(value: BigInt) {
this.set("tickUpper", Value.fromBigInt(value));
}
get logIndex(): BigInt | null {
let value = this.get("logIndex");
if (!value || value.kind == ValueKind.NULL) {
return null;
} else {
return value.toBigInt();
}
}
set logIndex(value: BigInt | null) {
if (!value) {
this.unset("logIndex");
} else {
this.set("logIndex", Value.fromBigInt(<BigInt>value));
}
}
}
export class Flash extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id != null, "Cannot save Flash entity without an ID");
if (id) {
assert(
id.kind == ValueKind.STRING,
`Entities of type Flash must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
);
store.set("Flash", id.toString(), this);
}
}
static loadInBlock(id: string): Flash | null {
return changetype<Flash | null>(store.get_in_block("Flash", id));
}
static load(id: string): Flash | null {
return changetype<Flash | null>(store.get("Flash", id));
}
get id(): string {
let value = this.get("id");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get transaction(): string {
let value = this.get("transaction");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set transaction(value: string) {
this.set("transaction", Value.fromString(value));
}
get timestamp(): BigInt {
let value = this.get("timestamp");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set timestamp(value: BigInt) {
this.set("timestamp", Value.fromBigInt(value));
}
get pool(): string {
let value = this.get("pool");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set pool(value: string) {
this.set("pool", Value.fromString(value));
}
get sender(): Bytes {
let value = this.get("sender");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBytes();
}
}
set sender(value: Bytes) {
this.set("sender", Value.fromBytes(value));
}
get recipient(): Bytes {
let value = this.get("recipient");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBytes();
}
}
set recipient(value: Bytes) {
this.set("recipient", Value.fromBytes(value));
}
get amount0(): BigDecimal {
let value = this.get("amount0");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set amount0(value: BigDecimal) {
this.set("amount0", Value.fromBigDecimal(value));
}
get amount1(): BigDecimal {
let value = this.get("amount1");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set amount1(value: BigDecimal) {
this.set("amount1", Value.fromBigDecimal(value));
}
get amountUSD(): BigDecimal {
let value = this.get("amountUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set amountUSD(value: BigDecimal) {
this.set("amountUSD", Value.fromBigDecimal(value));
}
get amount0Paid(): BigDecimal {
let value = this.get("amount0Paid");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set amount0Paid(value: BigDecimal) {
this.set("amount0Paid", Value.fromBigDecimal(value));
}
get amount1Paid(): BigDecimal {
let value = this.get("amount1Paid");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set amount1Paid(value: BigDecimal) {
this.set("amount1Paid", Value.fromBigDecimal(value));
}
get logIndex(): BigInt | null {
let value = this.get("logIndex");
if (!value || value.kind == ValueKind.NULL) {
return null;
} else {
return value.toBigInt();
}
}
set logIndex(value: BigInt | null) {
if (!value) {
this.unset("logIndex");
} else {
this.set("logIndex", Value.fromBigInt(<BigInt>value));
}
}
}
export class UniswapDayData extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id != null, "Cannot save UniswapDayData entity without an ID");
if (id) {
assert(
id.kind == ValueKind.STRING,
`Entities of type UniswapDayData must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
);
store.set("UniswapDayData", id.toString(), this);
}
}
static loadInBlock(id: string): UniswapDayData | null {
return changetype<UniswapDayData | null>(
store.get_in_block("UniswapDayData", id),
);
}
static load(id: string): UniswapDayData | null {
return changetype<UniswapDayData | null>(store.get("UniswapDayData", id));
}
get id(): string {
let value = this.get("id");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get date(): i32 {
let value = this.get("date");
if (!value || value.kind == ValueKind.NULL) {
return 0;
} else {
return value.toI32();
}
}
set date(value: i32) {
this.set("date", Value.fromI32(value));
}
get volumeETH(): BigDecimal {
let value = this.get("volumeETH");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set volumeETH(value: BigDecimal) {
this.set("volumeETH", Value.fromBigDecimal(value));
}
get volumeUSD(): BigDecimal {
let value = this.get("volumeUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set volumeUSD(value: BigDecimal) {
this.set("volumeUSD", Value.fromBigDecimal(value));
}
get volumeUSDUntracked(): BigDecimal {
let value = this.get("volumeUSDUntracked");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set volumeUSDUntracked(value: BigDecimal) {
this.set("volumeUSDUntracked", Value.fromBigDecimal(value));
}
get feesUSD(): BigDecimal {
let value = this.get("feesUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set feesUSD(value: BigDecimal) {
this.set("feesUSD", Value.fromBigDecimal(value));
}
get txCount(): BigInt {
let value = this.get("txCount");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set txCount(value: BigInt) {
this.set("txCount", Value.fromBigInt(value));
}
get tvlUSD(): BigDecimal {
let value = this.get("tvlUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set tvlUSD(value: BigDecimal) {
this.set("tvlUSD", Value.fromBigDecimal(value));
}
}
export class PoolDayData extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id != null, "Cannot save PoolDayData entity without an ID");
if (id) {
assert(
id.kind == ValueKind.STRING,
`Entities of type PoolDayData must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
);
store.set("PoolDayData", id.toString(), this);
}
}
static loadInBlock(id: string): PoolDayData | null {
return changetype<PoolDayData | null>(
store.get_in_block("PoolDayData", id),
);
}
static load(id: string): PoolDayData | null {
return changetype<PoolDayData | null>(store.get("PoolDayData", id));
}
get id(): string {
let value = this.get("id");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get date(): i32 {
let value = this.get("date");
if (!value || value.kind == ValueKind.NULL) {
return 0;
} else {
return value.toI32();
}
}
set date(value: i32) {
this.set("date", Value.fromI32(value));
}
get pool(): string {
let value = this.get("pool");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set pool(value: string) {
this.set("pool", Value.fromString(value));
}
get liquidity(): BigInt {
let value = this.get("liquidity");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set liquidity(value: BigInt) {
this.set("liquidity", Value.fromBigInt(value));
}
get sqrtPrice(): BigInt {
let value = this.get("sqrtPrice");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set sqrtPrice(value: BigInt) {
this.set("sqrtPrice", Value.fromBigInt(value));
}
get token0Price(): BigDecimal {
let value = this.get("token0Price");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set token0Price(value: BigDecimal) {
this.set("token0Price", Value.fromBigDecimal(value));
}
get token1Price(): BigDecimal {
let value = this.get("token1Price");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set token1Price(value: BigDecimal) {
this.set("token1Price", Value.fromBigDecimal(value));
}
get tick(): BigInt | null {
let value = this.get("tick");
if (!value || value.kind == ValueKind.NULL) {
return null;
} else {
return value.toBigInt();
}
}
set tick(value: BigInt | null) {
if (!value) {
this.unset("tick");
} else {
this.set("tick", Value.fromBigInt(<BigInt>value));
}
}
get tvlUSD(): BigDecimal {
let value = this.get("tvlUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set tvlUSD(value: BigDecimal) {
this.set("tvlUSD", Value.fromBigDecimal(value));
}
get volumeToken0(): BigDecimal {
let value = this.get("volumeToken0");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set volumeToken0(value: BigDecimal) {
this.set("volumeToken0", Value.fromBigDecimal(value));
}
get volumeToken1(): BigDecimal {
let value = this.get("volumeToken1");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set volumeToken1(value: BigDecimal) {
this.set("volumeToken1", Value.fromBigDecimal(value));
}
get volumeUSD(): BigDecimal {
let value = this.get("volumeUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set volumeUSD(value: BigDecimal) {
this.set("volumeUSD", Value.fromBigDecimal(value));
}
get feesUSD(): BigDecimal {
let value = this.get("feesUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set feesUSD(value: BigDecimal) {
this.set("feesUSD", Value.fromBigDecimal(value));
}
get txCount(): BigInt {
let value = this.get("txCount");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set txCount(value: BigInt) {
this.set("txCount", Value.fromBigInt(value));
}
get open(): BigDecimal {
let value = this.get("open");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set open(value: BigDecimal) {
this.set("open", Value.fromBigDecimal(value));
}
get high(): BigDecimal {
let value = this.get("high");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set high(value: BigDecimal) {
this.set("high", Value.fromBigDecimal(value));
}
get low(): BigDecimal {
let value = this.get("low");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set low(value: BigDecimal) {
this.set("low", Value.fromBigDecimal(value));
}
get close(): BigDecimal {
let value = this.get("close");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set close(value: BigDecimal) {
this.set("close", Value.fromBigDecimal(value));
}
}
export class PoolHourData extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id != null, "Cannot save PoolHourData entity without an ID");
if (id) {
assert(
id.kind == ValueKind.STRING,
`Entities of type PoolHourData must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
);
store.set("PoolHourData", id.toString(), this);
}
}
static loadInBlock(id: string): PoolHourData | null {
return changetype<PoolHourData | null>(
store.get_in_block("PoolHourData", id),
);
}
static load(id: string): PoolHourData | null {
return changetype<PoolHourData | null>(store.get("PoolHourData", id));
}
get id(): string {
let value = this.get("id");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get periodStartUnix(): i32 {
let value = this.get("periodStartUnix");
if (!value || value.kind == ValueKind.NULL) {
return 0;
} else {
return value.toI32();
}
}
set periodStartUnix(value: i32) {
this.set("periodStartUnix", Value.fromI32(value));
}
get pool(): string {
let value = this.get("pool");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set pool(value: string) {
this.set("pool", Value.fromString(value));
}
get liquidity(): BigInt {
let value = this.get("liquidity");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set liquidity(value: BigInt) {
this.set("liquidity", Value.fromBigInt(value));
}
get sqrtPrice(): BigInt {
let value = this.get("sqrtPrice");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set sqrtPrice(value: BigInt) {
this.set("sqrtPrice", Value.fromBigInt(value));
}
get token0Price(): BigDecimal {
let value = this.get("token0Price");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set token0Price(value: BigDecimal) {
this.set("token0Price", Value.fromBigDecimal(value));
}
get token1Price(): BigDecimal {
let value = this.get("token1Price");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set token1Price(value: BigDecimal) {
this.set("token1Price", Value.fromBigDecimal(value));
}
get tick(): BigInt | null {
let value = this.get("tick");
if (!value || value.kind == ValueKind.NULL) {
return null;
} else {
return value.toBigInt();
}
}
set tick(value: BigInt | null) {
if (!value) {
this.unset("tick");
} else {
this.set("tick", Value.fromBigInt(<BigInt>value));
}
}
get tvlUSD(): BigDecimal {
let value = this.get("tvlUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set tvlUSD(value: BigDecimal) {
this.set("tvlUSD", Value.fromBigDecimal(value));
}
get volumeToken0(): BigDecimal {
let value = this.get("volumeToken0");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set volumeToken0(value: BigDecimal) {
this.set("volumeToken0", Value.fromBigDecimal(value));
}
get volumeToken1(): BigDecimal {
let value = this.get("volumeToken1");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set volumeToken1(value: BigDecimal) {
this.set("volumeToken1", Value.fromBigDecimal(value));
}
get volumeUSD(): BigDecimal {
let value = this.get("volumeUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set volumeUSD(value: BigDecimal) {
this.set("volumeUSD", Value.fromBigDecimal(value));
}
get feesUSD(): BigDecimal {
let value = this.get("feesUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set feesUSD(value: BigDecimal) {
this.set("feesUSD", Value.fromBigDecimal(value));
}
get txCount(): BigInt {
let value = this.get("txCount");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigInt();
}
}
set txCount(value: BigInt) {
this.set("txCount", Value.fromBigInt(value));
}
get open(): BigDecimal {
let value = this.get("open");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set open(value: BigDecimal) {
this.set("open", Value.fromBigDecimal(value));
}
get high(): BigDecimal {
let value = this.get("high");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set high(value: BigDecimal) {
this.set("high", Value.fromBigDecimal(value));
}
get low(): BigDecimal {
let value = this.get("low");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set low(value: BigDecimal) {
this.set("low", Value.fromBigDecimal(value));
}
get close(): BigDecimal {
let value = this.get("close");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set close(value: BigDecimal) {
this.set("close", Value.fromBigDecimal(value));
}
}
export class TokenDayData extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id != null, "Cannot save TokenDayData entity without an ID");
if (id) {
assert(
id.kind == ValueKind.STRING,
`Entities of type TokenDayData must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
);
store.set("TokenDayData", id.toString(), this);
}
}
static loadInBlock(id: string): TokenDayData | null {
return changetype<TokenDayData | null>(
store.get_in_block("TokenDayData", id),
);
}
static load(id: string): TokenDayData | null {
return changetype<TokenDayData | null>(store.get("TokenDayData", id));
}
get id(): string {
let value = this.get("id");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get date(): i32 {
let value = this.get("date");
if (!value || value.kind == ValueKind.NULL) {
return 0;
} else {
return value.toI32();
}
}
set date(value: i32) {
this.set("date", Value.fromI32(value));
}
get token(): string {
let value = this.get("token");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set token(value: string) {
this.set("token", Value.fromString(value));
}
get volume(): BigDecimal {
let value = this.get("volume");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set volume(value: BigDecimal) {
this.set("volume", Value.fromBigDecimal(value));
}
get volumeUSD(): BigDecimal {
let value = this.get("volumeUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set volumeUSD(value: BigDecimal) {
this.set("volumeUSD", Value.fromBigDecimal(value));
}
get untrackedVolumeUSD(): BigDecimal {
let value = this.get("untrackedVolumeUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set untrackedVolumeUSD(value: BigDecimal) {
this.set("untrackedVolumeUSD", Value.fromBigDecimal(value));
}
get totalValueLocked(): BigDecimal {
let value = this.get("totalValueLocked");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalValueLocked(value: BigDecimal) {
this.set("totalValueLocked", Value.fromBigDecimal(value));
}
get totalValueLockedUSD(): BigDecimal {
let value = this.get("totalValueLockedUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalValueLockedUSD(value: BigDecimal) {
this.set("totalValueLockedUSD", Value.fromBigDecimal(value));
}
get priceUSD(): BigDecimal {
let value = this.get("priceUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set priceUSD(value: BigDecimal) {
this.set("priceUSD", Value.fromBigDecimal(value));
}
get feesUSD(): BigDecimal {
let value = this.get("feesUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set feesUSD(value: BigDecimal) {
this.set("feesUSD", Value.fromBigDecimal(value));
}
get open(): BigDecimal {
let value = this.get("open");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set open(value: BigDecimal) {
this.set("open", Value.fromBigDecimal(value));
}
get high(): BigDecimal {
let value = this.get("high");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set high(value: BigDecimal) {
this.set("high", Value.fromBigDecimal(value));
}
get low(): BigDecimal {
let value = this.get("low");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set low(value: BigDecimal) {
this.set("low", Value.fromBigDecimal(value));
}
get close(): BigDecimal {
let value = this.get("close");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set close(value: BigDecimal) {
this.set("close", Value.fromBigDecimal(value));
}
}
export class TokenHourData extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id != null, "Cannot save TokenHourData entity without an ID");
if (id) {
assert(
id.kind == ValueKind.STRING,
`Entities of type TokenHourData must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
);
store.set("TokenHourData", id.toString(), this);
}
}
static loadInBlock(id: string): TokenHourData | null {
return changetype<TokenHourData | null>(
store.get_in_block("TokenHourData", id),
);
}
static load(id: string): TokenHourData | null {
return changetype<TokenHourData | null>(store.get("TokenHourData", id));
}
get id(): string {
let value = this.get("id");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get periodStartUnix(): i32 {
let value = this.get("periodStartUnix");
if (!value || value.kind == ValueKind.NULL) {
return 0;
} else {
return value.toI32();
}
}
set periodStartUnix(value: i32) {
this.set("periodStartUnix", Value.fromI32(value));
}
get token(): string {
let value = this.get("token");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set token(value: string) {
this.set("token", Value.fromString(value));
}
get volume(): BigDecimal {
let value = this.get("volume");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set volume(value: BigDecimal) {
this.set("volume", Value.fromBigDecimal(value));
}
get volumeUSD(): BigDecimal {
let value = this.get("volumeUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set volumeUSD(value: BigDecimal) {
this.set("volumeUSD", Value.fromBigDecimal(value));
}
get untrackedVolumeUSD(): BigDecimal {
let value = this.get("untrackedVolumeUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set untrackedVolumeUSD(value: BigDecimal) {
this.set("untrackedVolumeUSD", Value.fromBigDecimal(value));
}
get totalValueLocked(): BigDecimal {
let value = this.get("totalValueLocked");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalValueLocked(value: BigDecimal) {
this.set("totalValueLocked", Value.fromBigDecimal(value));
}
get totalValueLockedUSD(): BigDecimal {
let value = this.get("totalValueLockedUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalValueLockedUSD(value: BigDecimal) {
this.set("totalValueLockedUSD", Value.fromBigDecimal(value));
}
get priceUSD(): BigDecimal {
let value = this.get("priceUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set priceUSD(value: BigDecimal) {
this.set("priceUSD", Value.fromBigDecimal(value));
}
get feesUSD(): BigDecimal {
let value = this.get("feesUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set feesUSD(value: BigDecimal) {
this.set("feesUSD", Value.fromBigDecimal(value));
}
get open(): BigDecimal {
let value = this.get("open");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set open(value: BigDecimal) {
this.set("open", Value.fromBigDecimal(value));
}
get high(): BigDecimal {
let value = this.get("high");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set high(value: BigDecimal) {
this.set("high", Value.fromBigDecimal(value));
}
get low(): BigDecimal {
let value = this.get("low");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set low(value: BigDecimal) {
this.set("low", Value.fromBigDecimal(value));
}
get close(): BigDecimal {
let value = this.get("close");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set close(value: BigDecimal) {
this.set("close", Value.fromBigDecimal(value));
}
}
export class Token5MinData extends Entity {
constructor(id: string) {
super();
this.set("id", Value.fromString(id));
}
save(): void {
let id = this.get("id");
assert(id != null, "Cannot save Token5MinData entity without an ID");
if (id) {
assert(
id.kind == ValueKind.STRING,
`Entities of type Token5MinData must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
);
store.set("Token5MinData", id.toString(), this);
}
}
static loadInBlock(id: string): Token5MinData | null {
return changetype<Token5MinData | null>(
store.get_in_block("Token5MinData", id),
);
}
static load(id: string): Token5MinData | null {
return changetype<Token5MinData | null>(store.get("Token5MinData", id));
}
get id(): string {
let value = this.get("id");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set id(value: string) {
this.set("id", Value.fromString(value));
}
get periodStartUnix(): i32 {
let value = this.get("periodStartUnix");
if (!value || value.kind == ValueKind.NULL) {
return 0;
} else {
return value.toI32();
}
}
set periodStartUnix(value: i32) {
this.set("periodStartUnix", Value.fromI32(value));
}
get token(): string {
let value = this.get("token");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toString();
}
}
set token(value: string) {
this.set("token", Value.fromString(value));
}
get volume(): BigDecimal {
let value = this.get("volume");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set volume(value: BigDecimal) {
this.set("volume", Value.fromBigDecimal(value));
}
get volumeUSD(): BigDecimal {
let value = this.get("volumeUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set volumeUSD(value: BigDecimal) {
this.set("volumeUSD", Value.fromBigDecimal(value));
}
get untrackedVolumeUSD(): BigDecimal {
let value = this.get("untrackedVolumeUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set untrackedVolumeUSD(value: BigDecimal) {
this.set("untrackedVolumeUSD", Value.fromBigDecimal(value));
}
get totalValueLocked(): BigDecimal {
let value = this.get("totalValueLocked");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalValueLocked(value: BigDecimal) {
this.set("totalValueLocked", Value.fromBigDecimal(value));
}
get totalValueLockedUSD(): BigDecimal {
let value = this.get("totalValueLockedUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set totalValueLockedUSD(value: BigDecimal) {
this.set("totalValueLockedUSD", Value.fromBigDecimal(value));
}
get priceUSD(): BigDecimal {
let value = this.get("priceUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set priceUSD(value: BigDecimal) {
this.set("priceUSD", Value.fromBigDecimal(value));
}
get feesUSD(): BigDecimal {
let value = this.get("feesUSD");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set feesUSD(value: BigDecimal) {
this.set("feesUSD", Value.fromBigDecimal(value));
}
get open(): BigDecimal {
let value = this.get("open");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set open(value: BigDecimal) {
this.set("open", Value.fromBigDecimal(value));
}
get high(): BigDecimal {
let value = this.get("high");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set high(value: BigDecimal) {
this.set("high", Value.fromBigDecimal(value));
}
get low(): BigDecimal {
let value = this.get("low");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set low(value: BigDecimal) {
this.set("low", Value.fromBigDecimal(value));
}
get close(): BigDecimal {
let value = this.get("close");
if (!value || value.kind == ValueKind.NULL) {
throw new Error("Cannot return null for a required field.");
} else {
return value.toBigDecimal();
}
}
set close(value: BigDecimal) {
this.set("close", Value.fromBigDecimal(value));
}
}
export class TokenDayDataLoader extends Entity {
_entity: string;
_field: string;
_id: string;
constructor(entity: string, id: string, field: string) {
super();
this._entity = entity;
this._id = id;
this._field = field;
}
load(): TokenDayData[] {
let value = store.loadRelated(this._entity, this._id, this._field);
return changetype<TokenDayData[]>(value);
}
}
export class TokenHourDataLoader extends Entity {
_entity: string;
_field: string;
_id: string;
constructor(entity: string, id: string, field: string) {
super();
this._entity = entity;
this._id = id;
this._field = field;
}
load(): TokenHourData[] {
let value = store.loadRelated(this._entity, this._id, this._field);
return changetype<TokenHourData[]>(value);
}
}
export class Token5MinDataLoader extends Entity {
_entity: string;
_field: string;
_id: string;
constructor(entity: string, id: string, field: string) {
super();
this._entity = entity;
this._id = id;
this._field = field;
}
load(): Token5MinData[] {
let value = store.loadRelated(this._entity, this._id, this._field);
return changetype<Token5MinData[]>(value);
}
}
export class PoolHourDataLoader extends Entity {
_entity: string;
_field: string;
_id: string;
constructor(entity: string, id: string, field: string) {
super();
this._entity = entity;
this._id = id;
this._field = field;
}
load(): PoolHourData[] {
let value = store.loadRelated(this._entity, this._id, this._field);
return changetype<PoolHourData[]>(value);
}
}
export class PoolDayDataLoader extends Entity {
_entity: string;
_field: string;
_id: string;
constructor(entity: string, id: string, field: string) {
super();
this._entity = entity;
this._id = id;
this._field = field;
}
load(): PoolDayData[] {
let value = store.loadRelated(this._entity, this._id, this._field);
return changetype<PoolDayData[]>(value);
}
}
export class MintLoader extends Entity {
_entity: string;
_field: string;
_id: string;
constructor(entity: string, id: string, field: string) {
super();
this._entity = entity;
this._id = id;
this._field = field;
}
load(): Mint[] {
let value = store.loadRelated(this._entity, this._id, this._field);
return changetype<Mint[]>(value);
}
}
export class BurnLoader extends Entity {
_entity: string;
_field: string;
_id: string;
constructor(entity: string, id: string, field: string) {
super();
this._entity = entity;
this._id = id;
this._field = field;
}
load(): Burn[] {
let value = store.loadRelated(this._entity, this._id, this._field);
return changetype<Burn[]>(value);
}
}
export class SwapLoader extends Entity {
_entity: string;
_field: string;
_id: string;
constructor(entity: string, id: string, field: string) {
super();
this._entity = entity;
this._id = id;
this._field = field;
}
load(): Swap[] {
let value = store.loadRelated(this._entity, this._id, this._field);
return changetype<Swap[]>(value);
}
}
export class CollectLoader extends Entity {
_entity: string;
_field: string;
_id: string;
constructor(entity: string, id: string, field: string) {
super();
this._entity = entity;
this._id = id;
this._field = field;
}
load(): Collect[] {
let value = store.loadRelated(this._entity, this._id, this._field);
return changetype<Collect[]>(value);
}
}
export class TickLoader extends Entity {
_entity: string;
_field: string;
_id: string;
constructor(entity: string, id: string, field: string) {
super();
this._entity = entity;
this._id = id;
this._field = field;
}
load(): Tick[] {
let value = store.loadRelated(this._entity, this._id, this._field);
return changetype<Tick[]>(value);
}
}
export class FlashLoader extends Entity {
_entity: string;
_field: string;
_id: string;
constructor(entity: string, id: string, field: string) {
super();
this._entity = entity;
this._id = id;
this._field = field;
}
load(): Flash[] {
let value = store.loadRelated(this._entity, this._id, this._field);
return changetype<Flash[]>(value);
}
}