2021-09-28 06:58:43 +00:00
|
|
|
// 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 Test extends ethereum.Event {
|
|
|
|
get params(): Test__Params {
|
|
|
|
return new Test__Params(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class Test__Params {
|
|
|
|
_event: Test;
|
|
|
|
|
|
|
|
constructor(event: Test) {
|
|
|
|
this._event = event;
|
|
|
|
}
|
|
|
|
|
|
|
|
get param1(): string {
|
|
|
|
return this._event.parameters[0].value.toString();
|
|
|
|
}
|
|
|
|
|
2021-11-01 09:43:22 +00:00
|
|
|
get param2(): i32 {
|
|
|
|
return this._event.parameters[1].value.toI32();
|
2021-09-28 06:58:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-23 05:53:47 +00:00
|
|
|
export class Example1__structMethodResultValue0Struct extends ethereum.Tuple {
|
|
|
|
get bidAmount1(): BigInt {
|
|
|
|
return this[0].toBigInt();
|
|
|
|
}
|
|
|
|
|
|
|
|
get bidAmount2(): BigInt {
|
|
|
|
return this[1].toBigInt();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-09-28 06:58:43 +00:00
|
|
|
export class Example1 extends ethereum.SmartContract {
|
|
|
|
static bind(address: Address): Example1 {
|
|
|
|
return new Example1("Example1", address);
|
|
|
|
}
|
|
|
|
|
2021-11-23 05:53:47 +00:00
|
|
|
addMethod(bidAmount1: BigInt, bidAmount2: BigInt): BigInt {
|
|
|
|
let result = super.call(
|
|
|
|
"addMethod",
|
|
|
|
"addMethod(uint128,uint128):(uint256)",
|
|
|
|
[
|
|
|
|
ethereum.Value.fromUnsignedBigInt(bidAmount1),
|
|
|
|
ethereum.Value.fromUnsignedBigInt(bidAmount2)
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
|
|
|
return result[0].toBigInt();
|
|
|
|
}
|
|
|
|
|
|
|
|
try_addMethod(
|
|
|
|
bidAmount1: BigInt,
|
|
|
|
bidAmount2: BigInt
|
|
|
|
): ethereum.CallResult<BigInt> {
|
|
|
|
let result = super.tryCall(
|
|
|
|
"addMethod",
|
|
|
|
"addMethod(uint128,uint128):(uint256)",
|
|
|
|
[
|
|
|
|
ethereum.Value.fromUnsignedBigInt(bidAmount1),
|
|
|
|
ethereum.Value.fromUnsignedBigInt(bidAmount2)
|
|
|
|
]
|
|
|
|
);
|
|
|
|
if (result.reverted) {
|
|
|
|
return new ethereum.CallResult();
|
|
|
|
}
|
|
|
|
let value = result.value;
|
|
|
|
return ethereum.CallResult.fromValue(value[0].toBigInt());
|
|
|
|
}
|
|
|
|
|
2021-11-01 09:43:22 +00:00
|
|
|
emitEvent(): boolean {
|
|
|
|
let result = super.call("emitEvent", "emitEvent():(bool)", []);
|
|
|
|
|
|
|
|
return result[0].toBoolean();
|
|
|
|
}
|
|
|
|
|
|
|
|
try_emitEvent(): ethereum.CallResult<boolean> {
|
|
|
|
let result = super.tryCall("emitEvent", "emitEvent():(bool)", []);
|
|
|
|
if (result.reverted) {
|
|
|
|
return new ethereum.CallResult();
|
|
|
|
}
|
|
|
|
let value = result.value;
|
|
|
|
return ethereum.CallResult.fromValue(value[0].toBoolean());
|
|
|
|
}
|
|
|
|
|
2021-09-28 06:58:43 +00:00
|
|
|
getMethod(): string {
|
|
|
|
let result = super.call("getMethod", "getMethod():(string)", []);
|
|
|
|
|
|
|
|
return result[0].toString();
|
|
|
|
}
|
|
|
|
|
|
|
|
try_getMethod(): ethereum.CallResult<string> {
|
|
|
|
let result = super.tryCall("getMethod", "getMethod():(string)", []);
|
|
|
|
if (result.reverted) {
|
|
|
|
return new ethereum.CallResult();
|
|
|
|
}
|
|
|
|
let value = result.value;
|
|
|
|
return ethereum.CallResult.fromValue(value[0].toString());
|
|
|
|
}
|
2021-11-23 05:53:47 +00:00
|
|
|
|
|
|
|
structMethod(
|
|
|
|
bidAmount1: BigInt,
|
|
|
|
bidAmount2: BigInt
|
|
|
|
): Example1__structMethodResultValue0Struct {
|
|
|
|
let result = super.call(
|
|
|
|
"structMethod",
|
|
|
|
"structMethod(uint128,uint128):((uint128,uint128))",
|
|
|
|
[
|
|
|
|
ethereum.Value.fromUnsignedBigInt(bidAmount1),
|
|
|
|
ethereum.Value.fromUnsignedBigInt(bidAmount2)
|
|
|
|
]
|
|
|
|
);
|
|
|
|
|
|
|
|
return changetype<Example1__structMethodResultValue0Struct>(
|
|
|
|
result[0].toTuple()
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
try_structMethod(
|
|
|
|
bidAmount1: BigInt,
|
|
|
|
bidAmount2: BigInt
|
|
|
|
): ethereum.CallResult<Example1__structMethodResultValue0Struct> {
|
|
|
|
let result = super.tryCall(
|
|
|
|
"structMethod",
|
|
|
|
"structMethod(uint128,uint128):((uint128,uint128))",
|
|
|
|
[
|
|
|
|
ethereum.Value.fromUnsignedBigInt(bidAmount1),
|
|
|
|
ethereum.Value.fromUnsignedBigInt(bidAmount2)
|
|
|
|
]
|
|
|
|
);
|
|
|
|
if (result.reverted) {
|
|
|
|
return new ethereum.CallResult();
|
|
|
|
}
|
|
|
|
let value = result.value;
|
|
|
|
return ethereum.CallResult.fromValue(
|
|
|
|
changetype<Example1__structMethodResultValue0Struct>(value[0].toTuple())
|
|
|
|
);
|
|
|
|
}
|
2021-09-28 06:58:43 +00:00
|
|
|
}
|
2021-11-01 09:43:22 +00:00
|
|
|
|
|
|
|
export class EmitEventCall extends ethereum.Call {
|
|
|
|
get inputs(): EmitEventCall__Inputs {
|
|
|
|
return new EmitEventCall__Inputs(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
get outputs(): EmitEventCall__Outputs {
|
|
|
|
return new EmitEventCall__Outputs(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class EmitEventCall__Inputs {
|
|
|
|
_call: EmitEventCall;
|
|
|
|
|
|
|
|
constructor(call: EmitEventCall) {
|
|
|
|
this._call = call;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class EmitEventCall__Outputs {
|
|
|
|
_call: EmitEventCall;
|
|
|
|
|
|
|
|
constructor(call: EmitEventCall) {
|
|
|
|
this._call = call;
|
|
|
|
}
|
|
|
|
|
|
|
|
get value0(): boolean {
|
|
|
|
return this._call.outputValues[0].value.toBoolean();
|
|
|
|
}
|
|
|
|
}
|