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,274 @@
|
|
|
1
|
+
import * as protocol from '../../binaries/bindingsTypes.js';
|
|
2
|
+
import { AddressWitnessP2pkhNAPI, AddressWitnessP2shNAPI, DataContractNAPI, DistributionLinearNAPI, DistributionExponentialNAPI, DistributionFixedAmountNAPI, DistributionInvertedLogarithmicNAPI, DistributionLogarithmicNAPI, DistributionPolynomialNAPI, DistributionRandomNAPI, DistributionStepDecreasingAmountNAPI, DocumentNAPI, IdentifierNAPI, IdentityNAPI, PartialIdentityNAPI, TokenConfigurationLocalizationJsonNAPI, TokenStatusNAPI, VerifiedAddressInfosNAPI, VerifiedBalanceTransferNAPI, VerifiedDocumentNAPI, VerifiedIdentityBalanceNAPI, VerifiedIdentityFullWithAddressInfosNAPI, VerifiedIdentityTokenInfoNAPI, VerifiedIdentityWithAddressInfosNAPI, VerifiedTokenGroupActionWithDocumentNAPI, VerifiedTokenGroupActionWithTokenBalanceNAPI, VerifiedTokenGroupActionWithTokenIdentityInfoNAPI, VerifiedTokenGroupActionWithTokenPricingScheduleNAPI, VerifiedTokenPricingScheduleNAPI, VoteNAPI } from '../../binaries/bindingsTypes.js';
|
|
3
|
+
import { ActionGoal, AssetLockProofType, GasFeesPaidBy, KeyType, NetworkWASM, PlatformVersionWASM, Pooling, Purpose, SecurityLevel, TokenDistributionType, TokenEmergencyAction, VoteStateResultType } from './enums.js';
|
|
4
|
+
import { IdentifierWASM } from './structs/Identifier.js';
|
|
5
|
+
import { languageCodes } from './constants.js';
|
|
6
|
+
import { DistributionFunctionWASM } from './structs/TokenConfiguration/DistributionFunction.js';
|
|
7
|
+
import { TokenConfigurationWASM } from './structs/TokenConfiguration/TokenConfiguration.js';
|
|
8
|
+
import { GroupWASM } from './structs/TokenConfiguration/Group.js';
|
|
9
|
+
import { DocumentCreateTransitionWASM } from './structs/Batch/DocumentTransitions/DocumentCreateTransition.js';
|
|
10
|
+
import { DocumentDeleteTransitionWASM } from './structs/Batch/DocumentTransitions/DocumentDeleteTransition.js';
|
|
11
|
+
import { DocumentPurchaseTransitionWASM } from './structs/Batch/DocumentTransitions/DocumentPurchaseTransition.js';
|
|
12
|
+
import { DocumentReplaceTransitionWASM } from './structs/Batch/DocumentTransitions/DocumentReplaceTransition.js';
|
|
13
|
+
import { DocumentTransferTransitionWASM } from './structs/Batch/DocumentTransitions/DocumentTransferTransition.js';
|
|
14
|
+
import { DocumentUpdatePriceTransitionWASM } from './structs/Batch/DocumentTransitions/DocumentUpdatePriceTransition.js';
|
|
15
|
+
import { TokenConfigUpdateTransitionWASM } from './structs/Batch/TokenTransitions/TokenConfigUpdateTransition.js';
|
|
16
|
+
import { TokenDirectPurchaseTransitionWASM } from './structs/Batch/TokenTransitions/TokenDirectPurchaseTransition.js';
|
|
17
|
+
import { TokenSetPriceForDirectPurchaseTransitionWASM } from './structs/Batch/TokenTransitions/TokenSetPriceForDirectPurchaseTransition.js';
|
|
18
|
+
import { TokenBurnTransitionWASM } from './structs/Batch/TokenTransitions/TokenBurnTransition.js';
|
|
19
|
+
import { TokenClaimTransitionWASM } from './structs/Batch/TokenTransitions/TokenClaimTransition.js';
|
|
20
|
+
import { TokenUnFreezeTransitionWASM } from './structs/Batch/TokenTransitions/TokenUnFreezeTransition.js';
|
|
21
|
+
import { TokenTransferTransitionWASM } from './structs/Batch/TokenTransitions/TokenTransferTransition.js';
|
|
22
|
+
import { TokenMintTransitionWASM } from './structs/Batch/TokenTransitions/TokenMintTransition.js';
|
|
23
|
+
import { TokenFreezeTransitionWASM } from './structs/Batch/TokenTransitions/TokenFreezeTransition.js';
|
|
24
|
+
import { TokenEmergencyActionTransitionWASM } from './structs/Batch/TokenTransitions/TokenEmergencyActionTransition.js';
|
|
25
|
+
import { TokenDestroyFrozenFundsTransitionWASM } from './structs/Batch/TokenTransitions/TokenDestroyFrozenFundsTransition.js';
|
|
26
|
+
import { DataContractWASM } from './structs/DataContract.js';
|
|
27
|
+
import { IdentityWASM } from './structs/Identity.js';
|
|
28
|
+
import { PartialIdentityWASM } from './structs/PartialIdentity.js';
|
|
29
|
+
import { DocumentWASM } from './structs/Document.js';
|
|
30
|
+
import { VoteWASM } from './structs/MasternodeVote/Vote.js';
|
|
31
|
+
import { TokenPricingScheduleWASM } from './structs/Batch/TokenPricingSchedule.js';
|
|
32
|
+
import { PlatformAddressWASM } from './structs/Address/PlatformAddress.js';
|
|
33
|
+
export type DashPlatformProtocol = typeof protocol;
|
|
34
|
+
export type IdentifierLike = string | Uint8Array | IdentifierNAPI | IdentifierWASM;
|
|
35
|
+
export type KeyTypeLike = KeyType | keyof typeof KeyType;
|
|
36
|
+
export type NetworkLike = NetworkWASM | keyof typeof NetworkWASM;
|
|
37
|
+
export type SecurityLevelLike = SecurityLevel | keyof typeof SecurityLevel;
|
|
38
|
+
export type PlatformVersionLike = PlatformVersionWASM | keyof typeof PlatformVersionWASM;
|
|
39
|
+
export type PurposeLike = Purpose | keyof typeof Purpose;
|
|
40
|
+
export type ActionGoalLike = ActionGoal | keyof typeof ActionGoal;
|
|
41
|
+
export type GasFeesPaidByLike = GasFeesPaidBy | keyof typeof GasFeesPaidBy;
|
|
42
|
+
export type TokenDistributionLike = TokenDistributionType | keyof typeof TokenDistributionType;
|
|
43
|
+
export type TokenEmergencyActionLike = TokenEmergencyAction | keyof typeof TokenEmergencyAction;
|
|
44
|
+
export type AssetLockProofTypeLike = AssetLockProofType | keyof typeof AssetLockProofType;
|
|
45
|
+
export type PoolingLike = Pooling | keyof typeof Pooling;
|
|
46
|
+
export type VoteStateResultTypeLike = VoteStateResultType | keyof typeof VoteStateResultType;
|
|
47
|
+
export type EnumLike = KeyTypeLike | NetworkLike | SecurityLevelLike | PlatformVersionLike | PurposeLike;
|
|
48
|
+
export type AddressWitnessP2PKH = AddressWitnessP2pkhNAPI;
|
|
49
|
+
export type AddressWitnessP2SH = AddressWitnessP2shNAPI;
|
|
50
|
+
export type TokenConfigurationLocalizationJson = TokenConfigurationLocalizationJsonNAPI;
|
|
51
|
+
export type DistributionFixedAmount = DistributionFixedAmountNAPI;
|
|
52
|
+
export type DistributionRandom = DistributionRandomNAPI;
|
|
53
|
+
export type DistributionStepDecreasingAmount = DistributionStepDecreasingAmountNAPI;
|
|
54
|
+
export interface DistributionStepwiseStep {
|
|
55
|
+
step: bigint;
|
|
56
|
+
amount: bigint;
|
|
57
|
+
}
|
|
58
|
+
export type DistributionStepwise = DistributionStepwiseStep[];
|
|
59
|
+
export type DistributionLinear = DistributionLinearNAPI;
|
|
60
|
+
export type DistributionPolynomial = DistributionPolynomialNAPI;
|
|
61
|
+
export type DistributionExponential = DistributionExponentialNAPI;
|
|
62
|
+
export type DistributionLogarithmic = DistributionLogarithmicNAPI;
|
|
63
|
+
export type DistributionInvertedLogarithmic = DistributionInvertedLogarithmicNAPI;
|
|
64
|
+
export interface RewardDistribution {
|
|
65
|
+
interval: bigint | number;
|
|
66
|
+
function: DistributionFunctionWASM;
|
|
67
|
+
distributionType: 'BlockBasedDistribution' | 'TimeBasedDistribution' | 'EpochBasedDistribution';
|
|
68
|
+
}
|
|
69
|
+
export type ISO639_CODES = typeof languageCodes[number];
|
|
70
|
+
export interface DataContractTokens {
|
|
71
|
+
position: number;
|
|
72
|
+
tokenConfiguration: TokenConfigurationWASM;
|
|
73
|
+
}
|
|
74
|
+
export interface DataContractGroups {
|
|
75
|
+
position: number;
|
|
76
|
+
group: GroupWASM;
|
|
77
|
+
}
|
|
78
|
+
export type DocumentTransitionLike = DocumentCreateTransitionWASM | DocumentDeleteTransitionWASM | DocumentPurchaseTransitionWASM | DocumentReplaceTransitionWASM | DocumentTransferTransitionWASM | DocumentUpdatePriceTransitionWASM;
|
|
79
|
+
export type TokenTransitionLike = TokenConfigUpdateTransitionWASM | TokenDirectPurchaseTransitionWASM | TokenSetPriceForDirectPurchaseTransitionWASM | TokenBurnTransitionWASM | TokenClaimTransitionWASM | TokenDestroyFrozenFundsTransitionWASM | TokenEmergencyActionTransitionWASM | TokenFreezeTransitionWASM | TokenMintTransitionWASM | TokenTransferTransitionWASM | TokenUnFreezeTransitionWASM;
|
|
80
|
+
export interface ExtendedEpochInfo {
|
|
81
|
+
index: number;
|
|
82
|
+
firstBlockTime: bigint;
|
|
83
|
+
firstBlockHeight: bigint;
|
|
84
|
+
firstCoreBlockHeight: number;
|
|
85
|
+
feeMultiplierPermille: bigint;
|
|
86
|
+
protocolVersion: number;
|
|
87
|
+
}
|
|
88
|
+
export interface VerifiedEpochsInfo {
|
|
89
|
+
rootHash: Uint8Array;
|
|
90
|
+
epochsInfo: ExtendedEpochInfo[];
|
|
91
|
+
}
|
|
92
|
+
export interface VerifiedTotalCredits {
|
|
93
|
+
rootHash: Uint8Array;
|
|
94
|
+
totalCredits: bigint;
|
|
95
|
+
}
|
|
96
|
+
export interface StartAt {
|
|
97
|
+
startIdentifier: IdentifierLike;
|
|
98
|
+
startIdentifierIncluded: boolean;
|
|
99
|
+
}
|
|
100
|
+
export type Winner = undefined | NoWinner | LockedWinner | WonByIdentityWinner;
|
|
101
|
+
export type WinnerType = 'NoWinner' | 'Locked' | 'WonByIdentity';
|
|
102
|
+
export interface NoWinner {
|
|
103
|
+
type: WinnerType;
|
|
104
|
+
blockInfo: BlockInfo;
|
|
105
|
+
}
|
|
106
|
+
export interface LockedWinner {
|
|
107
|
+
type: WinnerType;
|
|
108
|
+
blockInfo: BlockInfo;
|
|
109
|
+
}
|
|
110
|
+
export interface WonByIdentityWinner {
|
|
111
|
+
type: WinnerType;
|
|
112
|
+
identityId: Uint8Array;
|
|
113
|
+
blockInfo: BlockInfo;
|
|
114
|
+
}
|
|
115
|
+
export interface BlockInfo {
|
|
116
|
+
height: bigint;
|
|
117
|
+
coreHeight: number;
|
|
118
|
+
timeMs: bigint;
|
|
119
|
+
epoch?: number;
|
|
120
|
+
}
|
|
121
|
+
export interface ContenderWithSerializedDocument {
|
|
122
|
+
identityId: IdentifierWASM;
|
|
123
|
+
serializedDocument?: Uint8Array;
|
|
124
|
+
voteTally?: number;
|
|
125
|
+
}
|
|
126
|
+
export interface ContestedDocumentVotePollQueryExecutionResult {
|
|
127
|
+
contenders: ContenderWithSerializedDocument[];
|
|
128
|
+
lockedVoteTally?: number;
|
|
129
|
+
abstainingVoteTally?: number;
|
|
130
|
+
winner?: Winner;
|
|
131
|
+
skipped: number;
|
|
132
|
+
}
|
|
133
|
+
export interface VerifiedVoteState {
|
|
134
|
+
rootHash: Uint8Array;
|
|
135
|
+
result: ContestedDocumentVotePollQueryExecutionResult;
|
|
136
|
+
}
|
|
137
|
+
export interface VerifiedContract {
|
|
138
|
+
rootHash: Uint8Array;
|
|
139
|
+
dataContract?: DataContractWASM;
|
|
140
|
+
}
|
|
141
|
+
export interface IdentityTokenInfo {
|
|
142
|
+
frozen: boolean;
|
|
143
|
+
}
|
|
144
|
+
export interface TokenStatus {
|
|
145
|
+
paused: boolean;
|
|
146
|
+
}
|
|
147
|
+
export interface VerifiedIdentityBalance {
|
|
148
|
+
balance: bigint;
|
|
149
|
+
id: IdentifierWASM;
|
|
150
|
+
}
|
|
151
|
+
export interface VerifiedIdentityTokenInfo {
|
|
152
|
+
id: IdentifierWASM;
|
|
153
|
+
identityTokenInfo: IdentityTokenInfo;
|
|
154
|
+
}
|
|
155
|
+
export interface VerifiedTokenPricingSchedule {
|
|
156
|
+
id: IdentifierWASM;
|
|
157
|
+
pricingSchedule?: TokenPricingScheduleWASM;
|
|
158
|
+
}
|
|
159
|
+
export interface VerifiedBalanceTransfer {
|
|
160
|
+
sender: PartialIdentityWASM;
|
|
161
|
+
recipient: PartialIdentityWASM;
|
|
162
|
+
}
|
|
163
|
+
export interface VerifiedDocument {
|
|
164
|
+
id: IdentifierWASM;
|
|
165
|
+
document?: DocumentWASM;
|
|
166
|
+
}
|
|
167
|
+
export interface VerifiedTokenGroupActionWithDocument {
|
|
168
|
+
groupSumPower: number;
|
|
169
|
+
document?: DocumentWASM;
|
|
170
|
+
}
|
|
171
|
+
export interface VerifiedTokenGroupActionWithTokenBalance {
|
|
172
|
+
groupSumPower: number;
|
|
173
|
+
groupActionStatus: string;
|
|
174
|
+
amount?: bigint;
|
|
175
|
+
}
|
|
176
|
+
export interface VerifiedTokenGroupActionWithTokenIdentityInfo {
|
|
177
|
+
groupSumPower: number;
|
|
178
|
+
groupActionStatus: string;
|
|
179
|
+
identityTokenInfo?: IdentityTokenInfo;
|
|
180
|
+
}
|
|
181
|
+
export interface VerifiedTokenGroupActionWithTokenPricingSchedule {
|
|
182
|
+
groupSumPower: number;
|
|
183
|
+
groupActionStatus: string;
|
|
184
|
+
pricingSchedule?: TokenPricingScheduleWASM;
|
|
185
|
+
}
|
|
186
|
+
export interface VerifiedAddressInfo {
|
|
187
|
+
nonce?: number;
|
|
188
|
+
address: PlatformAddressWASM;
|
|
189
|
+
credits?: bigint;
|
|
190
|
+
}
|
|
191
|
+
export interface VerifiedIdentityFullWithAddressInfos {
|
|
192
|
+
identity: IdentityWASM;
|
|
193
|
+
infos: VerifiedAddressInfo[];
|
|
194
|
+
}
|
|
195
|
+
export interface VerifiedIdentityWithAddressInfos {
|
|
196
|
+
identity: PartialIdentityWASM;
|
|
197
|
+
infos: VerifiedAddressInfo[];
|
|
198
|
+
}
|
|
199
|
+
export type VerifiedStateTransitionResultVariants = DataContractWASM | IdentityWASM | IdentifierWASM | VerifiedIdentityBalance | VerifiedIdentityTokenInfo | VerifiedTokenPricingSchedule | TokenStatus | VerifiedIdentityBalance[] | PartialIdentityWASM | VerifiedBalanceTransfer | VerifiedDocument[] | DocumentWASM | VerifiedTokenGroupActionWithDocument | VerifiedTokenGroupActionWithTokenBalance | VerifiedTokenGroupActionWithTokenIdentityInfo | VerifiedTokenGroupActionWithTokenPricingSchedule | VoteWASM | VerifiedAddressInfo[] | VerifiedIdentityFullWithAddressInfos | VerifiedIdentityWithAddressInfos;
|
|
200
|
+
export type VerifiedStateTransitionResultVariantsRAW = DataContractNAPI | IdentityNAPI | IdentifierNAPI | VerifiedIdentityBalanceNAPI | VerifiedIdentityTokenInfoNAPI | VerifiedTokenPricingScheduleNAPI | TokenStatusNAPI | VerifiedIdentityBalanceNAPI[] | PartialIdentityNAPI | VerifiedBalanceTransferNAPI | VerifiedDocumentNAPI[] | DocumentNAPI | VerifiedTokenGroupActionWithDocumentNAPI | VerifiedTokenGroupActionWithTokenBalanceNAPI | VerifiedTokenGroupActionWithTokenIdentityInfoNAPI | VerifiedTokenGroupActionWithTokenPricingScheduleNAPI | VoteNAPI | VerifiedAddressInfosNAPI[] | VerifiedIdentityFullWithAddressInfosNAPI | VerifiedIdentityWithAddressInfosNAPI;
|
|
201
|
+
export interface VerifiedStateTransitionResult {
|
|
202
|
+
rootHash: Uint8Array;
|
|
203
|
+
result: VerifiedStateTransitionResultVariants;
|
|
204
|
+
}
|
|
205
|
+
export type WhereOperator = '=' | '==' | '>' | '>=' | '<' | '<=' | 'Between' | 'between' | 'BetweenExcludeBounds' | 'betweenExcludeBounds' | 'betweenexcludebounds' | 'between_exclude_bounds' | 'BetweenExcludeLeft' | 'betweenExcludeLeft' | 'betweenexcludeleft' | 'between_exclude_left' | 'BetweenExcludeRight' | 'betweenExcludeRight' | 'betweenexcluderight' | 'between_exclude_right' | 'In' | 'in' | 'StartsWith' | 'startsWith' | 'startswith' | 'starts_with';
|
|
206
|
+
export type WhereClause = [
|
|
207
|
+
field: string,
|
|
208
|
+
operator: WhereOperator,
|
|
209
|
+
value: unknown
|
|
210
|
+
];
|
|
211
|
+
export interface VerifiedDocuments {
|
|
212
|
+
rootHash: Uint8Array;
|
|
213
|
+
documents: DocumentWASM[];
|
|
214
|
+
}
|
|
215
|
+
export interface VerifiedIdentifierByNonUniquePublicKeyHash {
|
|
216
|
+
rootHash: Uint8Array;
|
|
217
|
+
identifier?: IdentifierWASM;
|
|
218
|
+
}
|
|
219
|
+
export interface VerifiedIdentityBalanceRootHash {
|
|
220
|
+
rootHash: Uint8Array;
|
|
221
|
+
balance?: bigint;
|
|
222
|
+
}
|
|
223
|
+
export interface VerifiedIdentityByIdentifier {
|
|
224
|
+
rootHash: Uint8Array;
|
|
225
|
+
identity?: IdentityWASM;
|
|
226
|
+
}
|
|
227
|
+
export interface VerifiedIdentityByUniqueKeyHash {
|
|
228
|
+
rootHash: Uint8Array;
|
|
229
|
+
identity?: IdentityWASM;
|
|
230
|
+
}
|
|
231
|
+
export interface VerifiedIdentityContractNonce {
|
|
232
|
+
rootHash: Uint8Array;
|
|
233
|
+
contractNonce?: bigint;
|
|
234
|
+
}
|
|
235
|
+
export interface VerifiedIdentityKeysByIdentifier {
|
|
236
|
+
rootHash: Uint8Array;
|
|
237
|
+
identity?: PartialIdentityWASM;
|
|
238
|
+
}
|
|
239
|
+
export interface VerifiedIdentityNonce {
|
|
240
|
+
rootHash: Uint8Array;
|
|
241
|
+
nonce?: bigint;
|
|
242
|
+
}
|
|
243
|
+
export interface IdentityTokenBalance {
|
|
244
|
+
balance: bigint;
|
|
245
|
+
id: IdentifierWASM;
|
|
246
|
+
}
|
|
247
|
+
export interface VerifiedTokenBalancesForIdentities {
|
|
248
|
+
rootHash: Uint8Array;
|
|
249
|
+
balances: IdentityTokenBalance[];
|
|
250
|
+
}
|
|
251
|
+
export interface TokenContractInfo {
|
|
252
|
+
contractId: IdentifierWASM;
|
|
253
|
+
tokenContractPosition: number;
|
|
254
|
+
}
|
|
255
|
+
export interface VerifiedTokenContractInfo {
|
|
256
|
+
rootHash: Uint8Array;
|
|
257
|
+
contractInfo?: TokenContractInfo;
|
|
258
|
+
}
|
|
259
|
+
export interface VerifiedTokenDirectPurchasePrices {
|
|
260
|
+
rootHash: Uint8Array;
|
|
261
|
+
prices: VerifiedTokenPricingSchedule[];
|
|
262
|
+
}
|
|
263
|
+
export interface TotalSingleTokenBalance {
|
|
264
|
+
tokenSupply: bigint;
|
|
265
|
+
aggregatedTokenAccountBalances: bigint;
|
|
266
|
+
}
|
|
267
|
+
export interface VerifiedTokenTotalSupply {
|
|
268
|
+
rootHash: Uint8Array;
|
|
269
|
+
totalBalance: TotalSingleTokenBalance;
|
|
270
|
+
}
|
|
271
|
+
export interface VerifiedTokensBalancesForIdentity {
|
|
272
|
+
rootHash: Uint8Array;
|
|
273
|
+
balances: IdentityTokenBalance[];
|
|
274
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DynamicValue, IdentifierLikeNAPI } from '../../binaries/bindingsTypes.js';
|
|
2
|
+
import { IdentifierLike } from './types.js';
|
|
3
|
+
export declare function valueToDynamicValue(value: any): DynamicValue;
|
|
4
|
+
export declare function valueFromDynamicValue(dynamicValue: DynamicValue): any;
|
|
5
|
+
export declare function prepareIdentifierValue(identifier: IdentifierLike): IdentifierLikeNAPI;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { dppProvider } from './provider.js';
|
|
2
|
+
import { UINT32MAX } from './constants.js';
|
|
3
|
+
import { IdentifierWASM } from './structs/Identifier.js';
|
|
4
|
+
export function valueToDynamicValue(value) {
|
|
5
|
+
if (typeof value === 'bigint' || value > UINT32MAX) {
|
|
6
|
+
return dppProvider.dpp.DynamicValue.fromBigIntString(BigInt(value.toString()).toString());
|
|
7
|
+
}
|
|
8
|
+
else if (value instanceof IdentifierWASM || value instanceof dppProvider.dpp.IdentifierNAPI) {
|
|
9
|
+
return new dppProvider.dpp.DynamicValue(value.bytes());
|
|
10
|
+
}
|
|
11
|
+
else if (value instanceof Uint8Array) {
|
|
12
|
+
return new dppProvider.dpp.DynamicValue(value);
|
|
13
|
+
}
|
|
14
|
+
else if (Array.isArray(value)) {
|
|
15
|
+
return new dppProvider.dpp.DynamicValue(value.map(valueToDynamicValue));
|
|
16
|
+
}
|
|
17
|
+
else if (typeof value === 'object' && value !== null) {
|
|
18
|
+
const keys = Object.keys(value);
|
|
19
|
+
const objectWithDynamicValue = Object.assign({}, value);
|
|
20
|
+
for (const key of keys) {
|
|
21
|
+
objectWithDynamicValue[key] = valueToDynamicValue(value[key]);
|
|
22
|
+
}
|
|
23
|
+
return new dppProvider.dpp.DynamicValue(objectWithDynamicValue);
|
|
24
|
+
}
|
|
25
|
+
else if (typeof value === 'function') {
|
|
26
|
+
throw new Error('Cannot parse value from function');
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return new dppProvider.dpp.DynamicValue(value);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
export function valueFromDynamicValue(dynamicValue) {
|
|
33
|
+
if (dynamicValue.value instanceof dppProvider.dpp.DynamicValue) {
|
|
34
|
+
return valueToDynamicValue(dynamicValue.value);
|
|
35
|
+
}
|
|
36
|
+
else if (dynamicValue.isBigInt()) {
|
|
37
|
+
return BigInt(dynamicValue.value);
|
|
38
|
+
}
|
|
39
|
+
else if (Array.isArray(dynamicValue.value)) {
|
|
40
|
+
return dynamicValue.value.map(valueFromDynamicValue);
|
|
41
|
+
}
|
|
42
|
+
else if (typeof dynamicValue.value === 'object' && !(dynamicValue.value instanceof Uint8Array) && dynamicValue.value !== null) {
|
|
43
|
+
const obj = {};
|
|
44
|
+
const keys = Object.keys(dynamicValue.value);
|
|
45
|
+
for (const key of keys) {
|
|
46
|
+
obj[key] = valueFromDynamicValue(dynamicValue.value[key]);
|
|
47
|
+
}
|
|
48
|
+
return obj;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
return dynamicValue.value;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export function prepareIdentifierValue(identifier) {
|
|
55
|
+
if (identifier instanceof IdentifierWASM) {
|
|
56
|
+
return identifier._rawIdentifier;
|
|
57
|
+
}
|
|
58
|
+
else if (identifier instanceof dppProvider.dpp.IdentifierNAPI) {
|
|
59
|
+
return identifier;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
return new dppProvider.dpp.DynamicValue(identifier);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { PlatformVersionLike, StartAt, VerifiedVoteState, VoteStateResultTypeLike } from '../../types.js';
|
|
2
|
+
import { DataContractWASM } from '../../structs/DataContract.js';
|
|
3
|
+
export declare function verifyVotePollVoteStateProof(proof: Uint8Array, contract: DataContractWASM, documentTypeName: string, indexName: string, indexValues: string[], resultType: VoteStateResultTypeLike, allowIncludeLockedAndAbstainingVoteTally: boolean, count: number | undefined, startAt: StartAt | undefined, platformVersion: PlatformVersionLike): VerifiedVoteState;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
import { valueFromDynamicValue, valueToDynamicValue } from '../../utils.js';
|
|
3
|
+
import { IdentifierWASM } from '../../structs/Identifier.js';
|
|
4
|
+
export function verifyVotePollVoteStateProof(proof, contract, documentTypeName, indexName, indexValues, resultType, allowIncludeLockedAndAbstainingVoteTally, count, startAt, platformVersion) {
|
|
5
|
+
const result = dppProvider.dpp.verifyVotePollVoteStateProof(proof, contract._rawDataContract, documentTypeName, indexName, valueToDynamicValue(indexValues), valueToDynamicValue(resultType), allowIncludeLockedAndAbstainingVoteTally, count, valueToDynamicValue(startAt), valueToDynamicValue(platformVersion));
|
|
6
|
+
const winner = valueFromDynamicValue(result.result.winner);
|
|
7
|
+
const winnerBlockInfo = winner?.blockInfo;
|
|
8
|
+
const outWinner = winner != null
|
|
9
|
+
? {
|
|
10
|
+
type: winner.type,
|
|
11
|
+
identityId: winner.identityId,
|
|
12
|
+
blockInfo: {
|
|
13
|
+
height: BigInt(winnerBlockInfo.height),
|
|
14
|
+
coreHeight: winnerBlockInfo.coreHeight,
|
|
15
|
+
timeMs: BigInt(winnerBlockInfo.timeMs),
|
|
16
|
+
epoch: winnerBlockInfo.epoch != null ? winnerBlockInfo?.epoch : undefined
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
: undefined;
|
|
20
|
+
return {
|
|
21
|
+
rootHash: result.rootHash,
|
|
22
|
+
result: {
|
|
23
|
+
lockedVoteTally: result.result.lockedVoteTally ?? undefined,
|
|
24
|
+
contenders: result.result.contenders.map(c => ({
|
|
25
|
+
identityId: IdentifierWASM.createFromRawInstance(c.identityId),
|
|
26
|
+
serializedDocument: c.serializedDocument ?? undefined,
|
|
27
|
+
voteTally: c.voteTally ?? undefined
|
|
28
|
+
})),
|
|
29
|
+
abstainingVoteTally: result.result.abstainingVoteTally ?? undefined,
|
|
30
|
+
winner: outWinner,
|
|
31
|
+
skipped: result.result.skipped
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { IdentifierLike, PlatformVersionLike, VerifiedContract } from '../../types.js';
|
|
2
|
+
export declare function verifyContractProof(proof: Uint8Array, contractKnownKeepsHistory: boolean | undefined, isProofSubset: boolean, inMultipleContractProofForm: boolean, contractId: IdentifierLike, platformVersion: PlatformVersionLike): VerifiedContract;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
import { prepareIdentifierValue, valueToDynamicValue } from '../../utils.js';
|
|
3
|
+
import { DataContractWASM } from '../../structs/DataContract.js';
|
|
4
|
+
export function verifyContractProof(proof, contractKnownKeepsHistory, isProofSubset, inMultipleContractProofForm, contractId, platformVersion) {
|
|
5
|
+
const result = dppProvider.dpp.verifyContractProof(proof, contractKnownKeepsHistory, isProofSubset, inMultipleContractProofForm, prepareIdentifierValue(contractId), valueToDynamicValue(platformVersion));
|
|
6
|
+
let dataContract;
|
|
7
|
+
if (result.dataContract != null) {
|
|
8
|
+
dataContract = DataContractWASM.createFromRawInstance(result.dataContract);
|
|
9
|
+
}
|
|
10
|
+
return {
|
|
11
|
+
rootHash: result.rootHash,
|
|
12
|
+
dataContract
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { IdentifierLike, PlatformVersionLike, VerifiedDocuments, WhereClause } from '../../types.js';
|
|
2
|
+
import { DataContractWASM } from '../../structs/DataContract.js';
|
|
3
|
+
export declare function verifyDocumentsProof(proof: Uint8Array, contract: DataContractWASM, documentTypeName: string, whereClauses: WhereClause[], orderBy: string[][], limit: number | undefined | null, startAt: IdentifierLike | undefined | null, startAtIncluded: boolean, blockTimeMs: bigint | undefined | null, platformVersion: PlatformVersionLike): VerifiedDocuments;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
import { DocumentWASM } from '../../structs/Document.js';
|
|
3
|
+
import { prepareIdentifierValue, valueToDynamicValue } from '../../utils.js';
|
|
4
|
+
export function verifyDocumentsProof(proof, contract, documentTypeName, whereClauses, orderBy, limit, startAt, startAtIncluded, blockTimeMs, platformVersion) {
|
|
5
|
+
const result = dppProvider.dpp.verifyDocumentsProof(proof, contract._rawDataContract, documentTypeName, valueToDynamicValue(whereClauses), orderBy, limit, startAt != null ? prepareIdentifierValue(startAt) : undefined, startAtIncluded, blockTimeMs?.toString(), valueToDynamicValue(platformVersion));
|
|
6
|
+
return {
|
|
7
|
+
rootHash: result.rootHash,
|
|
8
|
+
documents: result.documents.map(DocumentWASM.createFromRawInstance)
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { IdentifierLike, PlatformVersionLike, VerifiedIdentifierByNonUniquePublicKeyHash } from '../../types.js';
|
|
2
|
+
export declare function verifyIdentifierByNonUniquePublicKeyHashProof(proof: Uint8Array, proofSubset: boolean, publicKeyHash: Uint8Array, after: IdentifierLike | undefined | null, platformVersion: PlatformVersionLike): VerifiedIdentifierByNonUniquePublicKeyHash;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
import { prepareIdentifierValue, valueToDynamicValue } from '../../utils.js';
|
|
3
|
+
import { IdentifierWASM } from '../../structs/Identifier.js';
|
|
4
|
+
export function verifyIdentifierByNonUniquePublicKeyHashProof(proof, proofSubset, publicKeyHash, after, platformVersion) {
|
|
5
|
+
const result = dppProvider.dpp.verifyIdentifierByNonUniquePublicKeyHashProof(proof, proofSubset, publicKeyHash, after != null ? prepareIdentifierValue(after) : undefined, valueToDynamicValue(platformVersion));
|
|
6
|
+
return {
|
|
7
|
+
rootHash: result.rootHash,
|
|
8
|
+
identifier: result.identifier != null ? IdentifierWASM.createFromRawInstance(result.identifier) : undefined
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { IdentifierLike, PlatformVersionLike, VerifiedIdentityBalanceRootHash } from '../../types.js';
|
|
2
|
+
export declare function verifyIdentityBalanceProof(proof: Uint8Array, identityId: IdentifierLike, verifySubsetOfProof: boolean, platformVersion: PlatformVersionLike): VerifiedIdentityBalanceRootHash;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
import { prepareIdentifierValue, valueToDynamicValue } from '../../utils.js';
|
|
3
|
+
export function verifyIdentityBalanceProof(proof, identityId, verifySubsetOfProof, platformVersion) {
|
|
4
|
+
const result = dppProvider.dpp.verifyIdentityBalanceProof(proof, prepareIdentifierValue(identityId), verifySubsetOfProof, valueToDynamicValue(platformVersion));
|
|
5
|
+
return {
|
|
6
|
+
rootHash: result.rootHash,
|
|
7
|
+
balance: result.balance != null ? BigInt(result.balance) : undefined
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { IdentifierLike, PlatformVersionLike, VerifiedIdentityByIdentifier } from '../../types.js';
|
|
2
|
+
export declare function verifyIdentityByIdentifierProof(proof: Uint8Array, identityId: IdentifierLike, isProofSubset: boolean, platformVersion: PlatformVersionLike): VerifiedIdentityByIdentifier;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
import { prepareIdentifierValue, valueToDynamicValue } from '../../utils.js';
|
|
3
|
+
import { IdentityWASM } from '../../structs/Identity.js';
|
|
4
|
+
export function verifyIdentityByIdentifierProof(proof, identityId, isProofSubset, platformVersion) {
|
|
5
|
+
const result = dppProvider.dpp.verifyIdentityByIdentifierProof(proof, prepareIdentifierValue(identityId), isProofSubset, valueToDynamicValue(platformVersion));
|
|
6
|
+
return {
|
|
7
|
+
rootHash: result.rootHash,
|
|
8
|
+
identity: result.identity != null ? IdentityWASM.createFromRawInstance(result.identity) : undefined
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
import { valueToDynamicValue } from '../../utils.js';
|
|
3
|
+
import { IdentityWASM } from '../../structs/Identity.js';
|
|
4
|
+
export function verifyIdentityByUniqueKeyHashProof(proof, publicKeyHash, platformVersion) {
|
|
5
|
+
const result = dppProvider.dpp.verifyIdentityByUniqueKeyHashProof(proof, publicKeyHash, valueToDynamicValue(platformVersion));
|
|
6
|
+
return {
|
|
7
|
+
rootHash: result.rootHash,
|
|
8
|
+
identity: result.identity != null ? IdentityWASM.createFromRawInstance(result.identity) : undefined
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { IdentifierLike, PlatformVersionLike, VerifiedIdentityContractNonce } from '../../types.js';
|
|
2
|
+
export declare function verifyIdentityContractNonceProof(proof: Uint8Array, identityId: IdentifierLike, contractId: IdentifierLike, verifySubsetOfProof: boolean, platformVersion: PlatformVersionLike): VerifiedIdentityContractNonce;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
import { prepareIdentifierValue, valueToDynamicValue } from '../../utils.js';
|
|
3
|
+
export function verifyIdentityContractNonceProof(proof, identityId, contractId, verifySubsetOfProof, platformVersion) {
|
|
4
|
+
const result = dppProvider.dpp.verifyIdentityContractNonceProof(proof, prepareIdentifierValue(identityId), prepareIdentifierValue(contractId), verifySubsetOfProof, valueToDynamicValue(platformVersion));
|
|
5
|
+
return {
|
|
6
|
+
rootHash: result.rootHash,
|
|
7
|
+
contractNonce: result.contractNonce != null ? BigInt(result.contractNonce) : undefined
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { IdentifierLike, PlatformVersionLike, VerifiedIdentityKeysByIdentifier } from '../../types.js';
|
|
2
|
+
export declare function verifyIdentityKeysByIdentifierProof(proof: Uint8Array, identityId: IdentifierLike, specificKeyIds: number[] | undefined | null, withRevision: boolean, withBalance: boolean, isProofSubset: boolean, limit: number | undefined | null, offset: number | undefined | null, platformVersion: PlatformVersionLike): VerifiedIdentityKeysByIdentifier;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
import { prepareIdentifierValue, valueToDynamicValue } from '../../utils.js';
|
|
3
|
+
import { PartialIdentityWASM } from '../../structs/PartialIdentity.js';
|
|
4
|
+
export function verifyIdentityKeysByIdentifierProof(proof, identityId, specificKeyIds, withRevision, withBalance, isProofSubset, limit, offset, platformVersion) {
|
|
5
|
+
const result = dppProvider.dpp.verifyIdentityKeysByIdentifierProof(proof, prepareIdentifierValue(identityId), specificKeyIds, withRevision, withBalance, isProofSubset, limit, offset, valueToDynamicValue(platformVersion));
|
|
6
|
+
return {
|
|
7
|
+
rootHash: result.rootHash,
|
|
8
|
+
identity: result.identity != null ? PartialIdentityWASM.createFromRawInstance(result.identity) : undefined
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { IdentifierLike, PlatformVersionLike, VerifiedIdentityNonce } from '../../types.js';
|
|
2
|
+
export declare function verifyIdentityNonceProof(proof: Uint8Array, identityId: IdentifierLike, verifySubsetOfProof: boolean, platformVersion: PlatformVersionLike): VerifiedIdentityNonce;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
import { prepareIdentifierValue, valueToDynamicValue } from '../../utils.js';
|
|
3
|
+
export function verifyIdentityNonceProof(proof, identityId, verifySubsetOfProof, platformVersion) {
|
|
4
|
+
const result = dppProvider.dpp.verifyIdentityNonceProof(proof, prepareIdentifierValue(identityId), verifySubsetOfProof, valueToDynamicValue(platformVersion));
|
|
5
|
+
return {
|
|
6
|
+
rootHash: result.rootHash,
|
|
7
|
+
nonce: result.nonce != null ? BigInt(result.nonce) : undefined
|
|
8
|
+
};
|
|
9
|
+
}
|