defenderclienthttp

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 30, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserPoolIDEnv     = "DEFENDER_USER_POOL_ID"
	UserPoolIDDefault = "us-west-2_94f3puJWv"
)
View Source
const (
	ClientPoolIDEnv     = "DEFENDER_CLIENT_POOL_ID"
	ClientPoolIDDefault = "40e58hbc7pktmnp9i26hh5nsav"
)
View Source
const (
	APIURLEnv     = "DEFENDER_API_URL"
	APIURLDefault = "https://defender-api.openzeppelin.com/admin"
)
View Source
const (
	APIKeyEnv = "DEFENDER_API_KEY"
)
View Source
const (
	APISecretEnv = "DEFENDER_API_SECRET"
)

Variables

View Source
var ErrNotImplemented = fmt.Errorf("not implemented")

Functions

func APIKeyFlag

func APIKeyFlag(v *viper.Viper, f *pflag.FlagSet)

APIKeyFlag register flag for Authentication apiKey

func APISecretFlag

func APISecretFlag(v *viper.Viper, f *pflag.FlagSet)

APISecretFlag register flag for Authentication apiSecret

func APIURLFlag

func APIURLFlag(v *viper.Viper, f *pflag.FlagSet)

APIURLFlag register flag for Authentication apiURL

func ClientPoolIDFlag

func ClientPoolIDFlag(v *viper.Viper, f *pflag.FlagSet)

ClientPoolIDFlag register flag for Authentication clientPoolID

func Flags

func Flags(v *viper.Viper, f *pflag.FlagSet)

Flags register viper compatible pflags for auth

func GetAPIKey

func GetAPIKey(v *viper.Viper) string

func GetAPISecret

func GetAPISecret(v *viper.Viper) string

func GetAPIURL

func GetAPIURL(v *viper.Viper) string

func GetClientPoolID

func GetClientPoolID(v *viper.Viper) string

func GetUserPoolID

func GetUserPoolID(v *viper.Viper) string

func UserPoolIDFlag

func UserPoolIDFlag(v *viper.Viper, f *pflag.FlagSet)

UserPoolIDFlag register flag for Authentication userPoolID

Types

type ArchiveReqMsg

type ArchiveReqMsg struct {
	Archived bool `json:"archived"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(cfg *Config) (*Client, error)

func (*Client) AddressBook

func (c *Client) AddressBook(_ context.Context) (map[string]string, error)

func (*Client) ArchiveProposal

func (c *Client) ArchiveProposal(ctx context.Context, contractID, proposalID string) error

func (*Client) GetProposal

func (c *Client) GetProposal(_ context.Context, _, _ string) (*defenderclient.ProposalRespMsg, error)

func (*Client) GetProposalByList

func (c *Client) GetProposalByList(ctx context.Context, _, proposalID string) (*defenderclient.ProposalRespMsg, error)

func (*Client) Init

func (c *Client) Init(ctx context.Context) error

func (*Client) ListContracts

func (c *Client) ListContracts(ctx context.Context) ([]*defenderclient.ContractMsg, error)

func (*Client) ListProposals

func (c *Client) ListProposals(ctx context.Context, includeArchived bool) ([]*defenderclient.ProposalRespMsg, error)

type Config

type Config struct {
	APIKey, APISecret, UserPoolID, ClientPoolID, APIURL string
}

func NewConfigFromViper

func NewConfigFromViper(v *viper.Viper) *Config

func (*Config) SetDefault

func (cfg *Config) SetDefault() *Config

type ErrorMsg

type ErrorMsg struct {
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL