@oceanprotocol/lib 5.0.6 → 5.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/CHANGELOG.md +36 -4
  2. package/CodeExamples.md +8 -4
  3. package/ComputeExamples.md +4 -2
  4. package/dist/lib.cjs +1 -1
  5. package/dist/lib.cjs.map +1 -1
  6. package/dist/lib.modern.js +1 -1
  7. package/dist/lib.modern.js.map +1 -1
  8. package/dist/lib.module.mjs +1 -1
  9. package/dist/lib.module.mjs.map +1 -1
  10. package/dist/lib.umd.js +1 -1
  11. package/dist/lib.umd.js.map +1 -1
  12. package/dist/types/@types/Compute.d.ts +24 -8
  13. package/dist/types/config/Config.d.ts +0 -8
  14. package/dist/types/contracts/Dispenser.d.ts +1 -1
  15. package/dist/types/contracts/EnterpriseFeeCollector.d.ts +2 -1
  16. package/dist/types/contracts/Escrow.d.ts +12 -9
  17. package/dist/types/contracts/FixedRateExchange.d.ts +0 -1
  18. package/dist/types/contracts/NFT.d.ts +1 -1
  19. package/dist/types/contracts/index.d.ts +0 -6
  20. package/dist/types/services/Aquarius.d.ts +3 -2
  21. package/dist/types/services/Provider.d.ts +5 -3
  22. package/dist/types/utils/Assets.d.ts +2 -1
  23. package/dist/types/utils/TokenUtils.d.ts +2 -1
  24. package/docs/modules.md +0 -6
  25. package/package.json +2 -2
  26. package/dist/types/contracts/df/DfRewards.d.ts +0 -31
  27. package/dist/types/contracts/df/DfStrategyV1.d.ts +0 -21
  28. package/dist/types/contracts/ve/VeAllocate.d.ts +0 -38
  29. package/dist/types/contracts/ve/VeFeeDistributor.d.ts +0 -29
  30. package/dist/types/contracts/ve/VeFeeEstimate.d.ts +0 -14
  31. package/dist/types/contracts/ve/VeOcean.d.ts +0 -68
  32. package/docs/classes/DfRewards.md +0 -345
  33. package/docs/classes/DfStrategyV1.md +0 -313
  34. package/docs/classes/VeAllocate.md +0 -372
  35. package/docs/classes/VeFeeDistributor.md +0 -325
  36. package/docs/classes/VeFeeEstimate.md +0 -281
  37. package/docs/classes/VeOcean.md +0 -513
@@ -4,9 +4,9 @@ export interface RunningPlatform {
4
4
  architecture: string;
5
5
  os: string;
6
6
  }
7
- export type ComputeResourceType = 'cpu' | 'memory' | 'storage';
7
+ export type ComputeResourceType = 'cpu' | 'ram' | 'disk' | 'gpu';
8
8
  export interface ComputeResourcesPricingInfo {
9
- type: ComputeResourceType;
9
+ id: string;
10
10
  price: number;
11
11
  }
12
12
  export interface ComputeEnvFees {
@@ -14,22 +14,31 @@ export interface ComputeEnvFees {
14
14
  prices: ComputeResourcesPricingInfo[];
15
15
  }
16
16
  export interface ComputeEnvFeesStructure {
17
- [chainId: string]: ComputeEnvFees;
17
+ [chainId: string]: ComputeEnvFees[];
18
18
  }
19
19
  export interface ComputeResourceRequest {
20
20
  id: string;
21
21
  amount: number;
22
22
  }
23
23
  export interface ComputeResource {
24
- id: ComputeResourceType;
25
- type?: string;
24
+ id: string;
25
+ type?: ComputeResourceType;
26
26
  kind?: string;
27
- total: number;
28
- min: number;
27
+ total?: number;
28
+ min?: number;
29
29
  max: number;
30
+ description?: string;
31
+ init?: {
32
+ [key: string]: any;
33
+ };
30
34
  inUse?: number;
31
35
  }
36
+ export interface ComputeEnvironmentAccessOptions {
37
+ addresses?: string[];
38
+ accessLists?: any;
39
+ }
32
40
  export interface ComputeEnvironmentFreeOptions {
41
+ access?: ComputeEnvironmentAccessOptions;
33
42
  storageExpiry?: number;
34
43
  maxJobDuration?: number;
35
44
  maxJobs?: number;
@@ -37,14 +46,21 @@ export interface ComputeEnvironmentFreeOptions {
37
46
  }
38
47
  export interface ComputeEnvironment {
39
48
  id: string;
40
- description: string;
49
+ description?: string;
41
50
  consumerAddress: string;
51
+ access?: ComputeEnvironmentAccessOptions;
42
52
  storageExpiry?: number;
43
53
  minJobDuration?: number;
44
54
  maxJobDuration?: number;
45
55
  maxJobs?: number;
46
56
  runningJobs: number;
47
57
  runningfreeJobs?: number;
58
+ queuedJobs?: number;
59
+ queuedFreeJobs?: number;
60
+ queMaxWaitTime?: number;
61
+ queMaxWaitTimeFree?: number;
62
+ runMaxWaitTime?: number;
63
+ runMaxWaitTimeFree?: number;
48
64
  fees: ComputeEnvFeesStructure;
49
65
  resources?: ComputeResource[];
50
66
  free?: ComputeEnvironmentFreeOptions;
@@ -143,14 +143,6 @@ export declare class Config {
143
143
  * @type {number}
144
144
  */
145
145
  gasFeeMultiplier: number;
146
- veAllocate?: string;
147
- veOCEAN?: string;
148
- veDelegation?: string;
149
- veFeeDistributor?: string;
150
- veDelegationProxy?: string;
151
- DFRewards?: string;
152
- DFStrategyV1?: string;
153
- veFeeEstimate?: string;
154
146
  sdk?: SDK;
155
147
  accessListFactory?: string;
156
148
  escrow?: string;
@@ -8,7 +8,7 @@ export declare class Dispenser extends SmartContractWithAddress {
8
8
  * @param {String} dtAddress
9
9
  * @return {Promise<DispenserToken>}
10
10
  */
11
- status(dtAdress: string): Promise<DispenserToken>;
11
+ status(dtAddress: string): Promise<DispenserToken>;
12
12
  /**
13
13
  * Creates a new Dispenser
14
14
  * @param {String} dtAddress Datatoken address
@@ -27,7 +27,8 @@ export declare class EnterpriseFeeCollectorContract extends SmartContractWithAdd
27
27
  * Calculate fee
28
28
  * @param {string} token Token address
29
29
  * @param {string} amount Amount
30
+ * @param {number} [tokenDecimals] optional number of decimals of the token
30
31
  * @return {Promise<string>} Fee amount
31
32
  */
32
- calculateFee(token: string, amount: number): Promise<any>;
33
+ calculateFee(token: string, amount: number, tokenDecimals?: number): Promise<any>;
33
34
  }
@@ -12,7 +12,6 @@ export declare class EscrowContract extends SmartContractWithAddress {
12
12
  * @param {string | number} [network] Network id or name
13
13
  * @param {Config} [config] The configuration object.
14
14
  * @param {AbiItem[]} [abi] ABI array of the smart contract
15
- * @param {AbiItem[]} abiEnterprise Enterprise ABI array of the smart contract
16
15
  */
17
16
  constructor(address: string, signer: Signer, network?: string | number, config?: Config, abi?: AbiItem[]);
18
17
  /**
@@ -55,25 +54,28 @@ export declare class EscrowContract extends SmartContractWithAddress {
55
54
  * returned from initialize compute payment and used for authorize if needed.
56
55
  * @param {String} maxLockCounts max lock counts,
57
56
  * returned from initialize compute payment and used for authorize if needed.
57
+ * @param {number} [tokenDecimals] optional number of decimals of the token
58
58
  * @return {Promise<ValidationResponse>} validation response
59
59
  */
60
- verifyFundsForEscrowPayment(token: string, consumerAddress: string, amountToDeposit?: string, maxLockedAmount?: string, maxLockSeconds?: string, maxLockCounts?: string): Promise<ValidationResponse>;
60
+ verifyFundsForEscrowPayment(token: string, consumerAddress: string, amountToDeposit?: string, maxLockedAmount?: string, maxLockSeconds?: string, maxLockCounts?: string, tokenDecimals?: number): Promise<ValidationResponse>;
61
61
  /**
62
62
  * Deposit funds
63
63
  * @param {String} token Token address
64
64
  * @param {String} amount amount
65
+ * @param {number} [tokenDecimals] optional number of decimals of the token
65
66
  * @param {Boolean} estimateGas if True, return gas estimate
66
67
  * @return {Promise<ReceiptOrEstimate>} returns the transaction receipt or the estimateGas value
67
68
  */
68
- deposit<G extends boolean = false>(token: string, amount: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
69
+ deposit<G extends boolean = false>(token: string, amount: string, tokenDecimals?: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
69
70
  /**
70
71
  * Withdraw funds
71
72
  * @param {String[]} tokens Array of token addresses
72
73
  * @param {String[]} amounts Array of token amounts
74
+ * @param {number} [tokenDecimals] optional number of decimals of the token
73
75
  * @param {Boolean} estimateGas if True, return gas estimate
74
76
  * @return {Promise<ReceiptOrEstimate>} returns the transaction receipt or the estimateGas value
75
77
  */
76
- withdraw<G extends boolean = false>(tokens: string[], amounts: string[], estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
78
+ withdraw<G extends boolean = false>(tokens: string[], amounts: string[], tokenDecimals?: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
77
79
  /**
78
80
  * Authorize locks
79
81
  * @param {String} token Token address
@@ -81,16 +83,17 @@ export declare class EscrowContract extends SmartContractWithAddress {
81
83
  * @param {String} maxLockedAmount,
82
84
  * @param {String} maxLockSeconds,
83
85
  * @param {String} maxLockCounts,
86
+ * @param {number} [tokenDecimals] optional number of decimals of the token
84
87
  * @param {Boolean} estimateGas if True, return gas estimate
85
88
  * @return {Promise<ReceiptOrEstimate>} returns the transaction receipt or the estimateGas value
86
89
  */
87
- authorize<G extends boolean = false>(token: string, payee: string, maxLockedAmount: string, maxLockSeconds: string, maxLockCounts: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
90
+ authorize<G extends boolean = false>(token: string, payee: string, maxLockedAmount: string, maxLockSeconds: string, maxLockCounts: string, tokenDecimals?: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
88
91
  /**
89
92
  * Cancel expired locks
90
- * @param {String} jobId Job ID with hash
91
- * @param {String} token Token address
92
- * @param {String} payee, Payee address for the compute job,
93
- * @param {String} payer, Payer address for the compute job
93
+ * @param {String[]} jobIds Job IDs with hash
94
+ * @param {String[]} tokens Token addresses
95
+ * @param {String[]} payers, Payer addresses for the compute job
96
+ * @param {String[]} payees, Payee addresses for the compute job,
94
97
  * @param {Boolean} estimateGas if True, return gas estimate
95
98
  * @return {Promise<ReceiptOrEstimate>} returns the transaction receipt or the estimateGas value
96
99
  */
@@ -120,7 +120,6 @@ export declare class FixedRateExchange extends SmartContractWithAddress {
120
120
  getFeesInfo(exchangeId: string): Promise<FeesInfo>;
121
121
  /**
122
122
  * Returns all exchanges
123
- * @param {String} exchangeId Exchang eId
124
123
  * @return {Promise<String[]>} Exchanges list
125
124
  */
126
125
  getExchanges(): Promise<string[]>;
@@ -143,7 +143,7 @@ export declare class Nft extends SmartContract {
143
143
  /**
144
144
  * Helper function to improve UX sets both MetaData & TokenURI in one tx
145
145
  * @param {String} nftAddress NFT contract address
146
- * @param {String} address Caller address
146
+ * @param {String} metadataUpdater Caller address
147
147
  * @param {MetadataAndTokenURI} metadataAndTokenURI metaDataAndTokenURI object
148
148
  * @param {Boolean} estimateGas if True, return gas estimate
149
149
  * @return {Promise<ReceiptOrEstimate>} trxReceipt
@@ -9,12 +9,6 @@ export * from './NFT.js';
9
9
  export * from './AccessList.js';
10
10
  export * from './AccessListFactory.js';
11
11
  export * from './NFTFactory.js';
12
- export * from './ve/VeOcean.js';
13
- export * from './ve/VeFeeDistributor.js';
14
- export * from './ve/VeFeeEstimate.js';
15
- export * from './ve/VeAllocate.js';
16
- export * from './df/DfRewards.js';
17
- export * from './df/DfStrategyV1.js';
18
12
  export * from './Datatoken4.js';
19
13
  export * from './AccessList.js';
20
14
  export * from './AccessListFactory.js';
@@ -33,9 +33,10 @@ export declare class Aquarius {
33
33
  /**
34
34
  * Validate DDO content
35
35
  * @param {DDO} ddo DID Descriptor Object content.
36
- * @param {signer} ddo publisher account.
37
- * @param {providerUrl} provider url used to get the nonce.
36
+ * @param {Signer} signer ddo publisher account.
37
+ * @param {String} providerUrl url used to get the nonce.
38
38
  * @param {AbortSignal} signal abort signal
39
+ * @param {String} authorization header to pass to request
39
40
  * @return {Promise<ValidateMetadata>}.
40
41
  */
41
42
  validate(ddo: DDO, signer: Signer, providerUrl: string, signal?: AbortSignal, authorization?: string): Promise<ValidateMetadata>;
@@ -49,7 +49,7 @@ export declare class Provider {
49
49
  * @param {AbortSignal} signal abort signal
50
50
  * @return {Promise<string>} urlDetails
51
51
  */
52
- encrypt(data: any, chainId: number, providerUri: string, signal?: AbortSignal): Promise<string>;
52
+ encrypt(data: any, chainId: number, providerUri: string, signerOrAuthToken: Signer | string, policyServer?: any, signal?: AbortSignal): Promise<string>;
53
53
  /**
54
54
  * Get file details for a given DID and service ID.
55
55
  * @param {string} did - The DID to check.
@@ -94,9 +94,11 @@ export declare class Provider {
94
94
  * @param {ComputeAsset[]} assets The datasets array to initialize compute request.
95
95
  * @param {ComputeAlgorithmber} algorithm The algorithm to use.
96
96
  * @param {string} computeEnv The compute environment.
97
- * @param {number} validUntil The job expiration date.
98
97
  * @param {string} providerUri The provider URI.
99
98
  * @param {string} accountId caller address
99
+ * @param {string} chainId The chain Id to start compute on
100
+ * @param {string} token The token to use for the compute payment
101
+ * @param {number} maxJobDuration The maximum duration the job can take
100
102
  * @param {AbortSignal} signal abort signal
101
103
  * @return {Promise<ProviderComputeInitialize>} ProviderComputeInitialize data
102
104
  */
@@ -131,7 +133,7 @@ export declare class Provider {
131
133
  getDownloadUrl(did: string, serviceId: string, fileIndex: number, transferTxId: string, providerUri: string, signerOrAuthToken: Signer | string, policyServer?: any, userCustomParameters?: UserCustomParameters): Promise<any>;
132
134
  /** Instruct the provider to start a compute job (Old C2D V1) Kept for now, for backwards compatibility
133
135
  * @param {string} providerUri The provider URI.
134
- * @param {Signer} signer The consumer signer object.
136
+ * @param {Signer} consumer The consumer signer object.
135
137
  * @param {string} computeEnv The compute environment.
136
138
  * @param {ComputeAsset} dataset The dataset to start compute on
137
139
  * @param {ComputeAlgorithm} algorithm The algorithm to start compute with.
@@ -24,7 +24,8 @@ templateIDorAddress: string | number, // If string, it's template address , othe
24
24
  ddo: DDO, encryptDDO: boolean, // default is true
25
25
  providerUrl: string, providerFeeToken: string, aquariusInstance: Aquarius, accessListFactory?: string, // access list factory address
26
26
  allowAccessList?: string, // allow list address
27
- denyAccessList?: string): Promise<string>;
27
+ denyAccessList?: string, // deny list address
28
+ baseToken?: string, baseTokenDecimals?: number): Promise<string>;
28
29
  /**
29
30
  * deploy new access list factory if needed
30
31
  * @param accessListFactory accessListFactory address
@@ -33,9 +33,10 @@ export declare function approveWei<G extends boolean = false>(signer: Signer, co
33
33
  * @param {string} tokenAddress - The address of the token
34
34
  * @param {string} recipient - The address of the tokens receiver
35
35
  * @param {String} amount amount of ERC20 Datatokens (not as wei)
36
+ * @param {number} [tokenDecimals] optional number of decimals of the token
36
37
  * @param {String} estimateGas if true returns the gas estimate
37
38
  */
38
- export declare function transfer<G extends boolean = false>(signer: Signer, config: Config, tokenAddress: string, recipient: string, amount: string, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
39
+ export declare function transfer<G extends boolean = false>(signer: Signer, config: Config, tokenAddress: string, recipient: string, amount: string, tokenDecimals?: number, estimateGas?: G): Promise<ReceiptOrEstimate<G>>;
39
40
  /**
40
41
  * Get Allowance for any Datatoken
41
42
  * @param {Signer} signer - The signer object
package/docs/modules.md CHANGED
@@ -14,8 +14,6 @@
14
14
  - [Config](classes/Config.md)
15
15
  - [ConfigHelper](classes/ConfigHelper.md)
16
16
  - [Datatoken](classes/Datatoken.md)
17
- - [DfRewards](classes/DfRewards.md)
18
- - [DfStrategyV1](classes/DfStrategyV1.md)
19
17
  - [Dispenser](classes/Dispenser.md)
20
18
  - [FixedRateExchange](classes/FixedRateExchange.md)
21
19
  - [Logger](classes/Logger.md)
@@ -25,10 +23,6 @@
25
23
  - [Router](classes/Router.md)
26
24
  - [SmartContract](classes/SmartContract.md)
27
25
  - [SmartContractWithAddress](classes/SmartContractWithAddress.md)
28
- - [VeAllocate](classes/VeAllocate.md)
29
- - [VeFeeDistributor](classes/VeFeeDistributor.md)
30
- - [VeFeeEstimate](classes/VeFeeEstimate.md)
31
- - [VeOcean](classes/VeOcean.md)
32
26
 
33
27
  ### Interfaces
34
28
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oceanprotocol/lib",
3
3
  "source": "./src/index.ts",
4
- "version": "5.0.6",
4
+ "version": "5.1.1",
5
5
  "description": "JavaScript client library for Ocean Protocol",
6
6
  "main": "./dist/lib.cjs",
7
7
  "umd:main": "dist/lib.umd.js",
@@ -98,7 +98,7 @@
98
98
  "nyc": "^17.1.0",
99
99
  "ora": "5.4.1",
100
100
  "prettier": "^2.7.1",
101
- "release-it": "^18.1.2",
101
+ "release-it": "^19.2.4",
102
102
  "source-map-support": "^0.5.21",
103
103
  "ts-node": "^10.9.2",
104
104
  "ts-node-register": "^1.0.0",
@@ -1,31 +0,0 @@
1
- import { SmartContractWithAddress } from '../SmartContractWithAddress.js';
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 +0,0 @@
1
- import { SmartContractWithAddress } from '../SmartContractWithAddress.js';
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,38 +0,0 @@
1
- import { SmartContractWithAddress } from '../SmartContractWithAddress.js';
2
- import { ReceiptOrEstimate, AbiItem } from '../../@types/index.js';
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 percentage 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 +0,0 @@
1
- import { SmartContractWithAddress } from '../SmartContractWithAddress.js';
2
- import { ReceiptOrEstimate, AbiItem } from '../../@types/index.js';
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 +0,0 @@
1
- import { SmartContractWithAddress } from '../SmartContractWithAddress.js';
2
- import { AbiItem } from '../../@types/index.js';
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 +0,0 @@
1
- import { SmartContractWithAddress } from '../SmartContractWithAddress.js';
2
- import { ReceiptOrEstimate, AbiItem } from '../../@types/index.js';
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
- }