Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( FeePercentage = int64(10000) MinFeeAmountInUsd = decimal.NewFromFloat(1) TopicId = "0.0.1234567" BridgeAccountId = "0.0.476139" ReserveAmount = int64(100) ReserveAmountStr = strconv.FormatInt(ReserveAmount, 10) ReserveAmountBigInt = big.NewInt(ReserveAmount) ReserveAmountWrappedNFTBigInt = big.NewInt(0) NetworkHederaFungibleNativeToken = constants.Hbar NetworkHederaFungibleNativeAsset = &asset.NativeAsset{ MinFeeAmountInUsd: &MinFeeAmountInUsd, ChainId: constants.HederaNetworkId, Asset: NetworkHederaFungibleNativeToken, FeePercentage: FeePercentage, } NetworkHederaFungibleNativeTokenFungibleAssetInfo = &asset.FungibleAssetInfo{ Name: NetworkHederaFungibleNativeToken, Symbol: NetworkHederaFungibleNativeToken, Decimals: constants.HederaDefaultDecimals, IsNative: true, ReserveAmount: ReserveAmountBigInt, } NetworkHederaNonFungibleNativeToken = "0.0.111122" NetworkHederaNonFungibleNativeAsset = &asset.NativeAsset{ ChainId: constants.HederaNetworkId, Asset: NetworkHederaNonFungibleNativeToken, } NetworkHederaNFTRoyaltyFeeForToken = asset.RoyaltyFee{ Amount: token.Fraction{ Numerator: 100, Denominator: 100, }, FallbackFee: asset.FixedFee{ Amount: 10, DenominatingTokenId: &NetworkHederaFungibleNativeToken, }, CollectorAccountID: "", } NetworkHederaNFTRoyaltyFeeHbarFallback = asset.RoyaltyFee{ Amount: token.Fraction{ Numerator: 100, Denominator: 100, }, FallbackFee: asset.FixedFee{ Amount: 100, DenominatingTokenId: nil, }, CollectorAccountID: "", } NetworkHederaNonFungibleNativeTokenNonFungibleAssetInfo = &asset.NonFungibleAssetInfo{ Name: NetworkHederaNonFungibleNativeToken, Symbol: NetworkHederaNonFungibleNativeToken, IsNative: true, ReserveAmount: ReserveAmountBigInt, CustomFees: asset.CustomFees{ CreatedTimestamp: "", RoyaltyFees: []asset.RoyaltyFee{ NetworkHederaNFTRoyaltyFeeForToken, NetworkHederaNFTRoyaltyFeeHbarFallback, }, }, CustomFeeTotalAmounts: asset.CustomFeeTotalAmounts{ FallbackFeeAmountInHbar: 100, FallbackFeeAmountsByTokenId: map[string]int64{NetworkHederaFungibleNativeToken: NetworkHederaNFTRoyaltyFeeForToken.FallbackFee.Amount}, }, } NetworkHederaFungibleWrappedTokenForNetworkPolygon = "0.0.000033" NetworkHederaFungibleWrappedTokenForNetworkPolygonFungibleAssetInfo = &asset.FungibleAssetInfo{ Name: NetworkHederaFungibleWrappedTokenForNetworkPolygon, Symbol: NetworkHederaFungibleWrappedTokenForNetworkPolygon, Decimals: constants.HederaDefaultDecimals, ReserveAmount: ReserveAmountBigInt, } EthereumNetworkId = uint64(1) EthereumRouterContractAddress = "0xb083879B1e10C8476802016CB12cd2F25a000000" NetworkEthereumFungibleNativeToken = "0xb083879B1e10C8476802016CB12cd2F25a896691" NetworkEthereumFungibleNativeAsset = &asset.NativeAsset{ MinFeeAmountInUsd: &MinFeeAmountInUsd, ChainId: EthereumNetworkId, Asset: NetworkEthereumFungibleNativeToken, FeePercentage: FeePercentage, } NetworkEthereumFungibleNativeTokenFungibleAssetInfo = &asset.FungibleAssetInfo{ Name: NetworkEthereumFungibleNativeToken, Symbol: NetworkEthereumFungibleNativeToken, Decimals: constants.EvmDefaultDecimals, IsNative: true, ReserveAmount: ReserveAmountBigInt, } NetworkEthereumNFTWrappedTokenForNetworkHedera = "0x0000000000000000000000000000000000009999" NetworkEthereumFungibleWrappedTokenForNetworkPolygon = "0x0000000000000000000000000000000000000133" NetworkEthereumFungibleWrappedTokenForNetworkPolygonFungibleAssetInfo = &asset.FungibleAssetInfo{ Name: NetworkEthereumFungibleWrappedTokenForNetworkPolygon, Symbol: NetworkEthereumFungibleWrappedTokenForNetworkPolygon, Decimals: constants.EvmDefaultDecimals, ReserveAmount: ReserveAmountBigInt, } NetworkEthereumFungibleWrappedTokenForNetworkHedera = "0x0000000000000000000000000000000000000555" NetworkEthereumFungibleWrappedTokenForNetworkHederaFungibleAssetInfo = &asset.FungibleAssetInfo{ Name: NetworkEthereumFungibleWrappedTokenForNetworkHedera, Symbol: NetworkEthereumFungibleWrappedTokenForNetworkHedera, Decimals: constants.EvmDefaultDecimals, ReserveAmount: ReserveAmountBigInt, } PolygonNetworkId = uint64(137) PolygonRouterContractAddress = "0xb083879B1e10C8476802016CB12cd2F25a000001" NetworkPolygonFungibleNativeToken = "0x0000000000000000000000000000000000000033" NetworkPolygonFungibleNativeAsset = &asset.NativeAsset{ MinFeeAmountInUsd: &MinFeeAmountInUsd, ChainId: PolygonNetworkId, Asset: NetworkPolygonFungibleNativeToken, FeePercentage: FeePercentage, } NetworkPolygonFungibleNativeTokenFungibleAssetInfo = &asset.FungibleAssetInfo{ Name: NetworkPolygonFungibleNativeToken, Symbol: NetworkPolygonFungibleNativeToken, Decimals: constants.EvmDefaultDecimals, IsNative: true, ReserveAmount: ReserveAmountBigInt, } NetworkPolygonFungibleWrappedTokenForNetworkHedera = "0x0000000000000000000000000000000000000001" NetworkPolygonFungibleWrappedTokenForNetworkHederaFungibleAssetInfo = &asset.FungibleAssetInfo{ Name: NetworkPolygonFungibleWrappedTokenForNetworkHedera, Symbol: NetworkPolygonFungibleWrappedTokenForNetworkHedera, Decimals: constants.EvmDefaultDecimals, ReserveAmount: ReserveAmountBigInt, } NetworkPolygonFungibleWrappedTokenForNetworkEthereum = "0x0000000000000000000000000000000000000123" NetworkPolygonFungibleWrappedTokenForNetworkEthereumFungibleAssetInfo = &asset.FungibleAssetInfo{ Name: NetworkPolygonFungibleWrappedTokenForNetworkEthereum, Symbol: NetworkPolygonFungibleWrappedTokenForNetworkEthereum, Decimals: constants.EvmDefaultDecimals, ReserveAmount: ReserveAmountBigInt, } NetworkPolygonWrappedNonFungibleTokenForHedera = "0x0000000000000000000000000000000011111122" NetworkPolygonWrappedNonFungibleTokenForHederaNonFungibleAssetInfo = &asset.NonFungibleAssetInfo{ Name: NetworkPolygonWrappedNonFungibleTokenForHedera, Symbol: NetworkPolygonWrappedNonFungibleTokenForHedera, ReserveAmount: ReserveAmountWrappedNFTBigInt, } Networks = map[uint64]*parser.Network{ constants.HederaNetworkId: { Name: "Hedera", BridgeAccount: BridgeAccountId, PayerAccount: "0.0.476139", Members: []string{"0.0.123", "0.0.321", "0.0.231"}, Tokens: parser.Tokens{ Fungible: map[string]parser.Token{ NetworkHederaFungibleNativeToken: { Networks: map[uint64]string{ PolygonNetworkId: NetworkPolygonFungibleWrappedTokenForNetworkHedera, EthereumNetworkId: NetworkEthereumFungibleWrappedTokenForNetworkHedera, }, CoinGeckoId: HbarCoinGeckoId, CoinMarketCapId: HbarCoinMarketCapId, MinFeeAmountInUsd: MinFeeAmountInUsd.String(), }, }, Nft: map[string]parser.Token{ NetworkHederaNonFungibleNativeToken: { Networks: map[uint64]string{PolygonNetworkId: NetworkPolygonWrappedNonFungibleTokenForHedera}, }, }, }, }, EthereumNetworkId: { Name: "Ethereum", RouterContractAddress: EthereumRouterContractAddress, Tokens: parser.Tokens{ Fungible: map[string]parser.Token{ NetworkEthereumFungibleNativeToken: { Networks: map[uint64]string{ PolygonNetworkId: NetworkPolygonFungibleWrappedTokenForNetworkEthereum, }, CoinGeckoId: EthereumCoinGeckoId, CoinMarketCapId: EthereumCoinMarketCapId, MinFeeAmountInUsd: MinFeeAmountInUsd.String(), }, }, Nft: nil, }, }, PolygonNetworkId: { Name: "Polygon", RouterContractAddress: PolygonRouterContractAddress, Tokens: parser.Tokens{ Fungible: map[string]parser.Token{ NetworkPolygonFungibleNativeToken: { Networks: map[uint64]string{ constants.HederaNetworkId: NetworkHederaFungibleWrappedTokenForNetworkPolygon, EthereumNetworkId: NetworkEthereumFungibleWrappedTokenForNetworkPolygon, }, MinFeeAmountInUsd: MinFeeAmountInUsd.String(), }, }, Nft: nil, }, }, } NativeToWrapped = map[uint64]map[string]map[uint64]string{ constants.HederaNetworkId: { NetworkHederaFungibleNativeToken: { PolygonNetworkId: NetworkPolygonFungibleWrappedTokenForNetworkHedera, EthereumNetworkId: NetworkEthereumFungibleWrappedTokenForNetworkHedera, }, NetworkHederaNonFungibleNativeToken: { PolygonNetworkId: NetworkPolygonWrappedNonFungibleTokenForHedera, }, }, EthereumNetworkId: { NetworkEthereumFungibleNativeToken: { PolygonNetworkId: NetworkPolygonFungibleWrappedTokenForNetworkEthereum, }, }, PolygonNetworkId: { NetworkPolygonFungibleNativeToken: { constants.HederaNetworkId: NetworkHederaFungibleWrappedTokenForNetworkPolygon, EthereumNetworkId: NetworkEthereumFungibleWrappedTokenForNetworkPolygon, }, }, } WrappedToNative = map[uint64]map[string]*asset.NativeAsset{ constants.HederaNetworkId: { NetworkHederaFungibleWrappedTokenForNetworkPolygon: NetworkPolygonFungibleNativeAsset, }, EthereumNetworkId: { NetworkEthereumFungibleWrappedTokenForNetworkPolygon: NetworkPolygonFungibleNativeAsset, NetworkEthereumFungibleWrappedTokenForNetworkHedera: NetworkHederaFungibleNativeAsset, }, PolygonNetworkId: { NetworkPolygonFungibleWrappedTokenForNetworkHedera: NetworkHederaFungibleNativeAsset, NetworkPolygonFungibleWrappedTokenForNetworkEthereum: NetworkEthereumFungibleNativeAsset, NetworkPolygonWrappedNonFungibleTokenForHedera: NetworkHederaNonFungibleNativeAsset, }, } FungibleNetworkAssets = map[uint64][]string{ constants.HederaNetworkId: {NetworkHederaFungibleNativeToken, NetworkHederaFungibleWrappedTokenForNetworkPolygon}, EthereumNetworkId: {NetworkEthereumFungibleNativeToken, NetworkEthereumFungibleWrappedTokenForNetworkPolygon, NetworkEthereumFungibleWrappedTokenForNetworkHedera}, PolygonNetworkId: {NetworkPolygonFungibleNativeToken, NetworkPolygonFungibleWrappedTokenForNetworkEthereum, NetworkPolygonFungibleWrappedTokenForNetworkHedera}, } FungibleNativeAssets = map[uint64]map[string]*asset.NativeAsset{ constants.HederaNetworkId: { NetworkHederaFungibleNativeToken: NetworkHederaFungibleNativeAsset, }, EthereumNetworkId: { NetworkEthereumFungibleNativeToken: NetworkEthereumFungibleNativeAsset, }, PolygonNetworkId: { NetworkPolygonFungibleNativeToken: NetworkPolygonFungibleNativeAsset, }, } FungibleAssetInfos = map[uint64]map[string]*asset.FungibleAssetInfo{ constants.HederaNetworkId: { NetworkHederaFungibleNativeToken: NetworkHederaFungibleNativeTokenFungibleAssetInfo, NetworkHederaFungibleWrappedTokenForNetworkPolygon: NetworkHederaFungibleWrappedTokenForNetworkPolygonFungibleAssetInfo, }, EthereumNetworkId: { NetworkEthereumFungibleNativeToken: NetworkEthereumFungibleNativeTokenFungibleAssetInfo, NetworkEthereumFungibleWrappedTokenForNetworkPolygon: NetworkEthereumFungibleWrappedTokenForNetworkPolygonFungibleAssetInfo, NetworkEthereumFungibleWrappedTokenForNetworkHedera: NetworkEthereumFungibleWrappedTokenForNetworkHederaFungibleAssetInfo, }, PolygonNetworkId: { NetworkPolygonFungibleNativeToken: NetworkPolygonFungibleNativeTokenFungibleAssetInfo, NetworkPolygonFungibleWrappedTokenForNetworkHedera: NetworkPolygonFungibleWrappedTokenForNetworkHederaFungibleAssetInfo, NetworkPolygonFungibleWrappedTokenForNetworkEthereum: NetworkPolygonFungibleWrappedTokenForNetworkEthereumFungibleAssetInfo, }, } NonFungibleNetworkAssets = map[uint64][]string{ constants.HederaNetworkId: {NetworkHederaNonFungibleNativeToken}, PolygonNetworkId: {NetworkPolygonWrappedNonFungibleTokenForHedera}, } NonFungibleAssetInfos = map[uint64]map[string]*asset.NonFungibleAssetInfo{ constants.HederaNetworkId: { NetworkHederaNonFungibleNativeToken: NetworkHederaNonFungibleNativeTokenNonFungibleAssetInfo, }, PolygonNetworkId: { NetworkPolygonWrappedNonFungibleTokenForHedera: NetworkPolygonWrappedNonFungibleTokenForHederaNonFungibleAssetInfo, }, } ParserBridge = parser.Bridge{ UseLocalConfig: true, TopicId: TopicId, Networks: Networks, MonitoredAccounts: make(map[string]string), } HederaNftFees = map[string]int64{ NetworkHederaNonFungibleNativeToken: 1000, } HederaNftDynamicFees = map[string]decimal.Decimal{ NetworkHederaNonFungibleNativeToken: decimal.NewFromInt(2000), } PaymentTokens = map[uint64]string{ PolygonNetworkId: "0x0000000000000000000000000000000000006655", } NftFeesForApi = map[uint64]map[string]pricing.NonFungibleFee{ constants.HederaNetworkId: { NetworkHederaNonFungibleNativeToken: pricing.NonFungibleFee{ IsNative: true, PaymentToken: constants.Hbar, Fee: decimal.NewFromInt(HederaNftFees[NetworkHederaNonFungibleNativeToken]), CustomFees: []pricing.CustomFee{ { PaymentToken: constants.Hbar, Fee: decimal.NewFromInt(NetworkHederaNFTRoyaltyFeeHbarFallback.FallbackFee.Amount), }, { PaymentToken: NetworkHederaFungibleNativeToken, Fee: decimal.NewFromInt(NetworkHederaNFTRoyaltyFeeForToken.FallbackFee.Amount), }, }, }, }, PolygonNetworkId: { NetworkPolygonWrappedNonFungibleTokenForHedera: pricing.NonFungibleFee{ IsNative: false, PaymentToken: PaymentTokens[PolygonNetworkId], Fee: decimal.NewFromBigInt(big.NewInt(10000000000), 0), }, }, } )
View Source
var ( CoinGeckoApiConfig = config.CoinGecko{ ApiAddress: "https://api.coingecko.com/api/v3/", } SimplePriceResponse = coin_gecko.SimplePriceResponse{ EthereumCoinGeckoId: coin_gecko.PriceResult{Usd: EthereumNativeTokenPriceInUsdFloat64}, HbarCoinGeckoId: coin_gecko.PriceResult{Usd: HbarNativeTokenPriceInUsdFloat64}, } )
View Source
var ( CoinMarketCapApiConfig = config.CoinMarketCap{ ApiAddress: "https://pro-api.coinmarketcap.com/v2/cryptocurrency/", ApiKey: "0f56c8c8-4cde-4432-80f2-11f1623e5149", } CoinMarketCapResponse = coinMarketCapModel.CoinMarketCapResponse{ Status: coinMarketCapModel.Status{ ErrorCode: 0, }, Data: map[string]coinMarketCapModel.TokenInfo{ EthereumCoinMarketCapId: { Quote: coinMarketCapModel.Quote{ USD: coinMarketCapModel.Usd{ Price: EthereumNativeTokenPriceInUsdFloat64, }, }, }, HbarCoinMarketCapId: { Quote: coinMarketCapModel.Quote{ USD: coinMarketCapModel.Usd{ Price: HbarNativeTokenPriceInUsdFloat64, }, }, }, }, } )
View Source
var ( ParsedTransactionResponse = mirrorNodeModel.TransactionsResponse{ Transactions: []mirrorNodeModel.Transaction{ { Bytes: nil, ChargedTxFee: 0, ConsensusTimestamp: "1648206035.257921608", EntityId: "0.0.112", MaxFee: "200000000", MemoBase64: "Y3VycmVudFJhdGUgOiAwLjIyNTksIG5leHRSYXRlIDogMC4yMjY0LCBtaWRuaWdodC1jdXJyZW50UmF0ZSA6IDAuMjIwNSBtaWRuaWdodC1uZXh0UmF0ZSA6IDAuMjIwMA==", Name: "FILEUPDATE", Node: "0.0.4", Nonce: 0, ParentConsensusTimestamp: "", Result: "SUCCESS", Scheduled: false, TransactionHash: "zSMXPzZVq1czqAoNmpXjvBybW5K9RHdgGSDoBAI+nmAV/viN7tCCBp7gmbe+vuki", TransactionId: "0.0.57-1648206026-390263003", Transfers: make([]interface{}, 0), ValidDurationSeconds: "120", ValidStartTimestamp: "1648206026.390263003", }, }, Links: map[string]string{ "next": "/api/v1/transactions?account.id=0.0.57&transactiontype=fileupdate&limit=1×tamp=lt:1648206035.257921608", }, } ParsedTransactionResponseCurrentRate = decimal.NewFromFloat(0.2259) ParsedTransactionResponseNextRate = decimal.NewFromFloat(0.2264) )
View Source
var ( HbarCoinGeckoId = "hedera-hashgraph" HbarCoinMarketCapId = "4642" HbarPriceInUsd = decimal.NewFromFloat(0.2) HbarNativeTokenPriceInUsdFloat64, _ = HbarPriceInUsd.Float64() HbarMinAmountWithFee = big.NewInt(5000000000) HbarMinAmountWithFeeInEVM, _ = big.NewInt(0).SetString("50000000000000000000", 10) EthereumCoinGeckoId = "ethereum" EthereumCoinMarketCapId = "1027" EthereumNativeTokenPriceInUsd = decimal.NewFromFloat(8000.0) EthereumNativeTokenPriceInUsdFloat64, _ = EthereumNativeTokenPriceInUsd.Float64() EthereumNativeTokenMinAmountWithFee = big.NewInt(1250000000000000) PolygonNativeTokenMinAmountWithFee = big.NewInt(1250000000000000) UsdPrices = map[uint64]map[string]decimal.Decimal{ constants.HederaNetworkId: { constants.Hbar: HbarPriceInUsd, }, EthereumNetworkId: { NetworkEthereumFungibleNativeToken: EthereumNativeTokenPriceInUsd, }, } CoinGeckoIds = map[uint64]map[string]string{ constants.HederaNetworkId: { constants.Hbar: HbarCoinGeckoId, }, EthereumNetworkId: { NetworkEthereumFungibleNativeToken: EthereumCoinGeckoId, }, } CoinMarketCapIds = map[uint64]map[string]string{ constants.HederaNetworkId: { constants.Hbar: HbarCoinMarketCapId, }, EthereumNetworkId: { NetworkEthereumFungibleNativeToken: EthereumCoinMarketCapId, }, } TokenPriceInfos = map[uint64]map[string]pricing.TokenPriceInfo{ constants.HederaNetworkId: { constants.Hbar: pricing.TokenPriceInfo{ UsdPrice: HbarPriceInUsd, MinAmountWithFee: HbarMinAmountWithFee, }, }, EthereumNetworkId: { NetworkEthereumFungibleNativeToken: pricing.TokenPriceInfo{ UsdPrice: EthereumNativeTokenPriceInUsd, MinAmountWithFee: EthereumNativeTokenMinAmountWithFee, }, NetworkEthereumFungibleWrappedTokenForNetworkHedera: pricing.TokenPriceInfo{ UsdPrice: HbarPriceInUsd, MinAmountWithFee: HbarMinAmountWithFeeInEVM, }, }, PolygonNetworkId: { NetworkPolygonFungibleNativeToken: pricing.TokenPriceInfo{ MinAmountWithFee: PolygonNativeTokenMinAmountWithFee, }, NetworkPolygonFungibleWrappedTokenForNetworkHedera: pricing.TokenPriceInfo{ UsdPrice: HbarPriceInUsd, MinAmountWithFee: HbarMinAmountWithFeeInEVM, }, NetworkPolygonFungibleWrappedTokenForNetworkEthereum: pricing.TokenPriceInfo{ UsdPrice: EthereumNativeTokenPriceInUsd, MinAmountWithFee: EthereumNativeTokenMinAmountWithFee, }, }, } MinAmountsForApi = map[uint64]map[string]string{ constants.HederaNetworkId: { constants.Hbar: HbarMinAmountWithFee.String(), }, EthereumNetworkId: { NetworkEthereumFungibleNativeToken: EthereumNativeTokenMinAmountWithFee.String(), NetworkEthereumFungibleWrappedTokenForNetworkHedera: HbarMinAmountWithFeeInEVM.String(), }, PolygonNetworkId: { NetworkPolygonFungibleNativeToken: PolygonNativeTokenMinAmountWithFee.String(), NetworkPolygonFungibleWrappedTokenForNetworkEthereum: EthereumNativeTokenMinAmountWithFee.String(), NetworkPolygonFungibleWrappedTokenForNetworkHedera: HbarMinAmountWithFeeInEVM.String(), }, } )
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.