diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index d97fd19..0000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,23 +0,0 @@ -import { defineConfig } from "eslint-define-config"; - -export default defineConfig([ - { - languageOptions: { - globals: { - console: "readonly", - }, - }, - extends: ["plugin:prettier/recommended"], - rules: { - "no-console": ["warn", { allow: ["warn"] }], - "prefer-const": "error", - semi: ["error", "always"], - curly: ["error", "all"], - eqeqeq: ["error", "always"], - "no-multi-spaces": ["error"], - "no-duplicate-imports": ["error"], - "prettier/prettier": "error", - }, - ignores: ["mochawesome-report/**"], - }, -]); diff --git a/docs/test-specifications/token-service/CustomFee.md b/docs/test-specifications/token-service/CustomFee.md index ce906ea..08bcd2e 100644 --- a/docs/test-specifications/token-service/CustomFee.md +++ b/docs/test-specifications/token-service/CustomFee.md @@ -16,25 +16,25 @@ Custom fees can be added to tokens that will be charged users automatically when | Parameter Name | Type | Required/Optional | Description/Notes | |---------------------|--------|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| amount | int64 | required | The amount to be assessed as a fee. | +| amount | string | required | The amount to be assessed as a fee. | | denominatingTokenId | string | optional | The ID of the token to use to assess the fee. The value "0.0.0" SHALL be used to specify the token being created if used in a `TokenCreateTransaction`. Hbar SHALL be used if no value is provided. | ### Fractional Fee Object Definition | Parameter Name | Type | Required/Optional | Description/Notes | |------------------|--------|-------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| numerator | int64 | required | The numerator of the fraction of the amount to be assessed as a fee. | -| denominator | int64 | required | The denominator of the fraction of the amount to be assessed as a fee. | -| minimumAmount | int64 | required | The minimum amount to assess as a fee. | -| maximumAmount | int64 | required | The maximum amount to assess as a fee. 0 implies no maximum. | +| numerator | string | required | The numerator of the fraction of the amount to be assessed as a fee. | +| denominator | string | required | The denominator of the fraction of the amount to be assessed as a fee. | +| minimumAmount | string | required | The minimum amount to assess as a fee. | +| maximumAmount | string | required | The maximum amount to assess as a fee. 0 implies no maximum. | | assessmentMethod | string | required | How should the fee be assessed? It MUST be one of `inclusive` or `exclusive`. `inclusive` means the fee is included in the amount of tokens transferred and will be subtracted from that amount, while `exclusive` means the sender will be charged in addition to the transferred amount. | ### Royalty Fee Object Definition | Parameter Name | Type | Required/Optional | Description/Notes | |----------------|-------------|-------------------|------------------------------------------------------------------------------------------------------------| -| numerator | int64 | required | The numerator of the fraction of the amount to be assessed as a fee. | -| denominator | int64 | required | The denominator of the fraction of the amount to be assessed as a fee. | +| numerator | string | required | The numerator of the fraction of the amount to be assessed as a fee. | +| denominator | string | required | The denominator of the fraction of the amount to be assessed as a fee. | | fallbackFee | json object | optional | The [Fixed Fee](#fixed-fee-object-definition) to assess to the receiver if no fungible value is exchanged. | ## Example Usage @@ -56,7 +56,7 @@ If the `createToken` method were to contain a custom fee of each type, its usage "feeCollectorAccountId": "0.0.9931", "feeCollectorsExempt": true, "fixedFee": { - "amount": 10, + "amount": "10", "denominatingTokenId": "0.0.8228" } }, @@ -64,10 +64,10 @@ If the `createToken` method were to contain a custom fee of each type, its usage "feeCollectorAccountId": "0.0.3467294", "feeCollectorsExempt": false, "fractionalFee": { - "numerator": 12, - "denominator": 29, - "minimumAmount": 50, - "maximumAmount": 5000, + "numerator": "12", + "denominator": "29", + "minimumAmount": "50", + "maximumAmount": "5000", "assessmentMethod": "inclusive" } }, @@ -75,10 +75,10 @@ If the `createToken` method were to contain a custom fee of each type, its usage "feeCollectorAccountId": "0.0.437195", "feeCollectorsExempt": true, "royaltyFee": { - "numerator": 1, - "denominator": 94, + "numerator": "1", + "denominator": "94", "fallbackFee": { - "amount": 25, + "amount": "25", "denominatingTokenId": "0.0.67932" } } diff --git a/docs/test-specifications/token-service/TokenFeeScheduleUpdateTransaction.md b/docs/test-specifications/token-service/TokenFeeScheduleUpdateTransaction.md index ef156d5..5486da0 100644 --- a/docs/test-specifications/token-service/TokenFeeScheduleUpdateTransaction.md +++ b/docs/test-specifications/token-service/TokenFeeScheduleUpdateTransaction.md @@ -43,7 +43,7 @@ https://docs.hedera.com/hedera/sdks-and-apis/rest-api | status | string | The status of the submitted `TokenFeeScheduleUpdateTransaction` (from a `TransactionReceipt`). | ### Additional Notes -The tests contained in this specification will assume that two valid tokens have already been successfully created. The tokens will be an immutable fungible token, and an immutable NFT with values of name="testname", symbol="testsymbol", treasuryAccountId=, and feeScheduleKey= (and tokenType="ft" or tokenType="nft", depending on the token. The NFT will also need supplyKey=). The fungible token should also be created with a custom fixed fee with feeCollectorAccountId=, feeCollectorsExempt=false, and amount=10. Any tag is the ID of the first token, any tag is the ID of the NFT. Any tag is be the DER-encoded hex string of the fee schedule key of the fungible token, and any tag is the DER-encoded hex string of the fee schedule key of the NFT. Any will be the supply key of the NFT. +The tests contained in this specification will assume that two valid tokens have already been successfully created. The tokens will be an immutable fungible token, and an immutable NFT with values of name="testname", symbol="testsymbol", treasuryAccountId=, and feeScheduleKey= (and tokenType="ft" or tokenType="nft", depending on the token. The NFT will also need supplyKey=). The fungible token should also be created with a custom fixed fee with feeCollectorAccountId=, feeCollectorsExempt=false, and amount="10". Any tag is the ID of the first token, any tag is the ID of the NFT. Any tag is be the DER-encoded hex string of the fee schedule key of the fungible token, and any tag is the DER-encoded hex string of the fee schedule key of the NFT. Any will be the supply key of the NFT. ## Property Tests @@ -91,94 +91,70 @@ The tests contained in this specification will assume that two valid tokens have | Test no | Name | Input | Expected response | Implemented (Y/N) | |---------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------|-------------------| -| 1 | Updates a token's fee schedule with a fixed fee with an amount of 0 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount=0}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 2 | Updates a token's fee schedule with a fixed fee with an amount of -1 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount=-1}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 3 | Updates a token's fee schedule with a fixed fee with an amount of 9,223,372,036,854,775,807 (int64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount=9223372036854775807}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fixed fee with an amount of 9,223,372,036,854,775,807. | N | -| 4 | Updates a token's fee schedule with a fixed fee with an amount of 9,223,372,036,854,775,806 (int64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount=9223372036854775806}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fixed fee with an amount of 9,223,372,036,854,775,806. | N | -| 5 | Updates a token's fee schedule with a fixed fee with an amount of 9,223,372,036,854,775,808 (int64 max + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount=9223372036854775808}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 6 | Updates a token's fee schedule with a fixed fee with an amount of 18,446,744,073,709,551,615 (uint64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount=18446744073709551615}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 7 | Updates a token's fee schedule with a fixed fee with an amount of 18,446,744,073,709,551,614 (uint64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount=18446744073709551614}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 8 | Updates a token's fee schedule with a fixed fee with an amount of -9,223,372,036,854,775,808 (int64 min) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount=-9223372036854775808}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 9 | Updates a token's fee schedule with a fixed fee with an amount of -9,223,372,036,854,775,807 (int64 min + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount=-9223372036854775807}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 10 | Updates a token's fee schedule with a fractional fee with a numerator of 0 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=0, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 11 | Updates a token's fee schedule with a fractional fee with a numerator of -1 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=-1, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 12 | Updates a token's fee schedule with a fractional fee with a numerator of 9,223,372,036,854,775,807 (int64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=9223372036854775807, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fractional fee with an amount of 9,223,372,036,854,775,807 / 10. | N | -| 13 | Updates a token's fee schedule with a fractional fee with a numerator of 9,223,372,036,854,775,806 (int64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=9223372036854775806, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fractional fee with an amount of 9,223,372,036,854,775,806 / 10. | N | -| 14 | Updates a token's fee schedule with a fractional fee with a numerator of 9,223,372,036,854,775,808 (int64 max + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=9223372036854775808, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 15 | Updates a token's fee schedule with a fractional fee with a numerator of 18,446,744,073,709,551,615 (uint64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=18446744073709551615, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 16 | Updates a token's fee schedule with a fractional fee with a numerator of 18,446,744,073,709,551,614 (uint64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=18446744073709551614, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 17 | Updates a token's fee schedule with a fractional fee with a numerator of -9,223,372,036,854,775,808 (int64 min) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=-9223372036854775808, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 18 | Updates a token's fee schedule with a fractional fee with a numerator of -9,223,372,036,854,775,807 (int64 min + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=-9223372036854775807, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 19 | Updates a token's fee schedule with a fractional fee with a denominator of 0 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=0, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a FRACTION_DIVIDES_BY_ZERO response code from the network. | N | -| 20 | Updates a token's fee schedule with a fractional fee with a denominator of -1 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=-1, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 21 | Updates a token's fee schedule with a fractional fee with a denominator of 9,223,372,036,854,775,807 (int64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=9223372036854775807, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fractional fee with an amount of 1 / 9,223,372,036,854,775,807. | N | -| 22 | Updates a token's fee schedule with a fractional fee with a denominator of 9,223,372,036,854,775,806 (int64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=9223372036854775806, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fractional fee with an amount of 1 / 9,223,372,036,854,775,806. | N | -| 23 | Updates a token's fee schedule with a fractional fee with a denominator of 9,223,372,036,854,775,808 (int64 max + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=9223372036854775808, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 24 | Updates a token's fee schedule with a fractional fee with a denominator of 18,446,744,073,709,551,615 (uint64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=18446744073709551615, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 25 | Updates a token's fee schedule with a fractional fee with a denominator of 18,446,744,073,709,551,614 (uint64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=18446744073709551614, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 26 | Updates a token's fee schedule with a fractional fee with a denominator of -9,223,372,036,854,775,808 (int64 min) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=-9223372036854775808, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 27 | Updates a token's fee schedule with a fractional fee with a denominator of -9,223,372,036,854,775,807 (int64 min + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=-9223372036854775807, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 28 | Updates a token's fee schedule with a fractional fee with a minimum amount of 0 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=0, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fractional fee with a minimum amount of 0. | N | -| 29 | Updates a token's fee schedule with a fractional fee with a minimum amount of -1 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=-1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 30 | Updates a token's fee schedule with a fractional fee with a minimum amount of 9,223,372,036,854,775,807 (int64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=9223372036854775807, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT response code from the network. | N | -| 31 | Updates a token's fee schedule with a fractional fee with a minimum amount of 9,223,372,036,854,775,806 (int64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=9223372036854775806, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT response code from the network. | N | -| 32 | Updates a token's fee schedule with a fractional fee with a minimum amount of 9,223,372,036,854,775,808 (int64 max + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=9223372036854775808, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 33 | Updates a token's fee schedule with a fractional fee with a minimum amount of 18,446,744,073,709,551,615 (uint64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=18446744073709551615, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 34 | Updates a token's fee schedule with a fractional fee with a minimum amount of 18,446,744,073,709,551,614 (uint64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=18446744073709551614, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 35 | Updates a token's fee schedule with a fractional fee with a minimum amount of -9,223,372,036,854,775,808 (int64 min) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=-9223372036854775808, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 36 | Updates a token's fee schedule with a fractional fee with a minimum amount of -9,223,372,036,854,775,807 (int64 min + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=-9223372036854775807, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 37 | Updates a token's fee schedule with a fractional fee with a maximum amount of 0 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=0, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fractional fee with a maximum amount of 0 (unlimited). | N | -| 38 | Updates a token's fee schedule with a fractional fee with a maximum amount of -1 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=-1, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 39 | Updates a token's fee schedule with a fractional fee with a maximum amount of 9,223,372,036,854,775,807 (int64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=9223372036854775807, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fractional fee with a maximum amount of 9,223,372,036,854,775,807. | N | -| 40 | Updates a token's fee schedule with a fractional fee with a maximum amount of 9,223,372,036,854,775,806 (int64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=9223372036854775806, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fractional fee with a maximum amount of 9,223,372,036,854,775,806. | N | -| 41 | Updates a token's fee schedule with a fractional fee with a maximum amount of 9,223,372,036,854,775,808 (int64 max + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=9223372036854775808, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 42 | Updates a token's fee schedule with a fractional fee with a maximum amount of 18,446,744,073,709,551,615 (uint64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=18446744073709551615, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 43 | Updates a token's fee schedule with a fractional fee with a maximum amount of 18,446,744,073,709,551,614 (uint64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=18446744073709551614, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 44 | Updates a token's fee schedule with a fractional fee with a maximum amount of -9,223,372,036,854,775,808 (int64 min) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=-9223372036854775808, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 45 | Updates a token's fee schedule with a fractional fee with a maximum amount of -9,223,372,036,854,775,807 (int64 min + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=-9223372036854775807, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 46 | Updates a NFT's fee schedule with a royalty fee with a numerator of 0 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=0, royaltyFee.denominator=10, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 47 | Updates a NFT's fee schedule with a royalty fee with a numerator of -1 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=-1, royaltyFee.denominator=10, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 48 | Updates a NFT's fee schedule with a royalty fee with a numerator of 9,223,372,036,854,775,807 (int64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=9223372036854775807, royaltyFee.denominator=10, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with a ROYALTY_FRACTION_CANNOT_EXCEED_ONE response code from the network. | N | -| 49 | Updates a NFT's fee schedule with a royalty fee with a numerator of 9,223,372,036,854,775,806 (int64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=9223372036854775806, royaltyFee.denominator=10, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with a ROYALTY_FRACTION_CANNOT_EXCEED_ONE response code from the network. | N | -| 50 | Updates a NFT's fee schedule with a royalty fee with a numerator of 9,223,372,036,854,775,808 (int64 max + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=9223372036854775808, royaltyFee.denominator=10, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 51 | Updates a NFT's fee schedule with a royalty fee with a numerator of 18,446,744,073,709,551,615 (uint64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=18446744073709551615, royaltyFee.denominator=10, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 52 | Updates a NFT's fee schedule with a royalty fee with a numerator of 18,446,744,073,709,551,614 (uint64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=18446744073709551614, royaltyFee.denominator=10, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 53 | Updates a NFT's fee schedule with a royalty fee with a numerator of -9,223,372,036,854,775,808 (int64 min) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=-9223372036854775808, royaltyFee.denominator=10, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 54 | Updates a NFT's fee schedule with a royalty fee with a numerator of -9,223,372,036,854,775,807 (int64 min + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=-9223372036854775807, royaltyFee.denominator=10, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 55 | Updates a NFT's fee schedule with a royalty fee with a denominator of 0 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=0, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with a FRACTION_DIVIDES_BY_ZERO response code from the network. | N | -| 56 | Updates a NFT's fee schedule with a royalty fee with a denominator of -1 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=-1, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 57 | Updates a NFT's fee schedule with a royalty fee with a denominator of 9,223,372,036,854,775,807 (int64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=9223372036854775807, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom royalty fee with an amount of 1 / 9,223,372,036,854,775,807. | N | -| 58 | Updates a NFT's fee schedule with a royalty fee with a denominator of 9,223,372,036,854,775,806 (int64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=9223372036854775806, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom royalty fee with an amount of 1 / 9,223,372,036,854,775,806. | N | -| 59 | Updates a NFT's fee schedule with a royalty fee with a denominator of 9,223,372,036,854,775,808 (int64 max + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=9223372036854775808, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 60 | Updates a NFT's fee schedule with a royalty fee with a denominator of 18,446,744,073,709,551,615 (uint64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=18446744073709551615, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 61 | Updates a NFT's fee schedule with a royalty fee with a denominator of 18,446,744,073,709,551,614 (uint64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=18446744073709551614, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 62 | Updates a NFT's fee schedule with a royalty fee with a denominator of -9,223,372,036,854,775,808 (int64 min) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=-9223372036854775808, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 63 | Updates a NFT's fee schedule with a royalty fee with a denominator of -9,223,372,036,854,775,807 (int64 min + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=-9223372036854775807, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 64 | Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of 0 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=10, royaltyFee.fallbackFee.amount=0}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 65 | Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of -1 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=10, royaltyFee.fallbackFee.amount=-1}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 66 | Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of 9,223,372,036,854,775,807 (int64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=10, royaltyFee.fallbackFee.amount=9223372036854775807}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom royalty fee with a fallback fee with an amount of 9,223,372,036,854,775,807. | N | -| 67 | Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of 9,223,372,036,854,775,806 (int64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=10, royaltyFee.fallbackFee.amount=9223372036854775806}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom royalty fee with a fallback fee with an amount of 9,223,372,036,854,775,806. | N | -| 68 | Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of 9,223,372,036,854,775,808 (int64 max + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=10, royaltyFee.fallbackFee.amount=9223372036854775808}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 69 | Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of 18,446,744,073,709,551,615 (uint64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=10, royaltyFee.fallbackFee.amount=18446744073709551615}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 70 | Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of 18,446,744,073,709,551,614 (uint64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=10, royaltyFee.fallbackFee.amount=18446744073709551614}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 71 | Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of -9,223,372,036,854,775,808 (int64 min) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=10, royaltyFee.fallbackFee.amount=-9223372036854775808}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 72 | Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of -9,223,372,036,854,775,807 (int64 min + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=10, royaltyFee.fallbackFee.amount=-9223372036854775807}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | -| 73 | Updates a token's fee schedule with a fixed fee with a fee collector account that doesn't exist | tokenId=, customFees=[{feeCollectorAccountId="123.456.789", feeCollectorsExempt=false, fixedFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with an INVALID_CUSTOM_FEE_COLLECTOR response code from the network. | N | -| 74 | Updates a token's fee schedule with a fractional with a fee collector account that doesn't exist | tokenId=, customFees=[{feeCollectorAccountId="123.456.789", feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with an INVALID_CUSTOM_FEE_COLLECTOR response code from the network. | N | -| 75 | Updates a NFT's fee schedule with a royalty fee with a fee collector account that doesn't exist | tokenId=, customFees=[{feeCollectorAccountId="123.456.789", feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=10, royaltyFee.fallbackFee.feeCollectorAccountId=, royaltyFee.fallbackFee.feeCollectorsExempt=false, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with an INVALID_CUSTOM_FEE_COLLECTOR response code from the network. | N | -| 76 | Updates a token's fee schedule with a fixed fee with an empty fee collector account | tokenId=, customFees=[{feeCollectorAccountId="", feeCollectorsExempt=false, fixedFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with an SDK internal error. | N | -| 77 | Updates a token's fee schedule with a fractional with an empty fee collector account | tokenId=, customFees=[{feeCollectorAccountId="", feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with an SDK internal error. | N | -| 78 | Updates a NFT's fee schedule with a royalty fee with an empty fee collector account | tokenId=, customFees=[{feeCollectorAccountId="", feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=10, royaltyFee.fallbackFee.feeCollectorAccountId=, royaltyFee.fallbackFee.feeCollectorsExempt=false, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with an SDK internal error. | N | -| 79 | Updates a token's fee schedule with a fixed fee with a deleted fee collector account | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with a INVALID_CUSTOM_FEE_COLLECTOR response code from the network. | N | -| 80 | Updates a token's fee schedule with a fractional fee with a deleted fee collector account | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a INVALID_CUSTOM_FEE_COLLECTOR response code from the network. | N | -| 81 | Updates a NFT's fee schedule with a royalty fee with a deleted fee collector account | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=10, royaltyFee.fallbackFee.feeCollectorAccountId=, royaltyFee.fallbackFee.feeCollectorsExempt=false, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[, ] | The token fee schedule update fails with a INVALID_CUSTOM_FEE_COLLECTOR response code from the network. | N | -| 82 | Updates a token's fee schedule with a fixed fee that is assessed with a token that doesn't exist | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount=10, fixedFee.denominatingTokenId="123.456.789"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a INVALID_TOKEN_ID_IN_CUSTOM_FEES response code from the network. | N | -| 83 | Updates a token's fee schedule with a fixed fee that is assessed with an empty token | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount=10, fixedFee.denominatingTokenId=""}], commonTransactionParams.signers=[] | The token fee schedule update fails with an SDK internal error. | N | -| 84 | Updates a token's fee schedule with a fixed fee that is assessed with a deleted token | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount=10, fixedFee.denominatingTokenId=}], commonTransactionParams.signers=[] | The token fee schedule update fails with a INVALID_TOKEN_ID_IN_CUSTOM_FEES response code from the network. | N | -| 85 | Updates a token's fee schedule with a fractional fee that is assessed to the receiver | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="exclusive"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fractional fee that is assessed to the receiver. | N | -| 86 | Updates a fungible token's fee schedule with a royalty fee | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator=1, royaltyFee.denominator=10, royaltyFee.fallbackFee.feeCollectorAccountId=, royaltyFee.fallbackFee.feeCollectorsExempt=false, royaltyFee.fallbackFee.amount=10}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE response code from the network. | N | -| 87 | Updates a NFT's fee schedule with a fractional fee | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator=1, fractionalFee.denominator=10, fractionalFee.minimumAmount=1, fractionalFee.maximumAmount=10, fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON response code from the network. | N | -| 88 | Updates a token's fee schedule with more than the maximum amount of fees allowed | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount=10} ... (x11)], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEES_LIST_TOO_LONG response code from the network. | N | +| 1 | Updates a token's fee schedule with a fixed fee with an amount of 0 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount="0"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 2 | Updates a token's fee schedule with a fixed fee with an amount of -1 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount="-1"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 3 | Updates a token's fee schedule with a fixed fee with an amount of 9,223,372,036,854,775,807 (int64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount="9223372036854775807"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fixed fee with an amount of 9,223,372,036,854,775,807. | N | +| 4 | Updates a token's fee schedule with a fixed fee with an amount of 9,223,372,036,854,775,806 (int64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount="9223372036854775806"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fixed fee with an amount of 9,223,372,036,854,775,806. | N | +| 5 | Updates a token's fee schedule with a fixed fee with an amount of -9,223,372,036,854,775,808 (int64 min) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount="-9223372036854775808"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 6 | Updates a token's fee schedule with a fixed fee with an amount of -9,223,372,036,854,775,807 (int64 min + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount="-9223372036854775807"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 7 | Updates a token's fee schedule with a fractional fee with a numerator of 0 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="0", fractionalFee.denominator="10", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 8 | Updates a token's fee schedule with a fractional fee with a numerator of -1 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="-1", fractionalFee.denominator="10", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 9 | Updates a token's fee schedule with a fractional fee with a numerator of 9,223,372,036,854,775,807 (int64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="9223372036854775807", fractionalFee.denominator="10", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fractional fee with an amount of 9,223,372,036,854,775,807 / 10. | N | +| 10 | Updates a token's fee schedule with a fractional fee with a numerator of 9,223,372,036,854,775,806 (int64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="9223372036854775806", fractionalFee.denominator="10", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fractional fee with an amount of 9,223,372,036,854,775,806 / 10. | N | +| 11 | Updates a token's fee schedule with a fractional fee with a numerator of -9,223,372,036,854,775,808 (int64 min) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="-9223372036854775808", fractionalFee.denominator="10", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 12 | Updates a token's fee schedule with a fractional fee with a numerator of -9,223,372,036,854,775,807 (int64 min + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="-9223372036854775807", fractionalFee.denominator="10", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 13 | Updates a token's fee schedule with a fractional fee with a denominator of 0 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="0", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a FRACTION_DIVIDES_BY_ZERO response code from the network. | N | +| 14 | Updates a token's fee schedule with a fractional fee with a denominator of -1 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="-1", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 15 | Updates a token's fee schedule with a fractional fee with a denominator of 9,223,372,036,854,775,807 (int64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="9223372036854775807", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fractional fee with an amount of 1 / 9,223,372,036,854,775,807. | N | +| 16 | Updates a token's fee schedule with a fractional fee with a denominator of 9,223,372,036,854,775,806 (int64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="9223372036854775806", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fractional fee with an amount of 1 / 9,223,372,036,854,775,806. | N | +| 17 | Updates a token's fee schedule with a fractional fee with a denominator of -9,223,372,036,854,775,808 (int64 min) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="-9223372036854775808", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 18 | Updates a token's fee schedule with a fractional fee with a denominator of -9,223,372,036,854,775,807 (int64 min + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="-9223372036854775807", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 19 | Updates a token's fee schedule with a fractional fee with a minimum amount of 0 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="10", fractionalFee.minimumAmount="0", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fractional fee with a minimum amount of 0. | N | +| 20 | Updates a token's fee schedule with a fractional fee with a minimum amount of -1 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="10", fractionalFee.minimumAmount="-1", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 21 | Updates a token's fee schedule with a fractional fee with a minimum amount of 9,223,372,036,854,775,807 (int64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="10", fractionalFee.minimumAmount="9223372036854775807", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT response code from the network. | N | +| 22 | Updates a token's fee schedule with a fractional fee with a minimum amount of 9,223,372,036,854,775,806 (int64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="10", fractionalFee.minimumAmount="9223372036854775806", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT response code from the network. | N | +| 23 | Updates a token's fee schedule with a fractional fee with a minimum amount of -9,223,372,036,854,775,808 (int64 min) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="10", fractionalFee.minimumAmount="-9223372036854775808", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 24 | Updates a token's fee schedule with a fractional fee with a minimum amount of -9,223,372,036,854,775,807 (int64 min + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="10", fractionalFee.minimumAmount="-9223372036854775807", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 25 | Updates a token's fee schedule with a fractional fee with a maximum amount of 0 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="10", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="0", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fractional fee with a maximum amount of 0 (unlimited). | N | +| 26 | Updates a token's fee schedule with a fractional fee with a maximum amount of -1 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="10", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="-1", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 27 | Updates a token's fee schedule with a fractional fee with a maximum amount of 9,223,372,036,854,775,807 (int64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="10", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="9223372036854775807", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fractional fee with a maximum amount of 9,223,372,036,854,775,807. | N | +| 28 | Updates a token's fee schedule with a fractional fee with a maximum amount of 9,223,372,036,854,775,806 (int64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="10", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="9223372036854775806", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fractional fee with a maximum amount of 9,223,372,036,854,775,806. | N | +| 29 | Updates a token's fee schedule with a fractional fee with a maximum amount of -9,223,372,036,854,775,808 (int64 min) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="10", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="-9223372036854775808", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 30 | Updates a token's fee schedule with a fractional fee with a maximum amount of -9,223,372,036,854,775,807 (int64 min + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="10", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="-9223372036854775807", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 31 | Updates a NFT's fee schedule with a royalty fee with a numerator of 0 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator="0", royaltyFee.denominator="10", royaltyFee.fallbackFee.amount="10"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 32 | Updates a NFT's fee schedule with a royalty fee with a numerator of -1 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator="-1", royaltyFee.denominator="10", royaltyFee.fallbackFee.amount="10"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 33 | Updates a NFT's fee schedule with a royalty fee with a numerator of 9,223,372,036,854,775,807 (int64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator="9223372036854775807", royaltyFee.denominator="10", royaltyFee.fallbackFee.amount="10"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a ROYALTY_FRACTION_CANNOT_EXCEED_ONE response code from the network. | N | +| 34 | Updates a NFT's fee schedule with a royalty fee with a numerator of 9,223,372,036,854,775,806 (int64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator="9223372036854775806", royaltyFee.denominator="10", royaltyFee.fallbackFee.amount="10"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a ROYALTY_FRACTION_CANNOT_EXCEED_ONE response code from the network. | N | +| 35 | Updates a NFT's fee schedule with a royalty fee with a numerator of -9,223,372,036,854,775,808 (int64 min) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator="-9223372036854775808", royaltyFee.denominator="10", royaltyFee.fallbackFee.amount="10"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 36 | Updates a NFT's fee schedule with a royalty fee with a numerator of -9,223,372,036,854,775,807 (int64 min + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator="-9223372036854775807", royaltyFee.denominator="10", royaltyFee.fallbackFee.amount="10"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 37 | Updates a NFT's fee schedule with a royalty fee with a denominator of 0 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator="1", royaltyFee.denominator="0", royaltyFee.fallbackFee.amount="10"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a FRACTION_DIVIDES_BY_ZERO response code from the network. | N | +| 38 | Updates a NFT's fee schedule with a royalty fee with a denominator of -1 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator="1", royaltyFee.denominator="-1", royaltyFee.fallbackFee.amount="10"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 39 | Updates a NFT's fee schedule with a royalty fee with a denominator of 9,223,372,036,854,775,807 (int64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator="1", royaltyFee.denominator="9223372036854775807", royaltyFee.fallbackFee.amount="10"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom royalty fee with an amount of 1 / 9,223,372,036,854,775,807. | N | +| 40 | Updates a NFT's fee schedule with a royalty fee with a denominator of 9,223,372,036,854,775,806 (int64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator="1", royaltyFee.denominator="9223372036854775806", royaltyFee.fallbackFee.amount="10"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom royalty fee with an amount of 1 / 9,223,372,036,854,775,806. | N | +| 41 | Updates a NFT's fee schedule with a royalty fee with a denominator of -9,223,372,036,854,775,808 (int64 min) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator="1", royaltyFee.denominator="-9223372036854775808", royaltyFee.fallbackFee.amount="10"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 42 | Updates a NFT's fee schedule with a royalty fee with a denominator of -9,223,372,036,854,775,807 (int64 min + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator="1", royaltyFee.denominator="-9223372036854775807", royaltyFee.fallbackFee.amount="10"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 43 | Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of 0 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator="1", royaltyFee.denominator="10", royaltyFee.fallbackFee.amount="0"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 44 | Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of -1 | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator="1", royaltyFee.denominator="10", royaltyFee.fallbackFee.amount="-1"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 45 | Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of 9,223,372,036,854,775,807 (int64 max) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator="1", royaltyFee.denominator="10", royaltyFee.fallbackFee.amount="9223372036854775807"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom royalty fee with a fallback fee with an amount of 9,223,372,036,854,775,807. | N | +| 46 | Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of 9,223,372,036,854,775,806 (int64 max - 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator="1", royaltyFee.denominator="10", royaltyFee.fallbackFee.amount="9223372036854775806"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom royalty fee with a fallback fee with an amount of 9,223,372,036,854,775,806. | N | +| 47 | Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of -9,223,372,036,854,775,808 (int64 min) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator="1", royaltyFee.denominator="10", royaltyFee.fallbackFee.amount="-9223372036854775808"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 48 | Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of -9,223,372,036,854,775,807 (int64 min + 1) | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator="1", royaltyFee.denominator="10", royaltyFee.fallbackFee.amount="-9223372036854775807"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEE_MUST_BE_POSITIVE response code from the network. | N | +| 49 | Updates a token's fee schedule with a fixed fee with a fee collector account that doesn't exist | tokenId=, customFees=[{feeCollectorAccountId="123.456.789", feeCollectorsExempt=false, fixedFee.amount="10"}], commonTransactionParams.signers=[] | The token fee schedule update fails with an INVALID_CUSTOM_FEE_COLLECTOR response code from the network. | N | +| 50 | Updates a token's fee schedule with a fractional with a fee collector account that doesn't exist | tokenId=, customFees=[{feeCollectorAccountId="123.456.789", feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="10", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with an INVALID_CUSTOM_FEE_COLLECTOR response code from the network. | N | +| 51 | Updates a NFT's fee schedule with a royalty fee with a fee collector account that doesn't exist | tokenId=, customFees=[{feeCollectorAccountId="123.456.789", feeCollectorsExempt=false, royaltyFee.numerator="1", royaltyFee.denominator="10", royaltyFee.fallbackFee.feeCollectorAccountId=, royaltyFee.fallbackFee.feeCollectorsExempt=false, royaltyFee.fallbackFee.amount="10"}], commonTransactionParams.signers=[] | The token fee schedule update fails with an INVALID_CUSTOM_FEE_COLLECTOR response code from the network. | N | +| 52 | Updates a token's fee schedule with a fixed fee with an empty fee collector account | tokenId=, customFees=[{feeCollectorAccountId="", feeCollectorsExempt=false, fixedFee.amount="10"}], commonTransactionParams.signers=[] | The token fee schedule update fails with an SDK internal error. | N | +| 53 | Updates a token's fee schedule with a fractional with an empty fee collector account | tokenId=, customFees=[{feeCollectorAccountId="", feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="10", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with an SDK internal error. | N | +| 54 | Updates a NFT's fee schedule with a royalty fee with an empty fee collector account | tokenId=, customFees=[{feeCollectorAccountId="", feeCollectorsExempt=false, royaltyFee.numerator="1", royaltyFee.denominator="10", royaltyFee.fallbackFee.feeCollectorAccountId=, royaltyFee.fallbackFee.feeCollectorsExempt=false, royaltyFee.fallbackFee.amount="10"}], commonTransactionParams.signers=[] | The token fee schedule update fails with an SDK internal error. | N | +| 55 | Updates a token's fee schedule with a fixed fee with a deleted fee collector account | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount="10"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a INVALID_CUSTOM_FEE_COLLECTOR response code from the network. | N | +| 56 | Updates a token's fee schedule with a fractional fee with a deleted fee collector account | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="10", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a INVALID_CUSTOM_FEE_COLLECTOR response code from the network. | N | +| 57 | Updates a NFT's fee schedule with a royalty fee with a deleted fee collector account | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator="1", royaltyFee.denominator="10", royaltyFee.fallbackFee.feeCollectorAccountId=, royaltyFee.fallbackFee.feeCollectorsExempt=false, royaltyFee.fallbackFee.amount="10"}], commonTransactionParams.signers=[, ] | The token fee schedule update fails with a INVALID_CUSTOM_FEE_COLLECTOR response code from the network. | N | +| 58 | Updates a token's fee schedule with a fixed fee that is assessed with a token that doesn't exist | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount="10", fixedFee.denominatingTokenId="123.456.789"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a INVALID_TOKEN_ID_IN_CUSTOM_FEES response code from the network. | N | +| 59 | Updates a token's fee schedule with a fixed fee that is assessed with an empty token | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount="10", fixedFee.denominatingTokenId=""}], commonTransactionParams.signers=[] | The token fee schedule update fails with an SDK internal error. | N | +| 60 | Updates a token's fee schedule with a fixed fee that is assessed with a deleted token | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount="10", fixedFee.denominatingTokenId=}], commonTransactionParams.signers=[] | The token fee schedule update fails with a INVALID_TOKEN_ID_IN_CUSTOM_FEES response code from the network. | N | +| 61 | Updates a token's fee schedule with a fractional fee that is assessed to the receiver | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="10", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="exclusive"}], commonTransactionParams.signers=[] | The token fee schedule update succeeds and the token has the custom fractional fee that is assessed to the receiver. | N | +| 62 | Updates a fungible token's fee schedule with a royalty fee | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, royaltyFee.numerator="1", royaltyFee.denominator="10", royaltyFee.fallbackFee.feeCollectorAccountId=, royaltyFee.fallbackFee.feeCollectorsExempt=false, royaltyFee.fallbackFee.amount="10"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE response code from the network. | N | +| 63 | Updates a NFT's fee schedule with a fractional fee | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fractionalFee.numerator="1", fractionalFee.denominator="10", fractionalFee.minimumAmount="1", fractionalFee.maximumAmount="10", fractionalFee.assessmentMethod="inclusive"}], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON response code from the network. | N | +| 64 | Updates a token's fee schedule with more than the maximum amount of fees allowed | tokenId=, customFees=[{feeCollectorAccountId=, feeCollectorsExempt=false, fixedFee.amount="10"} ... (x11)], commonTransactionParams.signers=[] | The token fee schedule update fails with a CUSTOM_FEES_LIST_TOO_LONG response code from the network. | N | #### JSON Request Example @@ -194,7 +170,7 @@ The tests contained in this specification will assume that two valid tokens have "feeCollectorAccountId": "0.0.2", "feeCollectorsExempt": false, "fee": { - "amount": 10, + "amount": "10", "denominatingTokenId": "0.0.10" } } diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..c64a6dc --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,33 @@ +import { defineConfig } from "eslint-define-config"; +import typescriptEslintPlugin from "@typescript-eslint/eslint-plugin"; +import typescriptEslintParser from "@typescript-eslint/parser"; +import prettierPlugin from "eslint-plugin-prettier"; + +export default defineConfig([ + { + files: ["**/*.js", "**/*.ts", "**/*.tsx"], + languageOptions: { + parser: typescriptEslintParser, + parserOptions: { + ecmaVersion: "latest", + sourceType: "module", + }, + }, + plugins: { + "@typescript-eslint": typescriptEslintPlugin, + prettier: prettierPlugin, + }, + ignores: ["mochawesome-report/assets/app.js"], + rules: { + "no-console": ["warn", { allow: ["warn"] }], + "prefer-const": "error", + semi: ["error", "always"], + curly: ["error", "all"], + eqeqeq: ["error", "always"], + "no-multi-spaces": ["error"], + "no-duplicate-imports": ["error"], + "prettier/prettier": "error", + "@typescript-eslint/no-unused-vars": ["warn"], + }, + }, +]); diff --git a/package-lock.json b/package-lock.json index b7ad83e..6d4d522 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,16 +9,18 @@ "axios": "^1.6.0", "chai": "^4.3.6", "dotenv": "^16.0.1", + "json-bigint": "^1.0.0", "json-rpc-2.0": "^1.6.0", "mocha": "^9.2.2" }, "devDependencies": { "@types/chai": "^5.0.1", + "@types/json-bigint": "^1.0.4", "@types/mocha": "^10.0.10", "@types/node": "^22.9.1", - "@typescript-eslint/eslint-plugin": "^8.15.0", - "@typescript-eslint/parser": "^8.15.0", - "eslint": "^9.15.0", + "@typescript-eslint/eslint-plugin": "^8.18.0", + "@typescript-eslint/parser": "^8.18.0", + "eslint": "^9.17.0", "eslint-config-prettier": "^9.1.0", "eslint-define-config": "^2.1.0", "eslint-plugin-prettier": "^5.2.1", @@ -157,9 +159,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.15.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.15.0.tgz", - "integrity": "sha512-tMTqrY+EzbXmKJR5ToI8lxu7jaN5EdmrBFJpQk5JmSlyLsx6o4t27r883K5xsLuCYCpfKBCGswMSWXsM+jB7lg==", + "version": "9.17.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.17.0.tgz", + "integrity": "sha512-Sxc4hqcs1kTu0iID3kcZDW3JHq2a77HO9P8CP6YEA/FpH3Ll8UXE2r/86Rz9YJLKme39S9vU5OWNjC6Xl0Cr3w==", "dev": true, "license": "MIT", "engines": { @@ -965,6 +967,13 @@ "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true }, + "node_modules/@types/json-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@types/json-bigint/-/json-bigint-1.0.4.tgz", + "integrity": "sha512-ydHooXLbOmxBbubnA7Eh+RpBzuaIiQjh8WGJYQB50JFGFrdxW7JzVlyEV7fAXw0T2sqJ1ysTneJbiyNLqZRAag==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -993,17 +1002,17 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.15.0.tgz", - "integrity": "sha512-+zkm9AR1Ds9uLWN3fkoeXgFppaQ+uEVtfOV62dDmsy9QCNqlRHWNEck4yarvRNrvRcHQLGfqBNui3cimoz8XAg==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.18.0.tgz", + "integrity": "sha512-NR2yS7qUqCL7AIxdJUQf2MKKNDVNaig/dEB0GBLU7D+ZdHgK1NoH/3wsgO3OnPVipn51tG3MAwaODEGil70WEw==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.15.0", - "@typescript-eslint/type-utils": "8.15.0", - "@typescript-eslint/utils": "8.15.0", - "@typescript-eslint/visitor-keys": "8.15.0", + "@typescript-eslint/scope-manager": "8.18.0", + "@typescript-eslint/type-utils": "8.18.0", + "@typescript-eslint/utils": "8.18.0", + "@typescript-eslint/visitor-keys": "8.18.0", "graphemer": "^1.4.0", "ignore": "^5.3.1", "natural-compare": "^1.4.0", @@ -1018,25 +1027,21 @@ }, "peerDependencies": { "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0", - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/parser": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.15.0.tgz", - "integrity": "sha512-7n59qFpghG4uazrF9qtGKBZXn7Oz4sOMm8dwNWDQY96Xlm2oX67eipqcblDj+oY1lLCbf1oltMZFpUso66Kl1A==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.18.0.tgz", + "integrity": "sha512-hgUZ3kTEpVzKaK3uNibExUYm6SKKOmTU2BOxBSvOYwtJEPdVQ70kZJpPjstlnhCHcuc2WGfSbpKlb/69ttyN5Q==", "dev": true, - "license": "BSD-2-Clause", + "license": "MITClause", "dependencies": { - "@typescript-eslint/scope-manager": "8.15.0", - "@typescript-eslint/types": "8.15.0", - "@typescript-eslint/typescript-estree": "8.15.0", - "@typescript-eslint/visitor-keys": "8.15.0", + "@typescript-eslint/scope-manager": "8.18.0", + "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/typescript-estree": "8.18.0", + "@typescript-eslint/visitor-keys": "8.18.0", "debug": "^4.3.4" }, "engines": { @@ -1047,12 +1052,8 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/parser/node_modules/debug": { @@ -1074,14 +1075,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.15.0.tgz", - "integrity": "sha512-QRGy8ADi4J7ii95xz4UoiymmmMd/zuy9azCaamnZ3FM8T5fZcex8UfJcjkiEZjJSztKfEBe3dZ5T/5RHAmw2mA==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.18.0.tgz", + "integrity": "sha512-PNGcHop0jkK2WVYGotk/hxj+UFLhXtGPiGtiaWgVBVP1jhMoMCHlTyJA+hEj4rszoSdLTK3fN4oOatrL0Cp+Xw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.15.0", - "@typescript-eslint/visitor-keys": "8.15.0" + "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/visitor-keys": "8.18.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1092,14 +1093,14 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.15.0.tgz", - "integrity": "sha512-UU6uwXDoI3JGSXmcdnP5d8Fffa2KayOhUUqr/AiBnG1Gl7+7ut/oyagVeSkh7bxQ0zSXV9ptRh/4N15nkCqnpw==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.18.0.tgz", + "integrity": "sha512-er224jRepVAVLnMF2Q7MZJCq5CsdH2oqjP4dT7K6ij09Kyd+R21r7UVJrF0buMVdZS5QRhDzpvzAxHxabQadow==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/typescript-estree": "8.15.0", - "@typescript-eslint/utils": "8.15.0", + "@typescript-eslint/typescript-estree": "8.18.0", + "@typescript-eslint/utils": "8.18.0", "debug": "^4.3.4", "ts-api-utils": "^1.3.0" }, @@ -1111,18 +1112,14 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/type-utils/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -1138,9 +1135,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.15.0.tgz", - "integrity": "sha512-n3Gt8Y/KyJNe0S3yDCD2RVKrHBC4gTUcLTebVBXacPy091E6tNspFLKRXlk3hwT4G55nfr1n2AdFqi/XMxzmPQ==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.18.0.tgz", + "integrity": "sha512-FNYxgyTCAnFwTrzpBGq+zrnoTO4x0c1CKYY5MuUTzpScqmY5fmsh2o3+57lqdI3NZucBDCzDgdEbIaNfAjAHQA==", "dev": true, "license": "MIT", "engines": { @@ -1152,14 +1149,14 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.15.0.tgz", - "integrity": "sha512-1eMp2JgNec/niZsR7ioFBlsh/Fk0oJbhaqO0jRyQBMgkz7RrFfkqF9lYYmBoGBaSiLnu8TAPQTwoTUiSTUW9dg==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.18.0.tgz", + "integrity": "sha512-rqQgFRu6yPkauz+ms3nQpohwejS8bvgbPyIDq13cgEDbkXt4LH4OkDMT0/fN1RUtzG8e8AKJyDBoocuQh8qNeg==", "dev": true, - "license": "BSD-2-Clause", + "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.15.0", - "@typescript-eslint/visitor-keys": "8.15.0", + "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/visitor-keys": "8.18.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -1174,10 +1171,8 @@ "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "peerDependencies": { + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { @@ -1191,9 +1186,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", "dev": true, "license": "MIT", "dependencies": { @@ -1225,16 +1220,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.15.0.tgz", - "integrity": "sha512-k82RI9yGhr0QM3Dnq+egEpz9qB6Un+WLYhmoNcvl8ltMEededhh7otBVVIDDsEEttauwdY/hQoSsOv13lxrFzQ==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.18.0.tgz", + "integrity": "sha512-p6GLdY383i7h5b0Qrfbix3Vc3+J2k6QWw6UMUeY5JGfm3C5LbZ4QIZzJNoNOfgyRe0uuYKjvVOsO/jD4SJO+xg==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", - "@typescript-eslint/scope-manager": "8.15.0", - "@typescript-eslint/types": "8.15.0", - "@typescript-eslint/typescript-estree": "8.15.0" + "@typescript-eslint/scope-manager": "8.18.0", + "@typescript-eslint/types": "8.18.0", + "@typescript-eslint/typescript-estree": "8.18.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1244,22 +1239,18 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^8.57.0 || ^9.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <5.8.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.15.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.15.0.tgz", - "integrity": "sha512-h8vYOulWec9LhpwfAdZf2bjr8xIp0KNKnpgqSz0qqYYKAW/QZKw3ktRndbiAtUz4acH4QLQavwZBYCc0wulA/Q==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.18.0.tgz", + "integrity": "sha512-pCh/qEA8Lb1wVIqNvBke8UaRjJ6wrAWkJO5yyIbs8Yx6TNGYyfNjOo61tLv+WwLvoLPp4BQ8B7AHKijl8NGUfw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.15.0", + "@typescript-eslint/types": "8.18.0", "eslint-visitor-keys": "^4.2.0" }, "engines": { @@ -1847,9 +1838,9 @@ } }, "node_modules/eslint": { - "version": "9.15.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.15.0.tgz", - "integrity": "sha512-7CrWySmIibCgT1Os28lUU6upBshZ+GxybLOrmRzi08kS8MBuO8QA7pXEgYgY5W8vK3e74xv0lpjo9DbaGU9Rkw==", + "version": "9.17.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.17.0.tgz", + "integrity": "sha512-evtlNcpJg+cZLcnVKwsai8fExnqjGPicK7gnUtlNuzu+Fv9bI0aLpND5T44VLQtoMEnI57LoXO9XAkIXwohKrA==", "dev": true, "license": "MIT", "dependencies": { @@ -1858,7 +1849,7 @@ "@eslint/config-array": "^0.19.0", "@eslint/core": "^0.9.0", "@eslint/eslintrc": "^3.2.0", - "@eslint/js": "9.15.0", + "@eslint/js": "9.17.0", "@eslint/plugin-kit": "^0.2.3", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", @@ -1867,7 +1858,7 @@ "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", - "cross-spawn": "^7.0.5", + "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^8.2.0", @@ -2668,6 +2659,15 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "license": "MIT", + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, "node_modules/json-buffer": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", diff --git a/package.json b/package.json index e4d630c..15ca751 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "axios": "^1.6.0", "chai": "^4.3.6", "dotenv": "^16.0.1", + "json-bigint": "^1.0.0", "json-rpc-2.0": "^1.6.0", "mocha": "^9.2.2" }, @@ -15,11 +16,12 @@ }, "devDependencies": { "@types/chai": "^5.0.1", + "@types/json-bigint": "^1.0.4", "@types/mocha": "^10.0.10", "@types/node": "^22.9.1", - "@typescript-eslint/eslint-plugin": "^8.15.0", - "@typescript-eslint/parser": "^8.15.0", - "eslint": "^9.15.0", + "@typescript-eslint/eslint-plugin": "^8.18.0", + "@typescript-eslint/parser": "^8.18.0", + "eslint": "^9.17.0", "eslint-config-prettier": "^9.1.0", "eslint-define-config": "^2.1.0", "eslint-plugin-prettier": "^5.2.1", diff --git a/src/tests/token-service/test-token-create-transaction.ts b/src/tests/token-service/test-token-create-transaction.ts index 38fa19c..36ce164 100644 --- a/src/tests/token-service/test-token-create-transaction.ts +++ b/src/tests/token-service/test-token-create-transaction.ts @@ -11,6 +11,7 @@ import { verifyTokenKeyList, verifyTokenExpirationTimeUpdate, } from "@helpers/verify-token-tx"; + import { verifyTokenCreationWithFixedFee, verifyTokenCreationWithFractionalFee, @@ -1812,7 +1813,7 @@ describe("TokenCreateTransaction", function () { Math.floor(Date.now() / 1000) + 5184000 ).toString(); - const response = await JSONRPCRequest(this, "createToken", { + await JSONRPCRequest(this, "createToken", { name: "testname", symbol: "testsymbol", treasuryAccountId: process.env.OPERATOR_ACCOUNT_ID, @@ -1877,7 +1878,7 @@ describe("TokenCreateTransaction", function () { ).toString(); // Create the token with the calculated expiration time in ISO format - const response = await JSONRPCRequest(this, "createToken", { + await JSONRPCRequest(this, "createToken", { name: "testname", symbol: "testsymbol", treasuryAccountId: process.env.OPERATOR_ACCOUNT_ID, @@ -3228,7 +3229,7 @@ describe("TokenCreateTransaction", function () { assert.fail("Should throw an error"); }); - it.skip("(#19) Creates a token with a fractional fee with a minimum amount of 0", async function () { + it("(#19) Creates a token with a fractional fee with a minimum amount of 0", async function () { const feeCollectorAccountId = process.env.OPERATOR_ACCOUNT_ID as string; const feeCollectorsExempt = false; const numerator = "1"; @@ -3413,7 +3414,7 @@ describe("TokenCreateTransaction", function () { assert.fail("Should throw an error"); }); - it.skip("(#25) Creates a token with a fractional fee with a maximum amount of 0", async function () { + it("(#25) Creates a token with a fractional fee with a maximum amount of 0", async function () { const feeCollectorAccountId = process.env.OPERATOR_ACCOUNT_ID as string; const feeCollectorsExempt = false; const numerator = "1"; @@ -4734,7 +4735,7 @@ describe("TokenCreateTransaction", function () { assert.fail("Should throw an error"); }); - it.skip("(#62) Creates a token with a fractional fee that is assessed to the receiver", async function () { + it("(#62) Creates a token with a fractional fee that is assessed to the receiver", async function () { const feeCollectorAccountId = process.env.OPERATOR_ACCOUNT_ID as string; const feeCollectorsExempt = false; const numerator = "1"; diff --git a/src/tests/token-service/test-token-fee-schedule-update-transaction.ts b/src/tests/token-service/test-token-fee-schedule-update-transaction.ts new file mode 100644 index 0000000..a2a8922 --- /dev/null +++ b/src/tests/token-service/test-token-fee-schedule-update-transaction.ts @@ -0,0 +1,2356 @@ +import { assert, expect } from "chai"; + +import { JSONRPCRequest } from "@services/Client"; +import mirrorNodeClient from "@services/MirrorNodeClient"; +import consensusInfoClient from "@services/ConsensusInfoClient"; + +import { setOperator } from "@helpers/setup-tests"; +import { retryOnError } from "@helpers/retry-on-error"; + +import { + verifyTokenCreationWithFixedFee, + verifyTokenCreationWithFractionalFee, + verifyTokenCreationWithRoyaltyFee, +} from "@helpers/custom-fees"; + +/** + * Tests for TokenFeeScheduleUpdateTransaction + */ +describe("TokenFeeScheduleUpdateTransaction", function () { + // Tests should not take longer than 30 seconds to fully execute. + this.timeout(30000); + + // Initial token parameters. + const testTokenName = "testname"; + const testTokenSymbol = "testsymbol"; + const testTreasuryAccountId = process.env.OPERATOR_ACCOUNT_ID as string; + + // Create an immutable token. + let fungibleTokenId: string, + fungibleTokenFeeScheduleKey: string, + nonFungibleTokenId: string, + nonFungibleTokenFeeScheduleKey: string; + + beforeEach(async function () { + await setOperator( + this, + process.env.OPERATOR_ACCOUNT_ID as string as string, + process.env.OPERATOR_ACCOUNT_PRIVATE_KEY as string, + ); + + // Generate an immutable fungible token. + let response = await JSONRPCRequest(this, "generateKey", { + type: "ecdsaSecp256k1PrivateKey", + }); + + fungibleTokenFeeScheduleKey = response.key; + + response = await JSONRPCRequest(this, "createToken", { + name: testTokenName, + symbol: testTokenSymbol, + treasuryAccountId: testTreasuryAccountId, + tokenType: "ft", + feeScheduleKey: fungibleTokenFeeScheduleKey, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fixedFee: { + amount: "10", + }, + }, + ], + }); + + fungibleTokenId = response.tokenId; + + // Generate an immutable non-fungible token. + response = await JSONRPCRequest(this, "generateKey", { + type: "ed25519PrivateKey", + }); + nonFungibleTokenFeeScheduleKey = response.key; + + // Generate its supply key. + response = await JSONRPCRequest(this, "generateKey", { + type: "ed25519PrivateKey", + }); + const nftSupplyKey = response.key; + + response = await JSONRPCRequest(this, "createToken", { + name: testTokenName, + symbol: testTokenSymbol, + treasuryAccountId: testTreasuryAccountId, + tokenType: "nft", + supplyKey: nftSupplyKey, + feeScheduleKey: nonFungibleTokenFeeScheduleKey, + }); + nonFungibleTokenId = response.tokenId; + }); + + afterEach(async function () { + await JSONRPCRequest(this, "reset"); + }); + + describe("Token ID", function () { + async function verifyTokenFeeScheduleUpdate(tokenId: string) { + const consensusNodeData = await consensusInfoClient.getTokenInfo(tokenId); + const mirrorNodeData = await mirrorNodeClient.getTokenData(tokenId); + + expect(tokenId).to.be.equal(consensusNodeData.tokenId.toString()); + expect(tokenId).to.be.equal(mirrorNodeData.token_id); + } + + it("(#1) Updates a token's fee schedule to be empty", async function () { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + + await retryOnError(async () => + verifyTokenFeeScheduleUpdate(fungibleTokenId), + ); + }); + + it("(#2) Updates a token's fee schedule to be empty when it is already empty", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_SCHEDULE_ALREADY_HAS_NO_FEES"); + return; + } + + assert.fail("Should throw an error"); + }); + + // Check for a bug in services + it.skip("(#3) Updates a token's fee schedule with a token ID that doesn't exist", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: "123.456.789", + }); + } catch (err: any) { + assert.equal(err.data.status, "INVALID_TOKEN_ID"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#4) Updates a token's fee schedule with a token ID that isn't set", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: "", + }); + } catch (err: any) { + assert.equal(err.code, -32603); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#5) Updates a token's fee schedule with a token ID that is deleted", async function () { + let response = await JSONRPCRequest(this, "generateKey", { + type: "ed25519PrivateKey", + }); + + const key = response.key; + + response = await JSONRPCRequest(this, "createToken", { + name: testTokenName, + symbol: testTokenSymbol, + treasuryAccountId: testTreasuryAccountId, + adminKey: key, + commonTransactionParams: { + signers: [key], + }, + }); + + const tokenId = response.tokenId; + + response = await JSONRPCRequest(this, "deleteToken", { + tokenId: tokenId, + commonTransactionParams: { + signers: [key], + }, + }); + + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: tokenId, + }); + } catch (err: any) { + assert.equal(err.data.status, "TOKEN_WAS_DELETED"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#6) Updates a token's fee schedule with no token ID", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", {}); + } catch (err: any) { + assert.equal(err.data.status, "INVALID_TOKEN_ID"); + return; + } + + assert.fail("Should throw an error"); + }); + }); + + describe("Custom Fees", function () { + it("(#1) Updates a token's fee schedule with a fixed fee with an amount of 0", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fixedFee: { + amount: "0", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#2) Updates a token's fee schedule with a fixed fee with an amount of -1", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fixedFee: { + amount: "-1", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#3) Updates a token's fee schedule with a fixed fee with an amount of 9,223,372,036,854,775,807 (int64 max)", async function () { + const feeCollectorAccountId = process.env + .OPERATOR_ACCOUNT_ID as string as string; + const feeCollectorsExempt = false; + const amount = "9223372036854775807"; + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId, + feeCollectorsExempt, + fixedFee: { + amount, + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + + await retryOnError(async () => + verifyTokenCreationWithFixedFee( + fungibleTokenId, + feeCollectorAccountId, + feeCollectorsExempt, + amount, + ), + ); + }); + + it("(#4) Updates a token's fee schedule with a fixed fee with an amount of 9,223,372,036,854,775,806 (int64 max - 1)", async function () { + const feeCollectorAccountId = process.env.OPERATOR_ACCOUNT_ID as string; + const feeCollectorsExempt = false; + const amount = "9223372036854775806"; + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId, + feeCollectorsExempt, + fixedFee: { + amount, + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + + await retryOnError(async () => + verifyTokenCreationWithFixedFee( + fungibleTokenId, + feeCollectorAccountId, + feeCollectorsExempt, + amount, + ), + ); + }); + + it("(#5) Updates a token's fee schedule with a fixed fee with an amount of -9,223,372,036,854,775,808 (int64 min)", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fixedFee: { + amount: "-9223372036854775808", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#6) Updates a token's fee schedule with a fixed fee with an amount of -9,223,372,036,854,775,807 (int64 min + 1)", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fixedFee: { + amount: "-9223372036854775807", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#7) Updates a token's fee schedule with a fractional fee with a numerator of 0", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fractionalFee: { + numerator: "0", + denominator: "10", + minimumAmount: "1", + maximumAmount: "10", + assessmentMethod: "inclusive", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#8) Updates a token's fee schedule with a fractional fee with a numerator of -1", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fractionalFee: { + numerator: "-1", + denominator: "10", + minimumAmount: "1", + maximumAmount: "10", + assessmentMethod: "inclusive", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#9) Updates a token's fee schedule with a fractional fee with a numerator of 9,223,372,036,854,775,807 (int64 max)", async function () { + const feeCollectorAccountId = process.env + .OPERATOR_ACCOUNT_ID as string as string; + const feeCollectorsExempt = false; + const numerator = "9223372036854775807"; + const denominator = "10"; + const minimumAmount = "1"; + const maximumAmount = "10"; + const assessmentMethod = "inclusive"; + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId, + feeCollectorsExempt, + fractionalFee: { + numerator, + denominator, + minimumAmount, + maximumAmount, + assessmentMethod, + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + + await retryOnError(async () => + verifyTokenCreationWithFractionalFee( + fungibleTokenId, + feeCollectorAccountId, + feeCollectorsExempt, + numerator, + denominator, + minimumAmount, + maximumAmount, + assessmentMethod, + ), + ); + }); + + it("(#10) Updates a token's fee schedule with a fractional fee with a numerator of 9,223,372,036,854,775,806 (int64 max - 1)", async function () { + const feeCollectorAccountId = process.env.OPERATOR_ACCOUNT_ID as string; + const feeCollectorsExempt = false; + const numerator = "9223372036854775806"; + const denominator = "10"; + const minimumAmount = "1"; + const maximumAmount = "10"; + const assessmentMethod = "inclusive"; + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId, + feeCollectorsExempt, + fractionalFee: { + numerator, + denominator, + minimumAmount, + maximumAmount, + assessmentMethod, + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + + await retryOnError(async () => + verifyTokenCreationWithFractionalFee( + fungibleTokenId, + feeCollectorAccountId, + feeCollectorsExempt, + numerator, + denominator, + minimumAmount, + maximumAmount, + assessmentMethod, + ), + ); + }); + + it("(#11) Updates a token's fee schedule with a fractional fee with a numerator of -9,223,372,036,854,775,808 (int64 min)", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fractionalFee: { + numerator: "-9223372036854775808", + denominator: "10", + minimumAmount: "1", + maximumAmount: "10", + assessmentMethod: "inclusive", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#12) Updates a token's fee schedule with a fractional fee with a numerator of -9,223,372,036,854,775,807 (int64 min + 1)", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fractionalFee: { + numerator: "-9223372036854775807", + denominator: "10", + minimumAmount: "1", + maximumAmount: "10", + assessmentMethod: "inclusive", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#13) Updates a token's fee schedule with a fractional fee with a denominator of 0", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fractionalFee: { + numerator: "1", + denominator: "0", + minimumAmount: "1", + maximumAmount: "10", + assessmentMethod: "inclusive", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "FRACTION_DIVIDES_BY_ZERO"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#14) Updates a token's fee schedule with a fractional fee with a denominator of -1", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fractionalFee: { + numerator: "1", + denominator: "-1", + minimumAmount: "1", + maximumAmount: "10", + assessmentMethod: "inclusive", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#15) Updates a token's fee schedule with a fractional fee with a denominator of 9,223,372,036,854,775,807 (int64 max)", async function () { + const feeCollectorAccountId = process.env.OPERATOR_ACCOUNT_ID as string; + const feeCollectorsExempt = false; + const numerator = "1"; + const denominator = "9223372036854775807"; + const minimumAmount = "1"; + const maximumAmount = "10"; + const assessmentMethod = "inclusive"; + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId, + feeCollectorsExempt, + fractionalFee: { + numerator, + denominator, + minimumAmount, + maximumAmount, + assessmentMethod, + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + + await retryOnError(async () => + verifyTokenCreationWithFractionalFee( + fungibleTokenId, + feeCollectorAccountId, + feeCollectorsExempt, + numerator, + denominator, + minimumAmount, + maximumAmount, + assessmentMethod, + ), + ); + }); + + it("(#16) Updates a token's fee schedule with a fractional fee with a denominator of 9,223,372,036,854,775,806 (int64 max - 1)", async function () { + const feeCollectorAccountId = process.env.OPERATOR_ACCOUNT_ID as string; + const feeCollectorsExempt = false; + const numerator = "1"; + const denominator = "9223372036854775806"; + const minimumAmount = "1"; + const maximumAmount = "10"; + const assessmentMethod = "inclusive"; + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId, + feeCollectorsExempt, + fractionalFee: { + numerator, + denominator, + minimumAmount, + maximumAmount, + assessmentMethod, + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + + await retryOnError(async () => + verifyTokenCreationWithFractionalFee( + fungibleTokenId, + feeCollectorAccountId, + feeCollectorsExempt, + numerator, + denominator, + minimumAmount, + maximumAmount, + assessmentMethod, + ), + ); + }); + + it("(#17) Updates a token's fee schedule with a fractional fee with a denominator of -9,223,372,036,854,775,808 (int64 min)", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fractionalFee: { + numerator: "1", + denominator: "-9223372036854775808", + minimumAmount: "1", + maximumAmount: "10", + assessmentMethod: "inclusive", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#18) Updates a token's fee schedule with a fractional fee with a denominator of -9,223,372,036,854,775,807 (int64 min + 1)", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fractionalFee: { + numerator: "1", + denominator: "-9223372036854775807", + minimumAmount: "1", + maximumAmount: "10", + assessmentMethod: "inclusive", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#19) Updates a token's fee schedule with a fractional fee with a minimum amount of 0", async function () { + const feeCollectorAccountId = process.env.OPERATOR_ACCOUNT_ID as string; + const feeCollectorsExempt = false; + const numerator = "1"; + const denominator = "10"; + const minimumAmount = "0"; + const maximumAmount = "10"; + const assessmentMethod = "inclusive"; + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId, + feeCollectorsExempt, + fractionalFee: { + numerator, + denominator, + minimumAmount, + maximumAmount, + assessmentMethod, + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + + await retryOnError(async () => + verifyTokenCreationWithFractionalFee( + fungibleTokenId, + feeCollectorAccountId, + feeCollectorsExempt, + numerator, + denominator, + minimumAmount, + maximumAmount, + assessmentMethod, + ), + ); + }); + + it("(#20) Updates a token's fee schedule with a fractional fee with a minimum amount of -1", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fractionalFee: { + numerator: "1", + denominator: "10", + minimumAmount: "-1", + maximumAmount: "10", + assessmentMethod: "inclusive", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#21) Updates a token's fee schedule with a fractional fee with a minimum amount of 9,223,372,036,854,775,807 (int64 max)", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fractionalFee: { + numerator: "1", + denominator: "10", + minimumAmount: "9223372036854775807", + maximumAmount: "10", + assessmentMethod: "inclusive", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal( + err.data.status, + "FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT", + ); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#22) Updates a token's fee schedule with a fractional fee with a minimum amount of 9,223,372,036,854,775,806 (int64 max - 1)", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fractionalFee: { + numerator: "1", + denominator: "10", + minimumAmount: "9223372036854775806", + maximumAmount: "10", + assessmentMethod: "inclusive", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal( + err.data.status, + "FRACTIONAL_FEE_MAX_AMOUNT_LESS_THAN_MIN_AMOUNT", + ); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#23) Updates a token's fee schedule with a fractional fee with a minimum amount of -9,223,372,036,854,775,808 (int64 min)", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fractionalFee: { + numerator: "1", + denominator: "10", + minimumAmount: "-9223372036854775808", + maximumAmount: "10", + assessmentMethod: "inclusive", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#24) Updates a token's fee schedule with a fractional fee with a minimum amount of -9,223,372,036,854,775,807 (int64 min + 1)", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fractionalFee: { + numerator: "1", + denominator: "10", + minimumAmount: "-9223372036854775807", + maximumAmount: "10", + assessmentMethod: "inclusive", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#25) Updates a token's fee schedule with a fractional fee with a maximum amount of 0", async function () { + const feeCollectorAccountId = process.env.OPERATOR_ACCOUNT_ID as string; + const feeCollectorsExempt = false; + const numerator = "1"; + const denominator = "10"; + const minimumAmount = "1"; + const maximumAmount = "0"; + const assessmentMethod = "inclusive"; + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId, + feeCollectorsExempt, + fractionalFee: { + numerator, + denominator, + minimumAmount, + maximumAmount, + assessmentMethod, + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + + await retryOnError(async () => + verifyTokenCreationWithFractionalFee( + fungibleTokenId, + feeCollectorAccountId, + feeCollectorsExempt, + numerator, + denominator, + minimumAmount, + maximumAmount, + assessmentMethod, + ), + ); + }); + + it("(#26) Updates a token's fee schedule with a fractional fee with a maximum amount of -1", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fractionalFee: { + numerator: "1", + denominator: "10", + minimumAmount: "1", + maximumAmount: "-1", + assessmentMethod: "inclusive", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#27) Updates a token's fee schedule with a fractional fee with a maximum amount of 9,223,372,036,854,775,807 (int64 max)", async function () { + const feeCollectorAccountId = process.env.OPERATOR_ACCOUNT_ID as string; + const feeCollectorsExempt = false; + const numerator = "1"; + const denominator = "10"; + const minimumAmount = "1"; + const maximumAmount = "9223372036854775807"; + const assessmentMethod = "inclusive"; + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId, + feeCollectorsExempt, + fractionalFee: { + numerator, + denominator, + minimumAmount, + maximumAmount, + assessmentMethod, + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + + await retryOnError(async () => + verifyTokenCreationWithFractionalFee( + fungibleTokenId, + feeCollectorAccountId, + feeCollectorsExempt, + numerator, + denominator, + minimumAmount, + maximumAmount, + assessmentMethod, + ), + ); + }); + + it("(#28) Updates a token's fee schedule with a fractional fee with a maximum amount of 9,223,372,036,854,775,806 (int64 max - 1)", async function () { + const feeCollectorAccountId = process.env.OPERATOR_ACCOUNT_ID as string; + const feeCollectorsExempt = false; + const numerator = "1"; + const denominator = "10"; + const minimumAmount = "1"; + const maximumAmount = "9223372036854775806"; + const assessmentMethod = "inclusive"; + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId, + feeCollectorsExempt, + fractionalFee: { + numerator, + denominator, + minimumAmount, + maximumAmount, + assessmentMethod, + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + + await retryOnError(async () => + verifyTokenCreationWithFractionalFee( + fungibleTokenId, + feeCollectorAccountId, + feeCollectorsExempt, + numerator, + denominator, + minimumAmount, + maximumAmount, + assessmentMethod, + ), + ); + }); + + it("(#29) Updates a token's fee schedule with a fractional fee with a maximum amount of -9,223,372,036,854,775,808 (int64 min)", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fractionalFee: { + numerator: "1", + denominator: "10", + minimumAmount: "1", + maximumAmount: "-9223372036854775808", + assessmentMethod: "inclusive", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#30) Updates a token's fee schedule with a fractional fee with a maximum amount of -9,223,372,036,854,775,807 (int64 min + 1)", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fractionalFee: { + numerator: "1", + denominator: "10", + minimumAmount: "1", + maximumAmount: "-9223372036854775807", + assessmentMethod: "inclusive", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#31) Updates a NFT's fee schedule with a royalty fee with a numerator of 0", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + royaltyFee: { + numerator: "0", + denominator: "10", + fallbackFee: { + amount: "10", + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#32) Updates a NFT's fee schedule with a royalty fee with a numerator of -1", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + royaltyFee: { + numerator: "-1", + denominator: "10", + fallbackFee: { + amount: "10", + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#33) Updates a NFT's fee schedule with a royalty fee with a numerator of 9,223,372,036,854,775,807 (int64 max)", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + royaltyFee: { + numerator: "9223372036854775807", + denominator: "10", + fallbackFee: { + amount: "10", + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "ROYALTY_FRACTION_CANNOT_EXCEED_ONE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#34) Updates a NFT's fee schedule with a royalty fee with a numerator of 9,223,372,036,854,775,806 (int64 max - 1)", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + royaltyFee: { + numerator: "9223372036854775806", + denominator: "10", + fallbackFee: { + amount: "10", + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "ROYALTY_FRACTION_CANNOT_EXCEED_ONE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#35) Updates a NFT's fee schedule with a royalty fee with a numerator of -9,223,372,036,854,775,808 (int64 min)", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + royaltyFee: { + numerator: "-9223372036854775808", + denominator: "10", + fallbackFee: { + amount: "10", + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#36) Updates a NFT's fee schedule with a royalty fee with a numerator of -9,223,372,036,854,775,807 (int64 min + 1)", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + royaltyFee: { + numerator: "-9223372036854775807", + denominator: "10", + fallbackFee: { + amount: "10", + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#37) Updates a NFT's fee schedule with a royalty fee with a denominator of 0", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + royaltyFee: { + numerator: "1", + denominator: "0", + fallbackFee: { + amount: "10", + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "FRACTION_DIVIDES_BY_ZERO"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#38) Updates a NFT's fee schedule with a royalty fee with a denominator of -1", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + royaltyFee: { + numerator: "1", + denominator: "-1", + fallbackFee: { + amount: "10", + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#39) Updates a NFT's fee schedule with a royalty fee with a denominator of 9,223,372,036,854,775,807 (int64 max)", async function () { + const feeCollectorAccountId = process.env + .OPERATOR_ACCOUNT_ID as string as string; + const feeCollectorsExempt = false; + const numerator = "1"; + const denominator = "9223372036854775807"; + const fallbackAmount = "10"; + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId, + feeCollectorsExempt, + royaltyFee: { + numerator, + denominator, + fallbackFee: { + amount: fallbackAmount, + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + + await retryOnError(async () => + verifyTokenCreationWithRoyaltyFee( + nonFungibleTokenId, + feeCollectorAccountId, + feeCollectorsExempt, + numerator, + denominator, + fallbackAmount, + ), + ); + }); + + it("(#40) Updates a NFT's fee schedule with a royalty fee with a denominator of 9,223,372,036,854,775,806 (int64 max - 1)", async function () { + const feeCollectorAccountId = process.env.OPERATOR_ACCOUNT_ID as string; + const feeCollectorsExempt = false; + const numerator = "1"; + const denominator = "9223372036854775806"; + const fallbackAmount = "10"; + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId, + feeCollectorsExempt, + royaltyFee: { + numerator, + denominator, + fallbackFee: { + amount: fallbackAmount, + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + + await retryOnError(async () => + verifyTokenCreationWithRoyaltyFee( + nonFungibleTokenId, + feeCollectorAccountId, + feeCollectorsExempt, + numerator, + denominator, + fallbackAmount, + ), + ); + }); + + it("(#41) Updates a NFT's fee schedule with a royalty fee with a denominator of -9,223,372,036,854,775,808 (int64 min)", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + royaltyFee: { + numerator: "1", + denominator: "-9223372036854775808", + fallbackFee: { + amount: "10", + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#42) Updates a NFT's fee schedule with a royalty fee with a denominator of -9,223,372,036,854,775,807 (int64 min + 1)", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + royaltyFee: { + numerator: "1", + denominator: "-9223372036854775807", + fallbackFee: { + amount: "10", + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#43) Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of 0", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + royaltyFee: { + numerator: "1", + denominator: "10", + fallbackFee: { + amount: "0", + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#44) Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of -1", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + royaltyFee: { + numerator: "1", + denominator: "10", + fallbackFee: { + amount: "-1", + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#45) Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of 9,223,372,036,854,775,807 (int64 max)", async function () { + const feeCollectorAccountId = process.env.OPERATOR_ACCOUNT_ID as string; + const feeCollectorsExempt = false; + const numerator = "1"; + const denominator = "10"; + const fallbackAmount = "9223372036854775807"; + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId, + feeCollectorsExempt, + royaltyFee: { + numerator, + denominator, + fallbackFee: { + amount: fallbackAmount, + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + + await retryOnError(async () => + verifyTokenCreationWithRoyaltyFee( + nonFungibleTokenId, + feeCollectorAccountId, + feeCollectorsExempt, + numerator, + denominator, + fallbackAmount, + ), + ); + }); + + it("(#46) Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of 9,223,372,036,854,775,806 (int64 max - 1)", async function () { + const feeCollectorAccountId = process.env.OPERATOR_ACCOUNT_ID as string; + const feeCollectorsExempt = false; + const numerator = "1"; + const denominator = "10"; + const fallbackAmount = "9223372036854775806"; + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId, + feeCollectorsExempt, + royaltyFee: { + numerator, + denominator, + fallbackFee: { + amount: fallbackAmount, + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + + await retryOnError(async () => + verifyTokenCreationWithRoyaltyFee( + nonFungibleTokenId, + feeCollectorAccountId, + feeCollectorsExempt, + numerator, + denominator, + fallbackAmount, + ), + ); + }); + + it("(#47) Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of -9,223,372,036,854,775,808 (int64 min)", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + royaltyFee: { + numerator: "1", + denominator: "10", + fallbackFee: { + amount: "-9223372036854775808", + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#48) Updates a NFT's fee schedule with a royalty fee with a fallback fee with an amount of -9,223,372,036,854,775,807 (int64 min + 1)", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + royaltyFee: { + numerator: "1", + denominator: "10", + fallbackFee: { + amount: "-9223372036854775807", + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEE_MUST_BE_POSITIVE"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#49) Updates a token's fee schedule with a fixed fee with a fee collector account that doesn't exist", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: "123.456.789", + feeCollectorsExempt: false, + fixedFee: { + amount: "10", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "INVALID_CUSTOM_FEE_COLLECTOR"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#50) Updates a token's fee schedule with a fractional with a fee collector account that doesn't exist", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: "123.456.789", + feeCollectorsExempt: false, + fractionalFee: { + numerator: "1", + denominator: "10", + minimumAmount: "1", + maximumAmount: "10", + assessmentMethod: "inclusive", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "INVALID_CUSTOM_FEE_COLLECTOR"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#51) Updates a NFT's fee schedule with a royalty fee with a fee collector account that doesn't exist", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId: "123.456.789", + feeCollectorsExempt: false, + royaltyFee: { + numerator: "1", + denominator: "10", + fallbackFee: { + amount: "10", + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "INVALID_CUSTOM_FEE_COLLECTOR"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#52) Updates a token's fee schedule with a fixed fee with an empty fee collector account", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: "", + feeCollectorsExempt: false, + fixedFee: { + amount: "10", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.code, -32603); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#53) Updates a token's fee schedule with a fractional with an empty fee collector account", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: "", + feeCollectorsExempt: false, + fractionalFee: { + numerator: "1", + denominator: "10", + minimumAmount: "1", + maximumAmount: "10", + assessmentMethod: "inclusive", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.code, -32603); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#54) Updates a NFT's fee schedule with a royalty fee with an empty fee collector account", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId: "", + feeCollectorsExempt: false, + royaltyFee: { + numerator: "1", + denominator: "10", + fallbackFee: { + amount: "10", + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.code, -32603); + return; + } + + assert.fail("Should throw an error"); + }); + + // Check for a bug in services + it.skip("(#55) Updates a token's fee schedule with a fixed fee with a deleted fee collector account", async function () { + let response = await JSONRPCRequest(this, "generateKey", { + type: "ed25519PrivateKey", + }); + + const accountKey = response.key; + + response = await JSONRPCRequest(this, "createAccount", { + key: accountKey, + }); + + const accountId = response.accountId; + + response = await JSONRPCRequest(this, "deleteAccount", { + deleteAccountId: accountId, + transferAccountId: process.env.OPERATOR_ACCOUNT_ID, + commonTransactionParams: { + signers: [accountKey], + }, + }); + + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: accountId, + feeCollectorsExempt: false, + fixedFee: { + amount: "10", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "INVALID_CUSTOM_FEE_COLLECTOR"); + return; + } + + assert.fail("Should throw an error"); + }); + + // Check for a bug in services + it.skip("(#56) Updates a token's fee schedule with a fractional fee with a deleted fee collector account", async function () { + let response = await JSONRPCRequest(this, "generateKey", { + type: "ed25519PrivateKey", + }); + + const accountKey = response.key; + + response = await JSONRPCRequest(this, "createAccount", { + key: accountKey, + }); + + const accountId = response.accountId; + + response = await JSONRPCRequest(this, "deleteAccount", { + deleteAccountId: accountId, + transferAccountId: process.env.OPERATOR_ACCOUNT_ID, + commonTransactionParams: { + signers: [accountKey], + }, + }); + + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: accountId, + feeCollectorsExempt: false, + fractionalFee: { + numerator: "1", + denominator: "10", + minimumAmount: "1", + maximumAmount: "10", + assessmentMethod: "inclusive", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "INVALID_CUSTOM_FEE_COLLECTOR"); + return; + } + + assert.fail("Should throw an error"); + }); + + // Check for a bug in services + it.skip("(#57) Updates a NFT's fee schedule with a royalty fee with a deleted fee collector account", async function () { + let response = await JSONRPCRequest(this, "generateKey", { + type: "ed25519PrivateKey", + }); + + const accountKey = response.key; + + response = await JSONRPCRequest(this, "createAccount", { + key: accountKey, + }); + + const accountId = response.accountId; + + response = await JSONRPCRequest(this, "deleteAccount", { + deleteAccountId: accountId, + transferAccountId: process.env.OPERATOR_ACCOUNT_ID, + commonTransactionParams: { + signers: [accountKey], + }, + }); + + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId: accountId, + feeCollectorsExempt: false, + royaltyFee: { + numerator: "1", + denominator: "10", + fallbackFee: { + amount: "10", + }, + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "INVALID_CUSTOM_FEE_COLLECTOR"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#58) Updates a token's fee schedule with a fixed fee that is assessed with a token that doesn't exist", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fixedFee: { + amount: "10", + denominatingTokenId: "123.456.789", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "INVALID_TOKEN_ID_IN_CUSTOM_FEES"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#59) Updates a token's fee schedule with a fixed fee that is assessed with an empty token", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fixedFee: { + amount: "10", + denominatingTokenId: "", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.code, -32603); + return; + } + + assert.fail("Should throw an error"); + }); + + // Check for a bug in services + it.skip("(#60) Updates a token's fee schedule with a fixed fee that is assessed with a deleted token", async function () { + let response = await JSONRPCRequest(this, "generateKey", { + type: "ed25519PrivateKey", + }); + + const deleteKey = response.key; + + response = await JSONRPCRequest(this, "createToken", { + name: testTokenName, + symbol: testTokenSymbol, + treasuryAccountId: testTreasuryAccountId, + adminKey: deleteKey, + commonTransactionParams: { + signers: [deleteKey], + }, + }); + + const deleteTokenId = response.tokenId; + + response = await JSONRPCRequest(this, "deleteToken", { + tokenId: deleteTokenId, + commonTransactionParams: { + signers: [deleteKey], + }, + }); + + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fixedFee: { + amount: "10", + denominatingTokenId: deleteTokenId, + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "INVALID_TOKEN_ID_CUSTOM_FEES"); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#61) Updates a token's fee schedule with a fractional fee that is assessed to the receiver", async function () { + const feeCollectorAccountId = process.env.OPERATOR_ACCOUNT_ID as string; + const feeCollectorsExempt = false; + const numerator = "1"; + const denominator = "10"; + const minimumAmount = "1"; + const maximumAmount = "10"; + const assessmentMethod = "exclusive"; + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId, + feeCollectorsExempt, + fractionalFee: { + numerator, + denominator, + minimumAmount, + maximumAmount, + assessmentMethod, + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + + await retryOnError(async () => + verifyTokenCreationWithFractionalFee( + fungibleTokenId, + feeCollectorAccountId, + feeCollectorsExempt, + numerator, + denominator, + minimumAmount, + maximumAmount, + assessmentMethod, + ), + ); + }); + + it("(#62) Updates a fungible token's fee schedule with a royalty fee", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + royaltyFee: { + numerator: "1", + denominator: "10", + fallbackFee: { + amount: "10", + }, + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal( + err.data.status, + "CUSTOM_ROYALTY_FEE_ONLY_ALLOWED_FOR_NON_FUNGIBLE_UNIQUE", + ); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#63) Updates a NFT's fee schedule with a fractional fee", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: nonFungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fractionalFee: { + numerator: "1", + denominator: "10", + minimumAmount: "1", + maximumAmount: "10", + assessmentMethod: "inclusive", + }, + }, + ], + commonTransactionParams: { + signers: [nonFungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal( + err.data.status, + "CUSTOM_FRACTIONAL_FEE_ONLY_ALLOWED_FOR_FUNGIBLE_COMMON", + ); + return; + } + + assert.fail("Should throw an error"); + }); + + it("(#64) Updates a token's fee schedule with more than the maximum amount of fees allowed", async function () { + try { + await JSONRPCRequest(this, "updateTokenFeeSchedule", { + tokenId: fungibleTokenId, + customFees: [ + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fixedFee: { + amount: "10", + }, + }, + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fixedFee: { + amount: "10", + }, + }, + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fixedFee: { + amount: "10", + }, + }, + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fixedFee: { + amount: "10", + }, + }, + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fixedFee: { + amount: "10", + }, + }, + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fixedFee: { + amount: "10", + }, + }, + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fixedFee: { + amount: "10", + }, + }, + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fixedFee: { + amount: "10", + }, + }, + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fixedFee: { + amount: "10", + }, + }, + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fixedFee: { + amount: "10", + }, + }, + { + feeCollectorAccountId: process.env.OPERATOR_ACCOUNT_ID, + feeCollectorsExempt: false, + fixedFee: { + amount: "10", + }, + }, + ], + commonTransactionParams: { + signers: [fungibleTokenFeeScheduleKey], + }, + }); + } catch (err: any) { + assert.equal(err.data.status, "CUSTOM_FEES_LIST_TOO_LONG"); + return; + } + + assert.fail("Should throw an error"); + }); + }); + + return Promise.resolve(); +}); diff --git a/src/tests/token-service/test-token-update-transaction.ts b/src/tests/token-service/test-token-update-transaction.ts index cefe3cf..17d66e3 100644 --- a/src/tests/token-service/test-token-update-transaction.ts +++ b/src/tests/token-service/test-token-update-transaction.ts @@ -520,7 +520,7 @@ describe("TokenUpdateTransaction", function () { describe("Admin Key", () => { it("(#1) Updates an immutable token with a valid key as its admin key", async function () { - let response = await JSONRPCRequest(this, "generateKey", { + const response = await JSONRPCRequest(this, "generateKey", { type: "ed25519PublicKey", }); @@ -768,7 +768,7 @@ describe("TokenUpdateTransaction", function () { describe("KYC Key", () => { it("(#1) Updates an immutable token with a valid key as its KYC key", async function () { - let response = await JSONRPCRequest(this, "generateKey", { + const response = await JSONRPCRequest(this, "generateKey", { type: "ed25519PublicKey", }); @@ -1038,7 +1038,7 @@ describe("TokenUpdateTransaction", function () { describe("Freeze Key", () => { it("(#1) Updates an immutable token with a valid key as its freeze key", async function () { - let response = await JSONRPCRequest(this, "generateKey", { + const response = await JSONRPCRequest(this, "generateKey", { type: "ed25519PublicKey", }); @@ -1320,7 +1320,7 @@ describe("TokenUpdateTransaction", function () { describe("Wipe Key", () => { it("(#1) Updates an immutable token with a valid key as its wipe key", async function () { - let response = await JSONRPCRequest(this, "generateKey", { + const response = await JSONRPCRequest(this, "generateKey", { type: "ed25519PublicKey", }); @@ -1602,7 +1602,7 @@ describe("TokenUpdateTransaction", function () { describe("Supply Key", () => { it("(#1) Updates an immutable token with a valid key as its supply key", async function () { - let response = await JSONRPCRequest(this, "generateKey", { + const response = await JSONRPCRequest(this, "generateKey", { type: "ed25519PublicKey", }); @@ -2568,7 +2568,7 @@ describe("TokenUpdateTransaction", function () { describe("Fee Schedule Key", () => { it("(#1) Updates an immutable token with a valid key as its fee schedule key", async function () { - let response = await JSONRPCRequest(this, "generateKey", { + const response = await JSONRPCRequest(this, "generateKey", { type: "ed25519PublicKey", }); @@ -2832,7 +2832,7 @@ describe("TokenUpdateTransaction", function () { describe("Pause Key", () => { it("(#1) Updates an immutable token with a valid key as its pause key", async function () { - let response = await JSONRPCRequest(this, "generateKey", { + const response = await JSONRPCRequest(this, "generateKey", { type: "ed25519PublicKey", }); @@ -3146,7 +3146,7 @@ describe("TokenUpdateTransaction", function () { describe("Metadata Key", () => { it("(#1) Updates an immutable token with a valid key as its metadata key", async function () { - let response = await JSONRPCRequest(this, "generateKey", { + const response = await JSONRPCRequest(this, "generateKey", { type: "ed25519PublicKey", }); diff --git a/src/utils/helpers/asn1-decoder.ts b/src/utils/helpers/asn1-decoder.ts index 4bc533e..d851192 100644 --- a/src/utils/helpers/asn1-decoder.ts +++ b/src/utils/helpers/asn1-decoder.ts @@ -26,7 +26,7 @@ class ASN1Decoder { private readLength(): number { let length = this.data[this.pos++]; if (length & 0x80) { - let numBytes = length & 0x7f; + const numBytes = length & 0x7f; length = 0; for (let i = 0; i < numBytes; i++) { length = (length << 8) | this.data[this.pos++]; diff --git a/src/utils/helpers/custom-fees.ts b/src/utils/helpers/custom-fees.ts index f223776..e36f3df 100644 --- a/src/utils/helpers/custom-fees.ts +++ b/src/utils/helpers/custom-fees.ts @@ -9,13 +9,22 @@ import { import mirrorNodeClient from "@services/MirrorNodeClient"; import consensusInfoClient from "@services/ConsensusInfoClient"; +const stringifyNumberValue = (value: any) => { + if (value === null || value === undefined) { + return "0"; + } + + return value.toString(); +}; + const consensusNodeFeeEqualsCustomFee = ( customFee: CustomFee, feeCollectorAccountId: string, feeCollectorsExempt: boolean, ) => { return ( - feeCollectorAccountId === customFee.feeCollectorAccountId?.toString() && + feeCollectorAccountId === + stringifyNumberValue(customFee.feeCollectorAccountId) && feeCollectorsExempt === customFee.allCollectorsAreExempt ); }; @@ -31,7 +40,7 @@ const consensusNodeFeeEqualsCustomFixedFee = ( customFixedFee, feeCollectorAccountId, feeCollectorsExempt, - ) && amount === customFixedFee.amount?.toString() + ) && amount === stringifyNumberValue(customFixedFee.amount) ); }; @@ -51,13 +60,12 @@ const consensusNodeFeeEqualsCustomFractionalFee = ( feeCollectorAccountId, feeCollectorsExempt, ) && - numerator === customFractionalFee.numerator?.toString() && - denominator === customFractionalFee.denominator?.toString() && - minAmount === customFractionalFee.min?.toString() && - maxAmount === customFractionalFee.max?.toString() - // TODO: Uncomment this line when fixing assessmentMethod bug across SDKs - // (assessmentMethod === "exclusive") === - // customFractionalFee.assessmentMethod?._value + numerator === stringifyNumberValue(customFractionalFee.numerator) && + denominator === stringifyNumberValue(customFractionalFee.denominator) && + minAmount === stringifyNumberValue(customFractionalFee.min) && + maxAmount === stringifyNumberValue(customFractionalFee.max) && + (assessmentMethod === "exclusive") === + customFractionalFee.assessmentMethod?._value ); }; @@ -75,9 +83,10 @@ const consensusNodeFeeEqualsCustomRoyaltyFee = ( feeCollectorAccountId, feeCollectorsExempt, ) && - numerator === customRoyaltyFee.numerator?.toString() && - denominator === customRoyaltyFee.denominator?.toString() && - fixedFeeAmount === customRoyaltyFee.fallbackFee?.amount?.toString() + numerator === stringifyNumberValue(customRoyaltyFee.numerator) && + denominator === stringifyNumberValue(customRoyaltyFee.denominator) && + fixedFeeAmount === + stringifyNumberValue(customRoyaltyFee.fallbackFee?.amount) ); }; @@ -89,8 +98,8 @@ const mirrorNodeFeeEqualsCustomFixedFee = ( ) => { return ( feeCollectorAccountId.toString() === - customFixedFee.collector_account_id.toString() && - amount === customFixedFee.amount?.toString() + stringifyNumberValue(customFixedFee.collector_account_id) && + amount === stringifyNumberValue(customFixedFee.amount) ); }; @@ -104,16 +113,19 @@ const mirrorNodeFeeEqualsCustomFractionalFee = ( maxAmount: string, assessmentMethod: string, ) => { + if (customFractionalFee.maximum === null) { + customFractionalFee.maximum = 0; + } + return ( feeCollectorAccountId?.toString() === - customFractionalFee.collector_account_id && - numerator === customFractionalFee.amount.numerator.toString() && - denominator === customFractionalFee.amount.denominator.toString() && - minAmount === customFractionalFee.minimum.toString() && - maxAmount === customFractionalFee.maximum.toString() - // TODO: Uncomment this line when fixing assessmentMethod bug across SDKs - // (assessmentMethod === "exclusive") === - // customFractionalFee._allCollectorsAreExempt + stringifyNumberValue(customFractionalFee.collector_account_id) && + numerator === stringifyNumberValue(customFractionalFee.amount.numerator) && + denominator === + stringifyNumberValue(customFractionalFee.amount.denominator) && + minAmount === stringifyNumberValue(customFractionalFee.minimum) && + maxAmount === stringifyNumberValue(customFractionalFee.maximum) && + (assessmentMethod === "exclusive") === customFractionalFee.net_of_transfers ); }; @@ -127,10 +139,11 @@ const mirrorNodeFeeEqualsCustomRoyaltyFee = ( ) => { return ( feeCollectorAccountId.toString() === - customRoyaltyFee.collector_account_id && - numerator === customRoyaltyFee.amount.numerator?.toString() && - denominator === customRoyaltyFee.amount.denominator?.toString() && - fixedFeeAmount === customRoyaltyFee.fallback_fee.amount?.toString() + stringifyNumberValue(customRoyaltyFee.collector_account_id) && + numerator === stringifyNumberValue(customRoyaltyFee.amount.numerator) && + denominator === stringifyNumberValue(customRoyaltyFee.amount.denominator) && + fixedFeeAmount === + stringifyNumberValue(customRoyaltyFee.fallback_fee.amount) ); }; diff --git a/src/utils/helpers/key.ts b/src/utils/helpers/key.ts index 0a70547..ec85048 100644 --- a/src/utils/helpers/key.ts +++ b/src/utils/helpers/key.ts @@ -63,7 +63,7 @@ export const getPublicKeyFromMirrorNode = async ( // Access the dynamic key (e.g., fee_schedule_key, admin_key, etc.) const keyMirrorNode = data[searchedKey]; - if (keyMirrorNode == null) { + if (keyMirrorNode === null) { return null; }