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
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
import { VotePollWASM } from './VotePoll.js';
|
|
3
|
+
import { ResourceVoteChoiceWASM } from './ResourceVoteChoice.js';
|
|
4
|
+
export class VoteWASM {
|
|
5
|
+
/** @private **/
|
|
6
|
+
_rawVote;
|
|
7
|
+
constructor(votePoll, resourceVoteChoice) {
|
|
8
|
+
this._rawVote = new dppProvider.dpp.VoteNAPI(votePoll._rawVotePollWASM, resourceVoteChoice._rawResourceVoteChoice);
|
|
9
|
+
}
|
|
10
|
+
get votePoll() {
|
|
11
|
+
return VotePollWASM.createFromRawInstance(this._rawVote.votePoll);
|
|
12
|
+
}
|
|
13
|
+
set votePoll(votePoll) {
|
|
14
|
+
this._rawVote.votePoll = votePoll._rawVotePollWASM;
|
|
15
|
+
}
|
|
16
|
+
get resourceVoteChoice() {
|
|
17
|
+
return ResourceVoteChoiceWASM.createFromRawInstance(this._rawVote.resourceVoteChoice);
|
|
18
|
+
}
|
|
19
|
+
set resourceVoteChoice(resourceVoteChoice) {
|
|
20
|
+
this._rawVote.resourceVoteChoice = resourceVoteChoice._rawResourceVoteChoice;
|
|
21
|
+
}
|
|
22
|
+
static createFromRawInstance(rawInstance) {
|
|
23
|
+
const instance = Object.create(this.prototype);
|
|
24
|
+
instance._rawVote = rawInstance;
|
|
25
|
+
return instance;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { VotePollNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { IdentifierLike } from '../../types.js';
|
|
3
|
+
import { IdentifierWASM } from '../Identifier.js';
|
|
4
|
+
export declare class VotePollWASM {
|
|
5
|
+
/** @private **/
|
|
6
|
+
_rawVotePollWASM: VotePollNAPI;
|
|
7
|
+
constructor(contractId: IdentifierLike, documentTypeName: string, indexName: string, indexValues: string[]);
|
|
8
|
+
get contractId(): IdentifierWASM;
|
|
9
|
+
set contractId(value: IdentifierLike);
|
|
10
|
+
get documentTypeName(): string;
|
|
11
|
+
set documentTypeName(value: string);
|
|
12
|
+
get indexName(): string;
|
|
13
|
+
set indexName(value: string);
|
|
14
|
+
get indexValues(): any;
|
|
15
|
+
set indexValues(values: string[]);
|
|
16
|
+
toString(): string;
|
|
17
|
+
static createFromRawInstance(rawInstance: VotePollNAPI): VotePollWASM;
|
|
18
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
import { prepareIdentifierValue, valueFromDynamicValue, valueToDynamicValue } from '../../utils.js';
|
|
3
|
+
import { IdentifierWASM } from '../Identifier.js';
|
|
4
|
+
export class VotePollWASM {
|
|
5
|
+
/** @private **/
|
|
6
|
+
_rawVotePollWASM;
|
|
7
|
+
constructor(contractId, documentTypeName, indexName, indexValues) {
|
|
8
|
+
this._rawVotePollWASM = new dppProvider.dpp.VotePollNAPI(prepareIdentifierValue(contractId), documentTypeName, indexName, valueToDynamicValue(indexValues));
|
|
9
|
+
}
|
|
10
|
+
get contractId() {
|
|
11
|
+
return IdentifierWASM.createFromRawInstance(this._rawVotePollWASM.contractId);
|
|
12
|
+
}
|
|
13
|
+
set contractId(value) {
|
|
14
|
+
this._rawVotePollWASM.contractId = prepareIdentifierValue(value);
|
|
15
|
+
}
|
|
16
|
+
get documentTypeName() {
|
|
17
|
+
return this._rawVotePollWASM.documentTypeName;
|
|
18
|
+
}
|
|
19
|
+
set documentTypeName(value) {
|
|
20
|
+
this._rawVotePollWASM.documentTypeName = value;
|
|
21
|
+
}
|
|
22
|
+
get indexName() {
|
|
23
|
+
return this._rawVotePollWASM.indexName;
|
|
24
|
+
}
|
|
25
|
+
set indexName(value) {
|
|
26
|
+
this._rawVotePollWASM.indexName = value;
|
|
27
|
+
}
|
|
28
|
+
get indexValues() {
|
|
29
|
+
return valueFromDynamicValue(new dppProvider.dpp.DynamicValue(this._rawVotePollWASM.indexValues));
|
|
30
|
+
}
|
|
31
|
+
set indexValues(values) {
|
|
32
|
+
this._rawVotePollWASM.indexValues = valueToDynamicValue(values);
|
|
33
|
+
}
|
|
34
|
+
toString() {
|
|
35
|
+
return this._rawVotePollWASM.toString();
|
|
36
|
+
}
|
|
37
|
+
static createFromRawInstance(rawInstance) {
|
|
38
|
+
const instance = Object.create(this.prototype);
|
|
39
|
+
instance._rawVotePollWASM = rawInstance;
|
|
40
|
+
return instance;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { PartialIdentityNAPI } from '../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { IdentifierLike } from '../types.js';
|
|
3
|
+
import { IdentityPublicKeyWASM } from './IdentityPublicKey.js';
|
|
4
|
+
import { IdentifierWASM } from './Identifier.js';
|
|
5
|
+
export declare class PartialIdentityWASM {
|
|
6
|
+
/** @private **/
|
|
7
|
+
_rawPartialIdentity: PartialIdentityNAPI;
|
|
8
|
+
constructor(id: IdentifierLike, loadedPublicKeys: {
|
|
9
|
+
[key: number]: IdentityPublicKeyWASM;
|
|
10
|
+
}, balance?: bigint, revision?: bigint, notFoundPublicKeys?: number[]);
|
|
11
|
+
get id(): IdentifierWASM;
|
|
12
|
+
set id(id: IdentifierLike);
|
|
13
|
+
get loadedPublicKeys(): {
|
|
14
|
+
[key: number]: IdentityPublicKeyWASM;
|
|
15
|
+
};
|
|
16
|
+
set loadedPublicKeys(loadedPublicKeys: {
|
|
17
|
+
[key: number]: IdentityPublicKeyWASM;
|
|
18
|
+
});
|
|
19
|
+
get balance(): bigint | undefined;
|
|
20
|
+
set balance(balance: bigint | undefined | null);
|
|
21
|
+
get revision(): bigint | undefined;
|
|
22
|
+
set revision(revision: bigint | undefined | null);
|
|
23
|
+
get notFoundPublicKeys(): number[];
|
|
24
|
+
set notFoundPublicKeys(keys: number[]);
|
|
25
|
+
static createFromRawInstance(rawInstance: PartialIdentityNAPI): PartialIdentityWASM;
|
|
26
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { IdentityPublicKeyWASM } from './IdentityPublicKey.js';
|
|
2
|
+
import { dppProvider } from '../provider.js';
|
|
3
|
+
import { prepareIdentifierValue } from '../utils.js';
|
|
4
|
+
import { IdentifierWASM } from './Identifier.js';
|
|
5
|
+
export class PartialIdentityWASM {
|
|
6
|
+
/** @private **/
|
|
7
|
+
_rawPartialIdentity;
|
|
8
|
+
constructor(id, loadedPublicKeys, balance, revision, notFoundPublicKeys) {
|
|
9
|
+
const publicKeysIds = Object.keys(loadedPublicKeys);
|
|
10
|
+
const normalKeys = [];
|
|
11
|
+
for (const publicKeyId of publicKeysIds) {
|
|
12
|
+
normalKeys.push([
|
|
13
|
+
Number(publicKeyId),
|
|
14
|
+
loadedPublicKeys[Number(publicKeyId)]._rawIdentityPublicKey
|
|
15
|
+
]);
|
|
16
|
+
}
|
|
17
|
+
this._rawPartialIdentity = new dppProvider.dpp.PartialIdentityNAPI(prepareIdentifierValue(id), normalKeys, balance?.toString(), revision?.toString(), notFoundPublicKeys);
|
|
18
|
+
}
|
|
19
|
+
get id() {
|
|
20
|
+
return IdentifierWASM.createFromRawInstance(this._rawPartialIdentity.id);
|
|
21
|
+
}
|
|
22
|
+
set id(id) {
|
|
23
|
+
this._rawPartialIdentity.id = prepareIdentifierValue(id);
|
|
24
|
+
}
|
|
25
|
+
get loadedPublicKeys() {
|
|
26
|
+
const keys = this._rawPartialIdentity.loadedPublicKeys;
|
|
27
|
+
const out = {};
|
|
28
|
+
for (const key of keys) {
|
|
29
|
+
out[key[0]] = IdentityPublicKeyWASM.createFromRawInstance(key[1]);
|
|
30
|
+
}
|
|
31
|
+
return out;
|
|
32
|
+
}
|
|
33
|
+
set loadedPublicKeys(loadedPublicKeys) {
|
|
34
|
+
const publicKeysIds = Object.keys(loadedPublicKeys);
|
|
35
|
+
const normalKeys = [];
|
|
36
|
+
for (const publicKeyId of publicKeysIds) {
|
|
37
|
+
normalKeys.push([
|
|
38
|
+
Number(publicKeyId),
|
|
39
|
+
loadedPublicKeys[Number(publicKeyId)]._rawIdentityPublicKey
|
|
40
|
+
]);
|
|
41
|
+
}
|
|
42
|
+
this._rawPartialIdentity.loadedPublicKeys = normalKeys;
|
|
43
|
+
}
|
|
44
|
+
get balance() {
|
|
45
|
+
const balance = this._rawPartialIdentity.balance;
|
|
46
|
+
return balance != null ? BigInt(balance) : undefined;
|
|
47
|
+
}
|
|
48
|
+
set balance(balance) {
|
|
49
|
+
this._rawPartialIdentity.balance = balance?.toString();
|
|
50
|
+
}
|
|
51
|
+
get revision() {
|
|
52
|
+
const revision = this._rawPartialIdentity.revision;
|
|
53
|
+
return revision != null ? BigInt(revision) : undefined;
|
|
54
|
+
}
|
|
55
|
+
set revision(revision) {
|
|
56
|
+
this._rawPartialIdentity.revision = revision?.toString();
|
|
57
|
+
}
|
|
58
|
+
get notFoundPublicKeys() {
|
|
59
|
+
return this._rawPartialIdentity.notFoundPublicKeys;
|
|
60
|
+
}
|
|
61
|
+
set notFoundPublicKeys(keys) {
|
|
62
|
+
this._rawPartialIdentity.notFoundPublicKeys = keys;
|
|
63
|
+
}
|
|
64
|
+
static createFromRawInstance(rawInstance) {
|
|
65
|
+
const instance = Object.create(this.prototype);
|
|
66
|
+
instance._rawPartialIdentity = rawInstance;
|
|
67
|
+
return instance;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PrivateKeyNAPI } from '../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { NetworkLike } from '../types.js';
|
|
3
|
+
import { PublicKeyWASM } from './PublicKey.js';
|
|
4
|
+
export declare class PrivateKeyWASM {
|
|
5
|
+
/** @private **/
|
|
6
|
+
_rawPrivateKey: PrivateKeyNAPI;
|
|
7
|
+
constructor(key: string | Uint8Array, network: NetworkLike);
|
|
8
|
+
getPublicKey(): PublicKeyWASM;
|
|
9
|
+
getNetwork(): string;
|
|
10
|
+
WIF(): string;
|
|
11
|
+
bytes(): Uint8Array;
|
|
12
|
+
hex(): string;
|
|
13
|
+
getPublicKeyHash(): string;
|
|
14
|
+
sign(data: Uint8Array): Uint8Array;
|
|
15
|
+
signHash(dataHash: Uint8Array): Uint8Array;
|
|
16
|
+
static fromWIF(wif: string): PrivateKeyWASM;
|
|
17
|
+
static fromBytes(bytes: Uint8Array, network: NetworkLike): PrivateKeyWASM;
|
|
18
|
+
static fromHex(hex: string, network: NetworkLike): PrivateKeyWASM;
|
|
19
|
+
static createFromRawInstance(rawInstance: PrivateKeyNAPI): PrivateKeyWASM;
|
|
20
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { dppProvider } from '../provider.js';
|
|
2
|
+
import { valueToDynamicValue } from '../utils.js';
|
|
3
|
+
import { PublicKeyWASM } from './PublicKey.js';
|
|
4
|
+
export class PrivateKeyWASM {
|
|
5
|
+
/** @private **/
|
|
6
|
+
_rawPrivateKey;
|
|
7
|
+
constructor(key, network) {
|
|
8
|
+
this._rawPrivateKey = new dppProvider.dpp.PrivateKeyNAPI(valueToDynamicValue(key), valueToDynamicValue(network));
|
|
9
|
+
}
|
|
10
|
+
getPublicKey() {
|
|
11
|
+
return PublicKeyWASM.createFromRawInstance(this._rawPrivateKey.getPublicKey());
|
|
12
|
+
}
|
|
13
|
+
getNetwork() {
|
|
14
|
+
return this._rawPrivateKey.getNetwork();
|
|
15
|
+
}
|
|
16
|
+
WIF() {
|
|
17
|
+
return this._rawPrivateKey.WIF();
|
|
18
|
+
}
|
|
19
|
+
bytes() {
|
|
20
|
+
return this._rawPrivateKey.bytes();
|
|
21
|
+
}
|
|
22
|
+
hex() {
|
|
23
|
+
return this._rawPrivateKey.hex();
|
|
24
|
+
}
|
|
25
|
+
getPublicKeyHash() {
|
|
26
|
+
return this._rawPrivateKey.getPublicKeyHash();
|
|
27
|
+
}
|
|
28
|
+
sign(data) {
|
|
29
|
+
return this._rawPrivateKey.sign(data);
|
|
30
|
+
}
|
|
31
|
+
signHash(dataHash) {
|
|
32
|
+
return this._rawPrivateKey.signHash(dataHash);
|
|
33
|
+
}
|
|
34
|
+
static fromWIF(wif) {
|
|
35
|
+
return PrivateKeyWASM.createFromRawInstance(dppProvider.dpp.PrivateKeyNAPI.fromWIF(wif));
|
|
36
|
+
}
|
|
37
|
+
static fromBytes(bytes, network) {
|
|
38
|
+
return PrivateKeyWASM.createFromRawInstance(dppProvider.dpp.PrivateKeyNAPI.fromBytes(bytes, valueToDynamicValue(network)));
|
|
39
|
+
}
|
|
40
|
+
static fromHex(hex, network) {
|
|
41
|
+
return PrivateKeyWASM.createFromRawInstance(dppProvider.dpp.PrivateKeyNAPI.fromHex(hex, valueToDynamicValue(network)));
|
|
42
|
+
}
|
|
43
|
+
static createFromRawInstance(rawInstance) {
|
|
44
|
+
const instance = Object.create(this.prototype);
|
|
45
|
+
instance._rawPrivateKey = rawInstance;
|
|
46
|
+
return instance;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PublicKeyNAPI } from '../../../binaries/bindingsTypes.js';
|
|
2
|
+
export declare class PublicKeyWASM {
|
|
3
|
+
/** @private **/
|
|
4
|
+
_rawPublicKey: PublicKeyNAPI;
|
|
5
|
+
constructor(compressed: boolean, bytes: Uint8Array);
|
|
6
|
+
get compressed(): boolean;
|
|
7
|
+
set compressed(value: boolean);
|
|
8
|
+
get inner(): Uint8Array;
|
|
9
|
+
set inner(value: Uint8Array);
|
|
10
|
+
getPublicKeyHash(): string;
|
|
11
|
+
hash160(): Uint8Array;
|
|
12
|
+
bytes(): Uint8Array;
|
|
13
|
+
static fromBytes(bytes: Uint8Array): PublicKeyWASM;
|
|
14
|
+
static createFromRawInstance(rawInstance: PublicKeyNAPI): PublicKeyWASM;
|
|
15
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { dppProvider } from '../provider.js';
|
|
2
|
+
export class PublicKeyWASM {
|
|
3
|
+
/** @private **/
|
|
4
|
+
_rawPublicKey;
|
|
5
|
+
constructor(compressed, bytes) {
|
|
6
|
+
this._rawPublicKey = new dppProvider.dpp.PublicKeyNAPI(compressed, bytes);
|
|
7
|
+
}
|
|
8
|
+
get compressed() {
|
|
9
|
+
return this._rawPublicKey.compressed;
|
|
10
|
+
}
|
|
11
|
+
set compressed(value) {
|
|
12
|
+
this._rawPublicKey.compressed = value;
|
|
13
|
+
}
|
|
14
|
+
get inner() {
|
|
15
|
+
return this._rawPublicKey.inner;
|
|
16
|
+
}
|
|
17
|
+
set inner(value) {
|
|
18
|
+
this._rawPublicKey.inner = value;
|
|
19
|
+
}
|
|
20
|
+
getPublicKeyHash() {
|
|
21
|
+
return this._rawPublicKey.getPublicKeyHash();
|
|
22
|
+
}
|
|
23
|
+
hash160() {
|
|
24
|
+
return this._rawPublicKey.hash160();
|
|
25
|
+
}
|
|
26
|
+
bytes() {
|
|
27
|
+
return this._rawPublicKey.bytes();
|
|
28
|
+
}
|
|
29
|
+
static fromBytes(bytes) {
|
|
30
|
+
return PublicKeyWASM.createFromRawInstance(dppProvider.dpp.PublicKeyNAPI.fromBytes(bytes));
|
|
31
|
+
}
|
|
32
|
+
static createFromRawInstance(rawInstance) {
|
|
33
|
+
const instance = Object.create(this.prototype);
|
|
34
|
+
instance._rawPublicKey = rawInstance;
|
|
35
|
+
return instance;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { StateTransitionNAPI } from '../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { PrivateKeyWASM } from './PrivateKey.js';
|
|
3
|
+
import { IdentityPublicKeyWASM } from './IdentityPublicKey.js';
|
|
4
|
+
import { IdentifierLike, KeyTypeLike, PurposeLike } from '../types.js';
|
|
5
|
+
import { IdentifierWASM } from './Identifier.js';
|
|
6
|
+
export declare class StateTransitionWASM {
|
|
7
|
+
/** @private **/
|
|
8
|
+
_rawStateTransition: StateTransitionNAPI;
|
|
9
|
+
private constructor();
|
|
10
|
+
get signature(): Uint8Array | undefined;
|
|
11
|
+
set signature(signature: Uint8Array);
|
|
12
|
+
get signaturePublicKeyId(): number | undefined;
|
|
13
|
+
set signaturePublicKeyId(keyId: number);
|
|
14
|
+
get userFeeIncrease(): number;
|
|
15
|
+
set userFeeIncrease(userFeeIncrease: number);
|
|
16
|
+
sign(privateKey: PrivateKeyWASM | string | Uint8Array, publicKey: IdentityPublicKeyWASM): Uint8Array;
|
|
17
|
+
signByPrivateKey(privateKey: PrivateKeyWASM | string | Uint8Array, keyId?: number, keyType?: KeyTypeLike): Uint8Array;
|
|
18
|
+
verifyPublicKey(publicKey: IdentityPublicKeyWASM, allowSigningWithAnySecurityLevel?: boolean, allowSigningWithAnyPurpose?: boolean): void;
|
|
19
|
+
hash(skipSignature: boolean): string;
|
|
20
|
+
getActionName(): string;
|
|
21
|
+
getActionType(): string;
|
|
22
|
+
getActionTypeNumber(): number;
|
|
23
|
+
getOwnerId(): IdentifierWASM | undefined;
|
|
24
|
+
getPurposeRequirement(): string[] | undefined;
|
|
25
|
+
getKeyLevelRequirement(purpose: PurposeLike): string[] | undefined;
|
|
26
|
+
getIdentityContractNonce(): bigint | undefined;
|
|
27
|
+
getIdentityNonce(): bigint | undefined;
|
|
28
|
+
setOwnerId(ownerId: IdentifierLike): void;
|
|
29
|
+
setIdentityContractNonce(nonce: bigint): void;
|
|
30
|
+
setIdentityNonce(nonce: bigint): void;
|
|
31
|
+
bytes(): Uint8Array;
|
|
32
|
+
hex(): string;
|
|
33
|
+
base64(): string;
|
|
34
|
+
static fromBytes(bytes: Uint8Array): StateTransitionWASM;
|
|
35
|
+
static fromHex(hex: string): StateTransitionWASM;
|
|
36
|
+
static fromBase64(base64: string): StateTransitionWASM;
|
|
37
|
+
static createFromRawInstance(instance: StateTransitionNAPI): StateTransitionWASM;
|
|
38
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { dppProvider } from '../provider.js';
|
|
2
|
+
import { PrivateKeyWASM } from './PrivateKey.js';
|
|
3
|
+
import { prepareIdentifierValue, valueToDynamicValue } from '../utils.js';
|
|
4
|
+
import { IdentifierWASM } from './Identifier.js';
|
|
5
|
+
export class StateTransitionWASM {
|
|
6
|
+
/** @private **/
|
|
7
|
+
_rawStateTransition;
|
|
8
|
+
constructor(_rawStateTransition) {
|
|
9
|
+
this._rawStateTransition = _rawStateTransition;
|
|
10
|
+
}
|
|
11
|
+
get signature() {
|
|
12
|
+
return this._rawStateTransition.signature ?? undefined;
|
|
13
|
+
}
|
|
14
|
+
set signature(signature) {
|
|
15
|
+
this._rawStateTransition.signature = signature;
|
|
16
|
+
}
|
|
17
|
+
get signaturePublicKeyId() {
|
|
18
|
+
return this._rawStateTransition.signaturePublicKeyId ?? undefined;
|
|
19
|
+
}
|
|
20
|
+
set signaturePublicKeyId(keyId) {
|
|
21
|
+
this._rawStateTransition.signaturePublicKeyId = keyId;
|
|
22
|
+
}
|
|
23
|
+
get userFeeIncrease() {
|
|
24
|
+
return this._rawStateTransition.userFeeIncrease;
|
|
25
|
+
}
|
|
26
|
+
set userFeeIncrease(userFeeIncrease) {
|
|
27
|
+
this._rawStateTransition.userFeeIncrease = userFeeIncrease;
|
|
28
|
+
}
|
|
29
|
+
sign(privateKey, publicKey) {
|
|
30
|
+
const normalPrivateKey = privateKey instanceof PrivateKeyWASM ? privateKey._rawPrivateKey : valueToDynamicValue(privateKey);
|
|
31
|
+
return this._rawStateTransition.sign(normalPrivateKey, publicKey._rawIdentityPublicKey);
|
|
32
|
+
}
|
|
33
|
+
signByPrivateKey(privateKey, keyId, keyType) {
|
|
34
|
+
const normalPrivateKey = privateKey instanceof PrivateKeyWASM ? privateKey._rawPrivateKey : valueToDynamicValue(privateKey);
|
|
35
|
+
return this._rawStateTransition.signByPrivateKey(normalPrivateKey, keyId, keyType ? valueToDynamicValue(keyType) : undefined);
|
|
36
|
+
}
|
|
37
|
+
verifyPublicKey(publicKey, allowSigningWithAnySecurityLevel, allowSigningWithAnyPurpose) {
|
|
38
|
+
this._rawStateTransition.verifyPublicKey(publicKey._rawIdentityPublicKey, allowSigningWithAnySecurityLevel, allowSigningWithAnyPurpose);
|
|
39
|
+
}
|
|
40
|
+
hash(skipSignature) {
|
|
41
|
+
return this._rawStateTransition.hash(skipSignature);
|
|
42
|
+
}
|
|
43
|
+
getActionName() {
|
|
44
|
+
return this._rawStateTransition.getActionName();
|
|
45
|
+
}
|
|
46
|
+
getActionType() {
|
|
47
|
+
return this._rawStateTransition.getActionType();
|
|
48
|
+
}
|
|
49
|
+
getActionTypeNumber() {
|
|
50
|
+
return this._rawStateTransition.getActionTypeNumber();
|
|
51
|
+
}
|
|
52
|
+
getOwnerId() {
|
|
53
|
+
const id = this._rawStateTransition.getOwnerId();
|
|
54
|
+
return (id != null) ? IdentifierWASM.createFromRawInstance(id) : undefined;
|
|
55
|
+
}
|
|
56
|
+
getPurposeRequirement() {
|
|
57
|
+
return this._rawStateTransition.getPurposeRequirement() ?? undefined;
|
|
58
|
+
}
|
|
59
|
+
getKeyLevelRequirement(purpose) {
|
|
60
|
+
return this._rawStateTransition.getKeyLevelRequirement(valueToDynamicValue(purpose)) ?? undefined;
|
|
61
|
+
}
|
|
62
|
+
getIdentityContractNonce() {
|
|
63
|
+
const nonce = this._rawStateTransition.getIdentityContractNonce();
|
|
64
|
+
return nonce != null ? BigInt(nonce) : undefined;
|
|
65
|
+
}
|
|
66
|
+
getIdentityNonce() {
|
|
67
|
+
const nonce = this._rawStateTransition.getIdentityNonce();
|
|
68
|
+
return nonce != null ? BigInt(nonce) : undefined;
|
|
69
|
+
}
|
|
70
|
+
setOwnerId(ownerId) {
|
|
71
|
+
this._rawStateTransition.setOwnerId(prepareIdentifierValue(ownerId));
|
|
72
|
+
}
|
|
73
|
+
setIdentityContractNonce(nonce) {
|
|
74
|
+
this._rawStateTransition.setIdentityContractNonce(nonce.toString());
|
|
75
|
+
}
|
|
76
|
+
setIdentityNonce(nonce) {
|
|
77
|
+
this._rawStateTransition.setIdentityNonce(nonce.toString());
|
|
78
|
+
}
|
|
79
|
+
bytes() {
|
|
80
|
+
return this._rawStateTransition.bytes();
|
|
81
|
+
}
|
|
82
|
+
hex() {
|
|
83
|
+
return this._rawStateTransition.hex();
|
|
84
|
+
}
|
|
85
|
+
base64() {
|
|
86
|
+
return this._rawStateTransition.base64();
|
|
87
|
+
}
|
|
88
|
+
static fromBytes(bytes) {
|
|
89
|
+
return new StateTransitionWASM(dppProvider.dpp.StateTransitionNAPI.fromBytes(bytes));
|
|
90
|
+
}
|
|
91
|
+
static fromHex(hex) {
|
|
92
|
+
return new StateTransitionWASM(dppProvider.dpp.StateTransitionNAPI.fromHex(hex));
|
|
93
|
+
}
|
|
94
|
+
static fromBase64(base64) {
|
|
95
|
+
return new StateTransitionWASM(dppProvider.dpp.StateTransitionNAPI.fromBase64(base64));
|
|
96
|
+
}
|
|
97
|
+
static createFromRawInstance(instance) {
|
|
98
|
+
return new StateTransitionWASM(instance);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ActionTakerNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { IdentifierLike } from '../../types.js';
|
|
3
|
+
import { IdentifierWASM } from '../Identifier.js';
|
|
4
|
+
export declare class ActionTakerWASM {
|
|
5
|
+
/** @private **/
|
|
6
|
+
_rawActionTaker: ActionTakerNAPI;
|
|
7
|
+
constructor(value: IdentifierLike | IdentifierLike[]);
|
|
8
|
+
getType(): string;
|
|
9
|
+
get value(): IdentifierWASM | IdentifierWASM[];
|
|
10
|
+
set value(value: IdentifierWASM | IdentifierWASM[]);
|
|
11
|
+
static createFromRawInstance(rawInstance: ActionTakerNAPI): ActionTakerWASM;
|
|
12
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { prepareIdentifierValue } from '../../utils.js';
|
|
2
|
+
import { dppProvider } from '../../provider.js';
|
|
3
|
+
import { IdentifierWASM } from '../Identifier.js';
|
|
4
|
+
export class ActionTakerWASM {
|
|
5
|
+
/** @private **/
|
|
6
|
+
_rawActionTaker;
|
|
7
|
+
constructor(value) {
|
|
8
|
+
let normalValue;
|
|
9
|
+
if (Array.isArray(value)) {
|
|
10
|
+
normalValue = value.map(id => prepareIdentifierValue(id));
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
normalValue = prepareIdentifierValue(value);
|
|
14
|
+
}
|
|
15
|
+
this._rawActionTaker = new dppProvider.dpp.ActionTakerNAPI(normalValue);
|
|
16
|
+
}
|
|
17
|
+
getType() {
|
|
18
|
+
return this._rawActionTaker.getType();
|
|
19
|
+
}
|
|
20
|
+
get value() {
|
|
21
|
+
const v = this._rawActionTaker.value;
|
|
22
|
+
if (Array.isArray(v)) {
|
|
23
|
+
return v.map(IdentifierWASM.createFromRawInstance);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
return IdentifierWASM.createFromRawInstance(v);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
set value(value) {
|
|
30
|
+
let normalValue;
|
|
31
|
+
if (Array.isArray(value)) {
|
|
32
|
+
normalValue = value.map(id => prepareIdentifierValue(id));
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
normalValue = prepareIdentifierValue(value);
|
|
36
|
+
}
|
|
37
|
+
this._rawActionTaker.value = normalValue;
|
|
38
|
+
}
|
|
39
|
+
static createFromRawInstance(rawInstance) {
|
|
40
|
+
const instance = Object.create(this.prototype);
|
|
41
|
+
instance._rawActionTaker = rawInstance;
|
|
42
|
+
return instance;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AuthorizedActionTakersNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { IdentifierLike } from '../../types.js';
|
|
3
|
+
import { IdentifierWASM } from '../Identifier.js';
|
|
4
|
+
export declare class AuthorizedActionTakersWASM {
|
|
5
|
+
/** @private **/
|
|
6
|
+
_rawAuthorizedActionTakers: AuthorizedActionTakersNAPI;
|
|
7
|
+
private constructor();
|
|
8
|
+
getTakerType(): string;
|
|
9
|
+
getValue(): undefined | IdentifierWASM | number;
|
|
10
|
+
static NoOne(): AuthorizedActionTakersWASM;
|
|
11
|
+
static ContractOwner(): AuthorizedActionTakersWASM;
|
|
12
|
+
static Identity(id: IdentifierLike): AuthorizedActionTakersWASM;
|
|
13
|
+
static MainGroup(): AuthorizedActionTakersWASM;
|
|
14
|
+
static Group(groupContractPosition: number): AuthorizedActionTakersWASM;
|
|
15
|
+
static createFromRawInstance(rawInstance: AuthorizedActionTakersNAPI): AuthorizedActionTakersWASM;
|
|
16
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
import { prepareIdentifierValue } from '../../utils.js';
|
|
3
|
+
import { IdentifierWASM } from '../Identifier.js';
|
|
4
|
+
export class AuthorizedActionTakersWASM {
|
|
5
|
+
/** @private **/
|
|
6
|
+
_rawAuthorizedActionTakers;
|
|
7
|
+
constructor(authorizedActionTakers) {
|
|
8
|
+
this._rawAuthorizedActionTakers = authorizedActionTakers;
|
|
9
|
+
}
|
|
10
|
+
getTakerType() {
|
|
11
|
+
return this._rawAuthorizedActionTakers.getTakerType();
|
|
12
|
+
}
|
|
13
|
+
getValue() {
|
|
14
|
+
const value = this._rawAuthorizedActionTakers.getValue();
|
|
15
|
+
if (value === undefined) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
else if (typeof value === 'number') {
|
|
19
|
+
return Number(value);
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return IdentifierWASM.createFromRawInstance(value);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
static NoOne() {
|
|
26
|
+
return new AuthorizedActionTakersWASM(dppProvider.dpp.AuthorizedActionTakersNAPI.NoOne());
|
|
27
|
+
}
|
|
28
|
+
static ContractOwner() {
|
|
29
|
+
return new AuthorizedActionTakersWASM(dppProvider.dpp.AuthorizedActionTakersNAPI.ContractOwner());
|
|
30
|
+
}
|
|
31
|
+
static Identity(id) {
|
|
32
|
+
return new AuthorizedActionTakersWASM(dppProvider.dpp.AuthorizedActionTakersNAPI.Identity(prepareIdentifierValue(id)));
|
|
33
|
+
}
|
|
34
|
+
static MainGroup() {
|
|
35
|
+
return new AuthorizedActionTakersWASM(dppProvider.dpp.AuthorizedActionTakersNAPI.MainGroup());
|
|
36
|
+
}
|
|
37
|
+
static Group(groupContractPosition) {
|
|
38
|
+
return new AuthorizedActionTakersWASM(dppProvider.dpp.AuthorizedActionTakersNAPI.Group(groupContractPosition));
|
|
39
|
+
}
|
|
40
|
+
static createFromRawInstance(rawInstance) {
|
|
41
|
+
return new AuthorizedActionTakersWASM(rawInstance);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ChangeControlRulesNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { AuthorizedActionTakersWASM } from './AuthorizedActionTakers.js';
|
|
3
|
+
import { ActionGoalLike, IdentifierLike } from '../../types.js';
|
|
4
|
+
import { GroupWASM } from './Group.js';
|
|
5
|
+
import { ActionTakerWASM } from './ActionTaker.js';
|
|
6
|
+
export declare class ChangeControlRulesWASM {
|
|
7
|
+
_rawChangeControlRules: ChangeControlRulesNAPI;
|
|
8
|
+
constructor(authorizedToMakeChanges: AuthorizedActionTakersWASM, adminActionTakers: AuthorizedActionTakersWASM, changingAuthorizedActionTakersToNoOneAllowed: boolean, changingAdminActionTakersToNoOneAllowed: boolean, selfChangingAdminActionTakersAllowed: boolean);
|
|
9
|
+
get authorizedToMakeChange(): AuthorizedActionTakersWASM;
|
|
10
|
+
set authorizedToMakeChange(value: AuthorizedActionTakersWASM);
|
|
11
|
+
get adminActionTakers(): AuthorizedActionTakersWASM;
|
|
12
|
+
set adminActionTakers(value: AuthorizedActionTakersWASM);
|
|
13
|
+
get changingAuthorizedActionTakersToNoOneAllowed(): boolean;
|
|
14
|
+
set changingAuthorizedActionTakersToNoOneAllowed(value: boolean);
|
|
15
|
+
get changingAdminActionTakersToNoOneAllowed(): boolean;
|
|
16
|
+
set changingAdminActionTakersToNoOneAllowed(value: boolean);
|
|
17
|
+
get selfChangingAdminActionTakersAllowed(): boolean;
|
|
18
|
+
set selfChangingAdminActionTakersAllowed(value: boolean);
|
|
19
|
+
canChangeAdminActionTakers(adminActionTakers: AuthorizedActionTakersWASM, contractOwnerId: IdentifierLike, groups: {
|
|
20
|
+
[key: number]: GroupWASM;
|
|
21
|
+
}, actionTaker: ActionTakerWASM, goal: ActionGoalLike, mainGroup?: number): boolean;
|
|
22
|
+
static createFromRawInstance(rawInstance: ChangeControlRulesNAPI): ChangeControlRulesWASM;
|
|
23
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
import { AuthorizedActionTakersWASM } from './AuthorizedActionTakers.js';
|
|
3
|
+
import { prepareIdentifierValue, valueToDynamicValue } from '../../utils.js';
|
|
4
|
+
export class ChangeControlRulesWASM {
|
|
5
|
+
_rawChangeControlRules;
|
|
6
|
+
constructor(authorizedToMakeChanges, adminActionTakers, changingAuthorizedActionTakersToNoOneAllowed, changingAdminActionTakersToNoOneAllowed, selfChangingAdminActionTakersAllowed) {
|
|
7
|
+
this._rawChangeControlRules = new dppProvider.dpp.ChangeControlRulesNAPI(authorizedToMakeChanges._rawAuthorizedActionTakers, adminActionTakers._rawAuthorizedActionTakers, changingAuthorizedActionTakersToNoOneAllowed, changingAdminActionTakersToNoOneAllowed, selfChangingAdminActionTakersAllowed);
|
|
8
|
+
}
|
|
9
|
+
get authorizedToMakeChange() {
|
|
10
|
+
return AuthorizedActionTakersWASM.createFromRawInstance(this._rawChangeControlRules.authorizedToMakeChange);
|
|
11
|
+
}
|
|
12
|
+
set authorizedToMakeChange(value) {
|
|
13
|
+
this._rawChangeControlRules.authorizedToMakeChange = value._rawAuthorizedActionTakers;
|
|
14
|
+
}
|
|
15
|
+
get adminActionTakers() {
|
|
16
|
+
return AuthorizedActionTakersWASM.createFromRawInstance(this._rawChangeControlRules.adminActionTakers);
|
|
17
|
+
}
|
|
18
|
+
set adminActionTakers(value) {
|
|
19
|
+
this._rawChangeControlRules.adminActionTakers = value._rawAuthorizedActionTakers;
|
|
20
|
+
}
|
|
21
|
+
get changingAuthorizedActionTakersToNoOneAllowed() {
|
|
22
|
+
return this._rawChangeControlRules.changingAuthorizedActionTakersToNoOneAllowed;
|
|
23
|
+
}
|
|
24
|
+
set changingAuthorizedActionTakersToNoOneAllowed(value) {
|
|
25
|
+
this._rawChangeControlRules.changingAuthorizedActionTakersToNoOneAllowed = value;
|
|
26
|
+
}
|
|
27
|
+
get changingAdminActionTakersToNoOneAllowed() {
|
|
28
|
+
return this._rawChangeControlRules.changingAdminActionTakersToNoOneAllowed;
|
|
29
|
+
}
|
|
30
|
+
set changingAdminActionTakersToNoOneAllowed(value) {
|
|
31
|
+
this._rawChangeControlRules.changingAdminActionTakersToNoOneAllowed = value;
|
|
32
|
+
}
|
|
33
|
+
get selfChangingAdminActionTakersAllowed() {
|
|
34
|
+
return this._rawChangeControlRules.selfChangingAdminActionTakersAllowed;
|
|
35
|
+
}
|
|
36
|
+
set selfChangingAdminActionTakersAllowed(value) {
|
|
37
|
+
this._rawChangeControlRules.selfChangingAdminActionTakersAllowed = value;
|
|
38
|
+
}
|
|
39
|
+
canChangeAdminActionTakers(adminActionTakers, contractOwnerId, groups, actionTaker, goal, mainGroup) {
|
|
40
|
+
const keys = Object.keys(groups);
|
|
41
|
+
const normalGroups = [];
|
|
42
|
+
for (const key of keys) {
|
|
43
|
+
normalGroups.push([Number(key), groups[Number(key)]._rawGroup]);
|
|
44
|
+
}
|
|
45
|
+
return this._rawChangeControlRules.canChangeAdminActionTakers(adminActionTakers._rawAuthorizedActionTakers, prepareIdentifierValue(contractOwnerId), mainGroup, normalGroups, actionTaker._rawActionTaker, valueToDynamicValue(goal));
|
|
46
|
+
}
|
|
47
|
+
static createFromRawInstance(rawInstance) {
|
|
48
|
+
const instance = Object.create(this.prototype);
|
|
49
|
+
instance._rawChangeControlRules = rawInstance;
|
|
50
|
+
return instance;
|
|
51
|
+
}
|
|
52
|
+
}
|