Documentation ¶
Index ¶
- func AssignWallet(chainId uint64, ...) (address, uuid string, expireTime uint64, err error)
- func Claim(chainId uint64) (totalClaimAmount uint64, err error)
- func GetARP(chainId, date uint64) (apr string, err error)
- func GetLastARP(chainId uint64) (apr string, err error)
- func GetRequestRedemptionWallets(chainId uint64, redeemAmount *big.Int) (redemptionWalletMap map[string]string, err error)
- func GetTVL(chainId uint64) (amount uint64, err error)
- func GetUserClaimableAmount(chainId uint64, address string) (userClaimableAmount uint64, err error)
- func GetWithdrawList(chainId uint64, address, orderby string, offset, limit int) ([]*dao.PftokenWithdrawDetail, error)
- func HandleWalletDeposit(chainId uint64, address string) error
- func IsWalletAssignable(chainId uint64, address string) (ok bool, err error)
- func IsWalletValid(chainId uint64, address string) (ok bool, err error)
- func PaymentNotifyReset(chainId uint64, uuid string) (err error)
- func Rebase(chainId uint64) error
- func RefundFromWallet(chainId uint64, address string) (refundAmount string, err error)
- func RequestRedemption(chainId uint64, redeemAmount uint64, redemptionWalletMap map[string]uint64) (claimableTime uint64, err error)
- func StartScanTasks()
- func SwapMoney(chainId, amount uint64, address, invoiceNumber, notifyUrl string) (uuid string, err error)
- func SwapNotifyReset(chainId uint64, uuid string) (err error)
- func WalletCount(chainId uint64) (total uint64, err error)
- func WithdrawRefundTokens(chainId uint64, address, amount string) error
- type PlpServer
- type SwapRateResponse
Constants ¶
This section is empty.
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)
*
- Assign the given wallet or create a new one to the specified holder.
- For a given wallet, must check if the wallet is assignable. Any extra fund tokens in a wallet should be swept
- to this pool before being assigned, so that the actual fund token balance of the wallet would be exactly the
- same as its recorded balance.
- @param wallet_ Wallet to be assigned. A new wallet will be created if the given `wallet_` is the zero address.
- @param holder_ The new holder that the wallet will be assigned to.
- @param pfTokenReceiver_ The address to receive pfTokens when the payment is completed.
- @param payableAmount_ The amount to be paid.
- @param validityTerm_ The validity term of the wallet. `DEFAULT_VALIDITY_TERM` would be applied if the given
- `validityTerm_` is 0.
- @return The address of the assigned wallet and its expire time.
func GetLastARP ¶
func GetRequestRedemptionWallets ¶
func GetRequestRedemptionWallets(chainId uint64, redeemAmount *big.Int) (redemptionWalletMap map[string]string, err error)
*
- Request redemption by specifying the wallets to be collected and the amount of tokens to be collected.
- @param redeemAmount_ The amount of pfTokens for redeeming.
- @returns redemptionWalletMap key: wallets_ The addresses of wallets to collect funds from.
- @returns redemptionWalletMap val: collectAmounts_ The token amount to collect from each wallet.
func GetUserClaimableAmount ¶
*
- Query all redemption records of the given user, and calculate the currently claimable amount.
func GetWithdrawList ¶
func HandleWalletDeposit ¶
*
- Verify if the wallet payemnt has been completed, if so, update the status of the wallet and the pool,
- and mint pfTokens to target receiver.
- @param wallet_ The address of wallet to be deposited.
func IsWalletAssignable ¶
*
- Returns if the wallet is able to be assigned to a new user.
- An assignable wallet should exist in the wallet pool and have not unexpired,
- and the fund token balance should be equal to the recorded balance, which means
- that the last payment has been completed and the wallet is ready to be reassigned.
func IsWalletValid ¶
*
- Returns if the wallet exists in the pool, regardless of whether it is expired.
func PaymentNotifyReset ¶
func Rebase ¶
*
- Rebase by updating the value of base reserve by calculating the latest TVL in the plp address pool.
- After rebasing, the totalSupply of plp token will be equal to the amount of fund tokens in the plp
- address pool, thus keeping the exchange rate at 1:1.
func RefundFromWallet ¶
* * Execute refund from the given wallet. This function can only be called by the owner, so that to * prevent it from being abused. e.g., there may be a delay between the user payment (before expire * time) and the `handleWalletDeeposit` process (after expire time), if the refund process is * triggered before `handleWalletDeposit`, then the user payment would be deemed failed.
func RequestRedemption ¶
func StartScanTasks ¶
func StartScanTasks()
func SwapNotifyReset ¶
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)
Click to show internal directories.
Click to hide internal directories.