typed

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Definition

type Definition struct {
	Name string
	Type string
}

type Domain

type Domain struct {
	Name    string
	Version string
	ChainId string
}

func (Domain) FmtDefinitionEncoding

func (dm Domain) FmtDefinitionEncoding(field string) (fmtEnc []*big.Int)

encoding definition for standard Starknet Domain messages

type TypeDef

type TypeDef struct {
	Encoding    *big.Int
	Definitions []Definition
}

type TypedData

type TypedData struct {
	Types       map[string]TypeDef
	PrimaryType string
	Domain      Domain
	Message     TypedMessage
}

func NewTypedData

func NewTypedData(types map[string]TypeDef, pType string, dom Domain) (td TypedData, err error)

'typedData' interface for interacting and signing typed data in accordance with https://github.com/0xs34n/starknet.js/tree/develop/src/utils/typedData

func (TypedData) EncodeType

func (td TypedData) EncodeType(inType string) (enc string, err error)

func (TypedData) GetTypeHash

func (td TypedData) GetTypeHash(inType string) (ret *big.Int, err error)

func (TypedData) GetTypedMessageHash

func (td TypedData) GetTypedMessageHash(inType string, msg TypedMessage, sc curve.StarkCurve) (hash *big.Int, err error)

type TypedMessage

type TypedMessage interface {
	FmtDefinitionEncoding(string) []*big.Int
}

Jump to

Keyboard shortcuts

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