blockchain

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidAssetDecimals = errors.New("asset amount cannot be represented in base units")

Functions

func BaseUnitsToDecimal

func BaseUnitsToDecimal(amount *big.Int, decimals uint8) decimal.Decimal

func DecimalToBaseUnits

func DecimalToBaseUnits(amount decimal.Decimal, decimals uint8) (*big.Int, error)

Types

type AssetID

type AssetID struct {
	Family       ChainFamily
	ChainID      uint64
	AssetAddress string
}

func AssetIDFromURI

func AssetIDFromURI(uri core.AssetURI) (AssetID, error)

func ParseAssetID

func ParseAssetID(s string) (AssetID, error)

func (AssetID) String

func (id AssetID) String() string

type AssetResolver

type AssetResolver interface {
	ValidateAssetAddress(ctx context.Context, assetAddress string) error
	AssetDecimals(ctx context.Context, assetAddress string) (uint8, error)
}

type ChainFamily

type ChainFamily string
const (
	ChainFamilyEVM  ChainFamily = "evm"
	ChainFamilySOL  ChainFamily = "sol"
	ChainFamilyXRPL ChainFamily = "xrpl"
	ChainFamilyBTC  ChainFamily = "btc"
)

Directories

Path Synopsis
Package btc implements the Bitcoin custody vault adapter.
Package btc implements the Bitcoin custody vault adapter.
evm
Package evm implements the chain-agnostic adapter interfaces (see pkg/core) against an EVM chain, one focused type per concern: Depositor and WithdrawalFinalizer (the vault money path), plus RegistryAdapter, TokenAdapter, FraudAdapter, and FaucetAdapter.
Package evm implements the chain-agnostic adapter interfaces (see pkg/core) against an EVM chain, one focused type per concern: Depositor and WithdrawalFinalizer (the vault money path), plus RegistryAdapter, TokenAdapter, FraudAdapter, and FaucetAdapter.
abi_refresher command
Command abi_refresher regenerates the EVM contract bindings (the `pkg/blockchain/evm/*_abi.go` files) from the vendored ABI + bytecode files under `pkg/blockchain/evm/artifacts/`, using go-ethereum's abigen library directly — no bash, no jq, no external abigen binary, no forge build.
Command abi_refresher regenerates the EVM contract bindings (the `pkg/blockchain/evm/*_abi.go` files) from the vendored ABI + bytecode files under `pkg/blockchain/evm/artifacts/`, using go-ethereum's abigen library directly — no bash, no jq, no external abigen binary, no forge build.
sol
Package sol implements the chain-agnostic adapter interfaces (see pkg/core) against Solana, over the custody Anchor program.
Package sol implements the chain-agnostic adapter interfaces (see pkg/core) against Solana, over the custody Anchor program.
idl_refresher command
Command idl_refresher regenerates the Solana program bindings (the pkg/blockchain/sol/custody package) from the vendored Anchor IDL using anchor-go's generator library directly — the Solana analog of the EVM abi_refresher (which drives go-ethereum's abigen).
Command idl_refresher regenerates the Solana program bindings (the pkg/blockchain/sol/custody package) from the vendored Anchor IDL using anchor-go's generator library directly — the Solana analog of the EVM abi_refresher (which drives go-ethereum's abigen).
Package xrpl implements the XRP Ledger custody vault via Peersyst/xrpl-go: a depositor that sends tagged Payments, and a multi-sign withdrawal finalizer over a SignerList-configured vault account.
Package xrpl implements the XRP Ledger custody vault via Peersyst/xrpl-go: a depositor that sends tagged Payments, and a multi-sign withdrawal finalizer over a SignerList-configured vault account.

Jump to

Keyboard shortcuts

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