UNPKG

@openproduct/web-sdk

Version:

OpenMask Web - TypeScript Browser SDK for TON blockchain

9 lines (8 loc) 384 B
import { Contract } from "../contract/contract"; import Address from "./address"; import { bytesToHex } from "./utils"; export async function contractAddress(source) { const stateInit = Contract.createStateInit(source.initialCode, source.initialData); const stateInitHash = await stateInit.hash(); return new Address(source.workchain + ":" + bytesToHex(stateInitHash)); }