mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
add checksum param when fetching fileinfo and checksum aatribute to fileinfo interface
This commit is contained in:
parent
869ef38fc3
commit
00f776d540
@ -36,6 +36,12 @@ export interface FileInfo {
|
|||||||
*/
|
*/
|
||||||
method?: string
|
method?: string
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Computed file checksum
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
checksum?: string
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* check if file exists
|
* check if file exists
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
|
@ -168,8 +168,9 @@ export class Provider {
|
|||||||
*/
|
*/
|
||||||
public async checkDidFiles(
|
public async checkDidFiles(
|
||||||
did: string,
|
did: string,
|
||||||
serviceId: number,
|
serviceId: string,
|
||||||
providerUri: string,
|
providerUri: string,
|
||||||
|
withChecksum: boolean = false,
|
||||||
signal?: AbortSignal
|
signal?: AbortSignal
|
||||||
): Promise<FileInfo[]> {
|
): Promise<FileInfo[]> {
|
||||||
const providerEndpoints = await this.getEndpoints(providerUri)
|
const providerEndpoints = await this.getEndpoints(providerUri)
|
||||||
@ -177,7 +178,7 @@ export class Provider {
|
|||||||
providerUri,
|
providerUri,
|
||||||
providerEndpoints
|
providerEndpoints
|
||||||
)
|
)
|
||||||
const args = { did: did, serviceId: serviceId }
|
const args = { did: did, serviceId: serviceId, checksum: withChecksum }
|
||||||
const files: FileInfo[] = []
|
const files: FileInfo[] = []
|
||||||
const path = this.getEndpointURL(serviceEndpoints, 'fileinfo')
|
const path = this.getEndpointURL(serviceEndpoints, 'fileinfo')
|
||||||
? this.getEndpointURL(serviceEndpoints, 'fileinfo').urlPath
|
? this.getEndpointURL(serviceEndpoints, 'fileinfo').urlPath
|
||||||
|
Loading…
x
Reference in New Issue
Block a user