diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..5901167 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode", + "wix.vscode-import-cost" + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..171c9cd --- /dev/null +++ b/.vscode/settings.json @@ -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 + } +} diff --git a/schema.graphql b/schema.graphql index 36fe1f2..feb4ea7 100644 --- a/schema.graphql +++ b/schema.graphql @@ -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 # diff --git a/src/mappings/erc20Templates.ts b/src/mappings/erc20Templates.ts index 56c8ef0..3d88858 100644 --- a/src/mappings/erc20Templates.ts +++ b/src/mappings/erc20Templates.ts @@ -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() }