Documentation ¶
Index ¶
- Constants
- Variables
- func APICollectionAssets(c *gin.Context)
- func APICollectionDetail(c *gin.Context)
- func APIEstimateBuyFee(c *gin.Context)
- func APIEstimateReward(c *gin.Context)
- func APIEstimateSwapFee(c *gin.Context)
- func APIEstimateUnshield(c *gin.Context)
- func APIGenShieldAddress(c *gin.Context)
- func APIGenUnshieldAddress(c *gin.Context)
- func APIGetCollections(c *gin.Context)
- func APIGetDefaultTokenList(c *gin.Context)
- func APIGetFailedShieldTx(c *gin.Context)
- func APIGetInterswapTxStatus(c *gin.Context)
- func APIGetNetworksFee(c *gin.Context)
- func APIGetPendingShieldTx(c *gin.Context)
- func APIGetPendingSwapTx(c *gin.Context)
- func APIGetShieldStatus(c *gin.Context)
- func APIGetStatusByShieldService(c *gin.Context)
- func APIGetSupportedToken(c *gin.Context)
- func APIGetSupportedTokenInfo(c *gin.Context)
- func APIGetSupportedTokenInternal(c *gin.Context)
- func APIGetSwapTxStatus(c *gin.Context)
- func APIGetUnshieldStatus(c *gin.Context)
- func APIGetUnshieldTxStatus(c *gin.Context)
- func APIGetVaultState(c *gin.Context)
- func APINFTDetail(c *gin.Context)
- func APIRetryShieldTx(c *gin.Context)
- func APIRetrySwapTx(c *gin.Context)
- func APISearchToken(c *gin.Context)
- func APISubmitBuyTx(c *gin.Context)
- func APISubmitInterSwapTx(c *gin.Context)
- func APISubmitShieldTx(c *gin.Context)
- func APISubmitSwapTx(c *gin.Context)
- func APISubmitUnshieldTx(c *gin.Context)
- func APISubmitUnshieldTxNew(c *gin.Context)
- func APITrackDEXSwap(c *gin.Context)
- func APIUnshieldFeeEstimate(c *gin.Context)
- func APIValidateAddress(c *gin.Context)
- func ConvertNanoAmountOutChainToIncognitoNanoTokenAmountString(amountStr string, decimal, pDecimals int64) uint64
- func ConvertNanoIncogTokenToOutChainToken(amountStr string, decimal, pDecimals int64) uint64
- func ConvertToNanoIncognitoToken(coinAmount *big.Float, pdecimal int64) *big.Float
- func InitInterswapIncKeySet(keys map[string]string) error
- func IsValidOTAs(otas []string) (bool, error)
- func StartAPIservice(cfg common.Config)
- func ValidateSubmitInterSwapTxRequest(req SubmitInterSwapTxRequest, network string) (bool, string, error)
- func VerifyCaptcha(clientCaptcha string, secret string) (bool, error)
- type APIRespond
- type APITokenInfoRequest
- type AddOnSwapInfo
- type CurvePoolIndex
- type DexSwap
- type EstimateRewardRequest
- type EstimateRewardRespond
- type EstimateSwapRequest
- type EstimateSwapRespond
- type EstimateSwapResult
- type EstimateUnshieldRequest
- type EstimateUnshieldRespond
- type FeeModel
- type GenBTCShieldAddressRequest
- type GenShieldAddressRequest
- type GenUnshieldAddressRequest
- type HistoryAddressResp
- type InterswapStatus
- type OpenSeaFee
- type PancakeQuote
- type PancakeTokenMapItem
- type PappNetworkFee
- type PappSupportedTokenData
- type PdexEstimateRespond
- type QuoteDataResp
- type RetrySwapTx
- type RewardModel
- type ShieldStatus
- type ShieldStatusData
- type StatusSwapTxDetail
- type SubmitInterSwapTxRequest
- type SubmitShieldTx
- type SubmitSwapTx
- type SubmitSwapTxRequest
- type SubmitTxListRequest
- type SubmitUnshieldTxRequest
- type TokenStruct
- type TransactionDetail
- type TxStatusRespond
- type UnifiedReward
- type UnifiedStatus
- type UniswapQuote
- type UniswapQuoteToken
- type UniswapRoute
- type UnshieldNetworkFee
- type UnshieldRequest
- type UnshieldRequestData
- type UnshieldServiceAuth
Constants ¶
View Source
const ( ProtocolFee = "protocol_fee" NetworkFee = "network_fee" )
View Source
const EmptyExternalAddress = "0000000000000000000000000000000000000000"
View Source
const (
UNSHIELD_GAS_LIMIT = 300000
)
Variables ¶
View Source
var (
NotTradeable = errors.New("No tradeable network found")
)
Functions ¶
func APICollectionAssets ¶
func APICollectionDetail ¶
func APIEstimateBuyFee ¶
func APIEstimateReward ¶
func APIEstimateSwapFee ¶
func APIEstimateUnshield ¶
func APIGenShieldAddress ¶
func APIGenUnshieldAddress ¶
func APIGetCollections ¶
func APIGetDefaultTokenList ¶
func APIGetFailedShieldTx ¶
func APIGetInterswapTxStatus ¶
func APIGetNetworksFee ¶
func APIGetPendingShieldTx ¶
func APIGetPendingSwapTx ¶
func APIGetShieldStatus ¶
func APIGetSupportedToken ¶
func APIGetSwapTxStatus ¶
func APIGetUnshieldStatus ¶
func APIGetUnshieldTxStatus ¶
func APIGetVaultState ¶
func APINFTDetail ¶
func APIRetryShieldTx ¶
func APIRetrySwapTx ¶
func APISearchToken ¶
func APISubmitBuyTx ¶
func APISubmitInterSwapTx ¶
func APISubmitShieldTx ¶
func APISubmitSwapTx ¶
func APISubmitUnshieldTx ¶
func APISubmitUnshieldTxNew ¶
func APITrackDEXSwap ¶
func APIUnshieldFeeEstimate ¶
func APIValidateAddress ¶
func ConvertNanoAmountOutChainToIncognitoNanoTokenAmountString ¶
func ConvertNanoAmountOutChainToIncognitoNanoTokenAmountString(amountStr string, decimal, pDecimals int64) uint64
convert nano coin to nano token: ex: 2000000000000000 (nano eth) => 2000000 (nano pETH)
func ConvertToNanoIncognitoToken ¶
convert coin amount to incognito nano token amount: ex: 002(ETH)*1e9=2000000 nano pETH
func InitInterswapIncKeySet ¶
func IsValidOTAs ¶
func StartAPIservice ¶
func ValidateSubmitInterSwapTxRequest ¶
func ValidateSubmitInterSwapTxRequest(req SubmitInterSwapTxRequest, network string) (bool, string, error)
validate sanity request
Types ¶
type APIRespond ¶
type APIRespond struct { Result interface{} Error *string }
type APITokenInfoRequest ¶
type AddOnSwapInfo ¶
type CurvePoolIndex ¶
type EstimateRewardRequest ¶
type EstimateRewardRespond ¶
type EstimateSwapRequest ¶
type EstimateSwapRespond ¶
type EstimateSwapResult ¶
type EstimateSwapResult struct { EstimateReceive float64 Fees map[string]FeeModel Rewards map[string]RewardModel }
type EstimateUnshieldRequest ¶
type EstimateUnshieldRespond ¶
type GenShieldAddressRequest ¶
type HistoryAddressResp ¶
type HistoryAddressResp struct { ID uint UserID uint Address string ExpiredAt time.Time EstFeeAt *time.Time AddressType int Status int StatusMessage string StatusDetail string CurrencyType int Network string WalletAddress string UserPaymentAddress string RequestedAmount string ReceivedAmount string IncognitoAmount string EthereumTx string IncognitoTx string Erc20TokenTx string PrivacyTokenAddress string Erc20TokenAddress string CreatedAt time.Time UpdatedAt time.Time Decentralized int OutChainTx string InChainTx string TokenFee string PrivacyFee string OutChainPrivacyFee string OutChainTokenFee string BurnTokenFee string BurnPrivacyFee string IncognitoTxToPayOutsideChainFee string Note string Memo string TxReceive string UnifiedStatus *UnifiedStatus UnifiedReward *UnifiedReward Decimals int64 PDecimals uint64 }
type InterswapStatus ¶
type OpenSeaFee ¶
type PancakeQuote ¶
type PancakeTokenMapItem ¶
type PappNetworkFee ¶
type PappSupportedTokenData ¶
type PappSupportedTokenData struct { ID string ContractID string ContractIDGetRate string Name string Symbol string PricePrv float64 Decimals int PDecimals int Protocol string Verify bool IsPopular bool Priority int DappID int CurrencyType int NetworkID int MovedUnifiedToken bool NetworkName string }
type PdexEstimateRespond ¶
type QuoteDataResp ¶
type QuoteDataResp struct { AppName string CallContract string AmountIn string AmountInRaw string AmountOut string AmountOutRaw string AmountOutPreSlippage string RedepositReward string Rate string Fee []PappNetworkFee FeeAddress string FeeAddressShardID int Paths interface{} PathsContract interface{} PoolPairs []string Calldata string ImpactAmount string RouteDebug interface{} }
type RetrySwapTx ¶
type RetrySwapTx struct {
Txs []string
}
type RewardModel ¶
type ShieldStatus ¶
type ShieldStatus struct { Status byte `json:"Status"` Data []ShieldStatusData `json:"Data,omitempty"` ErrorCode int `json:"ErrorCode,omitempty"` }
type ShieldStatusData ¶
type StatusSwapTxDetail ¶
type SubmitInterSwapTxRequest ¶
type SubmitInterSwapTxRequest struct { TxRaw string TxHash string FromToken string ToToken string MidToken string FinalMinExpectedAmt uint64 Slippage string PAppName string PAppNetwork string ShardID string OTARefundFee string // user's OTA to receive refunded swap papp fee (sender is BE, receiver is user) OTARefund string // user's OTA to receive fund from InterswapBE only in case PappPdexType and the first tx is reverted (sender is InterswapBE, receiver is user) OTAFromToken string // user's OTA to receive refunded swap amount (sell token || mid token) OTAToToken string // user's OTA to receive buy token WithdrawAddress string // only withdraw when PathType = pDexToPapp }
type SubmitShieldTx ¶
type SubmitSwapTx ¶
type SubmitSwapTxRequest ¶
type SubmitTxListRequest ¶
type SubmitTxListRequest struct {
TxList []string
}
type SubmitUnshieldTxRequest ¶
type SubmitUnshieldTxRequest struct { Network string IncognitoAmount string PaymentAddress string PrivacyTokenAddress string WalletAddress string UserFeeLevel int ID int IncognitoTx string UserFeeSelection int //centralized PrivacyFee string TokenFee string Address string IncognitoTxToPayOutsideChainFee string }
type TokenStruct ¶
type TokenStruct struct {
ID string `json:"id"`
}
type TransactionDetail ¶
type TransactionDetail struct { BlockHash string `json:"BlockHash"` BlockHeight uint64 `json:"BlockHeight"` TxSize uint64 `json:"TxSize"` Index uint64 `json:"Index"` ShardID byte `json:"ShardID"` Hash string `json:"Hash"` Version int8 `json:"Version"` Type string `json:"Type"` // Transaction type LockTime string `json:"LockTime"` RawLockTime int64 `json:"RawLockTime,omitempty"` Fee uint64 `json:"Fee"` // Fee applies: always consant Image string `json:"Image"` IsPrivacy bool `json:"IsPrivacy"` // Proof privacy.Proof `json:"Proof"` // ProofDetail interface{} `json:"ProofDetail"` InputCoinPubKey string `json:"InputCoinPubKey"` SigPubKey string `json:"SigPubKey,omitempty"` // 64 bytes RawSigPubKey []byte `json:"RawSigPubKey,omitempty"` Sig string `json:"Sig,omitempty"` // 64 bytes Metadata string `json:"Metadata"` CustomTokenData string `json:"CustomTokenData"` PrivacyCustomTokenID string `json:"PrivacyCustomTokenID"` PrivacyCustomTokenName string `json:"PrivacyCustomTokenName"` PrivacyCustomTokenSymbol string `json:"PrivacyCustomTokenSymbol"` PrivacyCustomTokenData string `json:"PrivacyCustomTokenData"` PrivacyCustomTokenProofDetail interface{} `json:"PrivacyCustomTokenProofDetail"` PrivacyCustomTokenIsPrivacy bool `json:"PrivacyCustomTokenIsPrivacy"` PrivacyCustomTokenFee uint64 `json:"PrivacyCustomTokenFee"` IsInMempool bool `json:"IsInMempool"` IsInBlock bool `json:"IsInBlock"` Info string `json:"Info"` }
type TxStatusRespond ¶
type UnifiedReward ¶
type UnifiedStatus ¶
type UniswapQuote ¶
type UniswapQuote struct { Data struct { AmountIn string `json:"amountIn"` AmountOut string `json:"amountOut"` AmountOutRaw string `json:"amountOutRaw"` Route [][]UniswapRoute `json:"route"` Impact float64 `json:"impact"` EstimatedGasUsed string `json:"estimatedGasUsed"` } `json:"data"` Message string `json:"message"` Error string `json:"error"` }
type UniswapQuoteToken ¶
type UniswapRoute ¶
type UniswapRoute struct { AmountIn string `json:"amountIn"` AmountOut string `json:"amountOut"` Fee int64 `json:"fee"` Liquidity string `json:"liquidity"` Percent float64 `json:"percent"` Type string `json:"type"` PoolAddress string `json:"poolAddress"` RawQuote string `json:"rawQuote"` SqrtPriceX96After string `json:"sqrtPriceX96After"` TokenIn UniswapQuoteToken `json:"tokenIn"` TokenOut UniswapQuoteToken `json:"tokenOut"` }
type UnshieldNetworkFee ¶
type UnshieldNetworkFee struct { FeeAddress string `json:"feeAddress"` FeeAddressShardID int `json:"feeAddressShardID"` ExpectedReceive uint64 `json:"expectedReceive"` BurntAmount uint64 `json:"burntAmount"` TokenID string `json:"tokenid"` Amount uint64 `json:"feeAmount"` PrivacyFee uint64 `json:"privacyFee"` ProtocolFee uint64 `json:"protocolFee"` FeeInUSD float64 `json:"feeInUSD"` }
type UnshieldRequest ¶
type UnshieldRequest struct { UnifiedTokenID common.Hash `json:"UnifiedTokenID"` Data []UnshieldRequestData `json:"Data"` Receiver coin.OTAReceiver `json:"Receiver"` IsDepositToSC bool `json:"IsDepositToSC"` metadataCommon.MetadataBase }
type UnshieldRequestData ¶
type UnshieldServiceAuth ¶
type UnshieldServiceAuth struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.