Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
klkgraph
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
klkgraph
Commits
20089216
Commit
20089216
authored
Feb 19, 2025
by
vicotor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add generated
parent
46d58865
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
970 additions
and
0 deletions
+970
-0
Drago.ts
generated/Drago/Drago.ts
+449
-0
schema.ts
generated/schema.ts
+521
-0
No files found.
generated/Drago/Drago.ts
0 → 100644
View file @
20089216
// 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
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
tokenId
():
BigInt
{
return
this
.
_event
.
parameters
[
2
].
value
.
toBigInt
();
}
}
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
approved
():
Address
{
return
this
.
_event
.
parameters
[
1
].
value
.
toAddress
();
}
get
tokenId
():
BigInt
{
return
this
.
_event
.
parameters
[
2
].
value
.
toBigInt
();
}
}
export
class
ApprovalForAll
extends
ethereum
.
Event
{
get
params
():
ApprovalForAll__Params
{
return
new
ApprovalForAll__Params
(
this
);
}
}
export
class
ApprovalForAll__Params
{
_event
:
ApprovalForAll
;
constructor
(
event
:
ApprovalForAll
)
{
this
.
_event
=
event
;
}
get
owner
():
Address
{
return
this
.
_event
.
parameters
[
0
].
value
.
toAddress
();
}
get
operator
():
Address
{
return
this
.
_event
.
parameters
[
1
].
value
.
toAddress
();
}
get
approved
():
boolean
{
return
this
.
_event
.
parameters
[
2
].
value
.
toBoolean
();
}
}
export
class
Drago
extends
ethereum
.
SmartContract
{
static
bind
(
address
:
Address
):
Drago
{
return
new
Drago
(
"
Drago
"
,
address
);
}
supportsInterface
(
interfaceId
:
Bytes
):
boolean
{
let
result
=
super
.
call
(
"
supportsInterface
"
,
"
supportsInterface(bytes4):(bool)
"
,
[
ethereum
.
Value
.
fromFixedBytes
(
interfaceId
)],
);
return
result
[
0
].
toBoolean
();
}
try_supportsInterface
(
interfaceId
:
Bytes
):
ethereum
.
CallResult
<
boolean
>
{
let
result
=
super
.
tryCall
(
"
supportsInterface
"
,
"
supportsInterface(bytes4):(bool)
"
,
[
ethereum
.
Value
.
fromFixedBytes
(
interfaceId
)],
);
if
(
result
.
reverted
)
{
return
new
ethereum
.
CallResult
();
}
let
value
=
result
.
value
;
return
ethereum
.
CallResult
.
fromValue
(
value
[
0
].
toBoolean
());
}
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
());
}
ownerOf
(
tokenId
:
BigInt
):
Address
{
let
result
=
super
.
call
(
"
ownerOf
"
,
"
ownerOf(uint256):(address)
"
,
[
ethereum
.
Value
.
fromUnsignedBigInt
(
tokenId
),
]);
return
result
[
0
].
toAddress
();
}
try_ownerOf
(
tokenId
:
BigInt
):
ethereum
.
CallResult
<
Address
>
{
let
result
=
super
.
tryCall
(
"
ownerOf
"
,
"
ownerOf(uint256):(address)
"
,
[
ethereum
.
Value
.
fromUnsignedBigInt
(
tokenId
),
]);
if
(
result
.
reverted
)
{
return
new
ethereum
.
CallResult
();
}
let
value
=
result
.
value
;
return
ethereum
.
CallResult
.
fromValue
(
value
[
0
].
toAddress
());
}
getApproved
(
tokenId
:
BigInt
):
Address
{
let
result
=
super
.
call
(
"
getApproved
"
,
"
getApproved(uint256):(address)
"
,
[
ethereum
.
Value
.
fromUnsignedBigInt
(
tokenId
),
]);
return
result
[
0
].
toAddress
();
}
try_getApproved
(
tokenId
:
BigInt
):
ethereum
.
CallResult
<
Address
>
{
let
result
=
super
.
tryCall
(
"
getApproved
"
,
"
getApproved(uint256):(address)
"
,
[
ethereum
.
Value
.
fromUnsignedBigInt
(
tokenId
)],
);
if
(
result
.
reverted
)
{
return
new
ethereum
.
CallResult
();
}
let
value
=
result
.
value
;
return
ethereum
.
CallResult
.
fromValue
(
value
[
0
].
toAddress
());
}
isApprovedForAll
(
owner
:
Address
,
operator
:
Address
):
boolean
{
let
result
=
super
.
call
(
"
isApprovedForAll
"
,
"
isApprovedForAll(address,address):(bool)
"
,
[
ethereum
.
Value
.
fromAddress
(
owner
),
ethereum
.
Value
.
fromAddress
(
operator
)],
);
return
result
[
0
].
toBoolean
();
}
try_isApprovedForAll
(
owner
:
Address
,
operator
:
Address
,
):
ethereum
.
CallResult
<
boolean
>
{
let
result
=
super
.
tryCall
(
"
isApprovedForAll
"
,
"
isApprovedForAll(address,address):(bool)
"
,
[
ethereum
.
Value
.
fromAddress
(
owner
),
ethereum
.
Value
.
fromAddress
(
operator
)],
);
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
;
}
}
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
to
():
Address
{
return
this
.
_call
.
inputValues
[
0
].
value
.
toAddress
();
}
get
tokenId
():
BigInt
{
return
this
.
_call
.
inputValues
[
1
].
value
.
toBigInt
();
}
}
export
class
ApproveCall__Outputs
{
_call
:
ApproveCall
;
constructor
(
call
:
ApproveCall
)
{
this
.
_call
=
call
;
}
}
export
class
SetApprovalForAllCall
extends
ethereum
.
Call
{
get
inputs
():
SetApprovalForAllCall__Inputs
{
return
new
SetApprovalForAllCall__Inputs
(
this
);
}
get
outputs
():
SetApprovalForAllCall__Outputs
{
return
new
SetApprovalForAllCall__Outputs
(
this
);
}
}
export
class
SetApprovalForAllCall__Inputs
{
_call
:
SetApprovalForAllCall
;
constructor
(
call
:
SetApprovalForAllCall
)
{
this
.
_call
=
call
;
}
get
to
():
Address
{
return
this
.
_call
.
inputValues
[
0
].
value
.
toAddress
();
}
get
approved
():
boolean
{
return
this
.
_call
.
inputValues
[
1
].
value
.
toBoolean
();
}
}
export
class
SetApprovalForAllCall__Outputs
{
_call
:
SetApprovalForAllCall
;
constructor
(
call
:
SetApprovalForAllCall
)
{
this
.
_call
=
call
;
}
}
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
tokenId
():
BigInt
{
return
this
.
_call
.
inputValues
[
1
].
value
.
toBigInt
();
}
}
export
class
TransferCall__Outputs
{
_call
:
TransferCall
;
constructor
(
call
:
TransferCall
)
{
this
.
_call
=
call
;
}
}
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
tokenId
():
BigInt
{
return
this
.
_call
.
inputValues
[
2
].
value
.
toBigInt
();
}
}
export
class
TransferFromCall__Outputs
{
_call
:
TransferFromCall
;
constructor
(
call
:
TransferFromCall
)
{
this
.
_call
=
call
;
}
}
export
class
SafeTransferFromCall
extends
ethereum
.
Call
{
get
inputs
():
SafeTransferFromCall__Inputs
{
return
new
SafeTransferFromCall__Inputs
(
this
);
}
get
outputs
():
SafeTransferFromCall__Outputs
{
return
new
SafeTransferFromCall__Outputs
(
this
);
}
}
export
class
SafeTransferFromCall__Inputs
{
_call
:
SafeTransferFromCall
;
constructor
(
call
:
SafeTransferFromCall
)
{
this
.
_call
=
call
;
}
get
from
():
Address
{
return
this
.
_call
.
inputValues
[
0
].
value
.
toAddress
();
}
get
to
():
Address
{
return
this
.
_call
.
inputValues
[
1
].
value
.
toAddress
();
}
get
tokenId
():
BigInt
{
return
this
.
_call
.
inputValues
[
2
].
value
.
toBigInt
();
}
}
export
class
SafeTransferFromCall__Outputs
{
_call
:
SafeTransferFromCall
;
constructor
(
call
:
SafeTransferFromCall
)
{
this
.
_call
=
call
;
}
}
export
class
SafeTransferFrom1Call
extends
ethereum
.
Call
{
get
inputs
():
SafeTransferFrom1Call__Inputs
{
return
new
SafeTransferFrom1Call__Inputs
(
this
);
}
get
outputs
():
SafeTransferFrom1Call__Outputs
{
return
new
SafeTransferFrom1Call__Outputs
(
this
);
}
}
export
class
SafeTransferFrom1Call__Inputs
{
_call
:
SafeTransferFrom1Call
;
constructor
(
call
:
SafeTransferFrom1Call
)
{
this
.
_call
=
call
;
}
get
from
():
Address
{
return
this
.
_call
.
inputValues
[
0
].
value
.
toAddress
();
}
get
to
():
Address
{
return
this
.
_call
.
inputValues
[
1
].
value
.
toAddress
();
}
get
tokenId
():
BigInt
{
return
this
.
_call
.
inputValues
[
2
].
value
.
toBigInt
();
}
get
_data
():
Bytes
{
return
this
.
_call
.
inputValues
[
3
].
value
.
toBytes
();
}
}
export
class
SafeTransferFrom1Call__Outputs
{
_call
:
SafeTransferFrom1Call
;
constructor
(
call
:
SafeTransferFrom1Call
)
{
this
.
_call
=
call
;
}
}
generated/schema.ts
0 → 100644
View file @
20089216
// 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
Transfer
extends
Entity
{
constructor
(
id
:
Bytes
)
{
super
();
this
.
set
(
"
id
"
,
Value
.
fromBytes
(
id
));
}
save
():
void
{
let
id
=
this
.
get
(
"
id
"
);
assert
(
id
!=
null
,
"
Cannot save Transfer entity without an ID
"
);
if
(
id
)
{
assert
(
id
.
kind
==
ValueKind
.
BYTES
,
`Entities of type Transfer must have an ID of type Bytes but the id '
${
id
.
displayData
()}
' is of type
${
id
.
displayKind
()}
`
,
);
store
.
set
(
"
Transfer
"
,
id
.
toBytes
().
toHexString
(),
this
);
}
}
static
loadInBlock
(
id
:
Bytes
):
Transfer
|
null
{
return
changetype
<
Transfer
|
null
>
(
store
.
get_in_block
(
"
Transfer
"
,
id
.
toHexString
()),
);
}
static
load
(
id
:
Bytes
):
Transfer
|
null
{
return
changetype
<
Transfer
|
null
>
(
store
.
get
(
"
Transfer
"
,
id
.
toHexString
()));
}
get
id
():
Bytes
{
let
value
=
this
.
get
(
"
id
"
);
if
(
!
value
||
value
.
kind
==
ValueKind
.
NULL
)
{
throw
new
Error
(
"
Cannot return null for a required field.
"
);
}
else
{
return
value
.
toBytes
();
}
}
set
id
(
value
:
Bytes
)
{
this
.
set
(
"
id
"
,
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
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
tokenId
():
BigInt
{
let
value
=
this
.
get
(
"
tokenId
"
);
if
(
!
value
||
value
.
kind
==
ValueKind
.
NULL
)
{
throw
new
Error
(
"
Cannot return null for a required field.
"
);
}
else
{
return
value
.
toBigInt
();
}
}
set
tokenId
(
value
:
BigInt
)
{
this
.
set
(
"
tokenId
"
,
Value
.
fromBigInt
(
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
blockTimestamp
():
BigInt
{
let
value
=
this
.
get
(
"
blockTimestamp
"
);
if
(
!
value
||
value
.
kind
==
ValueKind
.
NULL
)
{
throw
new
Error
(
"
Cannot return null for a required field.
"
);
}
else
{
return
value
.
toBigInt
();
}
}
set
blockTimestamp
(
value
:
BigInt
)
{
this
.
set
(
"
blockTimestamp
"
,
Value
.
fromBigInt
(
value
));
}
get
transactionHash
():
Bytes
{
let
value
=
this
.
get
(
"
transactionHash
"
);
if
(
!
value
||
value
.
kind
==
ValueKind
.
NULL
)
{
throw
new
Error
(
"
Cannot return null for a required field.
"
);
}
else
{
return
value
.
toBytes
();
}
}
set
transactionHash
(
value
:
Bytes
)
{
this
.
set
(
"
transactionHash
"
,
Value
.
fromBytes
(
value
));
}
}
export
class
Approval
extends
Entity
{
constructor
(
id
:
Bytes
)
{
super
();
this
.
set
(
"
id
"
,
Value
.
fromBytes
(
id
));
}
save
():
void
{
let
id
=
this
.
get
(
"
id
"
);
assert
(
id
!=
null
,
"
Cannot save Approval entity without an ID
"
);
if
(
id
)
{
assert
(
id
.
kind
==
ValueKind
.
BYTES
,
`Entities of type Approval must have an ID of type Bytes but the id '
${
id
.
displayData
()}
' is of type
${
id
.
displayKind
()}
`
,
);
store
.
set
(
"
Approval
"
,
id
.
toBytes
().
toHexString
(),
this
);
}
}
static
loadInBlock
(
id
:
Bytes
):
Approval
|
null
{
return
changetype
<
Approval
|
null
>
(
store
.
get_in_block
(
"
Approval
"
,
id
.
toHexString
()),
);
}
static
load
(
id
:
Bytes
):
Approval
|
null
{
return
changetype
<
Approval
|
null
>
(
store
.
get
(
"
Approval
"
,
id
.
toHexString
()));
}
get
id
():
Bytes
{
let
value
=
this
.
get
(
"
id
"
);
if
(
!
value
||
value
.
kind
==
ValueKind
.
NULL
)
{
throw
new
Error
(
"
Cannot return null for a required field.
"
);
}
else
{
return
value
.
toBytes
();
}
}
set
id
(
value
:
Bytes
)
{
this
.
set
(
"
id
"
,
Value
.
fromBytes
(
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
approved
():
Bytes
{
let
value
=
this
.
get
(
"
approved
"
);
if
(
!
value
||
value
.
kind
==
ValueKind
.
NULL
)
{
throw
new
Error
(
"
Cannot return null for a required field.
"
);
}
else
{
return
value
.
toBytes
();
}
}
set
approved
(
value
:
Bytes
)
{
this
.
set
(
"
approved
"
,
Value
.
fromBytes
(
value
));
}
get
tokenId
():
BigInt
{
let
value
=
this
.
get
(
"
tokenId
"
);
if
(
!
value
||
value
.
kind
==
ValueKind
.
NULL
)
{
throw
new
Error
(
"
Cannot return null for a required field.
"
);
}
else
{
return
value
.
toBigInt
();
}
}
set
tokenId
(
value
:
BigInt
)
{
this
.
set
(
"
tokenId
"
,
Value
.
fromBigInt
(
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
blockTimestamp
():
BigInt
{
let
value
=
this
.
get
(
"
blockTimestamp
"
);
if
(
!
value
||
value
.
kind
==
ValueKind
.
NULL
)
{
throw
new
Error
(
"
Cannot return null for a required field.
"
);
}
else
{
return
value
.
toBigInt
();
}
}
set
blockTimestamp
(
value
:
BigInt
)
{
this
.
set
(
"
blockTimestamp
"
,
Value
.
fromBigInt
(
value
));
}
get
transactionHash
():
Bytes
{
let
value
=
this
.
get
(
"
transactionHash
"
);
if
(
!
value
||
value
.
kind
==
ValueKind
.
NULL
)
{
throw
new
Error
(
"
Cannot return null for a required field.
"
);
}
else
{
return
value
.
toBytes
();
}
}
set
transactionHash
(
value
:
Bytes
)
{
this
.
set
(
"
transactionHash
"
,
Value
.
fromBytes
(
value
));
}
}
export
class
ApprovalForAll
extends
Entity
{
constructor
(
id
:
Bytes
)
{
super
();
this
.
set
(
"
id
"
,
Value
.
fromBytes
(
id
));
}
save
():
void
{
let
id
=
this
.
get
(
"
id
"
);
assert
(
id
!=
null
,
"
Cannot save ApprovalForAll entity without an ID
"
);
if
(
id
)
{
assert
(
id
.
kind
==
ValueKind
.
BYTES
,
`Entities of type ApprovalForAll must have an ID of type Bytes but the id '
${
id
.
displayData
()}
' is of type
${
id
.
displayKind
()}
`
,
);
store
.
set
(
"
ApprovalForAll
"
,
id
.
toBytes
().
toHexString
(),
this
);
}
}
static
loadInBlock
(
id
:
Bytes
):
ApprovalForAll
|
null
{
return
changetype
<
ApprovalForAll
|
null
>
(
store
.
get_in_block
(
"
ApprovalForAll
"
,
id
.
toHexString
()),
);
}
static
load
(
id
:
Bytes
):
ApprovalForAll
|
null
{
return
changetype
<
ApprovalForAll
|
null
>
(
store
.
get
(
"
ApprovalForAll
"
,
id
.
toHexString
()),
);
}
get
id
():
Bytes
{
let
value
=
this
.
get
(
"
id
"
);
if
(
!
value
||
value
.
kind
==
ValueKind
.
NULL
)
{
throw
new
Error
(
"
Cannot return null for a required field.
"
);
}
else
{
return
value
.
toBytes
();
}
}
set
id
(
value
:
Bytes
)
{
this
.
set
(
"
id
"
,
Value
.
fromBytes
(
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
operator
():
Bytes
{
let
value
=
this
.
get
(
"
operator
"
);
if
(
!
value
||
value
.
kind
==
ValueKind
.
NULL
)
{
throw
new
Error
(
"
Cannot return null for a required field.
"
);
}
else
{
return
value
.
toBytes
();
}
}
set
operator
(
value
:
Bytes
)
{
this
.
set
(
"
operator
"
,
Value
.
fromBytes
(
value
));
}
get
approved
():
boolean
{
let
value
=
this
.
get
(
"
approved
"
);
if
(
!
value
||
value
.
kind
==
ValueKind
.
NULL
)
{
return
false
;
}
else
{
return
value
.
toBoolean
();
}
}
set
approved
(
value
:
boolean
)
{
this
.
set
(
"
approved
"
,
Value
.
fromBoolean
(
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
blockTimestamp
():
BigInt
{
let
value
=
this
.
get
(
"
blockTimestamp
"
);
if
(
!
value
||
value
.
kind
==
ValueKind
.
NULL
)
{
throw
new
Error
(
"
Cannot return null for a required field.
"
);
}
else
{
return
value
.
toBigInt
();
}
}
set
blockTimestamp
(
value
:
BigInt
)
{
this
.
set
(
"
blockTimestamp
"
,
Value
.
fromBigInt
(
value
));
}
get
transactionHash
():
Bytes
{
let
value
=
this
.
get
(
"
transactionHash
"
);
if
(
!
value
||
value
.
kind
==
ValueKind
.
NULL
)
{
throw
new
Error
(
"
Cannot return null for a required field.
"
);
}
else
{
return
value
.
toBytes
();
}
}
set
transactionHash
(
value
:
Bytes
)
{
this
.
set
(
"
transactionHash
"
,
Value
.
fromBytes
(
value
));
}
}
export
class
Minted
extends
Entity
{
constructor
(
id
:
Bytes
)
{
super
();
this
.
set
(
"
id
"
,
Value
.
fromBytes
(
id
));
}
save
():
void
{
let
id
=
this
.
get
(
"
id
"
);
assert
(
id
!=
null
,
"
Cannot save Minted entity without an ID
"
);
if
(
id
)
{
assert
(
id
.
kind
==
ValueKind
.
BYTES
,
`Entities of type Minted must have an ID of type Bytes but the id '
${
id
.
displayData
()}
' is of type
${
id
.
displayKind
()}
`
,
);
store
.
set
(
"
Minted
"
,
id
.
toBytes
().
toHexString
(),
this
);
}
}
static
loadInBlock
(
id
:
Bytes
):
Minted
|
null
{
return
changetype
<
Minted
|
null
>
(
store
.
get_in_block
(
"
Minted
"
,
id
.
toHexString
()),
);
}
static
load
(
id
:
Bytes
):
Minted
|
null
{
return
changetype
<
Minted
|
null
>
(
store
.
get
(
"
Minted
"
,
id
.
toHexString
()));
}
get
id
():
Bytes
{
let
value
=
this
.
get
(
"
id
"
);
if
(
!
value
||
value
.
kind
==
ValueKind
.
NULL
)
{
throw
new
Error
(
"
Cannot return null for a required field.
"
);
}
else
{
return
value
.
toBytes
();
}
}
set
id
(
value
:
Bytes
)
{
this
.
set
(
"
id
"
,
Value
.
fromBytes
(
value
));
}
set
sortHash
(
value
:
Bytes
)
{
this
.
set
(
"
sortHash
"
,
Value
.
fromBytes
(
value
));
}
get
sortHash
():
Bytes
{
let
value
=
this
.
get
(
"
sortHash
"
);
if
(
!
value
||
value
.
kind
==
ValueKind
.
NULL
)
{
throw
new
Error
(
"
Cannot return null for a required field.
"
);
}
else
{
return
value
.
toBytes
();
}
}
get
sortIndex
():
BigInt
{
let
value
=
this
.
get
(
"
sortIndex
"
);
if
(
!
value
||
value
.
kind
==
ValueKind
.
NULL
)
{
throw
new
Error
(
"
Cannot return null for a required field.
"
);
}
else
{
return
value
.
toBigInt
();
}
}
set
sortIndex
(
value
:
BigInt
)
{
this
.
set
(
"
sortIndex
"
,
Value
.
fromBigInt
(
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
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
tokenId
():
BigInt
{
let
value
=
this
.
get
(
"
tokenId
"
);
if
(
!
value
||
value
.
kind
==
ValueKind
.
NULL
)
{
throw
new
Error
(
"
Cannot return null for a required field.
"
);
}
else
{
return
value
.
toBigInt
();
}
}
set
tokenId
(
value
:
BigInt
)
{
this
.
set
(
"
tokenId
"
,
Value
.
fromBigInt
(
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
blockTimestamp
():
BigInt
{
let
value
=
this
.
get
(
"
blockTimestamp
"
);
if
(
!
value
||
value
.
kind
==
ValueKind
.
NULL
)
{
throw
new
Error
(
"
Cannot return null for a required field.
"
);
}
else
{
return
value
.
toBigInt
();
}
}
set
blockTimestamp
(
value
:
BigInt
)
{
this
.
set
(
"
blockTimestamp
"
,
Value
.
fromBigInt
(
value
));
}
get
transactionHash
():
Bytes
{
let
value
=
this
.
get
(
"
transactionHash
"
);
if
(
!
value
||
value
.
kind
==
ValueKind
.
NULL
)
{
throw
new
Error
(
"
Cannot return null for a required field.
"
);
}
else
{
return
value
.
toBytes
();
}
}
set
transactionHash
(
value
:
Bytes
)
{
this
.
set
(
"
transactionHash
"
,
Value
.
fromBytes
(
value
));
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment