Skip to content

Commit

Permalink
Add parseFullAccountStateInit helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexagon committed Feb 5, 2024
1 parent 63f3ad2 commit 1e377ed
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nekoton-wasm"
version = "1.3.2"
version = "1.3.3"
edition = "2021"
authors = ["Ivan Kalinin <[email protected]>"]
repository = "https://github.com/broxus/nekoton-wasm"
Expand Down
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,16 @@ pub fn parse_full_account_boc(account: &str) -> Result<OptionFullContractState,
make_full_contract_state(account).map(JsValue::unchecked_into)
}

#[wasm_bindgen(js_name = "parseFullAccountStateInit")]
pub fn parse_full_account_state_init(account: &str) -> Result<Option<String>, JsValue> {
let account = parse_cell(account)?;
let account = ton_block::Account::construct_from_cell(account).handle_error()?;
account
.state_init()
.map(|state_init| serialize_into_boc(state_init))
.transpose()
}

#[wasm_bindgen(js_name = "computeStorageFee")]
pub fn compute_storage_fee(
config: &str,
Expand Down

0 comments on commit 1e377ed

Please sign in to comment.