mirror of
https://github.com/oceanprotocol/ocean-subgraph.git
synced 2024-12-02 05:57:29 +01:00
Saving providerFee as an array of all previous provider fees
This commit is contained in:
parent
f0552a63e9
commit
79aa847eff
7
.vscode/extensions.json
vendored
Normal file
7
.vscode/extensions.json
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"dbaeumer.vscode-eslint",
|
||||
"esbenp.prettier-vscode",
|
||||
"wix.vscode-import-cost"
|
||||
]
|
||||
}
|
17
.vscode/settings.json
vendored
Normal file
17
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.fixAll.eslint": true
|
||||
},
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true,
|
||||
"eslint.validate": [
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact"
|
||||
],
|
||||
"search.exclude": {
|
||||
"**/.next": true,
|
||||
"**/out": true
|
||||
}
|
||||
}
|
@ -265,7 +265,7 @@ type Order @entity {
|
||||
publishingMarket: User
|
||||
publishingMarketToken: Token #
|
||||
publishingMarketAmmount: BigDecimal #call contract to get fee amount
|
||||
providerFee: String
|
||||
providerFee: [String!]
|
||||
|
||||
consumerMarket: User
|
||||
consumerMarketToken: Token #
|
||||
|
@ -204,7 +204,8 @@ export function handleProviderFee(event: ProviderFee): void {
|
||||
event.address.toHex(),
|
||||
event.transaction.from.toHex()
|
||||
)
|
||||
const providerFee = `{providerFeeAddress: ${event.params.providerFeeAddress.toHex()}, providerFeeToken: ${event.params.providerFeeToken.toHex()}, providerFeeAmount: ${
|
||||
|
||||
const providerFee: string = `{providerFeeAddress: ${event.params.providerFeeAddress.toHex()}, providerFeeToken: ${event.params.providerFeeToken.toHex()}, providerFeeAmount: ${
|
||||
event.params.providerFeeAmount
|
||||
}, providerData: ${event.params.providerData.toHexString()}, v: ${
|
||||
event.params.v
|
||||
@ -213,7 +214,12 @@ export function handleProviderFee(event: ProviderFee): void {
|
||||
}
|
||||
}`
|
||||
|
||||
order.providerFee = providerFee
|
||||
let existingProviderFees: string[]
|
||||
if (!order.providerFee) existingProviderFees = []
|
||||
else existingProviderFees = order.providerFee as string[]
|
||||
existingProviderFees.push(providerFee)
|
||||
|
||||
order.providerFee = existingProviderFees
|
||||
order.save()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user