pshenmic-dpp 1.1.2-dev.7 → 2.0.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -99
- package/dist/binaries/bindingsTypes.d.ts +1696 -0
- package/dist/binaries/bindingsTypes.js +98 -0
- package/dist/binaries/pshenmic_dpp.android.node/react-native-node-api-module +0 -0
- package/dist/binaries/pshenmic_dpp.android.node/x86_64/libpshenmic_dpp.so +0 -0
- package/dist/binaries/pshenmic_dpp.d.ts +166 -0
- package/dist/binaries/pshenmic_dpp.js +3 -0
- package/dist/binaries/wasm/wasmBytes.d.ts +2 -0
- package/dist/binaries/wasm/wasmBytes.js +2 -0
- package/dist/binaries/wasm.d.ts +166 -0
- package/dist/binaries/wasm.js +44 -0
- package/dist/src/dpp/constants.d.ts +4 -0
- package/dist/src/dpp/constants.js +19 -0
- package/dist/src/dpp/dpp.d.ts +110 -0
- package/dist/src/dpp/dpp.js +110 -0
- package/dist/src/dpp/enums.d.ts +1 -0
- package/dist/src/dpp/enums.js +1 -0
- package/dist/src/dpp/provider.d.ts +11 -0
- package/dist/src/dpp/provider.js +21 -0
- package/dist/src/dpp/structs/Address/AddressWitness.d.ts +12 -0
- package/dist/src/dpp/structs/Address/AddressWitness.js +23 -0
- package/dist/src/dpp/structs/Address/PlatformAddress.d.ts +14 -0
- package/dist/src/dpp/structs/Address/PlatformAddress.js +32 -0
- package/dist/src/dpp/structs/AddressTransitions/AddressCreditWithdrawalTransition.d.ts +38 -0
- package/dist/src/dpp/structs/AddressTransitions/AddressCreditWithdrawalTransition.js +95 -0
- package/dist/src/dpp/structs/AddressTransitions/AddressFundingFromAssetLockTransition.d.ts +35 -0
- package/dist/src/dpp/structs/AddressTransitions/AddressFundingFromAssetLockTransition.js +85 -0
- package/dist/src/dpp/structs/AddressTransitions/AddressFundsTransferTransition.d.ts +30 -0
- package/dist/src/dpp/structs/AddressTransitions/AddressFundsTransferTransition.js +72 -0
- package/dist/src/dpp/structs/AddressTransitions/IdentityCreateFromAddressesTransition.d.ts +33 -0
- package/dist/src/dpp/structs/AddressTransitions/IdentityCreateFromAddressesTransition.js +82 -0
- package/dist/src/dpp/structs/AddressTransitions/IdentityCreditTransferToAddressesTransition.d.ts +31 -0
- package/dist/src/dpp/structs/AddressTransitions/IdentityCreditTransferToAddressesTransition.js +77 -0
- package/dist/src/dpp/structs/AddressTransitions/IdentityTopUpFromAddressesTransition.d.ts +31 -0
- package/dist/src/dpp/structs/AddressTransitions/IdentityTopUpFromAddressesTransition.js +76 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/AddressFundsFeeStrategyStep.d.ts +12 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/AddressFundsFeeStrategyStep.js +26 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/InputAddress.d.ts +14 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/InputAddress.js +32 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddress.d.ts +12 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddress.js +26 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddressNullableCredits.d.ts +12 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddressNullableCredits.js +29 -0
- package/dist/src/dpp/structs/AssetLockProof/AssetLockProof.d.ts +19 -0
- package/dist/src/dpp/structs/AssetLockProof/AssetLockProof.js +51 -0
- package/dist/src/dpp/structs/AssetLockProof/ChainAssetLockProof.d.ts +17 -0
- package/dist/src/dpp/structs/AssetLockProof/ChainAssetLockProof.js +36 -0
- package/dist/src/dpp/structs/AssetLockProof/InstantAssetLockProof.d.ts +24 -0
- package/dist/src/dpp/structs/AssetLockProof/InstantAssetLockProof.js +48 -0
- package/dist/src/dpp/structs/AssetLockProof/OutPoint.d.ts +15 -0
- package/dist/src/dpp/structs/AssetLockProof/OutPoint.js +40 -0
- package/dist/src/dpp/structs/AssetLockProof/Transaction.d.ts +20 -0
- package/dist/src/dpp/structs/AssetLockProof/Transaction.js +49 -0
- package/dist/src/dpp/structs/AssetLockProof/TxIn.d.ts +17 -0
- package/dist/src/dpp/structs/AssetLockProof/TxIn.js +39 -0
- package/dist/src/dpp/structs/AssetLockProof/TxOut.d.ts +13 -0
- package/dist/src/dpp/structs/AssetLockProof/TxOut.js +34 -0
- package/dist/src/dpp/structs/AssetLockProof/Witness.d.ts +11 -0
- package/dist/src/dpp/structs/AssetLockProof/Witness.js +25 -0
- package/dist/src/dpp/structs/Batch/BatchTransition.d.ts +34 -0
- package/dist/src/dpp/structs/Batch/BatchTransition.js +95 -0
- package/dist/src/dpp/structs/Batch/BatchedTransition.d.ts +13 -0
- package/dist/src/dpp/structs/Batch/BatchedTransition.js +39 -0
- package/dist/src/dpp/structs/Batch/DocumentBaseTransition.d.ts +20 -0
- package/dist/src/dpp/structs/Batch/DocumentBaseTransition.js +54 -0
- package/dist/src/dpp/structs/Batch/DocumentTransition.d.ts +32 -0
- package/dist/src/dpp/structs/Batch/DocumentTransition.js +74 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentCreateTransition.d.ts +23 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentCreateTransition.js +58 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentDeleteTransition.d.ts +14 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentDeleteTransition.js +26 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentPurchaseTransition.d.ts +19 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentPurchaseTransition.js +39 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentReplaceTransition.d.ts +19 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentReplaceTransition.js +40 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentTransferTransition.d.ts +19 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentTransferTransition.js +35 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentUpdatePriceTransition.d.ts +17 -0
- package/dist/src/dpp/structs/Batch/DocumentTransitions/DocumentUpdatePriceTransition.js +33 -0
- package/dist/src/dpp/structs/Batch/PrefundedVotingBalance.d.ts +9 -0
- package/dist/src/dpp/structs/Batch/PrefundedVotingBalance.js +19 -0
- package/dist/src/dpp/structs/Batch/TokenBaseTransition.d.ts +20 -0
- package/dist/src/dpp/structs/Batch/TokenBaseTransition.js +49 -0
- package/dist/src/dpp/structs/Batch/TokenPaymentInfo.d.ts +19 -0
- package/dist/src/dpp/structs/Batch/TokenPaymentInfo.js +54 -0
- package/dist/src/dpp/structs/Batch/TokenPricingSchedule.d.ts +17 -0
- package/dist/src/dpp/structs/Batch/TokenPricingSchedule.js +41 -0
- package/dist/src/dpp/structs/Batch/TokenTransition.d.ts +20 -0
- package/dist/src/dpp/structs/Batch/TokenTransition.js +92 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenBurnTransition.d.ts +14 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenBurnTransition.js +32 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenClaimTransition.d.ts +15 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenClaimTransition.js +33 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenConfigUpdateTransition.d.ts +15 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenConfigUpdateTransition.js +33 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenDestroyFrozenFundsTransition.d.ts +16 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenDestroyFrozenFundsTransition.js +34 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenDirectPurchaseTransition.d.ts +14 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenDirectPurchaseTransition.js +32 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenEmergencyActionTransition.d.ts +15 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenEmergencyActionTransition.js +33 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenFreezeTransition.d.ts +16 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenFreezeTransition.js +34 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenMintTransition.d.ts +18 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenMintTransition.js +43 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenSetPriceForDirectPurchaseTransition.d.ts +15 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenSetPriceForDirectPurchaseTransition.js +36 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenTransferTransition.d.ts +21 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenTransferTransition.js +53 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenUnFreezeTransition.d.ts +16 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenUnFreezeTransition.js +34 -0
- package/dist/src/dpp/structs/ConsensusError.d.ts +8 -0
- package/dist/src/dpp/structs/ConsensusError.js +22 -0
- package/dist/src/dpp/structs/ContractBounds.d.ts +17 -0
- package/dist/src/dpp/structs/ContractBounds.js +39 -0
- package/dist/src/dpp/structs/CoreScript.d.ts +15 -0
- package/dist/src/dpp/structs/CoreScript.js +37 -0
- package/dist/src/dpp/structs/DataContract.d.ts +35 -0
- package/dist/src/dpp/structs/DataContract.js +116 -0
- package/dist/src/dpp/structs/DataContractTransitions/DataContractCreateTransition.d.ts +23 -0
- package/dist/src/dpp/structs/DataContractTransitions/DataContractCreateTransition.js +55 -0
- package/dist/src/dpp/structs/DataContractTransitions/DataContractUpdateTransition.d.ts +23 -0
- package/dist/src/dpp/structs/DataContractTransitions/DataContractUpdateTransition.js +55 -0
- package/dist/src/dpp/structs/Document.d.ts +51 -0
- package/dist/src/dpp/structs/Document.js +184 -0
- package/dist/src/dpp/structs/EncryptedNote/PrivateEncryptedNote.d.ts +13 -0
- package/dist/src/dpp/structs/EncryptedNote/PrivateEncryptedNote.js +31 -0
- package/dist/src/dpp/structs/EncryptedNote/SharedEncryptedNote.d.ts +13 -0
- package/dist/src/dpp/structs/EncryptedNote/SharedEncryptedNote.js +31 -0
- package/dist/src/dpp/structs/GroupStateTransitionInfo.d.ts +15 -0
- package/dist/src/dpp/structs/GroupStateTransitionInfo.js +33 -0
- package/dist/src/dpp/structs/Identifier.d.ts +17 -0
- package/dist/src/dpp/structs/Identifier.js +50 -0
- package/dist/src/dpp/structs/Identity.d.ts +26 -0
- package/dist/src/dpp/structs/Identity.js +73 -0
- package/dist/src/dpp/structs/IdentityPublicKey.d.ts +43 -0
- package/dist/src/dpp/structs/IdentityPublicKey.js +126 -0
- package/dist/src/dpp/structs/IdentityPublicKeyInCreation.d.ts +30 -0
- package/dist/src/dpp/structs/IdentityPublicKeyInCreation.js +77 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreateTransition.d.ts +29 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreateTransition.js +69 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditTransfer.d.ts +33 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditTransfer.js +85 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditWithdrawalTransition.d.ts +42 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityCreditWithdrawalTransition.js +114 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityTopUpTransition.d.ts +30 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityTopUpTransition.js +75 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityUpdateTransition.d.ts +40 -0
- package/dist/src/dpp/structs/IdentityTransitions/IdentityUpdateTransition.js +108 -0
- package/dist/src/dpp/structs/InstantLock.d.ts +17 -0
- package/dist/src/dpp/structs/InstantLock.js +43 -0
- package/dist/src/dpp/structs/MasternodeVote/MasternodeVoteTransition.d.ts +37 -0
- package/dist/src/dpp/structs/MasternodeVote/MasternodeVoteTransition.js +96 -0
- package/dist/src/dpp/structs/MasternodeVote/ResourceVoteChoice.d.ts +14 -0
- package/dist/src/dpp/structs/MasternodeVote/ResourceVoteChoice.js +29 -0
- package/dist/src/dpp/structs/MasternodeVote/Vote.d.ts +13 -0
- package/dist/src/dpp/structs/MasternodeVote/Vote.js +27 -0
- package/dist/src/dpp/structs/MasternodeVote/VotePoll.d.ts +18 -0
- package/dist/src/dpp/structs/MasternodeVote/VotePoll.js +42 -0
- package/dist/src/dpp/structs/PartialIdentity.d.ts +26 -0
- package/dist/src/dpp/structs/PartialIdentity.js +69 -0
- package/dist/src/dpp/structs/PrivateKey.d.ts +20 -0
- package/dist/src/dpp/structs/PrivateKey.js +48 -0
- package/dist/src/dpp/structs/PublicKey.d.ts +15 -0
- package/dist/src/dpp/structs/PublicKey.js +37 -0
- package/dist/src/dpp/structs/StateTransition.d.ts +38 -0
- package/dist/src/dpp/structs/StateTransition.js +100 -0
- package/dist/src/dpp/structs/TokenConfiguration/ActionTaker.d.ts +12 -0
- package/dist/src/dpp/structs/TokenConfiguration/ActionTaker.js +44 -0
- package/dist/src/dpp/structs/TokenConfiguration/AuthorizedActionTakers.d.ts +16 -0
- package/dist/src/dpp/structs/TokenConfiguration/AuthorizedActionTakers.js +43 -0
- package/dist/src/dpp/structs/TokenConfiguration/ChangeControlRules.d.ts +23 -0
- package/dist/src/dpp/structs/TokenConfiguration/ChangeControlRules.js +52 -0
- package/dist/src/dpp/structs/TokenConfiguration/DistributionFunction.d.ts +19 -0
- package/dist/src/dpp/structs/TokenConfiguration/DistributionFunction.js +57 -0
- package/dist/src/dpp/structs/TokenConfiguration/Group.d.ts +19 -0
- package/dist/src/dpp/structs/TokenConfiguration/Group.js +44 -0
- package/dist/src/dpp/structs/TokenConfiguration/RewardDistributionType.d.ts +13 -0
- package/dist/src/dpp/structs/TokenConfiguration/RewardDistributionType.js +40 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenConfiguration.d.ts +54 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenConfiguration.js +139 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationChangeItem.d.ts +47 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationChangeItem.js +140 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationConvention.d.ts +19 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationConvention.js +47 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationLocalization.d.ts +15 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenConfigurationLocalization.js +34 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenDistributionRecipient.d.ts +14 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenDistributionRecipient.js +31 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenDistributionRules.d.ts +28 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenDistributionRules.js +75 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenKeepsHistoryRules.d.ts +19 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenKeepsHistoryRules.js +49 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenMarketplaceRules.d.ts +13 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenMarketplaceRules.js +27 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenPerpetualDistribution.d.ts +13 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenPerpetualDistribution.js +27 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenPreProgrammedDistribution.d.ts +21 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenPreProgrammedDistribution.js +42 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenTradeMode.d.ts +9 -0
- package/dist/src/dpp/structs/TokenConfiguration/TokenTradeMode.js +17 -0
- package/dist/src/dpp/types.d.ts +274 -0
- package/dist/src/dpp/types.js +1 -0
- package/dist/src/dpp/utils.d.ts +5 -0
- package/dist/src/dpp/utils.js +64 -0
- package/dist/src/dpp/verify/Contested/verifyVotePollVoteStateProof.d.ts +3 -0
- package/dist/src/dpp/verify/Contested/verifyVotePollVoteStateProof.js +34 -0
- package/dist/src/dpp/verify/Contract/verifyContract.d.ts +2 -0
- package/dist/src/dpp/verify/Contract/verifyContract.js +14 -0
- package/dist/src/dpp/verify/Document/verifyDocumentsProof.d.ts +3 -0
- package/dist/src/dpp/verify/Document/verifyDocumentsProof.js +10 -0
- package/dist/src/dpp/verify/Identity/verifyIdentifierByNonUniquePublicKeyHashProof.d.ts +2 -0
- package/dist/src/dpp/verify/Identity/verifyIdentifierByNonUniquePublicKeyHashProof.js +10 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityBalanceProof.d.ts +2 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityBalanceProof.js +9 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityByIdentifierProof.d.ts +2 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityByIdentifierProof.js +10 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityByUniqueKeyHashProof.d.ts +2 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityByUniqueKeyHashProof.js +10 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityContractNonceProof.d.ts +2 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityContractNonceProof.js +9 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityKeysByIdentifierProof.d.ts +2 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityKeysByIdentifierProof.js +10 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityNonceProof.d.ts +2 -0
- package/dist/src/dpp/verify/Identity/verifyIdentityNonceProof.js +9 -0
- package/dist/src/dpp/verify/StateTransition/utils.d.ts +2 -0
- package/dist/src/dpp/verify/StateTransition/utils.js +115 -0
- package/dist/src/dpp/verify/StateTransition/verifyStateTransitionResult.d.ts +4 -0
- package/dist/src/dpp/verify/StateTransition/verifyStateTransitionResult.js +10 -0
- package/dist/src/dpp/verify/System/verifyEpochsInfoProof.d.ts +2 -0
- package/dist/src/dpp/verify/System/verifyEpochsInfoProof.js +16 -0
- package/dist/src/dpp/verify/System/verifyTotalCreditsProof.d.ts +2 -0
- package/dist/src/dpp/verify/System/verifyTotalCreditsProof.js +9 -0
- package/dist/src/dpp/verify/Tokens/verifyTokenBalancesForIdentitiesProof.d.ts +2 -0
- package/dist/src/dpp/verify/Tokens/verifyTokenBalancesForIdentitiesProof.js +13 -0
- package/dist/src/dpp/verify/Tokens/verifyTokenContractInfoProof.d.ts +2 -0
- package/dist/src/dpp/verify/Tokens/verifyTokenContractInfoProof.js +15 -0
- package/dist/src/dpp/verify/Tokens/verifyTokenDirectPurchasePrices.d.ts +2 -0
- package/dist/src/dpp/verify/Tokens/verifyTokenDirectPurchasePrices.js +14 -0
- package/dist/src/dpp/verify/Tokens/verifyTokenTotalSupplyProof.d.ts +2 -0
- package/dist/src/dpp/verify/Tokens/verifyTokenTotalSupplyProof.js +12 -0
- package/dist/src/dpp/verify/Tokens/verifyTokensBalancesForIdentityProof.d.ts +2 -0
- package/dist/src/dpp/verify/Tokens/verifyTokensBalancesForIdentityProof.js +13 -0
- package/dist/src/dpp/verify/verifySignatureDigest.d.ts +1 -0
- package/dist/src/dpp/verify/verifySignatureDigest.js +4 -0
- package/dist/src/react-native.d.ts +3 -0
- package/dist/src/react-native.js +6 -0
- package/dist/src/wasm.d.ts +3 -0
- package/dist/src/wasm.js +6 -0
- package/dist/utils/base122.d.ts +7 -0
- package/dist/utils/base122.js +63 -0
- package/package.json +30 -27
- package/tests/unit/DynamicValue.spec.ts +86 -0
- package/tests/unit/Identifier.spec.ts +105 -0
- package/tests/unit/Identity.spec.ts +119 -0
- package/tests/unit/IdentityPublicKey.spec.ts +126 -0
- package/dist/wasm/base122.d.ts +0 -1
- package/dist/wasm/base122.js +0 -67
- package/dist/wasm/index.d.ts +0 -128
- package/dist/wasm/index.js +0 -13
- package/dist/wasm/initAsync.d.ts +0 -4
- package/dist/wasm/initAsync.js +0 -20
- package/dist/wasm/initInterface.d.ts +0 -3
- package/dist/wasm/initInterface.js +0 -46
- package/dist/wasm/initWASM.d.ts +0 -1
- package/dist/wasm/initWASM.js +0 -28
- package/dist/wasm/pshenmic_dpp.d.ts +0 -4789
- package/dist/wasm/pshenmic_dpp.js +0 -23182
- package/dist/wasm/pshenmic_dpp_bg.d.ts +0 -3
- package/dist/wasm/pshenmic_dpp_bg.js +0 -2
- package/dist/wasm/pshenmic_dpp_bg.wasm.d.ts +0 -1477
- package/dist/wasm/pshenmic_dpp_zipped.d.ts +0 -3
- package/dist/wasm/pshenmic_dpp_zipped.js +0 -2
- package/dist/wasm/snippets/pshenmic_dpp_utils-23ab7381b198778d/stringify.js +0 -7
- package/tests/AssetLockProof.spec.cjs +0 -96
- package/tests/AsyncImportTest.spec.cjs +0 -930
- package/tests/AuthorizedActionTakers.spec.cjs +0 -75
- package/tests/BatchTransition.spec.cjs +0 -141
- package/tests/ChainLockProof.spec.cjs +0 -63
- package/tests/ChangeControlRules.spec.cjs +0 -184
- package/tests/CoreScript.spec.cjs +0 -37
- package/tests/DataContract.spec.cjs +0 -170
- package/tests/DataContractCreateStateTransition.spec.cjs +0 -102
- package/tests/DataContractUpdateStateTransition.spec.cjs +0 -103
- package/tests/DistributionFunction.spec.cjs +0 -416
- package/tests/Document.spec.cjs +0 -227
- package/tests/DocumentTransition.spec.cjs +0 -94
- package/tests/DocumentsTransitions.spec.cjs +0 -699
- package/tests/Identifier.spec.cjs +0 -82
- package/tests/Identity.spec.cjs +0 -107
- package/tests/IdentityCreateTransition.spec.cjs +0 -87
- package/tests/IdentityCreditTransferTransition.spec.cjs +0 -140
- package/tests/IdentityCreditWithdrawalTransition.spec.cjs +0 -186
- package/tests/IdentityPublicKey.spec.cjs +0 -166
- package/tests/IdentityTopUpTransition.spec.cjs +0 -125
- package/tests/IdentityUpdateTransition.spec.cjs +0 -141
- package/tests/InstantLockProof.spec.cjs +0 -91
- package/tests/OutPoint.spec.cjs +0 -49
- package/tests/PrivateKey.spec.cjs +0 -67
- package/tests/PublicKeyInCreation.spec.cjs +0 -252
- package/tests/RewardDistributionType.spec.cjs +0 -90
- package/tests/TokenBaseTransition.spec.cjs +0 -96
- package/tests/TokenConfiguration.spec.cjs +0 -188
- package/tests/TokenConfigurationConvention.spec.cjs +0 -93
- package/tests/TokenConfigurationLocalization.spec.cjs +0 -59
- package/tests/TokenDistributionRecipient.spec.cjs +0 -49
- package/tests/TokenDistributionRules.spec.cjs +0 -313
- package/tests/TokenKeepsHistoryRules.spec.cjs +0 -67
- package/tests/TokenPerpetualDistribution.spec.cjs +0 -130
- package/tests/TokenPreProgrammedDistribution.spec.cjs +0 -61
- package/tests/TokensTransitions.spec.cjs +0 -509
- package/tests/TxOut.spec.cjs +0 -70
- package/tests/mocks/DataContract/DataContract.json +0 -164
- package/tests/mocks/DataContract/index.js +0 -6
- package/tests/mocks/Document/DataContract.json +0 -23
- package/tests/mocks/Document/document.json +0 -3
- package/tests/mocks/Document/document2.json +0 -3
- package/tests/mocks/Document/index.js +0 -13
- package/tests/mocks/Identity/index.js +0 -13
- package/tests/mocks/Locks/index.js +0 -2
- package/tests/mocks/PrivateKey/index.js +0 -5
- package/tests/mocks/PublicKey/index.js +0 -13
- package/tests/mocks/TokenConfiguration/index.js +0 -5
- package/tests/utils/hex.js +0 -14
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
const assert = require('assert')
|
|
2
|
-
const { describe, it } = require('mocha')
|
|
3
|
-
const { tokenLocalization } = require('./mocks/TokenConfiguration')
|
|
4
|
-
const { default: wasm } = require('..')
|
|
5
|
-
|
|
6
|
-
describe('TokenConfigurationConvention', function () {
|
|
7
|
-
describe('serialization / deserialization', function () {
|
|
8
|
-
it('Should allow to create from object', function () {
|
|
9
|
-
const convention = new wasm.TokenConfigurationConventionWASM({
|
|
10
|
-
ru: tokenLocalization
|
|
11
|
-
},
|
|
12
|
-
1
|
|
13
|
-
)
|
|
14
|
-
|
|
15
|
-
assert.notEqual(convention.__wbg_ptr, 0)
|
|
16
|
-
})
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
describe('getters', function () {
|
|
20
|
-
it('Should allow to get object of convention in JSON', function () {
|
|
21
|
-
const convention = new wasm.TokenConfigurationConventionWASM({
|
|
22
|
-
ru: tokenLocalization
|
|
23
|
-
},
|
|
24
|
-
1
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
assert.deepEqual(convention.localizations.ru.toJSON(), tokenLocalization)
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
it('Should allow to get object of convention in wasm instance', function () {
|
|
31
|
-
const convention = new wasm.TokenConfigurationConventionWASM({
|
|
32
|
-
ru: tokenLocalization
|
|
33
|
-
},
|
|
34
|
-
1
|
|
35
|
-
)
|
|
36
|
-
|
|
37
|
-
assert.deepEqual(convention.localizations.constructor.name, 'Object')
|
|
38
|
-
assert.deepEqual(convention.localizations.ru.constructor.name, 'TokenConfigurationLocalizationWASM')
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
it('Should allow to get decimals', function () {
|
|
42
|
-
const convention = new wasm.TokenConfigurationConventionWASM({
|
|
43
|
-
ru: tokenLocalization
|
|
44
|
-
},
|
|
45
|
-
1
|
|
46
|
-
)
|
|
47
|
-
|
|
48
|
-
assert.deepEqual(convention.decimals, 1)
|
|
49
|
-
})
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
describe('setters', () => {
|
|
53
|
-
it('Should allow to set localizations object ', function () {
|
|
54
|
-
const convention = new wasm.TokenConfigurationConventionWASM({
|
|
55
|
-
ru: tokenLocalization
|
|
56
|
-
},
|
|
57
|
-
1
|
|
58
|
-
)
|
|
59
|
-
|
|
60
|
-
convention.localizations = {
|
|
61
|
-
en: tokenLocalization
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
assert.deepEqual(convention.localizations.constructor.name, 'Object')
|
|
65
|
-
assert.deepEqual(convention.localizations.ru, undefined)
|
|
66
|
-
assert.deepEqual(convention.localizations.en.constructor.name, 'TokenConfigurationLocalizationWASM')
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
it('Should allow to set localizations object with wasm ', function () {
|
|
70
|
-
const convention = new wasm.TokenConfigurationConventionWASM({
|
|
71
|
-
ru: tokenLocalization
|
|
72
|
-
},
|
|
73
|
-
1
|
|
74
|
-
)
|
|
75
|
-
|
|
76
|
-
const localization = new wasm.TokenConfigurationLocalizationWASM(false, 'singularForm', 'pluralForm')
|
|
77
|
-
|
|
78
|
-
convention.localizations = {
|
|
79
|
-
en: localization
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
assert.deepEqual(convention.localizations.constructor.name, 'Object')
|
|
83
|
-
assert.deepEqual(convention.localizations.ru, undefined)
|
|
84
|
-
assert.deepEqual(convention.localizations.en.constructor.name, 'TokenConfigurationLocalizationWASM')
|
|
85
|
-
assert.deepEqual(convention.localizations.en.toJSON(), {
|
|
86
|
-
shouldCapitalize: false,
|
|
87
|
-
singularForm: 'singularForm',
|
|
88
|
-
pluralForm: 'pluralForm'
|
|
89
|
-
})
|
|
90
|
-
assert.notEqual(localization.__wbg_ptr, 0)
|
|
91
|
-
})
|
|
92
|
-
})
|
|
93
|
-
})
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
const assert = require('assert')
|
|
2
|
-
const { describe, it } = require('mocha')
|
|
3
|
-
const { default: wasm } = require('..')
|
|
4
|
-
|
|
5
|
-
describe('TokenConfigurationLocalization', function () {
|
|
6
|
-
describe('serialization / deserialization', function () {
|
|
7
|
-
it('should allow to create from values', () => {
|
|
8
|
-
const localization = new wasm.TokenConfigurationLocalizationWASM(false, 'singularForm', 'pluralForm')
|
|
9
|
-
|
|
10
|
-
assert.notEqual(localization.__wbg_ptr, 0)
|
|
11
|
-
})
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
describe('getters', function () {
|
|
15
|
-
it('should allow to get shouldCapitalize', () => {
|
|
16
|
-
const localization = new wasm.TokenConfigurationLocalizationWASM(false, 'singularForm', 'pluralForm')
|
|
17
|
-
|
|
18
|
-
assert.equal(localization.shouldCapitalize, false)
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
it('should allow to get pluralForm', () => {
|
|
22
|
-
const localization = new wasm.TokenConfigurationLocalizationWASM(false, 'singularForm', 'pluralForm')
|
|
23
|
-
|
|
24
|
-
assert.equal(localization.pluralForm, 'pluralForm')
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
it('should allow to get singularForm', () => {
|
|
28
|
-
const localization = new wasm.TokenConfigurationLocalizationWASM(false, 'singularForm', 'pluralForm')
|
|
29
|
-
|
|
30
|
-
assert.equal(localization.singularForm, 'singularForm')
|
|
31
|
-
})
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
describe('setters', function () {
|
|
35
|
-
it('should allow to set shouldCapitalize', () => {
|
|
36
|
-
const localization = new wasm.TokenConfigurationLocalizationWASM(false, 'singularForm', 'pluralForm')
|
|
37
|
-
|
|
38
|
-
localization.shouldCapitalize = true
|
|
39
|
-
|
|
40
|
-
assert.equal(localization.shouldCapitalize, true)
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
it('should allow to set pluralForm', () => {
|
|
44
|
-
const localization = new wasm.TokenConfigurationLocalizationWASM(false, 'singularForm', 'pluralForm')
|
|
45
|
-
|
|
46
|
-
localization.pluralForm = 'pluralForm1212'
|
|
47
|
-
|
|
48
|
-
assert.equal(localization.pluralForm, 'pluralForm1212')
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
it('should allow to set singularForm', () => {
|
|
52
|
-
const localization = new wasm.TokenConfigurationLocalizationWASM(false, 'singularForm', 'pluralForm')
|
|
53
|
-
|
|
54
|
-
localization.singularForm = 'singularForm12121'
|
|
55
|
-
|
|
56
|
-
assert.equal(localization.singularForm, 'singularForm12121')
|
|
57
|
-
})
|
|
58
|
-
})
|
|
59
|
-
})
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
const assert = require('assert')
|
|
2
|
-
const { describe, it } = require('mocha')
|
|
3
|
-
const { identifier } = require('./mocks/Identity')
|
|
4
|
-
const { default: wasm } = require('..')
|
|
5
|
-
|
|
6
|
-
describe('TokenDistributionRecipient', function () {
|
|
7
|
-
describe('serialization / deserialization', function () {
|
|
8
|
-
it('should allow to create from values ContractOwner', () => {
|
|
9
|
-
const recipient = wasm.TokenDistributionRecipientWASM.ContractOwner()
|
|
10
|
-
|
|
11
|
-
assert.notEqual(recipient.__wbg_ptr, 0)
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
it('should allow to create from values Identity', () => {
|
|
15
|
-
const recipient = wasm.TokenDistributionRecipientWASM.Identity(identifier)
|
|
16
|
-
|
|
17
|
-
assert.notEqual(recipient.__wbg_ptr, 0)
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
it('should allow to create from values EvonodesByParticipation', () => {
|
|
21
|
-
const recipient = wasm.TokenDistributionRecipientWASM.EvonodesByParticipation()
|
|
22
|
-
|
|
23
|
-
assert.notEqual(recipient.__wbg_ptr, 0)
|
|
24
|
-
})
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
describe('getters', function () {
|
|
28
|
-
it('should allow to get values ContractOwner', () => {
|
|
29
|
-
const recipient = wasm.TokenDistributionRecipientWASM.ContractOwner()
|
|
30
|
-
|
|
31
|
-
assert.equal(recipient.getType(), 'ContractOwner')
|
|
32
|
-
assert.equal(recipient.getValue(), undefined)
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
it('should allow to get values Identity', () => {
|
|
36
|
-
const recipient = wasm.TokenDistributionRecipientWASM.Identity(identifier)
|
|
37
|
-
|
|
38
|
-
assert.equal(recipient.getType(), `Identity(${identifier})`)
|
|
39
|
-
assert.equal(recipient.getValue().base58(), identifier)
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
it('should allow to get values EvonodesByParticipation', () => {
|
|
43
|
-
const recipient = wasm.TokenDistributionRecipientWASM.EvonodesByParticipation()
|
|
44
|
-
|
|
45
|
-
assert.equal(recipient.getType(), 'EvonodesByParticipation')
|
|
46
|
-
assert.equal(recipient.getValue(), undefined)
|
|
47
|
-
})
|
|
48
|
-
})
|
|
49
|
-
})
|
|
@@ -1,313 +0,0 @@
|
|
|
1
|
-
const assert = require('assert')
|
|
2
|
-
const { describe, it, before } = require('mocha')
|
|
3
|
-
const { identifier } = require('./mocks/Identity')
|
|
4
|
-
const { default: wasm } = require('..')
|
|
5
|
-
|
|
6
|
-
describe('TokenDistributionRules', function () {
|
|
7
|
-
describe('serialization / deserialization', function () {
|
|
8
|
-
it('shoulda allow to create with undefined values', () => {
|
|
9
|
-
const noOne = wasm.AuthorizedActionTakersWASM.NoOne()
|
|
10
|
-
|
|
11
|
-
const changeRules = new wasm.ChangeControlRulesWASM(
|
|
12
|
-
noOne,
|
|
13
|
-
noOne,
|
|
14
|
-
true,
|
|
15
|
-
true,
|
|
16
|
-
true
|
|
17
|
-
)
|
|
18
|
-
|
|
19
|
-
const distributionRules = new wasm.TokenDistributionRulesWASM(
|
|
20
|
-
undefined,
|
|
21
|
-
changeRules,
|
|
22
|
-
undefined,
|
|
23
|
-
undefined,
|
|
24
|
-
changeRules,
|
|
25
|
-
true,
|
|
26
|
-
changeRules,
|
|
27
|
-
changeRules
|
|
28
|
-
)
|
|
29
|
-
|
|
30
|
-
assert.notEqual(distributionRules.__wbg_ptr, 0)
|
|
31
|
-
assert.notEqual(changeRules.__wbg_ptr, 0)
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
it('shoulda allow to create without undefined values', () => {
|
|
35
|
-
const noOne = wasm.AuthorizedActionTakersWASM.NoOne()
|
|
36
|
-
|
|
37
|
-
const changeRules = new wasm.ChangeControlRulesWASM(
|
|
38
|
-
noOne,
|
|
39
|
-
noOne,
|
|
40
|
-
true,
|
|
41
|
-
true,
|
|
42
|
-
true
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
const preProgrammedDistribution = new wasm.TokenPreProgrammedDistributionWASM(
|
|
46
|
-
{
|
|
47
|
-
1750140416485: {
|
|
48
|
-
PJUBWbXWmzEYCs99rAAbnCiHRzrnhKLQrXbmSsuPBYB: BigInt(10000)
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
const recipient = wasm.TokenDistributionRecipientWASM.ContractOwner()
|
|
54
|
-
|
|
55
|
-
const distributionFunction = wasm.DistributionFunctionWASM.FixedAmountDistribution(
|
|
56
|
-
BigInt(111)
|
|
57
|
-
)
|
|
58
|
-
|
|
59
|
-
const distributionType = wasm.RewardDistributionTypeWASM.BlockBasedDistribution(
|
|
60
|
-
BigInt(111),
|
|
61
|
-
distributionFunction
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
const perpetualDistribution = new wasm.TokenPerpetualDistributionWASM(
|
|
65
|
-
distributionType,
|
|
66
|
-
recipient
|
|
67
|
-
)
|
|
68
|
-
|
|
69
|
-
const distributionRules = new wasm.TokenDistributionRulesWASM(
|
|
70
|
-
perpetualDistribution,
|
|
71
|
-
changeRules,
|
|
72
|
-
preProgrammedDistribution,
|
|
73
|
-
identifier,
|
|
74
|
-
changeRules,
|
|
75
|
-
true,
|
|
76
|
-
changeRules,
|
|
77
|
-
changeRules
|
|
78
|
-
)
|
|
79
|
-
|
|
80
|
-
assert.notEqual(distributionRules.__wbg_ptr, 0)
|
|
81
|
-
assert.notEqual(perpetualDistribution.__wbg_ptr, 0)
|
|
82
|
-
assert.notEqual(preProgrammedDistribution.__wbg_ptr, 0)
|
|
83
|
-
assert.notEqual(changeRules.__wbg_ptr, 0)
|
|
84
|
-
})
|
|
85
|
-
})
|
|
86
|
-
|
|
87
|
-
describe('getters', function () {
|
|
88
|
-
it('shoulda allow to get values', () => {
|
|
89
|
-
const noOne = wasm.AuthorizedActionTakersWASM.NoOne()
|
|
90
|
-
|
|
91
|
-
const changeRules = new wasm.ChangeControlRulesWASM(
|
|
92
|
-
noOne,
|
|
93
|
-
noOne,
|
|
94
|
-
true,
|
|
95
|
-
true,
|
|
96
|
-
true
|
|
97
|
-
)
|
|
98
|
-
|
|
99
|
-
const preProgrammedDistribution = new wasm.TokenPreProgrammedDistributionWASM(
|
|
100
|
-
{
|
|
101
|
-
1750140416485: {
|
|
102
|
-
PJUBWbXWmzEYCs99rAAbnCiHRzrnhKLQrXbmSsuPBYB: BigInt(10000)
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
const recipient = wasm.TokenDistributionRecipientWASM.ContractOwner()
|
|
108
|
-
|
|
109
|
-
const distributionFunction = wasm.DistributionFunctionWASM.FixedAmountDistribution(
|
|
110
|
-
BigInt(111)
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
const distributionType = wasm.RewardDistributionTypeWASM.BlockBasedDistribution(
|
|
114
|
-
BigInt(111),
|
|
115
|
-
distributionFunction
|
|
116
|
-
)
|
|
117
|
-
|
|
118
|
-
const perpetualDistribution = new wasm.TokenPerpetualDistributionWASM(
|
|
119
|
-
distributionType,
|
|
120
|
-
recipient
|
|
121
|
-
)
|
|
122
|
-
|
|
123
|
-
const distributionRules = new wasm.TokenDistributionRulesWASM(
|
|
124
|
-
perpetualDistribution,
|
|
125
|
-
changeRules,
|
|
126
|
-
preProgrammedDistribution,
|
|
127
|
-
identifier,
|
|
128
|
-
changeRules,
|
|
129
|
-
true,
|
|
130
|
-
changeRules,
|
|
131
|
-
changeRules
|
|
132
|
-
)
|
|
133
|
-
|
|
134
|
-
assert.deepEqual(distributionRules.perpetualDistribution.constructor.name, 'TokenPerpetualDistributionWASM')
|
|
135
|
-
assert.deepEqual(distributionRules.perpetualDistributionRules.constructor.name, 'ChangeControlRulesWASM')
|
|
136
|
-
assert.deepEqual(distributionRules.preProgrammedDistribution.constructor.name, 'TokenPreProgrammedDistributionWASM')
|
|
137
|
-
assert.deepEqual(distributionRules.newTokenDestinationIdentity.constructor.name, 'IdentifierWASM')
|
|
138
|
-
assert.deepEqual(distributionRules.newTokenDestinationIdentityRules.constructor.name, 'ChangeControlRulesWASM')
|
|
139
|
-
assert.deepEqual(distributionRules.mintingAllowChoosingDestination, true)
|
|
140
|
-
assert.deepEqual(distributionRules.mintingAllowChoosingDestinationRules.constructor.name, 'ChangeControlRulesWASM')
|
|
141
|
-
assert.deepEqual(distributionRules.changeDirectPurchasePricingRules.constructor.name, 'ChangeControlRulesWASM')
|
|
142
|
-
})
|
|
143
|
-
})
|
|
144
|
-
|
|
145
|
-
describe('setters', function () {
|
|
146
|
-
let noOne
|
|
147
|
-
|
|
148
|
-
let changeRules
|
|
149
|
-
|
|
150
|
-
let preProgrammedDistribution
|
|
151
|
-
|
|
152
|
-
let recipient
|
|
153
|
-
|
|
154
|
-
let distributionFunction
|
|
155
|
-
|
|
156
|
-
let distributionType
|
|
157
|
-
|
|
158
|
-
let perpetualDistribution
|
|
159
|
-
|
|
160
|
-
let distributionRules
|
|
161
|
-
|
|
162
|
-
before(() => {
|
|
163
|
-
noOne = wasm.AuthorizedActionTakersWASM.NoOne()
|
|
164
|
-
changeRules = new wasm.ChangeControlRulesWASM(
|
|
165
|
-
noOne,
|
|
166
|
-
noOne,
|
|
167
|
-
true,
|
|
168
|
-
true,
|
|
169
|
-
true
|
|
170
|
-
)
|
|
171
|
-
preProgrammedDistribution = new wasm.TokenPreProgrammedDistributionWASM(
|
|
172
|
-
{
|
|
173
|
-
1750140416485: {
|
|
174
|
-
PJUBWbXWmzEYCs99rAAbnCiHRzrnhKLQrXbmSsuPBYB: BigInt(10000)
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
)
|
|
178
|
-
recipient = wasm.TokenDistributionRecipientWASM.ContractOwner()
|
|
179
|
-
distributionFunction = wasm.DistributionFunctionWASM.FixedAmountDistribution(
|
|
180
|
-
BigInt(111)
|
|
181
|
-
)
|
|
182
|
-
distributionType = wasm.RewardDistributionTypeWASM.BlockBasedDistribution(
|
|
183
|
-
BigInt(111),
|
|
184
|
-
distributionFunction
|
|
185
|
-
)
|
|
186
|
-
perpetualDistribution = new wasm.TokenPerpetualDistributionWASM(
|
|
187
|
-
distributionType,
|
|
188
|
-
recipient
|
|
189
|
-
)
|
|
190
|
-
distributionRules = new wasm.TokenDistributionRulesWASM(
|
|
191
|
-
perpetualDistribution,
|
|
192
|
-
changeRules,
|
|
193
|
-
preProgrammedDistribution,
|
|
194
|
-
identifier,
|
|
195
|
-
changeRules,
|
|
196
|
-
true,
|
|
197
|
-
changeRules,
|
|
198
|
-
changeRules
|
|
199
|
-
)
|
|
200
|
-
})
|
|
201
|
-
|
|
202
|
-
it('should allow to set mintingAllowChoosingDestination', () => {
|
|
203
|
-
distributionRules.mintingAllowChoosingDestination = false
|
|
204
|
-
|
|
205
|
-
assert.deepEqual(distributionRules.mintingAllowChoosingDestination, false)
|
|
206
|
-
})
|
|
207
|
-
|
|
208
|
-
it('should allow to set changeDirectPurchasePricingRules', () => {
|
|
209
|
-
const newRules = new wasm.ChangeControlRulesWASM(
|
|
210
|
-
noOne,
|
|
211
|
-
noOne,
|
|
212
|
-
false,
|
|
213
|
-
false,
|
|
214
|
-
false
|
|
215
|
-
)
|
|
216
|
-
|
|
217
|
-
distributionRules.changeDirectPurchasePricingRules = newRules
|
|
218
|
-
|
|
219
|
-
assert.notEqual(newRules.__wbg_ptr, 0)
|
|
220
|
-
assert.deepEqual(distributionRules.changeDirectPurchasePricingRules.selfChangingAdminActionTakersAllowed, false)
|
|
221
|
-
assert.deepEqual(distributionRules.changeDirectPurchasePricingRules.changingAdminActionTakersToNoOneAllowed, false)
|
|
222
|
-
assert.deepEqual(distributionRules.changeDirectPurchasePricingRules.changingAuthorizedActionTakersToNoOneAllowed, false)
|
|
223
|
-
})
|
|
224
|
-
|
|
225
|
-
it('should allow to set mintingAllowChoosingDestinationRules', () => {
|
|
226
|
-
const newRules = new wasm.ChangeControlRulesWASM(
|
|
227
|
-
noOne,
|
|
228
|
-
noOne,
|
|
229
|
-
false,
|
|
230
|
-
false,
|
|
231
|
-
false
|
|
232
|
-
)
|
|
233
|
-
|
|
234
|
-
distributionRules.mintingAllowChoosingDestinationRules = newRules
|
|
235
|
-
|
|
236
|
-
assert.notEqual(newRules.__wbg_ptr, 0)
|
|
237
|
-
assert.deepEqual(distributionRules.mintingAllowChoosingDestinationRules.selfChangingAdminActionTakersAllowed, false)
|
|
238
|
-
assert.deepEqual(distributionRules.mintingAllowChoosingDestinationRules.changingAdminActionTakersToNoOneAllowed, false)
|
|
239
|
-
assert.deepEqual(distributionRules.mintingAllowChoosingDestinationRules.changingAuthorizedActionTakersToNoOneAllowed, false)
|
|
240
|
-
})
|
|
241
|
-
|
|
242
|
-
it('should allow to set newTokenDestinationIdentityRules', () => {
|
|
243
|
-
const newRules = new wasm.ChangeControlRulesWASM(
|
|
244
|
-
noOne,
|
|
245
|
-
noOne,
|
|
246
|
-
false,
|
|
247
|
-
false,
|
|
248
|
-
false
|
|
249
|
-
)
|
|
250
|
-
|
|
251
|
-
distributionRules.newTokenDestinationIdentityRules = newRules
|
|
252
|
-
|
|
253
|
-
assert.notEqual(newRules.__wbg_ptr, 0)
|
|
254
|
-
assert.deepEqual(distributionRules.newTokenDestinationIdentityRules.selfChangingAdminActionTakersAllowed, false)
|
|
255
|
-
assert.deepEqual(distributionRules.newTokenDestinationIdentityRules.changingAdminActionTakersToNoOneAllowed, false)
|
|
256
|
-
assert.deepEqual(distributionRules.newTokenDestinationIdentityRules.changingAuthorizedActionTakersToNoOneAllowed, false)
|
|
257
|
-
})
|
|
258
|
-
|
|
259
|
-
it('should allow to set newTokenDestinationIdentity', () => {
|
|
260
|
-
distributionRules.newTokenDestinationIdentity = '12p3355tKpjLinncBYeMsXkdDYXCbsFzzVmssce6pSJ1'
|
|
261
|
-
|
|
262
|
-
assert.deepEqual(distributionRules.newTokenDestinationIdentity.base58(), '12p3355tKpjLinncBYeMsXkdDYXCbsFzzVmssce6pSJ1')
|
|
263
|
-
})
|
|
264
|
-
|
|
265
|
-
it('should allow to set preProgrammedDistribution', () => {
|
|
266
|
-
const newPreProgrammedDistribution = new wasm.TokenPreProgrammedDistributionWASM(
|
|
267
|
-
{
|
|
268
|
-
1750140416411: {
|
|
269
|
-
PJUBWbXWmzEYCs99rAAbnCiHRzrnhKLQrXbmSsuPBYB: BigInt(10011120)
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
)
|
|
273
|
-
|
|
274
|
-
distributionRules.preProgrammedDistribution = newPreProgrammedDistribution
|
|
275
|
-
|
|
276
|
-
assert.notEqual(newPreProgrammedDistribution.__wbg_ptr, 0)
|
|
277
|
-
assert.deepEqual(distributionRules.preProgrammedDistribution.distributions, {
|
|
278
|
-
1750140416411: {
|
|
279
|
-
PJUBWbXWmzEYCs99rAAbnCiHRzrnhKLQrXbmSsuPBYB: BigInt(10011120)
|
|
280
|
-
}
|
|
281
|
-
})
|
|
282
|
-
})
|
|
283
|
-
|
|
284
|
-
it('should allow to set perpetualDistributionRules', () => {
|
|
285
|
-
const newPerpetualDistributionRules = new wasm.ChangeControlRulesWASM(
|
|
286
|
-
noOne,
|
|
287
|
-
noOne,
|
|
288
|
-
false,
|
|
289
|
-
false,
|
|
290
|
-
false
|
|
291
|
-
)
|
|
292
|
-
|
|
293
|
-
distributionRules.perpetualDistributionRules = newPerpetualDistributionRules
|
|
294
|
-
|
|
295
|
-
assert.notEqual(newPerpetualDistributionRules.__wbg_ptr, 0)
|
|
296
|
-
assert.deepEqual(distributionRules.perpetualDistributionRules.changingAuthorizedActionTakersToNoOneAllowed, false)
|
|
297
|
-
})
|
|
298
|
-
|
|
299
|
-
it('should allow to set perpetualDistribution', () => {
|
|
300
|
-
const newRecipient = wasm.TokenDistributionRecipientWASM.EvonodesByParticipation()
|
|
301
|
-
|
|
302
|
-
const newPerpetualDistribution = new wasm.TokenPerpetualDistributionWASM(
|
|
303
|
-
distributionType,
|
|
304
|
-
newRecipient
|
|
305
|
-
)
|
|
306
|
-
|
|
307
|
-
distributionRules.perpetualDistribution = newPerpetualDistribution
|
|
308
|
-
|
|
309
|
-
assert.notEqual(newPerpetualDistribution.__wbg_ptr, 0)
|
|
310
|
-
assert.deepEqual(distributionRules.perpetualDistribution.distributionRecipient.getType(), 'EvonodesByParticipation')
|
|
311
|
-
})
|
|
312
|
-
})
|
|
313
|
-
})
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
const assert = require('assert')
|
|
2
|
-
const { describe, it } = require('mocha')
|
|
3
|
-
const { default: wasm } = require('..')
|
|
4
|
-
|
|
5
|
-
describe('TokenKeepsHistoryRules', function () {
|
|
6
|
-
describe('serialization / deserialization', function () {
|
|
7
|
-
it('should allow to create TokenKeepsHistoryRules from values', function () {
|
|
8
|
-
const keepHistory = new wasm.TokenKeepsHistoryRulesWASM(
|
|
9
|
-
true,
|
|
10
|
-
true,
|
|
11
|
-
true,
|
|
12
|
-
true,
|
|
13
|
-
true,
|
|
14
|
-
true
|
|
15
|
-
)
|
|
16
|
-
|
|
17
|
-
assert.notEqual(keepHistory.__wbg_ptr, 0)
|
|
18
|
-
})
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
describe('getters', function () {
|
|
22
|
-
it('should allow to get values', function () {
|
|
23
|
-
const keepHistory = new wasm.TokenKeepsHistoryRulesWASM(
|
|
24
|
-
true,
|
|
25
|
-
true,
|
|
26
|
-
true,
|
|
27
|
-
true,
|
|
28
|
-
true,
|
|
29
|
-
true
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
assert.equal(keepHistory.keepsTransferHistory, true)
|
|
33
|
-
assert.equal(keepHistory.keepsFreezingHistory, true)
|
|
34
|
-
assert.equal(keepHistory.keepsMintingHistory, true)
|
|
35
|
-
assert.equal(keepHistory.keepsBurningHistory, true)
|
|
36
|
-
assert.equal(keepHistory.keepsDirectPricingHistory, true)
|
|
37
|
-
assert.equal(keepHistory.keepsDirectPurchaseHistory, true)
|
|
38
|
-
})
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
describe('setters', function () {
|
|
42
|
-
it('should allow to set values', function () {
|
|
43
|
-
const keepHistory = new wasm.TokenKeepsHistoryRulesWASM(
|
|
44
|
-
true,
|
|
45
|
-
true,
|
|
46
|
-
true,
|
|
47
|
-
true,
|
|
48
|
-
true,
|
|
49
|
-
true
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
keepHistory.keepsTransferHistory = false
|
|
53
|
-
keepHistory.keepsFreezingHistory = false
|
|
54
|
-
keepHistory.keepsMintingHistory = false
|
|
55
|
-
keepHistory.keepsBurningHistory = false
|
|
56
|
-
keepHistory.keepsDirectPricingHistory = false
|
|
57
|
-
keepHistory.keepsDirectPurchaseHistory = false
|
|
58
|
-
|
|
59
|
-
assert.equal(keepHistory.keepsTransferHistory, false)
|
|
60
|
-
assert.equal(keepHistory.keepsFreezingHistory, false)
|
|
61
|
-
assert.equal(keepHistory.keepsMintingHistory, false)
|
|
62
|
-
assert.equal(keepHistory.keepsBurningHistory, false)
|
|
63
|
-
assert.equal(keepHistory.keepsDirectPricingHistory, false)
|
|
64
|
-
assert.equal(keepHistory.keepsDirectPurchaseHistory, false)
|
|
65
|
-
})
|
|
66
|
-
})
|
|
67
|
-
})
|