Skip to content

Commit

Permalink
Merge pull request #655 from nevermined-io/feat/session-keys-order
Browse files Browse the repository at this point in the history
Feat/session keys order
  • Loading branch information
eruizgar91 authored May 6, 2024
2 parents bcc2d13 + 59b2ada commit 5e9a924
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 14 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/testing-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ jobs:
with:
repository: nevermined-io/node
path: node
# TODO: remove this when Node integrated with SDKv2 is integraged
ref: feat/integrate-new-sdk
ref: main
token: ${{ secrets.API_TOKEN_GITHUB }}
- uses: nevermined-io/[email protected]
with:
Expand Down
29 changes: 22 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,22 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v3.0.0](https://github.com/nevermined-io/sdk-js/compare/v3.0.0-rc9...v3.0.0)
#### [v3.0.1-rc1](https://github.com/nevermined-io/sdk-js/compare/v3.0.1-rc0...v3.0.1-rc1)

> 6 May 2024
- Automated CHANGELOG.md update [`09aa3b7`](https://github.com/nevermined-io/sdk-js/commit/09aa3b7a2c7bc2d5b4a64f150d284fc1d74c1b13)
- feat: add console.log [`c0a800a`](https://github.com/nevermined-io/sdk-js/commit/c0a800ab41bf26120419d3a95af5744473df774b)
- feat: test againts latest node [`177496a`](https://github.com/nevermined-io/sdk-js/commit/177496accd540c10ee98efa2a279b09967b46092)

#### [v3.0.1-rc0](https://github.com/nevermined-io/sdk-js/compare/v3.0.0...v3.0.1-rc0)

> 3 May 2024
- fix: wait tx for session keys an use bigint for blocknumbers in all the places [`a6188e7`](https://github.com/nevermined-io/sdk-js/commit/a6188e78eaeecb346ff0b067335c4c7783dfefb0)
- chore: adding v3.0.0 Changelog updates [`bcc2d13`](https://github.com/nevermined-io/sdk-js/commit/bcc2d13c3da67cee187b2bb1b8e2c74ebec40bb4)

### [v3.0.0](https://github.com/nevermined-io/sdk-js/compare/v3.0.0-rc9...v3.0.0)

> 2 May 2024
Expand Down Expand Up @@ -491,7 +506,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- feat: add as an option in the config [`6f610b4`](https://github.com/nevermined-io/sdk-js/commit/6f610b4d6372c0d0843b70083b7018708f5a948d)
- chore: adding v2.0.0 Changelog updates [`4ddbf3d`](https://github.com/nevermined-io/sdk-js/commit/4ddbf3de548ed94c0a79341961693510151ce9bd)

#### [v2.0.0](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc9...v2.0.0)
### [v2.0.0](https://github.com/nevermined-io/sdk-js/compare/v2.0.0-rc9...v2.0.0)

> 20 October 2023
Expand Down Expand Up @@ -1087,7 +1102,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- ci: testing with https services [`bb96077`](https://github.com/nevermined-io/sdk-js/commit/bb96077c9403ea7ae26195a51d8a92e144cea384)
- linting [`d2547ed`](https://github.com/nevermined-io/sdk-js/commit/d2547edfbfebb49b488c97c4ce9e6d6f2ee849e4)

#### [v1.0.0](https://github.com/nevermined-io/sdk-js/compare/v1.0.0-rc9...v1.0.0)
### [v1.0.0](https://github.com/nevermined-io/sdk-js/compare/v1.0.0-rc9...v1.0.0)

> 14 February 2023
Expand Down Expand Up @@ -1826,7 +1841,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

> 2 May 2022
- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248)
- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248)
- Adding v0.19.21 Changelog updates [`c93cdc5`](https://github.com/nevermined-io/sdk-js/commit/c93cdc55f139a43db4130ccb0f80924d2645a931)

#### [v0.19.21](https://github.com/nevermined-io/sdk-js/compare/v0.19.20...v0.19.21)
Expand Down Expand Up @@ -2089,7 +2104,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

> 18 January 2022
- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186)
- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186)
- [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183)
- Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177)
- Adding v0.17.2 Changelog updates [`5eddda4`](https://github.com/nevermined-io/sdk-js/commit/5eddda43954e013e6e6f7344c9a877d801aacb5c)
Expand Down Expand Up @@ -2595,7 +2610,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- Feature/sync develop [`#268`](https://github.com/nevermined-io/sdk-js/pull/268)
- Quick fix for non-eip1559 networks [`#266`](https://github.com/nevermined-io/sdk-js/pull/266)
- integrate Permissions and refactor search query [`#264`](https://github.com/nevermined-io/sdk-js/pull/264)
- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248)
- add aave service agreement to ddo when creating nft721 asset [`#248`](https://github.com/nevermined-io/sdk-js/pull/248)
- Get the keeper version from the artifacts instead of package version [`#244`](https://github.com/nevermined-io/sdk-js/pull/244)
- replace `metadata-api` url by `marketplace-api` and sort type [`#243`](https://github.com/nevermined-io/sdk-js/pull/243)
- fixing issues with BigNumbers [`#246`](https://github.com/nevermined-io/sdk-js/pull/246)
Expand Down Expand Up @@ -2634,7 +2649,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- Feature/190 add did to sec markets [`#191`](https://github.com/nevermined-io/sdk-js/pull/191)
- Adding utility methods for getting nft token uri [`#189`](https://github.com/nevermined-io/sdk-js/pull/189)
- Lint ... [`#187`](https://github.com/nevermined-io/sdk-js/pull/187)
- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186)
- Removing not used parameter [`#186`](https://github.com/nevermined-io/sdk-js/pull/186)
- [wip] Create agreement+pay in one transaction [`#183`](https://github.com/nevermined-io/sdk-js/pull/183)
- Adapting to contracts `v1.3.3` [`#177`](https://github.com/nevermined-io/sdk-js/pull/177)
- Correct typo in route [`#184`](https://github.com/nevermined-io/sdk-js/pull/184)
Expand Down
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/sdk",
"version": "3.0.0",
"version": "3.0.1",
"description": "Javascript SDK for connecting with Nevermined Data Platform ",
"main": "./dist/node/sdk.js",
"typings": "./dist/node/sdk.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions src/events/EventHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export class EventHandler {
return this.events.size
}

private events = new Set<(blockNumber) => void>()
private events = new Set<(blockNumber: bigint) => void>()

private lastBlock: bigint

Expand All @@ -15,7 +15,7 @@ export class EventHandler {

private getBlockNumber: () => Promise<bigint>

public subscribe(callback: (blockNumber: number) => void, getBlockNumber: () => Promise<bigint>) {
public subscribe(callback: (blockNumber: bigint) => void, getBlockNumber: () => Promise<bigint>) {
this.getBlockNumber = getBlockNumber
this.events.add(callback)
this.checkBlock()
Expand All @@ -25,7 +25,7 @@ export class EventHandler {
}
}

public unsubscribe(callback: (blockNumber: number) => void) {
public unsubscribe(callback: (blockNumber: bigint) => void) {
this.events.delete(callback)
if (!this.count) {
clearTimeout(this.lastTimeout)
Expand Down
2 changes: 1 addition & 1 deletion src/events/SubgraphEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ export class SubgraphEvent extends NeverminedEvent {
`,
})

return result.data._meta.block.number
return BigInt(result.data._meta.block.number)
}
}
3 changes: 3 additions & 0 deletions src/keeper/contracts/ContractBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ export abstract class ContractBase extends Instantiable {
public async sendFrom(functionName: string, args: any[], from: NvmAccount, value?: TxParameters) {
const receipt = await this.send(functionName, from, args, value)
// receipt.transactionHash
if (from.getType() === 'sessionKey') {
return receipt
}
const tx = await this.client.public.waitForTransactionReceipt({ hash: receipt.transactionHash })
if (tx.status !== 'success') {
this.logger.error(
Expand Down

0 comments on commit 5e9a924

Please sign in to comment.