Skip to content

Commit

Permalink
fix the asset network get symbol
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricfung committed Feb 26, 2025
1 parent 7d5ab14 commit 99d0ab6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
17 changes: 17 additions & 0 deletions asset.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,3 +227,20 @@ func (asset *Asset) GetSymbol() string {
}
return asset.DisplaySymbol
}

func (asset *AssetNetwork) GetSymbol() string {
if asset.AssetID == USDT_ERC20 {
return "USDT (ERC20)"
} else if asset.AssetID == USDC_ERC20 {
return "USDC (ERC20)"
} else if asset.AssetID == USDT_TRC20 {
return "USDT (TRC20)"
} else if asset.AssetID == USDT_POLYGON {
return "USDT (Polygon)"
} else if asset.AssetID == USDT_BSC {
return "USDT (BSC)"
} else if asset.AssetID == USDT_SOLANA {
return "USDT (Solana)"
}
return asset.DisplaySymbol
}
2 changes: 1 addition & 1 deletion safe_deposits.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type SafeDepositPending struct {
UpdatedAt string `json:"updated_at"`
}

func FetchSafeDeposit(ctx context.Context) ([]*SafeDepositPending, error) {
func FetchPendingSafeDeposits(ctx context.Context) ([]*SafeDepositPending, error) {
endpoint := "/safe/deposits"
body, err := Request(ctx, "GET", endpoint, nil, "")
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions safe_deposits_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func TestFetchSafeDeposit(t *testing.T) {
pending, err := FetchSafeDeposit(context.Background())
pending, err := FetchPendingSafeDeposits(context.Background())
log.Println(err)
log.Println(len(pending))
}
}

0 comments on commit 99d0ab6

Please sign in to comment.