Skip to content

ka1fe1/msg-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

msg-parser

Tx msg parser for block chain which built with cosmos-sdk

install

Requirement

Go version above 1.15

Use Go Mod

require (
    github.com/kaifei-bianjie/msg-parser latest
)

Usage

Init Client

The initialization SDK code is as follows:

client := msg_parser.NewMsgClient()

parse Bank Msg of Tx

bankDoc, ok := client.Bank.HandleTxMsg(&msg)
if ok {
		//db save bank msg
	}

use in sync

var (
	docTx models.Tx
	docTxMsgs []msg_parser.DocTxMsg
    	)
	authTx := Tx.(signing.Tx)
	......
	msgs := authTx.GetMsgs()
	for _, msg := range msgs {
        if bankDoc, ok := client.Bank.HandleTxMsg(&msg);ok {
            docTxMsgs = append(docTxMsgs, bankDoc.DocTxMsg)
            continue
        }
        .....
    }
 docTx.DocTxMsgs = docTxMsgs

About

Tx msg parser for block chain which built with cosmos-sdk

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages