Remove formatting

This commit is contained in:
trizin 2023-08-17 21:24:55 +03:00 committed by GitHub
parent 3a77c3a5c8
commit 34c81143b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 236 additions and 221 deletions

View File

@ -1,134 +1,134 @@
type Token @entity {
id: ID!
symbol: String
name: String
decimals: Int!
address: String!
cap: BigDecimal
supply: BigDecimal
isDatatoken: Boolean!
id: ID!
symbol: String
name: String
decimals: Int!
address: String!
cap: BigDecimal
supply: BigDecimal
isDatatoken: Boolean!
"address of ERC721 that owns the token, valid only for datatokens"
nft: Nft
"address of ERC721 that owns the token, valid only for datatokens"
nft: Nft
"array of addresses with minter role"
minter: [String!]
"array of addresses with minter role"
minter: [String!]
"array of addresses with payment manager minter role"
paymentManager: [String!]
"array of addresses with payment manager minter role"
paymentManager: [String!]
"address that collects the payments (NOT fees)"
paymentCollector: String
"address that collects the payments (NOT fees)"
paymentCollector: String
"address of the market where the datatoken was created. This address collects market fees."
publishMarketFeeAddress: String
"address of the market where the datatoken was created. This address collects market fees."
publishMarketFeeAddress: String
"adreess of fee token (can be Ocean, ETH, etc.)"
publishMarketFeeToken: String
"adreess of fee token (can be Ocean, ETH, etc.)"
publishMarketFeeToken: String
"fee amount. Fixed value."
publishMarketFeeAmount: BigDecimal
"fee amount. Fixed value."
publishMarketFeeAmount: BigDecimal
"template ID of the datatoken"
templateId: BigInt!
"template ID of the datatoken"
templateId: BigInt!
"number of addresses holding a balance of datatoken , TODO: can we actually calculate this? what happens when users trade the dts"
holderCount: BigInt!
"number of addresses holding a balance of datatoken , TODO: can we actually calculate this? what happens when users trade the dts"
holderCount: BigInt!
"number of orders executed for this datatoken"
orderCount: BigInt!
"number of orders executed for this datatoken"
orderCount: BigInt!
"orders created with the datatoken, only available for datatokens"
orders: [Order!] @derivedFrom(field:"datatoken")
"orders created with the datatoken, only available for datatokens"
orders: [Order!] @derivedFrom(field: "datatoken")
"fixed rate exchanges, only available for datatokens"
fixedRateExchanges: [FixedRateExchange!] @derivedFrom(field:"datatoken")
"fixed rate exchanges, only available for datatokens"
fixedRateExchanges: [FixedRateExchange!] @derivedFrom(field: "datatoken")
"dispensers using this token"
dispensers: [Dispenser!] @derivedFrom(field:"token")
"dispensers using this token"
dispensers: [Dispenser!] @derivedFrom(field: "token")
"block time datatoken was created"
createdTimestamp: Int!
"block time datatoken was created"
createdTimestamp: Int!
"datatoken creation transaction id"
tx: String!
eventIndex: Int!
"block number when it was created"
block: Int!
"datatoken creation transaction id"
tx: String!
eventIndex: Int!
"block number when it was created"
block: Int!
lastPriceToken: Token
lastPriceValue: BigDecimal!
lastPriceToken: Token
lastPriceValue: BigDecimal!
}
"utility type"
type TokenValuePair @entity {
"address of the token"
id: ID!
token: Token!
value: BigDecimal!
"address of the token"
id : ID!
token : Token!
value : BigDecimal!
}
type Nft @entity {
"nft address"
id: ID!
symbol: String!
name: String!
tokenUri: String
type Nft @entity{
"nft address"
id: ID!
symbol: String!
name: String!
tokenUri: String
"address of the owner of the nft"
owner: User!
"address of the creator of the nft"
creator: User!
"address of the owner of the nft"
owner: User!
"address of the creator of the nft"
creator: User!
"same as id, it's just for easy discoverability"
address: String!
"same as id, it's just for easy discoverability"
address: String!
"provider url that can decrypt the ddo"
providerUrl: String
"provider url that can decrypt the ddo"
providerUrl: String
"state of the asset (described in docs)"
assetState: Int!
"state of the asset (described in docs)"
assetState: Int!
managerRole: [String!]
erc20DeployerRole: [String!]
storeUpdateRole: [String!]
"addresses that can update the metadata"
metadataRole: [String!]
managerRole: [String!]
erc20DeployerRole: [String!]
storeUpdateRole: [String!]
"addresses that can update the metadata"
metadataRole: [String!]
"template address"
template: String!
"template address"
template: String!
"template ID of the datatoken"
templateId: Int
"set if NFT is transferable"
transferable: Boolean!
"template ID of the datatoken"
templateId: Int
"block time nft was created"
createdTimestamp: Int!
"nft creation transaction id"
tx: String!
eventIndex: Int!
"block number when it was created"
block: Int
"set if NFT is transferable"
transferable: Boolean!
"number of orders executed for all underlying datatokens"
orderCount: BigInt!
"block time nft was created"
createdTimestamp: Int!
"nft creation transaction id"
tx: String!
eventIndex: Int!
"block number when it was created"
block: Int
"has metadata"
hasMetadata: Boolean!
"number of orders executed for all underlying datatokens"
orderCount: BigInt!
"has metadata"
hasMetadata: Boolean!
nftData: [NftData!] @derivedFrom(field: "nft")
transferHistory: [NftTransferHistory!] @derivedFrom(field: "nft")
nftData: [NftData!] @derivedFrom(field: "nft")
transferHistory: [NftTransferHistory!] @derivedFrom(field: "nft")
}
type NftData @entity {
"nft address+key"
id: ID!
nft: Nft!
key: Bytes
value: Bytes
}
type NftData @entity{
"nft address+key"
id: ID!
nft: Nft!
key: Bytes
value: Bytes
}
type OrderReuse @entity {
id: ID!
@ -143,11 +143,11 @@ type OrderReuse @entity {
"gas price in Wei"
gasPrice: BigInt
gasUsed: BigDecimal
}
}
type Order @entity {
"transaction hash - token address - from address - eventIndex"
id: ID!
type Order @entity {
"transaction hash - token address - from address - eventIndex"
id: ID!
datatoken: Token!
consumer: User!
@ -156,16 +156,18 @@ type Order @entity {
serviceIndex: Int!
nftOwner: User!
# the fees will be updated from an event that will be created after (todo)
publishingMarket: User
publishingMarketToken: Token #
publishingMarketAmmount: BigDecimal #call contract to get fee amount
publishingMarketToken: Token #
publishingMarketAmmount: BigDecimal #call contract to get fee amount
providerFee: String
providerFeeValidUntil: BigInt
consumerMarket: User
consumerMarketToken: Token #
consumerMarketAmmount: BigDecimal #call contract to get fee amount
consumerMarketToken: Token #
consumerMarketAmmount: BigDecimal #call contract to get fee amount
reuses: [OrderReuse!] @derivedFrom(field: "order")
createdTimestamp: Int!
@ -186,19 +188,19 @@ type User @entity {
tokenBalancesOwned: [TokenValuePair!]
orders: [Order!] @derivedFrom(field: "payer")
freSwaps: [FixedRateExchangeSwap!] @derivedFrom(field: "by")
"total number of orders made by this user"
"total number of orders made by this user"
totalOrders: BigInt!
"total number of orders made on assets owned by this user"
"total number of orders made on assets owned by this user"
totalSales: BigInt!
}
type FixedRateExchange @entity {
"fixed rate exchange id"
id: ID!
id: ID!
contract: String!
exchangeId: String!
exchangeId: String!
owner: User!
datatoken: Token!
baseToken: Token!
@ -211,13 +213,13 @@ type FixedRateExchange @entity {
price: BigDecimal!
active: Boolean!
"amount of total basetokens spent"
totalSwapValue: BigDecimal!
"address that is allowed to swap tokens"
allowedSwapper: String
totalSwapValue: BigDecimal!
"address that is allowed to swap tokens"
allowedSwapper: String
"if the owner allowes the fre to mint"
withMint: Boolean
"if the fre has the minter role on the datatoken"
isMinter: Boolean
withMint: Boolean
"if the fre has the minter role on the datatoken"
isMinter: Boolean
updates: [FixedRateExchangeUpdate!] @derivedFrom(field: "exchangeId")
swaps: [FixedRateExchangeSwap!] @derivedFrom(field: "exchangeId")
@ -227,11 +229,12 @@ type FixedRateExchange @entity {
eventIndex: Int!
block: Int!
"address of the market where the datatoken was created. This address collects market fees."
publishMarketFeeAddress: String
"address of the market where the datatoken was created. This address collects market fees."
publishMarketFeeAddress: String
"fee amount. Fixed value"
publishMarketSwapFee: BigDecimal
"fee amount. Fixed value"
publishMarketSwapFee: BigDecimal
}
type FixedRateExchangeUpdate @entity {
@ -264,38 +267,40 @@ type FixedRateExchangeSwap @entity {
tx: String!
eventIndex: Int!
oceanFeeAmount: BigDecimal!
marketFeeAmount: BigDecimal!
marketFeeAmount: BigDecimal!
consumeMarketFeeAmount: BigDecimal!
}
type Dispenser @entity {
"token address"
id: ID!
contract: String!
active: Boolean!
"if using the enterprise template the owner will always be the erc721 factory, for normal template it will a user"
id: ID!
contract: String!
active: Boolean!
"if using the enterprise template the owner will always be the erc721 factory, for normal template it will a user"
owner: String
token: Token!
allowedSwapper: String
isMinter: Boolean
"max tokens that can be dispensed"
maxTokens: BigDecimal!
"max balance of requester. If the balance is higher, the dispense is rejected"
maxBalance: BigDecimal!
"how many tokens are left"
balance: BigDecimal!
isMinter: Boolean
"max tokens that can be dispensed"
maxTokens: BigDecimal!
"max balance of requester. If the balance is higher, the dispense is rejected"
maxBalance: BigDecimal!
"how many tokens are left"
balance: BigDecimal!
block: Int!
createdTimestamp: Int!
tx: String!
tx: String!
eventIndex: Int!
dispenses: [DispenserTransaction!] @derivedFrom(field: "dispenser")
}
type DispenserTransaction @entity {
id: ID!
id: ID!
dispenser: Dispenser!
user: User!
amount: BigDecimal!
@ -308,67 +313,66 @@ type DispenserTransaction @entity {
"utility type"
type GlobalTotalLiquidityPair @entity {
"address of the token"
id: ID!
globalStatistic: GlobalStatistic!
token: Token!
value: BigDecimal!
"address of the token"
id : ID!
globalStatistic: GlobalStatistic!
token : Token!
value : BigDecimal!
}
"utility type"
type GlobalTotalFixedSwapPair @entity {
"address of the token"
id: ID!
globalStatistic: GlobalStatistic!
token: Token!
value: BigDecimal!
count: BigInt!
"address of the token"
id : ID!
globalStatistic: GlobalStatistic!
token : Token!
value : BigDecimal!
count: BigInt!
}
type GlobalStatistic @entity {
id: ID!
id: ID!
"total swap volume for each base token in fixed rate exchanges"
totalFixedSwapVolume: [GlobalTotalFixedSwapPair!]
@derivedFrom(field: "globalStatistic")
"total swap volume for each base token in fixed rate exchanges"
totalFixedSwapVolume: [GlobalTotalFixedSwapPair!] @derivedFrom(field: "globalStatistic")
"number of total orders. fixed rate exchange orders + dispenser orders"
orderCount: Int!
"number of total orders. fixed rate exchange orders + dispenser orders"
orderCount: Int!
"total nfts(erc721) created"
nftCount: Int!
"total datatokens (tokens with isDatatoken = true) created"
datatokenCount:Int!
"number of fixed rate exchanges"
fixedCount: Int!
"total nfts(erc721) created"
nftCount: Int!
"total datatokens (tokens with isDatatoken = true) created"
datatokenCount: Int!
"number of dispensers created"
dispenserCount: Int!
"number of fixed rate exchanges"
fixedCount: Int!
"number of dispensers created"
dispenserCount: Int!
"total ocean locked in veOcean"
totalOceanLocked: BigDecimal!
"current version"
version: String
"total ocean locked in veOcean"
totalOceanLocked:BigDecimal!
"current version"
version: String
}
type OPC @entity {
id: ID!
"fee in percent for swaps involving OPC approved tokens"
swapOceanFee: BigDecimal
"fee in percent for swaps involving non OPC approved tokens"
swapNonOceanFee: BigDecimal
"fee in percent taken by OPC from orderFees"
orderFee: BigDecimal
"fee in percent taken by OPC from providerFees"
providerFee: BigDecimal
approvedTokens: [Token!]
id: ID!
"fee in percent for swaps involving OPC approved tokens"
swapOceanFee: BigDecimal
"fee in percent for swaps involving non OPC approved tokens"
swapNonOceanFee: BigDecimal
"fee in percent taken by OPC from orderFees"
orderFee: BigDecimal
"fee in percent taken by OPC from providerFees"
providerFee: BigDecimal
approvedTokens: [Token!]
}
enum NftUpdateType {
METADATA_CREATED
METADATA_UPDATED
STATE_UPDATED
enum NftUpdateType {
METADATA_CREATED,
METADATA_UPDATED,
STATE_UPDATED,
TOKENURI_UPDATED
}
@ -377,10 +381,10 @@ type NftUpdate @entity {
tokenUri: String
nft: Nft!
"provider url that can decrypt the ddo"
providerUrl: String
"provider url that can decrypt the ddo"
providerUrl: String
"user that made the update"
"user that made the update"
userAddress: String!
"state of the asset in this update"
@ -395,7 +399,7 @@ type NftUpdate @entity {
eventIndex: Int!
}
type Template @entity {
type Template @entity{
id: ID!
fixedRateTemplates: [String!]
dispenserTemplates: [String!]
@ -403,11 +407,11 @@ type Template @entity {
}
# Not tracking allocationToId or idToAllocation
type VeAllocateUser @entity {
type VeAllocateUser @entity{
"id = {user}"
id: ID!
veAllocation: [VeAllocation!] @derivedFrom(field: "allocationUser")
veAllocation: [VeAllocation!] @derivedFrom(field: "allocationUser")
allocatedTotal: BigDecimal!
block: Int!
@ -418,7 +422,7 @@ type VeAllocateUser @entity {
veOcean: VeOCEAN!
}
type VeAllocateId @entity {
type VeAllocateId @entity{
"id = {DataNFT Address}-{chain id}"
id: ID!
nftAddress: String!
@ -441,7 +445,7 @@ type VeAllocation @entity {
allocationUser: VeAllocateUser!
allocationId: VeAllocateId!
updates: [VeAllocationUpdate!] @derivedFrom(field: "veAllocation")
allocated: BigDecimal!
chainId: BigInt!
@ -455,14 +459,14 @@ type VeAllocation @entity {
}
enum veAllocationUpdateType {
SET
SET,
REMOVED
}
type VeAllocationUpdate @entity {
"{tx}-{VeAllocation id}-{eventIndex}"
id: ID!
veAllocation: VeAllocation!
type: veAllocationUpdateType!
allocatedTotal: BigDecimal!
@ -474,7 +478,7 @@ type VeAllocationUpdate @entity {
}
type VeDelegation @entity {
"id = VeDelegation contract + tokenId"
"id = VeDelegation contract + tokenId"
id: ID!
delegator: VeOCEAN!
receiver: VeOCEAN!
@ -485,6 +489,7 @@ type VeDelegation @entity {
cancelTime: BigInt!
expireTime: BigInt!
updates: [VeDelegationUpdate!] @derivedFrom(field: "veDelegation")
}
type VeDelegationUpdate @entity {
@ -499,10 +504,11 @@ type VeDelegationUpdate @entity {
cancelTime: BigInt!
expireTime: BigInt!
"type: CREATE_BOOST = 0, EXTEND_BOOST = 1, BURN_BOOST = 2"
type: Int!
veDelegation: VeDelegation!
type:Int!
veDelegation:VeDelegation!
}
type VeOCEAN @entity {
"id = {user address}"
id: ID!
@ -522,7 +528,7 @@ type VeDeposit @entity {
"id = {user address}-{tx}-{eventIndex}"
id: ID!
"veOcean holder"
provider: String!
provider:String!
"who initiated the tx"
sender: String!
"amount of tokens locked"
@ -530,23 +536,23 @@ type VeDeposit @entity {
"unlock timestamp"
unlockTime: BigInt!
"deposit type: DEPOSIT_FOR = 0, CREATE_LOCK_TYPE = 1,INCREASE_LOCK_AMOUNT = 2,INCREASE_UNLOCK_TIME = 3, WITHDRAW = 4"
type: BigInt!
type:BigInt!
timestamp: BigInt!
block: Int!
tx: String!
eventIndex: Int!
veOcean: VeOCEAN!
totalOceanLocked: BigDecimal!
totalOceanLocked:BigDecimal!
}
type VeFeeDistributor @entity {
"id = contract address"
id: ID!
"token used by FeeDistributor"
token: Token!
claims: [VeClaim!] @derivedFrom(field: "VeFeeDistributor")
checkpoints: [VeFeeDistributorCheckPoint!]
@derivedFrom(field: "VeFeeDistributor")
checkpoints: [VeFeeDistributorCheckPoint!] @derivedFrom(field: "VeFeeDistributor")
}
type VeFeeDistributorCheckPoint @entity {
@ -581,7 +587,7 @@ type VeClaim @entity {
}
enum DFHistoryType {
Allocated
Allocated,
Claimed
}
@ -593,6 +599,7 @@ type DFAvailableClaim @entity {
token: Token!
}
type DFHistory @entity {
"id = {user-id}-{txId}-{eventId}"
id: ID!
@ -606,6 +613,7 @@ type DFHistory @entity {
eventIndex: Int!
}
type DFReward @entity {
"id = {user address}"
id: ID!
@ -638,7 +646,9 @@ type Erc20Template @entity {
templateId: BigInt!
}
type PredictSubscription @entity {
type PredictSubscription @entity{
"id = {contract address}-{txid}-{eventIndex}"
id: ID!
predictContract: PredictContract!
@ -646,18 +656,19 @@ type PredictSubscription @entity {
expireTime: BigInt!
"txId"
txId: String
eventIndex: Int!
eventIndex:Int!
timestamp: Int!
block: Int!
}
enum PredictSlotStatus {
Pending
Paying
Pending,
Paying,
Canceled
}
type PredictPayout @entity {
type PredictPayout @entity{
"id = {contract address}-{slot}-{user}"
id: ID!
prediction: PredictPrediction!
@ -667,12 +678,12 @@ type PredictPayout @entity {
aggregatedPredictedValue: BigDecimal!
"txId"
txId: String
eventIndex: Int!
eventIndex:Int!
timestamp: Int!
block: Int!
}
type PredictPrediction @entity {
type PredictPrediction @entity{
"id = {contract address}-{slot}-{user}"
id: ID!
slot: PredictSlot!
@ -681,41 +692,42 @@ type PredictPrediction @entity {
payout: PredictPayout
"txId"
txId: String
eventIndex: Int!
eventIndex:Int!
timestamp: Int!
block: Int!
}
type PredictTrueVal @entity {
type PredictTrueVal @entity{
"id = {contract address}-{slot}"
id: ID!
slot: PredictSlot!
trueValue: Boolean!
"txId"
txId: String
eventIndex: Int!
eventIndex:Int!
timestamp: Int!
block: Int!
}
type PredictionRevenue @entity {
type PredictionRevenue @entity{
"id = {contract address}-{slot}-{txid}-{eventIndex}"
id: ID!
slot: PredictSlot!
amount: BigDecimal!
"txId"
txId: String
eventIndex: Int!
eventIndex:Int!
timestamp: Int!
block: Int!
}
type PredictSlot @entity {
type PredictSlot @entity{
"id = {contract address}-{slot}"
id: ID!
predictContract: PredictContract!
slot: BigInt!
predictions: [PredictPrediction!] @derivedFrom(field: "slot")
predictions:[PredictPrediction!] @derivedFrom(field: "slot")
trueValues: [PredictTrueVal!] @derivedFrom(field: "slot")
revenue: BigDecimal!
revenues: [PredictionRevenue!] @derivedFrom(field: "slot")
@ -724,7 +736,8 @@ type PredictSlot @entity {
roundSumStakes: BigDecimal!
}
type PredictSettingUpdate @entity {
type PredictSettingUpdate @entity{
"id = {contract address}-{txId}-{eventIndex}"
id: ID!
predictContract: PredictContract!
@ -734,11 +747,11 @@ type PredictSettingUpdate @entity {
stakeToken: Token
"txId"
txId: String
eventIndex: Int!
eventIndex:Int!
timestamp: Int!
block: Int!
}
type PredictContract @entity {
type PredictContract @entity{
"id = {contract address}"
id: ID!
token: Token!
@ -757,3 +770,5 @@ type PredictContract @entity {
block: Int!
eventIndex: Int!
}

View File

@ -183,10 +183,10 @@ export function handleSettingChanged(event: SettingChanged): void {
predictContract.save()
const predictSettingsUpdate = new PredictSettingUpdate(
event.address.toHexString() +
'- ' +
event.transaction.hash.toHexString() +
'-' +
event.logIndex.toHexString()
'- ' +
event.transaction.hash.toHexString() +
'-' +
event.logIndex.toHexString()
)
predictSettingsUpdate.block = event.block.number.toI32()
predictSettingsUpdate.txId = event.transaction.hash.toHexString()