From e1684695d89f426a2fc6da5262c351f8cf2b9dc3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 09:45:53 +0000 Subject: [PATCH 01/17] chore(main): release 0.24.1 --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d0d7e9a..b03efa67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [0.24.1](https://github.com/ERC725Alliance/erc725.js/compare/v0.24.0...v0.24.1) (2024-04-03) + + +### Bug Fixes + +* Add missing exports due to merge conflict. ([2e14cd5](https://github.com/ERC725Alliance/erc725.js/commit/2e14cd5b4a5a1f51222c1056bd4220be2a09a02d)) + ## [0.24.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.23.1...v0.24.0) (2024-04-02) diff --git a/package-lock.json b/package-lock.json index d67c5414..b5e5a589 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@erc725/erc725.js", - "version": "0.24.0", + "version": "0.24.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.24.0", + "version": "0.24.1", "license": "Apache-2.0", "dependencies": { "add": "^2.0.6", diff --git a/package.json b/package.json index dc7ba660..bbb953e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.24.0", + "version": "0.24.1", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", From 09c669df6f04c368c2f14b4e192e8f79a82abf0f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 11 Apr 2024 09:05:18 +0000 Subject: [PATCH 02/17] chore(main): release 0.24.2 --- CHANGELOG.md | 9 +++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fa6ade7..3f362b93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [0.24.2](https://github.com/ERC725Alliance/erc725.js/compare/v0.24.1...v0.24.2) (2024-04-11) + + +### Bug Fixes + +* Apply suggestions. ([e9c3d81](https://github.com/ERC725Alliance/erc725.js/commit/e9c3d81875ef2861791753c1285defc096ddbdac)) +* Minimize changes ([cc31b5f](https://github.com/ERC725Alliance/erc725.js/commit/cc31b5f8b185743a5e783a04a7a8b4b158268fda)) +* Repair data: urls from not triggering the baseURI test. ([c26ab3e](https://github.com/ERC725Alliance/erc725.js/commit/c26ab3e51b1f027044df467ab4e2f0c6a00dff5d)) + ## [0.24.1](https://github.com/ERC725Alliance/erc725.js/compare/v0.24.0...v0.24.1) (2024-04-03) diff --git a/package-lock.json b/package-lock.json index a85fd377..43b58a3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@erc725/erc725.js", - "version": "0.24.1", + "version": "0.24.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.24.1", + "version": "0.24.2", "license": "Apache-2.0", "dependencies": { "add": "^2.0.6", diff --git a/package.json b/package.json index 45c10cf1..a1742bbb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.24.1", + "version": "0.24.2", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", From bb2599e7df411cceefc26b98312a7ae981d11ae4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 18 Apr 2024 09:12:16 +0000 Subject: [PATCH 03/17] chore(main): release 0.25.0 --- CHANGELOG.md | 7 +++++++ package-lock.json | 4 ++-- package.json | 14 +++++++++++--- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f362b93..dce7796a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [0.25.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.24.2...v0.25.0) (2024-04-18) + + +### Features + +* export methods for encoding/decoding dataSourceWithHash and valueContent ([b1e0ed9](https://github.com/ERC725Alliance/erc725.js/commit/b1e0ed98718acce90f1db6917728394ab8aeb4fa)) + ## [0.24.2](https://github.com/ERC725Alliance/erc725.js/compare/v0.24.1...v0.24.2) (2024-04-11) diff --git a/package-lock.json b/package-lock.json index 43b58a3d..cc9f69d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@erc725/erc725.js", - "version": "0.24.2", + "version": "0.25.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.24.2", + "version": "0.25.0", "license": "Apache-2.0", "dependencies": { "add": "^2.0.6", diff --git a/package.json b/package.json index 11f19abe..e14dbe1b 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,15 @@ { "name": "@erc725/erc725.js", - "version": "0.24.2", + "version": "0.25.0", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", "module": "build/module/src/index.js", - "files": ["build", "schemas", "docs"], + "files": [ + "build", + "schemas", + "docs" + ], "scripts": { "build": "run-p build:*", "build:main": "tsc -p tsconfig.json", @@ -21,7 +25,11 @@ "type": "git", "url": "git+https://github.com/ERC725Alliance/erc725.js" }, - "keywords": ["ethereum", "erc725", "lsp"], + "keywords": [ + "ethereum", + "erc725", + "lsp" + ], "contributors": [ { "name": "Robert McLeod", From 031101d550aec57ae6e414d1c151afbffbb58bb4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 18 Apr 2024 12:28:16 +0000 Subject: [PATCH 04/17] chore(main): release 0.25.0 --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dce7796a..ddf8f4dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [0.25.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.25.0...v0.25.0) (2024-04-18) + + +### Bug Fixes + +* Ignore formatting in package.json inside of biome ([33a80dd](https://github.com/ERC725Alliance/erc725.js/commit/33a80dd5368028cb55ab68ea940c176790595806)) + + +### Miscellaneous Chores + +* release 0.25.0 ([a6af6b4](https://github.com/ERC725Alliance/erc725.js/commit/a6af6b46aa25fab8494c55e8b8dcd4c2cad65102)) + ## [0.25.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.24.2...v0.25.0) (2024-04-18) From c8a4e73e3a57f13ef4bdfa533b1aad7024c59376 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 18 Apr 2024 14:20:28 +0000 Subject: [PATCH 05/17] chore(main): release 0.25.0 --- CHANGELOG.md | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddf8f4dd..5f878ce9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,40 +2,25 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. -## [0.25.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.25.0...v0.25.0) (2024-04-18) - - -### Bug Fixes - -* Ignore formatting in package.json inside of biome ([33a80dd](https://github.com/ERC725Alliance/erc725.js/commit/33a80dd5368028cb55ab68ea940c176790595806)) - - -### Miscellaneous Chores - -* release 0.25.0 ([a6af6b4](https://github.com/ERC725Alliance/erc725.js/commit/a6af6b46aa25fab8494c55e8b8dcd4c2cad65102)) - ## [0.25.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.24.2...v0.25.0) (2024-04-18) - ### Features -* export methods for encoding/decoding dataSourceWithHash and valueContent ([b1e0ed9](https://github.com/ERC725Alliance/erc725.js/commit/b1e0ed98718acce90f1db6917728394ab8aeb4fa)) +- export methods for encoding/decoding dataSourceWithHash and valueContent ([b1e0ed9](https://github.com/ERC725Alliance/erc725.js/commit/b1e0ed98718acce90f1db6917728394ab8aeb4fa)) ## [0.24.2](https://github.com/ERC725Alliance/erc725.js/compare/v0.24.1...v0.24.2) (2024-04-11) - ### Bug Fixes -* Apply suggestions. ([e9c3d81](https://github.com/ERC725Alliance/erc725.js/commit/e9c3d81875ef2861791753c1285defc096ddbdac)) -* Minimize changes ([cc31b5f](https://github.com/ERC725Alliance/erc725.js/commit/cc31b5f8b185743a5e783a04a7a8b4b158268fda)) -* Repair data: urls from not triggering the baseURI test. ([c26ab3e](https://github.com/ERC725Alliance/erc725.js/commit/c26ab3e51b1f027044df467ab4e2f0c6a00dff5d)) +- Apply suggestions. ([e9c3d81](https://github.com/ERC725Alliance/erc725.js/commit/e9c3d81875ef2861791753c1285defc096ddbdac)) +- Minimize changes ([cc31b5f](https://github.com/ERC725Alliance/erc725.js/commit/cc31b5f8b185743a5e783a04a7a8b4b158268fda)) +- Repair data: urls from not triggering the baseURI test. ([c26ab3e](https://github.com/ERC725Alliance/erc725.js/commit/c26ab3e51b1f027044df467ab4e2f0c6a00dff5d)) ## [0.24.1](https://github.com/ERC725Alliance/erc725.js/compare/v0.24.0...v0.24.1) (2024-04-03) - ### Bug Fixes -* Add missing exports due to merge conflict. ([2e14cd5](https://github.com/ERC725Alliance/erc725.js/commit/2e14cd5b4a5a1f51222c1056bd4220be2a09a02d)) +- Add missing exports due to merge conflict. ([2e14cd5](https://github.com/ERC725Alliance/erc725.js/commit/2e14cd5b4a5a1f51222c1056bd4220be2a09a02d)) ## [0.24.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.23.1...v0.24.0) (2024-04-02) From 5b6b1b764cc2c3bba2918ec7589e51734abf38f7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 14 May 2024 20:38:31 +0000 Subject: [PATCH 06/17] chore(main): release 0.26.0 --- CHANGELOG.md | 16 ++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f878ce9..75f1db39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [0.26.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.25.0...v0.26.0) (2024-05-14) + +### Features + +- add `dynamicPart` in schema returned by `getSchema` ([12d34d2](https://github.com/ERC725Alliance/erc725.js/commit/12d34d2d8a80656ae9b4efeb1ec72bcf2426b6e5)) +- add support for `bytesN` valueType from 1 to 32 ([1db6f2f](https://github.com/ERC725Alliance/erc725.js/commit/1db6f2faebaccdcc39455b4a3dbae05c6416271a)) +- allow to use `decodeData` to decode Array length only ([5ddb12d](https://github.com/ERC725Alliance/erc725.js/commit/5ddb12d43ce399e166e159be9faf364f9647c705)) +- export `getSchema` as a standalone function outside of class instance ([8558c71](https://github.com/ERC725Alliance/erc725.js/commit/8558c71b0cc077636db64506fc8407a8bc179c13)) +- include also `dynamicKeyPart` in the schema return by `getSchema` ([30dda33](https://github.com/ERC725Alliance/erc725.js/commit/30dda3398d35a019b97790524834f12489607f2b)) + +### Bug Fixes + +- encode `uintN` with correct padding and bytes length ([f8dc5ae](https://github.com/ERC725Alliance/erc725.js/commit/f8dc5ae9651ce953b2ff9808dfb3671126adace0)) +- Ignore formatting in package.json inside of biome ([33a80dd](https://github.com/ERC725Alliance/erc725.js/commit/33a80dd5368028cb55ab68ea940c176790595806)) +- valueContent from `bytes32` -> `Bytes32` for `LSP8ReferenceContract` ([dffc421](https://github.com/ERC725Alliance/erc725.js/commit/dffc421bea06c659d30f47ecead0be1385072248)) + ## [0.25.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.24.2...v0.25.0) (2024-04-18) ### Features diff --git a/package-lock.json b/package-lock.json index cc9f69d8..551ed80f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@erc725/erc725.js", - "version": "0.25.0", + "version": "0.26.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.25.0", + "version": "0.25.1", "license": "Apache-2.0", "dependencies": { "add": "^2.0.6", diff --git a/package.json b/package.json index e14dbe1b..d1d1938e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.25.0", + "version": "0.26.0", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", From fecc5f09dca210840aa82dec9f2e60446f1c64cc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 15 May 2024 14:40:53 +0000 Subject: [PATCH 07/17] chore(main): release 0.26.0 --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 551ed80f..4fb7e39e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.25.1", + "version": "0.26.0", "license": "Apache-2.0", "dependencies": { "add": "^2.0.6", From 7e5aeccb2a1e18ab83f57a444d6a684fe99587c9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 29 May 2024 14:05:17 +0000 Subject: [PATCH 08/17] chore(main): release 0.27.0 --- CHANGELOG.md | 16 ++++++++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75f1db39..8ae89819 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [0.27.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.26.0...v0.27.0) (2024-05-29) + + +### Features + +* allow to pass `number` directly in array when encoding tuples ([f6b4a9d](https://github.com/ERC725Alliance/erc725.js/commit/f6b4a9df803f1c63d53067ca3b67604219502cda)) +* export `mapPermission` function and don't make it throw an error ([08e72d6](https://github.com/ERC725Alliance/erc725.js/commit/08e72d61f37d8e3d8b70b5b0bf7cb355687f3546)) +* export function to get verification method ([f426a31](https://github.com/ERC725Alliance/erc725.js/commit/f426a31239f708775e5ab2829ccd0e206da43988)) +* export method `isDataAuthentic` as static, single method or member of class ([0c7ba98](https://github.com/ERC725Alliance/erc725.js/commit/0c7ba987540e0684e803ca8d722aa4b0b5d04fde)) +* return `dynamicKeyName` and `dynamicKeyPart` for `getSchema` with Array ([8b86092](https://github.com/ERC725Alliance/erc725.js/commit/8b860926f6a8e5a733c3d01321bf888a19b79f12)) + + +### Bug Fixes + +* allow to decode `0x` as `0` for keyType `Array` ([fde9f5d](https://github.com/ERC725Alliance/erc725.js/commit/fde9f5da07dfe87f1459266515b58bca58eacbcd)) + ## [0.26.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.25.0...v0.26.0) (2024-05-14) ### Features diff --git a/package-lock.json b/package-lock.json index 4fb7e39e..9c2b9549 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@erc725/erc725.js", - "version": "0.26.0", + "version": "0.27.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.26.0", + "version": "0.27.0", "license": "Apache-2.0", "dependencies": { "add": "^2.0.6", diff --git a/package.json b/package.json index d1d1938e..47122453 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.26.0", + "version": "0.27.0", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", From 95d567524397cec120afd9cfbc2839fb7f35d12f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2024 07:49:26 +0000 Subject: [PATCH 09/17] chore(main): release 0.27.1 --- CHANGELOG.md | 11 +++++++++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ae89819..5239074b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,17 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [0.27.1](https://github.com/ERC725Alliance/erc725.js/compare/v0.27.0...v0.27.1) (2024-07-12) + + +### Bug Fixes + +* Normalize tests and add name as a constant in the schema. Add nonDynamicName to capture resolved schema names. ([95dabb2](https://github.com/ERC725Alliance/erc725.js/commit/95dabb22c3958b94014eed2b460a5e2dcce4684d)) +* Repair and use dynamicName and dynamicKeyParts. ([2874516](https://github.com/ERC725Alliance/erc725.js/commit/2874516343fee7259367f84f19f071081be5f61f)) +* Repair limitation ([b0ffa5b](https://github.com/ERC725Alliance/erc725.js/commit/b0ffa5b1051015268c552b53b4334e0795295e1d)) +* Repair tests and 0x prefix for dynamic fields in some places. ([cef4e15](https://github.com/ERC725Alliance/erc725.js/commit/cef4e15587cb9dbc993606098851698fc77cd6b8)) +* Some cleanup, remove global-agent, some new minor upgrades ([239c98c](https://github.com/ERC725Alliance/erc725.js/commit/239c98c35233ad1188b74e971d9b5f993273b092)) + ## [0.27.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.26.0...v0.27.0) (2024-05-29) diff --git a/package-lock.json b/package-lock.json index 38749e13..9f29fb66 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@erc725/erc725.js", - "version": "0.27.0", + "version": "0.27.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.27.0", + "version": "0.27.1", "license": "Apache-2.0", "dependencies": { "cross-fetch": "^4.0.0", diff --git a/package.json b/package.json index 1601d3d0..eb63fc05 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.27.0", + "version": "0.27.1", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", From 74e730e6322bd79b169cb6dcaac116360d834cee Mon Sep 17 00:00:00 2001 From: CJ42 Date: Fri, 12 Jul 2024 09:10:38 +0100 Subject: [PATCH 10/17] docs: update schema docs page to latest content --- docs/methods.md | 2 +- docs/schemas.md | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/methods.md b/docs/methods.md index 953f3062..35b1bed8 100644 --- a/docs/methods.md +++ b/docs/methods.md @@ -3,7 +3,7 @@ sidebar_position: 1 title: 'Methods' --- -import CodeSandbox from "../../../src/components/CodeSandbox"; +import CodeSandbox from "@site/src/components/CodeSandbox"; diff --git a/docs/schemas.md b/docs/schemas.md index 2f7f0b21..143f2f98 100644 --- a/docs/schemas.md +++ b/docs/schemas.md @@ -4,13 +4,17 @@ sidebar_position: 2 # Schemas -The `@erc725/erc725.js` library contains a range of standard [LSP ERC725 JSON schemas](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-2-ERC725YJSONSchema.md). +:::info 📄 Schema Specification -Schemas allow erc725.js to know how to decode and encode data written in an [ERC725Y](https://eips.ethereum.org/EIPS/eip-725) smart contract. +For more details on schemas, see the [**official specification** of the LSP2 ERC725 JSON schemas](https://github.com/lukso-network/LIPs/blob/main/LSPs/LSP-2-ERC725YJSONSchema.md) standard specification -_A quick reference for keys used in schema definitions can be seen below_ +::: + +The ⚒️ [erc725.js](https://npmjs.com/package/@erc725/erc725.js) library works with [ERC725Y JSON schemas](../../standards/generic-standards/lsp2-json-schema). These schemas are JSON structures that tell developers and programs how to decode and encode 🗂️ [ERC725Y data keys](../../standards/lsp-background/erc725#erc725y-generic-data-keyvalue-store) from any [ERC725Y](https://eips.ethereum.org/EIPS/eip-725) smart contract.. You need to load the required schemas of the data keys you want to fetch when initializing the `ERC725` class. -[Official Documentation](https://github.com/lukso-network/LIPs/blob/master/LSPs/LSP-2-ERC725YJSONSchema.md). +The most common and standard schemas are [available](../../tools/erc725js/schemas.md) directly within the _erc725.js_ library. But you can also create and load your own ERC725Y JSON schemas if you want to use custom data keys. + +_A quick reference for keys used in schema definitions can be seen below_ - `name`: An arbitrary name - `key`: The sha3 hash of the name From 65960aa35850f36c389df18dedcfda227a569165 Mon Sep 17 00:00:00 2001 From: CJ42 Date: Wed, 17 Jul 2024 10:53:27 +0100 Subject: [PATCH 11/17] docs: move sentence from docs learn page into _erc725.js_ docs --- docs/getting-started.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/getting-started.md b/docs/getting-started.md index d2527739..28e52c46 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -134,6 +134,10 @@ const verifiableURI = encodeDataSourceWithHash( Try running the code snippets below within your browser using [StackBlitz](https://stackblitz.com/edit/erc725js-instantiation?devtoolsheight=66&file=index.js). ::: +The _erc725.js_ contains multiple functionalities such as reading and decoding data. A full list is available under the [**Methods**](./methods.md) page. + +For fetching data, it is possible to query one data key (as a `string` name) or multiple data keys at once by passing an array parameter, as shown below. + ```js await erc725.getOwner(); // > '0x28D25E70819140daF65b724158D00c373D1a18ee' From 194b357a397b3e2b9fa451de2e201ead4ca320a7 Mon Sep 17 00:00:00 2001 From: CJ42 Date: Wed, 17 Jul 2024 12:21:40 +0100 Subject: [PATCH 12/17] test: refactor test to use correct tuple of CompactBytesArray for AllowedCalls --- src/lib/utils.test.ts | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/lib/utils.test.ts b/src/lib/utils.test.ts index 2fabaed1..380921ba 100644 --- a/src/lib/utils.test.ts +++ b/src/lib/utils.test.ts @@ -198,28 +198,31 @@ describe('utils', () => { name: 'AddressPermissions:AllowedCalls:
', key: '0x4b80742de2bf393a64c70000
', keyType: 'MappingWithGrouping', - valueType: '(bytes4,address,bytes4)[CompactBytesArray]', - valueContent: '(Bytes4,Address,Bytes4)', + valueType: '(bytes4,address,bytes4,bytes4)[CompactBytesArray]', + valueContent: '(BitArray,Address,Bytes4,Bytes4)', }, decodedValue: [ [ - '0xcafecafe', - '0xDAFEA492D9c6733ae3d56b7Ed1ADB60692c98Bc5', - '0xcafecafe', + '0x00000003', // CALL and TRANSFERVALUE + '0xCA41e4ea94c8fA99889c8EA2c8948768cBaf4bc0', // addresses are decoded as checksummed + '0x3e89ad98', // LSP0 interface ID + '0xffffffff', // any function ], [ - '0xbeefbeef', - '0xFE31320faF8Da1492Eadf8Deb79bd264D7cF2141', - '0xbeefbeef', + '0x00000002', // CALL only + '0xF70Ce3b58f275A4c28d06C98615760dDe774DE57', + '0xffffffff', // any standard interface ID + '0x760d9bba', // function selector of `transfer(address,address,uint256,bool,bytes)` ], [ - '0xf00df00d', - '0xc527702b14BF2f79F70B32e09F62B6A74cADFd80', - '0xf00df00d', + '0x00000001', // TRANSFERVALUE only + '0xd3236aa1B8A4dDe5eA375fd1F2Fb5c354e686c9f', + '0xffffffff', // any standard interface ID + '0xffffffff', // any function ], ], encodedValue: - '0x001ccafecafeDAFEA492D9c6733ae3d56b7Ed1ADB60692c98Bc5cafecafe001cbeefbeefFE31320faF8Da1492Eadf8Deb79bd264D7cF2141beefbeef001cf00df00dc527702b14BF2f79F70B32e09F62B6A74cADFd80f00df00d'.toLowerCase(), + '0x002000000003ca41e4ea94c8fa99889c8ea2c8948768cbaf4bc03e89ad98ffffffff002000000002f70ce3b58f275a4c28d06c98615760dde774de57ffffffff760d9bba002000000001d3236aa1b8a4dde5ea375fd1f2fb5c354e686c9fffffffffffffffff', }, ]; From 0c1032a5f4077becae7ae97294aa6bd0526dc14e Mon Sep 17 00:00:00 2001 From: CJ42 Date: Wed, 17 Jul 2024 12:57:27 +0100 Subject: [PATCH 13/17] docs: document how to encode / decode tuple of CompactBytesArray with as example --- docs/methods.md | 113 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) diff --git a/docs/methods.md b/docs/methods.md index 35b1bed8..7db0ba5e 100644 --- a/docs/methods.md +++ b/docs/methods.md @@ -508,6 +508,64 @@ ERC725.encodeData( +
+ Encode a tuple of CompactBytesArray + +```ts title="Encode a tuple of CompactBytesArray" +import ERC725 from '@erc725/erc725.js'; + +const schemas = [ +{ + name: 'AddressPermissions:AllowedCalls:
', + key: '0x4b80742de2bf393a64c70000
', + keyType: 'MappingWithGrouping', + valueType: '(bytes4,address,bytes4,bytes4)[CompactBytesArray]', + valueContent: '(BitArray,Address,Bytes4,Bytes4)', + } +]; + +ERC725.encodeData( + [ + { + keyName: 'AddressPermissions:AllowedCalls:
', + dynamicKeyParts: "0xcafecafecafecafecafecafecafecafecafecafe" + value: [ + '0x00000003', // CALL and TRANSFERVALUE + '0xCA41e4ea94c8fA99889c8EA2c8948768cBaf4bc0', // addresses are decoded as checksummed + '0x3e89ad98', // LSP0 interface ID + '0xffffffff', // any function + ], + [ + '0x00000002', // CALL only + '0xF70Ce3b58f275A4c28d06C98615760dDe774DE57', + '0xffffffff', // any standard interface ID + '0x760d9bba', // function selector of `transfer(address,address,uint256,bool,bytes)` + ], + [ + '0x00000001', // TRANSFERVALUE only + '0xd3236aa1B8A4dDe5eA375fd1F2Fb5c354e686c9f', + '0xffffffff', // any standard interface ID + '0xffffffff', // any function + ], + }, + ], + schemas, +); +/** +{ + keys: [ + '0x4b80742de2bf393a64c70000cafecafecafecafecafecafecafecafecafecafe', // -> data key for `AddressPermissions:AllowedCalls:0xcafecafecafecafecafecafecafecafecafecafe` + ], + values: [ + '0x002000000003ca41e4ea94c8fa99889c8ea2c8948768cbaf4bc03e89ad98ffffffff002000000002f70ce3b58f275a4c28d06c98615760dde774de57ffffffff760d9bba002000000001d3236aa1b8a4dde5ea375fd1f2fb5c354e686c9fffffffffffffffff', // (bytes4,address,bytes4,bytes4)[CompactBytesArray] + ], +} +*/ + +``` + +
+ --- ### encodeKeyName @@ -965,6 +1023,61 @@ ERC725.decodeData( */ ``` +#### Tuple of CompactBytesArray Example + +```ts title="Decode a tuple of CompactBytesArray" +import ERC725 from '@erc725/erc725.js'; + +const schemas = [ + { + name: 'AddressPermissions:AllowedCalls:
', + key: '0x4b80742de2bf393a64c70000
', + keyType: 'MappingWithGrouping', + valueType: '(bytes4,address,bytes4,bytes4)[CompactBytesArray]', + valueContent: '(BitArray,Address,Bytes4,Bytes4)', + } +]; + +ERC725.decodeData( + [ + { + keyName: 'AddressPermissions:AllowedCalls:
', + dynamicKeyParts: "0xcafecafecafecafecafecafecafecafecafecafe" + value: '0x002000000003ca41e4ea94c8fa99889c8ea2c8948768cbaf4bc03e89ad98ffffffff002000000002f70ce3b58f275a4c28d06c98615760dde774de57ffffffff760d9bba002000000001d3236aa1b8a4dde5ea375fd1f2fb5c354e686c9fffffffffffffffff' + }, + ], + schemas, +); + +/** +{ + key: '0x4b80742de2bf393a64c70000cafecafecafecafecafecafecafecafecafecafe', + name: 'AddressPermissions:AllowedCalls:cafecafecafecafecafecafecafecafecafecafe', + value: [ + [ + '0x00000003', // CALL and TRANSFERVALUE + '0xCA41e4ea94c8fA99889c8EA2c8948768cBaf4bc0', // addresses are decoded as checksummed + '0x3e89ad98', // LSP0 interface ID + '0xffffffff', // any function + ], + [ + '0x00000002', // CALL only + '0xF70Ce3b58f275A4c28d06C98615760dDe774DE57', + '0xffffffff', // any standard interface ID + '0x760d9bba', // function selector of `transfer(address,address,uint256,bool,bytes)` + ], + [ + '0x00000001', // TRANSFERVALUE only + '0xd3236aa1B8A4dDe5eA375fd1F2Fb5c354e686c9f', + '0xffffffff', // any standard interface ID + '0xffffffff', // any function + ] + ] +} +*/ + +``` + ### decodeValueType ```js From 06cc24c3394d12998ef8e8860f9dcf8d711117c7 Mon Sep 17 00:00:00 2001 From: Andreas Richter <708186+richtera@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:50:10 -0400 Subject: [PATCH 14/17] fix: Make explicitely sure that method === 0x0000000 is also ignored in isDataAuthentic --- src/lib/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 14fa11fc..66b8eddf 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -550,7 +550,7 @@ export function isDataAuthentic( options: Verification, capture?: string[], ): boolean { - if (!options || !options.method) { + if (!options?.method || options?.method === '0x00000000') { return true; } From 96a3ef0add488ecea3bc65dadc1f9f9ae713a604 Mon Sep 17 00:00:00 2001 From: Andreas Richter <708186+richtera@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:54:27 -0400 Subject: [PATCH 15/17] fix: Compile temporary patch --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index eb63fc05..3c6d4bb4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.27.1", + "version": "0.27.2", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", From 1f0e740805085ddfb6d952879d99483c3d34204d Mon Sep 17 00:00:00 2001 From: Andreas Richter <708186+richtera@users.noreply.github.com> Date: Thu, 12 Sep 2024 13:58:26 -0400 Subject: [PATCH 16/17] fix: Patch version --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9f29fb66..d7fc836a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@erc725/erc725.js", - "version": "0.27.1", + "version": "0.27.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.27.1", + "version": "0.27.2", "license": "Apache-2.0", "dependencies": { "cross-fetch": "^4.0.0", From 3fe394d88ce5fd36b5e3c891d75e8c861b7e12a4 Mon Sep 17 00:00:00 2001 From: Andreas Richter <708186+richtera@users.noreply.github.com> Date: Tue, 17 Sep 2024 10:09:46 -0400 Subject: [PATCH 17/17] fix: Repair patchIPFSUrlsIfApplicable to only map urls starting with ipfs:// --- package.json | 2 +- src/lib/utils.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3c6d4bb4..223c980c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.27.2", + "version": "0.27.3", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts", diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 66b8eddf..d156d564 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -613,7 +613,9 @@ export function patchIPFSUrlsIfApplicable( receivedData: URLDataWithHash, ipfsGateway: string, ): URLDataWithHash { - if (receivedData?.url?.indexOf('ipfs://') !== -1) { + // Only map URL if it's indeed an ipfs:// URL and ignore if it's a data:// URL with JSON + // possibly containing an IPFS URL inside of the JSON data. + if (receivedData?.url?.startsWith('ipfs://')) { return { ...receivedData, url: receivedData.url.replace('ipfs://', ipfsGateway),