withdrawals

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompleteEthWithdrawal

func CompleteEthWithdrawal(
	ctx context.Context,
	ethClient *ethereumutil.Client,
	clientAPI *api.APIClient,
	l1signer signers.L1Signer,
	starkKeyHex string,
) (*eth.Transaction, error)

CompleteEthWithdrawal performs the complete withdrawal workflow for ETH

func PrepareWithdrawal

func PrepareWithdrawal(
	ctx context.Context,
	withdrawalsAPI api.WithdrawalsApi,
	l1signer signers.L1Signer,
	l2signer signers.L2Signer,
	request api.GetSignableWithdrawalRequest,
) (*api.CreateWithdrawalResponse, error)

PrepareWithdrawal submits a withdrawal request for ETH, ERC20 and ERC721 tokens to be included in the generation and submission of the next batch. Upon batch confirmation (on-chain state update), the asset is available to be withdrawn by the initial owner / originator of the asset.

Types

type ERC20Withdrawal

type ERC20Withdrawal struct {
	TokenAddress string
}

ERC20Withdrawal implements TokenWithdrawal. Used for withdrawal of ERC20 Tokens.

func NewERC20Withdrawal

func NewERC20Withdrawal(tokenAddress string) *ERC20Withdrawal

NewERC20Withdrawal instantiates a new ERC20Withdrawal object with the given tokenAddress.

func (*ERC20Withdrawal) CompleteWithdrawal

func (w *ERC20Withdrawal) CompleteWithdrawal(
	ctx context.Context,
	ethClient *ethereumutil.Client,
	clientAPI *api.APIClient,
	l1signer signers.L1Signer,
	starkKeyHex string,
) (*eth.Transaction, error)

CompleteWithdrawal performs the complete withdrawal workflow on ERC20Withdrawal

type ERC721Withdrawal

type ERC721Withdrawal struct {
	TokenID      string
	TokenAddress string
}

ERC721Withdrawal implements TokenWithdrawal. Used for withdrawal of ERC721 Tokens.

func NewERC721Withdrawal

func NewERC721Withdrawal(tokenID, tokenAddress string) *ERC721Withdrawal

NewERC721Withdrawal instantiates a new ERC721Withdrawal object with the given tokenId and tokenAddress.

func (*ERC721Withdrawal) CompleteWithdrawal

func (w *ERC721Withdrawal) CompleteWithdrawal(
	ctx context.Context,
	ethClient *ethereumutil.Client,
	clientAPI *api.APIClient,
	l1signer signers.L1Signer,
	starkKeyHex string,
) (*eth.Transaction, error)

CompleteWithdrawal performs the completion step of the withdrawal process for ERC721 token.

type TokenWithdrawal

type TokenWithdrawal interface {
	CompleteWithdrawal(ctx context.Context, ethClient *ethereumutil.Client, clientAPI *api.APIClient, l1signer signers.L1Signer, starkPublicKey string) (*eth.Transaction, error)
}

Jump to

Keyboard shortcuts

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