pshenmic-dpp 1.1.2-dev.8 → 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 -148
- 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 -5266
- package/dist/wasm/pshenmic_dpp.js +0 -25608
- 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 -1636
- 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,82 +0,0 @@
|
|
|
1
|
-
const assert = require('assert')
|
|
2
|
-
const { describe, it, before } = require('mocha')
|
|
3
|
-
const { default: wasm } = require('pshenmic-dpp')
|
|
4
|
-
|
|
5
|
-
let identifierBytes
|
|
6
|
-
|
|
7
|
-
describe('Identifier', function () {
|
|
8
|
-
before(async function () {
|
|
9
|
-
identifierBytes = Uint8Array.from([9, 40, 40, 237, 192, 129, 211, 186, 26, 84, 240, 67, 37, 155, 148, 19, 104, 242, 199, 24, 136, 27, 6, 169, 211, 71, 136, 59, 33, 191, 227, 19])
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
describe('serialization / deserialization', function () {
|
|
13
|
-
it('should allows to create Identifier from base58', function () {
|
|
14
|
-
const identifier = wasm.IdentifierWASM.fromBase58('ckBqfQe7LU7vwrwXopyCB4n5phZShjA16BGhNGpsD5U')
|
|
15
|
-
|
|
16
|
-
assert.deepEqual(identifier.bytes(), identifierBytes)
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
it('should allows to create Identifier from base64', function () {
|
|
20
|
-
const identifier = wasm.IdentifierWASM.fromBase64('CSgo7cCB07oaVPBDJZuUE2jyxxiIGwap00eIOyG/4xM=')
|
|
21
|
-
|
|
22
|
-
assert.deepEqual(identifier.bytes(), identifierBytes)
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
it('should allows to create Identifier from hex', function () {
|
|
26
|
-
const identifier = wasm.IdentifierWASM.fromHex('092828edc081d3ba1a54f043259b941368f2c718881b06a9d347883b21bfe313')
|
|
27
|
-
|
|
28
|
-
assert.deepEqual(identifier.bytes(), identifierBytes)
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
it('should allows to create Identifier from bytes', function () {
|
|
32
|
-
const identifier = wasm.IdentifierWASM.fromBytes(identifierBytes)
|
|
33
|
-
|
|
34
|
-
assert.deepEqual(identifier.bytes(), identifierBytes)
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
it('should allows to create Identifier from Identifier', function () {
|
|
38
|
-
const identifier = wasm.IdentifierWASM.fromBytes(identifierBytes)
|
|
39
|
-
const identifier2 = new wasm.IdentifierWASM(identifier)
|
|
40
|
-
|
|
41
|
-
assert.deepEqual(identifier2.bytes(), identifierBytes)
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
it('should allows to create Identifier from bytes in constructor', function () {
|
|
45
|
-
const identifier = new wasm.IdentifierWASM(identifierBytes)
|
|
46
|
-
|
|
47
|
-
assert.deepEqual(identifier.bytes(), identifierBytes)
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
it('should allows to create Identifier from base58 in constructor', function () {
|
|
51
|
-
const identifier = new wasm.IdentifierWASM('ckBqfQe7LU7vwrwXopyCB4n5phZShjA16BGhNGpsD5U')
|
|
52
|
-
|
|
53
|
-
assert.deepEqual(identifier.bytes(), identifierBytes)
|
|
54
|
-
})
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
describe('getters', function () {
|
|
58
|
-
it('should allow to get identifier base58', function () {
|
|
59
|
-
const identifier = wasm.IdentifierWASM.fromBase58('ckBqfQe7LU7vwrwXopyCB4n5phZShjA16BGhNGpsD5U')
|
|
60
|
-
|
|
61
|
-
assert.equal(identifier.base58(), 'ckBqfQe7LU7vwrwXopyCB4n5phZShjA16BGhNGpsD5U')
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
it('should allow to get identifier base64', function () {
|
|
65
|
-
const identifier = wasm.IdentifierWASM.fromBase58('ckBqfQe7LU7vwrwXopyCB4n5phZShjA16BGhNGpsD5U')
|
|
66
|
-
|
|
67
|
-
assert.equal(identifier.base64(), 'CSgo7cCB07oaVPBDJZuUE2jyxxiIGwap00eIOyG/4xM=')
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
it('should allow to get identifier hex', function () {
|
|
71
|
-
const identifier = wasm.IdentifierWASM.fromBase58('ckBqfQe7LU7vwrwXopyCB4n5phZShjA16BGhNGpsD5U')
|
|
72
|
-
|
|
73
|
-
assert.equal(identifier.hex(), '092828edc081d3ba1a54f043259b941368f2c718881b06a9d347883b21bfe313')
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
it('should allow to get identifier bytes', function () {
|
|
77
|
-
const identifier = wasm.IdentifierWASM.fromBase58('ckBqfQe7LU7vwrwXopyCB4n5phZShjA16BGhNGpsD5U')
|
|
78
|
-
|
|
79
|
-
assert.deepEqual(identifier.bytes(), identifierBytes)
|
|
80
|
-
})
|
|
81
|
-
})
|
|
82
|
-
})
|
package/tests/Identity.spec.cjs
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
const assert = require('assert')
|
|
2
|
-
const { describe, it } = require('mocha')
|
|
3
|
-
const { identifier, identityBytesWithoutKeys, identifierBytes, balance, revision } = require('./mocks/Identity')
|
|
4
|
-
const { keyId, purpose, securityLevel, keyType, binaryData } = require('./mocks/PublicKey')
|
|
5
|
-
const { default: wasm } = require('..')
|
|
6
|
-
|
|
7
|
-
describe('Identity', function () {
|
|
8
|
-
describe('serialization / deserialization', function () {
|
|
9
|
-
it('should generate identity from identifier', async function () {
|
|
10
|
-
const identity = new wasm.IdentityWASM(identifier)
|
|
11
|
-
|
|
12
|
-
assert.notEqual(identity.__wbg_ptr, 0)
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
it('should generate identity from identifier and return bytes', async function () {
|
|
16
|
-
const identity = new wasm.IdentityWASM(identifier)
|
|
17
|
-
|
|
18
|
-
assert.deepEqual(Array.from(identity.bytes()), identityBytesWithoutKeys)
|
|
19
|
-
|
|
20
|
-
const newIdentity = wasm.IdentityWASM.fromBytes(identity.bytes())
|
|
21
|
-
|
|
22
|
-
assert.notEqual(identity.__wbg_ptr, 0)
|
|
23
|
-
assert.notEqual(newIdentity.__wbg_ptr, 0)
|
|
24
|
-
})
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
describe('getters', function () {
|
|
28
|
-
it('should get id buffer', function () {
|
|
29
|
-
const identity = new wasm.IdentityWASM(identifier)
|
|
30
|
-
|
|
31
|
-
assert.deepEqual(identity.id.bytes(), Uint8Array.from(identifierBytes))
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
it('should get balance', function () {
|
|
35
|
-
const identity = new wasm.IdentityWASM(identifier)
|
|
36
|
-
|
|
37
|
-
assert.deepEqual(identity.balance, BigInt(0))
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
it('should get revision', function () {
|
|
41
|
-
const identity = new wasm.IdentityWASM(identifier)
|
|
42
|
-
|
|
43
|
-
assert.deepEqual(identity.revision, BigInt(0))
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
it('should get public keys', function () {
|
|
47
|
-
const identity = new wasm.IdentityWASM(identifier)
|
|
48
|
-
|
|
49
|
-
const pubKey = new wasm.IdentityPublicKeyWASM(
|
|
50
|
-
keyId,
|
|
51
|
-
purpose,
|
|
52
|
-
securityLevel,
|
|
53
|
-
keyType,
|
|
54
|
-
false,
|
|
55
|
-
binaryData)
|
|
56
|
-
|
|
57
|
-
const pubKey2 = new wasm.IdentityPublicKeyWASM(
|
|
58
|
-
keyId + 1,
|
|
59
|
-
purpose,
|
|
60
|
-
securityLevel,
|
|
61
|
-
keyType,
|
|
62
|
-
false,
|
|
63
|
-
binaryData)
|
|
64
|
-
|
|
65
|
-
identity.addPublicKey(pubKey)
|
|
66
|
-
identity.addPublicKey(pubKey2)
|
|
67
|
-
|
|
68
|
-
assert.equal(identity.getPublicKeys().length, 2)
|
|
69
|
-
})
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
describe('setters', function () {
|
|
73
|
-
it('should allows to set public key', function () {
|
|
74
|
-
const pubKey = new wasm.IdentityPublicKeyWASM(
|
|
75
|
-
keyId,
|
|
76
|
-
purpose,
|
|
77
|
-
securityLevel,
|
|
78
|
-
keyType,
|
|
79
|
-
false,
|
|
80
|
-
binaryData)
|
|
81
|
-
|
|
82
|
-
const identity = new wasm.IdentityWASM(identifier)
|
|
83
|
-
|
|
84
|
-
identity.addPublicKey(pubKey)
|
|
85
|
-
|
|
86
|
-
assert.notEqual(identity.__wbg_ptr, 0)
|
|
87
|
-
|
|
88
|
-
assert.deepEqual(identity.getPublicKeyById(keyId).bytes(), pubKey.bytes())
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
it('should allows to set balance', function () {
|
|
92
|
-
const identity = new wasm.IdentityWASM(identifier)
|
|
93
|
-
|
|
94
|
-
identity.balance = balance
|
|
95
|
-
|
|
96
|
-
assert.equal(identity.balance, balance)
|
|
97
|
-
})
|
|
98
|
-
|
|
99
|
-
it('should allows to set revision', function () {
|
|
100
|
-
const identity = new wasm.IdentityWASM(identifier)
|
|
101
|
-
|
|
102
|
-
identity.revision = revision
|
|
103
|
-
|
|
104
|
-
assert.equal(identity.revision, revision)
|
|
105
|
-
})
|
|
106
|
-
})
|
|
107
|
-
})
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
const assert = require('assert')
|
|
2
|
-
const { describe, it } = require('mocha')
|
|
3
|
-
const { default: wasm } = require('..')
|
|
4
|
-
|
|
5
|
-
describe('IdentityCreateTransition', function () {
|
|
6
|
-
describe('serialization / deserialization', function () {
|
|
7
|
-
it('should allow to create transition', function () {
|
|
8
|
-
const transition = wasm.IdentityCreateTransitionWASM.default(1)
|
|
9
|
-
|
|
10
|
-
assert.notEqual(transition.__wbg_ptr, 0)
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
it('should allow to serialize to bytes', function () {
|
|
14
|
-
const transition = wasm.IdentityCreateTransitionWASM.default(1)
|
|
15
|
-
|
|
16
|
-
const bytes = transition.bytes()
|
|
17
|
-
|
|
18
|
-
assert.equal(bytes.length > 0, true)
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
it('should allow to deserialize to bytes', function () {
|
|
22
|
-
const bytes = [0, 0, 0, 162, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 0, 255, 255, 255, 255, 1, 255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
|
23
|
-
|
|
24
|
-
const transition = wasm.IdentityCreateTransitionWASM.fromBytes(bytes)
|
|
25
|
-
|
|
26
|
-
assert.notEqual(transition.__wbg_ptr, 0)
|
|
27
|
-
})
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
describe('getters', function () {
|
|
31
|
-
it('should allow to get userFeeIncrease', function () {
|
|
32
|
-
const transition = wasm.IdentityCreateTransitionWASM.default(1)
|
|
33
|
-
|
|
34
|
-
assert.equal(transition.userFeeIncrease, 0)
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
it('should allow to get AssetLock', function () {
|
|
38
|
-
const transition = wasm.IdentityCreateTransitionWASM.default(1)
|
|
39
|
-
|
|
40
|
-
assert.notEqual(transition.assetLock.__wbg_ptr, 0)
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
it('should allow to get Identifier', function () {
|
|
44
|
-
const transition = wasm.IdentityCreateTransitionWASM.default(1)
|
|
45
|
-
|
|
46
|
-
assert.equal(transition.getIdentifier().base58(), '11111111111111111111111111111111')
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
it('should allow to get PublicKeys', function () {
|
|
50
|
-
const transition = wasm.IdentityCreateTransitionWASM.default(1)
|
|
51
|
-
|
|
52
|
-
assert.equal(transition.publicKeys.length, 0)
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
it('should allow to get signature', function () {
|
|
56
|
-
const transition = wasm.IdentityCreateTransitionWASM.default(1)
|
|
57
|
-
|
|
58
|
-
assert.deepEqual(transition.signature, Uint8Array.from([]))
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
it('should allow to get signable bytes', function () {
|
|
62
|
-
const transition = wasm.IdentityCreateTransitionWASM.default(1)
|
|
63
|
-
|
|
64
|
-
assert.equal(transition.getSignableBytes().length, 229)
|
|
65
|
-
})
|
|
66
|
-
})
|
|
67
|
-
|
|
68
|
-
describe('setters', function () {
|
|
69
|
-
it('should allow to set the userFeeIncrease', function () {
|
|
70
|
-
const transition = wasm.IdentityCreateTransitionWASM.default(1)
|
|
71
|
-
|
|
72
|
-
transition.userFeeIncrease = 100
|
|
73
|
-
|
|
74
|
-
assert.equal(transition.userFeeIncrease, 100)
|
|
75
|
-
})
|
|
76
|
-
|
|
77
|
-
// TODO: Implement publickeys in creation setter
|
|
78
|
-
// it('should allow to set the publicKeys', function () {
|
|
79
|
-
//
|
|
80
|
-
// })
|
|
81
|
-
|
|
82
|
-
// TODO: Implement asset lock setter
|
|
83
|
-
// it('should allow to set the asset lock', function () {
|
|
84
|
-
//
|
|
85
|
-
// })
|
|
86
|
-
})
|
|
87
|
-
})
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
const assert = require('assert')
|
|
2
|
-
const { describe, it } = require('mocha')
|
|
3
|
-
const { default: wasm } = require('..')
|
|
4
|
-
|
|
5
|
-
describe('IdentityCreditTransferTransition', function () {
|
|
6
|
-
describe('serialization / deserialization', function () {
|
|
7
|
-
it('Should create IdentityCreditTransferTransition with empty platform version', async function () {
|
|
8
|
-
const transition = new wasm.IdentityCreditTransferWASM('11111111111111111111111111111111', BigInt(100), 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec', BigInt(199))
|
|
9
|
-
|
|
10
|
-
assert.notEqual(transition.__wbg_ptr, 0)
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
it('Should create IdentityCreditTransferTransition with non empty platform version', async function () {
|
|
14
|
-
const sender = new wasm.IdentifierWASM('11111111111111111111111111111111')
|
|
15
|
-
const recipient = new wasm.IdentifierWASM('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
16
|
-
|
|
17
|
-
const transition = new wasm.IdentityCreditTransferWASM(sender, BigInt(100), recipient, BigInt(199), 'platform_v1')
|
|
18
|
-
|
|
19
|
-
assert.notEqual(transition.__wbg_ptr, 0)
|
|
20
|
-
assert.notEqual(sender.__wbg_ptr, 0)
|
|
21
|
-
assert.notEqual(recipient.__wbg_ptr, 0)
|
|
22
|
-
})
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
describe('getters', function () {
|
|
26
|
-
it('Should return recipientId', async function () {
|
|
27
|
-
const transition = new wasm.IdentityCreditTransferWASM('11111111111111111111111111111111', BigInt(100), 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec', BigInt(199))
|
|
28
|
-
|
|
29
|
-
assert.deepEqual(transition.recipientId.base58(), 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
30
|
-
})
|
|
31
|
-
|
|
32
|
-
it('Should return senderId', async function () {
|
|
33
|
-
const transition = new wasm.IdentityCreditTransferWASM('11111111111111111111111111111111', BigInt(100), 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec', BigInt(199))
|
|
34
|
-
|
|
35
|
-
assert.deepEqual(transition.senderId.base58(), '11111111111111111111111111111111')
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
it('Should return amount', async function () {
|
|
39
|
-
const transition = new wasm.IdentityCreditTransferWASM('11111111111111111111111111111111', BigInt(100), 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec', BigInt(199))
|
|
40
|
-
|
|
41
|
-
assert.deepEqual(transition.amount, BigInt(100))
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
it('Should return nonce', async function () {
|
|
45
|
-
const transition = new wasm.IdentityCreditTransferWASM('11111111111111111111111111111111', BigInt(100), 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec', BigInt(199))
|
|
46
|
-
|
|
47
|
-
assert.deepEqual(transition.nonce, BigInt(199))
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
it('Should return signature', async function () {
|
|
51
|
-
const transition = new wasm.IdentityCreditTransferWASM('11111111111111111111111111111111', BigInt(100), 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec', BigInt(199))
|
|
52
|
-
|
|
53
|
-
assert.deepEqual(transition.signature, Uint8Array.from([]))
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
it('Should return signaturePublicKeyId', async function () {
|
|
57
|
-
const transition = new wasm.IdentityCreditTransferWASM('11111111111111111111111111111111', BigInt(100), 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec', BigInt(199))
|
|
58
|
-
|
|
59
|
-
assert.deepEqual(transition.signaturePublicKeyId, 0)
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
it('Should return userFeeIncrease', async function () {
|
|
63
|
-
const transition = new wasm.IdentityCreditTransferWASM('11111111111111111111111111111111', BigInt(100), 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec', BigInt(199))
|
|
64
|
-
|
|
65
|
-
assert.deepEqual(transition.userFeeIncrease, 0)
|
|
66
|
-
})
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
describe('setters', function () {
|
|
70
|
-
it('Should allow to set recipientId', async function () {
|
|
71
|
-
const transition = new wasm.IdentityCreditTransferWASM('11111111111111111111111111111111', BigInt(100), 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec', BigInt(199))
|
|
72
|
-
|
|
73
|
-
const recipient = new wasm.IdentifierWASM('11111111111111111111111111111111')
|
|
74
|
-
|
|
75
|
-
transition.recipientId = recipient
|
|
76
|
-
|
|
77
|
-
assert.deepEqual(transition.recipientId.base58(), '11111111111111111111111111111111')
|
|
78
|
-
|
|
79
|
-
transition.recipientId = 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec'
|
|
80
|
-
|
|
81
|
-
assert.deepEqual(transition.recipientId.base58(), 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
82
|
-
assert.notEqual(recipient.__wbg_ptr, 0)
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
it('Should return senderId', async function () {
|
|
86
|
-
const transition = new wasm.IdentityCreditTransferWASM('11111111111111111111111111111111', BigInt(100), 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec', BigInt(199))
|
|
87
|
-
|
|
88
|
-
const sender = new wasm.IdentifierWASM('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
89
|
-
|
|
90
|
-
transition.senderId = sender
|
|
91
|
-
|
|
92
|
-
assert.deepEqual(transition.senderId.base58(), 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
93
|
-
|
|
94
|
-
transition.senderId = '11111111111111111111111111111111'
|
|
95
|
-
|
|
96
|
-
assert.notEqual(sender.__wbg_ptr, 0)
|
|
97
|
-
assert.deepEqual(transition.senderId.base58(), '11111111111111111111111111111111')
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
it('Should return amount', async function () {
|
|
101
|
-
const transition = new wasm.IdentityCreditTransferWASM('11111111111111111111111111111111', BigInt(100), 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec', BigInt(199))
|
|
102
|
-
|
|
103
|
-
transition.amount = BigInt(199)
|
|
104
|
-
|
|
105
|
-
assert.deepEqual(transition.amount, BigInt(199))
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
it('Should return nonce', async function () {
|
|
109
|
-
const transition = new wasm.IdentityCreditTransferWASM('11111111111111111111111111111111', BigInt(100), 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec', BigInt(199))
|
|
110
|
-
|
|
111
|
-
transition.nonce = BigInt(1)
|
|
112
|
-
|
|
113
|
-
assert.deepEqual(transition.nonce, BigInt(1))
|
|
114
|
-
})
|
|
115
|
-
|
|
116
|
-
it('Should return signature', async function () {
|
|
117
|
-
const transition = new wasm.IdentityCreditTransferWASM('11111111111111111111111111111111', BigInt(100), 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec', BigInt(199))
|
|
118
|
-
|
|
119
|
-
transition.signature = [1, 1]
|
|
120
|
-
|
|
121
|
-
assert.deepEqual(transition.signature, Uint8Array.from([1, 1]))
|
|
122
|
-
})
|
|
123
|
-
|
|
124
|
-
it('Should return signaturePublicKeyId', async function () {
|
|
125
|
-
const transition = new wasm.IdentityCreditTransferWASM('11111111111111111111111111111111', BigInt(100), 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec', BigInt(199))
|
|
126
|
-
|
|
127
|
-
transition.signaturePublicKeyId = 11
|
|
128
|
-
|
|
129
|
-
assert.deepEqual(transition.signaturePublicKeyId, 11)
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
it('Should return userFeeIncrease', async function () {
|
|
133
|
-
const transition = new wasm.IdentityCreditTransferWASM('11111111111111111111111111111111', BigInt(100), 'GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec', BigInt(199))
|
|
134
|
-
|
|
135
|
-
transition.userFeeIncrease = 11
|
|
136
|
-
|
|
137
|
-
assert.deepEqual(transition.userFeeIncrease, 11)
|
|
138
|
-
})
|
|
139
|
-
})
|
|
140
|
-
})
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
const assert = require('assert')
|
|
2
|
-
const { describe, it } = require('mocha')
|
|
3
|
-
const { default: wasm } = require('..')
|
|
4
|
-
|
|
5
|
-
describe('IdentityCreditWithdrawalTransition', function () {
|
|
6
|
-
describe('serialization / deserialization', function () {
|
|
7
|
-
it('Should allow to create IdentityCreditWithdrawalTransition', function () {
|
|
8
|
-
const identifier = new wasm.IdentifierWASM('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
9
|
-
const script = wasm.CoreScriptWASM.newP2PKH([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
|
|
10
|
-
|
|
11
|
-
const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', BigInt(1), script, 1)
|
|
12
|
-
|
|
13
|
-
assert.notEqual(identifier.__wbg_ptr, 0)
|
|
14
|
-
assert.notEqual(script.__wbg_ptr, 0)
|
|
15
|
-
assert.notEqual(transition.__wbg_ptr, 0)
|
|
16
|
-
})
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
describe('getters', function () {
|
|
20
|
-
it('Should allow to get outputScript', function () {
|
|
21
|
-
const identifier = new wasm.IdentifierWASM('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
22
|
-
const script = wasm.CoreScriptWASM.newP2PKH([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
|
|
23
|
-
|
|
24
|
-
const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', BigInt(1), script, 1)
|
|
25
|
-
|
|
26
|
-
assert.deepEqual(transition.outputScript.toString(), 'dqkUAQEBAQEBAQEBAQEBAQEBAQEBAQGIrA==')
|
|
27
|
-
})
|
|
28
|
-
|
|
29
|
-
it('Should allow to get pooling', function () {
|
|
30
|
-
const identifier = new wasm.IdentifierWASM('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
31
|
-
const script = wasm.CoreScriptWASM.newP2PKH([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
|
|
32
|
-
|
|
33
|
-
const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', BigInt(1), script, 1)
|
|
34
|
-
|
|
35
|
-
assert.deepEqual(transition.pooling, 'Never')
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
it('Should allow to get identityId', function () {
|
|
39
|
-
const identifier = new wasm.IdentifierWASM('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
40
|
-
const script = wasm.CoreScriptWASM.newP2PKH([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
|
|
41
|
-
|
|
42
|
-
const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', BigInt(1), script, 1)
|
|
43
|
-
|
|
44
|
-
assert.deepEqual(transition.identityId.base58(), identifier.base58())
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
it('Should allow to get userFeeIncrease', function () {
|
|
48
|
-
const identifier = new wasm.IdentifierWASM('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
49
|
-
const script = wasm.CoreScriptWASM.newP2PKH([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
|
|
50
|
-
|
|
51
|
-
const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', BigInt(1), script, 1)
|
|
52
|
-
|
|
53
|
-
assert.deepEqual(transition.userFeeIncrease, 1)
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
it('Should allow to get nonce', function () {
|
|
57
|
-
const identifier = new wasm.IdentifierWASM('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
58
|
-
const script = wasm.CoreScriptWASM.newP2PKH([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
|
|
59
|
-
|
|
60
|
-
const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', BigInt(1), script, 1)
|
|
61
|
-
|
|
62
|
-
assert.deepEqual(transition.nonce, BigInt(1))
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
it('Should allow to get amount', function () {
|
|
66
|
-
const identifier = new wasm.IdentifierWASM('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
67
|
-
const script = wasm.CoreScriptWASM.newP2PKH([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
|
|
68
|
-
|
|
69
|
-
const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', BigInt(1), script, 1)
|
|
70
|
-
|
|
71
|
-
assert.deepEqual(transition.amount, BigInt(111))
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
it('Should allow to get signature', function () {
|
|
75
|
-
const identifier = new wasm.IdentifierWASM('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
76
|
-
const script = wasm.CoreScriptWASM.newP2PKH([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
|
|
77
|
-
|
|
78
|
-
const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', BigInt(1), script, 1)
|
|
79
|
-
|
|
80
|
-
assert.deepEqual(transition.signature, Uint8Array.from([]))
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
it('Should allow to get signaturePublicKeyId', function () {
|
|
84
|
-
const identifier = new wasm.IdentifierWASM('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
85
|
-
const script = wasm.CoreScriptWASM.newP2PKH([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
|
|
86
|
-
|
|
87
|
-
const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', BigInt(1), script, 1)
|
|
88
|
-
|
|
89
|
-
assert.deepEqual(transition.signaturePublicKeyId, 0)
|
|
90
|
-
})
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
describe('setters', function () {
|
|
94
|
-
it('Should allow to set outputScript', function () {
|
|
95
|
-
const identifier = new wasm.IdentifierWASM('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
96
|
-
const script = wasm.CoreScriptWASM.newP2PKH([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
|
|
97
|
-
|
|
98
|
-
const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', BigInt(1), script, 1)
|
|
99
|
-
|
|
100
|
-
const script2 = wasm.CoreScriptWASM.newP2PKH([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
|
|
101
|
-
|
|
102
|
-
transition.outputScript = script2
|
|
103
|
-
|
|
104
|
-
assert.deepEqual(transition.outputScript.toString(), script2.toString())
|
|
105
|
-
})
|
|
106
|
-
|
|
107
|
-
it('Should allow to set pooling', function () {
|
|
108
|
-
const identifier = new wasm.IdentifierWASM('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
109
|
-
const script = wasm.CoreScriptWASM.newP2PKH([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
|
|
110
|
-
|
|
111
|
-
const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', BigInt(1), script, 1)
|
|
112
|
-
|
|
113
|
-
transition.pooling = 'Standard'
|
|
114
|
-
|
|
115
|
-
assert.deepEqual(transition.pooling, 'Standard')
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
it('Should allow to set identityId', function () {
|
|
119
|
-
const identifier = new wasm.IdentifierWASM('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
120
|
-
const script = wasm.CoreScriptWASM.newP2PKH([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
|
|
121
|
-
|
|
122
|
-
const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', BigInt(1), script, 1)
|
|
123
|
-
|
|
124
|
-
const identifier2 = new wasm.IdentifierWASM('11SAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
125
|
-
|
|
126
|
-
transition.identityId = identifier2
|
|
127
|
-
|
|
128
|
-
assert.deepEqual(transition.identityId.base58(), identifier2.base58())
|
|
129
|
-
})
|
|
130
|
-
|
|
131
|
-
it('Should allow to set userFeeIncrease', function () {
|
|
132
|
-
const identifier = new wasm.IdentifierWASM('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
133
|
-
const script = wasm.CoreScriptWASM.newP2PKH([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
|
|
134
|
-
|
|
135
|
-
const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', BigInt(1), script, 1)
|
|
136
|
-
|
|
137
|
-
transition.userFeeIncrease = 999
|
|
138
|
-
|
|
139
|
-
assert.deepEqual(transition.userFeeIncrease, 999)
|
|
140
|
-
})
|
|
141
|
-
|
|
142
|
-
it('Should allow to set nonce', function () {
|
|
143
|
-
const identifier = new wasm.IdentifierWASM('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
144
|
-
const script = wasm.CoreScriptWASM.newP2PKH([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
|
|
145
|
-
|
|
146
|
-
const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', BigInt(1), script, 1)
|
|
147
|
-
|
|
148
|
-
transition.nonce = BigInt(1111)
|
|
149
|
-
|
|
150
|
-
assert.deepEqual(transition.nonce, BigInt(1111))
|
|
151
|
-
})
|
|
152
|
-
|
|
153
|
-
it('Should allow to get amount', function () {
|
|
154
|
-
const identifier = new wasm.IdentifierWASM('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
155
|
-
const script = wasm.CoreScriptWASM.newP2PKH([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
|
|
156
|
-
|
|
157
|
-
const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', BigInt(1), script, 1)
|
|
158
|
-
|
|
159
|
-
transition.amount = BigInt(2222)
|
|
160
|
-
|
|
161
|
-
assert.deepEqual(transition.amount, BigInt(2222))
|
|
162
|
-
})
|
|
163
|
-
|
|
164
|
-
it('Should allow to get signature', function () {
|
|
165
|
-
const identifier = new wasm.IdentifierWASM('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
166
|
-
const script = wasm.CoreScriptWASM.newP2PKH([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
|
|
167
|
-
|
|
168
|
-
const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', BigInt(1), script, 1)
|
|
169
|
-
|
|
170
|
-
transition.signature = Uint8Array.from([1, 2, 3])
|
|
171
|
-
|
|
172
|
-
assert.deepEqual(transition.signature, Uint8Array.from([1, 2, 3]))
|
|
173
|
-
})
|
|
174
|
-
|
|
175
|
-
it('Should allow to get signaturePublicKeyId', function () {
|
|
176
|
-
const identifier = new wasm.IdentifierWASM('GWRSAVFMjXx8HpQFaNJMqBV7MBgMK4br5UESsB4S31Ec')
|
|
177
|
-
const script = wasm.CoreScriptWASM.newP2PKH([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
|
|
178
|
-
|
|
179
|
-
const transition = new wasm.IdentityCreditWithdrawalTransitionWASM(identifier, BigInt(111), 1, 'never', BigInt(1), script, 1)
|
|
180
|
-
|
|
181
|
-
transition.signaturePublicKeyId = 11
|
|
182
|
-
|
|
183
|
-
assert.deepEqual(transition.signaturePublicKeyId, 11)
|
|
184
|
-
})
|
|
185
|
-
})
|
|
186
|
-
})
|