forked from rainlanguage/rain1155
-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.graphql
89 lines (84 loc) · 3.06 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
type Rain1155 @entity {
"Rain1155 address"
id: ID!#{Rain1155.address}
"total numbers of assets created"
totalAssets: BigInt! # Increment by 1 after each new assets creation
"List of Assets"
assets: [Asset!] # Add Asset.id from AssetCreated event
"List of Holders of Assets"
holders: [Holder!] # Add new Holder from TransferSingle or TransferBatch event
"Block number at which Rain1155 contract deployed"
deployBlock: BigInt! # event.block.number
"Timestamp at which Rain1155 contract deployed"
deployTimestamp: BigInt! # event.block.timestamp
}
type Asset @entity {
#{Rain1155.address}-{event.params._asset._assetId}
id: ID! #{Rain1155.address}-{event.params._asset._assetId}
"Name of asset"
name: String! # event.params._name
"Description of Asset"
description: String! # event.params._descciption
"Id of asset"
assetId: BigInt! # event.params._asset._assetId
"Creator of this asset"
recipient: Bytes! # event.params._asset.creator
"Id of LootBox that contains this asset"
lootBoxID: BigInt! # event.params._asset.lootBoxId
"Script for price"
priceConfig: PriceConfig! # event.params._asset._priceConfig
"Script for mintConditions"
canMintConfig: CanMintConfig! # event.params._asset._canMintConfig
"List of ERC20 and ERC1155 tokens used for payment"
currencies: [String!]! # event.params._asset.currencies
"Block number at which Rain1155 contract deployed"
creationBlock: BigInt! # event.block.number
"Timestamp at which Rain1155 contract deployed"
creationTimestamp: BigInt! # event.block.timestamp
"TokenURI of Asset"
tokenURI: String! # event.params._asset.tokenURI
}
# create from AssetCreated event
type PriceConfig @entity {
#{Rain1155.address}-{event.params._asset._assetId}
id: ID!
# event.params._asset._priceConfig.sources
sources: [Bytes!]!
# event.params._asset._priceConfig.constants
constants: [BigInt!]!
# event.params._asset._priceConfig.stackLength
stackLength: BigInt!
# event.params._asset._priceConfig.argumentsLength
argumentsLength: BigInt!
}
# create from AssetCreated event
type CanMintConfig @entity {
#{Rain1155.address}-{event.params._asset._assetId}
id: ID!
# event.params._asset._priceConfig.sources
sources: [Bytes!]!
# event.params._asset._priceConfig.constants
constants: [BigInt!]!
# event.params._asset._priceConfig.stackLength
stackLength: BigInt!
# event.params._asset._priceConfig.argumentsLength
argumentsLength: BigInt!
}
# Create on every TransferSingle or TransferBatch event
type Holder @entity {
id: ID! #{Rain1155.address}-{event.params.to}
"Address of holder"
address: Bytes! # event.params.to
"List of AssetsOwned"
assetsOwned: [AssetsOwned!] # Add AssetsOwned by this user on every TransferSingle or TransferBatch event
}
type AssetsOwned @entity {
id: ID! #{Rain1155.address}-{Receiver}-{event.params.id}
"Asset entity"
asset: Asset! # Asset that is minted or transferd
"Id of asset"
assetId: BigInt! # Id od that Asset
"Amount of this asset owned"
count: BigInt! # TotalNumber of assets Owned of AssetId
# Increament for every AssetId.
}