From c532cc429488fbb7207ff9b2631f88e47a3e4684 Mon Sep 17 00:00:00 2001 From: Callum Date: Mon, 27 Jun 2022 14:49:34 +0200 Subject: [PATCH 1/6] docs: switch rpc url in docs to l16 --- README.md | 2 +- docs/getting-started.md | 2 +- docs/providers.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f817bc69..a3f444a8 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ const schema = [ const address = '0x3000783905Cc7170cCCe49a4112Deda952DDBe24'; const provider = new Web3.providers.HttpProvider( - 'https://rpc.l14.lukso.network', + 'https://rpc.l16.lukso.network', ); const config = { ipfsGateway: 'https://ipfs.lukso.network/ipfs/', diff --git a/docs/getting-started.md b/docs/getting-started.md index 78590997..7f82715b 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -53,7 +53,7 @@ const schemas = [ const address = '0x0c03fba782b07bcf810deb3b7f0595024a444f4e'; const provider = new Web3.providers.HttpProvider( - 'https://rpc.l14.lukso.network', + 'https://rpc.l16.lukso.network', ); const config = { ipfsGateway: 'https://ipfs.lukso.network/ipfs/', diff --git a/docs/providers.md b/docs/providers.md index a605547b..16425a4e 100644 --- a/docs/providers.md +++ b/docs/providers.md @@ -16,7 +16,7 @@ The following code snippet will use the web3 provider available at web3.provider import Web3 from 'web3'; const web3provider = new Web3( - new Web3.providers.HttpProvider('https://rpc.l14.lukso.network'), + new Web3.providers.HttpProvider('https://rpc.l16.lukso.network'), ); ``` From 6ddbf473039b17af562d56f1f12be5194a060477 Mon Sep 17 00:00:00 2001 From: Hugo Masclet Date: Tue, 28 Jun 2022 17:32:42 +0200 Subject: [PATCH 2/6] fix: LSP4Creators[] valueType --- schemas/LSP4DigitalAsset.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/schemas/LSP4DigitalAsset.json b/schemas/LSP4DigitalAsset.json index f52555c2..862162b7 100644 --- a/schemas/LSP4DigitalAsset.json +++ b/schemas/LSP4DigitalAsset.json @@ -31,8 +31,8 @@ "name": "LSP4Creators[]", "key": "0x114bd03b3a46d48759680d81ebb2b414fda7d030a7105a851867accf1c2352e7", "keyType": "Array", - "valueType": "uint256", - "valueContent": "Number" + "valueType": "address", + "valueContent": "Address" }, { "name": "LSP4CreatorsMap:
", From 3498502da0b531559e557fc4a9e6c2851b480807 Mon Sep 17 00:00:00 2001 From: CJ42 <31145285+CJ42@users.noreply.github.com> Date: Tue, 5 Jul 2022 08:19:34 +0100 Subject: [PATCH 3/6] feat: add `BitArray` in valueContent encoding map --- src/lib/encoder.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/lib/encoder.ts b/src/lib/encoder.ts index 6084c396..1dc7fbe1 100644 --- a/src/lib/encoder.ts +++ b/src/lib/encoder.ts @@ -305,6 +305,26 @@ export const valueContentEncodingMap = (valueContent: string) => { }, }; } + case 'BitArray': { + return { + type: 'bytes', + encode: (value: string) => { + if (typeof value !== 'string' || !isHex(value)) { + throw new Error(`Value: ${value} is not hex.`); + } + + return value; + }, + decode: (value: string) => { + if (typeof value !== 'string' || !isHex(value)) { + console.log(`Value: ${value} is not hex.`); + return null; + } + + return value; + }, + }; + } default: { return { type: 'unknown', From 8ae5c9401d4dca10f1d6946a826b0db108eecba6 Mon Sep 17 00:00:00 2001 From: CJ42 <31145285+CJ42@users.noreply.github.com> Date: Tue, 5 Jul 2022 13:44:57 +0100 Subject: [PATCH 4/6] test: add tests for encoding BitArray --- src/lib/encoder.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/encoder.test.ts b/src/lib/encoder.test.ts index 89fb7f20..17d58b1f 100644 --- a/src/lib/encoder.test.ts +++ b/src/lib/encoder.test.ts @@ -195,6 +195,13 @@ describe('encoder', () => { encodedValue: '0x6f357c6a027547537d35728a741470df1ccf65de10b454ca0def7c5c20b257b7b8d16168687474703a2f2f746573742e636f6d2f61737365742e676c62', }, + { + valueContent: 'BitArray', + encodedValue: + '0x0000000000000000000000000000000000000000000000000000000000000008', + decodedValue: + '0x0000000000000000000000000000000000000000000000000000000000000008', + }, ]; testCases.forEach((testCase) => { From dce6616d9f0f390d23bc184364dc4ff443ce0764 Mon Sep 17 00:00:00 2001 From: CJ42 <31145285+CJ42@users.noreply.github.com> Date: Tue, 5 Jul 2022 15:15:13 +0100 Subject: [PATCH 5/6] chore: fix comments + remove console errors --- src/lib/encoder.test.ts | 2 +- src/lib/encoder.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/encoder.test.ts b/src/lib/encoder.test.ts index 17d58b1f..689836f9 100644 --- a/src/lib/encoder.test.ts +++ b/src/lib/encoder.test.ts @@ -198,7 +198,7 @@ describe('encoder', () => { { valueContent: 'BitArray', encodedValue: - '0x0000000000000000000000000000000000000000000000000000000000000008', + '0x0000000000000000000000000000000000000000000000000000000000000008', // ... 0000 0000 1000 decodedValue: '0x0000000000000000000000000000000000000000000000000000000000000008', }, diff --git a/src/lib/encoder.ts b/src/lib/encoder.ts index 1dc7fbe1..78b1589d 100644 --- a/src/lib/encoder.ts +++ b/src/lib/encoder.ts @@ -317,7 +317,7 @@ export const valueContentEncodingMap = (valueContent: string) => { }, decode: (value: string) => { if (typeof value !== 'string' || !isHex(value)) { - console.log(`Value: ${value} is not hex.`); + console.error(`Value: ${value} is not hex.`); return null; } From 874f16894f235f9cb87ce23b35d9e228fccc63f3 Mon Sep 17 00:00:00 2001 From: Hugo Masclet Date: Thu, 7 Jul 2022 17:35:57 +0200 Subject: [PATCH 6/6] chore(release): 0.14.3 --- CHANGELOG.md | 49 +++++++++++++++++++++++++++-------------------- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9aa49c12..b036b260 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,21 @@ 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.14.2](https://github.com/ERC725Alliance/erc725.js/compare/v0.14.1...v0.14.2) (2022-06-24) +### [0.14.3](https://github.com/ERC725Alliance/erc725.js/compare/v0.14.2...v0.14.3) (2022-07-07) + +### Features + +- add `BitArray` in valueContent encoding map ([3498502](https://github.com/ERC725Alliance/erc725.js/commit/3498502da0b531559e557fc4a9e6c2851b480807)) ### Bug Fixes -* Update JsonRpc eth_call parameters ([470e846](https://github.com/ERC725Alliance/erc725.js/commit/470e8461e581f0763fe3fddc8f604cc55002f7a1)) +- LSP4Creators[] valueType ([6ddbf47](https://github.com/ERC725Alliance/erc725.js/commit/6ddbf473039b17af562d56f1f12be5194a060477)) +### [0.14.2](https://github.com/ERC725Alliance/erc725.js/compare/v0.14.1...v0.14.2) (2022-06-24) + +### Bug Fixes + +- Update JsonRpc eth_call parameters ([470e846](https://github.com/ERC725Alliance/erc725.js/commit/470e8461e581f0763fe3fddc8f604cc55002f7a1)) ### [0.14.1](https://github.com/ERC725Alliance/erc725.js/compare/v0.14.0...v0.14.1) (2022-06-15) @@ -17,34 +26,32 @@ Minor update to update the LSP-2 schemas. ### ⚠ BREAKING CHANGES -* fetchData as same output as decodeData -* getData as same output as decodeData -* add dynamic keys for getData -* use array for decodeData -* use array for encodeData - +- fetchData as same output as decodeData +- getData as same output as decodeData +- add dynamic keys for getData +- use array for decodeData +- use array for encodeData ### Features -* add dynamic keys for getData ([7a46786](https://github.com/ERC725Alliance/erc725.js/commit/7a46786105d35ca0b33ce5158be98866f3fbfd71)) -* add dynamicKeys for decodeData ([f386e15](https://github.com/ERC725Alliance/erc725.js/commit/f386e15396cbf6c2b842302f1c85b41a0798b684)) -* add non array input on decodeData ([0774a86](https://github.com/ERC725Alliance/erc725.js/commit/0774a86d652e205814863d07319adef2266f634c)) -* add support for hashed key for encodeData ([23323a0](https://github.com/ERC725Alliance/erc725.js/commit/23323a02a6bfb81be1eba24207fe353942367837)) -* add BytesN value content ([#184](https://github.com/ERC725Alliance/erc725.js/issues/184)) ([7e073e4](https://github.com/ERC725Alliance/erc725.js/commit/7e073e4dfc7094aac55935fffc18ef14d16a24c8)) -* add tuples support ([7f3d1a0](https://github.com/ERC725Alliance/erc725.js/commit/7f3d1a09c3e6058b76a5b3ceca8bc1f454e634ce)) +- add dynamic keys for getData ([7a46786](https://github.com/ERC725Alliance/erc725.js/commit/7a46786105d35ca0b33ce5158be98866f3fbfd71)) +- add dynamicKeys for decodeData ([f386e15](https://github.com/ERC725Alliance/erc725.js/commit/f386e15396cbf6c2b842302f1c85b41a0798b684)) +- add non array input on decodeData ([0774a86](https://github.com/ERC725Alliance/erc725.js/commit/0774a86d652e205814863d07319adef2266f634c)) +- add support for hashed key for encodeData ([23323a0](https://github.com/ERC725Alliance/erc725.js/commit/23323a02a6bfb81be1eba24207fe353942367837)) +- add BytesN value content ([#184](https://github.com/ERC725Alliance/erc725.js/issues/184)) ([7e073e4](https://github.com/ERC725Alliance/erc725.js/commit/7e073e4dfc7094aac55935fffc18ef14d16a24c8)) +- add tuples support ([7f3d1a0](https://github.com/ERC725Alliance/erc725.js/commit/7f3d1a09c3e6058b76a5b3ceca8bc1f454e634ce)) ### Bug Fixes -* encodeKeyName returns lowercase keys ([80566eb](https://github.com/ERC725Alliance/erc725.js/commit/80566eb2358db0ff90e42028ee5b1b5bca206b46)) - +- encodeKeyName returns lowercase keys ([80566eb](https://github.com/ERC725Alliance/erc725.js/commit/80566eb2358db0ff90e42028ee5b1b5bca206b46)) ### improvement -* change fetchData output to non object ([1d4d570](https://github.com/ERC725Alliance/erc725.js/commit/1d4d57077a7766b3490477efb20f194fc4e00da4)) -* fetchData as same output as decodeData ([59c3a87](https://github.com/ERC725Alliance/erc725.js/commit/59c3a879fefb2b9bfe46b9bea91ff6bd2a528df1)) -* getData as same output as decodeData ([0f3b149](https://github.com/ERC725Alliance/erc725.js/commit/0f3b149f2280e6025a05e8e9ed306facfa63601a)) -* use array for decodeData ([261d100](https://github.com/ERC725Alliance/erc725.js/commit/261d1007f4ff63abd9d794f4e64e5b408ce7c1a3)) -* use array for encodeData ([a2e6cdd](https://github.com/ERC725Alliance/erc725.js/commit/a2e6cdd5cca778f9015c71a624cc3953e2e0fd29)) +- change fetchData output to non object ([1d4d570](https://github.com/ERC725Alliance/erc725.js/commit/1d4d57077a7766b3490477efb20f194fc4e00da4)) +- fetchData as same output as decodeData ([59c3a87](https://github.com/ERC725Alliance/erc725.js/commit/59c3a879fefb2b9bfe46b9bea91ff6bd2a528df1)) +- getData as same output as decodeData ([0f3b149](https://github.com/ERC725Alliance/erc725.js/commit/0f3b149f2280e6025a05e8e9ed306facfa63601a)) +- use array for decodeData ([261d100](https://github.com/ERC725Alliance/erc725.js/commit/261d1007f4ff63abd9d794f4e64e5b408ce7c1a3)) +- use array for encodeData ([a2e6cdd](https://github.com/ERC725Alliance/erc725.js/commit/a2e6cdd5cca778f9015c71a624cc3953e2e0fd29)) ## [0.13.0](https://github.com/ERC725Alliance/erc725.js/compare/v0.12.0...v0.13.0) (2022-06-02) diff --git a/package-lock.json b/package-lock.json index 8804957c..2e9af4c2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@erc725/erc725.js", - "version": "0.14.2", + "version": "0.14.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@erc725/erc725.js", - "version": "0.14.2", + "version": "0.14.3", "license": "Apache-2.0", "dependencies": { "ethereumjs-util": "^7.1.4", diff --git a/package.json b/package.json index b27e313b..b260af0c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@erc725/erc725.js", - "version": "0.14.2", + "version": "0.14.3", "description": "Library to interact with ERC725 smart contracts", "main": "build/main/src/index.js", "typings": "build/main/src/index.d.ts",