Files

402 lines
9.3 KiB
TypeScript

// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
import {
ethereum,
JSONValue,
TypedMap,
Entity,
Bytes,
Address,
BigInt,
} from "@graphprotocol/graph-ts";
export class Approval extends ethereum.Event {
get params(): Approval__Params {
return new Approval__Params(this);
}
}
export class Approval__Params {
_event: Approval;
constructor(event: Approval) {
this._event = event;
}
get owner(): Address {
return this._event.parameters[0].value.toAddress();
}
get spender(): Address {
return this._event.parameters[1].value.toAddress();
}
get value(): BigInt {
return this._event.parameters[2].value.toBigInt();
}
}
export class Transfer extends ethereum.Event {
get params(): Transfer__Params {
return new Transfer__Params(this);
}
}
export class Transfer__Params {
_event: Transfer;
constructor(event: Transfer) {
this._event = event;
}
get from(): Address {
return this._event.parameters[0].value.toAddress();
}
get to(): Address {
return this._event.parameters[1].value.toAddress();
}
get value(): BigInt {
return this._event.parameters[2].value.toBigInt();
}
}
export class ERC20 extends ethereum.SmartContract {
static bind(address: Address): ERC20 {
return new ERC20("ERC20", address);
}
name(): string {
let result = super.call("name", "name():(string)", []);
return result[0].toString();
}
try_name(): ethereum.CallResult<string> {
let result = super.tryCall("name", "name():(string)", []);
if (result.reverted) {
return new ethereum.CallResult();
}
let value = result.value;
return ethereum.CallResult.fromValue(value[0].toString());
}
approve(_spender: Address, _value: BigInt): boolean {
let result = super.call("approve", "approve(address,uint256):(bool)", [
ethereum.Value.fromAddress(_spender),
ethereum.Value.fromUnsignedBigInt(_value),
]);
return result[0].toBoolean();
}
try_approve(_spender: Address, _value: BigInt): ethereum.CallResult<boolean> {
let result = super.tryCall("approve", "approve(address,uint256):(bool)", [
ethereum.Value.fromAddress(_spender),
ethereum.Value.fromUnsignedBigInt(_value),
]);
if (result.reverted) {
return new ethereum.CallResult();
}
let value = result.value;
return ethereum.CallResult.fromValue(value[0].toBoolean());
}
totalSupply(): BigInt {
let result = super.call("totalSupply", "totalSupply():(uint256)", []);
return result[0].toBigInt();
}
try_totalSupply(): ethereum.CallResult<BigInt> {
let result = super.tryCall("totalSupply", "totalSupply():(uint256)", []);
if (result.reverted) {
return new ethereum.CallResult();
}
let value = result.value;
return ethereum.CallResult.fromValue(value[0].toBigInt());
}
transferFrom(_from: Address, _to: Address, _value: BigInt): boolean {
let result = super.call(
"transferFrom",
"transferFrom(address,address,uint256):(bool)",
[
ethereum.Value.fromAddress(_from),
ethereum.Value.fromAddress(_to),
ethereum.Value.fromUnsignedBigInt(_value),
],
);
return result[0].toBoolean();
}
try_transferFrom(
_from: Address,
_to: Address,
_value: BigInt,
): ethereum.CallResult<boolean> {
let result = super.tryCall(
"transferFrom",
"transferFrom(address,address,uint256):(bool)",
[
ethereum.Value.fromAddress(_from),
ethereum.Value.fromAddress(_to),
ethereum.Value.fromUnsignedBigInt(_value),
],
);
if (result.reverted) {
return new ethereum.CallResult();
}
let value = result.value;
return ethereum.CallResult.fromValue(value[0].toBoolean());
}
decimals(): BigInt {
let result = super.call("decimals", "decimals():(uint32)", []);
return result[0].toBigInt();
}
try_decimals(): ethereum.CallResult<BigInt> {
let result = super.tryCall("decimals", "decimals():(uint32)", []);
if (result.reverted) {
return new ethereum.CallResult();
}
let value = result.value;
return ethereum.CallResult.fromValue(value[0].toBigInt());
}
balanceOf(_owner: Address): BigInt {
let result = super.call("balanceOf", "balanceOf(address):(uint256)", [
ethereum.Value.fromAddress(_owner),
]);
return result[0].toBigInt();
}
try_balanceOf(_owner: Address): ethereum.CallResult<BigInt> {
let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [
ethereum.Value.fromAddress(_owner),
]);
if (result.reverted) {
return new ethereum.CallResult();
}
let value = result.value;
return ethereum.CallResult.fromValue(value[0].toBigInt());
}
symbol(): string {
let result = super.call("symbol", "symbol():(string)", []);
return result[0].toString();
}
try_symbol(): ethereum.CallResult<string> {
let result = super.tryCall("symbol", "symbol():(string)", []);
if (result.reverted) {
return new ethereum.CallResult();
}
let value = result.value;
return ethereum.CallResult.fromValue(value[0].toString());
}
transfer(_to: Address, _value: BigInt): boolean {
let result = super.call("transfer", "transfer(address,uint256):(bool)", [
ethereum.Value.fromAddress(_to),
ethereum.Value.fromUnsignedBigInt(_value),
]);
return result[0].toBoolean();
}
try_transfer(_to: Address, _value: BigInt): ethereum.CallResult<boolean> {
let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [
ethereum.Value.fromAddress(_to),
ethereum.Value.fromUnsignedBigInt(_value),
]);
if (result.reverted) {
return new ethereum.CallResult();
}
let value = result.value;
return ethereum.CallResult.fromValue(value[0].toBoolean());
}
allowance(_owner: Address, _spender: Address): BigInt {
let result = super.call(
"allowance",
"allowance(address,address):(uint256)",
[
ethereum.Value.fromAddress(_owner),
ethereum.Value.fromAddress(_spender),
],
);
return result[0].toBigInt();
}
try_allowance(
_owner: Address,
_spender: Address,
): ethereum.CallResult<BigInt> {
let result = super.tryCall(
"allowance",
"allowance(address,address):(uint256)",
[
ethereum.Value.fromAddress(_owner),
ethereum.Value.fromAddress(_spender),
],
);
if (result.reverted) {
return new ethereum.CallResult();
}
let value = result.value;
return ethereum.CallResult.fromValue(value[0].toBigInt());
}
}
export class ApproveCall extends ethereum.Call {
get inputs(): ApproveCall__Inputs {
return new ApproveCall__Inputs(this);
}
get outputs(): ApproveCall__Outputs {
return new ApproveCall__Outputs(this);
}
}
export class ApproveCall__Inputs {
_call: ApproveCall;
constructor(call: ApproveCall) {
this._call = call;
}
get _spender(): Address {
return this._call.inputValues[0].value.toAddress();
}
get _value(): BigInt {
return this._call.inputValues[1].value.toBigInt();
}
}
export class ApproveCall__Outputs {
_call: ApproveCall;
constructor(call: ApproveCall) {
this._call = call;
}
get value0(): boolean {
return this._call.outputValues[0].value.toBoolean();
}
}
export class TransferFromCall extends ethereum.Call {
get inputs(): TransferFromCall__Inputs {
return new TransferFromCall__Inputs(this);
}
get outputs(): TransferFromCall__Outputs {
return new TransferFromCall__Outputs(this);
}
}
export class TransferFromCall__Inputs {
_call: TransferFromCall;
constructor(call: TransferFromCall) {
this._call = call;
}
get _from(): Address {
return this._call.inputValues[0].value.toAddress();
}
get _to(): Address {
return this._call.inputValues[1].value.toAddress();
}
get _value(): BigInt {
return this._call.inputValues[2].value.toBigInt();
}
}
export class TransferFromCall__Outputs {
_call: TransferFromCall;
constructor(call: TransferFromCall) {
this._call = call;
}
get value0(): boolean {
return this._call.outputValues[0].value.toBoolean();
}
}
export class TransferCall extends ethereum.Call {
get inputs(): TransferCall__Inputs {
return new TransferCall__Inputs(this);
}
get outputs(): TransferCall__Outputs {
return new TransferCall__Outputs(this);
}
}
export class TransferCall__Inputs {
_call: TransferCall;
constructor(call: TransferCall) {
this._call = call;
}
get _to(): Address {
return this._call.inputValues[0].value.toAddress();
}
get _value(): BigInt {
return this._call.inputValues[1].value.toBigInt();
}
}
export class TransferCall__Outputs {
_call: TransferCall;
constructor(call: TransferCall) {
this._call = call;
}
get value0(): boolean {
return this._call.outputValues[0].value.toBoolean();
}
}
export class DefaultCall extends ethereum.Call {
get inputs(): DefaultCall__Inputs {
return new DefaultCall__Inputs(this);
}
get outputs(): DefaultCall__Outputs {
return new DefaultCall__Outputs(this);
}
}
export class DefaultCall__Inputs {
_call: DefaultCall;
constructor(call: DefaultCall) {
this._call = call;
}
}
export class DefaultCall__Outputs {
_call: DefaultCall;
constructor(call: DefaultCall) {
this._call = call;
}
}