Skip to content

Commit

Permalink
DDO.js integration + ESM updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmedraza118 authored Mar 4, 2025
1 parent a7238a1 commit 9a542d0
Show file tree
Hide file tree
Showing 67 changed files with 18,122 additions and 25,946 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"ignorePatterns": ["dist/**/*"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module",
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,6 @@ jobs:
bash -x start_ocean.sh --with-provider2 --no-dashboard --with-c2d 2>&1 > start_ocean.log &
- run: npm ci
- run: npm run build:metadata
- name: Delete default runner images
run: |
docker image rm -f node:18
docker image rm -f node:18-alpine
docker image rm -f node:20
docker image rm -f debian:10
docker image rm -f debian:11
docker image rm -f moby/buildkit:latest
- name: Wait for contracts deployment and C2D cluster to be ready
working-directory: ${{ github.workspace }}/barge
run: |
Expand Down
8 changes: 8 additions & 0 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"require": ["source-map-support/register", "mock-local-storage"],
"extension": ["ts"],
"timeout": 200000,
"bail": true,
"exit": true,
"fullTrace": true
}
9 changes: 5 additions & 4 deletions CodeExamples.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Start by importing all of the necessary dependencies
import fs from 'fs'

import { ethers, providers, Signer } from 'ethers'
import { SHA256 } from 'crypto-js'
import crypto from 'crypto-js'
import { homedir } from 'os'
import {
approve,
Expand Down Expand Up @@ -109,8 +109,9 @@ import {
getEventFromTx,
DDO,
LoggerInstance
} from '@oceanprotocol/lib'
} from '../../src/index.js'
```
const { SHA256 } = crypto

<!--
describe('Marketplace flow tests
Expand Down Expand Up @@ -165,7 +166,7 @@ Next, we define the metadata that will describe our data asset. This is what we
```Typescript
const genericAsset: DDO = {
'@context': ['https://w3id.org/did/v1'],
id: '',
id: 'did:op',
version: '4.1.0',
chainId: 8996,
nftAddress: '0x0',
Expand Down Expand Up @@ -821,7 +822,7 @@ Let's start by using the `setData` method to update the nft key value store with
data
)
} catch (e) {
console.log('e = ', e)
console.log('error = ', e)
assert.fail('Failed to set data in NFT ERC725 key value store', e)
}
```
Expand Down
5 changes: 3 additions & 2 deletions ComputeExamples.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ Start by importing all of the necessary dependencies
import fs from 'fs'
import { homedir } from 'os'

import { SHA256 } from 'crypto-js'
import { ethers, providers, Signer } from 'ethers'
import {
ProviderInstance,
Expand All @@ -145,8 +144,10 @@ import {
ConfigHelper,
getEventFromTx,
amountToUnits
} from '@oceanprotocol/lib'
} from '../../src/index.js'
```
import crypto from 'crypto-js'
const { SHA256 } = crypto

### 4.2. Constants and variables

Expand Down
Loading

0 comments on commit 9a542d0

Please sign in to comment.