Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
7698392
feat: add wasm-dpp2
shumkov Oct 4, 2025
e99494f
refactor: remove WASM postfix from JS names
shumkov Oct 4, 2025
ee56d78
refactor: rename WASM postfix to Wasm
shumkov Oct 4, 2025
2814fe1
ci: add to CI
shumkov Oct 4, 2025
24711ff
chore: switch to local dpp
shumkov Oct 4, 2025
bc476ce
feat: integrate wasm-dpp2 entities
shumkov Oct 6, 2025
84a4ce9
refactor: rename `hex` to `toHex`
shumkov Oct 6, 2025
aa70d63
refactor: rename `bytes` to `toBytes`
shumkov Oct 6, 2025
44fd7d9
refactor: rename `toJson` to `toJSON`
shumkov Oct 6, 2025
bd0c39a
refactor: return error instead of jsvalue
shumkov Oct 6, 2025
9d4796b
refactor: replace jsvalue to error
shumkov Oct 7, 2025
06c576f
refactor: accomplish error refactoring
shumkov Oct 7, 2025
ee6ecc2
refactor: structure modules
shumkov Oct 7, 2025
3adc61d
refactor: downgrade to file modules
shumkov Oct 7, 2025
f1d296d
refactor: move code from mod.rs
shumkov Oct 7, 2025
77e95ae
refactor: use entities for data contract and documents
shumkov Oct 8, 2025
6796ba3
feat: epoch entities
shumkov Oct 8, 2025
8717ec2
feat: groups
shumkov Oct 9, 2025
b62ce96
refactor: group responses
shumkov Oct 9, 2025
9703af9
refactor: identity and group
shumkov Oct 9, 2025
cb0ad52
refactor: protocol
shumkov Oct 9, 2025
d09e11f
refactor: system
shumkov Oct 9, 2025
03abb96
refactor: add tokens
shumkov Oct 10, 2025
e9f6f2e
refactor: add typing to vote queries
shumkov Oct 15, 2025
2a2142b
Merge branch 'v2.1-dev' into feat/sdk/entities
QuantumExplorer Oct 24, 2025
7717fed
refactor: plain object query params
shumkov Oct 28, 2025
252e4e6
refactor: cleanup voting interface
shumkov Oct 28, 2025
7af57a7
chore: update SDK interfaces
shumkov Oct 29, 2025
267ae9c
Merge branch 'v2.2-dev' into feat/sdk/entities
shumkov Oct 29, 2025
fc83930
build: fix docker image
shumkov Oct 30, 2025
3dbeddc
build: do not build wasm-dpp2 by default
shumkov Oct 30, 2025
c24080d
build: build wasm-dpp2 by default but not for docker image
shumkov Oct 30, 2025
fadde6d
chore: remove unused deps
shumkov Oct 30, 2025
7572cff
chore: remove web-sys deps
shumkov Oct 30, 2025
6b636a1
refactor: fix clippy warnings
shumkov Oct 30, 2025
e9f77e2
test: fix contracts test
shumkov Oct 30, 2025
c1559b6
style: formatting
shumkov Oct 30, 2025
de92ae7
chore: remove commented code
shumkov Oct 30, 2025
e346dfa
fix: invalid contested resource value
shumkov Oct 30, 2025
4168580
fix: missing version 10
shumkov Oct 31, 2025
236a680
Update packages/wasm-dpp2/tests/unit/DataContractUpdateStateTransitio…
shumkov Oct 31, 2025
dc34f75
fix: typo
shumkov Oct 31, 2025
175cc08
Update packages/wasm-dpp2/src/state_transitions/batch/token_transitio…
shumkov Oct 31, 2025
136e253
Merge remote-tracking branch 'origin/feat/sdk/entities' into feat/sdk…
shumkov Oct 31, 2025
5f9bed7
Merge branch 'v2.2-dev' into feat/sdk/entities
shumkov Oct 31, 2025
2afb5f3
chore: update lock file
shumkov Oct 31, 2025
b100690
refactor: fix clippy warnings
shumkov Nov 1, 2025
5e0f1b4
Merge remote-tracking branch 'origin/feat/sdk/entities' into feat/sdk…
shumkov Nov 1, 2025
39deaba
feat(sdk): typed identifier
shumkov Nov 1, 2025
85ab1d5
fix: missing import
shumkov Nov 1, 2025
71b73c2
refactor: identifier params
shumkov Nov 1, 2025
3561301
refactor: rename fromValue to fromJSON
shumkov Nov 1, 2025
fcd291a
Merge branch 'feat/sdk/entities' into methods
shumkov Nov 2, 2025
de398f9
refactor(sdk): toObject/toJSON
shumkov Nov 3, 2025
16d7b23
Merge branch 'v2.2-dev' into methods
shumkov Nov 3, 2025
29dd696
fix: broken Cargo.toml
shumkov Nov 3, 2025
4c77e8b
refactor: fix clippy warnings
shumkov Nov 3, 2025
aa0d6e4
style: fix formatting
shumkov Nov 3, 2025
8914840
refactor: entity methods
shumkov Nov 18, 2025
2b14d84
refactor: implemented AssetLockProof
shumkov Nov 21, 2025
b23f871
refactro: convetion methods for BatchTransitionWasm
shumkov Nov 21, 2025
4d81576
fix: byte arrays toJson/toObject
shumkov Nov 26, 2025
60c7aa6
feat(sdk): pre-fetch trusted address list
shumkov Dec 1, 2025
b321db6
chore: missing provider
shumkov Dec 1, 2025
281f9d3
style: fix formatting
shumkov Dec 1, 2025
cb1201d
chore: add default addresses
shumkov Dec 1, 2025
494e803
chore: fix formatting and warnings
shumkov Dec 1, 2025
82f3b81
refactor: use ProofMetadataResponse
shumkov Dec 1, 2025
70749cb
docs: add list of files
shumkov Dec 1, 2025
2349361
Merge branch 'feat/toJSON' into methods
shumkov Dec 2, 2025
c929d59
feat: add convesion methods to wasm-sdk
shumkov Dec 2, 2025
edba809
test: update tests
shumkov Dec 3, 2025
7b03b52
test: fix tests
shumkov Dec 4, 2025
9b9d86d
fix: missing toJSON method
shumkov Dec 4, 2025
acd2f97
feat: json / wasm serializer
shumkov Dec 5, 2025
d8c1f06
fix: missing toJSON/toObject methods
shumkov Dec 9, 2025
2112a54
fix: invalid byte fields
shumkov Dec 9, 2025
335eab3
refactor: update Document methods
shumkov Dec 9, 2025
d7d993c
chore: fix identity and implement conversion fro block info
shumkov Dec 10, 2025
431cdc3
refactor: ensure conversion methods for the rest of entities
shumkov Dec 10, 2025
a13ea3d
refactor: json conversion logic
shumkov Dec 10, 2025
c28c1b9
docs: remove unnecesaary documents
shumkov Dec 10, 2025
1e250b4
refactor: use same code path
shumkov Dec 11, 2025
761f0b1
refactor: clean up
shumkov Dec 12, 2025
1447bbb
fix: toJSON for proof response
shumkov Dec 12, 2025
3b56b97
chore: use remote dependency
shumkov Dec 15, 2025
b825a5d
Merge branch 'v2.2-dev' into methods
shumkov Dec 15, 2025
ef1dc30
Merge branch 'v2.2-dev' into methods
shumkov Dec 15, 2025
c5554ab
refactor: use serde for instant lock proof
shumkov Dec 15, 2025
6d8733a
refactor: remove unnecessary conversion methods
shumkov Dec 15, 2025
2e0d5e5
refactor: remove more unused code
shumkov Dec 15, 2025
76edd75
refactor: remove tx out
shumkov Dec 16, 2025
f601134
fix: gerProperties must return JS object
shumkov Dec 16, 2025
e3c29fb
refactor: document conversion methods
shumkov Dec 16, 2025
6a5dad9
refactor: data contract use serde_format
shumkov Dec 16, 2025
26abe5e
refactor: use macro when possible
shumkov Dec 16, 2025
0a7bb51
fix: retuen JS objects instead json
shumkov Dec 16, 2025
ff91aed
docs: remove unnecessary dic
shumkov Dec 16, 2025
586f826
chore: revert unnecessary script
shumkov Dec 16, 2025
2c147b3
refactor: rename serde_format
shumkov Dec 17, 2025
8de2c71
refactor: remove unnecessary methods
shumkov Dec 22, 2025
f493bda
refactor: remove manual fields set
shumkov Dec 22, 2025
4cf994a
refactor: many stuff
shumkov Dec 23, 2025
fc33544
refactor: remove duplicated functions
shumkov Dec 23, 2025
3d309bf
Merge branch 'v3.0-dev' into methods
shumkov Dec 23, 2025
2c5f12e
refactor: use types
shumkov Dec 23, 2025
2b27a5d
refactor: multiple refactorings
shumkov Dec 24, 2025
36cc29b
refactor: to script
shumkov Dec 24, 2025
51284ae
fix: invalid bytes offset check
shumkov Dec 24, 2025
e4fe082
refactor: fomatting and linting
shumkov Dec 24, 2025
77fa2b0
fix: invalid dep versions
shumkov Dec 24, 2025
dbfcdc0
refactor: simplify identity conversion methods
shumkov Dec 24, 2025
3976331
refactor: gated serde implementation
shumkov Dec 24, 2025
46a3815
chore: update yarn lock
shumkov Dec 24, 2025
022097a
fix: invalid typings
shumkov Dec 24, 2025
6253378
refactor: consolidate derive attributes for serialization types
shumkov Dec 24, 2025
f8581b9
chore: remove unused deps
shumkov Dec 24, 2025
247b434
chore: switch to bs58 v4
shumkov Dec 24, 2025
75e710f
refactor: replace function expressions with arrow functions in tests
shumkov Dec 24, 2025
ba99c9e
test: fix create_platform_with_chain_asset_lock_mock test helper
shumkov Dec 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
18 changes: 14 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/js-evo-sdk/src/dpns/facade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ export class DpnsFacade {
return w.getDpnsUsername(identityId);
}

async usernamesWithProof(query: wasm.DpnsUsernamesQuery): Promise<wasm.DpnsUsernamesProofResponse> {
async usernamesWithProof(query: wasm.DpnsUsernamesQuery): Promise<wasm.ProofMetadataResponseTyped<Array<string>>> {
const w = await this.sdk.getWasmSdkConnected();
return w.getDpnsUsernamesWithProofInfo(query);
}

async usernameWithProof(identityId: wasm.IdentifierLike): Promise<wasm.DpnsUsernameProofResponse> {
async usernameWithProof(identityId: wasm.IdentifierLike): Promise<wasm.ProofMetadataResponseTyped<string | null>> {
const w = await this.sdk.getWasmSdkConnected();
return w.getDpnsUsernameWithProofInfo(identityId);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/js-evo-sdk/src/group/facade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ export class GroupFacade {
return w.getContestedResourcesWithProofInfo(query);
}

async contestedResourceVotersForIdentity(query: wasm.ContestedResourceVotersForIdentityQuery): Promise<string[]> {
async contestedResourceVotersForIdentity(query: wasm.ContestedResourceVotersForIdentityQuery): Promise<wasm.Identifier[]> {
const w = await this.sdk.getWasmSdkConnected();
return w.getContestedResourceVotersForIdentity(query);
}

async contestedResourceVotersForIdentityWithProof(query: wasm.ContestedResourceVotersForIdentityQuery): Promise<wasm.ProofMetadataResponseTyped<string[]>> {
async contestedResourceVotersForIdentityWithProof(query: wasm.ContestedResourceVotersForIdentityQuery): Promise<wasm.ProofMetadataResponseTyped<wasm.Identifier[]>> {
const w = await this.sdk.getWasmSdkConnected();
return w.getContestedResourceVotersForIdentityWithProofInfo(query);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/js-evo-sdk/src/voting/facade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ export class VotingFacade {
return w.getContestedResourceVoteStateWithProofInfo(query);
}

async contestedResourceIdentityVotes(query: wasm.ContestedResourceIdentityVotesQuery): Promise<any[]> {
async contestedResourceIdentityVotes(query: wasm.ContestedResourceIdentityVotesQuery): Promise<Map<wasm.Identifier, wasm.ResourceVote>> {
const w = await this.sdk.getWasmSdkConnected();
return w.getContestedResourceIdentityVotes(query);
}

async contestedResourceIdentityVotesWithProof(query: wasm.ContestedResourceIdentityVotesQuery): Promise<wasm.ProofMetadataResponseTyped<{ votes: Array<any> }>> {
async contestedResourceIdentityVotesWithProof(query: wasm.ContestedResourceIdentityVotesQuery): Promise<wasm.ProofMetadataResponseTyped<Map<wasm.Identifier, wasm.ResourceVote>>> {
const w = await this.sdk.getWasmSdkConnected();
return w.getContestedResourceIdentityVotesWithProofInfo(query);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,13 @@ impl DocumentJsonMethodsV0<'_> for ExtendedDocumentV0 {
Ok(json)
}

fn from_json_value<S>(
fn from_json_value<S, E>(
document_value: JsonValue,
platform_version: &PlatformVersion,
) -> Result<Self, ProtocolError>
where
for<'de> S: Deserialize<'de> + TryInto<Identifier, Error = ProtocolError>,
for<'de> S: Deserialize<'de> + TryInto<Identifier, Error = E>,
E: Into<ProtocolError>,
{
Self::from_platform_value(document_value.into(), platform_version)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,20 @@ impl DocumentJsonMethodsV0<'_> for Document {
}

/// Create a document from a JSON value.
fn from_json_value<S>(
fn from_json_value<S, E>(
document_value: JsonValue,
platform_version: &PlatformVersion,
) -> Result<Self, ProtocolError>
where
for<'de> S: Deserialize<'de> + TryInto<Identifier, Error = ProtocolError>,
for<'de> S: Deserialize<'de> + TryInto<Identifier, Error = E>,
E: Into<ProtocolError>,
{
match platform_version
.dpp
.document_versions
.document_structure_version
{
0 => Ok(Document::V0(DocumentV0::from_json_value::<S>(
0 => Ok(Document::V0(DocumentV0::from_json_value::<S, E>(
document_value,
platform_version,
)?)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ pub trait DocumentJsonMethodsV0<'a>: DocumentPlatformValueMethodsV0<'a> {
platform_version: &PlatformVersion,
) -> Result<JsonValue, ProtocolError>;
fn to_json(&self, platform_version: &PlatformVersion) -> Result<JsonValue, ProtocolError>;
fn from_json_value<S>(
fn from_json_value<S, E>(
document_value: JsonValue,
platform_version: &PlatformVersion,
) -> Result<Self, ProtocolError>
where
for<'de> S: Deserialize<'de> + TryInto<Identifier, Error = ProtocolError>,
for<'de> S: Deserialize<'de> + TryInto<Identifier, Error = E>,
E: Into<ProtocolError>,
Self: Sized;
}
23 changes: 15 additions & 8 deletions packages/rs-dpp/src/document/v0/json_conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,24 +104,29 @@ impl DocumentJsonMethodsV0<'_> for DocumentV0 {
.map(|v| v.try_into().map_err(ProtocolError::ValueError))?
}

fn from_json_value<S>(
fn from_json_value<S, E>(
mut document_value: JsonValue,
_platform_version: &PlatformVersion,
) -> Result<Self, ProtocolError>
where
for<'de> S: Deserialize<'de> + TryInto<Identifier, Error = ProtocolError>,
for<'de> S: Deserialize<'de> + TryInto<Identifier, Error = E>,
E: Into<ProtocolError>,
{
let mut document = Self {
..Default::default()
};

if let Ok(value) = document_value.remove(property_names::ID) {
let data: S = serde_json::from_value(value)?;
document.id = data.try_into()?;
if !value.is_null() {
let data: S = serde_json::from_value(value)?;
document.id = data.try_into().map_err(Into::into)?;
}
}
if let Ok(value) = document_value.remove(property_names::OWNER_ID) {
let data: S = serde_json::from_value(value)?;
document.owner_id = data.try_into()?;
if !value.is_null() {
let data: S = serde_json::from_value(value)?;
document.owner_id = data.try_into().map_err(Into::into)?;
}
}
if let Ok(value) = document_value.remove(property_names::REVISION) {
document.revision = serde_json::from_value(value)?
Expand Down Expand Up @@ -154,8 +159,10 @@ impl DocumentJsonMethodsV0<'_> for DocumentV0 {
document.transferred_at_core_block_height = serde_json::from_value(value)?;
}
if let Ok(value) = document_value.remove(property_names::CREATOR_ID) {
let data: S = serde_json::from_value(value)?;
document.creator_id = Some(data.try_into()?);
if !value.is_null() {
let data: S = serde_json::from_value(value)?;
document.creator_id = Some(data.try_into().map_err(Into::into)?);
}
}

let platform_value: Value = document_value.into();
Expand Down
6 changes: 6 additions & 0 deletions packages/rs-dpp/src/group/action_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ use crate::tokens::token_event::TokenEvent;
use crate::ProtocolError;
use bincode::{Decode, Encode};
use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize};
#[cfg(feature = "state-transition-serde-conversion")]
use serde::{Deserialize, Serialize};

#[derive(
Debug, PartialEq, PartialOrd, Clone, Eq, Encode, Decode, PlatformDeserialize, PlatformSerialize,
)]
#[cfg_attr(
feature = "state-transition-serde-conversion",
derive(Serialize, Deserialize)
)]
#[platform_serialize(unversioned)] //versioned directly, no need to use platform_version
pub enum GroupActionEvent {
TokenEvent(TokenEvent),
Expand Down
6 changes: 6 additions & 0 deletions packages/rs-dpp/src/group/group_action/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ use crate::ProtocolError;
use bincode::{Decode, Encode};
use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize};
use platform_value::Identifier;
#[cfg(feature = "state-transition-serde-conversion")]
use serde::{Deserialize, Serialize};

#[derive(
Debug, PartialEq, PartialOrd, Clone, Eq, Encode, Decode, PlatformDeserialize, PlatformSerialize,
)]
#[cfg_attr(
feature = "state-transition-serde-conversion",
derive(Serialize, Deserialize)
)]
#[platform_serialize(unversioned)] //versioned directly, no need to use platform_version
pub enum GroupAction {
V0(GroupActionV0),
Expand Down
6 changes: 6 additions & 0 deletions packages/rs-dpp/src/group/group_action/v0/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@ use crate::ProtocolError;
use bincode::{Decode, Encode};
use platform_serialization_derive::{PlatformDeserialize, PlatformSerialize};
use platform_value::Identifier;
#[cfg(feature = "state-transition-serde-conversion")]
use serde::{Deserialize, Serialize};

#[derive(
Debug, PartialEq, PartialOrd, Clone, Eq, Encode, Decode, PlatformDeserialize, PlatformSerialize,
)]
#[cfg_attr(
feature = "state-transition-serde-conversion",
derive(Serialize, Deserialize)
)]
#[platform_serialize(unversioned)] //versioned directly, no need to use platform_version
pub struct GroupActionV0 {
pub contract_id: Identifier,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,44 @@
mod v0;
pub use v0::*;
use crate::identity::identity_public_key::v0::IdentityPublicKeyV0;
use crate::identity::IdentityPublicKey;
use crate::version::PlatformVersion;
use crate::ProtocolError;
use serde_json::Value as JsonValue;
pub use v0::IdentityPublicKeyJsonConversionMethodsV0;

impl IdentityPublicKeyJsonConversionMethodsV0 for IdentityPublicKey {
fn to_json(&self) -> Result<JsonValue, ProtocolError> {
match self {
IdentityPublicKey::V0(key) => key.to_json(),
}
}

fn to_json_object(&self) -> Result<JsonValue, ProtocolError> {
match self {
IdentityPublicKey::V0(key) => key.to_json_object(),
}
}

fn from_json_object(
raw_object: JsonValue,
platform_version: &PlatformVersion,
) -> Result<Self, ProtocolError>
where
Self: Sized,
{
match platform_version
.dpp
.identity_versions
.identity_key_structure_version
{
0 => {
IdentityPublicKeyV0::from_json_object(raw_object, platform_version).map(Into::into)
}
version => Err(ProtocolError::UnknownVersionMismatch {
method: "IdentityPublicKey::from_json_object".to_string(),
known_versions: vec![0],
received: version,
}),
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[cfg(feature = "cbor")]
#[cfg(feature = "identity-cbor-conversion")]
pub mod cbor;
#[cfg(feature = "json-object")]
#[cfg(feature = "identity-json-conversion")]
pub mod json;
#[cfg(feature = "platform-value")]
#[cfg(feature = "identity-value-conversion")]
pub mod platform_value;
Original file line number Diff line number Diff line change
@@ -1,6 +1,48 @@
mod v0;
use crate::identity::identity_public_key::v0::IdentityPublicKeyV0;
use crate::identity::IdentityPublicKey;
use crate::serialization::ValueConvertible;
use crate::version::PlatformVersion;
use crate::ProtocolError;
use platform_value::Value;
pub use v0::*;

impl ValueConvertible<'_> for IdentityPublicKey {}

impl IdentityPublicKeyPlatformValueConversionMethodsV0 for IdentityPublicKey {
fn to_object(&self) -> Result<Value, ProtocolError> {
match self {
IdentityPublicKey::V0(key) => key.to_object(),
}
}

fn to_cleaned_object(&self) -> Result<Value, ProtocolError> {
match self {
IdentityPublicKey::V0(key) => key.to_cleaned_object(),
}
}

fn into_object(self) -> Result<Value, ProtocolError> {
match self {
IdentityPublicKey::V0(key) => key.into_object(),
}
}

fn from_object(
value: Value,
platform_version: &PlatformVersion,
) -> Result<Self, ProtocolError> {
match platform_version
.dpp
.identity_versions
.identity_key_structure_version
{
0 => IdentityPublicKeyV0::from_object(value, platform_version).map(Into::into),
version => Err(ProtocolError::UnknownVersionMismatch {
method: "IdentityPublicKey::from_object".to_string(),
known_versions: vec![0],
received: version,
}),
}
}
}
Loading
Loading