Documentation ¶
Index ¶
- Constants
- Variables
- func InitBlockChainClient()
- func IsSolana(chainId uint64) bool
- type Blockchain
- type EthClient
- func (c *EthClient) AssignWallet(walletAddress, holderAddress, pfTokenReceiverAddress string, ...) (address, txHash string, expireTime, blockNumber, blockTime, nonce uint64, ...)
- func (c *EthClient) Claim() (totalClaimAmount uint64, err error)
- func (c *EthClient) GetBlockNumberIntervalSeconds() uint64
- func (c *EthClient) GetFundTokenReserve() (fundTokenReserve string, err error)
- func (c *EthClient) GetIsPaymentProcessedByWallet(address string) (isPaymentProcessed bool, err error)
- func (c *EthClient) GetOwnerAddress() string
- func (c *EthClient) GetPayTokenBlockNumber() uint64
- func (c *EthClient) GetPayTokenContractAddr() string
- func (c *EthClient) GetPayTokenDecimals() uint8
- func (c *EthClient) GetPayTokenSymbol() string
- func (c *EthClient) GetPercentageFactor() (factor string, err error)
- func (c *EthClient) GetPlpAddressPoolContractAddr() string
- func (c *EthClient) GetSwapFeeBase() (liquidityTarget, maxFee, minFee string, err error)
- func (c *EthClient) GetTVL() (amount uint64, err error)
- func (c *EthClient) GetUserClaimableAmount(address string) (userClaimableAmount uint64, err error)
- func (c *EthClient) HandleWalletDeposit(address string) (err error)
- func (c *EthClient) IsWalletAssignable(address string) (ok bool, err error)
- func (c *EthClient) IsWalletValid(address string) (ok bool, err error)
- func (c *EthClient) LastRebaseTime() (lastRebaseTime uint64, err error)
- func (c *EthClient) MinRebaseInterval() (minRebaseInterval uint64, err error)
- func (c *EthClient) Rebase() (err error)
- func (c *EthClient) RefundFromWallet(address string) (refundAmount string, err error)
- func (c *EthClient) RequestRedemption(redeemAmount uint64, redemptionWalletMap map[string]uint64) (claimableTime uint64, err error)
- func (c *EthClient) SwapForFundToken(_pftokenAmount *big.Int, toAddr string) (sender common.Address, fundTokenAmount, fee *big.Int, txReceipt *types.Receipt, ...)
- func (c *EthClient) WalletCount() (total uint64, err error)
- func (c *EthClient) WithdrawRefundTokens(address, amount string) error
- type SolanaClient
- func (c *SolanaClient) AssignWallet(walletAddress, holderAddress, pfTokenReceiverAddress string, ...) (address, txHash string, expireTime, blockNumber, blockTime, nonce uint64, ...)
- func (c *SolanaClient) Claim() (totalClaimAmount uint64, err error)
- func (c *SolanaClient) GetBlockNumberIntervalSeconds() uint64
- func (c *SolanaClient) GetFundTokenReserve() (fundTokenReserve string, err error)
- func (c *SolanaClient) GetIsPaymentProcessedByWallet(address string) (isPaymentProcessed bool, err error)
- func (c *SolanaClient) GetOwnerAddress() string
- func (c *SolanaClient) GetPayTokenBlockNumber() uint64
- func (c *SolanaClient) GetPayTokenContractAddr() string
- func (c *SolanaClient) GetPayTokenDecimals() uint8
- func (c *SolanaClient) GetPayTokenSymbol() string
- func (c *SolanaClient) GetPercentageFactor() (factor string, err error)
- func (c *SolanaClient) GetPlpAddressPoolContractAddr() string
- func (c *SolanaClient) GetSwapFeeBase() (liquidityTarget, maxFee, minFee string, err error)
- func (c *SolanaClient) GetTVL() (amount uint64, err error)
- func (c *SolanaClient) GetUserClaimableAmount(address string) (userClaimableAmount uint64, err error)
- func (c *SolanaClient) HandleWalletDeposit(address string) error
- func (c *SolanaClient) IsWalletAssignable(address string) (ok bool, err error)
- func (c *SolanaClient) IsWalletValid(address string) (ok bool, err error)
- func (c *SolanaClient) LastRebaseTime() (lastRebaseTime uint64, err error)
- func (c *SolanaClient) MinRebaseInterval() (minRebaseInterval uint64, err error)
- func (c *SolanaClient) Rebase() (err error)
- func (c *SolanaClient) RefundFromWallet(address string) (refundAmount string, err error)
- func (c *SolanaClient) RequestRedemption(redeemAmount uint64, redemptionWalletMap map[string]uint64) (claimableTime uint64, err error)
- func (c *SolanaClient) WalletCount() (total uint64, err error)
- func (c *SolanaClient) WithdrawRefundTokens(address, amount string) error
Constants ¶
View Source
const ( Solana = "solana" SolanaMainChainId uint64 = 1199999911 SolanaTestnetChainId uint64 = 1188888811 SolanaDevnetChainId uint64 = 1177777711 )
Variables ¶
View Source
var EthInstancesByChain = make(map[uint64]*EthClient, 0)
View Source
var SolanaChainIdMap = map[uint64]string{ SolanaMainChainId: Solana, SolanaTestnetChainId: Solana, SolanaDevnetChainId: Solana, }
View Source
var SolanaInstancesByChain = make(map[uint64]*SolanaClient, 0)
Functions ¶
func InitBlockChainClient ¶
func InitBlockChainClient()
Types ¶
type Blockchain ¶
type Blockchain interface { WalletCount() (total uint64, err error) IsWalletValid(address string) (ok bool, err error) IsWalletAssignable(address string) (ok bool, err error) AssignWallet(walletAddress, holderAddress, pfTokenReceiverAddress string, payableAmount, validityTerm uint64) (address, txHash string, expireTime, blockNumber, blockTime, nonce uint64, err error) HandleWalletDeposit(address string) error RequestRedemption(redeemAmount uint64, redemptionWalletMap map[string]uint64) (claimableTime uint64, err error) Claim() (totalClaimAmount uint64, err error) RefundFromWallet(address string) (refundAmount string, err error) WithdrawRefundTokens(address string, amount string) error GetTVL() (amount uint64, err error) GetUserClaimableAmount(address string) (userClaimableAmount uint64, err error) GetPayTokenContractAddr() string GetPayTokenSymbol() string GetIsPaymentProcessedByWallet(address string) (isPaymentProcessed bool, err error) Rebase() error GetPayTokenDecimals() uint8 GetBlockNumberIntervalSeconds() uint64 LastRebaseTime() (lastRebaseTime uint64, err error) MinRebaseInterval() (minRebaseInterval uint64, err error) GetPayTokenBlockNumber() uint64 GetPlpAddressPoolContractAddr() string GetOwnerAddress() string GetFundTokenReserve() (fundTokenReserve string, err error) GetSwapFeeBase() (liquidityTarget, maxFee, minFee string, err error) GetPercentageFactor() (factor string, err error) }
func GetClientByChainId ¶
func GetClientByChainId(chainId uint64) (client Blockchain, err error)
type EthClient ¶
type EthClient struct { ChainId uint64 Client *eth.Client PlpAddressPoolContractAddr common.Address PfTokenContractAddr common.Address LiquidStakingContractAddr common.Address PayTokenContractAddr common.Address PayTokenSymbol string PayTokenDecimals uint8 PayTokenBlockNumber uint64 OwnerPriKey *eth.PrivateKey MerchantPriKey *eth.PrivateKey PlpAddressPoolContract *plp.Plp PfTokenContract *token.Token LiquidStakingContract *staking.Staking BlockNumberIntervalSeconds uint64 }
func GetEthClientByChainId ¶
func (*EthClient) AssignWallet ¶
func (*EthClient) GetBlockNumberIntervalSeconds ¶
func (*EthClient) GetFundTokenReserve ¶
func (*EthClient) GetIsPaymentProcessedByWallet ¶
func (*EthClient) GetOwnerAddress ¶
func (*EthClient) GetPayTokenBlockNumber ¶
func (*EthClient) GetPayTokenContractAddr ¶
func (*EthClient) GetPayTokenDecimals ¶
func (*EthClient) GetPayTokenSymbol ¶
func (*EthClient) GetPercentageFactor ¶
func (*EthClient) GetPlpAddressPoolContractAddr ¶
func (*EthClient) GetSwapFeeBase ¶
func (*EthClient) GetUserClaimableAmount ¶
func (*EthClient) HandleWalletDeposit ¶
func (*EthClient) IsWalletAssignable ¶
func (*EthClient) IsWalletValid ¶
func (*EthClient) LastRebaseTime ¶
func (*EthClient) MinRebaseInterval ¶
func (*EthClient) RefundFromWallet ¶
func (*EthClient) RequestRedemption ¶
func (*EthClient) SwapForFundToken ¶
func (*EthClient) WalletCount ¶
func (*EthClient) WithdrawRefundTokens ¶
type SolanaClient ¶
type SolanaClient struct { ChainId uint64 Client *solana.Client PlpAddressPoolContractAddr solanaGo.PublicKey PfTokenContractAddr solanaGo.PublicKey LiquidStakingContractAddr solanaGo.PublicKey PayTokenContractAddr solanaGo.PublicKey PayTokenSymbol string PayTokenDecimals uint8 PayTokenBlockNumber uint64 OwnerPriKey solanaGo.PrivateKey BlockNumberIntervalSeconds uint64 }
func (*SolanaClient) AssignWallet ¶
func (*SolanaClient) Claim ¶
func (c *SolanaClient) Claim() (totalClaimAmount uint64, err error)
func (*SolanaClient) GetBlockNumberIntervalSeconds ¶
func (c *SolanaClient) GetBlockNumberIntervalSeconds() uint64
func (*SolanaClient) GetFundTokenReserve ¶
func (c *SolanaClient) GetFundTokenReserve() (fundTokenReserve string, err error)
func (*SolanaClient) GetIsPaymentProcessedByWallet ¶
func (c *SolanaClient) GetIsPaymentProcessedByWallet(address string) (isPaymentProcessed bool, err error)
func (*SolanaClient) GetOwnerAddress ¶
func (c *SolanaClient) GetOwnerAddress() string
func (*SolanaClient) GetPayTokenBlockNumber ¶
func (c *SolanaClient) GetPayTokenBlockNumber() uint64
func (*SolanaClient) GetPayTokenContractAddr ¶
func (c *SolanaClient) GetPayTokenContractAddr() string
func (*SolanaClient) GetPayTokenDecimals ¶
func (c *SolanaClient) GetPayTokenDecimals() uint8
func (*SolanaClient) GetPayTokenSymbol ¶
func (c *SolanaClient) GetPayTokenSymbol() string
func (*SolanaClient) GetPercentageFactor ¶
func (c *SolanaClient) GetPercentageFactor() (factor string, err error)
func (*SolanaClient) GetPlpAddressPoolContractAddr ¶
func (c *SolanaClient) GetPlpAddressPoolContractAddr() string
func (*SolanaClient) GetSwapFeeBase ¶
func (c *SolanaClient) GetSwapFeeBase() (liquidityTarget, maxFee, minFee string, err error)
func (*SolanaClient) GetTVL ¶
func (c *SolanaClient) GetTVL() (amount uint64, err error)
func (*SolanaClient) GetUserClaimableAmount ¶
func (c *SolanaClient) GetUserClaimableAmount(address string) (userClaimableAmount uint64, err error)
func (*SolanaClient) HandleWalletDeposit ¶
func (c *SolanaClient) HandleWalletDeposit(address string) error
func (*SolanaClient) IsWalletAssignable ¶
func (c *SolanaClient) IsWalletAssignable(address string) (ok bool, err error)
func (*SolanaClient) IsWalletValid ¶
func (c *SolanaClient) IsWalletValid(address string) (ok bool, err error)
func (*SolanaClient) LastRebaseTime ¶
func (c *SolanaClient) LastRebaseTime() (lastRebaseTime uint64, err error)
func (*SolanaClient) MinRebaseInterval ¶
func (c *SolanaClient) MinRebaseInterval() (minRebaseInterval uint64, err error)
func (*SolanaClient) Rebase ¶
func (c *SolanaClient) Rebase() (err error)
func (*SolanaClient) RefundFromWallet ¶
func (c *SolanaClient) RefundFromWallet(address string) (refundAmount string, err error)
func (*SolanaClient) RequestRedemption ¶
func (*SolanaClient) WalletCount ¶
func (c *SolanaClient) WalletCount() (total uint64, err error)
func (*SolanaClient) WithdrawRefundTokens ¶
func (c *SolanaClient) WithdrawRefundTokens(address, amount string) error
Click to show internal directories.
Click to hide internal directories.