Documentation ¶
Overview ¶
Package multichain defines all supported assets and chains. It also re-exports the individual multichain APIs.
Index ¶
- Constants
- type AccountClient
- type AccountTx
- type AccountTxBuilder
- type Address
- type AddressEncodeDecoder
- type Asset
- type Chain
- func (chain Chain) ChainType() ChainType
- func (chain Chain) IsAccountBased() bool
- func (chain Chain) IsUTXOBased() bool
- func (chain Chain) Marshal(buf []byte, rem int) ([]byte, int, error)
- func (chain Chain) NativeAsset() Asset
- func (chain Chain) SizeHint() int
- func (chain *Chain) Unmarshal(buf []byte, rem int) ([]byte, int, error)
- type ChainType
- type ContractCallData
- type ContractCaller
- type GasEstimator
- type Network
- type RawAddress
- type UTXOClient
- type UTXOInput
- type UTXORecipient
- type UTXOTx
- type UTXOTxBuilder
- type UTXOutpoint
- type UTXOutput
Constants ¶
const ( AVAX = Asset("AVAX") // Avalanche BCH = Asset("BCH") // Bitcoin Cash BNB = Asset("BNB") // Binance Coin BTC = Asset("BTC") // Bitcoin DGB = Asset("DGB") // DigiByte DOGE = Asset("DOGE") // Dogecoin ETH = Asset("ETH") // Ether FIL = Asset("FIL") // Filecoin FTM = Asset("FTM") // Fantom GLMR = Asset("GLMR") // Glimmer LUNA = Asset("LUNA") // Luna MATIC = Asset("MATIC") // Matic PoS (Polygon) SOL = Asset("SOL") // Solana ZEC = Asset("ZEC") // Zcash AMOCK1 = Asset("AMOCK1") // Account-based mock asset AMOCK2 = Asset("AMOCK2") // Account-based mock asset UMOCK = Asset("UMOCK") // UTXO-based mock asset )
Enumeration of supported assets. When introducing a new chain, or new asset from an existing chain, you must add a human-readable string to this set of enumerated values. Assets must be listed in alphabetical order.
const ( Avalanche = Chain("Avalanche") BinanceSmartChain = Chain("BinanceSmartChain") Bitcoin = Chain("Bitcoin") BitcoinCash = Chain("BitcoinCash") DigiByte = Chain("DigiByte") Dogecoin = Chain("Dogecoin") Ethereum = Chain("Ethereum") Fantom = Chain("Fantom") Filecoin = Chain("Filecoin") Moonbeam = Chain("Moonbeam") Polygon = Chain("Polygon") Solana = Chain("Solana") Terra = Chain("Terra") Zcash = Chain("Zcash") AccountMocker1 = Chain("AccountMocker1") AccountMocker2 = Chain("AccountMocker2") UTXOMocker = Chain("UTXOMocker") )
Enumeration of supported chains. When introducing a new chain, you must add a human-readable string to this set of enumerated values. Chains must be listed in alphabetical order.
const ( // ChainTypeAccountBased is an identifier for all account-based chains, // namely, BinanceSmartChain, Ethereum, Filecoin, and so on. ChainTypeAccountBased = ChainType("Account") // ChainTypeUTXOBased is an identifier for all utxo-based chains, namely, // Bitcoin, BitcoinCash, DigiByte, and so on. ChainTypeUTXOBased = ChainType("UTXO") )
const ( // NetworkLocalnet represents a local network for chains. It is usually only // accessible from the device running the network, and is not accessible // over the Internet. Chain rules are often slightly different to allow for // faster block times and easier access to testing funds. This is also // sometimes referred to as "regnet" or "regression network". It should only // be used for local testing. NetworkLocalnet = Network("localnet") // NetworkDevnet represents the development network for chains. This network // is typically a deployed version of the localnet. Chain rules are often // slightly different to allow for faster block times and easier access to // testing funds. NetworkDevnet = Network("devnet") // NetworkTestnet represents the test network for chains. This network is // typically a publicly accessible network that has the same, or very // similar, chain rules compared to mainnet. Assets on this type of network // are usually not considered to have value. NetworkTestnet = Network("testnet") // NetworkMainnet represents the main network for chains. NetworkMainnet = Network("mainnet") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountClient ¶ added in v0.2.0
The AccountClient interface defines the functionality required to interact with a chain over RPC.
type AccountTx ¶ added in v0.2.0
The AccountTx interface defines the functionality that must be exposed by account-based transactions.
type AccountTxBuilder ¶ added in v0.2.0
The AccountTxBuilder interface defines the functionality required to build account-based transactions. Most chain implementations require additional information, and this should be accepted during the construction of the chain-specific transaction builder.
type Address ¶ added in v0.2.0
An Address is a human-readable representation of a public identity. It can be the address of an external account, contract, or script.
type AddressEncodeDecoder ¶ added in v0.2.1
type AddressEncodeDecoder = address.EncodeDecoder
The AddressEncodeDecoder interfaces combines encoding and decoding functionality into one interface.
type Asset ¶
type Asset string
An Asset uniquely identifies assets using human-readable strings.
func (Asset) ChainType ¶ added in v0.2.6
ChainType returns the chain-type (Account or UTXO) for the given asset
func (Asset) OriginChain ¶ added in v0.2.0
OriginChain returns the chain upon which the asset originates. For example, the origin chain of BTC is Bitcoin.
type Chain ¶
type Chain string
A Chain uniquely identifies a blockchain using a human-readable string.
func (Chain) ChainType ¶ added in v0.2.2
ChainType returns the chain type (whether account-based or utxo-based chain) for the chain.
func (Chain) IsAccountBased ¶ added in v0.2.2
IsAccountBased returns true when invoked on an account-based chain, otherwise returns false.
func (Chain) IsUTXOBased ¶ added in v0.2.2
IsUTXOBased returns true when invoked on a utxo-based chain, otherwise returns false.
func (Chain) Marshal ¶
Marshal the chain to binary. You should not call this function directly, unless you are implementing marshalling for a container type.
func (Chain) NativeAsset ¶ added in v0.2.8
NativeAsset returns the underlying native asset for a chain. For example, the root asset of Bitcoin chain is BTC.
type ChainType ¶ added in v0.2.2
type ChainType string
ChainType represents the type of chain (whether account-based or utxo-based)
func (ChainType) Marshal ¶ added in v0.2.2
Marshal the chain type to binary. You should not call this function directly, unless you are implementing marshalling for a container type.
type ContractCallData ¶ added in v0.2.0
ContractCallData is used to specify a function and its parameters when invoking business logic on a contract.
type ContractCaller ¶ added in v0.2.0
The ContractCaller interface defines the functionality required to call readonly functions on a contract. Calling functions that mutate contract state should be done using the Account API.
type GasEstimator ¶ added in v0.2.0
The GasEstimator interface defines the functionality required to know the current recommended gas prices.
type Network ¶ added in v0.2.4
type Network string
Network identifies the network type for the multichain deployment
func (Network) Marshal ¶ added in v0.2.4
Marshal the network to binary. You should not call this function directly, unless you are implementing marshalling for a container type.
type RawAddress ¶ added in v0.2.0
type RawAddress = address.RawAddress
RawAddress is an address that has been decoded into its binary form.
type UTXOClient ¶ added in v0.2.0
A UTXOClient interface defines the functionality required to interact with a chain over RPC.
type UTXOInput ¶ added in v0.2.0
A UTXOInput specifies an existing output, produced by a previous transaction, to be consumed by another transaction. It includes the script that meets the conditions specified by the consumed output (called the sig script, based on Bitcoin).
type UTXORecipient ¶ added in v0.2.0
A UTXORecipient specifies an address, and an amount, for which a transaction will produce an output. Depending on the output, the address can take on different formats (e.g. in Bitcoin, addresses can be P2PK, P2PKH, or P2SH).
type UTXOTx ¶ added in v0.2.0
A UTXOTx interfaces defines the functionality that must be exposed by utxo-based transactions.
type UTXOTxBuilder ¶ added in v0.2.0
A UTXOTxBuilder interface defines the functionality required to build account-based transactions. Most chain implementations require additional information, and this should be accepted during the construction of the chain-specific transaction builder.
type UTXOutpoint ¶ added in v0.2.2
A UTXOutpoint identifies a specific output produced by a transaction.
Directories ¶
Path | Synopsis |
---|---|
api
|
|
account
Package account defines the Account API.
|
Package account defines the Account API. |
address
Package address defines the Address API.
|
Package address defines the Address API. |
contract
Package contract defines the Contract API.
|
Package contract defines the Contract API. |
gas
Package gas defines the Gas API.
|
Package gas defines the Gas API. |
utxo
Package utxo defines the UTXO API.
|
Package utxo defines the UTXO API. |
chain
|
|
infra
|
|