status-go/services/wallet/requests/address_details.go
Sale Djenic 1418d40a63 feat_: endpoint for getting address details with/without blocking added
`AddressDetails` is added, basically it is the same as `GetAddressDetails`,
but does the check for address activity (if has balance) across all chains if the
chainIDs list is empty. Setting `timeoutInMilliseconds` param ensures that in case
of network congestion or no internet `AddressDetails` will return the response
setting `hasActivity` property to `false`.
2024-08-26 16:11:11 +02:00

24 lines
474 B
Go

package requests
import (
"errors"
"github.com/ethereum/go-ethereum/common"
)
var ErrAddresInvalid = errors.New("address-details: invalid address")
type AddressDetails struct {
Address string `json:"address"`
ChainIDs []uint64 `json:"chainIds"`
TimeoutInMilliseconds int64 `json:"timeoutInMilliseconds"`
}
func (a *AddressDetails) Validate() error {
if !common.IsHexAddress(a.Address) {
return ErrAddresInvalid
}
return nil
}