Skip to content

Commit

Permalink
Tokenfactory csv parsers
Browse files Browse the repository at this point in the history
  • Loading branch information
pharr117 committed Jan 28, 2024
1 parent b069432 commit dea949e
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
13 changes: 13 additions & 0 deletions csv/parsers/accointing/accointing.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ 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"
)
Expand Down Expand Up @@ -256,6 +257,8 @@ func ParseTx(address string, events []db.TaxableTransaction) (rows []parsers.Csv
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
Expand Down Expand Up @@ -478,3 +481,13 @@ func ParseValsetPrefRewards(event db.TaxableTransaction) (Row, error) {

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
}
13 changes: 13 additions & 0 deletions csv/parsers/cointracker/cointracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ 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"
)
Expand Down Expand Up @@ -218,6 +219,8 @@ func ParseTx(address string, events []db.TaxableTransaction, fees []db.Fee) (row
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
Expand Down Expand Up @@ -458,3 +461,13 @@ func ParseValsetPrefRewards(event db.TaxableTransaction) (Row, error) {

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
}
13 changes: 13 additions & 0 deletions csv/parsers/cryptotaxcalculator/cryptotaxcalculator.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ 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"
)
Expand Down Expand Up @@ -219,6 +220,8 @@ func ParseTx(address string, events []db.TaxableTransaction) (rows []parsers.Csv
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
Expand Down Expand Up @@ -442,3 +445,13 @@ func ParseValsetPrefRewards(event db.TaxableTransaction) (Row, error) {

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
}
13 changes: 13 additions & 0 deletions csv/parsers/koinly/koinly.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ 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"
)
Expand Down Expand Up @@ -322,6 +323,8 @@ func ParseTx(address string, events []db.TaxableTransaction) (rows []parsers.Csv
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
Expand Down Expand Up @@ -543,3 +546,13 @@ func ParseValsetPrefRewards(event db.TaxableTransaction) (Row, error) {

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
}
13 changes: 13 additions & 0 deletions csv/parsers/taxbit/taxbit.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ 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"
)

Expand Down Expand Up @@ -249,6 +250,8 @@ func ParseTx(address string, events []db.TaxableTransaction) (rows []parsers.Csv
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
Expand Down Expand Up @@ -394,3 +397,13 @@ func ParseValsetPrefRewards(event db.TaxableTransaction) (Row, error) {

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
}

0 comments on commit dea949e

Please sign in to comment.