Skip to content

Commit

Permalink
feat: add StringWithNetwork (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
gummy789j authored Nov 1, 2024
1 parent 353f9bc commit 93e3826
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions address.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,14 @@ func (a Address) String() string {
return str
}

func (a Address) StringWithNetwork(network Network) string {
str, err := encode(network, a)
if err != nil {
panic(err) // I don't know if this one is okay
}
return str
}

// Empty returns true if the address is empty, false otherwise.
func (a Address) Empty() bool {
return a == Undef
Expand Down

0 comments on commit 93e3826

Please sign in to comment.