code.vegaprotocol.io/vega@v0.79.0/wallet/service/v1/api.go (about)

     1  // Copyright (C) 2023 Gobalsky Labs Limited
     2  //
     3  // This program is free software: you can redistribute it and/or modify
     4  // it under the terms of the GNU Affero General Public License as
     5  // published by the Free Software Foundation, either version 3 of the
     6  // License, or (at your option) any later version.
     7  //
     8  // This program is distributed in the hope that it will be useful,
     9  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    10  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    11  // GNU Affero General Public License for more details.
    12  //
    13  // You should have received a copy of the GNU Affero General Public License
    14  // along with this program.  If not, see <http://www.gnu.org/licenses/>.
    15  
    16  package v1
    17  
    18  import (
    19  	"code.vegaprotocol.io/vega/wallet/network"
    20  
    21  	"go.uber.org/zap"
    22  )
    23  
    24  type API struct {
    25  	log *zap.Logger
    26  
    27  	network *network.Network
    28  
    29  	handler     WalletHandler
    30  	auth        Auth
    31  	nodeForward NodeForward
    32  	policy      Policy
    33  	spam        SpamHandler
    34  }
    35  
    36  func NewAPI(
    37  	log *zap.Logger,
    38  	handler WalletHandler,
    39  	auth Auth,
    40  	nodeForward NodeForward,
    41  	policy Policy,
    42  	net *network.Network,
    43  	spam SpamHandler,
    44  ) *API {
    45  	return &API{
    46  		log:         log,
    47  		network:     net,
    48  		handler:     handler,
    49  		auth:        auth,
    50  		nodeForward: nodeForward,
    51  		policy:      policy,
    52  		spam:        spam,
    53  	}
    54  }