@oceanprotocol/lib 1.0.0-next.41 → 1.0.0-next.42

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.
@@ -14,3 +14,12 @@ export interface ProviderInitialize {
14
14
  computeAddress: string;
15
15
  providerFee: ProviderFees;
16
16
  }
17
+ export interface ProviderComputeInitialize {
18
+ datatoken?: string;
19
+ validOrder?: string;
20
+ providerFee?: ProviderFees;
21
+ }
22
+ export interface ProviderComputeInitializeResults {
23
+ algorithm?: ProviderComputeInitialize;
24
+ datasets?: ProviderComputeInitialize[];
25
+ }
@@ -294,9 +294,10 @@ export declare class Pool {
294
294
  * @param {String} poolAddress
295
295
  * @param {String} tokenAmountIn exact number of base tokens to spend
296
296
  * @param {String} minPoolAmountOut minimum of pool shares expectex
297
+ * @param {number} tokenInDecimals optional number of decimals of the token
297
298
  * @return {TransactionReceipt}
298
299
  */
299
- joinswapExternAmountIn(account: string, poolAddress: string, tokenAmountIn: string, minPoolAmountOut: string): Promise<TransactionReceipt>;
300
+ joinswapExternAmountIn(account: string, poolAddress: string, tokenAmountIn: string, minPoolAmountOut: string, tokenInDecimals?: number): Promise<TransactionReceipt>;
300
301
  /**
301
302
  * Estimate gas cost for exitswapPoolAmountIn
302
303
  * @param {String} address
@@ -315,9 +316,10 @@ export declare class Pool {
315
316
  * @param {String} poolAddress
316
317
  * @param {String} poolAmountIn exact number of pool shares to spend
317
318
  * @param {String} minTokenAmountOut minimum amount of basetokens expected
319
+ * @param {number} poolDecimals optional number of decimals of the poool
318
320
  * @return {TransactionReceipt}
319
321
  */
320
- exitswapPoolAmountIn(account: string, poolAddress: string, poolAmountIn: string, minTokenAmountOut: string): Promise<TransactionReceipt>;
322
+ exitswapPoolAmountIn(account: string, poolAddress: string, poolAmountIn: string, minTokenAmountOut: string, poolDecimals?: number): Promise<TransactionReceipt>;
321
323
  /**
322
324
  * Return the spot price of swapping tokenIn to tokenOut
323
325
  * @param {String} poolAddress
@@ -1,5 +1,5 @@
1
1
  import Web3 from 'web3';
2
- import { FileMetadata, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ProviderInitialize } from '../@types/';
2
+ import { FileMetadata, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ProviderInitialize, ProviderComputeInitializeResults } from '../@types/';
3
3
  export interface HttpCallback {
4
4
  (httpMethod: string, url: string, body: string, header: any): Promise<any>;
5
5
  }
@@ -71,6 +71,17 @@ export declare class Provider {
71
71
  * @return {Promise<ProviderInitialize>} ProviderInitialize data
72
72
  */
73
73
  initialize(did: string, serviceId: string, fileIndex: number, consumerAddress: string, providerUri: string, signal?: AbortSignal, userCustomParameters?: UserCustomParameters, computeEnv?: string, validUntil?: number): Promise<ProviderInitialize>;
74
+ /** Initialize a compute request.
75
+ * @param {ComputeAsset} assets
76
+ * @param {ComputeAlgorithmber} algorithm
77
+ * @param {string} computeEnv
78
+ * @param {number} validUntil
79
+ * @param {string} providerUri Identifier of the asset to be registered in ocean
80
+ * @param {string} accountId
81
+ * @param {AbortSignal} signal abort signal
82
+ * @return {Promise<ProviderComputeInitialize>} ProviderComputeInitialize data
83
+ */
84
+ initializeCompute(assets: ComputeAsset[], algorithm: ComputeAlgorithm, computeEnv: string, validUntil: number, providerUri: string, accountId: string, signal?: AbortSignal): Promise<ProviderComputeInitializeResults>;
74
85
  /** Gets fully signed URL for download
75
86
  * @param {string} did
76
87
  * @param {string} accountId
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oceanprotocol/lib",
3
3
  "source": "./src/index.ts",
4
- "version": "1.0.0-next.41",
4
+ "version": "1.0.0-next.42",
5
5
  "description": "JavaScript client library for Ocean Protocol",
6
6
  "main": "./dist/lib.js",
7
7
  "umd:main": "dist/lib.umd.js",
@@ -58,7 +58,7 @@
58
58
  "web3": "^1.7.3"
59
59
  },
60
60
  "dependencies": {
61
- "@oceanprotocol/contracts": "^1.0.0-alpha.31",
61
+ "@oceanprotocol/contracts": "^1.0.0-alpha.32",
62
62
  "bignumber.js": "^9.0.2",
63
63
  "cross-fetch": "^3.1.5",
64
64
  "crypto-js": "^4.1.1",