-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add WebStore to miden-client * Rebased off latest next * Rust docs command fix --------- Co-authored-by: Dennis Garcia <[email protected]>
- Loading branch information
Showing
33 changed files
with
3,889 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
crates/rust-client/src/store/web_store/accounts/js_bindings.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
use wasm_bindgen::prelude::*; | ||
use wasm_bindgen_futures::*; | ||
|
||
// Account IndexedDB Operations | ||
#[wasm_bindgen(module = "/src/store/web_store/js/accounts.js")] | ||
extern "C" { | ||
// GETS | ||
// ================================================================================================ | ||
#[wasm_bindgen(js_name = getAccountIds)] | ||
pub fn idxdb_get_account_ids() -> js_sys::Promise; | ||
|
||
#[wasm_bindgen(js_name = getAllAccountStubs)] | ||
pub fn idxdb_get_account_stubs() -> js_sys::Promise; | ||
|
||
#[wasm_bindgen(js_name = getAccountStub)] | ||
pub fn idxdb_get_account_stub(account_id: String) -> js_sys::Promise; | ||
|
||
#[wasm_bindgen(js_name = getAccountCode)] | ||
pub fn idxdb_get_account_code(code_root: String) -> js_sys::Promise; | ||
|
||
#[wasm_bindgen(js_name = getAccountStorage)] | ||
pub fn idxdb_get_account_storage(storage_root: String) -> js_sys::Promise; | ||
|
||
#[wasm_bindgen(js_name = getAccountAssetVault)] | ||
pub fn idxdb_get_account_asset_vault(vault_root: String) -> js_sys::Promise; | ||
|
||
#[wasm_bindgen(js_name = getAccountAuth)] | ||
pub fn idxdb_get_account_auth(account_id: String) -> js_sys::Promise; | ||
|
||
#[wasm_bindgen(js_name = getAccountAuthByPubKey)] | ||
pub fn idxdb_get_account_auth_by_pub_key(pub_key: Vec<u8>) -> JsValue; | ||
|
||
#[wasm_bindgen(js_name = fetchAndCacheAccountAuthByPubKey)] | ||
pub fn idxdb_fetch_and_cache_account_auth_by_pub_key(account_id: String) -> js_sys::Promise; | ||
|
||
// INSERTS | ||
// ================================================================================================ | ||
|
||
#[wasm_bindgen(js_name = insertAccountCode)] | ||
pub fn idxdb_insert_account_code( | ||
code_root: String, | ||
code: String, | ||
module: Vec<u8>, | ||
) -> js_sys::Promise; | ||
|
||
#[wasm_bindgen(js_name = insertAccountStorage)] | ||
pub fn idxdb_insert_account_storage( | ||
storage_root: String, | ||
storage_slots: Vec<u8>, | ||
) -> js_sys::Promise; | ||
|
||
#[wasm_bindgen(js_name = insertAccountAssetVault)] | ||
pub fn idxdb_insert_account_asset_vault(vault_root: String, assets: String) -> js_sys::Promise; | ||
|
||
#[wasm_bindgen(js_name = insertAccountRecord)] | ||
pub fn idxdb_insert_account_record( | ||
id: String, | ||
code_root: String, | ||
storage_root: String, | ||
vault_root: String, | ||
nonce: String, | ||
committed: bool, | ||
account_seed: Option<Vec<u8>>, | ||
) -> js_sys::Promise; | ||
|
||
#[wasm_bindgen(js_name = insertAccountAuth)] | ||
pub fn idxdb_insert_account_auth( | ||
id: String, | ||
auth_info: Vec<u8>, | ||
pub_key: Vec<u8>, | ||
) -> js_sys::Promise; | ||
} |
Oops, something went wrong.