Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: getSubscriptionBalance method #57

Merged
merged 1 commit into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nevermined-io/payments",
"version": "0.3.0",
"version": "0.3.1",
"description": "Typescript SDK to interact with the Nevermined Payments Protocol",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
5 changes: 4 additions & 1 deletion src/payments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -527,11 +527,13 @@ export class Payments {
*
* @param subscriptionDid - The subscription DID of the service to be published.
* @param accountAddress - The address of the account to get the balance.
* @param nvmApiKey - The NVM API key to use for the request.
* @returns A promise that resolves to the balance result.
*/
public async getSubscriptionBalance(
subscriptionDid: string,
accountAddress: string,
accountAddress?: string,
nvmApiKey?: string,
): Promise<{
subscriptionType: string
isOwner: boolean
Expand All @@ -547,6 +549,7 @@ export class Payments {
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
Authorization: `Bearer ${nvmApiKey || this.nvmApiKey}`,
},
body: JSON.stringify(body),
}
Expand Down