Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 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
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
3 changes: 3 additions & 0 deletions .github/package-filters/rs-packages-direct.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ dpp:
wasm-dpp:
- packages/wasm-dpp/**

wasm-dpp2:
- packages/wasm-dpp2/**

drive:
- packages/rs-drive/**

Expand Down
4 changes: 4 additions & 0 deletions .github/package-filters/rs-packages-no-workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ wasm-dpp:
- packages/wasm-dpp/**
- *dpp

wasm-dpp2:
- packages/wasm-dpp2/**
- *dpp

drive: &drive
- packages/rs-drive/**
- *dpp
Expand Down
5 changes: 5 additions & 0 deletions .github/package-filters/rs-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ wasm-dpp:
- packages/wasm-dpp/**
- *dpp

wasm-dpp2:
- .github/workflows/tests*
- packages/wasm-dpp2/**
- *dpp

drive: &drive
- .github/workflows/tests*
- packages/rs-drive/**
Expand Down
210 changes: 210 additions & 0 deletions .pnp.cjs

Large diffs are not rendered by default.

21 changes: 20 additions & 1 deletion Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ members = [
"packages/rs-context-provider",
"packages/rs-sdk-trusted-context-provider",
"packages/wasm-dpp",
"packages/wasm-dpp2",
"packages/rs-dapi-client",
"packages/rs-sdk",
"packages/strategy-tests",
Expand Down
7 changes: 6 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ COPY --parents \
packages/rs-sdk-trusted-context-provider \
packages/rs-platform-wallet \
packages/wasm-dpp \
packages/wasm-dpp2 \
packages/wasm-drive-verify \
packages/rs-dapi-client \
packages/rs-sdk \
Expand Down Expand Up @@ -484,6 +485,7 @@ COPY --parents \
packages/rs-sdk-trusted-context-provider \
packages/rs-platform-wallet \
packages/wasm-dpp \
packages/wasm-dpp2 \
packages/wasm-drive-verify \
packages/rs-dapi-client \
packages/rs-sdk \
Expand Down Expand Up @@ -569,6 +571,7 @@ COPY --parents \
packages/rs-json-schema-compatibility-validator \
# Common
packages/wasm-dpp \
packages/wasm-dpp2 \
packages/dashpay-contract \
packages/withdrawals-contract \
packages/wallet-utils-contract \
Expand Down Expand Up @@ -604,7 +607,8 @@ RUN --mount=type=cache,sharing=shared,id=cargo_registry_index,target=${CARGO_HOM
yarn install --inline-builds && \
cp -R /platform/.yarn/unplugged /tmp/ && \
export SKIP_GRPC_PROTO_BUILD=1 && \
yarn build && \
# Build JS Dash SDK and dependencies
yarn run ultra -r --filter '+dash' --build && \
if [[ -x /usr/bin/sccache ]]; then sccache --show-stats; fi && \
# Remove target directory and rust packages to save space
rm -rf target packages/rs-*
Expand Down Expand Up @@ -844,6 +848,7 @@ COPY --parents \
packages/rs-context-provider \
packages/rs-sdk-trusted-context-provider \
packages/wasm-dpp \
packages/wasm-dpp2 \
packages/wasm-drive-verify \
packages/rs-dapi-client \
packages/rs-sdk \
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"packages/masternode-reward-shares-contract",
"packages/dash-spv",
"packages/wasm-dpp",
"packages/wasm-dpp2",
"packages/withdrawals-contract",
"packages/token-history-contract",
"packages/keyword-search-contract",
Expand Down
16 changes: 3 additions & 13 deletions packages/js-evo-sdk/src/contracts/facade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class ContractsFacade {
this.sdk = sdk;
}

async fetch(contractId: string): Promise<wasm.DataContract> {
async fetch(contractId: string): Promise<wasm.DataContract | undefined> {
const w = await this.sdk.getWasmSdkConnected();
return w.getDataContract(contractId);
}
Expand All @@ -22,23 +22,13 @@ export class ContractsFacade {
async getHistory(args: { contractId: string; limit?: number; startAtMs?: number | bigint }): Promise<any> {
const { contractId, limit, startAtMs } = args;
const w = await this.sdk.getWasmSdkConnected();
return w.getDataContractHistory(
contractId,
limit ?? null,
null,
startAtMs != null ? BigInt(startAtMs) : null,
);
return w.getDataContractHistory(contractId, limit ?? null, startAtMs != null ? BigInt(startAtMs) : null);
}

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

async getMany(contractIds: string[]): Promise<any> {
Expand Down
68 changes: 64 additions & 4 deletions packages/js-evo-sdk/src/group/facade.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
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 Down Expand Up @@ -93,24 +117,60 @@ export class GroupFacade {
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;
const w = await this.sdk.getWasmSdkConnected();
return w.getContestedResources(documentTypeName, contractId, indexName, startAtValue ?? null, limit ?? null, null, orderAscending ?? null);
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;
const w = await this.sdk.getWasmSdkConnected();
return w.getContestedResourcesWithProofInfo(documentTypeName, contractId, indexName, startAtValue ?? null, limit ?? null, null, orderAscending ?? null);
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;
const w = await this.sdk.getWasmSdkConnected();
return w.getContestedResourceVotersForIdentity(contractId, documentTypeName, indexName, indexValues, contestantId, startAtVoterInfo ?? null, limit ?? null, orderAscending ?? null);
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;
const w = await this.sdk.getWasmSdkConnected();
return w.getContestedResourceVotersForIdentityWithProofInfo(contractId, documentTypeName, indexName, indexValues, contestantId, startAtIdentifierInfo ?? null, count ?? null, orderAscending ?? null);
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);
}
}
6 changes: 3 additions & 3 deletions packages/js-evo-sdk/src/identities/facade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class IdentitiesFacade {
this.sdk = sdk;
}

async fetch(identityId: string): Promise<wasm.IdentityWasm> {
async fetch(identityId: string): Promise<wasm.Identity | undefined> {
const w = await this.sdk.getWasmSdkConnected();
return w.getIdentity(identityId);
}
Expand All @@ -19,7 +19,7 @@ export class IdentitiesFacade {
return w.getIdentityWithProofInfo(identityId);
}

async fetchUnproved(identityId: string): Promise<wasm.IdentityWasm> {
async fetchUnproved(identityId: string): Promise<wasm.Identity> {
const w = await this.sdk.getWasmSdkConnected();
return w.getIdentityUnproved(identityId);
}
Expand Down Expand Up @@ -100,7 +100,7 @@ export class IdentitiesFacade {
return w.getIdentityBalanceAndRevisionWithProofInfo(identityId);
}

async byPublicKeyHash(publicKeyHash: string): Promise<wasm.IdentityWasm> {
async byPublicKeyHash(publicKeyHash: string): Promise<wasm.Identity> {
const w = await this.sdk.getWasmSdkConnected();
return w.getIdentityByPublicKeyHash(publicKeyHash);
}
Expand Down
39 changes: 19 additions & 20 deletions packages/js-evo-sdk/src/voting/facade.ts
Original file line number Diff line number Diff line change
@@ -1,46 +1,45 @@
import type {
ContestedResourceIdentityVotesQuery,
ContestedResourceVoteStateQuery,
VotePollsByEndDateQuery,
} from '@dashevo/wasm-sdk';
import { asJsonString } from '../util.js';
import type { EvoSDK } from '../sdk.js';

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

async contestedResourceVoteState(params: { contractId: string; documentTypeName: string; indexName: string; indexValues: any[]; resultType: string; allowIncludeLockedAndAbstainingVoteTally?: boolean; startAtIdentifierInfo?: string; count?: number; orderAscending?: boolean }): Promise<any> {
const { contractId, documentTypeName, indexName, indexValues, resultType, allowIncludeLockedAndAbstainingVoteTally, startAtIdentifierInfo, count, orderAscending } = params;
async contestedResourceVoteState(query: ContestedResourceVoteStateQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getContestedResourceVoteState(contractId, documentTypeName, indexName, indexValues, resultType, allowIncludeLockedAndAbstainingVoteTally ?? null, startAtIdentifierInfo ?? null, count ?? null, orderAscending ?? null);
return w.getContestedResourceVoteState(query);
}

async contestedResourceVoteStateWithProof(params: { contractId: string; documentTypeName: string; indexName: string; indexValues: any[]; resultType: string; allowIncludeLockedAndAbstainingVoteTally?: boolean; startAtIdentifierInfo?: string; count?: number; orderAscending?: boolean }): Promise<any> {
const { contractId, documentTypeName, indexName, indexValues, resultType, allowIncludeLockedAndAbstainingVoteTally, startAtIdentifierInfo, count, orderAscending } = params;
async contestedResourceVoteStateWithProof(query: ContestedResourceVoteStateQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getContestedResourceVoteStateWithProofInfo(contractId, documentTypeName, indexName, indexValues, resultType, allowIncludeLockedAndAbstainingVoteTally ?? null, startAtIdentifierInfo ?? null, count ?? null, orderAscending ?? null);
return w.getContestedResourceVoteStateWithProofInfo(query);
}

async contestedResourceIdentityVotes(identityId: string, opts: { limit?: number; startAtVotePollIdInfo?: string; orderAscending?: boolean } = {}): Promise<any> {
const { limit, startAtVotePollIdInfo, orderAscending } = opts;
async contestedResourceIdentityVotes(query: ContestedResourceIdentityVotesQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getContestedResourceIdentityVotes(identityId, limit ?? null, startAtVotePollIdInfo ?? null, orderAscending ?? null);
return w.getContestedResourceIdentityVotes(query);
}

async contestedResourceIdentityVotesWithProof(identityId: string, opts: { limit?: number; offset?: number; orderAscending?: boolean } = {}): Promise<any> {
const { limit, offset, orderAscending } = opts;
async contestedResourceIdentityVotesWithProof(query: ContestedResourceIdentityVotesQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getContestedResourceIdentityVotesWithProofInfo(identityId, limit ?? null, offset ?? null, orderAscending ?? null);
return w.getContestedResourceIdentityVotesWithProofInfo(query);
}

async votePollsByEndDate(opts: { startTimeInfo?: string; endTimeInfo?: string; limit?: number; orderAscending?: boolean } = {}): Promise<any> {
const { startTimeInfo, endTimeInfo, limit, orderAscending } = opts;
async votePollsByEndDate(query?: VotePollsByEndDateQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getVotePollsByEndDate(startTimeInfo ?? null, endTimeInfo ?? null, limit ?? null, orderAscending ?? null);

return w.getVotePollsByEndDate(query ?? null);
}

async votePollsByEndDateWithProof(opts: { startTimeMs?: number | bigint | null; endTimeMs?: number | bigint | null; limit?: number; offset?: number; orderAscending?: boolean } = {}): Promise<any> {
const { startTimeMs, endTimeMs, limit, offset, orderAscending } = opts;
const start = startTimeMs != null ? BigInt(startTimeMs) : null;
const end = endTimeMs != null ? BigInt(endTimeMs) : null;
async votePollsByEndDateWithProof(query?: VotePollsByEndDateQuery): Promise<any> {
const w = await this.sdk.getWasmSdkConnected();
return w.getVotePollsByEndDateWithProofInfo(start ?? null, end ?? null, limit ?? null, offset ?? null, orderAscending ?? null);

return w.getVotePollsByEndDateWithProofInfo(query ?? null);
}

async masternodeVote(args: { masternodeProTxHash: string; contractId: string; documentTypeName: string; indexName: string; indexValues: string | any[]; voteChoice: string; votingKeyWif: string }): Promise<any> {
Expand Down
7 changes: 5 additions & 2 deletions packages/js-evo-sdk/tests/functional/voting.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('Voting', function votingSuite() {

it('contestedResourceVoteState() returns a vote state (may be empty)', async () => {
const res = await sdk.voting.contestedResourceVoteState({
contractId: TEST_IDS.dataContractId,
dataContractId: TEST_IDS.dataContractId,
documentTypeName: 'domain',
indexName: 'parentNameAndLabel',
indexValues: ['dash', TEST_IDS.username],
Expand All @@ -22,7 +22,10 @@ describe('Voting', function votingSuite() {
});

it('contestedResourceIdentityVotes() returns votes for identity (may be empty)', async () => {
const res = await sdk.voting.contestedResourceIdentityVotes(TEST_IDS.identityId, { limit: 5 });
const res = await sdk.voting.contestedResourceIdentityVotes({
identityId: TEST_IDS.identityId,
limit: 5,
});
expect(res).to.exist();
});
});
7 changes: 3 additions & 4 deletions packages/js-evo-sdk/tests/unit/facades/contracts.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,13 @@ describe('ContractsFacade', () => {
const { args } = wasmSdk.getDataContractHistory.firstCall;
expect(args[0]).to.equal('c');
expect(args[1]).to.equal(3);
expect(args[2]).to.equal(null);
expect(typeof args[3]).to.equal('bigint');
expect(args[3]).to.equal(BigInt(5));
expect(args[2]).to.be.a('bigint');
expect(args[2]).to.equal(BigInt(5));
});

it('getHistoryWithProof() forwards similarly', async () => {
await client.contracts.getHistoryWithProof({ contractId: 'c' });
expect(wasmSdk.getDataContractHistoryWithProofInfo).to.be.calledOnceWithExactly('c', null, null, null);
expect(wasmSdk.getDataContractHistoryWithProofInfo).to.be.calledOnceWithExactly('c', null, null);
});

it('getMany() and getManyWithProof() forward arrays', async () => {
Expand Down
Loading
Loading