// 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); } 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 { 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()); } approve(spender: Address, amount: BigInt): boolean { let result = super.call("approve", "approve(address,uint256):(bool)", [ ethereum.Value.fromAddress(spender), ethereum.Value.fromUnsignedBigInt(amount) ]); return result[0].toBoolean(); } try_approve(spender: Address, amount: BigInt): ethereum.CallResult { let result = super.tryCall("approve", "approve(address,uint256):(bool)", [ ethereum.Value.fromAddress(spender), ethereum.Value.fromUnsignedBigInt(amount) ]); if (result.reverted) { return new ethereum.CallResult(); } let value = result.value; return ethereum.CallResult.fromValue(value[0].toBoolean()); } balanceOf(account: Address): BigInt { let result = super.call("balanceOf", "balanceOf(address):(uint256)", [ ethereum.Value.fromAddress(account) ]); return result[0].toBigInt(); } try_balanceOf(account: Address): ethereum.CallResult { let result = super.tryCall("balanceOf", "balanceOf(address):(uint256)", [ ethereum.Value.fromAddress(account) ]); if (result.reverted) { return new ethereum.CallResult(); } let value = result.value; return ethereum.CallResult.fromValue(value[0].toBigInt()); } decimals(): i32 { let result = super.call("decimals", "decimals():(uint8)", []); return result[0].toI32(); } try_decimals(): ethereum.CallResult { let result = super.tryCall("decimals", "decimals():(uint8)", []); if (result.reverted) { return new ethereum.CallResult(); } let value = result.value; return ethereum.CallResult.fromValue(value[0].toI32()); } decreaseAllowance(spender: Address, subtractedValue: BigInt): boolean { let result = super.call( "decreaseAllowance", "decreaseAllowance(address,uint256):(bool)", [ ethereum.Value.fromAddress(spender), ethereum.Value.fromUnsignedBigInt(subtractedValue) ] ); return result[0].toBoolean(); } try_decreaseAllowance( spender: Address, subtractedValue: BigInt ): ethereum.CallResult { let result = super.tryCall( "decreaseAllowance", "decreaseAllowance(address,uint256):(bool)", [ ethereum.Value.fromAddress(spender), ethereum.Value.fromUnsignedBigInt(subtractedValue) ] ); if (result.reverted) { return new ethereum.CallResult(); } let value = result.value; return ethereum.CallResult.fromValue(value[0].toBoolean()); } increaseAllowance(spender: Address, addedValue: BigInt): boolean { let result = super.call( "increaseAllowance", "increaseAllowance(address,uint256):(bool)", [ ethereum.Value.fromAddress(spender), ethereum.Value.fromUnsignedBigInt(addedValue) ] ); return result[0].toBoolean(); } try_increaseAllowance( spender: Address, addedValue: BigInt ): ethereum.CallResult { let result = super.tryCall( "increaseAllowance", "increaseAllowance(address,uint256):(bool)", [ ethereum.Value.fromAddress(spender), ethereum.Value.fromUnsignedBigInt(addedValue) ] ); if (result.reverted) { return new ethereum.CallResult(); } let value = result.value; return ethereum.CallResult.fromValue(value[0].toBoolean()); } name(): string { let result = super.call("name", "name():(string)", []); return result[0].toString(); } try_name(): ethereum.CallResult { 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()); } symbol(): string { let result = super.call("symbol", "symbol():(string)", []); return result[0].toString(); } try_symbol(): ethereum.CallResult { 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()); } totalSupply(): BigInt { let result = super.call("totalSupply", "totalSupply():(uint256)", []); return result[0].toBigInt(); } try_totalSupply(): ethereum.CallResult { 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()); } transfer(recipient: Address, amount: BigInt): boolean { let result = super.call("transfer", "transfer(address,uint256):(bool)", [ ethereum.Value.fromAddress(recipient), ethereum.Value.fromUnsignedBigInt(amount) ]); return result[0].toBoolean(); } try_transfer( recipient: Address, amount: BigInt ): ethereum.CallResult { let result = super.tryCall("transfer", "transfer(address,uint256):(bool)", [ ethereum.Value.fromAddress(recipient), ethereum.Value.fromUnsignedBigInt(amount) ]); if (result.reverted) { return new ethereum.CallResult(); } let value = result.value; return ethereum.CallResult.fromValue(value[0].toBoolean()); } transferFrom(sender: Address, recipient: Address, amount: BigInt): boolean { let result = super.call( "transferFrom", "transferFrom(address,address,uint256):(bool)", [ ethereum.Value.fromAddress(sender), ethereum.Value.fromAddress(recipient), ethereum.Value.fromUnsignedBigInt(amount) ] ); return result[0].toBoolean(); } try_transferFrom( sender: Address, recipient: Address, amount: BigInt ): ethereum.CallResult { let result = super.tryCall( "transferFrom", "transferFrom(address,address,uint256):(bool)", [ ethereum.Value.fromAddress(sender), ethereum.Value.fromAddress(recipient), ethereum.Value.fromUnsignedBigInt(amount) ] ); if (result.reverted) { return new ethereum.CallResult(); } let value = result.value; return ethereum.CallResult.fromValue(value[0].toBoolean()); } } export class ConstructorCall extends ethereum.Call { get inputs(): ConstructorCall__Inputs { return new ConstructorCall__Inputs(this); } get outputs(): ConstructorCall__Outputs { return new ConstructorCall__Outputs(this); } } export class ConstructorCall__Inputs { _call: ConstructorCall; constructor(call: ConstructorCall) { this._call = call; } get name(): string { return this._call.inputValues[0].value.toString(); } get symbol(): string { return this._call.inputValues[1].value.toString(); } } export class ConstructorCall__Outputs { _call: ConstructorCall; constructor(call: ConstructorCall) { this._call = call; } } 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 amount(): 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 DecreaseAllowanceCall extends ethereum.Call { get inputs(): DecreaseAllowanceCall__Inputs { return new DecreaseAllowanceCall__Inputs(this); } get outputs(): DecreaseAllowanceCall__Outputs { return new DecreaseAllowanceCall__Outputs(this); } } export class DecreaseAllowanceCall__Inputs { _call: DecreaseAllowanceCall; constructor(call: DecreaseAllowanceCall) { this._call = call; } get spender(): Address { return this._call.inputValues[0].value.toAddress(); } get subtractedValue(): BigInt { return this._call.inputValues[1].value.toBigInt(); } } export class DecreaseAllowanceCall__Outputs { _call: DecreaseAllowanceCall; constructor(call: DecreaseAllowanceCall) { this._call = call; } get value0(): boolean { return this._call.outputValues[0].value.toBoolean(); } } export class IncreaseAllowanceCall extends ethereum.Call { get inputs(): IncreaseAllowanceCall__Inputs { return new IncreaseAllowanceCall__Inputs(this); } get outputs(): IncreaseAllowanceCall__Outputs { return new IncreaseAllowanceCall__Outputs(this); } } export class IncreaseAllowanceCall__Inputs { _call: IncreaseAllowanceCall; constructor(call: IncreaseAllowanceCall) { this._call = call; } get spender(): Address { return this._call.inputValues[0].value.toAddress(); } get addedValue(): BigInt { return this._call.inputValues[1].value.toBigInt(); } } export class IncreaseAllowanceCall__Outputs { _call: IncreaseAllowanceCall; constructor(call: IncreaseAllowanceCall) { 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 recipient(): Address { return this._call.inputValues[0].value.toAddress(); } get amount(): 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 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 sender(): Address { return this._call.inputValues[0].value.toAddress(); } get recipient(): Address { return this._call.inputValues[1].value.toAddress(); } get amount(): 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(); } }