Crates.io | ton_smart_contract_address |
lib.rs | ton_smart_contract_address |
version | 0.0.4 |
source | src |
created_at | 2022-12-20 09:23:11.829871 |
updated_at | 2023-01-31 15:41:44.062347 |
description | TON smart contract addresses |
homepage | https://gitlab.com/nosensedev/tonsmartcontractaddress |
repository | https://gitlab.com/nosensedev/tonsmartcontractaddress |
max_upload_size | |
id | 742143 |
size | 33,322 |
Provides functions to work with TON smart contract addresses.
See Smart Contract Address for more info.
let raw = "0:ba60bfbd527c0cd2d70c6396630c50a498af015b987adaad1d4a9e287f604536";
let bounceable = "EQC6YL-9UnwM0tcMY5ZjDFCkmK8BW5h62q0dSp4of2BFNvnA";
let non_bounceable = "UQC6YL-9UnwM0tcMY5ZjDFCkmK8BW5h62q0dSp4of2BFNqQF";
let raw1 = RawAddress::from_raw_str(raw).unwrap();
let raw2 = RawAddress::from_user_friendly_str(bounceable).unwrap();
let raw3 = RawAddress::from_user_friendly_str(non_bounceable).unwrap();
let user_friendly1 = UserFriendlyAddress::from_raw_str(raw).unwrap();
let user_friendly2 = UserFriendlyAddress::from_user_friendly_str(bounceable).unwrap();
let user_friendly3 = UserFriendlyAddress::from_user_friendly_str(non_bounceable).unwrap();
let raw1 = user_friendly1.to_raw();
let raw2 = RawAddress::from_user_friendly(&user_friendly2);
let user_friendly1 = raw1.to_user_friendly(UserFriendlyFlag::Bounceable);
let user_friendly2 = UserFriendlyAddress::from_raw(&raw2, UserFriendlyFlag::Bounceable).unwrap();
let raw_string1 = raw1.to_string();
let user_friendly_string1 = raw1.to_user_friendly_str(UserFriendlyFlag::Bounceable);
let raw_string2 = user_friendly1.to_raw_str();
let user_friendly_string2 = user_friendly1.to_string();
let mut raw1 = RawAddress::from_raw_str(raw).unwrap();
raw1.set_workchain(Workchaain::MasterChain);
let custom_flag = unsafe{ UserFriendlyFlag::custom(0x01) };
let user_friendly1 = raw1.to_user_friendly(custom_flag);