Documentation ¶
Index ¶
- Constants
- Variables
- func ChangeSessionState(db *sql.DB, topic Topic, active bool) error
- func UpsertSession(db *sql.DB, session DbSession) error
- type DbSession
- type JSONProxyType
- type Metadata
- type Namespace
- type PairSessionResponse
- type Params
- type Proposer
- type RequestParams
- type Service
- func (s *Service) AuthRequest(address common.Address, authMessage string) (*transfer.TxResponse, error)
- func (s *Service) ChangeSessionState(topic Topic, active bool) error
- func (s *Service) PairSessionProposal(proposal SessionProposal) (*PairSessionResponse, error)
- func (s *Service) SaveOrUpdateSession(session Session) error
- func (s *Service) SessionRequest(request SessionRequest) (response *transfer.TxResponse, err error)
- type Session
- 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 ChangeSessionState ¶ added in v0.171.33
Types ¶
type DbSession ¶ added in v0.171.33
type DbSession struct { Topic Topic `json:"topic"` PairingTopic Topic `json:"pairingTopic"` Expiry int64 `json:"expiry"` Active bool `json:"active"` DappName string `json:"dappName"` DappURL string `json:"dappUrl"` DappDescription string `json:"dappDescription"` DappIcon string `json:"dappIcon"` DappVerifyURL string `json:"dappVerifyUrl"` DappPublicKey string `json:"dappPublicKey"` }
func GetActiveSessions ¶ added in v0.171.33
GetActiveSessions returns all active sessions (active and not expired) that have an expiry timestamp newer or equal to the given timestamp.
func GetSessionByTopic ¶ added in v0.171.33
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 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) ChangeSessionState ¶ added in v0.171.33
func (*Service) PairSessionProposal ¶
func (s *Service) PairSessionProposal(proposal SessionProposal) (*PairSessionResponse, error)
func (*Service) SaveOrUpdateSession ¶ added in v0.171.33
func (*Service) SessionRequest ¶
func (s *Service) SessionRequest(request SessionRequest) (response *transfer.TxResponse, err error)
type Session ¶ added in v0.171.33
type Session struct { Acknowledged bool `json:"acknowledged"` Controller string `json:"controller"` Expiry int64 `json:"expiry"` Namespaces map[string]Namespace `json:"namespaces"` OptionalNamespaces map[string]Namespace `json:"optionalNamespaces"` PairingTopic Topic `json:"pairingTopic"` Peer Proposer `json:"peer"` Relay json.RawMessage `json:"relay"` RequiredNamespaces map[string]Namespace `json:"requiredNamespaces"` Self Proposer `json:"self"` Topic Topic `json:"topic"` }
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.