@dashevo/wasm-dpp 4.2.0-dev.1 → 4.2.0-dev.2
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/dist/wasm/wasm_dpp.d.ts +838 -743
- package/dist/wasm/wasm_dpp.js +87 -41
- package/dist/wasm/wasm_dpp_bg.js +1 -1
- package/lib/wasm/wasm_dpp.d.ts +838 -743
- package/package.json +2 -2
- package/src/errors/consensus/consensus_error.rs +28 -1
- package/src/errors/consensus/state/document/mod.rs +2 -0
- package/src/errors/consensus/state/document/referenced_entity_not_found_error.rs +44 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashevo/wasm-dpp",
|
|
3
|
-
"version": "4.2.0-dev.
|
|
3
|
+
"version": "4.2.0-dev.2",
|
|
4
4
|
"description": "The JavaScript implementation of the Dash Platform Protocol",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@babel/core": "^7.26.10",
|
|
45
45
|
"@babel/preset-env": "^7.26.9",
|
|
46
46
|
"@dashevo/dashcore-lib": "~0.22.0",
|
|
47
|
-
"@dashevo/dpns-contract": "4.2.0-dev.
|
|
47
|
+
"@dashevo/dpns-contract": "4.2.0-dev.2",
|
|
48
48
|
"@types/bs58": "^4.0.1",
|
|
49
49
|
"@types/node": "^20.10.0",
|
|
50
50
|
"@yarnpkg/pnpify": "^4.0.0-rc.42",
|
|
@@ -62,7 +62,7 @@ use dpp::consensus::state::data_trigger::DataTriggerError::{
|
|
|
62
62
|
DataTriggerConditionError, DataTriggerExecutionError, DataTriggerInvalidResultError,
|
|
63
63
|
};
|
|
64
64
|
use wasm_bindgen::{JsError, JsValue};
|
|
65
|
-
use dpp::consensus::basic::data_contract::{ContestedUniqueIndexOnMutableDocumentTypeError, ContestedUniqueIndexWithUniqueIndexError, DataContractTokenConfigurationUpdateError, DecimalsOverLimitError, DuplicateKeywordsError, GroupExceedsMaxMembersError, GroupHasTooFewMembersError, GroupMemberHasPowerOfZeroError, GroupMemberHasPowerOverLimitError, GroupNonUnilateralMemberPowerHasLessThanRequiredPowerError, GroupPositionDoesNotExistError, GroupRequiredPowerIsInvalidError, GroupTotalPowerLessThanRequiredError, InvalidDescriptionLengthError, InvalidDocumentTypeRequiredSecurityLevelError, InvalidKeywordCharacterError, InvalidKeywordLengthError, InvalidTokenBaseSupplyError, InvalidTokenDistributionFunctionDivideByZeroError, InvalidTokenDistributionFunctionIncoherenceError, InvalidTokenDistributionFunctionInvalidParameterError, InvalidTokenDistributionFunctionInvalidParameterTupleError, InvalidTokenLanguageCodeError, InvalidTokenNameCharacterError, InvalidTokenNameLengthError, MainGroupIsNotDefinedError, NewTokensDestinationIdentityOptionRequiredError, NonContiguousContractGroupPositionsError, NonContiguousContractTokenPositionsError, RedundantDocumentPaidForByTokenWithContractId, TokenPaymentByBurningOnlyAllowedOnInternalTokenError, TooManyKeywordsError, UnknownDocumentActionTokenEffectError, UnknownDocumentCreationRestrictionModeError, UnknownGasFeesPaidByError, UnknownSecurityLevelError, UnknownStorageKeyRequirementsError, UnknownTradeModeError, UnknownTransferableTypeError};
|
|
65
|
+
use dpp::consensus::basic::data_contract::{ContestedUniqueIndexOnMutableDocumentTypeError, DataContractInvalidRequiredFieldsUpdateError, ContestedUniqueIndexWithUniqueIndexError, DataContractTokenConfigurationUpdateError, DecimalsOverLimitError, DuplicateKeywordsError, GroupExceedsMaxMembersError, GroupHasTooFewMembersError, GroupMemberHasPowerOfZeroError, GroupMemberHasPowerOverLimitError, GroupNonUnilateralMemberPowerHasLessThanRequiredPowerError, GroupPositionDoesNotExistError, GroupRequiredPowerIsInvalidError, GroupTotalPowerLessThanRequiredError, InvalidDescriptionLengthError, InvalidDocumentTypeRequiredSecurityLevelError, InvalidKeywordCharacterError, InvalidKeywordLengthError, InvalidTokenBaseSupplyError, InvalidTokenDistributionFunctionDivideByZeroError, InvalidTokenDistributionFunctionIncoherenceError, InvalidTokenDistributionFunctionInvalidParameterError, InvalidTokenDistributionFunctionInvalidParameterTupleError, InvalidTokenLanguageCodeError, InvalidTokenNameCharacterError, InvalidTokenNameLengthError, MainGroupIsNotDefinedError, NewTokensDestinationIdentityOptionRequiredError, NonContiguousContractGroupPositionsError, NonContiguousContractTokenPositionsError, RedundantDocumentPaidForByTokenWithContractId, TokenPaymentByBurningOnlyAllowedOnInternalTokenError, TooManyKeywordsError, UnknownDocumentActionTokenEffectError, UnknownDocumentCreationRestrictionModeError, UnknownGasFeesPaidByError, UnknownSecurityLevelError, UnknownStorageKeyRequirementsError, UnknownTradeModeError, UnknownTransferableTypeError};
|
|
66
66
|
use dpp::consensus::basic::document::{ContestedDocumentsTemporarilyNotAllowedError, DocumentCreationNotAllowedError, DocumentFieldMaxSizeExceededError, MaxDocumentsTransitionsExceededError, MissingPositionsInDocumentTypePropertiesError};
|
|
67
67
|
use dpp::consensus::basic::group::GroupActionNotAllowedOnTransitionError;
|
|
68
68
|
use dpp::consensus::basic::identity::{DataContractBoundsNotPresentError, DisablingKeyIdAlsoBeingAddedInSameTransitionError, InvalidIdentityCreditWithdrawalTransitionAmountError, InvalidIdentityUpdateTransitionDisableKeysError, InvalidIdentityUpdateTransitionEmptyError, InvalidKeyPurposeForContractBoundsError, TooManyMasterPublicKeyError, WithdrawalOutputScriptNotAllowedWhenSigningWithOwnerKeyError};
|
|
@@ -92,6 +92,11 @@ use dpp::consensus::state::prefunded_specialized_balances::prefunded_specialized
|
|
|
92
92
|
use dpp::consensus::state::prefunded_specialized_balances::prefunded_specialized_balance_not_found_error::PrefundedSpecializedBalanceNotFoundError;
|
|
93
93
|
use dpp::consensus::state::token::{IdentityDoesNotHaveEnoughTokenBalanceError, IdentityTokenAccountNotFrozenError, IdentityTokenAccountFrozenError, TokenIsPausedError, IdentityTokenAccountAlreadyFrozenError, UnauthorizedTokenActionError, TokenSettingMaxSupplyToLessThanCurrentSupplyError, TokenMintPastMaxSupplyError, NewTokensDestinationIdentityDoesNotExistError, NewAuthorizedActionTakerIdentityDoesNotExistError, NewAuthorizedActionTakerGroupDoesNotExistError, NewAuthorizedActionTakerMainGroupNotSetError, InvalidGroupPositionError, TokenAlreadyPausedError, TokenNotPausedError, InvalidTokenClaimPropertyMismatch, InvalidTokenClaimNoCurrentRewards, InvalidTokenClaimWrongClaimant, TokenTransferRecipientIdentityNotExistError, PreProgrammedDistributionTimestampInPastError, IdentityHasNotAgreedToPayRequiredTokenAmountError, RequiredTokenPaymentInfoNotSetError, IdentityTryingToPayWithWrongTokenError, TokenDirectPurchaseUserPriceTooLow, TokenAmountUnderMinimumSaleAmount, TokenNotForDirectSale, InvalidTokenPositionStateError};
|
|
94
94
|
use dpp::consensus::state::address_funds::{AddressDoesNotExistError, AddressInvalidNonceError, AddressNotEnoughFundsError, AddressesNotEnoughFundsError};
|
|
95
|
+
use dpp::consensus::state::document::referenced_document_type_deletable_error::ReferencedDocumentTypeDeletableError;
|
|
96
|
+
use dpp::consensus::state::document::referenced_identity_key_disabled_error::ReferencedIdentityKeyDisabledError;
|
|
97
|
+
use dpp::consensus::state::document::referenced_identity_key_not_found_error::ReferencedIdentityKeyNotFoundError;
|
|
98
|
+
use dpp::consensus::state::document::referenced_key_id_property_invalid_error::ReferencedKeyIdPropertyInvalidError;
|
|
99
|
+
use dpp::consensus::state::document::referenced_document_type_not_found_error::ReferencedDocumentTypeNotFoundError;
|
|
95
100
|
use dpp::consensus::state::shielded::insufficient_pool_notes_error::InsufficientPoolNotesError;
|
|
96
101
|
use dpp::consensus::state::shielded::insufficient_shielded_fee_error::InsufficientShieldedFeeError;
|
|
97
102
|
use dpp::consensus::state::shielded::invalid_anchor_error::InvalidAnchorError;
|
|
@@ -138,6 +143,7 @@ use crate::errors::consensus::state::document::{
|
|
|
138
143
|
DocumentAlreadyPresentErrorWasm, DocumentNotFoundErrorWasm, DocumentOwnerIdMismatchErrorWasm,
|
|
139
144
|
DocumentTimestampWindowViolationErrorWasm, DocumentTimestampsMismatchErrorWasm,
|
|
140
145
|
DuplicateUniqueIndexErrorWasm, InvalidDocumentRevisionErrorWasm,
|
|
146
|
+
ReferencedEntityNotFoundErrorWasm,
|
|
141
147
|
};
|
|
142
148
|
use crate::errors::consensus::state::identity::{
|
|
143
149
|
IdentityAlreadyExistsErrorWasm, IdentityPublicKeyIsDisabledErrorWasm,
|
|
@@ -471,6 +477,24 @@ pub fn from_state_error(state_error: &StateError) -> JsValue {
|
|
|
471
477
|
StateError::InsufficientShieldedFeeError(e) => {
|
|
472
478
|
generic_consensus_error!(InsufficientShieldedFeeError, e).into()
|
|
473
479
|
}
|
|
480
|
+
StateError::ReferencedEntityNotFoundError(e) => {
|
|
481
|
+
ReferencedEntityNotFoundErrorWasm::from(e).into()
|
|
482
|
+
}
|
|
483
|
+
StateError::ReferencedDocumentTypeNotFoundError(e) => {
|
|
484
|
+
generic_consensus_error!(ReferencedDocumentTypeNotFoundError, e).into()
|
|
485
|
+
}
|
|
486
|
+
StateError::ReferencedDocumentTypeDeletableError(e) => {
|
|
487
|
+
generic_consensus_error!(ReferencedDocumentTypeDeletableError, e).into()
|
|
488
|
+
}
|
|
489
|
+
StateError::ReferencedIdentityKeyNotFoundError(e) => {
|
|
490
|
+
generic_consensus_error!(ReferencedIdentityKeyNotFoundError, e).into()
|
|
491
|
+
}
|
|
492
|
+
StateError::ReferencedIdentityKeyDisabledError(e) => {
|
|
493
|
+
generic_consensus_error!(ReferencedIdentityKeyDisabledError, e).into()
|
|
494
|
+
}
|
|
495
|
+
StateError::ReferencedKeyIdPropertyInvalidError(e) => {
|
|
496
|
+
generic_consensus_error!(ReferencedKeyIdPropertyInvalidError, e).into()
|
|
497
|
+
}
|
|
474
498
|
}
|
|
475
499
|
}
|
|
476
500
|
|
|
@@ -981,6 +1005,9 @@ fn from_basic_error(basic_error: &BasicError) -> JsValue {
|
|
|
981
1005
|
BasicError::TokenPricingScheduleEmptyError(e) => {
|
|
982
1006
|
generic_consensus_error!(TokenPricingScheduleEmptyError, e).into()
|
|
983
1007
|
}
|
|
1008
|
+
BasicError::DataContractInvalidRequiredFieldsUpdateError(e) => {
|
|
1009
|
+
generic_consensus_error!(DataContractInvalidRequiredFieldsUpdateError, e).into()
|
|
1010
|
+
}
|
|
984
1011
|
}
|
|
985
1012
|
}
|
|
986
1013
|
|
|
@@ -6,6 +6,7 @@ mod document_timestamps_are_equal_error;
|
|
|
6
6
|
mod document_timestamps_mismatch_error;
|
|
7
7
|
mod duplicate_unique_index_error;
|
|
8
8
|
mod invalid_document_revision_error;
|
|
9
|
+
mod referenced_entity_not_found_error;
|
|
9
10
|
|
|
10
11
|
pub use document_already_present_error::*;
|
|
11
12
|
pub use document_not_found_error::*;
|
|
@@ -15,3 +16,4 @@ pub use document_timestamps_are_equal_error::*;
|
|
|
15
16
|
pub use document_timestamps_mismatch_error::*;
|
|
16
17
|
pub use duplicate_unique_index_error::*;
|
|
17
18
|
pub use invalid_document_revision_error::*;
|
|
19
|
+
pub use referenced_entity_not_found_error::*;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
use crate::buffer::Buffer;
|
|
2
|
+
use dpp::consensus::codes::ErrorWithCode;
|
|
3
|
+
use dpp::consensus::state::document::referenced_entity_not_found_error::ReferencedEntityNotFoundError;
|
|
4
|
+
use dpp::consensus::ConsensusError;
|
|
5
|
+
use wasm_bindgen::prelude::*;
|
|
6
|
+
|
|
7
|
+
#[wasm_bindgen(js_name=ReferencedEntityNotFoundError)]
|
|
8
|
+
pub struct ReferencedEntityNotFoundErrorWasm {
|
|
9
|
+
inner: ReferencedEntityNotFoundError,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
impl From<&ReferencedEntityNotFoundError> for ReferencedEntityNotFoundErrorWasm {
|
|
13
|
+
fn from(e: &ReferencedEntityNotFoundError) -> Self {
|
|
14
|
+
Self { inner: e.clone() }
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
#[wasm_bindgen(js_class=ReferencedEntityNotFoundError)]
|
|
19
|
+
impl ReferencedEntityNotFoundErrorWasm {
|
|
20
|
+
#[wasm_bindgen(js_name=getEntityId)]
|
|
21
|
+
pub fn entity_id(&self) -> Buffer {
|
|
22
|
+
Buffer::from_bytes(self.inner.entity_id().as_bytes())
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
#[wasm_bindgen(js_name=getEntityType)]
|
|
26
|
+
pub fn entity_type(&self) -> String {
|
|
27
|
+
self.inner.entity_type().to_string()
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
#[wasm_bindgen(js_name=getPath)]
|
|
31
|
+
pub fn path(&self) -> String {
|
|
32
|
+
self.inner.path().to_string()
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
#[wasm_bindgen(js_name=getCode)]
|
|
36
|
+
pub fn get_code(&self) -> u32 {
|
|
37
|
+
ConsensusError::from(self.inner.clone()).code()
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
#[wasm_bindgen(getter)]
|
|
41
|
+
pub fn message(&self) -> String {
|
|
42
|
+
self.inner.to_string()
|
|
43
|
+
}
|
|
44
|
+
}
|