diff --git a/csv/parsers/accointing/accointing.go b/csv/parsers/accointing/accointing.go index 88ed244..1eaf81f 100644 --- a/csv/parsers/accointing/accointing.go +++ b/csv/parsers/accointing/accointing.go @@ -16,6 +16,8 @@ import ( "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/concentratedliquidity" "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/gamm" "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/poolmanager" + "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/tokenfactory" + "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/valsetpref" "github.com/DefiantLabs/cosmos-tax-cli/util" ) @@ -253,6 +255,10 @@ func ParseTx(address string, events []db.TaxableTransaction) (rows []parsers.Csv newRow, err = ParsePoolManagerSwap(event) case concentratedliquidity.MsgCollectIncentives, concentratedliquidity.MsgCollectSpreadRewards: newRow, err = ParseConcentratedLiquidityCollection(event) + case valsetpref.MsgDelegateBondedTokens, valsetpref.MsgUndelegateFromValidatorSet, valsetpref.MsgRedelegateValidatorSet, valsetpref.MsgWithdrawDelegationRewards, valsetpref.MsgDelegateToValidatorSet, valsetpref.MsgUndelegateFromRebalancedValidatorSet: + newRow, err = ParseValsetPrefRewards(event) + case tokenfactory.MsgMint, tokenfactory.MsgBurn: + newRow, err = ParseTokenFactoryEvents(address, event) default: config.Log.Errorf("no parser for message type '%v'", event.Message.MessageType.MessageType) continue @@ -460,3 +466,28 @@ func ParseConcentratedLiquidityCollection(event db.TaxableTransaction) (Row, err return *row, err } + +func ParseValsetPrefRewards(event db.TaxableTransaction) (Row, error) { + row := &Row{} + row.OperationID = event.Message.Tx.Hash + row.TransactionType = Withdraw + row.Classification = Staked + row.Date = event.Message.Tx.Block.TimeStamp.Format(TimeLayout) + + err := parseAndAddReceivedAmount(row, event) + if err != nil { + return *row, err + } + + return *row, nil +} + +func ParseTokenFactoryEvents(address string, event db.TaxableTransaction) (Row, error) { + row := &Row{} + err := row.ParseBasic(address, event) + if err != nil { + config.Log.Error("Error with ParseMsgMultiSend.", err) + } + + return *row, nil +} diff --git a/csv/parsers/cointracker/cointracker.go b/csv/parsers/cointracker/cointracker.go index 53f5220..f55a1c6 100644 --- a/csv/parsers/cointracker/cointracker.go +++ b/csv/parsers/cointracker/cointracker.go @@ -16,6 +16,8 @@ import ( "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/concentratedliquidity" "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/gamm" "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/poolmanager" + "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/tokenfactory" + "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/valsetpref" "github.com/DefiantLabs/cosmos-tax-cli/util" ) @@ -215,6 +217,10 @@ func ParseTx(address string, events []db.TaxableTransaction, fees []db.Fee) (row newRow, err = ParsePoolManagerSwap(event) case concentratedliquidity.MsgCollectIncentives, concentratedliquidity.MsgCollectSpreadRewards: newRow, err = ParseConcentratedLiquidityCollection(event) + case valsetpref.MsgDelegateBondedTokens, valsetpref.MsgUndelegateFromValidatorSet, valsetpref.MsgRedelegateValidatorSet, valsetpref.MsgWithdrawDelegationRewards, valsetpref.MsgDelegateToValidatorSet, valsetpref.MsgUndelegateFromRebalancedValidatorSet: + newRow, err = ParseValsetPrefRewards(event) + case tokenfactory.MsgMint, tokenfactory.MsgBurn: + newRow, err = ParseTokenFactoryEvents(address, event) default: config.Log.Errorf("no parser for message type '%v'", event.Message.MessageType.MessageType) continue @@ -443,3 +449,25 @@ func ParseConcentratedLiquidityCollection(event db.TaxableTransaction) (Row, err return *row, err } + +func ParseValsetPrefRewards(event db.TaxableTransaction) (Row, error) { + row := &Row{} + row.Date = event.Message.Tx.Block.TimeStamp.Format(TimeLayout) + + err := parseAndAddReceivedAmount(row, event) + if err != nil { + return *row, err + } + + return *row, nil +} + +func ParseTokenFactoryEvents(address string, event db.TaxableTransaction) (Row, error) { + row := &Row{} + err := row.ParseBasic(address, event) + if err != nil { + config.Log.Error("Error with ParseMsgMultiSend.", err) + } + + return *row, nil +} diff --git a/csv/parsers/cryptotaxcalculator/cryptotaxcalculator.go b/csv/parsers/cryptotaxcalculator/cryptotaxcalculator.go index c1d3bea..9e3d4ef 100644 --- a/csv/parsers/cryptotaxcalculator/cryptotaxcalculator.go +++ b/csv/parsers/cryptotaxcalculator/cryptotaxcalculator.go @@ -16,6 +16,8 @@ import ( "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/concentratedliquidity" "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/gamm" "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/poolmanager" + "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/tokenfactory" + "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/valsetpref" "github.com/DefiantLabs/cosmos-tax-cli/util" ) @@ -216,6 +218,10 @@ func ParseTx(address string, events []db.TaxableTransaction) (rows []parsers.Csv newRow, err = ParsePoolManagerSwap(address, event) case concentratedliquidity.MsgCollectIncentives, concentratedliquidity.MsgCollectSpreadRewards: newRow, err = ParseConcentratedLiquidityCollection(event) + case valsetpref.MsgDelegateBondedTokens, valsetpref.MsgUndelegateFromValidatorSet, valsetpref.MsgRedelegateValidatorSet, valsetpref.MsgWithdrawDelegationRewards, valsetpref.MsgDelegateToValidatorSet, valsetpref.MsgUndelegateFromRebalancedValidatorSet: + newRow, err = ParseValsetPrefRewards(event) + case tokenfactory.MsgMint, tokenfactory.MsgBurn: + newRow, err = ParseTokenFactoryEvents(address, event) default: config.Log.Errorf("no parser for message type '%v'", event.Message.MessageType.MessageType) continue @@ -426,3 +432,26 @@ func ParseConcentratedLiquidityCollection(event db.TaxableTransaction) (Row, err return *row, err } + +func ParseValsetPrefRewards(event db.TaxableTransaction) (Row, error) { + row := &Row{} + row.Type = Receive + row.Date = event.Message.Tx.Block.TimeStamp.Format(TimeLayout) + + err := parseAndAddReceivedAmount(row, event) + if err != nil { + return *row, err + } + + return *row, nil +} + +func ParseTokenFactoryEvents(address string, event db.TaxableTransaction) (Row, error) { + row := &Row{} + err := row.ParseBasic(address, event) + if err != nil { + config.Log.Error("Error with ParseMsgMultiSend.", err) + } + + return *row, nil +} diff --git a/csv/parsers/koinly/koinly.go b/csv/parsers/koinly/koinly.go index 005fc25..427052a 100644 --- a/csv/parsers/koinly/koinly.go +++ b/csv/parsers/koinly/koinly.go @@ -18,6 +18,8 @@ import ( "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/concentratedliquidity" "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/gamm" "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/poolmanager" + "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/tokenfactory" + "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/valsetpref" "github.com/DefiantLabs/cosmos-tax-cli/util" ) @@ -319,6 +321,10 @@ func ParseTx(address string, events []db.TaxableTransaction) (rows []parsers.Csv newRow, err = ParsePoolManagerSwap(event) case concentratedliquidity.MsgCollectIncentives, concentratedliquidity.MsgCollectSpreadRewards: newRow, err = ParseConcentratedLiquidityCollection(event) + case valsetpref.MsgDelegateBondedTokens, valsetpref.MsgUndelegateFromValidatorSet, valsetpref.MsgRedelegateValidatorSet, valsetpref.MsgWithdrawDelegationRewards, valsetpref.MsgDelegateToValidatorSet, valsetpref.MsgUndelegateFromRebalancedValidatorSet: + newRow, err = ParseValsetPrefRewards(event) + case tokenfactory.MsgMint, tokenfactory.MsgBurn: + newRow, err = ParseTokenFactoryEvents(address, event) default: config.Log.Errorf("no parser for message type '%v'", event.Message.MessageType.MessageType) continue @@ -526,3 +532,27 @@ func ParseConcentratedLiquidityCollection(event db.TaxableTransaction) (Row, err return *row, err } + +func ParseValsetPrefRewards(event db.TaxableTransaction) (Row, error) { + row := &Row{} + row.Label = Income + row.Date = event.Message.Tx.Block.TimeStamp.Format(TimeLayout) + row.TxHash = event.Message.Tx.Hash + + err := parseAndAddReceivedAmount(row, event) + if err != nil { + return *row, err + } + + return *row, nil +} + +func ParseTokenFactoryEvents(address string, event db.TaxableTransaction) (Row, error) { + row := &Row{} + err := row.ParseBasic(address, event) + if err != nil { + config.Log.Error("Error with ParseMsgMultiSend.", err) + } + + return *row, nil +} diff --git a/csv/parsers/taxbit/taxbit.go b/csv/parsers/taxbit/taxbit.go index 0ad26e1..2dfbffe 100644 --- a/csv/parsers/taxbit/taxbit.go +++ b/csv/parsers/taxbit/taxbit.go @@ -14,6 +14,8 @@ import ( "github.com/DefiantLabs/cosmos-tax-cli/db" "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/gamm" "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/poolmanager" + "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/tokenfactory" + "github.com/DefiantLabs/cosmos-tax-cli/osmosis/modules/valsetpref" ) func (p *Parser) TimeLayout() string { @@ -246,6 +248,10 @@ func ParseTx(address string, events []db.TaxableTransaction) (rows []parsers.Csv newRow, err = ParseMsgTransfer(address, event) case poolmanager.MsgSplitRouteSwapExactAmountIn, poolmanager.MsgSwapExactAmountIn, poolmanager.MsgSwapExactAmountOut: newRow, err = ParsePoolManagerSwap(event) + case valsetpref.MsgDelegateBondedTokens, valsetpref.MsgUndelegateFromValidatorSet, valsetpref.MsgRedelegateValidatorSet, valsetpref.MsgWithdrawDelegationRewards, valsetpref.MsgDelegateToValidatorSet, valsetpref.MsgUndelegateFromRebalancedValidatorSet: + newRow, err = ParseValsetPrefRewards(event) + case tokenfactory.MsgMint, tokenfactory.MsgBurn: + newRow, err = ParseTokenFactoryEvents(address, event) default: config.Log.Errorf("no parser for message type '%v'", event.Message.MessageType.MessageType) continue @@ -377,3 +383,27 @@ func ParsePoolManagerSwap(event db.TaxableTransaction) (Row, error) { } return *row, err } + +func ParseValsetPrefRewards(event db.TaxableTransaction) (Row, error) { + row := &Row{} + row.Date = event.Message.Tx.Block.TimeStamp.Format(TimeLayout) + row.TransactionType = Income + row.TxHash = event.Message.Tx.Hash + + err := parseAndAddReceivedAmount(row, event) + if err != nil { + return *row, err + } + + return *row, nil +} + +func ParseTokenFactoryEvents(address string, event db.TaxableTransaction) (Row, error) { + row := &Row{} + err := row.ParseBasic(address, event) + if err != nil { + config.Log.Error("Error with ParseMsgMultiSend.", err) + } + + return *row, nil +}