Documentation
¶
Index ¶
Constants ¶
const ( // Only blocks mined with progpow are considered. // Previous mining algorithms: MTP and Lyra2z ignored as being too early for // Firo wallet on Dex ~ late 2023 ProgpowStartTime = 1635228000 // Tue Oct 26 2021 06:00:00 UTC+0 HeaderLength = 80 ProgpowExtraLength = 40 ProgpowFullHeaderLength = HeaderLength + ProgpowExtraLength )
const ( ExxMainnet byte = 0xbb ExxTestnet byte = 0xb1 ExxSimnet byte = 0xac OP_EXCHANGEADDR byte = 0xe0 )
OP_EXCHANGEADDR is an unused bitcoin script opcode used to 'mark' the output as an exchange address for the recipient.
const ( // Transaction types TransactionNormal = 0 TransactionProviderRegister = 1 TransactionProviderUpdateService = 2 TransactionProviderUpdateRegistrar = 3 TransactionProviderUpdateRevoke = 4 TransactionCoinbase = 5 TransactionQuorumCommitment = 6 TransactionSpork = 7 TransactionLelantus = 8 TransactionSpark = 9 // TRANSACTION_ALIAS is a regular spark spend transaction, but contains // additional info about a created/modified spark name. TransactionAlias = 10 )
const (
// Zcoin XZC
BipID = 136
)
Variables ¶
var (
ExxVersionedPrefix = [2]byte{0x01, 0xb9}
)
var ( // WalletInfo defines some general information about a Firo wallet. WalletInfo = &asset.WalletInfo{ Name: "Firo", SupportedVersions: []uint32{version}, UnitInfo: dexfiro.UnitInfo, AvailableWallets: []*asset.WalletDefinition{ { Type: walletTypeRPC, Tab: "Firo Core (external)", Description: "Connect to firod", DefaultConfigPath: dexbtc.SystemConfigPath("firo"), ConfigOpts: configOpts, MultiFundingOpts: btc.MultiFundingOpts, }, { Type: walletTypeElectrum, Tab: "Electrum-Firo (external)", Description: "Use an external Electrum-Firo Wallet", ConfigOpts: append(btc.ElectrumConfigOpts, btc.CommonConfigOpts("FIRO", true)...), MultiFundingOpts: btc.MultiFundingOpts, }, }, } )
Functions ¶
func NewWallet ¶
func NewWallet(cfg *asset.WalletConfig, logger dex.Logger, network dex.Network) (asset.Wallet, error)
NewWallet is the exported constructor by which the DEX will import the exchange wallet. The wallet will shut down when the provided context is canceled. The configPath can be an empty string, in which case the standard system location of the firod config file is assumed.
Types ¶
type Driver ¶
type Driver struct{}
Driver implements asset.Driver.
func (*Driver) DecodeCoinID ¶
DecodeCoinID creates a human-readable representation of a coin ID for Firo.
func (*Driver) Info ¶
func (d *Driver) Info() *asset.WalletInfo
Info returns basic information about the wallet and asset.
func (*Driver) MinLotSize ¶
MinLotSize calculates the minimum bond size for a given fee rate that avoids dust outputs on the swap and refund txs, assuming the maxFeeRate doesn't change.