@oceanprotocol/lib 0.19.3 → 1.0.0-next.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/CHANGELOG.md +81 -0
- package/README.md +1 -1
- package/artifacts/ERC721Factory.sol/ERC721Factory.json +1164 -0
- package/artifacts/addresses/address.json +21 -0
- package/artifacts/communityFee/OPFCommunityFeeCollector.sol/OPFCommunityFeeCollector.json +116 -0
- package/artifacts/pools/FactoryRouter.sol/FactoryRouter.json +1086 -0
- package/artifacts/pools/balancer/BPool.sol/BPool.json +1744 -0
- package/artifacts/pools/dispenser/Dispenser.sol/Dispenser.json +358 -0
- package/artifacts/pools/fixedRate/FixedRateExchange.sol/FixedRateExchange.json +917 -0
- package/artifacts/pools/ssContracts/SideStaking.sol/SideStaking.json +428 -0
- package/artifacts/templates/ERC20Template.sol/ERC20Template.json +1382 -0
- package/artifacts/templates/ERC20TemplateEnterprise.sol/ERC20TemplateEnterprise.json +1530 -0
- package/artifacts/templates/ERC721Template.sol/ERC721Template.json +1534 -0
- package/artifacts/utils/mock/MockERC20.sol/MockERC20.json +302 -0
- package/artifacts/utils/mock/MockERC20Decimals.sol/MockERC20Decimals.json +302 -0
- package/dist/node/lib.js +1 -1
- package/dist/node/lib.js.map +1 -1
- package/dist/node/lib.module.js +1 -1
- package/dist/node/lib.module.js.map +1 -1
- package/dist/node/lib.umd.js +1 -1
- package/dist/node/lib.umd.js.map +1 -1
- package/dist/node/src/@types/Asset.d.ts +36 -0
- package/dist/node/{ocean/interfaces → src/@types}/Compute.d.ts +21 -12
- package/dist/node/src/@types/DDO/Credentials.d.ts +8 -0
- package/dist/node/src/@types/DDO/DDO.d.ts +15 -0
- package/dist/node/src/@types/DDO/Event.d.ts +7 -0
- package/dist/node/src/@types/DDO/Metadata.d.ts +38 -0
- package/dist/node/src/@types/DDO/Service.d.ts +28 -0
- package/dist/node/src/@types/FileMetadata.d.ts +8 -0
- package/dist/node/src/@types/Provider.d.ts +15 -0
- package/dist/node/src/@types/index.d.ts +8 -0
- package/dist/node/src/aquarius/Aquarius.d.ts +10 -0
- package/dist/node/src/aquarius/index.d.ts +1 -0
- package/dist/node/src/factories/NFTFactory.d.ts +70 -0
- package/dist/node/src/factories/index.d.ts +1 -0
- package/dist/node/src/index.d.ts +8 -0
- package/dist/node/src/interfaces/DispenserInterface.d.ts +7 -0
- package/dist/node/src/interfaces/Erc20Interface.d.ts +11 -0
- package/dist/node/src/interfaces/FixedRateInterface.d.ts +19 -0
- package/dist/node/src/interfaces/PoolInterface.d.ts +36 -0
- package/dist/node/src/interfaces/RouterInterface.d.ts +12 -0
- package/dist/node/src/interfaces/index.d.ts +5 -0
- package/dist/node/{models → src/models}/Config.d.ts +10 -6
- package/dist/node/src/models/index.d.ts +1 -0
- package/dist/node/src/pools/Router.d.ts +46 -0
- package/dist/node/src/pools/balancer/Pool.d.ts +73 -0
- package/dist/node/src/pools/balancer/index.d.ts +1 -0
- package/dist/node/src/pools/dispenser/Dispenser.d.ts +37 -0
- package/dist/node/src/pools/dispenser/index.d.ts +1 -0
- package/dist/node/src/pools/fixedRate/FixedRateExchange.d.ts +95 -0
- package/dist/node/src/pools/fixedRate/index.d.ts +1 -0
- package/dist/node/src/pools/index.d.ts +3 -0
- package/dist/node/src/pools/ssContracts/SideStaking.d.ts +28 -0
- package/dist/node/src/pools/ssContracts/index.d.ts +1 -0
- package/dist/node/src/provider/Provider.d.ts +31 -0
- package/dist/node/src/provider/index.d.ts +1 -0
- package/dist/node/src/tokens/Datatoken.d.ts +77 -0
- package/dist/node/src/tokens/NFT.d.ts +57 -0
- package/dist/node/src/tokens/index.d.ts +2 -0
- package/dist/node/src/utils/ConfigHelper.d.ts +6 -0
- package/dist/node/src/utils/Constants.d.ts +1 -0
- package/dist/node/src/utils/ContractParams.d.ts +4 -0
- package/dist/node/src/utils/ConversionTypeHelper.d.ts +3 -0
- package/dist/node/{utils/Datatokens.d.ts → src/utils/DatatokenName.d.ts} +1 -1
- package/dist/node/src/utils/DdoHelpers.d.ts +2 -0
- package/dist/node/src/utils/FetchHelper.d.ts +5 -0
- package/dist/node/{utils → src/utils}/GasUtils.d.ts +0 -0
- package/dist/node/{utils → src/utils}/Logger.d.ts +0 -0
- package/dist/node/src/utils/SignatureUtils.d.ts +8 -0
- package/dist/node/src/utils/index.d.ts +9 -0
- package/package.json +23 -19
- package/dist/node/Instantiable.abstract.d.ts +0 -25
- package/dist/node/balancer/OceanPool.d.ts +0 -94
- package/dist/node/balancer/Pool.d.ts +0 -55
- package/dist/node/balancer/PoolFactory.d.ts +0 -13
- package/dist/node/datatokens/ContractEvent.d.ts +0 -19
- package/dist/node/datatokens/ContractHandler.d.ts +0 -12
- package/dist/node/datatokens/Datatokens.d.ts +0 -42
- package/dist/node/datatokens/EventHandler.d.ts +0 -19
- package/dist/node/datatokens/Network.d.ts +0 -5
- package/dist/node/datatokens/Web3Provider.d.ts +0 -5
- package/dist/node/datatokens/contracts/ContractBase.d.ts +0 -27
- package/dist/node/ddo/DDO.d.ts +0 -36
- package/dist/node/ddo/interfaces/AdditionalInformation.d.ts +0 -16
- package/dist/node/ddo/interfaces/Authentication.d.ts +0 -4
- package/dist/node/ddo/interfaces/BestPrice.d.ts +0 -10
- package/dist/node/ddo/interfaces/Consumable.d.ts +0 -5
- package/dist/node/ddo/interfaces/Credentials.d.ts +0 -9
- package/dist/node/ddo/interfaces/Curation.d.ts +0 -6
- package/dist/node/ddo/interfaces/DataTokenInfo.d.ts +0 -10
- package/dist/node/ddo/interfaces/EditableMetadata.d.ts +0 -9
- package/dist/node/ddo/interfaces/EditableMetadataLinks.d.ts +0 -5
- package/dist/node/ddo/interfaces/Event.d.ts +0 -7
- package/dist/node/ddo/interfaces/File.d.ts +0 -13
- package/dist/node/ddo/interfaces/Metadata.d.ts +0 -15
- package/dist/node/ddo/interfaces/MetadataAlgorithm.d.ts +0 -12
- package/dist/node/ddo/interfaces/MetadataMain.d.ts +0 -12
- package/dist/node/ddo/interfaces/Proof.d.ts +0 -6
- package/dist/node/ddo/interfaces/PublicKey.d.ts +0 -8
- package/dist/node/ddo/interfaces/PurgatoryData.d.ts +0 -4
- package/dist/node/ddo/interfaces/Service.d.ts +0 -99
- package/dist/node/ddo/interfaces/ServicePrices.d.ts +0 -4
- package/dist/node/ddo/interfaces/Status.d.ts +0 -5
- package/dist/node/ddo/interfaces/index.d.ts +0 -17
- package/dist/node/dispenser/Dispenser.d.ts +0 -42
- package/dist/node/exchange/FixedRateExchange.d.ts +0 -57
- package/dist/node/index.d.ts +0 -1
- package/dist/node/lib.d.ts +0 -15
- package/dist/node/metadatacache/MetadataCache.d.ts +0 -41
- package/dist/node/metadatacache/OnChainMetaData.d.ts +0 -29
- package/dist/node/ocean/Account.d.ts +0 -16
- package/dist/node/ocean/Accounts.d.ts +0 -9
- package/dist/node/ocean/Assets.d.ts +0 -56
- package/dist/node/ocean/AssetsCredential.d.ts +0 -6
- package/dist/node/ocean/Compute.d.ts +0 -75
- package/dist/node/ocean/DID.d.ts +0 -8
- package/dist/node/ocean/EventAccessControl.d.ts +0 -9
- package/dist/node/ocean/Ocean.d.ts +0 -34
- package/dist/node/ocean/OceanAuth.d.ts +0 -15
- package/dist/node/ocean/Versions.d.ts +0 -25
- package/dist/node/ocean/utils/SignatureUtils.d.ts +0 -13
- package/dist/node/ocean/utils/Utils.d.ts +0 -8
- package/dist/node/ocean/utils/WebServiceConnector.d.ts +0 -15
- package/dist/node/provider/Provider.d.ts +0 -49
- package/dist/node/utils/AssetResolverHelper.d.ts +0 -8
- package/dist/node/utils/ConfigHelper.d.ts +0 -13
- package/dist/node/utils/ConversionTypeHelpers.d.ts +0 -8
- package/dist/node/utils/GeneratorHelpers.d.ts +0 -1
- package/dist/node/utils/PromiseResolver.d.ts +0 -3
- package/dist/node/utils/SubscribableObserver.d.ts +0 -12
- package/dist/node/utils/SubscribablePromise.d.ts +0 -14
- package/dist/node/utils/Timeout.d.ts +0 -1
- package/dist/node/utils/index.d.ts +0 -9
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import Web3 from 'web3';
|
|
2
|
-
import { AbiItem } from 'web3-utils/types';
|
|
3
|
-
import { TransactionReceipt } from 'web3-core';
|
|
4
|
-
import { Logger } from '../utils';
|
|
5
|
-
import { PoolFactory } from './PoolFactory';
|
|
6
|
-
export interface TokensToAdd {
|
|
7
|
-
address: string;
|
|
8
|
-
amount: string;
|
|
9
|
-
weight: string;
|
|
10
|
-
}
|
|
11
|
-
export declare class Pool extends PoolFactory {
|
|
12
|
-
poolABI: AbiItem | AbiItem[];
|
|
13
|
-
constructor(web3: Web3, logger: Logger, factoryABI?: AbiItem | AbiItem[], poolABI?: AbiItem | AbiItem[], factoryAddress?: string);
|
|
14
|
-
createPool(account: string): Promise<TransactionReceipt>;
|
|
15
|
-
setup(account: string, poolAddress: string, dataToken: string, dataTokenAmount: string, dataTokenWeight: string, baseToken: string, baseTokenAmount: string, baseTokenWeight: string, swapFee: string): Promise<string>;
|
|
16
|
-
allowance(tokenAdress: string, owner: string, spender: string): Promise<string>;
|
|
17
|
-
approve(account: string, tokenAddress: string, spender: string, amount: string, force?: boolean): Promise<TransactionReceipt | string>;
|
|
18
|
-
sharesBalance(account: string, poolAddress: string): Promise<string>;
|
|
19
|
-
addToPool(account: string, poolAddress: string, tokens: TokensToAdd[]): Promise<void>;
|
|
20
|
-
setSwapFee(account: string, poolAddress: string, fee: string): Promise<TransactionReceipt>;
|
|
21
|
-
finalize(account: string, poolAddress: string): Promise<TransactionReceipt>;
|
|
22
|
-
getNumTokens(poolAddress: string): Promise<string>;
|
|
23
|
-
getPoolSharesTotalSupply(poolAddress: string): Promise<string>;
|
|
24
|
-
getCurrentTokens(poolAddress: string): Promise<string[]>;
|
|
25
|
-
getFinalTokens(poolAddress: string): Promise<string[]>;
|
|
26
|
-
getController(poolAddress: string): Promise<string>;
|
|
27
|
-
setController(account: string, poolAddress: string, controllerAddress: string): Promise<string>;
|
|
28
|
-
isBound(poolAddress: string, token: string): Promise<boolean>;
|
|
29
|
-
getReserve(poolAddress: string, token: string): Promise<string>;
|
|
30
|
-
isFinalized(poolAddress: string): Promise<boolean>;
|
|
31
|
-
getSwapFee(poolAddress: string): Promise<string>;
|
|
32
|
-
getNormalizedWeight(poolAddress: string, token: string): Promise<string>;
|
|
33
|
-
getDenormalizedWeight(poolAddress: string, token: string): Promise<string>;
|
|
34
|
-
getTotalDenormalizedWeight(poolAddress: string): Promise<string>;
|
|
35
|
-
swapExactAmountIn(account: string, poolAddress: string, tokenIn: string, tokenAmountIn: string, tokenOut: string, minAmountOut: string, maxPrice?: string): Promise<TransactionReceipt>;
|
|
36
|
-
swapExactAmountOut(account: string, poolAddress: string, tokenIn: string, maxAmountIn: string, tokenOut: string, minAmountOut: string, maxPrice?: string): Promise<TransactionReceipt>;
|
|
37
|
-
joinPool(account: string, poolAddress: string, poolAmountOut: string, maxAmountsIn: string[]): Promise<TransactionReceipt>;
|
|
38
|
-
exitPool(account: string, poolAddress: string, poolAmountIn: string, minAmountsOut: string[]): Promise<TransactionReceipt>;
|
|
39
|
-
joinswapExternAmountIn(account: string, poolAddress: string, tokenIn: string, tokenAmountIn: string, minPoolAmountOut: string): Promise<TransactionReceipt>;
|
|
40
|
-
joinswapPoolAmountOut(account: string, poolAddress: string, tokenIn: string, poolAmountOut: string, maxAmountIn: string): Promise<TransactionReceipt>;
|
|
41
|
-
exitswapPoolAmountIn(account: string, poolAddress: string, tokenOut: string, poolAmountIn: string, minTokenAmountOut: string): Promise<TransactionReceipt>;
|
|
42
|
-
exitswapExternAmountOut(account: string, poolAddress: string, tokenOut: string, tokenAmountOut: string, maxPoolAmountIn: string): Promise<TransactionReceipt>;
|
|
43
|
-
getSpotPrice(poolAddress: string, tokenIn: string, tokenOut: string): Promise<string>;
|
|
44
|
-
getSpotPriceSansFee(poolAddress: string, tokenIn: string, tokenOut: string): Promise<string>;
|
|
45
|
-
calcSpotPrice(poolAddress: string, tokenBalanceIn: string, tokenWeightIn: string, tokenBalanceOut: string, tokenWeightOut: string, swapFee: string): Promise<string>;
|
|
46
|
-
calcInGivenOut(poolAddress: string, tokenBalanceIn: string, tokenWeightIn: string, tokenBalanceOut: string, tokenWeightOut: string, tokenAmountOut: string, swapFee: string): Promise<string>;
|
|
47
|
-
calcOutGivenIn(poolAddress: string, tokenBalanceIn: string, tokenWeightIn: string, tokenBalanceOut: string, tokenWeightOut: string, tokenAmountIn: string, swapFee: string): Promise<string>;
|
|
48
|
-
calcPoolOutGivenSingleIn(poolAddress: string, tokenBalanceIn: string, tokenWeightIn: string, poolSupply: string, totalWeight: string, tokenAmountIn: string, swapFee: string): Promise<string>;
|
|
49
|
-
calcSingleInGivenPoolOut(poolAddress: string, tokenBalanceIn: string, tokenWeightIn: string, poolSupply: string, totalWeight: string, poolAmountOut: string, swapFee: string): Promise<string>;
|
|
50
|
-
calcSingleOutGivenPoolIn(poolAddress: string, tokenBalanceOut: string, tokenWeightOut: string, poolSupply: string, totalWeight: string, poolAmountIn: string, swapFee: string): Promise<string>;
|
|
51
|
-
calcPoolInGivenSingleOut(poolAddress: string, tokenBalanceOut: string, tokenWeightOut: string, poolSupply: string, totalWeight: string, tokenAmountOut: string, swapFee: string): Promise<string>;
|
|
52
|
-
getSwapEventSignature(): string;
|
|
53
|
-
getJoinEventSignature(): string;
|
|
54
|
-
getExitEventSignature(): string;
|
|
55
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import Web3 from 'web3';
|
|
2
|
-
import { AbiItem } from 'web3-utils/types';
|
|
3
|
-
import { Logger } from '../utils';
|
|
4
|
-
import { TransactionReceipt } from 'web3-core';
|
|
5
|
-
export declare class PoolFactory {
|
|
6
|
-
GASLIMIT_DEFAULT: number;
|
|
7
|
-
web3: Web3;
|
|
8
|
-
factoryABI: AbiItem | AbiItem[];
|
|
9
|
-
factoryAddress: string;
|
|
10
|
-
logger: Logger;
|
|
11
|
-
constructor(web3: Web3, logger: Logger, factoryABI?: AbiItem | AbiItem[], factoryAddress?: string);
|
|
12
|
-
createPool(account: string): Promise<TransactionReceipt>;
|
|
13
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { EventData, Filter } from 'web3-eth-contract';
|
|
2
|
-
import ContractBase from './contracts/ContractBase';
|
|
3
|
-
interface EventEmitter {
|
|
4
|
-
subscribe: (onEvent: (blockNumber: number) => void) => void;
|
|
5
|
-
unsubscribe: (onEvent: (blockNumber: number) => void) => void;
|
|
6
|
-
}
|
|
7
|
-
export interface ContractEventSubscription {
|
|
8
|
-
unsubscribe: () => void;
|
|
9
|
-
}
|
|
10
|
-
export declare class ContractEvent {
|
|
11
|
-
private eventEmitter;
|
|
12
|
-
private contract;
|
|
13
|
-
private eventName;
|
|
14
|
-
private filter;
|
|
15
|
-
constructor(eventEmitter: EventEmitter, contract: ContractBase, eventName: string, filter: Filter);
|
|
16
|
-
subscribe(callback: (events: EventData[]) => void): ContractEventSubscription;
|
|
17
|
-
once(callback?: (events: EventData[]) => void): Promise<any[]>;
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Contract } from 'web3-eth-contract';
|
|
2
|
-
import { Instantiable, InstantiableConfig } from '../Instantiable.abstract';
|
|
3
|
-
export default class ContractHandler extends Instantiable {
|
|
4
|
-
protected static getContract(what: string, networkId: number): Contract;
|
|
5
|
-
protected static setContract(what: string, networkId: number, contractInstance: Contract): void;
|
|
6
|
-
protected static hasContract(what: string, networkId: number): boolean;
|
|
7
|
-
private static contracts;
|
|
8
|
-
private static getHash;
|
|
9
|
-
constructor(config: InstantiableConfig);
|
|
10
|
-
get(what: string, optional?: boolean): Promise<Contract>;
|
|
11
|
-
private load;
|
|
12
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import Web3 from 'web3';
|
|
2
|
-
import { AbiItem } from 'web3-utils/types';
|
|
3
|
-
import { Logger } from '../utils';
|
|
4
|
-
import { TransactionReceipt } from 'web3-core';
|
|
5
|
-
export declare class DataTokens {
|
|
6
|
-
GASLIMIT_DEFAULT: number;
|
|
7
|
-
factoryAddress: string;
|
|
8
|
-
factoryABI: AbiItem | AbiItem[];
|
|
9
|
-
datatokensABI: AbiItem | AbiItem[];
|
|
10
|
-
web3: Web3;
|
|
11
|
-
private logger;
|
|
12
|
-
startBlock: number;
|
|
13
|
-
constructor(factoryAddress: string, factoryABI: AbiItem | AbiItem[], datatokensABI: AbiItem | AbiItem[], web3: Web3, logger: Logger, startBlock?: number);
|
|
14
|
-
generateDtName(wordList?: {
|
|
15
|
-
nouns: string[];
|
|
16
|
-
adjectives: string[];
|
|
17
|
-
}): {
|
|
18
|
-
name: string;
|
|
19
|
-
symbol: string;
|
|
20
|
-
};
|
|
21
|
-
create(metadataCacheUri: string, address: string, cap?: string, name?: string, symbol?: string): Promise<string>;
|
|
22
|
-
approve(dataTokenAddress: string, spender: string, amount: string, address: string): Promise<TransactionReceipt>;
|
|
23
|
-
mint(dataTokenAddress: string, address: string, amount: string, toAddress?: string): Promise<TransactionReceipt>;
|
|
24
|
-
transfer(dataTokenAddress: string, toAddress: string, amount: string, address: string): Promise<TransactionReceipt>;
|
|
25
|
-
transferToken(dataTokenAddress: string, toAddress: string, amount: string, address: string): Promise<TransactionReceipt>;
|
|
26
|
-
transferWei(dataTokenAddress: string, toAddress: string, amount: string, address: string): Promise<TransactionReceipt>;
|
|
27
|
-
transferFrom(dataTokenAddress: string, fromAddress: string, amount: string, address: string): Promise<string>;
|
|
28
|
-
balance(dataTokenAddress: string, address: string): Promise<string>;
|
|
29
|
-
allowance(dataTokenAddress: string, owner: string, spender: string): Promise<string>;
|
|
30
|
-
getBlob(dataTokenAddress: string): Promise<string>;
|
|
31
|
-
getName(dataTokenAddress: string): Promise<string>;
|
|
32
|
-
getSymbol(dataTokenAddress: string): Promise<string>;
|
|
33
|
-
getCap(dataTokenAddress: string): Promise<string>;
|
|
34
|
-
toWei(amount: string): string;
|
|
35
|
-
fromWei(amount: string): string;
|
|
36
|
-
startOrder(dataTokenAddress: string, consumer: string, amount: string, serviceId: number, mpFeeAddress: string, address: string): Promise<TransactionReceipt>;
|
|
37
|
-
getPreviousValidOrders(dataTokenAddress: string, amount: string, serviceId: number, timeout: number, address: string): Promise<string>;
|
|
38
|
-
getStartOrderEventSignature(): string;
|
|
39
|
-
proposeMinter(dataTokenAddress: string, newMinterAddress: string, address: string): Promise<TransactionReceipt>;
|
|
40
|
-
approveMinter(dataTokenAddress: string, address: string): Promise<TransactionReceipt>;
|
|
41
|
-
isMinter(dataTokenAddress: string, address: string): Promise<boolean>;
|
|
42
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ContractEvent } from './ContractEvent';
|
|
2
|
-
import ContractBase from './contracts/ContractBase';
|
|
3
|
-
import { Instantiable, InstantiableConfig } from '../Instantiable.abstract';
|
|
4
|
-
import { Filter } from 'web3-eth-contract';
|
|
5
|
-
export declare class EventHandler extends Instantiable {
|
|
6
|
-
get count(): number;
|
|
7
|
-
private events;
|
|
8
|
-
private lastBlock;
|
|
9
|
-
private interval;
|
|
10
|
-
private polling;
|
|
11
|
-
private lastTimeout;
|
|
12
|
-
constructor(config: InstantiableConfig);
|
|
13
|
-
subscribe(callback: (blockNumber: number) => void): {
|
|
14
|
-
unsubscribe: () => void;
|
|
15
|
-
};
|
|
16
|
-
unsubscribe(callback: (blockNumber: number) => void): void;
|
|
17
|
-
getEvent(contract: ContractBase, eventName: string, filter: Filter): ContractEvent;
|
|
18
|
-
private checkBlock;
|
|
19
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { EventData, EventOptions, Filter } from 'web3-eth-contract';
|
|
2
|
-
import { TransactionReceipt } from 'web3-core';
|
|
3
|
-
import { Instantiable, InstantiableConfig } from '../../Instantiable.abstract';
|
|
4
|
-
export interface EventDataOptions extends EventOptions {
|
|
5
|
-
fromBlock: string | number;
|
|
6
|
-
toBlock: string | number;
|
|
7
|
-
}
|
|
8
|
-
export declare abstract class ContractBase extends Instantiable {
|
|
9
|
-
private optional;
|
|
10
|
-
protected static instance: any;
|
|
11
|
-
contractName: string;
|
|
12
|
-
private contract;
|
|
13
|
-
get address(): string;
|
|
14
|
-
constructor(contractName: string, optional?: boolean);
|
|
15
|
-
getEventData(eventName: string, options: EventDataOptions): Promise<EventData[]>;
|
|
16
|
-
getPastEvents(eventName: string, filter: Filter): Promise<EventData[]>;
|
|
17
|
-
getAddress(): string;
|
|
18
|
-
getSignatureOfMethod(methodName: string): string;
|
|
19
|
-
getInputsOfMethod(methodName: string): any[];
|
|
20
|
-
protected init(config: InstantiableConfig): Promise<void>;
|
|
21
|
-
protected getFromAddress(from?: string): Promise<string>;
|
|
22
|
-
protected sendFrom(name: string, args: any[], from?: string): Promise<TransactionReceipt>;
|
|
23
|
-
protected send(name: string, from: string, args: any[]): Promise<TransactionReceipt>;
|
|
24
|
-
protected call<T extends any>(name: string, args: any[], from?: string): Promise<T>;
|
|
25
|
-
private searchMethod;
|
|
26
|
-
}
|
|
27
|
-
export default ContractBase;
|
package/dist/node/ddo/DDO.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Ocean } from '../ocean/Ocean';
|
|
2
|
-
import { Authentication } from './interfaces/Authentication';
|
|
3
|
-
import { Proof } from './interfaces/Proof';
|
|
4
|
-
import { PublicKey } from './interfaces/PublicKey';
|
|
5
|
-
import { Service, ServiceType } from './interfaces/Service';
|
|
6
|
-
import { BestPrice } from './interfaces/BestPrice';
|
|
7
|
-
import { DataTokenInfo } from './interfaces/DataTokenInfo';
|
|
8
|
-
import { PurgatoryData } from './interfaces/PurgatoryData';
|
|
9
|
-
import { Credentials } from './interfaces/Credentials';
|
|
10
|
-
import { Event } from './interfaces/Event';
|
|
11
|
-
export declare class DDO {
|
|
12
|
-
static serialize(ddo: DDO): string;
|
|
13
|
-
static deserialize(ddoString: string): DDO;
|
|
14
|
-
'@context': string;
|
|
15
|
-
id: string;
|
|
16
|
-
created: string;
|
|
17
|
-
updated: string;
|
|
18
|
-
dataToken: string;
|
|
19
|
-
publicKey: PublicKey[];
|
|
20
|
-
authentication: Authentication[];
|
|
21
|
-
service: Service[];
|
|
22
|
-
proof: Proof;
|
|
23
|
-
price: BestPrice;
|
|
24
|
-
isInPurgatory: 'false' | 'true';
|
|
25
|
-
purgatoryData?: PurgatoryData;
|
|
26
|
-
dataTokenInfo?: DataTokenInfo;
|
|
27
|
-
credentials?: Credentials;
|
|
28
|
-
chainId?: number;
|
|
29
|
-
event?: Event;
|
|
30
|
-
constructor(ddo?: Partial<DDO>);
|
|
31
|
-
shortId(): string;
|
|
32
|
-
findServiceById<T extends ServiceType>(index: number): Service<T>;
|
|
33
|
-
findServiceByType<T extends ServiceType>(serviceType: T): Service<T>;
|
|
34
|
-
getChecksum(): string;
|
|
35
|
-
addProof(ocean: Ocean, publicKey: string, password?: string): Promise<void>;
|
|
36
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface AdditionalInformation {
|
|
2
|
-
description?: string;
|
|
3
|
-
copyrightHolder?: string;
|
|
4
|
-
workExample?: string;
|
|
5
|
-
links?: {
|
|
6
|
-
[name: string]: string;
|
|
7
|
-
}[];
|
|
8
|
-
inLanguage?: string;
|
|
9
|
-
categories?: string[];
|
|
10
|
-
tags?: string[];
|
|
11
|
-
updateFrequency?: string;
|
|
12
|
-
structuredMarkup?: {
|
|
13
|
-
uri: string;
|
|
14
|
-
mediaType: string;
|
|
15
|
-
}[];
|
|
16
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface File {
|
|
2
|
-
name?: string;
|
|
3
|
-
url?: string;
|
|
4
|
-
index?: number;
|
|
5
|
-
contentType: string;
|
|
6
|
-
checksum?: string;
|
|
7
|
-
checksumType?: string;
|
|
8
|
-
contentLength?: string;
|
|
9
|
-
resourceId?: string;
|
|
10
|
-
encoding?: string;
|
|
11
|
-
compression?: string;
|
|
12
|
-
valid?: boolean;
|
|
13
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { MetadataMain } from './MetadataMain';
|
|
2
|
-
import { AdditionalInformation } from './AdditionalInformation';
|
|
3
|
-
import { Curation } from './Curation';
|
|
4
|
-
import { Status } from './Status';
|
|
5
|
-
export interface Metadata {
|
|
6
|
-
main: MetadataMain;
|
|
7
|
-
encryptedFiles?: string;
|
|
8
|
-
additionalInformation?: AdditionalInformation;
|
|
9
|
-
curation?: Curation;
|
|
10
|
-
status?: Status;
|
|
11
|
-
}
|
|
12
|
-
export interface ValidateMetadata {
|
|
13
|
-
valid: Boolean;
|
|
14
|
-
errors?: Object;
|
|
15
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { MetadataAlgorithm } from './MetadataAlgorithm';
|
|
2
|
-
import { File } from './File';
|
|
3
|
-
export interface MetadataMain {
|
|
4
|
-
name: string;
|
|
5
|
-
type: 'dataset' | 'algorithm';
|
|
6
|
-
dateCreated: string;
|
|
7
|
-
datePublished?: string;
|
|
8
|
-
author: string;
|
|
9
|
-
license: string;
|
|
10
|
-
files: File[];
|
|
11
|
-
algorithm?: MetadataAlgorithm;
|
|
12
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { Metadata } from './Metadata';
|
|
2
|
-
import { Status } from './Status';
|
|
3
|
-
export interface ServiceCustomParameter {
|
|
4
|
-
name: string;
|
|
5
|
-
type: string;
|
|
6
|
-
label: string;
|
|
7
|
-
required: boolean;
|
|
8
|
-
options?: any;
|
|
9
|
-
description: string;
|
|
10
|
-
}
|
|
11
|
-
export interface ServiceCustomParametersRequired {
|
|
12
|
-
userCustomParameters?: ServiceCustomParameter[];
|
|
13
|
-
algoCustomParameters?: ServiceCustomParameter[];
|
|
14
|
-
}
|
|
15
|
-
export declare type ServiceType = 'authorization' | 'metadata' | 'access' | 'compute';
|
|
16
|
-
export interface ServiceCommonAttributes extends ServiceCustomParametersRequired {
|
|
17
|
-
main: {
|
|
18
|
-
[key: string]: any;
|
|
19
|
-
};
|
|
20
|
-
additionalInformation?: {
|
|
21
|
-
[key: string]: any;
|
|
22
|
-
};
|
|
23
|
-
status?: Status;
|
|
24
|
-
}
|
|
25
|
-
export interface ServiceCommon {
|
|
26
|
-
type: ServiceType;
|
|
27
|
-
index: number;
|
|
28
|
-
serviceEndpoint?: string;
|
|
29
|
-
attributes: ServiceCommonAttributes;
|
|
30
|
-
}
|
|
31
|
-
export interface ServiceAccessAttributes extends ServiceCommonAttributes {
|
|
32
|
-
main: {
|
|
33
|
-
creator: string;
|
|
34
|
-
name: string;
|
|
35
|
-
datePublished: string;
|
|
36
|
-
cost: string;
|
|
37
|
-
timeout: number;
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
export interface publisherTrustedAlgorithm {
|
|
41
|
-
did: string;
|
|
42
|
-
filesChecksum: string;
|
|
43
|
-
containerSectionChecksum: string;
|
|
44
|
-
}
|
|
45
|
-
export interface ServiceComputePrivacy {
|
|
46
|
-
allowRawAlgorithm?: boolean;
|
|
47
|
-
allowNetworkAccess?: boolean;
|
|
48
|
-
allowAllPublishedAlgorithms?: boolean;
|
|
49
|
-
publisherTrustedAlgorithms?: publisherTrustedAlgorithm[];
|
|
50
|
-
}
|
|
51
|
-
export interface ServiceComputeProvider {
|
|
52
|
-
type: string;
|
|
53
|
-
description: string;
|
|
54
|
-
environment: {
|
|
55
|
-
cluster: {
|
|
56
|
-
type: string;
|
|
57
|
-
url: string;
|
|
58
|
-
};
|
|
59
|
-
supportedContainers: {
|
|
60
|
-
image: string;
|
|
61
|
-
tag: string;
|
|
62
|
-
checksum: string;
|
|
63
|
-
}[];
|
|
64
|
-
supportedServers: {
|
|
65
|
-
serverId: string;
|
|
66
|
-
serverType: string;
|
|
67
|
-
cost: string;
|
|
68
|
-
cpu: string;
|
|
69
|
-
gpu: string;
|
|
70
|
-
memory: string;
|
|
71
|
-
disk: string;
|
|
72
|
-
maxExecutionTime: number;
|
|
73
|
-
}[];
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
export interface ServiceComputeAttributes extends ServiceCommonAttributes {
|
|
77
|
-
main: {
|
|
78
|
-
creator: string;
|
|
79
|
-
datePublished: string;
|
|
80
|
-
cost: string;
|
|
81
|
-
timeout: number;
|
|
82
|
-
provider?: ServiceComputeProvider;
|
|
83
|
-
name: string;
|
|
84
|
-
privacy?: ServiceComputePrivacy;
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
export interface ServiceMetadata extends ServiceCommon {
|
|
88
|
-
type: 'metadata';
|
|
89
|
-
attributes: Metadata;
|
|
90
|
-
}
|
|
91
|
-
export interface ServiceAccess extends ServiceCommon {
|
|
92
|
-
type: 'access';
|
|
93
|
-
attributes: ServiceAccessAttributes;
|
|
94
|
-
}
|
|
95
|
-
export interface ServiceCompute extends ServiceCommon {
|
|
96
|
-
type: 'compute';
|
|
97
|
-
attributes: ServiceComputeAttributes;
|
|
98
|
-
}
|
|
99
|
-
export declare type Service<T extends ServiceType | 'default' = 'default'> = T extends 'metadata' ? ServiceMetadata : T extends 'access' ? ServiceAccess : T extends 'compute' ? ServiceCompute : T extends 'default' ? ServiceCommon : ServiceCommon;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export * from './AdditionalInformation';
|
|
2
|
-
export * from './Authentication';
|
|
3
|
-
export * from './BestPrice';
|
|
4
|
-
export * from './Curation';
|
|
5
|
-
export * from './EditableMetadata';
|
|
6
|
-
export * from './EditableMetadataLinks';
|
|
7
|
-
export * from './Event';
|
|
8
|
-
export * from './File';
|
|
9
|
-
export * from './Metadata';
|
|
10
|
-
export * from './MetadataAlgorithm';
|
|
11
|
-
export * from './MetadataMain';
|
|
12
|
-
export * from './Proof';
|
|
13
|
-
export * from './PublicKey';
|
|
14
|
-
export * from './Service';
|
|
15
|
-
export * from './ServicePrices';
|
|
16
|
-
export * from './PurgatoryData';
|
|
17
|
-
export * from './Credentials';
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { TransactionReceipt } from 'web3-core';
|
|
2
|
-
import { Contract } from 'web3-eth-contract';
|
|
3
|
-
import { AbiItem } from 'web3-utils/types';
|
|
4
|
-
import Web3 from 'web3';
|
|
5
|
-
import { SubscribablePromise, Logger } from '../utils';
|
|
6
|
-
import { DataTokens } from '../datatokens/Datatokens';
|
|
7
|
-
export interface DispenserToken {
|
|
8
|
-
active: boolean;
|
|
9
|
-
owner: string;
|
|
10
|
-
minterApproved: boolean;
|
|
11
|
-
isTrueMinter: boolean;
|
|
12
|
-
maxTokens: string;
|
|
13
|
-
maxBalance: string;
|
|
14
|
-
balance: string;
|
|
15
|
-
}
|
|
16
|
-
export declare enum DispenserMakeMinterProgressStep {
|
|
17
|
-
MakeDispenserMinter = 0,
|
|
18
|
-
AcceptingNewMinter = 1
|
|
19
|
-
}
|
|
20
|
-
export declare enum DispenserCancelMinterProgressStep {
|
|
21
|
-
MakeOwnerMinter = 0,
|
|
22
|
-
AcceptingNewMinter = 1
|
|
23
|
-
}
|
|
24
|
-
export declare class OceanDispenser {
|
|
25
|
-
GASLIMIT_DEFAULT: number;
|
|
26
|
-
dispenserAddress: string;
|
|
27
|
-
dispenserABI: AbiItem | AbiItem[];
|
|
28
|
-
web3: Web3;
|
|
29
|
-
contract: Contract;
|
|
30
|
-
private logger;
|
|
31
|
-
datatokens: DataTokens;
|
|
32
|
-
startBlock: number;
|
|
33
|
-
constructor(web3: Web3, logger: Logger, dispenserAddress: string, dispenserABI: AbiItem | AbiItem[], datatokens: DataTokens, startBlock?: number);
|
|
34
|
-
status(dataTokenAddress: string): Promise<DispenserToken>;
|
|
35
|
-
activate(dataToken: string, maxTokens: string, maxBalance: string, address: string): Promise<TransactionReceipt>;
|
|
36
|
-
deactivate(dataToken: string, address: string): Promise<TransactionReceipt>;
|
|
37
|
-
makeMinter(dataToken: string, address: string): SubscribablePromise<DispenserMakeMinterProgressStep, TransactionReceipt>;
|
|
38
|
-
cancelMinter(dataToken: string, address: string): SubscribablePromise<DispenserCancelMinterProgressStep, TransactionReceipt>;
|
|
39
|
-
dispense(dataToken: string, address: string, amount?: string): Promise<TransactionReceipt>;
|
|
40
|
-
ownerWithdraw(dataToken: string, address: string): Promise<TransactionReceipt>;
|
|
41
|
-
isDispensable(dataToken: string, address: string, amount?: string): Promise<Boolean>;
|
|
42
|
-
}
|