sign

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EIP712Signature

func EIP712Signature(typedData core.TypedData, hexPrivateKey string) ([]byte, []byte, error)

func Ed25519Signature

func Ed25519Signature(privateKey, message []byte) []byte

func EthSignature

func EthSignature(data []byte, hexPrivateKey string) ([]byte, error)

func GenerateAddressByArgs

func GenerateAddressByArgs(net common.DasNetType, args string) (string, error)

func GetSignedPubKey

func GetSignedPubKey(rawByte []byte, sign []byte) (*ecdsa.PublicKey, error)

func PersonalSignature

func PersonalSignature(data []byte, hexPrivateKey string) ([]byte, error)

func TronSignature

func TronSignature(signType bool, data []byte, hexPrivateKey string) ([]byte, error)

func TronVerifySignature

func TronVerifySignature(signType bool, sign []byte, rawByte []byte, base58Addr string) bool

func VerifyEIP712Signature

func VerifyEIP712Signature(typedData core.TypedData, sign []byte, address string) (bool, error)

func VerifyEd25519Signature

func VerifyEd25519Signature(publicKey, message, sig []byte) bool

func VerifyEthSignature

func VerifyEthSignature(sign []byte, rawByte []byte, address string) (bool, error)

func VerifyPersonalSignature

func VerifyPersonalSignature(sign []byte, rawByte []byte, address string) (bool, error)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, apiUrl string) (*Client, error)

func (*Client) Client

func (c *Client) Client() rpc.Client

func (*Client) SignCkbMessage

func (c *Client) SignCkbMessage(ckbSignerAddress, message string) ([]byte, error)

type HandleSignCkbMessage

type HandleSignCkbMessage func(message string) ([]byte, error)

func LocalSign

func LocalSign(privateKey string) HandleSignCkbMessage

func RemoteSign

func RemoteSign(c *Client, net common.DasNetType, args string) HandleSignCkbMessage

Jump to

Keyboard shortcuts

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