diff --git a/.github/workflows/testing-node.yml b/.github/workflows/testing-node.yml index 682d4cd82..5376dc0d7 100644 --- a/.github/workflows/testing-node.yml +++ b/.github/workflows/testing-node.yml @@ -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/nvm-tools-actions@v0.15.0 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index d2a242266..586f5965a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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 @@ -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 @@ -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) @@ -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) @@ -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) @@ -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) diff --git a/package.json b/package.json index 2e539041f..15babbd06 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/events/EventHandler.ts b/src/events/EventHandler.ts index 077d25ba7..99d2629a1 100644 --- a/src/events/EventHandler.ts +++ b/src/events/EventHandler.ts @@ -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 @@ -15,7 +15,7 @@ export class EventHandler { private getBlockNumber: () => Promise - public subscribe(callback: (blockNumber: number) => void, getBlockNumber: () => Promise) { + public subscribe(callback: (blockNumber: bigint) => void, getBlockNumber: () => Promise) { this.getBlockNumber = getBlockNumber this.events.add(callback) this.checkBlock() @@ -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) diff --git a/src/events/SubgraphEvent.ts b/src/events/SubgraphEvent.ts index a7873511c..30510f255 100644 --- a/src/events/SubgraphEvent.ts +++ b/src/events/SubgraphEvent.ts @@ -79,6 +79,6 @@ export class SubgraphEvent extends NeverminedEvent { `, }) - return result.data._meta.block.number + return BigInt(result.data._meta.block.number) } } diff --git a/src/keeper/contracts/ContractBase.ts b/src/keeper/contracts/ContractBase.ts index aa910ce75..81f232526 100644 --- a/src/keeper/contracts/ContractBase.ts +++ b/src/keeper/contracts/ContractBase.ts @@ -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(