Documentation
¶
Overview ¶
This file implements python Hyperliquid's signing utils in golang. ref: https://github.com/hyperliquid-dex/hyperliquid-python-sdk/tree/a8edca1
Index ¶
Constants ¶
View Source
const ( MainnetAPI = "https://api.hyperliquid.xyz" TestnetAPI = "https://api.hyperliquid-testnet.xyz" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionEVMUserModify ¶
type ActionPayload ¶
type ActionPayload struct {
Action any `json:"action"` // The action to be performed
Nonce uint64 `json:"nonce"` // Nonce for the action
Signature SigRSV `json:"signature"` // Signature of the action
}
ActionPayload is the payload structure for actions sent to the Hypercore API.
type Client ¶
type Client interface {
// UseBigBlocks enables the use of big ETH-RPC blocks for account associated with the signer.
UseBigBlocks(ctx context.Context) error
}
Client defines the interface for the hypercore client.
func NewTestnetClient ¶
NewTestnetClient creates a new hypercore testnet client.
type PhantomAgent ¶
type PhantomAgent struct {
Source string `json:"source"` // "a" for mainnet, "b" for testnet
ConnectionID [32]byte `json:"connectionId"` // Hash of action data
}
PhantomAgent is a HL core concept that wraps an "action" for use in EIP-712 messages.
type Signer ¶
func NewFireblocksSigner ¶
func NewFireblocksSigner(client fireblocks.Client, addr common.Address) Signer
NewFireblocksSigner returns a new Signer that uses Fireblocks to sign messages.
func NewPrivateKeySigner ¶
func NewPrivateKeySigner(privateKey *ecdsa.PrivateKey) Signer
NewPrivateKeySigner returns a new Signer that uses the provided ECDSA private key.
Click to show internal directories.
Click to hide internal directories.