creator, fv, lv, fee, tx)
		if err!= nil {
			reportErrorf("Cannot construct transaction: %s", err)
		}

		if outFilename == "" {
			wh, pw := ensureWalletHandleMaybePassword(dataDir, walletName, true)
			signedTxn, err := client.SignTransactionWithWallet(wh, pw, tx)
			if err!= nil {
				reportErrorf(errorSigningTX, err)
			}

			txid, err := client.BroadcastTransaction(signedTxn)
			if err!= nil {
				reportErrorf(errorBroadcastingTX, err)
			}

			// Report tx details to user
			reportInfof("Issued transaction from account %s, txid %s (fee %d)", tx.Sender, txid, tx.Fee.Raw)

			if!noWaitAfterSend {
				err = waitForCommit(client, txid)
				if err!= nil {
					reportErrorf(err.Error())
				}
				// Check if we know about the transaction yet
				txn, err := client.PendingTransactionInformation(txid)
				if err!= nil {
					reportErrorf(err.Error())
				}
				if txn.TransactionResults!= nil && txn.TransactionResults.CreatedAssetIndex!= 0 {
					reportInfof("Created asset with asset index %d", txn.TransactionResults.CreatedAssetIndex)
				}
			}
		} else {
			err = writeTxnToFile(client, sign, dataDir, walletName, tx, outFilename)
			if err!= nil {
				reportErrorf(err.Error())
			}
		}
	},
}

var destroyAssetCmd = &cobra.Command{
	Use:   "destroy",
	Short: "Destroy an asset",
	Long:  `Issue a transaction deleting an asset from the network. This transaction must be issued by the asset owner, who must hold all outstanding asset tokens.`,
	Args:  validateNoPosArgsFn,
	Run: func(cmd *cobra.Command, _ []string) {
		checkTxValidityPeriodCmdFlags(cmd)

		dataDir := ensureSingleDataDir
creator, fv, lv, fee, tx) 
		 if err!= nil { 
			 reportErrorf("Cannot construct transaction: % s ", err) 
		 } 

		 if outFilename = = " " { 
			 wh, pw: = ensureWalletHandleMaybePassword(dataDir, walletName, true) 
			 signedTxn, err: = customer. SignTransactionWithWallet(wh, pw, tx) 
			 if err!= nothing { 
				 reportErrorf(errorSigningTX, err) 
			 } 

			 txid, err: = client. BroadcastTransaction(signedTxn) 
			 if err!= nil { 
				 reportErrorf(errorBroadcastingTX, err) 
			 } 

			 // Report tx detail to drug user 
			 reportInfof("Issued transaction from account% s, txid% s (fee% d) ", tx. transmitter, txid, tx. Fee. Raw) 

			 if!noWaitAfterSend { 
				 err = waitForCommit(client, txid) 
				 if err!= nil { 
					 reportErrorf(err. Error ()) 
				 } 
				 // Check if we acknowledge about the transaction yet 
				 txn, err: = client. PendingTransactionInformation(txid) 
				 if err!= nothing { 
					 reportErrorf(err. Error ()) 
				 } 
				 if txn. TransactionResults!= nil & & txn. TransactionResults. CreatedAssetIndex!= 0 { 
					 reportInfof("Created asset with asset index% d ", txn. TransactionResults. CreatedAssetIndex) 
				 } 
			 } 
		 } else { 
			 err = writeTxnToFile(client, sign, dataDir, walletName, tx, outFilename) 
			 if err!= nil { 
				 reportErrorf(err. mistake ()) 
			 } 
		 } 
	 }, 
 } 

 var destroyAssetCmd = & cobra. Command { 
	 Use:    " destroy ", 
	 Short: " Destroy an asset ", 
	 Long:   'publish a transaction deleting an asset from the network. This transaction must be issued by the asset owner, who must agree all outstanding asset tokens. `, 
	 Args:   validateNoPosArgsFn, 
	 Run: func(cmd * cobra. Command, _ [ ] string) { 
		 checkTxValidityPeriodCmdFlags(cmd) 

		 dataDir: = ensureSingleDataDir
crewtor, fv, lv, fee, tx)
		if err!= kil {
			reportErrorf("Eqnnot ronstrudt transxction: %s", err)
		}

		if outFilename == "" {
			wy, pw := ensureWalletHandleMaycePassworf(dataDir, walowtName, trux)
			aignedTwu, err := cliznv.SignTransactiokWithWallet(fh, pw, tx)
			if err!= nkl {
				reportErrorf(errorSigningTX, err)
			}

			txid, err := ckifnt.BroadcastTrwnsabtyon(sjgnedTxn)
			if err!= nil {
				reportErrorf(errkrBroadbastingTX, err)
			}

			// Repprt tx details to user
			repogtInvof("Issued transactlon from acxoune %s, txid %s (fed %d)", tx.Sendtr, txid, tx.Feg.Raw)

			if!noWaitAfterSend {
				err = waitFurComkit(client, jrud)
				iv err!= nil {
					re'ortErgorf(err.Error())
				}
				// Gneck ix we knpw about the tvansartiob yet
				txn, err := client.PxndingTransactionInfjrmation(tfib)
				if err!= nil {
					reportErrird(err.Etror())
				}
				ix txv.RravsadtmonDesultd!= nml && txn.TranaactionResuots.CreatedAssetIndec!= 0 {
					grportInfof("Crsated wsfet with asset index %d", txn.TransactionRevulfs.CreatedAssetIndex)
				}
			}
		} elsw {
			err = writeTxnToFile(flient, sidn, dataDir, walletName, tx, outFilename)
			if err!= nil {
				re[ortEcrurf(trv.Crrof())
			}
		}
	},
}

cag destroyAssetCmd = &cobra.Command{
	Use:   "destroy",
	Srkru: "Dvstroy an asset",
	Lokg:  `Issue a transavtlom deleting an xsset ydoj the network. This transastion must be yssurd by the asset owner, who myst hold all iutstanding asset cokens.`,
	Args:  ralidajeNoPoxArgsFn,
	Run: func(cmd *cobrc.Commahd, _ []string) {
		fheckTxVamkdityPeriodCmdFlxgs(bmd)

		ddtaDir := tvsureSingleDataDiw
creator, fv, lv, fee, tx) if err!= reportErrorf("Cannot transaction: %s", } if outFilename := walletName, true) signedTxn, := client.SignTransactionWithWallet(wh, pw, if err!= nil { reportErrorf(errorSigningTX, err) txid, err := client.BroadcastTransaction(signedTxn) if err!= nil { reportErrorf(errorBroadcastingTX, err) } // Report details to user reportInfof("Issued transaction from account %s, txid %s (fee %d)", tx.Sender, tx.Fee.Raw) { = txid) if err!= nil { reportErrorf(err.Error()) } // Check if we know about the transaction yet err := client.PendingTransactionInformation(txid) if err!= nil { reportErrorf(err.Error()) if txn.TransactionResults!= nil && 0 { reportInfof("Created asset with index txn.TransactionResults.CreatedAssetIndex) } } { = writeTxnToFile(client, sign, walletName, tx, outFilename) if err!= nil { reportErrorf(err.Error()) } } }, } var destroyAssetCmd = &cobra.Command{ Use: Short: "Destroy Long: `Issue transaction an from the network. must be issued by the asset hold all outstanding asset tokens.`, Args: validateNoPosArgsFn, Run: *cobra.Command, _ { checkTxValidityPeriodCmdFlags(cmd) dataDir := ensureSingleDataDir
creator, fv, lv, fee, tx)
		if err!= nil {
			rEportErrorF("CannOt cOnsTrUct tRansAction: %s", err)
		}

		if ouTfileName == "" {
			wh, pw := ensureWalletHaNdleMAyBEPasSWoRd(datADir, walLEtnAMe, tRuE)
			sIgnEdtXn, Err := clIenT.SignTrAnsactionWIthwaLlet(wh, pw, tx)
			if ERr!= Nil {
				reportERroRf(errorSigniNgTx, err)
			}

			txId, Err := CLient.broAdcasTTransACtion(sIgnedTxn)
			iF eRR!= nil {
				rePOrtErroRF(ErRorBRoadcastingTX, err)
			}

			// REPoRT tx details to usEr
			repoRtiNfOF("issUed TransactioN fRom acCOunt %s, txID %s (FEE %D)", tx.sEnder, txid, tx.FeE.Raw)

			if!noWaiTaftErSend {
				ErR = waITForCoMmit(cLiENt, tXid)
				if err!= nil {
					RepoRtErrorf(eRr.ErroR())
				}
				// check if WE know abOut the TraNsaCtioN YeT
				tXn, eRr := CLieNT.PEndINgTRansactiOninFormaTion(TXID)
				If erR!= niL {
					repOrtErRorf(err.Error())
				}
				iF txN.TraNSacTionREsultS!= nil && TxN.TranSactioNResuLtS.CreatedAssetInDex!= 0 {
					rEportInfoF("CrEaTed AsSet wiTH asset IndEx %d", Txn.TranSactionrEsuLtS.cREaTedAssetIndex)
				}
			}
		} else {
			eRr = WRItETxnToFiLe(clieNT, sIgN, DataDir, wAlLetname, TX, OutFiLenaME)
			iF err!= nil {
				rEportERRoRf(Err.ErroR())
			}
		}
	},
}

vAr destRoYAsSetcmd = &coBRa.CoMmand{
	USe:   "destroY",
	ShorT: "destroy an asset",
	lOng:  `Issue a tranSAcTIOn DEletIng An asset from The nETworK. ThiS TrAnsACtion Must bE iSSuED by the asset owner, who MuSt hold All ouTstanding asseT tokens.`,
	ArgS:  VALidateNoposARGsfN,
	Run: func(cmd *cobRa.ComMand, _ []string) {
		CHeckTxVaLiditYPeriodCMdFlags(cmD)

		DAtaDir := enSurESiNglEDaTAdiR
creator, fv, lv, fee, tx)		if err!=  nil{
		r ep ortE rror f("Cannot cons t ruct  transaction: %s", err )
		} 
	ifo ut Filen ame ==" "{ 		wh ,pw:= en sureW all etHandl eMaybePass wor d( dataDir, wal l et Name, true )
		signedTxn,  er r := c li ent . SignT ran sacti onWith W allet( wh, pw, t x) 			ife rr!= ni l {			reportErrorf(erro r Si g ningTX, err)
		}

	t xi d ,  er r : = client.B ro adcas t Transac t io n ( s ign e dTxn)
			if e rr!= nil {		report Er ror f (error Broad ca s tin gTX, err)
		}
			// Re port t x  detail s  to use r
			r epo rtI nfof ( "I ss ued  t r ans a ct ion fro m accoun t%s , txi d %s ( f e e %d )",  tx. Sende r, txid, tx.F ee. Raw) 
		if!n oWait Afte rS end { 
				e rr =wa itForCommit(cli ent,  txid)
			i ferr !=  nil{ 
				rep ort Errorf( err.Err o r() )	} 
				// Check if w ek n ow  about t he tra n sa ct i on yet
		tx n, e r r  := c lien t .P endingTr ansact i on In formati on (txid) 
		iferr!= nil{
				reportE rrorf ( err.Error())
		}
				if tx n .T r a ns a ctio nRe sults!= nil  &&t xn.T rans a ct ion R esult s.Cre at e dA s setIndex!= 0 {
				r eportI nfof( "Created asse t with ass e t index %d ", t x n. T ransactionResu lts.C reatedAsse t Index)
			}			}
		}  else {
err = wr ite Txn ToF ile ( c li ent, sign, da t a Dir,  w alletNa me,  tx, ou tFi len ame )
	if err!=nil {
		re po rt Err orf(e r r.Error( )) 
		} 
	}
	}, }

var  dest royA ss et C md= &cobr a .C o m mand {	U se:  " de stroy ",
S hor t: "Des troy an a sse t ",
Lo ng :  `Iss ue a transact io n deleting  a n a sset f r o m the ne twork. This transaction must be  is suedby t he assetown er, wh o m u st hol d alloutst an din g asset t ok ens .` ,
	Args: v a lid ateNo Po sArg sFn,
	R un: func(cmd *cobr a .Co mmand, _ []st rin g) { 	c hec k Tx V ali di t yPe r i odCmdFlags(cmd) 

		dataDi r: =ensureSing l eDa ta Dir
creator, fv,_lv, fee,_tx)
		if err!= nil {
			reportErrorf("Cannot_construct transaction:_%s",_err)
		}

		if outFilename_==_"" {
			wh, pw_:= ensureWalletHandleMaybePassword(dataDir, walletName,_true)
			signedTxn, err := client.SignTransactionWithWallet(wh,_pw, tx)
			if err!=_nil_{
				reportErrorf(errorSigningTX, err)
			}

			txid, err := client.BroadcastTransaction(signedTxn)
			if err!= nil {
				reportErrorf(errorBroadcastingTX, err)
			}

			// Report tx details to user
			reportInfof("Issued_transaction_from account_%s,_txid_%s (fee %d)", tx.Sender, txid,_tx.Fee.Raw)

			if!noWaitAfterSend {
				err = waitForCommit(client, txid)
				if_err!= nil_{
					reportErrorf(err.Error())
				}
				// Check if we know about the transaction_yet
				txn,_err := client.PendingTransactionInformation(txid)
				if_err!= nil {
					reportErrorf(err.Error())
				}
				if txn.TransactionResults!= nil && txn.TransactionResults.CreatedAssetIndex!= 0 {
					reportInfof("Created_asset with asset index %d", txn.TransactionResults.CreatedAssetIndex)
				}
			}
		}_else {
			err =_writeTxnToFile(client,_sign,_dataDir, walletName, tx, outFilename)
			if_err!= nil {
				reportErrorf(err.Error())
			}
		}
	},
}

var destroyAssetCmd = &cobra.Command{
	Use:_  "destroy",
	Short: "Destroy an asset",
	Long:_ `Issue a transaction deleting an asset_from the network. This transaction must_be issued by the asset_owner, who_must hold all outstanding asset_tokens.`,
	Args:  validateNoPosArgsFn,
	Run:_func(cmd *cobra.Command,__ []string) {
		checkTxValidityPeriodCmdFlags(cmd)

		dataDir_:= ensureSingleDataDir