Documentation
¶
Index ¶
- Variables
- func CreateAccount(keystorePath string, args *AccountCreateArgs) (accounts.Account, error)
- func ImportAccount(keystorePath string, args *AccountImportArgs) (common.Address, error)
- func ImportPrivKey(keystorePath string, args *AccountImportPrivKeyArgs) (common.Address, error)
- func ParseAccount(args *AccountUseArgs) (common.Address, error)
- type AccountCreateArgs
- type AccountImportArgs
- type AccountImportPrivKeyArgs
- type AccountUseArgs
- type CallArgs
- type EthClient
- func (cli *EthClient) Allowance(ctx context.Context, from, spender, asset common.Address) (amount *big.Int, err error)
- func (cli *EthClient) AllowancesMap(ctx context.Context, from, spender common.Address, assets []common.Address) map[common.Address]*big.Int
- func (cli *EthClient) Approve(call *CallArgs, asset, spender common.Address, value *big.Int) (txHash common.Hash, err error)
- func (cli *EthClient) BalanceOf(ctx context.Context, owner, asset common.Address) (amount *big.Int, err error)
- func (cli *EthClient) BalancesMap(ctx context.Context, owner common.Address, assets []common.Address) map[common.Address]*big.Int
- func (cli *EthClient) ContractAddress(contract EthContract) common.Address
- func (cli *EthClient) Contracts() map[EthContract]common.Address
- func (cli *EthClient) CreateAndSignDerivativesOrder(call *CallArgs, makerAssetData, takerAssetData []byte, ...) (*zeroex.SignedOrder, error)
- func (cli *EthClient) CreateAndSignOrder(call *CallArgs, feeRecipientAddress common.Address, ...) (*zeroex.SignedOrder, error)
- func (cli *EthClient) CreateAndSignTransaction_BatchCancelOrders(call *CallArgs, exchangeAddress common.Address, ...) (*zeroex.SignedTransaction, error)
- func (cli *EthClient) CreateAndSignTransaction_BatchMatchOrdersWithMaximalFill(call *CallArgs, exchangeAddress common.Address, ...) (*zeroex.SignedTransaction, error)
- func (cli *EthClient) CreateAndSignTransaction_CancelOrder(call *CallArgs, exchangeAddress common.Address, ...) (*zeroex.SignedTransaction, error)
- func (cli *EthClient) CreateAndSignTransaction_FillOrders(call *CallArgs, exchangeAddress common.Address, ...) (*zeroex.SignedTransaction, error)
- func (cli *EthClient) CreateAndSignTransaction_MarketBuyOrders(call *CallArgs, exchangeAddress common.Address, ...) (*zeroex.SignedTransaction, error)
- func (cli *EthClient) CreateAndSignTransaction_MarketSellOrders(call *CallArgs, exchangeAddress common.Address, ...) (*zeroex.SignedTransaction, error)
- func (cli *EthClient) EthBalance(ctx context.Context, address common.Address) (*big.Int, error)
- func (cli *EthClient) EthUnwrap(call *CallArgs, amount *big.Int) (txHash common.Hash, err error)
- func (cli *EthClient) EthWrap(call *CallArgs, amount *big.Int) (txHash common.Hash, err error)
- func (cli *EthClient) Ethereum() manager.EthManager
- func (cli *EthClient) ExecuteTransaction(call *CallArgs, zeroExTx *zeroex.SignedTransaction, approvalSignature []byte) (txHash common.Hash, err error)
- func (cli *EthClient) GetOrderRelevantStates(ctx context.Context, orders []wrappers.Order, signatures [][]byte) (struct{ ... }, error)
- func (cli *EthClient) GetTransferableAssetAmount(ctx context.Context, ownerAddress common.Address) (amount *big.Int, err error)
- func (cli *EthClient) GetZeroExOrderRelevantStates(ctx context.Context, orders []wrappers.Order, signatures [][]byte) (struct{ ... }, error)
- func (cli *EthClient) SetDefaultFromAddress(address common.Address)
- func (cli *EthClient) SignOrder(call *CallArgs, order *zeroex.Order) (*zeroex.SignedOrder, error)
- func (cli *EthClient) SignTransaction(call *CallArgs, tx *zeroex.Transaction) (*zeroex.SignedTransaction, error)
- func (cli *EthClient) TokenLock(call *CallArgs, asset common.Address) (txHash common.Hash, err error)
- func (cli *EthClient) TokenUnlock(call *CallArgs, asset common.Address) (txHash common.Hash, err error)
- type EthContract
- type WalletSpec
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrAlreadyLocked = errors.New("token aleady locked") ErrAlreadyUnlocked = errors.New("token aleady unlocked") )
View Source
var ( ErrInsufficientEthBalance = errors.New("insufficient ETH balance") ErrInsufficientWethBalance = errors.New("insufficient WETH balance") )
View Source
var UnlimitedAllowance = big.NewInt(0).Sub(big.NewInt(0).Exp(big.NewInt(2), big.NewInt(256), nil), big.NewInt(1))
UnlimitedAllowance is uint constant MAX_UINT = 2**256 - 1
Functions ¶
func CreateAccount ¶
func CreateAccount(keystorePath string, args *AccountCreateArgs) (accounts.Account, error)
func ImportAccount ¶
func ImportAccount(keystorePath string, args *AccountImportArgs) (common.Address, error)
func ImportPrivKey ¶
func ImportPrivKey(keystorePath string, args *AccountImportPrivKeyArgs) (common.Address, error)
func ParseAccount ¶
func ParseAccount(args *AccountUseArgs) (common.Address, error)
Types ¶
type AccountCreateArgs ¶
type AccountImportArgs ¶
type AccountImportArgs struct {
FilePath string
}
type AccountUseArgs ¶
type AccountUseArgs struct {
Address string
}
type EthClient ¶
type EthClient struct {
// contains filtered or unexported fields
}
func New ¶
func New( ks keystore.EthKeyStore, ethManager manager.EthManager, defaultFromAddress common.Address, contractAddresses map[EthContract]common.Address, allowGasOracles bool, ) (*EthClient, error)
func (*EthClient) AllowancesMap ¶
func (*EthClient) BalancesMap ¶
func (*EthClient) ContractAddress ¶
func (cli *EthClient) ContractAddress(contract EthContract) common.Address
func (*EthClient) CreateAndSignDerivativesOrder ¶
func (*EthClient) CreateAndSignOrder ¶
func (*EthClient) CreateAndSignTransaction_BatchCancelOrders ¶
func (cli *EthClient) CreateAndSignTransaction_BatchCancelOrders( call *CallArgs, exchangeAddress common.Address, signedOrders []*zeroex.SignedOrder, ) (*zeroex.SignedTransaction, error)
func (*EthClient) CreateAndSignTransaction_BatchMatchOrdersWithMaximalFill ¶
func (cli *EthClient) CreateAndSignTransaction_BatchMatchOrdersWithMaximalFill( call *CallArgs, exchangeAddress common.Address, signedOrders []*zeroex.SignedOrder, signedOrder *zeroex.SignedOrder, ) (*zeroex.SignedTransaction, error)
func (*EthClient) CreateAndSignTransaction_CancelOrder ¶
func (cli *EthClient) CreateAndSignTransaction_CancelOrder( call *CallArgs, exchangeAddress common.Address, signedOrder *zeroex.SignedOrder, ) (*zeroex.SignedTransaction, error)
func (*EthClient) CreateAndSignTransaction_FillOrders ¶
func (*EthClient) CreateAndSignTransaction_MarketBuyOrders ¶
func (*EthClient) CreateAndSignTransaction_MarketSellOrders ¶
func (*EthClient) EthBalance ¶
func (*EthClient) Ethereum ¶
func (cli *EthClient) Ethereum() manager.EthManager
func (*EthClient) ExecuteTransaction ¶
func (*EthClient) GetOrderRelevantStates ¶
func (*EthClient) GetTransferableAssetAmount ¶
func (*EthClient) GetZeroExOrderRelevantStates ¶
func (*EthClient) SetDefaultFromAddress ¶
func (*EthClient) SignTransaction ¶
func (cli *EthClient) SignTransaction(call *CallArgs, tx *zeroex.Transaction) (*zeroex.SignedTransaction, error)
type EthContract ¶
type EthContract string
const ( EthContractERC20Proxy EthContract = "erc20proxy" EthContractWETH9 EthContract = "weth9" EthContractExchange EthContract = "exchange" EthContractDevUtils EthContract = "devUtils" EthContractFutures EthContract = "futures" EthContractCoordinator EthContract = "coordinator" )
type WalletSpec ¶
type WalletSpec struct { Address string `json:"address"` ID string `json:"id"` Version int `json:"version"` Path string `json:"-"` }
func (*WalletSpec) HexToAddress ¶
func (spec *WalletSpec) HexToAddress() common.Address
Click to show internal directories.
Click to hide internal directories.