Misc utility Functions.
convert_address – Converts address from any TON format to any TON format
calc_storage_fee – Calculates storage fee for an account over a specified time period
Converts address from any TON format to any TON format
type ParamsOfConvertAddress = {
address: string,
output_format: AddressStringFormat
}
type ResultOfConvertAddress = {
address: string
}
function convert_address(
params: ParamsOfConvertAddress,
): Promise<ResultOfConvertAddress>;
address
: string – Account address in any TON format.output_format
: AddressStringFormat – Specify the format to convert to.
address
: string – Address in the specified format
Calculates storage fee for an account over a specified time period
type ParamsOfCalcStorageFee = {
account: string,
period: number
}
type ResultOfCalcStorageFee = {
fee: string
}
function calc_storage_fee(
params: ParamsOfCalcStorageFee,
): Promise<ResultOfCalcStorageFee>;
account
: stringperiod
: number
fee
: string
type AddressStringFormat = {
type: 'AccountId'
} | {
type: 'Hex'
} | {
type: 'Base64'
url: boolean,
test: boolean,
bounce: boolean
}
Depends on value of the type
field.
When type is 'AccountId'
When type is 'Hex'
When type is 'Base64'
url
: booleantest
: booleanbounce
: boolean
Variant constructors:
function addressStringFormatAccountId(): AddressStringFormat;
function addressStringFormatHex(): AddressStringFormat;
function addressStringFormatBase64(url: boolean, test: boolean, bounce: boolean): AddressStringFormat;
type ParamsOfConvertAddress = {
address: string,
output_format: AddressStringFormat
}
address
: string – Account address in any TON format.output_format
: AddressStringFormat – Specify the format to convert to.
type ResultOfConvertAddress = {
address: string
}
address
: string – Address in the specified format
type ParamsOfCalcStorageFee = {
account: string,
period: number
}
account
: stringperiod
: number
type ResultOfCalcStorageFee = {
fee: string
}
fee
: string