How to use the @requestnetwork/types.StorageTypes.StorageSystemType function in @requestnetwork/types

To help you get started, we’ve selected a few @requestnetwork/types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RequestNetwork / requestNetwork / packages / ethereum-storage / src / ethereum-storage.ts View on Github external
feesParameters,
      );
    } catch (error) {
      throw Error(`Smart contract error: ${error}`);
    }

    // Save the metadata of the new ipfsHash into the Ethereum metadata cache
    await this.ethereumMetadataCache.saveDataIdMeta(ipfsHash, ethereumMetadata);

    return {
      content,
      id: ipfsHash,
      meta: {
        ethereum: ethereumMetadata,
        ipfs: { size: contentSize },
        storageType: StorageTypes.StorageSystemType.ETHEREUM_IPFS,
        timestamp: ethereumMetadata.blockTimestamp,
      },
    };
  }
github RequestNetwork / requestNetwork / packages / request-client.js / src / mock-storage.ts View on Github external
const metaData = Object.values(this.data).map(elem => {
      return {
        storageType: StorageTypes.StorageSystemType.IN_MEMORY_MOCK,
        timestamp: elem.timestamp,
      };
    });
github RequestNetwork / requestNetwork / packages / prototype-estimator / src / mock-storage.ts View on Github external
public async getData(): Promise {
    const results = Object.values(this.data).map(data => String(data.content));
    const dataIds = Object.keys(this.data);

    const nowTimestampInSec = Utils.getCurrentTimestampInSecond();

    return {
      meta: {
        lastTimestamp: nowTimestampInSec,
        metaData: new Array(results.length).fill({
          storageType: StorageTypes.StorageSystemType.IN_MEMORY_MOCK,
        }),
      },
      result: {
        data: results,
        dataIds,
      },
    };
  }
}