Documentation
¶
Index ¶
- Variables
- func IsAssetBtc(assetSpecifier *priceoraclerpc.AssetSpecifier) bool
- func MarshalAsset(ctx context.Context, a *asset.Asset, isSpent, withWitness bool, ...) (*taprpc.Asset, error)
- func MarshalAssetKey(outPoint wire.OutPoint, scriptKeyPubKey *btcec.PublicKey) *universerpc.AssetKey
- func MarshalAssetRates(assetRate rfqmsg.AssetRate) lfn.Result[*priceoraclerpc.AssetRates]
- func MarshalAssetVersion(version asset.Version) (taprpc.AssetVersion, error)
- func MarshalBigIntFixedPoint(fp rfqmath.BigIntFixedPoint) (*priceoraclerpc.FixedPoint, error)
- func MarshalChainAsset(ctx context.Context, a asset.ChainAsset, decDisplay fn.Option[uint32], ...) (*taprpc.Asset, error)
- func MarshalExternalKey(key asset.ExternalKey) *taprpc.ExternalKey
- func MarshalGenesisInfo(gen *asset.Genesis, assetType asset.Type) *taprpc.GenesisInfo
- func MarshalGroupKeyRequest(req *asset.GroupKeyRequest) (*taprpc.GroupKeyRequest, error)
- func MarshalGroupVirtualTx(genTx *asset.GroupVirtualTx) (*taprpc.GroupVirtualTx, error)
- func MarshalKeyDescriptor(desc keychain.KeyDescriptor) *taprpc.KeyDescriptor
- func MarshalOutpoint(outPoint wire.OutPoint) *universerpc.Outpoint
- func MarshalScriptKey(scriptKey asset.ScriptKey) *taprpc.ScriptKey
- func MarshalScriptKeyType(typ asset.ScriptKeyType) taprpc.ScriptKeyType
- func MarshalUniverseID(assetIDBytes []byte, groupKeyBytes []byte) *universerpc.ID
- func ParseScriptKeyTypeQuery(q *taprpc.ScriptKeyTypeQuery) (fn.Option[asset.ScriptKeyType], bool, error)
- func UnmarshalAssetVersion(version taprpc.AssetVersion) (asset.Version, error)
- func UnmarshalExternalKey(rpcKey *taprpc.ExternalKey) (asset.ExternalKey, error)
- func UnmarshalFixedPoint(fp *priceoraclerpc.FixedPoint) (*rfqmath.BigIntFixedPoint, error)
- func UnmarshalGenesisInfo(rpcGen *taprpc.GenesisInfo) (*asset.Genesis, error)
- func UnmarshalGroupKeyRequest(req *taprpc.GroupKeyRequest) (*asset.GroupKeyRequest, error)
- func UnmarshalGroupVirtualTx(genTx *taprpc.GroupVirtualTx) (*asset.GroupVirtualTx, error)
- func UnmarshalKeyDescriptor(rpcDesc *taprpc.KeyDescriptor) (keychain.KeyDescriptor, error)
- func UnmarshalOutPoint(rpcOutpoint *taprpc.OutPoint) (wire.OutPoint, error)
- func UnmarshalRfqFixedPoint(fp *rfqrpc.FixedPoint) (*rfqmath.BigIntFixedPoint, error)
- func UnmarshalScriptKey(rpcKey *taprpc.ScriptKey) (*asset.ScriptKey, error)
- func UnmarshalScriptKeyType(rpcType taprpc.ScriptKeyType) (asset.ScriptKeyType, error)
- func UnmarshalTapscriptBranch(branch *taprpc.TapBranch) (*asset.TapscriptTreeNodes, error)
- func UnmarshalTapscriptFullTree(tree *taprpc.TapscriptFullTree) (*asset.TapscriptTreeNodes, error)
- func UnmarshalTapscriptSibling(rpcTree *taprpc.TapscriptFullTree, rpcBranch *taprpc.TapBranch) (fn.Option[asset.TapscriptTreeNodes], error)
- type KeyLookup
Constants ¶
This section is empty.
Variables ¶
var ( ProofDeliveryStatusNotApplicable = taprpc.ProofDeliveryStatus_PROOF_DELIVERY_STATUS_NOT_APPLICABLE ProofDeliveryStatusComplete = taprpc.ProofDeliveryStatus_PROOF_DELIVERY_STATUS_COMPLETE ProofDeliveryStatusPending = taprpc.ProofDeliveryStatus_PROOF_DELIVERY_STATUS_PENDING )
Shorthand for the asset transfer output proof delivery status enum.
nolint: lll
Functions ¶
func IsAssetBtc ¶
func IsAssetBtc(assetSpecifier *priceoraclerpc.AssetSpecifier) bool
IsAssetBtc is a helper function that returns true if the given asset specifier represents BTC, and false otherwise.
func MarshalAsset ¶
func MarshalAsset(ctx context.Context, a *asset.Asset, isSpent, withWitness bool, keyRing KeyLookup, decDisplay fn.Option[uint32]) (*taprpc.Asset, error)
MarshalAsset converts an asset to its rpc representation.
func MarshalAssetKey ¶
func MarshalAssetKey(outPoint wire.OutPoint, scriptKeyPubKey *btcec.PublicKey) *universerpc.AssetKey
MarshalAssetKey returns an RPC ready AssetKey.
func MarshalAssetRates ¶
func MarshalAssetRates( assetRate rfqmsg.AssetRate) lfn.Result[*priceoraclerpc.AssetRates]
MarshalAssetRates converts an asset rate to an RPC AssetRates. The OK result has a pointer type so that it is nil if there is an error. NOTE: The payment asset is assumed to be BTC.
func MarshalAssetVersion ¶
func MarshalAssetVersion(version asset.Version) (taprpc.AssetVersion, error)
MarshalAssetVersion parses an asset version from the RPC variant.
func MarshalBigIntFixedPoint ¶
func MarshalBigIntFixedPoint( fp rfqmath.BigIntFixedPoint) (*priceoraclerpc.FixedPoint, error)
MarshalBigIntFixedPoint converts a BigIntFixedPoint to an RPC FixedPoint.
func MarshalChainAsset ¶
func MarshalChainAsset(ctx context.Context, a asset.ChainAsset, decDisplay fn.Option[uint32], withWitness bool, keyRing KeyLookup) (*taprpc.Asset, error)
MarshalChainAsset marshals a chain asset into its RPC counterpart.
func MarshalExternalKey ¶
func MarshalExternalKey(key asset.ExternalKey) *taprpc.ExternalKey
MarshalExternalKey marshals an external key into its RPC counterpart.
func MarshalGenesisInfo ¶
MarshalGenesisInfo marshals the native asset genesis into the RPC counterpart.
func MarshalGroupKeyRequest ¶
func MarshalGroupKeyRequest( req *asset.GroupKeyRequest) (*taprpc.GroupKeyRequest, error)
MarshalGroupKeyRequest marshals the native group key request into the RPC counterpart.
func MarshalGroupVirtualTx ¶
func MarshalGroupVirtualTx(genTx *asset.GroupVirtualTx) (*taprpc.GroupVirtualTx, error)
MarshalGroupVirtualTx marshals the native asset group virtual transaction into the RPC counterpart.
func MarshalKeyDescriptor ¶
func MarshalKeyDescriptor(desc keychain.KeyDescriptor) *taprpc.KeyDescriptor
MarshalKeyDescriptor marshals the native key descriptor into the RPC counterpart.
func MarshalOutpoint ¶
func MarshalOutpoint(outPoint wire.OutPoint) *universerpc.Outpoint
MarshalOutpoint marshals a wire.OutPoint into an RPC ready Outpoint.
func MarshalScriptKey ¶
MarshalScriptKey marshals the native script key into the RPC counterpart.
func MarshalScriptKeyType ¶
func MarshalScriptKeyType(typ asset.ScriptKeyType) taprpc.ScriptKeyType
MarshalScriptKeyType marshals the script key type from the RPC variant.
func MarshalUniverseID ¶
func MarshalUniverseID(assetIDBytes []byte, groupKeyBytes []byte) *universerpc.ID
MarshalUniverseID returns an RPC ready universe ID.
func ParseScriptKeyTypeQuery ¶
func ParseScriptKeyTypeQuery( q *taprpc.ScriptKeyTypeQuery) (fn.Option[asset.ScriptKeyType], bool, error)
ParseScriptKeyTypeQuery parses the script key type query from the RPC variant.
func UnmarshalAssetVersion ¶
func UnmarshalAssetVersion(version taprpc.AssetVersion) (asset.Version, error)
UnmarshalAssetVersion parses an asset version from the RPC variant.
func UnmarshalExternalKey ¶
func UnmarshalExternalKey(rpcKey *taprpc.ExternalKey) (asset.ExternalKey, error)
UnmarshalExternalKey parses an external key from the RPC variant.
func UnmarshalFixedPoint ¶
func UnmarshalFixedPoint( fp *priceoraclerpc.FixedPoint) (*rfqmath.BigIntFixedPoint, error)
UnmarshalFixedPoint converts an RPC FixedPoint to a BigIntFixedPoint.
func UnmarshalGenesisInfo ¶
func UnmarshalGenesisInfo(rpcGen *taprpc.GenesisInfo) (*asset.Genesis, error)
UnmarshalGenesisInfo parses an asset Genesis from the RPC variant.
func UnmarshalGroupKeyRequest ¶
func UnmarshalGroupKeyRequest( req *taprpc.GroupKeyRequest) (*asset.GroupKeyRequest, error)
UnmarshalGroupKeyRequest parses a group key request from the RPC variant.
func UnmarshalGroupVirtualTx ¶
func UnmarshalGroupVirtualTx( genTx *taprpc.GroupVirtualTx) (*asset.GroupVirtualTx, error)
UnmarshalGroupVirtualTx parses a group virtual transaction from the RPC variant.
func UnmarshalKeyDescriptor ¶
func UnmarshalKeyDescriptor( rpcDesc *taprpc.KeyDescriptor) (keychain.KeyDescriptor, error)
UnmarshalKeyDescriptor parses the RPC key descriptor into the native counterpart.
func UnmarshalOutPoint ¶
UnmarshalOutPoint parses an outpoint from the RPC variant.
func UnmarshalRfqFixedPoint ¶
func UnmarshalRfqFixedPoint(fp *rfqrpc.FixedPoint) (*rfqmath.BigIntFixedPoint, error)
UnmarshalRfqFixedPoint converts an RPC FixedPoint to a BigIntFixedPoint.
func UnmarshalScriptKey ¶
UnmarshalScriptKey parses the RPC script key into the native counterpart.
func UnmarshalScriptKeyType ¶
func UnmarshalScriptKeyType(rpcType taprpc.ScriptKeyType) (asset.ScriptKeyType, error)
UnmarshalScriptKeyType parses the script key type from the RPC variant.
func UnmarshalTapscriptBranch ¶
func UnmarshalTapscriptBranch( branch *taprpc.TapBranch) (*asset.TapscriptTreeNodes, error)
UnmarshalTapscriptBranch parses a Tapscript branch from the RPC variant.
func UnmarshalTapscriptFullTree ¶
func UnmarshalTapscriptFullTree(tree *taprpc.TapscriptFullTree) ( *asset.TapscriptTreeNodes, error)
UnmarshalTapscriptFullTree parses a Tapscript tree from the RPC variant.
func UnmarshalTapscriptSibling ¶
func UnmarshalTapscriptSibling(rpcTree *taprpc.TapscriptFullTree, rpcBranch *taprpc.TapBranch) (fn.Option[asset.TapscriptTreeNodes], error)
UnmarshalTapscriptSibling parses a Tapscript sibling from the RPC variant.
Types ¶
type KeyLookup ¶
type KeyLookup interface { // IsLocalKey returns true if the key is under the control of the // wallet and can be derived by it. IsLocalKey(ctx context.Context, desc keychain.KeyDescriptor) bool }
KeyLookup is used to determine whether a key is under the control of the local wallet.