Repository navigation
Expand file tree
/
Copy pathschema.graphql
More file actions
95 lines (89 loc) · 3.01 KB
/
Copy pathschema.graphql
File metadata and controls
95 lines (89 loc) · 3.01 KB
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
90
91
92
93
94
95
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!] @derivedFrom(field: "rain1155")# 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"
rain1155: Rain1155!
name: String! # event.params._name
"Description of Asset"
description: String! # event.params._description
"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 of the asset"
vmStateConfig: VMStateConfig! # event.params._asset.vmStateConfig
"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: [Currency!]! # 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
sales: [Sale!] @derivedFrom(field: "asset")
holders: [Holder!]
}
# 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 transferred
"Id of asset"
assetId: BigInt! # Id od that Asset
"Amount of this asset owned"
count: BigInt! # TotalNumber of assets Owned of AssetId
# Increment for every AssetId.
}
type Currency @entity {
id: ID! # token Address
address: Bytes! # token Address
type: String!
name: String
symbol: String
decimals: Int
tokenId: BigInt
tokenURI: String
}
# create from AssetCreated event
type VMStateConfig @entity {
#{Rain1155.address}-{event.params._asset._assetId}
id: ID!
# event.params._asset._priceConfig.sources
sources: [Bytes!]!
# event.params._asset._priceConfig.constants
constants: [BigInt!]!
}
type Sale @entity {
id: ID!
asset: Asset!
quantity: BigInt!
timestamp: BigInt!
to: Bytes!
}