@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.
- package/CHANGELOG.md +18 -0
- package/dist/lib.js +1 -1
- package/dist/lib.js.map +1 -1
- package/dist/lib.modern.js +1 -1
- package/dist/lib.modern.js.map +1 -1
- package/dist/lib.module.js +1 -1
- package/dist/lib.module.js.map +1 -1
- package/dist/lib.umd.js +1 -1
- package/dist/lib.umd.js.map +1 -1
- package/dist/src/@types/Asset.d.ts +148 -148
- package/dist/src/@types/Compute.d.ts +71 -71
- package/dist/src/@types/Contracts.d.ts +26 -26
- package/dist/src/@types/DDO/ConsumerParameter.d.ts +37 -37
- package/dist/src/@types/DDO/Credentials.d.ts +8 -8
- package/dist/src/@types/DDO/DDO.d.ts +55 -55
- package/dist/src/@types/DDO/Event.d.ts +27 -27
- package/dist/src/@types/DDO/Metadata.d.ts +141 -141
- package/dist/src/@types/DDO/Service.d.ts +100 -100
- package/dist/src/@types/Datatoken.d.ts +38 -38
- package/dist/src/@types/Dispenser.d.ts +16 -16
- package/dist/src/@types/DownloadResponse.d.ts +4 -4
- package/dist/src/@types/File.d.ts +89 -89
- package/dist/src/@types/FileInfo.d.ts +43 -43
- package/dist/src/@types/FixedPrice.d.ts +51 -51
- package/dist/src/@types/NFT.d.ts +18 -18
- package/dist/src/@types/NFTFactory.d.ts +20 -20
- package/dist/src/@types/Provider.d.ts +33 -33
- package/dist/src/@types/ReturnTypes.d.ts +3 -3
- package/dist/src/@types/Router.d.ts +59 -59
- package/dist/src/@types/index.d.ts +20 -20
- package/dist/src/config/Config.d.ts +153 -153
- package/dist/src/config/ConfigHelper.d.ts +12 -12
- package/dist/src/config/index.d.ts +2 -2
- package/dist/src/contracts/Datatoken.d.ts +278 -260
- package/dist/src/contracts/Dispenser.d.ts +73 -73
- package/dist/src/contracts/FixedRateExchange.d.ts +209 -209
- package/dist/src/contracts/NFT.d.ts +220 -220
- package/dist/src/contracts/NFTFactory.d.ts +165 -165
- package/dist/src/contracts/Router.d.ts +107 -107
- package/dist/src/contracts/SmartContract.d.ts +45 -45
- package/dist/src/contracts/SmartContractWithAddress.d.ts +17 -17
- package/dist/src/contracts/df/DfRewards.d.ts +31 -31
- package/dist/src/contracts/df/DfStrategyV1.d.ts +21 -21
- package/dist/src/contracts/index.d.ts +14 -14
- package/dist/src/contracts/ve/VeAllocate.d.ts +38 -38
- package/dist/src/contracts/ve/VeFeeDistributor.d.ts +29 -29
- package/dist/src/contracts/ve/VeFeeEstimate.d.ts +14 -14
- package/dist/src/contracts/ve/VeOcean.d.ts +68 -68
- package/dist/src/index.d.ts +5 -5
- package/dist/src/services/Aquarius.d.ts +53 -53
- package/dist/src/services/Provider.d.ts +197 -197
- package/dist/src/services/index.d.ts +2 -2
- package/dist/src/utils/Constants.d.ts +4 -4
- package/dist/src/utils/ContractUtils.d.ts +46 -46
- package/dist/src/utils/DatatokenName.d.ts +14 -14
- package/dist/src/utils/DdoHelpers.d.ts +13 -13
- package/dist/src/utils/FetchHelper.d.ts +14 -14
- package/dist/src/utils/General.d.ts +5 -5
- package/dist/src/utils/Logger.d.ts +19 -19
- package/dist/src/utils/OrderUtils.d.ts +20 -0
- package/dist/src/utils/ProviderErrors.d.ts +1 -1
- package/dist/src/utils/SignatureUtils.d.ts +12 -12
- package/dist/src/utils/TokenUtils.d.ts +70 -70
- package/dist/src/utils/index.d.ts +12 -11
- package/dist/src/utils/minAbi.d.ts +38 -38
- package/dist/test/config.d.ts +19 -19
- package/dist/test/integration/CodeExamples.test.d.ts +1 -1
- package/dist/test/integration/ComputeExamples.test.d.ts +1 -1
- package/dist/test/integration/ComputeFlow.test.d.ts +1 -1
- package/dist/test/integration/Provider.test.d.ts +1 -1
- package/dist/test/integration/PublishEditConsume.test.d.ts +1 -1
- package/dist/test/integration/PublishFlows.test.d.ts +1 -1
- package/dist/test/integration/helpers.d.ts +7 -7
- package/dist/test/unit/DFRewards.test.d.ts +1 -1
- package/dist/test/unit/Datatoken.test.d.ts +1 -1
- package/dist/test/unit/Dispenser.test.d.ts +1 -1
- package/dist/test/unit/FixedRateExchange.test.d.ts +1 -1
- package/dist/test/unit/Nft.test.d.ts +1 -1
- package/dist/test/unit/NftFactory.test.d.ts +1 -1
- package/dist/test/unit/Router.test.d.ts +1 -1
- package/dist/test/unit/veOcean.test.d.ts +1 -1
- package/package.json +5 -5
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { Signer, Contract } from 'ethers';
|
|
2
|
-
import { AbiItem } from '../@types';
|
|
3
|
-
import { Config } from '../config';
|
|
4
|
-
import { SmartContract } from './SmartContract';
|
|
5
|
-
export declare abstract class SmartContractWithAddress extends SmartContract {
|
|
6
|
-
address: string;
|
|
7
|
-
contract: Contract;
|
|
8
|
-
/**
|
|
9
|
-
* Instantiate the smart contract.
|
|
10
|
-
* @param {string} address The address of the contract.
|
|
11
|
-
* @param {Signer} signer The signer object.
|
|
12
|
-
* @param {string | number} network Network id or name
|
|
13
|
-
* @param {Config} config The configuration object.
|
|
14
|
-
* @param {AbiItem[]} abi ABI array of the smart contract
|
|
15
|
-
*/
|
|
16
|
-
constructor(address: string, signer: Signer, network?: string | number, config?: Config, abi?: AbiItem[]);
|
|
17
|
-
}
|
|
1
|
+
import { Signer, Contract } from 'ethers';
|
|
2
|
+
import { AbiItem } from '../@types';
|
|
3
|
+
import { Config } from '../config';
|
|
4
|
+
import { SmartContract } from './SmartContract';
|
|
5
|
+
export declare abstract class SmartContractWithAddress extends SmartContract {
|
|
6
|
+
address: string;
|
|
7
|
+
contract: Contract;
|
|
8
|
+
/**
|
|
9
|
+
* Instantiate the smart contract.
|
|
10
|
+
* @param {string} address The address of the contract.
|
|
11
|
+
* @param {Signer} signer The signer object.
|
|
12
|
+
* @param {string | number} network Network id or name
|
|
13
|
+
* @param {Config} config The configuration object.
|
|
14
|
+
* @param {AbiItem[]} abi ABI array of the smart contract
|
|
15
|
+
*/
|
|
16
|
+
constructor(address: string, signer: Signer, network?: string | number, config?: Config, abi?: AbiItem[]);
|
|
17
|
+
}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { SmartContractWithAddress } from '../SmartContractWithAddress';
|
|
2
|
-
import { AbiItem, ReceiptOrEstimate } from '../../@types';
|
|
3
|
-
/**
|
|
4
|
-
* Provides an interface for DFRewards contract
|
|
5
|
-
*/
|
|
6
|
-
export declare class DfRewards extends SmartContractWithAddress {
|
|
7
|
-
getDefaultAbi(): AbiItem[];
|
|
8
|
-
/** Get available DF Rewards for a token
|
|
9
|
-
* @param {String} userAddress user address
|
|
10
|
-
* @param {String} tokenAddress token address
|
|
11
|
-
* @return {Promise<string>}
|
|
12
|
-
*/
|
|
13
|
-
getAvailableRewards(userAddress: string, tokenAddress: string): Promise<string>;
|
|
14
|
-
/**
|
|
15
|
-
* claim rewards for any address
|
|
16
|
-
* @param {String} userAddress user address to claim
|
|
17
|
-
* @param {String} tokenAddress token address
|
|
18
|
-
* @param {Boolean} estimateGas if True, return gas estimate
|
|
19
|
-
* @return {Promise<ReceiptOrEstimate>}
|
|
20
|
-
*/
|
|
21
|
-
claimRewards<G extends boolean = false>(userAddress: string, tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
22
|
-
/**
|
|
23
|
-
* allocate rewards to address. An approve must exist before calling this function.
|
|
24
|
-
* @param {String[]} userAddresses array of users that will receive rewards
|
|
25
|
-
* @param {String[]} amounts array of amounts
|
|
26
|
-
* @param {String} tokenAddress token address
|
|
27
|
-
* @param {Boolean} estimateGas if True, return gas estimate
|
|
28
|
-
* @return {Promise<ReceiptOrEstimate>}
|
|
29
|
-
*/
|
|
30
|
-
allocateRewards<G extends boolean = false>(userAddresses: string[], amounts: string[], tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
31
|
-
}
|
|
1
|
+
import { SmartContractWithAddress } from '../SmartContractWithAddress';
|
|
2
|
+
import { AbiItem, ReceiptOrEstimate } from '../../@types';
|
|
3
|
+
/**
|
|
4
|
+
* Provides an interface for DFRewards contract
|
|
5
|
+
*/
|
|
6
|
+
export declare class DfRewards extends SmartContractWithAddress {
|
|
7
|
+
getDefaultAbi(): AbiItem[];
|
|
8
|
+
/** Get available DF Rewards for a token
|
|
9
|
+
* @param {String} userAddress user address
|
|
10
|
+
* @param {String} tokenAddress token address
|
|
11
|
+
* @return {Promise<string>}
|
|
12
|
+
*/
|
|
13
|
+
getAvailableRewards(userAddress: string, tokenAddress: string): Promise<string>;
|
|
14
|
+
/**
|
|
15
|
+
* claim rewards for any address
|
|
16
|
+
* @param {String} userAddress user address to claim
|
|
17
|
+
* @param {String} tokenAddress token address
|
|
18
|
+
* @param {Boolean} estimateGas if True, return gas estimate
|
|
19
|
+
* @return {Promise<ReceiptOrEstimate>}
|
|
20
|
+
*/
|
|
21
|
+
claimRewards<G extends boolean = false>(userAddress: string, tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
22
|
+
/**
|
|
23
|
+
* allocate rewards to address. An approve must exist before calling this function.
|
|
24
|
+
* @param {String[]} userAddresses array of users that will receive rewards
|
|
25
|
+
* @param {String[]} amounts array of amounts
|
|
26
|
+
* @param {String} tokenAddress token address
|
|
27
|
+
* @param {Boolean} estimateGas if True, return gas estimate
|
|
28
|
+
* @return {Promise<ReceiptOrEstimate>}
|
|
29
|
+
*/
|
|
30
|
+
allocateRewards<G extends boolean = false>(userAddresses: string[], amounts: string[], tokenAddress: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
31
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { SmartContractWithAddress } from '../SmartContractWithAddress';
|
|
2
|
-
import { ReceiptOrEstimate, AbiItem } from '../../@types';
|
|
3
|
-
/**
|
|
4
|
-
* Provides an interface for dfStrategyV1 contract
|
|
5
|
-
*/
|
|
6
|
-
export declare class DfStrategyV1 extends SmartContractWithAddress {
|
|
7
|
-
getDefaultAbi(): AbiItem[];
|
|
8
|
-
/** Get available DF Rewards for multiple tokens
|
|
9
|
-
* @param {String} userAddress user address
|
|
10
|
-
* @param {String} tokenAddresses array of tokens
|
|
11
|
-
* @return {Promise<string[]>}
|
|
12
|
-
*/
|
|
13
|
-
getMultipleAvailableRewards(userAddress: string, tokenAddresses: string[]): Promise<string[]>;
|
|
14
|
-
/**
|
|
15
|
-
* claim multiple token rewards for any address
|
|
16
|
-
* @param {String} userAddress user address to claim
|
|
17
|
-
* @param {String} tokenAddresses array of tokens
|
|
18
|
-
* @return {Promise<ReceiptOrEstimate>}
|
|
19
|
-
*/
|
|
20
|
-
claimMultipleRewards<G extends boolean = false>(userAddress: string, tokenAddresses: string[], estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
21
|
-
}
|
|
1
|
+
import { SmartContractWithAddress } from '../SmartContractWithAddress';
|
|
2
|
+
import { ReceiptOrEstimate, AbiItem } from '../../@types';
|
|
3
|
+
/**
|
|
4
|
+
* Provides an interface for dfStrategyV1 contract
|
|
5
|
+
*/
|
|
6
|
+
export declare class DfStrategyV1 extends SmartContractWithAddress {
|
|
7
|
+
getDefaultAbi(): AbiItem[];
|
|
8
|
+
/** Get available DF Rewards for multiple tokens
|
|
9
|
+
* @param {String} userAddress user address
|
|
10
|
+
* @param {String} tokenAddresses array of tokens
|
|
11
|
+
* @return {Promise<string[]>}
|
|
12
|
+
*/
|
|
13
|
+
getMultipleAvailableRewards(userAddress: string, tokenAddresses: string[]): Promise<string[]>;
|
|
14
|
+
/**
|
|
15
|
+
* claim multiple token rewards for any address
|
|
16
|
+
* @param {String} userAddress user address to claim
|
|
17
|
+
* @param {String} tokenAddresses array of tokens
|
|
18
|
+
* @return {Promise<ReceiptOrEstimate>}
|
|
19
|
+
*/
|
|
20
|
+
claimMultipleRewards<G extends boolean = false>(userAddress: string, tokenAddresses: string[], estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
21
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export * from './SmartContract';
|
|
2
|
-
export * from './SmartContractWithAddress';
|
|
3
|
-
export * from './Dispenser';
|
|
4
|
-
export * from './FixedRateExchange';
|
|
5
|
-
export * from './Router';
|
|
6
|
-
export * from './Datatoken';
|
|
7
|
-
export * from './NFT';
|
|
8
|
-
export * from './NFTFactory';
|
|
9
|
-
export * from './ve/VeOcean';
|
|
10
|
-
export * from './ve/VeFeeDistributor';
|
|
11
|
-
export * from './ve/VeFeeEstimate';
|
|
12
|
-
export * from './ve/VeAllocate';
|
|
13
|
-
export * from './df/DfRewards';
|
|
14
|
-
export * from './df/DfStrategyV1';
|
|
1
|
+
export * from './SmartContract';
|
|
2
|
+
export * from './SmartContractWithAddress';
|
|
3
|
+
export * from './Dispenser';
|
|
4
|
+
export * from './FixedRateExchange';
|
|
5
|
+
export * from './Router';
|
|
6
|
+
export * from './Datatoken';
|
|
7
|
+
export * from './NFT';
|
|
8
|
+
export * from './NFTFactory';
|
|
9
|
+
export * from './ve/VeOcean';
|
|
10
|
+
export * from './ve/VeFeeDistributor';
|
|
11
|
+
export * from './ve/VeFeeEstimate';
|
|
12
|
+
export * from './ve/VeAllocate';
|
|
13
|
+
export * from './df/DfRewards';
|
|
14
|
+
export * from './df/DfStrategyV1';
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { SmartContractWithAddress } from '../SmartContractWithAddress';
|
|
2
|
-
import { ReceiptOrEstimate, AbiItem } from '../../@types';
|
|
3
|
-
/**
|
|
4
|
-
* Provides an interface for veOcean contract
|
|
5
|
-
*/
|
|
6
|
-
export declare class VeAllocate extends SmartContractWithAddress {
|
|
7
|
-
getDefaultAbi(): AbiItem[];
|
|
8
|
-
/**
|
|
9
|
-
* set a specific percentage of veOcean to a specific nft
|
|
10
|
-
* Maximum allocated percentage is 10000, so 1% is specified as 100
|
|
11
|
-
* @param {String} amount Percentage used
|
|
12
|
-
* @param {String} nft NFT address to allocate to
|
|
13
|
-
* @param {String} chainId chainId of NFT
|
|
14
|
-
* @return {Promise<ReceiptOrEstimate>}
|
|
15
|
-
*/
|
|
16
|
-
setAllocation<G extends boolean = false>(amount: string, nft: string, chainId: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
17
|
-
/**
|
|
18
|
-
* set specific percetage of veOcean to multiple nfts
|
|
19
|
-
* Maximum allocated percentage is 10000, so 1% is specified as 100
|
|
20
|
-
* @param {String[]} amount Array of percentages used
|
|
21
|
-
* @param {String[]} nft Array of NFT addresses
|
|
22
|
-
* @param {String[]} chainId Array of chainIds
|
|
23
|
-
* @return {Promise<ReceiptOrEstimate>}
|
|
24
|
-
*/
|
|
25
|
-
setBatchAllocation<G extends boolean = false>(amount: string[], nft: string[], chainId: number[], estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
26
|
-
/** Get totalAllocation for address
|
|
27
|
-
* @param {String} userAddress user address
|
|
28
|
-
* @return {Promise<number>}
|
|
29
|
-
*/
|
|
30
|
-
getTotalAllocation(userAddress: string): Promise<number>;
|
|
31
|
-
/** Get getveAllocation for address, nft, chainId
|
|
32
|
-
* @param {String} userAddress user address
|
|
33
|
-
* @param {String} nft NFT address to allocate to
|
|
34
|
-
* @param {String} chainId chainId of NFT
|
|
35
|
-
* @return {Promise<number>}
|
|
36
|
-
*/
|
|
37
|
-
getVeAllocation(userAddress: string, nft: string, chainId: string): Promise<number>;
|
|
38
|
-
}
|
|
1
|
+
import { SmartContractWithAddress } from '../SmartContractWithAddress';
|
|
2
|
+
import { ReceiptOrEstimate, AbiItem } from '../../@types';
|
|
3
|
+
/**
|
|
4
|
+
* Provides an interface for veOcean contract
|
|
5
|
+
*/
|
|
6
|
+
export declare class VeAllocate extends SmartContractWithAddress {
|
|
7
|
+
getDefaultAbi(): AbiItem[];
|
|
8
|
+
/**
|
|
9
|
+
* set a specific percentage of veOcean to a specific nft
|
|
10
|
+
* Maximum allocated percentage is 10000, so 1% is specified as 100
|
|
11
|
+
* @param {String} amount Percentage used
|
|
12
|
+
* @param {String} nft NFT address to allocate to
|
|
13
|
+
* @param {String} chainId chainId of NFT
|
|
14
|
+
* @return {Promise<ReceiptOrEstimate>}
|
|
15
|
+
*/
|
|
16
|
+
setAllocation<G extends boolean = false>(amount: string, nft: string, chainId: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
17
|
+
/**
|
|
18
|
+
* set specific percetage of veOcean to multiple nfts
|
|
19
|
+
* Maximum allocated percentage is 10000, so 1% is specified as 100
|
|
20
|
+
* @param {String[]} amount Array of percentages used
|
|
21
|
+
* @param {String[]} nft Array of NFT addresses
|
|
22
|
+
* @param {String[]} chainId Array of chainIds
|
|
23
|
+
* @return {Promise<ReceiptOrEstimate>}
|
|
24
|
+
*/
|
|
25
|
+
setBatchAllocation<G extends boolean = false>(amount: string[], nft: string[], chainId: number[], estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
26
|
+
/** Get totalAllocation for address
|
|
27
|
+
* @param {String} userAddress user address
|
|
28
|
+
* @return {Promise<number>}
|
|
29
|
+
*/
|
|
30
|
+
getTotalAllocation(userAddress: string): Promise<number>;
|
|
31
|
+
/** Get getveAllocation for address, nft, chainId
|
|
32
|
+
* @param {String} userAddress user address
|
|
33
|
+
* @param {String} nft NFT address to allocate to
|
|
34
|
+
* @param {String} chainId chainId of NFT
|
|
35
|
+
* @return {Promise<number>}
|
|
36
|
+
*/
|
|
37
|
+
getVeAllocation(userAddress: string, nft: string, chainId: string): Promise<number>;
|
|
38
|
+
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { SmartContractWithAddress } from '../SmartContractWithAddress';
|
|
2
|
-
import { ReceiptOrEstimate, AbiItem } from '../../@types';
|
|
3
|
-
/**
|
|
4
|
-
* Provides an interface for veOcean contract
|
|
5
|
-
*/
|
|
6
|
-
export declare class VeFeeDistributor extends SmartContractWithAddress {
|
|
7
|
-
getDefaultAbi(): AbiItem[];
|
|
8
|
-
/**
|
|
9
|
-
* Claim fees for `userAddress`
|
|
10
|
-
* Each call to claim look at a maximum of 50 user veOCEAN points.
|
|
11
|
-
For accounts with many veOCEAN related actions, this function
|
|
12
|
-
may need to be called more than once to claim all available
|
|
13
|
-
fees. In the `Claimed` event that fires, if `claim_epoch` is
|
|
14
|
-
less than `max_epoch`, the account may claim again
|
|
15
|
-
* @param {Boolean} estimateGas if True, return gas estimate
|
|
16
|
-
* @return {Promise<ReceiptOrEstimate>}
|
|
17
|
-
*/
|
|
18
|
-
claim<G extends boolean = false>(estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
19
|
-
/**
|
|
20
|
-
* Make multiple fee claims in a single call
|
|
21
|
-
Used to claim for many accounts at once, or to make
|
|
22
|
-
multiple claims for the same address when that address
|
|
23
|
-
has significant veOCEAN history
|
|
24
|
-
* @param {String} addresses array of addresses to claim
|
|
25
|
-
* @param {Boolean} estimateGas if True, return gas estimate
|
|
26
|
-
* @return {Promise<ReceiptOrEstimate>}
|
|
27
|
-
*/
|
|
28
|
-
claimMany<G extends boolean = false>(addresses: string[], estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
29
|
-
}
|
|
1
|
+
import { SmartContractWithAddress } from '../SmartContractWithAddress';
|
|
2
|
+
import { ReceiptOrEstimate, AbiItem } from '../../@types';
|
|
3
|
+
/**
|
|
4
|
+
* Provides an interface for veOcean contract
|
|
5
|
+
*/
|
|
6
|
+
export declare class VeFeeDistributor extends SmartContractWithAddress {
|
|
7
|
+
getDefaultAbi(): AbiItem[];
|
|
8
|
+
/**
|
|
9
|
+
* Claim fees for `userAddress`
|
|
10
|
+
* Each call to claim look at a maximum of 50 user veOCEAN points.
|
|
11
|
+
For accounts with many veOCEAN related actions, this function
|
|
12
|
+
may need to be called more than once to claim all available
|
|
13
|
+
fees. In the `Claimed` event that fires, if `claim_epoch` is
|
|
14
|
+
less than `max_epoch`, the account may claim again
|
|
15
|
+
* @param {Boolean} estimateGas if True, return gas estimate
|
|
16
|
+
* @return {Promise<ReceiptOrEstimate>}
|
|
17
|
+
*/
|
|
18
|
+
claim<G extends boolean = false>(estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
19
|
+
/**
|
|
20
|
+
* Make multiple fee claims in a single call
|
|
21
|
+
Used to claim for many accounts at once, or to make
|
|
22
|
+
multiple claims for the same address when that address
|
|
23
|
+
has significant veOCEAN history
|
|
24
|
+
* @param {String} addresses array of addresses to claim
|
|
25
|
+
* @param {Boolean} estimateGas if True, return gas estimate
|
|
26
|
+
* @return {Promise<ReceiptOrEstimate>}
|
|
27
|
+
*/
|
|
28
|
+
claimMany<G extends boolean = false>(addresses: string[], estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
29
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { SmartContractWithAddress } from '../SmartContractWithAddress';
|
|
2
|
-
import { AbiItem } from '../../@types';
|
|
3
|
-
/**
|
|
4
|
-
* Provides an interface for veOcean contract
|
|
5
|
-
*/
|
|
6
|
-
export declare class VeFeeEstimate extends SmartContractWithAddress {
|
|
7
|
-
getDefaultAbi(): AbiItem[];
|
|
8
|
-
/**
|
|
9
|
-
* estimateClaim
|
|
10
|
-
* @param {String} userAddress user address
|
|
11
|
-
* @return {Promise<string>}
|
|
12
|
-
*/
|
|
13
|
-
estimateClaim(userAddress: string): Promise<string>;
|
|
14
|
-
}
|
|
1
|
+
import { SmartContractWithAddress } from '../SmartContractWithAddress';
|
|
2
|
+
import { AbiItem } from '../../@types';
|
|
3
|
+
/**
|
|
4
|
+
* Provides an interface for veOcean contract
|
|
5
|
+
*/
|
|
6
|
+
export declare class VeFeeEstimate extends SmartContractWithAddress {
|
|
7
|
+
getDefaultAbi(): AbiItem[];
|
|
8
|
+
/**
|
|
9
|
+
* estimateClaim
|
|
10
|
+
* @param {String} userAddress user address
|
|
11
|
+
* @return {Promise<string>}
|
|
12
|
+
*/
|
|
13
|
+
estimateClaim(userAddress: string): Promise<string>;
|
|
14
|
+
}
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import { SmartContractWithAddress } from '../SmartContractWithAddress';
|
|
2
|
-
import { ReceiptOrEstimate, AbiItem } from '../../@types';
|
|
3
|
-
/**
|
|
4
|
-
* Provides an interface for veOcean contract
|
|
5
|
-
*/
|
|
6
|
-
export declare class VeOcean extends SmartContractWithAddress {
|
|
7
|
-
getDefaultAbi(): AbiItem[];
|
|
8
|
-
/**
|
|
9
|
-
* Deposit `amount` tokens for `userAddress` and lock until `unlockTime`
|
|
10
|
-
* @param {String} amount Amount of tokens to be locked
|
|
11
|
-
* @param {Number} unlockTime Timestamp for unlock
|
|
12
|
-
* @param {Boolean} estimateGas if True, return gas estimate
|
|
13
|
-
* @return {Promise<ReceiptOrEstimate>}
|
|
14
|
-
*/
|
|
15
|
-
lockTokens<G extends boolean = false>(amount: string, unlockTime: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
16
|
-
/**
|
|
17
|
-
* Deposit `amount` tokens for `toAddress` and add to the existing lock
|
|
18
|
-
* Anyone (even a smart contract) can deposit for someone else, but cannot extend their locktime and deposit for a brand new user
|
|
19
|
-
* @param {String} toAddress user address to deposit for
|
|
20
|
-
* @param {String} amount Amount of tokens to be locked
|
|
21
|
-
* @param {Boolean} estimateGas if True, return gas estimate
|
|
22
|
-
* @return {Promise<ReceiptOrEstimate>}
|
|
23
|
-
*/
|
|
24
|
-
depositFor<G extends boolean = false>(toAddress: string, amount: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
25
|
-
/**
|
|
26
|
-
* Deposit `amount` additional tokens for `userAddress` without modifying the unlock time
|
|
27
|
-
* @param {String} amount Amount of tokens to be locked
|
|
28
|
-
* @param {Boolean} estimateGas if True, return gas estimate
|
|
29
|
-
* @return {Promise<ReceiptOrEstimate>}
|
|
30
|
-
*/
|
|
31
|
-
increaseAmount<G extends boolean = false>(amount: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
32
|
-
/**
|
|
33
|
-
* Extend the unlock time for `userAddress` to `unlockTime`
|
|
34
|
-
* @param {Number} unlockTime Timestamp for new unlock time
|
|
35
|
-
* @param {Boolean} estimateGas if True, return gas estimate
|
|
36
|
-
* @return {Promise<ReceiptOrEstimate>}
|
|
37
|
-
*/
|
|
38
|
-
increaseUnlockTime<G extends boolean = false>(unlockTime: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
39
|
-
/**
|
|
40
|
-
* Withdraw all tokens for `userAddress`
|
|
41
|
-
* @param {Boolean} estimateGas if True, return gas estimate
|
|
42
|
-
* @return {Promise<ReceiptOrEstimate>}
|
|
43
|
-
*/
|
|
44
|
-
withdraw<G extends boolean = false>(estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
45
|
-
/** Get voting power for address
|
|
46
|
-
* @param {String} userAddress user address
|
|
47
|
-
* @return {Promise<number>}
|
|
48
|
-
*/
|
|
49
|
-
getVotingPower(userAddress: string): Promise<number>;
|
|
50
|
-
/** Get locked balance
|
|
51
|
-
* @param {String} userAddress user address
|
|
52
|
-
* @return {Promise<string>}
|
|
53
|
-
*/
|
|
54
|
-
getLockedAmount(userAddress: string): Promise<string>;
|
|
55
|
-
/** Get untilLock for address
|
|
56
|
-
* @param {String} userAddress user address
|
|
57
|
-
* @return {Promise<number>}
|
|
58
|
-
*/
|
|
59
|
-
lockEnd(userAddress: string): Promise<number>;
|
|
60
|
-
/** Get total supply
|
|
61
|
-
* @return {Promise<number>}
|
|
62
|
-
*/
|
|
63
|
-
totalSupply(): Promise<string>;
|
|
64
|
-
/** Get token
|
|
65
|
-
* @return {Promise<string>}
|
|
66
|
-
*/
|
|
67
|
-
getToken(): Promise<string>;
|
|
68
|
-
}
|
|
1
|
+
import { SmartContractWithAddress } from '../SmartContractWithAddress';
|
|
2
|
+
import { ReceiptOrEstimate, AbiItem } from '../../@types';
|
|
3
|
+
/**
|
|
4
|
+
* Provides an interface for veOcean contract
|
|
5
|
+
*/
|
|
6
|
+
export declare class VeOcean extends SmartContractWithAddress {
|
|
7
|
+
getDefaultAbi(): AbiItem[];
|
|
8
|
+
/**
|
|
9
|
+
* Deposit `amount` tokens for `userAddress` and lock until `unlockTime`
|
|
10
|
+
* @param {String} amount Amount of tokens to be locked
|
|
11
|
+
* @param {Number} unlockTime Timestamp for unlock
|
|
12
|
+
* @param {Boolean} estimateGas if True, return gas estimate
|
|
13
|
+
* @return {Promise<ReceiptOrEstimate>}
|
|
14
|
+
*/
|
|
15
|
+
lockTokens<G extends boolean = false>(amount: string, unlockTime: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
16
|
+
/**
|
|
17
|
+
* Deposit `amount` tokens for `toAddress` and add to the existing lock
|
|
18
|
+
* Anyone (even a smart contract) can deposit for someone else, but cannot extend their locktime and deposit for a brand new user
|
|
19
|
+
* @param {String} toAddress user address to deposit for
|
|
20
|
+
* @param {String} amount Amount of tokens to be locked
|
|
21
|
+
* @param {Boolean} estimateGas if True, return gas estimate
|
|
22
|
+
* @return {Promise<ReceiptOrEstimate>}
|
|
23
|
+
*/
|
|
24
|
+
depositFor<G extends boolean = false>(toAddress: string, amount: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
25
|
+
/**
|
|
26
|
+
* Deposit `amount` additional tokens for `userAddress` without modifying the unlock time
|
|
27
|
+
* @param {String} amount Amount of tokens to be locked
|
|
28
|
+
* @param {Boolean} estimateGas if True, return gas estimate
|
|
29
|
+
* @return {Promise<ReceiptOrEstimate>}
|
|
30
|
+
*/
|
|
31
|
+
increaseAmount<G extends boolean = false>(amount: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
32
|
+
/**
|
|
33
|
+
* Extend the unlock time for `userAddress` to `unlockTime`
|
|
34
|
+
* @param {Number} unlockTime Timestamp for new unlock time
|
|
35
|
+
* @param {Boolean} estimateGas if True, return gas estimate
|
|
36
|
+
* @return {Promise<ReceiptOrEstimate>}
|
|
37
|
+
*/
|
|
38
|
+
increaseUnlockTime<G extends boolean = false>(unlockTime: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
39
|
+
/**
|
|
40
|
+
* Withdraw all tokens for `userAddress`
|
|
41
|
+
* @param {Boolean} estimateGas if True, return gas estimate
|
|
42
|
+
* @return {Promise<ReceiptOrEstimate>}
|
|
43
|
+
*/
|
|
44
|
+
withdraw<G extends boolean = false>(estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
|
|
45
|
+
/** Get voting power for address
|
|
46
|
+
* @param {String} userAddress user address
|
|
47
|
+
* @return {Promise<number>}
|
|
48
|
+
*/
|
|
49
|
+
getVotingPower(userAddress: string): Promise<number>;
|
|
50
|
+
/** Get locked balance
|
|
51
|
+
* @param {String} userAddress user address
|
|
52
|
+
* @return {Promise<string>}
|
|
53
|
+
*/
|
|
54
|
+
getLockedAmount(userAddress: string): Promise<string>;
|
|
55
|
+
/** Get untilLock for address
|
|
56
|
+
* @param {String} userAddress user address
|
|
57
|
+
* @return {Promise<number>}
|
|
58
|
+
*/
|
|
59
|
+
lockEnd(userAddress: string): Promise<number>;
|
|
60
|
+
/** Get total supply
|
|
61
|
+
* @return {Promise<number>}
|
|
62
|
+
*/
|
|
63
|
+
totalSupply(): Promise<string>;
|
|
64
|
+
/** Get token
|
|
65
|
+
* @return {Promise<string>}
|
|
66
|
+
*/
|
|
67
|
+
getToken(): Promise<string>;
|
|
68
|
+
}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './@types';
|
|
2
|
-
export * from './config';
|
|
3
|
-
export * from './contracts';
|
|
4
|
-
export * from './services';
|
|
5
|
-
export * from './utils';
|
|
1
|
+
export * from './@types';
|
|
2
|
+
export * from './config';
|
|
3
|
+
export * from './contracts';
|
|
4
|
+
export * from './services';
|
|
5
|
+
export * from './utils';
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { Asset, DDO, ValidateMetadata } from '../@types';
|
|
2
|
-
export interface SearchQuery {
|
|
3
|
-
from?: number;
|
|
4
|
-
size?: number;
|
|
5
|
-
query: any;
|
|
6
|
-
sort?: {
|
|
7
|
-
[jsonPath: string]: string;
|
|
8
|
-
};
|
|
9
|
-
aggs?: any;
|
|
10
|
-
}
|
|
11
|
-
export declare class Aquarius {
|
|
12
|
-
aquariusURL: string;
|
|
13
|
-
/**
|
|
14
|
-
* Instantiate Aquarius
|
|
15
|
-
* @param {String} aquariusURL
|
|
16
|
-
*/
|
|
17
|
-
constructor(aquariusURL: string);
|
|
18
|
-
/** Resolves a DID
|
|
19
|
-
* @param {string} did DID of the asset.
|
|
20
|
-
* @param {AbortSignal} signal abort signal
|
|
21
|
-
* @return {Promise<Asset>} Asset
|
|
22
|
-
*/
|
|
23
|
-
resolve(did: string, signal?: AbortSignal): Promise<Asset>;
|
|
24
|
-
/**
|
|
25
|
-
* Blocks until Aqua will cache the did (or the update for that did) or timeouts
|
|
26
|
-
* @param {string} did DID of the asset.
|
|
27
|
-
* @param {string} txid used when the did exists and we expect an update with that txid.
|
|
28
|
-
* @param {AbortSignal} signal abort signal
|
|
29
|
-
* @return {Promise<Asset>} DDO of the asset.
|
|
30
|
-
*/
|
|
31
|
-
waitForAqua(did: string, txid?: string, signal?: AbortSignal): Promise<Asset>;
|
|
32
|
-
/**
|
|
33
|
-
* Validate DDO content
|
|
34
|
-
* @param {DDO} ddo DID Descriptor Object content.
|
|
35
|
-
* @param {AbortSignal} signal abort signal
|
|
36
|
-
* @return {Promise<ValidateMetadata>}.
|
|
37
|
-
*/
|
|
38
|
-
validate(ddo: DDO, signal?: AbortSignal): Promise<ValidateMetadata>;
|
|
39
|
-
/**
|
|
40
|
-
* Search over the DDOs using a query.
|
|
41
|
-
* @param {string} did DID of the asset
|
|
42
|
-
* @param {AbortSignal} signal abort signal
|
|
43
|
-
* @return {Promise<QueryResult>}
|
|
44
|
-
*/
|
|
45
|
-
getAssetMetadata(did: string, signal?: AbortSignal): Promise<any>;
|
|
46
|
-
/**
|
|
47
|
-
* Search over the DDOs using a query.
|
|
48
|
-
* @param {SearchQuery} query Query to filter the DDOs.
|
|
49
|
-
* @param {AbortSignal} signal abort signal
|
|
50
|
-
* @return {Promise<QueryResult>}
|
|
51
|
-
*/
|
|
52
|
-
querySearch(query: SearchQuery, signal?: AbortSignal): Promise<any>;
|
|
53
|
-
}
|
|
1
|
+
import { Asset, DDO, ValidateMetadata } from '../@types';
|
|
2
|
+
export interface SearchQuery {
|
|
3
|
+
from?: number;
|
|
4
|
+
size?: number;
|
|
5
|
+
query: any;
|
|
6
|
+
sort?: {
|
|
7
|
+
[jsonPath: string]: string;
|
|
8
|
+
};
|
|
9
|
+
aggs?: any;
|
|
10
|
+
}
|
|
11
|
+
export declare class Aquarius {
|
|
12
|
+
aquariusURL: string;
|
|
13
|
+
/**
|
|
14
|
+
* Instantiate Aquarius
|
|
15
|
+
* @param {String} aquariusURL
|
|
16
|
+
*/
|
|
17
|
+
constructor(aquariusURL: string);
|
|
18
|
+
/** Resolves a DID
|
|
19
|
+
* @param {string} did DID of the asset.
|
|
20
|
+
* @param {AbortSignal} signal abort signal
|
|
21
|
+
* @return {Promise<Asset>} Asset
|
|
22
|
+
*/
|
|
23
|
+
resolve(did: string, signal?: AbortSignal): Promise<Asset>;
|
|
24
|
+
/**
|
|
25
|
+
* Blocks until Aqua will cache the did (or the update for that did) or timeouts
|
|
26
|
+
* @param {string} did DID of the asset.
|
|
27
|
+
* @param {string} txid used when the did exists and we expect an update with that txid.
|
|
28
|
+
* @param {AbortSignal} signal abort signal
|
|
29
|
+
* @return {Promise<Asset>} DDO of the asset.
|
|
30
|
+
*/
|
|
31
|
+
waitForAqua(did: string, txid?: string, signal?: AbortSignal): Promise<Asset>;
|
|
32
|
+
/**
|
|
33
|
+
* Validate DDO content
|
|
34
|
+
* @param {DDO} ddo DID Descriptor Object content.
|
|
35
|
+
* @param {AbortSignal} signal abort signal
|
|
36
|
+
* @return {Promise<ValidateMetadata>}.
|
|
37
|
+
*/
|
|
38
|
+
validate(ddo: DDO, signal?: AbortSignal): Promise<ValidateMetadata>;
|
|
39
|
+
/**
|
|
40
|
+
* Search over the DDOs using a query.
|
|
41
|
+
* @param {string} did DID of the asset
|
|
42
|
+
* @param {AbortSignal} signal abort signal
|
|
43
|
+
* @return {Promise<QueryResult>}
|
|
44
|
+
*/
|
|
45
|
+
getAssetMetadata(did: string, signal?: AbortSignal): Promise<any>;
|
|
46
|
+
/**
|
|
47
|
+
* Search over the DDOs using a query.
|
|
48
|
+
* @param {SearchQuery} query Query to filter the DDOs.
|
|
49
|
+
* @param {AbortSignal} signal abort signal
|
|
50
|
+
* @return {Promise<QueryResult>}
|
|
51
|
+
*/
|
|
52
|
+
querySearch(query: SearchQuery, signal?: AbortSignal): Promise<any>;
|
|
53
|
+
}
|