mirror of
https://github.com/oceanprotocol/ocean-subgraph.git
synced 2024-12-02 05:57:29 +01:00
Fix and rename
This commit is contained in:
parent
c0fe3cd6b4
commit
70846eafe2
314
schema.graphql
314
schema.graphql
@ -1,130 +1,130 @@
|
||||
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: Int
|
||||
"template ID of the datatoken"
|
||||
templateId: Int
|
||||
|
||||
"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!
|
||||
"datatoken creation transaction id"
|
||||
tx: String!
|
||||
|
||||
"block number when it was created"
|
||||
block: 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!
|
||||
|
||||
"set if NFT is transferable"
|
||||
transferable: Boolean!
|
||||
"set if NFT is transferable"
|
||||
transferable: Boolean!
|
||||
|
||||
"block time nft was created"
|
||||
createdTimestamp: Int!
|
||||
"nft creation transaction id"
|
||||
tx: String!
|
||||
"block number when it was created"
|
||||
block: Int
|
||||
"block time nft was created"
|
||||
createdTimestamp: Int!
|
||||
"nft creation transaction id"
|
||||
tx: String!
|
||||
"block number when it was created"
|
||||
block: Int
|
||||
|
||||
"number of orders executed for all underlying datatokens"
|
||||
orderCount: BigInt!
|
||||
"number of orders executed for all underlying datatokens"
|
||||
orderCount: BigInt!
|
||||
|
||||
"has metadata"
|
||||
hasMetadata: Boolean!
|
||||
"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!
|
||||
@ -138,7 +138,7 @@ type OrderReuse @entity {
|
||||
"gas price in Wei"
|
||||
gasPrice: BigInt
|
||||
gasUsed: BigDecimal
|
||||
}
|
||||
}
|
||||
|
||||
type Order @entity {
|
||||
"transaction hash - token address - from address"
|
||||
@ -151,18 +151,16 @@ 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!
|
||||
@ -227,7 +225,6 @@ type FixedRateExchange @entity {
|
||||
|
||||
"fee amount. Fixed value"
|
||||
publishMarketSwapFee: BigDecimal
|
||||
|
||||
}
|
||||
|
||||
type FixedRateExchangeUpdate @entity {
|
||||
@ -258,11 +255,10 @@ type FixedRateExchangeSwap @entity {
|
||||
createdTimestamp: Int!
|
||||
tx: String!
|
||||
oceanFeeAmount: BigDecimal!
|
||||
marketFeeAmount: BigDecimal!
|
||||
marketFeeAmount: BigDecimal!
|
||||
consumeMarketFeeAmount: BigDecimal!
|
||||
}
|
||||
|
||||
|
||||
type Dispenser @entity {
|
||||
"token address"
|
||||
id: ID!
|
||||
@ -281,7 +277,6 @@ type Dispenser @entity {
|
||||
"how many tokens are left"
|
||||
balance: BigDecimal!
|
||||
|
||||
|
||||
block: Int!
|
||||
createdTimestamp: Int!
|
||||
tx: String!
|
||||
@ -302,66 +297,67 @@ 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!
|
||||
"total nfts(erc721) created"
|
||||
nftCount: Int!
|
||||
"total datatokens (tokens with isDatatoken = true) created"
|
||||
datatokenCount: Int!
|
||||
|
||||
"number of fixed rate exchanges"
|
||||
fixedCount: Int!
|
||||
"number of fixed rate exchanges"
|
||||
fixedCount: Int!
|
||||
|
||||
"number of dispensers created"
|
||||
dispenserCount: Int!
|
||||
"number of dispensers created"
|
||||
dispenserCount: Int!
|
||||
|
||||
"total ocean locked in veOcean"
|
||||
totalOceanLocked:BigDecimal!
|
||||
"total ocean locked in veOcean"
|
||||
totalOceanLocked: BigDecimal!
|
||||
|
||||
"current version"
|
||||
version: String
|
||||
"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
|
||||
}
|
||||
|
||||
@ -373,7 +369,7 @@ type NftUpdate @entity {
|
||||
"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"
|
||||
@ -387,7 +383,7 @@ type NftUpdate @entity {
|
||||
tx: String!
|
||||
}
|
||||
|
||||
type Template @entity{
|
||||
type Template @entity {
|
||||
id: ID!
|
||||
fixedRateTemplates: [String!]
|
||||
dispenserTemplates: [String!]
|
||||
@ -395,7 +391,7 @@ type Template @entity{
|
||||
}
|
||||
|
||||
# Not tracking allocationToId or idToAllocation
|
||||
type VeAllocateUser @entity{
|
||||
type VeAllocateUser @entity {
|
||||
"id = {user}"
|
||||
id: ID!
|
||||
|
||||
@ -409,7 +405,7 @@ type VeAllocateUser @entity{
|
||||
veOcean: VeOCEAN!
|
||||
}
|
||||
|
||||
type VeAllocateId @entity{
|
||||
type VeAllocateId @entity {
|
||||
"id = {DataNFT Address}-{chain id}"
|
||||
id: ID!
|
||||
nftAddress: String!
|
||||
@ -444,7 +440,7 @@ type VeAllocation @entity {
|
||||
}
|
||||
|
||||
enum veAllocationUpdateType {
|
||||
SET,
|
||||
SET
|
||||
REMOVED
|
||||
}
|
||||
|
||||
@ -469,11 +465,10 @@ type VeDelegation @entity {
|
||||
tokenId: BigInt!
|
||||
amount: BigDecimal!
|
||||
lockedAmount: BigDecimal!
|
||||
timeLeft: Int!
|
||||
timeLeftUnlock: Int!
|
||||
cancelTime: BigInt!
|
||||
expireTime: BigInt!
|
||||
updates: [VeDelegationUpdate!] @derivedFrom(field: "veDelegation")
|
||||
|
||||
}
|
||||
|
||||
type VeDelegationUpdate @entity {
|
||||
@ -487,11 +482,10 @@ 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!
|
||||
@ -511,7 +505,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"
|
||||
@ -519,22 +513,22 @@ 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!
|
||||
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 {
|
||||
@ -567,7 +561,7 @@ type VeClaim @entity {
|
||||
}
|
||||
|
||||
enum DFHistoryType {
|
||||
Allocated,
|
||||
Allocated
|
||||
Claimed
|
||||
}
|
||||
|
||||
@ -579,7 +573,6 @@ type DFAvailableClaim @entity {
|
||||
token: Token!
|
||||
}
|
||||
|
||||
|
||||
type DFHistory @entity {
|
||||
"id = {user-id}-{txId}-{eventId}"
|
||||
id: ID!
|
||||
@ -592,7 +585,6 @@ type DFHistory @entity {
|
||||
tx: String!
|
||||
}
|
||||
|
||||
|
||||
type DFReward @entity {
|
||||
"id = {user address}"
|
||||
id: ID!
|
||||
|
@ -137,7 +137,7 @@ export function getveDelegation(
|
||||
veDelegation.receiver = ''
|
||||
veDelegation.delegator = ''
|
||||
veDelegation.lockedAmount = BigDecimal.zero()
|
||||
veDelegation.timeLeft = BigInt.zero()
|
||||
veDelegation.timeLeftUnlock = 0
|
||||
veDelegation.save()
|
||||
}
|
||||
return veDelegation
|
||||
|
@ -30,7 +30,7 @@ export function handleDelegation(event: DelegateBoost): void {
|
||||
BigInt.fromI32(18).toI32()
|
||||
)
|
||||
veDelegation.lockedAmount = delegator.lockedAmount
|
||||
veDelegation.timeLeft = delegator.unlockTime.toI32().minus(ts)
|
||||
veDelegation.timeLeftUnlock = delegator.unlockTime.toI32() - ts
|
||||
veDelegation.cancelTime = _cancelTime
|
||||
veDelegation.expireTime = _expireTime
|
||||
veDelegation.save()
|
||||
|
Loading…
Reference in New Issue
Block a user