You can create deploy message using CreateDeployMessage method:
WalletV3 walletV3 =newWalletV3(options); // by default, wallet has 2 revision// create deploy messageExternalInMessage message =wallet.CreateDeployMessage();// sign deploy messagemessage.Sign(mnemonic.Keys.PrivateKey);// get message cellCell cell =message.Cell;// send this message via TonClient,// for example, await tonClient.SendBoc(cell);
Also you can create deploy message using CreateTransferMessage method:
Address destination =newAddress("/* destination address */");Coins amount =newCoins(1); // 1 TONstring comment ="Hello TON!";WalletV4 walletV4 =newWalletV4(options);// create transaction body query + commentCell body =newCellBuilder().StoreUInt(0,32).StoreString(comment).Build();// getting seqno using tonClientuint? seqno =awaittonClient.Wallet.GetSeqno(walletV4.Address);// create transfer messageExternalInMessage message =walletV4.CreateTransferMessage(new[]{newWalletTransfer { Message =newInternalMessage(newInternalMessageOptions { Info =newIntMsgInfo(newIntMsgInfoOptions { Dest = destination, Value = amount, Bounce =true// make bounceable message }), Body = body }), Mode =1// message mode }}, seqno ??0); // if seqno is null we pass 0, wallet will auto deploy on message send// sign transfer messagemessage.Sign(mnemonic.Keys.PrivateKey);// get message cellCell cell =message.Cell;// send this message via TonClient,// for example, await tonClient.SendBoc(cell);
To get more info about message modes check this page.
If you will pass seqno = 0, message will contain state init data.