pdex

package
v0.0.0-...-7ece11e Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 License: MIT Imports: 26 Imported by: 5

README

pDEX: The first privacy-protecting decentralized exchange

Introduction

The first generation of exchanges includes centralized exchanges like Binance and Coinbase. The second generation of exchanges comprises of decentralized exchanges (DEX) like Bancor, Kyber, and Uniswap. pDEX is an upgraded DEX. Like decentralized exchanges, it is trustless. It also implements additional features such as privacy via zero-knowledge proofs, high throughput via sharding, low latency via automated market making, and inter-blockchain trading via interoperable bridges.

DEX pDEX
Trustless YES YES
Privacy NO YES
High throughput NO YES
Inter-blockchain NO YES

Liquidity providers

Liquidity providers play an essential role in pDEX. They provide liquidity to various pools on pDEX and earn trading fees.

The main idea is to replace the traditional order book with a bonding curve mechanism known as constant product. On a typical exchange such as Coinbase or Binance, market makers supply liquidity at various price points. pDEX takes everyone's bids and asks and pool them into two giant buckets. Market makers no longer specify at which prices they are willing to buy or sell. Instead, pDEX automatically makes markets based on a Automated Market Making algorithm.

drawing
Conentrate liquidity

LP’s (Liquidity Providers) can concentrate their capital within custom price ranges, providing greater amounts of liquidity at desired prices. In doing so, LPs construct individualized price curves that reflect their own preferences.

drawing

For example, an LP in the ETH/DAI pool may choose to allocate $100 to the price ranges $1,000-$2,000 and an additional $50 to the ranges $1,500-$1,750.

Capital Efficiency

By concentrating their liquidity, LPs can provide the same liquidity depth as v2 within specified price ranges while putting far less capital at risk.

For example:

  • Alice and Bob both want to provide liquidity in an ETH/DAI pool on Uniswap v3. They each have $1m. The current price of ETH is 1,500 DAI.

  • Alice decides to deploy her capital across the entire price range (as she would have in Uniswap v2). She deposits 500,000 DAI and 333.33 ETH (worth a total of $1m).

  • Bob instead creates a concentrated position, depositing only within the price range from 1,000 to 2,250. He deposits 91,751 DAI and 61.17 ETH, worth a total of about $183,500. He keeps the other $816,500 himself, investing it however he prefers.

  • While Alice has put down 5.44x as much capital as Bob, they earn the same amount of fees, as long as the ETH/DAI price stays within the 1,000 to 2,250 range.

drawing
Active Liquidity

If market prices move outside an LP’s specified price range, their liquidity is effectively removed from the pool and is no longer earning fees

Range Orders

LPs can deposit a single token in a custom price range above or below the current price: if the market price enters into their specified range, they sell one asset for another along a smooth curve while earning swap fees in the process.

How to trade on pDEX?

Below is trading process if only new price P won't cross to new initialized tick

1-gh35s-RDa-Nmn-VY7-S5avb42-A.png

Let's go through a simple example. There are 100,000 pDAI and 10 pBTC currently in the pDAI/pBTC pool. No matter how much trading activity occurs, the goal is to keep this product equal to 1,000,000.

pDAI pool   : 100,000
pBTC pool   : 10
Constant    : 10 * 100,000 = 1,000,000

A buyer sends 10,000 pDAI to buy pBTC. A fee (in this example, 0.1% or 10 pDAI) is taken out for the liquidity providers, and the remaining 9,990 is added to the pDAI pool. The constant product is divided by the new amount of pDAI in the liquidity pool to determine the new pBTC pool. The buyer receives the remaining pBTC.

Buyer sends : 10,000 pDAI
Fee         : 10,000 * 0.1% = 10 pDAI
pDAI pool   : 100,000 + 10,000 - 10 = 109,990
pBTC pool   : 1,000,000 / 109,990 = 9.091735
Buyer gets  : 10 - 9.091735 = 0.908254 pBTC

Note that:

  • The fee is added to the liquidity pool. pDAI pool is now 109,990 + 10 = 110,000. Liquidity providers collect fees when they exit the pool.

  • Because the fee is added, the Constant slightly increases after each trade. In this example, it is now 110,000 * 9.091735 = 1,000,090.85

  • The price has shifted. If a buyer makes a trade in the same direction, they will get a slightly worse pBTC/pDAI rate. However, if a buyer makes a trade in the opposite direction, they will get a slightly better pDAI/pBTC rate.

In the case trading cross to new initialized tick, we need to calculate the liquidity and trading fee by the new tick

Trading fees

  1. Trading fees will be calcualted by trading volume in a period of time (But user can set it greater than the calculated value)

  2. Trading fees will be calculate by formula: Y = y - f(x + X * (1 - fee - Z)) which x and y is the current amount of 2 tokens will be traded, fee is base fee, Z is the factor depend on average volume of AMM during a time period

  3. Block producers sort orders by Trading FeeTrade Amount ratio, from highest to lowest, and process orders one by one. (Fee at least similar to trading fees which has been calculated above)

  4. The trading fees go directly to liquidity providers provide in current tick.

Unlike other exchanges which offer fixed trading fee structures, pDEX gives users complete control on how they want to set their trading fees. It’s entirely market-driven. The higher you set your trading fees, the more likely your orders will be processed first at the prices you want. The lower you set your trading fees, you’ll pay less but your orders will be more likely to fail due to price movements.

Unlike other exchanges which take all of the trading fees, on pDEX, the entirety of trading fees go directly to the liquidity providers.

We think that it’s a fairer way to build a crypto exchange.

Workflow

Deposit

Deposit process in a nutshell

drawing
Trade

Trade process in a nutshell drawing

Withdraw

Withdraw process in a nutshell

drawing

Architect

Overview
drawing
Detail
drawing

References

  1. Kyber Dynamic AMM (https://files.kyber.network/DMM-Feb21.pdf)
  2. Uniswap v3 core (https://uniswap.org/whitepaper-v3.pdf)

Documentation

Index

Constants

View Source
const (
	BasicVersion = iota + 1
	AmplifierVersion
)
View Source
const (
	MaxFeeRateBPS         = 200
	MaxPRVDiscountPercent = 75
)

params

View Source
const (
	MintingBlockReward = 45000000                 // without multiply with denominating rate
	MintingBlocks      = 3600 * 24 * 30 * 60 / 40 // 60 months
	DecayIntervals     = 30
	DecayRateBPS       = 500 // 5%
)

PDEX token

View Source
const (
	BPS = 10000
)

common

Variables

View Source
var (
	INSCRIPTIONS_FEATURE = "inscriptions"
	BaseLPFeesPerShare   = new(big.Int).SetUint64(1e18)

	TotalPDEXReward         = MintingBlockReward * math.Pow(10, common.PDEXDenominatingDecimal)
	DecayRate               = float64(DecayRateBPS) / float64(BPS)
	PDEXRewardFirstInterval = uint64(TotalPDEXReward * DecayRate / (1 - math.Pow(1-DecayRate, DecayIntervals)))
)

nft hash prefix

View Source
var Logger = PDEXLogger{}

Global instant to use

Functions

func CalculateShareAmount

func CalculateShareAmount(token0Amount, token1Amount, amount0, amount1, poolPairShareAmount uint64) uint64

func CombineReward

func CombineReward(
	reward1 map[common.Hash]uint64,
	reward2 map[common.Hash]uint64,
) map[common.Hash]uint64

func GetInscriptionTokenID

func GetInscriptionTokenID(index uint64) common.Hash

func GetPdexInstructions

func GetPdexInstructions(instructions [][]string) map[uint][][]string

func InitFullPoolPairStatesFromDB

func InitFullPoolPairStatesFromDB(stateDB *statedb.StateDB) (map[string]*PoolPairState, error)

func InitIntermediatePoolPairStatesFromDB

func InitIntermediatePoolPairStatesFromDB(stateDB *statedb.StateDB) (map[string]*PoolPairState, error)

func InitLiquidityPoolPairStatesFromDB

func InitLiquidityPoolPairStatesFromDB(stateDB *statedb.StateDB) (map[string]*PoolPairState, error)

func InitNftIDsFromDB

func InitNftIDsFromDB(stateDB *statedb.StateDB) (map[string]uint64, error)

func InitPoolPairIDsFromDB

func InitPoolPairIDsFromDB(stateDB *statedb.StateDB) ([]string, error)

func InitPoolPairOrderRewards

func InitPoolPairOrderRewards(stateDB *statedb.StateDB, poolPairID string) (map[string]*OrderReward, error)

func InitPoolPairShares

func InitPoolPairShares(stateDB *statedb.StateDB, poolPairID string) (map[string]*Share, error)

func InitStakingPoolsFromDB

func InitStakingPoolsFromDB(stateDB *statedb.StateDB) (map[string]*StakingPoolState, error)

func InitStateV2FromDBWithoutNftIDs

func InitStateV2FromDBWithoutNftIDs(stateDB *statedb.StateDB, beaconHeight uint64) (*stateV2, error)

func InitStatesFromDB

func InitStatesFromDB(
	stateDB *statedb.StateDB,
	beaconHeight uint64,
) (map[uint]State, error)

func InitWaitingContributionsFromDB

func InitWaitingContributionsFromDB(stateDB *statedb.StateDB) (map[string]rawdbv2.Pdexv3Contribution, error)

func NewContributionWithMetaData

func NewContributionWithMetaData(
	metaData metadataPdexv3.AddLiquidityRequest, txReqID common.Hash, shardID byte,
) *rawdbv2.Pdexv3Contribution

func NewStatev2

func NewStatev2() *stateV2

func TradePathFromState

func TradePathFromState(
	sellToken common.Hash,
	tradePath []string,
	pairs map[string]*PoolPairState,
) (
	[]*rawdbv2.Pdexv3PoolPair, []map[common.Hash]*big.Int, []map[common.Hash]uint64, []map[common.Hash]uint64,
	[]v2.OrderBookIterator, []byte, common.Hash, error,
)

TradePathFromState() prepares a trade path with reserves, orderbooks & directions. It returns cloned data only. State changes (if any) must be applied separately.

Types

type MakingVolume

type MakingVolume struct {
	// contains filtered or unexported fields
}

func NewMakingVolume

func NewMakingVolume() *MakingVolume

func (*MakingVolume) AddVolume

func (makingVolume *MakingVolume) AddVolume(nftID string, amount *big.Int)

func (*MakingVolume) Clone

func (makingVolume *MakingVolume) Clone() *MakingVolume

func (*MakingVolume) MarshalJSON

func (makingVolume *MakingVolume) MarshalJSON() ([]byte, error)

func (*MakingVolume) UnmarshalJSON

func (makingVolume *MakingVolume) UnmarshalJSON(data []byte) error

type Order

type Order = rawdbv2.Pdexv3Order

type OrderReward

type OrderReward struct {
	// contains filtered or unexported fields
}

func NewOrderReward

func NewOrderReward() *OrderReward

func (*OrderReward) AddReward

func (orderReward *OrderReward) AddReward(tokenID common.Hash, amount uint64)

func (*OrderReward) Clone

func (orderReward *OrderReward) Clone() *OrderReward

func (*OrderReward) MarshalJSON

func (orderReward *OrderReward) MarshalJSON() ([]byte, error)

func (*OrderReward) UncollectedRewards

func (orderReward *OrderReward) UncollectedRewards() Reward

func (*OrderReward) UnmarshalJSON

func (orderReward *OrderReward) UnmarshalJSON(data []byte) error

type Orderbook

type Orderbook struct {
	// contains filtered or unexported fields
}

func InitPoolPairOrders

func InitPoolPairOrders(stateDB *statedb.StateDB, poolPairID string) (*Orderbook, error)

func (*Orderbook) Clone

func (ob *Orderbook) Clone() Orderbook

func (*Orderbook) InsertOrder

func (ob *Orderbook) InsertOrder(ord *Order)

InsertOrder() appends a new order while keeping the list sorted (ascending by Token1Rate / Token0Rate)

func (Orderbook) MarshalJSON

func (ob Orderbook) MarshalJSON() ([]byte, error)

func (*Orderbook) NextOrder

func (ob *Orderbook) NextOrder(tradeDirection byte) (*v2.MatchingOrder, string, error)

NextOrder() returns the matchable order with the best rate that has any outstanding balance to sell

func (*Orderbook) NftIDs

func (ob *Orderbook) NftIDs() map[string]string

func (*Orderbook) RemoveOrder

func (ob *Orderbook) RemoveOrder(index int) error

RemoveOrder() removes one order by its index

func (*Orderbook) UnmarshalJSON

func (ob *Orderbook) UnmarshalJSON(data []byte) error

type PDEXLogger

type PDEXLogger struct {
	// contains filtered or unexported fields
}

func (*PDEXLogger) Init

func (pDEXLogger *PDEXLogger) Init(logger common.Logger)

type Params

type Params struct {
	DefaultFeeRateBPS                 uint            // the default value if fee rate is not specific in FeeRateBPS (default 0.3% ~ 30 BPS)
	FeeRateBPS                        map[string]uint // map: pool ID -> fee rate (0.1% ~ 10 BPS)
	PRVDiscountPercent                uint            // percent of fee that will be discounted if using PRV as the trading token fee (default: 25%)
	TradingProtocolFeePercent         uint            // percent of fees that is rewarded for the core team (default: 0%)
	TradingStakingPoolRewardPercent   uint            // percent of fees that is distributed for staking pools (PRV, PDEX, ..., default: 10%)
	PDEXRewardPoolPairsShare          map[string]uint // map: pool pair ID -> PDEX reward share weight
	StakingPoolsShare                 map[string]uint // map: staking tokenID -> pool staking share weight
	StakingRewardTokens               []common.Hash   // list of staking reward tokens
	MintNftRequireAmount              uint64          // amount prv for depositing to pdex
	MaxOrdersPerNft                   uint            // max orders per nft
	AutoWithdrawOrderLimitAmount      uint            // max orders will be auto withdraw each shard for each blocks
	MinPRVReserveTradingRate          uint64          // min prv reserve for checking price of trading fee paid by PRV
	DefaultOrderTradingRewardRatioBPS uint            // default order trading reward ratio BPS
	OrderTradingRewardRatioBPS        map[string]uint // map: pool ID -> the weight of LOP rewards compared with LP rewards (0.1% ~ 10 BPS)
	OrderLiquidityMiningBPS           map[string]uint // map: pool ID -> order liquidity mining BPS (1500 BPS -> the percent of reward for AMM : buy orders : sell orders will be 70% : 15% : 15%)
	DAOContributingPercent            uint            // percent of DAO reward that is using for liquidity mining (default: 0%)
	MiningRewardPendingBlocks         uint64          // liquidity mining reward of each contribution will be pending for this number of blocks (default: 0)
	OrderMiningRewardRatioBPS         map[string]uint // not used yet
}

func InitParamFromDB

func InitParamFromDB(stateDB *statedb.StateDB) (*Params, error)

func NewParams

func NewParams() *Params

func NewParamsWithValue

func NewParamsWithValue(paramsState *statedb.Pdexv3Params) *Params

func (*Params) Clone

func (p *Params) Clone() *Params

func (*Params) IsZeroValue

func (params *Params) IsZeroValue() bool

type PoolPairState

type PoolPairState struct {
	// contains filtered or unexported fields
}

func InitPoolPair

func InitPoolPair(stateDB *statedb.StateDB, poolPairID string) (*PoolPairState, error)

func NewPoolPairState

func NewPoolPairState() *PoolPairState

func NewPoolPairStateWithValue

func NewPoolPairStateWithValue(
	state rawdbv2.Pdexv3PoolPair,
	shares map[string]*Share,
	orderbook Orderbook,
	lpFeesPerShare, lmRewardsPerShare map[common.Hash]*big.Int,
	protocolFees, stakingPoolFees map[common.Hash]uint64,
	makingVolume map[common.Hash]*MakingVolume,
	orderRewards map[string]*OrderReward,
	lmLockedShare map[string]map[uint64]uint64,
) *PoolPairState

func (*PoolPairState) Clone

func (p *PoolPairState) Clone() *PoolPairState

func (*PoolPairState) LmLockedShare

func (poolPairState *PoolPairState) LmLockedShare() map[string]map[uint64]uint64

func (*PoolPairState) LmRewardsPerShare

func (poolPairState *PoolPairState) LmRewardsPerShare() map[common.Hash]*big.Int

func (*PoolPairState) LpFeesPerShare

func (poolPairState *PoolPairState) LpFeesPerShare() map[common.Hash]*big.Int

func (*PoolPairState) MarshalJSON

func (poolPairState *PoolPairState) MarshalJSON() ([]byte, error)

func (*PoolPairState) OrderRewards

func (poolPairState *PoolPairState) OrderRewards() map[string]*OrderReward

func (*PoolPairState) ProtocolFees

func (poolPairState *PoolPairState) ProtocolFees() map[common.Hash]uint64

func (*PoolPairState) RecomputeLPRewards

func (p *PoolPairState) RecomputeLPRewards(
	nftID common.Hash,
) (map[common.Hash]uint64, error)

func (*PoolPairState) Shares

func (poolPairState *PoolPairState) Shares() map[string]*Share

func (*PoolPairState) StakingPoolFees

func (poolPairState *PoolPairState) StakingPoolFees() map[common.Hash]uint64

func (*PoolPairState) State

func (poolPairState *PoolPairState) State() rawdbv2.Pdexv3PoolPair

func (*PoolPairState) UnmarshalJSON

func (poolPairState *PoolPairState) UnmarshalJSON(data []byte) error

type Reward

type Reward map[common.Hash]uint64 // tokenID -> amount

type Share

type Share struct {
	// contains filtered or unexported fields
}

func NewShare

func NewShare() *Share

func NewShareWithValue

func NewShareWithValue(
	amount, lmLockedAmount uint64,
	tradingFees map[common.Hash]uint64,
	lastLPFeesPerShare, lastLmRewardsPerShare map[common.Hash]*big.Int,
) *Share

func (*Share) Amount

func (share *Share) Amount() uint64

func (*Share) Clone

func (share *Share) Clone() *Share

func (*Share) LastLPFeesPerShare

func (share *Share) LastLPFeesPerShare() map[common.Hash]*big.Int

func (*Share) LastLmRewardsPerShare

func (share *Share) LastLmRewardsPerShare() map[common.Hash]*big.Int

func (*Share) LmLockedShareAmount

func (share *Share) LmLockedShareAmount() uint64

func (*Share) MarshalJSON

func (share *Share) MarshalJSON() ([]byte, error)

func (*Share) TradingFees

func (share *Share) TradingFees() map[common.Hash]uint64

func (*Share) UnmarshalJSON

func (share *Share) UnmarshalJSON(data []byte) error

type Staker

type Staker struct {
	// contains filtered or unexported fields
}

func NewStaker

func NewStaker() *Staker

func NewStakerWithValue

func NewStakerWithValue(liquidity uint64, rewards map[common.Hash]uint64, lastLPFeesPerShare map[common.Hash]*big.Int) *Staker

func (*Staker) Clone

func (staker *Staker) Clone() *Staker

func (*Staker) LastRewardsPerShare

func (staker *Staker) LastRewardsPerShare() map[common.Hash]*big.Int

func (*Staker) Liquidity

func (staker *Staker) Liquidity() uint64

func (*Staker) MarshalJSON

func (staker *Staker) MarshalJSON() ([]byte, error)

func (*Staker) Rewards

func (staker *Staker) Rewards() map[common.Hash]uint64

func (*Staker) UnmarshalJSON

func (staker *Staker) UnmarshalJSON(data []byte) error

type StakingPoolState

type StakingPoolState struct {
	// contains filtered or unexported fields
}

func InitStakingPoolFromDB

func InitStakingPoolFromDB(stateDB *statedb.StateDB, stakingPoolID string) (*StakingPoolState, error)

func NewStakingPoolState

func NewStakingPoolState() *StakingPoolState

func NewStakingPoolStateWithValue

func NewStakingPoolStateWithValue(
	liquidity uint64,
	stakers map[string]*Staker,
	rewardsPerShare map[common.Hash]*big.Int,
) *StakingPoolState

func (*StakingPoolState) AddReward

func (s *StakingPoolState) AddReward(
	tokenID common.Hash, amount uint64,
)

func (*StakingPoolState) Clone

func (s *StakingPoolState) Clone() *StakingPoolState

func (*StakingPoolState) Liquidity

func (stakingPoolState *StakingPoolState) Liquidity() uint64

func (*StakingPoolState) MarshalJSON

func (stakingPoolState *StakingPoolState) MarshalJSON() ([]byte, error)

func (*StakingPoolState) RecomputeStakingRewards

func (s *StakingPoolState) RecomputeStakingRewards(
	nftID common.Hash,
) (map[common.Hash]uint64, error)

func (*StakingPoolState) RewardsPerShare

func (stakingPoolState *StakingPoolState) RewardsPerShare() map[common.Hash]*big.Int

func (*StakingPoolState) SetRewardsPerShare

func (stakingPoolState *StakingPoolState) SetRewardsPerShare(rewardsPerShare map[common.Hash]*big.Int)

func (*StakingPoolState) Stakers

func (stakingPoolState *StakingPoolState) Stakers() map[string]*Staker

func (*StakingPoolState) UnmarshalJSON

func (stakingPoolState *StakingPoolState) UnmarshalJSON(data []byte) error

type State

type State interface {
	Version() uint
	Clone() State
	Process(StateEnvironment) error
	StoreToDB(StateEnvironment, *StateChange) error
	BuildInstructions(StateEnvironment) ([][]string, error)
	TransformKeyWithNewBeaconHeight(beaconHeight uint64)
	ClearCache()
	GetDiff(State, *StateChange) (State, *StateChange, error)
	Reader() StateReader
	Validator() StateValidator
}

func InitStateFromDB

func InitStateFromDB(stateDB *statedb.StateDB, beaconHeight uint64, version uint) (State, error)

func InitVersionByBeaconHeight

func InitVersionByBeaconHeight(beaconHeight uint64) State

type StateChange

type StateChange = v2.StateChange

func NewStateChange

func NewStateChange() *StateChange

type StateEnvBuilder

type StateEnvBuilder interface {
	BuildContributionActions([][]string) StateEnvBuilder
	BuildPRVRequiredContributionActions([][]string) StateEnvBuilder
	BuildTradeActions([][]string) StateEnvBuilder
	BuildCrossPoolTradeActions([][]string) StateEnvBuilder
	BuildWithdrawalActions([][]string) StateEnvBuilder
	BuildFeeWithdrawalActions([][]string) StateEnvBuilder
	BuildPrevBeaconHeight(uint64) StateEnvBuilder
	BuildListTxs(map[byte][]metadata.Transaction) StateEnvBuilder
	BuildBeaconInstructions([][]string) StateEnvBuilder
	BuildStateDB(*statedb.StateDB) StateEnvBuilder
	BuildBCHeightBreakPointPrivacyV2(uint64) StateEnvBuilder
	BuildPdexv3BreakPoint(uint64) StateEnvBuilder
	BuildReward(uint64) StateEnvBuilder
	BuildIsInscriptionFeatureEnabled(bool) StateEnvBuilder
	Build() StateEnvironment
}

func NewStateEnvBuilder

func NewStateEnvBuilder() StateEnvBuilder

type StateEnvironment

type StateEnvironment interface {
	ContributionActions() [][]string
	PRVRequiredContributionActions() [][]string
	TradeActions() [][]string
	CrossPoolTradeActions() [][]string
	WithdrawalActions() [][]string
	FeeWithdrawalActions() [][]string
	PrevBeaconHeight() uint64
	BeaconInstructions() [][]string
	ListTxs() map[byte][]metadata.Transaction
	StateDB() *statedb.StateDB
	BCHeightBreakPointPrivacyV2() uint64
	Pdexv3BreakPoint() uint64
	Reward() uint64
	IsInscriptionFeatureEnabled() bool
}

type StateReader

type StateReader interface {
	Params() *Params
	WaitingContributions() []byte
	PoolPairs() []byte
	Shares() map[string]uint64
	TradingFees() map[string]uint64
	NftIDs() map[string]uint64
	StakingPools() map[string]*StakingPoolState
}

type StateValidator

type StateValidator interface {
	IsValidNftID(nftID string) error
	IsValidPoolPairID(poolPairID string) error
	IsValidMintNftRequireAmount(amount uint64) error
	IsValidStakingPool(tokenID string) error
	IsValidUnstakingAmount(tokenID, nftID string, unstakingAmount uint64) error
	IsValidShareAmount(poolPairID, nftID string, shareAmount uint64) error
}

type TxBuilderV1

type TxBuilderV1 struct {
}

func (*TxBuilderV1) Build

func (txBuilder *TxBuilderV1) Build(
	metaType int,
	inst []string,
	producerPrivateKey *privacy.PrivateKey,
	shardID byte,
	transactionStateDB *statedb.StateDB,
) (metadata.Transaction, error)

type TxBuilderV2

type TxBuilderV2 struct {
}

func (*TxBuilderV2) Build

func (txBuilder *TxBuilderV2) Build(
	metaType int,
	inst []string,
	producerPrivateKey *privacy.PrivateKey,
	shardID byte,
	transactionStateDB *statedb.StateDB,
	beaconHeight uint64,
) (metadata.Transaction, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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