Feature/graphnode 27 (#541)

* use custom barge

* update for 27

* bump to latest contracts

* add description

* use main barge
pull/545/head
Alex Coseru 2 months ago committed by GitHub
parent f61cce9722
commit 8cb1d83a26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      package-lock.json
  2. 2
      package.json
  3. 6
      schema.graphql
  4. 18
      src/mappings/erc20Templates.ts
  5. 15
      subgraph.template.yaml
  6. 8
      subgraph_ve.template.yaml

14
package-lock.json generated

@ -9,7 +9,7 @@
"version": "2.0.6",
"license": "Apache-2.0",
"dependencies": {
"@oceanprotocol/contracts": "^1.1.4",
"@oceanprotocol/contracts": "^1.1.6",
"@oceanprotocol/lib": "^2.0.2",
"cross-fetch": "^3.1.4"
},
@ -860,9 +860,9 @@
}
},
"node_modules/@oceanprotocol/contracts": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-1.1.4.tgz",
"integrity": "sha512-fIJjtyj1fxF3GNaITUDaUJbQ2FBCLqB6Hlg72k5SzBK2//yuSPfdZVAqomul0qQjgiKl0jlJRmWVpfer/a5z2g=="
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-1.1.6.tgz",
"integrity": "sha512-BF4Dkoa44ZCxvp96o/i03bMl4c5pYHrY1K/xvM8ZUc1NJ+BNCX+qKvtXzVfqbZXf02GwoWBWwRzQXXdOmXhxbw=="
},
"node_modules/@oceanprotocol/lib": {
"version": "2.0.2",
@ -15278,9 +15278,9 @@
}
},
"@oceanprotocol/contracts": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-1.1.4.tgz",
"integrity": "sha512-fIJjtyj1fxF3GNaITUDaUJbQ2FBCLqB6Hlg72k5SzBK2//yuSPfdZVAqomul0qQjgiKl0jlJRmWVpfer/a5z2g=="
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-1.1.6.tgz",
"integrity": "sha512-BF4Dkoa44ZCxvp96o/i03bMl4c5pYHrY1K/xvM8ZUc1NJ+BNCX+qKvtXzVfqbZXf02GwoWBWwRzQXXdOmXhxbw=="
},
"@oceanprotocol/lib": {
"version": "2.0.2",

@ -67,7 +67,7 @@
"typescript": "^4.8.3"
},
"dependencies": {
"@oceanprotocol/contracts": "^1.1.4",
"@oceanprotocol/contracts": "^1.1.6",
"@oceanprotocol/lib": "^2.0.2",
"cross-fetch": "^3.1.4"
},

@ -134,8 +134,9 @@ type OrderReuse @entity {
block: Int!
providerFee: String
providerFeeValidUntil: BigInt
"gas price in Wei"
gasPrice: BigInt
gasUsed: BigInt
gasUsed: BigDecimal
}
type Order @entity {
@ -169,7 +170,8 @@ type Order @entity {
lastPriceToken: String!
lastPriceValue: BigDecimal!
estimatedUSDValue: BigDecimal!
gasUsed: BigInt
gasUsed: BigDecimal
"gas price in Wei"
gasPrice: BigInt
}

@ -1,5 +1,5 @@
import { Order, Nft, OrderReuse } from '../@types/schema'
import { BigInt } from '@graphprotocol/graph-ts'
import { BigInt, BigDecimal } from '@graphprotocol/graph-ts'
import {
NewPaymentCollector,
@ -66,10 +66,10 @@ export function handleOrderStarted(event: OrderStarted): void {
order.lastPriceValue,
order.createdTimestamp
)
if (event.receipt !== null) {
order.gasUsed = event.receipt!.gasUsed
if (event.receipt !== null && event.receipt!.gasUsed) {
order.gasUsed = event.receipt!.gasUsed.toBigDecimal()
} else {
order.gasUsed = BigInt.zero()
order.gasUsed = BigDecimal.zero()
}
if (event.transaction.gasPrice) {
order.gasPrice = event.transaction.gasPrice
@ -105,8 +105,9 @@ export function handlerOrderReused(event: OrderReused): void {
if (event.transaction.gasPrice)
reuseOrder.gasPrice = event.transaction.gasPrice
else reuseOrder.gasPrice = BigInt.zero()
if (event.receipt !== null) reuseOrder.gasUsed = event.receipt!.gasUsed
else reuseOrder.gasUsed = BigInt.zero()
if (event.receipt !== null && event.receipt!.gasUsed) {
reuseOrder.gasUsed = event.receipt!.gasUsed.toBigDecimal()
} else reuseOrder.gasUsed = BigDecimal.zero()
reuseOrder.order = orderId
reuseOrder.caller = event.params.caller.toHexString()
reuseOrder.createdTimestamp = event.params.timestamp.toI32()
@ -254,8 +255,9 @@ export function handleProviderFee(event: ProviderFee): void {
if (event.transaction.gasPrice)
orderReuse.gasPrice = event.transaction.gasPrice
else orderReuse.gasPrice = BigInt.zero()
if (event.receipt !== null) orderReuse.gasUsed = event.receipt!.gasUsed
else orderReuse.gasUsed = BigInt.zero()
if (event.receipt !== null && event.receipt!.gasUsed) {
orderReuse.gasUsed = event.receipt!.gasUsed.toBigDecimal()
} else orderReuse.gasUsed = BigDecimal.zero()
orderReuse.save()
}
}

@ -11,7 +11,7 @@ templates:
abi: ERC20Template
mapping:
kind: ethereum/events
apiVersion: 0.0.6
apiVersion: 0.0.7
language: wasm/assemblyscript
file: ./src/mappings/erc20Templates.ts
entities:
@ -28,8 +28,10 @@ templates:
eventHandlers:
- event: OrderStarted(indexed address,address,uint256,uint256,uint256,indexed address,uint256)
handler: handleOrderStarted
receipt: true
- event: OrderReused(bytes32,address,uint256,uint256)
handler: handlerOrderReused
receipt: true
- event: NewPaymentCollector(indexed address,indexed address,uint256,uint256)
handler: handleNewPaymentCollector
- event: PublishMarketFee(indexed address,indexed address,uint256)
@ -48,6 +50,7 @@ templates:
handler: handleCleanedPermissions
- event: ProviderFee(indexed address,indexed address,uint256,bytes,uint8,bytes32,bytes32,uint256)
handler: handleProviderFee
receipt: true
- name: ERC721Template
kind: ethereum/contract
@ -56,7 +59,7 @@ templates:
abi: ERC721Template
mapping:
kind: ethereum/events
apiVersion: 0.0.6
apiVersion: 0.0.7
language: wasm/assemblyscript
file: ./src/mappings/nftUpdate.ts
entities:
@ -107,7 +110,7 @@ templates:
abi: Dispenser
mapping:
kind: ethereum/events
apiVersion: 0.0.6
apiVersion: 0.0.7
language: wasm/assemblyscript
file: ./src/mappings/dispenser.ts
entities:
@ -138,7 +141,7 @@ templates:
abi: FixedRateExchange
mapping:
kind: ethereum/events
apiVersion: 0.0.6
apiVersion: 0.0.7
language: wasm/assemblyscript
file: ./src/mappings/fixedRateExchange.ts
entities:
@ -178,7 +181,7 @@ dataSources:
startBlock: __STARTBLOCK__
mapping:
kind: ethereum/events
apiVersion: 0.0.6
apiVersion: 0.0.7
language: wasm/assemblyscript
file: ./src/mappings/erc721Factory.ts
entities:
@ -203,7 +206,7 @@ dataSources:
startBlock: __STARTBLOCK__
mapping:
kind: ethereum/events
apiVersion: 0.0.6
apiVersion: 0.0.7
language: wasm/assemblyscript
file: ./src/mappings/factoryRouter.ts
entities:

@ -7,7 +7,7 @@
startBlock: __STARTBLOCK__
mapping:
kind: ethereum/events
apiVersion: 0.0.6
apiVersion: 0.0.7
language: wasm/assemblyscript
file: ./src/mappings/veAllocate.ts
entities:
@ -30,7 +30,7 @@
startBlock: __STARTBLOCK__
mapping:
kind: ethereum/events
apiVersion: 0.0.6
apiVersion: 0.0.7
language: wasm/assemblyscript
file: ./src/mappings/veOCEAN.ts
entities:
@ -55,7 +55,7 @@
startBlock: __STARTBLOCK__
mapping:
kind: ethereum/events
apiVersion: 0.0.6
apiVersion: 0.0.7
language: wasm/assemblyscript
file: ./src/mappings/veDelegation.ts
entities:
@ -76,7 +76,7 @@
startBlock: __STARTBLOCK__
mapping:
kind: ethereum/events
apiVersion: 0.0.6
apiVersion: 0.0.7
language: wasm/assemblyscript
file: ./src/mappings/dfRewards.ts
entities:

Loading…
Cancel
Save