Documentation
¶
Index ¶
- Constants
- func DeriveProxyAddress(chainID int64, eoa string) (string, error)
- func DeriveSafeAddress(chainID int64, eoa string) (string, error)
- func GetContractConfig(chainID int64) (types.ContractConfig, error)
- func IsProxyContractConfigValid(config types.ProxyContractConfig) bool
- func IsSafeContractConfigValid(config types.SafeContractConfig) bool
- func SignHMAC(secret string, message string) (string, error)
- type BuilderConfig
- type BuilderCredentials
- type BuilderHTTPDoer
- type BuilderRemoteConfig
- type ClientRelayerTransactionResponse
- type HTTPClient
- type HTTPError
- type RelayClient
- func (c *RelayClient) Deploy(ctx context.Context) (*ClientRelayerTransactionResponse, error)
- func (c *RelayClient) Execute(ctx context.Context, txns []types.Transaction, metadata string) (*ClientRelayerTransactionResponse, error)
- func (c *RelayClient) GetDeployed(ctx context.Context, safeAddress string) (bool, error)
- func (c *RelayClient) GetNonce(ctx context.Context, signerAddress string, signerType string) (types.NoncePayload, error)
- func (c *RelayClient) GetRelayPayload(ctx context.Context, signerAddress string, signerType string) (types.RelayPayload, error)
- func (c *RelayClient) GetTransaction(ctx context.Context, transactionID string) ([]types.RelayerTransaction, error)
- func (c *RelayClient) GetTransactions(ctx context.Context) ([]types.RelayerTransaction, error)
- func (c *RelayClient) PollUntilState(ctx context.Context, transactionID string, ...) (*types.RelayerTransaction, error)
- func (c *RelayClient) SetHTTPClient(client *HTTPClient)
- type RequestOptions
Constants ¶
const ( // #nosec G101 -- header names, not hardcoded credentials. HeaderPolyBuilderAPIKey = "POLY_BUILDER_API_KEY" // #nosec G101 -- header names, not hardcoded credentials. HeaderPolyBuilderPassphrase = "POLY_BUILDER_PASSPHRASE" HeaderPolyBuilderSignature = "POLY_BUILDER_SIGNATURE" HeaderPolyBuilderTimestamp = "POLY_BUILDER_TIMESTAMP" )
const ( GetNonceEndpoint = "/nonce" GetRelayPayloadEndpoint = "/relay-payload" GetTransactionEndpoint = "/transaction" GetTransactionsEndpoint = "/transactions" SubmitTransactionEndpoint = "/submit" GetDeployedEndpoint = "/deployed" )
Variables ¶
This section is empty.
Functions ¶
func DeriveProxyAddress ¶
DeriveProxyAddress returns the deterministic Proxy address for an EOA on a supported chain.
func DeriveSafeAddress ¶
DeriveSafeAddress returns the deterministic Safe address for an EOA on a supported chain.
func GetContractConfig ¶
func GetContractConfig(chainID int64) (types.ContractConfig, error)
func IsProxyContractConfigValid ¶
func IsProxyContractConfigValid(config types.ProxyContractConfig) bool
func IsSafeContractConfigValid ¶
func IsSafeContractConfigValid(config types.SafeContractConfig) bool
Types ¶
type BuilderConfig ¶
type BuilderConfig struct {
Local *BuilderCredentials
Remote *BuilderRemoteConfig
}
BuilderConfig holds configuration for local or remote builder attribution.
func (*BuilderConfig) Headers ¶
func (c *BuilderConfig) Headers(ctx context.Context, method, path string, body *string, timestamp int64) (http.Header, error)
Headers returns the attribution headers for a given request.
func (*BuilderConfig) IsValid ¶
func (c *BuilderConfig) IsValid() bool
IsValid returns true if the configuration has sufficient credentials.
type BuilderCredentials ¶
BuilderCredentials represents builder attribution credentials.
type BuilderHTTPDoer ¶
BuilderHTTPDoer executes HTTP requests for remote signing.
type BuilderRemoteConfig ¶
type BuilderRemoteConfig struct {
Host string
Token string
HTTPClient BuilderHTTPDoer
}
BuilderRemoteConfig configures a remote signing service.
type ClientRelayerTransactionResponse ¶
type ClientRelayerTransactionResponse struct {
TransactionID string
State string
TransactionHash string
// contains filtered or unexported fields
}
ClientRelayerTransactionResponse wraps a relayer transaction response.
func (*ClientRelayerTransactionResponse) GetTransaction ¶
func (r *ClientRelayerTransactionResponse) GetTransaction(ctx context.Context) ([]types.RelayerTransaction, error)
func (*ClientRelayerTransactionResponse) Wait ¶
func (r *ClientRelayerTransactionResponse) Wait(ctx context.Context) (*types.RelayerTransaction, error)
type HTTPClient ¶
type HTTPClient struct {
// contains filtered or unexported fields
}
func NewHTTPClient ¶
func NewHTTPClient(client *http.Client) *HTTPClient
func (*HTTPClient) Do ¶
func (c *HTTPClient) Do(ctx context.Context, method, urlStr string, opts *RequestOptions, out interface{}) error
type RelayClient ¶
type RelayClient struct {
// contains filtered or unexported fields
}
RelayClient provides access to Polymarket relayer endpoints.
func NewRelayClient ¶
func NewRelayClient(relayerURL string, chainID int64, signer signer.Signer, builderConfig *BuilderConfig, relayTxType types.RelayerTxType) (*RelayClient, error)
func (*RelayClient) Deploy ¶
func (c *RelayClient) Deploy(ctx context.Context) (*ClientRelayerTransactionResponse, error)
Deploy deploys a Safe contract.
func (*RelayClient) Execute ¶
func (c *RelayClient) Execute(ctx context.Context, txns []types.Transaction, metadata string) (*ClientRelayerTransactionResponse, error)
Execute executes a batch of transactions.
func (*RelayClient) GetDeployed ¶
func (*RelayClient) GetNonce ¶
func (c *RelayClient) GetNonce(ctx context.Context, signerAddress string, signerType string) (types.NoncePayload, error)
func (*RelayClient) GetRelayPayload ¶
func (c *RelayClient) GetRelayPayload(ctx context.Context, signerAddress string, signerType string) (types.RelayPayload, error)
func (*RelayClient) GetTransaction ¶
func (c *RelayClient) GetTransaction(ctx context.Context, transactionID string) ([]types.RelayerTransaction, error)
func (*RelayClient) GetTransactions ¶
func (c *RelayClient) GetTransactions(ctx context.Context) ([]types.RelayerTransaction, error)
func (*RelayClient) PollUntilState ¶
func (c *RelayClient) PollUntilState(ctx context.Context, transactionID string, states []types.RelayerTransactionState, failState types.RelayerTransactionState, maxPolls int, pollFrequency time.Duration) (*types.RelayerTransaction, error)
func (*RelayClient) SetHTTPClient ¶
func (c *RelayClient) SetHTTPClient(client *HTTPClient)
SetHTTPClient allows overriding the underlying HTTP client.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
basic
command
|
|
|
end_to_end
command
|
|
|
remote_signer_server
command
|
|
|
internal
|
|
|
pkg
|
|
|
errors
Package errors provides unified error definitions for the SDK.
|
Package errors provides unified error definitions for the SDK. |
|
logger
Package logger provides a unified logging interface for the SDK.
|
Package logger provides a unified logging interface for the SDK. |