Documentation ¶
Index ¶
- func FormatStruct(v any) string
- type Balance
- type Block
- type BlockHeader
- type BroadcastResult
- type Client
- func (c *Client) BroadcastTx(rawHex string) (*BroadcastResult, error)
- func (c *Client) CheckUrchainHealth() (*Health, error)
- func (c *Client) DecodePSBT(psbtHex, blockchain string) (string, error)
- func (c *Client) GetAllN20Tokens() ([]*N20TokenInfo, error)
- func (c *Client) GetBalance(scriptHash string) (*Balance, error)
- func (c *Client) GetBalances(scriptHashs []string) (*Balance, error)
- func (c *Client) GetBlockHeader() (*BlockHeader, error)
- func (c *Client) GetNoteBlock(blockHash string) (*NoteBlock, error)
- func (c *Client) GetNoteContract(contractHash string) (*NoteContract, error)
- func (c *Client) GetNoteTxHistory(scriptHash string) ([]*NoteTxHistory, error)
- func (c *Client) GetNoteTxInfo(txId string) (*NoteTxInfo, error)
- func (c *Client) GetTokenBalanceByAddress(address, tick string) (*TokenBalance, error)
- func (c *Client) GetTokenBalanceByScriptHas(scriptHash, tick string) (*TokenBalance, error)
- func (c *Client) GetTokenInfo(tick string) (*N20TokenInfo, error)
- func (c *Client) GetTokenUtxos(scriptHashs []string, tick string) ([]*TokenUtxo, error)
- func (c *Client) GetTokensByAddress(address string) ([]*Token, error)
- func (c *Client) GetTokensByScriptHash(scriptHash string) ([]*Token, error)
- func (c *Client) GetTxHistory(scriptHash string) ([]*TxHistory, error)
- func (c *Client) GetUnspentUtxos(scriptHashs []string) ([]*Utxo, error)
- func (c *Client) RefreshUtxos(scriptHash string) error
- type Health
- type N20TokenInfo
- type N20TokenInfoResp
- type NoteBlock
- type NoteContract
- type NotePayload
- type NoteTx
- type NoteTxHistory
- type NoteTxHistoryResp
- type NoteTxInfo
- type Options
- type Token
- type TokenBalance
- type TokenUtxo
- type TxHistory
- type TxUnlock
- type Txo
- type Utxo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatStruct ¶
Types ¶
type Block ¶
type Block struct { Hash string `json:"hash"` Height int64 `json:"height"` Version int `json:"version"` VersionHex string `json:"versionHex"` Time int64 `json:"time"` Mediantime int64 `json:"mediantime"` Nonce string `json:"nonce"` Bits string `json:"bits"` Difficulty string `json:"difficulty"` Chainwork string `json:"chainwork"` NumTx int `json:"num_tx"` PreviousBlockHash string `json:"previousblockhash"` NextBlockHash string `json:"nextblockhash"` BlockSize int `json:"blockSize"` Coinbase string `json:"coinbase"` BlockSubsidy string `json:"blockSubsidy"` Merkleroot string `json:"merkleroot"` TotalFee string `json:"totalFee"` Miner string `json:"miner"` Reorg any `json:"reorg"` Blockchain string `json:"blockchain"` NoteMerkelRoot string `json:"noteMerkelRoot"` }
type BlockHeader ¶
type BroadcastResult ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) BroadcastTx ¶
func (c *Client) BroadcastTx(rawHex string) (*BroadcastResult, error)
BroadcastTx broadcast a raw bitcoin transaction
func (*Client) CheckUrchainHealth ¶
CheckUrchainHealth check urchain health
func (*Client) DecodePSBT ¶
DecodePSBT decode a PSBT
func (*Client) GetAllN20Tokens ¶
func (c *Client) GetAllN20Tokens() ([]*N20TokenInfo, error)
GetAllN20Tokens get all N20 tokens
func (*Client) GetBalance ¶
GetBalance get bitcoin balance of a script hash
func (*Client) GetBalances ¶
GetBalances get bitcoin balances of multiple script hashes
func (*Client) GetBlockHeader ¶
func (c *Client) GetBlockHeader() (*BlockHeader, error)
GetBlockHeader get the best bitcoin block header
func (*Client) GetNoteBlock ¶
GetNoteBlock get note block by block hash
func (*Client) GetNoteContract ¶
func (c *Client) GetNoteContract(contractHash string) (*NoteContract, error)
GetNoteContract get note contract by contract hash
func (*Client) GetNoteTxHistory ¶
func (c *Client) GetNoteTxHistory(scriptHash string) ([]*NoteTxHistory, error)
GetNoteTxHistory get note transaction history of a script hash
func (*Client) GetNoteTxInfo ¶
func (c *Client) GetNoteTxInfo(txId string) (*NoteTxInfo, error)
GetNoteTxInfo parse note transaction by tx id
func (*Client) GetTokenBalanceByAddress ¶
func (c *Client) GetTokenBalanceByAddress(address, tick string) (*TokenBalance, error)
GetTokenBalanceByAddress get token balance of an address
func (*Client) GetTokenBalanceByScriptHas ¶
func (c *Client) GetTokenBalanceByScriptHas(scriptHash, tick string) (*TokenBalance, error)
GetTokenBalanceByScriptHas get token balance of a script hash
func (*Client) GetTokenInfo ¶
func (c *Client) GetTokenInfo(tick string) (*N20TokenInfo, error)
GetTokenInfo get N20 token info by tick
func (*Client) GetTokenUtxos ¶
GetTokenUtxos get token utxos
func (*Client) GetTokensByAddress ¶
GetTokensByAddress get tokens of an address
func (*Client) GetTokensByScriptHash ¶
GetTokensByScriptHash get tokens of a script hash
func (*Client) GetTxHistory ¶
GetTxHistory get bitcoin transaction history of a script hash
func (*Client) GetUnspentUtxos ¶
GetUnspentUtxos get unspent bitcoin utxos of multiple script hashes
func (*Client) RefreshUtxos ¶
RefreshUtxos refresh bitcoin utxos of a script hash
type N20TokenInfo ¶
type N20TokenInfo struct { Inpoint string `json:"inpoint"` Blockchain string `json:"blockchain"` TxId string `json:"txId"` InputIndex int `json:"inputIndex"` Height int64 `json:"height"` BlockHash string `json:"blockHash"` BlockTime int64 `json:"blockTime"` IndexInBlock int `json:"indexInBlock"` IndexInChain int `json:"indexInChain"` AccountId string `json:"accountId"` Address string `json:"address"` P string `json:"p"` Tick string `json:"tick"` Max string `json:"max"` Lim string `json:"lim"` Dec int32 `json:"dec"` Uri string `json:"uri"` Idx string `json:"idx"` Code string `json:"code"` Sch string `json:"sch"` Time int64 `json:"time"` DeployOptions string `json:"deployOptions"` Total string `json:"total"` }
type N20TokenInfoResp ¶
type N20TokenInfoResp struct { Total int `json:"total"` Data []*N20TokenInfo `json:"data"` }
type NoteContract ¶
type NoteContract struct { Hash string `json:"hash"` Inpoint string `json:"inpoint"` Blockchain string `json:"blockchain"` TxId string `json:"txId"` InputIndex int `json:"inputIndex"` Height int64 `json:"height"` BlockHash string `json:"blockHash"` BlockTime int64 `json:"blockTime"` IndexInBlock int `json:"indexInBlock"` IndexInChain int `json:"indexInChain"` Name string `json:"name"` Code string `json:"code"` AccountId string `json:"accountId"` Time int64 `json:"time"` Status string `json:"status"` AbiJson any `json:"abiJson"` Creater string `json:"creater"` }
type NotePayload ¶
type NoteTx ¶
type NoteTx struct { TxId string `json:"txId"` Blockchain string `json:"blockchain"` Time int64 `json:"time"` NumInputs int `json:"num_inputs"` NumOutputs int `json:"num_outputs"` Height int64 `json:"height"` BlockHash string `json:"blockHash"` BlockTime int64 `json:"blockTime"` IndexInBlock int `json:"indexInBlock"` IndexInChain int `json:"indexInChain"` Status string `json:"status"` Type string `json:"type"` Payload string `json:"payload"` }
type NoteTxHistory ¶
type NoteTxHistory struct { TxId string `json:"txId"` Amount string `json:"amount"` Income bool `json:"income"` Tick string `json:"tick"` Op string `json:"op"` Dec int32 `json:"dec"` Height int64 `json:"height"` Time int64 `json:"time"` FromAddress string `json:"fromAddress"` ToAddress string `json:"toAddress"` }
type NoteTxHistoryResp ¶
type NoteTxHistoryResp struct { Total int `json:"total"` Data []*NoteTxHistory `json:"data"` }
type NoteTxInfo ¶
type NoteTxInfo struct { TxId string `json:"txId"` Blockchain string `json:"blockchain"` Time int64 `json:"time"` NumInputs int `json:"num_inputs"` NumOutputs int `json:"num_outputs"` Height int64 `json:"height"` BlockHash string `json:"blockHash"` BlockTime int64 `json:"blockTime"` IndexInBlock int `json:"indexInBlock"` IndexInChain int `json:"indexInChain"` Status string `json:"status"` Type string `json:"type"` Payload string `json:"payload"` Version int `json:"version"` NLockTime int64 `json:"nLockTime"` TxSize int `json:"txSize"` Fee any `json:"fee"` OutputSatoshis string `json:"outputSatoshis"` TxHex string `json:"txHex"` MempoolTime int64 `json:"mempoolTime"` Rbf bool `json:"rbf"` Replaced any `json:"replaced"` Inputs []*struct { Unlock *TxUnlock `json:"Unlock"` TXO *Txo `json:"TXO"` } `json:"inputs"` Outputs []*struct { TXO *Txo `json:"TXO"` Unlock *TxUnlock `json:"Unlock"` Satoshis string `json:"satoshis,omitempty"` Holder string `json:"holder,omitempty"` Amount string `json:"amount,omitempty"` // contains filtered or unexported fields } }
type Options ¶
type Token ¶
type Token struct { *TokenBalance ScriptHash string `json:"tokenAddressScriptHash"` Dec int32 `json:"dec"` P string `json:"p"` }
type TokenBalance ¶
type TokenUtxo ¶
type TokenUtxo struct { TxId string `json:"txId"` Outpoint string `json:"outpoint"` OutputIndex uint32 `json:"outputIndex"` Script string `json:"script"` Satoshis int64 `json:"satoshis"` Holder string `json:"holder"` Amount string `json:"amount"` Height int64 `json:"height"` Tick string `json:"tick"` Dec int32 `json:"dec"` P string `json:"p"` Time int64 `json:"time"` }
type TxUnlock ¶
type TxUnlock struct { Inpoint string `json:"inpoint"` InputIndex int `json:"inputIndex"` PrevTxId string `json:"prevTxId"` SequenceNumber int `json:"sequenceNumber"` Witnesses []string `json:"witnesses"` Type string `json:"type"` FullScript string `json:"fullScript"` Amounts []string `json:"amounts"` // contains filtered or unexported fields }
type Txo ¶
type Txo struct { Satoshis string `json:"satoshis"` Holder string `json:"holder,omitempty"` Size int `json:"size"` ScriptHash string `json:"tokenAddressScriptHash"` Type string `json:"type"` Pubkey string `json:"pubkey"` Address string `json:"address"` Amount string `json:"amount,omitempty"` // contains filtered or unexported fields }
type Utxo ¶
type Utxo struct { Address string `json:"address"` TxId string `json:"txId"` OutputIndex uint32 `json:"outputIndex"` Height int64 `json:"height"` ScriptHash string `json:"tokenAddressScriptHash"` Script string `json:"script"` Satoshis int64 `json:"satoshis"` Type string `json:"type"` Time int64 `json:"time"` }