From 3255ce173ab6823c4617a26f75b817a742991852 Mon Sep 17 00:00:00 2001 From: paulo-ocean Date: Tue, 17 Sep 2024 12:53:06 +0100 Subject: [PATCH] small changes for order --- src/services/Provider.ts | 2 +- src/utils/OrderUtils.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/services/Provider.ts b/src/services/Provider.ts index ae00cea1..1552e22c 100644 --- a/src/services/Provider.ts +++ b/src/services/Provider.ts @@ -510,7 +510,7 @@ export class Provider { )) + 1 ).toString() - const signature = await this.signProviderRequest(signer, did + nonce) + const signature = await this.signProviderRequest(signer, did + nonce) // did + nonce let consumeUrl = downloadUrl consumeUrl += `?fileIndex=${fileIndex}` consumeUrl += `&documentId=${did}` diff --git a/src/utils/OrderUtils.ts b/src/utils/OrderUtils.ts index 132d81e1..522e8a30 100644 --- a/src/utils/OrderUtils.ts +++ b/src/utils/OrderUtils.ts @@ -66,6 +66,7 @@ export async function orderAsset( ) const templateIndex = await datatoken.getId(asset.datatokens[datatokenIndex].address) + const fixedRates = await datatoken.getFixedRates( asset.datatokens[datatokenIndex].address ) @@ -137,7 +138,7 @@ export async function orderAsset( orderParams._consumeMarketFee ) } - if (templateIndex === 2) { + if (templateIndex === 2 || templateIndex === 4) { return await datatoken.buyFromDispenserAndOrder( asset.services[serviceIndex].datatokenAddress, orderParams, @@ -210,7 +211,7 @@ export async function orderAsset( orderParams._consumeMarketFee ) } - if (templateIndex === 2) { + if (templateIndex === 2 || templateIndex === 4) { const tx: any = await approve( consumerAccount, config,