Skip to content

Commit

Permalink
Merge pull request #59 from nevermined-io/feature/account-address
Browse files Browse the repository at this point in the history
Feature: account address
  • Loading branch information
metabacalhau authored Jun 3, 2024
2 parents eee4e31 + a685198 commit 12903f9
Show file tree
Hide file tree
Showing 4 changed files with 443 additions and 448 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
.DS_Store

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nevermined-io/payments",
"version": "0.3.1",
"version": "0.3.2",
"description": "Typescript SDK to interact with the Nevermined Payments Protocol",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand All @@ -25,7 +25,6 @@
"@types/node": "^20.11.19",
"@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2",
"typedoc": "0.25.13",
"eslint": "^8.56.0",
"eslint-config-nevermined": "^0.2.0",
"eslint-config-next": "^14.1.0",
Expand All @@ -34,6 +33,7 @@
"prettier": "^3.2.5",
"ts-node": "^10.9.2",
"tslib": "^2.6.2",
"typedoc": "0.25.13",
"typescript": "^5.3.3"
}
}
11 changes: 10 additions & 1 deletion src/payments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export class Payments {
public environment: EnvironmentInfo
public appId?: string
public version?: string
public accountAddress?: string
private nvmApiKey?: string

/**
Expand Down Expand Up @@ -114,8 +115,16 @@ export class Payments {
if (nvmApiKey) {
this.nvmApiKey = nvmApiKey as string
url.searchParams.delete('nvmApiKey')
history.replaceState(history.state, '', url.toString())
}

const accountAddress = url.searchParams.get('accountAddress') as string

if (accountAddress) {
this.accountAddress = accountAddress
url.searchParams.delete('accountAddress')
}

history.replaceState(history.state, '', url.toString())
}

/**
Expand Down
Loading

0 comments on commit 12903f9

Please sign in to comment.