func BftxStructConverstionON(tx *btx.BF_TX) (*BFTXTransaction, error) {
	var newbftx BFTXTransaction
	bfjs, err := json.Marshal(tx)
	if err != nil {
		return &newbftx, err
	}
	err = json.Unmarshal(bfjs, &newbftx)
	if err != nil {
		return &newbftx, err
	}
	return &newbftx, nil
}
BftxStructConverstionON (Old to New) is a function that convert the old structure
*BF_TX to new structure *BFTXTransaction. These two structure is duplicated somehow. This function is used
for temporal conversion.
since this is just for temporal usage, I will just use json marshal and unmarshal
to convert structures
package saberservice
import (
	"bufio"
	"context"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"os"
	"strings"
	btx "github.com/blockfreight/go-bftx/lib/app/bf_tx"
	"google.golang.org/grpc"
	yaml "gopkg.in/yaml.v2"
)
type Saberinput struct {
	mode         string
	address      string
	txpath       string
	txconfigpath string
	KeyName      string
}
func check(e error) {
	if e != nil {
		panic(e)
	}
}
func loadtransaction(s string) *BFTXTransaction {
	var bftx *BFTXTransaction
	jsmsg, err := ioutil.ReadFile(s)
	check(err)
	err = json.Unmarshal(jsmsg, &bftx)
	check(err)
	return bftx
}
func loadconfiguration(s string) *BFTXEncryptionConfig {
	var bfconfig *BFTXEncryptionConfig
	ylconfig, err := ioutil.ReadFile(s)
	check(err)
	err = yaml.UnmarshalStrict(ylconfig, &bfconfig)
	check(err)
	return bfconfig
}
func NVCsvConverterNew(line []string) *BFTXTransaction {
	msg := BFTXTransaction{
		Properties: &BFTX_Payload{
			Shipper:         line[0],
			Consignee:       line[1],
			ReceiveAgent:    line[2],
			HouseBill:       line[3],
			PortOfLoading:   line[4],
			PortOfDischarge: line[5],
			Destination:     line[6],
			MarksAndNumbers: line[7],
			DescOfGoods:     nvparsedesc(line[8]),
			GrossWeight:     line[9],
			UnitOfWeight:    line[10],
			Volume:          line[11],
			UnitOfVolume:    line[12],
			Container:       line[13],
			ContainerSeal:   line[14],
			ContainerMode:   line[15],
			ContainerType:   line[16],
			Packages:        line[17],
			PackType:        line[18],
			INCOTerms:       line[19],
			DeliverAgent:    line[20],
		},
	}
	return &msg
}
func nvparsedesc(desc string) string {
	item := desc
	item = strings.Replace(item, "\n", " ", -1)
	item = strings.Replace(item, "\t", " ", -1)
	item = strings.Replace(item, "\r", " ", -1)
	return item
}
func BftxStructConverstionNO(tx *BFTXTransaction) (*btx.BF_TX, error) {
	var oldbftx btx.BF_TX
	bfjs, err := json.Marshal(*tx)
	if err != nil {
		return &oldbftx, err
	}
	err = json.Unmarshal(bfjs, &oldbftx)
	if err != nil {
		return &oldbftx, err
	}
	return &oldbftx, nil
}