blockchain

package
v1.6.8 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: GPL-3.0 Imports: 26 Imported by: 0

README

Smart contract Golang Binding

When changes are made to the smart contracts function signatures it is necessary to regenerate the Golang bindings so that the core projects stays compatible. For more info check the Smart Contract Readme.

To generate a contract.go from an ABI

  • Go to https://geth.ethereum.org/downloads/ and download the most recent Geth & Tools
  • Copy "abigen" to $GOPATH/bin
  • Run $GOPATH/bin/abigen --abi [ABI FILE] --pkg wallet --type [name of contract] --out [output file] Example:
$GOPATH/bin/abigen --abi ~/Projects/Proxeus/wallet-blockchain/DocumentRegistry.abi --pkg wallet --type DocumentRegistry --out ~/Projects/Proxeus/wallet-blockchain/documentRegistry.go

Documentation

Index

Constants

View Source
const ProxeusFSABI = "" /* 1733-byte string literal not displayed */

ProxeusFSABI is the input ABI used to generate the binding from.

View Source
const TokenABI = "" /* 2144-byte string literal not displayed */

TokenABI is the input ABI used to generate the binding from.

View Source
const XesMainTokenABI = "" /* 2670-byte string literal not displayed */

XesMainTokenABI is the input ABI used to generate the binding from.

Variables

View Source
var ErrInvalidSignature = errors.New("login.error.invalidSignature")

Special error returned when signature verification fails

View Source
var TestChannelPayment chan types.Log
View Source
var TestChannelSignature chan types.Log

Functions

func CreateSignInChallenge

func CreateSignInChallenge(i18nMessage string) string

Returns an hex string representation of a message to be used for login challenge. The challenge is prefixed by a human-readable message so that it can be displayed on Metamask. The challenge itself is an hex string of 32 random bytes.

func FreeEth

func FreeEth(walletAddress string)

func FreeXES

func FreeXES(walletAddress string)

FreeXES sends testnet XES to given wallet address

func GiveTokens

func GiveTokens(toWallet string)

func NewAdapter

func NewAdapter(XESContractAddress string, XESABI abi.ABI) *xesAdapter

func NewDummyLogSubscriber

func NewDummyLogSubscriber() *dummyLogSubscriber

func NewWebSocketLogSubscriber

func NewWebSocketLogSubscriber(ethDialler ethglue.ETHDiallerIF, webSocketURL, contract string) *webSocketLogSubscriber

func VerifySignInChallenge

func VerifySignInChallenge(challengeHex, signatureHex string) (addressHex string, err error)

Verifies if the given signature matches the provided challenge and returns the address of the wallet that made the signature.

Types

type Adapter

type Adapter interface {
	GetContractAddress() string
	EventFromLog(out interface{}, lg *types.Log, eventType string) error
}

type LogSubscriber

type LogSubscriber interface {
	Subscribe(ctx context.Context, logs chan<- types.Log, sub chan<- ethereum.Subscription)
	GetContractAddress() string
	String() string
}

type PaymentListener

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

func NewPaymentListener

func NewPaymentListener(xesAdapter Adapter, workflowPaymentsDB storage.WorkflowPaymentsIF, logSubscriber LogSubscriber) *PaymentListener

func (*PaymentListener) Listen

func (me *PaymentListener) Listen(ctx context.Context)

type ProxeusFSFileSignedEvent

type ProxeusFSFileSignedEvent struct {
	Hash   [32]byte
	Signer common.Address
	Raw    types.Log // Blockchain specific contextual infos
}

ProxeusFSFileSignedEvent represents a FileSignedEvent event raised by the ProxeusFS contract.

type Signaturelistener

type Signaturelistener struct {
	ProxeusFSABI abi.ABI
	// contains filtered or unexported fields
}

func NewSignatureListener

func NewSignatureListener(SignatureRequestsDB storage.SignatureRequestsIF,
	UserDB storage.UserIF, EmailSender email.EmailSender, ProxeusFSABI abi.ABI, domain string, logSubscriber LogSubscriber) *Signaturelistener

func (*Signaturelistener) Listen

func (me *Signaturelistener) Listen(ctx context.Context)

type Token

type Token struct {
	TokenCaller     // Read-only binding to the contract
	TokenTransactor // Write-only binding to the contract
	TokenFilterer   // Log filterer for contract events
}

Token is an auto generated Go binding around an Ethereum contract.

func NewToken

func NewToken(address common.Address, backend bind.ContractBackend) (*Token, error)

NewToken creates a new instance of Token, bound to a specific deployed contract.

type TokenCaller

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

TokenCaller is an auto generated read-only Go binding around an Ethereum contract.

type TokenCallerRaw

type TokenCallerRaw struct {
	Contract *TokenCaller // Generic read-only contract binding to access the raw methods on
}

TokenCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.

type TokenCallerSession

type TokenCallerSession struct {
	Contract *TokenCaller  // Generic contract caller binding to set the session for
	CallOpts bind.CallOpts // Call options to use throughout this session
}

TokenCallerSession is an auto generated read-only Go binding around an Ethereum contract, with pre-set call options.

type TokenFilterer

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

TokenFilterer is an auto generated log filtering Go binding around an Ethereum contract events.

type TokenRaw

type TokenRaw struct {
	Contract *Token // Generic contract binding to access the raw methods on
}

TokenRaw is an auto generated low-level Go binding around an Ethereum contract.

type TokenSession

type TokenSession struct {
	Contract     *Token            // Generic contract binding to set the session for
	CallOpts     bind.CallOpts     // Call options to use throughout this session
	TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}

TokenSession is an auto generated Go binding around an Ethereum contract, with pre-set call and transact options.

type TokenTransactor

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

TokenTransactor is an auto generated write-only Go binding around an Ethereum contract.

func (*TokenTransactor) Transfer

func (_Token *TokenTransactor) Transfer(opts *bind.TransactOpts, _to common.Address, _value *big.Int) (*types.Transaction, error)

Transfer is a paid mutator transaction binding the contract method 0xa9059cbb.

Solidity: function transfer(_to address, _value uint256) returns()

type TokenTransactorRaw

type TokenTransactorRaw struct {
	Contract *TokenTransactor // Generic write-only contract binding to access the raw methods on
}

TokenTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.

type TokenTransactorSession

type TokenTransactorSession struct {
	Contract     *TokenTransactor  // Generic contract transactor binding to set the session for
	TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}

TokenTransactorSession is an auto generated write-only Go binding around an Ethereum contract, with pre-set transact options.

type XesMainTokenTransfer

type XesMainTokenTransfer struct {
	FromAddress common.Address
	ToAddress   common.Address
	Value       *big.Int
	Raw         types.Log // Blockchain specific contextual infos
}

XesMainTokenTransfer represents a Transfer event raised by the XesMainToken contract.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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