1
0
mirror of https://github.com/oceanprotocol-archive/squid-js.git synced 2024-02-02 15:31:51 +01:00

update and clarify migration example

This commit is contained in:
Matthias Kretschmann 2020-01-28 19:42:07 +01:00
parent 9572b4eb3b
commit 66a056cf59
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 7 additions and 2 deletions

View File

@ -13,14 +13,19 @@ squid-js v2.0.0 only works against:
- Events Handler v0.4.4+ - Events Handler v0.4.4+
- Keeper Contracts v0.13.2+ - Keeper Contracts v0.13.2+
### Service index removal from `ocean.assets.order` & `ocean.assets.consume` ### Service index parameter removal from `ocean.assets` methods
Removes the need to get the respective service from the DDO, the `ocean.assets` methods will now do this on their own automatically.
```js ```js
// old // old
const service = ddo.findServiceByType('access')
const did = ddo.id
const agreementId = await ocean.assets.order(did, service.index, account) const agreementId = await ocean.assets.order(did, service.index, account)
const path = await ocean.assets.consume(agreementId, did, service.index, account, folder) const path = await ocean.assets.consume(agreementId, did, service.index, account, folder)
// NEW // NEW
const did = ddo.id
const agreementId = await ocean.assets.order(did, account) const agreementId = await ocean.assets.order(did, account)
const path = await ocean.assets.consume(agreementId, did, account, folder) const path = await ocean.assets.consume(agreementId, did, account, folder)
``` ```

View File

@ -19,7 +19,7 @@
}, },
{ {
"name": "events-handler", "name": "events-handler",
"version": "~0.4.1" "version": "~0.4.4"
} }
] ]
} }