@oceanprotocol/lib 7.0.0-next.4 → 7.0.0-next.6
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/dist/lib.cjs +1 -1
- package/dist/lib.module.mjs +1 -1
- package/dist/lib.umd.js +1 -1
- package/package.json +8 -5
- package/.mocharc.json +0 -8
- package/.nvmrc +0 -1
- package/CHANGELOG.md +0 -3256
- package/Cheatsheet.md +0 -326
- package/CodeExamples.md +0 -881
- package/ComputeExamples.md +0 -941
- package/dist/lib.cjs.map +0 -1
- package/dist/lib.module.mjs.map +0 -1
- package/dist/lib.umd.js.map +0 -1
- package/docs/.nojekyll +0 -1
- package/docs/README.md +0 -195
- package/docs/classes/Aquarius.md +0 -175
- package/docs/classes/Config.md +0 -481
- package/docs/classes/ConfigHelper.md +0 -66
- package/docs/classes/Datatoken.md +0 -1123
- package/docs/classes/Dispenser.md +0 -502
- package/docs/classes/Escrow.md +0 -285
- package/docs/classes/FixedRateExchange.md +0 -1068
- package/docs/classes/Logger.md +0 -191
- package/docs/classes/Nft.md +0 -970
- package/docs/classes/NftFactory.md +0 -861
- package/docs/classes/Provider.md +0 -727
- package/docs/classes/Router.md +0 -645
- package/docs/classes/SmartContract.md +0 -193
- package/docs/classes/SmartContractWithAddress.md +0 -268
- package/docs/enums/LogLevel.md +0 -63
- package/docs/interfaces/AbiInput.md +0 -63
- package/docs/interfaces/AbiItem.md +0 -107
- package/docs/interfaces/AbiOutput.md +0 -52
- package/docs/interfaces/Arweave.md +0 -32
- package/docs/interfaces/Asset.md +0 -227
- package/docs/interfaces/AssetDatatoken.md +0 -60
- package/docs/interfaces/AssetLastEvent.md +0 -63
- package/docs/interfaces/AssetNft.md +0 -105
- package/docs/interfaces/AssetPrice.md +0 -47
- package/docs/interfaces/ComputeAlgorithm.md +0 -82
- package/docs/interfaces/ComputeAsset.md +0 -56
- package/docs/interfaces/ComputeEnvFees.md +0 -30
- package/docs/interfaces/ComputeEnvFeesStructure.md +0 -20
- package/docs/interfaces/ComputeEnvironment.md +0 -177
- package/docs/interfaces/ComputeJob.md +0 -173
- package/docs/interfaces/ComputeOutput.md +0 -118
- package/docs/interfaces/ComputeResourcesPricingInfo.md +0 -30
- package/docs/interfaces/ComputeResourcesRequest.md +0 -34
- package/docs/interfaces/ComputeResult.md +0 -52
- package/docs/interfaces/ConsumeMarketFee.md +0 -41
- package/docs/interfaces/Credential.md +0 -30
- package/docs/interfaces/Credentials.md +0 -30
- package/docs/interfaces/DDO.md +0 -137
- package/docs/interfaces/DatatokenCreateParams.md +0 -107
- package/docs/interfaces/DatatokenRoles.md +0 -30
- package/docs/interfaces/DispenserCreationParams.md +0 -63
- package/docs/interfaces/DispenserParams.md +0 -52
- package/docs/interfaces/DispenserToken.md +0 -85
- package/docs/interfaces/DownloadResponse.md +0 -30
- package/docs/interfaces/Event.md +0 -73
- package/docs/interfaces/FeesInfo.md +0 -74
- package/docs/interfaces/FileInfo.md +0 -118
- package/docs/interfaces/Files.md +0 -41
- package/docs/interfaces/FixedPriceExchange.md +0 -162
- package/docs/interfaces/FreCreationParams.md +0 -118
- package/docs/interfaces/FreOrderParams.md +0 -85
- package/docs/interfaces/GraphqlQuery.md +0 -69
- package/docs/interfaces/Ipfs.md +0 -32
- package/docs/interfaces/Metadata.md +0 -193
- package/docs/interfaces/MetadataAlgorithm.md +0 -69
- package/docs/interfaces/MetadataAndTokenURI.md +0 -107
- package/docs/interfaces/MetadataProof.md +0 -52
- package/docs/interfaces/NftCreateData.md +0 -74
- package/docs/interfaces/NftRoles.md +0 -52
- package/docs/interfaces/Operation.md +0 -145
- package/docs/interfaces/OrderParams.md +0 -52
- package/docs/interfaces/PriceAndFees.md +0 -52
- package/docs/interfaces/ProviderComputeInitialize.md +0 -41
- package/docs/interfaces/ProviderComputeInitializeResults.md +0 -43
- package/docs/interfaces/ProviderFees.md +0 -96
- package/docs/interfaces/ProviderInitialize.md +0 -52
- package/docs/interfaces/PublisherTrustedAlgorithm.md +0 -47
- package/docs/interfaces/PublishingMarketFee.md +0 -41
- package/docs/interfaces/Purgatory.md +0 -34
- package/docs/interfaces/RunningPlatform.md +0 -30
- package/docs/interfaces/SearchQuery.md +0 -67
- package/docs/interfaces/Service.md +0 -138
- package/docs/interfaces/ServiceComputeOptions.md +0 -63
- package/docs/interfaces/ServiceEndpoint.md +0 -41
- package/docs/interfaces/Smartcontract-1.md +0 -58
- package/docs/interfaces/Stats.md +0 -47
- package/docs/interfaces/Template.md +0 -30
- package/docs/interfaces/TokenOrder.md +0 -63
- package/docs/interfaces/UrlFile.md +0 -71
- package/docs/interfaces/UserCustomParameters.md +0 -7
- package/docs/interfaces/ValidateMetadata.md +0 -52
- package/docs/modules.md +0 -850
- package/typedoc.json +0 -4
package/docs/classes/Escrow.md
DELETED
|
@@ -1,285 +0,0 @@
|
|
|
1
|
-
[@oceanprotocol/lib](../README.md) / [Exports](../modules.md) / EscrowContract
|
|
2
|
-
|
|
3
|
-
# Class: EscrowContract
|
|
4
|
-
|
|
5
|
-
Manages escrow payments for C2D jobs - handles deposits, locks, and authorizations.
|
|
6
|
-
|
|
7
|
-
## Hierarchy
|
|
8
|
-
|
|
9
|
-
- [`SmartContractWithAddress`](SmartContractWithAddress.md)
|
|
10
|
-
|
|
11
|
-
↳ **`EscrowContract`**
|
|
12
|
-
|
|
13
|
-
## Table of contents
|
|
14
|
-
|
|
15
|
-
### Constructors
|
|
16
|
-
|
|
17
|
-
- [constructor](Escrow.md#constructor)
|
|
18
|
-
|
|
19
|
-
### Methods
|
|
20
|
-
|
|
21
|
-
- [getFunds](Escrow.md#getfunds)
|
|
22
|
-
- [getUserFunds](Escrow.md#getuserfunds)
|
|
23
|
-
- [getUserTokens](Escrow.md#getusertokens)
|
|
24
|
-
- [getLocks](Escrow.md#getlocks)
|
|
25
|
-
- [getAuthorizations](Escrow.md#getauthorizations)
|
|
26
|
-
- [verifyFundsForEscrowPayment](Escrow.md#verifyfundsforescrowpayment)
|
|
27
|
-
- [deposit](Escrow.md#deposit)
|
|
28
|
-
- [withdraw](Escrow.md#withdraw)
|
|
29
|
-
- [authorize](Escrow.md#authorize)
|
|
30
|
-
|
|
31
|
-
## Constructors
|
|
32
|
-
|
|
33
|
-
### constructor
|
|
34
|
-
|
|
35
|
-
• **new EscrowContract**(`address`, `signer`, `network?`, `config?`, `abi?`)
|
|
36
|
-
|
|
37
|
-
#### Parameters
|
|
38
|
-
|
|
39
|
-
| Name | Type |
|
|
40
|
-
| :------ | :------ |
|
|
41
|
-
| `address` | `string` |
|
|
42
|
-
| `signer` | `Signer` |
|
|
43
|
-
| `network?` | `string` \| `number` |
|
|
44
|
-
| `config?` | [`Config`](Config.md) |
|
|
45
|
-
| `abi?` | [`AbiItem`](../interfaces/AbiItem.md)[] |
|
|
46
|
-
|
|
47
|
-
#### Inherited from
|
|
48
|
-
|
|
49
|
-
[SmartContractWithAddress](SmartContractWithAddress.md).[constructor](SmartContractWithAddress.md#constructor)
|
|
50
|
-
|
|
51
|
-
#### Defined in
|
|
52
|
-
|
|
53
|
-
[contracts/Escrow.ts:26](https://github.com/oceanprotocol/ocean.js/blob/main/src/contracts/Escrow.ts#L26)
|
|
54
|
-
|
|
55
|
-
## Methods
|
|
56
|
-
|
|
57
|
-
### getFunds
|
|
58
|
-
|
|
59
|
-
▸ **getFunds**(`token`): `Promise`<`{available: bigint, locked: bigint}`\>
|
|
60
|
-
|
|
61
|
-
Get total funds in escrow for a token
|
|
62
|
-
|
|
63
|
-
#### Parameters
|
|
64
|
-
|
|
65
|
-
| Name | Type | Description |
|
|
66
|
-
| :------ | :------ | :------ |
|
|
67
|
-
| `token` | `string` | token address |
|
|
68
|
-
|
|
69
|
-
#### Returns
|
|
70
|
-
|
|
71
|
-
`Promise`<`{available: bigint, locked: bigint}`\>
|
|
72
|
-
|
|
73
|
-
Object with `available` and `locked` amounts
|
|
74
|
-
|
|
75
|
-
#### Defined in
|
|
76
|
-
|
|
77
|
-
[contracts/Escrow.ts:41](https://github.com/oceanprotocol/ocean.js/blob/main/src/contracts/Escrow.ts#L41)
|
|
78
|
-
|
|
79
|
-
___
|
|
80
|
-
|
|
81
|
-
### getUserFunds
|
|
82
|
-
|
|
83
|
-
▸ **getUserFunds**(`payer`, `token`): `Promise`<`{available: bigint, locked: bigint}`\>
|
|
84
|
-
|
|
85
|
-
Get user's available escrow balance
|
|
86
|
-
|
|
87
|
-
#### Parameters
|
|
88
|
-
|
|
89
|
-
| Name | Type | Description |
|
|
90
|
-
| :------ | :------ | :------ |
|
|
91
|
-
| `payer` | `string` | user address |
|
|
92
|
-
| `token` | `string` | token address |
|
|
93
|
-
|
|
94
|
-
#### Returns
|
|
95
|
-
|
|
96
|
-
`Promise`<`{available: bigint, locked: bigint}`\>
|
|
97
|
-
|
|
98
|
-
Object with `available` and `locked` amounts for this user/token pair
|
|
99
|
-
|
|
100
|
-
#### Defined in
|
|
101
|
-
|
|
102
|
-
[contracts/Escrow.ts:49](https://github.com/oceanprotocol/ocean.js/blob/main/src/contracts/Escrow.ts#L49)
|
|
103
|
-
|
|
104
|
-
___
|
|
105
|
-
|
|
106
|
-
### getUserTokens
|
|
107
|
-
|
|
108
|
-
▸ **getUserTokens**(`payer`): `Promise`<`string[]`\>
|
|
109
|
-
|
|
110
|
-
Get list of tokens user has deposited
|
|
111
|
-
|
|
112
|
-
#### Parameters
|
|
113
|
-
|
|
114
|
-
| Name | Type | Description |
|
|
115
|
-
| :------ | :------ | :------ |
|
|
116
|
-
| `payer` | `string` | user address |
|
|
117
|
-
|
|
118
|
-
#### Returns
|
|
119
|
-
|
|
120
|
-
`Promise`<`string[]`\>
|
|
121
|
-
|
|
122
|
-
Array of token addresses this user has deposited
|
|
123
|
-
|
|
124
|
-
#### Defined in
|
|
125
|
-
|
|
126
|
-
[contracts/Escrow.ts:57](https://github.com/oceanprotocol/ocean.js/blob/main/src/contracts/Escrow.ts#L57)
|
|
127
|
-
|
|
128
|
-
___
|
|
129
|
-
|
|
130
|
-
### getLocks
|
|
131
|
-
|
|
132
|
-
▸ **getLocks**(`token`, `payer`, `payee`): `Promise`<`Lock[]`\>
|
|
133
|
-
|
|
134
|
-
Get active payment locks
|
|
135
|
-
|
|
136
|
-
#### Parameters
|
|
137
|
-
|
|
138
|
-
| Name | Type | Description |
|
|
139
|
-
| :------ | :------ | :------ |
|
|
140
|
-
| `token` | `string` | token address |
|
|
141
|
-
| `payer` | `string` | payer address |
|
|
142
|
-
| `payee` | `string` | payee address |
|
|
143
|
-
|
|
144
|
-
#### Returns
|
|
145
|
-
|
|
146
|
-
`Promise`<`Lock[]`\>
|
|
147
|
-
|
|
148
|
-
Array of locks where each lock contains: `{jobId, payer, payee, amount, expiry, token}`
|
|
149
|
-
|
|
150
|
-
#### Defined in
|
|
151
|
-
|
|
152
|
-
[contracts/Escrow.ts:65](https://github.com/oceanprotocol/ocean.js/blob/main/src/contracts/Escrow.ts#L65)
|
|
153
|
-
|
|
154
|
-
___
|
|
155
|
-
|
|
156
|
-
### getAuthorizations
|
|
157
|
-
|
|
158
|
-
▸ **getAuthorizations**(`token`, `payer`, `payee`): `Promise`<`Authorization[]`\>
|
|
159
|
-
|
|
160
|
-
Get payment authorizations
|
|
161
|
-
|
|
162
|
-
#### Parameters
|
|
163
|
-
|
|
164
|
-
| Name | Type | Description |
|
|
165
|
-
| :------ | :------ | :------ |
|
|
166
|
-
| `token` | `string` | token address |
|
|
167
|
-
| `payer` | `string` | payer address |
|
|
168
|
-
| `payee` | `string` | payee address |
|
|
169
|
-
|
|
170
|
-
#### Returns
|
|
171
|
-
|
|
172
|
-
`Promise`<`Authorization[]`\>
|
|
173
|
-
|
|
174
|
-
Array of authorizations where each contains: `{payee, maxLockedAmount, currentLockedAmount, maxLockSeconds, maxLockCounts, currentLocks}`
|
|
175
|
-
|
|
176
|
-
#### Defined in
|
|
177
|
-
|
|
178
|
-
[contracts/Escrow.ts:73](https://github.com/oceanprotocol/ocean.js/blob/main/src/contracts/Escrow.ts#L73)
|
|
179
|
-
|
|
180
|
-
___
|
|
181
|
-
|
|
182
|
-
### verifyFundsForEscrowPayment
|
|
183
|
-
|
|
184
|
-
▸ **verifyFundsForEscrowPayment**(`token`, `consumerAddress`, `amountToDeposit?`, `maxLockedAmount?`, `maxLockSeconds?`, `maxLockCounts?`): `Promise`<`ValidationResponse`\>
|
|
185
|
-
|
|
186
|
-
Checks if you have enough funds, authorizes and deposits if needed - all in one call
|
|
187
|
-
|
|
188
|
-
#### Parameters
|
|
189
|
-
|
|
190
|
-
| Name | Type | Description |
|
|
191
|
-
| :------ | :------ | :------ |
|
|
192
|
-
| `token` | `string` | payment token |
|
|
193
|
-
| `consumerAddress` | `string` | compute environment consumer address |
|
|
194
|
-
| `amountToDeposit?` | `string` | how much to deposit (optional) |
|
|
195
|
-
| `maxLockedAmount?` | `string` | max amount for compute job |
|
|
196
|
-
| `maxLockSeconds?` | `string` | max lock duration |
|
|
197
|
-
| `maxLockCounts?` | `string` | max number of locks |
|
|
198
|
-
|
|
199
|
-
#### Returns
|
|
200
|
-
|
|
201
|
-
`Promise`<`ValidationResponse`\>
|
|
202
|
-
|
|
203
|
-
validation status
|
|
204
|
-
|
|
205
|
-
#### Defined in
|
|
206
|
-
|
|
207
|
-
[contracts/Escrow.ts:98](https://github.com/oceanprotocol/ocean.js/blob/main/src/contracts/Escrow.ts#L98)
|
|
208
|
-
|
|
209
|
-
___
|
|
210
|
-
|
|
211
|
-
### deposit
|
|
212
|
-
|
|
213
|
-
▸ **deposit**<`G`\>(`token`, `amount`, `estimateGas?`): `Promise`<`ReceiptOrEstimate`<`G`\>\>
|
|
214
|
-
|
|
215
|
-
Deposit tokens into escrow
|
|
216
|
-
|
|
217
|
-
#### Parameters
|
|
218
|
-
|
|
219
|
-
| Name | Type |
|
|
220
|
-
| :------ | :------ |
|
|
221
|
-
| `token` | `string` |
|
|
222
|
-
| `amount` | `string` |
|
|
223
|
-
| `estimateGas?` | `G` |
|
|
224
|
-
|
|
225
|
-
#### Returns
|
|
226
|
-
|
|
227
|
-
`Promise`<`ReceiptOrEstimate`<`G`\>\>
|
|
228
|
-
|
|
229
|
-
#### Defined in
|
|
230
|
-
|
|
231
|
-
[contracts/Escrow.ts:191](https://github.com/oceanprotocol/ocean.js/blob/main/src/contracts/Escrow.ts#L191)
|
|
232
|
-
|
|
233
|
-
___
|
|
234
|
-
|
|
235
|
-
### withdraw
|
|
236
|
-
|
|
237
|
-
▸ **withdraw**<`G`\>(`tokens`, `amounts`, `estimateGas?`): `Promise`<`ReceiptOrEstimate`<`G`\>\>
|
|
238
|
-
|
|
239
|
-
Withdraw tokens from escrow
|
|
240
|
-
|
|
241
|
-
#### Parameters
|
|
242
|
-
|
|
243
|
-
| Name | Type | Description |
|
|
244
|
-
| :------ | :------ | :------ |
|
|
245
|
-
| `tokens` | `string[]` | array of token addresses |
|
|
246
|
-
| `amounts` | `string[]` | array of amounts to withdraw |
|
|
247
|
-
| `estimateGas?` | `G` | - |
|
|
248
|
-
|
|
249
|
-
#### Returns
|
|
250
|
-
|
|
251
|
-
`Promise`<`ReceiptOrEstimate`<`G`\>\>
|
|
252
|
-
|
|
253
|
-
#### Defined in
|
|
254
|
-
|
|
255
|
-
[contracts/Escrow.ts:217](https://github.com/oceanprotocol/ocean.js/blob/main/src/contracts/Escrow.ts#L217)
|
|
256
|
-
|
|
257
|
-
___
|
|
258
|
-
|
|
259
|
-
### authorize
|
|
260
|
-
|
|
261
|
-
▸ **authorize**<`G`\>(`token`, `payee`, `maxLockedAmount`, `maxLockSeconds`, `maxLockCounts`, `estimateGas?`): `Promise`<`ReceiptOrEstimate`<`G`\>\>
|
|
262
|
-
|
|
263
|
-
Authorize someone to lock your funds
|
|
264
|
-
|
|
265
|
-
#### Parameters
|
|
266
|
-
|
|
267
|
-
| Name | Type |
|
|
268
|
-
| :------ | :------ |
|
|
269
|
-
| `token` | `string` |
|
|
270
|
-
| `payee` | `string` |
|
|
271
|
-
| `maxLockedAmount` | `string` |
|
|
272
|
-
| `maxLockSeconds` | `string` |
|
|
273
|
-
| `maxLockCounts` | `string` |
|
|
274
|
-
| `estimateGas?` | `G` |
|
|
275
|
-
|
|
276
|
-
#### Returns
|
|
277
|
-
|
|
278
|
-
`Promise`<`ReceiptOrEstimate`<`G`\>\>
|
|
279
|
-
|
|
280
|
-
#### Defined in
|
|
281
|
-
|
|
282
|
-
[contracts/Escrow.ts:274](https://github.com/oceanprotocol/ocean.js/blob/main/src/contracts/Escrow.ts#L274)
|
|
283
|
-
|
|
284
|
-
___
|
|
285
|
-
|