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
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IdentifierLike } from '../types.js';
|
|
2
|
+
import { IdentifierNAPI } from '../../../binaries/bindingsTypes.js';
|
|
3
|
+
export declare class IdentifierWASM {
|
|
4
|
+
/** @private **/
|
|
5
|
+
_rawIdentifier: IdentifierNAPI;
|
|
6
|
+
constructor(rawId: IdentifierLike | IdentifierWASM);
|
|
7
|
+
base58(): string;
|
|
8
|
+
base64(): string;
|
|
9
|
+
hex(): string;
|
|
10
|
+
bytes(): Uint8Array;
|
|
11
|
+
static fromBase58(id: string): IdentifierWASM;
|
|
12
|
+
static fromBase64(id: string): IdentifierWASM;
|
|
13
|
+
static fromHex(id: string): IdentifierWASM;
|
|
14
|
+
static fromBytes(id: Uint8Array): IdentifierWASM;
|
|
15
|
+
static createFromRawInstance(rawInstance: IdentifierNAPI): IdentifierWASM;
|
|
16
|
+
getRawInstance(): IdentifierNAPI;
|
|
17
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { dppProvider } from '../provider.js';
|
|
2
|
+
export class IdentifierWASM {
|
|
3
|
+
/** @private **/
|
|
4
|
+
_rawIdentifier;
|
|
5
|
+
constructor(rawId) {
|
|
6
|
+
const dpp = dppProvider.dpp;
|
|
7
|
+
if (rawId instanceof IdentifierWASM) {
|
|
8
|
+
return rawId;
|
|
9
|
+
}
|
|
10
|
+
else if (rawId instanceof Uint8Array || typeof rawId === 'string') {
|
|
11
|
+
const id = new dpp.DynamicValue(rawId);
|
|
12
|
+
this._rawIdentifier = new dpp.IdentifierNAPI(id);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
throw new Error('Invalid raw ID');
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
base58() {
|
|
19
|
+
return this._rawIdentifier.base58();
|
|
20
|
+
}
|
|
21
|
+
base64() {
|
|
22
|
+
return this._rawIdentifier.base64();
|
|
23
|
+
}
|
|
24
|
+
hex() {
|
|
25
|
+
return this._rawIdentifier.hex();
|
|
26
|
+
}
|
|
27
|
+
bytes() {
|
|
28
|
+
return this._rawIdentifier.bytes();
|
|
29
|
+
}
|
|
30
|
+
static fromBase58(id) {
|
|
31
|
+
return this.createFromRawInstance(dppProvider.dpp.IdentifierNAPI.fromBase58(id));
|
|
32
|
+
}
|
|
33
|
+
static fromBase64(id) {
|
|
34
|
+
return this.createFromRawInstance(dppProvider.dpp.IdentifierNAPI.fromBase64(id));
|
|
35
|
+
}
|
|
36
|
+
static fromHex(id) {
|
|
37
|
+
return this.createFromRawInstance(dppProvider.dpp.IdentifierNAPI.fromHex(id));
|
|
38
|
+
}
|
|
39
|
+
static fromBytes(id) {
|
|
40
|
+
return this.createFromRawInstance(dppProvider.dpp.IdentifierNAPI.fromBytes(id));
|
|
41
|
+
}
|
|
42
|
+
static createFromRawInstance(rawInstance) {
|
|
43
|
+
const instance = Object.create(this.prototype);
|
|
44
|
+
instance._rawIdentifier = rawInstance;
|
|
45
|
+
return instance;
|
|
46
|
+
}
|
|
47
|
+
getRawInstance() {
|
|
48
|
+
return this._rawIdentifier;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { IdentifierWASM } from './Identifier.js';
|
|
2
|
+
import { IdentityPublicKeyWASM } from './IdentityPublicKey.js';
|
|
3
|
+
import { IdentifierLike, PlatformVersionLike } from '../types.js';
|
|
4
|
+
import { IdentityNAPI } from '../../../binaries/bindingsTypes.js';
|
|
5
|
+
export declare class IdentityWASM {
|
|
6
|
+
/** @private **/
|
|
7
|
+
_rawIdentity: IdentityNAPI;
|
|
8
|
+
constructor(rawId: IdentifierLike, platformVersion?: PlatformVersionLike);
|
|
9
|
+
set id(rawId: IdentifierLike);
|
|
10
|
+
get id(): IdentifierWASM;
|
|
11
|
+
set balance(balance: bigint);
|
|
12
|
+
get balance(): bigint;
|
|
13
|
+
set revision(revision: bigint);
|
|
14
|
+
get revision(): bigint;
|
|
15
|
+
addPublicKey(publicKey: IdentityPublicKeyWASM): void;
|
|
16
|
+
getPublicKeyById(keyId: number): IdentityPublicKeyWASM | undefined;
|
|
17
|
+
getPublicKeys(): IdentityPublicKeyWASM[];
|
|
18
|
+
static fromHex(hex: string): IdentityWASM;
|
|
19
|
+
static fromBase64(base64: string): IdentityWASM;
|
|
20
|
+
static fromBytes(bytes: Uint8Array): IdentityWASM;
|
|
21
|
+
bytes(): Uint8Array;
|
|
22
|
+
hex(): string;
|
|
23
|
+
base64(): string;
|
|
24
|
+
static createFromRawInstance(rawInstance: IdentityNAPI): IdentityWASM;
|
|
25
|
+
getRawInstance(): IdentityNAPI;
|
|
26
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { IdentifierWASM } from './Identifier.js';
|
|
2
|
+
import { IdentityPublicKeyWASM } from './IdentityPublicKey.js';
|
|
3
|
+
import { dppProvider } from '../provider.js';
|
|
4
|
+
import { prepareIdentifierValue, valueToDynamicValue } from '../utils.js';
|
|
5
|
+
export class IdentityWASM {
|
|
6
|
+
/** @private **/
|
|
7
|
+
_rawIdentity;
|
|
8
|
+
constructor(rawId, platformVersion) {
|
|
9
|
+
const dpp = dppProvider.dpp;
|
|
10
|
+
this._rawIdentity = new dpp.IdentityNAPI(prepareIdentifierValue(rawId), valueToDynamicValue(platformVersion));
|
|
11
|
+
}
|
|
12
|
+
set id(rawId) {
|
|
13
|
+
this._rawIdentity.id = prepareIdentifierValue(rawId);
|
|
14
|
+
}
|
|
15
|
+
get id() {
|
|
16
|
+
return IdentifierWASM.createFromRawInstance(this._rawIdentity.id);
|
|
17
|
+
}
|
|
18
|
+
set balance(balance) {
|
|
19
|
+
this._rawIdentity.balance = balance.toString();
|
|
20
|
+
}
|
|
21
|
+
get balance() {
|
|
22
|
+
return BigInt(this._rawIdentity.balance);
|
|
23
|
+
}
|
|
24
|
+
set revision(revision) {
|
|
25
|
+
this._rawIdentity.revision = revision.toString();
|
|
26
|
+
}
|
|
27
|
+
get revision() {
|
|
28
|
+
return BigInt(this._rawIdentity.revision);
|
|
29
|
+
}
|
|
30
|
+
addPublicKey(publicKey) {
|
|
31
|
+
this._rawIdentity.addPublicKey(publicKey._rawIdentityPublicKey);
|
|
32
|
+
}
|
|
33
|
+
getPublicKeyById(keyId) {
|
|
34
|
+
const rawKeyInstance = this._rawIdentity.getPublicKeyById(keyId);
|
|
35
|
+
if (rawKeyInstance != null) {
|
|
36
|
+
return IdentityPublicKeyWASM.createFromRawInstance(rawKeyInstance);
|
|
37
|
+
}
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
getPublicKeys() {
|
|
41
|
+
const rawKeysArr = this._rawIdentity.getPublicKeys();
|
|
42
|
+
return rawKeysArr.map((key) => IdentityPublicKeyWASM.createFromRawInstance(key));
|
|
43
|
+
}
|
|
44
|
+
static fromHex(hex) {
|
|
45
|
+
const rawInstance = dppProvider.dpp.IdentityNAPI.fromHex(hex);
|
|
46
|
+
return this.createFromRawInstance(rawInstance);
|
|
47
|
+
}
|
|
48
|
+
static fromBase64(base64) {
|
|
49
|
+
const rawInstance = dppProvider.dpp.IdentityNAPI.fromBase64(base64);
|
|
50
|
+
return this.createFromRawInstance(rawInstance);
|
|
51
|
+
}
|
|
52
|
+
static fromBytes(bytes) {
|
|
53
|
+
const rawInstance = dppProvider.dpp.IdentityNAPI.fromBytes(bytes);
|
|
54
|
+
return this.createFromRawInstance(rawInstance);
|
|
55
|
+
}
|
|
56
|
+
bytes() {
|
|
57
|
+
return this._rawIdentity.bytes();
|
|
58
|
+
}
|
|
59
|
+
hex() {
|
|
60
|
+
return this._rawIdentity.hex();
|
|
61
|
+
}
|
|
62
|
+
base64() {
|
|
63
|
+
return this._rawIdentity.base64();
|
|
64
|
+
}
|
|
65
|
+
static createFromRawInstance(rawInstance) {
|
|
66
|
+
const instance = Object.create(this.prototype);
|
|
67
|
+
instance._rawIdentity = rawInstance;
|
|
68
|
+
return instance;
|
|
69
|
+
}
|
|
70
|
+
getRawInstance() {
|
|
71
|
+
return this._rawIdentity;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { KeyTypeLike, NetworkLike, PurposeLike, SecurityLevelLike } from '../types.js';
|
|
2
|
+
import { IdentityPublicKeyNAPI } from '../../../binaries/bindingsTypes.js';
|
|
3
|
+
import { KeyType, Purpose, SecurityLevel } from '../enums.js';
|
|
4
|
+
import { ContractBoundsWASM } from './ContractBounds.js';
|
|
5
|
+
import { PrivateKeyWASM } from './PrivateKey.js';
|
|
6
|
+
export declare class IdentityPublicKeyWASM {
|
|
7
|
+
/** @private **/
|
|
8
|
+
_rawIdentityPublicKey: IdentityPublicKeyNAPI;
|
|
9
|
+
constructor(id: number, purpose: PurposeLike, securityLevel: SecurityLevelLike, keyType: KeyTypeLike, readOnly: boolean, binaryData: string, disabledAt?: bigint | number, contractBounds?: ContractBoundsWASM);
|
|
10
|
+
get keyId(): number;
|
|
11
|
+
set keyId(keyId: number);
|
|
12
|
+
get purpose(): string;
|
|
13
|
+
set purpose(purpose: PurposeLike);
|
|
14
|
+
get purposeNumber(): Purpose;
|
|
15
|
+
set purposeNumber(purpose: Purpose);
|
|
16
|
+
get securityLevel(): string;
|
|
17
|
+
set securityLevel(securityLevel: SecurityLevelLike);
|
|
18
|
+
get securityLevelNumber(): SecurityLevel;
|
|
19
|
+
set securityLevelNumber(securityLevel: SecurityLevel);
|
|
20
|
+
get keyType(): string;
|
|
21
|
+
set keyType(keyType: KeyTypeLike);
|
|
22
|
+
get keyTypeNumber(): KeyType;
|
|
23
|
+
set keyTypeNumber(keyType: KeyType);
|
|
24
|
+
get readOnly(): boolean;
|
|
25
|
+
set readOnly(readOnly: boolean);
|
|
26
|
+
get data(): string;
|
|
27
|
+
set data(binaryData: string);
|
|
28
|
+
get disabledAt(): bigint | undefined;
|
|
29
|
+
set disabledAt(disabledAt: bigint | number);
|
|
30
|
+
get contractBounds(): ContractBoundsWASM | undefined;
|
|
31
|
+
set contractBounds(contractBounds: ContractBoundsWASM | undefined | null);
|
|
32
|
+
removeDisabledAt(): void;
|
|
33
|
+
getPublicKeyHash(): string;
|
|
34
|
+
isMaster(): boolean;
|
|
35
|
+
bytes(): Uint8Array;
|
|
36
|
+
hex(): string;
|
|
37
|
+
base64(): string;
|
|
38
|
+
validatePrivateKey(privateKey: string | Uint8Array | PrivateKeyWASM, network: NetworkLike): boolean;
|
|
39
|
+
static fromBytes(bytes: Uint8Array): IdentityPublicKeyWASM;
|
|
40
|
+
static fromHex(hex: string): IdentityPublicKeyWASM;
|
|
41
|
+
static fromBase64(base64: string): IdentityPublicKeyWASM;
|
|
42
|
+
static createFromRawInstance(rawInstance: IdentityPublicKeyNAPI): IdentityPublicKeyWASM;
|
|
43
|
+
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { dppProvider } from '../provider.js';
|
|
2
|
+
import { ContractBoundsWASM } from './ContractBounds.js';
|
|
3
|
+
import { PrivateKeyWASM } from './PrivateKey.js';
|
|
4
|
+
import { valueToDynamicValue } from '../utils.js';
|
|
5
|
+
export class IdentityPublicKeyWASM {
|
|
6
|
+
/** @private **/
|
|
7
|
+
_rawIdentityPublicKey;
|
|
8
|
+
constructor(id, purpose, securityLevel, keyType, readOnly, binaryData, disabledAt, contractBounds) {
|
|
9
|
+
const dpp = dppProvider.dpp;
|
|
10
|
+
if (purpose == null || securityLevel == null || keyType == null) {
|
|
11
|
+
throw new Error('purpose, securityLevel, keyType must be specified');
|
|
12
|
+
}
|
|
13
|
+
this._rawIdentityPublicKey = new dpp.IdentityPublicKeyNAPI(id, new dpp.DynamicValue(purpose), new dpp.DynamicValue(securityLevel), new dpp.DynamicValue(keyType), readOnly, binaryData, disabledAt?.toString(), contractBounds?._rawContractBounds);
|
|
14
|
+
}
|
|
15
|
+
get keyId() {
|
|
16
|
+
return this._rawIdentityPublicKey.keyId;
|
|
17
|
+
}
|
|
18
|
+
set keyId(keyId) {
|
|
19
|
+
this._rawIdentityPublicKey.keyId = keyId;
|
|
20
|
+
}
|
|
21
|
+
get purpose() {
|
|
22
|
+
return this._rawIdentityPublicKey.purpose;
|
|
23
|
+
}
|
|
24
|
+
set purpose(purpose) {
|
|
25
|
+
const dpp = dppProvider.dpp;
|
|
26
|
+
this._rawIdentityPublicKey.purpose = new dpp.DynamicValue(purpose);
|
|
27
|
+
}
|
|
28
|
+
get purposeNumber() {
|
|
29
|
+
return this._rawIdentityPublicKey.purposeNumber;
|
|
30
|
+
}
|
|
31
|
+
set purposeNumber(purpose) {
|
|
32
|
+
this._rawIdentityPublicKey.purposeNumber = purpose;
|
|
33
|
+
}
|
|
34
|
+
get securityLevel() {
|
|
35
|
+
return this._rawIdentityPublicKey.securityLevel;
|
|
36
|
+
}
|
|
37
|
+
set securityLevel(securityLevel) {
|
|
38
|
+
const dpp = dppProvider.dpp;
|
|
39
|
+
this._rawIdentityPublicKey.securityLevel = new dpp.DynamicValue(securityLevel);
|
|
40
|
+
}
|
|
41
|
+
get securityLevelNumber() {
|
|
42
|
+
return this._rawIdentityPublicKey.securityLevelNumber;
|
|
43
|
+
}
|
|
44
|
+
set securityLevelNumber(securityLevel) {
|
|
45
|
+
this._rawIdentityPublicKey.securityLevelNumber = securityLevel;
|
|
46
|
+
}
|
|
47
|
+
get keyType() {
|
|
48
|
+
return this._rawIdentityPublicKey.keyType;
|
|
49
|
+
}
|
|
50
|
+
set keyType(keyType) {
|
|
51
|
+
const dpp = dppProvider.dpp;
|
|
52
|
+
this._rawIdentityPublicKey.keyType = new dpp.DynamicValue(keyType);
|
|
53
|
+
}
|
|
54
|
+
get keyTypeNumber() {
|
|
55
|
+
return this._rawIdentityPublicKey.keyTypeNumber;
|
|
56
|
+
}
|
|
57
|
+
set keyTypeNumber(keyType) {
|
|
58
|
+
this._rawIdentityPublicKey.keyTypeNumber = keyType;
|
|
59
|
+
}
|
|
60
|
+
get readOnly() {
|
|
61
|
+
return this._rawIdentityPublicKey.readOnly;
|
|
62
|
+
}
|
|
63
|
+
set readOnly(readOnly) {
|
|
64
|
+
this._rawIdentityPublicKey.readOnly = readOnly;
|
|
65
|
+
}
|
|
66
|
+
get data() {
|
|
67
|
+
return this._rawIdentityPublicKey.data;
|
|
68
|
+
}
|
|
69
|
+
set data(binaryData) {
|
|
70
|
+
this._rawIdentityPublicKey.data = binaryData;
|
|
71
|
+
}
|
|
72
|
+
get disabledAt() {
|
|
73
|
+
const timestamp = this._rawIdentityPublicKey.disabledAt;
|
|
74
|
+
return (timestamp != null) ? BigInt(timestamp) : undefined;
|
|
75
|
+
}
|
|
76
|
+
set disabledAt(disabledAt) {
|
|
77
|
+
this._rawIdentityPublicKey.disabledAt = disabledAt.toString();
|
|
78
|
+
}
|
|
79
|
+
get contractBounds() {
|
|
80
|
+
if (this._rawIdentityPublicKey.contractBounds != null) {
|
|
81
|
+
return ContractBoundsWASM.createFromRawInstance(this._rawIdentityPublicKey.contractBounds);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
set contractBounds(contractBounds) {
|
|
85
|
+
this._rawIdentityPublicKey.contractBounds = contractBounds?._rawContractBounds;
|
|
86
|
+
}
|
|
87
|
+
removeDisabledAt() {
|
|
88
|
+
this._rawIdentityPublicKey.removeDisabledAt();
|
|
89
|
+
}
|
|
90
|
+
getPublicKeyHash() {
|
|
91
|
+
return this._rawIdentityPublicKey.getPublicKeyHash();
|
|
92
|
+
}
|
|
93
|
+
isMaster() {
|
|
94
|
+
return this._rawIdentityPublicKey.isMaster();
|
|
95
|
+
}
|
|
96
|
+
bytes() {
|
|
97
|
+
return this._rawIdentityPublicKey.bytes();
|
|
98
|
+
}
|
|
99
|
+
hex() {
|
|
100
|
+
return this._rawIdentityPublicKey.hex();
|
|
101
|
+
}
|
|
102
|
+
base64() {
|
|
103
|
+
return this._rawIdentityPublicKey.base64();
|
|
104
|
+
}
|
|
105
|
+
validatePrivateKey(privateKey, network) {
|
|
106
|
+
const normalPrivateKey = privateKey instanceof PrivateKeyWASM ? privateKey._rawPrivateKey : valueToDynamicValue(privateKey);
|
|
107
|
+
return this._rawIdentityPublicKey.validatePrivateKey(normalPrivateKey, valueToDynamicValue(network));
|
|
108
|
+
}
|
|
109
|
+
static fromBytes(bytes) {
|
|
110
|
+
const rawInstance = dppProvider.dpp.IdentityPublicKeyNAPI.fromBytes(bytes);
|
|
111
|
+
return this.createFromRawInstance(rawInstance);
|
|
112
|
+
}
|
|
113
|
+
static fromHex(hex) {
|
|
114
|
+
const rawInstance = dppProvider.dpp.IdentityPublicKeyNAPI.fromHex(hex);
|
|
115
|
+
return this.createFromRawInstance(rawInstance);
|
|
116
|
+
}
|
|
117
|
+
static fromBase64(base64) {
|
|
118
|
+
const rawInstance = dppProvider.dpp.IdentityPublicKeyNAPI.fromBase64(base64);
|
|
119
|
+
return this.createFromRawInstance(rawInstance);
|
|
120
|
+
}
|
|
121
|
+
static createFromRawInstance(rawInstance) {
|
|
122
|
+
const instance = Object.create(this.prototype);
|
|
123
|
+
instance._rawIdentityPublicKey = rawInstance;
|
|
124
|
+
return instance;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { IdentityPublicKeyInCreationNAPI } from '../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { KeyTypeLike, NetworkLike, PurposeLike, SecurityLevelLike } from '../types.js';
|
|
3
|
+
import { ContractBoundsWASM } from './ContractBounds.js';
|
|
4
|
+
import { IdentityPublicKeyWASM } from './IdentityPublicKey.js';
|
|
5
|
+
import { PrivateKeyWASM } from './PrivateKey.js';
|
|
6
|
+
export declare class IdentityPublicKeyInCreationWASM {
|
|
7
|
+
/** @private **/
|
|
8
|
+
_rawKeyInCreation: IdentityPublicKeyInCreationNAPI;
|
|
9
|
+
constructor(id: number, purpose: PurposeLike, securityLevel: SecurityLevelLike, keyType: KeyTypeLike, readOnly: boolean, binaryData: Uint8Array, signature?: Uint8Array, contractBounds?: ContractBoundsWASM);
|
|
10
|
+
toIdentityPublicKey(): IdentityPublicKeyWASM;
|
|
11
|
+
validatePrivateKey(privateKey: string | Uint8Array | PrivateKeyWASM, network: NetworkLike): boolean;
|
|
12
|
+
getHash(): Uint8Array;
|
|
13
|
+
get contractBounds(): ContractBoundsWASM | undefined;
|
|
14
|
+
set contractBounds(value: ContractBoundsWASM);
|
|
15
|
+
get keyId(): number;
|
|
16
|
+
set keyId(value: number);
|
|
17
|
+
get purpose(): string;
|
|
18
|
+
set purpose(value: PurposeLike);
|
|
19
|
+
get securityLevel(): string;
|
|
20
|
+
set securityLevel(value: SecurityLevelLike);
|
|
21
|
+
get keyType(): string;
|
|
22
|
+
set keyType(value: KeyTypeLike);
|
|
23
|
+
get readOnly(): boolean;
|
|
24
|
+
set readOnly(value: boolean);
|
|
25
|
+
get data(): Uint8Array;
|
|
26
|
+
set data(value: Uint8Array);
|
|
27
|
+
get signature(): Uint8Array;
|
|
28
|
+
set signature(value: Uint8Array);
|
|
29
|
+
static createFromRawInstance(rawInstance: IdentityPublicKeyInCreationNAPI): IdentityPublicKeyInCreationWASM;
|
|
30
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { ContractBoundsWASM } from './ContractBounds.js';
|
|
2
|
+
import { dppProvider } from '../provider.js';
|
|
3
|
+
import { valueToDynamicValue } from '../utils.js';
|
|
4
|
+
import { IdentityPublicKeyWASM } from './IdentityPublicKey.js';
|
|
5
|
+
import { PrivateKeyWASM } from './PrivateKey.js';
|
|
6
|
+
export class IdentityPublicKeyInCreationWASM {
|
|
7
|
+
/** @private **/
|
|
8
|
+
_rawKeyInCreation;
|
|
9
|
+
constructor(id, purpose, securityLevel, keyType, readOnly, binaryData, signature, contractBounds) {
|
|
10
|
+
this._rawKeyInCreation = new dppProvider.dpp.IdentityPublicKeyInCreationNAPI(id, valueToDynamicValue(purpose), valueToDynamicValue(securityLevel), valueToDynamicValue(keyType), readOnly, binaryData, signature, contractBounds?._rawContractBounds);
|
|
11
|
+
}
|
|
12
|
+
toIdentityPublicKey() {
|
|
13
|
+
return IdentityPublicKeyWASM.createFromRawInstance(this._rawKeyInCreation.toIdentityPublicKey());
|
|
14
|
+
}
|
|
15
|
+
validatePrivateKey(privateKey, network) {
|
|
16
|
+
const normalPrivateKey = privateKey instanceof PrivateKeyWASM ? privateKey._rawPrivateKey : valueToDynamicValue(privateKey);
|
|
17
|
+
return this._rawKeyInCreation.validatePrivateKey(normalPrivateKey, valueToDynamicValue(network));
|
|
18
|
+
}
|
|
19
|
+
getHash() {
|
|
20
|
+
return this._rawKeyInCreation.getHash();
|
|
21
|
+
}
|
|
22
|
+
get contractBounds() {
|
|
23
|
+
if (this._rawKeyInCreation.contractBounds != null) {
|
|
24
|
+
return ContractBoundsWASM.createFromRawInstance(this._rawKeyInCreation.contractBounds);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
set contractBounds(value) {
|
|
28
|
+
this._rawKeyInCreation.contractBounds = value._rawContractBounds;
|
|
29
|
+
}
|
|
30
|
+
get keyId() {
|
|
31
|
+
return this._rawKeyInCreation.keyId;
|
|
32
|
+
}
|
|
33
|
+
set keyId(value) {
|
|
34
|
+
this._rawKeyInCreation.keyId = value;
|
|
35
|
+
}
|
|
36
|
+
get purpose() {
|
|
37
|
+
return this._rawKeyInCreation.purpose;
|
|
38
|
+
}
|
|
39
|
+
set purpose(value) {
|
|
40
|
+
this._rawKeyInCreation.purpose = valueToDynamicValue(value);
|
|
41
|
+
}
|
|
42
|
+
get securityLevel() {
|
|
43
|
+
return this._rawKeyInCreation.securityLevel;
|
|
44
|
+
}
|
|
45
|
+
set securityLevel(value) {
|
|
46
|
+
this._rawKeyInCreation.securityLevel = valueToDynamicValue(value);
|
|
47
|
+
}
|
|
48
|
+
get keyType() {
|
|
49
|
+
return this._rawKeyInCreation.keyType;
|
|
50
|
+
}
|
|
51
|
+
set keyType(value) {
|
|
52
|
+
this._rawKeyInCreation.keyType = valueToDynamicValue(value);
|
|
53
|
+
}
|
|
54
|
+
get readOnly() {
|
|
55
|
+
return this._rawKeyInCreation.readOnly;
|
|
56
|
+
}
|
|
57
|
+
set readOnly(value) {
|
|
58
|
+
this._rawKeyInCreation.readOnly = value;
|
|
59
|
+
}
|
|
60
|
+
get data() {
|
|
61
|
+
return this._rawKeyInCreation.data;
|
|
62
|
+
}
|
|
63
|
+
set data(value) {
|
|
64
|
+
this._rawKeyInCreation.data = value;
|
|
65
|
+
}
|
|
66
|
+
get signature() {
|
|
67
|
+
return this._rawKeyInCreation.signature;
|
|
68
|
+
}
|
|
69
|
+
set signature(value) {
|
|
70
|
+
this._rawKeyInCreation.signature = value;
|
|
71
|
+
}
|
|
72
|
+
static createFromRawInstance(rawInstance) {
|
|
73
|
+
const instance = Object.create(this.prototype);
|
|
74
|
+
instance._rawKeyInCreation = rawInstance;
|
|
75
|
+
return instance;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IdentityCreateTransitionNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { IdentityPublicKeyInCreationWASM } from '../IdentityPublicKeyInCreation.js';
|
|
3
|
+
import { AssetLockProofWASM } from '../AssetLockProof/AssetLockProof.js';
|
|
4
|
+
import { PlatformVersionLike } from '../../types.js';
|
|
5
|
+
import { IdentifierWASM } from '../Identifier.js';
|
|
6
|
+
import { StateTransitionWASM } from '../StateTransition.js';
|
|
7
|
+
export declare class IdentityCreateTransitionWASM {
|
|
8
|
+
/** @private **/
|
|
9
|
+
_rawIdentityCreateTransition: IdentityCreateTransitionNAPI;
|
|
10
|
+
constructor(publicKeys: IdentityPublicKeyInCreationWASM[], assetLockProof: AssetLockProofWASM, signature?: Uint8Array, userFeeIncrease?: number);
|
|
11
|
+
get publicKeys(): IdentityPublicKeyInCreationWASM[];
|
|
12
|
+
set publicKeys(publicKeys: IdentityPublicKeyInCreationWASM[]);
|
|
13
|
+
get userFeeIncrease(): number;
|
|
14
|
+
set userFeeIncrease(value: number);
|
|
15
|
+
get signature(): Uint8Array;
|
|
16
|
+
set signature(value: Uint8Array);
|
|
17
|
+
get assetLock(): AssetLockProofWASM;
|
|
18
|
+
set assetLock(value: AssetLockProofWASM);
|
|
19
|
+
getSignableBytes(): Uint8Array;
|
|
20
|
+
getIdentifier(): IdentifierWASM;
|
|
21
|
+
bytes(): Uint8Array;
|
|
22
|
+
toStateTransition(): StateTransitionWASM;
|
|
23
|
+
static default(platformVersion: PlatformVersionLike): IdentityCreateTransitionWASM;
|
|
24
|
+
static fromHex(hex: string): IdentityCreateTransitionWASM;
|
|
25
|
+
static fromBase64(base64: string): IdentityCreateTransitionWASM;
|
|
26
|
+
static fromBytes(bytes: Uint8Array): IdentityCreateTransitionWASM;
|
|
27
|
+
static fromStateTransition(stateTransition: StateTransitionWASM): IdentityCreateTransitionWASM;
|
|
28
|
+
static createFromRawInstance(rawInstance: IdentityCreateTransitionNAPI): IdentityCreateTransitionWASM;
|
|
29
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { IdentityPublicKeyInCreationWASM } from '../IdentityPublicKeyInCreation.js';
|
|
2
|
+
import { AssetLockProofWASM } from '../AssetLockProof/AssetLockProof.js';
|
|
3
|
+
import { dppProvider } from '../../provider.js';
|
|
4
|
+
import { valueToDynamicValue } from '../../utils.js';
|
|
5
|
+
import { IdentifierWASM } from '../Identifier.js';
|
|
6
|
+
import { StateTransitionWASM } from '../StateTransition.js';
|
|
7
|
+
export class IdentityCreateTransitionWASM {
|
|
8
|
+
/** @private **/
|
|
9
|
+
_rawIdentityCreateTransition;
|
|
10
|
+
constructor(publicKeys, assetLockProof, signature, userFeeIncrease) {
|
|
11
|
+
this._rawIdentityCreateTransition = new dppProvider.dpp.IdentityCreateTransitionNAPI(publicKeys.map(publicKey => publicKey._rawKeyInCreation), assetLockProof._rawAssetLockProof, signature, userFeeIncrease);
|
|
12
|
+
}
|
|
13
|
+
get publicKeys() {
|
|
14
|
+
return this._rawIdentityCreateTransition.publicKeys.map(IdentityPublicKeyInCreationWASM.createFromRawInstance);
|
|
15
|
+
}
|
|
16
|
+
set publicKeys(publicKeys) {
|
|
17
|
+
this._rawIdentityCreateTransition.publicKeys = publicKeys.map(publicKey => publicKey._rawKeyInCreation);
|
|
18
|
+
}
|
|
19
|
+
get userFeeIncrease() {
|
|
20
|
+
return this._rawIdentityCreateTransition.userFeeIncrease;
|
|
21
|
+
}
|
|
22
|
+
set userFeeIncrease(value) {
|
|
23
|
+
this._rawIdentityCreateTransition.userFeeIncrease = value;
|
|
24
|
+
}
|
|
25
|
+
get signature() {
|
|
26
|
+
return this._rawIdentityCreateTransition.signature;
|
|
27
|
+
}
|
|
28
|
+
set signature(value) {
|
|
29
|
+
this._rawIdentityCreateTransition.signature = value;
|
|
30
|
+
}
|
|
31
|
+
get assetLock() {
|
|
32
|
+
return AssetLockProofWASM.createFromRawInstance(this._rawIdentityCreateTransition.assetLock);
|
|
33
|
+
}
|
|
34
|
+
set assetLock(value) {
|
|
35
|
+
this._rawIdentityCreateTransition.assetLock = value._rawAssetLockProof;
|
|
36
|
+
}
|
|
37
|
+
getSignableBytes() {
|
|
38
|
+
return this._rawIdentityCreateTransition.getSignableBytes();
|
|
39
|
+
}
|
|
40
|
+
getIdentifier() {
|
|
41
|
+
return IdentifierWASM.createFromRawInstance(this._rawIdentityCreateTransition.getIdentifier());
|
|
42
|
+
}
|
|
43
|
+
bytes() {
|
|
44
|
+
return this._rawIdentityCreateTransition.bytes();
|
|
45
|
+
}
|
|
46
|
+
toStateTransition() {
|
|
47
|
+
return StateTransitionWASM.createFromRawInstance(this._rawIdentityCreateTransition.toStateTransition());
|
|
48
|
+
}
|
|
49
|
+
static default(platformVersion) {
|
|
50
|
+
return IdentityCreateTransitionWASM.createFromRawInstance(dppProvider.dpp.IdentityCreateTransitionNAPI.default(valueToDynamicValue(platformVersion)));
|
|
51
|
+
}
|
|
52
|
+
static fromHex(hex) {
|
|
53
|
+
return IdentityCreateTransitionWASM.createFromRawInstance(dppProvider.dpp.IdentityCreateTransitionNAPI.fromHex(hex));
|
|
54
|
+
}
|
|
55
|
+
static fromBase64(base64) {
|
|
56
|
+
return IdentityCreateTransitionWASM.createFromRawInstance(dppProvider.dpp.IdentityCreateTransitionNAPI.fromBase64(base64));
|
|
57
|
+
}
|
|
58
|
+
static fromBytes(bytes) {
|
|
59
|
+
return IdentityCreateTransitionWASM.createFromRawInstance(dppProvider.dpp.IdentityCreateTransitionNAPI.fromBytes(bytes));
|
|
60
|
+
}
|
|
61
|
+
static fromStateTransition(stateTransition) {
|
|
62
|
+
return IdentityCreateTransitionWASM.createFromRawInstance(dppProvider.dpp.IdentityCreateTransitionNAPI.fromStateTransition(stateTransition._rawStateTransition));
|
|
63
|
+
}
|
|
64
|
+
static createFromRawInstance(rawInstance) {
|
|
65
|
+
const instance = Object.create(this.prototype);
|
|
66
|
+
instance._rawIdentityCreateTransition = rawInstance;
|
|
67
|
+
return instance;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IdentityCreditTransferNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { IdentifierLike } from '../../types.js';
|
|
3
|
+
import { IdentifierWASM } from '../Identifier.js';
|
|
4
|
+
import { StateTransitionWASM } from '../StateTransition.js';
|
|
5
|
+
export declare class IdentityCreditTransferWASM {
|
|
6
|
+
/** @private **/
|
|
7
|
+
_rawIdentityCreditTransfer: IdentityCreditTransferNAPI;
|
|
8
|
+
constructor(sender: IdentifierLike, amount: bigint, recipient: IdentifierLike, nonce: bigint, userFeeIncrease?: number);
|
|
9
|
+
get recipientId(): IdentifierWASM;
|
|
10
|
+
set recipientId(value: IdentifierLike);
|
|
11
|
+
get senderId(): IdentifierWASM;
|
|
12
|
+
set senderId(value: IdentifierLike);
|
|
13
|
+
get amount(): bigint;
|
|
14
|
+
set amount(value: bigint);
|
|
15
|
+
get nonce(): bigint;
|
|
16
|
+
set nonce(value: bigint);
|
|
17
|
+
get signature(): Uint8Array;
|
|
18
|
+
set signature(value: Uint8Array);
|
|
19
|
+
get signaturePublicKeyId(): number;
|
|
20
|
+
set signaturePublicKeyId(value: number);
|
|
21
|
+
get userFeeIncrease(): number;
|
|
22
|
+
set userFeeIncrease(value: number);
|
|
23
|
+
getSignableBytes(): Uint8Array;
|
|
24
|
+
bytes(): Uint8Array;
|
|
25
|
+
hex(): string;
|
|
26
|
+
base64(): string;
|
|
27
|
+
toStateTransition(): StateTransitionWASM;
|
|
28
|
+
static fromBytes(bytes: Uint8Array): IdentityCreditTransferWASM;
|
|
29
|
+
static fromHex(hex: string): IdentityCreditTransferWASM;
|
|
30
|
+
static fromBase64(base64: string): IdentityCreditTransferWASM;
|
|
31
|
+
static fromStateTransition(stateTransition: StateTransitionWASM): IdentityCreditTransferWASM;
|
|
32
|
+
static createFromRawInstance(rawInstance: IdentityCreditTransferNAPI): IdentityCreditTransferWASM;
|
|
33
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
import { prepareIdentifierValue } from '../../utils.js';
|
|
3
|
+
import { IdentifierWASM } from '../Identifier.js';
|
|
4
|
+
import { StateTransitionWASM } from '../StateTransition.js';
|
|
5
|
+
export class IdentityCreditTransferWASM {
|
|
6
|
+
/** @private **/
|
|
7
|
+
_rawIdentityCreditTransfer;
|
|
8
|
+
constructor(sender, amount, recipient, nonce, userFeeIncrease) {
|
|
9
|
+
this._rawIdentityCreditTransfer = new dppProvider.dpp.IdentityCreditTransferNAPI(prepareIdentifierValue(sender), amount.toString(), prepareIdentifierValue(recipient), nonce.toString(), userFeeIncrease);
|
|
10
|
+
}
|
|
11
|
+
get recipientId() {
|
|
12
|
+
return IdentifierWASM.createFromRawInstance(this._rawIdentityCreditTransfer.recipientId);
|
|
13
|
+
}
|
|
14
|
+
set recipientId(value) {
|
|
15
|
+
this._rawIdentityCreditTransfer.recipientId = prepareIdentifierValue(value);
|
|
16
|
+
}
|
|
17
|
+
get senderId() {
|
|
18
|
+
return IdentifierWASM.createFromRawInstance(this._rawIdentityCreditTransfer.senderId);
|
|
19
|
+
}
|
|
20
|
+
set senderId(value) {
|
|
21
|
+
this._rawIdentityCreditTransfer.recipientId = prepareIdentifierValue(value);
|
|
22
|
+
}
|
|
23
|
+
get amount() {
|
|
24
|
+
return BigInt(this._rawIdentityCreditTransfer.amount);
|
|
25
|
+
}
|
|
26
|
+
set amount(value) {
|
|
27
|
+
this._rawIdentityCreditTransfer.amount = value.toString();
|
|
28
|
+
}
|
|
29
|
+
get nonce() {
|
|
30
|
+
return BigInt(this._rawIdentityCreditTransfer.nonce);
|
|
31
|
+
}
|
|
32
|
+
set nonce(value) {
|
|
33
|
+
this._rawIdentityCreditTransfer.nonce = value.toString();
|
|
34
|
+
}
|
|
35
|
+
get signature() {
|
|
36
|
+
return this._rawIdentityCreditTransfer.signature;
|
|
37
|
+
}
|
|
38
|
+
set signature(value) {
|
|
39
|
+
this._rawIdentityCreditTransfer.signature = value;
|
|
40
|
+
}
|
|
41
|
+
get signaturePublicKeyId() {
|
|
42
|
+
return this._rawIdentityCreditTransfer.signaturePublicKeyId;
|
|
43
|
+
}
|
|
44
|
+
set signaturePublicKeyId(value) {
|
|
45
|
+
this._rawIdentityCreditTransfer.signaturePublicKeyId = value;
|
|
46
|
+
}
|
|
47
|
+
get userFeeIncrease() {
|
|
48
|
+
return this._rawIdentityCreditTransfer.userFeeIncrease;
|
|
49
|
+
}
|
|
50
|
+
set userFeeIncrease(value) {
|
|
51
|
+
this._rawIdentityCreditTransfer.userFeeIncrease = value;
|
|
52
|
+
}
|
|
53
|
+
getSignableBytes() {
|
|
54
|
+
return this._rawIdentityCreditTransfer.getSignableBytes();
|
|
55
|
+
}
|
|
56
|
+
bytes() {
|
|
57
|
+
return this._rawIdentityCreditTransfer.bytes();
|
|
58
|
+
}
|
|
59
|
+
hex() {
|
|
60
|
+
return this._rawIdentityCreditTransfer.hex();
|
|
61
|
+
}
|
|
62
|
+
base64() {
|
|
63
|
+
return this._rawIdentityCreditTransfer.base64();
|
|
64
|
+
}
|
|
65
|
+
toStateTransition() {
|
|
66
|
+
return StateTransitionWASM.createFromRawInstance(this._rawIdentityCreditTransfer.toStateTransition());
|
|
67
|
+
}
|
|
68
|
+
static fromBytes(bytes) {
|
|
69
|
+
return IdentityCreditTransferWASM.createFromRawInstance(dppProvider.dpp.IdentityCreditTransferNAPI.fromBytes(bytes));
|
|
70
|
+
}
|
|
71
|
+
static fromHex(hex) {
|
|
72
|
+
return IdentityCreditTransferWASM.createFromRawInstance(dppProvider.dpp.IdentityCreditTransferNAPI.fromHex(hex));
|
|
73
|
+
}
|
|
74
|
+
static fromBase64(base64) {
|
|
75
|
+
return IdentityCreditTransferWASM.createFromRawInstance(dppProvider.dpp.IdentityCreditTransferNAPI.fromBase64(base64));
|
|
76
|
+
}
|
|
77
|
+
static fromStateTransition(stateTransition) {
|
|
78
|
+
return IdentityCreditTransferWASM.createFromRawInstance(dppProvider.dpp.IdentityCreditTransferNAPI.fromStateTransition(stateTransition._rawStateTransition));
|
|
79
|
+
}
|
|
80
|
+
static createFromRawInstance(rawInstance) {
|
|
81
|
+
const instance = Object.create(this.prototype);
|
|
82
|
+
instance._rawIdentityCreditTransfer = rawInstance;
|
|
83
|
+
return instance;
|
|
84
|
+
}
|
|
85
|
+
}
|