@oceanprotocol/lib 3.0.4 → 3.1.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.
Files changed (82) hide show
  1. package/CHANGELOG.md +10 -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 +17 -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,38 +1,38 @@
1
- import { ProviderFees } from '.';
2
- export interface DatatokenCreateParams {
3
- templateIndex: number;
4
- minter: string;
5
- paymentCollector: string;
6
- mpFeeAddress: string;
7
- feeToken: string;
8
- feeAmount: string;
9
- cap: string;
10
- name?: string;
11
- symbol?: string;
12
- }
13
- export interface ConsumeMarketFee {
14
- consumeMarketFeeAddress: string;
15
- consumeMarketFeeToken: string;
16
- consumeMarketFeeAmount: string;
17
- }
18
- export interface PublishingMarketFee {
19
- publishMarketFeeAddress: string;
20
- publishMarketFeeToken: string;
21
- publishMarketFeeAmount: string;
22
- }
23
- export interface DatatokenRoles {
24
- minter: boolean;
25
- paymentManager: boolean;
26
- }
27
- export interface OrderParams {
28
- consumer: string;
29
- serviceIndex: number;
30
- _providerFee: ProviderFees;
31
- _consumeMarketFee: ConsumeMarketFee;
32
- }
33
- export interface DispenserParams {
34
- maxTokens: string;
35
- maxBalance: string;
36
- withMint?: boolean;
37
- allowedSwapper?: string;
38
- }
1
+ import { ProviderFees } from '.';
2
+ export interface DatatokenCreateParams {
3
+ templateIndex: number;
4
+ minter: string;
5
+ paymentCollector: string;
6
+ mpFeeAddress: string;
7
+ feeToken: string;
8
+ feeAmount: string;
9
+ cap: string;
10
+ name?: string;
11
+ symbol?: string;
12
+ }
13
+ export interface ConsumeMarketFee {
14
+ consumeMarketFeeAddress: string;
15
+ consumeMarketFeeToken: string;
16
+ consumeMarketFeeAmount: string;
17
+ }
18
+ export interface PublishingMarketFee {
19
+ publishMarketFeeAddress: string;
20
+ publishMarketFeeToken: string;
21
+ publishMarketFeeAmount: string;
22
+ }
23
+ export interface DatatokenRoles {
24
+ minter: boolean;
25
+ paymentManager: boolean;
26
+ }
27
+ export interface OrderParams {
28
+ consumer: string;
29
+ serviceIndex: number;
30
+ _providerFee: ProviderFees;
31
+ _consumeMarketFee: ConsumeMarketFee;
32
+ }
33
+ export interface DispenserParams {
34
+ maxTokens: string;
35
+ maxBalance: string;
36
+ withMint?: boolean;
37
+ allowedSwapper?: string;
38
+ }
@@ -1,16 +1,16 @@
1
- export interface DispenserCreationParams {
2
- dispenserAddress: string;
3
- maxTokens: string;
4
- maxBalance: string;
5
- withMint?: boolean;
6
- allowedSwapper?: string;
7
- }
8
- export interface DispenserToken {
9
- active: boolean;
10
- owner: string;
11
- maxTokens: string;
12
- maxBalance: string;
13
- balance: string;
14
- isMinter: boolean;
15
- allowedSwapper: string;
16
- }
1
+ export interface DispenserCreationParams {
2
+ dispenserAddress: string;
3
+ maxTokens: string;
4
+ maxBalance: string;
5
+ withMint?: boolean;
6
+ allowedSwapper?: string;
7
+ }
8
+ export interface DispenserToken {
9
+ active: boolean;
10
+ owner: string;
11
+ maxTokens: string;
12
+ maxBalance: string;
13
+ balance: string;
14
+ isMinter: boolean;
15
+ allowedSwapper: string;
16
+ }
@@ -1,4 +1,4 @@
1
- export interface DownloadResponse {
2
- data: ArrayBuffer;
3
- filename: string;
4
- }
1
+ export interface DownloadResponse {
2
+ data: ArrayBuffer;
3
+ filename: string;
4
+ }
@@ -1,89 +1,89 @@
1
- import { AbiItem } from './Contracts';
2
- interface FileTypeHeaders {
3
- [key: string]: string;
4
- }
5
- export interface UrlFile {
6
- type: 'url';
7
- /**
8
- * File index.
9
- * @type {number}
10
- */
11
- index?: number;
12
- /**
13
- * File URL.
14
- * @type {string}
15
- */
16
- url: string;
17
- /**
18
- * HTTP method used
19
- * @type {string}
20
- */
21
- method: string;
22
- /**
23
- * Headers key value pairs associated with the asset GET request
24
- * @type {string}
25
- */
26
- headers?: FileTypeHeaders;
27
- }
28
- export interface GraphqlQuery {
29
- type: 'graphql';
30
- /**
31
- * @type {number}
32
- */
33
- index?: number;
34
- /**
35
- * Endpoint URL
36
- * @type {string}
37
- */
38
- url: string;
39
- /**
40
- * query
41
- * @type {string}
42
- */
43
- query: string;
44
- /**
45
- * Headers key value pairs associated with the asset GET request
46
- * @type {string}
47
- */
48
- headers?: FileTypeHeaders;
49
- }
50
- export interface Arweave {
51
- type: 'arweave';
52
- /**
53
- * transactionId
54
- * @type {string}
55
- */
56
- transactionId: string;
57
- }
58
- export interface Ipfs {
59
- type: 'ipfs';
60
- /**
61
- * hash
62
- * @type {string}
63
- */
64
- hash: string;
65
- }
66
- export interface Smartcontract {
67
- type: 'smartcontract';
68
- /**
69
- * Smartcontract address
70
- * @type {string}
71
- */
72
- address: string;
73
- /**
74
- * ChainId
75
- * @type {number}
76
- */
77
- chainId: number;
78
- /**
79
- * Function ABI (not the entire smartcontract abi)
80
- * @type {AbiItem}
81
- */
82
- abi: AbiItem;
83
- }
84
- export interface Files {
85
- nftAddress: string;
86
- datatokenAddress: string;
87
- files: UrlFile[] | GraphqlQuery[] | Arweave[] | Smartcontract[] | Ipfs[];
88
- }
89
- export {};
1
+ import { AbiItem } from './Contracts';
2
+ interface FileTypeHeaders {
3
+ [key: string]: string;
4
+ }
5
+ export interface UrlFile {
6
+ type: 'url';
7
+ /**
8
+ * File index.
9
+ * @type {number}
10
+ */
11
+ index?: number;
12
+ /**
13
+ * File URL.
14
+ * @type {string}
15
+ */
16
+ url: string;
17
+ /**
18
+ * HTTP method used
19
+ * @type {string}
20
+ */
21
+ method: string;
22
+ /**
23
+ * Headers key value pairs associated with the asset GET request
24
+ * @type {string}
25
+ */
26
+ headers?: FileTypeHeaders;
27
+ }
28
+ export interface GraphqlQuery {
29
+ type: 'graphql';
30
+ /**
31
+ * @type {number}
32
+ */
33
+ index?: number;
34
+ /**
35
+ * Endpoint URL
36
+ * @type {string}
37
+ */
38
+ url: string;
39
+ /**
40
+ * query
41
+ * @type {string}
42
+ */
43
+ query: string;
44
+ /**
45
+ * Headers key value pairs associated with the asset GET request
46
+ * @type {string}
47
+ */
48
+ headers?: FileTypeHeaders;
49
+ }
50
+ export interface Arweave {
51
+ type: 'arweave';
52
+ /**
53
+ * transactionId
54
+ * @type {string}
55
+ */
56
+ transactionId: string;
57
+ }
58
+ export interface Ipfs {
59
+ type: 'ipfs';
60
+ /**
61
+ * hash
62
+ * @type {string}
63
+ */
64
+ hash: string;
65
+ }
66
+ export interface Smartcontract {
67
+ type: 'smartcontract';
68
+ /**
69
+ * Smartcontract address
70
+ * @type {string}
71
+ */
72
+ address: string;
73
+ /**
74
+ * ChainId
75
+ * @type {number}
76
+ */
77
+ chainId: number;
78
+ /**
79
+ * Function ABI (not the entire smartcontract abi)
80
+ * @type {AbiItem}
81
+ */
82
+ abi: AbiItem;
83
+ }
84
+ export interface Files {
85
+ nftAddress: string;
86
+ datatokenAddress: string;
87
+ files: UrlFile[] | GraphqlQuery[] | Arweave[] | Smartcontract[] | Ipfs[];
88
+ }
89
+ export {};
@@ -1,43 +1,43 @@
1
- export interface FileInfo {
2
- /**
3
- * File URL.
4
- * @type {string}
5
- */
6
- type: string;
7
- /**
8
- * File format, if applicable.
9
- * @type {string}
10
- * @example "text/csv"
11
- */
12
- contentType?: string;
13
- /**
14
- * File content length.
15
- * @type {[type]}
16
- */
17
- contentLength?: string;
18
- /**
19
- * File index.
20
- * @type {number}
21
- */
22
- index?: number;
23
- /**
24
- * File URL.
25
- * @type {string}
26
- */
27
- url?: string;
28
- /**
29
- * HTTP method used
30
- * @type {string}
31
- */
32
- method?: string;
33
- /**
34
- * Computed file checksum
35
- * @type {string}
36
- */
37
- checksum?: string;
38
- /**
39
- * check if file exists
40
- * @type {boolean}
41
- */
42
- valid?: boolean;
43
- }
1
+ export interface FileInfo {
2
+ /**
3
+ * File URL.
4
+ * @type {string}
5
+ */
6
+ type: string;
7
+ /**
8
+ * File format, if applicable.
9
+ * @type {string}
10
+ * @example "text/csv"
11
+ */
12
+ contentType?: string;
13
+ /**
14
+ * File content length.
15
+ * @type {[type]}
16
+ */
17
+ contentLength?: string;
18
+ /**
19
+ * File index.
20
+ * @type {number}
21
+ */
22
+ index?: number;
23
+ /**
24
+ * File URL.
25
+ * @type {string}
26
+ */
27
+ url?: string;
28
+ /**
29
+ * HTTP method used
30
+ * @type {string}
31
+ */
32
+ method?: string;
33
+ /**
34
+ * Computed file checksum
35
+ * @type {string}
36
+ */
37
+ checksum?: string;
38
+ /**
39
+ * check if file exists
40
+ * @type {boolean}
41
+ */
42
+ valid?: boolean;
43
+ }
@@ -1,51 +1,51 @@
1
- export interface FreCreationParams {
2
- fixedRateAddress: string;
3
- baseTokenAddress: string;
4
- owner: string;
5
- marketFeeCollector: string;
6
- baseTokenDecimals: number;
7
- datatokenDecimals: number;
8
- fixedRate: string;
9
- marketFee: string;
10
- withMint?: boolean;
11
- allowedConsumer?: string;
12
- }
13
- export interface FreOrderParams {
14
- exchangeContract: string;
15
- exchangeId: string;
16
- maxBaseTokenAmount: string;
17
- baseTokenAddress: string;
18
- baseTokenDecimals?: number;
19
- swapMarketFee: string;
20
- marketFeeAddress: string;
21
- }
22
- export interface PriceAndFees {
23
- baseTokenAmount: string;
24
- oceanFeeAmount: string;
25
- marketFeeAmount: string;
26
- consumeMarketFeeAmount: string;
27
- }
28
- export interface FixedPriceExchange {
29
- active: boolean;
30
- exchangeOwner: string;
31
- datatoken: string;
32
- baseToken: string;
33
- fixedRate: string;
34
- dtDecimals: string;
35
- btDecimals: string;
36
- dtBalance: string;
37
- btBalance: string;
38
- dtSupply: string;
39
- btSupply: string;
40
- withMint: boolean;
41
- allowedSwapper: string;
42
- exchangeId?: string;
43
- }
44
- export interface FeesInfo {
45
- opcFee: string;
46
- marketFee: string;
47
- marketFeeCollector: string;
48
- marketFeeAvailable: string;
49
- oceanFeeAvailable: string;
50
- exchangeId: string;
51
- }
1
+ export interface FreCreationParams {
2
+ fixedRateAddress: string;
3
+ baseTokenAddress: string;
4
+ owner: string;
5
+ marketFeeCollector: string;
6
+ baseTokenDecimals: number;
7
+ datatokenDecimals: number;
8
+ fixedRate: string;
9
+ marketFee: string;
10
+ withMint?: boolean;
11
+ allowedConsumer?: string;
12
+ }
13
+ export interface FreOrderParams {
14
+ exchangeContract: string;
15
+ exchangeId: string;
16
+ maxBaseTokenAmount: string;
17
+ baseTokenAddress: string;
18
+ baseTokenDecimals?: number;
19
+ swapMarketFee: string;
20
+ marketFeeAddress: string;
21
+ }
22
+ export interface PriceAndFees {
23
+ baseTokenAmount: string;
24
+ oceanFeeAmount: string;
25
+ marketFeeAmount: string;
26
+ consumeMarketFeeAmount: string;
27
+ }
28
+ export interface FixedPriceExchange {
29
+ active: boolean;
30
+ exchangeOwner: string;
31
+ datatoken: string;
32
+ baseToken: string;
33
+ fixedRate: string;
34
+ dtDecimals: string;
35
+ btDecimals: string;
36
+ dtBalance: string;
37
+ btBalance: string;
38
+ dtSupply: string;
39
+ btSupply: string;
40
+ withMint: boolean;
41
+ allowedSwapper: string;
42
+ exchangeId?: string;
43
+ }
44
+ export interface FeesInfo {
45
+ opcFee: string;
46
+ marketFee: string;
47
+ marketFeeCollector: string;
48
+ marketFeeAvailable: string;
49
+ oceanFeeAvailable: string;
50
+ exchangeId: string;
51
+ }
@@ -1,18 +1,18 @@
1
- import { MetadataProof } from '.';
2
- export interface MetadataAndTokenURI {
3
- metaDataState: number;
4
- metaDataDecryptorUrl: string;
5
- metaDataDecryptorAddress: string;
6
- flags: string;
7
- data: string;
8
- metaDataHash: string;
9
- tokenId: number;
10
- tokenURI: string;
11
- metadataProofs?: MetadataProof[];
12
- }
13
- export interface NftRoles {
14
- manager: boolean;
15
- deployERC20: boolean;
16
- updateMetadata: boolean;
17
- store: boolean;
18
- }
1
+ import { MetadataProof } from '.';
2
+ export interface MetadataAndTokenURI {
3
+ metaDataState: number;
4
+ metaDataDecryptorUrl: string;
5
+ metaDataDecryptorAddress: string;
6
+ flags: string;
7
+ data: string;
8
+ metaDataHash: string;
9
+ tokenId: number;
10
+ tokenURI: string;
11
+ metadataProofs?: MetadataProof[];
12
+ }
13
+ export interface NftRoles {
14
+ manager: boolean;
15
+ deployERC20: boolean;
16
+ updateMetadata: boolean;
17
+ store: boolean;
18
+ }
@@ -1,20 +1,20 @@
1
- import { ConsumeMarketFee, ProviderFees } from '.';
2
- export interface Template {
3
- templateAddress: string;
4
- isActive: boolean;
5
- }
6
- export interface TokenOrder {
7
- tokenAddress: string;
8
- consumer: string;
9
- serviceIndex: number;
10
- _providerFee: ProviderFees;
11
- _consumeMarketFee: ConsumeMarketFee;
12
- }
13
- export interface NftCreateData {
14
- name: string;
15
- symbol: string;
16
- templateIndex: number;
17
- tokenURI: string;
18
- transferable: boolean;
19
- owner: string;
20
- }
1
+ import { ConsumeMarketFee, ProviderFees } from '.';
2
+ export interface Template {
3
+ templateAddress: string;
4
+ isActive: boolean;
5
+ }
6
+ export interface TokenOrder {
7
+ tokenAddress: string;
8
+ consumer: string;
9
+ serviceIndex: number;
10
+ _providerFee: ProviderFees;
11
+ _consumeMarketFee: ConsumeMarketFee;
12
+ }
13
+ export interface NftCreateData {
14
+ name: string;
15
+ symbol: string;
16
+ templateIndex: number;
17
+ tokenURI: string;
18
+ transferable: boolean;
19
+ owner: string;
20
+ }
@@ -1,33 +1,33 @@
1
- export interface ProviderFees {
2
- providerFeeAddress: string;
3
- providerFeeToken: string;
4
- providerFeeAmount: string;
5
- v: string;
6
- r: string;
7
- s: string;
8
- providerData: string;
9
- validUntil: string;
10
- }
11
- export interface ProviderInitialize {
12
- datatoken: string;
13
- nonce: string;
14
- computeAddress: string;
15
- providerFee: ProviderFees;
16
- }
17
- export interface ProviderComputeInitialize {
18
- datatoken?: string;
19
- validOrder?: string;
20
- providerFee?: ProviderFees;
21
- }
22
- export interface ProviderComputeInitializeResults {
23
- algorithm?: ProviderComputeInitialize;
24
- datasets?: ProviderComputeInitialize[];
25
- }
26
- export interface ServiceEndpoint {
27
- serviceName: string;
28
- method: string;
29
- urlPath: string;
30
- }
31
- export interface UserCustomParameters {
32
- [key: string]: any;
33
- }
1
+ export interface ProviderFees {
2
+ providerFeeAddress: string;
3
+ providerFeeToken: string;
4
+ providerFeeAmount: string;
5
+ v: string;
6
+ r: string;
7
+ s: string;
8
+ providerData: string;
9
+ validUntil: string;
10
+ }
11
+ export interface ProviderInitialize {
12
+ datatoken: string;
13
+ nonce: string;
14
+ computeAddress: string;
15
+ providerFee: ProviderFees;
16
+ }
17
+ export interface ProviderComputeInitialize {
18
+ datatoken?: string;
19
+ validOrder?: string;
20
+ providerFee?: ProviderFees;
21
+ }
22
+ export interface ProviderComputeInitializeResults {
23
+ algorithm?: ProviderComputeInitialize;
24
+ datasets?: ProviderComputeInitialize[];
25
+ }
26
+ export interface ServiceEndpoint {
27
+ serviceName: string;
28
+ method: string;
29
+ urlPath: string;
30
+ }
31
+ export interface UserCustomParameters {
32
+ [key: string]: any;
33
+ }
@@ -1,3 +1,3 @@
1
- import { BigNumber, providers } from 'ethers';
2
- export declare type ReceiptOrEstimate<G extends boolean = false> = G extends false ? providers.TransactionResponse : BigNumber;
3
- export declare type ReceiptOrDecimal<G extends boolean = false> = G extends false ? providers.TransactionResponse : number;
1
+ import { BigNumber, providers } from 'ethers';
2
+ export type ReceiptOrEstimate<G extends boolean = false> = G extends false ? providers.TransactionResponse : BigNumber;
3
+ export type ReceiptOrDecimal<G extends boolean = false> = G extends false ? providers.TransactionResponse : number;