Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 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
85ab1d5
fix: missing import
shumkov Nov 1, 2025
a44cc80
refactor: update document and identity params
shumkov Nov 1, 2025
717f6fa
Merge branch 'feat/sdk/entities' into wasm-sdk-params
shumkov Nov 1, 2025
c27179f
refactor(sdk): use param objects instead of arguments
shumkov Nov 1, 2025
d1ba7db
refactor(sdk): typed wasm-sdk params
shumkov Nov 2, 2025
ac1088f
Merge branch 'v2.2-dev' into wasm-sdk-params
shumkov Nov 3, 2025
f3706a4
fix: compilation errors after conflicts merge
shumkov Nov 3, 2025
0176785
refactor: use DataContractHistoryQuery as an argument
shumkov Nov 3, 2025
b5f8326
refactor: use EpochsQuery as an argument
shumkov Nov 3, 2025
50fcc81
refactor: use other queries
shumkov Nov 3, 2025
ef9552f
refactor: rename params
shumkov Nov 4, 2025
2f051e6
fix: regression on parsing hex to identifier
shumkov Nov 4, 2025
969a0af
refactor: identifier should has id postfix
shumkov Nov 4, 2025
b4a39a7
fix: unsafe converting u32 to u16
shumkov Nov 4, 2025
0ee75f4
fix: offset is not taking into account
shumkov Nov 4, 2025
1f3c294
Update packages/wasm-sdk/src/queries/group.rs
shumkov Nov 4, 2025
b4fe12b
Merge remote-tracking branch 'origin/wasm-sdk-params' into wasm-sdk-p…
shumkov Nov 4, 2025
dfe146f
refactor: implement TryFrom<&str> for IdentifierWasm
shumkov Nov 4, 2025
d1c7929
fix: unnecessary local side pagination and empty proofs
shumkov Nov 4, 2025
01adbbf
style: formatting
shumkov Nov 4, 2025
1f66959
refactor: clippy warnings
shumkov Nov 4, 2025
1a14c95
style: JS formatting
shumkov Nov 4, 2025
47563a6
refactor: clippy warnings
shumkov Nov 4, 2025
1e60b89
style: formatting
shumkov Nov 4, 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
11 changes: 5 additions & 6 deletions packages/js-evo-sdk/src/contracts/facade.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as wasm from '../wasm.js';
import { asJsonString } from '../util.js';
import type { EvoSDK } from '../sdk.js';
import type { DataContractHistoryQuery } from '../wasm.js';

export class ContractsFacade {
private sdk: EvoSDK;
Expand All @@ -19,16 +20,14 @@ export class ContractsFacade {
return w.getDataContractWithProofInfo(contractId);
}

async getHistory(args: { contractId: string; limit?: number; startAtMs?: number | bigint }): Promise<any> {
const { contractId, limit, startAtMs } = args;
async getHistory(query: DataContractHistoryQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getDataContractHistory(contractId, limit ?? null, startAtMs != null ? BigInt(startAtMs) : null);
return w.getDataContractHistory(query);
}

async getHistoryWithProof(args: { contractId: string; limit?: number; startAtMs?: number | bigint }): Promise<any> {
const { contractId, limit, startAtMs } = args;
async getHistoryWithProof(query: DataContractHistoryQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getDataContractHistoryWithProofInfo(contractId, limit ?? null, startAtMs != null ? BigInt(startAtMs) : null);
return w.getDataContractHistoryWithProofInfo(query);
}

async getMany(contractIds: string[]): Promise<any> {
Expand Down
47 changes: 5 additions & 42 deletions packages/js-evo-sdk/src/documents/facade.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { asJsonString } from '../util.js';
import type { EvoSDK } from '../sdk.js';
import type { DocumentsQuery } from '../wasm.js';

export class DocumentsFacade {
private sdk: EvoSDK;
Expand All @@ -9,52 +10,14 @@ export class DocumentsFacade {
}

// Query many documents
async query(params: {
contractId: string;
type: string;
where?: unknown;
orderBy?: unknown;
limit?: number;
startAfter?: string;
startAt?: string;
}): Promise<any> {
const { contractId, type, where, orderBy, limit, startAfter, startAt } = params;
const whereJson = asJsonString(where);
const orderJson = asJsonString(orderBy);
async query(query: DocumentsQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getDocuments(
contractId,
type,
whereJson ?? null,
orderJson ?? null,
limit ?? null,
startAfter ?? null,
startAt ?? null,
);
return w.getDocuments(query);
}

async queryWithProof(params: {
contractId: string;
type: string;
where?: unknown;
orderBy?: unknown;
limit?: number;
startAfter?: string;
startAt?: string;
}): Promise<any> {
const { contractId, type, where, orderBy, limit, startAfter, startAt } = params;
const whereJson = asJsonString(where);
const orderJson = asJsonString(orderBy);
async queryWithProof(query: DocumentsQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getDocumentsWithProofInfo(
contractId,
type,
whereJson ?? null,
orderJson ?? null,
limit ?? null,
startAfter ?? null,
startAt ?? null,
);
return w.getDocumentsWithProofInfo(query);
}

async get(contractId: string, type: string, documentId: string): Promise<any> {
Expand Down
35 changes: 17 additions & 18 deletions packages/js-evo-sdk/src/epoch/facade.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
import type { EvoSDK } from '../sdk.js';
import type {
EpochsQuery,
FinalizedEpochsQuery,
EvonodeProposedBlocksRangeQuery,
} from '../wasm.js';

export class EpochFacade {
private sdk: EvoSDK;
constructor(sdk: EvoSDK) { this.sdk = sdk; }

async epochsInfo(params: { startEpoch?: number; count?: number; ascending?: boolean } = {}): Promise<any> {
const { startEpoch, count, ascending } = params;
async epochsInfo(query: EpochsQuery = {}): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getEpochsInfo(startEpoch ?? null, count ?? null, ascending ?? null);
return w.getEpochsInfo(query);
}

async epochsInfoWithProof(params: { startEpoch?: number; count?: number; ascending?: boolean } = {}): Promise<any> {
const { startEpoch, count, ascending } = params;
async epochsInfoWithProof(query: EpochsQuery = {}): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getEpochsInfoWithProofInfo(startEpoch ?? null, count ?? null, ascending ?? null);
return w.getEpochsInfoWithProofInfo(query);
}

async finalizedInfos(params: { startEpoch?: number; count?: number; ascending?: boolean } = {}): Promise<any> {
const { startEpoch, count, ascending } = params;
async finalizedInfos(query: FinalizedEpochsQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getFinalizedEpochInfos(startEpoch ?? null, count ?? null, ascending ?? null);
return w.getFinalizedEpochInfos(query);
}

async finalizedInfosWithProof(params: { startEpoch?: number; count?: number; ascending?: boolean } = {}): Promise<any> {
const { startEpoch, count, ascending } = params;
async finalizedInfosWithProof(query: FinalizedEpochsQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getFinalizedEpochInfosWithProofInfo(startEpoch ?? null, count ?? null, ascending ?? null);
return w.getFinalizedEpochInfosWithProofInfo(query);
}

async current(): Promise<any> { const w = await this.sdk.getWasmSdkConnected(); return w.getCurrentEpoch(); }
Expand All @@ -41,15 +42,13 @@ export class EpochFacade {
return w.getEvonodesProposedEpochBlocksByIdsWithProofInfo(epoch, ids);
}

async evonodesProposedBlocksByRange(epoch: number, opts: { limit?: number; startAfter?: string; orderAscending?: boolean } = {}): Promise<any> {
const { limit, startAfter, orderAscending } = opts;
async evonodesProposedBlocksByRange(query: EvonodeProposedBlocksRangeQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getEvonodesProposedEpochBlocksByRange(epoch, limit ?? null, startAfter ?? null, orderAscending ?? null);
return w.getEvonodesProposedEpochBlocksByRange(query);
}

async evonodesProposedBlocksByRangeWithProof(epoch: number, opts: { limit?: number; startAfter?: string; orderAscending?: boolean } = {}): Promise<any> {
const { limit, startAfter, orderAscending } = opts;
async evonodesProposedBlocksByRangeWithProof(query: EvonodeProposedBlocksRangeQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getEvonodesProposedEpochBlocksByRangeWithProofInfo(epoch, limit ?? null, startAfter ?? null, orderAscending ?? null);
return w.getEvonodesProposedEpochBlocksByRangeWithProofInfo(query);
}
}
128 changes: 28 additions & 100 deletions packages/js-evo-sdk/src/group/facade.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,13 @@
import type {
ContestedResourceVotersForIdentityQuery,
GroupActionsQuery,
GroupInfosQuery,
GroupMembersQuery,
IdentityGroupsQuery,
VotePollsByDocumentTypeQuery,
} from '../wasm.js';
import type { EvoSDK } from '../sdk.js';

interface VotePollsByDocumentTypeQueryInput {
dataContractId: string;
documentTypeName: string;
indexName: string;
startIndexValues?: unknown[];
endIndexValues?: unknown[];
startAtValue?: unknown;
startAtValueIncluded?: boolean;
limit?: number;
orderAscending?: boolean;
}

interface ContestedResourceVotersForIdentityQueryInput {
dataContractId: string;
documentTypeName: string;
indexName: string;
indexValues?: unknown[];
contestantId: string;
limit?: number;
startAtVoterId?: string;
startAtIncluded?: boolean;
orderAscending?: boolean;
}

export class GroupFacade {
private sdk: EvoSDK;
constructor(sdk: EvoSDK) { this.sdk = sdk; }
Expand All @@ -38,60 +22,44 @@ export class GroupFacade {
return w.getGroupInfoWithProofInfo(contractId, groupContractPosition);
}

async infos(contractId: string, startAtInfo?: unknown, count?: number): Promise<any> {
async infos(query: GroupInfosQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getGroupInfos(contractId, startAtInfo ?? null, count ?? null);
return w.getGroupInfos(query);
}

async infosWithProof(contractId: string, startAtInfo?: unknown, count?: number): Promise<any> {
async infosWithProof(query: GroupInfosQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getGroupInfosWithProofInfo(contractId, startAtInfo ?? null, count ?? null);
return w.getGroupInfosWithProofInfo(query);
}

async members(contractId: string, groupContractPosition: number, opts: { memberIds?: string[]; startAt?: string; limit?: number } = {}): Promise<any> {
const { memberIds, startAt, limit } = opts;
async members(query: GroupMembersQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getGroupMembers(contractId, groupContractPosition, memberIds ?? null, startAt ?? null, limit ?? null);
return w.getGroupMembers(query);
}

async membersWithProof(contractId: string, groupContractPosition: number, opts: { memberIds?: string[]; startAt?: string; limit?: number } = {}): Promise<any> {
const { memberIds, startAt, limit } = opts;
async membersWithProof(query: GroupMembersQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getGroupMembersWithProofInfo(contractId, groupContractPosition, memberIds ?? null, startAt ?? null, limit ?? null);
return w.getGroupMembersWithProofInfo(query);
}

async identityGroups(identityId: string, opts: { memberDataContracts?: string[]; ownerDataContracts?: string[]; moderatorDataContracts?: string[] } = {}): Promise<any> {
const { memberDataContracts, ownerDataContracts, moderatorDataContracts } = opts;
async identityGroups(query: IdentityGroupsQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getIdentityGroups(
identityId,
memberDataContracts ?? null,
ownerDataContracts ?? null,
moderatorDataContracts ?? null,
);
return w.getIdentityGroups(query);
}

async identityGroupsWithProof(identityId: string, opts: { memberDataContracts?: string[]; ownerDataContracts?: string[]; moderatorDataContracts?: string[] } = {}): Promise<any> {
const { memberDataContracts, ownerDataContracts, moderatorDataContracts } = opts;
async identityGroupsWithProof(query: IdentityGroupsQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getIdentityGroupsWithProofInfo(
identityId,
memberDataContracts ?? null,
ownerDataContracts ?? null,
moderatorDataContracts ?? null,
);
return w.getIdentityGroupsWithProofInfo(query);
}

async actions(contractId: string, groupContractPosition: number, status: string, opts: { startAtInfo?: unknown; count?: number } = {}): Promise<any> {
const { startAtInfo, count } = opts;
async actions(query: GroupActionsQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getGroupActions(contractId, groupContractPosition, status, startAtInfo ?? null, count ?? null);
return w.getGroupActions(query);
}

async actionsWithProof(contractId: string, groupContractPosition: number, status: string, opts: { startAtInfo?: unknown; count?: number } = {}): Promise<any> {
const { startAtInfo, count } = opts;
async actionsWithProof(query: GroupActionsQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getGroupActionsWithProofInfo(contractId, groupContractPosition, status, startAtInfo ?? null, count ?? null);
return w.getGroupActionsWithProofInfo(query);
}

async actionSigners(contractId: string, groupContractPosition: number, status: string, actionId: string): Promise<any> {
Expand All @@ -114,63 +82,23 @@ export class GroupFacade {
return w.getGroupsDataContractsWithProofInfo(dataContractIds);
}

async contestedResources(params: { documentTypeName: string; contractId: string; indexName: string; startAtValue?: Uint8Array; limit?: number; orderAscending?: boolean }): Promise<any> {
const { documentTypeName, contractId, indexName, startAtValue, limit, orderAscending } = params;
async contestedResources(query: VotePollsByDocumentTypeQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
const query: VotePollsByDocumentTypeQueryInput = {
dataContractId: contractId,
documentTypeName,
indexName,
};
if (startAtValue !== undefined) query.startAtValue = startAtValue;
if (limit !== undefined) query.limit = limit;
if (orderAscending !== undefined) query.orderAscending = orderAscending;
return w.getContestedResources(query);
}

async contestedResourcesWithProof(params: { documentTypeName: string; contractId: string; indexName: string; startAtValue?: Uint8Array; limit?: number; orderAscending?: boolean }): Promise<any> {
const { documentTypeName, contractId, indexName, startAtValue, limit, orderAscending } = params;
async contestedResourcesWithProof(query: VotePollsByDocumentTypeQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
const query: VotePollsByDocumentTypeQueryInput = {
dataContractId: contractId,
documentTypeName,
indexName,
};
if (startAtValue !== undefined) query.startAtValue = startAtValue;
if (limit !== undefined) query.limit = limit;
if (orderAscending !== undefined) query.orderAscending = orderAscending;
return w.getContestedResourcesWithProofInfo(query);
}

async contestedResourceVotersForIdentity(params: { contractId: string; documentTypeName: string; indexName: string; indexValues: any[]; contestantId: string; startAtVoterInfo?: string; limit?: number; orderAscending?: boolean }): Promise<any> {
const { contractId, documentTypeName, indexName, indexValues, contestantId, startAtVoterInfo, limit, orderAscending } = params;
async contestedResourceVotersForIdentity(query: ContestedResourceVotersForIdentityQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
const query: ContestedResourceVotersForIdentityQueryInput = {
dataContractId: contractId,
documentTypeName,
indexName,
indexValues,
contestantId,
};
if (startAtVoterInfo !== undefined) query.startAtVoterId = startAtVoterInfo;
if (limit !== undefined) query.limit = limit;
if (orderAscending !== undefined) query.orderAscending = orderAscending;
return w.getContestedResourceVotersForIdentity(query);
}

async contestedResourceVotersForIdentityWithProof(params: { contractId: string; documentTypeName: string; indexName: string; indexValues: any[]; contestantId: string; startAtIdentifierInfo?: string; count?: number; orderAscending?: boolean }): Promise<any> {
const { contractId, documentTypeName, indexName, indexValues, contestantId, startAtIdentifierInfo, count, orderAscending } = params;
async contestedResourceVotersForIdentityWithProof(query: ContestedResourceVotersForIdentityQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
const query: ContestedResourceVotersForIdentityQueryInput = {
dataContractId: contractId,
documentTypeName,
indexName,
indexValues,
contestantId,
};
if (startAtIdentifierInfo !== undefined) query.startAtVoterId = startAtIdentifierInfo;
if (count !== undefined) query.limit = count;
if (orderAscending !== undefined) query.orderAscending = orderAscending;
return w.getContestedResourceVotersForIdentityWithProofInfo(query);
}
}
Loading
Loading