Documentation
¶
Index ¶
- Constants
- Variables
- func AddressPublic(address string, mnemonic string, passphrase string, sequence uint32) (string, error)
- func AddressSecret(address string, mnemonic string, passphrase string, sequence uint32) (string, error)
- func AddressWallet(mnemonic string, passphrase string, sequence uint32) (string, error)
- func GetBaseFeeMultiplier(baseFeeWei decimal.Decimal) decimal.Decimal
- func ValidateAddress(address string) bool
- func WalletPubKeyHash(mnemonic string, passphrase string, sequence uint32) (string, *btcec.PrivateKey, *btcec.PublicKey, error)
- type Config
- type EVM
- func (s *EVM) Blockchain() wconstants.BlockchainType
- func (s *EVM) EstimateFee(ctx context.Context) (*EstimateFeeResult, error)
- func (s *EVM) EstimateTransfer(ctx context.Context, fromAddress, toAddress, assetIdentifier string, ...) (*EstimateTransferResult, error)
- func (s *EVM) Name() string
- func (s *EVM) Node() *ethclient.Client
- func (s *EVM) Start(_ context.Context) error
- func (s *EVM) Stop(_ context.Context) error
- type EstimateFeeResult
- type EstimateTransferResult
- type EtherUnit
- type Unit
- type WalletSDK
Constants ¶
View Source
const ( // MaxGasLimit is the maximum gas limit for a transaction in wei MaxGasLimit = 70000 MaxGasPrice = 25000000000 )
View Source
const ( EVMAssetDecimals = 18 TransferFeeCoeff float64 = 1.007 )
Variables ¶
View Source
var UnitMap = map[EtherUnit]decimal.Decimal{ EtherUnitWei: decimal.NewFromInt(1), EtherUnitKWei: decimal.NewFromInt(1e3), EtherUnitMWei: decimal.NewFromInt(1e6), EtherUnitGWei: decimal.NewFromInt(1e9), EtherUnitSzabo: decimal.NewFromInt(1e12), EtherUnitFinney: decimal.NewFromInt(1e15), EtherUnitEther: decimal.NewFromInt(1e18), }
Functions ¶
func AddressPublic ¶
func AddressSecret ¶
func AddressWallet ¶
func ValidateAddress ¶
Types ¶
type Config ¶
type Config struct { NodeAddr string RPCOptions []rpc.ClientOption Blockchain wconstants.BlockchainType }
type EVM ¶
type EVM struct {
// contains filtered or unexported fields
}
func (*EVM) Blockchain ¶
func (s *EVM) Blockchain() wconstants.BlockchainType
Blockchain returns the blockchain type
func (*EVM) EstimateFee ¶
func (s *EVM) EstimateFee(ctx context.Context) (*EstimateFeeResult, error)
type EstimateFeeResult ¶
type EstimateFeeResult struct { // MaxFeePerGas is the maximum fee per gas in Wei MaxFeePerGas decimal.Decimal `json:"max_fee_per_gas"` // SuggestGasTipCap is the suggested gas tip cap in Wei SuggestGasTipCap decimal.Decimal `json:"suggest_gas_tip_cap"` // SuggestGasPrice is the suggested gas price in Wei SuggestGasPrice decimal.Decimal `json:"suggest_gas_price"` }
EstimateFeeResult represents the result of the fee estimation
All values are in Wei
type EstimateTransferResult ¶
type EstimateTransferResult struct { Estimate EstimateFeeResult `json:"estimate"` EstimateGasAmount decimal.Decimal `json:"estimate_gas_amount"` TotalFeeAmount decimal.Decimal `json:"total_fee_amount"` TotalGasPrice decimal.Decimal `json:"total_gas_price"` GasTipCap decimal.Decimal `json:"gas_tip_cap"` }
type Unit ¶
type Unit struct {
// contains filtered or unexported fields
}
Unit represents a currency value in the Ethereum blockchain. by default, the value is in Wei.
func NewUnitFromBigInt ¶
NewUnitFromBigInt creates a new currency value with the given big integer value and unit.
Click to show internal directories.
Click to hide internal directories.