Skip to content

Commit

Permalink
Merge pull request #126 from nevermined-io/fix/update-doc
Browse files Browse the repository at this point in the history
fix: nvmApp documentation
  • Loading branch information
aaitor authored Jun 19, 2024
2 parents 161367f + fcf76fd commit 9abf015
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions docs/tutorials/integration/03-api-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ const accountSigner = zerodevProvider.getAccountSigner()
await nvmApp.connect(accountSigner)
```

:::warning
The use of zeroDev is optional. And regarding the wallet, you can use ethers/viem or other libraries to have the wallet connected.
:::

### Publishing subscriptions

Here you can see how to create a Credits Subscription that gives 50 credits to the subscribers when they purchase the subscription for 1 USD/USDC:
Expand Down Expand Up @@ -163,8 +167,9 @@ await nvmAppSubscriber.connect(subscriberAddress, appConfig)
And now we order the previously created subscription with the new account:

```typescript
const orderResult = await nvmAppSubscriber.orderSubscription(subscriptionDDO.id)
const orderResult = await nvmAppSubscriber.orderSubscription(subscriptionDDO.id, subscriptionDDO.credits)
const agreementId = orderResult.agreementId
await nvmApp.claimSubscription(agreementId, subscriptionDDO.id, subscriptionDDO.credits)
```

### Using the subscription to get access to AI Agents
Expand All @@ -190,8 +195,9 @@ const result = await fetch(token.neverminedProxyUri, opts)
```typescript
const results = await nvmAppSubscriber.downloadFiles(
datasetDDO.id,
agreementId,
`/tmp`,
1, // The index of the file to download
agreementId, // Optional
`/tmp`, // The folder where the file will be downloaded
)

```

0 comments on commit 9abf015

Please sign in to comment.