@oceanprotocol/lib 1.0.0-next.1 → 1.0.0-next.13

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 (103) hide show
  1. package/CHANGELOG.md +111 -1
  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 +119 -0
  11. package/dist/src/{src/@types → @types}/Compute.d.ts +17 -0
  12. package/dist/src/{src/@types → @types}/DDO/Credentials.d.ts +0 -0
  13. package/dist/src/@types/DDO/DDO.d.ts +58 -0
  14. package/dist/src/@types/DDO/Event.d.ts +27 -0
  15. package/dist/src/@types/DDO/Metadata.d.ts +126 -0
  16. package/dist/src/@types/DDO/Service.d.ts +124 -0
  17. package/dist/src/{src/interfaces/DispenserInterface.d.ts → @types/Dispenser.d.ts} +0 -0
  18. package/dist/src/@types/DownloadResponse.d.ts +4 -0
  19. package/dist/src/{src/interfaces/Erc20Interface.d.ts → @types/Erc20.d.ts} +0 -0
  20. package/dist/src/@types/Erc721.d.ts +12 -0
  21. package/dist/src/@types/FileMetadata.d.ts +38 -0
  22. package/dist/src/{src/interfaces/FixedRateInterface.d.ts → @types/FixedPrice.d.ts} +1 -1
  23. package/dist/src/{src/interfaces/PoolInterface.d.ts → @types/Pool.d.ts} +4 -4
  24. package/dist/src/{src/@types → @types}/Provider.d.ts +3 -2
  25. package/dist/src/@types/Router.d.ts +59 -0
  26. package/dist/src/{src/@types → @types}/index.d.ts +6 -0
  27. package/dist/src/aquarius/Aquarius.d.ts +32 -0
  28. package/dist/src/{src/aquarius → aquarius}/index.d.ts +0 -0
  29. package/dist/src/factories/NFTFactory.d.ts +273 -0
  30. package/dist/src/{src/factories → factories}/index.d.ts +0 -0
  31. package/dist/src/{src/index.d.ts → index.d.ts} +0 -1
  32. package/dist/src/models/Config.d.ts +166 -0
  33. package/dist/src/{src/models → models}/index.d.ts +0 -0
  34. package/dist/src/pools/Router.d.ts +229 -0
  35. package/dist/src/pools/balancer/Pool.d.ts +365 -0
  36. package/dist/src/{src/pools → pools}/balancer/index.d.ts +0 -0
  37. package/dist/src/pools/dispenser/Dispenser.d.ts +146 -0
  38. package/dist/src/{src/pools → pools}/dispenser/index.d.ts +0 -0
  39. package/dist/src/pools/fixedRate/FixedRateExchange.d.ts +375 -0
  40. package/dist/src/{src/pools → pools}/fixedRate/index.d.ts +0 -0
  41. package/dist/src/{src/pools → pools}/index.d.ts +0 -0
  42. package/dist/src/pools/ssContracts/SideStaking.d.ts +132 -0
  43. package/dist/src/{src/pools → pools}/ssContracts/index.d.ts +0 -0
  44. package/dist/src/provider/Provider.d.ts +147 -0
  45. package/dist/src/{src/provider → provider}/index.d.ts +0 -0
  46. package/dist/src/tokens/Datatoken.d.ts +362 -0
  47. package/dist/src/tokens/NFT.d.ts +355 -0
  48. package/dist/src/{src/tokens → tokens}/index.d.ts +0 -0
  49. package/dist/src/{src/utils → utils}/ConfigHelper.d.ts +1 -1
  50. package/dist/src/{src/utils → utils}/Constants.d.ts +1 -0
  51. package/dist/src/utils/ContractUtils.d.ts +11 -0
  52. package/dist/src/{src/utils → utils}/ConversionTypeHelper.d.ts +0 -0
  53. package/dist/src/utils/DatatokenName.d.ts +11 -0
  54. package/dist/src/{src/utils → utils}/DdoHelpers.d.ts +0 -0
  55. package/dist/src/{src/utils → utils}/FetchHelper.d.ts +3 -2
  56. package/dist/src/utils/General.d.ts +4 -0
  57. package/dist/src/{src/utils → utils}/Logger.d.ts +0 -0
  58. package/dist/src/{src/utils → utils}/SignatureUtils.d.ts +0 -0
  59. package/dist/src/utils/TokenUtils.d.ts +39 -0
  60. package/dist/src/{src/utils → utils}/index.d.ts +3 -2
  61. package/dist/src/utils/minAbi.d.ts +2 -0
  62. package/dist/{src/test → test}/TestContractHandler.d.ts +0 -0
  63. package/dist/{src/test → test}/integration/ComputeFlow.test.d.ts +0 -0
  64. package/dist/{src/test → test}/integration/Provider.test.d.ts +0 -0
  65. package/dist/{src/test → test}/integration/PublishFlows.test.d.ts +0 -0
  66. package/dist/{src/test → test}/integration/SimplePublishConsumeFlow.test.d.ts +0 -0
  67. package/dist/{src/test → test}/integration/config.d.ts +0 -0
  68. package/dist/{src/test → test}/unit/NftFactory.test.d.ts +0 -0
  69. package/dist/{src/test → test}/unit/config.d.ts +0 -0
  70. package/dist/{src/test → test}/unit/pools/Router.test.d.ts +0 -0
  71. package/dist/{src/test → test}/unit/pools/balancer/Pool.test.d.ts +0 -0
  72. package/dist/{src/test → test}/unit/pools/dispenser/Dispenser.test.d.ts +0 -0
  73. package/dist/{src/test → test}/unit/pools/fixedRate/FixedRateExchange.test.d.ts +0 -0
  74. package/dist/{src/test → test}/unit/pools/ssContracts/SideStaking.test.d.ts +0 -0
  75. package/dist/{src/test → test}/unit/tokens/Datatoken.test.d.ts +0 -0
  76. package/dist/{src/test → test}/unit/tokens/Nft.test.d.ts +0 -0
  77. package/docs/beginners_guide.md +4 -4
  78. package/docs/overview.md +100 -9
  79. package/docs/quickstart_marketplace.md +34 -33
  80. package/docs/quickstart_simple.md +18 -16
  81. package/package.json +23 -22
  82. package/dist/src/src/@types/Asset.d.ts +0 -36
  83. package/dist/src/src/@types/DDO/DDO.d.ts +0 -15
  84. package/dist/src/src/@types/DDO/Event.d.ts +0 -7
  85. package/dist/src/src/@types/DDO/Metadata.d.ts +0 -38
  86. package/dist/src/src/@types/DDO/Service.d.ts +0 -28
  87. package/dist/src/src/@types/FileMetadata.d.ts +0 -8
  88. package/dist/src/src/aquarius/Aquarius.d.ts +0 -10
  89. package/dist/src/src/factories/NFTFactory.d.ts +0 -70
  90. package/dist/src/src/interfaces/RouterInterface.d.ts +0 -12
  91. package/dist/src/src/interfaces/index.d.ts +0 -5
  92. package/dist/src/src/models/Config.d.ts +0 -34
  93. package/dist/src/src/pools/Router.d.ts +0 -46
  94. package/dist/src/src/pools/balancer/Pool.d.ts +0 -73
  95. package/dist/src/src/pools/dispenser/Dispenser.d.ts +0 -37
  96. package/dist/src/src/pools/fixedRate/FixedRateExchange.d.ts +0 -95
  97. package/dist/src/src/pools/ssContracts/SideStaking.d.ts +0 -28
  98. package/dist/src/src/provider/Provider.d.ts +0 -31
  99. package/dist/src/src/tokens/Datatoken.d.ts +0 -77
  100. package/dist/src/src/tokens/NFT.d.ts +0 -57
  101. package/dist/src/src/utils/ContractParams.d.ts +0 -4
  102. package/dist/src/src/utils/DatatokenName.d.ts +0 -7
  103. package/dist/src/src/utils/GasUtils.d.ts +0 -2
@@ -0,0 +1,119 @@
1
+ import { DDO } from './DDO/DDO';
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
+ * @type {number}
31
+ */
32
+ state: 0 | 1 | 2 | 3 | 4;
33
+ /**
34
+ * Contains the date of NFT creation.
35
+ * @type {string}
36
+ */
37
+ created: string;
38
+ /**
39
+ * NFT token URI.
40
+ * @type {string}
41
+ */
42
+ tokenURI: string;
43
+ }
44
+ export interface Purgatory {
45
+ /**
46
+ * If `true`, asset is in purgatory.
47
+ * @type {boolean}
48
+ */
49
+ state: boolean;
50
+ /**
51
+ * If asset is in purgatory, contains the reason for being there as defined in `list-purgatory`.
52
+ * @type {string}
53
+ */
54
+ reason: string;
55
+ }
56
+ export interface AssetDatatoken {
57
+ /**
58
+ * Contract address of the deployed ERC20 contract.
59
+ * @type {string}
60
+ */
61
+ address: string;
62
+ /**
63
+ * Name of NFT set in contract.
64
+ * @type {string}
65
+ */
66
+ name: string;
67
+ /**
68
+ * Symbol of NFT set in contract.
69
+ * @type {string}
70
+ */
71
+ symbol: string;
72
+ /**
73
+ * ID of the service the datatoken is attached to.
74
+ * @type {string}
75
+ */
76
+ serviceId: string;
77
+ }
78
+ export interface AssetLastEvent {
79
+ tx: string;
80
+ block: number;
81
+ from: string;
82
+ contract: string;
83
+ datetime: string;
84
+ }
85
+ export interface Asset extends DDO {
86
+ /**
87
+ * Contains information about the ERC721 NFT contract which represents the intellectual property of the publisher.
88
+ * @type {string}
89
+ */
90
+ nft: AssetNft;
91
+ /**
92
+ * Contains information about the ERC20 datatokens attached to asset services.
93
+ * @type {string}
94
+ */
95
+ datatokens: AssetDatatoken[];
96
+ /**
97
+ * Contains information about the last transaction that created or updated the DDO.
98
+ * @type {string}
99
+ */
100
+ event: AssetLastEvent;
101
+ /**
102
+ * The stats section contains different statistics fields.
103
+ * @type {string}
104
+ */
105
+ stats: {
106
+ /**
107
+ * How often an asset was consumed, meaning how often it was either downloaded or used as part of a compute job.
108
+ * @type {string}
109
+ */
110
+ consume: number;
111
+ };
112
+ /**
113
+ * Contains information about an asset's purgatory status defined in
114
+ * [`list-purgatory`](https://github.com/oceanprotocol/list-purgatory).
115
+ * Marketplace interfaces are encouraged to prevent certain user actions like adding liquidity on assets in purgatory.
116
+ * @type {Purgatory}
117
+ */
118
+ purgatory: Purgatory;
119
+ }
@@ -1,5 +1,22 @@
1
1
  import { Metadata, MetadataAlgorithm } from './DDO/Metadata';
2
2
  export declare type ComputeResultType = 'algorithmLog' | 'output';
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
+ }
3
20
  export interface ComputeResult {
4
21
  filename: string;
5
22
  filesize: number;
@@ -0,0 +1,58 @@
1
+ import { Service } from './Service';
2
+ import { Metadata } from './Metadata';
3
+ import { Credentials } from './Credentials';
4
+ import { Event } from './Event';
5
+ /**
6
+ * DID Descriptor Object.
7
+ * Contains metadata about the asset, and define access in at least one service.
8
+ */
9
+ export interface DDO {
10
+ /**
11
+ * Contexts used for validation.
12
+ * @type {string[]}
13
+ */
14
+ '@context': string[];
15
+ /**
16
+ * DID, descentralized ID.
17
+ * Computed as sha256(address of ERC721 contract + chainId)
18
+ * @type {string}
19
+ */
20
+ id: string;
21
+ /**
22
+ * Version information in SemVer notation
23
+ * referring to the DDO spec version
24
+ * @type {string}
25
+ */
26
+ version: string;
27
+ /**
28
+ * NFT contract address
29
+ * @type {string}
30
+ */
31
+ nftAddress: string;
32
+ /**
33
+ * ChainId of the network the DDO was published to.
34
+ * @type {number}
35
+ */
36
+ chainId: number;
37
+ /**
38
+ * Stores an object describing the asset.
39
+ * @type {Metadata}
40
+ */
41
+ metadata: Metadata;
42
+ /**
43
+ * Stores an array of services defining access to the asset.
44
+ * @type {Service[]}
45
+ */
46
+ services: Service[];
47
+ /**
48
+ * Describes the credentials needed to access a dataset
49
+ * in addition to the services definition.
50
+ * @type {Credentials}
51
+ */
52
+ credentials?: Credentials;
53
+ /**
54
+ * Describes the event of last metadata event
55
+ * @type {Event}
56
+ */
57
+ event?: Event;
58
+ }
@@ -0,0 +1,27 @@
1
+ export interface Event {
2
+ /**
3
+ * TX id of the last create/update
4
+ * @type {string}
5
+ */
6
+ txid?: string;
7
+ /**
8
+ * Block of txid
9
+ * @type {number}
10
+ */
11
+ block?: number;
12
+ /**
13
+ * Sender of tx
14
+ * @type {String}
15
+ */
16
+ from?: string;
17
+ /**
18
+ * Contract
19
+ * @type {String}
20
+ */
21
+ contract?: string;
22
+ /**
23
+ * datetime of tx
24
+ * @type {String}
25
+ */
26
+ datetime?: string;
27
+ }
@@ -0,0 +1,126 @@
1
+ export interface MetadataAlgorithm {
2
+ /**
3
+ * Language used to implement the software.
4
+ * @type {string}
5
+ */
6
+ language?: string;
7
+ /**
8
+ * Version of the software preferably in SemVer notation.
9
+ * @type {string}
10
+ */
11
+ version?: string;
12
+ /**
13
+ * Rawcode
14
+ * @type {string}
15
+ */
16
+ rawcode?: string;
17
+ /**
18
+ * Object describing the Docker container image.
19
+ * @type {Object}
20
+ */
21
+ container: {
22
+ /**
23
+ * The command to execute, or script to run inside the Docker image.
24
+ * @type {string}
25
+ */
26
+ entrypoint: string;
27
+ /**
28
+ * Name of the Docker image.
29
+ * @type {string}
30
+ */
31
+ image: string;
32
+ /**
33
+ * Tag of the Docker image.
34
+ * @type {string}
35
+ */
36
+ tag: string;
37
+ /**
38
+ * Checksum of the Docker image.
39
+ * @type {string}
40
+ */
41
+ checksum: string;
42
+ };
43
+ }
44
+ export interface Metadata {
45
+ /**
46
+ * Contains the date of publishing in ISO Date Time
47
+ * @type {string}
48
+ */
49
+ created: string;
50
+ /**
51
+ * Contains the the date of last update in ISO Date Time
52
+ * @type {string}
53
+ */
54
+ updated: string;
55
+ /**
56
+ * Descriptive name or title of the asset.
57
+ * @type {string}
58
+ */
59
+ name: string;
60
+ /**
61
+ * Details of what the resource is.
62
+ * @type {string}
63
+ */
64
+ description: string;
65
+ /**
66
+ * Asset type. Includes "dataset" (e.g. csv file), "algorithm" (e.g. Python script).
67
+ * Each type needs a different subset of metadata attributes.
68
+ * @type {'dataset' | 'algorithm'}
69
+ */
70
+ type: 'dataset' | 'algorithm';
71
+ /**
72
+ * Name of the entity generating this data (e.g. Tfl, Disney Corp, etc.).
73
+ * @type {string}
74
+ */
75
+ author: string;
76
+ /**
77
+ * Short name referencing the license of the asset.
78
+ * If it’s not specified, the following value will be added: “No License Specified”.
79
+ * @type {string}
80
+ */
81
+ license: string;
82
+ /**
83
+ * Mapping of URL strings for data samples, or links to find out more information.
84
+ * Links may be to either a URL or another asset.
85
+ * @type {string[]}
86
+ */
87
+ links?: string[];
88
+ /**
89
+ * Mapping of URL strings for data samples, or links to find out more information.
90
+ * Links may be to either a URL or another asset.
91
+ * @type {string[]}
92
+ */
93
+ tags?: string[];
94
+ /**
95
+ * The party holding the legal copyright. Empty by default.
96
+ * @type {string}
97
+ */
98
+ copyrightHolder?: string;
99
+ /**
100
+ *The language of the content. Use one of the language codes from the IETF BCP 47 standard
101
+ * @type {string}
102
+ */
103
+ contentLanguage?: string;
104
+ /**
105
+ * Information about asset of typealgorithm
106
+ * @type {MetadataAlgorithm}
107
+ */
108
+ algorithm?: MetadataAlgorithm;
109
+ /**
110
+ * Stores additional information, this is customizable by publisher
111
+ * @type {any}
112
+ */
113
+ additionalInformation?: any;
114
+ }
115
+ export interface MetadataProof {
116
+ validatorAddress?: string;
117
+ r?: string;
118
+ s?: string;
119
+ v?: number;
120
+ }
121
+ export interface ValidateMetadata {
122
+ valid: Boolean;
123
+ errors?: Object;
124
+ hash?: string;
125
+ proof?: MetadataProof;
126
+ }
@@ -0,0 +1,124 @@
1
+ export interface PublisherTrustedAlgorithm {
2
+ /**
3
+ * The DID of the algorithm which is trusted by the publisher.
4
+ * @type {string}
5
+ */
6
+ did: string;
7
+ /**
8
+ * Hash of algorithm’s files section.
9
+ * @type {string}
10
+ */
11
+ filesChecksum: string;
12
+ /**
13
+ * Hash of algorithm’s metadata.algorithm.container section.
14
+ * @type {string}
15
+ */
16
+ containerSectionChecksum: string;
17
+ }
18
+ export interface ServiceComputeOptions {
19
+ /**
20
+ * Namespaced used for the compute job.
21
+ * @type {string}
22
+ */
23
+ namespace: string;
24
+ /**
25
+ * Maximum number of CPUs allocated for a job
26
+ * @type {number}
27
+ */
28
+ cpu?: number;
29
+ /**
30
+ * Maximum number of GPUs allocated for a job
31
+ * @type {number}
32
+ */
33
+ gpu?: number;
34
+ /**
35
+ * Type of GPU (if any)
36
+ * @type {string}
37
+ */
38
+ gpuType?: string;
39
+ /**
40
+ * Maximum amount of memory allocated for a job.
41
+ * You can express memory as a plain integer or as a fixed-point number using one of these suffixes: E, P, T, G, M, k.
42
+ * You can also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki.
43
+ * For example, the following represent roughly the same value: 128974848, 129e6, 129M, 123Mi
44
+ * @type {string}
45
+ */
46
+ memory?: string;
47
+ /**
48
+ * Amount of disk space allocated.
49
+ * You can express it as a plain integer or as a fixed-point number using one of these suffixes: E, P, T, G, M, k.
50
+ * You can also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki.
51
+ * @type {string}
52
+ */
53
+ volumeSize?: string;
54
+ /**
55
+ * If true, any passed raw text will be allowed to run.
56
+ * Useful for an algorithm drag & drop use case, but increases risk of data escape through malicious user input.
57
+ * Should be false by default in all implementations.
58
+ * @type {boolean}
59
+ */
60
+ allowRawAlgorithm: boolean;
61
+ /**
62
+ * If true, the algorithm job will have network access.
63
+ * @type {boolean}
64
+ */
65
+ allowNetworkAccess: boolean;
66
+ /**
67
+ * If empty, then any published algorithm is allowed.
68
+ * Otherwise, only published algorithms by some publishers are allowed
69
+ * @type {string[]}
70
+ */
71
+ publisherTrustedAlgorithmPublishers: string[];
72
+ /**
73
+ * If empty, then any published algorithm is allowed. (see below)
74
+ * @type {PublisherTrustedAlgorithm[]}
75
+ */
76
+ publisherTrustedAlgorithms: PublisherTrustedAlgorithm[];
77
+ }
78
+ export interface Service {
79
+ /**
80
+ * Unique ID
81
+ * @type {string}
82
+ */
83
+ id: string;
84
+ /**
85
+ * Type of service (access, compute, wss.
86
+ * @type {string}
87
+ */
88
+ type: 'access' | 'compute' | string;
89
+ /**
90
+ * Encrypted file URLs.
91
+ * @type {string}
92
+ */
93
+ files: string;
94
+ /**
95
+ * Datatoken address
96
+ * @type {string}
97
+ */
98
+ datatokenAddress: string;
99
+ /**
100
+ * Provider URL (schema + host).
101
+ * @type {string}
102
+ */
103
+ serviceEndpoint: string;
104
+ /**
105
+ * Describing how long the service can be used after consumption is initiated.
106
+ * @type {number}
107
+ */
108
+ timeout: number;
109
+ /**
110
+ * Service friendly name
111
+ * @type {string}
112
+ */
113
+ name?: string;
114
+ /**
115
+ * Service description
116
+ * @type {string}
117
+ */
118
+ description?: string;
119
+ /**
120
+ * If service is of typecompute, holds information about the compute-related privacy settings & resources.
121
+ * @type {ServiceComputeOptions}
122
+ */
123
+ compute?: ServiceComputeOptions;
124
+ }
@@ -0,0 +1,4 @@
1
+ export interface DownloadResponse {
2
+ data: ArrayBuffer;
3
+ filename: string;
4
+ }
@@ -0,0 +1,12 @@
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
+ }
@@ -0,0 +1,38 @@
1
+ export interface FileMetadata {
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
+ * check if file exists
35
+ * @type {boolean}
36
+ */
37
+ valid?: boolean;
38
+ }
@@ -4,7 +4,7 @@ export interface FreCreationParams {
4
4
  owner: string;
5
5
  marketFeeCollector: string;
6
6
  baseTokenDecimals: number;
7
- dataTokenDecimals: number;
7
+ datatokenDecimals: number;
8
8
  fixedRate: string;
9
9
  marketFee: number;
10
10
  withMint?: boolean;
@@ -1,15 +1,15 @@
1
1
  export interface PoolCreationParams {
2
2
  ssContract: string;
3
- basetokenAddress: string;
4
- basetokenSender: string;
3
+ baseTokenAddress: string;
4
+ baseTokenSender: string;
5
5
  publisherAddress: string;
6
6
  marketFeeCollector: string;
7
7
  poolTemplateAddress: string;
8
8
  rate: string;
9
- basetokenDecimals: number;
9
+ baseTokenDecimals: number;
10
10
  vestingAmount: string;
11
11
  vestedBlocks: number;
12
- initialBasetokenLiquidity: string;
12
+ initialBaseTokenLiquidity: string;
13
13
  swapFeeLiquidityProvider: number;
14
14
  swapFeeMarketRunner: number;
15
15
  }
@@ -2,13 +2,14 @@ export interface ProviderFees {
2
2
  providerFeeAddress: string;
3
3
  providerFeeToken: string;
4
4
  providerFeeAmount: string;
5
- providerData: string;
6
5
  v: string;
7
6
  r: string;
8
7
  s: string;
8
+ providerData: string;
9
+ validUntil: string;
9
10
  }
10
11
  export interface ProviderInitialize {
11
- dataToken: string;
12
+ datatoken: string;
12
13
  nonce: string;
13
14
  computeAddress: string;
14
15
  providerFee: ProviderFees;
@@ -0,0 +1,59 @@
1
+ export interface Operation {
2
+ /**
3
+ * used only for FixedRate or Dispenser, but needs to be filled even for pool
4
+ * @type {string}
5
+ */
6
+ exchangeIds: string;
7
+ /**
8
+ * pool Address
9
+ * @type {string}
10
+ */
11
+ source: string;
12
+ /**
13
+ * operation:
14
+ * 0 - swapExactAmountIn
15
+ * 1 - swapExactAmountOut
16
+ * 2 - FixedRateExchange
17
+ * 3 - Dispenser
18
+ * @type {number}
19
+ */
20
+ operation: number;
21
+ /**
22
+ * token in address
23
+ * @type {string}
24
+ */
25
+ tokenIn: string;
26
+ /**
27
+ * when swapExactAmountIn is EXACT amount IN
28
+ * expressed in Wei
29
+ * @type {string | number}
30
+ */
31
+ amountsIn: string | number;
32
+ /**
33
+ * token out address
34
+ * @type {string}
35
+ */
36
+ tokenOut: string;
37
+ /**
38
+ * when swapExactAmountIn is MIN amount OUT
39
+ * expressed in Wei
40
+ * @type {string | number}
41
+ */
42
+ amountsOut: string | number;
43
+ /**
44
+ * max price (only for pools)
45
+ * expressed in Wei
46
+ * @type {string | number}
47
+ */
48
+ maxPrice: string | number;
49
+ /**
50
+ * swap fee amount
51
+ * @type {string}
52
+ */
53
+ swapMarketFee: string;
54
+ /**
55
+ * market fee address to receive fees
56
+ * @type {string}
57
+ */
58
+ marketFeeAddress: string;
59
+ }
@@ -6,3 +6,9 @@ export * from './DDO/Metadata';
6
6
  export * from './FileMetadata';
7
7
  export * from './Compute';
8
8
  export * from './Provider';
9
+ export * from './FixedPrice';
10
+ export * from './Pool';
11
+ export * from './Erc20';
12
+ export * from './Erc721';
13
+ export * from './Dispenser';
14
+ export * from './Router';
@@ -0,0 +1,32 @@
1
+ import { Asset, DDO, ValidateMetadata } from '../@types/';
2
+ export declare class Aquarius {
3
+ aquariusURL: any;
4
+ /**
5
+ * Instantiate Aquarius
6
+ * @param {String} aquariusURL
7
+ */
8
+ constructor(aquariusURL: string);
9
+ /** Resolves a DID
10
+ * @param {string} did
11
+ * @param {AbortSignal} signal abort signal
12
+ * @return {Promise<Asset>} Asset
13
+ */
14
+ resolve(did: string, signal?: AbortSignal): Promise<Asset>;
15
+ /**
16
+ * Blocks until Aqua will cache the did (or the update for that did) or timeouts
17
+
18
+ * @param {string} did DID of the asset.
19
+ * @param {string} txid used when the did exists and we expect an update with that txid.
20
+ * @param {AbortSignal} signal abort signal
21
+ * @return {Promise<DDO>} DDO of the asset.
22
+ */
23
+ waitForAqua(did: string, txid?: string, signal?: AbortSignal): Promise<Asset>;
24
+ /**
25
+ * Validate DDO content
26
+ * @param {DDO} ddo DID Descriptor Object content.
27
+ * @param {AbortSignal} signal abort signal
28
+ * @return {Promise<ValidateMetadata>}.
29
+ */
30
+ validate(ddo: DDO, signal?: AbortSignal): Promise<ValidateMetadata>;
31
+ }
32
+ export default Aquarius;
File without changes