Documentation ¶
Index ¶
- Constants
- func DecodeAddressToPublicKey(address string) (string, error)
- func EncodePublicKeyToAddress(publicKey string) (string, error)
- func IsValidAddress(address string) bool
- func NewAccountAddressFromHex(addr string) (*types.AccountAddress, error)
- func NewStructTag(tag string) (*types.StructTag, error)
- func NewU128FromString(number string) (*serde.Uint128, error)
- func StructTagToString(t types.StructTag) string
- type Account
- func (a *Account) AccountAddress() starTypes.AccountAddress
- func (a *Account) Address() string
- func (a *Account) DecodeAddressToPublicKey(address string) (string, error)
- func (a *Account) EncodePublicKeyToAddress(publicKey string) (string, error)
- func (a *Account) IsValidAddress(address string) bool
- func (a *Account) PrivateKey() ([]byte, error)
- func (a *Account) PrivateKeyHex() (string, error)
- func (a *Account) PublicKey() []byte
- func (a *Account) PublicKeyHex() string
- func (a *Account) Sign(message []byte, password string) ([]byte, error)
- func (a *Account) SignHex(messageHex string, password string) (*base.OptionalString, error)
- func (a *Account) StarcoinPrivateKey() starTypes.Ed25519PrivateKey
- func (a *Account) StarcoinPublicKey() starTypes.Ed25519PublicKey
- type Chain
- func (c *Chain) BalanceOfAccount(account base.Account) (*base.Balance, error)
- func (c *Chain) BalanceOfAddress(address string) (b *base.Balance, err error)
- func (c *Chain) BalanceOfPublicKey(publicKey string) (*base.Balance, error)
- func (c *Chain) BatchFetchTransactionStatus(hashListString string) string
- func (c *Chain) BuildRawUserTransaction(from *Account, payload types.TransactionPayload) (txn *types.RawUserTransaction, err error)
- func (c *Chain) EstimateTransactionFee(transaction base.Transaction) (fee *base.OptionalString, err error)
- func (c *Chain) EstimateTransactionFeeUsePublicKey(transaction base.Transaction, pubkey string) (fee *base.OptionalString, err error)
- func (c *Chain) FetchTransactionDetail(hash string) (detail *base.TransactionDetail, err error)
- func (c *Chain) FetchTransactionStatus(hash string) base.TransactionStatus
- func (c *Chain) GasPrice() (*base.OptionalString, error)
- func (c *Chain) MainToken() base.Token
- func (c *Chain) SendRawTransaction(signedTx string) (hash string, err error)
- type Token
- func (t *Token) BalanceOfAccount(account base.Account) (*base.Balance, error)
- func (t *Token) BalanceOfAddress(address string) (b *base.Balance, err error)
- func (t *Token) BalanceOfPublicKey(publicKey string) (*base.Balance, error)
- func (t *Token) BuildTransfer(sender, receiver, amount string) (txn base.Transaction, err error)
- func (t *Token) BuildTransferAll(sender, receiver string) (txn base.Transaction, err error)
- func (t *Token) BuildTransferPayload(receiverAddress, amount string) (p types.TransactionPayload, err error)
- func (t *Token) BuildTransferTx(privateKey, receiverAddress, amount string) (*base.OptionalString, error)
- func (t *Token) BuildTransferTxWithAccount(account *Account, receiverAddress, amount string) (s *base.OptionalString, err error)
- func (t *Token) CanTransferAll() bool
- func (t *Token) Chain() base.Chain
- func (t *Token) EstimateFees(account *Account, receiverAddress, amount string) (f *base.OptionalString, err error)
- func (t *Token) TokenInfo() (*base.TokenInfo, error)
- type Util
Constants ¶
View Source
const (
MaxGasAmount = client.DEFAULT_MAX_GAS_AMOUNT
)
Variables ¶
This section is empty.
Functions ¶
func EncodePublicKeyToAddress ¶
@param publicKey can start with 0x or not.
func NewAccountAddressFromHex ¶
func NewAccountAddressFromHex(addr string) (*types.AccountAddress, error)
func StructTagToString ¶
Types ¶
type Account ¶
type Account struct { AuthKey []byte // contains filtered or unexported fields }
func AccountWithPrivateKey ¶
func AsStarcoinAccount ¶
func NewAccountWithMnemonic ¶
func (*Account) AccountAddress ¶
func (a *Account) AccountAddress() starTypes.AccountAddress
func (*Account) DecodeAddressToPublicKey ¶
@return publicKey that will start with 0x.
func (*Account) EncodePublicKeyToAddress ¶
@param publicKey can start with 0x or not.
func (*Account) IsValidAddress ¶
func (*Account) PrivateKeyHex ¶
@return privateKey string that will start with 0x.
func (*Account) PublicKeyHex ¶
@return publicKey string that will start with 0x.
func (*Account) StarcoinPrivateKey ¶
func (a *Account) StarcoinPrivateKey() starTypes.Ed25519PrivateKey
func (*Account) StarcoinPublicKey ¶
func (a *Account) StarcoinPublicKey() starTypes.Ed25519PublicKey
type Chain ¶
type Chain struct { RpcUrl string // contains filtered or unexported fields }
func NewChainWithRpc ¶
func (*Chain) BalanceOfAccount ¶
func (*Chain) BalanceOfAddress ¶
func (*Chain) BalanceOfPublicKey ¶
func (*Chain) BatchFetchTransactionStatus ¶
func (*Chain) BuildRawUserTransaction ¶
func (c *Chain) BuildRawUserTransaction(from *Account, payload types.TransactionPayload) (txn *types.RawUserTransaction, err error)
func (*Chain) EstimateTransactionFee ¶
func (c *Chain) EstimateTransactionFee(transaction base.Transaction) (fee *base.OptionalString, err error)
func (*Chain) EstimateTransactionFeeUsePublicKey ¶
func (c *Chain) EstimateTransactionFeeUsePublicKey(transaction base.Transaction, pubkey string) (fee *base.OptionalString, err error)
func (*Chain) FetchTransactionDetail ¶
func (c *Chain) FetchTransactionDetail(hash string) (detail *base.TransactionDetail, err error)
Fetch transaction details through transaction hash
func (*Chain) FetchTransactionStatus ¶
func (c *Chain) FetchTransactionStatus(hash string) base.TransactionStatus
type Token ¶
type Token struct {
// contains filtered or unexported fields
}
func NewMainToken ¶
func (*Token) BalanceOfAccount ¶
func (*Token) BalanceOfAddress ¶
func (*Token) BalanceOfPublicKey ¶
func (*Token) BuildTransfer ¶
func (t *Token) BuildTransfer(sender, receiver, amount string) (txn base.Transaction, err error)
func (*Token) BuildTransferAll ¶
func (t *Token) BuildTransferAll(sender, receiver string) (txn base.Transaction, err error)
func (*Token) BuildTransferPayload ¶
func (t *Token) BuildTransferPayload(receiverAddress, amount string) (p types.TransactionPayload, err error)
func (*Token) BuildTransferTx ¶
func (t *Token) BuildTransferTx(privateKey, receiverAddress, amount string) (*base.OptionalString, error)
func (*Token) BuildTransferTxWithAccount ¶
func (*Token) CanTransferAll ¶
func (*Token) EstimateFees ¶
type Util ¶
type Util struct { }
func (*Util) DecodeAddressToPublicKey ¶
Warning: Starcoin cannot support decode address to public key
func (*Util) EncodePublicKeyToAddress ¶
@param publicKey can start with 0x or not.
func (*Util) IsValidAddress ¶
Click to show internal directories.
Click to hide internal directories.