pshenmic-dpp 1.1.2-dev.8 → 2.0.0-dev.10
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 +1721 -0
- package/dist/binaries/bindingsTypes.js +99 -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 +171 -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 +171 -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 +112 -0
- package/dist/src/dpp/dpp.js +112 -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/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 +15 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/InputAddress.js +33 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddress.d.ts +13 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddress.js +27 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddressNullableCredits.d.ts +13 -0
- package/dist/src/dpp/structs/AddressTransitions/entities/OutputAddressNullableCredits.js +30 -0
- package/dist/src/dpp/structs/AssetLockProof/AssetLockProof.d.ts +19 -0
- package/dist/src/dpp/structs/AssetLockProof/AssetLockProof.js +50 -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 +14 -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 +33 -0
- package/dist/src/dpp/structs/Batch/DocumentTransition.js +77 -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 +21 -0
- package/dist/src/dpp/structs/Batch/TokenTransition.js +95 -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 +24 -0
- package/dist/src/dpp/structs/Batch/TokenTransitions/TokenTransferTransition.js +60 -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 +38 -0
- package/dist/src/dpp/structs/DataContract.js +125 -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 +44 -0
- package/dist/src/dpp/structs/IdentityPublicKey.js +131 -0
- package/dist/src/dpp/structs/IdentityPublicKeyInCreation.d.ts +31 -0
- package/dist/src/dpp/structs/IdentityPublicKeyInCreation.js +82 -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/PlatformAddress/AddressWitness.d.ts +12 -0
- package/dist/src/dpp/structs/PlatformAddress/AddressWitness.js +23 -0
- package/dist/src/dpp/structs/PlatformAddress/PlatformAddress.d.ts +16 -0
- package/dist/src/dpp/structs/PlatformAddress/PlatformAddress.js +38 -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 +39 -0
- package/dist/src/dpp/structs/StateTransition.js +103 -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 +284 -0
- package/dist/src/dpp/types.js +1 -0
- package/dist/src/dpp/utils.d.ts +6 -0
- package/dist/src/dpp/utils.js +96 -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/PlatformAddress/verifyPlatformAddressInfo.d.ts +2 -0
- package/dist/src/dpp/verify/PlatformAddress/verifyPlatformAddressInfo.js +12 -0
- package/dist/src/dpp/verify/PlatformAddress/verifyPlatformAddressesInfos.d.ts +2 -0
- package/dist/src/dpp/verify/PlatformAddress/verifyPlatformAddressesInfos.js +14 -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 +126 -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,23 @@
|
|
|
1
|
+
import type { ChangeControlRulesNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { AuthorizedActionTakersWASM } from './AuthorizedActionTakers.js';
|
|
3
|
+
import { ActionGoalLike, IdentifierLike } from '../../types.js';
|
|
4
|
+
import { GroupWASM } from './Group.js';
|
|
5
|
+
import { ActionTakerWASM } from './ActionTaker.js';
|
|
6
|
+
export declare class ChangeControlRulesWASM {
|
|
7
|
+
_rawChangeControlRules: ChangeControlRulesNAPI;
|
|
8
|
+
constructor(authorizedToMakeChanges: AuthorizedActionTakersWASM, adminActionTakers: AuthorizedActionTakersWASM, changingAuthorizedActionTakersToNoOneAllowed: boolean, changingAdminActionTakersToNoOneAllowed: boolean, selfChangingAdminActionTakersAllowed: boolean);
|
|
9
|
+
get authorizedToMakeChange(): AuthorizedActionTakersWASM;
|
|
10
|
+
set authorizedToMakeChange(value: AuthorizedActionTakersWASM);
|
|
11
|
+
get adminActionTakers(): AuthorizedActionTakersWASM;
|
|
12
|
+
set adminActionTakers(value: AuthorizedActionTakersWASM);
|
|
13
|
+
get changingAuthorizedActionTakersToNoOneAllowed(): boolean;
|
|
14
|
+
set changingAuthorizedActionTakersToNoOneAllowed(value: boolean);
|
|
15
|
+
get changingAdminActionTakersToNoOneAllowed(): boolean;
|
|
16
|
+
set changingAdminActionTakersToNoOneAllowed(value: boolean);
|
|
17
|
+
get selfChangingAdminActionTakersAllowed(): boolean;
|
|
18
|
+
set selfChangingAdminActionTakersAllowed(value: boolean);
|
|
19
|
+
canChangeAdminActionTakers(adminActionTakers: AuthorizedActionTakersWASM, contractOwnerId: IdentifierLike, groups: {
|
|
20
|
+
[key: number]: GroupWASM;
|
|
21
|
+
}, actionTaker: ActionTakerWASM, goal: ActionGoalLike, mainGroup?: number): boolean;
|
|
22
|
+
static createFromRawInstance(rawInstance: ChangeControlRulesNAPI): ChangeControlRulesWASM;
|
|
23
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
import { AuthorizedActionTakersWASM } from './AuthorizedActionTakers.js';
|
|
3
|
+
import { prepareIdentifierValue, valueToDynamicValue } from '../../utils.js';
|
|
4
|
+
export class ChangeControlRulesWASM {
|
|
5
|
+
_rawChangeControlRules;
|
|
6
|
+
constructor(authorizedToMakeChanges, adminActionTakers, changingAuthorizedActionTakersToNoOneAllowed, changingAdminActionTakersToNoOneAllowed, selfChangingAdminActionTakersAllowed) {
|
|
7
|
+
this._rawChangeControlRules = new dppProvider.dpp.ChangeControlRulesNAPI(authorizedToMakeChanges._rawAuthorizedActionTakers, adminActionTakers._rawAuthorizedActionTakers, changingAuthorizedActionTakersToNoOneAllowed, changingAdminActionTakersToNoOneAllowed, selfChangingAdminActionTakersAllowed);
|
|
8
|
+
}
|
|
9
|
+
get authorizedToMakeChange() {
|
|
10
|
+
return AuthorizedActionTakersWASM.createFromRawInstance(this._rawChangeControlRules.authorizedToMakeChange);
|
|
11
|
+
}
|
|
12
|
+
set authorizedToMakeChange(value) {
|
|
13
|
+
this._rawChangeControlRules.authorizedToMakeChange = value._rawAuthorizedActionTakers;
|
|
14
|
+
}
|
|
15
|
+
get adminActionTakers() {
|
|
16
|
+
return AuthorizedActionTakersWASM.createFromRawInstance(this._rawChangeControlRules.adminActionTakers);
|
|
17
|
+
}
|
|
18
|
+
set adminActionTakers(value) {
|
|
19
|
+
this._rawChangeControlRules.adminActionTakers = value._rawAuthorizedActionTakers;
|
|
20
|
+
}
|
|
21
|
+
get changingAuthorizedActionTakersToNoOneAllowed() {
|
|
22
|
+
return this._rawChangeControlRules.changingAuthorizedActionTakersToNoOneAllowed;
|
|
23
|
+
}
|
|
24
|
+
set changingAuthorizedActionTakersToNoOneAllowed(value) {
|
|
25
|
+
this._rawChangeControlRules.changingAuthorizedActionTakersToNoOneAllowed = value;
|
|
26
|
+
}
|
|
27
|
+
get changingAdminActionTakersToNoOneAllowed() {
|
|
28
|
+
return this._rawChangeControlRules.changingAdminActionTakersToNoOneAllowed;
|
|
29
|
+
}
|
|
30
|
+
set changingAdminActionTakersToNoOneAllowed(value) {
|
|
31
|
+
this._rawChangeControlRules.changingAdminActionTakersToNoOneAllowed = value;
|
|
32
|
+
}
|
|
33
|
+
get selfChangingAdminActionTakersAllowed() {
|
|
34
|
+
return this._rawChangeControlRules.selfChangingAdminActionTakersAllowed;
|
|
35
|
+
}
|
|
36
|
+
set selfChangingAdminActionTakersAllowed(value) {
|
|
37
|
+
this._rawChangeControlRules.selfChangingAdminActionTakersAllowed = value;
|
|
38
|
+
}
|
|
39
|
+
canChangeAdminActionTakers(adminActionTakers, contractOwnerId, groups, actionTaker, goal, mainGroup) {
|
|
40
|
+
const keys = Object.keys(groups);
|
|
41
|
+
const normalGroups = [];
|
|
42
|
+
for (const key of keys) {
|
|
43
|
+
normalGroups.push([Number(key), groups[Number(key)]._rawGroup]);
|
|
44
|
+
}
|
|
45
|
+
return this._rawChangeControlRules.canChangeAdminActionTakers(adminActionTakers._rawAuthorizedActionTakers, prepareIdentifierValue(contractOwnerId), mainGroup, normalGroups, actionTaker._rawActionTaker, valueToDynamicValue(goal));
|
|
46
|
+
}
|
|
47
|
+
static createFromRawInstance(rawInstance) {
|
|
48
|
+
const instance = Object.create(ChangeControlRulesWASM.prototype);
|
|
49
|
+
instance._rawChangeControlRules = rawInstance;
|
|
50
|
+
return instance;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DistributionFunctionNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { DistributionExponential, DistributionFixedAmount, DistributionInvertedLogarithmic, DistributionLinear, DistributionLogarithmic, DistributionPolynomial, DistributionRandom, DistributionStepDecreasingAmount, DistributionStepwise } from '../../types.js';
|
|
3
|
+
export declare class DistributionFunctionWASM {
|
|
4
|
+
/** @private **/
|
|
5
|
+
_rawDistributionFunction: DistributionFunctionNAPI;
|
|
6
|
+
private constructor();
|
|
7
|
+
static FixedAmountDistribution(amount: bigint): DistributionFunctionWASM;
|
|
8
|
+
getFunctionName(): string;
|
|
9
|
+
getFunctionValue(): DistributionFixedAmount | DistributionRandom | DistributionStepDecreasingAmount | DistributionLinear | DistributionPolynomial | DistributionExponential | DistributionLogarithmic | DistributionInvertedLogarithmic | DistributionStepwise;
|
|
10
|
+
static Random(min: bigint, max: bigint): DistributionFunctionWASM;
|
|
11
|
+
static StepDecreasingAmount(stepCount: number, decreasePerIntervalNumerator: number, decreasePerIntervalDenominator: number, distributionStartAmount: bigint, trailingDistributionIntervalAmount: bigint, startDecreasingOffset?: bigint, maxIntervalCount?: number, minValue?: bigint): DistributionFunctionWASM;
|
|
12
|
+
static Stepwise(steps: DistributionStepwise): DistributionFunctionWASM;
|
|
13
|
+
static Linear(a: number, d: bigint, startingAmount: bigint, startStep?: bigint, minValue?: bigint, maxValue?: bigint): DistributionFunctionWASM;
|
|
14
|
+
static Polynomial(a: number, d: bigint, m: number, n: bigint, o: number, b: bigint, startMoment?: bigint, minValue?: bigint, maxValue?: bigint): DistributionFunctionWASM;
|
|
15
|
+
static Exponential(a: bigint, d: bigint, m: number, n: bigint, o: number, b: bigint, startMoment?: bigint, minValue?: bigint, maxValue?: bigint): DistributionFunctionWASM;
|
|
16
|
+
static Logarithmic(a: number, d: bigint, m: bigint, n: bigint, o: number, b: bigint, startMoment?: bigint, minValue?: bigint, maxValue?: bigint): DistributionFunctionWASM;
|
|
17
|
+
static InvertedLogarithmic(a: number, d: bigint, m: bigint, n: bigint, o: number, b: bigint, startMoment?: bigint, minValue?: bigint, maxValue?: bigint): DistributionFunctionWASM;
|
|
18
|
+
static createFromRawInstance(rawInstance: DistributionFunctionNAPI): DistributionFunctionWASM;
|
|
19
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
export class DistributionFunctionWASM {
|
|
3
|
+
/** @private **/
|
|
4
|
+
_rawDistributionFunction;
|
|
5
|
+
constructor(rawInstance) {
|
|
6
|
+
this._rawDistributionFunction = rawInstance;
|
|
7
|
+
}
|
|
8
|
+
static FixedAmountDistribution(amount) {
|
|
9
|
+
return new DistributionFunctionWASM(dppProvider.dpp.DistributionFunctionNAPI.FixedAmountDistribution(amount.toString()));
|
|
10
|
+
}
|
|
11
|
+
getFunctionName() {
|
|
12
|
+
return this._rawDistributionFunction.getFunctionName();
|
|
13
|
+
}
|
|
14
|
+
getFunctionValue() {
|
|
15
|
+
const value = this._rawDistributionFunction.getFunctionValue();
|
|
16
|
+
if (Array.isArray(value)) {
|
|
17
|
+
// StepWise
|
|
18
|
+
return value.map(step => ({
|
|
19
|
+
step: BigInt(step.step),
|
|
20
|
+
amount: BigInt(step.amount)
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
static Random(min, max) {
|
|
28
|
+
return new DistributionFunctionWASM(dppProvider.dpp.DistributionFunctionNAPI.Random(min.toString(), max.toString()));
|
|
29
|
+
}
|
|
30
|
+
static StepDecreasingAmount(stepCount, decreasePerIntervalNumerator, decreasePerIntervalDenominator, distributionStartAmount, trailingDistributionIntervalAmount, startDecreasingOffset, maxIntervalCount, minValue) {
|
|
31
|
+
return new DistributionFunctionWASM(dppProvider.dpp.DistributionFunctionNAPI.StepDecreasingAmount(stepCount, decreasePerIntervalNumerator, decreasePerIntervalDenominator, startDecreasingOffset?.toString(), maxIntervalCount, distributionStartAmount?.toString(), trailingDistributionIntervalAmount?.toString(), minValue?.toString()));
|
|
32
|
+
}
|
|
33
|
+
static Stepwise(steps) {
|
|
34
|
+
return new DistributionFunctionWASM(dppProvider.dpp.DistributionFunctionNAPI.Stepwise(steps.map((step) => ({
|
|
35
|
+
step: step.step.toString(),
|
|
36
|
+
amount: step.amount.toString()
|
|
37
|
+
}))));
|
|
38
|
+
}
|
|
39
|
+
static Linear(a, d, startingAmount, startStep, minValue, maxValue) {
|
|
40
|
+
return new DistributionFunctionWASM(dppProvider.dpp.DistributionFunctionNAPI.Linear(a, d.toString(), startStep?.toString(), startingAmount.toString(), minValue?.toString(), maxValue?.toString()));
|
|
41
|
+
}
|
|
42
|
+
static Polynomial(a, d, m, n, o, b, startMoment, minValue, maxValue) {
|
|
43
|
+
return new DistributionFunctionWASM(dppProvider.dpp.DistributionFunctionNAPI.Polynomial(a, d.toString(), m, n.toString(), o, startMoment?.toString(), b.toString(), minValue?.toString(), maxValue?.toString()));
|
|
44
|
+
}
|
|
45
|
+
static Exponential(a, d, m, n, o, b, startMoment, minValue, maxValue) {
|
|
46
|
+
return new DistributionFunctionWASM(dppProvider.dpp.DistributionFunctionNAPI.Exponential(a.toString(), d.toString(), m, n.toString(), o, startMoment?.toString(), b.toString(), minValue?.toString(), maxValue?.toString()));
|
|
47
|
+
}
|
|
48
|
+
static Logarithmic(a, d, m, n, o, b, startMoment, minValue, maxValue) {
|
|
49
|
+
return new DistributionFunctionWASM(dppProvider.dpp.DistributionFunctionNAPI.Logarithmic(a, d.toString(), m.toString(), n.toString(), o, startMoment?.toString(), b.toString(), minValue?.toString(), maxValue?.toString()));
|
|
50
|
+
}
|
|
51
|
+
static InvertedLogarithmic(a, d, m, n, o, b, startMoment, minValue, maxValue) {
|
|
52
|
+
return new DistributionFunctionWASM(dppProvider.dpp.DistributionFunctionNAPI.InvertedLogarithmic(a, d.toString(), m.toString(), n.toString(), o, startMoment?.toString(), b.toString(), minValue?.toString(), maxValue?.toString()));
|
|
53
|
+
}
|
|
54
|
+
static createFromRawInstance(rawInstance) {
|
|
55
|
+
return new DistributionFunctionWASM(rawInstance);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { GroupNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { IdentifierLike } from '../../types.js';
|
|
3
|
+
export declare class GroupWASM {
|
|
4
|
+
/** @private **/
|
|
5
|
+
_rawGroup: GroupNAPI;
|
|
6
|
+
constructor(members: {
|
|
7
|
+
[key: string]: number;
|
|
8
|
+
}, requiredPower: number);
|
|
9
|
+
get members(): {
|
|
10
|
+
[key: string]: number;
|
|
11
|
+
};
|
|
12
|
+
set members(members: {
|
|
13
|
+
[key: string]: number;
|
|
14
|
+
});
|
|
15
|
+
get requiredPower(): number;
|
|
16
|
+
set requiredPower(value: number);
|
|
17
|
+
setMemberRequiredPower(member: IdentifierLike, power: number): void;
|
|
18
|
+
static createFromRawInstance(rawInstance: GroupNAPI): GroupWASM;
|
|
19
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { dppProvider } from '../../provider.js';
|
|
2
|
+
import { prepareIdentifierValue, valueToDynamicValue } from '../../utils.js';
|
|
3
|
+
export class GroupWASM {
|
|
4
|
+
/** @private **/
|
|
5
|
+
_rawGroup;
|
|
6
|
+
constructor(members, requiredPower) {
|
|
7
|
+
const keys = Object.keys(members);
|
|
8
|
+
const normalMembers = [];
|
|
9
|
+
for (const key of keys) {
|
|
10
|
+
normalMembers.push([valueToDynamicValue(key), members[key]]);
|
|
11
|
+
}
|
|
12
|
+
this._rawGroup = new dppProvider.dpp.GroupNAPI(normalMembers, requiredPower);
|
|
13
|
+
}
|
|
14
|
+
get members() {
|
|
15
|
+
const rawMembers = this._rawGroup.members;
|
|
16
|
+
const out = {};
|
|
17
|
+
for (const [id, power] of rawMembers) {
|
|
18
|
+
out[id.base58()] = power;
|
|
19
|
+
}
|
|
20
|
+
return out;
|
|
21
|
+
}
|
|
22
|
+
set members(members) {
|
|
23
|
+
const keys = Object.keys(members);
|
|
24
|
+
const normalMembers = [];
|
|
25
|
+
for (const key of keys) {
|
|
26
|
+
normalMembers.push([valueToDynamicValue(key), members[key]]);
|
|
27
|
+
}
|
|
28
|
+
this._rawGroup.members = normalMembers;
|
|
29
|
+
}
|
|
30
|
+
get requiredPower() {
|
|
31
|
+
return this._rawGroup.requiredPower;
|
|
32
|
+
}
|
|
33
|
+
set requiredPower(value) {
|
|
34
|
+
this._rawGroup.requiredPower = value;
|
|
35
|
+
}
|
|
36
|
+
setMemberRequiredPower(member, power) {
|
|
37
|
+
this._rawGroup.setMemberRequiredPower(prepareIdentifierValue(member), power);
|
|
38
|
+
}
|
|
39
|
+
static createFromRawInstance(rawInstance) {
|
|
40
|
+
const instance = Object.create(GroupWASM.prototype);
|
|
41
|
+
instance._rawGroup = rawInstance;
|
|
42
|
+
return instance;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RewardDistributionTypeNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { DistributionFunctionWASM } from './DistributionFunction.js';
|
|
3
|
+
import { RewardDistribution } from '../../types.js';
|
|
4
|
+
export declare class RewardDistributionTypeWASM {
|
|
5
|
+
/** @private **/
|
|
6
|
+
_rawRewardDistributionType: RewardDistributionTypeNAPI;
|
|
7
|
+
private constructor();
|
|
8
|
+
getDistribution(): RewardDistribution;
|
|
9
|
+
static BlockBasedDistribution(interval: bigint, distributionFunction: DistributionFunctionWASM): RewardDistributionTypeWASM;
|
|
10
|
+
static TimeBasedDistribution(interval: bigint, distributionFunction: DistributionFunctionWASM): RewardDistributionTypeWASM;
|
|
11
|
+
static EpochBasedDistribution(interval: number, distributionFunction: DistributionFunctionWASM): RewardDistributionTypeWASM;
|
|
12
|
+
static createFromRawInstance(rawInstance: RewardDistributionTypeNAPI): RewardDistributionTypeWASM;
|
|
13
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { DistributionFunctionWASM } from './DistributionFunction.js';
|
|
2
|
+
import { dppProvider } from '../../provider.js';
|
|
3
|
+
export class RewardDistributionTypeWASM {
|
|
4
|
+
/** @private **/
|
|
5
|
+
_rawRewardDistributionType;
|
|
6
|
+
constructor(rawInstance) {
|
|
7
|
+
this._rawRewardDistributionType = rawInstance;
|
|
8
|
+
}
|
|
9
|
+
getDistribution() {
|
|
10
|
+
const dist = this._rawRewardDistributionType.getDistribution();
|
|
11
|
+
const interval = typeof dist.interval === 'number' ? dist.interval : BigInt(dist.interval);
|
|
12
|
+
let distributionType;
|
|
13
|
+
if (dist instanceof dppProvider.dpp.BlockBasedDistributionNAPI) {
|
|
14
|
+
distributionType = 'BlockBasedDistribution';
|
|
15
|
+
}
|
|
16
|
+
else if (dist instanceof dppProvider.dpp.TimeBasedDistributionNAPI) {
|
|
17
|
+
distributionType = 'TimeBasedDistribution';
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
distributionType = 'EpochBasedDistribution';
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
interval,
|
|
24
|
+
function: DistributionFunctionWASM.createFromRawInstance(dist.function),
|
|
25
|
+
distributionType
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
static BlockBasedDistribution(interval, distributionFunction) {
|
|
29
|
+
return new RewardDistributionTypeWASM(dppProvider.dpp.RewardDistributionTypeNAPI.BlockBasedDistribution(interval.toString(), distributionFunction._rawDistributionFunction));
|
|
30
|
+
}
|
|
31
|
+
static TimeBasedDistribution(interval, distributionFunction) {
|
|
32
|
+
return new RewardDistributionTypeWASM(dppProvider.dpp.RewardDistributionTypeNAPI.TimeBasedDistribution(interval.toString(), distributionFunction._rawDistributionFunction));
|
|
33
|
+
}
|
|
34
|
+
static EpochBasedDistribution(interval, distributionFunction) {
|
|
35
|
+
return new RewardDistributionTypeWASM(dppProvider.dpp.RewardDistributionTypeNAPI.EpochBasedDistribution(interval, distributionFunction._rawDistributionFunction));
|
|
36
|
+
}
|
|
37
|
+
static createFromRawInstance(rawInstance) {
|
|
38
|
+
return new RewardDistributionTypeWASM(rawInstance);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { TokenConfigurationNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { TokenConfigurationConventionWASM } from './TokenConfigurationConvention.js';
|
|
3
|
+
import { ChangeControlRulesWASM } from './ChangeControlRules.js';
|
|
4
|
+
import { TokenKeepsHistoryRulesWASM } from './TokenKeepsHistoryRules.js';
|
|
5
|
+
import { TokenDistributionRulesWASM } from './TokenDistributionRules.js';
|
|
6
|
+
import { TokenMarketplaceRulesWASM } from './TokenMarketplaceRules.js';
|
|
7
|
+
import { AuthorizedActionTakersWASM } from './AuthorizedActionTakers.js';
|
|
8
|
+
import { IdentifierLike } from '../../types.js';
|
|
9
|
+
import { IdentifierWASM } from '../Identifier.js';
|
|
10
|
+
export declare class TokenConfigurationWASM {
|
|
11
|
+
/** @private **/
|
|
12
|
+
_rawTokenConfiguration: TokenConfigurationNAPI;
|
|
13
|
+
constructor(conventions: TokenConfigurationConventionWASM, conventionsChangeRules: ChangeControlRulesWASM, baseSupply: bigint, keepsHistory: TokenKeepsHistoryRulesWASM, startAsPaused: boolean, allowTransferToFrozenBalance: boolean, maxSupplyChangeRules: ChangeControlRulesWASM, distributionRules: TokenDistributionRulesWASM, marketplaceRules: TokenMarketplaceRulesWASM, manualMintingRules: ChangeControlRulesWASM, manualBurningRules: ChangeControlRulesWASM, freezeRules: ChangeControlRulesWASM, unfreezeRules: ChangeControlRulesWASM, destroyFrozenFundsRules: ChangeControlRulesWASM, emergencyActionRules: ChangeControlRulesWASM, mainControlGroupCanBeModified: AuthorizedActionTakersWASM, maxSupply?: bigint, mainControlGroup?: number, description?: string);
|
|
14
|
+
get conventions(): TokenConfigurationConventionWASM;
|
|
15
|
+
set conventions(value: TokenConfigurationConventionWASM);
|
|
16
|
+
get conventionsChangeRules(): ChangeControlRulesWASM;
|
|
17
|
+
set conventionsChangeRules(value: ChangeControlRulesWASM);
|
|
18
|
+
get baseSupply(): bigint;
|
|
19
|
+
set baseSupply(value: bigint);
|
|
20
|
+
get keepsHistory(): TokenKeepsHistoryRulesWASM;
|
|
21
|
+
set keepsHistory(value: TokenKeepsHistoryRulesWASM);
|
|
22
|
+
get startAsPaused(): boolean;
|
|
23
|
+
set startAsPaused(value: boolean);
|
|
24
|
+
get isAllowedTransferToFrozenBalance(): boolean;
|
|
25
|
+
set isAllowedTransferToFrozenBalance(value: boolean);
|
|
26
|
+
get maxSupply(): bigint | undefined;
|
|
27
|
+
set maxSupply(value: bigint | undefined);
|
|
28
|
+
get maxSupplyChangeRules(): ChangeControlRulesWASM;
|
|
29
|
+
set maxSupplyChangeRules(value: ChangeControlRulesWASM);
|
|
30
|
+
get distributionRules(): TokenDistributionRulesWASM;
|
|
31
|
+
set distributionRules(value: TokenDistributionRulesWASM);
|
|
32
|
+
get marketplaceRules(): TokenMarketplaceRulesWASM;
|
|
33
|
+
set marketplaceRules(value: TokenMarketplaceRulesWASM);
|
|
34
|
+
get manualMintingRules(): ChangeControlRulesWASM;
|
|
35
|
+
set manualMintingRules(value: ChangeControlRulesWASM);
|
|
36
|
+
get manualBurningRules(): ChangeControlRulesWASM;
|
|
37
|
+
set manualBurningRules(value: ChangeControlRulesWASM);
|
|
38
|
+
get freezeRules(): ChangeControlRulesWASM;
|
|
39
|
+
set freezeRules(value: ChangeControlRulesWASM);
|
|
40
|
+
get unfreezeRules(): ChangeControlRulesWASM;
|
|
41
|
+
set unfreezeRules(value: ChangeControlRulesWASM);
|
|
42
|
+
get destroyFrozenFundsRules(): ChangeControlRulesWASM;
|
|
43
|
+
set destroyFrozenFundsRules(value: ChangeControlRulesWASM);
|
|
44
|
+
get emergencyActionRules(): ChangeControlRulesWASM;
|
|
45
|
+
set emergencyActionRules(value: ChangeControlRulesWASM);
|
|
46
|
+
get mainControlGroup(): number | undefined;
|
|
47
|
+
set mainControlGroup(value: number | undefined);
|
|
48
|
+
get mainControlGroupCanBeModified(): AuthorizedActionTakersWASM;
|
|
49
|
+
set mainControlGroupCanBeModified(value: AuthorizedActionTakersWASM);
|
|
50
|
+
get description(): string | undefined;
|
|
51
|
+
set description(value: string | undefined);
|
|
52
|
+
static calculateTokenId(contractId: IdentifierLike, tokenPosition: number): IdentifierWASM;
|
|
53
|
+
static createFromRawInstance(rawInstance: TokenConfigurationNAPI): TokenConfigurationWASM;
|
|
54
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { TokenConfigurationConventionWASM } from './TokenConfigurationConvention.js';
|
|
2
|
+
import { ChangeControlRulesWASM } from './ChangeControlRules.js';
|
|
3
|
+
import { TokenKeepsHistoryRulesWASM } from './TokenKeepsHistoryRules.js';
|
|
4
|
+
import { TokenDistributionRulesWASM } from './TokenDistributionRules.js';
|
|
5
|
+
import { TokenMarketplaceRulesWASM } from './TokenMarketplaceRules.js';
|
|
6
|
+
import { AuthorizedActionTakersWASM } from './AuthorizedActionTakers.js';
|
|
7
|
+
import { dppProvider } from '../../provider.js';
|
|
8
|
+
import { IdentifierWASM } from '../Identifier.js';
|
|
9
|
+
import { prepareIdentifierValue } from '../../utils.js';
|
|
10
|
+
export class TokenConfigurationWASM {
|
|
11
|
+
/** @private **/
|
|
12
|
+
_rawTokenConfiguration;
|
|
13
|
+
constructor(conventions, conventionsChangeRules, baseSupply, keepsHistory, startAsPaused, allowTransferToFrozenBalance, maxSupplyChangeRules, distributionRules, marketplaceRules, manualMintingRules, manualBurningRules, freezeRules, unfreezeRules, destroyFrozenFundsRules, emergencyActionRules, mainControlGroupCanBeModified, maxSupply, mainControlGroup, description) {
|
|
14
|
+
this._rawTokenConfiguration = new dppProvider.dpp.TokenConfigurationNAPI(conventions._rawTokenConfigurationConvention, conventionsChangeRules._rawChangeControlRules, baseSupply.toString(), maxSupply?.toString(), keepsHistory._rawTokenKeepsHistoryRules, startAsPaused, allowTransferToFrozenBalance, maxSupplyChangeRules._rawChangeControlRules, distributionRules._rawTokenDistributionRules, marketplaceRules._rawTokenMarketplaceRules, manualMintingRules._rawChangeControlRules, manualBurningRules._rawChangeControlRules, freezeRules._rawChangeControlRules, unfreezeRules._rawChangeControlRules, destroyFrozenFundsRules._rawChangeControlRules, emergencyActionRules._rawChangeControlRules, mainControlGroup, mainControlGroupCanBeModified?._rawAuthorizedActionTakers, description);
|
|
15
|
+
}
|
|
16
|
+
get conventions() {
|
|
17
|
+
return TokenConfigurationConventionWASM.createFromRawInstance(this._rawTokenConfiguration.conventions);
|
|
18
|
+
}
|
|
19
|
+
set conventions(value) {
|
|
20
|
+
this._rawTokenConfiguration.conventions = value._rawTokenConfigurationConvention;
|
|
21
|
+
}
|
|
22
|
+
get conventionsChangeRules() {
|
|
23
|
+
return ChangeControlRulesWASM.createFromRawInstance(this._rawTokenConfiguration.conventionsChangeRules);
|
|
24
|
+
}
|
|
25
|
+
set conventionsChangeRules(value) {
|
|
26
|
+
this._rawTokenConfiguration.conventionsChangeRules = value._rawChangeControlRules;
|
|
27
|
+
}
|
|
28
|
+
get baseSupply() {
|
|
29
|
+
return BigInt(this._rawTokenConfiguration.baseSupply);
|
|
30
|
+
}
|
|
31
|
+
set baseSupply(value) {
|
|
32
|
+
this._rawTokenConfiguration.baseSupply = value.toString();
|
|
33
|
+
}
|
|
34
|
+
get keepsHistory() {
|
|
35
|
+
return TokenKeepsHistoryRulesWASM.createFromRawInstance(this._rawTokenConfiguration.keepsHistory);
|
|
36
|
+
}
|
|
37
|
+
set keepsHistory(value) {
|
|
38
|
+
this._rawTokenConfiguration.keepsHistory = value._rawTokenKeepsHistoryRules;
|
|
39
|
+
}
|
|
40
|
+
get startAsPaused() {
|
|
41
|
+
return this._rawTokenConfiguration.startAsPaused;
|
|
42
|
+
}
|
|
43
|
+
set startAsPaused(value) {
|
|
44
|
+
this._rawTokenConfiguration.startAsPaused = value;
|
|
45
|
+
}
|
|
46
|
+
get isAllowedTransferToFrozenBalance() {
|
|
47
|
+
return this._rawTokenConfiguration.isAllowedTransferToFrozenBalance;
|
|
48
|
+
}
|
|
49
|
+
set isAllowedTransferToFrozenBalance(value) {
|
|
50
|
+
this._rawTokenConfiguration.isAllowedTransferToFrozenBalance = value;
|
|
51
|
+
}
|
|
52
|
+
get maxSupply() {
|
|
53
|
+
const supply = this._rawTokenConfiguration.maxSupply;
|
|
54
|
+
return supply != null ? BigInt(supply) : undefined;
|
|
55
|
+
}
|
|
56
|
+
set maxSupply(value) {
|
|
57
|
+
this._rawTokenConfiguration.maxSupply = value?.toString();
|
|
58
|
+
}
|
|
59
|
+
get maxSupplyChangeRules() {
|
|
60
|
+
return ChangeControlRulesWASM.createFromRawInstance(this._rawTokenConfiguration.maxSupplyChangeRules);
|
|
61
|
+
}
|
|
62
|
+
set maxSupplyChangeRules(value) {
|
|
63
|
+
this._rawTokenConfiguration.maxSupplyChangeRules = value._rawChangeControlRules;
|
|
64
|
+
}
|
|
65
|
+
get distributionRules() {
|
|
66
|
+
return TokenDistributionRulesWASM.createFromRawInstance(this._rawTokenConfiguration.distributionRules);
|
|
67
|
+
}
|
|
68
|
+
set distributionRules(value) {
|
|
69
|
+
this._rawTokenConfiguration.distributionRules = value._rawTokenDistributionRules;
|
|
70
|
+
}
|
|
71
|
+
get marketplaceRules() {
|
|
72
|
+
return TokenMarketplaceRulesWASM.createFromRawInstance(this._rawTokenConfiguration.marketplaceRules);
|
|
73
|
+
}
|
|
74
|
+
set marketplaceRules(value) {
|
|
75
|
+
this._rawTokenConfiguration.marketplaceRules = value._rawTokenMarketplaceRules;
|
|
76
|
+
}
|
|
77
|
+
get manualMintingRules() {
|
|
78
|
+
return ChangeControlRulesWASM.createFromRawInstance(this._rawTokenConfiguration.manualMintingRules);
|
|
79
|
+
}
|
|
80
|
+
set manualMintingRules(value) {
|
|
81
|
+
this._rawTokenConfiguration.manualMintingRules = value._rawChangeControlRules;
|
|
82
|
+
}
|
|
83
|
+
get manualBurningRules() {
|
|
84
|
+
return ChangeControlRulesWASM.createFromRawInstance(this._rawTokenConfiguration.manualBurningRules);
|
|
85
|
+
}
|
|
86
|
+
set manualBurningRules(value) {
|
|
87
|
+
this._rawTokenConfiguration.manualBurningRules = value._rawChangeControlRules;
|
|
88
|
+
}
|
|
89
|
+
get freezeRules() {
|
|
90
|
+
return ChangeControlRulesWASM.createFromRawInstance(this._rawTokenConfiguration.freezeRules);
|
|
91
|
+
}
|
|
92
|
+
set freezeRules(value) {
|
|
93
|
+
this._rawTokenConfiguration.freezeRules = value._rawChangeControlRules;
|
|
94
|
+
}
|
|
95
|
+
get unfreezeRules() {
|
|
96
|
+
return ChangeControlRulesWASM.createFromRawInstance(this._rawTokenConfiguration.unfreezeRules);
|
|
97
|
+
}
|
|
98
|
+
set unfreezeRules(value) {
|
|
99
|
+
this._rawTokenConfiguration.unfreezeRules = value._rawChangeControlRules;
|
|
100
|
+
}
|
|
101
|
+
get destroyFrozenFundsRules() {
|
|
102
|
+
return ChangeControlRulesWASM.createFromRawInstance(this._rawTokenConfiguration.destroyFrozenFundsRules);
|
|
103
|
+
}
|
|
104
|
+
set destroyFrozenFundsRules(value) {
|
|
105
|
+
this._rawTokenConfiguration.destroyFrozenFundsRules = value._rawChangeControlRules;
|
|
106
|
+
}
|
|
107
|
+
get emergencyActionRules() {
|
|
108
|
+
return ChangeControlRulesWASM.createFromRawInstance(this._rawTokenConfiguration.emergencyActionRules);
|
|
109
|
+
}
|
|
110
|
+
set emergencyActionRules(value) {
|
|
111
|
+
this._rawTokenConfiguration.emergencyActionRules = value._rawChangeControlRules;
|
|
112
|
+
}
|
|
113
|
+
get mainControlGroup() {
|
|
114
|
+
return this._rawTokenConfiguration.mainControlGroup ?? undefined;
|
|
115
|
+
}
|
|
116
|
+
set mainControlGroup(value) {
|
|
117
|
+
this._rawTokenConfiguration.mainControlGroup = value;
|
|
118
|
+
}
|
|
119
|
+
get mainControlGroupCanBeModified() {
|
|
120
|
+
return AuthorizedActionTakersWASM.createFromRawInstance(this._rawTokenConfiguration.mainControlGroupCanBeModified);
|
|
121
|
+
}
|
|
122
|
+
set mainControlGroupCanBeModified(value) {
|
|
123
|
+
this._rawTokenConfiguration.mainControlGroupCanBeModified = value._rawAuthorizedActionTakers;
|
|
124
|
+
}
|
|
125
|
+
get description() {
|
|
126
|
+
return this._rawTokenConfiguration.description ?? undefined;
|
|
127
|
+
}
|
|
128
|
+
set description(value) {
|
|
129
|
+
this._rawTokenConfiguration.description = value;
|
|
130
|
+
}
|
|
131
|
+
static calculateTokenId(contractId, tokenPosition) {
|
|
132
|
+
return IdentifierWASM.createFromRawInstance(dppProvider.dpp.TokenConfigurationNAPI.calculateTokenId(prepareIdentifierValue(contractId), tokenPosition));
|
|
133
|
+
}
|
|
134
|
+
static createFromRawInstance(rawInstance) {
|
|
135
|
+
const instance = Object.create(TokenConfigurationWASM.prototype);
|
|
136
|
+
instance._rawTokenConfiguration = rawInstance;
|
|
137
|
+
return instance;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { TokenConfigurationChangeItemNAPI } from '../../../../binaries/bindingsTypes.js';
|
|
2
|
+
import { TokenConfigurationConventionWASM } from './TokenConfigurationConvention.js';
|
|
3
|
+
import { AuthorizedActionTakersWASM } from './AuthorizedActionTakers.js';
|
|
4
|
+
import { TokenPerpetualDistributionWASM } from './TokenPerpetualDistribution.js';
|
|
5
|
+
import { IdentifierWASM } from '../Identifier.js';
|
|
6
|
+
import { TokenTradeModeWASM } from './TokenTradeMode.js';
|
|
7
|
+
import { IdentifierLike } from '../../types.js';
|
|
8
|
+
export declare class TokenConfigurationChangeItemWASM {
|
|
9
|
+
/** @private **/
|
|
10
|
+
_rawTokenConfigurationChangeItem: TokenConfigurationChangeItemNAPI;
|
|
11
|
+
private constructor();
|
|
12
|
+
getItemName(): string;
|
|
13
|
+
getItem(): string | TokenConfigurationConventionWASM | AuthorizedActionTakersWASM | bigint | TokenPerpetualDistributionWASM | IdentifierWASM | boolean | TokenTradeModeWASM | number | undefined | null;
|
|
14
|
+
static ConventionsItem(convention: TokenConfigurationConventionWASM): TokenConfigurationChangeItemWASM;
|
|
15
|
+
static ConventionsAdminGroupItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
16
|
+
static ConventionsControlGroupItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
17
|
+
static FreezeItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
18
|
+
static FreezeAdminGroupItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
19
|
+
static DestroyFrozenFundsItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
20
|
+
static DestroyFrozenFundsAdminGroupItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
21
|
+
static EmergencyActionItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
22
|
+
static EmergencyActionAdminGroupItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
23
|
+
static MainControlGroupItem(groupContractPosition?: number): TokenConfigurationChangeItemWASM;
|
|
24
|
+
static ManualBurningItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
25
|
+
static ManualBurningAdminGroupItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
26
|
+
static ManualMintingItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
27
|
+
static ManualMintingAdminGroupItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
28
|
+
static MarketplaceTradeModeItem(tradeMode: TokenTradeModeWASM): TokenConfigurationChangeItemWASM;
|
|
29
|
+
static MarketplaceTradeModeControlGroupItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
30
|
+
static MarketplaceTradeModeAdminGroupItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
31
|
+
static MaxSupplyItem(supply?: bigint): TokenConfigurationChangeItemWASM;
|
|
32
|
+
static MaxSupplyControlGroupItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
33
|
+
static MaxSupplyAdminGroupItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
34
|
+
static MintingAllowChoosingDestinationItem(flag: boolean): TokenConfigurationChangeItemWASM;
|
|
35
|
+
static MintingAllowChoosingDestinationControlGroupItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
36
|
+
static MintingAllowChoosingDestinationAdminGroupItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
37
|
+
static NewTokensDestinationIdentityItem(identityId?: IdentifierLike): TokenConfigurationChangeItemWASM;
|
|
38
|
+
static NewTokensDestinationIdentityControlGroupItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
39
|
+
static NewTokensDestinationIdentityAdminGroupItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
40
|
+
static noChangeItem(): TokenConfigurationChangeItemWASM;
|
|
41
|
+
static PerpetualDistributionConfigurationItem(distribution?: TokenPerpetualDistributionWASM): TokenConfigurationChangeItemWASM;
|
|
42
|
+
static PerpetualDistributionControlGroupItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
43
|
+
static PerpetualDistributionAdminGroupItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
44
|
+
static UnfreezeItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
45
|
+
static UnfreezeAdminGroupItem(actionTaker: AuthorizedActionTakersWASM): TokenConfigurationChangeItemWASM;
|
|
46
|
+
static createFromRawInstance(rawInstance: TokenConfigurationChangeItemNAPI): TokenConfigurationChangeItemWASM;
|
|
47
|
+
}
|