@oceanprotocol/lib 9.0.0-next.10 → 9.0.0-next.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -2
- package/dist/lib.modern.mjs +3 -0
- package/dist/lib.module.mjs +3 -5
- package/dist/types/@types/Compute.d.ts +67 -1
- package/dist/types/@types/Datatoken.d.ts +1 -1
- package/dist/types/@types/File.d.ts +1 -1
- package/dist/types/@types/NFTFactory.d.ts +1 -1
- package/dist/types/@types/Services.d.ts +7 -7
- package/dist/types/config/Config.d.ts +2 -2
- package/dist/types/config/ConfigHelper.d.ts +1 -1
- package/dist/types/contracts/Dispenser.d.ts +1 -1
- package/dist/types/contracts/EnterpriseFeeCollector.d.ts +3 -3
- package/dist/types/contracts/Escrow.d.ts +3 -3
- package/dist/types/contracts/NFT.d.ts +2 -2
- package/dist/types/contracts/NFTFactory.d.ts +2 -2
- package/dist/types/services/Provider.d.ts +1 -1
- package/dist/types/services/providers/BaseProvider.d.ts +103 -10
- package/dist/types/services/providers/HttpProvider.d.ts +18 -3
- package/dist/types/services/providers/P2pProvider.d.ts +456 -15
- package/dist/types/services/providers/lpFraming.d.ts +173 -0
- package/dist/types/utils/C2dCapability.d.ts +78 -0
- package/dist/types/utils/index.d.ts +1 -0
- package/package.json +57 -60
- package/dist/lib.cjs +0 -5
- package/dist/lib.umd.js +0 -5
package/README.md
CHANGED
|
@@ -57,12 +57,34 @@ npm install @oceanprotocol/lib
|
|
|
57
57
|
- Developers using this library should ensure their tsconfig.json includes the necessary options:
|
|
58
58
|
```
|
|
59
59
|
{
|
|
60
|
-
"moduleResolution": "
|
|
60
|
+
"moduleResolution": "bundler",
|
|
61
|
+
"module": "esnext",
|
|
61
62
|
"esModuleInterop": true,
|
|
62
63
|
"allowSyntheticDefaultImports": true
|
|
63
64
|
}
|
|
64
65
|
```
|
|
65
|
-
-
|
|
66
|
+
- `"moduleResolution": "nodenext"` works too. The older `"node"` (node10) mode was removed in
|
|
67
|
+
TypeScript 7, so don't use it — and it cannot resolve this package's `exports` map anyway.
|
|
68
|
+
|
|
69
|
+
### ESM only
|
|
70
|
+
|
|
71
|
+
`@oceanprotocol/lib` ships as ES modules only — there is no CommonJS build, because most of
|
|
72
|
+
its runtime dependencies (the libp2p stack, `multiformats`, `uint8arrays`) are themselves
|
|
73
|
+
ESM-only. Import it:
|
|
74
|
+
|
|
75
|
+
```js
|
|
76
|
+
import { ProviderInstance, ConfigHelper } from '@oceanprotocol/lib'
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
From CommonJS code, use Node's built-in `require(esm)` support, available from **Node
|
|
80
|
+
22.12**:
|
|
81
|
+
|
|
82
|
+
```js
|
|
83
|
+
const { ConfigHelper } = require('@oceanprotocol/lib')
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
On Node 22.0–22.11 this throws `ERR_REQUIRE_ESM`; use a dynamic `await import(...)`
|
|
87
|
+
instead, or move the calling module to ESM.
|
|
66
88
|
|
|
67
89
|
## 📖 Documentation
|
|
68
90
|
|