Documentation ¶
Index ¶
- Constants
- Variables
- func EncodePublicDataToAddress(public []byte, chainnet string) (string, error)
- func EncodePublicKeyToAddress(publicKey, chainnet string) (string, error)
- func FetchTransactionDetail(hashString, chainnet string) (*base.TransactionDetail, error)deprecated
- func FetchTransactionStatus(hashString string, chainnet string) base.TransactionStatusdeprecated
- func IsValidAddress(address, chainnet string) bool
- func QueryBalance(address, chainnet string) (string, error)deprecated
- func QueryBalancePubkey(pubkey, chainnet string) (string, error)deprecated
- func SdkBatchTransactionStatus(hashListString string, chainnet string) stringdeprecated
- func SendRawTransaction(signedTx string, chainnet string) (string, error)deprecated
- type Account
- func (a *Account) Address() string
- func (a *Account) DecodeAddressToPublicKey(address string) (string, error)
- func (a *Account) DeriveAccountAt(chainnet string) (*Account, 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)
- type Chain
- func (c *Chain) BalanceOfAccount(account base.Account) (*base.Balance, error)
- func (c *Chain) BalanceOfAddress(address string) (*base.Balance, error)
- func (c *Chain) BalanceOfPublicKey(publicKey string) (*base.Balance, error)
- func (c *Chain) BatchFetchTransactionStatus(hashListString string) string
- func (c *Chain) Chain() base.Chain
- func (c *Chain) FetchTransactionDetail(hash string) (*base.TransactionDetail, error)
- func (c *Chain) FetchTransactionStatus(hash string) base.TransactionStatus
- func (c *Chain) MainToken() base.Token
- func (c *Chain) SendRawTransaction(signedTx string) (string, error)
- func (c *Chain) TokenInfo() (*base.TokenInfo, error)
- type FeeRate
- type Util
Constants ¶
const ( ChainSignet = "signet" ChainMainnet = "mainnet" // ComingChat used, similar mainnet's alias. ChainBitcoin = "bitcoin" )
Variables ¶
Functions ¶
func EncodePublicDataToAddress ¶ added in v0.2.0
func EncodePublicKeyToAddress ¶ added in v0.2.0
@param publicKey can start with 0x or not.
func FetchTransactionDetail
deprecated
added in
v0.1.5
func FetchTransactionDetail(hashString, chainnet string) (*base.TransactionDetail, error)
Deprecated: FetchTransactionDetail is deprecated. Please Use Chain.FetchTransactionDetail() instead.
func FetchTransactionStatus
deprecated
added in
v0.1.5
func FetchTransactionStatus(hashString string, chainnet string) base.TransactionStatus
Deprecated: FetchTransactionStatus is deprecated. Please Use Chain.FetchTransactionStatus() instead.
func QueryBalance
deprecated
added in
v0.1.5
func QueryBalancePubkey
deprecated
added in
v0.1.5
func SdkBatchTransactionStatus
deprecated
added in
v0.1.5
func SendRawTransaction
deprecated
added in
v0.1.5
Types ¶
type Account ¶ added in v0.2.0
type Account struct { Chainnet string // contains filtered or unexported fields }
func NewAccountWithMnemonic ¶ added in v0.2.0
func (*Account) DecodeAddressToPublicKey ¶ added in v0.2.2
@return publicKey that will start with 0x.
func (*Account) DeriveAccountAt ¶ added in v0.2.0
func (*Account) EncodePublicKeyToAddress ¶ added in v0.2.2
@param publicKey can start with 0x or not.
func (*Account) IsValidAddress ¶ added in v0.2.2
func (*Account) PrivateKey ¶ added in v0.2.0
@return privateKey data
func (*Account) PrivateKeyHex ¶ added in v0.2.0
@return privateKey string that will start with 0x.
func (*Account) PublicKeyHex ¶ added in v0.2.0
@return publicKey string that will start with 0x.
type Chain ¶ added in v0.2.0
type Chain struct {
*Util
}
func NewChainWithChainnet ¶ added in v0.2.0
func (*Chain) BalanceOfAccount ¶ added in v0.2.0
func (*Chain) BalanceOfAddress ¶ added in v0.2.0
func (*Chain) BalanceOfPublicKey ¶ added in v0.2.0
func (*Chain) BatchFetchTransactionStatus ¶ added in v0.2.0
func (*Chain) FetchTransactionDetail ¶ added in v0.2.0
func (c *Chain) FetchTransactionDetail(hash string) (*base.TransactionDetail, error)
Fetch transaction details through transaction hash Note: The input parsing of bitcoin is very complex and the network cost is relatively high, So only the status and timestamp can be queried.
func (*Chain) FetchTransactionStatus ¶ added in v0.2.0
func (c *Chain) FetchTransactionStatus(hash string) base.TransactionStatus
func (*Chain) SendRawTransaction ¶ added in v0.2.0
Send the raw transaction on-chain @return the hex hash string
type FeeRate ¶ added in v0.2.3
func SuggestFeeRate ¶ added in v0.2.3
type Util ¶ added in v0.2.0
type Util struct {
Chainnet string
}
func NewUtilWithChainnet ¶ added in v0.2.0
func (*Util) DecodeAddressToPublicKey ¶ added in v0.2.0
Warning: Btc cannot support decode address to public key
func (*Util) EncodePublicDataToAddress ¶ added in v0.2.0
func (*Util) EncodePublicKeyToAddress ¶ added in v0.2.0
@param publicKey can start with 0x or not.