service

package
v0.0.0-...-4d9bc2d Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ONE             = "1"
	ExpiredDuration = 1
)

Variables

This section is empty.

Functions

func AssignWallet

func AssignWallet(
	chainId uint64, holderAddress, pfTokenReceiverAddress, invoiceNumber, notifyUrl string,
	payableAmount, validityTerm uint64) (address, uuid string, expireTime uint64, err error)

func Claim

func Claim(chainId uint64) (totalClaimAmount uint64, err error)

func GetARP

func GetARP(chainId, date uint64) (apr string, err error)

func GetLastARP

func GetLastARP(chainId uint64) (apr string, err error)

func GetRequestRedemptionWallets

func GetRequestRedemptionWallets(chainId uint64, redeemAmount *big.Int) (redemptionWalletMap map[string]string, err error)

func GetTVL

func GetTVL(chainId uint64) (amount uint64, err error)

func GetUserClaimableAmount

func GetUserClaimableAmount(chainId uint64, address string) (userClaimableAmount uint64, err error)

func GetWithdrawList

func GetWithdrawList(chainId uint64, address, orderby string, offset, limit int) ([]*dao.PftokenWithdrawDetail, error)

func HandleWalletDeposit

func HandleWalletDeposit(chainId uint64, address string) error

func IsWalletAssignable

func IsWalletAssignable(chainId uint64, address string) (ok bool, err error)

func IsWalletValid

func IsWalletValid(chainId uint64, address string) (ok bool, err error)

func PaymentNotifyReset

func PaymentNotifyReset(chainId uint64, uuid string) (err error)

func Rebase

func Rebase(chainId uint64) error

func RefundFromWallet

func RefundFromWallet(chainId uint64, address string) (refundAmount string, err error)

func RequestRedemption

func RequestRedemption(chainId uint64, redeemAmount uint64, redemptionWalletMap map[string]uint64) (claimableTime uint64, err error)

func SwapMoney

func SwapMoney(
	chainId, amount uint64, address, invoiceNumber, notifyUrl string) (uuid string, err error)

func SwapNotifyReset

func SwapNotifyReset(chainId uint64, uuid string) (err error)

func WalletCount

func WalletCount(chainId uint64) (total uint64, err error)

func WithdrawRefundTokens

func WithdrawRefundTokens(chainId uint64, address, amount string) error

Types

type SwapRateResponse

type SwapRateResponse struct {
	Amount          *big.Int `json:"amount"`
	ActualAmount    *big.Int `json:"actual_amount"`
	LiquidityTarget *big.Int `json:"liquidity_target"`
	Reserve         *big.Int `json:"reserve"`
	Fee             *big.Int `json:"fee"`
	Decimals        uint8    `json:"decimals"`
	FeeRate         *big.Int `json:"fee_rate"`
	MinFee          *big.Int `json:"min_fee"`
	MaxFee          *big.Int `json:"max_fee"`
	FeeDecimals     uint8    `json:"fee_decimals"`
}

func SwapRate

func SwapRate(chainId, amount uint64) (res *SwapRateResponse, err error)

type SwapRateStr

type SwapRateStr struct {
	ReserveStr string `json:"reserveStr"`
	TargetStr  string `json:"targetStr"`
	MaxFeeStr  string `json:"maxFeeStr"`
	MinFeeStr  string `json:"minFeeStr"`
	FactorStr  string `json:"factorStr"`
}

type Wallet

type Wallet struct {
	*db.Wallet
	BIntRecordedBalance *big.Int
	BIntBalanceOf       *big.Int
}

func NewWalletHasNumType

func NewWalletHasNumType(wallet *db.Wallet) (*Wallet, error)

type WalletService

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

func GetWalletService

func GetWalletService() *WalletService

func NewWalletService

func NewWalletService() *WalletService

func (*WalletService) AssignWallet

func (s *WalletService) AssignWallet(wallet *db.Wallet, assign *db.WalletAssign, blockTime uint64) (
	w *db.Wallet, a *db.WalletAssign, err error)

func (*WalletService) DoesCoinExistByCoinType

func (s *WalletService) DoesCoinExistByCoinType(coinType uint64) (exists bool, err error)

func (*WalletService) GetAvailableWallet

func (s *WalletService) GetAvailableWallet(chainId uint64) (wallet *db.Wallet, err error)

func (*WalletService) GetCoinByCoinType

func (s *WalletService) GetCoinByCoinType(coinType uint64) (coin *db.Coin, err error)

func (*WalletService) GetSwapRecordByUUID

func (s *WalletService) GetSwapRecordByUUID(uuid string) (swap *db.SwapRecord, err error)

func (*WalletService) GetWalletAssignByUUID

func (s *WalletService) GetWalletAssignByUUID(uuid string) (assign *db.WalletAssign, err error)

func (*WalletService) UpdateWallet

func (s *WalletService) UpdateWallet(wallet *db.Wallet, assign *db.WalletAssign) (err error)

Jump to

Keyboard shortcuts

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