Documentation ¶
Index ¶
- Constants
- type Api
- func (c *Api) RuneBalance(owner, runeName string) (*Balance, error)
- func (c *Api) RuneBalances(owner string) (*BalanceArray, error)
- func (c *Api) RuneInfo(name string) (*Info, error)
- func (c *Api) RuneInfoById(id string) (*Info, error)
- func (c *Api) TransferRunes(sender, receiver string, runeName, amount string, feeRate float64, postage int) (*TransferTransaction, error)
- type Balance
- type BalanceArray
- type Info
- type TransferTransaction
- func (t *TransferTransaction) JsonString() (*base.OptionalString, error)
- func (t *TransferTransaction) SignWithAccount(account base.Account) (signedTxn *base.OptionalString, err error)
- func (t *TransferTransaction) SignedTransactionWithAccount(account base.Account) (signedTxn base.SignedTransaction, err error)
- func (t *TransferTransaction) TotalFee() int64
Constants ¶
View Source
const ( UrlMainnet = "https://ord.bevm.io/mainnet" UrlTestnet = "https://ord.bevm.io/testnet" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Api ¶
type Api struct {
Url string
}
func (*Api) RuneBalance ¶
查询一个地址下某个 rune 的 balance
func (*Api) RuneBalances ¶
func (c *Api) RuneBalances(owner string) (*BalanceArray, error)
查询一个地址下所有的 rune balance
func (*Api) RuneInfoById ¶
使用 rune id 查询 rune 信息
func (*Api) TransferRunes ¶
func (c *Api) TransferRunes(sender, receiver string, runeName, amount string, feeRate float64, postage int) (*TransferTransaction, error)
构建 rune 转账交易 @param postage: the rune utxo's satoshi value, default is 546
type Balance ¶
type Balance struct { Address string `json:"addr"` Balance string `json:"balance"` Divisibility int16 `json:"divisibility"` // decimal HasInscription bool `json:"has_inscription"` Rune string `json:"rune"` Symbol string `json:"symbol"` }
rune balance
func (*Balance) BalanceWithDecimal ¶
func (*Balance) JsonString ¶
func (*Balance) UnmarshalJSON ¶
type BalanceArray ¶
type Info ¶
type Info struct { RuneId string `json:"rune_id"` Block int64 `json:"block"` Burned int64 `json:"burned"` Divisibility int16 `json:"divisibility"` Etching string `json:"etching"` Mints int64 `json:"mints"` Number int64 `json:"number"` Premine int64 `json:"premine"` SpacedRune string `json:"spaced_rune"` Symbol string `json:"symbol"` Timestamp int64 `json:"timestamp"` Progress float64 `json:"progress"` }
rune info
func (*Info) JsonString ¶
type TransferTransaction ¶
type TransferTransaction struct { CommitId string `json:"commit_id"` CommitPsbt string `json:"commit_psbt"` NetworkFee int64 `json:"network_fee"` SatpointFee int64 `json:"satpoint_fee"` ServiceFee int64 `json:"service_fee"` CommitFee int64 `json:"commit_fee"` CommitVsize int64 `json:"commit_vsize"` CommitCustom *btc.Brc20CommitCustom `json:"commit_custom"` }
func (*TransferTransaction) JsonString ¶
func (t *TransferTransaction) JsonString() (*base.OptionalString, error)
func (*TransferTransaction) SignWithAccount ¶
func (t *TransferTransaction) SignWithAccount(account base.Account) (signedTxn *base.OptionalString, err error)
func (*TransferTransaction) SignedTransactionWithAccount ¶
func (t *TransferTransaction) SignedTransactionWithAccount(account base.Account) (signedTxn base.SignedTransaction, err error)
func (*TransferTransaction) TotalFee ¶
func (t *TransferTransaction) TotalFee() int64
return networkFee + serviceFee + satpointFee
Click to show internal directories.
Click to hide internal directories.