Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ChainIDToName = map[string]string{
"1": "eth",
"11155111": "sep",
"560048": "hod",
}
ChainIDToName maps chain IDs to their Safe API chain names.
Functions ¶
Types ¶
type Client ¶
type Client interface {
// GetQueuedTransactions returns queued transactions for a safe with nonce >= minNonce.
GetQueuedTransactions(ctx context.Context, safeAddress string, minNonce int64) (*MultisigTransactionsResponse, error)
// GetTransaction returns details for a specific transaction.
GetTransaction(ctx context.Context, safeTxHash string) (*MultisigTransaction, error)
// GetSafe returns details for a specific safe.
GetSafe(ctx context.Context, safeAddress string) (*SafeResponse, error)
// SetChain sets the chain name for the client.
SetChain(chain string)
}
Client exposes Safe Transaction Service API client.
type Config ¶
type Config struct {
Enabled bool `yaml:"enabled" default:"true"`
Endpoint string `yaml:"endpoint" default:"https://api.safe.global"`
APIKey string `yaml:"apiKey"`
}
Config holds configuration for the Safe API client.
type Confirmation ¶
type Confirmation struct {
Owner string `json:"owner"`
SubmissionDate string `json:"submissionDate"`
Signature string `json:"signature"`
SignatureType string `json:"signatureType"`
}
Confirmation represents a transaction confirmation.
type DataDecoded ¶
type DataDecoded struct {
Method string `json:"method"`
Parameters []Parameter `json:"parameters"`
}
DataDecoded represents decoded transaction data.
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func GetMetricsInstance ¶
func (Metrics) ObserveRequest ¶
type MultisigTransaction ¶ added in v0.3.3
type MultisigTransaction struct {
Safe string `json:"safe"`
To string `json:"to"`
Value string `json:"value"`
Data *string `json:"data"`
Operation int `json:"operation"`
SafeTxHash string `json:"safeTxHash"`
Nonce int64 `json:"nonce,string"`
SubmissionDate string `json:"submissionDate"`
IsExecuted bool `json:"isExecuted"`
ConfirmationsRequired int `json:"confirmationsRequired"`
Confirmations []Confirmation `json:"confirmations"`
DataDecoded *DataDecoded `json:"dataDecoded"`
Proposer string `json:"proposer"`
Origin string `json:"origin"`
Trusted bool `json:"trusted"`
}
MultisigTransaction represents a multisig transaction from the Transaction Service API v2. Used for both list and detail endpoints.
type MultisigTransactionsResponse ¶ added in v0.3.3
type MultisigTransactionsResponse struct {
Count int `json:"count"`
Next *string `json:"next"`
Previous *string `json:"previous"`
Results []MultisigTransaction `json:"results"`
CountUniqueNonce int `json:"countUniqueNonce"`
}
MultisigTransactionsResponse represents the response from /multisig-transactions/?executed=false.
type Parameter ¶
type Parameter struct {
Name string `json:"name"`
Type string `json:"type"`
Value any `json:"value"`
ValueDecoded any `json:"valueDecoded"`
}
Parameter represents a decoded parameter from transaction data.
type SafeResponse ¶ added in v0.1.0
type SafeResponse struct {
Address string `json:"address"`
Nonce int64 `json:"nonce,string"`
Threshold int `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"`
}
SafeResponse represents the response from /safes/{address}/.
func (*SafeResponse) CheckSigners ¶ added in v0.1.1
func (s *SafeResponse) CheckSigners(signers []string) bool
CheckSigners verifies that the provided signers match the Safe owners.