helpers

package
v0.0.0-...-b6e08ef Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 13 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Eip712OnboardingActionStruct = []map[string]string{
		{"type": "string", "name": "action"},
		{"type": "string", "name": "onlySignOn"},
	}
	Eip712OnboardingActionStructString = "dYdX(string action,string onlySignOn)"

	Eip712OnboardingActionStructTestnet = []map[string]string{
		{"type": "string", "name": "action"},
	}
	Eip712OnboardingActionStructStringTestnet = "dYdX(string action)"
	Eip712StructName                          = "dYdX"
	OnlySignOnDomainMainnet                   = "https://trade.dydx.exchange"
)

Functions

func CreateTypedSignature

func CreateTypedSignature(signature string, sigType int) string

func ExpireAfter

func ExpireAfter(duration time.Duration) string

func FromString

func FromString(input string) (u uuid.UUID, err error)

func GenerateQueryPath

func GenerateQueryPath(url string, params url.Values) string

func GetAccountId

func GetAccountId(address string) string

func HashString

func HashString(input string) string

func Must

func Must(u uuid.UUID, err error) uuid.UUID

func RandomClientId

func RandomClientId() string

func ToFloat

func ToFloat(s string) float64

func ToValues

func ToValues(i interface{}) (values url.Values)

Types

type EthKeySinger

type EthKeySinger struct {
	Address    string
	PrivateKey string
}

type EthSigner

type EthSigner interface {
	// contains filtered or unexported methods
}

type EthWeb3Signer

type EthWeb3Signer struct {
	Web3 *jsonrpc.Client
}

type SignOnboardingAction

type SignOnboardingAction struct {
	Signer    EthSigner
	NetworkId int
}

func NewSigner

func NewSigner(signer EthSigner, networkId int) *SignOnboardingAction

func (*SignOnboardingAction) GetDomainHash

func (a *SignOnboardingAction) GetDomainHash() string

func (*SignOnboardingAction) GetEIP712Message

func (a *SignOnboardingAction) GetEIP712Message(message map[string]interface{}) map[string]interface{}

func (*SignOnboardingAction) GetEIP712Struct

func (a *SignOnboardingAction) GetEIP712Struct() []map[string]string

func (*SignOnboardingAction) GetEIP712StructName

func (a *SignOnboardingAction) GetEIP712StructName() string

func (*SignOnboardingAction) GetEip712Hash

func (a *SignOnboardingAction) GetEip712Hash(structHash string) string

func (*SignOnboardingAction) GetHash

func (a *SignOnboardingAction) GetHash(action string) string

func (*SignOnboardingAction) Sign

func (a *SignOnboardingAction) Sign(signerAddress string, message map[string]interface{}) string

Jump to

Keyboard shortcuts

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