mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
small changes for order
This commit is contained in:
parent
a06a5c5cab
commit
3255ce173a
@ -510,7 +510,7 @@ export class Provider {
|
|||||||
)) + 1
|
)) + 1
|
||||||
).toString()
|
).toString()
|
||||||
|
|
||||||
const signature = await this.signProviderRequest(signer, did + nonce)
|
const signature = await this.signProviderRequest(signer, did + nonce) // did + nonce
|
||||||
let consumeUrl = downloadUrl
|
let consumeUrl = downloadUrl
|
||||||
consumeUrl += `?fileIndex=${fileIndex}`
|
consumeUrl += `?fileIndex=${fileIndex}`
|
||||||
consumeUrl += `&documentId=${did}`
|
consumeUrl += `&documentId=${did}`
|
||||||
|
@ -66,6 +66,7 @@ export async function orderAsset(
|
|||||||
)
|
)
|
||||||
|
|
||||||
const templateIndex = await datatoken.getId(asset.datatokens[datatokenIndex].address)
|
const templateIndex = await datatoken.getId(asset.datatokens[datatokenIndex].address)
|
||||||
|
|
||||||
const fixedRates = await datatoken.getFixedRates(
|
const fixedRates = await datatoken.getFixedRates(
|
||||||
asset.datatokens[datatokenIndex].address
|
asset.datatokens[datatokenIndex].address
|
||||||
)
|
)
|
||||||
@ -137,7 +138,7 @@ export async function orderAsset(
|
|||||||
orderParams._consumeMarketFee
|
orderParams._consumeMarketFee
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (templateIndex === 2) {
|
if (templateIndex === 2 || templateIndex === 4) {
|
||||||
return await datatoken.buyFromDispenserAndOrder(
|
return await datatoken.buyFromDispenserAndOrder(
|
||||||
asset.services[serviceIndex].datatokenAddress,
|
asset.services[serviceIndex].datatokenAddress,
|
||||||
orderParams,
|
orderParams,
|
||||||
@ -210,7 +211,7 @@ export async function orderAsset(
|
|||||||
orderParams._consumeMarketFee
|
orderParams._consumeMarketFee
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
if (templateIndex === 2) {
|
if (templateIndex === 2 || templateIndex === 4) {
|
||||||
const tx: any = await approve(
|
const tx: any = await approve(
|
||||||
consumerAccount,
|
consumerAccount,
|
||||||
config,
|
config,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user