From 764c9a7650afc880cdc4d639fe43b6662f85607d Mon Sep 17 00:00:00 2001 From: GuilaneDen <83951892+GuilaneDen@users.noreply.github.com> Date: Thu, 12 Dec 2024 10:48:01 +0100 Subject: [PATCH] feat: updated InitContract and UpdateContract + clean up --- CHANGELOG.md | 531 +++---------------------------------------- README.md | 30 +-- package-lock.json | 4 +- package.json | 2 +- src/Concordium.ts | 62 +++-- src/serialization.ts | 49 +++- test.js | 64 ------ 7 files changed, 134 insertions(+), 608 deletions(-) delete mode 100644 test.js diff --git a/CHANGELOG.md b/CHANGELOG.md index d3afdbe..37f2a88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,505 +1,26 @@ -# @ledgerhq/hw-app-algorand - -## 6.29.4 - -### Patch Changes - -- Updated dependencies [[`0a71c43`](https://github.com/LedgerHQ/ledger-live/commit/0a71c4344b7bb2c6640f3e5dda152ae815573330)]: - - @ledgerhq/errors@6.19.1 - - @ledgerhq/hw-transport@6.31.4 - -## 6.29.4-next.0 - -### Patch Changes - -- Updated dependencies [[`0a71c43`](https://github.com/LedgerHQ/ledger-live/commit/0a71c4344b7bb2c6640f3e5dda152ae815573330)]: - - @ledgerhq/errors@6.19.1-next.0 - - @ledgerhq/hw-transport@6.31.4-next.0 - -## 6.29.3 - -### Patch Changes - -- Updated dependencies [[`5c738cb`](https://github.com/LedgerHQ/ledger-live/commit/5c738cbd35ce5d0ca39ad3b86a61cc6234d1bdf7), [`fb9466a`](https://github.com/LedgerHQ/ledger-live/commit/fb9466a4d7827fd4759c726ad3ae0b43dddcacd3), [`a3fd728`](https://github.com/LedgerHQ/ledger-live/commit/a3fd72861f2a7df676bd793062b3816fdb9d1f57)]: - - @ledgerhq/errors@6.19.0 - - @ledgerhq/hw-transport@6.31.3 - -## 6.29.3-next.0 - -### Patch Changes - -- Updated dependencies [[`5c738cb`](https://github.com/LedgerHQ/ledger-live/commit/5c738cbd35ce5d0ca39ad3b86a61cc6234d1bdf7), [`fb9466a`](https://github.com/LedgerHQ/ledger-live/commit/fb9466a4d7827fd4759c726ad3ae0b43dddcacd3), [`a3fd728`](https://github.com/LedgerHQ/ledger-live/commit/a3fd72861f2a7df676bd793062b3816fdb9d1f57)]: - - @ledgerhq/errors@6.19.0-next.0 - - @ledgerhq/hw-transport@6.31.3-next.0 - -## 6.29.2 - -### Patch Changes - -- Updated dependencies []: - - @ledgerhq/hw-transport@6.31.2 - -## 6.29.2-hotfix.0 - -### Patch Changes - -- Updated dependencies []: - - @ledgerhq/hw-transport@6.31.2-hotfix.0 - -## 6.29.1 - -### Patch Changes - -- Updated dependencies [[`e78f3b7`](https://github.com/LedgerHQ/ledger-live/commit/e78f3b75296c7a063f6cddbeae44c36d236055f3), [`f979216`](https://github.com/LedgerHQ/ledger-live/commit/f9792160293fc8215c6d099f02e1b136c6655f9b), [`c1d2bb0`](https://github.com/LedgerHQ/ledger-live/commit/c1d2bb0866723c10d6e2899d40ddd9b9801189f4)]: - - @ledgerhq/errors@6.18.0 - - @ledgerhq/hw-transport@6.31.1 - -## 6.29.1-next.0 - -### Patch Changes - -- Updated dependencies [[`e78f3b7`](https://github.com/LedgerHQ/ledger-live/commit/e78f3b75296c7a063f6cddbeae44c36d236055f3), [`f979216`](https://github.com/LedgerHQ/ledger-live/commit/f9792160293fc8215c6d099f02e1b136c6655f9b), [`c1d2bb0`](https://github.com/LedgerHQ/ledger-live/commit/c1d2bb0866723c10d6e2899d40ddd9b9801189f4)]: - - @ledgerhq/errors@6.18.0-next.0 - - @ledgerhq/hw-transport@6.31.1-next.0 - -## 6.29.0 - -### Minor Changes - -- [#6596](https://github.com/LedgerHQ/ledger-live/pull/6596) [`77fa530`](https://github.com/LedgerHQ/ledger-live/commit/77fa530c8626df94fa7f9c0a8b3a99f2efa7cb11) Thanks [@KVNLS](https://github.com/KVNLS)! - Upgrade React Native to version 0.73.6 - -### Patch Changes - -- Updated dependencies [[`77fa530`](https://github.com/LedgerHQ/ledger-live/commit/77fa530c8626df94fa7f9c0a8b3a99f2efa7cb11), [`815ae3d`](https://github.com/LedgerHQ/ledger-live/commit/815ae3dae8027823854ada837df3dc983d09b10f), [`cec1599`](https://github.com/LedgerHQ/ledger-live/commit/cec1599a41aa1a18a249e34312164bc93b63972f)]: - - @ledgerhq/hw-transport@6.31.0 - - @ledgerhq/errors@6.17.0 - -## 6.29.0-next.0 - -### Minor Changes - -- [#6596](https://github.com/LedgerHQ/ledger-live/pull/6596) [`77fa530`](https://github.com/LedgerHQ/ledger-live/commit/77fa530c8626df94fa7f9c0a8b3a99f2efa7cb11) Thanks [@KVNLS](https://github.com/KVNLS)! - Upgrade React Native to version 0.73.6 - -### Patch Changes - -- Updated dependencies [[`77fa530`](https://github.com/LedgerHQ/ledger-live/commit/77fa530c8626df94fa7f9c0a8b3a99f2efa7cb11), [`815ae3d`](https://github.com/LedgerHQ/ledger-live/commit/815ae3dae8027823854ada837df3dc983d09b10f), [`cec1599`](https://github.com/LedgerHQ/ledger-live/commit/cec1599a41aa1a18a249e34312164bc93b63972f)]: - - @ledgerhq/hw-transport@6.31.0-next.0 - - @ledgerhq/errors@6.17.0-next.0 - -## 6.28.6 - -### Patch Changes - -- Updated dependencies [[`fc4f83e`](https://github.com/LedgerHQ/ledger-live/commit/fc4f83e26d9f00b7c518f28157e8d9da55ce3685), [`dd1d17f`](https://github.com/LedgerHQ/ledger-live/commit/dd1d17fd3ce7ed42558204b2f93707fb9b1599de), [`26b3a5d`](https://github.com/LedgerHQ/ledger-live/commit/26b3a5d7d6e11efc226403707d683f3d0098a1c1)]: - - @ledgerhq/errors@6.16.4 - - @ledgerhq/hw-transport@6.30.6 - -## 6.28.6-next.0 - -### Patch Changes - -- Updated dependencies [[`fc4f83e`](https://github.com/LedgerHQ/ledger-live/commit/fc4f83e26d9f00b7c518f28157e8d9da55ce3685), [`dd1d17f`](https://github.com/LedgerHQ/ledger-live/commit/dd1d17fd3ce7ed42558204b2f93707fb9b1599de), [`26b3a5d`](https://github.com/LedgerHQ/ledger-live/commit/26b3a5d7d6e11efc226403707d683f3d0098a1c1)]: - - @ledgerhq/errors@6.16.4-next.0 - - @ledgerhq/hw-transport@6.30.6-next.0 - -## 6.28.5 - -### Patch Changes - -- Updated dependencies [[`f456d69`](https://github.com/LedgerHQ/ledger-live/commit/f456d69a2f64b6a217d3c1d9c6a531f31c2817a8)]: - - @ledgerhq/errors@6.16.3 - - @ledgerhq/hw-transport@6.30.5 - -## 6.28.5-next.0 - -### Patch Changes - -- Updated dependencies [[`f456d69`](https://github.com/LedgerHQ/ledger-live/commit/f456d69a2f64b6a217d3c1d9c6a531f31c2817a8)]: - - @ledgerhq/errors@6.16.3-next.0 - - @ledgerhq/hw-transport@6.30.5-next.0 - -## 6.28.4 - -### Patch Changes - -- Updated dependencies [[`ee88785`](https://github.com/LedgerHQ/ledger-live/commit/ee8878515671241ce1037362af5e8f7799b3673a)]: - - @ledgerhq/errors@6.16.2 - - @ledgerhq/hw-transport@6.30.4 - -## 6.28.4-next.0 - -### Patch Changes - -- Updated dependencies [[`f456d69`](https://github.com/LedgerHQ/ledger-live/commit/f456d69a2f64b6a217d3c1d9c6a531f31c2817a8)]: - - @ledgerhq/errors@6.16.2-next.0 - - @ledgerhq/hw-transport@6.30.4-next.0 - -## 6.28.3 - -### Patch Changes - -- Updated dependencies [[`eadebff`](https://github.com/LedgerHQ/ledger-live/commit/eadebff3fe58aef6a5befb033d5147afc49663d3)]: - - @ledgerhq/hw-transport@6.30.3 - -## 6.28.3-next.0 - -### Patch Changes - -- Updated dependencies [[`eadebff`](https://github.com/LedgerHQ/ledger-live/commit/eadebff3fe58aef6a5befb033d5147afc49663d3)]: - - @ledgerhq/hw-transport@6.30.3-next.0 - -## 6.28.2 - -### Patch Changes - -- Updated dependencies [[`16b4d7a`](https://github.com/LedgerHQ/ledger-live/commit/16b4d7ab4702022d4967f3c054d3c62a76716947)]: - - @ledgerhq/hw-transport@6.30.2 - -## 6.28.2-next.0 - -### Patch Changes - -- Updated dependencies [[`16b4d7a`](https://github.com/LedgerHQ/ledger-live/commit/16b4d7ab4702022d4967f3c054d3c62a76716947)]: - - @ledgerhq/hw-transport@6.30.2-next.0 - -## 6.28.1 - -### Patch Changes - -- Updated dependencies [[`52a3732`](https://github.com/LedgerHQ/ledger-live/commit/52a373273dee3b2cb5a3e8d2d4b05f90616d71a2), [`4d1aade`](https://github.com/LedgerHQ/ledger-live/commit/4d1aade53cd33f8e7548ce340f54fbb834bdcdcb)]: - - @ledgerhq/hw-transport@6.30.1 - - @ledgerhq/errors@6.16.1 - -## 6.28.1-next.0 - -### Patch Changes - -- Updated dependencies [[`52a3732`](https://github.com/LedgerHQ/ledger-live/commit/52a373273dee3b2cb5a3e8d2d4b05f90616d71a2), [`4d1aade`](https://github.com/LedgerHQ/ledger-live/commit/4d1aade53cd33f8e7548ce340f54fbb834bdcdcb)]: - - @ledgerhq/hw-transport@6.30.1-next.0 - - @ledgerhq/errors@6.16.1-next.0 - -## 6.28.0 - -### Minor Changes - -- [#5430](https://github.com/LedgerHQ/ledger-live/pull/5430) [`5964e30bed`](https://github.com/LedgerHQ/ledger-live/commit/5964e30bed11d64a3b7401c6ab51ffc1ad4c427c) Thanks [@hedi-edelbloute](https://github.com/hedi-edelbloute)! - Update documentation v14 ledgerjs - -### Patch Changes - -- Updated dependencies [[`771c9d3c1d`](https://github.com/LedgerHQ/ledger-live/commit/771c9d3c1d138ddd68da2e4f9738e2c41ecaf81b), [`c5981ae341`](https://github.com/LedgerHQ/ledger-live/commit/c5981ae3411abc4c8594adf2efcb52aacddac143), [`e63205b850`](https://github.com/LedgerHQ/ledger-live/commit/e63205b85071538ed2431157a12818d7a8f0ffa9), [`5964e30bed`](https://github.com/LedgerHQ/ledger-live/commit/5964e30bed11d64a3b7401c6ab51ffc1ad4c427c)]: - - @ledgerhq/errors@6.16.0 - - @ledgerhq/hw-transport@6.30.0 - -## 6.28.0-next.0 - -### Minor Changes - -- [#5430](https://github.com/LedgerHQ/ledger-live/pull/5430) [`5964e30bed`](https://github.com/LedgerHQ/ledger-live/commit/5964e30bed11d64a3b7401c6ab51ffc1ad4c427c) Thanks [@hedi-edelbloute](https://github.com/hedi-edelbloute)! - Update documentation v14 ledgerjs - -### Patch Changes - -- Updated dependencies [[`771c9d3c1d`](https://github.com/LedgerHQ/ledger-live/commit/771c9d3c1d138ddd68da2e4f9738e2c41ecaf81b), [`c5981ae341`](https://github.com/LedgerHQ/ledger-live/commit/c5981ae3411abc4c8594adf2efcb52aacddac143), [`e63205b850`](https://github.com/LedgerHQ/ledger-live/commit/e63205b85071538ed2431157a12818d7a8f0ffa9), [`5964e30bed`](https://github.com/LedgerHQ/ledger-live/commit/5964e30bed11d64a3b7401c6ab51ffc1ad4c427c)]: - - @ledgerhq/errors@6.16.0-next.0 - - @ledgerhq/hw-transport@6.30.0-next.0 - -## 6.27.20 - -### Patch Changes - -- Updated dependencies [[`7968dfc551`](https://github.com/LedgerHQ/ledger-live/commit/7968dfc551acca00b7fabf00a726758d74be33de), [`6b7fc5d071`](https://github.com/LedgerHQ/ledger-live/commit/6b7fc5d0711a83ed2fcacacd02795862a4a3bf1d), [`9e2d32aec4`](https://github.com/LedgerHQ/ledger-live/commit/9e2d32aec4ebd8774880f94e3ef0e805ebb172ac), [`4d6fa0772e`](https://github.com/LedgerHQ/ledger-live/commit/4d6fa0772e19cdbd4b432fafa43621c42e2a5fdd)]: - - @ledgerhq/hw-transport@6.29.0 - - @ledgerhq/errors@6.15.0 - -## 6.27.20-next.0 - -### Patch Changes - -- Updated dependencies [[`7968dfc551`](https://github.com/LedgerHQ/ledger-live/commit/7968dfc551acca00b7fabf00a726758d74be33de), [`6b7fc5d071`](https://github.com/LedgerHQ/ledger-live/commit/6b7fc5d0711a83ed2fcacacd02795862a4a3bf1d), [`9e2d32aec4`](https://github.com/LedgerHQ/ledger-live/commit/9e2d32aec4ebd8774880f94e3ef0e805ebb172ac), [`4d6fa0772e`](https://github.com/LedgerHQ/ledger-live/commit/4d6fa0772e19cdbd4b432fafa43621c42e2a5fdd)]: - - @ledgerhq/hw-transport@6.29.0-next.0 - - @ledgerhq/errors@6.15.0-next.0 - -## 6.27.19 - -### Patch Changes - -- Updated dependencies [[`a61a43fc47`](https://github.com/LedgerHQ/ledger-live/commit/a61a43fc47399e969fa68539de6af51bfa41e921), [`3455944496`](https://github.com/LedgerHQ/ledger-live/commit/34559444969ce1571ff4c54f33feb7f3fb59a33a)]: - - @ledgerhq/errors@6.14.0 - - @ledgerhq/hw-transport@6.28.8 - -## 6.27.19-next.0 - -### Patch Changes - -- Updated dependencies [[`a61a43fc47`](https://github.com/LedgerHQ/ledger-live/commit/a61a43fc47399e969fa68539de6af51bfa41e921), [`3455944496`](https://github.com/LedgerHQ/ledger-live/commit/34559444969ce1571ff4c54f33feb7f3fb59a33a)]: - - @ledgerhq/errors@6.14.0-next.0 - - @ledgerhq/hw-transport@6.28.8-next.0 - -## 6.27.18 - -### Patch Changes - -- Updated dependencies [[`c7c484acf0`](https://github.com/LedgerHQ/ledger-live/commit/c7c484acf01e9db8dc5a5507b62ffcb863c77ca4)]: - - @ledgerhq/errors@6.13.1 - - @ledgerhq/hw-transport@6.28.7 - -## 6.27.18-next.0 - -### Patch Changes - -- Updated dependencies [[`c7c484acf0`](https://github.com/LedgerHQ/ledger-live/commit/c7c484acf01e9db8dc5a5507b62ffcb863c77ca4)]: - - @ledgerhq/errors@6.13.1-next.0 - - @ledgerhq/hw-transport@6.28.7-next.0 - -## 6.27.17 - -### Patch Changes - -- Updated dependencies [[`0f4293e9bf`](https://github.com/LedgerHQ/ledger-live/commit/0f4293e9bf9cac4c2a195efeb0831aab3d51933d)]: - - @ledgerhq/errors@6.13.0 - - @ledgerhq/hw-transport@6.28.6 - -## 6.27.17-next.0 - -### Patch Changes - -- Updated dependencies [[`0f4293e9bf`](https://github.com/LedgerHQ/ledger-live/commit/0f4293e9bf9cac4c2a195efeb0831aab3d51933d)]: - - @ledgerhq/errors@6.13.0-next.0 - - @ledgerhq/hw-transport@6.28.6-next.0 - -## 6.27.16 - -### Patch Changes - -- Updated dependencies [[`9adc1862dd`](https://github.com/LedgerHQ/ledger-live/commit/9adc1862dda605a722d19f3b6895bd324834c914)]: - - @ledgerhq/errors@6.12.7 - - @ledgerhq/hw-transport@6.28.5 - -## 6.27.16-next.0 - -### Patch Changes - -- Updated dependencies [[`9adc1862dd`](https://github.com/LedgerHQ/ledger-live/commit/9adc1862dda605a722d19f3b6895bd324834c914)]: - - @ledgerhq/errors@6.12.7-next.0 - - @ledgerhq/hw-transport@6.28.5-next.0 - -## 6.27.15 - -### Patch Changes - -- Updated dependencies [[`77f990e207`](https://github.com/LedgerHQ/ledger-live/commit/77f990e2075c7c9a4be69b364e3754b449c7a546)]: - - @ledgerhq/errors@6.12.6 - - @ledgerhq/hw-transport@6.28.4 - -## 6.27.15-next.0 - -### Patch Changes - -- Updated dependencies [[`77f990e207`](https://github.com/LedgerHQ/ledger-live/commit/77f990e2075c7c9a4be69b364e3754b449c7a546)]: - - @ledgerhq/errors@6.12.6-next.0 - - @ledgerhq/hw-transport@6.28.4-next.0 - -## 6.27.14 - -### Patch Changes - -- Updated dependencies [[`87d2349fd8`](https://github.com/LedgerHQ/ledger-live/commit/87d2349fd835e5deb39d1ee8dfcf3539f4195472)]: - - @ledgerhq/errors@6.12.5 - - @ledgerhq/hw-transport@6.28.3 - -## 6.27.14-next.0 - -### Patch Changes - -- Updated dependencies [[`87d2349fd8`](https://github.com/LedgerHQ/ledger-live/commit/87d2349fd835e5deb39d1ee8dfcf3539f4195472)]: - - @ledgerhq/errors@6.12.5-next.0 - - @ledgerhq/hw-transport@6.28.3-next.0 - -## 6.27.13 - -### Patch Changes - -- Updated dependencies [[`1d0b2d19eb`](https://github.com/LedgerHQ/ledger-live/commit/1d0b2d19ebc5acd058930b842c6d37f8daf2a5a3), [`ef945b05c0`](https://github.com/LedgerHQ/ledger-live/commit/ef945b05c01a791281687abb28e639e1bcc4e472), [`5fa68510b4`](https://github.com/LedgerHQ/ledger-live/commit/5fa68510b49334cfd80c30793dfe68900f1b9b3b)]: - - @ledgerhq/errors@6.12.4 - - @ledgerhq/hw-transport@6.28.2 - -## 6.27.13-next.0 - -### Patch Changes - -- Updated dependencies [[`1d0b2d19eb`](https://github.com/LedgerHQ/ledger-live/commit/1d0b2d19ebc5acd058930b842c6d37f8daf2a5a3), [`ef945b05c0`](https://github.com/LedgerHQ/ledger-live/commit/ef945b05c01a791281687abb28e639e1bcc4e472), [`5fa68510b4`](https://github.com/LedgerHQ/ledger-live/commit/5fa68510b49334cfd80c30793dfe68900f1b9b3b)]: - - @ledgerhq/errors@6.12.4-next.0 - - @ledgerhq/hw-transport@6.28.2-next.0 - -## 6.27.12 - -### Patch Changes - -- Updated dependencies []: - - @ledgerhq/hw-transport@6.28.1 - -## 6.27.12-next.0 - -### Patch Changes - -- Updated dependencies []: - - @ledgerhq/hw-transport@6.28.1-next.0 - -## 6.27.11 - -### Patch Changes - -- Updated dependencies [[`c2779b1cab`](https://github.com/LedgerHQ/ledger-live/commit/c2779b1cab18a1d5747ca955f5ceee86db920f57)]: - - @ledgerhq/hw-transport@6.28.0 - -## 6.27.11-next.0 - -### Patch Changes - -- Updated dependencies [[`c2779b1cab`](https://github.com/LedgerHQ/ledger-live/commit/c2779b1cab18a1d5747ca955f5ceee86db920f57)]: - - @ledgerhq/hw-transport@6.28.0-next.0 - -## 6.27.10 - -### Patch Changes - -- Updated dependencies [[`3df451dafb`](https://github.com/LedgerHQ/ledger-live/commit/3df451dafb7233f5e3f897478aee22e89f6e5339), [`20c5c5e109`](https://github.com/LedgerHQ/ledger-live/commit/20c5c5e1099885173aaa5ea3199052044066ac98)]: - - @ledgerhq/errors@6.12.3 - - @ledgerhq/hw-transport@6.27.10 - -## 6.27.10-next.0 - -### Patch Changes - -- Updated dependencies [[`3df451dafb`](https://github.com/LedgerHQ/ledger-live/commit/3df451dafb7233f5e3f897478aee22e89f6e5339), [`20c5c5e109`](https://github.com/LedgerHQ/ledger-live/commit/20c5c5e1099885173aaa5ea3199052044066ac98)]: - - @ledgerhq/errors@6.12.3-next.0 - - @ledgerhq/hw-transport@6.27.10-next.0 - -## 6.27.9 - -### Patch Changes - -- Updated dependencies [[`f1c15446da`](https://github.com/LedgerHQ/ledger-live/commit/f1c15446dabef05bb91dada8d8f53f9bc6474ba5)]: - - @ledgerhq/errors@6.12.2 - - @ledgerhq/hw-transport@6.27.9 - -## 6.27.9-next.0 - -### Patch Changes - -- Updated dependencies [[`f1c15446da`](https://github.com/LedgerHQ/ledger-live/commit/f1c15446dabef05bb91dada8d8f53f9bc6474ba5)]: - - @ledgerhq/errors@6.12.2-next.0 - - @ledgerhq/hw-transport@6.27.9-next.0 - -## 6.27.8 - -### Patch Changes - -- Updated dependencies [[`856f49374e`](https://github.com/LedgerHQ/ledger-live/commit/856f49374ec9b49f005676e270acdb81b78879c8), [`77056e3692`](https://github.com/LedgerHQ/ledger-live/commit/77056e369256112188c183823a2c3fabfea2cba8)]: - - @ledgerhq/errors@6.12.1 - - @ledgerhq/hw-transport@6.27.8 - -## 6.27.8-next.0 - -### Patch Changes - -- Updated dependencies [[`856f49374e`](https://github.com/LedgerHQ/ledger-live/commit/856f49374ec9b49f005676e270acdb81b78879c8), [`77056e3692`](https://github.com/LedgerHQ/ledger-live/commit/77056e369256112188c183823a2c3fabfea2cba8)]: - - @ledgerhq/errors@6.12.1-next.0 - - @ledgerhq/hw-transport@6.27.8-next.0 - -## 6.27.7 - -### Patch Changes - -- Updated dependencies [[`0308e8c6ae`](https://github.com/LedgerHQ/ledger-live/commit/0308e8c6ae721a99bc50f5dc60db0d11ea8ea1ff), [`d3c91a53e0`](https://github.com/LedgerHQ/ledger-live/commit/d3c91a53e06f9f47817e96c452f69e2d9f71d80f), [`df8cbb8dd1`](https://github.com/LedgerHQ/ledger-live/commit/df8cbb8dd166a66325eb96d8192f3f985b71df60), [`4ad6155953`](https://github.com/LedgerHQ/ledger-live/commit/4ad615595392f5ef806cbd21f0be1b30d3ae73c6), [`24ea9cd15f`](https://github.com/LedgerHQ/ledger-live/commit/24ea9cd15f92d5a2c74c4b936bacb89d5d4d36fd)]: - - @ledgerhq/errors@6.12.0 - - @ledgerhq/hw-transport@6.27.7 - -## 6.27.7-next.0 - -### Patch Changes - -- Updated dependencies [[`0308e8c6ae`](https://github.com/LedgerHQ/ledger-live/commit/0308e8c6ae721a99bc50f5dc60db0d11ea8ea1ff), [`d3c91a53e0`](https://github.com/LedgerHQ/ledger-live/commit/d3c91a53e06f9f47817e96c452f69e2d9f71d80f), [`df8cbb8dd1`](https://github.com/LedgerHQ/ledger-live/commit/df8cbb8dd166a66325eb96d8192f3f985b71df60), [`4ad6155953`](https://github.com/LedgerHQ/ledger-live/commit/4ad615595392f5ef806cbd21f0be1b30d3ae73c6), [`24ea9cd15f`](https://github.com/LedgerHQ/ledger-live/commit/24ea9cd15f92d5a2c74c4b936bacb89d5d4d36fd)]: - - @ledgerhq/errors@6.12.0-next.0 - - @ledgerhq/hw-transport@6.27.7-next.0 - -## 6.27.6 - -### Patch Changes - -- [#1356](https://github.com/LedgerHQ/ledger-live/pull/1356) [`ecac411d7a`](https://github.com/LedgerHQ/ledger-live/commit/ecac411d7aad6f4003503ba6259d7c25017ca7aa) Thanks [@juan-cortes](https://github.com/juan-cortes)! - Updated readme.md of packages - -- Updated dependencies [[`ecac411d7a`](https://github.com/LedgerHQ/ledger-live/commit/ecac411d7aad6f4003503ba6259d7c25017ca7aa)]: - - @ledgerhq/errors@6.11.1 - - @ledgerhq/hw-transport@6.27.6 - -## 6.27.6-next.0 - -### Patch Changes - -- [#1356](https://github.com/LedgerHQ/ledger-live/pull/1356) [`ecac411d7a`](https://github.com/LedgerHQ/ledger-live/commit/ecac411d7aad6f4003503ba6259d7c25017ca7aa) Thanks [@juan-cortes](https://github.com/juan-cortes)! - Updated readme.md of packages - -- Updated dependencies [[`ecac411d7a`](https://github.com/LedgerHQ/ledger-live/commit/ecac411d7aad6f4003503ba6259d7c25017ca7aa)]: - - @ledgerhq/errors@6.11.1-next.0 - - @ledgerhq/hw-transport@6.27.6-next.0 - -## 6.27.5 - -### Patch Changes - -- Updated dependencies [[`1a94cbf28a`](https://github.com/LedgerHQ/ledger-live/commit/1a94cbf28aaa2917c70719e22f446148cd66cef6)]: - - @ledgerhq/errors@6.11.0 - - @ledgerhq/hw-transport@6.27.5 - -## 6.27.5-next.0 - -### Patch Changes - -- Updated dependencies [[`1a94cbf28a`](https://github.com/LedgerHQ/ledger-live/commit/1a94cbf28aaa2917c70719e22f446148cd66cef6)]: - - @ledgerhq/errors@6.11.0-next.0 - - @ledgerhq/hw-transport@6.27.5-next.0 - -## 6.27.4 - -### Patch Changes - -- Updated dependencies [[`ae5e33e15e`](https://github.com/LedgerHQ/ledger-live/commit/ae5e33e15e8a107d0ba8a3688a63eda2c0d43ce7)]: - - @ledgerhq/errors@6.10.2 - - @ledgerhq/hw-transport@6.27.4 - -## 6.27.4-next.0 - -### Patch Changes - -- Updated dependencies [[`ae5e33e15`](https://github.com/LedgerHQ/ledger-live/commit/ae5e33e15e8a107d0ba8a3688a63eda2c0d43ce7)]: - - @ledgerhq/errors@6.10.2-next.0 - - @ledgerhq/hw-transport@6.27.4-next.0 - -## 6.27.3 - -### Patch Changes - -- Updated dependencies [[`ecfdd1ebd8`](https://github.com/LedgerHQ/ledger-live/commit/ecfdd1ebd8cc7c4b5bc6315316ce662bb6241311)]: - - @ledgerhq/hw-transport@6.27.3 - -## 6.27.3-next.0 - -### Patch Changes - -- Updated dependencies [[`ecfdd1ebd`](https://github.com/LedgerHQ/ledger-live/commit/ecfdd1ebd8cc7c4b5bc6315316ce662bb6241311)]: - - @ledgerhq/hw-transport@6.27.3-next.0 - -## 6.27.2 - -### Patch Changes - -- Updated dependencies [[`203b927b4`](https://github.com/LedgerHQ/ledger-live/commit/203b927b4e5bca3402c85a88c536d519adb18c5f)]: - - @ledgerhq/errors@6.10.1 - - @ledgerhq/hw-transport@6.27.2 - -## 6.27.2-next.0 - -### Patch Changes - -- Updated dependencies [[`203b927b4`](https://github.com/LedgerHQ/ledger-live/commit/203b927b4e5bca3402c85a88c536d519adb18c5f)]: - - @ledgerhq/errors@6.10.1-next.0 - - @ledgerhq/hw-transport@6.27.2-next.0 +# @blooo/hw-app-concoridum + +## 1.0.0 + +### Features +- Initial implementation of Ledger hardware wallet support for Concordium +- Added support for key derivation and address generation +- Implemented transaction signing functionality +- Added support for message signing + +### API +- Introduced `Concordium` class for Ledger device interaction +- Added methods for: + - Getting public key and private key + - Signing transactions + - Signing messages + - Device connection management + +### Documentation +- Added comprehensive API documentation +- Included usage examples +- Added installation instructions + +### Dependencies +- Requires Ledger device with Concordium app installed +- Compatible with @ledgerhq/hw-transport-* packages diff --git a/README.md b/README.md index 8ec63e6..28ace51 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This repository contains JavaScript bindings for interacting with the Concordium To use this SDK, install it via npm: ```bash -npm install @blooo-io/hw-app-concordium +npm install @blooo/hw-app-concordium ``` ## API @@ -163,7 +163,7 @@ const { status } = await ccd.verifyAddress(false, 12, 12, 12); ```javascript import { AccountAddress, CcdAmount, AccountTransactionType } from "@concordium/web-sdk"; -import Concordium from "@blooo-io/hw-app-concordium"; +import Concordium from "@blooo/hw-app-concordium"; import TransportWebHID from "@ledgerhq/hw-transport-webhid"; const transport = await TransportWebHID.create(); @@ -204,7 +204,7 @@ const { signature } = await ccd.signTransfer(tx, "44/919/0/0/0/0"); ```javascript import { AccountAddress, CcdAmount, AccountTransactionType } from "@concordium/web-sdk"; -import Concordium from "@blooo-io/hw-app-concordium"; +import Concordium from "@blooo/hw-app-concordium"; import TransportWebHID from "@ledgerhq/hw-transport-webhid"; const transport = await TransportWebHID.create(); @@ -246,7 +246,7 @@ const { signature } = await ccd.signTransferWithMemo(txWithMemo, "44/919/0/0/0/0 ```javascript import { AccountAddress, CcdAmount, AccountTransactionType } from "@concordium/web-sdk"; -import Concordium from "@blooo-io/hw-app-concordium"; +import Concordium from "@blooo/hw-app-concordium"; import TransportWebHID from "@ledgerhq/hw-transport-webhid"; const transport = await TransportWebHID.create(); @@ -289,7 +289,7 @@ const { signature } = await ccd.signTransferWithSchedule(tx, "44/919/0/0/0/0"); ```javascript import { AccountAddress, CcdAmount, AccountTransactionType } from "@concordium/web-sdk"; -import Concordium from "@blooo-io/hw-app-concordium"; +import Concordium from "@blooo/hw-app-concordium"; import TransportWebHID from "@ledgerhq/hw-transport-webhid"; const transport = await TransportWebHID.create(); @@ -335,7 +335,7 @@ const { signature } = await ccd.signTransferWithScheduleAndMemo(tx, "44/919/0/0/ ```javascript import { AccountAddress, CcdAmount, AccountTransactionType } from "@concordium/web-sdk"; -import Concordium from "@blooo-io/hw-app-concordium"; +import Concordium from "@blooo/hw-app-concordium"; import TransportWebHID from "@ledgerhq/hw-transport-webhid"; const transport = await TransportWebHID.create(); @@ -380,7 +380,7 @@ const { signature } = await ccd.signConfigureDelegation(tx, "44/919/0/0/0/0"); ```javascript import { AccountAddress, CcdAmount, AccountTransactionType } from "@concordium/web-sdk"; -import Concordium from "@blooo-io/hw-app-concordium"; +import Concordium from "@blooo/hw-app-concordium"; import TransportWebHID from "@ledgerhq/hw-transport-webhid"; const transport = await TransportWebHID.create(); @@ -434,7 +434,7 @@ const configureBaker = { ```javascript import { AccountAddress, CcdAmount, AccountTransactionType } from "@concordium/web-sdk"; -import Concordium from "@blooo-io/hw-app-concordium"; +import Concordium from "@blooo/hw-app-concordium"; import TransportWebHID from "@ledgerhq/hw-transport-webhid"; const transport = await TransportWebHID.create(); @@ -474,7 +474,7 @@ const { signature } = await ccd.signRegisterData(tx, "44/919/0/0/0/0"); ```javascript import { AccountAddress, CcdAmount, AccountTransactionType } from "@concordium/web-sdk"; -import Concordium from "@blooo-io/hw-app-concordium"; +import Concordium from "@blooo/hw-app-concordium"; import TransportWebHID from "@ledgerhq/hw-transport-webhid"; const transport = await TransportWebHID.create(); @@ -516,7 +516,7 @@ const transferToPublic = { ```javascript import { AccountAddress, CcdAmount, AccountTransactionType } from "@concordium/web-sdk"; -import Concordium from "@blooo-io/hw-app-concordium"; +import Concordium from "@blooo/hw-app-concordium"; import TransportWebHID from "@ledgerhq/hw-transport-webhid"; const transport = await TransportWebHID.create(); @@ -557,7 +557,7 @@ const { signature } = await ccd.signDeployModule(tx, "44/919/0/0/0/0"); ```javascript import { AccountAddress, CcdAmount, AccountTransactionType } from "@concordium/web-sdk"; -import Concordium from "@blooo-io/hw-app-concordium"; +import Concordium from "@blooo/hw-app-concordium"; import TransportWebHID from "@ledgerhq/hw-transport-webhid"; const transport = await TransportWebHID.create(); @@ -610,7 +610,7 @@ const { signature } = await ccd.signInitContract(tx, "44/919/0/0/0/0"); ```javascript import { AccountAddress, CcdAmount, AccountTransactionType } from "@concordium/web-sdk"; -import Concordium from "@blooo-io/hw-app-concordium"; +import Concordium from "@blooo/hw-app-concordium"; import TransportWebHID from "@ledgerhq/hw-transport-webhid"; const transport = await TransportWebHID.create(); @@ -659,7 +659,7 @@ const { signature } = await ccd.signUpdateContract(tx, "44/919/0/0/0/0"); #### Examples-SignPublicInfoForIp ```javascript -import Concordium from "@blooo-io/hw-app-concordium"; +import Concordium from "@blooo/hw-app-concordium"; import TransportWebHID from "@ledgerhq/hw-transport-webhid"; const transport = await TransportWebHID.create(); @@ -700,7 +700,7 @@ const { signature } = await ccd.signPublicInfoForIp(transactionPublicInfoForIp, #### Examples-SignCredentialDeployment ```javascript -import Concordium from "@blooo-io/hw-app-concordium"; +import Concordium from "@blooo/hw-app-concordium"; import TransportWebHID from "@ledgerhq/hw-transport-webhid"; const transport = await TransportWebHID.create(); @@ -753,7 +753,7 @@ const { signature } = await ccd.signCredentialDeployment(credentialValues, true, ```javascript import { AccountAddress, CcdAmount, AccountTransactionType } from "@concordium/web-sdk"; -import Concordium from "@blooo-io/hw-app-concordium"; +import Concordium from "@blooo/hw-app-concordium"; import TransportWebHID from "@ledgerhq/hw-transport-webhid"; const transport = await TransportWebHID.create(); diff --git a/package-lock.json b/package-lock.json index bdc2a6d..10ee41e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "@blooo-io/hw-app-concordium", + "name": "@blooo/hw-app-concordium", "version": "6.29.4", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@blooo-io/hw-app-concordium", + "name": "@blooo/hw-app-concordium", "version": "6.29.4", "license": "Apache-2.0", "dependencies": { diff --git a/package.json b/package.json index a0d32c1..4ab031c 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "@blooo-io/hw-app-concordium", + "name": "@blooo/hw-app-concordium", "type": "module", "version": "1.0.0", "description": "Ledger Hardware Wallet Concordium Application API", diff --git a/src/Concordium.ts b/src/Concordium.ts index 1c1c840..76e6ebf 100644 --- a/src/Concordium.ts +++ b/src/Concordium.ts @@ -59,6 +59,8 @@ const P1_SCHEDULED_TRANSFER_PAIRS = 0x01; // Deploy Module const P1_SOURCE = 0x01; +const P1_NAME = 0x01; +const P1_PARAM = 0x02; // Update Credentials const P2_CREDENTIAL_INITIAL = 0x00; @@ -87,6 +89,9 @@ const INS = { SIGN_TRANSFER_SCHEDULE: 0x03, SIGN_CREDENTIAL_DEPLOYMENT: 0x04, EXPORT_PRIVATE_KEY: 0x05, + SIGN_DEPLOY_MODULE: 0x06, + SIGN_INIT_CONTRACT: 0x07, + SIGN_UPDATE_CONTRACT: 0x08, SIGN_TRANSFER_TO_PUBLIC: 0x12, SIGN_CONFIGURE_DELEGATION: 0x17, SIGN_CONFIGURE_BAKER: 0x18, @@ -96,9 +101,6 @@ const INS = { SIGN_TRANSFER_MEMO: 0x32, SIGN_TRANSFER_SCHEDULE_AND_MEMO: 0x34, SIGN_REGISTER_DATA: 0x35, - SIGN_DEPLOY_MODULE: 0x06, - SIGN_INIT_CONTRACT: 0x06, - SIGN_UPDATE_CONTRACT: 0x06, }; /** @@ -108,7 +110,7 @@ const INS = { * @param scrambleKey a scramble key * * @example - * import Concordium from "@blooo-io/hw-app-concordium"; + * import Concordium from "@blooo/hw-app-concordium"; * const Concordium = new Concordium(transport); */ export default class Concordium { @@ -614,17 +616,31 @@ export default class Concordium { */ async signInitContract(txn: IInitContractTransaction, path: string): Promise<{ signature: string[] }> { - const { payloads } = serializeInitContract(txn, path); + const { payloadsHeaderAndData, payloadsName, payloadsParam } = serializeInitContract(txn, path); let response; + await this.sendToDevice( + INS.SIGN_INIT_CONTRACT, + P1_INITIAL_PACKET, + NONE, + payloadsHeaderAndData[0] + ); - for (let i = 0; i < payloads.length; i++) { - const lastChunk = i === payloads.length - 1; + for (const nameChunk of payloadsName) { + await this.sendToDevice( + INS.SIGN_INIT_CONTRACT, + P1_NAME, + NONE, + nameChunk + ); + } + + for (const paramChunk of payloadsParam) { response = await this.sendToDevice( INS.SIGN_INIT_CONTRACT, - P1_FIRST_CHUNK + i, - lastChunk ? P2_LAST : P2_MORE, - payloads[i] + P1_PARAM, + NONE, + paramChunk ); } @@ -644,17 +660,31 @@ export default class Concordium { */ async signUpdateContract(txn: IUpdateContractTransaction, path: string): Promise<{ signature: string[] }> { - const { payloads } = serializeUpdateContract(txn, path); + const { payloadsHeaderAndData, payloadsName, payloadsParam } = serializeUpdateContract(txn, path); let response; + await this.sendToDevice( + INS.SIGN_UPDATE_CONTRACT, + P1_INITIAL_PACKET, + NONE, + payloadsHeaderAndData[0] + ); - for (let i = 0; i < payloads.length; i++) { - const lastChunk = i === payloads.length - 1; + for (const nameChunk of payloadsName) { + await this.sendToDevice( + INS.SIGN_UPDATE_CONTRACT, + P1_NAME, + NONE, + nameChunk + ); + } + + for (const paramChunk of payloadsParam) { response = await this.sendToDevice( INS.SIGN_UPDATE_CONTRACT, - P1_FIRST_CHUNK + i, - lastChunk ? P2_LAST : P2_MORE, - payloads[i] + P1_PARAM, + NONE, + paramChunk ); } diff --git a/src/serialization.ts b/src/serialization.ts index cd9de8c..27c2395 100644 --- a/src/serialization.ts +++ b/src/serialization.ts @@ -36,7 +36,10 @@ const FINALIZATION_REWARD_COMMISSION_LENGTH = 4; // Deploy module constants const VERSION_LENGTH = 4; const SOURCE_LENGTH_LENGTH = 4; - +const AMOUNT_LENGTH = 8; +const MODULE_REF_LENGTH = 32; +const UPDATE_INDEX_LENGTH = 8; +const UPDATE_SUB_INDEX_LENGTH = 8; // Credential and identity-related constants const REG_ID_LENGTH = 48; const IP_IDENTITY_LENGTH = 4; @@ -441,8 +444,26 @@ export const serializeDeployModule = (txn: IDeployModuleTransaction, path: strin * @param {string} path - The BIP32 path as a string. * @returns {{ payloads: Buffer[] }} - An object containing serialized payloads. */ -export const serializeInitContract = (txn: IInitContractTransaction, path: string): { payloads: Buffer[] } => { - return serializeTransaction(txn, path); +export const serializeInitContract = (txn: IInitContractTransaction, path: string): { payloadsHeaderAndData: Buffer[], payloadsName: Buffer[], payloadsParam: Buffer[] } => { + const txSerialized = serializeAccountTransaction(txn); + let offset = 0; + const headerAndData = txSerialized.subarray(0, HEADER_LENGTH + TRANSACTION_KIND_LENGTH + AMOUNT_LENGTH + MODULE_REF_LENGTH); + offset += HEADER_LENGTH + TRANSACTION_KIND_LENGTH + AMOUNT_LENGTH + MODULE_REF_LENGTH; + const payloadsHeaderAndData = serializeTransactionPayloadsWithDerivationPath(path, headerAndData); + + const nameLength = txSerialized.subarray(offset, offset + 2*ONE_OCTET_LENGTH); + offset += 2*ONE_OCTET_LENGTH; + const name = txSerialized.subarray(offset, offset + nameLength.readUInt16BE(0)); + offset += nameLength.readUInt16BE(0); + const payloadsName = serializeTransactionPayloads(Buffer.concat([nameLength, name])); + + const paramLength = txSerialized.subarray(offset, offset + 2*ONE_OCTET_LENGTH); + offset += 2*ONE_OCTET_LENGTH; + const param = txSerialized.subarray(offset, offset + paramLength.readUInt16BE(0)); + offset += paramLength.readUInt16BE(0); + const payloadsParam = serializeTransactionPayloads(Buffer.concat([paramLength, param])); + + return { payloadsHeaderAndData, payloadsName, payloadsParam }; }; /** @@ -451,8 +472,26 @@ export const serializeInitContract = (txn: IInitContractTransaction, path: strin * @param {string} path - The BIP32 path as a string. * @returns {{ payloads: Buffer[] }} - An object containing serialized payloads. */ -export const serializeUpdateContract = (txn: IUpdateContractTransaction, path: string): { payloads: Buffer[] } => { - return serializeTransaction(txn, path); +export const serializeUpdateContract = (txn: IUpdateContractTransaction, path: string): { payloadsHeaderAndData: Buffer[], payloadsName: Buffer[], payloadsParam: Buffer[] } => { + const txSerialized = serializeAccountTransaction(txn); + let offset = 0; + const headerAndData = txSerialized.subarray(0, HEADER_LENGTH + TRANSACTION_KIND_LENGTH + AMOUNT_LENGTH + UPDATE_INDEX_LENGTH + UPDATE_SUB_INDEX_LENGTH); + offset += HEADER_LENGTH + TRANSACTION_KIND_LENGTH + AMOUNT_LENGTH + UPDATE_INDEX_LENGTH + UPDATE_SUB_INDEX_LENGTH; + const payloadsHeaderAndData = serializeTransactionPayloadsWithDerivationPath(path, headerAndData); + + const nameLength = txSerialized.subarray(offset, offset + 2*ONE_OCTET_LENGTH); + offset += 2*ONE_OCTET_LENGTH; + const name = txSerialized.subarray(offset, offset + nameLength.readUInt16BE(0)); + offset += nameLength.readUInt16BE(0); + const payloadsName = serializeTransactionPayloads(Buffer.concat([nameLength, name])); + + const paramLength = txSerialized.subarray(offset, offset + 2*ONE_OCTET_LENGTH); + offset += 2*ONE_OCTET_LENGTH; + const param = txSerialized.subarray(offset, offset + paramLength.readUInt16BE(0)); + offset += paramLength.readUInt16BE(0); + const payloadsParam = serializeTransactionPayloads(Buffer.concat([paramLength, param])); + + return { payloadsHeaderAndData, payloadsName, payloadsParam }; }; /** diff --git a/test.js b/test.js deleted file mode 100644 index afef098..0000000 --- a/test.js +++ /dev/null @@ -1,64 +0,0 @@ -// import Concordium from "./src/Concordium"; -import { AccountAddress, AccountTransactionType, CcdAmount, SequenceNumber, TransactionExpiry } from "@concordium/web-sdk"; -import { serializeAccountTransaction } from "./lib-es/utils.js"; -import { encodeInt32, encodeInt8 } from "@concordium/common-sdk/lib/serializationHelpers.js"; -import { serializeConcordiumTransaction } from "./lib-es/serialization.js" -// import { createTransport } from "@ledgerhq/hw-transport-mocker"; - -// const transport = createTransport(); -// const concordium = new Concordium(transport); - -const DERIVATION = "44'/8217'/0'/0/0"; - -// Address used for testing (default speculos address, pub & priv key) -const test_sender_address = "4McQDikzr3GXi52Xjgcm2XZbq7E8YF7gzATZScZ5U59eLLkKjg"; -const test_sender_publicKey = - "0x31553d8c312ef1668adcf75f179a59accb85ffad9ea2a8ecf91049d9cdafc4706f3eb10091a459826803d353b3e3a98af0e999cd44353879930d8baf0779fde7"; -const test_sender_privateKey = - "0xba988b41f30ab65c5b8df817aa27468292d089db601892b01bccf0028d0d95bb"; -const test_receiver_address = "4McQDikzr3GXi52Xjgcm2XZbq7E8YF7gzATZScZ5U59eLLkKjg"; - -const sender = AccountAddress.fromBase58(test_sender_address); - const toAddress = AccountAddress.fromBase58(test_receiver_address); - const nonce = SequenceNumber.create(1234); - // const nextNonce: NextAccountNonce = await client.getNextAccountNonce(sender); - - const header = { - expiry: TransactionExpiry.futureMinutes(60), - nonce, - sender, - }; - - // Include memo if it is given otherwise don't - - const simpleTransfer = { - amount: CcdAmount.fromMicroCcd("999"), - toAddress, - }; - - const accountTransaction = { - header: header, - payload: simpleTransfer, - type: AccountTransactionType.Transfer, - }; - const idEncoded = encodeInt32(0); - const credEncoded = encodeInt32(0); -console.log("GUI TEST", Buffer.concat([idEncoded,credEncoded]).toString("hex")); - - - const transaction = { - sender, - nonce: nonce.toString(), - expiry: BigInt(123456), - energyAmount: '1234', - transactionKind: AccountTransactionType.Transfer, - payload: simpleTransfer, -}; -const txSerialized = serializeAccountTransaction(transaction); -console.log("Hex transaction", txSerialized.toString('hex')); - -const trx = serializeConcordiumTransaction(transaction, "44'/919'/0'/0/0") -console.log("GUI TX: ", trx); - -// const tx = Buffer.from(,txSerialized]) -// console.log("Transaction", tx);