@oceanprotocol/lib 0.20.1 → 1.0.0-next.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.
- package/CHANGELOG.md +75 -0
- package/README.md +1 -1
- package/dist/lib.js +2 -0
- package/dist/lib.js.map +1 -0
- package/dist/lib.modern.js +2 -0
- package/dist/lib.modern.js.map +1 -0
- package/dist/lib.module.js +2 -0
- package/dist/lib.module.js.map +1 -0
- package/dist/lib.umd.js +2 -0
- package/dist/lib.umd.js.map +1 -0
- package/dist/src/@types/Asset.d.ts +36 -0
- package/dist/{node/ocean/interfaces → src/@types}/Compute.d.ts +13 -9
- package/dist/src/@types/DDO/Credentials.d.ts +8 -0
- package/dist/src/@types/DDO/DDO.d.ts +15 -0
- package/dist/src/@types/DDO/Event.d.ts +7 -0
- package/dist/src/@types/DDO/Metadata.d.ts +38 -0
- package/dist/src/@types/DDO/Service.d.ts +28 -0
- package/dist/src/@types/FileMetadata.d.ts +8 -0
- package/dist/src/@types/Provider.d.ts +15 -0
- package/dist/src/@types/index.d.ts +8 -0
- package/dist/src/aquarius/Aquarius.d.ts +10 -0
- package/dist/src/aquarius/index.d.ts +1 -0
- package/dist/src/factories/NFTFactory.d.ts +70 -0
- package/dist/src/factories/index.d.ts +1 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/src/interfaces/DispenserInterface.d.ts +7 -0
- package/dist/src/interfaces/Erc20Interface.d.ts +11 -0
- package/dist/src/interfaces/FixedRateInterface.d.ts +19 -0
- package/dist/src/interfaces/PoolInterface.d.ts +36 -0
- package/dist/src/interfaces/RouterInterface.d.ts +12 -0
- package/dist/src/interfaces/index.d.ts +5 -0
- package/dist/{node → src}/models/Config.d.ts +10 -7
- package/dist/src/models/index.d.ts +1 -0
- package/dist/src/pools/Router.d.ts +46 -0
- package/dist/src/pools/balancer/Pool.d.ts +73 -0
- package/dist/src/pools/balancer/index.d.ts +1 -0
- package/dist/src/pools/dispenser/Dispenser.d.ts +37 -0
- package/dist/src/pools/dispenser/index.d.ts +1 -0
- package/dist/src/pools/fixedRate/FixedRateExchange.d.ts +95 -0
- package/dist/src/pools/fixedRate/index.d.ts +1 -0
- package/dist/src/pools/index.d.ts +3 -0
- package/dist/src/pools/ssContracts/SideStaking.d.ts +28 -0
- package/dist/src/pools/ssContracts/index.d.ts +1 -0
- package/dist/src/provider/Provider.d.ts +31 -0
- package/dist/src/provider/index.d.ts +1 -0
- package/dist/src/tokens/Datatoken.d.ts +77 -0
- package/dist/src/tokens/NFT.d.ts +57 -0
- package/dist/src/tokens/index.d.ts +2 -0
- package/dist/src/utils/ConfigHelper.d.ts +6 -0
- package/dist/src/utils/Constants.d.ts +1 -0
- package/dist/src/utils/ContractParams.d.ts +4 -0
- package/dist/src/utils/ConversionTypeHelper.d.ts +3 -0
- package/dist/{node/utils/Datatokens.d.ts → src/utils/DatatokenName.d.ts} +1 -1
- package/dist/src/utils/DdoHelpers.d.ts +2 -0
- package/dist/src/utils/FetchHelper.d.ts +5 -0
- package/dist/src/utils/GasUtils.d.ts +2 -0
- package/dist/{node → src}/utils/Logger.d.ts +0 -0
- package/dist/src/utils/SignatureUtils.d.ts +8 -0
- package/dist/src/utils/index.d.ts +9 -0
- package/dist/test/TestContractHandler.d.ts +44 -0
- package/dist/test/integration/ComputeFlow.test.d.ts +1 -0
- package/dist/test/integration/Provider.test.d.ts +1 -0
- package/dist/test/integration/PublishFlows.test.d.ts +1 -0
- package/dist/test/integration/SimplePublishConsumeFlow.test.d.ts +1 -0
- package/dist/test/integration/config.d.ts +3 -0
- package/dist/test/unit/NftFactory.test.d.ts +1 -0
- package/dist/test/unit/config.d.ts +3 -0
- package/dist/test/unit/pools/Router.test.d.ts +1 -0
- package/dist/test/unit/pools/balancer/Pool.test.d.ts +1 -0
- package/dist/test/unit/pools/dispenser/Dispenser.test.d.ts +1 -0
- package/dist/test/unit/pools/fixedRate/FixedRateExchange.test.d.ts +1 -0
- package/dist/test/unit/pools/ssContracts/SideStaking.test.d.ts +1 -0
- package/dist/test/unit/tokens/Datatoken.test.d.ts +1 -0
- package/dist/test/unit/tokens/Nft.test.d.ts +1 -0
- package/package.json +34 -27
- package/dist/node/Instantiable.abstract.d.ts +0 -25
- package/dist/node/balancer/OceanPool.d.ts +0 -95
- package/dist/node/balancer/Pool.d.ts +0 -56
- package/dist/node/balancer/PoolFactory.d.ts +0 -15
- package/dist/node/datatokens/ContractEvent.d.ts +0 -19
- package/dist/node/datatokens/ContractHandler.d.ts +0 -12
- package/dist/node/datatokens/Datatokens.d.ts +0 -44
- package/dist/node/datatokens/EventHandler.d.ts +0 -19
- package/dist/node/datatokens/Network.d.ts +0 -5
- package/dist/node/datatokens/Web3Provider.d.ts +0 -5
- package/dist/node/datatokens/contracts/ContractBase.d.ts +0 -27
- package/dist/node/ddo/DDO.d.ts +0 -36
- package/dist/node/ddo/interfaces/AdditionalInformation.d.ts +0 -16
- package/dist/node/ddo/interfaces/Authentication.d.ts +0 -4
- package/dist/node/ddo/interfaces/BestPrice.d.ts +0 -10
- package/dist/node/ddo/interfaces/Consumable.d.ts +0 -5
- package/dist/node/ddo/interfaces/Credentials.d.ts +0 -9
- package/dist/node/ddo/interfaces/Curation.d.ts +0 -6
- package/dist/node/ddo/interfaces/DataTokenInfo.d.ts +0 -10
- package/dist/node/ddo/interfaces/EditableMetadata.d.ts +0 -9
- package/dist/node/ddo/interfaces/EditableMetadataLinks.d.ts +0 -5
- package/dist/node/ddo/interfaces/Event.d.ts +0 -7
- package/dist/node/ddo/interfaces/File.d.ts +0 -13
- package/dist/node/ddo/interfaces/Metadata.d.ts +0 -15
- package/dist/node/ddo/interfaces/MetadataAlgorithm.d.ts +0 -12
- package/dist/node/ddo/interfaces/MetadataMain.d.ts +0 -12
- package/dist/node/ddo/interfaces/Proof.d.ts +0 -6
- package/dist/node/ddo/interfaces/PublicKey.d.ts +0 -8
- package/dist/node/ddo/interfaces/PurgatoryData.d.ts +0 -4
- package/dist/node/ddo/interfaces/Service.d.ts +0 -99
- package/dist/node/ddo/interfaces/ServicePrices.d.ts +0 -4
- package/dist/node/ddo/interfaces/Status.d.ts +0 -5
- package/dist/node/ddo/interfaces/index.d.ts +0 -17
- package/dist/node/dispenser/Dispenser.d.ts +0 -44
- package/dist/node/exchange/FixedRateExchange.d.ts +0 -59
- package/dist/node/index.d.ts +0 -1
- package/dist/node/lib.d.ts +0 -15
- package/dist/node/lib.js +0 -2
- package/dist/node/lib.js.map +0 -1
- package/dist/node/lib.module.js +0 -2
- package/dist/node/lib.module.js.map +0 -1
- package/dist/node/lib.umd.js +0 -2
- package/dist/node/lib.umd.js.map +0 -1
- package/dist/node/metadatacache/MetadataCache.d.ts +0 -41
- package/dist/node/metadatacache/OnChainMetaData.d.ts +0 -31
- package/dist/node/ocean/Account.d.ts +0 -16
- package/dist/node/ocean/Accounts.d.ts +0 -9
- package/dist/node/ocean/Assets.d.ts +0 -56
- package/dist/node/ocean/AssetsCredential.d.ts +0 -6
- package/dist/node/ocean/Compute.d.ts +0 -75
- package/dist/node/ocean/DID.d.ts +0 -8
- package/dist/node/ocean/EventAccessControl.d.ts +0 -9
- package/dist/node/ocean/Ocean.d.ts +0 -34
- package/dist/node/ocean/OceanAuth.d.ts +0 -15
- package/dist/node/ocean/Versions.d.ts +0 -25
- package/dist/node/ocean/utils/SignatureUtils.d.ts +0 -13
- package/dist/node/ocean/utils/Utils.d.ts +0 -8
- package/dist/node/ocean/utils/WebServiceConnector.d.ts +0 -16
- package/dist/node/provider/Provider.d.ts +0 -56
- package/dist/node/utils/AssetResolverHelper.d.ts +0 -8
- package/dist/node/utils/ConfigHelper.d.ts +0 -17
- package/dist/node/utils/ContractUtils.d.ts +0 -5
- package/dist/node/utils/ConversionTypeHelpers.d.ts +0 -8
- package/dist/node/utils/GeneratorHelpers.d.ts +0 -1
- package/dist/node/utils/PromiseResolver.d.ts +0 -3
- package/dist/node/utils/SubscribableObserver.d.ts +0 -12
- package/dist/node/utils/SubscribablePromise.d.ts +0 -14
- package/dist/node/utils/Timeout.d.ts +0 -1
- package/dist/node/utils/index.d.ts +0 -9
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { DDO } from '../ddo/DDO';
|
|
2
|
-
import DID from '../ocean/DID';
|
|
3
|
-
import { Logger } from '../utils';
|
|
4
|
-
import { WebServiceConnector } from '../ocean/utils/WebServiceConnector';
|
|
5
|
-
import { Metadata, ValidateMetadata } from '../ddo/interfaces';
|
|
6
|
-
export interface SearchQuery {
|
|
7
|
-
from?: number;
|
|
8
|
-
size?: number;
|
|
9
|
-
query: {
|
|
10
|
-
match?: {
|
|
11
|
-
[property: string]: string | number | boolean | Record<string, string | number | boolean>;
|
|
12
|
-
};
|
|
13
|
-
query_string?: {
|
|
14
|
-
[property: string]: string | number | string[] | number[] | boolean;
|
|
15
|
-
};
|
|
16
|
-
simple_query_string?: {
|
|
17
|
-
[property: string]: string | number | string[] | number[] | boolean;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
sort?: {
|
|
21
|
-
[jsonPath: string]: string;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export declare class MetadataCache {
|
|
25
|
-
fetch: WebServiceConnector;
|
|
26
|
-
private logger;
|
|
27
|
-
private metadataCacheUri;
|
|
28
|
-
private get url();
|
|
29
|
-
constructor(metadataCacheUri: string, logger: Logger, requestTimeout?: number);
|
|
30
|
-
getVersionInfo(): Promise<any>;
|
|
31
|
-
getAccessUrl(accessToken: any, payload: any): Promise<string>;
|
|
32
|
-
queryMetadata(query: SearchQuery): Promise<any>;
|
|
33
|
-
encryptDDO(ddo: any): Promise<any>;
|
|
34
|
-
validateMetadata(metadata: Metadata | DDO): Promise<ValidateMetadata>;
|
|
35
|
-
retrieveDDO(did: DID | string, metadataServiceEndpoint?: string): Promise<DDO>;
|
|
36
|
-
retrieveDDOByUrl(metadataServiceEndpoint?: string): Promise<DDO>;
|
|
37
|
-
getServiceEndpoint(did: DID): string;
|
|
38
|
-
getURI(): string;
|
|
39
|
-
sleep(ms: number): Promise<unknown>;
|
|
40
|
-
waitForAqua(did: string, txid?: string): Promise<void>;
|
|
41
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { DDO } from '../ddo/DDO';
|
|
2
|
-
import { TransactionReceipt } from 'web3-core';
|
|
3
|
-
import { Contract } from 'web3-eth-contract';
|
|
4
|
-
import { AbiItem } from 'web3-utils/types';
|
|
5
|
-
import Web3 from 'web3';
|
|
6
|
-
import { Logger } from '../utils';
|
|
7
|
-
import { ConfigHelperConfig } from '../utils/ConfigHelper';
|
|
8
|
-
import { MetadataCache } from '../metadatacache/MetadataCache';
|
|
9
|
-
export interface rawMetadata {
|
|
10
|
-
flags: number;
|
|
11
|
-
data: any;
|
|
12
|
-
}
|
|
13
|
-
export declare class OnChainMetadata {
|
|
14
|
-
GASLIMIT_DEFAULT: number;
|
|
15
|
-
DDOContractAddress: string;
|
|
16
|
-
DDOContractABI: AbiItem | AbiItem[];
|
|
17
|
-
web3: Web3;
|
|
18
|
-
DDOContract: Contract;
|
|
19
|
-
private logger;
|
|
20
|
-
metadataCache: MetadataCache;
|
|
21
|
-
private config;
|
|
22
|
-
constructor(web3: Web3, logger: Logger, DDOContractAddress: string, DDOContractABI: AbiItem | AbiItem[], metadataCache: MetadataCache, config?: ConfigHelperConfig);
|
|
23
|
-
compressDDO(data: any): Promise<string>;
|
|
24
|
-
publish(did: string, ddo: DDO, consumerAccount: string, encrypt?: boolean, validate?: boolean): Promise<TransactionReceipt>;
|
|
25
|
-
update(did: string, ddo: DDO, consumerAccount: string, encrypt?: boolean, validate?: boolean): Promise<TransactionReceipt>;
|
|
26
|
-
prepareRawData(ddo: DDO, encrypt?: boolean): Promise<rawMetadata>;
|
|
27
|
-
publishRaw(did: string, flags: any, data: any, consumerAccount: string): Promise<TransactionReceipt>;
|
|
28
|
-
updateRaw(did: string, flags: any, data: any, consumerAccount: string): Promise<TransactionReceipt>;
|
|
29
|
-
transferOwnership(did: string, newOwner: string, consumerAccount: string): Promise<TransactionReceipt>;
|
|
30
|
-
getHex(message: any): string;
|
|
31
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Instantiable, InstantiableConfig } from '../Instantiable.abstract';
|
|
2
|
-
export default class Account extends Instantiable {
|
|
3
|
-
private id;
|
|
4
|
-
private password?;
|
|
5
|
-
private token?;
|
|
6
|
-
constructor(id?: string, config?: InstantiableConfig);
|
|
7
|
-
getId(): string;
|
|
8
|
-
setId(id: string): void;
|
|
9
|
-
setPassword(password: string): void;
|
|
10
|
-
getPassword(): string;
|
|
11
|
-
getTokenBalance(TokenAdress: string): Promise<string>;
|
|
12
|
-
getTokenDecimals(TokenAdress: string): Promise<number>;
|
|
13
|
-
getOceanBalance(): Promise<string>;
|
|
14
|
-
getTokenSymbol(TokenAdress: string): Promise<string>;
|
|
15
|
-
getEtherBalance(): Promise<string>;
|
|
16
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import Account from './Account';
|
|
2
|
-
import { Instantiable, InstantiableConfig } from '../Instantiable.abstract';
|
|
3
|
-
export declare class Accounts extends Instantiable {
|
|
4
|
-
static getInstance(config: InstantiableConfig): Promise<Accounts>;
|
|
5
|
-
list(): Promise<Account[]>;
|
|
6
|
-
getTokenBalance(TokenAddress: string, account: Account): Promise<string>;
|
|
7
|
-
getOceanBalance(account: Account): Promise<string>;
|
|
8
|
-
getEtherBalance(account: Account): Promise<string>;
|
|
9
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { DDO } from '../ddo/DDO';
|
|
2
|
-
import { Metadata } from '../ddo/interfaces/Metadata';
|
|
3
|
-
import { Service, ServiceAccess, ServiceCustomParameter, ServiceCustomParametersRequired } from '../ddo/interfaces/Service';
|
|
4
|
-
import { SearchQuery } from '../metadatacache/MetadataCache';
|
|
5
|
-
import { EditableMetadata } from '../ddo/interfaces/EditableMetadata';
|
|
6
|
-
import Account from './Account';
|
|
7
|
-
import { SubscribablePromise } from '../utils';
|
|
8
|
-
import { Instantiable, InstantiableConfig } from '../Instantiable.abstract';
|
|
9
|
-
import { UserCustomParameters } from '../provider/Provider';
|
|
10
|
-
import { TransactionReceipt } from 'web3-core';
|
|
11
|
-
import { Consumable } from '../ddo/interfaces/Consumable';
|
|
12
|
-
export declare enum CreateProgressStep {
|
|
13
|
-
CreatingDataToken = 0,
|
|
14
|
-
DataTokenCreated = 1,
|
|
15
|
-
EncryptingFiles = 2,
|
|
16
|
-
FilesEncrypted = 3,
|
|
17
|
-
StoringDdo = 4,
|
|
18
|
-
DdoStored = 5
|
|
19
|
-
}
|
|
20
|
-
export declare enum OrderProgressStep {
|
|
21
|
-
TransferDataToken = 0
|
|
22
|
-
}
|
|
23
|
-
export interface Order {
|
|
24
|
-
dtAddress: string;
|
|
25
|
-
amount: string;
|
|
26
|
-
timestamp: number;
|
|
27
|
-
transactionHash: string;
|
|
28
|
-
consumer: string;
|
|
29
|
-
payer: string;
|
|
30
|
-
did?: string;
|
|
31
|
-
serviceId?: number;
|
|
32
|
-
serviceType?: string;
|
|
33
|
-
}
|
|
34
|
-
export declare class Assets extends Instantiable {
|
|
35
|
-
static getInstance(config: InstantiableConfig): Promise<Assets>;
|
|
36
|
-
create(metadata: Metadata, publisher: Account, services?: Service[], dtAddress?: string, cap?: string, name?: string, symbol?: string, providerUri?: string): SubscribablePromise<CreateProgressStep, DDO>;
|
|
37
|
-
resolve(did: string): Promise<DDO>;
|
|
38
|
-
editMetadata(ddo: DDO, newMetadata: EditableMetadata): Promise<DDO>;
|
|
39
|
-
updateCredentials(ddo: DDO, credentialType: string, allowList: string[], denyList: string[]): Promise<DDO>;
|
|
40
|
-
checkCredential(ddo: DDO, credentialType: string, value: string): Consumable;
|
|
41
|
-
publishDdo(ddo: DDO, consumerAccount: string, encrypt?: boolean): Promise<TransactionReceipt>;
|
|
42
|
-
updateMetadata(ddo: DDO, consumerAccount: string): Promise<TransactionReceipt>;
|
|
43
|
-
editServiceTimeout(ddo: DDO, serviceIndex: number, timeout: number): Promise<DDO>;
|
|
44
|
-
creator(asset: DDO | string): Promise<string>;
|
|
45
|
-
getServiceByType(asset: DDO | string, serviceType: string): Promise<Service>;
|
|
46
|
-
getServiceByIndex(asset: DDO | string, serviceIndex: number): Promise<Service>;
|
|
47
|
-
query(query: SearchQuery): Promise<any>;
|
|
48
|
-
createAccessServiceAttributes(creator: Account, cost: string, datePublished: string, timeout?: number, providerUri?: string, requiredParameters?: ServiceCustomParametersRequired): Promise<ServiceAccess>;
|
|
49
|
-
initialize(asset: DDO | string, serviceType: string, consumerAddress: string, serviceIndex: number, serviceEndpoint: string, userCustomParameters?: UserCustomParameters): Promise<any>;
|
|
50
|
-
order(asset: DDO | string, serviceType: string, payerAddress: string, serviceIndex?: number, mpAddress?: string, consumerAddress?: string, userCustomParameters?: UserCustomParameters, authService?: string, searchPreviousOrders?: boolean): Promise<string>;
|
|
51
|
-
download(asset: DDO | string, txId: string, tokenAddress: string, consumerAccount: Account, destination: string): Promise<string | true>;
|
|
52
|
-
simpleDownload(dtAddress: string, serviceEndpoint: string, txId: string, account: string): Promise<string>;
|
|
53
|
-
getOrderHistory(account: Account, serviceType?: string, fromBlock?: number): Promise<Order[]>;
|
|
54
|
-
isConsumable(ddo: DDO, consumer?: string, credentialsType?: string, authService?: string): Promise<Consumable>;
|
|
55
|
-
isUserCustomParametersValid(serviceCustomParameters: ServiceCustomParameter[], userCustomParameters?: UserCustomParameters): Promise<boolean>;
|
|
56
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { DDO } from '../ddo/DDO';
|
|
2
|
-
import { Credentials, CredentialAction } from '../ddo/interfaces/Credentials';
|
|
3
|
-
export declare function checkCredentialExist(credentials: Credentials, credentialType: string, credentialAction: CredentialAction): boolean;
|
|
4
|
-
export declare function removeCredentialDetail(ddo: DDO, credentialType: string, credentialAction: CredentialAction): DDO;
|
|
5
|
-
export declare function updateCredentialDetail(ddo: DDO, credentialType: string, list: string[], credentialAction: CredentialAction): DDO;
|
|
6
|
-
export declare function addCredentialDetail(ddo: DDO, credentialType: string, list: string[], credentialAction: CredentialAction): DDO;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { DDO } from '../ddo/DDO';
|
|
2
|
-
import { ServiceComputePrivacy, ServiceCompute, publisherTrustedAlgorithm, ServiceCustomParametersRequired } from '../ddo/interfaces/Service';
|
|
3
|
-
import Account from './Account';
|
|
4
|
-
import { SubscribablePromise } from '../utils';
|
|
5
|
-
import { Instantiable, InstantiableConfig } from '../Instantiable.abstract';
|
|
6
|
-
import { ComputeOutput, ComputeJob, ComputeInput, ComputeAlgorithm } from './interfaces/Compute';
|
|
7
|
-
import { UserCustomParameters } from '../provider/Provider';
|
|
8
|
-
export declare enum OrderProgressStep {
|
|
9
|
-
TransferDataToken = 0
|
|
10
|
-
}
|
|
11
|
-
export interface Cluster {
|
|
12
|
-
type: string;
|
|
13
|
-
url: string;
|
|
14
|
-
}
|
|
15
|
-
export interface Container {
|
|
16
|
-
image: string;
|
|
17
|
-
tag: string;
|
|
18
|
-
checksum: string;
|
|
19
|
-
}
|
|
20
|
-
export interface Server {
|
|
21
|
-
serverId: string;
|
|
22
|
-
serverType: string;
|
|
23
|
-
cost: string;
|
|
24
|
-
cpu: string;
|
|
25
|
-
gpu: string;
|
|
26
|
-
memory: string;
|
|
27
|
-
disk: string;
|
|
28
|
-
maxExecutionTime: number;
|
|
29
|
-
}
|
|
30
|
-
export declare const ComputeJobStatus: Readonly<{
|
|
31
|
-
WarmingUp: number;
|
|
32
|
-
Started: number;
|
|
33
|
-
ConfiguringVolumes: number;
|
|
34
|
-
ProvisioningSuccess: number;
|
|
35
|
-
DataProvisioningFailed: number;
|
|
36
|
-
AlgorithmProvisioningFailed: number;
|
|
37
|
-
RunningAlgorithm: number;
|
|
38
|
-
FilteringResults: number;
|
|
39
|
-
PublishingResult: number;
|
|
40
|
-
Completed: number;
|
|
41
|
-
Stopped: number;
|
|
42
|
-
Deleted: number;
|
|
43
|
-
}>;
|
|
44
|
-
export declare class Compute extends Instantiable {
|
|
45
|
-
static getInstance(config: InstantiableConfig): Promise<Compute>;
|
|
46
|
-
getComputeAddress(did: string, serviceIndex?: number): Promise<string>;
|
|
47
|
-
start(asset: DDO | string, txId: string, tokenAddress: string, consumerAccount: Account, algorithm: ComputeAlgorithm, output?: ComputeOutput, serviceIndex?: string, serviceType?: string, additionalInputs?: ComputeInput[]): Promise<ComputeJob>;
|
|
48
|
-
stop(consumerAccount: Account, asset: DDO | string, jobId: string): Promise<ComputeJob>;
|
|
49
|
-
delete(consumerAccount: Account, asset: DDO | string, jobId: string): Promise<ComputeJob>;
|
|
50
|
-
status(consumerAccount: Account, did?: string, ddo?: DDO, service?: ServiceCompute, jobId?: string, txId?: string): Promise<ComputeJob[]>;
|
|
51
|
-
getResult(consumerAccount: Account, jobId: string, index: number, destination: string, did?: string, ddo?: DDO, service?: ServiceCompute): Promise<any>;
|
|
52
|
-
createServerAttributes(serverId: string, serverType: string, cost: string, cpu: string, gpu: string, memory: string, disk: string, maxExecutionTime: number): Server;
|
|
53
|
-
createContainerAttributes(image: string, tag: string, checksum: string): Container;
|
|
54
|
-
createClusterAttributes(type: string, url: string): Cluster;
|
|
55
|
-
createProviderAttributes(type: string, description: string, cluster: Cluster, containers: Container[], servers: Server[]): {
|
|
56
|
-
type: string;
|
|
57
|
-
description: string;
|
|
58
|
-
environment: {
|
|
59
|
-
cluster: Cluster;
|
|
60
|
-
supportedServers: Server[];
|
|
61
|
-
supportedContainers: Container[];
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
createComputeService(consumerAccount: Account, cost: string, datePublished: string, providerAttributes: any, computePrivacy?: ServiceComputePrivacy, timeout?: number, providerUri?: string, requiredCustomParameters?: ServiceCustomParametersRequired): ServiceCompute;
|
|
65
|
-
private checkOutput;
|
|
66
|
-
isOrderable(dataset: DDO | string, serviceIndex: number, algorithm: ComputeAlgorithm, algorithmDDO?: DDO): Promise<boolean>;
|
|
67
|
-
orderAsset(consumerAccount: string, dataset: DDO | string, serviceIndex: number, algorithm: ComputeAlgorithm, mpAddress?: string, computeAddress?: string, userCustomParameters?: UserCustomParameters, authService?: string, searchPreviousOrders?: boolean): SubscribablePromise<OrderProgressStep, string>;
|
|
68
|
-
orderAlgorithm(asset: DDO | string, serviceType: string, payerAddress: string, serviceIndex?: number, mpAddress?: string, consumerAddress?: string, userCustomParameters?: UserCustomParameters, authService?: string, searchPreviousOrders?: boolean): Promise<string>;
|
|
69
|
-
editComputePrivacy(ddo: DDO, serviceIndex: number, computePrivacy: ServiceComputePrivacy): Promise<DDO>;
|
|
70
|
-
toggleAllowAllPublishedAlgorithms(ddo: DDO, serviceIndex: number, newState: boolean): Promise<DDO>;
|
|
71
|
-
createPublisherTrustedAlgorithmfromDID(did: string, ddo?: DDO): Promise<publisherTrustedAlgorithm>;
|
|
72
|
-
addTrustedAlgorithmtoAsset(ddo: DDO, serviceIndex: number, algoDid: string): Promise<DDO>;
|
|
73
|
-
isAlgorithmTrusted(ddo: DDO, serviceIndex: number, algoDid: string): Promise<boolean>;
|
|
74
|
-
removeTrustedAlgorithmFromAsset(ddo: DDO, serviceIndex: number, algoDid: string): Promise<DDO>;
|
|
75
|
-
}
|
package/dist/node/ocean/DID.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Instantiable, InstantiableConfig } from '../Instantiable.abstract';
|
|
2
|
-
export declare class EventAccessControl extends Instantiable {
|
|
3
|
-
private baseUrl;
|
|
4
|
-
static getInstance(config: InstantiableConfig): Promise<EventAccessControl>;
|
|
5
|
-
setBaseUrl(url: string): Promise<void>;
|
|
6
|
-
get url(): string;
|
|
7
|
-
private getIsPermitArgs;
|
|
8
|
-
isPermit(component: string, eventType: string, authService: string, credentials: string, credentialsType: string, did?: string): Promise<boolean>;
|
|
9
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Accounts } from './Accounts';
|
|
2
|
-
import { Assets } from './Assets';
|
|
3
|
-
import { Versions } from './Versions';
|
|
4
|
-
import { OceanUtils } from './utils/Utils';
|
|
5
|
-
import { MetadataCache } from '../metadatacache/MetadataCache';
|
|
6
|
-
import { OnChainMetadata } from '../metadatacache/OnChainMetaData';
|
|
7
|
-
import { Provider } from '../provider/Provider';
|
|
8
|
-
import { DataTokens } from '../datatokens/Datatokens';
|
|
9
|
-
import { Network } from '../datatokens/Network';
|
|
10
|
-
import { Config } from '../models/Config';
|
|
11
|
-
import { Instantiable } from '../Instantiable.abstract';
|
|
12
|
-
import { Compute } from './Compute';
|
|
13
|
-
import { OceanPool } from '../balancer/OceanPool';
|
|
14
|
-
import { OceanFixedRateExchange } from '../exchange/FixedRateExchange';
|
|
15
|
-
import { OceanDispenser } from '../dispenser/Dispenser';
|
|
16
|
-
import { EventAccessControl } from './EventAccessControl';
|
|
17
|
-
export declare class Ocean extends Instantiable {
|
|
18
|
-
static getInstance(config: Config): Promise<Ocean>;
|
|
19
|
-
network: Network;
|
|
20
|
-
provider: Provider;
|
|
21
|
-
eventAccessControl: EventAccessControl;
|
|
22
|
-
web3Provider: any;
|
|
23
|
-
metadataCache: MetadataCache;
|
|
24
|
-
onChainMetadata: OnChainMetadata;
|
|
25
|
-
accounts: Accounts;
|
|
26
|
-
assets: Assets;
|
|
27
|
-
compute: Compute;
|
|
28
|
-
datatokens: DataTokens;
|
|
29
|
-
pool: OceanPool;
|
|
30
|
-
fixedRateExchange: OceanFixedRateExchange;
|
|
31
|
-
OceanDispenser: OceanDispenser;
|
|
32
|
-
versions: Versions;
|
|
33
|
-
utils: OceanUtils;
|
|
34
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import Account from './Account';
|
|
2
|
-
import { Instantiable, InstantiableConfig } from '../Instantiable.abstract';
|
|
3
|
-
export declare class OceanAuth extends Instantiable {
|
|
4
|
-
static getInstance(config: InstantiableConfig): Promise<OceanAuth>;
|
|
5
|
-
get(account: Account): Promise<string>;
|
|
6
|
-
check(token: string): Promise<string>;
|
|
7
|
-
store(account: Account): Promise<void>;
|
|
8
|
-
restore(account: Account): Promise<string>;
|
|
9
|
-
isStored(account: Account): Promise<boolean>;
|
|
10
|
-
private writeToken;
|
|
11
|
-
private readToken;
|
|
12
|
-
private getLocalStorage;
|
|
13
|
-
private getMessage;
|
|
14
|
-
private getExpiration;
|
|
15
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Instantiable, InstantiableConfig } from '../Instantiable.abstract';
|
|
2
|
-
export declare enum OceanPlatformTechStatus {
|
|
3
|
-
Loading = "Loading",
|
|
4
|
-
Unknown = "Unknown",
|
|
5
|
-
Stopped = "Stopped",
|
|
6
|
-
Working = "Working"
|
|
7
|
-
}
|
|
8
|
-
export interface OceanPlatformTech {
|
|
9
|
-
name: string;
|
|
10
|
-
version?: string;
|
|
11
|
-
commit?: string;
|
|
12
|
-
status: OceanPlatformTechStatus;
|
|
13
|
-
}
|
|
14
|
-
export interface OceanPlatformVersions {
|
|
15
|
-
lib: OceanPlatformTech;
|
|
16
|
-
metadataCache: OceanPlatformTech;
|
|
17
|
-
provider: OceanPlatformTech;
|
|
18
|
-
status: {
|
|
19
|
-
ok: boolean;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
export declare class Versions extends Instantiable {
|
|
23
|
-
static getInstance(config: InstantiableConfig): Promise<Versions>;
|
|
24
|
-
get(): Promise<OceanPlatformVersions>;
|
|
25
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import Web3 from 'web3';
|
|
2
|
-
import { Logger } from '../../utils';
|
|
3
|
-
import { Account } from '../../lib';
|
|
4
|
-
export declare class SignatureUtils {
|
|
5
|
-
private web3;
|
|
6
|
-
private logger;
|
|
7
|
-
constructor(web3: Web3, logger: Logger);
|
|
8
|
-
signText(text: string, publicKey: string, password?: string): Promise<string>;
|
|
9
|
-
signWithHash(text: string, publicKey: string, password?: string): Promise<string>;
|
|
10
|
-
verifyText(text: string, signature: string): Promise<string>;
|
|
11
|
-
getHash(message: string): Promise<string>;
|
|
12
|
-
signForAquarius(message: string, account: Account): Promise<string>;
|
|
13
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract';
|
|
2
|
-
import { SignatureUtils } from './SignatureUtils';
|
|
3
|
-
import { WebServiceConnector } from './WebServiceConnector';
|
|
4
|
-
export declare class OceanUtils extends Instantiable {
|
|
5
|
-
static getInstance(config: InstantiableConfig): Promise<OceanUtils>;
|
|
6
|
-
signature: SignatureUtils;
|
|
7
|
-
fetch: WebServiceConnector;
|
|
8
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Response } from 'node-fetch';
|
|
2
|
-
import { Logger } from '../../utils';
|
|
3
|
-
export declare class WebServiceConnector {
|
|
4
|
-
logger: Logger;
|
|
5
|
-
requestTimeout: number;
|
|
6
|
-
constructor(logger: Logger, requestTimeout?: number);
|
|
7
|
-
post(url: string, payload: BodyInit): Promise<Response>;
|
|
8
|
-
postWithOctet(url: string, payload: BodyInit): Promise<Response>;
|
|
9
|
-
postWithHeaders(url: string, payload: BodyInit, headers: any): Promise<Response>;
|
|
10
|
-
get(url: string): Promise<Response>;
|
|
11
|
-
put(url: string, payload: BodyInit): Promise<Response>;
|
|
12
|
-
delete(url: string, payload?: BodyInit): Promise<Response>;
|
|
13
|
-
downloadFile(url: string, destination?: string, index?: number): Promise<string>;
|
|
14
|
-
downloadFileBrowser(url: string): Promise<void>;
|
|
15
|
-
private fetch;
|
|
16
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import Account from '../ocean/Account';
|
|
2
|
-
import { Instantiable, InstantiableConfig } from '../Instantiable.abstract';
|
|
3
|
-
import { File } from '../ddo/interfaces/File';
|
|
4
|
-
import { ComputeJob, ComputeInput, ComputeOutput, ComputeAlgorithm } from '../ocean/interfaces/Compute';
|
|
5
|
-
import { DDO } from '../ddo/DDO';
|
|
6
|
-
import DID from '../ocean/DID';
|
|
7
|
-
export interface ServiceEndpoint {
|
|
8
|
-
serviceName: string;
|
|
9
|
-
method: string;
|
|
10
|
-
urlPath: string;
|
|
11
|
-
}
|
|
12
|
-
export interface ComputeLimits {
|
|
13
|
-
algoTimeLimit?: string;
|
|
14
|
-
storageExpiry?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface UserCustomParameters {
|
|
17
|
-
[key: string]: any;
|
|
18
|
-
}
|
|
19
|
-
export declare class Provider extends Instantiable {
|
|
20
|
-
nonce: string;
|
|
21
|
-
private baseUrl;
|
|
22
|
-
servicesEndpoints: ServiceEndpoint[];
|
|
23
|
-
computeAddress: string;
|
|
24
|
-
providerAddress: string;
|
|
25
|
-
providerVersion: string;
|
|
26
|
-
computeLimits: ComputeLimits;
|
|
27
|
-
static getInstance(config: InstantiableConfig): Promise<Provider>;
|
|
28
|
-
setBaseUrl(url: string): Promise<boolean>;
|
|
29
|
-
get url(): string;
|
|
30
|
-
getServiceEndpoints(): Promise<ServiceEndpoint[]>;
|
|
31
|
-
getEndpointURL(serviceName: string): ServiceEndpoint;
|
|
32
|
-
createSignature(account: Account, agreementId: string): Promise<string>;
|
|
33
|
-
createHashSignature(account: Account, message: string): Promise<string>;
|
|
34
|
-
encrypt(did: string, document: any, account: Account): Promise<string>;
|
|
35
|
-
fileinfo(url: string): Promise<File[]>;
|
|
36
|
-
isFileConsumable(did: DID, serviceIndex: number): Promise<boolean>;
|
|
37
|
-
getNonce(consumerAddress: string): Promise<string>;
|
|
38
|
-
initialize(asset: DDO | string, serviceIndex: number, serviceType: string, consumerAddress: string, userCustomParameters?: UserCustomParameters): Promise<string>;
|
|
39
|
-
download(did: string, txId: string, tokenAddress: string, serviceType: string, serviceIndex: string, destination: string, account: Account, files: File[], index?: number, userCustomParameters?: UserCustomParameters): Promise<any>;
|
|
40
|
-
computeStart(did: string, consumerAccount: Account, algorithm: ComputeAlgorithm, output?: ComputeOutput, txId?: string, serviceIndex?: string, serviceType?: string, tokenAddress?: string, additionalInputs?: ComputeInput[], userCustomParameters?: UserCustomParameters): Promise<ComputeJob | ComputeJob[]>;
|
|
41
|
-
computeStop(did: string, consumerAccount: Account, jobId: string): Promise<ComputeJob | ComputeJob[]>;
|
|
42
|
-
computeDelete(did: string, consumerAccount: Account, jobId: string): Promise<ComputeJob | ComputeJob[]>;
|
|
43
|
-
computeStatus(did: string, consumerAccount: Account, jobId?: string, txId?: string): Promise<ComputeJob | ComputeJob[]>;
|
|
44
|
-
computeResult(jobId: string, index: number, destination: string, account: Account): Promise<any>;
|
|
45
|
-
getInitializeEndpoint(): ServiceEndpoint;
|
|
46
|
-
getNonceEndpoint(): ServiceEndpoint;
|
|
47
|
-
getEncryptEndpoint(): ServiceEndpoint;
|
|
48
|
-
getFileinfoEndpoint(): ServiceEndpoint;
|
|
49
|
-
getComputeStartEndpoint(): ServiceEndpoint;
|
|
50
|
-
getComputeStopEndpoint(): ServiceEndpoint;
|
|
51
|
-
getComputeStatusEndpoint(): ServiceEndpoint;
|
|
52
|
-
getComputeDeleteEndpoint(): ServiceEndpoint;
|
|
53
|
-
getComputeResultEndpoint(): ServiceEndpoint;
|
|
54
|
-
getDownloadEndpoint(): ServiceEndpoint;
|
|
55
|
-
isValidProvider(url: string): Promise<boolean>;
|
|
56
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { DDO } from '../ddo/DDO';
|
|
2
|
-
import { Ocean } from '../ocean/Ocean';
|
|
3
|
-
export interface AssetResolved {
|
|
4
|
-
did: string;
|
|
5
|
-
ddo: DDO;
|
|
6
|
-
}
|
|
7
|
-
export declare function isDdo(arg: any): arg is DDO;
|
|
8
|
-
export declare function assetResolve(asset: DDO | string, ocean: Ocean): Promise<AssetResolved>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import Config from '../models/Config';
|
|
2
|
-
export interface ConfigHelperConfig extends Config {
|
|
3
|
-
networkId: number;
|
|
4
|
-
network: string;
|
|
5
|
-
subgraphUri: string;
|
|
6
|
-
explorerUri: string;
|
|
7
|
-
oceanTokenSymbol: string;
|
|
8
|
-
transactionBlockTimeout: number;
|
|
9
|
-
transactionConfirmationBlocks: number;
|
|
10
|
-
transactionPollingTimeout: number;
|
|
11
|
-
gasFeeMultiplier: number;
|
|
12
|
-
}
|
|
13
|
-
export declare const configHelperNetworks: ConfigHelperConfig[];
|
|
14
|
-
export declare class ConfigHelper {
|
|
15
|
-
getAddressesFromEnv(network: string): Partial<ConfigHelperConfig>;
|
|
16
|
-
getConfig(network: string | number, infuraProjectId?: string): Config;
|
|
17
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import Web3 from 'web3';
|
|
2
|
-
import { Contract } from 'web3-eth-contract';
|
|
3
|
-
import { ConfigHelperConfig } from './ConfigHelper';
|
|
4
|
-
export declare function getFairGasPrice(web3: Web3, config: ConfigHelperConfig): Promise<string>;
|
|
5
|
-
export declare function setContractDefaults(contract: Contract, config: ConfigHelperConfig): Contract;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const zeroX: (input: string) => string;
|
|
2
|
-
export declare const noZeroX: (input: string) => string;
|
|
3
|
-
export declare function zeroXTransformer(input: string, zeroOutput: boolean): string;
|
|
4
|
-
export declare const didPrefixed: (input: string) => string;
|
|
5
|
-
export declare const noDidPrefixed: (input: string) => string;
|
|
6
|
-
export declare function didTransformer(input: string, prefixOutput: boolean): string;
|
|
7
|
-
export declare const didZeroX: (input: string) => string;
|
|
8
|
-
export declare const didNoZeroX: (input: string) => string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function generateId(length?: number): string;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare class SubscribableObserver<T, P> {
|
|
2
|
-
completed: boolean;
|
|
3
|
-
private subscriptions;
|
|
4
|
-
subscribe(onNext?: (next: T) => void, onComplete?: (complete: P) => void, onError?: (error: any) => void): {
|
|
5
|
-
unsubscribe: () => boolean;
|
|
6
|
-
};
|
|
7
|
-
next(next?: T): void;
|
|
8
|
-
complete(resolve?: P): void;
|
|
9
|
-
error(error?: any): void;
|
|
10
|
-
private emit;
|
|
11
|
-
private unsubscribe;
|
|
12
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { SubscribableObserver } from './SubscribableObserver';
|
|
2
|
-
export declare class SubscribablePromise<T extends any, P extends any> {
|
|
3
|
-
private observer;
|
|
4
|
-
private promise;
|
|
5
|
-
constructor(executor: (observer: SubscribableObserver<T, P>) => void | Promise<P>);
|
|
6
|
-
subscribe(onNext: (next: T) => void): {
|
|
7
|
-
unsubscribe: () => boolean;
|
|
8
|
-
};
|
|
9
|
-
next(onNext: (next: T) => void): this;
|
|
10
|
-
then(onfulfilled?: (value: P) => any, onrejected?: (error: any) => any): Promise<any> & this;
|
|
11
|
-
catch(onrejected?: (error: any) => any): Promise<any> & this;
|
|
12
|
-
finally(onfinally?: () => any): Promise<P> & this;
|
|
13
|
-
private init;
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function timeoutSignal(timeout: number): any;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export * from './PromiseResolver';
|
|
2
|
-
export * from './Logger';
|
|
3
|
-
export * from './ConversionTypeHelpers';
|
|
4
|
-
export * from './GeneratorHelpers';
|
|
5
|
-
export * from './SubscribablePromise';
|
|
6
|
-
export * from './SubscribableObserver';
|
|
7
|
-
export * from './ContractUtils';
|
|
8
|
-
export * from './AssetResolverHelper';
|
|
9
|
-
export * from './Datatokens';
|