Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 4 additions & 13 deletions packages/wasm-sdk/src/dpns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,10 +455,7 @@ impl WasmSdk {
}
}

#[wasm_bindgen(
js_name = "getDpnsUsernameByNameWithProofInfo",
unchecked_return_type = "ProofMetadataResponseTyped<DpnsUsernameInfo | undefined>"
)]
#[wasm_bindgen(js_name = "getDpnsUsernameByNameWithProofInfo")]
pub async fn get_dpns_username_by_name_with_proof_info(
&self,
username: &str,
Expand Down Expand Up @@ -511,7 +508,7 @@ impl WasmSdk {
Ok(response)
}

#[wasm_bindgen(js_name = "getDpnsUsernames", unchecked_return_type = "Array<string>")]
#[wasm_bindgen(js_name = "getDpnsUsernames")]
pub async fn get_dpns_usernames(
&self,
query: DpnsUsernamesQueryJs,
Expand Down Expand Up @@ -543,10 +540,7 @@ impl WasmSdk {
.ok_or_else(|| WasmSdkError::generic("DPNS username is not a string"))
}

#[wasm_bindgen(
js_name = "getDpnsUsernamesWithProofInfo",
unchecked_return_type = "ProofMetadataResponseTyped<Array<string>>"
)]
#[wasm_bindgen(js_name = "getDpnsUsernamesWithProofInfo")]
pub async fn get_dpns_usernames_with_proof_info(
&self,
query: DpnsUsernamesQueryJs,
Expand All @@ -556,10 +550,7 @@ impl WasmSdk {
.await
}

#[wasm_bindgen(
js_name = "getDpnsUsernameWithProofInfo",
unchecked_return_type = "ProofMetadataResponseTyped<string | undefined>"
)]
#[wasm_bindgen(js_name = "getDpnsUsernameWithProofInfo")]
pub async fn get_dpns_username_with_proof_info(
&self,
#[wasm_bindgen(js_name = "identityId")] identity_id: IdentifierLikeJs,
Expand Down
15 changes: 3 additions & 12 deletions packages/wasm-sdk/src/queries/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,7 @@ impl WasmSdk {
///
/// @param address - The platform address to query (PlatformAddress, Uint8Array, or bech32m string)
/// @returns ProofMetadataResponse containing PlatformAddressInfo with proof information
#[wasm_bindgen(
js_name = "getAddressInfoWithProofInfo",
unchecked_return_type = "ProofMetadataResponseTyped<PlatformAddressInfo | undefined>"
)]
#[wasm_bindgen(js_name = "getAddressInfoWithProofInfo")]
pub async fn get_address_info_with_proof_info(
&self,
address: PlatformAddressLikeJs,
Expand Down Expand Up @@ -113,10 +110,7 @@ impl WasmSdk {
///
/// @param addresses - Array of platform addresses to query
/// @returns Map of PlatformAddress to PlatformAddressInfo (or undefined for unfunded addresses)
#[wasm_bindgen(
js_name = "getAddressesInfos",
unchecked_return_type = "Map<PlatformAddress, PlatformAddressInfo | undefined>"
)]
#[wasm_bindgen(js_name = "getAddressesInfos")]
pub async fn get_addresses_infos(
&self,
addresses: PlatformAddressLikeArrayJs,
Expand Down Expand Up @@ -150,10 +144,7 @@ impl WasmSdk {
///
/// @param addresses - Array of platform addresses to query
/// @returns ProofMetadataResponse containing Map of PlatformAddress to PlatformAddressInfo
#[wasm_bindgen(
js_name = "getAddressesInfosWithProofInfo",
unchecked_return_type = "ProofMetadataResponseTyped<Map<PlatformAddress, PlatformAddressInfo | undefined>>"
)]
#[wasm_bindgen(js_name = "getAddressesInfosWithProofInfo")]
pub async fn get_addresses_infos_with_proof_info(
&self,
addresses: PlatformAddressLikeArrayJs,
Expand Down
25 changes: 5 additions & 20 deletions packages/wasm-sdk/src/queries/data_contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,7 @@ impl WasmSdk {
Ok(data_contract)
}

#[wasm_bindgen(
js_name = "getDataContractWithProofInfo",
unchecked_return_type = "ProofMetadataResponseTyped<DataContract>"
)]
#[wasm_bindgen(js_name = "getDataContractWithProofInfo")]
pub async fn get_data_contract_with_proof_info(
&self,
#[wasm_bindgen(js_name = "contractId")] contract_id: IdentifierLikeJs,
Expand All @@ -135,10 +132,7 @@ impl WasmSdk {
.ok_or_else(|| WasmSdkError::not_found("Data contract not found"))
}

#[wasm_bindgen(
js_name = "getDataContractHistory",
unchecked_return_type = "Map<bigint, DataContract>"
)]
#[wasm_bindgen(js_name = "getDataContractHistory")]
pub async fn get_data_contract_history(
&self,
query: DataContractHistoryQueryJs,
Expand All @@ -162,10 +156,7 @@ impl WasmSdk {
Ok(history_map)
}

#[wasm_bindgen(
js_name = "getDataContracts",
unchecked_return_type = "Map<Identifier, DataContract | undefined>"
)]
#[wasm_bindgen(js_name = "getDataContracts")]
pub async fn get_data_contracts(
&self,
ids: IdentifierLikeArrayJs,
Expand All @@ -191,10 +182,7 @@ impl WasmSdk {

// Proof info versions for data contract queries

#[wasm_bindgen(
js_name = "getDataContractHistoryWithProofInfo",
unchecked_return_type = "ProofMetadataResponseTyped<Map<bigint, DataContract>>"
)]
#[wasm_bindgen(js_name = "getDataContractHistoryWithProofInfo")]
pub async fn get_data_contract_history_with_proof_info(
&self,
query: DataContractHistoryQueryJs,
Expand Down Expand Up @@ -224,10 +212,7 @@ impl WasmSdk {
))
}

#[wasm_bindgen(
js_name = "getDataContractsWithProofInfo",
unchecked_return_type = "ProofMetadataResponseTyped<Map<Identifier, DataContract | undefined>>"
)]
#[wasm_bindgen(js_name = "getDataContractsWithProofInfo")]
pub async fn get_data_contracts_with_proof_info(
&self,
ids: IdentifierLikeArrayJs,
Expand Down
15 changes: 3 additions & 12 deletions packages/wasm-sdk/src/queries/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,7 @@ fn json_to_platform_value(json_val: &JsonValue) -> Result<Value, WasmSdkError> {

#[wasm_bindgen]
impl WasmSdk {
#[wasm_bindgen(
js_name = "getDocuments",
unchecked_return_type = "Map<Identifier, Document | undefined>"
)]
#[wasm_bindgen(js_name = "getDocuments")]
pub async fn get_documents(&self, query: DocumentsQueryJs) -> Result<Map, WasmSdkError> {
use dash_sdk::platform::FetchMany;
use drive_proof_verifier::types::Documents;
Expand Down Expand Up @@ -338,10 +335,7 @@ impl WasmSdk {
Ok(documents_map)
}

#[wasm_bindgen(
js_name = "getDocumentsWithProofInfo",
unchecked_return_type = "ProofMetadataResponseTyped<Map<Identifier, Document | undefined>>"
)]
#[wasm_bindgen(js_name = "getDocumentsWithProofInfo")]
pub async fn get_documents_with_proof_info(
&self,
query: DocumentsQueryJs,
Expand Down Expand Up @@ -412,10 +406,7 @@ impl WasmSdk {
Ok(document)
}

#[wasm_bindgen(
js_name = "getDocumentWithProofInfo",
unchecked_return_type = "ProofMetadataResponseTyped<Document | undefined>"
)]
#[wasm_bindgen(js_name = "getDocumentWithProofInfo")]
pub async fn get_document_with_proof_info(
&self,
#[wasm_bindgen(js_name = "dataContractId")] data_contract_id: IdentifierLikeJs,
Expand Down
45 changes: 9 additions & 36 deletions packages/wasm-sdk/src/queries/epoch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,7 @@ fn parse_evonode_range_query(

#[wasm_bindgen]
impl WasmSdk {
#[wasm_bindgen(
js_name = "getEpochsInfo",
unchecked_return_type = "Map<number, ExtendedEpochInfo | undefined>"
)]
#[wasm_bindgen(js_name = "getEpochsInfo")]
pub async fn get_epochs_info(&self, query: EpochsQueryJs) -> Result<Map, WasmSdkError> {
use dash_sdk::platform::types::epoch::EpochQuery;

Expand Down Expand Up @@ -257,10 +254,7 @@ impl WasmSdk {
)))
}

#[wasm_bindgen(
js_name = "getFinalizedEpochInfos",
unchecked_return_type = "Map<number, FinalizedEpochInfo | undefined>"
)]
#[wasm_bindgen(js_name = "getFinalizedEpochInfos")]
pub async fn get_finalized_epoch_infos(
&self,
query: FinalizedEpochsQueryJs,
Expand Down Expand Up @@ -313,10 +307,7 @@ impl WasmSdk {
)))
}

#[wasm_bindgen(
js_name = "getEvonodesProposedEpochBlocksByIds",
unchecked_return_type = "Map<Identifier, bigint>"
)]
#[wasm_bindgen(js_name = "getEvonodesProposedEpochBlocksByIds")]
pub async fn get_evonodes_proposed_epoch_blocks_by_ids(
&self,
epoch: u16,
Expand All @@ -341,10 +332,7 @@ impl WasmSdk {
)))
}

#[wasm_bindgen(
js_name = "getEvonodesProposedEpochBlocksByRange",
unchecked_return_type = "Map<Identifier, bigint>"
)]
#[wasm_bindgen(js_name = "getEvonodesProposedEpochBlocksByRange")]
pub async fn get_evonodes_proposed_epoch_blocks_by_range(
&self,
query: EvonodeProposedBlocksRangeQueryJs,
Expand Down Expand Up @@ -381,10 +369,7 @@ impl WasmSdk {
Ok(ExtendedEpochInfoWasm::from(epoch))
}

#[wasm_bindgen(
js_name = "getEpochsInfoWithProofInfo",
unchecked_return_type = "ProofMetadataResponseTyped<Map<number, ExtendedEpochInfo | undefined>>"
)]
#[wasm_bindgen(js_name = "getEpochsInfoWithProofInfo")]
pub async fn get_epochs_info_with_proof_info(
&self,
query: EpochsQueryJs,
Expand Down Expand Up @@ -422,10 +407,7 @@ impl WasmSdk {
))
}

#[wasm_bindgen(
js_name = "getCurrentEpochWithProofInfo",
unchecked_return_type = "ProofMetadataResponseTyped<ExtendedEpochInfo>"
)]
#[wasm_bindgen(js_name = "getCurrentEpochWithProofInfo")]
pub async fn get_current_epoch_with_proof_info(
&self,
) -> Result<ProofMetadataResponseWasm, WasmSdkError> {
Expand All @@ -441,10 +423,7 @@ impl WasmSdk {

// Additional proof info versions for epoch queries

#[wasm_bindgen(
js_name = "getFinalizedEpochInfosWithProofInfo",
unchecked_return_type = "ProofMetadataResponseTyped<Map<number, FinalizedEpochInfo | undefined>>"
)]
#[wasm_bindgen(js_name = "getFinalizedEpochInfosWithProofInfo")]
pub async fn get_finalized_epoch_infos_with_proof_info(
&self,
query: FinalizedEpochsQueryJs,
Expand Down Expand Up @@ -495,10 +474,7 @@ impl WasmSdk {
))
}

#[wasm_bindgen(
js_name = "getEvonodesProposedEpochBlocksByIdsWithProofInfo",
unchecked_return_type = "ProofMetadataResponseTyped<Map<Identifier, bigint>>"
)]
#[wasm_bindgen(js_name = "getEvonodesProposedEpochBlocksByIdsWithProofInfo")]
pub async fn get_evonodes_proposed_epoch_blocks_by_ids_with_proof_info(
&self,
epoch: u16,
Expand Down Expand Up @@ -529,10 +505,7 @@ impl WasmSdk {
))
}

#[wasm_bindgen(
js_name = "getEvonodesProposedEpochBlocksByRangeWithProofInfo",
unchecked_return_type = "ProofMetadataResponseTyped<Map<Identifier, bigint>>"
)]
#[wasm_bindgen(js_name = "getEvonodesProposedEpochBlocksByRangeWithProofInfo")]
pub async fn get_evonodes_proposed_epoch_blocks_by_range_with_proof_info(
&self,
query: EvonodeProposedBlocksRangeQueryJs,
Expand Down
Loading
Loading