@oceanprotocol/lib 8.0.6 → 8.2.0
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/dist/lib.cjs +4 -4
- package/dist/lib.module.mjs +4 -4
- package/dist/lib.umd.js +4 -4
- package/dist/types/@types/Assets.d.ts +1 -0
- package/dist/types/@types/NFT.d.ts +1 -1
- package/dist/types/@types/Provider.d.ts +14 -0
- package/dist/types/@types/index.d.ts +1 -0
- package/dist/types/contracts/AccessList.d.ts +6 -1
- package/dist/types/contracts/AccessListFactory.d.ts +4 -1
- package/dist/types/contracts/Datatoken.d.ts +18 -1
- package/dist/types/contracts/Datatoken4.d.ts +4 -1
- package/dist/types/contracts/Dispenser.d.ts +7 -0
- package/dist/types/contracts/Escrow.d.ts +7 -1
- package/dist/types/contracts/FixedRateExchange.d.ts +15 -0
- package/dist/types/contracts/NFT.d.ts +21 -2
- package/dist/types/contracts/NFTFactory.d.ts +12 -0
- package/dist/types/contracts/Router.d.ts +9 -0
- package/dist/types/services/Aquarius.d.ts +1 -1
- package/dist/types/services/providers/BaseProvider.d.ts +43 -47
- package/dist/types/services/providers/HttpProvider.d.ts +20 -22
- package/dist/types/services/providers/P2pProvider.d.ts +50 -47
- package/dist/types/utils/Assets.d.ts +1 -1
- package/dist/types/utils/ContractUtils.d.ts +7 -3
- package/dist/types/utils/OrderUtils.d.ts +1 -1
- package/package.json +6 -6
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TransactionRequest } from 'ethers';
|
|
1
2
|
import { AbiItem, FreCreationParams, DatatokenCreateParams, DispenserCreationParams, NftCreateData, Template, TokenOrder, ReceiptOrEstimate } from '../@types/index.js';
|
|
2
3
|
import { SmartContractWithAddress } from './SmartContractWithAddress.js';
|
|
3
4
|
/**
|
|
@@ -12,6 +13,7 @@ export declare class NftFactory extends SmartContractWithAddress {
|
|
|
12
13
|
* @return {Promise<string|BigNumber>} The transaction hash or the gas estimate.
|
|
13
14
|
*/
|
|
14
15
|
createNFT<G extends boolean = false>(nftData: NftCreateData, estimateGas?: G): Promise<G extends false ? string : bigint>;
|
|
16
|
+
createNFTTx(nftData: NftCreateData): Promise<TransactionRequest>;
|
|
15
17
|
/**
|
|
16
18
|
* Get Current NFT Count (NFT created)
|
|
17
19
|
* @return {Promise<number>} Number of NFT created from this factory
|
|
@@ -69,6 +71,7 @@ export declare class NftFactory extends SmartContractWithAddress {
|
|
|
69
71
|
* @return {Promise<ReceiptOrEstimate>}
|
|
70
72
|
*/
|
|
71
73
|
addNFTTemplate<G extends boolean = false>(address: string, templateAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
74
|
+
addNFTTemplateTx(address: string, templateAddress: string): Promise<TransactionRequest>;
|
|
72
75
|
/**
|
|
73
76
|
* Disable token template - only factory Owner
|
|
74
77
|
* @param {String} address
|
|
@@ -77,6 +80,7 @@ export declare class NftFactory extends SmartContractWithAddress {
|
|
|
77
80
|
* @return {Promise<ReceiptOrEstimate>} current token template count
|
|
78
81
|
*/
|
|
79
82
|
disableNFTTemplate<G extends boolean = false>(address: string, templateIndex: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
83
|
+
disableNFTTemplateTx(address: string, templateIndex: number): Promise<TransactionRequest>;
|
|
80
84
|
/**
|
|
81
85
|
* Reactivate a previously disabled token template - only factory Owner
|
|
82
86
|
* @param {String} address
|
|
@@ -85,6 +89,7 @@ export declare class NftFactory extends SmartContractWithAddress {
|
|
|
85
89
|
* @return {Promise<ReceiptOrEstimate>} current token template count
|
|
86
90
|
*/
|
|
87
91
|
reactivateNFTTemplate<G extends boolean = false>(address: string, templateIndex: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
92
|
+
reactivateNFTTemplateTx(address: string, templateIndex: number): Promise<TransactionRequest>;
|
|
88
93
|
/**
|
|
89
94
|
* Add a new NFT token template - only factory Owner
|
|
90
95
|
* @param {String} address caller address
|
|
@@ -93,6 +98,7 @@ export declare class NftFactory extends SmartContractWithAddress {
|
|
|
93
98
|
* @return {Promise<ReceiptOrEstimate>}
|
|
94
99
|
*/
|
|
95
100
|
addTokenTemplate<G extends boolean = false>(address: string, templateAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
101
|
+
addTokenTemplateTx(address: string, templateAddress: string): Promise<TransactionRequest>;
|
|
96
102
|
/**
|
|
97
103
|
* Disable token template - only factory Owner
|
|
98
104
|
* @param {String} address caller address
|
|
@@ -101,6 +107,7 @@ export declare class NftFactory extends SmartContractWithAddress {
|
|
|
101
107
|
* @return {Promise<ReceiptOrEstimate>} current token template count
|
|
102
108
|
*/
|
|
103
109
|
disableTokenTemplate<G extends boolean = false>(address: string, templateIndex: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
110
|
+
disableTokenTemplateTx(address: string, templateIndex: number): Promise<TransactionRequest>;
|
|
104
111
|
/**
|
|
105
112
|
* Reactivate a previously disabled token template - only factory Owner
|
|
106
113
|
* @param {String} address caller address
|
|
@@ -109,6 +116,7 @@ export declare class NftFactory extends SmartContractWithAddress {
|
|
|
109
116
|
* @return {Promise<ReceiptOrEstimate>} current token template count
|
|
110
117
|
*/
|
|
111
118
|
reactivateTokenTemplate<G extends boolean = false>(address: string, templateIndex: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
119
|
+
reactivateTokenTemplateTx(address: string, templateIndex: number): Promise<TransactionRequest>;
|
|
112
120
|
/**
|
|
113
121
|
* Used as a proxy to order multiple services
|
|
114
122
|
* Users can have inifinite approvals for fees for factory instead of having one approval/ Datatoken contract
|
|
@@ -121,6 +129,7 @@ export declare class NftFactory extends SmartContractWithAddress {
|
|
|
121
129
|
* @return {Promise<ReceiptOrEstimate>} transaction receipt
|
|
122
130
|
*/
|
|
123
131
|
startMultipleTokenOrder<G extends boolean = false>(orders: TokenOrder[], estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
132
|
+
startMultipleTokenOrderTx(orders: TokenOrder[]): Promise<TransactionRequest>;
|
|
124
133
|
/**
|
|
125
134
|
* Creates a new NFT, then a datatoken,all in one call
|
|
126
135
|
* @param {NftCreateData} nftCreateData - The data required to create an NFT.
|
|
@@ -129,6 +138,7 @@ export declare class NftFactory extends SmartContractWithAddress {
|
|
|
129
138
|
* @return {Promise<ReceiptOrEstimate>} transaction receipt
|
|
130
139
|
*/
|
|
131
140
|
createNftWithDatatoken<G extends boolean = false>(nftCreateData: NftCreateData, dtParams: DatatokenCreateParams, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
141
|
+
createNftWithDatatokenTx(nftCreateData: NftCreateData, dtParams: DatatokenCreateParams): Promise<TransactionRequest>;
|
|
132
142
|
/**
|
|
133
143
|
* Creates an NFT with a datatoken with a fixed rate all in one call.
|
|
134
144
|
* be aware if Fixed Rate creation fails, you are still going to pay a lot of gas
|
|
@@ -139,6 +149,7 @@ export declare class NftFactory extends SmartContractWithAddress {
|
|
|
139
149
|
* @returns {Promis<ReceiptOrEstimate<G>>}
|
|
140
150
|
*/
|
|
141
151
|
createNftWithDatatokenWithFixedRate<G extends boolean = false>(nftCreateData: NftCreateData, dtParams: DatatokenCreateParams, freParams: FreCreationParams, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
152
|
+
createNftWithDatatokenWithFixedRateTx(nftCreateData: NftCreateData, dtParams: DatatokenCreateParams, freParams: FreCreationParams): Promise<TransactionRequest>;
|
|
142
153
|
/**
|
|
143
154
|
* Creates an NFT with a datatoken with a dispenser in one call.
|
|
144
155
|
* Be aware if Fixed Rate creation fails, you are still going to pay a lot of gas
|
|
@@ -149,6 +160,7 @@ export declare class NftFactory extends SmartContractWithAddress {
|
|
|
149
160
|
* @returns {Promis<ReceiptOrEstimate<G>>}
|
|
150
161
|
*/
|
|
151
162
|
createNftWithDatatokenWithDispenser<G extends boolean = false>(nftCreateData: NftCreateData, dtParams: DatatokenCreateParams, dispenserParams: DispenserCreationParams, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
163
|
+
createNftWithDatatokenWithDispenserTx(nftCreateData: NftCreateData, dtParams: DatatokenCreateParams, dispenserParams: DispenserCreationParams): Promise<TransactionRequest>;
|
|
152
164
|
/**
|
|
153
165
|
* Gets the parameters required to create an ERC20 token.
|
|
154
166
|
* @param {DatatokenCreateParams} dtParams - The parameters required to create a datatoken.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TransactionRequest } from 'ethers';
|
|
1
2
|
import { Operation, ReceiptOrEstimate, AbiItem } from '../@types/index.js';
|
|
2
3
|
import { SmartContractWithAddress } from './SmartContractWithAddress.js';
|
|
3
4
|
/**
|
|
@@ -14,6 +15,7 @@ export declare class Router extends SmartContractWithAddress {
|
|
|
14
15
|
* @return {Promise<ReceiptOrEstimate>} Transaction receipt
|
|
15
16
|
*/
|
|
16
17
|
buyDatatokenBatch<G extends boolean = false>(operations: Operation[], estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
18
|
+
buyDatatokenBatchTx(operations: Operation[]): Promise<TransactionRequest>;
|
|
17
19
|
/**
|
|
18
20
|
* Checks if a token is on approved tokens list,
|
|
19
21
|
* if true opfFee is lower in pools with that token/DT
|
|
@@ -45,6 +47,7 @@ export declare class Router extends SmartContractWithAddress {
|
|
|
45
47
|
* @return {Promise<ReceiptOrEstimate>}
|
|
46
48
|
*/
|
|
47
49
|
addApprovedToken<G extends boolean = false>(address: string, tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
50
|
+
addApprovedTokenTx(address: string, tokenAddress: string): Promise<TransactionRequest>;
|
|
48
51
|
/**
|
|
49
52
|
* Removes a token if exists from the list of tokens with reduced fees
|
|
50
53
|
* @param {String} address caller address
|
|
@@ -53,6 +56,7 @@ export declare class Router extends SmartContractWithAddress {
|
|
|
53
56
|
* @return {Promise<ReceiptOrEstimate>}
|
|
54
57
|
*/
|
|
55
58
|
removeApprovedToken<G extends boolean = false>(address: string, tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
59
|
+
removeApprovedTokenTx(address: string, tokenAddress: string): Promise<TransactionRequest>;
|
|
56
60
|
/**
|
|
57
61
|
* Adds an address to the list of fixed rate contracts
|
|
58
62
|
* @param {String} address caller address
|
|
@@ -61,6 +65,7 @@ export declare class Router extends SmartContractWithAddress {
|
|
|
61
65
|
* @return {Promise<ReceiptOrEstimate>}
|
|
62
66
|
*/
|
|
63
67
|
addFixedRateContract<G extends boolean = false>(address: string, tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
68
|
+
addFixedRateContractTx(address: string, tokenAddress: string): Promise<TransactionRequest>;
|
|
64
69
|
/**
|
|
65
70
|
* Removes an address from the list of fixed rate contracts
|
|
66
71
|
* @param {String} address caller address
|
|
@@ -69,6 +74,7 @@ export declare class Router extends SmartContractWithAddress {
|
|
|
69
74
|
* @return {Promise<ReceiptOrEstimate>}
|
|
70
75
|
*/
|
|
71
76
|
removeFixedRateContract<G extends boolean = false>(address: string, tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
77
|
+
removeFixedRateContractTx(address: string, tokenAddress: string): Promise<TransactionRequest>;
|
|
72
78
|
/**
|
|
73
79
|
* Adds an address to the list of dispensers
|
|
74
80
|
* @param {String} address caller address
|
|
@@ -77,6 +83,7 @@ export declare class Router extends SmartContractWithAddress {
|
|
|
77
83
|
* @return {Promise<ReceiptOrEstimate>}
|
|
78
84
|
*/
|
|
79
85
|
addDispenserContract<G extends boolean = false>(address: string, tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
86
|
+
addDispenserContractTx(address: string, tokenAddress: string): Promise<TransactionRequest>;
|
|
80
87
|
/**
|
|
81
88
|
* Removes an address from the list of dispensers
|
|
82
89
|
* @param {String} address caller address
|
|
@@ -85,6 +92,7 @@ export declare class Router extends SmartContractWithAddress {
|
|
|
85
92
|
* @return {Promise<ReceiptOrEstimate>}
|
|
86
93
|
*/
|
|
87
94
|
removeDispenserContract<G extends boolean = false>(address: string, tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
95
|
+
removeDispenserContractTx(address: string, tokenAddress: string): Promise<TransactionRequest>;
|
|
88
96
|
/** Get OPF Fee per token
|
|
89
97
|
* @return {Promise<number>} OPC fee for a specific baseToken
|
|
90
98
|
*/
|
|
@@ -104,4 +112,5 @@ export declare class Router extends SmartContractWithAddress {
|
|
|
104
112
|
* @return {Promise<ReceiptOrEstimate>}
|
|
105
113
|
*/
|
|
106
114
|
updateOPCFee<G extends boolean = false>(address: string, newSwapOceanFee: number, newSwapNonOceanFee: number, newConsumeFee: number, newProviderFee: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
115
|
+
updateOPCFeeTx(address: string, newSwapOceanFee: number, newSwapNonOceanFee: number, newConsumeFee: number, newProviderFee: number): Promise<TransactionRequest>;
|
|
107
116
|
}
|
|
@@ -1,45 +1,46 @@
|
|
|
1
|
-
import { type Multiaddr } from '@multiformats/multiaddr';
|
|
2
1
|
import { Signer } from 'ethers';
|
|
3
|
-
import { StorageObject, FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ComputeResultStream, ProviderInitialize, ProviderComputeInitializeResults, ServiceEndpoint, UserCustomParameters, ComputeResourceRequest, ComputeJobMetadata, PolicyServerInitializeCommand, PolicyServerPassthroughCommand, dockerRegistryAuth, DownloadResponse, NodeStatus, NodeComputeJob,
|
|
2
|
+
import { StorageObject, FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ComputeResultStream, ProviderInitialize, ProviderComputeInitializeResults, ServiceEndpoint, UserCustomParameters, ComputeResourceRequest, ComputeJobMetadata, PolicyServerInitializeCommand, PolicyServerPassthroughCommand, dockerRegistryAuth, DownloadResponse, NodeStatus, NodeComputeJob, NodeLogEntry, PersistentStorageAccessList, PersistentStorageBucket, PersistentStorageCreateBucketRequest, PersistentStorageDeleteFileResponse, PersistentStorageFileEntry, PersistentStorageObject, OceanNode, CompleteSignature, SignerOrAuthTokenOrSignature } from '../../@types/index.js';
|
|
4
3
|
import { type DDO, type ValidateMetadata } from '@oceanprotocol/ddo-js';
|
|
5
|
-
import { type P2PConfig, type P2PRequestBodyStream } from './P2pProvider.js';
|
|
4
|
+
import { P2pProvider, type P2PConfig, type P2PRequestBodyStream } from './P2pProvider.js';
|
|
6
5
|
export { OCEAN_P2P_PROTOCOL, type P2PConfig } from './P2pProvider.js';
|
|
7
|
-
export declare function getConsumerAddress(signerOrAuthToken:
|
|
8
|
-
export declare function getSignature(signerOrAuthToken:
|
|
9
|
-
export declare function getAuthorization(signerOrAuthToken:
|
|
10
|
-
export declare function
|
|
6
|
+
export declare function getConsumerAddress(signerOrAuthToken: SignerOrAuthTokenOrSignature): Promise<string>;
|
|
7
|
+
export declare function getSignature(signerOrAuthToken: SignerOrAuthTokenOrSignature, nonce: string, command: string): Promise<string | null>;
|
|
8
|
+
export declare function getAuthorization(signerOrAuthToken: SignerOrAuthTokenOrSignature): string | undefined;
|
|
9
|
+
export declare function isAgentSignature(v: unknown): v is CompleteSignature;
|
|
10
|
+
export declare function isP2pUri(node: OceanNode): boolean;
|
|
11
11
|
export declare class BaseProvider {
|
|
12
12
|
private httpProvider;
|
|
13
13
|
private p2pProvider;
|
|
14
|
-
protected getImpl(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
14
|
+
protected getImpl(node: OceanNode): any;
|
|
15
|
+
getP2PProvider(): P2pProvider;
|
|
16
|
+
getNonce(nodeUri: OceanNode, consumerAddress: string, signal?: AbortSignal, providerEndpoints?: any, serviceEndpoints?: ServiceEndpoint[]): Promise<number>;
|
|
17
|
+
encrypt(data: any, chainId: number, nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, policyServer?: any, signal?: AbortSignal): Promise<string>;
|
|
18
|
+
checkDidFiles(did: string, serviceId: string, nodeUri: OceanNode, withChecksum?: boolean, signal?: AbortSignal): Promise<FileInfo[]>;
|
|
19
|
+
getFileInfo(file: StorageObject, nodeUri: OceanNode, withChecksum?: boolean, signal?: AbortSignal): Promise<FileInfo[]>;
|
|
20
|
+
getComputeEnvironments(nodeUri: OceanNode, signal?: AbortSignal): Promise<ComputeEnvironment[]>;
|
|
21
|
+
initialize(did: string, serviceId: string, fileIndex: number, consumerAddress: string, nodeUri: OceanNode, signal?: AbortSignal, userCustomParameters?: UserCustomParameters, computeEnv?: string, validUntil?: number): Promise<ProviderInitialize>;
|
|
22
|
+
initializeCompute(assets: ComputeAsset[], algorithm: ComputeAlgorithm, computeEnv: string, token: string, validUntil: number, nodeUri: OceanNode, consumerAddress: string, resources: ComputeResourceRequest[], chainId: number, policyServer?: any, signal?: AbortSignal, queueMaxWaitTime?: number, dockerRegistryAuthData?: dockerRegistryAuth, output?: ComputeOutput): Promise<ProviderComputeInitializeResults>;
|
|
23
|
+
getDownloadUrl(did: string, serviceId: string, fileIndex: number, transferTxId: string, nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, policyServer?: any, userCustomParameters?: UserCustomParameters): Promise<string | DownloadResponse>;
|
|
24
|
+
computeStart(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, computeEnv: string, datasets: ComputeAsset[], algorithm: ComputeAlgorithm, maxJobDuration: number, token: string, resources: ComputeResourceRequest[], chainId: number, metadata?: ComputeJobMetadata, additionalViewers?: string[], output?: ComputeOutput, policyServer?: any, signal?: AbortSignal, queueMaxWaitTime?: number, dockerRegistryAuth?: dockerRegistryAuth): Promise<ComputeJob | ComputeJob[]>;
|
|
25
|
+
freeComputeStart(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, computeEnv: string, datasets: ComputeAsset[], algorithm: ComputeAlgorithm, resources?: ComputeResourceRequest[], metadata?: ComputeJobMetadata, additionalViewers?: string[], output?: ComputeOutput, policyServer?: any, signal?: AbortSignal, queueMaxWaitTime?: number, dockerRegistryAuth?: dockerRegistryAuth): Promise<ComputeJob | ComputeJob[]>;
|
|
26
|
+
computeStreamableLogs(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, jobId: string, signal?: AbortSignal): Promise<any>;
|
|
27
|
+
computeStop(jobId: string, nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, agreementId?: string, signal?: AbortSignal): Promise<ComputeJob | ComputeJob[]>;
|
|
28
|
+
computeStatus(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, jobId?: string, agreementId?: string, signal?: AbortSignal): Promise<ComputeJob | ComputeJob[]>;
|
|
29
|
+
getComputeResultUrl(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, jobId: string, index: number): Promise<string>;
|
|
30
|
+
getComputeResult(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, jobId: string, index: number, offset?: number): Promise<ComputeResultStream>;
|
|
31
|
+
generateAuthToken(consumer: Signer, nodeUri: OceanNode, signal?: AbortSignal): Promise<string>;
|
|
32
|
+
generateSignedAuthToken(address: string, signature: string, nonce: string, nodeUri: OceanNode, signal?: AbortSignal): Promise<string>;
|
|
33
|
+
invalidateAuthToken(consumer: Signer, token: string, nodeUri: OceanNode, signal?: AbortSignal): Promise<{
|
|
33
34
|
success: boolean;
|
|
34
35
|
}>;
|
|
35
|
-
resolveDdo(nodeUri:
|
|
36
|
-
validateDdo(nodeUri:
|
|
37
|
-
isValidProvider(url:
|
|
38
|
-
PolicyServerPassthrough(nodeUri:
|
|
39
|
-
initializePSVerification(nodeUri:
|
|
40
|
-
downloadNodeLogs(nodeUri:
|
|
41
|
-
getNodeStatus(nodeUri:
|
|
42
|
-
getNodeJobs(nodeUri:
|
|
36
|
+
resolveDdo(nodeUri: OceanNode, did: string, signal?: AbortSignal): Promise<any>;
|
|
37
|
+
validateDdo(nodeUri: OceanNode, ddo: DDO, signerOrAuthToken: SignerOrAuthTokenOrSignature, signal?: AbortSignal): Promise<ValidateMetadata>;
|
|
38
|
+
isValidProvider(url: OceanNode, signal?: AbortSignal): Promise<boolean>;
|
|
39
|
+
PolicyServerPassthrough(nodeUri: OceanNode, request: PolicyServerPassthroughCommand, signal?: AbortSignal): Promise<any>;
|
|
40
|
+
initializePSVerification(nodeUri: OceanNode, request: PolicyServerInitializeCommand, signal?: AbortSignal): Promise<any>;
|
|
41
|
+
downloadNodeLogs(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, startTime: string, endTime: string, maxLogs?: number, moduleName?: string, level?: string, page?: number, signal?: AbortSignal): Promise<NodeLogEntry[]>;
|
|
42
|
+
getNodeStatus(nodeUri: OceanNode, signal?: AbortSignal): Promise<NodeStatus>;
|
|
43
|
+
getNodeJobs(nodeUri: OceanNode, fromTimestamp?: number, signal?: AbortSignal): Promise<NodeComputeJob[]>;
|
|
43
44
|
setupP2P(config: P2PConfig): Promise<void>;
|
|
44
45
|
getLibp2pNode(): import("libp2p").Libp2p<import("@libp2p/interface").ServiceMap>;
|
|
45
46
|
getDiscoveredNodes(): Promise<Array<{
|
|
@@ -47,21 +48,16 @@ export declare class BaseProvider {
|
|
|
47
48
|
multiaddrs: string[];
|
|
48
49
|
}>>;
|
|
49
50
|
getMultiaddrFromPeerId(peerId: string): Promise<string>;
|
|
50
|
-
|
|
51
|
-
* Fetch node logs via P2P with a pre-signed payload.
|
|
52
|
-
* For auto-signed log fetching (HTTP or P2P), use downloadNodeLogs().
|
|
53
|
-
*/
|
|
54
|
-
fetchNodeLogs(nodeUri: string | Multiaddr[], address: string, signature: string, nonce: string, logParams?: NodeLogsParams): Promise<NodeLogEntry[]>;
|
|
55
|
-
createPersistentStorageBucket(nodeUri: string | Multiaddr[], signerOrAuthToken: Signer | string, payload: PersistentStorageCreateBucketRequest, signal?: AbortSignal): Promise<{
|
|
51
|
+
createPersistentStorageBucket(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, payload: PersistentStorageCreateBucketRequest, signal?: AbortSignal): Promise<{
|
|
56
52
|
bucketId: string;
|
|
57
53
|
owner: string;
|
|
58
54
|
accessList: PersistentStorageAccessList[];
|
|
59
55
|
}>;
|
|
60
|
-
getPersistentStorageBuckets(nodeUri:
|
|
61
|
-
listPersistentStorageFiles(nodeUri:
|
|
62
|
-
getPersistentStorageFileObject(nodeUri:
|
|
63
|
-
uploadPersistentStorageFile(nodeUri:
|
|
64
|
-
deletePersistentStorageFile(nodeUri:
|
|
65
|
-
fetchConfig(nodeUri:
|
|
66
|
-
pushConfig(nodeUri:
|
|
56
|
+
getPersistentStorageBuckets(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, owner: string, signal?: AbortSignal): Promise<PersistentStorageBucket[]>;
|
|
57
|
+
listPersistentStorageFiles(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, bucketId: string, signal?: AbortSignal): Promise<PersistentStorageFileEntry[]>;
|
|
58
|
+
getPersistentStorageFileObject(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, bucketId: string, fileName: string, signal?: AbortSignal): Promise<PersistentStorageObject>;
|
|
59
|
+
uploadPersistentStorageFile(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, bucketId: string, fileName: string, content: P2PRequestBodyStream, signal?: AbortSignal): Promise<PersistentStorageFileEntry>;
|
|
60
|
+
deletePersistentStorageFile(nodeUri: OceanNode, signerOrAuthToken: SignerOrAuthTokenOrSignature, bucketId: string, fileName: string, signal?: AbortSignal): Promise<PersistentStorageDeleteFileResponse>;
|
|
61
|
+
fetchConfig(nodeUri: OceanNode, payload: Record<string, any>): Promise<any>;
|
|
62
|
+
pushConfig(nodeUri: OceanNode, payload: Record<string, any>): Promise<any>;
|
|
67
63
|
}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Signer } from 'ethers';
|
|
2
|
-
import { StorageObject, FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ProviderInitialize, ProviderComputeInitializeResults, ServiceEndpoint, UserCustomParameters, ComputeResourceRequest, ComputeJobMetadata, PolicyServerInitializeCommand, PolicyServerPassthroughCommand, dockerRegistryAuth, ComputeResultStream, NodeStatus, NodeComputeJob, NodeLogEntry, PersistentStorageAccessList, PersistentStorageBucket, PersistentStorageCreateBucketRequest, PersistentStorageDeleteFileResponse, PersistentStorageFileEntry, PersistentStorageObject } from '../../@types/index.js';
|
|
2
|
+
import { StorageObject, FileInfo, ComputeJob, ComputeOutput, ComputeAlgorithm, ComputeAsset, ComputeEnvironment, ProviderInitialize, ProviderComputeInitializeResults, ServiceEndpoint, UserCustomParameters, ComputeResourceRequest, ComputeJobMetadata, PolicyServerInitializeCommand, PolicyServerPassthroughCommand, dockerRegistryAuth, ComputeResultStream, NodeStatus, NodeComputeJob, NodeLogEntry, PersistentStorageAccessList, PersistentStorageBucket, PersistentStorageCreateBucketRequest, PersistentStorageDeleteFileResponse, PersistentStorageFileEntry, PersistentStorageObject, SignerOrAuthTokenOrSignature } from '../../@types/index.js';
|
|
3
3
|
import { type DDO, type ValidateMetadata } from '@oceanprotocol/ddo-js';
|
|
4
4
|
import { type P2PRequestBodyStream } from './P2pProvider.js';
|
|
5
5
|
export declare class HttpProvider {
|
|
6
|
-
protected
|
|
7
|
-
|
|
8
|
-
protected getAuthorization(s: Signer | string): string;
|
|
9
|
-
private getPersistentStorageSignaturePayload;
|
|
6
|
+
protected getAuthorization(s: SignerOrAuthTokenOrSignature): string;
|
|
7
|
+
private getSignedCommandParams;
|
|
10
8
|
private resolvePersistentStorageRoute;
|
|
11
9
|
/**
|
|
12
10
|
* Returns the provider endpoints
|
|
@@ -53,7 +51,7 @@ export declare class HttpProvider {
|
|
|
53
51
|
* @param {AbortSignal} signal abort signal
|
|
54
52
|
* @return {Promise<string>} urlDetails
|
|
55
53
|
*/
|
|
56
|
-
encrypt(data: any, chainId: number, nodeUri: string, signerOrAuthToken:
|
|
54
|
+
encrypt(data: any, chainId: number, nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, policyServer?: any, signal?: AbortSignal): Promise<string>;
|
|
57
55
|
/**
|
|
58
56
|
* Get file details for a given DID and service ID.
|
|
59
57
|
* @param {string} did - The DID to check.
|
|
@@ -122,7 +120,7 @@ export declare class HttpProvider {
|
|
|
122
120
|
* @param {UserCustomParameters} userCustomParameters - The user custom parameters.
|
|
123
121
|
* @returns {Promise<any>} The download URL.
|
|
124
122
|
*/
|
|
125
|
-
getDownloadUrl(did: string, serviceId: string, fileIndex: number, transferTxId: string, nodeUri: string, signerOrAuthToken:
|
|
123
|
+
getDownloadUrl(did: string, serviceId: string, fileIndex: number, transferTxId: string, nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, policyServer?: any, userCustomParameters?: UserCustomParameters): Promise<any>;
|
|
126
124
|
/** Instruct the provider to start a PAYED compute job
|
|
127
125
|
* @param {string} nodeUri The provider URI.
|
|
128
126
|
* @param {SignerOrAuthToken} signerOrAuthToken The consumer signer object or auth token.
|
|
@@ -141,7 +139,7 @@ export declare class HttpProvider {
|
|
|
141
139
|
* @param {dockerRegistryAuth} dockerRegistryAuth Docker registry authentication data.
|
|
142
140
|
* @return {Promise<ComputeJob | ComputeJob[]>} The compute job or jobs.
|
|
143
141
|
*/
|
|
144
|
-
computeStart(nodeUri: string, signerOrAuthToken:
|
|
142
|
+
computeStart(nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, computeEnv: string, datasets: ComputeAsset[], algorithm: ComputeAlgorithm, maxJobDuration: number, token: string, resources: ComputeResourceRequest[], chainId: number, metadata?: ComputeJobMetadata, additionalViewers?: string[], output?: ComputeOutput, policyServer?: any, signal?: AbortSignal, queueMaxWaitTime?: number, dockerRegistryAuth?: dockerRegistryAuth): Promise<ComputeJob | ComputeJob[]>;
|
|
145
143
|
/** Instruct the provider to start a FREE compute job
|
|
146
144
|
* @param {string} nodeUri The provider URI.
|
|
147
145
|
* @param {SignerOrAuthToken} signerOrAuthToken The consumer signer object or auth token.
|
|
@@ -157,7 +155,7 @@ export declare class HttpProvider {
|
|
|
157
155
|
* @param {dockerRegistryAuth} dockerRegistryAuth Docker registry authentication data.
|
|
158
156
|
* @return {Promise<ComputeJob | ComputeJob[]>} The compute job or jobs.
|
|
159
157
|
*/
|
|
160
|
-
freeComputeStart(nodeUri: string, signerOrAuthToken:
|
|
158
|
+
freeComputeStart(nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, computeEnv: string, datasets: ComputeAsset[], algorithm: ComputeAlgorithm, resources?: ComputeResourceRequest[], metadata?: ComputeJobMetadata, additionalViewers?: string[], output?: ComputeOutput, policyServer?: any, signal?: AbortSignal, queueMaxWaitTime?: number, dockerRegistryAuth?: dockerRegistryAuth): Promise<ComputeJob | ComputeJob[]>;
|
|
161
159
|
/**
|
|
162
160
|
* @param nodeUri provider URL
|
|
163
161
|
* @param signerOrAuthToken signer or auth token
|
|
@@ -165,7 +163,7 @@ export declare class HttpProvider {
|
|
|
165
163
|
* @param signal abort signal
|
|
166
164
|
* @returns logs response
|
|
167
165
|
*/
|
|
168
|
-
computeStreamableLogs(nodeUri: string, signerOrAuthToken:
|
|
166
|
+
computeStreamableLogs(nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, jobId: string, signal?: AbortSignal): Promise<any>;
|
|
169
167
|
/** Instruct the provider to Stop the execution of a to stop a compute job.
|
|
170
168
|
* @param {string} jobId the compute job id
|
|
171
169
|
* @param {string} nodeUri The provider URI.
|
|
@@ -174,7 +172,7 @@ export declare class HttpProvider {
|
|
|
174
172
|
* @param {AbortSignal} signal abort signal
|
|
175
173
|
* @return {Promise<ComputeJob | ComputeJob[]>}
|
|
176
174
|
*/
|
|
177
|
-
computeStop(jobId: string, nodeUri: string, signerOrAuthToken:
|
|
175
|
+
computeStop(jobId: string, nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, agreementId?: string, signal?: AbortSignal): Promise<ComputeJob | ComputeJob[]>;
|
|
178
176
|
/** Get compute status for a specific jobId/documentId/owner.
|
|
179
177
|
* @param {string} nodeUri The URI of the provider we want to query
|
|
180
178
|
* @param {string} consumerAddress The consumer ethereum address
|
|
@@ -183,7 +181,7 @@ export declare class HttpProvider {
|
|
|
183
181
|
* @param {AbortSignal} signal abort signal
|
|
184
182
|
* @return {Promise<ComputeJob | ComputeJob[]>}
|
|
185
183
|
*/
|
|
186
|
-
computeStatus(nodeUri: string, signerOrAuthToken:
|
|
184
|
+
computeStatus(nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, jobId?: string, agreementId?: string, signal?: AbortSignal): Promise<ComputeJob | ComputeJob[]>;
|
|
187
185
|
/** Get compute result url
|
|
188
186
|
* @param {string} nodeUri The URI of the provider we want to query
|
|
189
187
|
* @param {SignerOrAuthToken} signerOrAuthToken signer or auth token
|
|
@@ -191,8 +189,8 @@ export declare class HttpProvider {
|
|
|
191
189
|
* @param {number} index Result index
|
|
192
190
|
* @return {Promise<string>}
|
|
193
191
|
*/
|
|
194
|
-
getComputeResultUrl(nodeUri: string, signerOrAuthToken:
|
|
195
|
-
getComputeResult(nodeUri: string, signerOrAuthToken:
|
|
192
|
+
getComputeResultUrl(nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, jobId: string, index: number): Promise<string>;
|
|
193
|
+
getComputeResult(nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, jobId: string, index: number, offset?: number): Promise<ComputeResultStream>;
|
|
196
194
|
/** Generates an auth token
|
|
197
195
|
* @param {Signer} consumer consumer Signer wallet object
|
|
198
196
|
* @param {string} nodeUri The URI of the provider we want to query
|
|
@@ -241,21 +239,21 @@ export declare class HttpProvider {
|
|
|
241
239
|
* @param {AbortSignal} [signal] - An optional abort signal.
|
|
242
240
|
* @returns {Promise<any>} The logs response body stream.
|
|
243
241
|
*/
|
|
244
|
-
downloadNodeLogs(nodeUri: string,
|
|
242
|
+
downloadNodeLogs(nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, startTime: string, endTime: string, maxLogs?: number, moduleName?: string, level?: string, page?: number, signal?: AbortSignal): Promise<NodeLogEntry[]>;
|
|
245
243
|
private noZeroX;
|
|
246
244
|
private zeroXTransformer;
|
|
247
245
|
private inputMatch;
|
|
248
246
|
resolveDdo(nodeUri: string, did: string, signal?: AbortSignal): Promise<any>;
|
|
249
|
-
validateDdo(nodeUri: string, ddo: DDO,
|
|
247
|
+
validateDdo(nodeUri: string, ddo: DDO, signerOrAuthToken: SignerOrAuthTokenOrSignature, signal?: AbortSignal): Promise<ValidateMetadata>;
|
|
250
248
|
private getData;
|
|
251
|
-
createPersistentStorageBucket(nodeUri: string, signerOrAuthToken:
|
|
249
|
+
createPersistentStorageBucket(nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, payload: PersistentStorageCreateBucketRequest, signal?: AbortSignal): Promise<{
|
|
252
250
|
bucketId: string;
|
|
253
251
|
owner: string;
|
|
254
252
|
accessList: PersistentStorageAccessList[];
|
|
255
253
|
}>;
|
|
256
|
-
getPersistentStorageBuckets(nodeUri: string, signerOrAuthToken:
|
|
257
|
-
listPersistentStorageFiles(nodeUri: string, signerOrAuthToken:
|
|
258
|
-
getPersistentStorageFileObject(nodeUri: string, signerOrAuthToken:
|
|
259
|
-
uploadPersistentStorageFile(nodeUri: string, signerOrAuthToken:
|
|
260
|
-
deletePersistentStorageFile(nodeUri: string, signerOrAuthToken:
|
|
254
|
+
getPersistentStorageBuckets(nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, owner: string, signal?: AbortSignal): Promise<PersistentStorageBucket[]>;
|
|
255
|
+
listPersistentStorageFiles(nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, bucketId: string, signal?: AbortSignal): Promise<PersistentStorageFileEntry[]>;
|
|
256
|
+
getPersistentStorageFileObject(nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, bucketId: string, fileName: string, signal?: AbortSignal): Promise<PersistentStorageObject>;
|
|
257
|
+
uploadPersistentStorageFile(nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, bucketId: string, fileName: string, content: P2PRequestBodyStream, signal?: AbortSignal): Promise<PersistentStorageFileEntry>;
|
|
258
|
+
deletePersistentStorageFile(nodeUri: string, signerOrAuthToken: SignerOrAuthTokenOrSignature, bucketId: string, fileName: string, signal?: AbortSignal): Promise<PersistentStorageDeleteFileResponse>;
|
|
261
259
|
}
|