@oceanprotocol/lib 3.0.4 → 3.1.1

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.
Files changed (82) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/lib.js +1 -1
  3. package/dist/lib.js.map +1 -1
  4. package/dist/lib.modern.js +1 -1
  5. package/dist/lib.modern.js.map +1 -1
  6. package/dist/lib.module.js +1 -1
  7. package/dist/lib.module.js.map +1 -1
  8. package/dist/lib.umd.js +1 -1
  9. package/dist/lib.umd.js.map +1 -1
  10. package/dist/src/@types/Asset.d.ts +148 -148
  11. package/dist/src/@types/Compute.d.ts +71 -71
  12. package/dist/src/@types/Contracts.d.ts +26 -26
  13. package/dist/src/@types/DDO/ConsumerParameter.d.ts +37 -37
  14. package/dist/src/@types/DDO/Credentials.d.ts +8 -8
  15. package/dist/src/@types/DDO/DDO.d.ts +55 -55
  16. package/dist/src/@types/DDO/Event.d.ts +27 -27
  17. package/dist/src/@types/DDO/Metadata.d.ts +141 -141
  18. package/dist/src/@types/DDO/Service.d.ts +100 -100
  19. package/dist/src/@types/Datatoken.d.ts +38 -38
  20. package/dist/src/@types/Dispenser.d.ts +16 -16
  21. package/dist/src/@types/DownloadResponse.d.ts +4 -4
  22. package/dist/src/@types/File.d.ts +89 -89
  23. package/dist/src/@types/FileInfo.d.ts +43 -43
  24. package/dist/src/@types/FixedPrice.d.ts +51 -51
  25. package/dist/src/@types/NFT.d.ts +18 -18
  26. package/dist/src/@types/NFTFactory.d.ts +20 -20
  27. package/dist/src/@types/Provider.d.ts +33 -33
  28. package/dist/src/@types/ReturnTypes.d.ts +3 -3
  29. package/dist/src/@types/Router.d.ts +59 -59
  30. package/dist/src/@types/index.d.ts +20 -20
  31. package/dist/src/config/Config.d.ts +153 -153
  32. package/dist/src/config/ConfigHelper.d.ts +12 -12
  33. package/dist/src/config/index.d.ts +2 -2
  34. package/dist/src/contracts/Datatoken.d.ts +278 -260
  35. package/dist/src/contracts/Dispenser.d.ts +73 -73
  36. package/dist/src/contracts/FixedRateExchange.d.ts +209 -209
  37. package/dist/src/contracts/NFT.d.ts +220 -220
  38. package/dist/src/contracts/NFTFactory.d.ts +165 -165
  39. package/dist/src/contracts/Router.d.ts +107 -107
  40. package/dist/src/contracts/SmartContract.d.ts +45 -45
  41. package/dist/src/contracts/SmartContractWithAddress.d.ts +17 -17
  42. package/dist/src/contracts/df/DfRewards.d.ts +31 -31
  43. package/dist/src/contracts/df/DfStrategyV1.d.ts +21 -21
  44. package/dist/src/contracts/index.d.ts +14 -14
  45. package/dist/src/contracts/ve/VeAllocate.d.ts +38 -38
  46. package/dist/src/contracts/ve/VeFeeDistributor.d.ts +29 -29
  47. package/dist/src/contracts/ve/VeFeeEstimate.d.ts +14 -14
  48. package/dist/src/contracts/ve/VeOcean.d.ts +68 -68
  49. package/dist/src/index.d.ts +5 -5
  50. package/dist/src/services/Aquarius.d.ts +53 -53
  51. package/dist/src/services/Provider.d.ts +197 -197
  52. package/dist/src/services/index.d.ts +2 -2
  53. package/dist/src/utils/Constants.d.ts +4 -4
  54. package/dist/src/utils/ContractUtils.d.ts +46 -46
  55. package/dist/src/utils/DatatokenName.d.ts +14 -14
  56. package/dist/src/utils/DdoHelpers.d.ts +13 -13
  57. package/dist/src/utils/FetchHelper.d.ts +14 -14
  58. package/dist/src/utils/General.d.ts +5 -5
  59. package/dist/src/utils/Logger.d.ts +19 -19
  60. package/dist/src/utils/OrderUtils.d.ts +20 -0
  61. package/dist/src/utils/ProviderErrors.d.ts +1 -1
  62. package/dist/src/utils/SignatureUtils.d.ts +12 -12
  63. package/dist/src/utils/TokenUtils.d.ts +70 -70
  64. package/dist/src/utils/index.d.ts +12 -11
  65. package/dist/src/utils/minAbi.d.ts +38 -38
  66. package/dist/test/config.d.ts +19 -19
  67. package/dist/test/integration/CodeExamples.test.d.ts +1 -1
  68. package/dist/test/integration/ComputeExamples.test.d.ts +1 -1
  69. package/dist/test/integration/ComputeFlow.test.d.ts +1 -1
  70. package/dist/test/integration/Provider.test.d.ts +1 -1
  71. package/dist/test/integration/PublishEditConsume.test.d.ts +1 -1
  72. package/dist/test/integration/PublishFlows.test.d.ts +1 -1
  73. package/dist/test/integration/helpers.d.ts +7 -7
  74. package/dist/test/unit/DFRewards.test.d.ts +1 -1
  75. package/dist/test/unit/Datatoken.test.d.ts +1 -1
  76. package/dist/test/unit/Dispenser.test.d.ts +1 -1
  77. package/dist/test/unit/FixedRateExchange.test.d.ts +1 -1
  78. package/dist/test/unit/Nft.test.d.ts +1 -1
  79. package/dist/test/unit/NftFactory.test.d.ts +1 -1
  80. package/dist/test/unit/Router.test.d.ts +1 -1
  81. package/dist/test/unit/veOcean.test.d.ts +1 -1
  82. package/package.json +5 -5
@@ -1,148 +1,148 @@
1
- import { DDO } from '.';
2
- export interface AssetNft {
3
- /**
4
- * Contract address of the deployed ERC721 NFT contract.
5
- * @type {string}
6
- */
7
- address: string;
8
- /**
9
- * Name of NFT set in contract.
10
- * @type {string}
11
- */
12
- name: string;
13
- /**
14
- * Symbol of NFT set in contract.
15
- * @type {string}
16
- */
17
- symbol: string;
18
- /**
19
- * ETH account address of the NFT owner.
20
- * @type {string}
21
- */
22
- owner: string;
23
- /**
24
- * State of the asset reflecting the NFT contract value.
25
- * 0 Active.
26
- * 1 End-of-life.
27
- * 2 Deprecated (by another asset).
28
- * 3 Revoked by publisher.
29
- * 4 Ordering is temporary disabled.
30
- * 5 Unlisted in markets.
31
- * @type {number}
32
- */
33
- state: 0 | 1 | 2 | 3 | 4 | 5;
34
- /**
35
- * Contains the date of NFT creation.
36
- * @type {string}
37
- */
38
- created: string;
39
- /**
40
- * NFT token URI.
41
- * @type {string}
42
- */
43
- tokenURI: string;
44
- }
45
- export interface Purgatory {
46
- /**
47
- * If `true`, asset is in purgatory.
48
- * @type {boolean}
49
- */
50
- state: boolean;
51
- /**
52
- * If asset is in purgatory, contains the reason for being there as defined in `list-purgatory`.
53
- * @type {string}
54
- */
55
- reason: string;
56
- }
57
- export interface AssetDatatoken {
58
- /**
59
- * Contract address of the deployed Datatoken contract.
60
- * @type {string}
61
- */
62
- address: string;
63
- /**
64
- * Name of NFT set in contract.
65
- * @type {string}
66
- */
67
- name: string;
68
- /**
69
- * Symbol of NFT set in contract.
70
- * @type {string}
71
- */
72
- symbol: string;
73
- /**
74
- * ID of the service the datatoken is attached to.
75
- * @type {string}
76
- */
77
- serviceId: string;
78
- }
79
- export interface AssetPrice {
80
- /**
81
- * The price of the asset expressed as a number. If 0 then the price is FREE.
82
- * @type {number}
83
- */
84
- value: number;
85
- /**
86
- * The symbol that the price of the asset is expressed in.
87
- * @type {string}
88
- */
89
- tokenSymbol?: string;
90
- /**
91
- * The address of the token that the price needs to be paid in.
92
- * @type {string}
93
- */
94
- tokenAddress?: string;
95
- }
96
- export interface Stats {
97
- /**
98
- * How often an asset was consumed, meaning how often it was either downloaded or used as part of a compute job.
99
- * @type {number}
100
- */
101
- orders: number;
102
- /**
103
- * Contains information about the price of this asset.
104
- * @type {AssetPrice}
105
- */
106
- price: AssetPrice;
107
- /**
108
- * Total amount of veOCEAN allocated on this asset.
109
- * @type {number}
110
- */
111
- allocated?: number;
112
- }
113
- export interface AssetLastEvent {
114
- tx: string;
115
- block: number;
116
- from: string;
117
- contract: string;
118
- datetime: string;
119
- }
120
- export interface Asset extends DDO {
121
- /**
122
- * Contains information about the ERC721 NFT contract which represents the intellectual property of the publisher.
123
- * @type {string}
124
- */
125
- nft: AssetNft;
126
- /**
127
- * Contains information about the ERC20 Datatokens attached to asset services.
128
- * @type {string}
129
- */
130
- datatokens: AssetDatatoken[];
131
- /**
132
- * Contains information about the last transaction that created or updated the DDO.
133
- * @type {string}
134
- */
135
- event: AssetLastEvent;
136
- /**
137
- * The stats section contains different statistics fields. This section is added by Aquarius
138
- * @type {Stats}
139
- */
140
- stats: Stats;
141
- /**
142
- * Contains information about an asset's purgatory status defined in
143
- * [`list-purgatory`](https://github.com/oceanprotocol/list-purgatory).
144
- * Marketplace interfaces are encouraged to prevent certain user actions like downloading on assets in purgatory.
145
- * @type {Purgatory}
146
- */
147
- purgatory: Purgatory;
148
- }
1
+ import { DDO } from '.';
2
+ export interface AssetNft {
3
+ /**
4
+ * Contract address of the deployed ERC721 NFT contract.
5
+ * @type {string}
6
+ */
7
+ address: string;
8
+ /**
9
+ * Name of NFT set in contract.
10
+ * @type {string}
11
+ */
12
+ name: string;
13
+ /**
14
+ * Symbol of NFT set in contract.
15
+ * @type {string}
16
+ */
17
+ symbol: string;
18
+ /**
19
+ * ETH account address of the NFT owner.
20
+ * @type {string}
21
+ */
22
+ owner: string;
23
+ /**
24
+ * State of the asset reflecting the NFT contract value.
25
+ * 0 Active.
26
+ * 1 End-of-life.
27
+ * 2 Deprecated (by another asset).
28
+ * 3 Revoked by publisher.
29
+ * 4 Ordering is temporary disabled.
30
+ * 5 Unlisted in markets.
31
+ * @type {number}
32
+ */
33
+ state: 0 | 1 | 2 | 3 | 4 | 5;
34
+ /**
35
+ * Contains the date of NFT creation.
36
+ * @type {string}
37
+ */
38
+ created: string;
39
+ /**
40
+ * NFT token URI.
41
+ * @type {string}
42
+ */
43
+ tokenURI: string;
44
+ }
45
+ export interface Purgatory {
46
+ /**
47
+ * If `true`, asset is in purgatory.
48
+ * @type {boolean}
49
+ */
50
+ state: boolean;
51
+ /**
52
+ * If asset is in purgatory, contains the reason for being there as defined in `list-purgatory`.
53
+ * @type {string}
54
+ */
55
+ reason: string;
56
+ }
57
+ export interface AssetDatatoken {
58
+ /**
59
+ * Contract address of the deployed Datatoken contract.
60
+ * @type {string}
61
+ */
62
+ address: string;
63
+ /**
64
+ * Name of NFT set in contract.
65
+ * @type {string}
66
+ */
67
+ name: string;
68
+ /**
69
+ * Symbol of NFT set in contract.
70
+ * @type {string}
71
+ */
72
+ symbol: string;
73
+ /**
74
+ * ID of the service the datatoken is attached to.
75
+ * @type {string}
76
+ */
77
+ serviceId: string;
78
+ }
79
+ export interface AssetPrice {
80
+ /**
81
+ * The price of the asset expressed as a number. If 0 then the price is FREE.
82
+ * @type {number}
83
+ */
84
+ value: number;
85
+ /**
86
+ * The symbol that the price of the asset is expressed in.
87
+ * @type {string}
88
+ */
89
+ tokenSymbol?: string;
90
+ /**
91
+ * The address of the token that the price needs to be paid in.
92
+ * @type {string}
93
+ */
94
+ tokenAddress?: string;
95
+ }
96
+ export interface Stats {
97
+ /**
98
+ * How often an asset was consumed, meaning how often it was either downloaded or used as part of a compute job.
99
+ * @type {number}
100
+ */
101
+ orders: number;
102
+ /**
103
+ * Contains information about the price of this asset.
104
+ * @type {AssetPrice}
105
+ */
106
+ price: AssetPrice;
107
+ /**
108
+ * Total amount of veOCEAN allocated on this asset.
109
+ * @type {number}
110
+ */
111
+ allocated?: number;
112
+ }
113
+ export interface AssetLastEvent {
114
+ tx: string;
115
+ block: number;
116
+ from: string;
117
+ contract: string;
118
+ datetime: string;
119
+ }
120
+ export interface Asset extends DDO {
121
+ /**
122
+ * Contains information about the ERC721 NFT contract which represents the intellectual property of the publisher.
123
+ * @type {string}
124
+ */
125
+ nft: AssetNft;
126
+ /**
127
+ * Contains information about the ERC20 Datatokens attached to asset services.
128
+ * @type {string}
129
+ */
130
+ datatokens: AssetDatatoken[];
131
+ /**
132
+ * Contains information about the last transaction that created or updated the DDO.
133
+ * @type {string}
134
+ */
135
+ event: AssetLastEvent;
136
+ /**
137
+ * The stats section contains different statistics fields. This section is added by Aquarius
138
+ * @type {Stats}
139
+ */
140
+ stats: Stats;
141
+ /**
142
+ * Contains information about an asset's purgatory status defined in
143
+ * [`list-purgatory`](https://github.com/oceanprotocol/list-purgatory).
144
+ * Marketplace interfaces are encouraged to prevent certain user actions like downloading on assets in purgatory.
145
+ * @type {Purgatory}
146
+ */
147
+ purgatory: Purgatory;
148
+ }
@@ -1,71 +1,71 @@
1
- import { Metadata, MetadataAlgorithm } from '.';
2
- export declare type ComputeResultType = 'algorithmLog' | 'output' | 'configrationLog' | 'publishLog';
3
- export interface ComputeEnvironment {
4
- id: string;
5
- cpuNumber: number;
6
- cpuType: string;
7
- gpuNumber: number;
8
- gpuType: string;
9
- ramGB: number;
10
- diskGB: number;
11
- priceMin: number;
12
- desc: string;
13
- currentJobs: number;
14
- maxJobs: number;
15
- consumerAddress: string;
16
- storageExpiry: number;
17
- maxJobDuration: number;
18
- lastSeen: number;
19
- }
20
- export interface ComputeResult {
21
- filename: string;
22
- filesize: number;
23
- type: ComputeResultType;
24
- index?: number;
25
- }
26
- export interface ComputeJob {
27
- owner: string;
28
- did?: string;
29
- jobId: string;
30
- dateCreated: string;
31
- dateFinished: string;
32
- status: number;
33
- statusText: string;
34
- results: ComputeResult[];
35
- inputDID?: string[];
36
- algoDID?: string;
37
- agreementId?: string;
38
- expireTimestamp: number;
39
- }
40
- export interface ComputeOutput {
41
- publishAlgorithmLog?: boolean;
42
- publishOutput?: boolean;
43
- providerAddress?: string;
44
- providerUri?: string;
45
- metadata?: Metadata;
46
- metadataUri?: string;
47
- nodeUri?: string;
48
- owner?: string;
49
- secretStoreUri?: string;
50
- whitelist?: string[];
51
- }
52
- export interface ComputeAsset {
53
- documentId: string;
54
- serviceId: string;
55
- transferTxId?: string;
56
- userdata?: {
57
- [key: string]: any;
58
- };
59
- }
60
- export interface ComputeAlgorithm {
61
- documentId?: string;
62
- serviceId?: string;
63
- meta?: MetadataAlgorithm;
64
- transferTxId?: string;
65
- algocustomdata?: {
66
- [key: string]: any;
67
- };
68
- userdata?: {
69
- [key: string]: any;
70
- };
71
- }
1
+ import { Metadata, MetadataAlgorithm } from '.';
2
+ export type ComputeResultType = 'algorithmLog' | 'output' | 'configrationLog' | 'publishLog';
3
+ export interface ComputeEnvironment {
4
+ id: string;
5
+ cpuNumber: number;
6
+ cpuType: string;
7
+ gpuNumber: number;
8
+ gpuType: string;
9
+ ramGB: number;
10
+ diskGB: number;
11
+ priceMin: number;
12
+ desc: string;
13
+ currentJobs: number;
14
+ maxJobs: number;
15
+ consumerAddress: string;
16
+ storageExpiry: number;
17
+ maxJobDuration: number;
18
+ lastSeen: number;
19
+ }
20
+ export interface ComputeResult {
21
+ filename: string;
22
+ filesize: number;
23
+ type: ComputeResultType;
24
+ index?: number;
25
+ }
26
+ export interface ComputeJob {
27
+ owner: string;
28
+ did?: string;
29
+ jobId: string;
30
+ dateCreated: string;
31
+ dateFinished: string;
32
+ status: number;
33
+ statusText: string;
34
+ results: ComputeResult[];
35
+ inputDID?: string[];
36
+ algoDID?: string;
37
+ agreementId?: string;
38
+ expireTimestamp: number;
39
+ }
40
+ export interface ComputeOutput {
41
+ publishAlgorithmLog?: boolean;
42
+ publishOutput?: boolean;
43
+ providerAddress?: string;
44
+ providerUri?: string;
45
+ metadata?: Metadata;
46
+ metadataUri?: string;
47
+ nodeUri?: string;
48
+ owner?: string;
49
+ secretStoreUri?: string;
50
+ whitelist?: string[];
51
+ }
52
+ export interface ComputeAsset {
53
+ documentId: string;
54
+ serviceId: string;
55
+ transferTxId?: string;
56
+ userdata?: {
57
+ [key: string]: any;
58
+ };
59
+ }
60
+ export interface ComputeAlgorithm {
61
+ documentId?: string;
62
+ serviceId?: string;
63
+ meta?: MetadataAlgorithm;
64
+ transferTxId?: string;
65
+ algocustomdata?: {
66
+ [key: string]: any;
67
+ };
68
+ userdata?: {
69
+ [key: string]: any;
70
+ };
71
+ }
@@ -1,26 +1,26 @@
1
- export declare type AbiType = 'function' | 'constructor' | 'event' | 'fallback';
2
- export declare type StateMutabilityType = 'pure' | 'view' | 'nonpayable' | 'payable';
3
- export interface AbiInput {
4
- name: string;
5
- type: string;
6
- indexed?: boolean;
7
- components?: AbiInput[];
8
- internalType?: string;
9
- }
10
- export interface AbiOutput {
11
- name: string;
12
- type: string;
13
- components?: AbiOutput[];
14
- internalType?: string;
15
- }
16
- export interface AbiItem {
17
- anonymous?: boolean;
18
- constant?: boolean;
19
- inputs?: AbiInput[];
20
- name?: string;
21
- outputs?: AbiOutput[];
22
- payable?: boolean;
23
- stateMutability?: StateMutabilityType;
24
- type: AbiType;
25
- gas?: number;
26
- }
1
+ export type AbiType = 'function' | 'constructor' | 'event' | 'fallback';
2
+ export type StateMutabilityType = 'pure' | 'view' | 'nonpayable' | 'payable';
3
+ export interface AbiInput {
4
+ name: string;
5
+ type: string;
6
+ indexed?: boolean;
7
+ components?: AbiInput[];
8
+ internalType?: string;
9
+ }
10
+ export interface AbiOutput {
11
+ name: string;
12
+ type: string;
13
+ components?: AbiOutput[];
14
+ internalType?: string;
15
+ }
16
+ export interface AbiItem {
17
+ anonymous?: boolean;
18
+ constant?: boolean;
19
+ inputs?: AbiInput[];
20
+ name?: string;
21
+ outputs?: AbiOutput[];
22
+ payable?: boolean;
23
+ stateMutability?: StateMutabilityType;
24
+ type: AbiType;
25
+ gas?: number;
26
+ }
@@ -1,37 +1,37 @@
1
- export interface ConsumerParameter {
2
- /**
3
- * Parameter name.
4
- * @type {string}
5
- */
6
- name: string;
7
- /**
8
- * Field type.
9
- * @type {'text' | 'number' | 'boolean' | 'select'}
10
- */
11
- type: 'text' | 'number' | 'boolean' | 'select';
12
- /**
13
- * Displayed field label.
14
- * @type {string}
15
- */
16
- label: string;
17
- /**
18
- * Defines if customer input for this field is mandatory.
19
- * @type {boolean}
20
- */
21
- required: boolean;
22
- /**
23
- * Field description.
24
- * @type {string}
25
- */
26
- description: string;
27
- /**
28
- * Field default value. For select types, string key of default option.
29
- * @type {string}
30
- */
31
- default: string;
32
- /**
33
- * For select types, a list of options.
34
- * @type {string}
35
- */
36
- options?: string;
37
- }
1
+ export interface ConsumerParameter {
2
+ /**
3
+ * Parameter name.
4
+ * @type {string}
5
+ */
6
+ name: string;
7
+ /**
8
+ * Field type.
9
+ * @type {'text' | 'number' | 'boolean' | 'select'}
10
+ */
11
+ type: 'text' | 'number' | 'boolean' | 'select';
12
+ /**
13
+ * Displayed field label.
14
+ * @type {string}
15
+ */
16
+ label: string;
17
+ /**
18
+ * Defines if customer input for this field is mandatory.
19
+ * @type {boolean}
20
+ */
21
+ required: boolean;
22
+ /**
23
+ * Field description.
24
+ * @type {string}
25
+ */
26
+ description: string;
27
+ /**
28
+ * Field default value. For select types, string key of default option.
29
+ * @type {string}
30
+ */
31
+ default: string;
32
+ /**
33
+ * For select types, a list of options.
34
+ * @type {string}
35
+ */
36
+ options?: string;
37
+ }
@@ -1,8 +1,8 @@
1
- export interface Credential {
2
- type: string;
3
- values: string[];
4
- }
5
- export interface Credentials {
6
- allow: Credential[];
7
- deny: Credential[];
8
- }
1
+ export interface Credential {
2
+ type: string;
3
+ values: string[];
4
+ }
5
+ export interface Credentials {
6
+ allow: Credential[];
7
+ deny: Credential[];
8
+ }