Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: hiero-ledger/hiero-sdk-js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.48.1
Choose a base ref
...
head repository: hiero-ledger/hiero-sdk-js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.49.2
Choose a head ref
  • 16 commits
  • 48 files changed
  • 7 contributors

Commits on Jul 9, 2024

  1. update: release all skipped tests (#2395)

    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    svetoslav-nikol0v authored Jul 9, 2024
    Copy the full SHA
    131133d View commit details

Commits on Jul 15, 2024

  1. test: add maxAutomaticTokenAssociations tests (#2390)

    * test: add max auto associate tests
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * test(style): timeout consistency
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * test: using transfer_amount const instead of total_supply when transfering tokens
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * test: use serial ids instead of hardcoded integers
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * test: approve before transfer for token association
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    ---------
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    ivaylonikolov7 authored Jul 15, 2024
    Copy the full SHA
    720c2f9 View commit details

Commits on Jul 16, 2024

  1. feat: pull protobuf changes from latest tag (#2398)

    * feat: when updating the protobufs upstream repo use latest semantic tag instead of main
    
    Signed-off-by: Iliya Savov <isavov@users.noreply.github.com>
    
    * chore: rework version sort logic to handle pre-release tags
    
    Signed-off-by: Iliya Savov <isavov@users.noreply.github.com>
    
    * chore: improve output
    
    Signed-off-by: Iliya Savov <isavov@users.noreply.github.com>
    
    ---------
    
    Signed-off-by: Iliya Savov <isavov@users.noreply.github.com>
    Co-authored-by: Iliya Savov <isavov@users.noreply.github.com>
    Co-authored-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    3 people authored Jul 16, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a618bbb View commit details

Commits on Jul 17, 2024

  1. chore(deps): bump actions/checkout from 4.1.1 to 4.1.7 (#2350)

    Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.1 to 4.1.7.
    - [Release notes](https://github.com/actions/checkout/releases)
    - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
    - [Commits](actions/checkout@b4ffde6...692973e)
    
    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jul 17, 2024
    Copy the full SHA
    79c06ec View commit details

Commits on Jul 22, 2024

  1. update: retry on PLATFORM_NOT_ACTIVE error (#2401)

    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    svetoslav-nikol0v authored Jul 22, 2024
    Copy the full SHA
    f281162 View commit details

Commits on Jul 23, 2024

  1. update: add node id to the precheck error (#2414)

    * update: add node id to the precheck error
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    * chore: formatting
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    ---------
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    svetoslav-nikol0v authored Jul 23, 2024
    Copy the full SHA
    238f0c7 View commit details

Commits on Jul 26, 2024

  1. chore(deps): bump fast-loops in /examples/react-native-example (#2397)

    Bumps [fast-loops](https://github.com/robinweser/fast-loops) from 1.1.3 to 1.1.4.
    - [Commits](https://github.com/robinweser/fast-loops/commits)
    
    ---
    updated-dependencies:
    - dependency-name: fast-loops
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jul 26, 2024
    Copy the full SHA
    83992ff View commit details

Commits on Jul 31, 2024

  1. fix: reconnect to working node (#2417)

    * chore: address initial pain points
    
    Signed-off-by: Ivan Ivanov <ivanivanov.ii726@gmail.com>
    
    * chore: bump grpc-js version
    
    Signed-off-by: Ivan Ivanov <ivanivanov.ii726@gmail.com>
    
    * fix
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    * remove example
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    * chore: formatting
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    * fix
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    * revert: grpc old version
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    * revert: pnpm-lock file
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    * revert: package-lock file
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    ---------
    
    Signed-off-by: Ivan Ivanov <ivanivanov.ii726@gmail.com>
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    Co-authored-by: Ivan Ivanov <ivanivanov.ii726@gmail.com>
    svetoslav-nikol0v and 0xivanov authored Jul 31, 2024
    Copy the full SHA
    f5108e7 View commit details
  2. chore: add id-token permission to pages.yml workflow (#2418)

    Signed-off-by: Iliya Savov <isavov@users.noreply.github.com>
    Co-authored-by: Iliya Savov <isavov@users.noreply.github.com>
    Co-authored-by: Svet <svetoslav.nikolov@limechain.tech>
    3 people authored Jul 31, 2024
    Copy the full SHA
    81fb7d0 View commit details

Commits on Aug 1, 2024

  1. feat: Implement TokenRejectTransaction (#2411)

    * feat: TokenRejectTransaction js file
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * test: unit tests for TokenRejectTransaction
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * test: add integration tests for TokenRejectTransaction
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * feat: TokenRejectFlow
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * feat: TokenRejectFlow and TokenReject example
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * fix: circular dependency
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * chore: lint change
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * chore: remove client
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * refactor: use to string for status codes
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * refactor: use ? instead of | null
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * refactor: avoid usage of token identifier
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * refator: add PublicKey type for jsdocs in type definitions
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * fix: should not support strings conversion in token reject tx
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * fix(test): unit test should not expect token identifier property
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * fix: use proper PublicKey path
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * feat: better console logging when executing examples
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
    
    * refactor: avoid using magical number in example script
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * chore: remove unused imports
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * chore: improve comments naming
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * chore: improve token naming
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * chore: max automatic token assoc should be 100 for consistency between all sdk
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * fix: reconnect to working node (#2417)
    
    * chore: address initial pain points
    
    Signed-off-by: Ivan Ivanov <ivanivanov.ii726@gmail.com>
    
    * chore: bump grpc-js version
    
    Signed-off-by: Ivan Ivanov <ivanivanov.ii726@gmail.com>
    
    * fix
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    * remove example
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    * chore: formatting
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    * fix
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    * revert: grpc old version
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    * revert: pnpm-lock file
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    * revert: package-lock file
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    ---------
    
    Signed-off-by: Ivan Ivanov <ivanivanov.ii726@gmail.com>
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    Co-authored-by: Ivan Ivanov <ivanivanov.ii726@gmail.com>
    
    * test(fix): update token reject outdated test
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * chore: comments typo and improvement
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * test: temporary skip allowance tests for NFT and FT
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * test: ignore eslint warnings for skipped tests
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    
    * chore: add id-token permission to pages.yml workflow (#2418)
    
    Signed-off-by: Iliya Savov <isavov@users.noreply.github.com>
    Co-authored-by: Iliya Savov <isavov@users.noreply.github.com>
    Co-authored-by: Svet <svetoslav.nikolov@limechain.tech>
    
    ---------
    
    Signed-off-by: Ivaylo Nikolov <ivaylo.nikolov@limechain.tech>
    Signed-off-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
    Signed-off-by: Ivan Ivanov <ivanivanov.ii726@gmail.com>
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    Signed-off-by: Iliya Savov <isavov@users.noreply.github.com>
    Co-authored-by: Svet <svetoslav.nikolov@limechain.tech>
    Co-authored-by: Ivan Ivanov <ivanivanov.ii726@gmail.com>
    Co-authored-by: Iliya Savov <117984128+isavov@users.noreply.github.com>
    Co-authored-by: Iliya Savov <isavov@users.noreply.github.com>
    Co-authored-by: Alexander Gadzhalov <alexander.gadzhalov@limechain.tech>
    6 people authored Aug 1, 2024
    Copy the full SHA
    8a22ce9 View commit details

Commits on Aug 2, 2024

  1. release: proto v2.15.0-beta.3 (#2415)

    * chore: bump version v2.15.0-beta.3
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    * chore: update protobufs to v0.52.0
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    ---------
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    svetoslav-nikol0v authored Aug 2, 2024
    Copy the full SHA
    39629db View commit details
  2. fix: update taskfile status check for submodules task (#2435)

    Signed-off-by: Iliya Savov <isavov@users.noreply.github.com>
    Co-authored-by: Iliya Savov <isavov@users.noreply.github.com>
    Co-authored-by: Svet <svetoslav.nikolov@limechain.tech>
    3 people authored Aug 2, 2024
    Copy the full SHA
    5459fb4 View commit details
  3. release: v2.49.0 (#2436)

    * update: version 2.49.0
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    * update: release notes
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    * update: proto version 2.15.0-beta.3
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    * chore: remove 'readonly' modifier
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    
    ---------
    
    Signed-off-by: svetoslav-nikol0v <svetoslav.nikolov@limechain.tech>
    svetoslav-nikol0v authored Aug 2, 2024
    Copy the full SHA
    572cb18 View commit details
  4. fix: better condition for install:submodules task (#2438)

    Signed-off-by: Iliya Savov <isavov@users.noreply.github.com>
    Co-authored-by: Iliya Savov <isavov@users.noreply.github.com>
    isavov and isavov authored Aug 2, 2024
    Copy the full SHA
    433fc14 View commit details
  5. release: v2.49.1 (#2440)

    * update: version v2.49.1
    
    Signed-off-by: Svet <svetoslav.nikolov@limechain.tech>
    
    * update: release notes
    
    Signed-off-by: Svet <svetoslav.nikolov@limechain.tech>
    
    * update: address books
    
    Signed-off-by: Svet <svetoslav.nikolov@limechain.tech>
    
    ---------
    
    Signed-off-by: Svet <svetoslav.nikolov@limechain.tech>
    svetoslav-nikol0v authored Aug 2, 2024
    Copy the full SHA
    05ed4b5 View commit details

Commits on Aug 3, 2024

  1. release: v2.49.2 (#2441)

    * update: release notes
    
    Signed-off-by: Svet <svetoslav.nikolov@limechain.tech>
    
    * update: version
    
    Signed-off-by: Svet <svetoslav.nikolov@limechain.tech>
    
    * fix: remove deprecation
    
    Signed-off-by: Svet <svetoslav.nikolov@limechain.tech>
    
    * fix: remove unnecessary
    
    Signed-off-by: Svet <svetoslav.nikolov@limechain.tech>
    
    ---------
    
    Signed-off-by: Svet <svetoslav.nikolov@limechain.tech>
    svetoslav-nikol0v authored Aug 3, 2024
    Copy the full SHA
    c0e092d View commit details
Showing with 3,859 additions and 779 deletions.
  1. +2 −2 .github/workflows/build.yml
  2. +1 −1 .github/workflows/common_js.yml
  3. +2 −1 .github/workflows/pages.yml
  4. +3 −3 .github/workflows/publish_release.yaml
  5. +2 −2 .github/workflows/react_native.yml
  6. +1 −1 .github/workflows/renovate.yml
  7. +16 −0 CHANGELOG.md
  8. +3 −3 examples/react-native-example/yarn.lock
  9. +241 −0 examples/token-reject.js
  10. +2 −2 package.json
  11. +14 −2 packages/proto/Taskfile.yml
  12. +1 −1 packages/proto/package.json
  13. +1 −1 packages/proto/src/proto
  14. +17 −8 src/Executable.js
  15. +11 −1 src/PrecheckStatusError.js
  16. +27 −0 src/RequestType.js
  17. +57 −0 src/Status.js
  18. +1 −11 src/account/AccountBalance.js
  19. +0 −25 src/client/Client.js
  20. +1 −1 src/client/addressbooks/mainnet.js
  21. +1 −1 src/client/addressbooks/previewnet.js
  22. +1 −1 src/client/addressbooks/testnet.js
  23. +4 −1 src/contract/ContractCallQuery.js
  24. +2 −0 src/exports.js
  25. +3 −2 src/query/CostQuery.js
  26. +4 −1 src/query/Query.js
  27. +40 −0 src/token/TokenReference.js
  28. +279 −0 src/token/TokenRejectFlow.js
  29. +280 −0 src/token/TokenRejectTransaction.js
  30. +4 −2 src/transaction/Transaction.js
  31. +4 −1 src/transaction/TransactionReceiptQuery.js
  32. +4 −2 src/transaction/TransactionRecordQuery.js
  33. +22 −27 test/integration/AccountBalanceIntegrationTest.js
  34. +28 −33 test/integration/AccountInfoIntegrationTest.js
  35. +837 −71 test/integration/TokenAssociateIntegrationTest.js
  36. +46 −52 test/integration/TokenBurnIntegrationTest.js
  37. +85 −90 test/integration/TokenDissociateIntegrationTest.js
  38. +66 −71 test/integration/TokenFreezeIntegrationTest.js
  39. +66 −71 test/integration/TokenGrantKycIntegrationTest.js
  40. +209 −0 test/integration/TokenRejectFlowIntegrationTest.js
  41. +1,005 −0 test/integration/TokenRejectIntegrationTest.js
  42. +89 −94 test/integration/TokenRevokeKycIntegrationTest.js
  43. +89 −94 test/integration/TokenUnfreezeIntegrationTest.js
  44. +93 −98 test/integration/TokenWipeIntegrationTest.js
  45. +1 −1 test/integration/client/BaseIntegrationTestEnv.js
  46. +1 −1 test/unit/AccountInfoMocking.js
  47. +81 −0 test/unit/TokenRejectFlow.js
  48. +112 −0 test/unit/TokenRejectTransaction.js
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ jobs:
egress-policy: audit

- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: true

@@ -115,7 +115,7 @@ jobs:
egress-policy: audit

- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: recursive

2 changes: 1 addition & 1 deletion .github/workflows/common_js.yml
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ jobs:
egress-policy: audit

- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: true

3 changes: 2 additions & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ defaults:
permissions:
pages: write
contents: read
id-token: write

jobs:
build-and-deploy-docs:
@@ -23,7 +24,7 @@ jobs:
egress-policy: audit

- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: recursive

6 changes: 3 additions & 3 deletions .github/workflows/publish_release.yaml
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ jobs:
egress-policy: audit

- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ github.event.inputs.tag || '' }}
fetch-depth: 0
@@ -235,7 +235,7 @@ jobs:
egress-policy: audit

- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ github.event.inputs.tag || '' }}

@@ -271,7 +271,7 @@ jobs:
egress-policy: audit

- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ github.event.inputs.tag || '' }}

4 changes: 2 additions & 2 deletions .github/workflows/react_native.yml
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ jobs:
egress-policy: audit

- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Setup Java
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
@@ -92,7 +92,7 @@ jobs:
egress-policy: audit

- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Setup Java
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
2 changes: 1 addition & 1 deletion .github/workflows/renovate.yml
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ jobs:
egress-policy: audit

- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: recursive

16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v2.49.2

## What's Changed

* fix: update taskfile status check for submodules task by @isavov in https://github.com/hashgraph/hedera-sdk-js/pull/2435
* chore: fix token permissions for deploy to github pages by @isavov in https://github.com/hashgraph/hedera-sdk-js/pull/2418
* fix: reconnect to working node by @0xivanov in https://github.com/hashgraph/hedera-sdk-js/pull/2417
* release: proto v2.15.0-beta.3 by @svetoslav-nikol0v in https://github.com/hashgraph/hedera-sdk-js/pull/2415
* update: add node id to the precheck error by @svetoslav-nikol0v in https://github.com/hashgraph/hedera-sdk-js/pull/2414
* feat: Implement TokenRejectTransaction by @ivaylonikolov7 in https://github.com/hashgraph/hedera-sdk-js/pull/2411
* update: handle PLATFORM_NOT_ACTIVE error gracefully by @svetoslav-nikol0v in https://github.com/hashgraph/hedera-sdk-js/pull/2401
* feat: pull protobuf changes from latest tag by @isavov in https://github.com/hashgraph/hedera-sdk-js/pull/2435
* chore: fix token permissions for deploy to github pages by @isavov in https://github.com/hashgraph/hedera-sdk-js/pull/2389
* update: release all skipped tests by @svetoslav-nikol0v in https://github.com/hashgraph/hedera-sdk-js/pull/2395
* test: add maxAutomaticTokenAssociations tests by @ivaylonikolov7 in https://github.com/hashgraph/hedera-sdk-js/pull/2390

## v2.48.1

## What's Changed
6 changes: 3 additions & 3 deletions examples/react-native-example/yarn.lock
Original file line number Diff line number Diff line change
@@ -3779,9 +3779,9 @@ fast-glob@^3.2.5, fast-glob@^3.2.9:
micromatch "^4.0.4"

fast-loops@^1.1.3:
version "1.1.3"
resolved "https://registry.npmjs.org/fast-loops/-/fast-loops-1.1.3.tgz"
integrity sha512-8EZzEP0eKkEEVX+drtd9mtuQ+/QrlfW/5MlwcwK5Nds6EkZ/tRzEexkzUY2mIssnAyVLT+TKHuRXmFNNXYUd6g==
version "1.1.4"
resolved "https://registry.yarnpkg.com/fast-loops/-/fast-loops-1.1.4.tgz#61bc77d518c0af5073a638c6d9d5c7683f069ce2"
integrity sha512-8dbd3XWoKCTms18ize6JmQF1SFnnfj5s0B7rRry22EofgMu7B6LKHVh+XfFqFGsqnbH54xgeO83PzpKI+ODhlg==

fast-redact@^3.1.1:
version "3.3.0"
241 changes: 241 additions & 0 deletions examples/token-reject.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
import {
AccountCreateTransaction,
PrivateKey,
TokenCreateTransaction,
TransferTransaction,
AccountId,
Client,
TokenType,
TokenMintTransaction,
TokenRejectTransaction,
TokenRejectFlow,
NftId,
AccountBalanceQuery,
TokenSupplyType,
} from "@hashgraph/sdk";
import dotenv from "dotenv";

dotenv.config();

async function main() {
if (
process.env.OPERATOR_ID == null ||
process.env.OPERATOR_KEY == null ||
process.env.HEDERA_NETWORK == null
) {
throw new Error(
"Environment variables OPERATOR_ID, HEDERA_NETWORK, and OPERATOR_KEY are required.",
);
}
const CID = [
"QmNPCiNA3Dsu3K5FxDPMG5Q3fZRwVTg14EXA92uqEeSRXn",
"QmZ4dgAgt8owvnULxnKxNe8YqpavtVCXmc1Lt2XajFpJs9",
"QmPzY5GxevjyfMUF5vEAjtyRoigzWp47MiKAtLBduLMC1T",
];
const operatorId = AccountId.fromString(process.env.OPERATOR_ID);
const operatorKey = PrivateKey.fromStringED25519(process.env.OPERATOR_KEY);
const network = process.env.HEDERA_NETWORK;
const client = Client.forName(network).setOperator(operatorId, operatorKey);

// create a treasury account
const treasuryPrivateKey = PrivateKey.generateED25519();
const treasuryAccountId = (
await (
await new AccountCreateTransaction()
.setKey(treasuryPrivateKey)
.setMaxAutomaticTokenAssociations(100)
.execute(client)
).getReceipt(client)
).accountId;

// create a receiver account with unlimited max auto associations
const receiverPrivateKey = PrivateKey.generateED25519();
const receiverAccountId = (
await (
await new AccountCreateTransaction()
.setKey(receiverPrivateKey)
.setMaxAutomaticTokenAssociations(-1)
.execute(client)
).getReceipt(client)
).accountId;

// create a nft collection
const nftCreationTx = await (
await new TokenCreateTransaction()
.setTokenType(TokenType.NonFungibleUnique)
.setTokenName("Example Fungible Token")
.setTokenSymbol("EFT")
.setMaxSupply(CID.length)
.setSupplyType(TokenSupplyType.Finite)
.setSupplyKey(operatorKey)
.setAdminKey(operatorKey)
.setTreasuryAccountId(treasuryAccountId)
.freezeWith(client)
.sign(treasuryPrivateKey)
).execute(client);

const nftId = (await nftCreationTx.getReceipt(client)).tokenId;
console.log("NFT ID: ", nftId.toString());

// create a fungible token
const ftCreationTx = await (
await new TokenCreateTransaction()
.setTokenName("Example Fungible Token")
.setTokenSymbol("EFT")
.setInitialSupply(100000000)
.setSupplyKey(operatorKey)
.setAdminKey(operatorKey)
.setTreasuryAccountId(treasuryAccountId)
.freezeWith(client)
.sign(treasuryPrivateKey)
).execute(client);

const ftId = (await ftCreationTx.getReceipt(client)).tokenId;
console.log("FT ID: ", ftId.toString());

// mint 3 NFTs to treasury
const nftSerialIds = [];
for (let i = 0; i < CID.length; i++) {
const { serials } = await (
await new TokenMintTransaction()
.setTokenId(nftId)
.addMetadata(Buffer.from(CID[i]))
.execute(client)
).getReceipt(client);
const [serial] = serials;
nftSerialIds.push(new NftId(nftId, serial));
}

// transfer nfts to receiver
await (
await (
await new TransferTransaction()
.addNftTransfer(
nftSerialIds[0],
treasuryAccountId,
receiverAccountId,
)
.addNftTransfer(
nftSerialIds[1],
treasuryAccountId,
receiverAccountId,
)
.addNftTransfer(
nftSerialIds[2],
treasuryAccountId,
receiverAccountId,
)
.freezeWith(client)
.sign(treasuryPrivateKey)
).execute(client)
).getReceipt(client);

// transfer fungible tokens to receiver
await (
await (
await new TransferTransaction()
.addTokenTransfer(ftId, treasuryAccountId, -1)
.addTokenTransfer(ftId, receiverAccountId, 1)
.freezeWith(client)
.sign(treasuryPrivateKey)
).execute(client)
).getReceipt(client);

console.log("=======================");
console.log("Before Token Reject");
console.log("=======================");
const receiverFTBalanceBefore = (
await new AccountBalanceQuery()
.setAccountId(receiverAccountId)
.execute(client)
).tokens.get(ftId);
const treasuryFTBalanceBefore = (
await new AccountBalanceQuery()
.setAccountId(treasuryAccountId)
.execute(client)
).tokens.get(ftId);
const receiverNFTBalanceBefore = (
await new AccountBalanceQuery()
.setAccountId(receiverAccountId)
.execute(client)
).tokens.get(nftId);
const treasuryNFTBalanceBefore = (
await new AccountBalanceQuery()
.setAccountId(treasuryAccountId)
.execute(client)
).tokens.get(nftId);
console.log("Receiver FT balance: ", receiverFTBalanceBefore.toInt());
console.log("Treasury FT balance: ", treasuryFTBalanceBefore.toInt());
console.log(
"Receiver NFT balance: ",
receiverNFTBalanceBefore ? receiverNFTBalanceBefore.toInt() : 0,
);
console.log("Treasury NFT balance: ", treasuryNFTBalanceBefore.toInt());

// reject fungible tokens back to treasury
const tokenRejectResponse = await (
await (
await new TokenRejectTransaction()
.setOwnerId(receiverAccountId)
.addTokenId(ftId)
.freezeWith(client)
.sign(receiverPrivateKey)
).execute(client)
).getReceipt(client);

// reject NFTs back to treasury
const rejectFlowResponse = await (
await (
new TokenRejectFlow()
.setOwnerId(receiverAccountId)
.setNftIds(nftSerialIds)
.freezeWith(client)
.sign(receiverPrivateKey)
).execute(client)
).getReceipt(client);

const tokenRejectStatus = tokenRejectResponse.status.toString();
const tokenRejectFlowStatus = rejectFlowResponse.status.toString();

console.log("=======================");
console.log("After Token Reject Transaction and flow");
console.log("=======================");

const receiverFTBalanceAfter = (
await new AccountBalanceQuery()
.setAccountId(receiverAccountId)
.execute(client)
).tokens.get(ftId);

const treasuryFTBalanceAfter = (
await new AccountBalanceQuery()
.setAccountId(treasuryAccountId)
.execute(client)
).tokens.get(ftId);

const receiverNFTBalanceAfter = (
await new AccountBalanceQuery()
.setAccountId(receiverAccountId)
.execute(client)
).tokens.get(nftId);

const treasuryNFTBalanceAfter = (
await new AccountBalanceQuery()
.setAccountId(treasuryAccountId)
.execute(client)
).tokens.get(nftId);

console.log("TokenReject response:", tokenRejectStatus);
console.log("TokenRejectFlow response:", tokenRejectFlowStatus);
console.log("Receiver FT balance: ", receiverFTBalanceAfter.toInt());
console.log("Treasury FT balance: ", treasuryFTBalanceAfter.toInt());
console.log(
"Receiver NFT balance: ",
receiverNFTBalanceAfter ? receiverNFTBalanceAfter.toInt() : 0,
);
console.log("Treasury NFT balance: ", treasuryNFTBalanceAfter.toInt());

client.close();
}

void main();
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hashgraph/sdk",
"version": "2.48.1",
"version": "2.49.2",
"description": "Hedera™ Hashgraph SDK",
"types": "./lib/index.d.ts",
"main": "./lib/index.cjs",
@@ -58,7 +58,7 @@
"@ethersproject/rlp": "^5.7.0",
"@grpc/grpc-js": "1.8.2",
"@hashgraph/cryptography": "1.4.8-beta.5",
"@hashgraph/proto": "2.15.0-beta.2",
"@hashgraph/proto": "2.15.0-beta.3",
"axios": "^1.6.4",
"bignumber.js": "^9.1.1",
"bn.js": "^5.1.1",
Loading