File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Expand file tree Collapse file tree 2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @nevermined-io/payments" ,
3
- "version" : " 0.1.8 " ,
3
+ "version" : " 0.1.9 " ,
4
4
"description" : " Typescript SDK to interact with the Nevermined Payments Protocol" ,
5
5
"main" : " ./dist/index.js" ,
6
6
"types" : " ./dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -480,6 +480,37 @@ export class Payments {
480
480
return response . json ( )
481
481
}
482
482
483
+
484
+ /**
485
+ * Get array of services DIDs associated with a subscription.
486
+ *
487
+ * @param did - The DID of the asset.
488
+ * @returns A promise that resolves to the array of services DIDs.
489
+ */
490
+ public async getSubscriptionAssociatedServices ( subscriptionDid : string ) {
491
+ const url = new URL ( `/api/v1/payments/subscription/services/${ subscriptionDid } ` , this . environment . backend )
492
+ const response = await fetch ( url )
493
+ if ( ! response . ok ) {
494
+ throw Error ( response . statusText )
495
+ }
496
+ return response . json ( )
497
+ }
498
+
499
+ /**
500
+ * Get array of files DIDs associated with a subscription.
501
+ *
502
+ * @param did - The DID of the asset.
503
+ * @returns A promise that resolves to array of files DIDs.
504
+ */
505
+ public async getSubscriptionAssociatedFiles ( subscriptionDid : string ) {
506
+ const url = new URL ( `/api/v1/payments/subscription/files/${ subscriptionDid } ` , this . environment . backend )
507
+ const response = await fetch ( url )
508
+ if ( ! response . ok ) {
509
+ throw Error ( response . statusText )
510
+ }
511
+ return response . json ( )
512
+ }
513
+
483
514
/**
484
515
* Get the balance of an account for a subscription.
485
516
*
You can’t perform that action at this time.
0 commit comments