Documentation ¶
Index ¶
- Constants
- Variables
- func ChangePairingState(db *sql.DB, topic Topic, active bool) error
- func HasActivePairings(db *sql.DB, expiryNotOlderThanTimestamp int64) (bool, error)
- func InsertPairing(db *sql.DB, pairing Pairing) error
- type JSONProxyType
- type Metadata
- type Namespace
- type PairSessionResponse
- type Pairing
- type Params
- type Proposer
- type RequestParams
- type Service
- func (s *Service) AuthRequest(address common.Address, authMessage string) (*transfer.TxResponse, error)
- func (s *Service) ChangePairingState(topic Topic, active bool) error
- func (s *Service) HasActivePairings() (bool, error)
- func (s *Service) PairSessionProposal(proposal SessionProposal) (*PairSessionResponse, error)
- func (s *Service) RecordSuccessfulPairing(proposal SessionProposal) error
- func (s *Service) SessionRequest(request SessionRequest) (response *transfer.TxResponse, err error)
- type SessionDelete
- type SessionProposal
- type SessionRequest
- type Topic
- type Verified
- type VerifyContext
Constants ¶
View Source
const ( SupportedEip155Namespace = "eip155" ProposeUserPairEvent = walletevent.EventType("WalletConnectProposeUserPair") )
Variables ¶
View Source
var ( ErrorInvalidSessionProposal = errors.New("invalid session proposal") ErrorNamespaceNotSupported = errors.New("namespace not supported") ErrorChainsNotSupported = errors.New("chains not supported") ErrorInvalidParamsCount = errors.New("invalid params count") ErrorInvalidAddressMsgIndex = errors.New("invalid address and/or msg index (must be 0 or 1)") ErrorMethodNotSupported = errors.New("method not supported") )
Functions ¶
func ChangePairingState ¶ added in v0.171.25
func HasActivePairings ¶
Types ¶
type JSONProxyType ¶
type JSONProxyType struct {
// contains filtered or unexported fields
}
JSONProxyType provides a generic way of changing the JSON value before unmarshalling it into the target. transform function is called before unmarshalling.
func (*JSONProxyType) UnmarshalJSON ¶
func (b *JSONProxyType) UnmarshalJSON(input []byte) error
type Namespace ¶
type PairSessionResponse ¶
type PairSessionResponse struct { SessionProposal SessionProposal `json:"sessionProposal"` SupportedNamespaces map[string]Namespace `json:"supportedNamespaces"` }
type Pairing ¶
type Pairing struct { Topic Topic `json:"topic"` Expiry int64 `json:"expiry"` Active bool `json:"active"` AppName string `json:"appName"` URL string `json:"url"` Description string `json:"description"` Icon string `json:"icon"` Verified Verified `json:"verified"` }
func GetActivePairings ¶
GetActivePairings returns all active pairings (active and not expired) that have an expiry timestamp newer or equal to the given timestamp.
type Params ¶
type Params struct { ID int64 `json:"id"` PairingTopic Topic `json:"pairingTopic"` Expiry int64 `json:"expiry"` RequiredNamespaces map[string]Namespace `json:"requiredNamespaces"` OptionalNamespaces map[string]Namespace `json:"optionalNamespaces"` Proposer Proposer `json:"proposer"` Verify VerifyContext `json:"verifyContext"` }
type RequestParams ¶
type RequestParams struct { Request struct { Method string `json:"method"` Params []json.RawMessage `json:"params"` } `json:"request"` ChainID string `json:"chainId"` }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(db *sql.DB, networkManager *network.Manager, accountsDB *accounts.Database, transactionManager *transfer.TransactionManager, gethManager *account.GethManager, eventFeed *event.Feed, config *params.NodeConfig) *Service
func (*Service) AuthRequest ¶ added in v0.171.30
func (*Service) ChangePairingState ¶ added in v0.171.25
func (*Service) HasActivePairings ¶
func (*Service) PairSessionProposal ¶
func (s *Service) PairSessionProposal(proposal SessionProposal) (*PairSessionResponse, error)
func (*Service) RecordSuccessfulPairing ¶
func (s *Service) RecordSuccessfulPairing(proposal SessionProposal) error
func (*Service) SessionRequest ¶
func (s *Service) SessionRequest(request SessionRequest) (response *transfer.TxResponse, err error)
type SessionDelete ¶
type SessionProposal ¶
func (*SessionProposal) Valid ¶
func (p *SessionProposal) Valid() bool
Valid session propsal https://specs.walletconnect.com/2.0/specs/clients/sign/namespaces#controller-side-validation-of-incoming-proposal-namespaces-wallet
type SessionRequest ¶
type SessionRequest struct { ID int64 `json:"id"` Topic Topic `json:"topic"` Params RequestParams `json:"params"` Verify VerifyContext `json:"verifyContext"` }
type VerifyContext ¶
type VerifyContext struct {
Verified Verified `json:"verified"`
}
Click to show internal directories.
Click to hide internal directories.