@oceanprotocol/lib 4.3.2 → 4.3.4
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/CHANGELOG.md +97 -0
- package/dist/lib.cjs +1 -1
- package/dist/lib.cjs.map +1 -1
- package/dist/lib.modern.js +1 -1
- package/dist/lib.modern.js.map +1 -1
- package/dist/lib.module.mjs +1 -1
- package/dist/lib.module.mjs.map +1 -1
- package/dist/lib.umd.js +1 -1
- package/dist/lib.umd.js.map +1 -1
- package/dist/types/@types/PolicyServer.d.ts +9 -0
- package/dist/types/@types/index.d.ts +1 -0
- package/dist/types/config/Config.d.ts +5 -0
- package/dist/types/contracts/EnterpriseFeeCollector.d.ts +34 -0
- package/dist/types/services/Provider.d.ts +13 -1
- package/package.json +2 -2
|
@@ -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';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Signer } from 'ethers';
|
|
2
|
+
import { AbiItem } from '../@types';
|
|
3
|
+
import { Config } from '../config';
|
|
4
|
+
import { SmartContractWithAddress } from './SmartContractWithAddress';
|
|
5
|
+
export declare class EnterpriseFeeCollectorContract extends SmartContractWithAddress {
|
|
6
|
+
abi: AbiItem[];
|
|
7
|
+
getDefaultAbi(): AbiItem[];
|
|
8
|
+
/**
|
|
9
|
+
* Instantiate EnterpriseFeeCollectorContract class
|
|
10
|
+
* @param {string} address The contract address.
|
|
11
|
+
* @param {Signer} signer The signer object.
|
|
12
|
+
* @param {string | number} [network] Network id or name
|
|
13
|
+
* @param {Config} [config] The configuration object.
|
|
14
|
+
* @param {AbiItem[]} [abi] ABI array of the smart contract
|
|
15
|
+
*/
|
|
16
|
+
constructor(address: string, signer: Signer, network?: string | number, config?: Config, abi?: AbiItem[]);
|
|
17
|
+
/**
|
|
18
|
+
* Check if token is allowed
|
|
19
|
+
* @return {Promise<any>} Boolean indicating if token is allowed
|
|
20
|
+
*/
|
|
21
|
+
isTokenAllowed(token: string): Promise<boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* Get Token details
|
|
24
|
+
* @return {Promise<any>} Token details
|
|
25
|
+
*/
|
|
26
|
+
getToken(token: string): Promise<any>;
|
|
27
|
+
/**
|
|
28
|
+
* Calculate fee
|
|
29
|
+
* @param {string} token Token address
|
|
30
|
+
* @param {string} amount Amount
|
|
31
|
+
* @return {Promise<string>} Fee amount
|
|
32
|
+
*/
|
|
33
|
+
calculateFee(token: string, amount: number): Promise<any>;
|
|
34
|
+
}
|
|
@@ -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;
|
|
@@ -242,6 +242,18 @@ export declare class Provider {
|
|
|
242
242
|
* @return {Promise<boolean>} valid or not
|
|
243
243
|
*/
|
|
244
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>;
|
|
245
257
|
/**
|
|
246
258
|
* Private method that removes the leading 0x from a string.
|
|
247
259
|
* @param {string} input - The input string.
|
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.
|
|
4
|
+
"version": "4.3.4",
|
|
5
5
|
"description": "JavaScript client library for Ocean Protocol",
|
|
6
6
|
"main": "./dist/lib.cjs",
|
|
7
7
|
"umd:main": "dist/lib.umd.js",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@oasisprotocol/sapphire-paratime": "^1.3.2",
|
|
60
|
-
"@oceanprotocol/contracts": "^2.
|
|
60
|
+
"@oceanprotocol/contracts": "^2.4.1",
|
|
61
61
|
"@oceanprotocol/ddo-js": "^0.1.2",
|
|
62
62
|
"@rdfjs/dataset": "^2.0.2",
|
|
63
63
|
"@rdfjs/formats-common": "^3.1.0",
|