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,116 @@
|
|
|
1
|
+
import { dppProvider } from '../provider.js';
|
|
2
|
+
import { prepareIdentifierValue, valueFromDynamicValue, valueToDynamicValue } from '../utils.js';
|
|
3
|
+
import { IdentifierWASM } from './Identifier.js';
|
|
4
|
+
import { TokenConfigurationWASM } from './TokenConfiguration/TokenConfiguration.js';
|
|
5
|
+
import { GroupWASM } from './TokenConfiguration/Group.js';
|
|
6
|
+
export class DataContractWASM {
|
|
7
|
+
/** @private **/
|
|
8
|
+
_rawDataContract;
|
|
9
|
+
constructor(ownerId, identityNonce, schema, definitions, tokens, fullValidation, platformVersion) {
|
|
10
|
+
let normalTokens;
|
|
11
|
+
if (tokens != null) {
|
|
12
|
+
normalTokens = [];
|
|
13
|
+
for (const token of tokens) {
|
|
14
|
+
normalTokens.push([token.position, token.tokenConfiguration._rawTokenConfiguration]);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
this._rawDataContract = new dppProvider.dpp.DataContractNAPI(prepareIdentifierValue(ownerId), identityNonce.toString(), valueToDynamicValue(schema), valueToDynamicValue(definitions), normalTokens, fullValidation, valueToDynamicValue(platformVersion));
|
|
18
|
+
}
|
|
19
|
+
get systemVersion() {
|
|
20
|
+
return this._rawDataContract.systemVersion;
|
|
21
|
+
}
|
|
22
|
+
set systemVersion(value) {
|
|
23
|
+
this._rawDataContract.systemVersion = value;
|
|
24
|
+
}
|
|
25
|
+
get version() {
|
|
26
|
+
return this._rawDataContract.version;
|
|
27
|
+
}
|
|
28
|
+
set version(value) {
|
|
29
|
+
this._rawDataContract.version = value;
|
|
30
|
+
}
|
|
31
|
+
get id() {
|
|
32
|
+
return IdentifierWASM.createFromRawInstance(this._rawDataContract.id);
|
|
33
|
+
}
|
|
34
|
+
set id(value) {
|
|
35
|
+
this._rawDataContract.id = value._rawIdentifier;
|
|
36
|
+
}
|
|
37
|
+
get tokens() {
|
|
38
|
+
const tokens = this._rawDataContract.tokens;
|
|
39
|
+
return tokens.map(([position, token]) => ({
|
|
40
|
+
position,
|
|
41
|
+
tokenConfiguration: TokenConfigurationWASM.createFromRawInstance(token)
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
set tokens(tokens) {
|
|
45
|
+
let normalTokens;
|
|
46
|
+
if (tokens != null) {
|
|
47
|
+
normalTokens = [];
|
|
48
|
+
for (const token of tokens) {
|
|
49
|
+
normalTokens.push([token.position, token.tokenConfiguration._rawTokenConfiguration]);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
this._rawDataContract.tokens = normalTokens;
|
|
53
|
+
}
|
|
54
|
+
get groups() {
|
|
55
|
+
return this._rawDataContract.groups.map(([position, group]) => ({
|
|
56
|
+
position,
|
|
57
|
+
group: GroupWASM.createFromRawInstance(group)
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
set groups(groups) {
|
|
61
|
+
this._rawDataContract.groups = groups.map(({ group, position }) => ([position, group._rawGroup]));
|
|
62
|
+
}
|
|
63
|
+
get description() {
|
|
64
|
+
return this._rawDataContract.description ?? undefined;
|
|
65
|
+
}
|
|
66
|
+
set description(value) {
|
|
67
|
+
this._rawDataContract.description = value;
|
|
68
|
+
}
|
|
69
|
+
get keywords() {
|
|
70
|
+
return this._rawDataContract.keywords;
|
|
71
|
+
}
|
|
72
|
+
set keywords(value) {
|
|
73
|
+
this._rawDataContract.keywords = value;
|
|
74
|
+
}
|
|
75
|
+
getSchemas() {
|
|
76
|
+
return valueFromDynamicValue(this._rawDataContract.getSchemas());
|
|
77
|
+
}
|
|
78
|
+
getConfig() {
|
|
79
|
+
return valueFromDynamicValue(this._rawDataContract.getConfig());
|
|
80
|
+
}
|
|
81
|
+
bytes(platformVersion) {
|
|
82
|
+
return this._rawDataContract.bytes(valueToDynamicValue(platformVersion));
|
|
83
|
+
}
|
|
84
|
+
hex(platformVersion) {
|
|
85
|
+
return this._rawDataContract.hex(valueToDynamicValue(platformVersion));
|
|
86
|
+
}
|
|
87
|
+
base64(platformVersion) {
|
|
88
|
+
return this._rawDataContract.base64(valueToDynamicValue(platformVersion));
|
|
89
|
+
}
|
|
90
|
+
toJSON(platformVersion) {
|
|
91
|
+
return this._rawDataContract.toJson(valueToDynamicValue(platformVersion));
|
|
92
|
+
}
|
|
93
|
+
toValue(platformVersion) {
|
|
94
|
+
return valueFromDynamicValue(this._rawDataContract.toValue(valueToDynamicValue(platformVersion)));
|
|
95
|
+
}
|
|
96
|
+
static fromValue(value, fullValidation, platformVersion) {
|
|
97
|
+
return DataContractWASM.createFromRawInstance(dppProvider.dpp.DataContractNAPI.fromValue(valueToDynamicValue(value), fullValidation, valueToDynamicValue(platformVersion)));
|
|
98
|
+
}
|
|
99
|
+
static fromBytes(bytes, fullValidation, platformVersion) {
|
|
100
|
+
return DataContractWASM.createFromRawInstance(dppProvider.dpp.DataContractNAPI.fromBytes(bytes, fullValidation, valueToDynamicValue(platformVersion)));
|
|
101
|
+
}
|
|
102
|
+
static fromHex(hex, fullValidation, platformVersion) {
|
|
103
|
+
return DataContractWASM.createFromRawInstance(dppProvider.dpp.DataContractNAPI.fromHex(hex, fullValidation, valueToDynamicValue(platformVersion)));
|
|
104
|
+
}
|
|
105
|
+
static fromBase64(base64, fullValidation, platformVersion) {
|
|
106
|
+
return DataContractWASM.createFromRawInstance(dppProvider.dpp.DataContractNAPI.fromBase64(base64, fullValidation, valueToDynamicValue(platformVersion)));
|
|
107
|
+
}
|
|
108
|
+
static generateId(ownerId, identityNonce) {
|
|
109
|
+
return IdentifierWASM.createFromRawInstance(dppProvider.dpp.DataContractNAPI.generateId(prepareIdentifierValue(ownerId), identityNonce.toString()));
|
|
110
|
+
}
|
|
111
|
+
static createFromRawInstance(rawInstance) {
|
|
112
|
+
const instance = Object.create(this.prototype);
|
|
113
|
+
instance._rawDataContract = rawInstance;
|
|
114
|
+
return instance;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DataContractCreateTransitionNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { DataContractWASM } from '../DataContract.js';
|
|
3
|
+
import { PlatformVersionLike } from '../../types.js';
|
|
4
|
+
import { StateTransitionWASM } from '../StateTransition.js';
|
|
5
|
+
export declare class DataContractCreateTransitionWASM {
|
|
6
|
+
/** @private **/
|
|
7
|
+
_rawDataContractCreateTransition: DataContractCreateTransitionNAPI;
|
|
8
|
+
constructor(dataContract: DataContractWASM, identityNonce: bigint, platformVersion?: PlatformVersionLike);
|
|
9
|
+
get featureVersion(): number;
|
|
10
|
+
get identityNonce(): bigint;
|
|
11
|
+
verifyProtocolVersion(protocolVersion: number): boolean;
|
|
12
|
+
setDataContract(dataContract: DataContractWASM, platformVersion?: PlatformVersionLike): void;
|
|
13
|
+
getDataContract(platformVersion?: PlatformVersionLike, fullValidation?: boolean): DataContractWASM;
|
|
14
|
+
bytes(): Uint8Array;
|
|
15
|
+
hex(): string;
|
|
16
|
+
base64(): string;
|
|
17
|
+
toStateTransition(): StateTransitionWASM;
|
|
18
|
+
static fromBytes(bytes: Uint8Array): DataContractCreateTransitionWASM;
|
|
19
|
+
static fromHex(hex: string): DataContractCreateTransitionWASM;
|
|
20
|
+
static fromBase64(base64: string): DataContractCreateTransitionWASM;
|
|
21
|
+
static fromStateTransition(stateTransition: StateTransitionWASM): DataContractCreateTransitionWASM;
|
|
22
|
+
static createFromRawInstance(rawInstance: DataContractCreateTransitionNAPI): DataContractCreateTransitionWASM;
|
|
23
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { DataContractWASM } from '../DataContract.js';
|
|
2
|
+
import { dppProvider } from '../../provider.js';
|
|
3
|
+
import { valueToDynamicValue } from '../../utils.js';
|
|
4
|
+
import { StateTransitionWASM } from '../StateTransition.js';
|
|
5
|
+
export class DataContractCreateTransitionWASM {
|
|
6
|
+
/** @private **/
|
|
7
|
+
_rawDataContractCreateTransition;
|
|
8
|
+
constructor(dataContract, identityNonce, platformVersion) {
|
|
9
|
+
this._rawDataContractCreateTransition = new dppProvider.dpp.DataContractCreateTransitionNAPI(dataContract._rawDataContract, identityNonce.toString(), valueToDynamicValue(platformVersion));
|
|
10
|
+
}
|
|
11
|
+
get featureVersion() {
|
|
12
|
+
return this._rawDataContractCreateTransition.featureVersion;
|
|
13
|
+
}
|
|
14
|
+
get identityNonce() {
|
|
15
|
+
return BigInt(this._rawDataContractCreateTransition.identityNonce);
|
|
16
|
+
}
|
|
17
|
+
verifyProtocolVersion(protocolVersion) {
|
|
18
|
+
return this._rawDataContractCreateTransition.verifyProtocolVersion(protocolVersion);
|
|
19
|
+
}
|
|
20
|
+
setDataContract(dataContract, platformVersion) {
|
|
21
|
+
this._rawDataContractCreateTransition.setDataContract(dataContract._rawDataContract, valueToDynamicValue(platformVersion));
|
|
22
|
+
}
|
|
23
|
+
getDataContract(platformVersion, fullValidation) {
|
|
24
|
+
return DataContractWASM.createFromRawInstance(this._rawDataContractCreateTransition.getDataContract(valueToDynamicValue(platformVersion), fullValidation));
|
|
25
|
+
}
|
|
26
|
+
bytes() {
|
|
27
|
+
return this._rawDataContractCreateTransition.bytes();
|
|
28
|
+
}
|
|
29
|
+
hex() {
|
|
30
|
+
return this._rawDataContractCreateTransition.hex();
|
|
31
|
+
}
|
|
32
|
+
base64() {
|
|
33
|
+
return this._rawDataContractCreateTransition.base64();
|
|
34
|
+
}
|
|
35
|
+
toStateTransition() {
|
|
36
|
+
return StateTransitionWASM.createFromRawInstance(this._rawDataContractCreateTransition.toStateTransition());
|
|
37
|
+
}
|
|
38
|
+
static fromBytes(bytes) {
|
|
39
|
+
return DataContractCreateTransitionWASM.createFromRawInstance(dppProvider.dpp.DataContractCreateTransitionNAPI.fromBytes(bytes));
|
|
40
|
+
}
|
|
41
|
+
static fromHex(hex) {
|
|
42
|
+
return DataContractCreateTransitionWASM.createFromRawInstance(dppProvider.dpp.DataContractCreateTransitionNAPI.fromHex(hex));
|
|
43
|
+
}
|
|
44
|
+
static fromBase64(base64) {
|
|
45
|
+
return DataContractCreateTransitionWASM.createFromRawInstance(dppProvider.dpp.DataContractCreateTransitionNAPI.fromBase64(base64));
|
|
46
|
+
}
|
|
47
|
+
static fromStateTransition(stateTransition) {
|
|
48
|
+
return DataContractCreateTransitionWASM.createFromRawInstance(dppProvider.dpp.DataContractCreateTransitionNAPI.fromStateTransition(stateTransition._rawStateTransition));
|
|
49
|
+
}
|
|
50
|
+
static createFromRawInstance(rawInstance) {
|
|
51
|
+
const instance = Object.create(this.prototype);
|
|
52
|
+
instance._rawDataContractCreateTransition = rawInstance;
|
|
53
|
+
return instance;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DataContractUpdateTransitionNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { DataContractWASM } from '../DataContract.js';
|
|
3
|
+
import { PlatformVersionLike } from '../../types.js';
|
|
4
|
+
import { StateTransitionWASM } from '../StateTransition.js';
|
|
5
|
+
export declare class DataContractUpdateTransitionWASM {
|
|
6
|
+
/** @private **/
|
|
7
|
+
_rawDataContractUpdateTransition: DataContractUpdateTransitionNAPI;
|
|
8
|
+
constructor(dataContract: DataContractWASM, identityNonce: bigint, platformVersion?: PlatformVersionLike);
|
|
9
|
+
get featureVersion(): number;
|
|
10
|
+
get identityContractNonce(): bigint;
|
|
11
|
+
verifyProtocolVersion(protocolVersion: number): boolean;
|
|
12
|
+
setDataContract(dataContract: DataContractWASM, platformVersion?: PlatformVersionLike): void;
|
|
13
|
+
getDataContract(fullValidation?: boolean, platformVersion?: PlatformVersionLike): DataContractWASM;
|
|
14
|
+
bytes(): Uint8Array;
|
|
15
|
+
hex(): string;
|
|
16
|
+
base64(): string;
|
|
17
|
+
toStateTransition(): StateTransitionWASM;
|
|
18
|
+
static fromBytes(bytes: Uint8Array): DataContractUpdateTransitionWASM;
|
|
19
|
+
static fromHex(hex: string): DataContractUpdateTransitionWASM;
|
|
20
|
+
static fromBase64(base64: string): DataContractUpdateTransitionWASM;
|
|
21
|
+
static fromStateTransition(stateTransition: StateTransitionWASM): DataContractUpdateTransitionWASM;
|
|
22
|
+
static createFromRawInstance(rawInstance: DataContractUpdateTransitionNAPI): DataContractUpdateTransitionWASM;
|
|
23
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { DataContractWASM } from '../DataContract.js';
|
|
2
|
+
import { dppProvider } from '../../provider.js';
|
|
3
|
+
import { valueToDynamicValue } from '../../utils.js';
|
|
4
|
+
import { StateTransitionWASM } from '../StateTransition.js';
|
|
5
|
+
export class DataContractUpdateTransitionWASM {
|
|
6
|
+
/** @private **/
|
|
7
|
+
_rawDataContractUpdateTransition;
|
|
8
|
+
constructor(dataContract, identityNonce, platformVersion) {
|
|
9
|
+
this._rawDataContractUpdateTransition = new dppProvider.dpp.DataContractUpdateTransitionNAPI(dataContract._rawDataContract, identityNonce.toString(), valueToDynamicValue(platformVersion));
|
|
10
|
+
}
|
|
11
|
+
get featureVersion() {
|
|
12
|
+
return this._rawDataContractUpdateTransition.featureVersion;
|
|
13
|
+
}
|
|
14
|
+
get identityContractNonce() {
|
|
15
|
+
return BigInt(this._rawDataContractUpdateTransition.identityContractNonce);
|
|
16
|
+
}
|
|
17
|
+
verifyProtocolVersion(protocolVersion) {
|
|
18
|
+
return this._rawDataContractUpdateTransition.verifyProtocolVersion(protocolVersion);
|
|
19
|
+
}
|
|
20
|
+
setDataContract(dataContract, platformVersion) {
|
|
21
|
+
this._rawDataContractUpdateTransition.setDataContract(dataContract._rawDataContract, valueToDynamicValue(platformVersion));
|
|
22
|
+
}
|
|
23
|
+
getDataContract(fullValidation, platformVersion) {
|
|
24
|
+
return DataContractWASM.createFromRawInstance(this._rawDataContractUpdateTransition.getDataContract(fullValidation, valueToDynamicValue(platformVersion)));
|
|
25
|
+
}
|
|
26
|
+
bytes() {
|
|
27
|
+
return this._rawDataContractUpdateTransition.bytes();
|
|
28
|
+
}
|
|
29
|
+
hex() {
|
|
30
|
+
return this._rawDataContractUpdateTransition.hex();
|
|
31
|
+
}
|
|
32
|
+
base64() {
|
|
33
|
+
return this._rawDataContractUpdateTransition.base64();
|
|
34
|
+
}
|
|
35
|
+
toStateTransition() {
|
|
36
|
+
return StateTransitionWASM.createFromRawInstance(this._rawDataContractUpdateTransition.toStateTransition());
|
|
37
|
+
}
|
|
38
|
+
static fromBytes(bytes) {
|
|
39
|
+
return DataContractUpdateTransitionWASM.createFromRawInstance(dppProvider.dpp.DataContractUpdateTransitionNAPI.fromBytes(bytes));
|
|
40
|
+
}
|
|
41
|
+
static fromHex(hex) {
|
|
42
|
+
return DataContractUpdateTransitionWASM.createFromRawInstance(dppProvider.dpp.DataContractUpdateTransitionNAPI.fromHex(hex));
|
|
43
|
+
}
|
|
44
|
+
static fromBase64(base64) {
|
|
45
|
+
return DataContractUpdateTransitionWASM.createFromRawInstance(dppProvider.dpp.DataContractUpdateTransitionNAPI.fromBase64(base64));
|
|
46
|
+
}
|
|
47
|
+
static fromStateTransition(stateTransition) {
|
|
48
|
+
return DataContractUpdateTransitionWASM.createFromRawInstance(dppProvider.dpp.DataContractUpdateTransitionNAPI.fromStateTransition(stateTransition._rawStateTransition));
|
|
49
|
+
}
|
|
50
|
+
static createFromRawInstance(rawInstance) {
|
|
51
|
+
const instance = Object.create(this.prototype);
|
|
52
|
+
instance._rawDataContractUpdateTransition = rawInstance;
|
|
53
|
+
return instance;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { DocumentNAPI } from '../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { IdentifierLike, PlatformVersionLike } from '../types.js';
|
|
3
|
+
import { IdentifierWASM } from './Identifier.js';
|
|
4
|
+
import { DataContractWASM } from './DataContract.js';
|
|
5
|
+
export declare class DocumentWASM {
|
|
6
|
+
/** @private **/
|
|
7
|
+
_rawDocument: DocumentNAPI;
|
|
8
|
+
constructor(documentContent: object, documentTypeName: string, revision: bigint, dataContractId: IdentifierLike, ownerId: IdentifierLike, documentId?: IdentifierLike, creatorId?: IdentifierLike);
|
|
9
|
+
get id(): IdentifierWASM;
|
|
10
|
+
set id(id: IdentifierWASM);
|
|
11
|
+
get entropy(): Uint8Array | undefined;
|
|
12
|
+
set entropy(value: Uint8Array | undefined);
|
|
13
|
+
get dataContractId(): IdentifierWASM;
|
|
14
|
+
set dataContractId(value: IdentifierLike);
|
|
15
|
+
get ownerId(): IdentifierWASM;
|
|
16
|
+
set ownerId(value: IdentifierLike);
|
|
17
|
+
get properties(): object;
|
|
18
|
+
set properties(value: object);
|
|
19
|
+
get revision(): bigint | undefined;
|
|
20
|
+
set revision(value: bigint | undefined);
|
|
21
|
+
get createdAt(): bigint | undefined;
|
|
22
|
+
set createdAt(timestamp: Date | number | bigint | undefined);
|
|
23
|
+
get updatedAt(): bigint | undefined;
|
|
24
|
+
set updatedAt(timestamp: Date | number | bigint | undefined);
|
|
25
|
+
get transferredAt(): bigint | undefined;
|
|
26
|
+
set transferredAt(timestamp: Date | number | bigint | undefined);
|
|
27
|
+
get createdAtBlockHeight(): bigint | undefined;
|
|
28
|
+
set createdAtBlockHeight(value: bigint | undefined);
|
|
29
|
+
get updatedAtBlockHeight(): bigint | undefined;
|
|
30
|
+
set updatedAtBlockHeight(value: bigint | undefined);
|
|
31
|
+
get transferredAtBlockHeight(): bigint | undefined;
|
|
32
|
+
set transferredAtBlockHeight(value: bigint | undefined);
|
|
33
|
+
get createdAtCoreBlockHeight(): number | undefined;
|
|
34
|
+
set createdAtCoreBlockHeight(value: number | undefined);
|
|
35
|
+
get updatedAtCoreBlockHeight(): number | undefined;
|
|
36
|
+
set updatedAtCoreBlockHeight(value: number | undefined);
|
|
37
|
+
get transferredAtCoreBlockHeight(): number | undefined;
|
|
38
|
+
set transferredAtCoreBlockHeight(value: number | undefined);
|
|
39
|
+
get documentTypeName(): string;
|
|
40
|
+
set documentTypeName(value: string);
|
|
41
|
+
get creatorId(): IdentifierWASM | undefined;
|
|
42
|
+
set creatorId(value: IdentifierLike);
|
|
43
|
+
bytes(dataContract: DataContractWASM, platformVersion?: PlatformVersionLike): Uint8Array;
|
|
44
|
+
hex(dataContract: DataContractWASM, platformVersion?: PlatformVersionLike): string;
|
|
45
|
+
base64(dataContract: DataContractWASM, platformVersion?: PlatformVersionLike): string;
|
|
46
|
+
static fromBytes(bytes: Uint8Array, dataContract: DataContractWASM, documentTypeName: string, platformVersion?: PlatformVersionLike): DocumentWASM;
|
|
47
|
+
static fromHex(hex: string, dataContract: DataContractWASM, documentTypeName: string, platformVersion?: PlatformVersionLike): DocumentWASM;
|
|
48
|
+
static fromBase64(base64: string, dataContract: DataContractWASM, documentTypeName: string, platformVersion?: PlatformVersionLike): DocumentWASM;
|
|
49
|
+
static generateId(documentTypeName: string, ownerId: IdentifierLike, dataContractId: IdentifierLike, entropy?: Uint8Array): IdentifierWASM;
|
|
50
|
+
static createFromRawInstance(rawInstance: DocumentNAPI): DocumentWASM;
|
|
51
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { dppProvider } from '../provider.js';
|
|
2
|
+
import { prepareIdentifierValue, valueFromDynamicValue, valueToDynamicValue } from '../utils.js';
|
|
3
|
+
import { IdentifierWASM } from './Identifier.js';
|
|
4
|
+
export class DocumentWASM {
|
|
5
|
+
/** @private **/
|
|
6
|
+
_rawDocument;
|
|
7
|
+
constructor(documentContent, documentTypeName, revision, dataContractId, ownerId, documentId, creatorId) {
|
|
8
|
+
this._rawDocument = new dppProvider.dpp.DocumentNAPI(valueToDynamicValue(documentContent), documentTypeName, revision.toString(), prepareIdentifierValue(dataContractId), prepareIdentifierValue(ownerId), documentId != null ? prepareIdentifierValue(documentId) : undefined, creatorId != null ? prepareIdentifierValue(creatorId) : undefined);
|
|
9
|
+
}
|
|
10
|
+
get id() {
|
|
11
|
+
return IdentifierWASM.createFromRawInstance(this._rawDocument.id);
|
|
12
|
+
}
|
|
13
|
+
set id(id) {
|
|
14
|
+
this._rawDocument.id = id._rawIdentifier;
|
|
15
|
+
}
|
|
16
|
+
get entropy() {
|
|
17
|
+
return this._rawDocument.entropy ?? undefined;
|
|
18
|
+
}
|
|
19
|
+
set entropy(value) {
|
|
20
|
+
this._rawDocument.entropy = value;
|
|
21
|
+
}
|
|
22
|
+
get dataContractId() {
|
|
23
|
+
return IdentifierWASM.createFromRawInstance(this._rawDocument.dataContractId);
|
|
24
|
+
}
|
|
25
|
+
set dataContractId(value) {
|
|
26
|
+
this._rawDocument.dataContractId = prepareIdentifierValue(value);
|
|
27
|
+
}
|
|
28
|
+
get ownerId() {
|
|
29
|
+
return IdentifierWASM.createFromRawInstance(this._rawDocument.ownerId);
|
|
30
|
+
}
|
|
31
|
+
set ownerId(value) {
|
|
32
|
+
this._rawDocument.ownerId = prepareIdentifierValue(value);
|
|
33
|
+
}
|
|
34
|
+
get properties() {
|
|
35
|
+
return valueFromDynamicValue(this._rawDocument.properties);
|
|
36
|
+
}
|
|
37
|
+
set properties(value) {
|
|
38
|
+
this._rawDocument.properties = valueToDynamicValue(value);
|
|
39
|
+
}
|
|
40
|
+
get revision() {
|
|
41
|
+
const revision = this._rawDocument.revision;
|
|
42
|
+
return revision != null ? BigInt(revision) : undefined;
|
|
43
|
+
}
|
|
44
|
+
set revision(value) {
|
|
45
|
+
this._rawDocument.revision = value?.toString();
|
|
46
|
+
}
|
|
47
|
+
get createdAt() {
|
|
48
|
+
const createdAt = this._rawDocument.createdAt;
|
|
49
|
+
if (createdAt != null) {
|
|
50
|
+
return BigInt(createdAt);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
set createdAt(timestamp) {
|
|
54
|
+
if (timestamp instanceof Date) {
|
|
55
|
+
this._rawDocument.createdAt = timestamp.getTime().toString();
|
|
56
|
+
}
|
|
57
|
+
else if (timestamp == null) {
|
|
58
|
+
this._rawDocument.createdAt = undefined;
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
this._rawDocument.createdAt = timestamp.toString();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
get updatedAt() {
|
|
65
|
+
const updatedAt = this._rawDocument.updatedAt;
|
|
66
|
+
if (updatedAt != null) {
|
|
67
|
+
return BigInt(updatedAt);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
set updatedAt(timestamp) {
|
|
71
|
+
if (timestamp instanceof Date) {
|
|
72
|
+
this._rawDocument.updatedAt = timestamp.getTime().toString();
|
|
73
|
+
}
|
|
74
|
+
else if (timestamp == null) {
|
|
75
|
+
this._rawDocument.updatedAt = undefined;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
this._rawDocument.updatedAt = timestamp.toString();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
get transferredAt() {
|
|
82
|
+
const transferredAt = this._rawDocument.transferredAt;
|
|
83
|
+
if (transferredAt != null) {
|
|
84
|
+
return BigInt(transferredAt);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
set transferredAt(timestamp) {
|
|
88
|
+
if (timestamp instanceof Date) {
|
|
89
|
+
this._rawDocument.transferredAt = timestamp.getTime().toString();
|
|
90
|
+
}
|
|
91
|
+
else if (timestamp == null) {
|
|
92
|
+
this._rawDocument.transferredAt = undefined;
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
this._rawDocument.transferredAt = timestamp.toString();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
get createdAtBlockHeight() {
|
|
99
|
+
const createdAtBlockHeight = this._rawDocument.createdAtBlockHeight;
|
|
100
|
+
if (createdAtBlockHeight != null) {
|
|
101
|
+
return BigInt(createdAtBlockHeight);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
set createdAtBlockHeight(value) {
|
|
105
|
+
this._rawDocument.createdAtBlockHeight = value?.toString();
|
|
106
|
+
}
|
|
107
|
+
get updatedAtBlockHeight() {
|
|
108
|
+
const updatedAtBlockHeight = this._rawDocument.createdAtBlockHeight;
|
|
109
|
+
if (updatedAtBlockHeight != null) {
|
|
110
|
+
return BigInt(updatedAtBlockHeight);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
set updatedAtBlockHeight(value) {
|
|
114
|
+
this._rawDocument.createdAtBlockHeight = value?.toString();
|
|
115
|
+
}
|
|
116
|
+
get transferredAtBlockHeight() {
|
|
117
|
+
const transferredAtBlockHeight = this._rawDocument.createdAtBlockHeight;
|
|
118
|
+
if (transferredAtBlockHeight != null) {
|
|
119
|
+
return BigInt(transferredAtBlockHeight);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
set transferredAtBlockHeight(value) {
|
|
123
|
+
this._rawDocument.createdAtBlockHeight = value?.toString();
|
|
124
|
+
}
|
|
125
|
+
get createdAtCoreBlockHeight() {
|
|
126
|
+
return this._rawDocument.createdAtCoreBlockHeight ?? undefined;
|
|
127
|
+
}
|
|
128
|
+
set createdAtCoreBlockHeight(value) {
|
|
129
|
+
this._rawDocument.createdAtCoreBlockHeight = value;
|
|
130
|
+
}
|
|
131
|
+
get updatedAtCoreBlockHeight() {
|
|
132
|
+
return this._rawDocument.updatedAtCoreBlockHeight ?? undefined;
|
|
133
|
+
}
|
|
134
|
+
set updatedAtCoreBlockHeight(value) {
|
|
135
|
+
this._rawDocument.createdAtCoreBlockHeight = value;
|
|
136
|
+
}
|
|
137
|
+
get transferredAtCoreBlockHeight() {
|
|
138
|
+
return this._rawDocument.transferredAtCoreBlockHeight ?? undefined;
|
|
139
|
+
}
|
|
140
|
+
set transferredAtCoreBlockHeight(value) {
|
|
141
|
+
this._rawDocument.createdAtCoreBlockHeight = value;
|
|
142
|
+
}
|
|
143
|
+
get documentTypeName() {
|
|
144
|
+
return this._rawDocument.documentTypeName;
|
|
145
|
+
}
|
|
146
|
+
set documentTypeName(value) {
|
|
147
|
+
this._rawDocument.documentTypeName = value;
|
|
148
|
+
}
|
|
149
|
+
get creatorId() {
|
|
150
|
+
const id = this._rawDocument.creatorId;
|
|
151
|
+
if (id != null) {
|
|
152
|
+
return IdentifierWASM.createFromRawInstance(id);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
set creatorId(value) {
|
|
156
|
+
this._rawDocument.creatorId = prepareIdentifierValue(value);
|
|
157
|
+
}
|
|
158
|
+
bytes(dataContract, platformVersion) {
|
|
159
|
+
return this._rawDocument.bytes(dataContract._rawDataContract, valueToDynamicValue(platformVersion));
|
|
160
|
+
}
|
|
161
|
+
hex(dataContract, platformVersion) {
|
|
162
|
+
return this._rawDocument.hex(dataContract._rawDataContract, valueToDynamicValue(platformVersion));
|
|
163
|
+
}
|
|
164
|
+
base64(dataContract, platformVersion) {
|
|
165
|
+
return this._rawDocument.base64(dataContract._rawDataContract, valueToDynamicValue(platformVersion));
|
|
166
|
+
}
|
|
167
|
+
static fromBytes(bytes, dataContract, documentTypeName, platformVersion) {
|
|
168
|
+
return DocumentWASM.createFromRawInstance(dppProvider.dpp.DocumentNAPI.fromBytes(bytes, dataContract._rawDataContract, documentTypeName, valueToDynamicValue(platformVersion)));
|
|
169
|
+
}
|
|
170
|
+
static fromHex(hex, dataContract, documentTypeName, platformVersion) {
|
|
171
|
+
return DocumentWASM.createFromRawInstance(dppProvider.dpp.DocumentNAPI.fromHex(hex, dataContract._rawDataContract, documentTypeName, valueToDynamicValue(platformVersion)));
|
|
172
|
+
}
|
|
173
|
+
static fromBase64(base64, dataContract, documentTypeName, platformVersion) {
|
|
174
|
+
return DocumentWASM.createFromRawInstance(dppProvider.dpp.DocumentNAPI.fromBase64(base64, dataContract._rawDataContract, documentTypeName, valueToDynamicValue(platformVersion)));
|
|
175
|
+
}
|
|
176
|
+
static generateId(documentTypeName, ownerId, dataContractId, entropy) {
|
|
177
|
+
return IdentifierWASM.createFromRawInstance(dppProvider.dpp.DocumentNAPI.generateId(documentTypeName, prepareIdentifierValue(ownerId), prepareIdentifierValue(dataContractId), entropy));
|
|
178
|
+
}
|
|
179
|
+
static createFromRawInstance(rawInstance) {
|
|
180
|
+
const instance = Object.create(this.prototype);
|
|
181
|
+
instance._rawDocument = rawInstance;
|
|
182
|
+
return instance;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PrivateEncryptedNoteNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
+
export declare class PrivateEncryptedNoteWASM {
|
|
3
|
+
/** @private **/
|
|
4
|
+
_rawEncryptedNote: PrivateEncryptedNoteNAPI;
|
|
5
|
+
constructor(rootEncryptionKeyIndex: number, derivationEncryptionKeyIndex: number, value: Uint8Array);
|
|
6
|
+
get rootEncryptionKeyIndex(): number;
|
|
7
|
+
set rootEncryptionKeyIndex(index: number);
|
|
8
|
+
get derivationEncryptionKeyIndex(): number;
|
|
9
|
+
set derivationEncryptionKeyIndex(index: number);
|
|
10
|
+
get value(): Uint8Array;
|
|
11
|
+
set value(value: Uint8Array);
|
|
12
|
+
static createFromRawInstance(rawInstance: PrivateEncryptedNoteNAPI): PrivateEncryptedNoteWASM;
|
|
13
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
export class PrivateEncryptedNoteWASM {
|
|
3
|
+
/** @private **/
|
|
4
|
+
_rawEncryptedNote;
|
|
5
|
+
constructor(rootEncryptionKeyIndex, derivationEncryptionKeyIndex, value) {
|
|
6
|
+
this._rawEncryptedNote = new dppProvider.dpp.PrivateEncryptedNoteNAPI(rootEncryptionKeyIndex, derivationEncryptionKeyIndex, value);
|
|
7
|
+
}
|
|
8
|
+
get rootEncryptionKeyIndex() {
|
|
9
|
+
return this._rawEncryptedNote.rootEncryptionKeyIndex;
|
|
10
|
+
}
|
|
11
|
+
set rootEncryptionKeyIndex(index) {
|
|
12
|
+
this._rawEncryptedNote.rootEncryptionKeyIndex = index;
|
|
13
|
+
}
|
|
14
|
+
get derivationEncryptionKeyIndex() {
|
|
15
|
+
return this._rawEncryptedNote.derivationEncryptionKeyIndex;
|
|
16
|
+
}
|
|
17
|
+
set derivationEncryptionKeyIndex(index) {
|
|
18
|
+
this._rawEncryptedNote.derivationEncryptionKeyIndex = index;
|
|
19
|
+
}
|
|
20
|
+
get value() {
|
|
21
|
+
return this._rawEncryptedNote.value;
|
|
22
|
+
}
|
|
23
|
+
set value(value) {
|
|
24
|
+
this._rawEncryptedNote.value = value;
|
|
25
|
+
}
|
|
26
|
+
static createFromRawInstance(rawInstance) {
|
|
27
|
+
const instance = Object.create(this.prototype);
|
|
28
|
+
instance._rawEncryptedNote = rawInstance;
|
|
29
|
+
return instance;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SharedEncryptedNoteNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
+
export declare class SharedEncryptedNoteWASM {
|
|
3
|
+
/** @private **/
|
|
4
|
+
_rawSharedNote: SharedEncryptedNoteNAPI;
|
|
5
|
+
constructor(senderKeyIndex: number, recipientKeyIndex: number, value: Uint8Array);
|
|
6
|
+
get senderKeyIndex(): number;
|
|
7
|
+
set senderKeyIndex(index: number);
|
|
8
|
+
get recipientKeyIndex(): number;
|
|
9
|
+
set recipientKeyIndex(index: number);
|
|
10
|
+
get value(): Uint8Array;
|
|
11
|
+
set value(value: Uint8Array);
|
|
12
|
+
static createFromRawInstance(rawInstance: SharedEncryptedNoteNAPI): SharedEncryptedNoteWASM;
|
|
13
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
export class SharedEncryptedNoteWASM {
|
|
3
|
+
/** @private **/
|
|
4
|
+
_rawSharedNote;
|
|
5
|
+
constructor(senderKeyIndex, recipientKeyIndex, value) {
|
|
6
|
+
this._rawSharedNote = new dppProvider.dpp.SharedEncryptedNoteNAPI(senderKeyIndex, recipientKeyIndex, value);
|
|
7
|
+
}
|
|
8
|
+
get senderKeyIndex() {
|
|
9
|
+
return this._rawSharedNote.senderKeyIndex;
|
|
10
|
+
}
|
|
11
|
+
set senderKeyIndex(index) {
|
|
12
|
+
this._rawSharedNote.senderKeyIndex = index;
|
|
13
|
+
}
|
|
14
|
+
get recipientKeyIndex() {
|
|
15
|
+
return this._rawSharedNote.recipientKeyIndex;
|
|
16
|
+
}
|
|
17
|
+
set recipientKeyIndex(index) {
|
|
18
|
+
this._rawSharedNote.recipientKeyIndex = index;
|
|
19
|
+
}
|
|
20
|
+
get value() {
|
|
21
|
+
return this._rawSharedNote.value;
|
|
22
|
+
}
|
|
23
|
+
set value(value) {
|
|
24
|
+
this._rawSharedNote.value = value;
|
|
25
|
+
}
|
|
26
|
+
static createFromRawInstance(rawInstance) {
|
|
27
|
+
const instance = Object.create(this.prototype);
|
|
28
|
+
instance._rawSharedNote = rawInstance;
|
|
29
|
+
return instance;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GroupStateTransitionInfoNAPI } from '../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { IdentifierLike } from '../types.js';
|
|
3
|
+
import { IdentifierWASM } from './Identifier.js';
|
|
4
|
+
export declare class GroupStateTransitionInfoWASM {
|
|
5
|
+
/** @private **/
|
|
6
|
+
_rawGroupStateTransitionInfo: GroupStateTransitionInfoNAPI;
|
|
7
|
+
constructor(groupContractPosition: number, actionId: IdentifierLike, actionIsProposer: boolean);
|
|
8
|
+
get groupContractPosition(): number;
|
|
9
|
+
set groupContractPosition(groupContractPosition: number);
|
|
10
|
+
get actionId(): IdentifierWASM;
|
|
11
|
+
set actionId(actionId: IdentifierLike);
|
|
12
|
+
get actionIsProposer(): boolean;
|
|
13
|
+
set actionIsProposer(actionIsProposer: boolean);
|
|
14
|
+
static createFromRawInstance(rawInstance: GroupStateTransitionInfoNAPI): GroupStateTransitionInfoWASM;
|
|
15
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { dppProvider } from '../provider.js';
|
|
2
|
+
import { prepareIdentifierValue } from '../utils.js';
|
|
3
|
+
import { IdentifierWASM } from './Identifier.js';
|
|
4
|
+
export class GroupStateTransitionInfoWASM {
|
|
5
|
+
/** @private **/
|
|
6
|
+
_rawGroupStateTransitionInfo;
|
|
7
|
+
constructor(groupContractPosition, actionId, actionIsProposer) {
|
|
8
|
+
this._rawGroupStateTransitionInfo = new dppProvider.dpp.GroupStateTransitionInfoNAPI(groupContractPosition, prepareIdentifierValue(actionId), actionIsProposer);
|
|
9
|
+
}
|
|
10
|
+
get groupContractPosition() {
|
|
11
|
+
return this._rawGroupStateTransitionInfo.groupContractPosition;
|
|
12
|
+
}
|
|
13
|
+
set groupContractPosition(groupContractPosition) {
|
|
14
|
+
this._rawGroupStateTransitionInfo.groupContractPosition = groupContractPosition;
|
|
15
|
+
}
|
|
16
|
+
get actionId() {
|
|
17
|
+
return IdentifierWASM.createFromRawInstance(this._rawGroupStateTransitionInfo.actionId);
|
|
18
|
+
}
|
|
19
|
+
set actionId(actionId) {
|
|
20
|
+
this._rawGroupStateTransitionInfo.actionId = prepareIdentifierValue(actionId);
|
|
21
|
+
}
|
|
22
|
+
get actionIsProposer() {
|
|
23
|
+
return this._rawGroupStateTransitionInfo.actionIsProposer;
|
|
24
|
+
}
|
|
25
|
+
set actionIsProposer(actionIsProposer) {
|
|
26
|
+
this._rawGroupStateTransitionInfo.actionIsProposer = actionIsProposer;
|
|
27
|
+
}
|
|
28
|
+
static createFromRawInstance(rawInstance) {
|
|
29
|
+
const instance = Object.create(this.prototype);
|
|
30
|
+
instance._rawGroupStateTransitionInfo = rawInstance;
|
|
31
|
+
return instance;
|
|
32
|
+
}
|
|
33
|
+
}
|