Dash Platform Evo JS SDK Documentation
Return types generated from @dashevo/evo-sdk@4.1.0 published declarations. Return type declarations.
Overview
The Dash Platform Evo JS SDK exposes a modern JavaScript interface for interacting with platform data and submitting state transitions. This documentation mirrors the legacy layout so you can quickly find queries and transitions while using the Evo SDK.
Key Concepts
- Queries: Read-only operations that fetch data from Dash Platform
- State Transitions: Mutating operations that require properly authorized identities
- Proofs: Many queries can return cryptographic proofs for verification
- Credits: Platform fees are collected in credits; keep balances funded before submitting transitions
- Default Limits: Optional limit arguments default to a maximum of 100 items unless specified
Tip: Examples below execute against Dash Platform Testnet via the Evo SDK client. Click "Run" to invoke any example.
5DbLwAxGBzUzo81VewMUwn4b5P4bpv9FNFybi25XB5BkThis identity has activity on testnet and is safe to use for read-only demonstrations.
Queries
Identity Queries
Get Identity
Fetch an identity by its identifier.
fetch(identityId: wasm.IdentifierLike): Promise<wasm.Identity | undefined>
Parameters
Returns
Promise<wasm.Identity | undefined>
Example
Get Identity (Unproved)
Fetch an identity without requesting cryptographic proofs.
fetchUnproved(identityId: wasm.IdentifierLike): Promise<wasm.Identity>
Parameters
Returns
Promise<wasm.Identity>
Example
Get Identity Keys
Retrieve public keys for an identity, including support for specific key IDs or purpose searches.
getKeys(query: wasm.IdentityKeysQuery): Promise<wasm.IdentityPublicKey[]>
Parameters
Identity identifier.
Requested key selection strategy.
number
Optional
Maximum number of keys to return after applying request filters.
number
Optional
Number of keys to skip from the beginning of the result set.
Returns
Promise<wasm.IdentityPublicKey[]>
Example
Get Contract Keys for Identities
Fetch contract-specific keys for one or more identities.
Disabled: Requires fix for upstream issue: https://github.com/dashpay/platform/issues/3028
contractKeys(query: wasm.IdentitiesContractKeysQuery): Promise<wasm.IdentityContractKeys[]>
Parameters
Identity identifiers to fetch keys for.
Data contract identifier (reserved for future filtering).
number[]
Optional
Optional list of purposes to include.
Returns
Promise<wasm.IdentityContractKeys[]>
Example
Get Identity Nonce
Retrieve the global nonce associated with an identity.
nonce(identityId: wasm.IdentifierLike): Promise<bigint | undefined>
Parameters
Returns
Promise<bigint | undefined>
Example
Get Identity Contract Nonce
Retrieve the per-contract nonce for an identity.
contractNonce(identityId: wasm.IdentifierLike, contractId: wasm.IdentifierLike): Promise<bigint | undefined>
Returns
Promise<bigint | undefined>
Example
Get Identity Balance
Fetch the credit balance for an identity.
balance(identityId: wasm.IdentifierLike): Promise<bigint | undefined>
Parameters
Returns
Promise<bigint | undefined>
Example
Get Multiple Identity Balances
Fetch balances for multiple identities in a single request.
balances(identityIds: wasm.IdentifierLikeArray): Promise<Map<string, bigint | undefined>>
Parameters
Returns
Promise<Map<string, bigint | undefined>>
Example
Get Identity Balance & Revision
Retrieve both the balance and revision number for an identity.
balanceAndRevision(identityId: wasm.IdentifierLike): Promise<wasm.IdentityBalanceAndRevision | undefined>
Parameters
Returns
Promise<wasm.IdentityBalanceAndRevision | undefined>
Example
Get Identity by Unique Public Key Hash
Lookup an identity via its unique public key hash.
byPublicKeyHash(publicKeyHash: wasm.PublicKeyHashLike): Promise<wasm.Identity | undefined>
Parameters
Returns
Promise<wasm.Identity | undefined>
Example
Get Identity by Non-Unique Public Key Hash
Lookup identities that match a non-unique public key hash.
byNonUniquePublicKeyHash(publicKeyHash: wasm.PublicKeyHashLike, startAfter?: wasm.IdentifierLike): Promise<wasm.Identity[]>
Returns
Promise<wasm.Identity[]>
Example
Get Identity Token Balances
Retrieve balances for a set of token IDs held by an identity.
tokenBalances(identityId: wasm.IdentifierLike, tokenIds: wasm.IdentifierLikeArray): Promise<Map<string, bigint>>
Returns
Promise<Map<string, bigint>>
Example
Get Token Balances for Identities
Fetch balances for multiple identities for a single token.
balances(identityIds: wasm.IdentifierLikeArray, tokenId: wasm.IdentifierLike): Promise<Map<string, bigint>>
Returns
Promise<Map<string, bigint>>
Example
Get Identity Token Info
Retrieve token metadata and balances for an identity.
identityTokenInfos(identityId: wasm.IdentifierLike, tokenIds: wasm.IdentifierLikeArray): Promise<Map<string, wasm.IdentityTokenInfo>>
Returns
Promise<Map<string, wasm.IdentityTokenInfo>>
Example
Get Token Info for Identities
Retrieve token metadata for multiple identities for a single token.
identitiesTokenInfos(identityIds: wasm.IdentifierLikeArray, tokenId: wasm.IdentifierLike): Promise<Map<string, wasm.IdentityTokenInfo>>
Returns
Promise<Map<string, wasm.IdentityTokenInfo>>
Example
Data Contract Queries
Get Data Contract
Fetch a data contract by its identifier.
fetch(contractId: wasm.IdentifierLike): Promise<wasm.DataContract | undefined>
Parameters
Returns
Promise<wasm.DataContract | undefined>
Example
Get Data Contract History
Retrieve the version history for a data contract.
getHistory(query: wasm.DataContractHistoryQuery): Promise<Map<bigint, wasm.DataContract>>
Parameters
Data contract identifier.
number
Optional
Maximum number of entries to return.
number
Optional
Millisecond timestamp (inclusive) to start from.
Returns
Promise<Map<bigint, wasm.DataContract>>
Example
Get Data Contracts
Fetch multiple data contracts by their identifiers.
getMany(contractIds: wasm.IdentifierLikeArray): Promise<Map<string, wasm.DataContract | undefined>>
Parameters
Returns
Promise<Map<string, wasm.DataContract | undefined>>
Example
Document Queries
Get Documents
Query documents from a data contract using optional filters.
query(query: wasm.DocumentsQuery): Promise<Map<string, wasm.Document | undefined>>
Parameters
Data contract identifier.
string
Required
Document type name.
Optional filter clauses expressed as [field, operator, value].
Optional sorting clauses expressed as [field, direction].
number
Optional
Maximum number of documents to return.
Exclusive document ID to resume from.
Inclusive document ID to start from.
string[]
Optional
Count-query knob: SQL-shaped `GROUP BY` field list. Mirrors the v1 wire's `group_by: repeated string` directly. Ignored by the regular document-fetch path. - `[]` or omitted → aggregate count (a single row). - `["<in_field>"]` where `<in_field>` matches an `In` constraint → per-`In`-value entries (PerInValue). - `["<range_field>"]` where `<range_field>` matches a range constraint → per-distinct-value entries within the range (RangeDistinct). - `["<in_field>", "<range_field>"]` for compound `In + range` queries → compound distinct entries. Entry direction comes from the first `orderBy` clause's direction (which also drives walk order on the materialize + prove path); set `orderBy: [["<range_field>", "asc"|"desc"]]` alongside `groupBy: ["<range_field>"]` to control sort.
Returns
Promise<Map<string, wasm.Document | undefined>>
Example
Get Document
Fetch a specific document by ID.
get(contractId: wasm.IdentifierLike, type: string, documentId: wasm.IdentifierLike): Promise<wasm.Document | undefined>
Parameters
string
Required
Returns
Promise<wasm.Document | undefined>
Example
DPNS Queries
Get Primary Username
Fetch the primary DPNS username for an identity.
username(identityId: wasm.IdentifierLike): Promise<string | undefined>
Parameters
Returns
Promise<string | undefined>
Example
List Usernames for Identity
Fetch all DPNS usernames owned by an identity.
usernames(query: wasm.DpnsUsernamesQuery): Promise<string[]>
Parameters
Identity to fetch usernames for.
number
Optional
Maximum number of usernames to return. Use 0 for default.
Returns
Promise<string[]>
Example
Get Username by Name
Fetch DPNS username details by full name.
getUsernameByName(username: string): Promise<wasm.DpnsUsernameInfo | undefined>
Parameters
string
Required
Returns
Promise<wasm.DpnsUsernameInfo | undefined>
Example
Resolve DPNS Name
Resolve a DPNS name to its identity information.
resolveName(name: string): Promise<string | undefined>
Parameters
string
Required
Returns
Promise<string | undefined>
Example
Check DPNS Availability
Check if a DPNS label is available for registration.
isNameAvailable(label: string): Promise<boolean>
Parameters
string
Required
Returns
Promise<boolean>
Example
Convert to Homograph Safe
Convert a label to its homograph-safe representation.
convertToHomographSafe(input: string): Promise<string>
Parameters
string
Required
Returns
Promise<string>
Example
Validate Username
Validate whether a label conforms to DPNS username rules.
isValidUsername(label: string): Promise<boolean>
Parameters
string
Required
Returns
Promise<boolean>
Example
Is Contested Username
Check if a label is currently part of a contested DPNS registration.
isContestedUsername(label: string): Promise<boolean>
Parameters
string
Required
Returns
Promise<boolean>
Example
Voting & Contested Resources
Get Contested Resources
List contested resources for a document type and index.
contestedResources(query: wasm.VotePollsByDocumentTypeQuery): Promise<any[]>
Parameters
Data contract identifier.
string
Required
Document type to query.
string
Required
Index name to query.
unknown[]
Optional
Optional lower bound for index range, commonly an array of composite values.
unknown[]
Optional
Optional upper bound for index range, commonly an array of composite values.
unknown
Optional
Cursor value to resume iteration from. Provide a JS value matching the index schema (e.g., string, number, array).
boolean
Optional
Whether to include `startAtValue` in the result set.
number
Optional
Maximum number of records to return.
boolean
Optional
Sort order. When omitted, the query defaults to ascending order.
Returns
Promise<any[]>
Example
Get Contested Resource Vote State
Retrieve vote tallies for a contested resource.
contestedResourceVoteState(query: wasm.ContestedResourceVoteStateQuery): Promise<wasm.ContestedResourceVoteState>
Parameters
Data contract identifier.
string
Required
Contested document type name.
string
Required
Index name to query.
unknown[]
Optional
Optional index values used as query parameters.
'documents' | 'voteTally' | 'documentsAndVoteTally'
Optional
Result projection type.
number
Optional
Maximum number of records to return.
Contender identifier to resume from (exclusive by default).
boolean
Optional
Include the start contender when true.
boolean
Optional
Include locked and abstaining tallies when true.
Returns
Promise<wasm.ContestedResourceVoteState>
Example
Get Voters for Identity
List voters that voted for a specific identity in a contested resource.
contestedResourceVotersForIdentity(query: wasm.ContestedResourceVotersForIdentityQuery): Promise<wasm.Identifier[]>
Parameters
Data contract identifier.
string
Required
Contested document type name.
string
Required
Index name used to locate the contested resource.
unknown[]
Optional
Optional index values used as query arguments.
Contested identity identifier.
number
Optional
Maximum number of voters to return.
Voter identifier to resume from (exclusive by default).
boolean
Optional
Include the `startAtVoterId` when true.
boolean
Optional
Sort order. When omitted, defaults to ascending.
Returns
Promise<wasm.Identifier[]>
Example
Get Identity Votes
Fetch contested resource votes submitted by a particular identity.
contestedResourceIdentityVotes(query: wasm.ContestedResourceIdentityVotesQuery): Promise<Map<string, wasm.ResourceVote>>
Parameters
Identity identifier.
number
Optional
Maximum number of votes to return.
Vote identifier to resume from (exclusive by default).
boolean
Optional
Include the `startAtVoteId` when true.
boolean
Optional
Sort order. When omitted, defaults to ascending.
Returns
Promise<Map<string, wasm.ResourceVote>>
Example
Get Vote Polls by End Date
Fetch vote polls filtered by end time using millisecond timestamps.
votePollsByEndDate(query?: wasm.VotePollsByEndDateQuery): Promise<wasm.VotePollsByEndDateEntry[]>
Parameters
number
Optional
Starting timestamp (milliseconds) to filter polls.
boolean
Optional
Include the `startTimeMs` boundary when true.
number
Optional
Ending timestamp (milliseconds) to filter polls.
boolean
Optional
Include the `endTimeMs` boundary when true.
number
Optional
Maximum number of buckets to return.
number
Optional
Offset into the paginated result set.
boolean
Optional
Sort order for timestamps; ascending by default.
Returns
Promise<wasm.VotePollsByEndDateEntry[]>
Example
Protocol & Version
Get Protocol Version Upgrade State
Retrieve protocol upgrade vote tallies.
versionUpgradeState(): Promise<wasm.ProtocolVersionUpgradeState>
Parameters
No parameters required
Returns
Promise<wasm.ProtocolVersionUpgradeState>
Example
Get Protocol Version Vote Status
Fetch voting status for masternodes on protocol upgrades.
versionUpgradeVoteStatus(startProTxHash: wasm.ProTxHashLike | undefined, count: number): Promise<Map<string, wasm.ProtocolVersionUpgradeVoteStatus>>
Returns
Promise<Map<string, wasm.ProtocolVersionUpgradeVoteStatus>>
Example
Epoch & Block Queries
Get Epochs Info
Retrieve summary information for one or more epochs.
epochsInfo(query?: EpochsQuery): Promise<Map<number, wasm.ExtendedEpochInfo | undefined>>
Parameters
number
Optional
Starting epoch index.
number
Optional
Maximum number of epochs to return.
boolean
Optional
Sort order for returned epochs.
Returns
Promise<Map<number, wasm.ExtendedEpochInfo | undefined>>
Example
Get Current Epoch
Fetch the current platform epoch.
current(): Promise<wasm.ExtendedEpochInfo>
Parameters
No parameters required
Returns
Promise<wasm.ExtendedEpochInfo>
Example
Get Finalized Epoch Infos
Retrieve finalized epoch information for a range.
finalizedInfos(query: FinalizedEpochsQuery): Promise<Map<number, wasm.FinalizedEpochInfo | undefined>>
Parameters
number
Required
Starting epoch index (required).
number
Optional
Maximum number of epochs to return.
boolean
Optional
Sort order for returned epochs.
Returns
Promise<Map<number, wasm.FinalizedEpochInfo | undefined>>
Example
Get Epoch Blocks by Evonode IDs
Fetch proposed blocks for specific evonode ProTx hashes.
evonodesProposedBlocksByIds(epoch: number, ids: wasm.ProTxHashLikeArray): Promise<Map<string, bigint>>
Returns
Promise<Map<string, bigint>>
Example
Get Epoch Blocks by Range
Fetch proposed blocks in range order.
evonodesProposedBlocksByRange(query: EvonodeProposedBlocksRangeQuery): Promise<Map<string, bigint>>
Parameters
number
Required
Epoch index to query.
number
Optional
Maximum number of items to return.
ProTxHash to resume from (exclusive by default).
Returns
Promise<Map<string, bigint>>
Example
Token Queries
Calculate Token ID
Calculate a token ID from a contract ID and token position. This is a utility method that does not require network connection.
calculateId(contractId: wasm.IdentifierLike, tokenPosition: number): Promise<string>
Returns
Promise<string>
Example
Get Token Statuses
Retrieve status information for one or more tokens.
statuses(tokenIds: wasm.IdentifierLikeArray): Promise<Map<string, wasm.TokenStatus>>
Parameters
Returns
Promise<Map<string, wasm.TokenStatus>>
Example
Get Direct Purchase Prices
Fetch direct purchase prices for tokens.
directPurchasePrices(tokenIds: wasm.IdentifierLikeArray): Promise<Map<string, wasm.TokenPriceInfo>>
Parameters
Returns
Promise<Map<string, wasm.TokenPriceInfo>>
Example
Get Token Contract Info
Retrieve metadata for a token contract.
contractInfo(tokenId: wasm.IdentifierLike): Promise<wasm.TokenContractInfo | undefined>
Parameters
Returns
Promise<wasm.TokenContractInfo | undefined>
Example
Get Token Distribution Last Claim
Fetch the last perpetual distribution claim for an identity and token.
perpetualDistributionLastClaim(identityId: wasm.IdentifierLike, tokenId: wasm.IdentifierLike): Promise<wasm.RewardDistributionMoment | undefined>
Returns
Promise<wasm.RewardDistributionMoment | undefined>
Example
Get Token Total Supply
Fetch the total supply for a token.
totalSupply(tokenId: wasm.IdentifierLike): Promise<wasm.TokenTotalSupply | undefined>
Parameters
Returns
Promise<wasm.TokenTotalSupply | undefined>
Example
Get Token Price by Contract
Retrieve the price details for a token indexed by contract position.
priceByContract(contractId: wasm.IdentifierLike, tokenPosition: number): Promise<wasm.TokenPriceInfo>
Returns
Promise<wasm.TokenPriceInfo>
Example
Group Queries
Get Group Info
Fetch metadata for a specific group contract position.
info(contractId: wasm.IdentifierLike, groupContractPosition: number): Promise<wasm.Group | undefined>
Returns
Promise<wasm.Group | undefined>
Example
List Group Infos
List group information entries for a contract.
infos(query: wasm.GroupInfosQuery): Promise<Map<number, wasm.Group | undefined>>
Parameters
Data contract identifier.
Cursor describing where to resume from.
number
Optional
Maximum number of groups to return.
Returns
Promise<Map<number, wasm.Group | undefined>>
Example
Get Group Members
Retrieve member entries for a group.
members(query: wasm.GroupMembersQuery): Promise<Map<string, bigint>>
Parameters
Data contract identifier.
number
Required
Group position inside the contract.
Optional list of member IDs to retrieve. When provided, pagination options are ignored.
Member identifier to resume from.
number
Optional
Maximum number of members to return when not requesting specific IDs.
Returns
Promise<Map<string, bigint>>
Example
Get Group Actions
Fetch actions associated with a group.
actions(query: wasm.GroupActionsQuery): Promise<Map<string, wasm.GroupAction | undefined>>
Parameters
Data contract identifier.
number
Required
Position of the group within the contract.
Filter actions by status.
Cursor describing where to resume from.
number
Optional
Maximum number of actions to return.
Returns
Promise<Map<string, wasm.GroupAction | undefined>>
Example
Get Group Action Signers
List signers for a specific group action.
actionSigners(query: wasm.GroupActionSignersQuery): Promise<Map<string, bigint>>
Parameters
Data contract identifier.
number
Required
Position of the group within the contract.
Action status filter.
Group action identifier.
Returns
Promise<Map<string, bigint>>
Example
Get Identity Groups
Fetch group memberships for an identity.
identityGroups(query: wasm.IdentityGroupsQuery): Promise<wasm.IdentityGroupInfo[]>
Parameters
Identity identifier.
Data contracts where the identity participates as a member.
Data contracts where the identity participates as an owner. (Currently not implemented server-side.)
Data contracts where the identity participates as a moderator. (Currently not implemented server-side.)
Returns
Promise<wasm.IdentityGroupInfo[]>
Example
Get Groups Data Contracts
Fetch group configuration documents for the supplied data contracts.
groupsDataContracts(dataContractIds: wasm.IdentifierLikeArray): Promise<Map<string, Map<number, wasm.Group | undefined>>>
Parameters
Returns
Promise<Map<string, Map<number, wasm.Group | undefined>>>
Example
System & Utility
Get Platform Status
Retrieve basic platform status information.
status(): Promise<wasm.StatusResponse>
Parameters
No parameters required
Returns
Promise<wasm.StatusResponse>
Example
Get Current Quorums Info
Fetch details about currently active quorums.
currentQuorumsInfo(): Promise<wasm.CurrentQuorumsInfo>
Parameters
No parameters required
Returns
Promise<wasm.CurrentQuorumsInfo>
Example
Get Prefunded Specialized Balance
Retrieve a prefunded specialized balance entry.
prefundedSpecializedBalance(identityId: wasm.IdentifierLike): Promise<wasm.PrefundedSpecializedBalance>
Parameters
Returns
Promise<wasm.PrefundedSpecializedBalance>
Example
Get Total Credits in Platform
Fetch the total credit balance stored in the platform.
totalCreditsInPlatform(): Promise<bigint>
Parameters
No parameters required
Returns
Promise<bigint>
Example
Get Path Elements
Access items in the GroveDB state tree by specifying a path and keys.
pathElements(path: wasm.GrovePathSegment[], keys: wasm.GrovePathSegment[]): Promise<wasm.PathElement[]>
Returns
Promise<wasm.PathElement[]>
Example
Wait for State Transition Result
Wait for a state transition to be processed and return the result.
waitForStateTransitionResult(stateTransitionHash: string): Promise<wasm.StateTransitionResult>
Parameters
string
Required
Returns
Promise<wasm.StateTransitionResult>
Example
Platform Address Queries
Get Platform Address
Fetch information about a Platform address including its nonce and balance.
get(address: wasm.PlatformAddressLike): Promise<wasm.PlatformAddressInfo | undefined>
Parameters
- The platform address to query (PlatformAddress, Uint8Array, or bech32m string)
Returns
Promise<wasm.PlatformAddressInfo | undefined>
Example
Get Multiple Platform Addresses
Fetch information about multiple Platform addresses.
getMany(addresses: wasm.PlatformAddressLikeArray): Promise<Map<string, wasm.PlatformAddressInfo | undefined>>
Parameters
- Array of platform addresses to query
Returns
Promise<Map<string, wasm.PlatformAddressInfo | undefined>>
Example
State Transitions
Evo SDK v4 state transitions accept constructed payload objects plus the appropriate public key and signer object. Build an IdentitySigner with addKeyFromWif; do not pass a WIF string directly in a transition call. Identity creation and asset-lock top ups instead take typed AssetLockProof and PrivateKey objects.
Identity Transitions
Identity Create
Create a new identity with initial credits
create(options: wasm.IdentityCreateOptions): Promise<void>
Parameters
The identity to create (with public keys set up). Use Identity.create() to build the identity structure first.
Asset lock proof from the Core chain. Use AssetLockProof.createInstantAssetLockProof() or AssetLockProof.createChainAssetLockProof().
Private key for signing the asset lock proof. This is the private key that controls the asset lock output.
Signer containing private keys for the identity's public keys. Use IdentitySigner to add keys for signing identity key proofs.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<void>
Example
Identity Top Up
Add credits to an existing identity
topUp(options: wasm.IdentityTopUpOptions): Promise<bigint>
Parameters
The identity to top up.
Asset lock proof from the Core chain. Use AssetLockProof.createInstantAssetLockProof() or AssetLockProof.createChainAssetLockProof().
Private key for signing the asset lock proof. This is the private key that controls the asset lock output.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<bigint>
Example
Identity Update
Update identity keys (add or disable)
update(options: wasm.IdentityUpdateOptions): Promise<void>
Parameters
The identity to update.
Array of public keys to add to the identity. Use IdentityPublicKeyInCreation to create new keys.
number[]
Optional
Array of key IDs to disable. Cannot disable master, critical auth, or transfer keys.
Signer containing the private key for the identity's master key. Use IdentitySigner to add the master key before calling.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<void>
Example
Identity Credit Transfer
Transfer credits between identities
creditTransfer(options: wasm.IdentityCreditTransferOptions): Promise<wasm.IdentityCreditTransferResult>
Parameters
The sender identity.
The identity ID of the recipient.
bigint
Required
The amount of credits to transfer.
Signer containing the private key for the sender's transfer key. Use IdentitySigner to add the transfer key before calling.
Optional identity public key to use for signing. If not provided, auto-selects an available transfer key.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<wasm.IdentityCreditTransferResult>
Example
Identity Credit Withdrawal
Withdraw credits from identity to Dash address
creditWithdrawal(options: wasm.IdentityCreditWithdrawalOptions): Promise<bigint>
Parameters
The identity to withdraw from.
bigint
Required
The amount of credits to withdraw.
string
Optional
Optional Dash address to send the withdrawn credits to.
number
Optional
Core (L1) fee per byte for the withdrawal transaction. This determines the mining fee for the Core blockchain transaction.
Signer containing the private key for the identity's transfer/owner key. Use IdentitySigner to add the key before calling.
Optional identity public key to use for signing. If not provided, auto-selects a matching transfer or owner key.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<bigint>
Example
Data Contract Transitions
Data Contract Create
Create a new data contract
publish(options: wasm.ContractPublishOptions): Promise<wasm.DataContract>
Parameters
The data contract to create. Use `new DataContract(...)` or `DataContract.fromJSON(...)` to construct it.
The identity public key to use for signing the transition. Get this from the owner identity's public keys.
Signer containing the private key that corresponds to the identity key. Use IdentitySigner to add the private key before calling.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<wasm.DataContract>
Example
Data Contract Update
Add document types, groups, or tokens to an existing data contract
update(options: wasm.ContractUpdateOptions): Promise<void>
Parameters
The updated data contract. Use the existing contract and modify it, or create a new one with `DataContract.fromJSON(...)`. Version must be incremented.
The identity public key to use for signing the transition. Get this from the owner identity's public keys.
Signer containing the private key that corresponds to the identity key. Use IdentitySigner to add the private key before calling.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<void>
Example
Document Transitions
Document Create
Create a new document
create(options: wasm.DocumentCreateOptions): Promise<void>
Parameters
The document to create. Use `new Document(...)` or `Document.fromJSON(...)` to construct it. Must include dataContractId, documentTypeName, ownerId, and entropy.
The identity public key to use for signing the transition. Get this from the owner identity's public keys.
Signer containing the private key that corresponds to the identity key. Use IdentitySigner to add the private key before calling.
Optional token payment agreement for document types with tokenCost.create.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<void>
Example
Document Replace
Replace an existing document
replace(options: wasm.DocumentReplaceOptions): Promise<void>
Parameters
The document with updated data. Must have the same ID as the existing document. Revision should be set to current revision + 1.
The identity public key to use for signing the transition. Get this from the owner identity's public keys.
Signer containing the private key that corresponds to the identity key. Use IdentitySigner to add the private key before calling.
Optional token payment agreement for document types with tokenCost.replace.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<void>
Example
Document Delete
Delete an existing document
delete(options: wasm.DocumentDeleteOptions): Promise<void>
Parameters
Document | { id: IdentifierLike; ownerId: IdentifierLike; dataContractId: IdentifierLike; documentTypeName: string; }
Required
The document to delete - either a Document instance or an object with identifiers.
The identity public key to use for signing the transition. Get this from the owner identity's public keys.
Signer containing the private key that corresponds to the identity key. Use IdentitySigner to add the private key before calling.
Optional token payment agreement for document types with tokenCost.delete.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<void>
Example
Document Transfer
Transfer document ownership
transfer(options: wasm.DocumentTransferOptions): Promise<void>
Parameters
The document to transfer. Must include id, ownerId, dataContractId, documentTypeName, and revision.
The new owner's identity ID.
The identity public key to use for signing the transition. Get this from the owner identity's public keys.
Signer containing the private key that corresponds to the identity key. Use IdentitySigner to add the private key before calling.
Optional token payment agreement for document types with tokenCost.transfer.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<void>
Example
Document Purchase
Purchase a document
purchase(options: wasm.DocumentPurchaseOptions): Promise<void>
Parameters
The document to purchase. Must include id, ownerId, dataContractId, documentTypeName, and revision.
The buyer's identity ID.
bigint
Required
The purchase price in credits. Must match the document's listed price.
The public key to use for signing the transition. Get this from the buyer identity's public keys.
Signer containing the private key that corresponds to the identity key. Use IdentitySigner to add the private key before calling.
Optional token payment agreement for document types with tokenCost.purchase.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<void>
Example
Document Set Price
Set or update document price
setPrice(options: wasm.DocumentSetPriceOptions): Promise<void>
Parameters
The document to set a price on. Must include id, ownerId, dataContractId, documentTypeName, and revision.
bigint
Required
The price in credits. Set to 0 to remove the price and make the document not for sale.
The identity public key to use for signing the transition. Get this from the owner identity's public keys.
Signer containing the private key that corresponds to the identity key. Use IdentitySigner to add the private key before calling.
Optional token payment agreement for document types with tokenCost.update_price.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<void>
Example
DPNS Register Name
Register a new DPNS username
Disabled: Typed v4 preorder and registration flow is not covered by a usable credential fixture.
registerName(options: wasm.DpnsRegisterNameOptions): Promise<wasm.RegisterDpnsNameResult>
Parameters
string
Required
The username label to register (without the .dash suffix). Must be a valid DPNS username (3-63 characters, alphanumeric and hyphens).
The identity that will own the username. Fetch the identity first using `getIdentity()`.
The identity public key to use for signing the transition. Get this from the identity's public keys.
Signer containing the private key that corresponds to the identity key. Use IdentitySigner to add the private key before calling.
Optional callback called after the preorder document is submitted. Receives the preorder Document object.
Returns
Promise<wasm.RegisterDpnsNameResult>
Example
Token Transitions
Token Burn
Burn tokens
burn(options: wasm.TokenBurnOptions): Promise<wasm.TokenBurnResult>
Parameters
The ID of the data contract containing the token.
number
Required
The position of the token in the contract (0-indexed).
bigint
Required
The amount of tokens to burn.
The identity ID of the token holder burning tokens.
string
Optional
Optional public note for the burn operation.
The identity public key to use for signing the transition.
Signer containing the private key that corresponds to the identity key. Use IdentitySigner to add the private key before calling.
Optional group action info for group-managed token burning. Use GroupStateTransitionInfoStatus.proposer() to propose a new group action, or GroupStateTransitionInfoStatus.otherSigner() to vote on an existing action.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<wasm.TokenBurnResult>
Example
Token Mint
Mint new tokens
mint(options: wasm.TokenMintOptions): Promise<wasm.TokenMintResult>
Parameters
The ID of the data contract containing the token.
number
Required
The position of the token in the contract (0-indexed).
bigint
Required
The amount of tokens to mint.
The identity ID of the minter.
Optional recipient identity ID. If not provided, mints to the minter's identity.
string
Optional
Optional public note for the mint operation.
The identity public key to use for signing the transition. Get this from the minter identity's public keys.
Signer containing the private key that corresponds to the identity key. Use IdentitySigner to add the private key before calling.
Optional group action info for group-managed token minting. Use GroupStateTransitionInfoStatus.proposer() to propose a new group action, or GroupStateTransitionInfoStatus.otherSigner() to vote on an existing action.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<wasm.TokenMintResult>
Example
Token Claim
Claim tokens from a distribution
claim(options: wasm.TokenClaimOptions): Promise<wasm.TokenClaimResult>
Parameters
The ID of the data contract containing the token.
number
Required
The position of the token in the contract (0-indexed).
The identity ID claiming the tokens.
"preProgrammed" | "perpetual"
Required
The type of distribution to claim from: "preProgrammed" or "perpetual".
string
Optional
Optional public note for the claim operation.
The identity public key to use for signing the transition.
Signer containing the private key that corresponds to the identity key. Use IdentitySigner to add the private key before calling.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<wasm.TokenClaimResult>
Example
Token Set Price
Set or update the price for direct token purchases
setPrice(options: wasm.TokenSetPriceOptions): Promise<wasm.TokenSetPriceResult>
Parameters
The ID of the data contract containing the token.
number
Required
The position of the token in the contract (0-indexed).
The identity ID of the token authority setting the price.
bigint | null
Optional
The flat price in credits for one token (SinglePrice schedule). Set to null to disable direct purchases. Mutually exclusive with `priceTiers`.
Record<string, bigint>
Optional
Tiered direct-purchase pricing (SetPrices schedule). Maps the minimum bulk-buy amount (token amount, as a string key) to the per-token price in credits for that tier. Keys are unsigned integers encoded as strings; values are credit amounts as bigint. Example: `{ "1": 1_000n, "100": 900n, "1000": 800n }` charges 1000 credits/token for purchases of 1+, 900 for purchases of 100+, and 800 for purchases of 1000+. Mutually exclusive with `price`. Must contain at least one entry.
string
Optional
Optional public note for the price change.
The identity public key to use for signing the transition.
Signer containing the private key for the authority's authentication key. Use IdentitySigner to add the authentication key before calling.
Optional group action info for group-managed price changes. Use GroupStateTransitionInfoStatus.proposer() to propose a new group action, or GroupStateTransitionInfoStatus.otherSigner() to vote on an existing action.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<wasm.TokenSetPriceResult>
Example
Token Direct Purchase
Purchase tokens directly at the configured price
directPurchase(options: wasm.TokenDirectPurchaseOptions): Promise<wasm.TokenDirectPurchaseResult>
Parameters
The ID of the data contract containing the token.
number
Required
The position of the token in the contract (0-indexed).
The identity ID purchasing the tokens.
bigint
Required
The amount of tokens to purchase.
bigint
Required
The maximum total credits the buyer is willing to pay. The actual cost may be less if the token price is lower.
The identity public key to use for signing the transition.
Signer containing the private key for the buyer's authentication key. Use IdentitySigner to add the authentication key before calling.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<wasm.TokenDirectPurchaseResult>
Example
Token Emergency Action
Perform an emergency action on a token
emergencyAction(options: wasm.TokenEmergencyActionOptions): Promise<wasm.TokenEmergencyActionResult>
Parameters
The ID of the data contract containing the token.
number
Required
The position of the token in the contract (0-indexed).
The identity ID of the token authority performing the action.
"pause" | "resume"
Required
The emergency action to perform: "pause" or "resume".
string
Optional
Optional public note for the emergency action.
The identity public key to use for signing the transition.
Signer containing the private key for the authority's authentication key. Use IdentitySigner to add the authentication key before calling.
Optional group action info for group-managed emergency actions. Use GroupStateTransitionInfoStatus.proposer() to propose a new group action, or GroupStateTransitionInfoStatus.otherSigner() to vote on an existing action.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<wasm.TokenEmergencyActionResult>
Example
Token Transfer
Transfer tokens between identities
transfer(options: wasm.TokenTransferOptions): Promise<wasm.TokenTransferResult>
Parameters
The ID of the data contract containing the token.
number
Required
The position of the token in the contract (0-indexed).
bigint
Required
The amount of tokens to transfer.
The sender's identity ID.
The recipient's identity ID.
string
Optional
Optional public note for the transfer.
The identity public key to use for signing the transition.
Signer containing the private key for the sender's authentication key. Use IdentitySigner to add the authentication key before calling.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<wasm.TokenTransferResult>
Example
Token Freeze
Freeze tokens for a specific identity
freeze(options: wasm.TokenFreezeOptions): Promise<wasm.TokenFreezeResult>
Parameters
The ID of the data contract containing the token.
number
Required
The position of the token in the contract (0-indexed).
The identity ID of the token authority performing the freeze.
The identity ID to freeze.
string
Optional
Optional public note for the freeze operation.
The identity public key to use for signing the transition.
Signer containing the private key for the authority's authentication key. Use IdentitySigner to add the authentication key before calling.
Optional group action info for group-managed token freezing. Use GroupStateTransitionInfoStatus.proposer() to propose a new group action, or GroupStateTransitionInfoStatus.otherSigner() to vote on an existing action.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<wasm.TokenFreezeResult>
Example
Token Unfreeze
Unfreeze tokens for a specific identity
unfreeze(options: wasm.TokenUnfreezeOptions): Promise<wasm.TokenUnfreezeResult>
Parameters
The ID of the data contract containing the token.
number
Required
The position of the token in the contract (0-indexed).
The identity ID of the token authority performing the unfreeze.
The identity ID to unfreeze.
string
Optional
Optional public note for the unfreeze operation.
The identity public key to use for signing the transition.
Signer containing the private key for the authority's authentication key. Use IdentitySigner to add the authentication key before calling.
Optional group action info for group-managed token unfreezing. Use GroupStateTransitionInfoStatus.proposer() to propose a new group action, or GroupStateTransitionInfoStatus.otherSigner() to vote on an existing action.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<wasm.TokenUnfreezeResult>
Example
Token Destroy Frozen
Destroy frozen tokens
destroyFrozen(options: wasm.TokenDestroyFrozenOptions): Promise<wasm.TokenDestroyFrozenResult>
Parameters
The ID of the data contract containing the token.
number
Required
The position of the token in the contract (0-indexed).
The identity ID of the token authority performing the destruction.
The frozen identity ID whose tokens will be destroyed.
string
Optional
Optional public note for the destruction operation.
The identity public key to use for signing the transition.
Signer containing the private key for the authority's authentication key. Use IdentitySigner to add the authentication key before calling.
Optional group action info for group-managed token destruction. Use GroupStateTransitionInfoStatus.proposer() to propose a new group action, or GroupStateTransitionInfoStatus.otherSigner() to vote on an existing action.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<wasm.TokenDestroyFrozenResult>
Example
Voting Transitions
DPNS Username
Cast a vote for a contested DPNS username
Disabled: Typed v4 masternode voting flow is not covered by a usable voting-key fixture.
masternodeVote(options: wasm.MasternodeVoteOptions): Promise<void>
Parameters
The ProTxHash of the masternode.
The vote poll to vote on. Use VotePoll.createContestedDocumentResourceVotePoll() to create.
The vote choice. Use ResourceVoteChoice.towardsIdentity(), ResourceVoteChoice.abstain(), or ResourceVoteChoice.lock().
The masternode's voting public key. This should be the voting key associated with the masternode.
Signer containing the private key for the masternode's voting key. Use IdentitySigner to add the voting key before calling.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<void>
Example
Contested Resource
Cast a vote for contested resources as a masternode
Disabled: Typed v4 masternode voting flow is not covered by a usable voting-key fixture.
masternodeVote(options: wasm.MasternodeVoteOptions): Promise<void>
Parameters
The ProTxHash of the masternode.
The vote poll to vote on. Use VotePoll.createContestedDocumentResourceVotePoll() to create.
The vote choice. Use ResourceVoteChoice.towardsIdentity(), ResourceVoteChoice.abstain(), or ResourceVoteChoice.lock().
The masternode's voting public key. This should be the voting key associated with the masternode.
Signer containing the private key for the masternode's voting key. Use IdentitySigner to add the voting key before calling.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<void>
Example
Platform Address Transitions
Address Transfer
Transfer credits between Platform addresses
transfer(options: wasm.AddressFundsTransferOptions): Promise<Map<string, wasm.PlatformAddressInfo>>
Parameters
- Transfer options including inputs, outputs, and signer
Array of input addresses with amounts to spend. Use PlatformAddressInput for typed inputs (nonces fetched automatically).
Array of output addresses with amounts to receive. Use PlatformAddressOutput for typed outputs.
Signer containing private keys for all input addresses. Use PlatformAddressSigner to add keys before calling transfer.
Fee strategy defining how transaction fees are paid. Array of FeeStrategyStep, each specifying to deduct from an input or reduce an output.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<Map<string, wasm.PlatformAddressInfo>>
Example
Top Up Identity from Address
Top up an identity using Platform address credits
topUpIdentity(options: wasm.IdentityTopUpFromAddressesOptions): Promise<wasm.IdentityTopUpFromAddressesResult>
Parameters
- Top up options including identity ID, inputs, and signer
The identity to top up.
Array of input addresses with amounts to use for top up. Use PlatformAddressInput for typed inputs (nonces fetched automatically).
Signer containing private keys for all input addresses. Use PlatformAddressSigner to add keys before calling top up.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<wasm.IdentityTopUpFromAddressesResult>
Example
Withdraw to Core
Withdraw Platform address credits to Dash Core
withdraw(options: wasm.AddressFundsWithdrawOptions): Promise<Map<string, wasm.PlatformAddressInfo>>
Parameters
- Withdrawal options including inputs, output script, pooling, and signer
Array of input addresses with amounts to withdraw. Use PlatformAddressInput for typed inputs (nonces fetched automatically).
Optional change output address and amount. If provided, specifies where to send any change from the withdrawal.
Fee strategy defining how transaction fees are paid. Array of FeeStrategyStep, each specifying to deduct from an input or reduce an output.
number
Required
Core (L1) fee per byte for the withdrawal transaction. This determines the mining fee for the Core blockchain transaction.
Pooling strategy for the withdrawal. - Pooling.Never: Create individual withdrawal transaction - Pooling.IfAvailable: Join pool if available, otherwise individual - Pooling.Standard: Wait to join pool (may take longer)
Core output script specifying the L1 destination address. Use CoreScript.newP2PKH() or CoreScript.newP2SH() to create.
Signer containing private keys for all input addresses. Use PlatformAddressSigner to add keys before calling withdraw.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<Map<string, wasm.PlatformAddressInfo>>
Example
Transfer from Identity to Address
Transfer credits from an identity to Platform addresses
transferFromIdentity(options: wasm.IdentityTransferToAddressesOptions): Promise<wasm.IdentityTransferToAddressesResult>
Parameters
- Transfer options including identity ID, outputs, and signer
The identity to transfer credits from.
Array of output addresses with amounts to receive. Use PlatformAddressOutput for typed outputs.
Signer containing the private key(s) for signing with identity transfer key(s). Use IdentitySigner to add keys before calling transfer.
number
Optional
Optional key ID to use for signing. If not specified, will auto-select a matching transfer key.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<wasm.IdentityTransferToAddressesResult>
Example
Fund Address from Asset Lock
Fund Platform addresses from an asset lock
fundFromAssetLock(options: wasm.AddressFundingFromAssetLockOptions): Promise<Map<string, wasm.PlatformAddressInfo>>
Parameters
- Funding options including asset lock proof, outputs, and signer
Asset lock proof from the Core chain. Use AssetLockProof.createInstantAssetLockProof() or AssetLockProof.createChainAssetLockProof().
Private key for signing the asset lock proof. This is the private key that controls the asset lock output.
Array of output addresses with amounts to fund. Use PlatformAddressOutput for typed outputs.
Signer containing private keys for all output addresses. Use PlatformAddressSigner to add keys before calling fund.
Fee strategy defining how transaction fees are paid. Array of FeeStrategyStep, each specifying to deduct from an input or reduce an output.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<Map<string, wasm.PlatformAddressInfo>>
Example
Create Identity from Address
Create a new identity funded from Platform addresses
createIdentity(options: wasm.IdentityCreateFromAddressesOptions): Promise<wasm.IdentityCreateFromAddressesResult>
Parameters
- Creation options including identity, inputs, and signers
The identity to create (with public keys set up). Use Identity.create() to build the identity structure first.
Array of input addresses with amounts to use for funding. Use PlatformAddressInput for typed inputs (nonces fetched automatically).
Optional change output address and amount. If provided, remaining credits will be sent to this address.
Signer containing private keys for the identity's public keys. Use IdentitySigner to add keys for signing identity key proofs.
Signer containing private keys for all input addresses. Use PlatformAddressSigner to add keys for signing address inputs.
Optional settings for the broadcast operation. Includes retries, timeouts, userFeeIncrease, etc.
Returns
Promise<wasm.IdentityCreateFromAddressesResult>