gnosis

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GNOSIS_API_MAINNET  = "https://safe-transaction-mainnet.safe.global/api/v1/"
	GNOSIS_API_GOERLI   = "https://safe-transaction-goerli.safe.global/api/v1/"
	GNOSIS_API_ARBITRUM = "https://safe-transaction-arbitrum.safe.global/api/v1/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse struct {
	NonFieldErrors []string `json:"nonFieldErrors"`
}

type Gnosis

type Gnosis struct {
	API           string
	ChainId       int
	SafeAddress   string
	BridgeAddress string
	PrivateKey    *ecdsa.PrivateKey
	PublicKey     common.Address
}

func NewGnosis

func NewGnosis(conf *config.Config) (*Gnosis, error)

NewGnosis constructs the gnosis safe

func (*Gnosis) CreateSafeMultisigTx

func (g *Gnosis) CreateSafeMultisigTx(data *NewMultisigTx) error

CreateSafeMultisigTx submits multisig tx to gnosis safe API

func (*Gnosis) GetSafe

func (g *Gnosis) GetSafe() (*ResponseSafe, error)

GetSafe gets safe info and current nonce

func (*Gnosis) GetSafeMultisigTx

func (g *Gnosis) GetSafeMultisigTx(safeTxHash string) (*MultisigTx, error)

GetSafeMultisigTx gets multisig tx from gnosis safe API

func (*Gnosis) GetSafeMultisigTxByNonce

func (g *Gnosis) GetSafeMultisigTxByNonce(nonce int64) (*MultisigTxs, error)

GetSafeMultisigTx gets multisig tx from gnosis safe API

func (*Gnosis) GetSafeMultisigTxs

func (g *Gnosis) GetSafeMultisigTxs() (*MultisigTxs, error)

GetSafeMultisigTxs gets multisig txs from gnosis safe API

func (*Gnosis) ImportPrivateKey

func (g *Gnosis) ImportPrivateKey(pk string) (*Gnosis, error)

ImportPrivateKey imports private key and generates corresponding public key

func (*Gnosis) SignMintTx

func (g *Gnosis) SignMintTx(tokenAddress string, recipientAddress string, amount *big.Int) ([]byte, []byte, error)

type MultisigTx

type MultisigTx struct {
	Safe                  string                    `json:"safe"`
	To                    string                    `json:"to"`
	Value                 int64                     `json:"value,string"`
	Data                  string                    `json:"data"`
	Operation             int64                     `json:"operation"`
	GasToken              string                    `json:"gasToken"`
	SafeTxGas             int64                     `json:"safeTxGas"`
	BaseGas               int64                     `json:"baseGas"`
	GasPrice              int64                     `json:"gasPrice,string"`
	RefundReceiver        string                    `json:"refundReceiver"`
	Nonce                 int64                     `json:"nonce"`
	ExecutionDate         *time.Time                `json:"executionDate"`
	SubmissionDate        *time.Time                `json:"submissionDate"`
	Modified              *time.Time                `json:"modified"`
	SafeTxHash            string                    `json:"safeTxHash"`
	IsExecuted            bool                      `json:"isExecuted"`
	ConfirmationsRequired int64                     `json:"confirmationsRequired"`
	Confirmations         []*MultisigTxConfirmation `json:"confirmations"`
}

type MultisigTxConfirmation

type MultisigTxConfirmation struct {
	Owner           string     `json:"owner"`
	SubmissionDate  *time.Time `json:"submissionDate"`
	TransactionHash string     `json:"transactionHash"`
	Signature       string     `json:"signature"`
	SignatureType   string     `json:"signatureType"`
}

type MultisigTxs

type MultisigTxs struct {
	Results []*MultisigTx `json:"results"`
}

type NewMultisigTx

type NewMultisigTx struct {
	Safe                    string  `json:"safe"`
	To                      string  `json:"to"`
	Value                   int64   `json:"value"`
	Data                    string  `json:"data"`
	Operation               int64   `json:"operation"`
	GasToken                string  `json:"gasToken"`
	SafeTxGas               int64   `json:"safeTxGas"`
	BaseGas                 int64   `json:"baseGas"`
	GasPrice                int64   `json:"gasPrice"`
	RefundReceiver          string  `json:"refundReceiver"`
	Nonce                   int64   `json:"nonce"`
	ContractTransactionHash string  `json:"contractTransactionHash"`
	Sender                  string  `json:"sender"`
	Signature               string  `json:"signature"`
	Origin                  *string `json:"origin"`
}

type ResponseMultisigTxs

type ResponseMultisigTxs struct {
	Count   int64         `json:"count"`
	Results []*MultisigTx `json:"results"`
}

type ResponseSafe

type ResponseSafe struct {
	Address         string   `json:"address"`
	Nonce           int64    `json:"nonce"`
	Threshold       int64    `json:"threshold"`
	Owners          []string `json:"owners"`
	MasterCopy      string   `json:"masterCopy"`
	Modules         []string `json:"modules"`
	FallbackHandler string   `json:"fallbackHandler"`
	Guard           string   `json:"guard"`
	Version         string   `json:"version"`
}

Jump to

Keyboard shortcuts

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