@oceanprotocol/lib 4.3.1 → 4.3.3

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.
@@ -0,0 +1,9 @@
1
+ export interface PolicyServerPassthroughCommand {
2
+ policyServerPassthrough?: any;
3
+ }
4
+ export interface PolicyServerInitializeCommand {
5
+ documentId?: string;
6
+ serviceId?: string;
7
+ consumerAddress?: string;
8
+ policyServer?: any;
9
+ }
@@ -8,6 +8,7 @@ export * from './DownloadResponse.js';
8
8
  export * from './FixedPrice.js';
9
9
  export * from './NFT.js';
10
10
  export * from './NFTFactory.js';
11
+ export * from './PolicyServer.js';
11
12
  export * from './Provider.js';
12
13
  export * from './Router.js';
13
14
  export * from './ReturnTypes.js';
@@ -15,7 +15,7 @@ export declare class VeAllocate extends SmartContractWithAddress {
15
15
  */
16
16
  setAllocation<G extends boolean = false>(amount: string, nft: string, chainId: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
17
17
  /**
18
- * set specific percetage of veOcean to multiple nfts
18
+ * set specific percentage of veOcean to multiple nfts
19
19
  * Maximum allocated percentage is 10000, so 1% is specified as 100
20
20
  * @param {String[]} amount Array of percentages used
21
21
  * @param {String[]} nft Array of NFT addresses
@@ -1,5 +1,5 @@
1
1
  import { Signer } from 'ethers';
2
- import { Arweave, FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ProviderInitialize, ProviderComputeInitializeResults, ServiceEndpoint, UrlFile, UserCustomParameters, Ipfs, ComputeResourceRequest, ComputeJobMetadata } from '../@types';
2
+ import { Arweave, FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ProviderInitialize, ProviderComputeInitializeResults, ServiceEndpoint, UrlFile, UserCustomParameters, Ipfs, ComputeResourceRequest, ComputeJobMetadata, PolicyServerInitializeCommand, PolicyServerPassthroughCommand } from '../@types';
3
3
  export declare class Provider {
4
4
  private getConsumerAddress;
5
5
  private getSignature;
@@ -185,15 +185,14 @@ export declare class Provider {
185
185
  computeStreamableLogs(providerUri: string, signerOrAuthToken: Signer | string, jobId: string, signal?: AbortSignal): Promise<any>;
186
186
  getComputeStartRoutes(providerUri: string, isFreeCompute?: boolean): Promise<string | null>;
187
187
  /** Instruct the provider to Stop the execution of a to stop a compute job.
188
- * @param {string} did the asset did
189
- * @param {string} consumerAddress The consumer address.
190
188
  * @param {string} jobId the compute job id
191
189
  * @param {string} providerUri The provider URI.
192
190
  * @param {SignerOrAuthToken} signerOrAuthToken The consumer signer or auth token.
191
+ * @param {string} agreementId The agreement id.
193
192
  * @param {AbortSignal} signal abort signal
194
193
  * @return {Promise<ComputeJob | ComputeJob[]>}
195
194
  */
196
- computeStop(did: string, consumerAddress: string, jobId: string, providerUri: string, signerOrAuthToken: Signer | string, agreementId?: string, signal?: AbortSignal): Promise<ComputeJob | ComputeJob[]>;
195
+ computeStop(jobId: string, providerUri: string, signerOrAuthToken: Signer | string, agreementId?: string, signal?: AbortSignal): Promise<ComputeJob | ComputeJob[]>;
197
196
  /** Get compute status for a specific jobId/documentId/owner.
198
197
  * @param {string} providerUri The URI of the provider we want to query
199
198
  * @param {string} consumerAddress The consumer ethereum address
@@ -243,6 +242,18 @@ export declare class Provider {
243
242
  * @return {Promise<boolean>} valid or not
244
243
  */
245
244
  isValidProvider(url: string, signal?: AbortSignal): Promise<boolean>;
245
+ /** Sends a PolicyServer request to node to be passthrough to PS
246
+ * @param {string} providerUri The provider URI.
247
+ * @param {PolicyServerPassthroughCommand} request The request to be passed through to the Policy Server.
248
+ * @param {AbortSignal} signal abort signal
249
+ */
250
+ PolicyServerPassthrough(providerUri: string, request: PolicyServerPassthroughCommand, signal?: AbortSignal): Promise<any>;
251
+ /** Initialize Policy Server verification
252
+ * @param {string} providerUri The provider URI.
253
+ * @param {PolicyServerInitializeCommand} request The request to be sent to the Policy Server.
254
+ * @param {AbortSignal} signal abort signal
255
+ */
256
+ initializePSVerification(providerUri: string, request: PolicyServerInitializeCommand, signal?: AbortSignal): Promise<any>;
246
257
  /**
247
258
  * Private method that removes the leading 0x from a string.
248
259
  * @param {string} input - The input string.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Simple blocking sleep function
3
- * @param {number} ms - Number of miliseconds to wait
3
+ * @param {number} ms - Number of milliseconds to wait
4
4
  */
5
5
  export declare function sleep(ms: number): Promise<unknown>;
6
6
  export declare function isDefined(something: any): boolean;
@@ -161,7 +161,7 @@ Blocks until Indexer will cache the did (or the update for that did) or timeouts
161
161
  | `did` | `string` | DID of the asset. |
162
162
  | `txid?` | `string` | used when the did exists and we expect an update with that txid. |
163
163
  | `signal?` | `AbortSignal` | abort signal |
164
- | `interval` | `number` | retry interval in miliseconds. Default is 3000 |
164
+ | `interval` | `number` | retry interval in milliseconds. Default is 3000 |
165
165
  | `maxRetries` | `number` | max number of retries. Default is 100 |
166
166
 
167
167
  #### Returns
@@ -315,7 +315,7 @@ ___
315
315
 
316
316
  ▸ **setBatchAllocation**<`G`\>(`amount`, `nft`, `chainId`, `estimateGas?`): `Promise`<[`ReceiptOrEstimate`](../modules.md#receiptorestimate)<`G`\>\>
317
317
 
318
- set specific percetage of veOcean to multiple nfts
318
+ set specific percentage of veOcean to multiple nfts
319
319
  Maximum allocated percentage is 10000, so 1% is specified as 100
320
320
 
321
321
  #### Type parameters
package/docs/modules.md CHANGED
@@ -785,7 +785,7 @@ Simple blocking sleep function
785
785
 
786
786
  | Name | Type | Description |
787
787
  | :------ | :------ | :------ |
788
- | `ms` | `number` | Number of miliseconds to wait |
788
+ | `ms` | `number` | Number of milliseconds to wait |
789
789
 
790
790
  #### Returns
791
791
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oceanprotocol/lib",
3
3
  "source": "./src/index.ts",
4
- "version": "4.3.1",
4
+ "version": "4.3.3",
5
5
  "description": "JavaScript client library for Ocean Protocol",
6
6
  "main": "./dist/lib.cjs",
7
7
  "umd:main": "dist/lib.umd.js",
@@ -72,7 +72,7 @@
72
72
  "devDependencies": {
73
73
  "@istanbuljs/nyc-config-typescript": "^1.0.2",
74
74
  "@truffle/hdwallet-provider": "^2.0.14",
75
- "@types/chai": "^4.3.1",
75
+ "@types/chai": "^5.2.2",
76
76
  "@types/chai-spies": "^1.0.3",
77
77
  "@types/crypto-js": "^4.1.1",
78
78
  "@types/jsonwebtoken": "^9.0.10",
@@ -83,7 +83,7 @@
83
83
  "@typescript-eslint/parser": "^6.4.1",
84
84
  "auto-changelog": "^2.4.0",
85
85
  "c8": "^10.1.3",
86
- "chai": "^4.3.6",
86
+ "chai": "^5.2.1",
87
87
  "chai-spies": "^1.0.0",
88
88
  "cross-env": "^7.0.3",
89
89
  "eslint": "^8.23.1",