@oceanprotocol/lib 4.3.0 → 4.3.2

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.
@@ -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,6 +1,5 @@
1
1
  import { Signer } from 'ethers';
2
2
  import { Arweave, FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ProviderInitialize, ProviderComputeInitializeResults, ServiceEndpoint, UrlFile, UserCustomParameters, Ipfs, ComputeResourceRequest, ComputeJobMetadata } from '../@types';
3
- import { PolicyServer } from '../@types/PolicyServer.js';
4
3
  export declare class Provider {
5
4
  private getConsumerAddress;
6
5
  private getSignature;
@@ -112,11 +111,11 @@ export declare class Provider {
112
111
  * @param {SignerOrAuthToken} signerOrAuthToken Signer or auth token
113
112
  * @param {ComputeResourceRequest[]} resources The resources to start compute job with.
114
113
  * @param {number} chainId The chain used to do payments
115
- * @param {PolicyServer} policyServer The policy server object.
114
+ * @param {any} policyServer Policy server data.
116
115
  * @param {AbortSignal} signal abort signal
117
116
  * @return {Promise<ProviderComputeInitialize>} ProviderComputeInitialize data
118
117
  */
119
- initializeCompute(assets: ComputeAsset[], algorithm: ComputeAlgorithm, computeEnv: string, token: string, validUntil: number, providerUri: string, signerOrAuthToken: Signer | string, resources: ComputeResourceRequest[], chainId: number, policyServer?: PolicyServer, signal?: AbortSignal): Promise<ProviderComputeInitializeResults>;
118
+ initializeCompute(assets: ComputeAsset[], algorithm: ComputeAlgorithm, computeEnv: string, token: string, validUntil: number, providerUri: string, signerOrAuthToken: Signer | string, resources: ComputeResourceRequest[], chainId: number, policyServer?: any, signal?: AbortSignal): Promise<ProviderComputeInitializeResults>;
120
119
  /**
121
120
  * Gets the download URL.
122
121
  * @param {string} did - The DID.
@@ -125,11 +124,11 @@ export declare class Provider {
125
124
  * @param {string} transferTxId - The transfer transaction ID.
126
125
  * @param {string} providerUri - The provider URI.
127
126
  * @param {SignerOrAuthToken} signerOrAuthToken - The signer or auth token.
128
- * @param {PolicyServer} policyServer - The policy server (if any is to be used).
127
+ * @param {any} policyServer Policy server data.
129
128
  * @param {UserCustomParameters} userCustomParameters - The user custom parameters.
130
129
  * @returns {Promise<any>} The download URL.
131
130
  */
132
- getDownloadUrl(did: string, serviceId: string, fileIndex: number, transferTxId: string, providerUri: string, signerOrAuthToken: Signer | string, policyServer?: PolicyServer, userCustomParameters?: UserCustomParameters): Promise<any>;
131
+ getDownloadUrl(did: string, serviceId: string, fileIndex: number, transferTxId: string, providerUri: string, signerOrAuthToken: Signer | string, policyServer?: any, userCustomParameters?: UserCustomParameters): Promise<any>;
133
132
  /** Instruct the provider to start a compute job (Old C2D V1) Kept for now, for backwards compatibility
134
133
  * @param {string} providerUri The provider URI.
135
134
  * @param {Signer} signer The consumer signer object.
@@ -155,12 +154,12 @@ export declare class Provider {
155
154
  * @param {chainId} chainId The chain used to do payments
156
155
  * @param {ComputeJobMetadata} metadata The compute job metadata. Additional metadata to be stored in the database.
157
156
  * @param {ComputeOutput} output The compute job output settings.
158
- * @param {PolicyServer} policyServer The policy server object.
157
+ * @param {any} policyServer Policy server data.
159
158
  * @param {AbortSignal} signal abort signal
160
159
  * @return {Promise<ComputeJob | ComputeJob[]>} The compute job or jobs.
161
160
  */
162
161
  computeStart(providerUri: string, signerOrAuthToken: Signer | string, computeEnv: string, datasets: ComputeAsset[], algorithm: ComputeAlgorithm, maxJobDuration: number, token: string, resources: ComputeResourceRequest[], chainId: number, // network used by payment (only for payed compute jobs)
163
- metadata?: ComputeJobMetadata, output?: ComputeOutput, policyServer?: PolicyServer, signal?: AbortSignal): Promise<ComputeJob | ComputeJob[]>;
162
+ metadata?: ComputeJobMetadata, output?: ComputeOutput, policyServer?: any, signal?: AbortSignal): Promise<ComputeJob | ComputeJob[]>;
164
163
  /** Instruct the provider to start a FREE compute job (new C2D V2)
165
164
  * @param {string} providerUri The provider URI.
166
165
  * @param {SignerOrAuthToken} signerOrAuthToken The consumer signer object or auth token.
@@ -170,11 +169,11 @@ export declare class Provider {
170
169
  * @param {ComputeResourceRequest} resources The resources to start compute job with.
171
170
  * @param {ComputeJobMetadata} metadata The compute job metadata. Additional metadata to be stored in the database.
172
171
  * @param {ComputeOutput} output The compute job output settings.
173
- * @param {PolicyServer} policyServer The policy server object.
172
+ * @param {any} policyServer Policy server data.
174
173
  * @param {AbortSignal} signal abort signal
175
174
  * @return {Promise<ComputeJob | ComputeJob[]>} The compute job or jobs.
176
175
  */
177
- freeComputeStart(providerUri: string, signerOrAuthToken: Signer | string, computeEnv: string, datasets: ComputeAsset[], algorithm: ComputeAlgorithm, resources?: ComputeResourceRequest[], metadata?: ComputeJobMetadata, output?: ComputeOutput, policyServer?: PolicyServer, signal?: AbortSignal): Promise<ComputeJob | ComputeJob[]>;
176
+ freeComputeStart(providerUri: string, signerOrAuthToken: Signer | string, computeEnv: string, datasets: ComputeAsset[], algorithm: ComputeAlgorithm, resources?: ComputeResourceRequest[], metadata?: ComputeJobMetadata, output?: ComputeOutput, policyServer?: any, signal?: AbortSignal): Promise<ComputeJob | ComputeJob[]>;
178
177
  /**
179
178
  *
180
179
  * @param providerUri provider URL
@@ -186,15 +185,14 @@ export declare class Provider {
186
185
  computeStreamableLogs(providerUri: string, signerOrAuthToken: Signer | string, jobId: string, signal?: AbortSignal): Promise<any>;
187
186
  getComputeStartRoutes(providerUri: string, isFreeCompute?: boolean): Promise<string | null>;
188
187
  /** Instruct the provider to Stop the execution of a to stop a compute job.
189
- * @param {string} did the asset did
190
- * @param {string} consumerAddress The consumer address.
191
188
  * @param {string} jobId the compute job id
192
189
  * @param {string} providerUri The provider URI.
193
190
  * @param {SignerOrAuthToken} signerOrAuthToken The consumer signer or auth token.
191
+ * @param {string} agreementId The agreement id.
194
192
  * @param {AbortSignal} signal abort signal
195
193
  * @return {Promise<ComputeJob | ComputeJob[]>}
196
194
  */
197
- 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[]>;
198
196
  /** Get compute status for a specific jobId/documentId/owner.
199
197
  * @param {string} providerUri The URI of the provider we want to query
200
198
  * @param {string} consumerAddress The consumer ethereum address
@@ -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.0",
4
+ "version": "4.3.2",
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",
@@ -1,7 +0,0 @@
1
- export interface PolicyServer {
2
- sessionId?: string;
3
- successRedirectUri?: string;
4
- errorRedirectUri?: string;
5
- responseRedirectUri?: string;
6
- presentationDefinitionUri?: string;
7
- }