"Asm.fif" include "TonUtil.fif" include { ."usage: " @' $0 type ." []" cr ."Creates a new advanced wallet in specified workchain, with private key saved to or loaded from .pk" cr ."('new-wallet.pk' by default)" cr 1 halt } : usage $# 1- -2 and ' usage if $1 parse-workchain-id =: wc // set workchain id from command line argument def? $2 { @' $2 } { "new-wallet" } cond constant file-base ."Creating new advanced wallet in workchain " wc . cr "wallet-code.fif" include // code // data null // no libraries // create StateInit dup ."StateInit: " dup ."signing message: " dup ."External message for initialization is " B dup Bx. cr file-base +"-query.boc" tuck B>file ."(Saved wallet creating query to file " type .")" cr