mirror of
https://github.com/luxfi/uni-v2-subgraph.git
synced 2026-10-30 15:14:26 +00:00
2355 lines
58 KiB
TypeScript
2355 lines
58 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 UniswapFactory extends Entity {
|
|
constructor(id: string) {
|
|
super();
|
|
this.set("id", Value.fromString(id));
|
|
}
|
|
|
|
save(): void {
|
|
let id = this.get("id");
|
|
assert(id != null, "Cannot save UniswapFactory entity without an ID");
|
|
if (id) {
|
|
assert(
|
|
id.kind == ValueKind.STRING,
|
|
`Entities of type UniswapFactory must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
|
|
);
|
|
store.set("UniswapFactory", id.toString(), this);
|
|
}
|
|
}
|
|
|
|
static loadInBlock(id: string): UniswapFactory | null {
|
|
return changetype<UniswapFactory | null>(
|
|
store.get_in_block("UniswapFactory", id),
|
|
);
|
|
}
|
|
|
|
static load(id: string): UniswapFactory | null {
|
|
return changetype<UniswapFactory | null>(store.get("UniswapFactory", 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 pairCount(): i32 {
|
|
let value = this.get("pairCount");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
return 0;
|
|
} else {
|
|
return value.toI32();
|
|
}
|
|
}
|
|
|
|
set pairCount(value: i32) {
|
|
this.set("pairCount", Value.fromI32(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 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 totalLiquidityUSD(): BigDecimal {
|
|
let value = this.get("totalLiquidityUSD");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set totalLiquidityUSD(value: BigDecimal) {
|
|
this.set("totalLiquidityUSD", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get totalLiquidityETH(): BigDecimal {
|
|
let value = this.get("totalLiquidityETH");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set totalLiquidityETH(value: BigDecimal) {
|
|
this.set("totalLiquidityETH", 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));
|
|
}
|
|
}
|
|
|
|
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 tradeVolume(): BigDecimal {
|
|
let value = this.get("tradeVolume");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set tradeVolume(value: BigDecimal) {
|
|
this.set("tradeVolume", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get tradeVolumeUSD(): BigDecimal {
|
|
let value = this.get("tradeVolumeUSD");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set tradeVolumeUSD(value: BigDecimal) {
|
|
this.set("tradeVolumeUSD", 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 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 totalLiquidity(): BigDecimal {
|
|
let value = this.get("totalLiquidity");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set totalLiquidity(value: BigDecimal) {
|
|
this.set("totalLiquidity", 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 tokenDayData(): TokenDayDataLoader {
|
|
return new TokenDayDataLoader(
|
|
"Token",
|
|
this.get("id")!.toString(),
|
|
"tokenDayData",
|
|
);
|
|
}
|
|
|
|
get pairDayDataBase(): PairDayDataLoader {
|
|
return new PairDayDataLoader(
|
|
"Token",
|
|
this.get("id")!.toString(),
|
|
"pairDayDataBase",
|
|
);
|
|
}
|
|
|
|
get pairDayDataQuote(): PairDayDataLoader {
|
|
return new PairDayDataLoader(
|
|
"Token",
|
|
this.get("id")!.toString(),
|
|
"pairDayDataQuote",
|
|
);
|
|
}
|
|
|
|
get pairBase(): PairLoader {
|
|
return new PairLoader("Token", this.get("id")!.toString(), "pairBase");
|
|
}
|
|
|
|
get pairQuote(): PairLoader {
|
|
return new PairLoader("Token", this.get("id")!.toString(), "pairQuote");
|
|
}
|
|
}
|
|
|
|
export class Pair extends Entity {
|
|
constructor(id: string) {
|
|
super();
|
|
this.set("id", Value.fromString(id));
|
|
}
|
|
|
|
save(): void {
|
|
let id = this.get("id");
|
|
assert(id != null, "Cannot save Pair entity without an ID");
|
|
if (id) {
|
|
assert(
|
|
id.kind == ValueKind.STRING,
|
|
`Entities of type Pair must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
|
|
);
|
|
store.set("Pair", id.toString(), this);
|
|
}
|
|
}
|
|
|
|
static loadInBlock(id: string): Pair | null {
|
|
return changetype<Pair | null>(store.get_in_block("Pair", id));
|
|
}
|
|
|
|
static load(id: string): Pair | null {
|
|
return changetype<Pair | null>(store.get("Pair", 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 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 reserve0(): BigDecimal {
|
|
let value = this.get("reserve0");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set reserve0(value: BigDecimal) {
|
|
this.set("reserve0", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get reserve1(): BigDecimal {
|
|
let value = this.get("reserve1");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set reserve1(value: BigDecimal) {
|
|
this.set("reserve1", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get totalSupply(): BigDecimal {
|
|
let value = this.get("totalSupply");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set totalSupply(value: BigDecimal) {
|
|
this.set("totalSupply", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get reserveETH(): BigDecimal {
|
|
let value = this.get("reserveETH");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set reserveETH(value: BigDecimal) {
|
|
this.set("reserveETH", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get reserveUSD(): BigDecimal {
|
|
let value = this.get("reserveUSD");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set reserveUSD(value: BigDecimal) {
|
|
this.set("reserveUSD", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get trackedReserveETH(): BigDecimal {
|
|
let value = this.get("trackedReserveETH");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set trackedReserveETH(value: BigDecimal) {
|
|
this.set("trackedReserveETH", Value.fromBigDecimal(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 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 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 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 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 pairHourData(): PairHourDataLoader {
|
|
return new PairHourDataLoader(
|
|
"Pair",
|
|
this.get("id")!.toString(),
|
|
"pairHourData",
|
|
);
|
|
}
|
|
|
|
get mints(): MintLoader {
|
|
return new MintLoader("Pair", this.get("id")!.toString(), "mints");
|
|
}
|
|
|
|
get burns(): BurnLoader {
|
|
return new BurnLoader("Pair", this.get("id")!.toString(), "burns");
|
|
}
|
|
|
|
get swaps(): SwapLoader {
|
|
return new SwapLoader("Pair", this.get("id")!.toString(), "swaps");
|
|
}
|
|
}
|
|
|
|
export class User extends Entity {
|
|
constructor(id: string) {
|
|
super();
|
|
this.set("id", Value.fromString(id));
|
|
}
|
|
|
|
save(): void {
|
|
let id = this.get("id");
|
|
assert(id != null, "Cannot save User entity without an ID");
|
|
if (id) {
|
|
assert(
|
|
id.kind == ValueKind.STRING,
|
|
`Entities of type User must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
|
|
);
|
|
store.set("User", id.toString(), this);
|
|
}
|
|
}
|
|
|
|
static loadInBlock(id: string): User | null {
|
|
return changetype<User | null>(store.get_in_block("User", id));
|
|
}
|
|
|
|
static load(id: string): User | null {
|
|
return changetype<User | null>(store.get("User", 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 usdSwapped(): BigDecimal {
|
|
let value = this.get("usdSwapped");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set usdSwapped(value: BigDecimal) {
|
|
this.set("usdSwapped", Value.fromBigDecimal(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 mints(): Array<string> {
|
|
let value = this.get("mints");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toStringArray();
|
|
}
|
|
}
|
|
|
|
set mints(value: Array<string>) {
|
|
this.set("mints", Value.fromStringArray(value));
|
|
}
|
|
|
|
get burns(): Array<string> {
|
|
let value = this.get("burns");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toStringArray();
|
|
}
|
|
}
|
|
|
|
set burns(value: Array<string>) {
|
|
this.set("burns", Value.fromStringArray(value));
|
|
}
|
|
|
|
get swaps(): Array<string> {
|
|
let value = this.get("swaps");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toStringArray();
|
|
}
|
|
}
|
|
|
|
set swaps(value: Array<string>) {
|
|
this.set("swaps", Value.fromStringArray(value));
|
|
}
|
|
}
|
|
|
|
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 pair(): string {
|
|
let value = this.get("pair");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toString();
|
|
}
|
|
}
|
|
|
|
set pair(value: string) {
|
|
this.set("pair", Value.fromString(value));
|
|
}
|
|
|
|
get to(): Bytes {
|
|
let value = this.get("to");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBytes();
|
|
}
|
|
}
|
|
|
|
set to(value: Bytes) {
|
|
this.set("to", Value.fromBytes(value));
|
|
}
|
|
|
|
get liquidity(): BigDecimal {
|
|
let value = this.get("liquidity");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set liquidity(value: BigDecimal) {
|
|
this.set("liquidity", Value.fromBigDecimal(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 amount0(): BigDecimal | null {
|
|
let value = this.get("amount0");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
return null;
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set amount0(value: BigDecimal | null) {
|
|
if (!value) {
|
|
this.unset("amount0");
|
|
} else {
|
|
this.set("amount0", Value.fromBigDecimal(<BigDecimal>value));
|
|
}
|
|
}
|
|
|
|
get amount1(): BigDecimal | null {
|
|
let value = this.get("amount1");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
return null;
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set amount1(value: BigDecimal | null) {
|
|
if (!value) {
|
|
this.unset("amount1");
|
|
} else {
|
|
this.set("amount1", Value.fromBigDecimal(<BigDecimal>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));
|
|
}
|
|
}
|
|
|
|
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 feeTo(): Bytes | null {
|
|
let value = this.get("feeTo");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
return null;
|
|
} else {
|
|
return value.toBytes();
|
|
}
|
|
}
|
|
|
|
set feeTo(value: Bytes | null) {
|
|
if (!value) {
|
|
this.unset("feeTo");
|
|
} else {
|
|
this.set("feeTo", Value.fromBytes(<Bytes>value));
|
|
}
|
|
}
|
|
|
|
get feeLiquidity(): BigDecimal | null {
|
|
let value = this.get("feeLiquidity");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
return null;
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set feeLiquidity(value: BigDecimal | null) {
|
|
if (!value) {
|
|
this.unset("feeLiquidity");
|
|
} else {
|
|
this.set("feeLiquidity", Value.fromBigDecimal(<BigDecimal>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 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 pair(): string {
|
|
let value = this.get("pair");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toString();
|
|
}
|
|
}
|
|
|
|
set pair(value: string) {
|
|
this.set("pair", Value.fromString(value));
|
|
}
|
|
|
|
get liquidity(): BigDecimal {
|
|
let value = this.get("liquidity");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set liquidity(value: BigDecimal) {
|
|
this.set("liquidity", Value.fromBigDecimal(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 amount0(): BigDecimal | null {
|
|
let value = this.get("amount0");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
return null;
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set amount0(value: BigDecimal | null) {
|
|
if (!value) {
|
|
this.unset("amount0");
|
|
} else {
|
|
this.set("amount0", Value.fromBigDecimal(<BigDecimal>value));
|
|
}
|
|
}
|
|
|
|
get amount1(): BigDecimal | null {
|
|
let value = this.get("amount1");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
return null;
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set amount1(value: BigDecimal | null) {
|
|
if (!value) {
|
|
this.unset("amount1");
|
|
} else {
|
|
this.set("amount1", Value.fromBigDecimal(<BigDecimal>value));
|
|
}
|
|
}
|
|
|
|
get to(): Bytes | null {
|
|
let value = this.get("to");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
return null;
|
|
} else {
|
|
return value.toBytes();
|
|
}
|
|
}
|
|
|
|
set to(value: Bytes | null) {
|
|
if (!value) {
|
|
this.unset("to");
|
|
} else {
|
|
this.set("to", Value.fromBytes(<Bytes>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));
|
|
}
|
|
}
|
|
|
|
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 needsComplete(): boolean {
|
|
let value = this.get("needsComplete");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
return false;
|
|
} else {
|
|
return value.toBoolean();
|
|
}
|
|
}
|
|
|
|
set needsComplete(value: boolean) {
|
|
this.set("needsComplete", Value.fromBoolean(value));
|
|
}
|
|
|
|
get feeTo(): Bytes | null {
|
|
let value = this.get("feeTo");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
return null;
|
|
} else {
|
|
return value.toBytes();
|
|
}
|
|
}
|
|
|
|
set feeTo(value: Bytes | null) {
|
|
if (!value) {
|
|
this.unset("feeTo");
|
|
} else {
|
|
this.set("feeTo", Value.fromBytes(<Bytes>value));
|
|
}
|
|
}
|
|
|
|
get feeLiquidity(): BigDecimal | null {
|
|
let value = this.get("feeLiquidity");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
return null;
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set feeLiquidity(value: BigDecimal | null) {
|
|
if (!value) {
|
|
this.unset("feeLiquidity");
|
|
} else {
|
|
this.set("feeLiquidity", Value.fromBigDecimal(<BigDecimal>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 pair(): string {
|
|
let value = this.get("pair");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toString();
|
|
}
|
|
}
|
|
|
|
set pair(value: string) {
|
|
this.set("pair", 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 from(): Bytes {
|
|
let value = this.get("from");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBytes();
|
|
}
|
|
}
|
|
|
|
set from(value: Bytes) {
|
|
this.set("from", Value.fromBytes(value));
|
|
}
|
|
|
|
get amount0In(): BigDecimal {
|
|
let value = this.get("amount0In");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set amount0In(value: BigDecimal) {
|
|
this.set("amount0In", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get amount1In(): BigDecimal {
|
|
let value = this.get("amount1In");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set amount1In(value: BigDecimal) {
|
|
this.set("amount1In", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get amount0Out(): BigDecimal {
|
|
let value = this.get("amount0Out");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set amount0Out(value: BigDecimal) {
|
|
this.set("amount0Out", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get amount1Out(): BigDecimal {
|
|
let value = this.get("amount1Out");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set amount1Out(value: BigDecimal) {
|
|
this.set("amount1Out", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get to(): Bytes {
|
|
let value = this.get("to");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBytes();
|
|
}
|
|
}
|
|
|
|
set to(value: Bytes) {
|
|
this.set("to", Value.fromBytes(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));
|
|
}
|
|
}
|
|
|
|
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));
|
|
}
|
|
}
|
|
|
|
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 ethPrice(): BigDecimal {
|
|
let value = this.get("ethPrice");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set ethPrice(value: BigDecimal) {
|
|
this.set("ethPrice", Value.fromBigDecimal(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 dailyVolumeETH(): BigDecimal {
|
|
let value = this.get("dailyVolumeETH");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set dailyVolumeETH(value: BigDecimal) {
|
|
this.set("dailyVolumeETH", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get dailyVolumeUSD(): BigDecimal {
|
|
let value = this.get("dailyVolumeUSD");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set dailyVolumeUSD(value: BigDecimal) {
|
|
this.set("dailyVolumeUSD", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get dailyVolumeUntracked(): BigDecimal {
|
|
let value = this.get("dailyVolumeUntracked");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set dailyVolumeUntracked(value: BigDecimal) {
|
|
this.set("dailyVolumeUntracked", 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 totalLiquidityETH(): BigDecimal {
|
|
let value = this.get("totalLiquidityETH");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set totalLiquidityETH(value: BigDecimal) {
|
|
this.set("totalLiquidityETH", Value.fromBigDecimal(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 totalLiquidityUSD(): BigDecimal {
|
|
let value = this.get("totalLiquidityUSD");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set totalLiquidityUSD(value: BigDecimal) {
|
|
this.set("totalLiquidityUSD", 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));
|
|
}
|
|
}
|
|
|
|
export class PairHourData extends Entity {
|
|
constructor(id: string) {
|
|
super();
|
|
this.set("id", Value.fromString(id));
|
|
}
|
|
|
|
save(): void {
|
|
let id = this.get("id");
|
|
assert(id != null, "Cannot save PairHourData entity without an ID");
|
|
if (id) {
|
|
assert(
|
|
id.kind == ValueKind.STRING,
|
|
`Entities of type PairHourData must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
|
|
);
|
|
store.set("PairHourData", id.toString(), this);
|
|
}
|
|
}
|
|
|
|
static loadInBlock(id: string): PairHourData | null {
|
|
return changetype<PairHourData | null>(
|
|
store.get_in_block("PairHourData", id),
|
|
);
|
|
}
|
|
|
|
static load(id: string): PairHourData | null {
|
|
return changetype<PairHourData | null>(store.get("PairHourData", 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 hourStartUnix(): i32 {
|
|
let value = this.get("hourStartUnix");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
return 0;
|
|
} else {
|
|
return value.toI32();
|
|
}
|
|
}
|
|
|
|
set hourStartUnix(value: i32) {
|
|
this.set("hourStartUnix", Value.fromI32(value));
|
|
}
|
|
|
|
get pair(): string {
|
|
let value = this.get("pair");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toString();
|
|
}
|
|
}
|
|
|
|
set pair(value: string) {
|
|
this.set("pair", Value.fromString(value));
|
|
}
|
|
|
|
get reserve0(): BigDecimal {
|
|
let value = this.get("reserve0");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set reserve0(value: BigDecimal) {
|
|
this.set("reserve0", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get reserve1(): BigDecimal {
|
|
let value = this.get("reserve1");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set reserve1(value: BigDecimal) {
|
|
this.set("reserve1", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get totalSupply(): BigDecimal | null {
|
|
let value = this.get("totalSupply");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
return null;
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set totalSupply(value: BigDecimal | null) {
|
|
if (!value) {
|
|
this.unset("totalSupply");
|
|
} else {
|
|
this.set("totalSupply", Value.fromBigDecimal(<BigDecimal>value));
|
|
}
|
|
}
|
|
|
|
get reserveUSD(): BigDecimal {
|
|
let value = this.get("reserveUSD");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set reserveUSD(value: BigDecimal) {
|
|
this.set("reserveUSD", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get hourlyVolumeToken0(): BigDecimal {
|
|
let value = this.get("hourlyVolumeToken0");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set hourlyVolumeToken0(value: BigDecimal) {
|
|
this.set("hourlyVolumeToken0", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get hourlyVolumeToken1(): BigDecimal {
|
|
let value = this.get("hourlyVolumeToken1");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set hourlyVolumeToken1(value: BigDecimal) {
|
|
this.set("hourlyVolumeToken1", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get hourlyVolumeUSD(): BigDecimal {
|
|
let value = this.get("hourlyVolumeUSD");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set hourlyVolumeUSD(value: BigDecimal) {
|
|
this.set("hourlyVolumeUSD", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get hourlyTxns(): BigInt {
|
|
let value = this.get("hourlyTxns");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigInt();
|
|
}
|
|
}
|
|
|
|
set hourlyTxns(value: BigInt) {
|
|
this.set("hourlyTxns", Value.fromBigInt(value));
|
|
}
|
|
}
|
|
|
|
export class PairDayData extends Entity {
|
|
constructor(id: string) {
|
|
super();
|
|
this.set("id", Value.fromString(id));
|
|
}
|
|
|
|
save(): void {
|
|
let id = this.get("id");
|
|
assert(id != null, "Cannot save PairDayData entity without an ID");
|
|
if (id) {
|
|
assert(
|
|
id.kind == ValueKind.STRING,
|
|
`Entities of type PairDayData must have an ID of type String but the id '${id.displayData()}' is of type ${id.displayKind()}`,
|
|
);
|
|
store.set("PairDayData", id.toString(), this);
|
|
}
|
|
}
|
|
|
|
static loadInBlock(id: string): PairDayData | null {
|
|
return changetype<PairDayData | null>(
|
|
store.get_in_block("PairDayData", id),
|
|
);
|
|
}
|
|
|
|
static load(id: string): PairDayData | null {
|
|
return changetype<PairDayData | null>(store.get("PairDayData", 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 pairAddress(): Bytes {
|
|
let value = this.get("pairAddress");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBytes();
|
|
}
|
|
}
|
|
|
|
set pairAddress(value: Bytes) {
|
|
this.set("pairAddress", Value.fromBytes(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 reserve0(): BigDecimal {
|
|
let value = this.get("reserve0");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set reserve0(value: BigDecimal) {
|
|
this.set("reserve0", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get reserve1(): BigDecimal {
|
|
let value = this.get("reserve1");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set reserve1(value: BigDecimal) {
|
|
this.set("reserve1", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get totalSupply(): BigDecimal | null {
|
|
let value = this.get("totalSupply");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
return null;
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set totalSupply(value: BigDecimal | null) {
|
|
if (!value) {
|
|
this.unset("totalSupply");
|
|
} else {
|
|
this.set("totalSupply", Value.fromBigDecimal(<BigDecimal>value));
|
|
}
|
|
}
|
|
|
|
get reserveUSD(): BigDecimal {
|
|
let value = this.get("reserveUSD");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set reserveUSD(value: BigDecimal) {
|
|
this.set("reserveUSD", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get dailyVolumeToken0(): BigDecimal {
|
|
let value = this.get("dailyVolumeToken0");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set dailyVolumeToken0(value: BigDecimal) {
|
|
this.set("dailyVolumeToken0", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get dailyVolumeToken1(): BigDecimal {
|
|
let value = this.get("dailyVolumeToken1");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set dailyVolumeToken1(value: BigDecimal) {
|
|
this.set("dailyVolumeToken1", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get dailyVolumeUSD(): BigDecimal {
|
|
let value = this.get("dailyVolumeUSD");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set dailyVolumeUSD(value: BigDecimal) {
|
|
this.set("dailyVolumeUSD", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get dailyTxns(): BigInt {
|
|
let value = this.get("dailyTxns");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigInt();
|
|
}
|
|
}
|
|
|
|
set dailyTxns(value: BigInt) {
|
|
this.set("dailyTxns", Value.fromBigInt(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 dailyVolumeToken(): BigDecimal {
|
|
let value = this.get("dailyVolumeToken");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set dailyVolumeToken(value: BigDecimal) {
|
|
this.set("dailyVolumeToken", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get dailyVolumeETH(): BigDecimal {
|
|
let value = this.get("dailyVolumeETH");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set dailyVolumeETH(value: BigDecimal) {
|
|
this.set("dailyVolumeETH", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get dailyVolumeUSD(): BigDecimal {
|
|
let value = this.get("dailyVolumeUSD");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set dailyVolumeUSD(value: BigDecimal) {
|
|
this.set("dailyVolumeUSD", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get dailyTxns(): BigInt {
|
|
let value = this.get("dailyTxns");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigInt();
|
|
}
|
|
}
|
|
|
|
set dailyTxns(value: BigInt) {
|
|
this.set("dailyTxns", Value.fromBigInt(value));
|
|
}
|
|
|
|
get totalLiquidityToken(): BigDecimal {
|
|
let value = this.get("totalLiquidityToken");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set totalLiquidityToken(value: BigDecimal) {
|
|
this.set("totalLiquidityToken", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get totalLiquidityETH(): BigDecimal {
|
|
let value = this.get("totalLiquidityETH");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set totalLiquidityETH(value: BigDecimal) {
|
|
this.set("totalLiquidityETH", Value.fromBigDecimal(value));
|
|
}
|
|
|
|
get totalLiquidityUSD(): BigDecimal {
|
|
let value = this.get("totalLiquidityUSD");
|
|
if (!value || value.kind == ValueKind.NULL) {
|
|
throw new Error("Cannot return null for a required field.");
|
|
} else {
|
|
return value.toBigDecimal();
|
|
}
|
|
}
|
|
|
|
set totalLiquidityUSD(value: BigDecimal) {
|
|
this.set("totalLiquidityUSD", 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));
|
|
}
|
|
}
|
|
|
|
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 PairDayDataLoader 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(): PairDayData[] {
|
|
let value = store.loadRelated(this._entity, this._id, this._field);
|
|
return changetype<PairDayData[]>(value);
|
|
}
|
|
}
|
|
|
|
export class PairLoader 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(): Pair[] {
|
|
let value = store.loadRelated(this._entity, this._id, this._field);
|
|
return changetype<Pair[]>(value);
|
|
}
|
|
}
|
|
|
|
export class PairHourDataLoader 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(): PairHourData[] {
|
|
let value = store.loadRelated(this._entity, this._id, this._field);
|
|
return changetype<PairHourData[]>(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);
|
|
}
|
|
}
|