eip712

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: LGPL-3.0 Imports: 28 Imported by: 0

Documentation

Overview

Copyright 2023 Streakk Foundation This file is part of Streakk' Ethermint library.

The Ethermint library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The Ethermint library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the Ethermint library.

Copyright 2023 Streakk Foundation This file is part of Streakk' Ethermint library.

The Ethermint library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The Ethermint library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the Ethermint library.

Copyright 2023 Streakk Foundation This file is part of Streakk' Ethermint library.

The Ethermint library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

The Ethermint library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with the Ethermint library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEIP712BytesForMsg

func GetEIP712BytesForMsg(signDocBytes []byte) ([]byte, error)

Get the EIP-712 object bytes for the given SignDoc bytes by first decoding the bytes into an EIP-712 object, then hashing the EIP-712 object to create the bytes to be signed. See https://eips.ethereum.org/EIPS/eip-712 for more.

func GetEIP712TypedDataForMsg

func GetEIP712TypedDataForMsg(signDocBytes []byte) (apitypes.TypedData, error)

GetEIP712TypedDataForMsg returns the EIP-712 TypedData representation for either Amino or Protobuf encoded signature doc bytes.

func PreprocessLedgerTx

func PreprocessLedgerTx(chainID string, keyType cosmoskr.KeyType, txBuilder client.TxBuilder) error

PreprocessLedgerTx reformats Ledger-signed Cosmos transactions to match the fork expected by Ethermint by including the signature in a Web3Tx extension and sending a blank signature in the body.

func SetEncodingConfig

func SetEncodingConfig(cfg params.EncodingConfig)

SetEncodingConfig set the encoding config to the singleton codecs (Amino and Protobuf). The process of unmarshaling SignDoc bytes into a SignDoc object requires having a codec populated with all relevant message types. As a result, we must call this method on app initialization with the app's encoding config.

func WrapTxToTypedData

func WrapTxToTypedData(
	cdc codectypes.AnyUnpacker,
	chainID uint64,
	msg sdk.Msg,
	data []byte,
	feeDelegation *FeeDelegationOptions,
) (apitypes.TypedData, error)

WrapTxToTypedData is an ultimate method that wraps Amino-encoded Cosmos Tx JSON data into an EIP712-compatible TypedData request.

Types

type FeeDelegationOptions

type FeeDelegationOptions struct {
	FeePayer sdk.AccAddress
}

Jump to

Keyboard shortcuts

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