rune

package
v0.0.0-...-903dc5f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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 NewApi

func NewApi(url string) *Api

func (*Api) RuneBalance

func (c *Api) RuneBalance(owner, runeName string) (*Balance, error)

查询一个地址下某个 rune 的 balance

func (*Api) RuneBalances

func (c *Api) RuneBalances(owner string) (*BalanceArray, error)

查询一个地址下所有的 rune balance

func (*Api) RuneInfo

func (c *Api) RuneInfo(name string) (*Info, error)

使用 rune 名称查询 rune 信息

func (*Api) RuneInfoById

func (c *Api) RuneInfoById(id string) (*Info, error)

使用 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 (b *Balance) BalanceWithDecimal() string

func (*Balance) JsonString

func (b *Balance) JsonString() string

func (*Balance) UnmarshalJSON

func (b *Balance) UnmarshalJSON(data []byte) error

type BalanceArray

type BalanceArray struct {
	inter.AnyArray[*Balance]
}

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

func (i *Info) JsonString() string

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL