From b759e357f7a43c6bf94b2f93970bb0978801088d Mon Sep 17 00:00:00 2001 From: codingsh Date: Tue, 8 Mar 2022 23:11:24 +0000 Subject: [PATCH 01/24] feat(network): add moonbeam network --- docs/evm-integration.md | 1 + packages/mask/shared/flags.ts | 1 + .../mask/src/components/shared/ApplicationBoard.tsx | 1 + packages/mask/src/plugins/EVM/constants.ts | 10 ++++++++++ packages/mask/src/plugins/ITO/base.ts | 1 + packages/mask/src/plugins/NextID/base.ts | 1 + packages/mask/src/plugins/RedPacket/base.ts | 1 + packages/mask/src/plugins/Trader/apis/trader/index.ts | 2 ++ packages/mask/src/plugins/Trader/base.ts | 1 + packages/mask/src/plugins/Trader/constants/0x.ts | 1 + packages/mask/src/plugins/Trader/constants/dodo.ts | 1 + .../mask/src/plugins/Trader/constants/openocean.ts | 1 + .../mask/src/plugins/Trader/constants/sushiswap.ts | 1 + packages/mask/src/plugins/Trader/constants/trader.ts | 1 + packages/mask/src/plugins/Trader/pipes.ts | 2 ++ packages/mask/src/plugins/Trader/trader/0x/useTrade.ts | 1 + packages/mask/src/plugins/Wallet/services/account.ts | 1 + packages/public-api/src/web.ts | 1 + packages/web3-constants/compile-constants.ts | 1 + packages/web3-shared/evm/pipes/index.ts | 3 +++ packages/web3-shared/evm/types/index.ts | 4 ++++ packages/web3-shared/evm/utils/chainDetailed.ts | 1 + 22 files changed, 38 insertions(+) diff --git a/docs/evm-integration.md b/docs/evm-integration.md index 7cfddfc9ecf8..ebfa0bc488d2 100644 --- a/docs/evm-integration.md +++ b/docs/evm-integration.md @@ -100,3 +100,4 @@ Goto `chrome-extension://jkoeaghipilijlahjplgbfiocjhldnap/dashboard.html#/wallet | xDai | | | Arbitrum | | | Avalanche | | +| Moonbeam | <#> | diff --git a/packages/mask/shared/flags.ts b/packages/mask/shared/flags.ts index 3a02f63f634e..1bd355a23828 100644 --- a/packages/mask/shared/flags.ts +++ b/packages/mask/shared/flags.ts @@ -57,6 +57,7 @@ export const Flags = { flow_enabled: true, celo_enabled: true, aurora_enabled: true, + moonbeam_enabled: true, nft_airdrop_enabled: false, post_actions_enabled: false, next_id_tip_enabled: false, diff --git a/packages/mask/src/components/shared/ApplicationBoard.tsx b/packages/mask/src/components/shared/ApplicationBoard.tsx index d30e2849a02f..de8ebbf4cd54 100644 --- a/packages/mask/src/components/shared/ApplicationBoard.tsx +++ b/packages/mask/src/components/shared/ApplicationBoard.tsx @@ -111,6 +111,7 @@ const SUPPORTED_CHAIN_ID_LIST = [ ChainId.Fantom, ChainId.Aurora, ChainId.Avalanche, + ChainId.Moonbeam, ] export interface MaskAppEntry { diff --git a/packages/mask/src/plugins/EVM/constants.ts b/packages/mask/src/plugins/EVM/constants.ts index c49be1afb4b8..f1008af954a3 100644 --- a/packages/mask/src/plugins/EVM/constants.ts +++ b/packages/mask/src/plugins/EVM/constants.ts @@ -167,6 +167,16 @@ export const PLUGIN_NETWORKS: Web3Plugin.NetworkDescriptor[] = [ iconColor: 'rgb(112, 212, 74)', isMainnet: true, }, + { + ID: `${PLUGIN_ID}_moonbeam`, + networkSupporterPluginID: PLUGIN_ID, + chainId: ChainId.Moonbeam, + type: NetworkType.Moonbeam, + name: 'Moonbeam', + icon: new URL('./assets/moonbeam.png', import.meta.url), + iconColor: 'rgb(127, 39, 88)', + isMainnet: true, + }, ] export const PLUGIN_PROVIDERS: Web3Plugin.ProviderDescriptor[] = [ { diff --git a/packages/mask/src/plugins/ITO/base.ts b/packages/mask/src/plugins/ITO/base.ts index eceee4b13b46..87f34e6b9274 100644 --- a/packages/mask/src/plugins/ITO/base.ts +++ b/packages/mask/src/plugins/ITO/base.ts @@ -25,6 +25,7 @@ export const base: Plugin.Shared.Definition = { ChainId.Aurora, ChainId.Avalanche, ChainId.Fantom, + ChainId.Moonbeam, ], }, }, diff --git a/packages/mask/src/plugins/NextID/base.ts b/packages/mask/src/plugins/NextID/base.ts index 459ddf09c267..30f13235ee08 100644 --- a/packages/mask/src/plugins/NextID/base.ts +++ b/packages/mask/src/plugins/NextID/base.ts @@ -28,6 +28,7 @@ export const base: Plugin.Shared.Definition = { ChainId.Aurora, ChainId.Avalanche, ChainId.Fantom, + ChainId.Moonbeam, ], }, }, diff --git a/packages/mask/src/plugins/RedPacket/base.ts b/packages/mask/src/plugins/RedPacket/base.ts index 5be12ed3fc1b..a356e130aa31 100644 --- a/packages/mask/src/plugins/RedPacket/base.ts +++ b/packages/mask/src/plugins/RedPacket/base.ts @@ -26,6 +26,7 @@ export const base: Plugin.Shared.Definition = { ChainId.Fantom, ChainId.Avalanche, ChainId.Aurora, + ChainId.Moonbeam, ], }, }, diff --git a/packages/mask/src/plugins/Trader/apis/trader/index.ts b/packages/mask/src/plugins/Trader/apis/trader/index.ts index 3e562ea63401..63717924d61a 100644 --- a/packages/mask/src/plugins/Trader/apis/trader/index.ts +++ b/packages/mask/src/plugins/Trader/apis/trader/index.ts @@ -50,6 +50,8 @@ export async function getAvailableTraderProviders(chainId: ChainId) { return [TradeProvider.SUSHISWAP] case NetworkType.Aurora: return [TradeProvider.DODO, TradeProvider.WANNASWAP, TradeProvider.TRISOLARIS] + case NetworkType.Moonbeam: + return [TradeProvider.SUSHISWAP] case NetworkType.Boba: case NetworkType.Fuse: case NetworkType.Metis: diff --git a/packages/mask/src/plugins/Trader/base.ts b/packages/mask/src/plugins/Trader/base.ts index 2c575a7ae707..92beae4030b7 100644 --- a/packages/mask/src/plugins/Trader/base.ts +++ b/packages/mask/src/plugins/Trader/base.ts @@ -23,6 +23,7 @@ export const base: Plugin.Shared.Definition = { ChainId.Aurora, ChainId.Avalanche, ChainId.Fantom, + ChainId.Moonbeam, ], }, }, diff --git a/packages/mask/src/plugins/Trader/constants/0x.ts b/packages/mask/src/plugins/Trader/constants/0x.ts index 06be52d5c29f..98d0ab0d1a3c 100644 --- a/packages/mask/src/plugins/Trader/constants/0x.ts +++ b/packages/mask/src/plugins/Trader/constants/0x.ts @@ -14,6 +14,7 @@ export const ZRX_BASE_URL: Record = { [NetworkType.Fuse]: '', [NetworkType.Metis]: '', [NetworkType.Optimistic]: '', + [NetworkType.Moonbeam]: '', } export const ZRX_AFFILIATE_ADDRESS = '0x934B510D4C9103E6a87AEf13b816fb080286D649' diff --git a/packages/mask/src/plugins/Trader/constants/dodo.ts b/packages/mask/src/plugins/Trader/constants/dodo.ts index 7996fe13525e..bcdd7e80ce17 100644 --- a/packages/mask/src/plugins/Trader/constants/dodo.ts +++ b/packages/mask/src/plugins/Trader/constants/dodo.ts @@ -16,4 +16,5 @@ export const networkNames: Record = { [NetworkType.Fuse]: '', [NetworkType.Metis]: '', [NetworkType.Optimistic]: '', + [NetworkType.Moonbeam]: '', } diff --git a/packages/mask/src/plugins/Trader/constants/openocean.ts b/packages/mask/src/plugins/Trader/constants/openocean.ts index 862e158999b1..5f450246977b 100644 --- a/packages/mask/src/plugins/Trader/constants/openocean.ts +++ b/packages/mask/src/plugins/Trader/constants/openocean.ts @@ -16,4 +16,5 @@ export const networkNames: Record = { [NetworkType.Fuse]: '', [NetworkType.Metis]: '', [NetworkType.Optimistic]: '', + [NetworkType.Moonbeam]: '', } diff --git a/packages/mask/src/plugins/Trader/constants/sushiswap.ts b/packages/mask/src/plugins/Trader/constants/sushiswap.ts index 1c77a8e30c71..67cb9659d40c 100644 --- a/packages/mask/src/plugins/Trader/constants/sushiswap.ts +++ b/packages/mask/src/plugins/Trader/constants/sushiswap.ts @@ -36,4 +36,5 @@ export const SUSHISWAP_BASE_AGAINST_TOKENS: ERC20AgainstToken = { [ChainId.Celo]: [WNATIVE, CUSD, CEUR].map((x) => x[ChainId.Celo]), [ChainId.Fantom]: [WNATIVE, DAI, USDC, fUSDT, WBTC].map((x) => x[ChainId.Fantom]), [ChainId.Avalanche]: [WNATIVE, DAI, USDC, WBTC, USDT].map((x) => x[ChainId.Avalanche]), + [ChainId.Moonbeam]: [WNATIVE, DAI, USDC, WBTC, USDT].map((x) => x[ChainId.Moonbeam]), } diff --git a/packages/mask/src/plugins/Trader/constants/trader.ts b/packages/mask/src/plugins/Trader/constants/trader.ts index 6f8cdc2d5594..030f9ed68688 100644 --- a/packages/mask/src/plugins/Trader/constants/trader.ts +++ b/packages/mask/src/plugins/Trader/constants/trader.ts @@ -77,6 +77,7 @@ export const WNATIVE_ONLY: ERC20AgainstToken = { [ChainId.Fantom]: [WNATIVE[ChainId.Fantom]], [ChainId.Aurora]: [WNATIVE[ChainId.Aurora]], [ChainId.Aurora_Testnet]: [WNATIVE[ChainId.Aurora_Testnet]], + [ChainId.Moonbeam]: [WNATIVE[ChainId.Moonbeam]], } export const BIPS_BASE = new BigNumber(10000) diff --git a/packages/mask/src/plugins/Trader/pipes.ts b/packages/mask/src/plugins/Trader/pipes.ts index ea9434a4858a..f3189af133d6 100644 --- a/packages/mask/src/plugins/Trader/pipes.ts +++ b/packages/mask/src/plugins/Trader/pipes.ts @@ -98,6 +98,7 @@ export function resolveTradeProviderLink(tradeProvider: TradeProvider, networkTy case NetworkType.Metis: case NetworkType.Avalanche: case NetworkType.Optimistic: + case NetworkType.Moonbeam: console.error('To be implement network: ', networkType) return '' default: @@ -176,6 +177,7 @@ export function resolveTradePairLink(tradeProvider: TradeProvider, address: stri case NetworkType.Fuse: case NetworkType.Metis: case NetworkType.Optimistic: + case NetworkType.Moonbeam: console.error('To be implement network: ', networkType) return '' default: diff --git a/packages/mask/src/plugins/Trader/trader/0x/useTrade.ts b/packages/mask/src/plugins/Trader/trader/0x/useTrade.ts index 8476309e06ed..5faf561b6742 100644 --- a/packages/mask/src/plugins/Trader/trader/0x/useTrade.ts +++ b/packages/mask/src/plugins/Trader/trader/0x/useTrade.ts @@ -36,6 +36,7 @@ export function getNativeTokenLabel(networkType: NetworkType) { case NetworkType.Metis: case NetworkType.Avalanche: case NetworkType.Optimistic: + case NetworkType.Moonbeam: return NATIVE_TOKEN_ADDRESS default: safeUnreachable(networkType) diff --git a/packages/mask/src/plugins/Wallet/services/account.ts b/packages/mask/src/plugins/Wallet/services/account.ts index 2b3759fc6beb..3b41240c2d0d 100644 --- a/packages/mask/src/plugins/Wallet/services/account.ts +++ b/packages/mask/src/plugins/Wallet/services/account.ts @@ -128,5 +128,6 @@ export async function getSupportedNetworks() { Flags.fantom_enabled ? NetworkType.Fantom : undefined, Flags.avalanche_enabled ? NetworkType.Avalanche : undefined, Flags.aurora_enabled ? NetworkType.Aurora : undefined, + Flags.moonbeam_enabled ? NetworkType.Moonbeam : undefined, ].filter(Boolean) as NetworkType[] } diff --git a/packages/public-api/src/web.ts b/packages/public-api/src/web.ts index fb4d55ad81ed..a72a4276123b 100644 --- a/packages/public-api/src/web.ts +++ b/packages/public-api/src/web.ts @@ -192,6 +192,7 @@ export enum NetworkType { Fuse = 'Fuse', Metis = 'Metis', Optimistic = 'Optimistic', + Moonbeam = 'Moonbeam', } export enum DataProvider { diff --git a/packages/web3-constants/compile-constants.ts b/packages/web3-constants/compile-constants.ts index cafdb8aa29af..525742267816 100644 --- a/packages/web3-constants/compile-constants.ts +++ b/packages/web3-constants/compile-constants.ts @@ -59,6 +59,7 @@ compileConstants(path.join(__dirname, 'evm'), [ 'Fantom', 'Aurora', 'Aurora_Testnet', + 'Moonbeam', ]) compileConstants(path.join(__dirname, 'solana'), ['Mainnet', 'Testnet', 'Devnet']) diff --git a/packages/web3-shared/evm/pipes/index.ts b/packages/web3-shared/evm/pipes/index.ts index 34a54a1a422b..51cdf6e1b774 100644 --- a/packages/web3-shared/evm/pipes/index.ts +++ b/packages/web3-shared/evm/pipes/index.ts @@ -96,6 +96,7 @@ export const resolveNetworkAddressPrefix = createLookupTableResolver [NetworkType.Celo]: 'Celo', [NetworkType.Fantom]: 'Fantom', [NetworkType.Aurora]: 'Aurora', + [NetworkType.Moonbeam]: 'Moonbeam', }, 'Unknown', ) @@ -145,6 +147,7 @@ export const resolveChainColor = createLookupTableResolver( [ChainId.Fantom]: 'rgb(19, 181, 236)', [ChainId.Aurora]: 'rgb(112, 212, 74)', [ChainId.Aurora_Testnet]: 'rgb(112, 212, 74)', + [ChainId.Moonbeam]: 'rgb(127, 39, 88)', }, 'rgb(214, 217, 220)', ) diff --git a/packages/web3-shared/evm/types/index.ts b/packages/web3-shared/evm/types/index.ts index 7840867421cc..44d99a88227f 100644 --- a/packages/web3-shared/evm/types/index.ts +++ b/packages/web3-shared/evm/types/index.ts @@ -78,6 +78,9 @@ export enum ChainId { // Optimistic Optimistic = 10, + + // Moonbeam + Moonbeam = 1284, } export enum ProviderType { @@ -113,6 +116,7 @@ export enum NetworkType { Fuse = 'Fuse', Metis = 'Metis', Optimistic = 'Optimistic', + Moonbeam = 'Moonbeam', } export interface Wallet { diff --git a/packages/web3-shared/evm/utils/chainDetailed.ts b/packages/web3-shared/evm/utils/chainDetailed.ts index 1cceb01fa697..20f8b6682981 100644 --- a/packages/web3-shared/evm/utils/chainDetailed.ts +++ b/packages/web3-shared/evm/utils/chainDetailed.ts @@ -114,6 +114,7 @@ const chainNameMap: Record = { [NetworkType.Fuse]: 'Fuse', [NetworkType.Metis]: 'Metis', [NetworkType.Optimistic]: 'Optimistic', + [NetworkType.Moonbeam]: 'Moonbeam', } export function getNetworkTypeFromChainId(chainId: ChainId, value?: boolean) { const chainDetailed = getChainDetailed(chainId) From 375be3ce50ad6ce1d847e6202194b0a7fa32c6f6 Mon Sep 17 00:00:00 2001 From: codingsh Date: Wed, 9 Mar 2022 11:07:01 +0000 Subject: [PATCH 02/24] feat(moonbeam): add BeamSwap and StellaSwap #5826 #5827 --- cspell.json | 3 + .../src/plugins/Trader/apis/trader/index.ts | 2 +- .../src/plugins/Trader/constants/beamswap.ts | 14 + .../src/plugins/Trader/constants/index.ts | 2 + .../plugins/Trader/constants/stellaswap.ts | 14 + .../src/plugins/Trader/constants/trader.ts | 2 + packages/mask/src/plugins/Trader/pipes.ts | 14 + packages/mask/src/plugins/Trader/settings.ts | 6 + .../Trader/trader/useAllTradeComputed.ts | 26 ++ .../Trader/trader/useGetTradeContext.ts | 28 ++ .../plugins/Trader/trader/useTradeCallback.ts | 4 + .../plugins/Trader/trader/useTradeContext.ts | 28 ++ .../mask/src/plugins/Trader/types/trader.ts | 2 + packages/public-api/src/web.ts | 2 + packages/web3-constants/evm/explorer.json | 6 +- packages/web3-constants/evm/rpc.json | 6 +- packages/web3-constants/evm/token.json | 183 +++++++--- packages/web3-constants/evm/trader.json | 321 +++++++++++++++--- 18 files changed, 560 insertions(+), 103 deletions(-) create mode 100644 packages/mask/src/plugins/Trader/constants/beamswap.ts create mode 100644 packages/mask/src/plugins/Trader/constants/stellaswap.ts diff --git a/cspell.json b/cspell.json index aa4c82a87783..6e1beb20b1af 100644 --- a/cspell.json +++ b/cspell.json @@ -28,6 +28,8 @@ "arweave", "avalanche", "avax", + "beamshare", + "beamswap", "betanet", "bgcolor", "bignumber", @@ -217,6 +219,7 @@ "steganographic", "steganography", "stego", + "stellaswap", "subrepo", "superrare", "sushiswap", diff --git a/packages/mask/src/plugins/Trader/apis/trader/index.ts b/packages/mask/src/plugins/Trader/apis/trader/index.ts index 63717924d61a..e43f2e30843d 100644 --- a/packages/mask/src/plugins/Trader/apis/trader/index.ts +++ b/packages/mask/src/plugins/Trader/apis/trader/index.ts @@ -51,7 +51,7 @@ export async function getAvailableTraderProviders(chainId: ChainId) { case NetworkType.Aurora: return [TradeProvider.DODO, TradeProvider.WANNASWAP, TradeProvider.TRISOLARIS] case NetworkType.Moonbeam: - return [TradeProvider.SUSHISWAP] + return [TradeProvider.SUSHISWAP, TradeProvider.BEAMSWAP, TradeProvider.STELLASWAP] case NetworkType.Boba: case NetworkType.Fuse: case NetworkType.Metis: diff --git a/packages/mask/src/plugins/Trader/constants/beamswap.ts b/packages/mask/src/plugins/Trader/constants/beamswap.ts new file mode 100644 index 000000000000..ddc97c3e00f5 --- /dev/null +++ b/packages/mask/src/plugins/Trader/constants/beamswap.ts @@ -0,0 +1,14 @@ +import { ChainId } from '@masknet/web3-shared-evm' +import { DAI, USDC, USDT, WBTC, SHARE, WNATIVE, WNATIVE_ONLY } from './trader' +import type { ERC20AgainstToken, ERC20TokenCustomizedBase } from './types' + +/** + * Some tokens can only be swapped via certain pairs, + * so we override the list of bases that are considered for these tokens. + */ +export const BEAMSWAP_CUSTOM_BASES: ERC20TokenCustomizedBase = {} + +export const BEAMSWAP_BASE_AGAINST_TOKENS: ERC20AgainstToken = { + ...WNATIVE_ONLY, + [ChainId.Moonbeam]: [WNATIVE, DAI, SHARE, USDT, USDC, WBTC].map((x) => x[ChainId.Moonbeam]), +} diff --git a/packages/mask/src/plugins/Trader/constants/index.ts b/packages/mask/src/plugins/Trader/constants/index.ts index 7cde5749d988..ae62a1724902 100644 --- a/packages/mask/src/plugins/Trader/constants/index.ts +++ b/packages/mask/src/plugins/Trader/constants/index.ts @@ -13,4 +13,6 @@ export * from './traderjoe' export * from './pangolindex' export * from './wannaswap' export * from './trisolaris' +export * from './beamswap' +export * from './stellaswap' export type { ERC20TokenCustomizedBase, ERC20AgainstToken } from './types' diff --git a/packages/mask/src/plugins/Trader/constants/stellaswap.ts b/packages/mask/src/plugins/Trader/constants/stellaswap.ts new file mode 100644 index 000000000000..7f07a0c3b1b5 --- /dev/null +++ b/packages/mask/src/plugins/Trader/constants/stellaswap.ts @@ -0,0 +1,14 @@ +import { ChainId } from '@masknet/web3-shared-evm' +import { DAI, USDC, STELLA, USDT, WBTC, WNATIVE, WNATIVE_ONLY } from './trader' +import type { ERC20AgainstToken, ERC20TokenCustomizedBase } from './types' + +/** + * Some tokens can only be swapped via certain pairs, + * so we override the list of bases that are considered for these tokens. + */ +export const STELLASWAP_CUSTOM_BASES: ERC20TokenCustomizedBase = {} + +export const STELLASWAP_BASE_AGAINST_TOKENS: ERC20AgainstToken = { + ...WNATIVE_ONLY, + [ChainId.Moonbeam]: [WNATIVE, STELLA, DAI, USDT, USDC, WBTC].map((x) => x[ChainId.Moonbeam]), +} diff --git a/packages/mask/src/plugins/Trader/constants/trader.ts b/packages/mask/src/plugins/Trader/constants/trader.ts index 030f9ed68688..4d6b99f2a2e7 100644 --- a/packages/mask/src/plugins/Trader/constants/trader.ts +++ b/packages/mask/src/plugins/Trader/constants/trader.ts @@ -50,6 +50,8 @@ export const CUSD = createERC20Tokens('cUSD_ADDRESS', 'Celo Dollar', 'cUSD', 18) export const CEUR = createERC20Tokens('cEUR_ADDRESS', 'Celo Euro', 'cEUR', 18) export const JOE = createERC20Tokens('JOE_ADDRESS', 'JoeToken', 'JOE', 18) export const PNG = createERC20Tokens('PNG_ADDRESS', 'Pangolin', 'PNG', 18) +export const SHARE = createERC20Tokens('SHARE_ADDRESS', 'Beamshare Token', 'SHARE', 18) +export const STELLA = createERC20Tokens('STELLA_ADDRESS', 'StellaSwap', 'STELLA', 18) export const WNATIVE = createERC20Tokens( 'WNATIVE_ADDRESS', diff --git a/packages/mask/src/plugins/Trader/pipes.ts b/packages/mask/src/plugins/Trader/pipes.ts index f3189af133d6..437c32262952 100644 --- a/packages/mask/src/plugins/Trader/pipes.ts +++ b/packages/mask/src/plugins/Trader/pipes.ts @@ -61,6 +61,8 @@ export const resolveTradeProviderName = createLookupTableResolver { throw new Error(`Unknown provider type: ${tradeProvider}`) @@ -129,6 +131,10 @@ export function resolveTradeProviderLink(tradeProvider: TradeProvider, networkTy return 'https://www.trisolaris.io/#/swap' case TradeProvider.WANNASWAP: return 'https://wannaswap.finance/exchange/swap' + case TradeProvider.BEAMSWAP: + return 'https://app.beamswap.io/' + case TradeProvider.STELLASWAP: + return 'https://app.stellaswap.com/' default: unreachable(tradeProvider) } @@ -208,6 +214,12 @@ export function resolveTradePairLink(tradeProvider: TradeProvider, address: stri case TradeProvider.WANNASWAP: // TODO - add WannaSwap analytics return '' + case TradeProvider.STELLASWAP: + // TODO - add WannaSwap analytics + return '' + case TradeProvider.BEAMSWAP: + // TODO - add WannaSwap analytics + return '' default: unreachable(tradeProvider) } @@ -301,6 +313,8 @@ export const resolveZrxTradePoolName = createLookupTableResolver(`${PLUGIN_ID}+tradeProvi const openoceanSettings = createInternalSettings(`${PLUGIN_ID}+tradeProvider+openocean`, '') const trisolarisSettings = createInternalSettings(`${PLUGIN_ID}+tradeProvider+trisolaris`, '') const wannaswapSettings = createInternalSettings(`${PLUGIN_ID}+tradeProvider+wannaswap`, '') +const beamswapSettings = createInternalSettings(`${PLUGIN_ID}+tradeProvider+beamswap`, '') +const stellaswapSettings = createInternalSettings(`${PLUGIN_ID}+tradeProvider+stellaswap`, '') /** * The general settings of specific tarde provider @@ -91,6 +93,10 @@ export function getCurrentTradeProviderGeneralSettings(tradeProvider: TradeProvi return trisolarisSettings case TradeProvider.WANNASWAP: return wannaswapSettings + case TradeProvider.BEAMSWAP: + return beamswapSettings + case TradeProvider.STELLASWAP: + return stellaswapSettings default: unreachable(tradeProvider) } diff --git a/packages/mask/src/plugins/Trader/trader/useAllTradeComputed.ts b/packages/mask/src/plugins/Trader/trader/useAllTradeComputed.ts index 085da9903ab5..220b5004adbf 100644 --- a/packages/mask/src/plugins/Trader/trader/useAllTradeComputed.ts +++ b/packages/mask/src/plugins/Trader/trader/useAllTradeComputed.ts @@ -247,6 +247,30 @@ export function useAllTradeComputed( const wannaswap = useUniswapTradeComputed(wannaswap_.value, inputToken, outputToken) const wannaSwapEstimateGas = useUniswapTradeGasLimit(wannaswap, TradeProvider.WANNASWAP) + // StellaSwap + const stellaswap_ = useUniswapV2Trade( + TradeProvider.STELLASWAP, + TradeStrategy.ExactIn, + inputAmount_, + '0', + tradeProviders.some((x) => x === TradeProvider.STELLASWAP) ? inputToken : undefined, + tradeProviders.some((x) => x === TradeProvider.STELLASWAP) ? outputToken : undefined, + ) + const stellaswap = useUniswapTradeComputed(stellaswap_.value, inputToken, outputToken) + const stellaswapEstimateGas = useUniswapTradeGasLimit(stellaswap, TradeProvider.STELLASWAP) + + // BeamSwap + const beamswap_ = useUniswapV2Trade( + TradeProvider.BEAMSWAP, + TradeStrategy.ExactIn, + inputAmount_, + '0', + tradeProviders.some((x) => x === TradeProvider.BEAMSWAP) ? inputToken : undefined, + tradeProviders.some((x) => x === TradeProvider.BEAMSWAP) ? outputToken : undefined, + ) + const beamswap = useUniswapTradeComputed(beamswap_.value, inputToken, outputToken) + const beamswapEstimateGas = useUniswapTradeGasLimit(beamswap, TradeProvider.BEAMSWAP) + const allTradeResult = [ { provider: TradeProvider.UNISWAP_V2, ...uniswapV2_, value: uniswapV2, gas: uniswapV2EstimateGas }, { provider: TradeProvider.SUSHISWAP, ...sushiSwap_, value: sushiSwap, gas: sushiSwapEstimateGas }, @@ -263,6 +287,8 @@ export function useAllTradeComputed( { provider: TradeProvider.OPENOCEAN, ...openocean_, value: openocean, gas: openoceanSwapEstimateGas }, { provider: TradeProvider.WANNASWAP, ...wannaswap_, value: wannaswap, gas: wannaSwapEstimateGas }, { provider: TradeProvider.TRISOLARIS, ...trisolaris_, value: trisolaris, gas: trisolarisEstimateGas }, + { provider: TradeProvider.STELLASWAP, ...stellaswap_, value: stellaswap, gas: stellaswapEstimateGas }, + { provider: TradeProvider.BEAMSWAP, ...beamswap_, value: beamswap, gas: beamswapEstimateGas }, ] return nativeToken_.value diff --git a/packages/mask/src/plugins/Trader/trader/useGetTradeContext.ts b/packages/mask/src/plugins/Trader/trader/useGetTradeContext.ts index 77533cc926e2..2d35e0de1dca 100644 --- a/packages/mask/src/plugins/Trader/trader/useGetTradeContext.ts +++ b/packages/mask/src/plugins/Trader/trader/useGetTradeContext.ts @@ -21,6 +21,10 @@ import { WANNASWAP_CUSTOM_BASES, TRISOLARIS_BASE_AGAINST_TOKENS, TRISOLARIS_CUSTOM_BASES, + BEAMSWAP_BASE_AGAINST_TOKENS, + BEAMSWAP_CUSTOM_BASES, + STELLASWAP_BASE_AGAINST_TOKENS, + STELLASWAP_CUSTOM_BASES, } from '../constants' import { unreachable } from '@dimensiondev/kit' import { TargetChainIdContext } from './useTargetChainIdContext' @@ -150,6 +154,30 @@ export function useGetTradeContext(tradeProvider?: TradeProvider) { ADDITIONAL_TOKENS: {}, CUSTOM_TOKENS: TRISOLARIS_CUSTOM_BASES, } + case TradeProvider.BEAMSWAP: + return { + TYPE: tradeProvider, + IS_UNISWAP_V2_LIKE: true, + GRAPH_API: DEX_TRADE.TRISOLARIS_THEGRAPH, + INIT_CODE_HASH: DEX_TRADE.TRISOLARIS_INIT_CODE_HASH, + ROUTER_CONTRACT_ADDRESS: DEX_TRADE.TRISOLARIS_ROUTER_ADDRESS, + FACTORY_CONTRACT_ADDRESS: DEX_TRADE.TRISOLARIS_FACTORY_ADDRESS, + AGAINST_TOKENS: BEAMSWAP_BASE_AGAINST_TOKENS, + ADDITIONAL_TOKENS: {}, + CUSTOM_TOKENS: BEAMSWAP_CUSTOM_BASES, + } + case TradeProvider.STELLASWAP: + return { + TYPE: tradeProvider, + IS_UNISWAP_V2_LIKE: true, + GRAPH_API: DEX_TRADE.TRISOLARIS_THEGRAPH, + INIT_CODE_HASH: DEX_TRADE.TRISOLARIS_INIT_CODE_HASH, + ROUTER_CONTRACT_ADDRESS: DEX_TRADE.TRISOLARIS_ROUTER_ADDRESS, + FACTORY_CONTRACT_ADDRESS: DEX_TRADE.TRISOLARIS_FACTORY_ADDRESS, + AGAINST_TOKENS: STELLASWAP_BASE_AGAINST_TOKENS, + ADDITIONAL_TOKENS: {}, + CUSTOM_TOKENS: STELLASWAP_CUSTOM_BASES, + } case TradeProvider.ZRX: return { TYPE: tradeProvider, diff --git a/packages/mask/src/plugins/Trader/trader/useTradeCallback.ts b/packages/mask/src/plugins/Trader/trader/useTradeCallback.ts index c678a4013af9..f4385669380c 100644 --- a/packages/mask/src/plugins/Trader/trader/useTradeCallback.ts +++ b/packages/mask/src/plugins/Trader/trader/useTradeCallback.ts @@ -114,6 +114,10 @@ export function useTradeCallback( return uniswapV2Like case TradeProvider.OPENOCEAN: return openocean + case TradeProvider.BEAMSWAP: + return uniswapV2Like + case TradeProvider.STELLASWAP: + return uniswapV2Like default: if (provider) unreachable(provider) return [] diff --git a/packages/mask/src/plugins/Trader/trader/useTradeContext.ts b/packages/mask/src/plugins/Trader/trader/useTradeContext.ts index 3db649333430..ffaca7ae0b1c 100644 --- a/packages/mask/src/plugins/Trader/trader/useTradeContext.ts +++ b/packages/mask/src/plugins/Trader/trader/useTradeContext.ts @@ -21,6 +21,10 @@ import { WANNASWAP_CUSTOM_BASES, TRISOLARIS_CUSTOM_BASES, TRISOLARIS_BASE_AGAINST_TOKENS, + BEAMSWAP_CUSTOM_BASES, + BEAMSWAP_BASE_AGAINST_TOKENS, + STELLASWAP_BASE_AGAINST_TOKENS, + STELLASWAP_CUSTOM_BASES, } from '../constants' import type { TradeContext as TradeContext_ } from '../types' import { TargetChainIdContext } from './useTargetChainIdContext' @@ -128,6 +132,30 @@ export function useTradeContext(tradeProvider: TradeProvider) { ADDITIONAL_TOKENS: {}, CUSTOM_TOKENS: TRISOLARIS_CUSTOM_BASES, } + case TradeProvider.BEAMSWAP: + return { + TYPE: tradeProvider, + IS_UNISWAP_V2_LIKE: true, + GRAPH_API: DEX_TRADE.TRISOLARIS_THEGRAPH, + INIT_CODE_HASH: DEX_TRADE.TRISOLARIS_INIT_CODE_HASH, + ROUTER_CONTRACT_ADDRESS: DEX_TRADE.TRISOLARIS_ROUTER_ADDRESS, + FACTORY_CONTRACT_ADDRESS: DEX_TRADE.TRISOLARIS_FACTORY_ADDRESS, + AGAINST_TOKENS: BEAMSWAP_BASE_AGAINST_TOKENS, + ADDITIONAL_TOKENS: {}, + CUSTOM_TOKENS: BEAMSWAP_CUSTOM_BASES, + } + case TradeProvider.STELLASWAP: + return { + TYPE: tradeProvider, + IS_UNISWAP_V2_LIKE: true, + GRAPH_API: DEX_TRADE.TRISOLARIS_THEGRAPH, + INIT_CODE_HASH: DEX_TRADE.TRISOLARIS_INIT_CODE_HASH, + ROUTER_CONTRACT_ADDRESS: DEX_TRADE.TRISOLARIS_ROUTER_ADDRESS, + FACTORY_CONTRACT_ADDRESS: DEX_TRADE.TRISOLARIS_FACTORY_ADDRESS, + AGAINST_TOKENS: STELLASWAP_BASE_AGAINST_TOKENS, + ADDITIONAL_TOKENS: {}, + CUSTOM_TOKENS: STELLASWAP_CUSTOM_BASES, + } case TradeProvider.ZRX: return { TYPE: tradeProvider, diff --git a/packages/mask/src/plugins/Trader/types/trader.ts b/packages/mask/src/plugins/Trader/types/trader.ts index fb0d655737ee..75ee31306bfe 100644 --- a/packages/mask/src/plugins/Trader/types/trader.ts +++ b/packages/mask/src/plugins/Trader/types/trader.ts @@ -75,6 +75,8 @@ export enum ZrxTradePool { PangolinDex = 'PangolinDex', Trisolaris = 'Trisolaris', WannaSwap = 'WannaSwap', + StellaSwap = 'StellaSwap', + BeamSwap = 'BeamSwap', } export interface TradeComputed { diff --git a/packages/public-api/src/web.ts b/packages/public-api/src/web.ts index a72a4276123b..457746203daf 100644 --- a/packages/public-api/src/web.ts +++ b/packages/public-api/src/web.ts @@ -217,6 +217,8 @@ export enum TradeProvider { TRISOLARIS = 12, TRADERJOE = 13, PANGOLIN = 14, + BEAMSWAP = 15, + STELLASWAP = 16, } /** Supported language settings */ export enum LanguageOptions { diff --git a/packages/web3-constants/evm/explorer.json b/packages/web3-constants/evm/explorer.json index a3c5bf0d117e..1f9887e08a81 100644 --- a/packages/web3-constants/evm/explorer.json +++ b/packages/web3-constants/evm/explorer.json @@ -17,7 +17,8 @@ "Celo": [], "Fantom": ["AST4WWPNEYDURUXG2GH32JZMYWEFDP999S"], "Aurora": [], - "Aurora_Testnet": [] + "Aurora_Testnet": [], + "Moonbeam": [] }, "EXPLORER_API": { "Mainnet": "https://api.etherscan.io/api", @@ -37,6 +38,7 @@ "Celo": "https://explorer.celo.org/api", "Fantom": "https://api.ftmscan.com/api", "Aurora": "https://explorer.mainnet.aurora.dev/api", - "Aurora_Testnet": "https://explorer.testnet.aurora.dev/api" + "Aurora_Testnet": "https://explorer.testnet.aurora.dev/api", + "Moonbeam": "https://api-moonbeam.moonscan.io/api?" } } diff --git a/packages/web3-constants/evm/rpc.json b/packages/web3-constants/evm/rpc.json index 54cfb9185c13..4f13f86051d8 100644 --- a/packages/web3-constants/evm/rpc.json +++ b/packages/web3-constants/evm/rpc.json @@ -59,7 +59,8 @@ "Celo": ["https://forno.celo.org"], "Fantom": ["https://rpc.ftm.tools/"], "Aurora": ["https://mainnet.aurora.dev"], - "Aurora_Testnet": ["https://testnet.aurora.dev"] + "Aurora_Testnet": ["https://testnet.aurora.dev"], + "Moonbeam": ["https://testnet.aurora.dev"] }, "RPC_WEIGHTS": { "Mainnet": [0, 1, 2, 3, 4], @@ -79,6 +80,7 @@ "Celo": [0, 0, 0, 0, 0], "Fantom": [0, 0, 0, 0, 0], "Aurora": [0, 0, 0, 0, 0], - "Aurora_Testnet": [0, 0, 0, 0, 0] + "Aurora_Testnet": [0, 0, 0, 0, 0], + "Moonbeam": [0, 0, 0, 0, 0] } } diff --git a/packages/web3-constants/evm/token.json b/packages/web3-constants/evm/token.json index f6fe2360d0d4..7cb1d06eb30f 100644 --- a/packages/web3-constants/evm/token.json +++ b/packages/web3-constants/evm/token.json @@ -17,7 +17,8 @@ "Celo": "0x471EcE3750Da237f93B8E339c536989b8978a438", "Fantom": "0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83", "Aurora": "0xC9BdeEd33CD01541e1eeD10f90519d2C06Fe3feB", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "0xacc15dc74880c9944775448304b263d191c6077f" }, "USDC_ADDRESS": { "Mainnet": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", @@ -37,7 +38,8 @@ "Celo": "0x2A3684e9Dc20B857375EA04235F2F7edBe818FA7", "Fantom": "0x04068da6c83afcfa0e13ba15a6696662335d5b75", "Aurora": "0xb12bfca5a55806aaf64e99521918a4bf0fc40802", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "USDT_ADDRESS": { "Mainnet": "0xdAC17F958D2ee523a2206206994597C13D831ec7", @@ -57,7 +59,8 @@ "Celo": "0xb020d981420744f6b0fedd22bb67cd37ce18a1d5", "Fantom": "", "Aurora": "0x4988a896b1227218e4a686fde5eabdcabd91571f", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "HUSD_ADDRESS": { "Mainnet": "0xdf574c24545e5ffecb9a659c229253d4111d87e1", @@ -77,7 +80,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "BUSD_ADDRESS": { "Mainnet": "0x4fabb145d64652a948d72533023f6e7a623c7c53", @@ -97,7 +101,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "COMP_ADDRESS": { "Mainnet": "0xc00e94Cb662C3520282E6f5717214004A7f26888", @@ -117,7 +122,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "EASY_ADDRESS": { "Mainnet": "", @@ -137,7 +143,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "MKR_ADDRESS": { "Mainnet": "0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2", @@ -157,7 +164,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "MASK_ADDRESS": { "Mainnet": "0x69af81e73A73B40adF4f3d4223Cd9b1ECE623074", @@ -177,7 +185,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "MSKA_ADDRESS": { "Mainnet": "", @@ -197,7 +206,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "MSKB_ADDRESS": { "Mainnet": "", @@ -217,7 +227,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "MSKC_ADDRESS": { "Mainnet": "", @@ -237,7 +248,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "MSKD_ADDRESS": { "Mainnet": "", @@ -257,7 +269,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "MSKE_ADDRESS": { "Mainnet": "", @@ -277,7 +290,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "DAI_ADDRESS": { "Mainnet": "0x6B175474E89094C44Da98b954EedeAC495271d0F", @@ -297,7 +311,8 @@ "Celo": "", "Fantom": "0x8D11eC38a3EB5E956B052f67Da8Bdc9bef8Abf3E", "Aurora": "0xe3520349f477a5f6eb06107066048508498a291b", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "AMPL_ADDRESS": { "Mainnet": "0xD46bA6D942050d489DBd938a2C909A5d5039A161", @@ -317,7 +332,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "OKB_ADDRESS": { "Mainnet": "0x75231F58b43240C9718Dd58B4967c5114342a86c", @@ -337,7 +353,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "UST_ADDRESS": { "Mainnet": "0xa47c8bf37f92aBed4A126BDA807A7b7498661acD", @@ -357,7 +374,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "eUSDC_ADDRESS": { "Mainnet": "", @@ -377,7 +395,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "eUSDT_ADDRESS": { "Mainnet": "", @@ -397,7 +416,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "fUSDT_ADDRESS": { "Mainnet": "", @@ -417,7 +437,8 @@ "Celo": "", "Fantom": "0x049d68029688eAbF473097a2fC38ef61633A3C7A", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "eDAI_ADDRESS": { "Mainnet": "", @@ -437,7 +458,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "UNITOKEN_ADDRESS": { "Mainnet": "", @@ -457,7 +479,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "TT01_ADDRESS": { "Mainnet": "", @@ -477,7 +500,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "TT02_ADDRESS": { "Mainnet": "", @@ -497,7 +521,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "QUICK_ADDRESS": { "Mainnet": "", @@ -517,7 +542,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "WANNA_ADDRESS": { "Mainnet": "", @@ -537,7 +563,8 @@ "Celo": "", "Fantom": "", "Aurora": "0x7faA64Faf54750a2E3eE621166635fEAF406Ab22", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "WBTC_ADDRESS": { "Mainnet": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", @@ -557,7 +584,8 @@ "Celo": "0xBe50a3013A1c94768A1ABb78c3cB79AB28fc1aCE", "Fantom": "0x321162Cd933E2Be498Cd2267a90534A804051b11", "Aurora": "0xf4eb217ba2454613b15dbdea6e5f22276410e89e", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "IGG_ADDRESS": { "Mainnet": "", @@ -577,7 +605,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "OM_ADDRESS": { "Mainnet": "", @@ -597,7 +626,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "SUSHI_ADDRESS": { "Mainnet": "0x6B3595068778DD592e39A122f4f5a5cF09C90fE2", @@ -617,7 +647,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "YAM_ADDRESS": { "Mainnet": "0x0e2298E3B3390e3b945a5456fBf59eCc3f55DA16", @@ -637,7 +668,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "RUNE_ADDRESS": { "Mainnet": "0x3155BA85D5F96b2d030a4966AF206230e46849cb", @@ -657,7 +689,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "YFI_ADDRESS": { "Mainnet": "0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e", @@ -677,7 +710,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "sUSD_ADDRESS": { "Mainnet": "0x57ab1ec28d129707052df4df418d58a2d46d5f51", @@ -697,7 +731,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "BTCB_ADDRESS": { "Mainnet": "", @@ -717,7 +752,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "CAKE_ADDRESS": { "Mainnet": "", @@ -737,7 +773,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "maUSDC_ADDRESS": { "Mainnet": "", @@ -757,7 +794,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "stETH_ADDRESS": { "Mainnet": "0xDFe66B14D37C77F4E9b180cEb433d1b164f0281D", @@ -777,7 +815,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "NFTX_ADDRESS": { "Mainnet": "0x87d73E916D7057945c9BcD8cdd94e42A6F47f776", @@ -797,7 +836,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "cUSD_ADDRESS": { "Mainnet": "", @@ -817,7 +857,8 @@ "Celo": "0x765de816845861e75a25fca122bb6898b8b1282a", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "cEUR_ADDRESS": { "Mainnet": "", @@ -837,7 +878,8 @@ "Celo": "0x765de816845861e75a25fca122bb6898b8b1282a", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "xTRI_ADDRESS": { "Mainnet": "", @@ -857,7 +899,8 @@ "Celo": "", "Fantom": "", "Aurora": "0x802119e4e253D5C19aA06A5d567C5a41596D6803", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "JOE_ADDRESS": { "Mainnet": "", @@ -877,7 +920,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "PNG_ADDRESS": { "Mainnet": "", @@ -897,7 +941,50 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" + }, + "SHARE_ADDRESS": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "0x60781C2586D68229fde47564546784ab3fACA982", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Moonbeam": "0x4204cAd97732282d261FbB7088e07557810A6408" + }, + "STELLA_ADDRESS": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "0x60781C2586D68229fde47564546784ab3fACA982", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Moonbeam": "0x0e358838ce72d5e61e0018a2ffac4bec5f4c88d2" }, "ETHER_ADDRESS": { "Mainnet": "", @@ -917,7 +1004,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "NATIVE_TOKEN_ADDRESS": { "Mainnet": "0x0000000000000000000000000000000000000000", @@ -937,6 +1025,7 @@ "Celo": "0x471ece3750da237f93b8e339c536989b8978a438", "Fantom": "0x0000000000000000000000000000000000000000", "Aurora": "0x0000000000000000000000000000000000000000", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/trader.json b/packages/web3-constants/evm/trader.json index b656354c3839..b5d7cc11b84f 100644 --- a/packages/web3-constants/evm/trader.json +++ b/packages/web3-constants/evm/trader.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "UNISWAP_V2_FACTORY_ADDRESS": { "Mainnet": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f", @@ -37,7 +38,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "UNISWAP_V2_THEGRAPH": { "Mainnet": "https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2", @@ -57,7 +59,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "UNISWAP_V2_INIT_CODE_HASH": { "Mainnet": "0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f", @@ -77,7 +80,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "UNISWAP_SWAP_ROUTER_ADDRESS": { "Mainnet": "0xe592427a0aece92de3edee1f18e0157c05861564", @@ -97,7 +101,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "UNISWAP_V3_FACTORY_ADDRESS": { "Mainnet": "0x1F98431c8aD98523631AE4a59f267346ea31F984", @@ -117,7 +122,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "UNISWAP_V3_QUOTER_ADDRESS": { "Mainnet": "0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6", @@ -137,7 +143,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "UNISWAP_V3_THEGRAPH": { "Mainnet": "https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3", @@ -157,7 +164,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "UNISWAP_V3_INIT_CODE_HASH": { "Mainnet": "0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54", @@ -177,7 +185,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "SUSHISWAP_ROUTER_ADDRESS": { "Mainnet": "0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F", @@ -197,7 +206,8 @@ "Celo": "0x1421bDe4B10e8dd459b3BCb598810B1337D56842", "Fantom": "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506", "Aurora": "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "SUSHISWAP_FACTORY_ADDRESS": { "Mainnet": "0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac", @@ -217,7 +227,8 @@ "Celo": "0xc35DADB65012eC5796536bD9864eD8773aBc74C4", "Fantom": "0xc35DADB65012eC5796536bD9864eD8773aBc74C4", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "SUSHISWAP_THEGRAPH": { "Mainnet": "https://api.thegraph.com/subgraphs/name/zippoxer/sushiswap-subgraph-fork", @@ -237,7 +248,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "SUSHISWAP_INIT_CODE_HASH": { "Mainnet": "0xe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303", @@ -257,7 +269,8 @@ "Celo": "0xe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303", "Fantom": "0xe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "SASHIMISWAP_ROUTER_ADDRESS": { "Mainnet": "0xe4fe6a45f354e845f954cddee6084603cedb9410", @@ -277,7 +290,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "SASHIMISWAP_FACTORY_ADDRESS": { "Mainnet": "0xF028F723ED1D0fE01cC59973C49298AA95c57472", @@ -297,7 +311,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "SASHIMISWAP_THEGRAPH": { "Mainnet": "https://api.thegraph.com/subgraphs/name/sashimiproject/sashimi", @@ -317,7 +332,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "SASHIMISWAP_INIT_CODE_HASH": { "Mainnet": "0xb465bbe4edb8c9b0da8ff0b2b36ce0065de9fcd5a33f32c6856ea821779c8b72", @@ -337,7 +353,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "QUICKSWAP_ROUTER_ADDRESS": { "Mainnet": "", @@ -357,7 +374,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "QUICKSWAP_FACTORY_ADDRESS": { "Mainnet": "", @@ -377,7 +395,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "QUICKSWAP_THEGRAPH": { "Mainnet": "", @@ -397,7 +416,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "QUICKSWAP_INIT_CODE_HASH": { "Mainnet": "", @@ -417,7 +437,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "PANCAKESWAP_ROUTER_ADDRESS": { "Mainnet": "", @@ -437,7 +458,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "PANCAKESWAP_FACTORY_ADDRESS": { "Mainnet": "", @@ -457,7 +479,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "PANCAKESWAP_THEGRAPH": { "Mainnet": "", @@ -477,7 +500,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "PANCAKESWAP_INIT_CODE_HASH": { "Mainnet": "", @@ -497,7 +521,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "BALANCER_ETH_ADDRESS": { "Mainnet": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", @@ -517,7 +542,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "BALANCER_EXCHANGE_PROXY_ADDRESS": { "Mainnet": "0x3E66B66Fd1d0b02fDa6C811Da9E0547970DB2f21", @@ -537,7 +563,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "BALANCER_POOLS_URL": { "Mainnet": "https://ipfs.fleek.co/ipns/balancer-bucket.storage.fleek.co/balancer-exchange/pools", @@ -557,7 +584,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "DODO_ETH_ADDRESS": { "Mainnet": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", @@ -577,7 +605,8 @@ "Celo": "", "Fantom": "", "Aurora": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "DODO_EXCHANGE_PROXY_ADDRESS": { "Mainnet": "0xCB859eA579b28e02B87A1FDE08d087ab9dbE5149", @@ -597,7 +626,8 @@ "Celo": "", "Fantom": "", "Aurora": "0x335aC99bb3E51BDbF22025f092Ebc1Cf2c5cC619", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "BANCOR_ETH_ADDRESS": { "Mainnet": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", @@ -617,7 +647,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "BANCOR_EXCHANGE_PROXY_ADDRESS": { "Mainnet": "0x2F9EC37d6CcFFf1caB21733BdaDEdE11c823cCB0", @@ -637,7 +668,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "TRADERJOE_ROUTER_ADDRESS": { "Mainnet": "", @@ -657,7 +689,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "TRADERJOE_FACTORY_ADDRESS": { "Mainnet": "", @@ -677,7 +710,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "TRADERJOE_THEGRAPH": { "Mainnet": "https://api.thegraph.com/subgraphs/name/traderjoe-xyz/exchange", @@ -697,7 +731,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "TRADERJOE_INIT_CODE_HASH": { "Mainnet": "", @@ -717,7 +752,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "OPENOCEAN_ETH_ADDRESS": { "Mainnet": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", @@ -737,7 +773,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "OPENOCEAN_EXCHANGE_PROXY_ADDRESS": { "Mainnet": "0x6352a56caadC4F1E25CD6c75970Fa768A3304e64", @@ -757,7 +794,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "PANGOLIN_ROUTER_ADDRESS": { "Mainnet": "", @@ -777,7 +815,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "PANGOLIN_FACTORY_ADDRESS": { "Mainnet": "", @@ -797,7 +836,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "PANGOLIN_THEGRAPH": { "Mainnet": "", @@ -817,7 +857,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "PANGOLIN_INIT_CODE_HASH": { "Mainnet": "", @@ -837,7 +878,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "WANNASWAP_ROUTER_V2_ADDRESS": { "Mainnet": "", @@ -857,7 +899,8 @@ "Celo": "", "Fantom": "", "Aurora": "0xa3a1eF5Ae6561572023363862e238aFA84C72ef5", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "WANNASWAP_ROUTER_ADDRESS": { "Mainnet": "", @@ -877,7 +920,8 @@ "Celo": "", "Fantom": "", "Aurora": "0x8f1E0Cf0f9f269Bc977C38635E560aa5b0E63323", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "WANNASWAP_FACTORY_ADDRESS": { "Mainnet": "", @@ -897,7 +941,8 @@ "Celo": "", "Fantom": "", "Aurora": "0x7928D4FeA7b2c90C732c10aFF59cf403f0C38246", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "WANNASWAP_THEGRAPH": { "Mainnet": "", @@ -917,7 +962,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "WANNASWAP_INIT_CODE_HASH": { "Mainnet": "", @@ -937,7 +983,8 @@ "Celo": "", "Fantom": "", "Aurora": "0xa06b8b0642cf6a9298322d0c8ac3c68c291ca24dc66245cf23aa2abc33b57e21", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "TRISOLARIS_ROUTER_ADDRESS": { "Mainnet": "", @@ -957,7 +1004,8 @@ "Celo": "", "Fantom": "", "Aurora": "0x2CB45Edb4517d5947aFdE3BEAbF95A582506858B", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "TRISOLARIS_FACTORY_ADDRESS": { "Mainnet": "", @@ -977,7 +1025,8 @@ "Celo": "", "Fantom": "", "Aurora": "0xc66F594268041dB60507F00703b152492fb176E7", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "TRISOLARIS_THEGRAPH": { "Mainnet": "", @@ -997,7 +1046,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "TRISOLARIS_INIT_CODE_HASH": { "Mainnet": "", @@ -1017,6 +1067,175 @@ "Celo": "", "Fantom": "", "Aurora": "0x754e1d90e536e4c1df81b7f030f47b4ca80c87120e145c294f098c83a6cb5ace", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" + }, + "BEAMSWAP_ROUTER_ADDRESS": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "0x60913758635b54e6C9685f92201A5704eEe74748", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "0x2CB45Edb4517d5947aFdE3BEAbF95A582506858B", + "Aurora_Testnet": "", + "Moonbeam": "0x96b244391D98B62D19aE89b1A4dCcf0fc56970C7" + }, + "BEAMSWAP_FACTORY_ADDRESS": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Moonbeam": "0x985BcA32293A7A496300a48081947321177a86FD" + }, + "BEAMSWAP_THEGRAPH": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Moonbeam": "" + }, + "BEAMSWAP_INIT_CODE_HASH": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Moonbeam": "0xe31da4209ffcce713230a74b5287fa8ec84797c9e77e1f7cfeccea015cdc97ea" + }, + "STELLASWAP_ROUTER_ADDRESS": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "0x60913758635b54e6C9685f92201A5704eEe74748", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "0x2CB45Edb4517d5947aFdE3BEAbF95A582506858B", + "Aurora_Testnet": "", + "Moonbeam": "0xd0A01ec574D1fC6652eDF79cb2F880fd47D34Ab1" + }, + "STELLASWAP_FACTORY_ADDRESS": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Moonbeam": "0x68A384D826D3678f78BB9FB1533c7E9577dACc0E" + }, + "STELLASWAP_THEGRAPH": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Moonbeam": "" + }, + "STELLASWAP_INIT_CODE_HASH": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Moonbeam": "0x48a6ca3d52d0d0a6c53a83cc3c8688dd46ea4cb786b169ee959b95ad30f61643" } } From c80d16ad43c7d9688d37ffaf3af6357d88b2977c Mon Sep 17 00:00:00 2001 From: codingsh Date: Wed, 9 Mar 2022 11:10:49 +0000 Subject: [PATCH 03/24] chore(moonbeam): add json infos --- packages/web3-constants/evm/airdrop.json | 3 ++- packages/web3-constants/evm/artblocks.json | 3 ++- packages/web3-constants/evm/coingecko.json | 6 ++++-- .../web3-constants/evm/coinmarketcap.json | 3 ++- packages/web3-constants/evm/cryptoartai.json | 9 +++++--- packages/web3-constants/evm/debank.json | 3 ++- packages/web3-constants/evm/dhedge.json | 6 ++++-- packages/web3-constants/evm/ethereum.json | 12 +++++++---- packages/web3-constants/evm/gitcoin.json | 12 +++++++---- .../web3-constants/evm/good-ghosting.json | 6 ++++-- packages/web3-constants/evm/ito.json | 21 ++++++++++++------- packages/web3-constants/evm/lbp.json | 3 ++- packages/web3-constants/evm/mask-box.json | 6 ++++-- .../web3-constants/evm/nft-red-packet.json | 6 ++++-- packages/web3-constants/evm/openocean.json | 3 ++- packages/web3-constants/evm/opensea-api.json | 9 +++++--- packages/web3-constants/evm/pooltogether.json | 6 ++++-- packages/web3-constants/evm/red-packet.json | 18 ++++++++++------ packages/web3-constants/evm/savings.json | 9 +++++--- .../evm/space-station-galaxy.json | 6 ++++-- .../evm/token-asset-base-url.json | 3 ++- packages/web3-constants/evm/token-list.json | 3 ++- packages/web3-constants/evm/trending.json | 9 +++++--- packages/web3-constants/evm/zerion.json | 6 ++++-- packages/web3-shared/evm/assets/chains.json | 4 ++-- 25 files changed, 116 insertions(+), 59 deletions(-) diff --git a/packages/web3-constants/evm/airdrop.json b/packages/web3-constants/evm/airdrop.json index ab949267d4f5..dea740de6813 100644 --- a/packages/web3-constants/evm/airdrop.json +++ b/packages/web3-constants/evm/airdrop.json @@ -17,6 +17,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/artblocks.json b/packages/web3-constants/evm/artblocks.json index b626e1dae9f6..02d6db284972 100644 --- a/packages/web3-constants/evm/artblocks.json +++ b/packages/web3-constants/evm/artblocks.json @@ -17,6 +17,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/coingecko.json b/packages/web3-constants/evm/coingecko.json index 6f3add83afa9..c3bebfc78dd2 100644 --- a/packages/web3-constants/evm/coingecko.json +++ b/packages/web3-constants/evm/coingecko.json @@ -17,7 +17,8 @@ "Celo": "celo", "Fantom": "fantom", "Aurora": "aurora", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "moonbeam" }, "COIN_ID": { "Mainnet": "ethereum", @@ -37,6 +38,7 @@ "Celo": "celo", "Fantom": "fantom", "Aurora": "ethereum", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "moonbeam" } } diff --git a/packages/web3-constants/evm/coinmarketcap.json b/packages/web3-constants/evm/coinmarketcap.json index ffd32861a9a2..b0a28ce1271a 100644 --- a/packages/web3-constants/evm/coinmarketcap.json +++ b/packages/web3-constants/evm/coinmarketcap.json @@ -17,6 +17,7 @@ "Celo": "5567", "Fantom": "3513", "Aurora": "1313161554", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/cryptoartai.json b/packages/web3-constants/evm/cryptoartai.json index edde7f04abdc..b6125a9d733a 100644 --- a/packages/web3-constants/evm/cryptoartai.json +++ b/packages/web3-constants/evm/cryptoartai.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "ARTIST_ACCEPTING_BIDS_V2": { "Mainnet": "0x78C889749f29D2965a76Ede3BBb232A9729Ccf0b", @@ -37,7 +38,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "CANFT_MARKET": { "Mainnet": "0x72d081953957723e540780a0C6bA31725469238E", @@ -57,6 +59,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/debank.json b/packages/web3-constants/evm/debank.json index 070df0c683df..efc5866bfa3e 100644 --- a/packages/web3-constants/evm/debank.json +++ b/packages/web3-constants/evm/debank.json @@ -17,6 +17,7 @@ "Celo": "celo", "Fantom": "ftm", "Aurora": "aurora", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "mobm" } } diff --git a/packages/web3-constants/evm/dhedge.json b/packages/web3-constants/evm/dhedge.json index 870f99083e7f..9976a38f8648 100644 --- a/packages/web3-constants/evm/dhedge.json +++ b/packages/web3-constants/evm/dhedge.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "API_URL": { "Mainnet": "https://api-v2.dhedge.org/graphql", @@ -37,6 +38,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/ethereum.json b/packages/web3-constants/evm/ethereum.json index f4ca94106031..b2be707e41fb 100644 --- a/packages/web3-constants/evm/ethereum.json +++ b/packages/web3-constants/evm/ethereum.json @@ -17,7 +17,8 @@ "Celo": "0x8e28F1d64ceD52b9A09aB1AA3071Aa3c05802d1F", "Fantom": "0xc119574d5fb333f5ac018658d4d8b5035e16bf39", "Aurora": "0xC119574D5Fb333F5AC018658D4d8b5035E16bf39", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "MULTICALL_ADDRESS": { "Mainnet": "0x1F98415757620B543A52E61c46B32eB19261F984", @@ -37,7 +38,8 @@ "Celo": "0x072453AdEC16cFC7FB6Af1517c3f25407180cccC", "Fantom": "0x913975af2Bb8a6Be4100D7dc5e9765B77F6A5d6c", "Aurora": "0x6cc1b1058F9153358278C35E0b2D382f1585854B", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "ENS_REGISTRAR_ADDRESS": { "Mainnet": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", @@ -57,7 +59,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "ENS_REVERSE_RECORDS_ADDRESS": { "Mainnet": "0x3671aE578E63FdF66ad4F3E12CC0c0d71Ac7510C", @@ -77,6 +80,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/gitcoin.json b/packages/web3-constants/evm/gitcoin.json index 708e296ea6de..f0105137920c 100644 --- a/packages/web3-constants/evm/gitcoin.json +++ b/packages/web3-constants/evm/gitcoin.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "BULK_CHECKOUT_ADDRESS": { "Mainnet": "0x7d655c57f71464B6f83811C55D84009Cd9f5221C", @@ -37,7 +38,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "GITCOIN_ETH_ADDRESS": { "Mainnet": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", @@ -57,7 +59,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "GITCOIN_TIP_PERCENTAGE": { "Mainnet": 5, @@ -77,6 +80,7 @@ "Celo": 0, "Fantom": 0, "Aurora": 0, - "Aurora_Testnet": 0 + "Aurora_Testnet": 0, + "Moonbeam": 0 } } diff --git a/packages/web3-constants/evm/good-ghosting.json b/packages/web3-constants/evm/good-ghosting.json index e54f1e6ba1bf..ce65c967a2f4 100644 --- a/packages/web3-constants/evm/good-ghosting.json +++ b/packages/web3-constants/evm/good-ghosting.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "GOOD_GHOSTING_INCENTIVES_CONTRACT_ADDRESS": { "Mainnet": "", @@ -37,6 +38,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/ito.json b/packages/web3-constants/evm/ito.json index f0cbea49edfb..9decb1c3e446 100644 --- a/packages/web3-constants/evm/ito.json +++ b/packages/web3-constants/evm/ito.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "MASK_ITO_CONTRACT_ADDRESS": { "Mainnet": "0x86812da3A623ab9606976078588b80C315E55FA3", @@ -37,7 +38,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "ITO2_CONTRACT_ADDRESS": { "Mainnet": "0xc2CFbF22d6Dc87D0eE18d38d73733524c109Ff46", @@ -57,7 +59,8 @@ "Celo": "0xaA5bfd7355637eA7405CB194a55303e821c4c569", "Fantom": "0x981be454a930479d92C91a0092D204b64845A5D6", "Aurora": "0x2cf91AD8C175305EBe6970Bd8f81231585EFbd77", - "Aurora_Testnet": "0xdcA6F476EebCDE8FE8b072e3fC80dBC28dC209b3" + "Aurora_Testnet": "0xdcA6F476EebCDE8FE8b072e3fC80dBC28dC209b3", + "Moonbeam": "" }, "ITO2_CONTRACT_CREATION_BLOCK_HEIGHT": { "Mainnet": 12766513, @@ -77,7 +80,8 @@ "Celo": 10278776, "Fantom": 25071597, "Aurora": 57350598, - "Aurora_Testnet": 77919102 + "Aurora_Testnet": 77919102, + "Moonbeam": 0 }, "DEFAULT_QUALIFICATION_ADDRESS": { "Mainnet": "0x81b6ae377e360dcad63611846a2516f4ba8c88ac", @@ -97,7 +101,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "DEFAULT_QUALIFICATION2_ADDRESS": { "Mainnet": "0x4dC5f343Fe57E4fbDA1B454d125D396A3181272c", @@ -117,7 +122,8 @@ "Celo": "0x2cB220F925E603A04BEE05F210252120deBA29d7", "Fantom": "0x83D6b366f21e413f214EB077D5378478e71a5eD2", "Aurora": "0x578a7Fee5f0D8CEc7d00578Bf37374C5b95C4b98", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "SUBGRAPH_URL": { "Mainnet": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-ito-mainnet", @@ -137,6 +143,7 @@ "Celo": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-ito-celo", "Fantom": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-ito-fantom", "Aurora": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-ito-aurora", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/lbp.json b/packages/web3-constants/evm/lbp.json index 051943e8a62d..f1bd4d7f795e 100644 --- a/packages/web3-constants/evm/lbp.json +++ b/packages/web3-constants/evm/lbp.json @@ -17,6 +17,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/mask-box.json b/packages/web3-constants/evm/mask-box.json index a391a2ea2256..97401206bc5b 100644 --- a/packages/web3-constants/evm/mask-box.json +++ b/packages/web3-constants/evm/mask-box.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "0xf5056B96ab242C566002852d0b98ce0BcDf1af51", - "Aurora_Testnet": "0xB4D669bc117735FdA44e90e52795132187705B21" + "Aurora_Testnet": "0xB4D669bc117735FdA44e90e52795132187705B21", + "Moonbeam": "" }, "MASK_BOX_CONTRACT_FROM_BLOCK": { "Mainnet": 13687866, @@ -37,6 +38,7 @@ "Celo": 0, "Fantom": 0, "Aurora": 57259004, - "Aurora_Testnet": 77919118 + "Aurora_Testnet": 77919118, + "Moonbeam": 0 } } diff --git a/packages/web3-constants/evm/nft-red-packet.json b/packages/web3-constants/evm/nft-red-packet.json index 14f892ec49c5..5c2a79dab88b 100644 --- a/packages/web3-constants/evm/nft-red-packet.json +++ b/packages/web3-constants/evm/nft-red-packet.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "0x05ee315E407C21a594f807D61d6CC11306D1F149", - "Aurora_Testnet": "0x97369fEE7db34E0BfE47861f2ec44b4378d13eB4" + "Aurora_Testnet": "0x97369fEE7db34E0BfE47861f2ec44b4378d13eB4", + "Moonbeam": "" }, "SUBGRAPH_URL": { "Mainnet": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-nft-red-packet-mainnet", @@ -37,6 +38,7 @@ "Celo": "", "Fantom": "", "Aurora": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-nft-red-packet-aurora", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/openocean.json b/packages/web3-constants/evm/openocean.json index 50fb7755a589..f9c90534fcf8 100644 --- a/packages/web3-constants/evm/openocean.json +++ b/packages/web3-constants/evm/openocean.json @@ -17,6 +17,7 @@ "Celo": "0x934B510D4C9103E6a87AEf13b816fb080286D649", "Fantom": "0x934B510D4C9103E6a87AEf13b816fb080286D649", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/opensea-api.json b/packages/web3-constants/evm/opensea-api.json index 8032d46e99ce..e24db6214106 100644 --- a/packages/web3-constants/evm/opensea-api.json +++ b/packages/web3-constants/evm/opensea-api.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "GET_SINGLE_ASSET_URL": { "Mainnet": "https://api.opensea.io/api/v1/asset", @@ -37,7 +38,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "GET_ASSETS_URL": { "Mainnet": "https://api.opensea.io/api/v1/assets", @@ -57,6 +59,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/pooltogether.json b/packages/web3-constants/evm/pooltogether.json index 529a2e16bb28..e80ee0c11b0d 100644 --- a/packages/web3-constants/evm/pooltogether.json +++ b/packages/web3-constants/evm/pooltogether.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "MASK_POOL_ADDRESS": { "Mainnet": "", @@ -37,6 +38,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/red-packet.json b/packages/web3-constants/evm/red-packet.json index d587717e2cd6..199c5c5aee53 100644 --- a/packages/web3-constants/evm/red-packet.json +++ b/packages/web3-constants/evm/red-packet.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "HAPPY_RED_PACKET_ADDRESS_V2": { "Mainnet": "0x8D8912E1237F9FF3EF661F32743CFB276E052F98", @@ -37,7 +38,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "HAPPY_RED_PACKET_ADDRESS_V3": { "Mainnet": "", @@ -57,7 +59,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "HAPPY_RED_PACKET_ADDRESS_V4": { "Mainnet": "0xaBBe1101FD8fa5847c452A6D70C8655532B03C33", @@ -77,7 +80,8 @@ "Celo": "0xAb7B1bE4233A04e5C43a810E75657ECED8E5463B", "Fantom": "0x578a7Fee5f0D8CEc7d00578Bf37374C5b95C4b98", "Aurora": "0x19f179D7e0D7d9F9d5386afFF64271D98A91615B", - "Aurora_Testnet": "0xdB93cCd481012bB5D1E2c8d0aF7C5f2940c00fdC" + "Aurora_Testnet": "0xdB93cCd481012bB5D1E2c8d0aF7C5f2940c00fdC", + "Moonbeam": "" }, "HAPPY_RED_PACKET_ADDRESS_V4_BLOCK_HEIGHT": { "Mainnet": 12939427, @@ -97,7 +101,8 @@ "Celo": 10413552, "Fantom": 25112473, "Aurora": 57552338, - "Aurora_Testnet": 77918765 + "Aurora_Testnet": 77918765, + "Moonbeam": 0 }, "SUBGRAPH_URL": { "Mainnet": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-red-packet-mainnet", @@ -117,6 +122,7 @@ "Celo": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-red-packet-celo", "Fantom": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-red-packet-fantom", "Aurora": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-red-packet-aurora", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/savings.json b/packages/web3-constants/evm/savings.json index 0f58f923eb48..4925b89295fa 100644 --- a/packages/web3-constants/evm/savings.json +++ b/packages/web3-constants/evm/savings.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "LIDO_STETH": { "Mainnet": "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84", @@ -37,7 +38,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "LIDO_REFERRAL_ADDRESS": { "Mainnet": "0x278D7e418a28ff763eEeDf29238CD6dfcade3A3a", @@ -57,6 +59,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/space-station-galaxy.json b/packages/web3-constants/evm/space-station-galaxy.json index 86b85572cdcd..cc1bbc8a7f70 100644 --- a/packages/web3-constants/evm/space-station-galaxy.json +++ b/packages/web3-constants/evm/space-station-galaxy.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "SUBGRAPH_URL": { "Mainnet": "", @@ -37,6 +38,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/token-asset-base-url.json b/packages/web3-constants/evm/token-asset-base-url.json index 994c1a1189ae..0b00012c960d 100644 --- a/packages/web3-constants/evm/token-asset-base-url.json +++ b/packages/web3-constants/evm/token-asset-base-url.json @@ -47,6 +47,7 @@ "Celo": [], "Fantom": [], "Aurora": [], - "Aurora_Testnet": [] + "Aurora_Testnet": [], + "Moonbeam": [] } } diff --git a/packages/web3-constants/evm/token-list.json b/packages/web3-constants/evm/token-list.json index 76b7b8870aee..dc87129fbb6d 100644 --- a/packages/web3-constants/evm/token-list.json +++ b/packages/web3-constants/evm/token-list.json @@ -17,6 +17,7 @@ "Celo": ["https://tokens.r2d2.to/latest/42220/tokens.json"], "Fantom": ["https://tokens.r2d2.to/latest/250/tokens.json"], "Aurora": ["https://tokens.r2d2.to/latest/1313161554/tokens.json"], - "Aurora_Testnet": [] + "Aurora_Testnet": [], + "Moonbeam": ["https://tokens.r2d2.to/latest/1284/tokens.json"] } } diff --git a/packages/web3-constants/evm/trending.json b/packages/web3-constants/evm/trending.json index a115fe46afe5..7e786339de55 100644 --- a/packages/web3-constants/evm/trending.json +++ b/packages/web3-constants/evm/trending.json @@ -17,7 +17,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "UNISWAP_V2_HEALTH_URL": { "Mainnet": "https://api.thegraph.com/index-node/graphql", @@ -37,7 +38,8 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" }, "ETHEREUM_BLOCKS_SUBGRAPH_URL": { "Mainnet": "https://api.thegraph.com/subgraphs/name/blocklytics/ethereum-blocks", @@ -57,6 +59,7 @@ "Celo": "", "Fantom": "", "Aurora": "", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/zerion.json b/packages/web3-constants/evm/zerion.json index e0d70150b37f..5e8a6c03c5e3 100644 --- a/packages/web3-constants/evm/zerion.json +++ b/packages/web3-constants/evm/zerion.json @@ -17,7 +17,8 @@ "Celo": "celo-assets", "Fantom": "fantom-assets", "Aurora": "aurora-assets", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "moonbeam-assets" }, "TRANSACTIONS_SCOPE_NAME": { "Mainnet": "transactions", @@ -37,6 +38,7 @@ "Celo": "celo-transactions", "Fantom": "fantom-transactions", "Aurora": "aurora-transactions", - "Aurora_Testnet": "" + "Aurora_Testnet": "", + "Moonbeam": "moonbeam-assets" } } diff --git a/packages/web3-shared/evm/assets/chains.json b/packages/web3-shared/evm/assets/chains.json index 23f44392849e..7390867447b7 100644 --- a/packages/web3-shared/evm/assets/chains.json +++ b/packages/web3-shared/evm/assets/chains.json @@ -1609,7 +1609,7 @@ }, { "name": "Moonbeam Polkadot", - "chain": "MOON", + "chain": "moonbeam", "network": "moonbeam", "rpc": [], "faucets": [], @@ -1648,7 +1648,7 @@ }, { "name": "Moonbeam Testnet Moonbase Alpha", - "chain": "MOON", + "chain": "moonbeam", "network": "moonbase", "rpc": ["https://rpc.testnet.moonbeam.network", "wss://wss.testnet.moonbeam.network"], "faucets": [], From eb34de04290adda1dab1a9a1a63e6f1ff69c58e1 Mon Sep 17 00:00:00 2001 From: codingsh Date: Wed, 9 Mar 2022 11:40:55 +0000 Subject: [PATCH 04/24] feat(moonbeam): add padswap dex --- cspell.json | 2 + .../src/plugins/Trader/apis/trader/index.ts | 3 +- .../src/plugins/Trader/constants/index.ts | 1 + .../src/plugins/Trader/constants/padswap.ts | 15 ++++ .../src/plugins/Trader/constants/trader.ts | 1 + packages/mask/src/plugins/Trader/pipes.ts | 10 ++- packages/mask/src/plugins/Trader/settings.ts | 3 + .../Trader/trader/useAllTradeComputed.ts | 13 +++ .../Trader/trader/useGetTradeContext.ts | 30 +++++-- .../plugins/Trader/trader/useTradeCallback.ts | 2 + .../plugins/Trader/trader/useTradeContext.ts | 30 +++++-- .../mask/src/plugins/Trader/types/trader.ts | 1 + packages/public-api/src/web.ts | 1 + packages/web3-constants/evm/token.json | 42 ++++++++++ packages/web3-constants/evm/trader.json | 84 +++++++++++++++++++ 15 files changed, 218 insertions(+), 20 deletions(-) create mode 100644 packages/mask/src/plugins/Trader/constants/padswap.ts diff --git a/cspell.json b/cspell.json index 6e1beb20b1af..8283e8933ad1 100644 --- a/cspell.json +++ b/cspell.json @@ -95,6 +95,7 @@ "futuna", "gasnow", "geckoview", + "glmr", "gltf", "goodghosting", "gundb", @@ -168,6 +169,7 @@ "opensea", "overridable", "overscan", + "padswap", "pageable", "pagelet", "pancakeswap", diff --git a/packages/mask/src/plugins/Trader/apis/trader/index.ts b/packages/mask/src/plugins/Trader/apis/trader/index.ts index e43f2e30843d..3c485fa705f6 100644 --- a/packages/mask/src/plugins/Trader/apis/trader/index.ts +++ b/packages/mask/src/plugins/Trader/apis/trader/index.ts @@ -35,6 +35,7 @@ export async function getAvailableTraderProviders(chainId: ChainId) { TradeProvider.DODO, TradeProvider.ZRX, TradeProvider.OPENOCEAN, + TradeProvider.PADSWAP, ] case NetworkType.Arbitrum: return [TradeProvider.UNISWAP_V3, TradeProvider.OPENOCEAN, TradeProvider.DODO] @@ -51,7 +52,7 @@ export async function getAvailableTraderProviders(chainId: ChainId) { case NetworkType.Aurora: return [TradeProvider.DODO, TradeProvider.WANNASWAP, TradeProvider.TRISOLARIS] case NetworkType.Moonbeam: - return [TradeProvider.SUSHISWAP, TradeProvider.BEAMSWAP, TradeProvider.STELLASWAP] + return [TradeProvider.SUSHISWAP, TradeProvider.BEAMSWAP, TradeProvider.STELLASWAP, TradeProvider.PADSWAP] case NetworkType.Boba: case NetworkType.Fuse: case NetworkType.Metis: diff --git a/packages/mask/src/plugins/Trader/constants/index.ts b/packages/mask/src/plugins/Trader/constants/index.ts index ae62a1724902..5806197d6735 100644 --- a/packages/mask/src/plugins/Trader/constants/index.ts +++ b/packages/mask/src/plugins/Trader/constants/index.ts @@ -15,4 +15,5 @@ export * from './wannaswap' export * from './trisolaris' export * from './beamswap' export * from './stellaswap' +export * from './padswap' export type { ERC20TokenCustomizedBase, ERC20AgainstToken } from './types' diff --git a/packages/mask/src/plugins/Trader/constants/padswap.ts b/packages/mask/src/plugins/Trader/constants/padswap.ts new file mode 100644 index 000000000000..edba1d47c0f3 --- /dev/null +++ b/packages/mask/src/plugins/Trader/constants/padswap.ts @@ -0,0 +1,15 @@ +import { ChainId } from '@masknet/web3-shared-evm' +import { DAI, USDC, USDT, PAD, WBTC, WNATIVE, WNATIVE_ONLY } from './trader' +import type { ERC20AgainstToken, ERC20TokenCustomizedBase } from './types' + +/** + * Some tokens can only be swapped via certain pairs, + * so we override the list of bases that are considered for these tokens. + */ +export const PADSWAP_CUSTOM_BASES: ERC20TokenCustomizedBase = {} + +export const PADSWAP_BASE_AGAINST_TOKENS: ERC20AgainstToken = { + ...WNATIVE_ONLY, + [ChainId.Moonbeam]: [WNATIVE, DAI, PAD, USDT, USDC, WBTC].map((x) => x[ChainId.Moonbeam]), + [ChainId.BSC]: [WNATIVE, DAI, PAD, USDT, USDC, WBTC].map((x) => x[ChainId.BSC]), +} diff --git a/packages/mask/src/plugins/Trader/constants/trader.ts b/packages/mask/src/plugins/Trader/constants/trader.ts index 4d6b99f2a2e7..42b8c794b982 100644 --- a/packages/mask/src/plugins/Trader/constants/trader.ts +++ b/packages/mask/src/plugins/Trader/constants/trader.ts @@ -52,6 +52,7 @@ export const JOE = createERC20Tokens('JOE_ADDRESS', 'JoeToken', 'JOE', 18) export const PNG = createERC20Tokens('PNG_ADDRESS', 'Pangolin', 'PNG', 18) export const SHARE = createERC20Tokens('SHARE_ADDRESS', 'Beamshare Token', 'SHARE', 18) export const STELLA = createERC20Tokens('STELLA_ADDRESS', 'StellaSwap', 'STELLA', 18) +export const PAD = createERC20Tokens('PAD_ADDRESS', 'Glmr Pad', 'PAD', 18) export const WNATIVE = createERC20Tokens( 'WNATIVE_ADDRESS', diff --git a/packages/mask/src/plugins/Trader/pipes.ts b/packages/mask/src/plugins/Trader/pipes.ts index 437c32262952..f6101011697b 100644 --- a/packages/mask/src/plugins/Trader/pipes.ts +++ b/packages/mask/src/plugins/Trader/pipes.ts @@ -63,6 +63,7 @@ export const resolveTradeProviderName = createLookupTableResolver { throw new Error(`Unknown provider type: ${tradeProvider}`) @@ -135,6 +136,8 @@ export function resolveTradeProviderLink(tradeProvider: TradeProvider, networkTy return 'https://app.beamswap.io/' case TradeProvider.STELLASWAP: return 'https://app.stellaswap.com/' + case TradeProvider.PADSWAP: + return 'https://padswap.exchange/swap' default: unreachable(tradeProvider) } @@ -215,11 +218,12 @@ export function resolveTradePairLink(tradeProvider: TradeProvider, address: stri // TODO - add WannaSwap analytics return '' case TradeProvider.STELLASWAP: - // TODO - add WannaSwap analytics + // TODO - add StellaSwap analytics return '' case TradeProvider.BEAMSWAP: - // TODO - add WannaSwap analytics - return '' + return `https://analytics.beamswap.io/paris/${address}` + case TradeProvider.PADSWAP: + return `https://glmr-info.padswap.exchange/pair/${address}` default: unreachable(tradeProvider) } diff --git a/packages/mask/src/plugins/Trader/settings.ts b/packages/mask/src/plugins/Trader/settings.ts index 33f1f2ecf114..820efc9af781 100644 --- a/packages/mask/src/plugins/Trader/settings.ts +++ b/packages/mask/src/plugins/Trader/settings.ts @@ -57,6 +57,7 @@ const trisolarisSettings = createInternalSettings(`${PLUGIN_ID}+tradePro const wannaswapSettings = createInternalSettings(`${PLUGIN_ID}+tradeProvider+wannaswap`, '') const beamswapSettings = createInternalSettings(`${PLUGIN_ID}+tradeProvider+beamswap`, '') const stellaswapSettings = createInternalSettings(`${PLUGIN_ID}+tradeProvider+stellaswap`, '') +const padswapSettings = createInternalSettings(`${PLUGIN_ID}+tradeProvider+padswap`, '') /** * The general settings of specific tarde provider @@ -97,6 +98,8 @@ export function getCurrentTradeProviderGeneralSettings(tradeProvider: TradeProvi return beamswapSettings case TradeProvider.STELLASWAP: return stellaswapSettings + case TradeProvider.PADSWAP: + return padswapSettings default: unreachable(tradeProvider) } diff --git a/packages/mask/src/plugins/Trader/trader/useAllTradeComputed.ts b/packages/mask/src/plugins/Trader/trader/useAllTradeComputed.ts index 220b5004adbf..57ad1eee824b 100644 --- a/packages/mask/src/plugins/Trader/trader/useAllTradeComputed.ts +++ b/packages/mask/src/plugins/Trader/trader/useAllTradeComputed.ts @@ -271,6 +271,18 @@ export function useAllTradeComputed( const beamswap = useUniswapTradeComputed(beamswap_.value, inputToken, outputToken) const beamswapEstimateGas = useUniswapTradeGasLimit(beamswap, TradeProvider.BEAMSWAP) + // PADswap + const padswap_ = useUniswapV2Trade( + TradeProvider.PADSWAP, + TradeStrategy.ExactIn, + inputAmount_, + '0', + tradeProviders.some((x) => x === TradeProvider.PADSWAP) ? inputToken : undefined, + tradeProviders.some((x) => x === TradeProvider.PADSWAP) ? outputToken : undefined, + ) + const padswap = useUniswapTradeComputed(padswap_.value, inputToken, outputToken) + const padswapEstimateGas = useUniswapTradeGasLimit(padswap, TradeProvider.PADSWAP) + const allTradeResult = [ { provider: TradeProvider.UNISWAP_V2, ...uniswapV2_, value: uniswapV2, gas: uniswapV2EstimateGas }, { provider: TradeProvider.SUSHISWAP, ...sushiSwap_, value: sushiSwap, gas: sushiSwapEstimateGas }, @@ -289,6 +301,7 @@ export function useAllTradeComputed( { provider: TradeProvider.TRISOLARIS, ...trisolaris_, value: trisolaris, gas: trisolarisEstimateGas }, { provider: TradeProvider.STELLASWAP, ...stellaswap_, value: stellaswap, gas: stellaswapEstimateGas }, { provider: TradeProvider.BEAMSWAP, ...beamswap_, value: beamswap, gas: beamswapEstimateGas }, + { provider: TradeProvider.PADSWAP, ...padswap_, value: padswap, gas: padswapEstimateGas }, ] return nativeToken_.value diff --git a/packages/mask/src/plugins/Trader/trader/useGetTradeContext.ts b/packages/mask/src/plugins/Trader/trader/useGetTradeContext.ts index 2d35e0de1dca..ff9956c9be8c 100644 --- a/packages/mask/src/plugins/Trader/trader/useGetTradeContext.ts +++ b/packages/mask/src/plugins/Trader/trader/useGetTradeContext.ts @@ -25,6 +25,8 @@ import { BEAMSWAP_CUSTOM_BASES, STELLASWAP_BASE_AGAINST_TOKENS, STELLASWAP_CUSTOM_BASES, + PADSWAP_BASE_AGAINST_TOKENS, + PADSWAP_CUSTOM_BASES, } from '../constants' import { unreachable } from '@dimensiondev/kit' import { TargetChainIdContext } from './useTargetChainIdContext' @@ -158,10 +160,10 @@ export function useGetTradeContext(tradeProvider?: TradeProvider) { return { TYPE: tradeProvider, IS_UNISWAP_V2_LIKE: true, - GRAPH_API: DEX_TRADE.TRISOLARIS_THEGRAPH, - INIT_CODE_HASH: DEX_TRADE.TRISOLARIS_INIT_CODE_HASH, - ROUTER_CONTRACT_ADDRESS: DEX_TRADE.TRISOLARIS_ROUTER_ADDRESS, - FACTORY_CONTRACT_ADDRESS: DEX_TRADE.TRISOLARIS_FACTORY_ADDRESS, + GRAPH_API: DEX_TRADE.BEAMSWAP_THEGRAPH, + INIT_CODE_HASH: DEX_TRADE.BEAMSWAP_INIT_CODE_HASH, + ROUTER_CONTRACT_ADDRESS: DEX_TRADE.BEAMSWAP_ROUTER_ADDRESS, + FACTORY_CONTRACT_ADDRESS: DEX_TRADE.BEAMSWAP_FACTORY_ADDRESS, AGAINST_TOKENS: BEAMSWAP_BASE_AGAINST_TOKENS, ADDITIONAL_TOKENS: {}, CUSTOM_TOKENS: BEAMSWAP_CUSTOM_BASES, @@ -170,14 +172,26 @@ export function useGetTradeContext(tradeProvider?: TradeProvider) { return { TYPE: tradeProvider, IS_UNISWAP_V2_LIKE: true, - GRAPH_API: DEX_TRADE.TRISOLARIS_THEGRAPH, - INIT_CODE_HASH: DEX_TRADE.TRISOLARIS_INIT_CODE_HASH, - ROUTER_CONTRACT_ADDRESS: DEX_TRADE.TRISOLARIS_ROUTER_ADDRESS, - FACTORY_CONTRACT_ADDRESS: DEX_TRADE.TRISOLARIS_FACTORY_ADDRESS, + GRAPH_API: DEX_TRADE.STELLASWAP_THEGRAPH, + INIT_CODE_HASH: DEX_TRADE.STELLASWAP_INIT_CODE_HASH, + ROUTER_CONTRACT_ADDRESS: DEX_TRADE.STELLASWAP_ROUTER_ADDRESS, + FACTORY_CONTRACT_ADDRESS: DEX_TRADE.STELLASWAP_FACTORY_ADDRESS, AGAINST_TOKENS: STELLASWAP_BASE_AGAINST_TOKENS, ADDITIONAL_TOKENS: {}, CUSTOM_TOKENS: STELLASWAP_CUSTOM_BASES, } + case TradeProvider.PADSWAP: + return { + TYPE: tradeProvider, + IS_UNISWAP_V2_LIKE: true, + GRAPH_API: DEX_TRADE.PADSWAP_THEGRAPH, + INIT_CODE_HASH: DEX_TRADE.PADSWAP_INIT_CODE_HASH, + ROUTER_CONTRACT_ADDRESS: DEX_TRADE.PADSWAP_ROUTER_ADDRESS, + FACTORY_CONTRACT_ADDRESS: DEX_TRADE.PADSWAP_FACTORY_ADDRESS, + AGAINST_TOKENS: PADSWAP_BASE_AGAINST_TOKENS, + ADDITIONAL_TOKENS: {}, + CUSTOM_TOKENS: PADSWAP_CUSTOM_BASES, + } case TradeProvider.ZRX: return { TYPE: tradeProvider, diff --git a/packages/mask/src/plugins/Trader/trader/useTradeCallback.ts b/packages/mask/src/plugins/Trader/trader/useTradeCallback.ts index f4385669380c..0636f3867729 100644 --- a/packages/mask/src/plugins/Trader/trader/useTradeCallback.ts +++ b/packages/mask/src/plugins/Trader/trader/useTradeCallback.ts @@ -118,6 +118,8 @@ export function useTradeCallback( return uniswapV2Like case TradeProvider.STELLASWAP: return uniswapV2Like + case TradeProvider.PADSWAP: + return uniswapV2Like default: if (provider) unreachable(provider) return [] diff --git a/packages/mask/src/plugins/Trader/trader/useTradeContext.ts b/packages/mask/src/plugins/Trader/trader/useTradeContext.ts index ffaca7ae0b1c..1dee1d700478 100644 --- a/packages/mask/src/plugins/Trader/trader/useTradeContext.ts +++ b/packages/mask/src/plugins/Trader/trader/useTradeContext.ts @@ -25,6 +25,8 @@ import { BEAMSWAP_BASE_AGAINST_TOKENS, STELLASWAP_BASE_AGAINST_TOKENS, STELLASWAP_CUSTOM_BASES, + PADSWAP_BASE_AGAINST_TOKENS, + PADSWAP_CUSTOM_BASES, } from '../constants' import type { TradeContext as TradeContext_ } from '../types' import { TargetChainIdContext } from './useTargetChainIdContext' @@ -136,10 +138,10 @@ export function useTradeContext(tradeProvider: TradeProvider) { return { TYPE: tradeProvider, IS_UNISWAP_V2_LIKE: true, - GRAPH_API: DEX_TRADE.TRISOLARIS_THEGRAPH, - INIT_CODE_HASH: DEX_TRADE.TRISOLARIS_INIT_CODE_HASH, - ROUTER_CONTRACT_ADDRESS: DEX_TRADE.TRISOLARIS_ROUTER_ADDRESS, - FACTORY_CONTRACT_ADDRESS: DEX_TRADE.TRISOLARIS_FACTORY_ADDRESS, + GRAPH_API: DEX_TRADE.BEAMSWAP_THEGRAPH, + INIT_CODE_HASH: DEX_TRADE.BEAMSWAP_INIT_CODE_HASH, + ROUTER_CONTRACT_ADDRESS: DEX_TRADE.BEAMSWAP_ROUTER_ADDRESS, + FACTORY_CONTRACT_ADDRESS: DEX_TRADE.BEAMSWAP_FACTORY_ADDRESS, AGAINST_TOKENS: BEAMSWAP_BASE_AGAINST_TOKENS, ADDITIONAL_TOKENS: {}, CUSTOM_TOKENS: BEAMSWAP_CUSTOM_BASES, @@ -148,14 +150,26 @@ export function useTradeContext(tradeProvider: TradeProvider) { return { TYPE: tradeProvider, IS_UNISWAP_V2_LIKE: true, - GRAPH_API: DEX_TRADE.TRISOLARIS_THEGRAPH, - INIT_CODE_HASH: DEX_TRADE.TRISOLARIS_INIT_CODE_HASH, - ROUTER_CONTRACT_ADDRESS: DEX_TRADE.TRISOLARIS_ROUTER_ADDRESS, - FACTORY_CONTRACT_ADDRESS: DEX_TRADE.TRISOLARIS_FACTORY_ADDRESS, + GRAPH_API: DEX_TRADE.STELLASWAP_THEGRAPH, + INIT_CODE_HASH: DEX_TRADE.STELLASWAP_INIT_CODE_HASH, + ROUTER_CONTRACT_ADDRESS: DEX_TRADE.STELLASWAP_ROUTER_ADDRESS, + FACTORY_CONTRACT_ADDRESS: DEX_TRADE.STELLASWAP_FACTORY_ADDRESS, AGAINST_TOKENS: STELLASWAP_BASE_AGAINST_TOKENS, ADDITIONAL_TOKENS: {}, CUSTOM_TOKENS: STELLASWAP_CUSTOM_BASES, } + case TradeProvider.PADSWAP: + return { + TYPE: tradeProvider, + IS_UNISWAP_V2_LIKE: true, + GRAPH_API: DEX_TRADE.PADSWAP_THEGRAPH, + INIT_CODE_HASH: DEX_TRADE.PADSWAP_INIT_CODE_HASH, + ROUTER_CONTRACT_ADDRESS: DEX_TRADE.PADSWAP_ROUTER_ADDRESS, + FACTORY_CONTRACT_ADDRESS: DEX_TRADE.PADSWAP_FACTORY_ADDRESS, + AGAINST_TOKENS: PADSWAP_BASE_AGAINST_TOKENS, + ADDITIONAL_TOKENS: {}, + CUSTOM_TOKENS: PADSWAP_CUSTOM_BASES, + } case TradeProvider.ZRX: return { TYPE: tradeProvider, diff --git a/packages/mask/src/plugins/Trader/types/trader.ts b/packages/mask/src/plugins/Trader/types/trader.ts index 75ee31306bfe..f46374572093 100644 --- a/packages/mask/src/plugins/Trader/types/trader.ts +++ b/packages/mask/src/plugins/Trader/types/trader.ts @@ -77,6 +77,7 @@ export enum ZrxTradePool { WannaSwap = 'WannaSwap', StellaSwap = 'StellaSwap', BeamSwap = 'BeamSwap', + PADSwap = 'PADSwap', } export interface TradeComputed { diff --git a/packages/public-api/src/web.ts b/packages/public-api/src/web.ts index 457746203daf..4df090a27067 100644 --- a/packages/public-api/src/web.ts +++ b/packages/public-api/src/web.ts @@ -219,6 +219,7 @@ export enum TradeProvider { PANGOLIN = 14, BEAMSWAP = 15, STELLASWAP = 16, + PADSWAP = 17, } /** Supported language settings */ export enum LanguageOptions { diff --git a/packages/web3-constants/evm/token.json b/packages/web3-constants/evm/token.json index 7cb1d06eb30f..0052edb14b84 100644 --- a/packages/web3-constants/evm/token.json +++ b/packages/web3-constants/evm/token.json @@ -986,6 +986,48 @@ "Aurora_Testnet": "", "Moonbeam": "0x0e358838ce72d5e61e0018a2ffac4bec5f4c88d2" }, + "TOAD_ADDRESS": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "0x463e737d8f740395abf44f7aac2d9531d8d539e9", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "0x60781C2586D68229fde47564546784ab3fACA982", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Moonbeam": "0xF480f38C366dAaC4305dC484b2Ad7a496FF00CeA" + }, + "PAD_ADDRESS": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "0xc0888d80ee0abf84563168b3182650c0addeb6d5", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "0x60781C2586D68229fde47564546784ab3fACA982", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Moonbeam": "0x59193512877E2EC3bB27C178A8888Cfac62FB32D" + }, "ETHER_ADDRESS": { "Mainnet": "", "Ropsten": "", diff --git a/packages/web3-constants/evm/trader.json b/packages/web3-constants/evm/trader.json index b5d7cc11b84f..a81a195135b9 100644 --- a/packages/web3-constants/evm/trader.json +++ b/packages/web3-constants/evm/trader.json @@ -1237,5 +1237,89 @@ "Aurora": "", "Aurora_Testnet": "", "Moonbeam": "0x48a6ca3d52d0d0a6c53a83cc3c8688dd46ea4cb786b169ee959b95ad30f61643" + }, + "PADSWAP_ROUTER_ADDRESS": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "0x76437234D29f84D9A12820A137c6c6A719138C24", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Moonbeam": "0x40F1fEF0Fe68Fd10ff904070ee00a7769EE7fe34 " + }, + "PADSWAP_FACTORY_ADDRESS": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "0xB836017ACf10b8A7c6c6C9e99eFE0f5B0250FC45", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Moonbeam": "0x663a07a2648296f1A3C02EE86A126fE1407888E5" + }, + "PADSWAP_THEGRAPH": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Moonbeam": "" + }, + "PADSWAP_INIT_CODE_HASH": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "0x71e6e31358ee16b3d9300fae77629fc40a171f4cc53183576ba7ba5fb318c931", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Moonbeam": "0x3eb475f0bc063c4f457199bae925b27d909f4af70ef7db78ba734972fc1a8543" } } From d3f1475f36f9a18619083adcbb39152b9b10ad5f Mon Sep 17 00:00:00 2001 From: codingsh Date: Wed, 9 Mar 2022 11:51:49 +0000 Subject: [PATCH 05/24] chore(moonbeam): add brand image --- .../mask/src/plugins/EVM/assets/moonbeam.png | Bin 0 -> 25740 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 packages/mask/src/plugins/EVM/assets/moonbeam.png diff --git a/packages/mask/src/plugins/EVM/assets/moonbeam.png b/packages/mask/src/plugins/EVM/assets/moonbeam.png new file mode 100644 index 0000000000000000000000000000000000000000..360d69ba76924b316f6c5e9865a5a499c5c69560 GIT binary patch literal 25740 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 d>;C&N~VCO@5ng;iTp^~j%@l7(jdl`$y}IS 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 P00000NkvXXu0mjfqb)9< literal 0 HcmV?d00001 From 90006f95f326cf494edb71c0f6b00762f99a9eec Mon Sep 17 00:00:00 2001 From: codingsh Date: Wed, 6 Apr 2022 12:02:14 +0000 Subject: [PATCH 06/24] chore(moonbeam): add contracts address --- packages/web3-constants/evm/ethereum.json | 4 ++-- packages/web3-constants/evm/ito.json | 6 +++--- packages/web3-constants/evm/nft-red-packet.json | 4 ++-- packages/web3-constants/evm/red-packet.json | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/web3-constants/evm/ethereum.json b/packages/web3-constants/evm/ethereum.json index 38dcf1b7ef1f..08a7c3ce97f7 100644 --- a/packages/web3-constants/evm/ethereum.json +++ b/packages/web3-constants/evm/ethereum.json @@ -19,7 +19,7 @@ "Aurora": "0xC119574D5Fb333F5AC018658D4d8b5035E16bf39", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "" + "Moonbeam": "0xC119574D5Fb333F5AC018658D4d8b5035E16bf39" }, "MULTICALL_ADDRESS": { "Mainnet": "0x1F98415757620B543A52E61c46B32eB19261F984", @@ -41,7 +41,7 @@ "Aurora": "0x6cc1b1058F9153358278C35E0b2D382f1585854B", "Aurora_Testnet": "", "Conflux": "0x19f179d7e0d7d9f9d5386afff64271d98a91615b", - "Moonbeam": "0xcA11bde05977b3631167028862bE2a173976CA11" + "Moonbeam": "0x6cc1b1058F9153358278C35E0b2D382f1585854B" }, "ENS_REGISTRAR_ADDRESS": { "Mainnet": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", diff --git a/packages/web3-constants/evm/ito.json b/packages/web3-constants/evm/ito.json index 0252efd92079..bbe98567bc46 100644 --- a/packages/web3-constants/evm/ito.json +++ b/packages/web3-constants/evm/ito.json @@ -63,7 +63,7 @@ "Aurora": "0x2cf91AD8C175305EBe6970Bd8f81231585EFbd77", "Aurora_Testnet": "0xdcA6F476EebCDE8FE8b072e3fC80dBC28dC209b3", "Conflux": "0x066804d9123bf2609ed4a4a40b1177a9c5a9ed51", - "Moonbeam": "" + "Moonbeam": "0x981be454a930479d92C91a0092D204b64845A5D6" }, "ITO2_CONTRACT_CREATION_BLOCK_HEIGHT": { "Mainnet": 12766513, @@ -85,7 +85,7 @@ "Aurora": 57350598, "Aurora_Testnet": 77919102, "Conflux": 37722805, - "Moonbeam": 0 + "Moonbeam": 1314566 }, "DEFAULT_QUALIFICATION_ADDRESS": { "Mainnet": "0x81b6ae377e360dcad63611846a2516f4ba8c88ac", @@ -129,7 +129,7 @@ "Aurora": "0x578a7Fee5f0D8CEc7d00578Bf37374C5b95C4b98", "Aurora_Testnet": "", "Conflux": "0x05ee315e407c21a594f807d61d6cc11306d1f149", - "Moonbeam": "" + "Moonbeam": "0x83D6b366f21e413f214EB077D5378478e71a5eD2" }, "SUBGRAPH_URL": { "Mainnet": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-ito-mainnet", diff --git a/packages/web3-constants/evm/nft-red-packet.json b/packages/web3-constants/evm/nft-red-packet.json index 8b327f6a7c9c..83b86de54892 100644 --- a/packages/web3-constants/evm/nft-red-packet.json +++ b/packages/web3-constants/evm/nft-red-packet.json @@ -19,7 +19,7 @@ "Aurora": "0x05ee315E407C21a594f807D61d6CC11306D1F149", "Aurora_Testnet": "0x97369fEE7db34E0BfE47861f2ec44b4378d13eB4", "Conflux": "0x5b966f3a32db9c180843bcb40267a66b73e4f022", - "Moonbeam": "" + "Moonbeam": "0xF9F7C1496c21bC0180f4B64daBE0754ebFc8A8c0" }, "SUBGRAPH_URL": { "Mainnet": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-nft-red-packet-mainnet", @@ -41,6 +41,6 @@ "Aurora": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-nft-red-packet-aurora", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "" + "Moonbeam": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-nft-red-packet-moonbeam" } } diff --git a/packages/web3-constants/evm/red-packet.json b/packages/web3-constants/evm/red-packet.json index 00645d0adb3f..0dc5d1e78d74 100644 --- a/packages/web3-constants/evm/red-packet.json +++ b/packages/web3-constants/evm/red-packet.json @@ -85,7 +85,7 @@ "Aurora": "0x19f179D7e0D7d9F9d5386afFF64271D98A91615B", "Aurora_Testnet": "0xdB93cCd481012bB5D1E2c8d0aF7C5f2940c00fdC", "Conflux": "0x96c7d011cdfd467f551605f0f5fce279f86f4186", - "Moonbeam": "" + "Moonbeam": "0x578a7Fee5f0D8CEc7d00578Bf37374C5b95C4b98" }, "HAPPY_RED_PACKET_ADDRESS_V4_BLOCK_HEIGHT": { "Mainnet": 12939427, @@ -107,7 +107,7 @@ "Aurora": 57552338, "Aurora_Testnet": 77918765, "Conflux": 37670572, - "Moonbeam": 0 + "Moonbeam": 1314596 }, "SUBGRAPH_URL": { "Mainnet": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-red-packet-mainnet", From d3494cdaa3671d5f798132450a4e685397249628 Mon Sep 17 00:00:00 2001 From: codingsh Date: Thu, 7 Apr 2022 13:53:46 +0200 Subject: [PATCH 07/24] Update packages/web3-constants/evm/explorer.json Co-authored-by: guanbinrui <52657989+guanbinrui@users.noreply.github.com> --- packages/web3-constants/evm/explorer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web3-constants/evm/explorer.json b/packages/web3-constants/evm/explorer.json index cfc555c4cbac..c4a51af56945 100644 --- a/packages/web3-constants/evm/explorer.json +++ b/packages/web3-constants/evm/explorer.json @@ -41,6 +41,6 @@ "Aurora": "https://explorer.mainnet.aurora.dev/api", "Aurora_Testnet": "https://explorer.testnet.aurora.dev/api", "Conflux": "", - "Moonbeam": "https://api-moonbeam.moonscan.io/api?" + "Moonbeam": "https://api-moonbeam.moonscan.io/api" } } From aa69fa13a80d9fad274241480e9359e420522f60 Mon Sep 17 00:00:00 2001 From: codingsh Date: Fri, 22 Apr 2022 16:49:39 +0000 Subject: [PATCH 08/24] chore(moonbeam): add pr url on docs --- docs/evm-integration.md | 4 ++-- packages/mask/src/plugins/FindTruman/base.ts | 1 + packages/mask/src/plugins/Savings/base.ts | 1 + packages/web3-constants/evm/rpc.json | 2 +- packages/web3-shared/evm/constants/tokens.ts | 1 + packages/web3-shared/evm/utils/chainDetailed.ts | 1 + 6 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/evm-integration.md b/docs/evm-integration.md index 0eb6e57a3fa5..07e448a88782 100644 --- a/docs/evm-integration.md +++ b/docs/evm-integration.md @@ -113,10 +113,10 @@ Here is the chain abilities checklist. If you are working on a bounty task, plea ## Examples | Chain | Pull Request Link | -| --------- | ---------------------------------------------------- | +| --------- | ---------------------------------------------------- | --- | | CELO | | | Fantom | | | xDai | | | Arbitrum | | | Avalanche | | -| Moonbeam | <#> | +| Moonbeam | | | diff --git a/packages/mask/src/plugins/FindTruman/base.ts b/packages/mask/src/plugins/FindTruman/base.ts index b5b340c83f6d..394427d0af5d 100644 --- a/packages/mask/src/plugins/FindTruman/base.ts +++ b/packages/mask/src/plugins/FindTruman/base.ts @@ -26,6 +26,7 @@ export const base: Plugin.Shared.Definition = { ChainId.Avalanche, ChainId.Aurora, ChainId.Conflux, + ChainId.Moonbeam, ], }, [NetworkPluginID.PLUGIN_FLOW]: { supportedChainIds: [] }, diff --git a/packages/mask/src/plugins/Savings/base.ts b/packages/mask/src/plugins/Savings/base.ts index 5bf0aa30c04d..514b9f029447 100644 --- a/packages/mask/src/plugins/Savings/base.ts +++ b/packages/mask/src/plugins/Savings/base.ts @@ -28,6 +28,7 @@ export const base: Plugin.Shared.Definition = { ChainId.Aurora, ChainId.Avalanche, ChainId.Fantom, + ChainId.Moonbeam, ], }, [NetworkPluginID.PLUGIN_FLOW]: { supportedChainIds: [] }, diff --git a/packages/web3-constants/evm/rpc.json b/packages/web3-constants/evm/rpc.json index 9cf58dd1f233..aa36b58a62ce 100644 --- a/packages/web3-constants/evm/rpc.json +++ b/packages/web3-constants/evm/rpc.json @@ -61,7 +61,7 @@ "Aurora": ["https://mainnet.aurora.dev"], "Aurora_Testnet": ["https://testnet.aurora.dev"], "Conflux": ["https://evm.confluxrpc.com"], - "Moonbeam": ["https://testnet.aurora.dev"] + "Moonbeam": ["https://rpc.api.moonbeam.network", "wss://wss.api.moonbeam.network"] }, "RPC_WEIGHTS": { "Mainnet": [0, 1, 2, 3, 4], diff --git a/packages/web3-shared/evm/constants/tokens.ts b/packages/web3-shared/evm/constants/tokens.ts index 3c3ef562f3ec..45ff871cf965 100644 --- a/packages/web3-shared/evm/constants/tokens.ts +++ b/packages/web3-shared/evm/constants/tokens.ts @@ -75,4 +75,5 @@ export const WNATIVE_ONLY: ERC20AgainstToken = { [ChainId.Fantom]: [WNATIVE[ChainId.Fantom]], [ChainId.Aurora]: [WNATIVE[ChainId.Aurora]], [ChainId.Aurora_Testnet]: [WNATIVE[ChainId.Aurora_Testnet]], + [ChainId.Moonbeam]: [WNATIVE[ChainId.Moonbeam]], } diff --git a/packages/web3-shared/evm/utils/chainDetailed.ts b/packages/web3-shared/evm/utils/chainDetailed.ts index 80f1f4abe6a6..a550d00242bf 100644 --- a/packages/web3-shared/evm/utils/chainDetailed.ts +++ b/packages/web3-shared/evm/utils/chainDetailed.ts @@ -96,6 +96,7 @@ export const getChainIdFromNetworkType = createLookupTableResolver Date: Fri, 22 Apr 2022 19:32:21 +0200 Subject: [PATCH 09/24] chore(moonbeam): add multicall address --- packages/web3-constants/evm/ethereum.json | 10 +- packages/web3-constants/evm/lido.json | 6 +- packages/web3-constants/evm/token.json | 165 ++++++++++++++-------- 3 files changed, 119 insertions(+), 62 deletions(-) diff --git a/packages/web3-constants/evm/ethereum.json b/packages/web3-constants/evm/ethereum.json index 08a7c3ce97f7..9c76055034db 100644 --- a/packages/web3-constants/evm/ethereum.json +++ b/packages/web3-constants/evm/ethereum.json @@ -28,20 +28,20 @@ "Kovan": "0x1F98415757620B543A52E61c46B32eB19261F984", "Gorli": "0x1F98415757620B543A52E61c46B32eB19261F984", "BSC": "0x5211fe40fE49a13CC86E3bC77855152457eDE585", - "BSCT": "", + "BSCT": "0xcA11bde05977b3631167028862bE2a173976CA11", "Matic": "0x54c06a5D7C6447BE47E07390eD7da7e6994585f4", - "Mumbai": "", + "Mumbai": "0xcA11bde05977b3631167028862bE2a173976CA11", "Arbitrum": "0xadF885960B47eA2CD9B55E6DAc6B42b7Cb2806dB", "Arbitrum_Rinkeby": "0xa501c031958F579dB7676fF1CE78AD305794d579", "xDai": "0xAb7B1bE4233A04e5C43a810E75657ECED8E5463B", "Avalanche": "0x6cc1b1058F9153358278C35E0b2D382f1585854B", - "Avalanche_Fuji": "", + "Avalanche_Fuji": "0xcA11bde05977b3631167028862bE2a173976CA11", "Celo": "0x072453AdEC16cFC7FB6Af1517c3f25407180cccC", "Fantom": "0x913975af2Bb8a6Be4100D7dc5e9765B77F6A5d6c", "Aurora": "0x6cc1b1058F9153358278C35E0b2D382f1585854B", - "Aurora_Testnet": "", + "Aurora_Testnet": "0xcA11bde05977b3631167028862bE2a173976CA11", "Conflux": "0x19f179d7e0d7d9f9d5386afff64271d98a91615b", - "Moonbeam": "0x6cc1b1058F9153358278C35E0b2D382f1585854B" + "Moonbeam": "0xcA11bde05977b3631167028862bE2a173976CA11" }, "ENS_REGISTRAR_ADDRESS": { "Mainnet": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", diff --git a/packages/web3-constants/evm/lido.json b/packages/web3-constants/evm/lido.json index 0a3c06476274..dd98946c0c97 100644 --- a/packages/web3-constants/evm/lido.json +++ b/packages/web3-constants/evm/lido.json @@ -18,7 +18,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "LIDO_REFERRAL_ADDRESS": { "Mainnet": "0x934b510d4c9103e6a87aef13b816fb080286d649", @@ -39,6 +40,7 @@ "Fantom": "0x934b510d4c9103e6a87aef13b816fb080286d649", "Aurora": "0x934b510d4c9103e6a87aef13b816fb080286d649", "Aurora_Testnet": "0x934b510d4c9103e6a87aef13b816fb080286d649", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/token.json b/packages/web3-constants/evm/token.json index c63e4450d444..25c709f072f0 100644 --- a/packages/web3-constants/evm/token.json +++ b/packages/web3-constants/evm/token.json @@ -40,7 +40,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "USDC_ADDRESS": { "Mainnet": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", @@ -105,7 +106,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "HUSD_ADDRESS": { "Mainnet": "0xdf574c24545e5ffecb9a659c229253d4111d87e1", @@ -1182,7 +1184,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aWETH_ADDRESS": { "Mainnet": "0x030bA81f1c18d280636F32af80b9AAd02Cf0854e", @@ -1203,7 +1206,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "ZRX_ADDRESS": { "Mainnet": "0xE41d2489571d322189246DaFA5ebDe1F4699F498", @@ -1224,7 +1228,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aZRX_ADDRESS": { "Mainnet": "0xDf7FF54aAcAcbFf42dfe29DD6144A69b629f8C9e", @@ -1245,7 +1250,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "UNI_ADDRESS": { "Mainnet": "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984", @@ -1266,7 +1272,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aUNI_ADDRESS": { "Mainnet": "0xB9D7CB55f463405CDfBe4E90a6D2Df01C2B92BF1", @@ -1287,7 +1294,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "LIDO_ADDRESS": { "Mainnet": "0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32", @@ -1308,7 +1316,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "AAVE_ADDRESS": { "Mainnet": "0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9", @@ -1329,7 +1338,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aAAVE_ADDRESS": { "Mainnet": "0xFFC97d72E13E01096502Cb8Eb52dEe56f74DAD7B", @@ -1350,7 +1360,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "BAT_ADDRESS": { "Mainnet": "0x0D8775F648430679A709E98d2b0Cb6250d2887EF", @@ -1371,7 +1382,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aBAT_ADDRESS": { "Mainnet": "0x05Ec93c0365baAeAbF7AefFb0972ea7ECdD39CF1", @@ -1392,7 +1404,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "ENJ_ADDRESS": { "Mainnet": "0xF629cBd94d3791C9250152BD8dfBDF380E2a3B9c", @@ -1413,7 +1426,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aENJ_ADDRESS": { "Mainnet": "0xaC6Df26a590F08dcC95D5a4705ae8abbc88509Ef", @@ -1434,7 +1448,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "KNC_ADDRESS": { "Mainnet": "0xdd974D5C2e2928deA5F71b9825b8b646686BD200", @@ -1455,7 +1470,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aKNC_ADDRESS": { "Mainnet": "0x39C6b3e42d6A679d7D776778Fe880BC9487C2EDA", @@ -1476,7 +1492,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "LINK_ADDRESS": { "Mainnet": "0x514910771AF9Ca656af840dff83E8264EcF986CA", @@ -1497,7 +1514,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aLINK_ADDRESS": { "Mainnet": "0xa06bC25B5805d5F8d82847D191Cb4Af5A3e873E0", @@ -1518,7 +1536,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "MANA_ADDRESS": { "Mainnet": "0x0F5D2fB29fb7d3CFeE444a200298f468908cC942", @@ -1539,7 +1558,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aMANA_ADDRESS": { "Mainnet": "0xa685a61171bb30d4072B338c80Cb7b2c865c873E", @@ -1560,7 +1580,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "REN_ADDRESS": { "Mainnet": "0x408e41876cCCDC0F92210600ef50372656052a38", @@ -1581,7 +1602,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aREN_ADDRESS": { "Mainnet": "0xCC12AbE4ff81c9378D670De1b57F8e0Dd228D77a", @@ -1602,7 +1624,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "SNX_ADDRESS": { "Mainnet": "0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F", @@ -1623,7 +1646,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aSNX_ADDRESS": { "Mainnet": "0x35f6B052C598d933D69A4EEC4D04c73A191fE6c2", @@ -1644,7 +1668,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "TUSD_ADDRESS": { "Mainnet": "0x0000000000085d4780B73119b644AE5ecd22b376", @@ -1665,7 +1690,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aTUSD_ADDRESS": { "Mainnet": "0x101cc05f4A51C0319f570d5E146a8C625198e636", @@ -1686,7 +1712,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "CRV_ADDRESS": { "Mainnet": "0xD533a949740bb3306d119CC777fa900bA034cd52", @@ -1707,7 +1734,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aCRV_ADDRESS": { "Mainnet": "0x8dAE6Cb04688C62d939ed9B68d32Bc62e49970b1", @@ -1728,7 +1756,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "GUSD_ADDRESS": { "Mainnet": "0x056Fd409E1d7A124BD7017459dFEa2F387b6d5Cd", @@ -1749,7 +1778,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aGUSD_ADDRESS": { "Mainnet": "0xD37EE7e4f452C6638c96536e68090De8cBcdb583", @@ -1770,7 +1800,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "BAL_ADDRESS": { "Mainnet": "0xba100000625a3754423978a60c9317c58a424e3D", @@ -1791,7 +1822,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aBAL_ADDRESS": { "Mainnet": "0x272F97b7a56a387aE942350bBC7Df5700f8a4576", @@ -1812,7 +1844,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "xSUSHI_ADDRESS": { "Mainnet": "0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272", @@ -1833,7 +1866,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aXSUSHI_ADDRESS": { "Mainnet": "0xF256CC7847E919FAc9B808cC216cAc87CCF2f47a", @@ -1854,7 +1888,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "renFIL_ADDRESS": { "Mainnet": "0xD5147bc8e386d91Cc5DBE72099DAC6C9b99276F5", @@ -1875,7 +1910,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aRENFIL_ADDRESS": { "Mainnet": "0x514cd6756CCBe28772d4Cb81bC3156BA9d1744aa", @@ -1896,7 +1932,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "RAI_ADDRESS": { "Mainnet": "0x03ab458634910AaD20eF5f1C8ee96F1D6ac54919", @@ -1917,7 +1954,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aRAI_ADDRESS": { "Mainnet": "0xc9BC48c72154ef3e5425641a3c747242112a46AF", @@ -1938,7 +1976,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "USDP_ADDRESS": { "Mainnet": "0x8E870D67F660D95d5be530380D0eC0bd388289E1", @@ -1959,7 +1998,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aUSDP_ADDRESS": { "Mainnet": "0x2e8F4bdbE3d47d7d7DE490437AeA9915D930F1A3", @@ -1980,7 +2020,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "DPI_ADDRESS": { "Mainnet": "0x1494CA1F11D487c2bBe4543E90080AeBa4BA3C2b", @@ -2001,7 +2042,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aDPI_ADDRESS": { "Mainnet": "0x6F634c6135D2EBD550000ac92F494F9CB8183dAe", @@ -2022,7 +2064,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "FRAX_ADDRESS": { "Mainnet": "0x853d955aCEf822Db058eb8505911ED77F175b99e", @@ -2043,7 +2086,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aFRAX_ADDRESS": { "Mainnet": "0xd4937682df3C8aEF4FE912A96A74121C0829E664", @@ -2064,7 +2108,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "FEI_ADDRESS": { "Mainnet": "0x956F47F50A910163D8BF957Cf5846D573E7f87CA", @@ -2085,7 +2130,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aFEI_ADDRESS": { "Mainnet": "0x683923dB55Fead99A79Fa01A27EeC3cB19679cC3", @@ -2106,7 +2152,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aWBTC_ADDRESS": { "Mainnet": "0x9ff58f4fFB29fA2266Ab25e75e2A8b3503311656", @@ -2127,7 +2174,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aYFI_ADDRESS": { "Mainnet": "0x5165d24277cD063F5ac44Efd447B27025e888f37", @@ -2148,7 +2196,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aBUSD_ADDRESS": { "Mainnet": "0xA361718326c15715591c299427c62086F69923D9", @@ -2169,7 +2218,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aDAI_ADDRESS": { "Mainnet": "0x028171bCA77440897B824Ca71D1c56caC55b68A3", @@ -2190,7 +2240,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aMKR_ADDRESS": { "Mainnet": "0xc713e5E149D5D0715DcD1c156a020976e7E56B88", @@ -2211,7 +2262,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aSUSD_ADDRESS": { "Mainnet": "0x6C5024Cd4F8A59110119C56f8933403A539555EB", @@ -2232,7 +2284,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aUSDC_ADDRESS": { "Mainnet": "0xBcca60bB61934080951369a648Fb03DF4F96263C", @@ -2253,7 +2306,8 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "" + "Conflux": "", + "Moonbeam": "" }, "aAMPL_ADDRESS": { "Mainnet": "0x1E6bb68Acec8fefBD87D192bE09bb274170a0548", @@ -2274,6 +2328,7 @@ "Fantom": "", "Aurora": "", "Aurora_Testnet": "", - "Conflux": "0x0000000000000000000000000000000000000000" + "Conflux": "0x0000000000000000000000000000000000000000", + "Moonbeam": "" } } From 3fa8ceecbdf9db47399bd89379ad03cb9e0ef244 Mon Sep 17 00:00:00 2001 From: codingsh Date: Fri, 22 Apr 2022 19:47:32 +0200 Subject: [PATCH 10/24] chore(moonbeam): update token address --- packages/web3-constants/evm/token.json | 10 +++++----- packages/web3-shared/evm/assets/chains.json | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/web3-constants/evm/token.json b/packages/web3-constants/evm/token.json index 25c709f072f0..f1c761749718 100644 --- a/packages/web3-constants/evm/token.json +++ b/packages/web3-constants/evm/token.json @@ -63,7 +63,7 @@ "Aurora": "0xb12bfca5a55806aaf64e99521918a4bf0fc40802", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "" + "Moonbeam": "0x818ec0A7Fe18Ff94269904fCED6AE3DaE6d6dC0b" }, "USDT_ADDRESS": { "Mainnet": "0xdAC17F958D2ee523a2206206994597C13D831ec7", @@ -85,7 +85,7 @@ "Aurora": "0x4988a896b1227218e4a686fde5eabdcabd91571f", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "" + "Moonbeam": "0xeFAeeE334F0Fd1712f9a8cc375f427D9Cdd40d73" }, "aUSDT_ADDRESS": { "Mainnet": "0x71fc860F7D3A592A4a98740e39dB31d25db65ae8", @@ -151,7 +151,7 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "" + "Moonbeam": "0xA649325Aa7C5093d12D6F98EB4378deAe68CE23F" }, "COMP_ADDRESS": { "Mainnet": "0xc00e94Cb662C3520282E6f5717214004A7f26888", @@ -371,7 +371,7 @@ "Aurora": "0xe3520349f477a5f6eb06107066048508498a291b", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "" + "Moonbeam": "0xc234A67a4F840E61adE794be47de455361b52413" }, "AMPL_ADDRESS": { "Mainnet": "0xD46bA6D942050d489DBd938a2C909A5d5039A161", @@ -657,7 +657,7 @@ "Aurora": "0xf4eb217ba2454613b15dbdea6e5f22276410e89e", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "" + "Moonbeam": "0x1DC78Acda13a8BC4408B207c9E48CDBc096D95e0" }, "IGG_ADDRESS": { "Mainnet": "", diff --git a/packages/web3-shared/evm/assets/chains.json b/packages/web3-shared/evm/assets/chains.json index 38db5b871bbd..ba82e0be1776 100644 --- a/packages/web3-shared/evm/assets/chains.json +++ b/packages/web3-shared/evm/assets/chains.json @@ -1609,8 +1609,8 @@ }, { "name": "Moonbeam Polkadot", - "chain": "moonbeam", - "network": "moonbeam", + "chain": "Moonbeam", + "network": "mainnet", "rpc": [], "faucets": [], "features": [], From 41b05806f2a7e251f67a1a791ae85bda565dd33a Mon Sep 17 00:00:00 2001 From: codingsh Date: Fri, 22 Apr 2022 20:41:18 +0200 Subject: [PATCH 11/24] chore(moonbeam): add EIP1559 feature on moonbeam network --- packages/web3-constants/evm/rpc.json | 2 +- packages/web3-shared/evm/assets/chains.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/web3-constants/evm/rpc.json b/packages/web3-constants/evm/rpc.json index aa36b58a62ce..8a0d48f99f22 100644 --- a/packages/web3-constants/evm/rpc.json +++ b/packages/web3-constants/evm/rpc.json @@ -61,7 +61,7 @@ "Aurora": ["https://mainnet.aurora.dev"], "Aurora_Testnet": ["https://testnet.aurora.dev"], "Conflux": ["https://evm.confluxrpc.com"], - "Moonbeam": ["https://rpc.api.moonbeam.network", "wss://wss.api.moonbeam.network"] + "Moonbeam": ["https://rpc.api.moonbeam.network"] }, "RPC_WEIGHTS": { "Mainnet": [0, 1, 2, 3, 4], diff --git a/packages/web3-shared/evm/assets/chains.json b/packages/web3-shared/evm/assets/chains.json index ba82e0be1776..3284b81e881f 100644 --- a/packages/web3-shared/evm/assets/chains.json +++ b/packages/web3-shared/evm/assets/chains.json @@ -1611,12 +1611,12 @@ "name": "Moonbeam Polkadot", "chain": "Moonbeam", "network": "mainnet", - "rpc": [], + "rpc": ["https://rpc.api.moonbeam.network"], "faucets": [], - "features": [], + "features": ["EIP1559"], "nativeCurrency": { "name": "Glimmer", "symbol": "GLMR", "decimals": 18 }, "infoURL": "https://moonbeam.network/networks/moonbeam/", - "shortName": "mbeam", + "shortName": "mobm", "chainId": 1284, "networkId": 1284 }, From f3fee324fa25c5dad47c8f21b58c565463a35e3b Mon Sep 17 00:00:00 2001 From: codingsh Date: Fri, 22 Apr 2022 22:38:02 +0200 Subject: [PATCH 12/24] feat(moonbeam): add solflare and zenlink dex --- cspell.json | 2 + .../src/plugins/Trader/apis/trader/index.ts | 9 +- .../src/plugins/Trader/constants/index.ts | 2 + .../src/plugins/Trader/constants/solflare.ts | 13 ++ .../src/plugins/Trader/constants/zenlink.ts | 13 ++ packages/mask/src/plugins/Trader/pipes.ts | 2 + .../Trader/trader/useAllTradeComputed.ts | 16 ++ .../Trader/trader/useGetTradeContext.ts | 30 +++ .../plugins/Trader/trader/useTradeCallback.ts | 4 + .../mask/src/plugins/Trader/types/trader.ts | 2 + packages/public-api/src/web.ts | 2 + packages/web3-constants/evm/token.json | 44 +++++ packages/web3-constants/evm/trader.json | 176 ++++++++++++++++++ packages/web3-shared/evm/constants/tokens.ts | 2 + 14 files changed, 316 insertions(+), 1 deletion(-) create mode 100644 packages/mask/src/plugins/Trader/constants/solflare.ts create mode 100644 packages/mask/src/plugins/Trader/constants/zenlink.ts diff --git a/cspell.json b/cspell.json index 7adb99637095..df3aea88965e 100644 --- a/cspell.json +++ b/cspell.json @@ -223,6 +223,7 @@ "signup", "sint", "solana", + "solflare", "sollet", "steelblue", "steganographic", @@ -276,6 +277,7 @@ "xdai", "xlarge", "xlink", + "zenlink", "zerion", "zora", "zubin" diff --git a/packages/mask/src/plugins/Trader/apis/trader/index.ts b/packages/mask/src/plugins/Trader/apis/trader/index.ts index ee060d1413c8..520102d613d3 100644 --- a/packages/mask/src/plugins/Trader/apis/trader/index.ts +++ b/packages/mask/src/plugins/Trader/apis/trader/index.ts @@ -54,7 +54,14 @@ export async function getAvailableTraderProviders(chainId: ChainId) { case NetworkType.Aurora: return [TradeProvider.DODO, TradeProvider.WANNASWAP, TradeProvider.TRISOLARIS] case NetworkType.Moonbeam: - return [TradeProvider.SUSHISWAP, TradeProvider.BEAMSWAP, TradeProvider.STELLASWAP, TradeProvider.PADSWAP] + return [ + TradeProvider.SUSHISWAP, + TradeProvider.BEAMSWAP, + TradeProvider.STELLASWAP, + TradeProvider.PADSWAP, + TradeProvider.ZENLINK, + TradeProvider.SOLFLARE, + ] case NetworkType.Boba: case NetworkType.Fuse: case NetworkType.Metis: diff --git a/packages/mask/src/plugins/Trader/constants/index.ts b/packages/mask/src/plugins/Trader/constants/index.ts index e16f92031599..74310903f32e 100644 --- a/packages/mask/src/plugins/Trader/constants/index.ts +++ b/packages/mask/src/plugins/Trader/constants/index.ts @@ -17,4 +17,6 @@ export * from './beamswap' export * from './stellaswap' export * from './padswap' export * from './mdex' +export * from './zenlink' +export * from './solflare' export type { ERC20TokenCustomizedBase, ERC20AgainstToken } from './types' diff --git a/packages/mask/src/plugins/Trader/constants/solflare.ts b/packages/mask/src/plugins/Trader/constants/solflare.ts new file mode 100644 index 000000000000..fb2a32227963 --- /dev/null +++ b/packages/mask/src/plugins/Trader/constants/solflare.ts @@ -0,0 +1,13 @@ +import { DAI, USDC, USDT, WBTC, FLARE, WNATIVE, WNATIVE_ONLY, ChainId } from '@masknet/web3-shared-evm' +import type { ERC20AgainstToken, ERC20TokenCustomizedBase } from './types' + +/** + * Some tokens can only be swapped via certain pairs, + * so we override the list of bases that are considered for these tokens. + */ +export const SOLFLARE_CUSTOM_BASES: ERC20TokenCustomizedBase = {} + +export const SOLFLARE_BASE_AGAINST_TOKENS: ERC20AgainstToken = { + ...WNATIVE_ONLY, + [ChainId.Moonbeam]: [WNATIVE, DAI, FLARE, USDT, USDC, WBTC].map((x) => x[ChainId.Moonbeam]), +} diff --git a/packages/mask/src/plugins/Trader/constants/zenlink.ts b/packages/mask/src/plugins/Trader/constants/zenlink.ts new file mode 100644 index 000000000000..b1e960176ca2 --- /dev/null +++ b/packages/mask/src/plugins/Trader/constants/zenlink.ts @@ -0,0 +1,13 @@ +import { DAI, USDC, USDT, WBTC, ZLK, WNATIVE, WNATIVE_ONLY, ChainId } from '@masknet/web3-shared-evm' +import type { ERC20AgainstToken, ERC20TokenCustomizedBase } from './types' + +/** + * Some tokens can only be swapped via certain pairs, + * so we override the list of bases that are considered for these tokens. + */ +export const ZENLINK_CUSTOM_BASES: ERC20TokenCustomizedBase = {} + +export const ZENLINK_BASE_AGAINST_TOKENS: ERC20AgainstToken = { + ...WNATIVE_ONLY, + [ChainId.Moonbeam]: [WNATIVE, DAI, ZLK, USDT, USDC, WBTC].map((x) => x[ChainId.Moonbeam]), +} diff --git a/packages/mask/src/plugins/Trader/pipes.ts b/packages/mask/src/plugins/Trader/pipes.ts index c2a9c33c532d..df6d2ccc2b97 100644 --- a/packages/mask/src/plugins/Trader/pipes.ts +++ b/packages/mask/src/plugins/Trader/pipes.ts @@ -44,6 +44,8 @@ export const resolveTradeProviderName = createLookupTableResolver { throw new Error(`Unknown provider type: ${tradeProvider}`) diff --git a/packages/mask/src/plugins/Trader/trader/useAllTradeComputed.ts b/packages/mask/src/plugins/Trader/trader/useAllTradeComputed.ts index d945fbc42fe4..80e817f6da29 100644 --- a/packages/mask/src/plugins/Trader/trader/useAllTradeComputed.ts +++ b/packages/mask/src/plugins/Trader/trader/useAllTradeComputed.ts @@ -227,6 +227,20 @@ export function useAllTradeComputed( traderEstimateGas: padswapEstimateGas, } = useUniswapV2Like(tradeProviders, TradeProvider.PADSWAP, inputAmount_, inputToken, outputToken) + // SolFlare + const { + trader_: solflare_, + trader: solflare, + traderEstimateGas: solflareEstimateGas, + } = useUniswapV2Like(tradeProviders, TradeProvider.SOLFLARE, inputAmount_, inputToken, outputToken) + + // ZenLink + const { + trader_: zenlink_, + trader: zenlink, + traderEstimateGas: zenlinkEstimateGas, + } = useUniswapV2Like(tradeProviders, TradeProvider.ZENLINK, inputAmount_, inputToken, outputToken) + const allTradeResult = [ { provider: TradeProvider.UNISWAP_V2, ...uniswapV2_, value: uniswapV2, gas: uniswapV2EstimateGas }, { provider: TradeProvider.SUSHISWAP, ...sushiSwap_, value: sushiSwap, gas: sushiSwapEstimateGas }, @@ -247,6 +261,8 @@ export function useAllTradeComputed( { provider: TradeProvider.BEAMSWAP, ...beamswap_, value: beamswap, gas: beamswapEstimateGas }, { provider: TradeProvider.PADSWAP, ...padswap_, value: padswap, gas: padswapEstimateGas }, { provider: TradeProvider.MDEX, ...mdex_, value: mdex, gas: mdexEstimateGas }, + { provider: TradeProvider.SOLFLARE, ...solflare_, value: solflare, gas: solflareEstimateGas }, + { provider: TradeProvider.ZENLINK, ...zenlink_, value: zenlink, gas: zenlinkEstimateGas }, ] return nativeToken_.value diff --git a/packages/mask/src/plugins/Trader/trader/useGetTradeContext.ts b/packages/mask/src/plugins/Trader/trader/useGetTradeContext.ts index f4b9bf2cd4e2..2808eb8c9dd2 100644 --- a/packages/mask/src/plugins/Trader/trader/useGetTradeContext.ts +++ b/packages/mask/src/plugins/Trader/trader/useGetTradeContext.ts @@ -29,6 +29,10 @@ import { PADSWAP_CUSTOM_BASES, MDEX_BASE_AGAINST_TOKENS, MDEX_CUSTOM_BASES, + SOLFLARE_BASE_AGAINST_TOKENS, + SOLFLARE_CUSTOM_BASES, + ZENLINK_BASE_AGAINST_TOKENS, + ZENLINK_CUSTOM_BASES, } from '../constants' import { unreachable } from '@dimensiondev/kit' import { TargetChainIdContext } from './useTargetChainIdContext' @@ -217,6 +221,32 @@ export function useGetTradeContext(tradeProvider?: TradeProvider) { ADDITIONAL_TOKENS: {}, CUSTOM_TOKENS: MDEX_CUSTOM_BASES, } + case TradeProvider.SOLFLARE: + return { + TYPE: tradeProvider, + IS_UNISWAP_V2_LIKE: true, + GRAPH_API: DEX_TRADE.SOLFLARE_THEGRAPH, + INIT_CODE_HASH: DEX_TRADE.SOLFLARE_INIT_CODE_HASH, + ROUTER_CONTRACT_ADDRESS: DEX_TRADE.SOLFLARE_ROUTER_ADDRESS, + SPENDER_CONTRACT_ADDRESS: DEX_TRADE.SOLFLARE_ROUTER_ADDRESS, + FACTORY_CONTRACT_ADDRESS: DEX_TRADE.SOLFLARE_FACTORY_ADDRESS, + AGAINST_TOKENS: SOLFLARE_BASE_AGAINST_TOKENS, + ADDITIONAL_TOKENS: {}, + CUSTOM_TOKENS: SOLFLARE_CUSTOM_BASES, + } + case TradeProvider.ZENLINK: + return { + TYPE: tradeProvider, + IS_UNISWAP_V2_LIKE: true, + GRAPH_API: DEX_TRADE.ZENLINK_THEGRAPH, + INIT_CODE_HASH: DEX_TRADE.ZENLINK_INIT_CODE_HASH, + ROUTER_CONTRACT_ADDRESS: DEX_TRADE.ZENLINK_ROUTER_ADDRESS, + SPENDER_CONTRACT_ADDRESS: DEX_TRADE.ZENLINK_ROUTER_ADDRESS, + FACTORY_CONTRACT_ADDRESS: DEX_TRADE.ZENLINK_FACTORY_ADDRESS, + AGAINST_TOKENS: ZENLINK_BASE_AGAINST_TOKENS, + ADDITIONAL_TOKENS: {}, + CUSTOM_TOKENS: ZENLINK_CUSTOM_BASES, + } case TradeProvider.ZRX: return { TYPE: tradeProvider, diff --git a/packages/mask/src/plugins/Trader/trader/useTradeCallback.ts b/packages/mask/src/plugins/Trader/trader/useTradeCallback.ts index add20c429adf..46fd7bd411e3 100644 --- a/packages/mask/src/plugins/Trader/trader/useTradeCallback.ts +++ b/packages/mask/src/plugins/Trader/trader/useTradeCallback.ts @@ -122,6 +122,10 @@ export function useTradeCallback( return uniswapV2Like case TradeProvider.PADSWAP: return uniswapV2Like + case TradeProvider.SOLFLARE: + return uniswapV2Like + case TradeProvider.ZENLINK: + return uniswapV2Like default: if (provider) unreachable(provider) return [] diff --git a/packages/mask/src/plugins/Trader/types/trader.ts b/packages/mask/src/plugins/Trader/types/trader.ts index 2feb382e5430..ab257c28f3cf 100644 --- a/packages/mask/src/plugins/Trader/types/trader.ts +++ b/packages/mask/src/plugins/Trader/types/trader.ts @@ -79,6 +79,8 @@ export enum ZrxTradePool { BeamSwap = 'BeamSwap', PADSwap = 'PADSwap', Mdex = 'Mdex', + ZenLink = 'ZenLink', + SolFlare = 'SolFlare', } export interface TradeComputed { diff --git a/packages/public-api/src/web.ts b/packages/public-api/src/web.ts index 4712c9586916..f10dc14ca166 100644 --- a/packages/public-api/src/web.ts +++ b/packages/public-api/src/web.ts @@ -186,6 +186,8 @@ export enum TradeProvider { BEAMSWAP = 16, STELLASWAP = 17, PADSWAP = 18, + SOLFLARE = 19, + ZENLINK = 20, } /** Supported language settings */ diff --git a/packages/web3-constants/evm/token.json b/packages/web3-constants/evm/token.json index f1c761749718..1339c01eec97 100644 --- a/packages/web3-constants/evm/token.json +++ b/packages/web3-constants/evm/token.json @@ -2330,5 +2330,49 @@ "Aurora_Testnet": "", "Conflux": "0x0000000000000000000000000000000000000000", "Moonbeam": "" + }, + "ZLK_ADDRESS": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Conflux": "", + "Moonbeam": "" + }, + "FLARE_ADDRESS": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Conflux": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/trader.json b/packages/web3-constants/evm/trader.json index 04a5a687354b..d535d3b0a505 100644 --- a/packages/web3-constants/evm/trader.json +++ b/packages/web3-constants/evm/trader.json @@ -1472,5 +1472,181 @@ "Aurora_Testnet": "", "Conflux": "", "Moonbeam": "0x3eb475f0bc063c4f457199bae925b27d909f4af70ef7db78ba734972fc1a8543" + }, + "ZENLINK_ROUTER_ADDRESS": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Conflux": "", + "Moonbeam": "0x7a3909C7996EFE42d425cD932fc44E3840fCAB71" + }, + "ZENLINK_FACTORY_ADDRESS": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Conflux": "", + "Moonbeam": "0xf49255205dfd7933c4d0f25a57d40b1511f92fef" + }, + "ZENLINK_THEGRAPH": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Conflux": "", + "Moonbeam": "" + }, + "ZENLINK_INIT_CODE_HASH": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Conflux": "", + "Moonbeam": "0x7eba2084662eb5b00a4d7e2a74743051dc33bfe07fcbcd724b88b351a7078fda" + }, + "SOLFLARE_ROUTER_ADDRESS": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Conflux": "", + "Moonbeam": "0xd3b02ff30c218c7f7756ba14bca075bf7c2c951e" + }, + "SOLFLARE_FACTORY_ADDRESS": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Conflux": "", + "Moonbeam": "0x19b85ae92947e0725d5265ffb3389e7e4f191fda" + }, + "SOLFLARE_THEGRAPH": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Conflux": "", + "Moonbeam": "" + }, + "SOLFLARE_INIT_CODE_HASH": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Conflux": "", + "Moonbeam": "0xe21386787732ef8059a646602f85a5ebb23848cddd90ef5a8d111ec84a4cb71f " } } diff --git a/packages/web3-shared/evm/constants/tokens.ts b/packages/web3-shared/evm/constants/tokens.ts index 45ff871cf965..7976ae175bb5 100644 --- a/packages/web3-shared/evm/constants/tokens.ts +++ b/packages/web3-shared/evm/constants/tokens.ts @@ -48,6 +48,8 @@ export const PNG = createERC20Tokens('PNG_ADDRESS', 'Pangolin', 'PNG', 18) export const SHARE = createERC20Tokens('SHARE_ADDRESS', 'Beamshare Token', 'SHARE', 18) export const STELLA = createERC20Tokens('STELLA_ADDRESS', 'StellaSwap', 'STELLA', 18) export const PAD = createERC20Tokens('PAD_ADDRESS', 'Glmr Pad', 'PAD', 18) +export const FLARE = createERC20Tokens('FLARE_ADDRESS', 'Flare Token', 'FLARE', 18) +export const ZLK = createERC20Tokens('ZLK_ADDRESS', 'Zenlink Network Token ', 'ZLK', 18) export const WNATIVE = createERC20Tokens( 'WNATIVE_ADDRESS', From 29f26dde60f8de8d223e11a3d0150b564c8dab64 Mon Sep 17 00:00:00 2001 From: codingsh Date: Sun, 24 Apr 2022 14:01:05 +0200 Subject: [PATCH 13/24] chore(moonbeam): code review fixed chains and docs --- docs/evm-integration.md | 4 ++-- packages/web3-shared/evm/assets/chains.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/evm-integration.md b/docs/evm-integration.md index 07e448a88782..a7ad89bab0c7 100644 --- a/docs/evm-integration.md +++ b/docs/evm-integration.md @@ -113,10 +113,10 @@ Here is the chain abilities checklist. If you are working on a bounty task, plea ## Examples | Chain | Pull Request Link | -| --------- | ---------------------------------------------------- | --- | +| --------- | ---------------------------------------------------- | | CELO | | | Fantom | | | xDai | | | Arbitrum | | | Avalanche | | -| Moonbeam | | | +| Moonbeam | | diff --git a/packages/web3-shared/evm/assets/chains.json b/packages/web3-shared/evm/assets/chains.json index 3284b81e881f..08fa6a894691 100644 --- a/packages/web3-shared/evm/assets/chains.json +++ b/packages/web3-shared/evm/assets/chains.json @@ -1609,7 +1609,7 @@ }, { "name": "Moonbeam Polkadot", - "chain": "Moonbeam", + "chain": "moonbeam", "network": "mainnet", "rpc": ["https://rpc.api.moonbeam.network"], "faucets": [], From 9ad9ce47f48c998d867a792b3dbd243f2769a122 Mon Sep 17 00:00:00 2001 From: codingsh Date: Mon, 2 May 2022 12:10:33 +0000 Subject: [PATCH 14/24] fix(moonbeam): fixed chainId --- .../popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx | 1 + packages/mask/src/plugins/NextID/base.ts | 2 +- packages/mask/src/plugins/RedPacket/base.ts | 2 +- .../SNSAdaptor/GasSettingDialog/Prior1559GasSetting.tsx | 1 + packages/mask/src/plugins/Wallet/apis/debank.ts | 3 ++- packages/mask/src/plugins/Wallet/services/assets.ts | 2 +- packages/web3-shared/evm/assets/chains.json | 4 ++-- 7 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/mask/src/extension/popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx b/packages/mask/src/extension/popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx index fcbc87fb0df9..af40584f9d57 100644 --- a/packages/mask/src/extension/popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx +++ b/packages/mask/src/extension/popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx @@ -97,6 +97,7 @@ const minGasPriceOfChain: ChainIdOptionalRecord = { [ChainId.BSC]: pow10(9).multipliedBy(5), // 5 Gwei [ChainId.Conflux]: pow10(9).multipliedBy(5), // 5 Gwei [ChainId.Matic]: pow10(9).multipliedBy(30), // 30 Gwei + [ChainId.Moonbeam]: pow10(9).multipliedBy(1), // 1 Gwei } export const Prior1559GasSetting = memo(() => { diff --git a/packages/mask/src/plugins/NextID/base.ts b/packages/mask/src/plugins/NextID/base.ts index 09ccf1b892b5..e9911e4bb0ec 100644 --- a/packages/mask/src/plugins/NextID/base.ts +++ b/packages/mask/src/plugins/NextID/base.ts @@ -29,8 +29,8 @@ export const base: Plugin.Shared.Definition = { ChainId.Aurora, ChainId.Avalanche, ChainId.Fantom, - ChainId.Moonbeam, ChainId.Conflux, + ChainId.Moonbeam, ], }, [NetworkPluginID.PLUGIN_FLOW]: { supportedChainIds: [] }, diff --git a/packages/mask/src/plugins/RedPacket/base.ts b/packages/mask/src/plugins/RedPacket/base.ts index ec0aa4cc9798..a4830c731c95 100644 --- a/packages/mask/src/plugins/RedPacket/base.ts +++ b/packages/mask/src/plugins/RedPacket/base.ts @@ -29,8 +29,8 @@ export const base: Plugin.Shared.Definition = { ChainId.Fantom, ChainId.Avalanche, ChainId.Aurora, - ChainId.Moonbeam, ChainId.Conflux, + ChainId.Moonbeam, ], }, [NetworkPluginID.PLUGIN_FLOW]: { supportedChainIds: [] }, diff --git a/packages/mask/src/plugins/Wallet/SNSAdaptor/GasSettingDialog/Prior1559GasSetting.tsx b/packages/mask/src/plugins/Wallet/SNSAdaptor/GasSettingDialog/Prior1559GasSetting.tsx index 725775c21af7..8612e33a3319 100644 --- a/packages/mask/src/plugins/Wallet/SNSAdaptor/GasSettingDialog/Prior1559GasSetting.tsx +++ b/packages/mask/src/plugins/Wallet/SNSAdaptor/GasSettingDialog/Prior1559GasSetting.tsx @@ -29,6 +29,7 @@ const minGasPriceOfChain: ChainIdOptionalRecord = { [ChainId.BSC]: pow10(9).multipliedBy(5), // 5 Gwei [ChainId.Conflux]: pow10(9).multipliedBy(5), // 5 Gwei [ChainId.Matic]: pow10(9).multipliedBy(30), // 30 Gwei + [ChainId.Moonbeam]: pow10(9).multipliedBy(1), // 1 Gwei } export const Prior1559GasSetting: FC = memo( diff --git a/packages/mask/src/plugins/Wallet/apis/debank.ts b/packages/mask/src/plugins/Wallet/apis/debank.ts index e72fdc67de63..a1a2f5b0948a 100644 --- a/packages/mask/src/plugins/Wallet/apis/debank.ts +++ b/packages/mask/src/plugins/Wallet/apis/debank.ts @@ -29,6 +29,7 @@ export async function getAssetsList(address: string) { } const auroraChainOnDebank = getDeBankConstants(ChainId.Aurora).CHAIN_ID +const moonbeamChainOnDebank = getDeBankConstants(ChainId.Moonbeam).CHAIN_ID const fieldKeys = ['fast', 'normal', 'slow'] as const /** * Debank's data might be outdated, like gas price for aurora which requires 1 Gwei at least @@ -36,7 +37,7 @@ const fieldKeys = ['fast', 'normal', 'slow'] as const * Once debank fixes it, we will remove this modifier. */ function gasModifier(gasDict: GasPriceDictResponse, chain: string) { - if (chain === auroraChainOnDebank) { + if ([auroraChainOnDebank, moonbeamChainOnDebank].includes(chain)) { fieldKeys.forEach((fieldKey) => { const field = gasDict.data[fieldKey] field.price = Math.max(field.price, formatGweiToWei(1).toNumber()) diff --git a/packages/mask/src/plugins/Wallet/services/assets.ts b/packages/mask/src/plugins/Wallet/services/assets.ts index 52fca9a4808c..f4c8ed13f3a9 100644 --- a/packages/mask/src/plugins/Wallet/services/assets.ts +++ b/packages/mask/src/plugins/Wallet/services/assets.ts @@ -107,7 +107,7 @@ export async function getAssetsList( // xdai-assets is not support const scopes = network ? [resolveZerionAssetsScopeName(network)] - : ['assets', 'bsc-assets', 'polygon-assets', 'arbitrum-assets', 'avalanche-assets'] + : ['assets', 'bsc-assets', 'polygon-assets', 'arbitrum-assets', 'avalanche-assets', 'moonbeam-assets'] for (const scope of scopes) { const { meta, payload } = await ZerionAPI.getAssetsList(address, scope) if (meta.status !== 'ok') throw new Error('Fail to load assets.') diff --git a/packages/web3-shared/evm/assets/chains.json b/packages/web3-shared/evm/assets/chains.json index 78893d86f0e9..82e62e2dbbaa 100644 --- a/packages/web3-shared/evm/assets/chains.json +++ b/packages/web3-shared/evm/assets/chains.json @@ -1693,14 +1693,14 @@ }, { "name": "Moonbeam Polkadot", - "chain": "moonbeam", + "chain": "Moonbeam", "network": "mainnet", "rpc": ["https://rpc.api.moonbeam.network"], "faucets": [], "features": ["EIP1559"], "nativeCurrency": { "name": "Glimmer", "symbol": "GLMR", "decimals": 18 }, "infoURL": "https://moonscan.io/", - "shortName": "mobm", + "shortName": "Moobeam", "chainId": 1284, "networkId": 1284 }, From dd0d43acc3ded29b2089b187feda928338f13229 Mon Sep 17 00:00:00 2001 From: codingsh Date: Mon, 2 May 2022 14:54:32 +0200 Subject: [PATCH 15/24] chore(Moonbeam): update dexs tokens address --- packages/web3-constants/evm/token.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/web3-constants/evm/token.json b/packages/web3-constants/evm/token.json index 1339c01eec97..3b566a7a2a65 100644 --- a/packages/web3-constants/evm/token.json +++ b/packages/web3-constants/evm/token.json @@ -2351,7 +2351,7 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "" + "Moonbeam": "0x0f47ba9d9Bde3442b42175e51d6A367928A1173B" }, "FLARE_ADDRESS": { "Mainnet": "", @@ -2373,6 +2373,6 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "" + "Moonbeam": "0xE3e43888fa7803cDC7BEA478aB327cF1A0dc11a7" } } From fdc5403ebe0658c1077d65dab1a658a28a9ace94 Mon Sep 17 00:00:00 2001 From: codingsh Date: Mon, 16 May 2022 19:47:54 +0100 Subject: [PATCH 16/24] chore(moonbeam): change native token address --- packages/web3-constants/evm/token.json | 299 ++++++++++++++++--------- 1 file changed, 199 insertions(+), 100 deletions(-) diff --git a/packages/web3-constants/evm/token.json b/packages/web3-constants/evm/token.json index 1caeea3d7c9b..47897b6d030a 100644 --- a/packages/web3-constants/evm/token.json +++ b/packages/web3-constants/evm/token.json @@ -44,7 +44,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "USDC_ADDRESS": { "Mainnet": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", @@ -115,7 +116,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0x3C2B8Be99c50593081EAA2A724F0B8285F5aba8f", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "HUSD_ADDRESS": { "Mainnet": "0xdf574c24545e5ffecb9a659c229253d4111d87e1", @@ -138,7 +140,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "BUSD_ADDRESS": { "Mainnet": "0x4fabb145d64652a948d72533023f6e7a623c7c53", @@ -185,7 +188,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "EASY_ADDRESS": { "Mainnet": "", @@ -208,7 +212,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "MKR_ADDRESS": { "Mainnet": "0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2", @@ -231,7 +236,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "MASK_ADDRESS": { "Mainnet": "0x69af81e73A73B40adF4f3d4223Cd9b1ECE623074", @@ -254,7 +260,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "MSKA_ADDRESS": { "Mainnet": "", @@ -277,7 +284,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "MSKB_ADDRESS": { "Mainnet": "", @@ -300,7 +308,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "MSKC_ADDRESS": { "Mainnet": "", @@ -323,7 +332,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "MSKD_ADDRESS": { "Mainnet": "", @@ -346,7 +356,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "MSKE_ADDRESS": { "Mainnet": "", @@ -369,7 +380,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "DAI_ADDRESS": { "Mainnet": "0x6B175474E89094C44Da98b954EedeAC495271d0F", @@ -416,7 +428,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "OKB_ADDRESS": { "Mainnet": "0x75231F58b43240C9718Dd58B4967c5114342a86c", @@ -439,7 +452,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "UST_ADDRESS": { "Mainnet": "0xa47c8bf37f92aBed4A126BDA807A7b7498661acD", @@ -462,7 +476,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0x224e64ec1BDce3870a6a6c777eDd450454068FEC", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "eUSDC_ADDRESS": { "Mainnet": "", @@ -485,7 +500,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "eUSDT_ADDRESS": { "Mainnet": "", @@ -508,7 +524,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "fUSDT_ADDRESS": { "Mainnet": "", @@ -531,7 +548,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "eDAI_ADDRESS": { "Mainnet": "", @@ -554,7 +572,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "UNITOKEN_ADDRESS": { "Mainnet": "", @@ -577,7 +596,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "TT01_ADDRESS": { "Mainnet": "", @@ -600,7 +620,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "TT02_ADDRESS": { "Mainnet": "", @@ -623,7 +644,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "QUICK_ADDRESS": { "Mainnet": "", @@ -646,7 +668,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "WANNA_ADDRESS": { "Mainnet": "", @@ -669,7 +692,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "WBTC_ADDRESS": { "Mainnet": "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599", @@ -716,7 +740,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "OM_ADDRESS": { "Mainnet": "", @@ -739,7 +764,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "SUSHI_ADDRESS": { "Mainnet": "0x6B3595068778DD592e39A122f4f5a5cF09C90fE2", @@ -762,7 +788,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0xBEC775Cb42AbFa4288dE81F387a9b1A3c4Bc552A", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "YAM_ADDRESS": { "Mainnet": "0x0e2298E3B3390e3b945a5456fBf59eCc3f55DA16", @@ -785,7 +812,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "RUNE_ADDRESS": { "Mainnet": "0x3155BA85D5F96b2d030a4966AF206230e46849cb", @@ -808,7 +836,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "YFI_ADDRESS": { "Mainnet": "0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e", @@ -831,7 +860,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "sUSD_ADDRESS": { "Mainnet": "0x57ab1ec28d129707052df4df418d58a2d46d5f51", @@ -854,7 +884,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "BTCB_ADDRESS": { "Mainnet": "", @@ -877,7 +908,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "CAKE_ADDRESS": { "Mainnet": "", @@ -900,7 +932,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "maUSDC_ADDRESS": { "Mainnet": "", @@ -923,7 +956,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "stETH_ADDRESS": { "Mainnet": "0xDFe66B14D37C77F4E9b180cEb433d1b164f0281D", @@ -946,7 +980,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "NFTX_ADDRESS": { "Mainnet": "0x87d73E916D7057945c9BcD8cdd94e42A6F47f776", @@ -969,7 +1004,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "cUSD_ADDRESS": { "Mainnet": "", @@ -992,7 +1028,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "cEUR_ADDRESS": { "Mainnet": "", @@ -1015,7 +1052,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "xTRI_ADDRESS": { "Mainnet": "", @@ -1038,7 +1076,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "JOE_ADDRESS": { "Mainnet": "", @@ -1061,7 +1100,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "PNG_ADDRESS": { "Mainnet": "", @@ -1084,7 +1124,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "VIPER_ADDRESS": { "Mainnet": "", @@ -1107,7 +1148,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0xEa589E93Ff18b1a1F1e9BaC7EF3E86Ab62addc79", - "Harmony_Test": "0x69A655c56087D927eb05247FB56495a0f19B9f70" + "Harmony_Test": "0x69A655c56087D927eb05247FB56495a0f19B9f70", + "Moonbeam": "" }, "JEWEL_ADDRESS": { "Mainnet": "", @@ -1130,7 +1172,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0x72Cb10C6bfA5624dD07Ef608027E366bd690048F", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "CRYSTAL_ADDRESS": { "Mainnet": "", @@ -1153,7 +1196,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0x72Cb10C6bfA5624dD07Ef608027E366bd690048F", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "OPENX_ADDRESS": { "Mainnet": "", @@ -1176,7 +1220,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0x01A4b054110d57069c1658AFBC46730529A3E326", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "ETHER_ADDRESS": { "Mainnet": "", @@ -1199,7 +1244,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "NATIVE_TOKEN_ADDRESS": { "Mainnet": "0x0000000000000000000000000000000000000000", @@ -1223,7 +1269,7 @@ "Conflux": "0x0000000000000000000000000000000000000000", "Harmony": "0x0000000000000000000000000000000000000000", "Harmony_Test": "0x0000000000000000000000000000000000000000", - "Moonbeam": "0x0000000000000000000000000000000000000000" + "Moonbeam": "0x0000000000000000000000000000000000000802" }, "WETH_ADDRESS": { "Mainnet": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", @@ -1246,7 +1292,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aWETH_ADDRESS": { "Mainnet": "0x030bA81f1c18d280636F32af80b9AAd02Cf0854e", @@ -1269,7 +1316,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0xe50fA9b3c56FfB159cB0FCA61F5c9D750e8128c8", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "ZRX_ADDRESS": { "Mainnet": "0xE41d2489571d322189246DaFA5ebDe1F4699F498", @@ -1292,7 +1340,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aZRX_ADDRESS": { "Mainnet": "0xDf7FF54aAcAcbFf42dfe29DD6144A69b629f8C9e", @@ -1315,7 +1364,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "UNI_ADDRESS": { "Mainnet": "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984", @@ -1338,7 +1388,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aUNI_ADDRESS": { "Mainnet": "0xB9D7CB55f463405CDfBe4E90a6D2Df01C2B92BF1", @@ -1361,7 +1412,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "LIDO_ADDRESS": { "Mainnet": "0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32", @@ -1384,7 +1436,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "AAVE_ADDRESS": { "Mainnet": "0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9", @@ -1407,7 +1460,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0xcF323Aad9E522B93F11c352CaA519Ad0E14eB40F", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aAAVE_ADDRESS": { "Mainnet": "0xFFC97d72E13E01096502Cb8Eb52dEe56f74DAD7B", @@ -1430,7 +1484,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0xf329e36C7bF6E5E86ce2150875a84Ce77f477375", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "BAT_ADDRESS": { "Mainnet": "0x0D8775F648430679A709E98d2b0Cb6250d2887EF", @@ -1453,7 +1508,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aBAT_ADDRESS": { "Mainnet": "0x05Ec93c0365baAeAbF7AefFb0972ea7ECdD39CF1", @@ -1476,7 +1532,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "ENJ_ADDRESS": { "Mainnet": "0xF629cBd94d3791C9250152BD8dfBDF380E2a3B9c", @@ -1499,7 +1556,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aENJ_ADDRESS": { "Mainnet": "0xaC6Df26a590F08dcC95D5a4705ae8abbc88509Ef", @@ -1522,7 +1580,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "KNC_ADDRESS": { "Mainnet": "0xdd974D5C2e2928deA5F71b9825b8b646686BD200", @@ -1545,7 +1604,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aKNC_ADDRESS": { "Mainnet": "0x39C6b3e42d6A679d7D776778Fe880BC9487C2EDA", @@ -1568,7 +1628,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "LINK_ADDRESS": { "Mainnet": "0x514910771AF9Ca656af840dff83E8264EcF986CA", @@ -1591,7 +1652,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0x218532a12a389a4a92fC0C5Fb22901D1c19198aA", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aLINK_ADDRESS": { "Mainnet": "0xa06bC25B5805d5F8d82847D191Cb4Af5A3e873E0", @@ -1614,7 +1676,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "MANA_ADDRESS": { "Mainnet": "0x0F5D2fB29fb7d3CFeE444a200298f468908cC942", @@ -1637,7 +1700,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aMANA_ADDRESS": { "Mainnet": "0xa685a61171bb30d4072B338c80Cb7b2c865c873E", @@ -1660,7 +1724,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "REN_ADDRESS": { "Mainnet": "0x408e41876cCCDC0F92210600ef50372656052a38", @@ -1683,7 +1748,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aREN_ADDRESS": { "Mainnet": "0xCC12AbE4ff81c9378D670De1b57F8e0Dd228D77a", @@ -1706,7 +1772,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "SNX_ADDRESS": { "Mainnet": "0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F", @@ -1729,7 +1796,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aSNX_ADDRESS": { "Mainnet": "0x35f6B052C598d933D69A4EEC4D04c73A191fE6c2", @@ -1752,7 +1820,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "TUSD_ADDRESS": { "Mainnet": "0x0000000000085d4780B73119b644AE5ecd22b376", @@ -1775,7 +1844,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aTUSD_ADDRESS": { "Mainnet": "0x101cc05f4A51C0319f570d5E146a8C625198e636", @@ -1798,7 +1868,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "CRV_ADDRESS": { "Mainnet": "0xD533a949740bb3306d119CC777fa900bA034cd52", @@ -1821,7 +1892,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aCRV_ADDRESS": { "Mainnet": "0x8dAE6Cb04688C62d939ed9B68d32Bc62e49970b1", @@ -1844,7 +1916,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "GUSD_ADDRESS": { "Mainnet": "0x056Fd409E1d7A124BD7017459dFEa2F387b6d5Cd", @@ -1867,7 +1940,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aGUSD_ADDRESS": { "Mainnet": "0xD37EE7e4f452C6638c96536e68090De8cBcdb583", @@ -1890,7 +1964,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "BAL_ADDRESS": { "Mainnet": "0xba100000625a3754423978a60c9317c58a424e3D", @@ -1913,7 +1988,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aBAL_ADDRESS": { "Mainnet": "0x272F97b7a56a387aE942350bBC7Df5700f8a4576", @@ -1936,7 +2012,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "xSUSHI_ADDRESS": { "Mainnet": "0x8798249c2E607446EfB7Ad49eC89dD1865Ff4272", @@ -1959,7 +2036,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aXSUSHI_ADDRESS": { "Mainnet": "0xF256CC7847E919FAc9B808cC216cAc87CCF2f47a", @@ -1982,7 +2060,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "renFIL_ADDRESS": { "Mainnet": "0xD5147bc8e386d91Cc5DBE72099DAC6C9b99276F5", @@ -2005,7 +2084,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aRENFIL_ADDRESS": { "Mainnet": "0x514cd6756CCBe28772d4Cb81bC3156BA9d1744aa", @@ -2028,7 +2108,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "RAI_ADDRESS": { "Mainnet": "0x03ab458634910AaD20eF5f1C8ee96F1D6ac54919", @@ -2051,7 +2132,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aRAI_ADDRESS": { "Mainnet": "0xc9BC48c72154ef3e5425641a3c747242112a46AF", @@ -2074,7 +2156,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "USDP_ADDRESS": { "Mainnet": "0x8E870D67F660D95d5be530380D0eC0bd388289E1", @@ -2097,7 +2180,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aUSDP_ADDRESS": { "Mainnet": "0x2e8F4bdbE3d47d7d7DE490437AeA9915D930F1A3", @@ -2120,7 +2204,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "DPI_ADDRESS": { "Mainnet": "0x1494CA1F11D487c2bBe4543E90080AeBa4BA3C2b", @@ -2143,7 +2228,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aDPI_ADDRESS": { "Mainnet": "0x6F634c6135D2EBD550000ac92F494F9CB8183dAe", @@ -2166,7 +2252,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "FRAX_ADDRESS": { "Mainnet": "0x853d955aCEf822Db058eb8505911ED77F175b99e", @@ -2189,7 +2276,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0xFa7191D292d5633f702B0bd7E3E3BcCC0e633200", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aFRAX_ADDRESS": { "Mainnet": "0xd4937682df3C8aEF4FE912A96A74121C0829E664", @@ -2212,7 +2300,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "FEI_ADDRESS": { "Mainnet": "0x956F47F50A910163D8BF957Cf5846D573E7f87CA", @@ -2235,7 +2324,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aFEI_ADDRESS": { "Mainnet": "0x683923dB55Fead99A79Fa01A27EeC3cB19679cC3", @@ -2258,7 +2348,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aWBTC_ADDRESS": { "Mainnet": "0x9ff58f4fFB29fA2266Ab25e75e2A8b3503311656", @@ -2281,7 +2372,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0x078f358208685046a11C85e8ad32895DED33A249", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aYFI_ADDRESS": { "Mainnet": "0x5165d24277cD063F5ac44Efd447B27025e888f37", @@ -2304,7 +2396,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aBUSD_ADDRESS": { "Mainnet": "0xA361718326c15715591c299427c62086F69923D9", @@ -2327,7 +2420,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aDAI_ADDRESS": { "Mainnet": "0x028171bCA77440897B824Ca71D1c56caC55b68A3", @@ -2350,7 +2444,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aMKR_ADDRESS": { "Mainnet": "0xc713e5E149D5D0715DcD1c156a020976e7E56B88", @@ -2373,7 +2468,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aSUSD_ADDRESS": { "Mainnet": "0x6C5024Cd4F8A59110119C56f8933403A539555EB", @@ -2396,7 +2492,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aUSDC_ADDRESS": { "Mainnet": "0xBcca60bB61934080951369a648Fb03DF4F96263C", @@ -2419,7 +2516,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "aAMPL_ADDRESS": { "Mainnet": "0x1E6bb68Acec8fefBD87D192bE09bb274170a0548", @@ -2442,7 +2540,8 @@ "Aurora_Testnet": "", "Conflux": "0x0000000000000000000000000000000000000000", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "SHARE_ADDRESS": { "Mainnet": "", From 5acc3f05c25a6eda276ab3a79ade8f476e832428 Mon Sep 17 00:00:00 2001 From: codingsh Date: Mon, 16 May 2022 20:10:45 +0100 Subject: [PATCH 17/24] chore(moonbeam): add GLINT beamSwap token --- .../Wallet/GasSetting/Prior1559GasSetting.tsx | 1 - .../GasSettingDialog/Prior1559GasSetting.tsx | 1 - packages/web3-constants/evm/airdrop.json | 4 +- packages/web3-constants/evm/artblocks.json | 4 +- packages/web3-constants/evm/coingecko.json | 8 +- .../web3-constants/evm/coinmarketcap.json | 4 +- packages/web3-constants/evm/cryptoartai.json | 12 +- packages/web3-constants/evm/debank.json | 4 +- packages/web3-constants/evm/dhedge.json | 8 +- packages/web3-constants/evm/ethereum.json | 16 +- packages/web3-constants/evm/explorer.json | 8 +- packages/web3-constants/evm/gitcoin.json | 16 +- .../web3-constants/evm/good-ghosting.json | 8 +- packages/web3-constants/evm/ito.json | 28 +-- packages/web3-constants/evm/lbp.json | 4 +- packages/web3-constants/evm/lido.json | 8 +- packages/web3-constants/evm/mask-box.json | 8 +- .../web3-constants/evm/nft-red-packet.json | 8 +- packages/web3-constants/evm/openocean.json | 4 +- packages/web3-constants/evm/opensea-api.json | 12 +- packages/web3-constants/evm/pooltogether.json | 8 +- packages/web3-constants/evm/red-packet.json | 24 +-- packages/web3-constants/evm/rpc.json | 8 +- .../evm/space-station-galaxy.json | 8 +- .../evm/token-asset-base-url.json | 10 +- packages/web3-constants/evm/token-list.json | 4 +- packages/web3-constants/evm/token.json | 30 ++- packages/web3-constants/evm/trader.json | 201 ++++++++++++------ packages/web3-shared/evm/constants/tokens.ts | 1 + 29 files changed, 275 insertions(+), 185 deletions(-) diff --git a/packages/mask/src/extension/popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx b/packages/mask/src/extension/popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx index af40584f9d57..fcbc87fb0df9 100644 --- a/packages/mask/src/extension/popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx +++ b/packages/mask/src/extension/popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx @@ -97,7 +97,6 @@ const minGasPriceOfChain: ChainIdOptionalRecord = { [ChainId.BSC]: pow10(9).multipliedBy(5), // 5 Gwei [ChainId.Conflux]: pow10(9).multipliedBy(5), // 5 Gwei [ChainId.Matic]: pow10(9).multipliedBy(30), // 30 Gwei - [ChainId.Moonbeam]: pow10(9).multipliedBy(1), // 1 Gwei } export const Prior1559GasSetting = memo(() => { diff --git a/packages/mask/src/plugins/Wallet/SNSAdaptor/GasSettingDialog/Prior1559GasSetting.tsx b/packages/mask/src/plugins/Wallet/SNSAdaptor/GasSettingDialog/Prior1559GasSetting.tsx index 8612e33a3319..725775c21af7 100644 --- a/packages/mask/src/plugins/Wallet/SNSAdaptor/GasSettingDialog/Prior1559GasSetting.tsx +++ b/packages/mask/src/plugins/Wallet/SNSAdaptor/GasSettingDialog/Prior1559GasSetting.tsx @@ -29,7 +29,6 @@ const minGasPriceOfChain: ChainIdOptionalRecord = { [ChainId.BSC]: pow10(9).multipliedBy(5), // 5 Gwei [ChainId.Conflux]: pow10(9).multipliedBy(5), // 5 Gwei [ChainId.Matic]: pow10(9).multipliedBy(30), // 30 Gwei - [ChainId.Moonbeam]: pow10(9).multipliedBy(1), // 1 Gwei } export const Prior1559GasSetting: FC = memo( diff --git a/packages/web3-constants/evm/airdrop.json b/packages/web3-constants/evm/airdrop.json index 4be9aa6f1857..9ab75a8b4ca5 100644 --- a/packages/web3-constants/evm/airdrop.json +++ b/packages/web3-constants/evm/airdrop.json @@ -19,8 +19,8 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/artblocks.json b/packages/web3-constants/evm/artblocks.json index 3579a38935bf..54a6500abd3d 100644 --- a/packages/web3-constants/evm/artblocks.json +++ b/packages/web3-constants/evm/artblocks.json @@ -19,8 +19,8 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/coingecko.json b/packages/web3-constants/evm/coingecko.json index e9a3b386f61c..dde6a4c4ba38 100644 --- a/packages/web3-constants/evm/coingecko.json +++ b/packages/web3-constants/evm/coingecko.json @@ -19,9 +19,9 @@ "Aurora": "aurora", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "moonbeam", "Harmony": "harmony", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "moonbeam" }, "COIN_ID": { "Mainnet": "ethereum", @@ -43,8 +43,8 @@ "Aurora": "ethereum", "Aurora_Testnet": "", "Conflux": "conflux-token", - "Moonbeam": "moonbeam", "Harmony": "harmony", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "moonbeam" } } diff --git a/packages/web3-constants/evm/coinmarketcap.json b/packages/web3-constants/evm/coinmarketcap.json index a1150406e3a6..62ca7b77c2ef 100644 --- a/packages/web3-constants/evm/coinmarketcap.json +++ b/packages/web3-constants/evm/coinmarketcap.json @@ -19,8 +19,8 @@ "Aurora": "14803", "Aurora_Testnet": "", "Conflux": "7334", - "Moonbeam": "6836", "Harmony": "3945", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "6836" } } diff --git a/packages/web3-constants/evm/cryptoartai.json b/packages/web3-constants/evm/cryptoartai.json index 9d756c9e305f..5e55b81b6cbf 100644 --- a/packages/web3-constants/evm/cryptoartai.json +++ b/packages/web3-constants/evm/cryptoartai.json @@ -19,9 +19,9 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "ARTIST_ACCEPTING_BIDS_V2": { "Mainnet": "0x78C889749f29D2965a76Ede3BBb232A9729Ccf0b", @@ -43,9 +43,9 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "CANFT_MARKET": { "Mainnet": "0x72d081953957723e540780a0C6bA31725469238E", @@ -67,8 +67,8 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/debank.json b/packages/web3-constants/evm/debank.json index da57253d1c16..52f980d5f535 100644 --- a/packages/web3-constants/evm/debank.json +++ b/packages/web3-constants/evm/debank.json @@ -19,8 +19,8 @@ "Aurora": "aurora", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "mobm", "Harmony": "hmy", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "mobm" } } diff --git a/packages/web3-constants/evm/dhedge.json b/packages/web3-constants/evm/dhedge.json index 5075501d7ad9..284aa7738d6c 100644 --- a/packages/web3-constants/evm/dhedge.json +++ b/packages/web3-constants/evm/dhedge.json @@ -19,9 +19,9 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "API_URL": { "Mainnet": "https://api-v2.dhedge.org/graphql", @@ -43,8 +43,8 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/ethereum.json b/packages/web3-constants/evm/ethereum.json index bacc880d36a0..b7a6d67f9aa1 100644 --- a/packages/web3-constants/evm/ethereum.json +++ b/packages/web3-constants/evm/ethereum.json @@ -19,9 +19,9 @@ "Aurora": "0xC119574D5Fb333F5AC018658D4d8b5035E16bf39", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "0xC119574D5Fb333F5AC018658D4d8b5035E16bf39", "Harmony": "0xc119574d5fb333f5ac018658d4d8b5035e16bf39", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "0xC119574D5Fb333F5AC018658D4d8b5035E16bf39" }, "MULTICALL_ADDRESS": { "Mainnet": "0x1F98415757620B543A52E61c46B32eB19261F984", @@ -44,8 +44,8 @@ "Aurora_Testnet": "0xcA11bde05977b3631167028862bE2a173976CA11", "Conflux": "0x19f179d7e0d7d9f9d5386afff64271d98a91615b", "Harmony": "0x6cc1b1058f9153358278c35e0b2d382f1585854b", - "Moonbeam": "0xcA11bde05977b3631167028862bE2a173976CA11", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "0xcA11bde05977b3631167028862bE2a173976CA11" }, "ENS_REGISTRAR_ADDRESS": { "Mainnet": "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e", @@ -67,9 +67,9 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "ENS_REVERSE_RECORDS_ADDRESS": { "Mainnet": "0x3671aE578E63FdF66ad4F3E12CC0c0d71Ac7510C", @@ -91,8 +91,8 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/explorer.json b/packages/web3-constants/evm/explorer.json index 39d67f5f029a..efd471fe552d 100644 --- a/packages/web3-constants/evm/explorer.json +++ b/packages/web3-constants/evm/explorer.json @@ -19,9 +19,9 @@ "Aurora": [], "Aurora_Testnet": [], "Conflux": [], - "Moonbeam": [], "Harmony": [], - "Harmony_Test": [] + "Harmony_Test": [], + "Moonbeam": [] }, "EXPLORER_API": { "Mainnet": "https://api.etherscan.io/api", @@ -43,8 +43,8 @@ "Aurora": "https://explorer.mainnet.aurora.dev/api", "Aurora_Testnet": "https://explorer.testnet.aurora.dev/api", "Conflux": "https://evmapi.confluxscan.net/api", - "Moonbeam": "https://api-moonbeam.moonscan.io/api", "Harmony": "https://explorer.harmony.one", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "https://api-moonbeam.moonscan.io/api" } } diff --git a/packages/web3-constants/evm/gitcoin.json b/packages/web3-constants/evm/gitcoin.json index 66f3843bf9c8..0a93b637d14d 100644 --- a/packages/web3-constants/evm/gitcoin.json +++ b/packages/web3-constants/evm/gitcoin.json @@ -19,9 +19,9 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "BULK_CHECKOUT_ADDRESS": { "Mainnet": "0x7d655c57f71464B6f83811C55D84009Cd9f5221C", @@ -43,9 +43,9 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "GITCOIN_ETH_ADDRESS": { "Mainnet": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", @@ -67,9 +67,9 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "GITCOIN_TIP_PERCENTAGE": { "Mainnet": 5, @@ -91,8 +91,8 @@ "Aurora": 0, "Aurora_Testnet": 0, "Conflux": 0, - "Moonbeam": 0, "Harmony": 0, - "Harmony_Test": 0 + "Harmony_Test": 0, + "Moonbeam": 0 } } diff --git a/packages/web3-constants/evm/good-ghosting.json b/packages/web3-constants/evm/good-ghosting.json index 5ff93e9697d2..231a8718aead 100644 --- a/packages/web3-constants/evm/good-ghosting.json +++ b/packages/web3-constants/evm/good-ghosting.json @@ -19,9 +19,9 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "GOOD_GHOSTING_INCENTIVES_CONTRACT_ADDRESS": { "Mainnet": "", @@ -43,8 +43,8 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/ito.json b/packages/web3-constants/evm/ito.json index 54b41b585fbe..cbb0cce8fa67 100644 --- a/packages/web3-constants/evm/ito.json +++ b/packages/web3-constants/evm/ito.json @@ -19,9 +19,9 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "MASK_ITO_CONTRACT_ADDRESS": { "Mainnet": "0x86812da3A623ab9606976078588b80C315E55FA3", @@ -43,9 +43,9 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "ITO2_CONTRACT_ADDRESS": { "Mainnet": "0xc2CFbF22d6Dc87D0eE18d38d73733524c109Ff46", @@ -67,9 +67,9 @@ "Aurora": "0x2cf91AD8C175305EBe6970Bd8f81231585EFbd77", "Aurora_Testnet": "0xdcA6F476EebCDE8FE8b072e3fC80dBC28dC209b3", "Conflux": "0x066804d9123bf2609ed4a4a40b1177a9c5a9ed51", - "Moonbeam": "0x981be454a930479d92C91a0092D204b64845A5D6", "Harmony": "0x5b966f3a32db9c180843bcb40267a66b73e4f022", - "Harmony_Test": "0x578a7fee5f0d8cec7d00578bf37374c5b95c4b98" + "Harmony_Test": "0x578a7fee5f0d8cec7d00578bf37374c5b95c4b98", + "Moonbeam": "0x981be454a930479d92C91a0092D204b64845A5D6" }, "ITO2_CONTRACT_CREATION_BLOCK_HEIGHT": { "Mainnet": 12766513, @@ -91,9 +91,9 @@ "Aurora": 57350598, "Aurora_Testnet": 77919102, "Conflux": 37722805, - "Moonbeam": 1314566, "Harmony": 24133305, - "Harmony_Test": 22744597 + "Harmony_Test": 22744597, + "Moonbeam": 1314566 }, "DEFAULT_QUALIFICATION_ADDRESS": { "Mainnet": "0x81b6ae377e360dcad63611846a2516f4ba8c88ac", @@ -115,9 +115,9 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "DEFAULT_QUALIFICATION2_ADDRESS": { "Mainnet": "0x4dC5f343Fe57E4fbDA1B454d125D396A3181272c", @@ -139,9 +139,9 @@ "Aurora": "0x578a7Fee5f0D8CEc7d00578Bf37374C5b95C4b98", "Aurora_Testnet": "", "Conflux": "0x05ee315e407c21a594f807d61d6cc11306d1f149", - "Moonbeam": "0x83D6b366f21e413f214EB077D5378478e71a5eD2", "Harmony": "0x02Ea0720254F7fa4eca7d09A1b9C783F1020EbEF", - "Harmony_Test": "0x812463356F58fc8194645A1838ee6C52D8ca2D26" + "Harmony_Test": "0x812463356F58fc8194645A1838ee6C52D8ca2D26", + "Moonbeam": "0x83D6b366f21e413f214EB077D5378478e71a5eD2" }, "SUBGRAPH_URL": { "Mainnet": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-ito-mainnet", @@ -163,8 +163,8 @@ "Aurora": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-ito-aurora", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-ito-moonbeam", "Harmony": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-ito-harmony", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-ito-moonbeam" } } diff --git a/packages/web3-constants/evm/lbp.json b/packages/web3-constants/evm/lbp.json index 6eb92bd2c9eb..769681d56ff8 100644 --- a/packages/web3-constants/evm/lbp.json +++ b/packages/web3-constants/evm/lbp.json @@ -19,8 +19,8 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/lido.json b/packages/web3-constants/evm/lido.json index 15a513800ee5..0dd1a9c854d2 100644 --- a/packages/web3-constants/evm/lido.json +++ b/packages/web3-constants/evm/lido.json @@ -19,9 +19,9 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "LIDO_REFERRAL_ADDRESS": { "Mainnet": "0x934b510d4c9103e6a87aef13b816fb080286d649", @@ -43,8 +43,8 @@ "Aurora": "0x934b510d4c9103e6a87aef13b816fb080286d649", "Aurora_Testnet": "0x934b510d4c9103e6a87aef13b816fb080286d649", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/mask-box.json b/packages/web3-constants/evm/mask-box.json index 010326950314..758dd7585f9f 100644 --- a/packages/web3-constants/evm/mask-box.json +++ b/packages/web3-constants/evm/mask-box.json @@ -19,9 +19,9 @@ "Aurora": "0xf5056B96ab242C566002852d0b98ce0BcDf1af51", "Aurora_Testnet": "0xB4D669bc117735FdA44e90e52795132187705B21", "Conflux": "", - "Moonbeam": "", "Harmony": "0xDc0905F2Dac875E29A36f22F1Ea046e063875D3e", - "Harmony_Test": "0x4Fda6d9Bb68Af18E5d686555b18cCeA7C82E0A3F" + "Harmony_Test": "0x4Fda6d9Bb68Af18E5d686555b18cCeA7C82E0A3F", + "Moonbeam": "" }, "MASK_BOX_CONTRACT_FROM_BLOCK": { "Mainnet": 13687866, @@ -43,8 +43,8 @@ "Aurora": 57259004, "Aurora_Testnet": 77919118, "Conflux": 0, - "Moonbeam": 0, "Harmony": 24172689, - "Harmony_Test": 22787067 + "Harmony_Test": 22787067, + "Moonbeam": 0 } } diff --git a/packages/web3-constants/evm/nft-red-packet.json b/packages/web3-constants/evm/nft-red-packet.json index c1714fba792b..0ec9b3285ce8 100644 --- a/packages/web3-constants/evm/nft-red-packet.json +++ b/packages/web3-constants/evm/nft-red-packet.json @@ -19,9 +19,9 @@ "Aurora": "0x05ee315E407C21a594f807D61d6CC11306D1F149", "Aurora_Testnet": "0x97369fEE7db34E0BfE47861f2ec44b4378d13eB4", "Conflux": "0x5b966f3a32db9c180843bcb40267a66b73e4f022", - "Moonbeam": "0xF9F7C1496c21bC0180f4B64daBE0754ebFc8A8c0", "Harmony": "0x83d6b366f21e413f214eb077d5378478e71a5ed2", - "Harmony_Test": "0x981be454a930479d92c91a0092d204b64845a5d6" + "Harmony_Test": "0x981be454a930479d92c91a0092d204b64845a5d6", + "Moonbeam": "0xF9F7C1496c21bC0180f4B64daBE0754ebFc8A8c0" }, "SUBGRAPH_URL": { "Mainnet": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-nft-red-packet-mainnet", @@ -43,8 +43,8 @@ "Aurora": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-nft-red-packet-aurora", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-nft-red-packet-moonbeam", "Harmony": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-nft-red-packet-harmony", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-nft-red-packet-moonbeam" } } diff --git a/packages/web3-constants/evm/openocean.json b/packages/web3-constants/evm/openocean.json index 3586179a2c9b..fadb35939347 100644 --- a/packages/web3-constants/evm/openocean.json +++ b/packages/web3-constants/evm/openocean.json @@ -19,8 +19,8 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/opensea-api.json b/packages/web3-constants/evm/opensea-api.json index c7c83ce26df2..36661774b803 100644 --- a/packages/web3-constants/evm/opensea-api.json +++ b/packages/web3-constants/evm/opensea-api.json @@ -19,9 +19,9 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "GET_SINGLE_ASSET_URL": { "Mainnet": "https://api.opensea.io/api/v1/asset", @@ -43,9 +43,9 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "GET_ASSETS_URL": { "Mainnet": "https://api.opensea.io/api/v1/assets", @@ -67,8 +67,8 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/pooltogether.json b/packages/web3-constants/evm/pooltogether.json index d5054f70888c..50d1cb7b4403 100644 --- a/packages/web3-constants/evm/pooltogether.json +++ b/packages/web3-constants/evm/pooltogether.json @@ -19,9 +19,9 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "MASK_POOL_ADDRESS": { "Mainnet": "", @@ -43,8 +43,8 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/red-packet.json b/packages/web3-constants/evm/red-packet.json index 99cc6d9094c5..9be13e532a8b 100644 --- a/packages/web3-constants/evm/red-packet.json +++ b/packages/web3-constants/evm/red-packet.json @@ -19,9 +19,9 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "HAPPY_RED_PACKET_ADDRESS_V2": { "Mainnet": "0x8D8912E1237F9FF3EF661F32743CFB276E052F98", @@ -43,9 +43,9 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "HAPPY_RED_PACKET_ADDRESS_V3": { "Mainnet": "", @@ -67,9 +67,9 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "HAPPY_RED_PACKET_ADDRESS_V4": { "Mainnet": "0xaBBe1101FD8fa5847c452A6D70C8655532B03C33", @@ -91,9 +91,9 @@ "Aurora": "0x19f179D7e0D7d9F9d5386afFF64271D98A91615B", "Aurora_Testnet": "0xdB93cCd481012bB5D1E2c8d0aF7C5f2940c00fdC", "Conflux": "0x96c7d011cdfd467f551605f0f5fce279f86f4186", - "Moonbeam": "0x578a7Fee5f0D8CEc7d00578Bf37374C5b95C4b98", "Harmony": "0xab7b1be4233a04e5c43a810e75657eced8e5463b", - "Harmony_Test": "0x96c7d011cdfd467f551605f0f5fce279f86f4186" + "Harmony_Test": "0x96c7d011cdfd467f551605f0f5fce279f86f4186", + "Moonbeam": "0x578a7Fee5f0D8CEc7d00578Bf37374C5b95C4b98" }, "HAPPY_RED_PACKET_ADDRESS_V4_BLOCK_HEIGHT": { "Mainnet": 12939427, @@ -115,9 +115,9 @@ "Aurora": 57552338, "Aurora_Testnet": 77918765, "Conflux": 37670572, - "Moonbeam": 1314596, "Harmony": 24134162, - "Harmony_Test": 22701101 + "Harmony_Test": 22701101, + "Moonbeam": 1314596 }, "SUBGRAPH_URL": { "Mainnet": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-red-packet-mainnet", @@ -139,8 +139,8 @@ "Aurora": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-red-packet-aurora", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-red-packet-moobeam", "Harmony": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-red-packet-harmony", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "https://api.thegraph.com/subgraphs/name/dimensiondev/mask-red-packet-moobeam" } } diff --git a/packages/web3-constants/evm/rpc.json b/packages/web3-constants/evm/rpc.json index 0b2eff95c201..74f2fddf7663 100644 --- a/packages/web3-constants/evm/rpc.json +++ b/packages/web3-constants/evm/rpc.json @@ -61,7 +61,6 @@ "Aurora": ["https://mainnet.aurora.dev"], "Aurora_Testnet": ["https://testnet.aurora.dev"], "Conflux": ["https://evm.confluxrpc.com"], - "Moonbeam": ["https://rpc.api.moonbeam.network"], "Harmony": [ "https://harmony-0-rpc.gateway.pokt.network", "https://api.harmony.one", @@ -69,7 +68,8 @@ "https://api.s0.t.hmny.io", "https://rpc.hermesdefi.io/" ], - "Harmony_Test": ["https://api.s0.b.hmny.io/"] + "Harmony_Test": ["https://api.s0.b.hmny.io/"], + "Moonbeam": ["https://rpc.api.moonbeam.network"] }, "RPC_WEIGHTS": { "Mainnet": [0, 1, 2, 3, 4], @@ -91,8 +91,8 @@ "Aurora": [0, 0, 0, 0, 0], "Aurora_Testnet": [0, 0, 0, 0, 0], "Conflux": [0, 0, 0, 0, 0], - "Moonbeam": [0, 0, 0, 0, 0], "Harmony": [0, 0, 0, 0, 0], - "Harmony_Test": [0, 0, 0, 0, 0] + "Harmony_Test": [0, 0, 0, 0, 0], + "Moonbeam": [0, 0, 0, 0, 0] } } diff --git a/packages/web3-constants/evm/space-station-galaxy.json b/packages/web3-constants/evm/space-station-galaxy.json index 77a78ffd6c43..9b5249d253c8 100644 --- a/packages/web3-constants/evm/space-station-galaxy.json +++ b/packages/web3-constants/evm/space-station-galaxy.json @@ -19,9 +19,9 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "SUBGRAPH_URL": { "Mainnet": "", @@ -43,8 +43,8 @@ "Aurora": "", "Aurora_Testnet": "", "Conflux": "", - "Moonbeam": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" } } diff --git a/packages/web3-constants/evm/token-asset-base-url.json b/packages/web3-constants/evm/token-asset-base-url.json index de2d16df8d0c..4f63ae4b6d60 100644 --- a/packages/web3-constants/evm/token-asset-base-url.json +++ b/packages/web3-constants/evm/token-asset-base-url.json @@ -49,14 +49,14 @@ "Aurora": [], "Aurora_Testnet": [], "Conflux": [], - "Moonbeam": [ - "https://raw.githubusercontent.com/dimensiondev/assets/master/blockchains/moonbeam", - "https://rawcdn.githack.com/dimensiondev/assets/master/blockchains/moonbeam" - ], "Harmony": [ "https://raw.githubusercontent.com/dimensiondev/assets/master/blockchains/harmony", "https://rawcdn.githack.com/dimensiondev/assets/master/blockchains/harmony" ], - "Harmony_Test": [] + "Harmony_Test": [], + "Moonbeam": [ + "https://raw.githubusercontent.com/dimensiondev/assets/master/blockchains/moonbeam", + "https://rawcdn.githack.com/dimensiondev/assets/master/blockchains/moonbeam" + ] } } diff --git a/packages/web3-constants/evm/token-list.json b/packages/web3-constants/evm/token-list.json index f2cab2b6533a..4c67eefe715d 100644 --- a/packages/web3-constants/evm/token-list.json +++ b/packages/web3-constants/evm/token-list.json @@ -19,8 +19,8 @@ "Aurora": ["https://tokens.r2d2.to/latest/1313161554/tokens.json"], "Aurora_Testnet": [], "Conflux": ["https://tokens.r2d2.to/latest/1030/tokens.json"], - "Moonbeam": ["https://tokens.r2d2.to/latest/1284/tokens.json"], "Harmony": ["https://tokens.r2d2.to/latest/1666600000/tokens.json"], - "Harmony_Test": ["https://tokens.r2d2.to/latest/1666700000/tokens.json"] + "Harmony_Test": ["https://tokens.r2d2.to/latest/1666700000/tokens.json"], + "Moonbeam": ["https://tokens.r2d2.to/latest/1284/tokens.json"] } } diff --git a/packages/web3-constants/evm/token.json b/packages/web3-constants/evm/token.json index 47897b6d030a..a86397e9bc83 100644 --- a/packages/web3-constants/evm/token.json +++ b/packages/web3-constants/evm/token.json @@ -477,7 +477,7 @@ "Conflux": "", "Harmony": "0x224e64ec1BDce3870a6a6c777eDd450454068FEC", "Harmony_Test": "", - "Moonbeam": "" + "Moonbeam": "0x8e70cD5B4Ff3f62659049e74b6649c6603A0E594" }, "eUSDC_ADDRESS": { "Mainnet": "", @@ -1293,7 +1293,7 @@ "Conflux": "", "Harmony": "", "Harmony_Test": "", - "Moonbeam": "" + "Moonbeam": "0x30D2a9F5FDf90ACe8c17952cbb4eE48a55D916A7" }, "aWETH_ADDRESS": { "Mainnet": "0x030bA81f1c18d280636F32af80b9AAd02Cf0854e", @@ -2277,7 +2277,7 @@ "Conflux": "", "Harmony": "0xFa7191D292d5633f702B0bd7E3E3BcCC0e633200", "Harmony_Test": "", - "Moonbeam": "" + "Moonbeam": "0x322E86852e492a7Ee17f28a78c663da38FB33bfb" }, "aFRAX_ADDRESS": { "Mainnet": "0xd4937682df3C8aEF4FE912A96A74121C0829E664", @@ -2686,5 +2686,29 @@ "Harmony": "", "Harmony_Test": "", "Moonbeam": "0xE3e43888fa7803cDC7BEA478aB327cF1A0dc11a7" + }, + "GLINT_ADDRESS": { + "Mainnet": "", + "Ropsten": "", + "Rinkeby": "", + "Kovan": "", + "Gorli": "", + "BSC": "", + "BSCT": "", + "Matic": "", + "Mumbai": "", + "Arbitrum": "", + "Arbitrum_Rinkeby": "", + "xDai": "", + "Avalanche": "", + "Avalanche_Fuji": "", + "Celo": "", + "Fantom": "", + "Aurora": "", + "Aurora_Testnet": "", + "Conflux": "", + "Harmony": "", + "Harmony_Test": "", + "Moonbeam": "0xcd3B51D98478D53F4515A306bE565c6EebeF1D58" } } diff --git a/packages/web3-constants/evm/trader.json b/packages/web3-constants/evm/trader.json index 53359b41f2ea..b4617dd748d0 100644 --- a/packages/web3-constants/evm/trader.json +++ b/packages/web3-constants/evm/trader.json @@ -20,7 +20,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "UNISWAP_V2_FACTORY_ADDRESS": { "Mainnet": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f", @@ -43,7 +44,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "UNISWAP_V2_THEGRAPH": { "Mainnet": "https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v2", @@ -66,7 +68,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "UNISWAP_V2_INIT_CODE_HASH": { "Mainnet": "0x96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f", @@ -89,7 +92,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "UNISWAP_SWAP_ROUTER_ADDRESS": { "Mainnet": "0xe592427a0aece92de3edee1f18e0157c05861564", @@ -112,7 +116,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "UNISWAP_V3_FACTORY_ADDRESS": { "Mainnet": "0x1F98431c8aD98523631AE4a59f267346ea31F984", @@ -135,7 +140,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "UNISWAP_V3_QUOTER_ADDRESS": { "Mainnet": "0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6", @@ -158,7 +164,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "UNISWAP_V3_THEGRAPH": { "Mainnet": "https://api.thegraph.com/subgraphs/name/uniswap/uniswap-v3", @@ -181,7 +188,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "UNISWAP_V3_INIT_CODE_HASH": { "Mainnet": "0xe34f199b19b2b4f47f68442619d555527d244f78a3297ea89325f843f87b8b54", @@ -204,7 +212,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "SUSHISWAP_ROUTER_ADDRESS": { "Mainnet": "0xd9e1cE17f2641f24aE83637ab66a2cca9C378B9F", @@ -227,7 +236,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506", - "Harmony_Test": "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506" + "Harmony_Test": "0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506", + "Moonbeam": "" }, "SUSHISWAP_FACTORY_ADDRESS": { "Mainnet": "0xC0AEe478e3658e2610c5F7A4A2E1777cE9e4f2Ac", @@ -250,7 +260,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0xc35DADB65012eC5796536bD9864eD8773aBc74C4", - "Harmony_Test": "0xc35DADB65012eC5796536bD9864eD8773aBc74C4" + "Harmony_Test": "0xc35DADB65012eC5796536bD9864eD8773aBc74C4", + "Moonbeam": "" }, "SUSHISWAP_THEGRAPH": { "Mainnet": "https://api.thegraph.com/subgraphs/name/zippoxer/sushiswap-subgraph-fork", @@ -273,7 +284,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "SUSHISWAP_INIT_CODE_HASH": { "Mainnet": "0xe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303", @@ -296,7 +308,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0xe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303", - "Harmony_Test": "0xe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303" + "Harmony_Test": "0xe18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303", + "Moonbeam": "" }, "SASHIMISWAP_ROUTER_ADDRESS": { "Mainnet": "0xe4fe6a45f354e845f954cddee6084603cedb9410", @@ -319,7 +332,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "SASHIMISWAP_FACTORY_ADDRESS": { "Mainnet": "0xF028F723ED1D0fE01cC59973C49298AA95c57472", @@ -342,7 +356,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "SASHIMISWAP_THEGRAPH": { "Mainnet": "https://api.thegraph.com/subgraphs/name/sashimiproject/sashimi", @@ -365,7 +380,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "SASHIMISWAP_INIT_CODE_HASH": { "Mainnet": "0xb465bbe4edb8c9b0da8ff0b2b36ce0065de9fcd5a33f32c6856ea821779c8b72", @@ -388,7 +404,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "QUICKSWAP_ROUTER_ADDRESS": { "Mainnet": "", @@ -411,7 +428,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "QUICKSWAP_FACTORY_ADDRESS": { "Mainnet": "", @@ -434,7 +452,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "QUICKSWAP_THEGRAPH": { "Mainnet": "", @@ -457,7 +476,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "QUICKSWAP_INIT_CODE_HASH": { "Mainnet": "", @@ -480,7 +500,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "PANCAKESWAP_ROUTER_ADDRESS": { "Mainnet": "", @@ -503,7 +524,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "PANCAKESWAP_FACTORY_ADDRESS": { "Mainnet": "", @@ -526,7 +548,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "PANCAKESWAP_THEGRAPH": { "Mainnet": "", @@ -549,7 +572,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "PANCAKESWAP_INIT_CODE_HASH": { "Mainnet": "", @@ -572,7 +596,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "BALANCER_ETH_ADDRESS": { "Mainnet": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", @@ -595,7 +620,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "BALANCER_EXCHANGE_PROXY_ADDRESS": { "Mainnet": "0x3E66B66Fd1d0b02fDa6C811Da9E0547970DB2f21", @@ -618,7 +644,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "BALANCER_POOLS_URL": { "Mainnet": "https://ipfs.fleek.co/ipns/balancer-bucket.storage.fleek.co/balancer-exchange/pools", @@ -641,7 +668,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "DODO_ETH_ADDRESS": { "Mainnet": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", @@ -664,7 +692,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "DODO_EXCHANGE_PROXY_ADDRESS": { "Mainnet": "0xCB859eA579b28e02B87A1FDE08d087ab9dbE5149", @@ -687,7 +716,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "BANCOR_ETH_ADDRESS": { "Mainnet": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", @@ -710,7 +740,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "BANCOR_EXCHANGE_PROXY_ADDRESS": { "Mainnet": "0x2F9EC37d6CcFFf1caB21733BdaDEdE11c823cCB0", @@ -733,7 +764,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "TRADERJOE_ROUTER_ADDRESS": { "Mainnet": "", @@ -756,7 +788,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "TRADERJOE_FACTORY_ADDRESS": { "Mainnet": "", @@ -779,7 +812,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "TRADERJOE_THEGRAPH": { "Mainnet": "https://api.thegraph.com/subgraphs/name/traderjoe-xyz/exchange", @@ -802,7 +836,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "TRADERJOE_INIT_CODE_HASH": { "Mainnet": "", @@ -825,7 +860,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "OPENOCEAN_ETH_ADDRESS": { "Mainnet": "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE", @@ -848,7 +884,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "OPENOCEAN_EXCHANGE_PROXY_ADDRESS": { "Mainnet": "0x6352a56caadC4F1E25CD6c75970Fa768A3304e64", @@ -871,7 +908,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "PANGOLIN_ROUTER_ADDRESS": { "Mainnet": "", @@ -894,7 +932,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "PANGOLIN_FACTORY_ADDRESS": { "Mainnet": "", @@ -917,7 +956,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "PANGOLIN_THEGRAPH": { "Mainnet": "", @@ -940,7 +980,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "PANGOLIN_INIT_CODE_HASH": { "Mainnet": "", @@ -963,7 +1004,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "WANNASWAP_ROUTER_V2_ADDRESS": { "Mainnet": "", @@ -986,7 +1028,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "WANNASWAP_ROUTER_ADDRESS": { "Mainnet": "", @@ -1009,7 +1052,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "WANNASWAP_FACTORY_ADDRESS": { "Mainnet": "", @@ -1032,7 +1076,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "WANNASWAP_THEGRAPH": { "Mainnet": "", @@ -1055,7 +1100,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "WANNASWAP_INIT_CODE_HASH": { "Mainnet": "", @@ -1078,7 +1124,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "TRISOLARIS_ROUTER_ADDRESS": { "Mainnet": "", @@ -1101,7 +1148,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "TRISOLARIS_FACTORY_ADDRESS": { "Mainnet": "", @@ -1124,7 +1172,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "TRISOLARIS_THEGRAPH": { "Mainnet": "", @@ -1147,7 +1196,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "TRISOLARIS_INIT_CODE_HASH": { "Mainnet": "", @@ -1170,7 +1220,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "MDEX_ROUTER_ADDRESS": { "Mainnet": "0x74119c3bca85bEA0538A62319a79b4a372590B47", @@ -1193,7 +1244,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "MDEX_FACTORY_ADDRESS": { "Mainnet": "0x7DAe51BD3E3376B8c7c4900E9107f12Be3AF1bA8", @@ -1216,7 +1268,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "MDEX_THEGRAPH": { "Mainnet": "", @@ -1239,7 +1292,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "MDEX_INIT_CODE_HASH": { "Mainnet": "0x8ecc069c645df696f2ca5116ab459c5c2889f299e73c1b208aaa3cdd7d110b16", @@ -1262,7 +1316,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "VENOMSWAP_ROUTER_ADDRESS": { "Mainnet": "", @@ -1285,7 +1340,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0xf012702a5f0e54015362cbca26a26fc90aa832a3", - "Harmony_Test": "0x8e9A3cE409B13ef459fE4448aE97a79d6Ecd8b4b" + "Harmony_Test": "0x8e9A3cE409B13ef459fE4448aE97a79d6Ecd8b4b", + "Moonbeam": "" }, "VENOMSWAP_FACTORY_ADDRESS": { "Mainnet": "", @@ -1308,7 +1364,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0x7D02c116b98d0965ba7B642ace0183ad8b8D2196", - "Harmony_Test": "0x066bafafC84607a956967F6f050bD14A8347952F" + "Harmony_Test": "0x066bafafC84607a956967F6f050bD14A8347952F", + "Moonbeam": "" }, "VENOMSWAP_THEGRAPH": { "Mainnet": "", @@ -1331,7 +1388,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "VENOMSWAP_INIT_CODE_HASH": { "Mainnet": "", @@ -1354,7 +1412,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0x162f79e638367cd45a118c778971dfd8d96c625d2798d3b71994b035cfe9b6dc", - "Harmony_Test": "0x162f79e638367cd45a118c778971dfd8d96c625d2798d3b71994b035cfe9b6dc" + "Harmony_Test": "0x162f79e638367cd45a118c778971dfd8d96c625d2798d3b71994b035cfe9b6dc", + "Moonbeam": "" }, "OPENSWAP_ROUTER_ADDRESS": { "Mainnet": "", @@ -1377,7 +1436,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0x2F99992024DCC51324BA4956bB1c510F36FA54F5", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "OPENSWAP_FACTORY_ADDRESS": { "Mainnet": "", @@ -1400,7 +1460,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0x5d2F9817303b940C9bB4F47C8C566c5C034d9848", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "OPENSWAP_THEGRAPH": { "Mainnet": "", @@ -1423,7 +1484,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "OPENSWAP_INIT_CODE_HASH": { "Mainnet": "", @@ -1446,7 +1508,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0x613b6eaa34b43dcb7eb8881dd4b5af85805be104d5f2f385304ffa8bda5e219c", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "DEFIKINGDOMS_ROUTER_ADDRESS": { "Mainnet": "", @@ -1469,7 +1532,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0x24ad62502d1C652Cc7684081169D04896aC20f30", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "DEFIKINGDOMS_FACTORY_ADDRESS": { "Mainnet": "", @@ -1492,7 +1556,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0x9014B937069918bd319f80e8B3BB4A2cf6FAA5F7", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "DEFIKINGDOMS_THEGRAPH": { "Mainnet": "", @@ -1515,7 +1580,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "DEFIKINGDOMS_INIT_CODE_HASH": { "Mainnet": "", @@ -1538,7 +1604,8 @@ "Aurora_Testnet": "", "Conflux": "", "Harmony": "0xf1c21a825f13eff153022ddea53156462dd79972b6f88adf06f79ca8b042c3c1", - "Harmony_Test": "" + "Harmony_Test": "", + "Moonbeam": "" }, "BEAMSWAP_ROUTER_ADDRESS": { "Mainnet": "", diff --git a/packages/web3-shared/evm/constants/tokens.ts b/packages/web3-shared/evm/constants/tokens.ts index 2d9a2e22a55f..3c3efee6a3ed 100644 --- a/packages/web3-shared/evm/constants/tokens.ts +++ b/packages/web3-shared/evm/constants/tokens.ts @@ -53,6 +53,7 @@ export const ZLK = createERC20Tokens('ZLK_ADDRESS', 'Zenlink Network Token ', 'Z export const VIPER = createERC20Tokens('VIPER_ADDRESS', 'Viper', 'VIPER', 18) export const OPENX = createERC20Tokens('OPENX_ADDRESS', 'OpenSwap Token', 'OpenX', 18) export const JEWEL = createERC20Tokens('JEWEL_ADDRESS', 'Jewels', 'JEWEL', 18) +export const GLINT = createERC20Tokens('GLINT_ADDRESS', 'Beamswap Token', 'GLINT', 18) export const WNATIVE = createERC20Tokens( 'WNATIVE_ADDRESS', From bfeb569faaf582203bef084af40e0fcb9a77c942 Mon Sep 17 00:00:00 2001 From: codingsh Date: Mon, 16 May 2022 20:23:41 +0100 Subject: [PATCH 18/24] chore(moonbeam): add zenlink dex on getContractOwnerDomain --- packages/mask/shared-ui/locales/en-US.json | 1 - packages/web3-constants/evm/token-list.json | 2 +- .../web3-shared/evm/constants/getContractOwnerDomain.ts | 1 + packages/web3-shared/evm/pipes/index.ts | 8 ++++---- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/mask/shared-ui/locales/en-US.json b/packages/mask/shared-ui/locales/en-US.json index c97bf81ed945..7331c936d720 100644 --- a/packages/mask/shared-ui/locales/en-US.json +++ b/packages/mask/shared-ui/locales/en-US.json @@ -65,7 +65,6 @@ "compose_encrypt_visible_to_private": "Private", "compose_encrypt_visible_to_private_sub": "Just Me", "compose_shared_friends": "1 friend", - "compose_shared_friends_other": "{{count}} friends", "compose_encrypt_visible_to_share": "Share with", "compose_encrypt_visible_to_share_sub": "Just Selected Contacts", "compose_encrypt_share_dialog_empty": "No encrypted friends, you can try searching.", diff --git a/packages/web3-constants/evm/token-list.json b/packages/web3-constants/evm/token-list.json index 4c67eefe715d..fb16a3faf1e4 100644 --- a/packages/web3-constants/evm/token-list.json +++ b/packages/web3-constants/evm/token-list.json @@ -21,6 +21,6 @@ "Conflux": ["https://tokens.r2d2.to/latest/1030/tokens.json"], "Harmony": ["https://tokens.r2d2.to/latest/1666600000/tokens.json"], "Harmony_Test": ["https://tokens.r2d2.to/latest/1666700000/tokens.json"], - "Moonbeam": ["https://tokens.r2d2.to/latest/1284/tokens.json"] + "Moonbeam": ["https://token-list.sushi.com/", "https://tokens.r2d2.to/latest/1284/tokens.json"] } } diff --git a/packages/web3-shared/evm/constants/getContractOwnerDomain.ts b/packages/web3-shared/evm/constants/getContractOwnerDomain.ts index ae6757dc5d64..f4a669495c78 100644 --- a/packages/web3-shared/evm/constants/getContractOwnerDomain.ts +++ b/packages/web3-shared/evm/constants/getContractOwnerDomain.ts @@ -47,6 +47,7 @@ const domainAddressMap: Record = { 'WANNASWAP_ROUTER_ADDRESS', 'WANNASWAP_FACTORY_ADDRESS', ]), + 'dex.zenlink.pro': collect(Trader, ['ZENLINK_ROUTER_ADDRESS', 'ZENLINK_FACTORY_ADDRESS']), 'www.trisolaris.io': collect(Trader, ['TRISOLARIS_ROUTER_ADDRESS', 'TRISOLARIS_FACTORY_ADDRESS']), 'mdex.com': collect(Trader, ['MDEX_ROUTER_ADDRESS', 'MDEX_FACTORY_ADDRESS']), 'aave.com': collect(Aave, ['AAVE_LENDING_POOL_ADDRESSES_PROVIDER_CONTRACT_ADDRESS']), diff --git a/packages/web3-shared/evm/pipes/index.ts b/packages/web3-shared/evm/pipes/index.ts index 1752ff4a03a7..d4a7f03e2da2 100644 --- a/packages/web3-shared/evm/pipes/index.ts +++ b/packages/web3-shared/evm/pipes/index.ts @@ -163,10 +163,10 @@ export const resolveChainColor = createLookupTableResolver( [ChainId.Harmony_Test]: 'rgb(48, 153, 242)', [ChainId.Aurora_Testnet]: 'rgb(112, 212, 74)', [ChainId.Moonbeam]: 'rgb(127, 39, 88)', - [ChainId.Fuse]: 'rgb(255 255 255)', - [ChainId.Boba]: 'rgb(255 255 255)', - [ChainId.Metis]: 'rgb(255 255 255)', - [ChainId.Optimistic]: 'rgb(255 255 255)', + [ChainId.Fuse]: 'rgb(112, 212, 74)', + [ChainId.Boba]: 'rgb(112, 212, 74)', + [ChainId.Metis]: 'rgb(19, 181, 236)', + [ChainId.Optimistic]: 'rgb(232, 65, 66)', }, 'rgb(214, 217, 220)', ) From 14b576e87b4e15b864739520350eb7389631a24c Mon Sep 17 00:00:00 2001 From: codingsh Date: Tue, 24 May 2022 00:40:53 +0100 Subject: [PATCH 19/24] chore(moonbeam): update rpcs and enalbe 1559 --- .../popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx | 1 + .../SNSAdaptor/GasSettingDialog/Prior1559GasSetting.tsx | 1 + packages/web3-constants/evm/rpc.json | 7 ++++++- packages/web3-constants/evm/token-asset-base-url.json | 5 +---- packages/web3-constants/evm/token-list.json | 2 +- packages/web3-constants/evm/token.json | 2 +- packages/web3-shared/evm/assets/chains.json | 2 +- 7 files changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/mask/src/extension/popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx b/packages/mask/src/extension/popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx index fcbc87fb0df9..af40584f9d57 100644 --- a/packages/mask/src/extension/popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx +++ b/packages/mask/src/extension/popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx @@ -97,6 +97,7 @@ const minGasPriceOfChain: ChainIdOptionalRecord = { [ChainId.BSC]: pow10(9).multipliedBy(5), // 5 Gwei [ChainId.Conflux]: pow10(9).multipliedBy(5), // 5 Gwei [ChainId.Matic]: pow10(9).multipliedBy(30), // 30 Gwei + [ChainId.Moonbeam]: pow10(9).multipliedBy(1), // 1 Gwei } export const Prior1559GasSetting = memo(() => { diff --git a/packages/mask/src/plugins/Wallet/SNSAdaptor/GasSettingDialog/Prior1559GasSetting.tsx b/packages/mask/src/plugins/Wallet/SNSAdaptor/GasSettingDialog/Prior1559GasSetting.tsx index 725775c21af7..8612e33a3319 100644 --- a/packages/mask/src/plugins/Wallet/SNSAdaptor/GasSettingDialog/Prior1559GasSetting.tsx +++ b/packages/mask/src/plugins/Wallet/SNSAdaptor/GasSettingDialog/Prior1559GasSetting.tsx @@ -29,6 +29,7 @@ const minGasPriceOfChain: ChainIdOptionalRecord = { [ChainId.BSC]: pow10(9).multipliedBy(5), // 5 Gwei [ChainId.Conflux]: pow10(9).multipliedBy(5), // 5 Gwei [ChainId.Matic]: pow10(9).multipliedBy(30), // 30 Gwei + [ChainId.Moonbeam]: pow10(9).multipliedBy(1), // 1 Gwei } export const Prior1559GasSetting: FC = memo( diff --git a/packages/web3-constants/evm/rpc.json b/packages/web3-constants/evm/rpc.json index 74f2fddf7663..dfda4bce9d6e 100644 --- a/packages/web3-constants/evm/rpc.json +++ b/packages/web3-constants/evm/rpc.json @@ -69,7 +69,12 @@ "https://rpc.hermesdefi.io/" ], "Harmony_Test": ["https://api.s0.b.hmny.io/"], - "Moonbeam": ["https://rpc.api.moonbeam.network"] + "Moonbeam": [ + "https://moonbeam.api.onfinality.io/rpc?apikey=e5e810e6-6162-4427-8ba3-d5ad8b9cf4c0", + "https://moonbeam.blastapi.io/905553b4-5acd-4f24-b473-ebca226a76c4", + "https://moonbeam.public.blastapi.io", + "https://moonbeam.api.onfinality.io/public" + ] }, "RPC_WEIGHTS": { "Mainnet": [0, 1, 2, 3, 4], diff --git a/packages/web3-constants/evm/token-asset-base-url.json b/packages/web3-constants/evm/token-asset-base-url.json index 4f63ae4b6d60..2e1a91e0bfbe 100644 --- a/packages/web3-constants/evm/token-asset-base-url.json +++ b/packages/web3-constants/evm/token-asset-base-url.json @@ -54,9 +54,6 @@ "https://rawcdn.githack.com/dimensiondev/assets/master/blockchains/harmony" ], "Harmony_Test": [], - "Moonbeam": [ - "https://raw.githubusercontent.com/dimensiondev/assets/master/blockchains/moonbeam", - "https://rawcdn.githack.com/dimensiondev/assets/master/blockchains/moonbeam" - ] + "Moonbeam": [] } } diff --git a/packages/web3-constants/evm/token-list.json b/packages/web3-constants/evm/token-list.json index fb16a3faf1e4..7e41e3f00a5b 100644 --- a/packages/web3-constants/evm/token-list.json +++ b/packages/web3-constants/evm/token-list.json @@ -21,6 +21,6 @@ "Conflux": ["https://tokens.r2d2.to/latest/1030/tokens.json"], "Harmony": ["https://tokens.r2d2.to/latest/1666600000/tokens.json"], "Harmony_Test": ["https://tokens.r2d2.to/latest/1666700000/tokens.json"], - "Moonbeam": ["https://token-list.sushi.com/", "https://tokens.r2d2.to/latest/1284/tokens.json"] + "Moonbeam": ["https://token-list.sushi.com/"] } } diff --git a/packages/web3-constants/evm/token.json b/packages/web3-constants/evm/token.json index a86397e9bc83..41e85e88e733 100644 --- a/packages/web3-constants/evm/token.json +++ b/packages/web3-constants/evm/token.json @@ -21,7 +21,7 @@ "Conflux": "", "Harmony": "0xcF664087a5bB0237a0BAd6742852ec6c8d69A27a", "Harmony_Test": "", - "Moonbeam": "0xacc15dc74880c9944775448304b263d191c6077f" + "Moonbeam": "0xAcc15dC74880C9944775448304B263D191c6077F" }, "LDO_stETH_ADDRESS": { "Mainnet": "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84", diff --git a/packages/web3-shared/evm/assets/chains.json b/packages/web3-shared/evm/assets/chains.json index 2e32c98efb90..7e66a00a2a15 100644 --- a/packages/web3-shared/evm/assets/chains.json +++ b/packages/web3-shared/evm/assets/chains.json @@ -1695,7 +1695,7 @@ "name": "Moonbeam Polkadot", "chain": "Moonbeam", "network": "mainnet", - "rpc": ["https://rpc.api.moonbeam.network"], + "rpc": ["https://moonbeam.blastapi.io/905553b4-5acd-4f24-b473-ebca226a76c4"], "faucets": [], "features": ["EIP1559"], "nativeCurrency": { "name": "Glimmer", "symbol": "GLMR", "decimals": 18 }, From 6e185f54b18aa0a9eea875f034d1e90e961a869f Mon Sep 17 00:00:00 2001 From: nuanyang233 Date: Thu, 26 May 2022 17:34:15 +0800 Subject: [PATCH 20/24] fix: add missing deps (#6356) --- .../src/components/InjectedComponents/ProfileTabContent.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mask/src/components/InjectedComponents/ProfileTabContent.tsx b/packages/mask/src/components/InjectedComponents/ProfileTabContent.tsx index 0487f9d1b095..aaf461822524 100644 --- a/packages/mask/src/components/InjectedComponents/ProfileTabContent.tsx +++ b/packages/mask/src/components/InjectedComponents/ProfileTabContent.tsx @@ -124,7 +124,7 @@ export function ProfileTabContent(props: ProfileTabContentProps) { ? displayPlugins?.find((tab) => tab?.pluginID === PluginId.NextID)?.ID : selectedTabId return getTabContent(tabId ?? '') - }, [selectedTabId, identity.identifier?.userId]) + }, [selectedTabId, identity.identifier?.userId, currentAccountNotConnectPersona]) if (hidden) return null From 836f5f5535702cd8ad948a320f7eee88d142f3ba Mon Sep 17 00:00:00 2001 From: Hancheng Zhou Date: Thu, 26 May 2022 17:44:11 +0800 Subject: [PATCH 21/24] fix(ui): claim button && mind fb tool box hint (#6337) --- cspell.json | 1 + .../InjectedComponents/ToolboxUnstyled.tsx | 5 ++++- .../DashboardComponents/ActionButton.tsx | 21 +++++++++++++++---- .../plugins/ITO/SNSAdaptor/ClaimAllDialog.tsx | 2 ++ .../facebook.com/injection/Toolbar.tsx | 3 ++- .../facebook.com/injection/ToolbarUI.tsx | 19 +++++++++-------- .../minds.com/customization/custom.ts | 3 +++ .../minds.com/injection/ToolboxHint_UI.tsx | 4 ++-- .../minds.com/utils/selector.ts | 4 +--- .../src/web3/UI/EthereumChainBoundary.tsx | 3 +++ 10 files changed, 45 insertions(+), 20 deletions(-) diff --git a/cspell.json b/cspell.json index 28e4e04fbc54..4dbe240d7ac5 100644 --- a/cspell.json +++ b/cspell.json @@ -286,6 +286,7 @@ "redpackets", "renfil", "shapeclip", + "ssrb", "steth", "swaptoken", "testweb", diff --git a/packages/mask/src/components/InjectedComponents/ToolboxUnstyled.tsx b/packages/mask/src/components/InjectedComponents/ToolboxUnstyled.tsx index 106098381aeb..6a2593c93cca 100644 --- a/packages/mask/src/components/InjectedComponents/ToolboxUnstyled.tsx +++ b/packages/mask/src/components/InjectedComponents/ToolboxUnstyled.tsx @@ -91,6 +91,7 @@ export function ToolboxHintUnstyled(props: ToolboxHintProps) { function ToolboxHintForApplication(props: ToolboxHintProps) { const { ListItemButton = MuiListItemButton, + ListItemIcon = MuiListItemIcon, Container = 'div', Typography = MuiTypography, iconSize = 24, @@ -104,7 +105,9 @@ function ToolboxHintForApplication(props: ToolboxHintProps) { - + + + {mini ? null : ( ('init') - const completeClass = classNames(classes.success, b.className) - const failClass = classNames(classes.failed, b.className) + const basicClass = classNames(classes.button, b.className) + const completeClass = classNames(basicClass, classes.success) + const failClass = classNames(basicClass, classes.failed) const run = () => { setState('wait') @@ -144,7 +145,16 @@ export function ActionButtonPromise(props: ActionButtonPromiseProps) { }, [executor, noUpdateEffect]) if (state === 'wait') - return ) @@ -155,12 +157,12 @@ export function PreviewCard(props: PreviewCardProps) {
- {t('plugin_gitcoin_last_updated')} {grant.last_update_natural} + {t.last_updated()} {grant.last_update_natural}
- {t('plugin_gitcoin_by')} + {t.by()} - {t('plugin_gitcoin_view_on')} + {t.view_on()} @@ -199,7 +201,7 @@ export function PreviewCard(props: PreviewCardProps) { color: 'white', }} onClick={onDonate}> - {t('plugin_gitcoin_donate')} + {t.donate()} diff --git a/packages/mask/src/plugins/Gitcoin/SNSAdaptor/index.tsx b/packages/mask/src/plugins/Gitcoin/SNSAdaptor/index.tsx index 956f016b34d3..1ffb8a4109eb 100644 --- a/packages/mask/src/plugins/Gitcoin/SNSAdaptor/index.tsx +++ b/packages/mask/src/plugins/Gitcoin/SNSAdaptor/index.tsx @@ -1,18 +1,15 @@ -import { useMemo } from 'react' -import { ChainId } from '@masknet/web3-shared-evm' -import { usePostInfoDetails, Plugin, usePluginWrapper } from '@masknet/plugin-infra/content-script' -import { NetworkPluginID, useChainId } from '@masknet/plugin-infra/web3' -import { extractTextFromTypedMessage } from '@masknet/typed-message' -import { parseURL } from '@masknet/shared-base' import { GitcoinIcon } from '@masknet/icons' -import { PreviewCard } from './PreviewCard' +import { Plugin, PluginId, usePluginWrapper, usePostInfoDetails } from '@masknet/plugin-infra/content-script' +import { parseURL } from '@masknet/shared-base' +import { extractTextFromTypedMessage } from '@masknet/typed-message' +import { useMemo } from 'react' import { Trans } from 'react-i18next' import { base } from '../base' -import { PLUGIN_NAME, PLUGIN_META_KEY } from '../constants' +import { PLUGIN_META_KEY, PLUGIN_NAME } from '../constants' import { DonateDialog } from './DonateDialog' +import { PreviewCard } from './PreviewCard' const isGitcoin = (x: string): boolean => /^https:\/\/gitcoin.co\/grants\/\d+/.test(x) -const isGitCoinSupported = (chainId: ChainId) => [ChainId.Mainnet, ChainId.Matic].includes(chainId) const sns: Plugin.SNSAdaptor.Definition = { ...base, @@ -41,8 +38,8 @@ const sns: Plugin.SNSAdaptor.Definition = { { ApplicationEntryID: base.ID, category: 'dapp', - description: , - name: , + description: , + name: , icon: , marketListSortingPriority: 9, tutorialLink: 'https://realmasknetwork.notion.site/98ed83784ed4446a8a13fa685c7bddfb', @@ -52,7 +49,6 @@ const sns: Plugin.SNSAdaptor.Definition = { function Renderer(props: React.PropsWithChildren<{ url: string }>) { const [id = ''] = props.url.match(/\d+/) ?? [] - const chainId = useChainId(NetworkPluginID.PLUGIN_EVM) usePluginWrapper(true) return } diff --git a/packages/mask/src/plugins/Gitcoin/base.ts b/packages/mask/src/plugins/Gitcoin/base.ts index 2ba903193d15..399adeb050cb 100644 --- a/packages/mask/src/plugins/Gitcoin/base.ts +++ b/packages/mask/src/plugins/Gitcoin/base.ts @@ -2,6 +2,7 @@ import type { Plugin } from '@masknet/plugin-infra' import { NetworkPluginID } from '@masknet/plugin-infra/web3' import { ChainId } from '@masknet/web3-shared-evm' import { PLUGIN_ID, PLUGIN_NAME, PLUGIN_DESCRIPTION } from './constants' +import { languages } from './locales/languages' export const base: Plugin.Shared.Definition = { ID: PLUGIN_ID, @@ -21,4 +22,5 @@ export const base: Plugin.Shared.Definition = { }, }, contribution: { postContent: new Set([/https:\/\/gitcoin.co\/grants\/\d+/]) }, + i18n: languages, } diff --git a/packages/mask/src/plugins/Gitcoin/locales/en-US.json b/packages/mask/src/plugins/Gitcoin/locales/en-US.json new file mode 100644 index 000000000000..96bdf7b52625 --- /dev/null +++ b/packages/mask/src/plugins/Gitcoin/locales/en-US.json @@ -0,0 +1,15 @@ +{ + "name": "Gitcoin", + "description": "Display specific information of Gitcoin projects, donate to a project directly on social media.", + "promote": "Share or browse Gitcoin projects you have donated or interested in.", + "select_a_token": "Select a token", + "grant_not_available": "Grant not available", + "enter_an_amount": "Enter an amount", + "insufficient_balance": "Insufficient {{symbol}} balance", + "gitcoin_readme": "By using this service, you will also be contributing 5% of your contribution to the Gitcoin grants development fund.", + "donate": "Donate", + "last_updated": "Last update:", + "by": "By", + "view_on": "View on Gitcoin", + "readme_fund_link": "https://gitcoin.co/grants/86/gitcoin-sustainability-fund" +} diff --git a/packages/mask/src/plugins/Gitcoin/locales/index.ts b/packages/mask/src/plugins/Gitcoin/locales/index.ts new file mode 100644 index 000000000000..d6ead60252e4 --- /dev/null +++ b/packages/mask/src/plugins/Gitcoin/locales/index.ts @@ -0,0 +1,6 @@ +// This file is auto generated. DO NOT EDIT +// Run `npx gulp sync-languages` to regenerate. +// Default fallback language in a family of languages are chosen by the alphabet order +// To overwrite this, please overwrite packages/scripts/src/locale-kit-next/index.ts + +export * from './i18n_generated' diff --git a/packages/mask/src/plugins/Gitcoin/locales/ja-JP.json b/packages/mask/src/plugins/Gitcoin/locales/ja-JP.json new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/packages/mask/src/plugins/Gitcoin/locales/ja-JP.json @@ -0,0 +1 @@ +{} diff --git a/packages/mask/src/plugins/Gitcoin/locales/ko-KR.json b/packages/mask/src/plugins/Gitcoin/locales/ko-KR.json new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/packages/mask/src/plugins/Gitcoin/locales/ko-KR.json @@ -0,0 +1 @@ +{} diff --git a/packages/mask/src/plugins/Gitcoin/locales/languages.ts b/packages/mask/src/plugins/Gitcoin/locales/languages.ts new file mode 100644 index 000000000000..9b496c047c8a --- /dev/null +++ b/packages/mask/src/plugins/Gitcoin/locales/languages.ts @@ -0,0 +1,34 @@ +// This file is auto generated. DO NOT EDIT +// Run `npx gulp sync-languages` to regenerate. +// Default fallback language in a family of languages are chosen by the alphabet order +// To overwrite this, please overwrite packages/scripts/src/locale-kit-next/index.ts +import en_US from './en-US.json' +import ja_JP from './ja-JP.json' +import ko_KR from './ko-KR.json' +import qya_AA from './qya-AA.json' +import zh_CN from './zh-CN.json' +import zh_TW from './zh-TW.json' +export const languages = { + en: en_US, + ja: ja_JP, + ko: ko_KR, + qy: qya_AA, + 'zh-CN': zh_CN, + zh: zh_TW, +} +// @ts-ignore +if (import.meta.webpackHot) { + // @ts-ignore + import.meta.webpackHot.accept( + ['./en-US.json', './ja-JP.json', './ko-KR.json', './qya-AA.json', './zh-CN.json', './zh-TW.json'], + () => + globalThis.dispatchEvent?.( + new CustomEvent('MASK_I18N_HMR', { + detail: [ + 'com.maskbook.gitcoin', + { en: en_US, ja: ja_JP, ko: ko_KR, qy: qya_AA, 'zh-CN': zh_CN, zh: zh_TW }, + ], + }), + ), + ) +} diff --git a/packages/mask/src/plugins/Gitcoin/locales/qya-AA.json b/packages/mask/src/plugins/Gitcoin/locales/qya-AA.json new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/packages/mask/src/plugins/Gitcoin/locales/qya-AA.json @@ -0,0 +1 @@ +{} diff --git a/packages/mask/src/plugins/Gitcoin/locales/zh-CN.json b/packages/mask/src/plugins/Gitcoin/locales/zh-CN.json new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/packages/mask/src/plugins/Gitcoin/locales/zh-CN.json @@ -0,0 +1 @@ +{} diff --git a/packages/mask/src/plugins/Gitcoin/locales/zh-TW.json b/packages/mask/src/plugins/Gitcoin/locales/zh-TW.json new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/packages/mask/src/plugins/Gitcoin/locales/zh-TW.json @@ -0,0 +1 @@ +{} diff --git a/packages/mask/src/plugins/ITO/SNSAdaptor/ITO.tsx b/packages/mask/src/plugins/ITO/SNSAdaptor/ITO.tsx index 7b761a3bb0fb..325506b44221 100644 --- a/packages/mask/src/plugins/ITO/SNSAdaptor/ITO.tsx +++ b/packages/mask/src/plugins/ITO/SNSAdaptor/ITO.tsx @@ -5,12 +5,9 @@ import { FungibleTokenDetailed, getChainDetailed, isSameAddress, - currySameAddress, resolveLinkOnExplorer, - TransactionStateType, useAccount, useChainId, - useChainIdValid, useTokenConstants, isNativeTokenAddress, } from '@masknet/web3-shared-evm' @@ -246,8 +243,7 @@ export function ITO(props: ITO_Props) { const account = useAccount() const postLink = usePostLink() const chainId = useChainId() - const chainIdValid = useChainIdValid() - const [destructState, destructCallback, resetDestructCallback] = useDestructCallback(props.payload.contract_address) + const [, destructCallback] = useDestructCallback(props.payload.contract_address) const [openClaimDialog, setOpenClaimDialog] = useState(false) const [claimDialogStatus, setClaimDialogStatus] = useState(SwapStatus.Remind) @@ -414,23 +410,8 @@ export function ITO(props: ITO_Props) { return () => clearTimeout(timer) }, [endTime, listOfStatus]) - useEffect(() => { - if (destructState.type === TransactionStateType.UNKNOWN || !canWithdraw) return - let summary = t('plugin_ito_withdraw') - if (!noRemain) { - summary += ' ' + formatBalance(total_remaining, token.decimals) + ' ' + token.symbol - } - availability?.exchange_addrs.forEach((addr, i) => { - const token = exchange_tokens.find(currySameAddress(addr)) - const comma = noRemain && i === 0 ? ' ' : ', ' - if (token) { - summary += comma + formatBalance(availability?.exchanged_tokens[i], token.decimals) + ' ' + token.symbol - } - }) - }, [destructState, canWithdraw]) - const onWithdraw = useCallback(async () => { - destructCallback(payload.pid) + await destructCallback(payload.pid) }, [destructCallback, payload.pid]) // #endregion diff --git a/packages/mask/src/plugins/ITO/SNSAdaptor/NftAirdropCard.tsx b/packages/mask/src/plugins/ITO/SNSAdaptor/NftAirdropCard.tsx index 7190867404a9..f4eaba6d32be 100644 --- a/packages/mask/src/plugins/ITO/SNSAdaptor/NftAirdropCard.tsx +++ b/packages/mask/src/plugins/ITO/SNSAdaptor/NftAirdropCard.tsx @@ -1,17 +1,11 @@ import formatDateTime from 'date-fns/format' -import { - ChainId, - TransactionStateType, - useAccount, - resolveTransactionLinkOnExplorer, - useChainId, -} from '@masknet/web3-shared-evm' +import { ChainId, useAccount, resolveTransactionLinkOnExplorer, useChainId } from '@masknet/web3-shared-evm' import { EthereumWalletConnectedBoundary } from '../../../web3/UI/EthereumWalletConnectedBoundary' import { Box, Typography, Button, TextField, CircularProgress, Link } from '@mui/material' import { useSpaceStationClaimableTokenCountCallback } from './hooks/useSpaceStationClaimableTokenCountCallback' import { useSpaceStationContractClaimCallback } from './hooks/useSpaceStationContractClaimCallback' import { useI18N } from '../../../utils' -import { useState, useEffect } from 'react' +import { useState, useEffect, useCallback } from 'react' import { makeStyles, useCustomSnackbar, OptionsObject } from '@masknet/theme' import OpenInNewIcon from '@mui/icons-material/OpenInNew' import CloseIcon from '@mui/icons-material/Close' @@ -287,8 +281,9 @@ function ClaimItem(props: ClaimItemProps) { horizontal: 'center', }, } - useEffect(() => { - if (claimState.type === TransactionStateType.CONFIRMED && claimState.no === 0) { + const claim = useCallback(async () => { + const hash = await claimCallback() + if (typeof hash === 'string') { showSnackbar(
@@ -299,10 +294,7 @@ function ClaimItem(props: ClaimItemProps) { className={classes.whiteText} target="_blank" rel="noopener noreferrer" - href={resolveTransactionLinkOnExplorer( - ChainId.Mumbai, - claimState.receipt.transactionHash, - )}> + href={resolveTransactionLinkOnExplorer(ChainId.Mumbai, hash)}> @@ -316,7 +308,7 @@ function ClaimItem(props: ClaimItemProps) { ) retry() - } else if (claimState.type === TransactionStateType.FAILED) { + } else { showSnackbar(
@@ -331,7 +323,7 @@ function ClaimItem(props: ClaimItemProps) { } as OptionsObject, ) } - }, [claimState]) + }, [showSnackbar]) const unClaimable = now < campaignInfo.startTime * 1000 || @@ -359,17 +351,10 @@ function ClaimItem(props: ClaimItemProps) { unlockMetaMask: classNames(classes.actionButton, classes.connectWallet), }}> {claimed diff --git a/packages/mask/src/plugins/ITO/SNSAdaptor/PoolInList.tsx b/packages/mask/src/plugins/ITO/SNSAdaptor/PoolInList.tsx index e044f04798a5..67441435125f 100644 --- a/packages/mask/src/plugins/ITO/SNSAdaptor/PoolInList.tsx +++ b/packages/mask/src/plugins/ITO/SNSAdaptor/PoolInList.tsx @@ -5,7 +5,6 @@ import { FungibleTokenInitial, getChainDetailed, isSameAddress, - TransactionStateType, useAccount, useFungibleTokenDetailed, useFungibleTokensDetailed, @@ -35,10 +34,10 @@ import { useAvailabilityComputed } from './hooks/useAvailabilityComputed' import { usePoolTradeInfo } from './hooks/usePoolTradeInfo' import { ITO_Status, JSON_PayloadFromChain, JSON_PayloadInMask, PoolFromNetwork } from '../types' import { useDestructCallback } from './hooks/useDestructCallback' -import { useTransactionDialog } from '../../../web3/hooks/useTransactionDialog' import { omit } from 'lodash-unified' import { useSubscription } from 'use-subscription' import { PersistentStorages } from '../../../../shared' +import { useCallback } from 'react' const useStyles = makeStyles()((theme) => { const smallQuery = `@media (max-width: ${theme.breakpoints.values.sm}px)` @@ -175,11 +174,14 @@ export function PoolInList(props: PoolInListProps) { // #endregion // #region withdraw - const [destructState, destructCallback, resetDestructCallback] = useDestructCallback(pool.contract_address) - useTransactionDialog(null, destructState, TransactionStateType.CONFIRMED, () => { - onRetry() - resetDestructCallback() - }) + const [{ loading: destructing }, destructCallback] = useDestructCallback(pool.contract_address) + const destruct = useCallback( + async (pid: string) => { + await destructCallback(pid) + onRetry() + }, + [destructCallback, onRetry], + ) // #endregion const account = useAccount() @@ -202,7 +204,13 @@ export function PoolInList(props: PoolInListProps) { return ( <> {loadingTradeInfo || loadingAvailability ? null : canWithdraw ? ( - destructCallback(pool.pid)}> + destruct(pool.pid)}> {t('plugin_ito_withdraw')} ) : canSend ? ( diff --git a/packages/mask/src/plugins/ITO/SNSAdaptor/hooks/useDestructCallback.ts b/packages/mask/src/plugins/ITO/SNSAdaptor/hooks/useDestructCallback.ts index 2e736befd4e6..2176cfce5699 100644 --- a/packages/mask/src/plugins/ITO/SNSAdaptor/hooks/useDestructCallback.ts +++ b/packages/mask/src/plugins/ITO/SNSAdaptor/hooks/useDestructCallback.ts @@ -1,43 +1,22 @@ -import { useCallback } from 'react' -import type { TransactionReceipt } from 'web3-core' import type { NonPayableTx } from '@masknet/web3-contracts/types/types' -import { TransactionEventType, TransactionStateType, useAccount, useTransactionState } from '@masknet/web3-shared-evm' +import { TransactionEventType, useAccount } from '@masknet/web3-shared-evm' +import { useAsyncFn } from 'react-use' import { useITO_Contract } from './useITO_Contract' export function useDestructCallback(ito_address: string) { const account = useAccount() const { contract: ITO_Contract } = useITO_Contract(ito_address) - const [destructState, setDestructState] = useTransactionState() - const destructCallback = useCallback( + return useAsyncFn( async (id: string) => { - if (!ITO_Contract || !id) { - setDestructState({ - type: TransactionStateType.UNKNOWN, - }) - return - } - - // start waiting for provider to confirm tx - setDestructState({ - type: TransactionStateType.WAIT_FOR_CONFIRMING, - }) + if (!ITO_Contract || !id) return // estimate gas and compose transaction const config = { from: account, - gas: await ITO_Contract.methods - .destruct(id) - .estimateGas({ - from: account, - }) - .catch((error: Error) => { - setDestructState({ - type: TransactionStateType.FAILED, - error, - }) - throw error - }), + gas: await ITO_Contract.methods.destruct(id).estimateGas({ + from: account, + }), } // send transaction and wait for hash @@ -45,39 +24,14 @@ export function useDestructCallback(ito_address: string) { ITO_Contract.methods .destruct(id) .send(config as NonPayableTx) - .on(TransactionEventType.RECEIPT, (receipt: TransactionReceipt) => { - setDestructState({ - type: TransactionStateType.CONFIRMED, - no: 0, - receipt, - }) - resolve(receipt.transactionHash) - }) - .on(TransactionEventType.CONFIRMATION, (no: number, receipt: TransactionReceipt) => { - setDestructState({ - type: TransactionStateType.CONFIRMED, - no, - receipt, - }) + .on(TransactionEventType.CONFIRMATION, (no, receipt) => { resolve(receipt.transactionHash) }) .on(TransactionEventType.ERROR, (error: Error) => { - setDestructState({ - type: TransactionStateType.FAILED, - error, - }) reject(error) }) }) }, [ITO_Contract], ) - - const resetCallback = useCallback(() => { - setDestructState({ - type: TransactionStateType.UNKNOWN, - }) - }, []) - - return [destructState, destructCallback, resetCallback] as const } diff --git a/packages/mask/src/plugins/ITO/SNSAdaptor/hooks/useSpaceStationContractClaimCallback.ts b/packages/mask/src/plugins/ITO/SNSAdaptor/hooks/useSpaceStationContractClaimCallback.ts index 3ceca469f049..ab72cf70ea35 100644 --- a/packages/mask/src/plugins/ITO/SNSAdaptor/hooks/useSpaceStationContractClaimCallback.ts +++ b/packages/mask/src/plugins/ITO/SNSAdaptor/hooks/useSpaceStationContractClaimCallback.ts @@ -1,49 +1,28 @@ -import { useSpaceStationContract } from './useSpaceStationContract' -import { - useAccount, - useSpaceStationGalaxyConstants, - useTransactionState, - TransactionStateType, - TransactionEventType, -} from '@masknet/web3-shared-evm' -import { useCallback } from 'react' -import type { CampaignInfo } from '../../types' import type { SpaceStationGalaxy } from '@masknet/web3-contracts/types/SpaceStationGalaxy' import type { NonPayableTx } from '@masknet/web3-contracts/types/types' -import { getAccountClaimSignature, mutationParticipate } from '../../Worker/apis/spaceStationGalaxy' +import { TransactionEventType, useAccount, useSpaceStationGalaxyConstants } from '@masknet/web3-shared-evm' +import { useAsyncFn } from 'react-use' import Services from '../../../../extension/service' +import type { CampaignInfo } from '../../types' +import { getAccountClaimSignature, mutationParticipate } from '../../Worker/apis/spaceStationGalaxy' +import { useSpaceStationContract } from './useSpaceStationContract' export function useSpaceStationContractClaimCallback(campaignInfo: CampaignInfo) { const account = useAccount() const spaceStationContract = useSpaceStationContract() const { CONTRACT_ADDRESS } = useSpaceStationGalaxyConstants() - const [claimState, setClaimState] = useTransactionState() - const claimCallback = useCallback(async () => { + return useAsyncFn(async () => { if (!CONTRACT_ADDRESS || !spaceStationContract || !campaignInfo) { - setClaimState({ type: TransactionStateType.UNKNOWN }) return } - // start waiting for provider to confirm tx - setClaimState({ - type: TransactionStateType.WAIT_FOR_CONFIRMING, - }) - - let useSignature = '' - try { - useSignature = await Services.Ethereum.personalSign( - `${campaignInfo.name} + const useSignature = await Services.Ethereum.personalSign( + `${campaignInfo.name} ${campaignInfo.description}`, - account, - ) - } catch (error) { - setClaimState({ - type: TransactionStateType.FAILED, - error: new Error('Not allowed to claim.'), - }) - } + account, + ) const { allow, signature, verifyIDs, nftCoreAddress, powahs } = await getAccountClaimSignature( useSignature, @@ -53,10 +32,7 @@ ${campaignInfo.description}`, ) if (!allow) { - setClaimState({ - type: TransactionStateType.FAILED, - error: new Error('Not allowed to claim.'), - }) + throw new Error('Not allowed to claim.') } const params = [campaignInfo.id, nftCoreAddress, verifyIDs[0], powahs[0], signature] as Parameters< SpaceStationGalaxy['methods']['claim'] @@ -64,15 +40,9 @@ ${campaignInfo.description}`, // estimate gas and compose transaction const config = { from: account, - gas: await spaceStationContract.methods - .claim(...params) - .estimateGas({ from: account }) - .catch((error) => { - setClaimState({ type: TransactionStateType.FAILED, error }) - throw error - }), + gas: await spaceStationContract.methods.claim(...params).estimateGas({ from: account }), } - return new Promise(async (resolve, reject) => { + return new Promise(async (resolve, reject) => { spaceStationContract.methods .claim(...params) .send(config as NonPayableTx) @@ -87,39 +57,15 @@ ${campaignInfo.description}`, ) if (!participated) { - setClaimState({ - type: TransactionStateType.FAILED, - error: new Error('Failed to claim'), - }) + throw new Error('Failed to claim') } }) - .on(TransactionEventType.RECEIPT, (receipt) => { - setClaimState({ - type: TransactionStateType.CONFIRMED, - no: 0, - receipt, - }) - resolve() - }) .on(TransactionEventType.CONFIRMATION, (no, receipt) => { - setClaimState({ - type: TransactionStateType.CONFIRMED, - no, - receipt, - }) - resolve() + resolve(receipt.transactionHash) }) .on(TransactionEventType.ERROR, (error) => { - setClaimState({ - type: TransactionStateType.FAILED, - error, - }) reject(error) }) }) }, [account, campaignInfo, CONTRACT_ADDRESS, spaceStationContract]) - - const resetCallback = useCallback(() => {}, [setClaimState]) - - return [claimState, claimCallback, resetCallback] as const } diff --git a/packages/mask/src/plugins/MaskBox/SNSAdaptor/components/PreviewCard.tsx b/packages/mask/src/plugins/MaskBox/SNSAdaptor/components/PreviewCard.tsx index faff29761645..bacbc617e7b8 100644 --- a/packages/mask/src/plugins/MaskBox/SNSAdaptor/components/PreviewCard.tsx +++ b/packages/mask/src/plugins/MaskBox/SNSAdaptor/components/PreviewCard.tsx @@ -97,7 +97,7 @@ export function PreviewCard(props: PreviewCardProps) { }, [openBoxTransaction?.config, openBoxTransactionOverrides, openBoxTransactionGasLimit]) // #region open box - const [isOpening, openBoxCallback] = useTransactionCallback(txConfig, openBoxTransaction?.method) + const [{ loading: isOpening }, openBoxCallback] = useTransactionCallback(txConfig, openBoxTransaction?.method) const onRefresh = useCallback(() => { state[1](CardTab.Articles) setPaymentCount(1) diff --git a/packages/mask/src/plugins/RedPacket/SNSAdaptor/NftList.tsx b/packages/mask/src/plugins/RedPacket/SNSAdaptor/NftList.tsx index e26742b4bfd1..ba5f31bf2a4f 100644 --- a/packages/mask/src/plugins/RedPacket/SNSAdaptor/NftList.tsx +++ b/packages/mask/src/plugins/RedPacket/SNSAdaptor/NftList.tsx @@ -3,8 +3,8 @@ import { ERC721ContractDetailed, formatNFT_TokenId } from '@masknet/web3-shared- import { List, ListItem, ListProps, Typography } from '@mui/material' import classnames from 'classnames' import { FC, HTMLProps, useState } from 'react' -import { useI18N } from '../../../utils' import { NFTCardStyledAssetPlayer } from '@masknet/shared' +import { useI18N } from '../locales' const useStyles = makeStyles()((theme) => { const smallQuery = `@media (max-width: ${theme.breakpoints.values.sm}px)` @@ -99,7 +99,7 @@ interface NftItemProps extends HTMLProps { } export const NftItem: FC = ({ contract, tokenId, className, claimed, renderOrder, ...rest }) => { - const { t } = useI18N() + const t = useI18N() const { classes } = useStyles() const [name, setName] = useState(formatNFT_TokenId(tokenId, 2)) @@ -116,7 +116,7 @@ export const NftItem: FC = ({ contract, tokenId, className, claime setERC721TokenName={setName} /> {name} - {claimed && {t('plugin_red_packet_claimed')}} + {claimed && {t.claimed()}}
) } diff --git a/packages/mask/src/plugins/RedPacket/SNSAdaptor/NftRedPacketHistoryItem.tsx b/packages/mask/src/plugins/RedPacket/SNSAdaptor/NftRedPacketHistoryItem.tsx index 286a4d520610..1b767ead5a4f 100644 --- a/packages/mask/src/plugins/RedPacket/SNSAdaptor/NftRedPacketHistoryItem.tsx +++ b/packages/mask/src/plugins/RedPacket/SNSAdaptor/NftRedPacketHistoryItem.tsx @@ -1,5 +1,4 @@ import { FC, memo, MouseEventHandler, useCallback } from 'react' -import { Trans } from 'react-i18next' import classNames from 'classnames' import { fill } from 'lodash-unified' import { TokenIcon } from '@masknet/shared' @@ -9,12 +8,12 @@ import { WalletMessages } from '@masknet/plugin-wallet' import { ERC721ContractDetailed, useAccount, useERC721ContractDetailed } from '@masknet/web3-shared-evm' import { Box, ListItem, Typography } from '@mui/material' import ActionButton from '../../../extension/options-page/DashboardComponents/ActionButton' -import { useI18N } from '../../../utils/i18n-next-ui' import { dateTimeFormat } from '../../ITO/assets/formatDate' import type { NftRedPacketHistory } from '../types' import { useAvailabilityNftRedPacket } from './hooks/useAvailabilityNftRedPacket' import { useNftAvailabilityComputed } from './hooks/useNftAvailabilityComputed' import { NftList } from './NftList' +import { Translate, useI18N } from '../locales' const useStyles = makeStyles()((theme) => { const smallQuery = `@media (max-width: ${theme.breakpoints.values.sm}px)` @@ -150,7 +149,7 @@ export interface NftRedPacketHistoryItemProps { export const NftRedPacketHistoryItem: FC = memo( ({ history, onSend, onShowPopover, onHidePopover }) => { const account = useAccount() - const { t } = useI18N() + const t = useI18N() const { classes } = useStyles() const { computed: { canSend, isPasswordValid }, @@ -175,7 +174,7 @@ export const NftRedPacketHistoryItem: FC = memo( } } const handleShowPopover = (anchor: HTMLElement) => { - onShowPopover(anchor, t('plugin_nft_red_packet_data_broken')) + onShowPopover(anchor, t.nft_data_broken()) } return ( @@ -196,10 +195,10 @@ export const NftRedPacketHistoryItem: FC = memo( - {history.message === '' ? t('plugin_red_packet_best_wishes') : history.message} + {history.message === '' ? t.best_wishes() : history.message} - {t('plugin_red_packet_history_duration', { + {t.history_duration({ startTime: dateTimeFormat(new Date(history.creation_time)), endTime: dateTimeFormat( new Date(history.creation_time + history.duration), @@ -219,7 +218,7 @@ export const NftRedPacketHistoryItem: FC = memo( )} variant="contained" size="large"> - {t('plugin_red_packet_history_send')} + {t.send()} ) : null} @@ -237,14 +236,13 @@ export const NftRedPacketHistoryItem: FC = memo(
- , }} values={{ - claimedShares: history.claimers.length, - shares: history.shares, + claimedShares: history.claimers.length.toString(), + shares: history.shares.toString(), }} /> diff --git a/packages/mask/src/plugins/RedPacket/SNSAdaptor/NftRedPacketHistoryList.tsx b/packages/mask/src/plugins/RedPacket/SNSAdaptor/NftRedPacketHistoryList.tsx index 16affe48056f..dc8e88b63923 100644 --- a/packages/mask/src/plugins/RedPacket/SNSAdaptor/NftRedPacketHistoryList.tsx +++ b/packages/mask/src/plugins/RedPacket/SNSAdaptor/NftRedPacketHistoryList.tsx @@ -7,7 +7,8 @@ import { useRef, useState } from 'react' import type { NftRedPacketHistory } from '../types' import { useNftRedPacketHistory } from './hooks/useNftRedPacketHistory' import { NftRedPacketHistoryItem } from './NftRedPacketHistoryItem' -import { useI18N } from '../../../utils' +import { useI18N as useBaseI18n } from '../../../utils' +import { useI18N } from '../locales' const useStyles = makeStyles()((theme, _, refs) => { const smallQuery = `@media (max-width: ${theme.breakpoints.values.sm}px)` @@ -80,7 +81,8 @@ interface Props { export function NftRedPacketHistoryList({ onSend }: Props) { const { classes } = useStyles() - const { t } = useI18N() + const { t: tr } = useBaseI18n() + const t = useI18N() const account = useAccount() const chainId = useChainId() const { histories, fetchMore, loading } = useNftRedPacketHistory(account, chainId) @@ -101,7 +103,7 @@ export function NftRedPacketHistoryList({ onSend }: Props) { if (chainId === ChainId.BSC) { return ( - {t('plugin_chain_not_supported', { chain: 'Binance Smart Chain' })} + {t.chain_not_supported({ chain: 'Binance Smart Chain' })} ) } @@ -109,7 +111,7 @@ export function NftRedPacketHistoryList({ onSend }: Props) { if (loading) { return ( - {t('loading')} + {tr('loading')} ) } @@ -117,7 +119,7 @@ export function NftRedPacketHistoryList({ onSend }: Props) { if (!histories?.length) { return ( - {t('plugin_red_packet_nft_no_history')} + {t.nft_no_history()} ) } diff --git a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacket/OperationFooter.tsx b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacket/OperationFooter.tsx index 1fc627f16cf3..06e1d7d1f0b7 100644 --- a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacket/OperationFooter.tsx +++ b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacket/OperationFooter.tsx @@ -4,9 +4,10 @@ import { useRemoteControlledDialog } from '@masknet/shared-base-ui' import { ChainId, useAccount, useChainIdValid } from '@masknet/web3-shared-evm' import { Box, useTheme } from '@mui/material' import ActionButton from '../../../../extension/options-page/DashboardComponents/ActionButton' -import { useI18N } from '../../../../utils' import { EthereumChainBoundary } from '../../../../web3/UI/EthereumChainBoundary' +import { useI18N as useBaseI18n } from '../../../../utils' import { EthereumWalletConnectedBoundary } from '../../../../web3/UI/EthereumWalletConnectedBoundary' +import { useI18N } from '../../locales' import { useStyles } from './useStyles' interface OperationFooterProps { @@ -28,7 +29,8 @@ export function OperationFooter({ onClaimOrRefund, }: OperationFooterProps) { const { classes } = useStyles() - const { t } = useI18N() + const { t: tr } = useBaseI18n() + const t = useI18N() const account = useAccount() const chainIdValid = useChainIdValid() const theme = useTheme() @@ -45,14 +47,14 @@ export function OperationFooter({ if (!account) { return ( - {t('plugin_wallet_connect_a_wallet')} + {tr('plugin_wallet_connect_a_wallet')} ) } if (!chainIdValid) { return ( - {t('plugin_wallet_invalid_network')} + {tr('plugin_wallet_invalid_network')} ) } @@ -73,13 +75,7 @@ export function OperationFooter({ disabled={isLoading} variant="contained" onClick={onClaimOrRefund}> - {canClaim - ? isClaiming - ? t('plugin_red_packet_claiming') - : t('plugin_red_packet_claim') - : isRefunding - ? t('plugin_red_packet_refunding') - : t('plugin_red_packet_refund')} + {canClaim ? (isClaiming ? t.claiming() : t.claim()) : isRefunding ? t.refunding() : t.refund()} ) } @@ -109,7 +105,7 @@ export function OperationFooter({ startIcon={} variant="contained" onClick={onShare}> - {t('share')} + {tr('share')} )} diff --git a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacket/index.tsx b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacket/index.tsx index 57be9b6a6518..d1f52642f190 100644 --- a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacket/index.tsx +++ b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacket/index.tsx @@ -15,7 +15,8 @@ import { usePostLink } from '../../../../components/DataSource/usePostInfo' import { activatedSocialNetworkUI } from '../../../../social-network' import { isFacebook } from '../../../../social-network-adaptor/facebook.com/base' import { isTwitter } from '../../../../social-network-adaptor/twitter.com/base' -import { useI18N } from '../../../../utils' +import { useI18N as useBaseI18n } from '../../../../utils' +import { useI18N } from '../../locales' import type { RedPacketAvailability, RedPacketJSONPayload } from '../../types' import { RedPacketStatus } from '../../types' import { useAvailabilityComputed } from '../hooks/useAvailabilityComputed' @@ -31,7 +32,8 @@ export interface RedPacketProps { export function RedPacket(props: RedPacketProps) { const { payload } = props - const { t } = useI18N() + const t = useI18N() + const { t: tr } = useBaseI18n() const { classes } = useStyles() // context @@ -54,12 +56,6 @@ export function RedPacket(props: RedPacketProps) { // #region remote controlled transaction dialog const postLink = usePostLink() - const shareTextOption = { - sender: payload.sender.name, - payload: postLink, - network: resolveNetworkName(networkType), - account: isTwitter(activatedSocialNetworkUI) ? t('twitter_account') : t('facebook_account'), - } const [{ loading: isClaiming, value: claimTxHash }, claimCallback] = useClaimCallback( payload.contract_version, @@ -68,15 +64,25 @@ export function RedPacket(props: RedPacketProps) { payload.contract_version > 3 ? web3.eth.accounts.sign(account, payload.password).signature : payload.password, ) - const shareText = ( - listOfStatus.includes(RedPacketStatus.claimed) || claimTxHash - ? isTwitter(activatedSocialNetworkUI) || isFacebook(activatedSocialNetworkUI) - ? t('plugin_red_packet_share_message_official_account', shareTextOption) - : t('plugin_red_packet_share_message_not_twitter', shareTextOption) - : isTwitter(activatedSocialNetworkUI) || isFacebook(activatedSocialNetworkUI) - ? t('plugin_red_packet_share_unclaimed_message_official_account', shareTextOption) - : t('plugin_red_packet_share_unclaimed_message_not_twitter', shareTextOption) - ).trim() + const shareText = useMemo(() => { + const isOnTwitter = isTwitter(activatedSocialNetworkUI) + const isOnFacebook = isFacebook(activatedSocialNetworkUI) + const shareTextOption = { + sender: payload.sender.name, + payload: postLink.toString(), + network: resolveNetworkName(networkType), + account: isTwitter(activatedSocialNetworkUI) ? tr('twitter_account') : tr('facebook_account'), + } + if (listOfStatus.includes(RedPacketStatus.claimed) || claimTxHash) { + return isOnTwitter || isOnFacebook + ? t.share_message_official_account(shareTextOption) + : t.share_message_not_twitter(shareTextOption) + } + + return isOnTwitter || isOnFacebook + ? t.share_unclaimed_message_official_account(shareTextOption) + : t.share_unclaimed_message_not_twitter(shareTextOption) + }, [payload, postLink, networkType, claimTxHash, listOfStatus, activatedSocialNetworkUI, t, tr]) const [{ loading: isRefunding }, isRefunded, refundCallback] = useRefundCallback( payload.contract_version, @@ -105,8 +111,7 @@ export function RedPacket(props: RedPacketProps) { const myStatus = useMemo(() => { if (token && listOfStatus.includes(RedPacketStatus.claimed)) - return t( - 'plugin_red_packet_description_claimed', + return t.description_claimed( (availability as RedPacketAvailability).claimed_amount ? { amount: formatBalance( @@ -114,9 +119,9 @@ export function RedPacket(props: RedPacketProps) { token.decimals, 8, ), - symbol: token.symbol, + symbol: token.symbol || '-', } - : { amount: '', symbol: '' }, + : { amount: '-', symbol: '-' }, ) return '' }, [listOfStatus, t, token]) @@ -125,18 +130,18 @@ export function RedPacket(props: RedPacketProps) { if (!availability || !token) return if (listOfStatus.includes(RedPacketStatus.expired) && canRefund) - return t('plugin_red_packet_description_refund', { + return t.description_refund({ balance: formatBalance(availability.balance, token.decimals), - symbol: token.symbol, + symbol: token.symbol ?? '-', }) - if (listOfStatus.includes(RedPacketStatus.refunded)) return t('plugin_red_packet_description_refunded') - if (listOfStatus.includes(RedPacketStatus.expired)) return t('plugin_red_packet_description_expired') - if (listOfStatus.includes(RedPacketStatus.empty)) return t('plugin_red_packet_description_empty') - if (!payload.password) return t('plugin_red_packet_description_broken') - return t('plugin_red_packet_description_failover', { + if (listOfStatus.includes(RedPacketStatus.refunded)) return t.description_refunded() + if (listOfStatus.includes(RedPacketStatus.expired)) return t.description_expired() + if (listOfStatus.includes(RedPacketStatus.empty)) return t.description_empty() + if (!payload.password) return t.description_broken() + return t.description_failover({ total: formatBalance(payload.total, token.decimals), - symbol: token.symbol, - shares: payload.shares ?? '-', + symbol: token.symbol ?? '-', + shares: payload.shares.toString() ?? '-', }) }, [availability, canRefund, token, t, payload, listOfStatus]) @@ -150,7 +155,7 @@ export function RedPacket(props: RedPacketProps) { return ( - {t('loading')} + {tr('loading')} ) @@ -178,7 +183,7 @@ export function RedPacket(props: RedPacketProps) { {myStatus} - {t('plugin_red_packet_from', { name: payload.sender.name ?? '-' })} + {t.from({ name: payload.sender.name ?? '-' })}
diff --git a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketConfirmDialog.tsx b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketConfirmDialog.tsx index 1bde8315ac8e..601ee15fcc2b 100644 --- a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketConfirmDialog.tsx +++ b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketConfirmDialog.tsx @@ -6,7 +6,6 @@ import { getChainName, isNativeTokenAddress, resolveTokenLinkOnExplorer, - TransactionStateType, useAccount, useChainId, useNetworkType, @@ -18,10 +17,10 @@ import { makeStyles } from '@masknet/theme' import LaunchIcon from '@mui/icons-material/Launch' import { FormattedBalance, useOpenShareTxDialog } from '@masknet/shared' import ActionButton from '../../../extension/options-page/DashboardComponents/ActionButton' -import { useI18N } from '../../../utils' import { RedPacketSettings, useCreateCallback } from './hooks/useCreateCallback' import type { RedPacketJSONPayload, RedPacketRecord } from '../types' import { RedPacketRPC } from '../messages' +import { useI18N } from '../locales' const useStyles = makeStyles()((theme) => ({ link: { @@ -85,7 +84,7 @@ export interface ConfirmRedPacketFormProps { } export function RedPacketConfirmDialog(props: ConfirmRedPacketFormProps) { - const { t } = useI18N() + const t = useI18N() const { onBack, settings, onClose, onCreated } = props const { classes } = useStyles() const chainId = useChainId() @@ -101,12 +100,7 @@ export function RedPacketConfirmDialog(props: ConfirmRedPacketFormProps) { const web3 = useWeb3() const account = useAccount() const { address: publicKey, privateKey } = useMemo(() => web3.eth.accounts.create(), []) - const [createState, createCallback, resetCreateCallback] = useCreateCallback(settings!, contract_version, publicKey) - const isCreating = [ - TransactionStateType.WAIT_FOR_CONFIRMING, - TransactionStateType.HASH, - TransactionStateType.RECEIPT, - ].includes(createState.type) + const [{ loading: isCreating }, createCallback] = useCreateCallback(settings!, contract_version, publicKey) const openShareTxDialog = useOpenShareTxDialog() const createRedpacket = useCallback(async () => { const receipt = await createCallback() @@ -114,8 +108,6 @@ export function RedPacketConfirmDialog(props: ConfirmRedPacketFormProps) { await openShareTxDialog({ hash: receipt.transactionHash, }) - // reset state - resetCreateCallback() // the settings is not available if (!settings?.token) return @@ -141,9 +133,17 @@ export function RedPacketConfirmDialog(props: ConfirmRedPacketFormProps) { payload.current.creation_time = Number.parseInt(CreationSuccess.creation_time, 10) * 1000 payload.current.token = settings.token + const record: RedPacketRecord = { + id: receipt.transactionHash!, + from: '', + password: privateKey, + contract_version, + } + RedPacketRPC.discoverRedPacket(record) + // output the redpacket as JSON payload onCreated(payload.current) - }, [createCallback, resetCreateCallback, settings, openShareTxDialog, onCreated]) + }, [createCallback, settings, openShareTxDialog, onCreated]) // #endregion // assemble JSON payload @@ -154,7 +154,6 @@ export function RedPacketConfirmDialog(props: ConfirmRedPacketFormProps) { const { HAPPY_RED_PACKET_ADDRESS_V4 } = useRedPacketConstants() const networkType = useNetworkType() useEffect(() => { - if (createState.type !== TransactionStateType.UNKNOWN) return const contractAddress = HAPPY_RED_PACKET_ADDRESS_V4 if (!contractAddress) { onClose() @@ -163,25 +162,8 @@ export function RedPacketConfirmDialog(props: ConfirmRedPacketFormProps) { payload.current.contract_address = contractAddress payload.current.contract_version = contract_version payload.current.network = getChainName(chainId) - }, [chainId, networkType, contract_version, createState]) + }, [chainId, networkType, contract_version]) - useEffect(() => { - if (!settings?.token || createState.type === TransactionStateType.UNKNOWN) return - - // storing the created red packet in DB, it helps retrieve red packet password later - // save to the database early, otherwise red-packet would lose when close the tx dialog or - // web page before create successfully. - if (createState.type === TransactionStateType.HASH && createState.hash) { - payload.current.txid = createState.hash - const record: RedPacketRecord = { - id: createState.hash!, - from: '', - password: privateKey, - contract_version, - } - RedPacketRPC.discoverRedPacket(record) - } - }, [createState /* update tx dialog only if state changed */]) // #endregion return ( @@ -193,7 +175,7 @@ export function RedPacketConfirmDialog(props: ConfirmRedPacketFormProps) { - {t('plugin_red_packet_token')} + {t.token()} @@ -215,18 +197,18 @@ export function RedPacketConfirmDialog(props: ConfirmRedPacketFormProps) { - {t('plugin_red_packet_split_mode')} + {t.split_mode()} - {settings?.isRandom ? t('plugin_red_packet_random') : t('plugin_red_packet_average')} + {settings?.isRandom ? t.random() : t.average()} - {t('plugin_red_packet_shares')} + {t.shares()} @@ -239,7 +221,7 @@ export function RedPacketConfirmDialog(props: ConfirmRedPacketFormProps) { <> - {t('plugin_red_packet_amount_per_share')} + {t.amount_per_share()} @@ -257,7 +239,7 @@ export function RedPacketConfirmDialog(props: ConfirmRedPacketFormProps) { - {t('plugin_red_packet_amount_total')} + {t.amount_total()} @@ -273,21 +255,21 @@ export function RedPacketConfirmDialog(props: ConfirmRedPacketFormProps) { - {t('plugin_red_packet_hint')} + {t.hint()} - {t('plugin_red_packet_back')} + {t.back()} - {t('plugin_red_packet_send_symbol', { + {t.send_symbol({ amount: formatBalance(settings?.total, settings?.token?.decimals ?? 0), - symbol: settings?.token?.symbol, + symbol: settings?.token?.symbol ?? '-', })} diff --git a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketCreateNew.tsx b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketCreateNew.tsx index cdc94626b9c1..3ceac4ff3cbd 100644 --- a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketCreateNew.tsx +++ b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketCreateNew.tsx @@ -3,7 +3,7 @@ import { useChainId, ChainId } from '@masknet/web3-shared-evm' import { RedPacketFormProps, RedPacketERC20Form } from './RedPacketERC20Form' import { RedPacketERC721Form } from './RedPacketERC721Form' import AbstractTab, { AbstractTabProps } from '../../../components/shared/AbstractTab' -import { useI18N } from '../../../utils' +import { useI18N } from '../locales' import { activatedSocialNetworkUI } from '../../../social-network' import { IconURLs } from './IconURL' import { EnhanceableSite } from '@masknet/shared-base' @@ -49,7 +49,7 @@ const useStyles = makeStyles()((theme, { snsId }) => ({ export function RedPacketCreateNew(props: RedPacketFormProps & { state: readonly [number, (next: number) => void] }) { const { origin, onNext, onChange, onClose, state } = props - const { t } = useI18N() + const t = useI18N() const { classes } = useStyles({ snsId: activatedSocialNetworkUI.networkIdentifier }) const chainId = useChainId() @@ -59,7 +59,7 @@ export function RedPacketCreateNew(props: RedPacketFormProps & { state: readonly label: (
- {t('plugin_red_packet_erc20_tab_title')} + {t.erc20_tab_title()}
), children: , @@ -69,7 +69,7 @@ export function RedPacketCreateNew(props: RedPacketFormProps & { state: readonly label: (
- {t('plugin_red_packet_erc721_tab_title')} + {t.erc721_tab_title()}
), children: , diff --git a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketDialog.tsx b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketDialog.tsx index cdadc425c58d..5e4e92c5d94a 100644 --- a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketDialog.tsx +++ b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketDialog.tsx @@ -13,7 +13,7 @@ import { } from '../../../components/DataSource/useActivatedUI' import AbstractTab, { AbstractTabProps } from '../../../components/shared/AbstractTab' import Services from '../../../extension/service' -import { useI18N } from '../../../utils' +import { useI18N } from '../locales' import { WalletMessages } from '../../Wallet/messages' import { RedPacketMetaKey } from '../constants' import { DialogTabs, RedPacketJSONPayload, RpTypeTabs } from '../types' @@ -63,7 +63,7 @@ interface RedPacketDialogProps extends withClasses { } export default function RedPacketDialog(props: RedPacketDialogProps) { - const { t } = useI18N() + const t = useI18N() const chainId = useChainId() const account = useAccount() const { classes } = useStyles() @@ -134,7 +134,7 @@ export default function RedPacketDialog(props: RedPacketDialogProps) { const tabProps: AbstractTabProps = { tabs: [ { - label: t('plugin_red_packet_create_new'), + label: t.create_new(), children: ( , sx: { p: 0 }, }, @@ -172,7 +172,7 @@ export default function RedPacketDialog(props: RedPacketDialogProps) { ) const isCreateStep = step === CreateRedPacketPageStep.NewRedPacketPage - const title = isCreateStep ? t('plugin_red_packet_display_name') : t('plugin_red_packet_details') + const title = isCreateStep ? t.display_name() : t.details() return ( diff --git a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketERC20Form.tsx b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketERC20Form.tsx index a4843e141d93..1055ed3cbb27 100644 --- a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketERC20Form.tsx +++ b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketERC20Form.tsx @@ -17,7 +17,8 @@ import { ChangeEvent, useCallback, useEffect, useMemo, useRef, useState } from ' import { usePickToken } from '@masknet/shared' import { useCurrentIdentity, useCurrentLinkedPersona } from '../../../components/DataSource/useActivatedUI' import ActionButton from '../../../extension/options-page/DashboardComponents/ActionButton' -import { useI18N } from '../../../utils' +import { useI18N } from '../locales' +import { useI18N as useBaseI18n } from '../../../utils' import { EthereumERC20TokenApprovedBoundary } from '../../../web3/UI/EthereumERC20TokenApprovedBoundary' import { EthereumWalletConnectedBoundary } from '../../../web3/UI/EthereumWalletConnectedBoundary' import { TokenAmountPanel } from '../../../web3/UI/TokenAmountPanel' @@ -82,7 +83,8 @@ export interface RedPacketFormProps extends withClasses { } export function RedPacketERC20Form(props: RedPacketFormProps) { - const { t } = useI18N() + const t = useI18N() + const { t: tr } = useBaseI18n() const classes = useStylesExtends(useStyles(), props) const { onChange, onNext, origin } = props // context @@ -105,7 +107,7 @@ export function RedPacketERC20Form(props: RedPacketFormProps) { // #region packet settings const [isRandom, setRandom] = useState(origin?.isRandom ? 1 : 0) - const [message, setMessage] = useState(origin?.message || t('plugin_red_packet_best_wishes')) + const [message, setMessage] = useState(origin?.message || t.best_wishes()) const currentIdentity = useCurrentIdentity() const { value: linkedPersona } = useCurrentLinkedPersona() @@ -153,32 +155,32 @@ export function RedPacketERC20Form(props: RedPacketFormProps) { // #endregion const validationMessage = useMemo(() => { - if (!token) return t('plugin_wallet_select_a_token') - if (!account) return t('plugin_wallet_connect_a_wallet') + if (!token) return t.select_a_token() + if (!account) return tr('plugin_wallet_connect_a_wallet') if (isZero(shares || '0')) return 'Enter shares' if (isGreaterThan(shares || '0', 255)) return 'At most 255 recipients' - if (isZero(amount)) return t('plugin_dhedge_enter_an_amount') + if (isZero(amount)) return tr('plugin_dhedge_enter_an_amount') if (isGreaterThan(totalAmount, tokenBalance)) - return t('plugin_gitcoin_insufficient_balance', { symbol: token.symbol }) + return tr('plugin_gitcoin_insufficient_balance', { symbol: token.symbol }) if (!isDivisible) - return t('plugin_red_packet_indivisible', { - symbol: token.symbol, + return t.indivisible({ + symbol: token.symbol!, amount: formatBalance(1, token.decimals), }) return '' - }, [account, amount, totalAmount, shares, token, tokenBalance]) + }, [account, amount, totalAmount, shares, token, tokenBalance, t, tr]) const creatingParams = useMemo( () => ({ duration, isRandom: Boolean(isRandom), name: senderName, - message: message || t('plugin_red_packet_best_wishes'), + message: message || t.best_wishes(), shares: shares || 0, token: token ? (omit(token, ['logoURI']) as FungibleTokenDetailed) : undefined, total: totalAmount.toFixed(), }), - [isRandom, senderName, message, t('plugin_red_packet_best_wishes'), shares, token, totalAmount], + [isRandom, senderName, message, t.best_wishes(), shares, token, totalAmount], ) const onClick = useCallback(() => { @@ -193,7 +195,7 @@ export function RedPacketERC20Form(props: RedPacketFormProps) { <>
- {t('plugin_red_packet_split_mode')} + {t.split_mode()} @@ -241,7 +243,7 @@ export function RedPacketERC20Form(props: RedPacketFormProps) {
@@ -282,7 +284,7 @@ export function RedPacketERC20Form(props: RedPacketFormProps) { fullWidth disabled={!!validationMessage} onClick={onClick}> - {validationMessage || t('plugin_red_packet_next')} + {validationMessage || t.next()} diff --git a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketERC721Form.tsx b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketERC721Form.tsx index 63c55e2e534b..b53e3f69a5da 100644 --- a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketERC721Form.tsx +++ b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketERC721Form.tsx @@ -1,7 +1,7 @@ import { Box, Typography, List, ListItem, CircularProgress } from '@mui/material' import { makeStyles } from '@masknet/theme' import { useState, useCallback, useEffect, useMemo } from 'react' -import { useI18N } from '../../../utils' +import { useI18N } from '../locales' import classNames from 'classnames' import ActionButton from '../../../extension/options-page/DashboardComponents/ActionButton' import { ERC721ContractSelectPanel } from '../../../web3/UI/ERC721ContractSelectPanel' @@ -201,7 +201,7 @@ interface RedPacketERC721FormProps { onClose: () => void } export function RedPacketERC721Form(props: RedPacketERC721FormProps) { - const { t } = useI18N() + const t = useI18N() const { onClose } = props const { classes } = useStyles() const [open, setOpen] = useState(false) @@ -259,10 +259,10 @@ export function RedPacketERC721Form(props: RedPacketERC721FormProps) { const { RED_PACKET_NFT_ADDRESS } = useNftRedPacketConstants() const validationMessage = useMemo(() => { - if (!balance) return t('plugin_red_packet_erc721_insufficient_balance') - if (tokenDetailedList.length === 0) return t('plugin_wallet_select_a_token') + if (!balance) return t.erc721_insufficient_balance() + if (tokenDetailedList.length === 0) return t.select_a_token() return '' - }, [tokenDetailedList.length, balance]) + }, [tokenDetailedList.length, balance, t]) return ( <> @@ -297,8 +297,11 @@ export function RedPacketERC721Form(props: RedPacketERC721FormProps) { {tokenDetailedOwnerList.length === 0 ? 'All' - : t('plugin_red_packet_nft_select_all_option', { - total: Math.min(NFT_RED_PACKET_MAX_SHARES, tokenDetailedOwnerList.length), + : t.nft_select_all_option({ + total: Math.min( + NFT_RED_PACKET_MAX_SHARES, + tokenDetailedOwnerList.length, + ).toString(), })}
@@ -310,9 +313,7 @@ export function RedPacketERC721Form(props: RedPacketERC721FormProps) { )}>
- - {t('plugin_red_packet_nft_select_partially_option')} - + {t.nft_select_partially_option()}
) @@ -338,12 +339,8 @@ export function RedPacketERC721Form(props: RedPacketERC721FormProps) { {contract && balance && !loadingOwnerList ? ( <> - - {t('plugin_red_packet_nft_unapproved_tip')} - - - {t('plugin_red_packet_nft_approve_all_tip')} - + {t.nft_unapproved_tip()} + {t.nft_approve_all_tip()} ) : null} @@ -358,7 +355,7 @@ export function RedPacketERC721Form(props: RedPacketERC721FormProps) { disabled={!!validationMessage} fullWidth onClick={() => setOpenConfirmDialog(true)}> - {t('plugin_red_packet_next')} + {t.next()} diff --git a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketInHistoryList.tsx b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketInHistoryList.tsx index 3e0749c9e2fc..1a2595f81691 100644 --- a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketInHistoryList.tsx +++ b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketInHistoryList.tsx @@ -18,9 +18,8 @@ import intervalToDuration from 'date-fns/intervalToDuration' import nextDay from 'date-fns/nextDay' import { omit, pick } from 'lodash-unified' import { MouseEvent, useCallback, useState } from 'react' -import { Trans } from 'react-i18next' import ActionButton from '../../../extension/options-page/DashboardComponents/ActionButton' -import { useI18N } from '../../../utils' +import { Translate, useI18N } from '../locales' import { dateTimeFormat } from '../../ITO/assets/formatDate' import { StyledLinearProgress } from '../../ITO/SNSAdaptor/StyledLinearProgress' import { RedPacketJSONPayload, RedPacketJSONPayloadFromChain, RedPacketStatus } from '../types' @@ -185,7 +184,7 @@ export interface RedPacketInHistoryListProps { export function RedPacketInHistoryList(props: RedPacketInHistoryListProps) { const account = useAccount() const { history, onSelect } = props - const { t } = useI18N() + const t = useI18N() const { classes } = useStyles() const isSmall = useMediaQuery((theme: Theme) => theme.breakpoints.down('sm')) const { @@ -246,28 +245,24 @@ export function RedPacketInHistoryList(props: RedPacketInHistoryListProps) {
- {history.sender.message === '' - ? t('plugin_red_packet_best_wishes') - : history.sender.message} + {history.sender.message === '' ? t.best_wishes() : history.sender.message}
- {t('plugin_red_packet_history_duration', { + {t.history_duration({ startTime: dateTimeFormat(new Date(history.creation_time)), endTime: dateTimeFormat(new Date(history.creation_time + history.duration), false), })} - {t('plugin_red_packet_history_total_amount', { + {t.history_total_amount({ amount: formatBalance(history.total, historyToken?.decimals, 6), - symbol: historyToken?.symbol, + symbol: historyToken?.symbol!, })} - {t('plugin_red_packet_history_split_mode', { - mode: history.is_random - ? t('plugin_red_packet_random') - : t('plugin_red_packet_average'), + {t.history_split_mode({ + mode: history.is_random ? t.random() : t.average(), })}
@@ -291,12 +286,12 @@ export function RedPacketInHistoryList(props: RedPacketInHistoryListProps) { variant="contained" size="large"> {canSend - ? t('plugin_red_packet_history_send') + ? t.send() : refunded - ? t('plugin_red_packet_refunding') + ? t.refunding() : listOfStatus.includes(RedPacketStatus.empty) - ? t('plugin_red_packet_empty') - : t('plugin_red_packet_refund')} + ? t.empty() + : t.refund()} - {t('plugin_red_packet_data_broken', { duration: formatRefundDuration })} + {t.data_broken({ duration: formatRefundDuration })}
@@ -319,20 +314,18 @@ export function RedPacketInHistoryList(props: RedPacketInHistoryListProps) { />
- , }} values={{ - claimedShares: history.claimers?.length ?? 0, - shares: history.shares, + claimedShares: history.claimers?.length.toString() ?? '0', + shares: history.shares.toString(), }} /> - , span: , @@ -344,7 +337,7 @@ export function RedPacketInHistoryList(props: RedPacketInHistoryListProps) { historyToken?.decimals, 6, ), - symbol: historyToken?.symbol, + symbol: historyToken?.symbol!, }} /> diff --git a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketNft.tsx b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketNft.tsx index 3db5fa3656c9..62b11814cbc8 100644 --- a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketNft.tsx +++ b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketNft.tsx @@ -1,30 +1,31 @@ +import { PluginWalletConnectIcon, SharedIcon } from '@masknet/icons' +import { NFTCardStyledAssetPlayer } from '@masknet/shared' +import { openWindow } from '@masknet/shared-base-ui' import { makeStyles } from '@masknet/theme' import { - useAccount, resolveAddressLinkOnExplorer, - useWeb3, resolveNetworkName, - useNetworkType, TransactionStateType, + useAccount, + useNetworkType, + useWeb3, } from '@masknet/web3-shared-evm' import LaunchIcon from '@mui/icons-material/Launch' -import { Card, CardHeader, Typography, Link, CardMedia, CardContent, Button, Box, Skeleton } from '@mui/material' -import { useCallback, useEffect, useState } from 'react' -import ActionButton from '../../../extension/options-page/DashboardComponents/ActionButton' -import { useI18N } from '../../../utils' -import { EthereumWalletConnectedBoundary } from '../../../web3/UI/EthereumWalletConnectedBoundary' -import type { RedPacketNftJSONPayload } from '../types' -import { useClaimNftRedpacketCallback } from './hooks/useClaimNftRedpacketCallback' -import { useAvailabilityNftRedPacket } from './hooks/useAvailabilityNftRedPacket' +import { Box, Button, Card, CardContent, CardHeader, CardMedia, Link, Skeleton, Typography } from '@mui/material' import classNames from 'classnames' +import { useCallback, useEffect, useMemo, useState } from 'react' import { usePostLink } from '../../../components/DataSource/usePostInfo' +import ActionButton from '../../../extension/options-page/DashboardComponents/ActionButton' import { activatedSocialNetworkUI } from '../../../social-network' -import { isTwitter } from '../../../social-network-adaptor/twitter.com/base' import { isFacebook } from '../../../social-network-adaptor/facebook.com/base' -import { NFTCardStyledAssetPlayer } from '@masknet/shared' -import { openWindow } from '@masknet/shared-base-ui' -import { PluginWalletConnectIcon, SharedIcon } from '@masknet/icons' +import { isTwitter } from '../../../social-network-adaptor/twitter.com/base' +import { useI18N as useBaseI18N } from '../../../utils' import { EthereumChainBoundary } from '../../../web3/UI/EthereumChainBoundary' +import { EthereumWalletConnectedBoundary } from '../../../web3/UI/EthereumWalletConnectedBoundary' +import { useI18N } from '../locales' +import type { RedPacketNftJSONPayload } from '../types' +import { useAvailabilityNftRedPacket } from './hooks/useAvailabilityNftRedPacket' +import { useClaimNftRedpacketCallback } from './hooks/useClaimNftRedpacketCallback' const useStyles = makeStyles()((theme) => ({ root: { @@ -249,7 +250,8 @@ export interface RedPacketNftProps { } export function RedPacketNft({ payload }: RedPacketNftProps) { - const { t } = useI18N() + const { t: i18n } = useBaseI18N() + const t = useI18N() const { classes } = useStyles() const web3 = useWeb3() const account = useAccount() @@ -295,29 +297,23 @@ export function RedPacketNft({ payload }: RedPacketNftProps) { // #region on share const postLink = usePostLink() const networkType = useNetworkType() - const shareText = availability?.isClaimed - ? t( - isTwitter(activatedSocialNetworkUI) || isFacebook(activatedSocialNetworkUI) - ? 'plugin_red_packet_nft_share_claimed_message' - : 'plugin_red_packet_nft_share_claimed_message_not_twitter', - { - sender: payload.senderName, - payload: postLink, - network: resolveNetworkName(networkType), - account: isTwitter(activatedSocialNetworkUI) ? t('twitter_account') : t('facebook_account'), - }, - ).trim() - : t( - isTwitter(activatedSocialNetworkUI) || isFacebook(activatedSocialNetworkUI) - ? 'plugin_red_packet_nft_share_foreshow_message' - : 'plugin_red_packet_nft_share_foreshow_message_not_twitter', - { - sender: payload.senderName, - payload: postLink, - network: resolveNetworkName(networkType), - account: isTwitter(activatedSocialNetworkUI) ? t('twitter_account') : t('facebook_account'), - }, - ).trim() + const shareText = useMemo(() => { + const isTwitterOrFacebook = isTwitter(activatedSocialNetworkUI) || isFacebook(activatedSocialNetworkUI) + const options = { + sender: payload.senderName, + payload: postLink.toString(), + network: resolveNetworkName(networkType), + account: isTwitter(activatedSocialNetworkUI) ? i18n('twitter_account') : i18n('facebook_account'), + } + if (availability?.isClaimed) { + return isTwitterOrFacebook + ? t.nft_share_claimed_message(options) + : t.nft_share_claimed_message_not_twitter(options) + } + return isTwitterOrFacebook + ? t.nft_share_foreshow_message(options) + : t.nft_share_foreshow_message_not_twitter(options) + }, [availability?.isClaimed, t, i18n]) const onShare = useCallback(() => { if (shareText) activatedSocialNetworkUI.utils.share?.(shareText) @@ -330,13 +326,13 @@ export function RedPacketNft({ payload }: RedPacketNftProps) { - {t('loading_failed')} + {i18n('loading_failed')}
@@ -389,14 +385,14 @@ export function RedPacketNft({ payload }: RedPacketNftProps) { ) : ( - {availability.claimedAmount}/{availability.totalAmount} {t('collectibles_name')} + {availability.claimedAmount}/{availability.totalAmount} {i18n('collectibles_name')} )} - {t('plugin_red_packet_nft_tip')} + {t.nft_tip()}
@@ -426,7 +422,7 @@ export function RedPacketNft({ payload }: RedPacketNftProps) { />
- {availability.expired ? t('plugin_red_packet_expired') : t('plugin_red_packet_completed')} + {availability.expired ? t.expired() : t.completed()}
@@ -439,7 +435,7 @@ export function RedPacketNft({ payload }: RedPacketNftProps) { fullWidth onClick={onShare} variant="contained"> - {t('share')} + {i18n('share')} {availability.isClaimed ? null : ( @@ -460,7 +456,7 @@ export function RedPacketNft({ payload }: RedPacketNftProps) { onClick={claimCallback} className={classes.button} fullWidth> - {isClaiming ? t('plugin_red_packet_claiming') : t('plugin_red_packet_claim')} + {isClaiming ? t.claiming() : t.claim()} diff --git a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketPast.tsx b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketPast.tsx index 644196520eae..40f166399cf0 100644 --- a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketPast.tsx +++ b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedPacketPast.tsx @@ -2,7 +2,7 @@ import { useChainId, ChainId } from '@masknet/web3-shared-evm' import { makeStyles } from '@masknet/theme' import { useCallback, useState } from 'react' import AbstractTab, { AbstractTabProps } from '../../../components/shared/AbstractTab' -import { useI18N } from '../../../utils' +import { useI18N } from '../locales' import { IconURLs } from './IconURL' import { RedPacketHistoryList } from './RedPacketHistoryList' import { NftRedPacketHistoryList } from './NftRedPacketHistoryList' @@ -58,7 +58,7 @@ interface Props { } export function RedPacketPast({ onSelect, onClose }: Props) { - const { t } = useI18N() + const t = useI18N() const { classes } = useStyles() const state = useState(RpTypeTabs.ERC20) const chainId = useChainId() @@ -95,7 +95,7 @@ export function RedPacketPast({ onSelect, onClose }: Props) { label: (
- {t('plugin_red_packet_erc20_tab_title')} + {t.erc20_tab_title()}
), children: , @@ -105,7 +105,7 @@ export function RedPacketPast({ onSelect, onClose }: Props) { label: (
- {t('plugin_red_packet_erc721_tab_title')} + {t.erc721_tab_title()}
), children: , diff --git a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedpacketMessagePanel.tsx b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedpacketMessagePanel.tsx index 7270b5f44c14..86b54fb72449 100644 --- a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedpacketMessagePanel.tsx +++ b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedpacketMessagePanel.tsx @@ -1,7 +1,7 @@ import classNames from 'classnames' import { Box, InputBase, Typography } from '@mui/material' import { makeStyles } from '@masknet/theme' -import { useI18N } from '../../../utils' +import { useI18N } from '../locales' const useStyles = makeStyles()((theme) => { return { @@ -40,20 +40,20 @@ export interface RedpacketMessagePanelProps { export function RedpacketMessagePanel(props: RedpacketMessagePanelProps) { const { onChange, message } = props const { classes } = useStyles() - const { t } = useI18N() + const t = useI18N() return (
- {t('plugin_red_packet_message_label')} + {t.message_label()}
onChange(e.target.value)} - inputProps={{ placeholder: t('plugin_red_packet_best_wishes') }} + inputProps={{ placeholder: t.best_wishes() }} value={message} />
diff --git a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedpacketNftConfirmDialog.tsx b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedpacketNftConfirmDialog.tsx index 0a676a0f9a01..3b96cc508aee 100644 --- a/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedpacketNftConfirmDialog.tsx +++ b/packages/mask/src/plugins/RedPacket/SNSAdaptor/RedpacketNftConfirmDialog.tsx @@ -20,7 +20,7 @@ import { Button, Grid, Link, Typography, DialogContent, List, ListItem } from '@ import ActionButton from '../../../extension/options-page/DashboardComponents/ActionButton' import { EthereumWalletConnectedBoundary } from '../../../web3/UI/EthereumWalletConnectedBoundary' import LaunchIcon from '@mui/icons-material/Launch' -import { useI18N } from '../../../utils' +import { useI18N as useBaseI18N } from '../../../utils' import { useCreateNftRedpacketCallback } from './hooks/useCreateNftRedpacketCallback' import { useCurrentIdentity } from '../../../components/DataSource/useActivatedUI' import { useCompositionContext } from '@masknet/plugin-infra/content-script' @@ -29,6 +29,7 @@ import { WalletMessages } from '../../Wallet/messages' import { RedPacketRPC } from '../messages' import { useAsync } from 'react-use' import Services from '../../../extension/service' +import { useI18N } from '../locales' const useStyles = makeStyles()((theme) => ({ root: { @@ -167,7 +168,8 @@ export function RedpacketNftConfirmDialog(props: RedpacketNftConfirmDialogProps) const web3 = useWeb3() const { attachMetadata } = useCompositionContext() - const { t } = useI18N() + const { t: i18n } = useBaseI18N() + const t = useI18N() const { address: publicKey, privateKey } = useMemo(() => web3.eth.accounts.create(), []) const duration = 60 * 60 * 24 const currentIdentity = useCurrentIdentity() @@ -236,12 +238,12 @@ export function RedpacketNftConfirmDialog(props: RedpacketNftConfirmDialogProps) }, [createState, onSendPost]) return ( - + - {t('plugin_red_packet_nft_account_name')} + {t.nft_account_name()} @@ -266,7 +268,7 @@ export function RedpacketNftConfirmDialog(props: RedpacketNftConfirmDialogProps) - {t('plugin_red_packet_nft_attached_message')} + {t.nft_attached_message()} @@ -274,13 +276,13 @@ export function RedpacketNftConfirmDialog(props: RedpacketNftConfirmDialogProps) variant="body1" color="textPrimary" align="right" - className={(classes.text, classes.bold, classes.ellipsis)}> + className={classNames(classes.text, classes.bold, classes.ellipsis)}> {message} - {t('plugin_wallet_collections')} + {t.collections()} @@ -307,7 +309,7 @@ export function RedpacketNftConfirmDialog(props: RedpacketNftConfirmDialogProps) - {t('plugin_red_packet_nft_total_amount')} + {t.nft_total_amount()} @@ -327,7 +329,7 @@ export function RedpacketNftConfirmDialog(props: RedpacketNftConfirmDialogProps) onClick={onBack} size="large" variant="contained"> - {t('cancel')} + {i18n('cancel')} @@ -344,8 +346,8 @@ export function RedpacketNftConfirmDialog(props: RedpacketNftConfirmDialogProps) onClick={onSendTx} className={classNames(classes.button, classes.sendButton)} fullWidth> - {t('plugin_red_packet_send_symbol', { - amount: tokenList.length, + {t.send_symbol({ + amount: tokenList.length.toString(), symbol: tokenList.length > 1 ? 'NFTs' : 'NFT', })} diff --git a/packages/mask/src/plugins/RedPacket/SNSAdaptor/SelectNftTokenDialog.tsx b/packages/mask/src/plugins/RedPacket/SNSAdaptor/SelectNftTokenDialog.tsx index 0915e71da8a8..acf9198e6695 100644 --- a/packages/mask/src/plugins/RedPacket/SNSAdaptor/SelectNftTokenDialog.tsx +++ b/packages/mask/src/plugins/RedPacket/SNSAdaptor/SelectNftTokenDialog.tsx @@ -8,17 +8,17 @@ import { isSameAddress, formatNFT_TokenId, } from '@masknet/web3-shared-evm' -import { useI18N } from '../../../utils' +import { useI18N as useBaseI18N } from '../../../utils' import { DialogContent, Box, InputBase, Paper, Button, Typography, ListItem, CircularProgress } from '@mui/material' import QuestionMarkIcon from '@mui/icons-material/QuestionMark' import { makeStyles, ShadowRootTooltip } from '@masknet/theme' import { useCallback, useState, useEffect } from 'react' import { SearchIcon } from '@masknet/icons' import CheckIcon from '@mui/icons-material/Check' -import { Trans } from 'react-i18next' import { useUpdate } from 'react-use' import { findLastIndex } from 'lodash-unified' import { NFT_RED_PACKET_MAX_SHARES } from '../constants' +import { useI18N, Translate } from '../locales' interface StyleProps { isSelectSharesExceed: boolean @@ -320,7 +320,8 @@ export function SelectNftTokenDialog(props: SelectNftTokenDialogProps) { onClose, loadingOwnerList, } = props - const { t } = useI18N() + const { t: tr } = useBaseI18N() + const t = useI18N() const account = useAccount() const [tokenDetailed, setTokenDetailed] = useState() const [searched, setSearched] = useState(false) @@ -435,8 +436,7 @@ export function SelectNftTokenDialog(props: SelectNftTokenDialogProps) { }, [tokenDetailed, tokenDetailedSelectedList, setExistTokenDetailedList, onClose]) const NonExistedTokenList = () => ( - @@ -452,12 +452,10 @@ export function SelectNftTokenDialog(props: SelectNftTokenDialogProps) { /> ) + const maxSharesOptions = { amount: NFT_RED_PACKET_MAX_SHARES.toString() } + return ( - + {tokenDetailedOwnerList.length === 0 ? ( @@ -476,17 +474,13 @@ export function SelectNftTokenDialog(props: SelectNftTokenDialogProps) { className={classes.searchButton} variant="contained" onClick={onSearch}> - {t('search')} + {t.search()}
{loadingToken || !tokenDetailed || !contract ? ( - {loadingToken - ? t('wallet_loading_token') - : searched - ? t('wallet_search_no_result') - : null} + {loadingToken ? t.loading_token() : searched ? t.search_no_result() : null} ) : ( @@ -512,21 +506,15 @@ export function SelectNftTokenDialog(props: SelectNftTokenDialogProps) {
- {isSelectSharesExceed - ? t('plugin_red_packet_nft_max_shares_tip', { amount: NFT_RED_PACKET_MAX_SHARES }) - : null} + {isSelectSharesExceed ? t.nft_max_shares_tip(maxSharesOptions) : null} {tokenDetailedSelectedList.length > NFT_RED_PACKET_MAX_SHARES - ? t('plugin_red_packet_nft_max_shares_tip', { - amount: NFT_RED_PACKET_MAX_SHARES, - }) - : t('plugin_red_packet_nft_max_shares', { - amount: NFT_RED_PACKET_MAX_SHARES, - })} + ? t.nft_max_shares_tip(maxSharesOptions) + : t.nft_max_shares(maxSharesOptions)} } placement="top-end" @@ -546,10 +534,10 @@ export function SelectNftTokenDialog(props: SelectNftTokenDialogProps) { variant="contained" onClick={onSubmit}> {tokenDetailed && !isOwner - ? t('wallet_add_nft_invalid_owner') + ? t.nft_invalid_owner() : isAdded - ? t('wallet_add_nft_already_added') - : t('confirm')} + ? t.nft_already_added() + : tr('confirm')} ) : ( @@ -574,14 +562,12 @@ export function SelectNftTokenDialog(props: SelectNftTokenDialogProps) { className={classes.searchButton} variant="contained" onClick={tokenDetailedOwnerList.length === 0 ? onSearch : onFilter}> - {t('search')} + {t.search()}
{(loadingToken || !tokenDetailed) && searched ? ( - - {loadingToken ? t('wallet_loading_token') : t('wallet_search_no_result')} - + {loadingToken ? t.loading_token() : t.search_no_result()} ) : tokenDetailed?.info.name ? ( @@ -606,12 +592,11 @@ export function SelectNftTokenDialog(props: SelectNftTokenDialogProps) { {selectAll ? : null} - {t('select_all')} + {tr('select_all')} - , }} @@ -670,9 +655,7 @@ export function SelectNftTokenDialog(props: SelectNftTokenDialogProps) { ) : null} - {isSelectSharesExceed - ? t('plugin_red_packet_nft_max_shares_tip', { amount: NFT_RED_PACKET_MAX_SHARES }) - : null} + {isSelectSharesExceed ? t.nft_max_shares_tip(maxSharesOptions) : null} @@ -681,12 +664,8 @@ export function SelectNftTokenDialog(props: SelectNftTokenDialogProps) { title={ {tokenDetailedSelectedList.length > NFT_RED_PACKET_MAX_SHARES - ? t('plugin_red_packet_nft_max_shares_tip', { - amount: NFT_RED_PACKET_MAX_SHARES, - }) - : t('plugin_red_packet_nft_max_shares', { - amount: NFT_RED_PACKET_MAX_SHARES, - })} + ? t.nft_max_shares_tip(maxSharesOptions) + : t.nft_max_shares(maxSharesOptions)} } placement="top-end" @@ -714,10 +693,10 @@ export function SelectNftTokenDialog(props: SelectNftTokenDialogProps) { variant="contained" onClick={onSubmit}> {tokenDetailed && !isOwner - ? t('wallet_add_nft_invalid_owner') + ? t.nft_invalid_owner() : isAdded - ? t('wallet_add_nft_already_added') - : t('confirm')} + ? t.nft_already_added() + : tr('confirm')} )} diff --git a/packages/mask/src/plugins/RedPacket/SNSAdaptor/hooks/useCreateCallback.tsx b/packages/mask/src/plugins/RedPacket/SNSAdaptor/hooks/useCreateCallback.tsx index aced424d9e3e..f5b967e28b4c 100644 --- a/packages/mask/src/plugins/RedPacket/SNSAdaptor/hooks/useCreateCallback.tsx +++ b/packages/mask/src/plugins/RedPacket/SNSAdaptor/hooks/useCreateCallback.tsx @@ -5,14 +5,13 @@ import { EthereumTokenType, FungibleTokenDetailed, TransactionEventType, - TransactionStateType, useAccount, useChainId, useTokenConstants, - useTransactionState, } from '@masknet/web3-shared-evm' import { omit } from 'lodash-unified' import { useCallback } from 'react' +import { useAsyncFn } from 'react-use' import type { TransactionReceipt } from 'web3-core' import Web3Utils from 'web3-utils' import { useRedPacketContract } from './useRedPacketContract' @@ -120,17 +119,10 @@ export function useCreateParams(redPacketSettings: RedPacketSettings | undefined export function useCreateCallback(redPacketSettings: RedPacketSettings, version: number, publicKey: string) { const account = useAccount() const chainId = useChainId() - const [createState, setCreateState] = useTransactionState() const redPacketContract = useRedPacketContract(version) const getCreateParams = useCreateParams(redPacketSettings, version, publicKey) - const resetCallback = useCallback(() => { - setCreateState({ - type: TransactionStateType.UNKNOWN, - }) - }, []) - const createCallback = useCallback(async () => { - resetCallback() + return useAsyncFn(async () => { const { token } = redPacketSettings const createParams = await getCreateParams() @@ -139,28 +131,15 @@ export function useCreateCallback(redPacketSettings: RedPacketSettings, version: const { gas, params, paramsObj, gasError } = createParams if (gasError) { - setCreateState({ - type: TransactionStateType.FAILED, - error: gasError, - }) return } try { checkParams(paramsObj) } catch (error) { - setCreateState({ - type: TransactionStateType.FAILED, - error: error as Error, - }) return } - // pre-step: start waiting for provider to confirm tx - setCreateState({ - type: TransactionStateType.WAIT_FOR_CONFIRMING, - }) - // estimate gas and compose transaction const value = toFixed(token.type === EthereumTokenType.Native ? paramsObj.total : 0) const config: PayableTx = { @@ -175,22 +154,11 @@ export function useCreateCallback(redPacketSettings: RedPacketSettings, version: .create_red_packet(...params) .send(config) .on(TransactionEventType.CONFIRMATION, (no, receipt) => { - setCreateState({ - type: TransactionStateType.CONFIRMED, - no, - receipt, - }) resolve(receipt) }) .on(TransactionEventType.ERROR, (error: Error) => { - setCreateState({ - type: TransactionStateType.FAILED, - error, - }) reject(error) }) }) }, [account, redPacketContract, redPacketSettings, chainId, getCreateParams]) - - return [createState, createCallback, resetCallback] as const } diff --git a/packages/mask/src/plugins/RedPacket/SNSAdaptor/index.tsx b/packages/mask/src/plugins/RedPacket/SNSAdaptor/index.tsx index f56ca1eb9aec..d1ec432b53a0 100644 --- a/packages/mask/src/plugins/RedPacket/SNSAdaptor/index.tsx +++ b/packages/mask/src/plugins/RedPacket/SNSAdaptor/index.tsx @@ -1,4 +1,4 @@ -import { type Plugin, usePluginWrapper } from '@masknet/plugin-infra/content-script' +import { type Plugin, usePluginWrapper, PluginId } from '@masknet/plugin-infra/content-script' import { ChainId, EthereumTokenType, @@ -94,9 +94,9 @@ const sns: Plugin.SNSAdaptor.Definition = { ApplicationEntries: [ (() => { const icon = - const name = + const name = const recommendFeature = { - description: , + description: , backgroundGradient: 'linear-gradient(180.54deg, #FF9A9E 0.71%, #FECFEF 98.79%, #FECFEF 99.78%)', } return { @@ -125,7 +125,7 @@ const sns: Plugin.SNSAdaptor.Definition = { appBoardSortingDefaultPriority: 1, marketListSortingPriority: 1, icon, - description: , + description: , name, tutorialLink: 'https://realmasknetwork.notion.site/0a71fd421aae4563bd07caa3e2129e5b', category: 'dapp', diff --git a/packages/mask/src/plugins/RedPacket/base.ts b/packages/mask/src/plugins/RedPacket/base.ts index cb9aeeea4ca9..c1fe7aa7fc8b 100644 --- a/packages/mask/src/plugins/RedPacket/base.ts +++ b/packages/mask/src/plugins/RedPacket/base.ts @@ -2,6 +2,7 @@ import type { Plugin } from '@masknet/plugin-infra' import { NetworkPluginID } from '@masknet/plugin-infra/web3' import { ChainId } from '@masknet/web3-shared-evm' import { RedPacketMetaKey, RedPacketNftMetaKey, RedPacketPluginID } from './constants' +import { languages } from './locales/languages' export const base: Plugin.Shared.Definition = { ID: RedPacketPluginID, @@ -40,4 +41,5 @@ export const base: Plugin.Shared.Definition = { contribution: { metadataKeys: new Set([RedPacketMetaKey, RedPacketNftMetaKey]), }, + i18n: languages, } diff --git a/packages/mask/src/plugins/RedPacket/locales/en-US.json b/packages/mask/src/plugins/RedPacket/locales/en-US.json new file mode 100644 index 000000000000..b3491141c7f6 --- /dev/null +++ b/packages/mask/src/plugins/RedPacket/locales/en-US.json @@ -0,0 +1,84 @@ +{ + "promote": "šŸ§§šŸ§§šŸ§§ Try sending Lucky Drop to your friends with tokens or NFTs to share the joy now! Install Mask.io to send your first Lucky Drop.", + "promote_short": "šŸ§§šŸ§§šŸ§§ Try sending Lucky Drop to your friends with Mask.io.", + "nft_shift_select_tip": "You can also use {{text}} to select multiple NFTs.", + "collections": "Collections", + "select_a_token": "Select a Token", + "search": "Search", + "loading_token": "Loading token...", + "search_no_result": "No results.", + "nft_already_added": "The collectible has already been added.", + "nft_invalid_owner": "The collectible does not belong to you.", + "nft_max_shares": "The maximum number of NFTs to be sold in NFT lucky drop contract is {{amount}}.", + "nft_max_shares_tip": "The NFT lucky drop supports up to {{amount, number}} NFTs selected for one time.", + "nft_non_existed_tip": "Token ID does not exist or belong to you.", + "nft_select_collection": "Choose your collection", + "completed": "Completed", + "expired": "Expired", + "nft_tip": "This is an NFT lucky drop.", + "nft_share_foreshow_message_not_twitter": "@{{sender}} is sending an NFT lucky drop on {{network}} network. \n{{payload}}", + "nft_share_foreshow_message": "@{{sender}} is sending an NFT lucky drop on {{network}} network. Follow @{{account}} (mask.io) to claim NFT lucky drops.\n#mask_io #LuckyDrop\n{{payload}}", + "nft_share_claimed_message_not_twitter": "I just claimed an NFT lucky drop from @{{sender}} on {{network}} network.\n$t(promote_short) \n{{payload}}", + "nft_share_claimed_message": "I just claimed an NFT lucky drop from @{{sender}} on {{network}} network. Follow @{{account}} (mask.io) to claim NFT lucky drops.\n$t(promote_short)\n#mask_io #LuckyDrop\n{{payload}}", + "nft_total_amount": "Total Amount", + "nft_attached_message": "Attached Message", + "nft_account_name": "Wallet account", + "message_label": "Title", + "claiming": "Claiming...", + "claim": "Claim", + "data_broken": "The Lucky Drop canā€™t be sent due to data damage. Please withdraw the assets after {{duration}}.", + "refund": "Refund", + "empty": "Empty", + "refunding": "Refunding", + "history_send": "Send", + "history_total_amount": "Total Amount: {{amount}} {{symbol}}", + "history_split_mode": "Split Mode: {{mode}}", + "history_total_claimed_amount": "Total: {{claimedAmount}}/{{amount}} {{symbol}}", + "attached_message": "Attached Message", + "indivisible": "The minimum amount for each share is {{amount}} {{symbol}}", + "name": "Lucky Drop", + "description": "Gift crypto or NFTs to any users, first come, first served.", + "next": "Next", + "nft_approve_all_tip": "Note: When selecting approve all, all NFTs in the contract will be authorized for sale by default, including the NFTs transfered later.", + "nft_unapproved_tip": "You can get the rest of your NFTs back after 24 hours of sending.", + "nft_select_partially_option": "Select partially", + "nft_select_all_option": "ALL ({{total}} NFT)", + "erc721_insufficient_balance": "Insufficient Balance", + "erc721_tab_title": "Collectibles", + "erc20_tab_title": "Token", + "claimed": "Claimed", + "details": "Lucky Drop Details", + "display_name": "Plugin: Lucky Drop", + "select_existing": "Past", + "create_new": "New", + "send_symbol": "Send {{amount}} {{symbol}}", + "back": "Back", + "hint": "You can withdraw the remaining balance 24 hours after the Lucky Drop is sent.", + "amount_total": "Amount Total", + "amount_per_share": "Amount per Share", + "shares": "Shares", + "average": "Average", + "random": "Random", + "split_mode": "Split Mode", + "token": "Token", + "chain_not_supported": "Not supported on {{chain}} yet.", + "nft_no_history": "You havenā€™t created any NFT lucky drop yet. Try to create and share lucky with your friends.", + "history_claimed": "Claimed: {{claimedShares}}/{{shares}} Share", + "send": "Send", + "history_duration": "Time: {{startTime}} ~ {{endTime}} (UTC+8)", + "best_wishes": "Best Wishes!", + "nft_data_broken": "The Lucky Drop canā€™t be sent due to data damage.", + "from": "From: @{{name}}", + "share_message_official_account": "I just claimed a lucky drop from @{{sender}} on {{network}} network. Follow @{{account}} (mask.io) to claim lucky drops.\n$t(promote_short)\n#mask_io #LuckyDrop\n{{payload}}", + "share_message_not_twitter": "I just claimed a lucky drop from @{{sender}} on {{network}} network.\n$t(promote_short)\n{{payload}}", + "share_unclaimed_message_official_account": "Hi friends, I just found a lucky drop sent by @{{sender}} on {{network}} network. Follow @{{account}} (mask.io) to claim lucky drops.\n$t(promote_short)\n#mask_io #LuckyDrop\n{{payload}}", + "share_unclaimed_message_not_twitter": "Hi friends, I just found a lucky drop sent by @{{sender}} on {{network}} network.\n$t(promote_short)\n{{payload}}", + "description_claimed": "You got {{amount}} {{symbol}}", + "description_refund": "You could refund {{balance}} {{symbol}}.", + "description_refunded": "The Lucky Drop has been refunded.", + "description_expired": "The Lucky Drop is expired.", + "description_broken": "The Lucky Drop is broken.", + "description_empty": "The Lucky Drop is empty.", + "description_failover": "{{shares}} shares / {{total}} {{symbol}}", + "recommend_feature_description": "Surpirse your social friends with Lucky Drop" +} diff --git a/packages/mask/src/plugins/RedPacket/locales/index.ts b/packages/mask/src/plugins/RedPacket/locales/index.ts new file mode 100644 index 000000000000..d6ead60252e4 --- /dev/null +++ b/packages/mask/src/plugins/RedPacket/locales/index.ts @@ -0,0 +1,6 @@ +// This file is auto generated. DO NOT EDIT +// Run `npx gulp sync-languages` to regenerate. +// Default fallback language in a family of languages are chosen by the alphabet order +// To overwrite this, please overwrite packages/scripts/src/locale-kit-next/index.ts + +export * from './i18n_generated' diff --git a/packages/mask/src/plugins/RedPacket/locales/ja-JP.json b/packages/mask/src/plugins/RedPacket/locales/ja-JP.json new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/packages/mask/src/plugins/RedPacket/locales/ja-JP.json @@ -0,0 +1 @@ +{} diff --git a/packages/mask/src/plugins/RedPacket/locales/ko-KR.json b/packages/mask/src/plugins/RedPacket/locales/ko-KR.json new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/packages/mask/src/plugins/RedPacket/locales/ko-KR.json @@ -0,0 +1 @@ +{} diff --git a/packages/mask/src/plugins/RedPacket/locales/languages.ts b/packages/mask/src/plugins/RedPacket/locales/languages.ts new file mode 100644 index 000000000000..e8cd5a8b1cd5 --- /dev/null +++ b/packages/mask/src/plugins/RedPacket/locales/languages.ts @@ -0,0 +1,34 @@ +// This file is auto generated. DO NOT EDIT +// Run `npx gulp sync-languages` to regenerate. +// Default fallback language in a family of languages are chosen by the alphabet order +// To overwrite this, please overwrite packages/scripts/src/locale-kit-next/index.ts +import en_US from './en-US.json' +import ja_JP from './ja-JP.json' +import ko_KR from './ko-KR.json' +import qya_AA from './qya-AA.json' +import zh_CN from './zh-CN.json' +import zh_TW from './zh-TW.json' +export const languages = { + en: en_US, + ja: ja_JP, + ko: ko_KR, + qy: qya_AA, + 'zh-CN': zh_CN, + zh: zh_TW, +} +// @ts-ignore +if (import.meta.webpackHot) { + // @ts-ignore + import.meta.webpackHot.accept( + ['./en-US.json', './ja-JP.json', './ko-KR.json', './qya-AA.json', './zh-CN.json', './zh-TW.json'], + () => + globalThis.dispatchEvent?.( + new CustomEvent('MASK_I18N_HMR', { + detail: [ + 'com.maskbook.red_packet', + { en: en_US, ja: ja_JP, ko: ko_KR, qy: qya_AA, 'zh-CN': zh_CN, zh: zh_TW }, + ], + }), + ), + ) +} diff --git a/packages/mask/src/plugins/RedPacket/locales/qya-AA.json b/packages/mask/src/plugins/RedPacket/locales/qya-AA.json new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/packages/mask/src/plugins/RedPacket/locales/qya-AA.json @@ -0,0 +1 @@ +{} diff --git a/packages/mask/src/plugins/RedPacket/locales/zh-CN.json b/packages/mask/src/plugins/RedPacket/locales/zh-CN.json new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/packages/mask/src/plugins/RedPacket/locales/zh-CN.json @@ -0,0 +1 @@ +{} diff --git a/packages/mask/src/plugins/RedPacket/locales/zh-TW.json b/packages/mask/src/plugins/RedPacket/locales/zh-TW.json new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/packages/mask/src/plugins/RedPacket/locales/zh-TW.json @@ -0,0 +1 @@ +{} diff --git a/packages/mask/src/plugins/Savings/SNSAdaptor/SavingsForm.tsx b/packages/mask/src/plugins/Savings/SNSAdaptor/SavingsForm.tsx index 7986af9309d3..47d5a9576b6c 100644 --- a/packages/mask/src/plugins/Savings/SNSAdaptor/SavingsForm.tsx +++ b/packages/mask/src/plugins/Savings/SNSAdaptor/SavingsForm.tsx @@ -13,6 +13,7 @@ import { formatCurrency, getAaveConstants, isSameAddress, + resolveChainName, useAccount, useFungibleTokenBalance, useTokenConstants, @@ -26,7 +27,6 @@ import { useAsync, useAsyncFn } from 'react-use' import type { AbiItem } from 'web3-utils' import { ActionButtonPromise } from '../../../extension/options-page/DashboardComponents/ActionButton' import { activatedSocialNetworkUI } from '../../../social-network' -import { isFacebook } from '../../../social-network-adaptor/facebook.com/base' import { isTwitter } from '../../../social-network-adaptor/twitter.com/base' import { useI18N } from '../../../utils' import { EthereumChainBoundary } from '../../../web3/UI/EthereumChainBoundary' @@ -164,16 +164,12 @@ export function SavingsForm({ chainId, protocol, tab, onClose }: SavingsFormProp }, [protocol.bareToken, inputAmount, chainId]) const openShareTxDialog = useOpenShareTxDialog() - const shareText = [ - `I just deposit ${inputAmount} ${protocol.bareToken.symbol} with ${resolveProtocolName(protocol.type)}. ${ - isTwitter(activatedSocialNetworkUI) || isFacebook(activatedSocialNetworkUI) - ? `Follow @${ - isTwitter(activatedSocialNetworkUI) ? t('twitter_account') : t('facebook_account') - } (mask.io) to deposit.` - : '' - }`, - '#mask_io', - ].join('\n') + const shareText = t('promote_savings', { + amount: inputAmount, + symbol: protocol.bareToken.symbol, + chain: resolveChainName(chainId), + account: isTwitter(activatedSocialNetworkUI) ? t('twitter_account') : t('facebook_account'), + }) const [, executor] = useAsyncFn(async () => { switch (tab) { case TabType.Deposit: diff --git a/packages/mask/src/plugins/Snapshot/SNSAdaptor/VotingCard.tsx b/packages/mask/src/plugins/Snapshot/SNSAdaptor/VotingCard.tsx index 1d09bbab169f..068d235a77f1 100644 --- a/packages/mask/src/plugins/Snapshot/SNSAdaptor/VotingCard.tsx +++ b/packages/mask/src/plugins/Snapshot/SNSAdaptor/VotingCard.tsx @@ -13,6 +13,7 @@ import { usePower } from './hooks/usePower' import { VoteConfirmDialog } from './VoteConfirmDialog' import { useRetry } from './hooks/useRetry' import { NetworkPluginID, useCurrentWeb3NetworkPluginID } from '@masknet/plugin-infra/web3' +import { activatedSocialNetworkUI } from '../../../social-network' const useStyles = makeStyles()((theme) => { return { @@ -52,11 +53,12 @@ export function VotingCard() { const networkPluginId = useCurrentWeb3NetworkPluginID() const retry = useRetry() const onVoteConfirm = useSnackbarCallback( - () => { + async () => { setLoading(true) - return PluginSnapshotRPC.vote(identifier, choice, account, proposal.type) + await PluginSnapshotRPC.vote(identifier, choice, account, proposal.type) + activatedSocialNetworkUI.utils.share?.(t('promote_snapshot')) }, - [choice, identifier], + [choice, identifier, account, proposal.type, t], () => { setLoading(false) setOpen(false) diff --git a/packages/mask/src/plugins/Trader/SNSAdaptor/trader/Trader.tsx b/packages/mask/src/plugins/Trader/SNSAdaptor/trader/Trader.tsx index 0f3f1536c37f..656592bc4d28 100644 --- a/packages/mask/src/plugins/Trader/SNSAdaptor/trader/Trader.tsx +++ b/packages/mask/src/plugins/Trader/SNSAdaptor/trader/Trader.tsx @@ -21,7 +21,8 @@ import { useUnmount, useUpdateEffect } from 'react-use' import { activatedSocialNetworkUI } from '../../../../social-network' import { isFacebook } from '../../../../social-network-adaptor/facebook.com/base' import { isTwitter } from '../../../../social-network-adaptor/twitter.com/base' -import { useI18N } from '../../../../utils' +import { useI18N as useBaseI18N } from '../../../../utils' +import { useI18N } from '../../locales' import { isNativeTokenWrapper } from '../../helpers' import { PluginTraderMessages } from '../../messages' import { AllProviderTradeActionType, AllProviderTradeContext } from '../../trader/useAllProviderTradeContext' @@ -61,7 +62,8 @@ export function Trader(props: TraderProps) { const chainIdValid = useChainIdValid() const { NATIVE_TOKEN_ADDRESS } = useTokenConstants() const classes = useStylesExtends(useStyles(), props) - const { t } = useI18N() + const { t: tr } = useBaseI18N() + const t = useI18N() const { setTargetChainId } = TargetChainIdContext.useContainer() // #region trade state @@ -248,16 +250,17 @@ export function Trader(props: TraderProps) { }.${ isTwitter(activatedSocialNetworkUI) || isFacebook(activatedSocialNetworkUI) ? `Follow @${ - isTwitter(activatedSocialNetworkUI) ? t('twitter_account') : t('facebook_account') + isTwitter(activatedSocialNetworkUI) ? tr('twitter_account') : tr('facebook_account') } (mask.io) to swap cryptocurrencies on ${ isTwitter(activatedSocialNetworkUI) ? 'Twitter' : 'Facebook' }.` : '' }`, '#mask_io', + t.promote(), ].join('\n') : '' - }, [focusedTrade?.value, inputToken, outputToken]) + }, [focusedTrade?.value, inputToken, outputToken, tr, t]) const openShareTxDialog = useOpenShareTxDialog() const onConfirmDialogConfirm = useCallback(async () => { setOpenConfirmDialog(false) diff --git a/packages/mask/src/plugins/Trader/base.ts b/packages/mask/src/plugins/Trader/base.ts index 2bb1969f0c29..e9970b26ff6b 100644 --- a/packages/mask/src/plugins/Trader/base.ts +++ b/packages/mask/src/plugins/Trader/base.ts @@ -2,6 +2,7 @@ import type { Plugin } from '@masknet/plugin-infra' import { NetworkPluginID } from '@masknet/plugin-infra/web3' import { ChainId } from '@masknet/web3-shared-evm' import { PLUGIN_ID } from './constants' +import { languages } from './locales/languages' export const base: Plugin.Shared.Definition = { ID: PLUGIN_ID, @@ -30,4 +31,5 @@ export const base: Plugin.Shared.Definition = { [NetworkPluginID.PLUGIN_SOLANA]: { supportedChainIds: [] }, }, }, + i18n: languages, } diff --git a/packages/mask/src/plugins/Trader/locales/en-US.json b/packages/mask/src/plugins/Trader/locales/en-US.json new file mode 100644 index 000000000000..5920a7a664f4 --- /dev/null +++ b/packages/mask/src/plugins/Trader/locales/en-US.json @@ -0,0 +1,3 @@ +{ + "promote": "Instantly token exchange on Twitter. Install Mask.io to explore ā€œbetter serverā€ on Multi-chain Dex." +} diff --git a/packages/mask/src/plugins/Trader/locales/index.ts b/packages/mask/src/plugins/Trader/locales/index.ts new file mode 100644 index 000000000000..d6ead60252e4 --- /dev/null +++ b/packages/mask/src/plugins/Trader/locales/index.ts @@ -0,0 +1,6 @@ +// This file is auto generated. DO NOT EDIT +// Run `npx gulp sync-languages` to regenerate. +// Default fallback language in a family of languages are chosen by the alphabet order +// To overwrite this, please overwrite packages/scripts/src/locale-kit-next/index.ts + +export * from './i18n_generated' diff --git a/packages/mask/src/plugins/Trader/locales/ja-JP.json b/packages/mask/src/plugins/Trader/locales/ja-JP.json new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/packages/mask/src/plugins/Trader/locales/ja-JP.json @@ -0,0 +1 @@ +{} diff --git a/packages/mask/src/plugins/Trader/locales/ko-KR.json b/packages/mask/src/plugins/Trader/locales/ko-KR.json new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/packages/mask/src/plugins/Trader/locales/ko-KR.json @@ -0,0 +1 @@ +{} diff --git a/packages/mask/src/plugins/Trader/locales/languages.ts b/packages/mask/src/plugins/Trader/locales/languages.ts new file mode 100644 index 000000000000..a189384a2e40 --- /dev/null +++ b/packages/mask/src/plugins/Trader/locales/languages.ts @@ -0,0 +1,34 @@ +// This file is auto generated. DO NOT EDIT +// Run `npx gulp sync-languages` to regenerate. +// Default fallback language in a family of languages are chosen by the alphabet order +// To overwrite this, please overwrite packages/scripts/src/locale-kit-next/index.ts +import en_US from './en-US.json' +import ja_JP from './ja-JP.json' +import ko_KR from './ko-KR.json' +import qya_AA from './qya-AA.json' +import zh_CN from './zh-CN.json' +import zh_TW from './zh-TW.json' +export const languages = { + en: en_US, + ja: ja_JP, + ko: ko_KR, + qy: qya_AA, + 'zh-CN': zh_CN, + zh: zh_TW, +} +// @ts-ignore +if (import.meta.webpackHot) { + // @ts-ignore + import.meta.webpackHot.accept( + ['./en-US.json', './ja-JP.json', './ko-KR.json', './qya-AA.json', './zh-CN.json', './zh-TW.json'], + () => + globalThis.dispatchEvent?.( + new CustomEvent('MASK_I18N_HMR', { + detail: [ + 'com.maskbook.trader', + { en: en_US, ja: ja_JP, ko: ko_KR, qy: qya_AA, 'zh-CN': zh_CN, zh: zh_TW }, + ], + }), + ), + ) +} diff --git a/packages/mask/src/plugins/Trader/locales/qya-AA.json b/packages/mask/src/plugins/Trader/locales/qya-AA.json new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/packages/mask/src/plugins/Trader/locales/qya-AA.json @@ -0,0 +1 @@ +{} diff --git a/packages/mask/src/plugins/Trader/locales/zh-CN.json b/packages/mask/src/plugins/Trader/locales/zh-CN.json new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/packages/mask/src/plugins/Trader/locales/zh-CN.json @@ -0,0 +1 @@ +{} diff --git a/packages/mask/src/plugins/Trader/locales/zh-TW.json b/packages/mask/src/plugins/Trader/locales/zh-TW.json new file mode 100644 index 000000000000..0967ef424bce --- /dev/null +++ b/packages/mask/src/plugins/Trader/locales/zh-TW.json @@ -0,0 +1 @@ +{} diff --git a/packages/mask/src/plugins/dHEDGE/UI/InvestDialog.tsx b/packages/mask/src/plugins/dHEDGE/UI/InvestDialog.tsx index 53f8e5eda38c..d636468993f7 100644 --- a/packages/mask/src/plugins/dHEDGE/UI/InvestDialog.tsx +++ b/packages/mask/src/plugins/dHEDGE/UI/InvestDialog.tsx @@ -94,7 +94,7 @@ export function InvestDialog() { // #endregion // #region blocking - const [isInvesting, investCallback] = useInvestCallback(pool, amount.toFixed(), token) + const [{ loading: isInvesting }, investCallback] = useInvestCallback(pool, amount.toFixed(), token) const openShareTxDialog = useOpenShareTxDialog() const cashTag = isTwitter(activatedSocialNetworkUI) ? '$' : '' const shareText = token diff --git a/packages/mask/src/plugins/dHEDGE/hooks/useInvestCallback.ts b/packages/mask/src/plugins/dHEDGE/hooks/useInvestCallback.ts index ced58ff42cde..ec087c129d64 100644 --- a/packages/mask/src/plugins/dHEDGE/hooks/useInvestCallback.ts +++ b/packages/mask/src/plugins/dHEDGE/hooks/useInvestCallback.ts @@ -1,6 +1,6 @@ import { toFixed } from '@masknet/web3-shared-base' import { EthereumTokenType, FungibleTokenDetailed, TransactionEventType, useAccount } from '@masknet/web3-shared-evm' -import { useCallback, useState } from 'react' +import { useAsyncFn } from 'react-use' import { useDHedgePoolV1Contract, useDHedgePoolV2Contract } from '../contracts/useDHedgePool' import { Pool, PoolType } from '../types' @@ -15,9 +15,8 @@ export function useInvestCallback(pool: Pool | undefined, amount: string, token? const poolV2Contract = useDHedgePoolV2Contract(pool?.address ?? '') const account = useAccount() - const [loading, setLoading] = useState(false) - const investCallback = useCallback(async () => { + return useAsyncFn(async () => { if (!token || !poolV1Contract || !poolV2Contract) return // step 1: estimate gas @@ -32,11 +31,9 @@ export function useInvestCallback(pool: Pool | undefined, amount: string, token? : poolV2Contract.methods.deposit(token.address, amount) } - setLoading(true) const estimatedGas = await deposit() .estimateGas(config) .catch((error) => { - setLoading(false) throw error }) @@ -53,6 +50,4 @@ export function useInvestCallback(pool: Pool | undefined, amount: string, token? .on(TransactionEventType.ERROR, reject) }) }, [pool, account, amount, token]) - - return [loading, investCallback] as const } diff --git a/packages/mask/src/social-network-adaptor/twitter.com/injection/NFT/NFTAvatarInTwitter.tsx b/packages/mask/src/social-network-adaptor/twitter.com/injection/NFT/NFTAvatarInTwitter.tsx index 1fb279a56651..b8a0682dcea7 100644 --- a/packages/mask/src/social-network-adaptor/twitter.com/injection/NFT/NFTAvatarInTwitter.tsx +++ b/packages/mask/src/social-network-adaptor/twitter.com/injection/NFT/NFTAvatarInTwitter.tsx @@ -1,4 +1,4 @@ -import { createReactRootShadowed, MaskMessages, NFTAvatarEvent, startWatch } from '../../../../utils' +import { createReactRootShadowed, MaskMessages, NFTAvatarEvent, startWatch, useI18N } from '../../../../utils' import { searchTwitterAvatarLinkSelector, searchTwitterAvatarSelector } from '../../utils/selector' import { MutationObserverWatcher } from '@dimensiondev/holoflows-kit' import { makeStyles } from '@masknet/theme' @@ -16,6 +16,9 @@ import { trim } from 'lodash-unified' import { RSS3_KEY_SNS } from '../../../../plugins/Avatar/constants' import { openWindow } from '@masknet/shared-base-ui' import { usePersonaNFTAvatar } from '../../../../plugins/Avatar/hooks/usePersonaNFTAvatar' +import { NFTCardStyledAssetPlayer, useShowConfirm } from '@masknet/shared' +import { Box, Typography } from '@mui/material' +import { activatedSocialNetworkUI } from '../../../../social-network' export function injectNFTAvatarInTwitter(signal: AbortSignal) { const watcher = new MutationObserverWatcher(searchTwitterAvatarSelector()) @@ -61,6 +64,7 @@ function NFTAvatarInTwitter() { const windowSize = useWindowSize() const location = useLocation() + const { t } = useI18N() const showAvatar = useMemo( () => getAvatarId(identity.avatar ?? '') === avatar?.avatarId && avatar.avatarId, [avatar?.avatarId, identity.avatar], @@ -81,6 +85,7 @@ function NFTAvatarInTwitter() { const onUpdate = (data: NFTAvatarEvent) => { setNFTEvent(data) } + const openConfirmDialog = useShowConfirm() // After the avatar is set, it cannot be saved immediately, and must wait until the avatar of twitter is updated useAsync(async () => { @@ -118,6 +123,21 @@ function NFTAvatarInTwitter() { window.alert('Sorry, failed to save NFT Avatar. Please set again.') return } + openConfirmDialog({ + title: t('plugin_avatar_setup_share_title'), + content: ( + + + + {t('plugin_avatar_setup_success')} + + + ), + confirmLabel: t('share'), + onSubmit() { + activatedSocialNetworkUI.utils.share?.(t('plugin_avatar_setup_pfp_share')) + }, + }) setAvatar(avatar) MaskMessages.events.NFTAvatarTimelineUpdated.sendToAll( @@ -130,7 +150,7 @@ function NFTAvatarInTwitter() { ) setNFTEvent(undefined) - }, [identity.avatar]) + }, [identity.avatar, openConfirmDialog, t]) useEffect(() => { setAvatar(_avatar) diff --git a/packages/mask/src/tsconfig.json b/packages/mask/src/tsconfig.json index 9d137580ffed..5be5ef7a1573 100644 --- a/packages/mask/src/tsconfig.json +++ b/packages/mask/src/tsconfig.json @@ -31,6 +31,7 @@ { "path": "../../plugin-infra" }, { "path": "../../plugins/Wallet" }, { "path": "../../plugins/Flow" }, + { "path": "../../plugins/FileService" }, { "path": "../../external-plugin-previewer" }, { "path": "../../injected-script/sdk" }, { "path": "../../mask-sdk/server" }, diff --git a/packages/mask/src/web3/UI/EthereumERC20TokenApprovedBoundary.tsx b/packages/mask/src/web3/UI/EthereumERC20TokenApprovedBoundary.tsx index 8759226ec53d..7ae770d3fc76 100644 --- a/packages/mask/src/web3/UI/EthereumERC20TokenApprovedBoundary.tsx +++ b/packages/mask/src/web3/UI/EthereumERC20TokenApprovedBoundary.tsx @@ -154,7 +154,7 @@ export function EthereumERC20TokenApprovedBoundary(props: EthereumERC20TokenAppr ) : null} ) - if (approveStateType === ApproveStateType.PENDING || approveStateType === ApproveStateType.UPDATING) + if (transactionState.loading || approveStateType === ApproveStateType.UPDATING) return ( - {approveStateType === ApproveStateType.PENDING + {transactionState.loading ? t('plugin_ito_unlocking_symbol', { symbol: token.symbol }) : `Updating ${token.symbol}`} … diff --git a/packages/mask/src/web3/UI/EthereumERC721TokenApprovedBoundary.tsx b/packages/mask/src/web3/UI/EthereumERC721TokenApprovedBoundary.tsx index e10bd3c2760b..e84035bd6bf9 100644 --- a/packages/mask/src/web3/UI/EthereumERC721TokenApprovedBoundary.tsx +++ b/packages/mask/src/web3/UI/EthereumERC721TokenApprovedBoundary.tsx @@ -1,17 +1,16 @@ +import { makeStyles, useCustomSnackbar, useStylesExtends } from '@masknet/theme' import { - useERC721ContractIsApproveForAll, - useERC721ContractSetApproveForAllCallback, - TransactionStateType, ERC721ContractDetailed, resolveTransactionLinkOnExplorer, + useERC721ContractIsApproveForAll, + useERC721ContractSetApproveForAllCallback, } from '@masknet/web3-shared-evm' import OpenInNewIcon from '@mui/icons-material/OpenInNew' -import { useI18N } from '../../utils' -import { makeStyles, useCustomSnackbar, useStylesExtends } from '@masknet/theme' -import { Typography, Link } from '@mui/material' -import ActionButton, { ActionButtonProps } from '../../extension/options-page/DashboardComponents/ActionButton' -import { useMemo, useEffect } from 'react' +import { Link, Typography } from '@mui/material' +import { useCallback, useMemo } from 'react' import { EthereumAddress } from 'wallet.ts' +import ActionButton, { ActionButtonProps } from '../../extension/options-page/DashboardComponents/ActionButton' +import { useI18N } from '../../utils' const useStyles = makeStyles()(() => ({ snackBarText: { @@ -48,45 +47,39 @@ export function EthereumERC721TokenApprovedBoundary(props: EthereumERC712TokenAp const { t } = useI18N() const classes = useStylesExtends(useStyles(), props) const { value, loading, retry } = useERC721ContractIsApproveForAll(contractDetailed?.address, owner, operator) - const [approveState, approveCallback, resetCallback] = useERC721ContractSetApproveForAllCallback( + const [approveState, approveCallback] = useERC721ContractSetApproveForAllCallback( contractDetailed?.address, operator, true, ) const { showSnackbar } = useCustomSnackbar() - useEffect(() => { - if (approveState.type === TransactionStateType.CONFIRMED && approveState.no === 0) { - showSnackbar( -
- - {t('plugin_wallet_approve_all_nft_successfully', { symbol: contractDetailed?.symbol })} - - - - -
, - { - variant: 'success', - anchorOrigin: { horizontal: 'right', vertical: 'top' }, - }, - ) - resetCallback() - retry() - } else if (approveState.type === TransactionStateType.FAILED) { - showSnackbar(approveState.error.message, { - variant: 'error', - }) - resetCallback() + const approve = useCallback(async () => { + const hash = await approveCallback() + if (typeof hash !== 'string') { + showSnackbar(approveState.error?.message) + return } - }, [approveState, contractDetailed]) + showSnackbar( +
+ + {t('plugin_wallet_approve_all_nft_successfully', { symbol: contractDetailed?.symbol })} + + + + +
, + { + variant: 'success', + anchorOrigin: { horizontal: 'right', vertical: 'top' }, + }, + ) + retry() + }, [showSnackbar, approveState, retry, contractDetailed]) const validationMessage = useMemo(() => { if (!contractDetailed?.address || !EthereumAddress.isValid(contractDetailed?.address)) @@ -97,7 +90,7 @@ export function EthereumERC721TokenApprovedBoundary(props: EthereumERC712TokenAp return '' }, [contractDetailed, owner, operator, _validationMessage]) - if ([TransactionStateType.WAIT_FOR_CONFIRMING, TransactionStateType.HASH].includes(approveState.type)) { + if (approveState.loading) { return ( {t('plugin_wallet_approve_all_nft', { symbol: contractDetailed?.symbol diff --git a/packages/plugins/FileService/src/index.ts b/packages/plugins/FileService/src/index.ts index 69226b786ae4..79ee5520eaa9 100644 --- a/packages/plugins/FileService/src/index.ts +++ b/packages/plugins/FileService/src/index.ts @@ -1,6 +1,8 @@ import { registerPlugin } from '@masknet/plugin-infra' import { base } from './base' +export { FileInfoMetadataReader } from './helpers' + registerPlugin({ ...base, SNSAdaptor: { diff --git a/packages/web3-shared/evm/hooks/useERC20TokenApproveCallback.ts b/packages/web3-shared/evm/hooks/useERC20TokenApproveCallback.ts index 346b49771765..2e52b2049043 100644 --- a/packages/web3-shared/evm/hooks/useERC20TokenApproveCallback.ts +++ b/packages/web3-shared/evm/hooks/useERC20TokenApproveCallback.ts @@ -1,13 +1,13 @@ -import { useCallback, useMemo } from 'react' -import { once } from 'lodash-unified' import type { NonPayableTx } from '@masknet/web3-contracts/types/types' -import { TransactionStateType, TransactionEventType } from '../types' +import { isLessThan, toFixed } from '@masknet/web3-shared-base' +import { once } from 'lodash-unified' +import { useCallback, useMemo } from 'react' +import { useAsyncFn } from 'react-use' import { useERC20TokenContract } from '../contracts/useERC20TokenContract' +import { TransactionEventType } from '../types' import { useAccount } from './useAccount' import { useERC20TokenAllowance } from './useERC20TokenAllowance' import { useERC20TokenBalance } from './useERC20TokenBalance' -import { useTransactionState } from './useTransactionState' -import { isLessThan, toFixed } from '@masknet/web3-shared-base' const MaxUint256 = toFixed('0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff') @@ -23,7 +23,6 @@ export enum ApproveStateType { export function useERC20TokenApproveCallback(address?: string, amount?: string, spender?: string) { const account = useAccount() const erc20Contract = useERC20TokenContract(address) - const [transactionState, setTransactionState] = useTransactionState() // read the approved information from the chain const { @@ -44,43 +43,20 @@ export function useERC20TokenApproveCallback(address?: string, amount?: string, if (!amount || !spender) return ApproveStateType.UNKNOWN if (loadingBalance || loadingAllowance) return ApproveStateType.UPDATING if (errorBalance || errorAllowance) return ApproveStateType.FAILED - if (transactionState.type === TransactionStateType.WAIT_FOR_CONFIRMING) return ApproveStateType.PENDING return isLessThan(allowance, amount) ? ApproveStateType.NOT_APPROVED : ApproveStateType.APPROVED - }, [ - amount, - spender, - balance, - allowance, - errorBalance, - errorAllowance, - loadingAllowance, - loadingBalance, - transactionState.type, - ]) + }, [amount, spender, balance, allowance, errorBalance, errorAllowance, loadingAllowance, loadingBalance]) - const approveCallback = useCallback( + const [state, approveCallback] = useAsyncFn( async (useExact = false) => { - setTransactionState({ - type: TransactionStateType.UNKNOWN, - }) if (approveStateType === ApproveStateType.UNKNOWN || !amount || !spender || !erc20Contract) { return } // error: failed to approve token if (approveStateType !== ApproveStateType.NOT_APPROVED) { - setTransactionState({ - type: TransactionStateType.FAILED, - error: new Error('Failed to approve token.'), - }) return } - // start waiting for provider to confirm tx - setTransactionState({ - type: TransactionStateType.WAIT_FOR_CONFIRMING, - }) - // estimate gas and compose transaction const config = { from: account, @@ -96,16 +72,12 @@ export function useERC20TokenApproveCallback(address?: string, amount?: string, }) }) .catch((error) => { - setTransactionState({ - type: TransactionStateType.FAILED, - error, - }) throw error }), } // send transaction and wait for hash - return new Promise(async (resolve, reject) => { + return new Promise(async (resolve, reject) => { const revalidate = once(() => { revalidateBalance() revalidateAllowance() @@ -113,43 +85,25 @@ export function useERC20TokenApproveCallback(address?: string, amount?: string, erc20Contract.methods .approve(spender, useExact ? amount : MaxUint256) .send(config as NonPayableTx) - .on(TransactionEventType.RECEIPT, (receipt) => { - setTransactionState({ - type: TransactionStateType.CONFIRMED, - no: 0, - receipt, - }) + .on(TransactionEventType.RECEIPT, () => { revalidate() - resolve() }) .on(TransactionEventType.CONFIRMATION, (no, receipt) => { - setTransactionState({ - type: TransactionStateType.CONFIRMED, - no, - receipt, - }) revalidate() - resolve() + resolve(receipt.transactionHash) }) .on(TransactionEventType.ERROR, (error) => { - setTransactionState({ - type: TransactionStateType.FAILED, - error, - }) revalidate() reject(error) }) }) }, - [account, amount, balance, spender, loadingAllowance, loadingBalance, erc20Contract, approveStateType], + [account, amount, spender, erc20Contract, approveStateType], ) const resetCallback = useCallback(() => { revalidateBalance() revalidateAllowance() - setTransactionState({ - type: TransactionStateType.UNKNOWN, - }) }, [revalidateBalance, revalidateAllowance]) return [ @@ -160,7 +114,7 @@ export function useERC20TokenApproveCallback(address?: string, amount?: string, spender, balance, }, - transactionState, + state, approveCallback, resetCallback, ] as const diff --git a/packages/web3-shared/evm/hooks/useERC721ContractSetApproveForAllCallback.ts b/packages/web3-shared/evm/hooks/useERC721ContractSetApproveForAllCallback.ts index 6eb6672de354..99c2cf200196 100644 --- a/packages/web3-shared/evm/hooks/useERC721ContractSetApproveForAllCallback.ts +++ b/packages/web3-shared/evm/hooks/useERC721ContractSetApproveForAllCallback.ts @@ -1,9 +1,8 @@ -import { useCallback } from 'react' import type { NonPayableTx } from '@masknet/web3-contracts/types/types' -import { useAccount } from './useAccount' -import { useTransactionState } from './useTransactionState' +import { useAsyncFn } from 'react-use' import { useERC721TokenContract } from '../contracts' -import { TransactionStateType, TransactionEventType } from '../types' +import { TransactionEventType } from '../types' +import { useAccount } from './useAccount' import { useChainId } from './useChainId' /** @@ -19,62 +18,32 @@ export function useERC721ContractSetApproveForAllCallback( const account = useAccount() const chainId = useChainId() const erc721TokenContract = useERC721TokenContract(contractAddress) - const [approveState, setApproveState] = useTransactionState() - const approveCallback = useCallback(async () => { + return useAsyncFn(async () => { if (!erc721TokenContract || !contractAddress || !operator) { - setApproveState({ type: TransactionStateType.UNKNOWN }) return } - setApproveState({ - type: TransactionStateType.WAIT_FOR_CONFIRMING, - }) - const config = { from: account, gas: await erc721TokenContract.methods .setApprovalForAll(operator, approved) .estimateGas({ from: account }) .catch((error) => { - setApproveState({ type: TransactionStateType.FAILED, error }) throw error }), } - return new Promise(async (resolve, reject) => { + return new Promise(async (resolve, reject) => { erc721TokenContract.methods .setApprovalForAll(operator, approved) .send(config as NonPayableTx) - .on(TransactionEventType.RECEIPT, (receipt) => { - setApproveState({ - type: TransactionStateType.CONFIRMED, - no: 0, - receipt, - }) - resolve() - }) .on(TransactionEventType.CONFIRMATION, (no, receipt) => { - setApproveState({ - type: TransactionStateType.CONFIRMED, - no, - receipt, - }) - resolve() + resolve(receipt.transactionHash) }) .on(TransactionEventType.ERROR, (error) => { - setApproveState({ - type: TransactionStateType.FAILED, - error, - }) reject(error) }) }) - }, [account, chainId, erc721TokenContract, approved, contractAddress, operator, setApproveState]) - - const resetCallback = useCallback(() => { - setApproveState({ type: TransactionStateType.UNKNOWN }) - }, []) - - return [approveState, approveCallback, resetCallback] as const + }, [account, chainId, erc721TokenContract, approved, contractAddress, operator]) } diff --git a/packages/web3-shared/evm/hooks/useTransactionCallback.ts b/packages/web3-shared/evm/hooks/useTransactionCallback.ts index b2a8f6f446d2..a2f6d92d0f7e 100644 --- a/packages/web3-shared/evm/hooks/useTransactionCallback.ts +++ b/packages/web3-shared/evm/hooks/useTransactionCallback.ts @@ -1,32 +1,24 @@ import type { PayableTransactionObject, PayableTx } from '@masknet/web3-contracts/types/types' import { omit } from 'lodash-unified' -import { useCallback, useState } from 'react' +import { useAsyncFn } from 'react-use' import { TransactionEventType } from '../types' export function useTransactionCallback( config: PayableTx | undefined, method: PayableTransactionObject | undefined, ) { - const [loading, setLoading] = useState(false) - - const updateCallback = useCallback(async () => { + return useAsyncFn(async () => { if (!config || !method) return const gasExpectedConfig = { ...config } - setLoading(true) try { const estimatedGas = await method.estimateGas(omit(config, 'gas')) if (!gasExpectedConfig.gas && estimatedGas) { gasExpectedConfig.gas = estimatedGas } } catch (error) { - try { - await method.call(config) - } catch (error) { - setLoading(false) - throw error - } + await method.call(config) } return new Promise(async (resolve, reject) => { @@ -40,6 +32,4 @@ export function useTransactionCallback( }) }) }, [config, method]) - - return [loading, updateCallback] as const } From 6e3d3c845fe251e5eee0376f27eb0eb9e02b9591 Mon Sep 17 00:00:00 2001 From: codingsh Date: Fri, 27 May 2022 03:19:01 +0100 Subject: [PATCH 23/24] chore(moonbeam): add balanceChecker contract --- .../pages/Wallet/GasSetting/Prior1559GasSetting.tsx | 10 +++++----- .../GasSettingDialog/Prior1559GasSetting.tsx | 10 +++++----- packages/web3-constants/evm/ethereum.json | 2 +- packages/web3-constants/evm/rpc.json | 4 +--- packages/web3-constants/evm/token-list.json | 2 +- packages/web3-constants/evm/token.json | 2 +- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/packages/mask/src/extension/popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx b/packages/mask/src/extension/popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx index af40584f9d57..db06c6732f34 100644 --- a/packages/mask/src/extension/popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx +++ b/packages/mask/src/extension/popups/pages/Wallet/GasSetting/Prior1559GasSetting.tsx @@ -1,5 +1,5 @@ import { makeStyles } from '@masknet/theme' -import { isLessThan, pow10 } from '@masknet/web3-shared-base' +import { isLessThan, scale10 } from '@masknet/web3-shared-base' import { memo, useEffect, useMemo, useState } from 'react' import { useI18N } from '../../../../../utils' import { useAsync, useAsyncFn, useUpdateEffect } from 'react-use' @@ -94,10 +94,10 @@ const useStyles = makeStyles()((theme) => ({ })) const minGasPriceOfChain: ChainIdOptionalRecord = { - [ChainId.BSC]: pow10(9).multipliedBy(5), // 5 Gwei - [ChainId.Conflux]: pow10(9).multipliedBy(5), // 5 Gwei - [ChainId.Matic]: pow10(9).multipliedBy(30), // 30 Gwei - [ChainId.Moonbeam]: pow10(9).multipliedBy(1), // 1 Gwei + [ChainId.BSC]: scale10(5, 9), // 5 Gwei + [ChainId.Conflux]: scale10(5, 9), // 5 Gwei + [ChainId.Matic]: scale10(30, 9), // 30 Gwei + [ChainId.Moonbeam]: scale10(1, 9), // 1 Gwei } export const Prior1559GasSetting = memo(() => { diff --git a/packages/mask/src/plugins/Wallet/SNSAdaptor/GasSettingDialog/Prior1559GasSetting.tsx b/packages/mask/src/plugins/Wallet/SNSAdaptor/GasSettingDialog/Prior1559GasSetting.tsx index 8612e33a3319..0aa2e35067e0 100644 --- a/packages/mask/src/plugins/Wallet/SNSAdaptor/GasSettingDialog/Prior1559GasSetting.tsx +++ b/packages/mask/src/plugins/Wallet/SNSAdaptor/GasSettingDialog/Prior1559GasSetting.tsx @@ -23,13 +23,13 @@ import { WalletRPC } from '../../../Wallet/messages' import { useNativeTokenPrice } from '../../hooks/useTokenPrice' import type { GasSettingProps } from './types' import { useGasSettingStyles } from './useGasSettingStyles' -import { pow10 } from '@masknet/web3-shared-base' +import { scale10 } from '@masknet/web3-shared-base' const minGasPriceOfChain: ChainIdOptionalRecord = { - [ChainId.BSC]: pow10(9).multipliedBy(5), // 5 Gwei - [ChainId.Conflux]: pow10(9).multipliedBy(5), // 5 Gwei - [ChainId.Matic]: pow10(9).multipliedBy(30), // 30 Gwei - [ChainId.Moonbeam]: pow10(9).multipliedBy(1), // 1 Gwei + [ChainId.BSC]: scale10(5, 9), // 5 Gwei + [ChainId.Conflux]: scale10(5, 9), // 5 Gwei + [ChainId.Matic]: scale10(30, 9), // 30 Gwei + [ChainId.Moonbeam]: scale10(1, 9), // 1 Gwei } export const Prior1559GasSetting: FC = memo( diff --git a/packages/web3-constants/evm/ethereum.json b/packages/web3-constants/evm/ethereum.json index b7a6d67f9aa1..66b9ea794e9e 100644 --- a/packages/web3-constants/evm/ethereum.json +++ b/packages/web3-constants/evm/ethereum.json @@ -21,7 +21,7 @@ "Conflux": "", "Harmony": "0xc119574d5fb333f5ac018658d4d8b5035e16bf39", "Harmony_Test": "", - "Moonbeam": "0xC119574D5Fb333F5AC018658D4d8b5035E16bf39" + "Moonbeam": "0xf5056B96ab242C566002852d0b98ce0BcDf1af51" }, "MULTICALL_ADDRESS": { "Mainnet": "0x1F98415757620B543A52E61c46B32eB19261F984", diff --git a/packages/web3-constants/evm/rpc.json b/packages/web3-constants/evm/rpc.json index dfda4bce9d6e..271512be801f 100644 --- a/packages/web3-constants/evm/rpc.json +++ b/packages/web3-constants/evm/rpc.json @@ -71,9 +71,7 @@ "Harmony_Test": ["https://api.s0.b.hmny.io/"], "Moonbeam": [ "https://moonbeam.api.onfinality.io/rpc?apikey=e5e810e6-6162-4427-8ba3-d5ad8b9cf4c0", - "https://moonbeam.blastapi.io/905553b4-5acd-4f24-b473-ebca226a76c4", - "https://moonbeam.public.blastapi.io", - "https://moonbeam.api.onfinality.io/public" + "https://moonbeam.blastapi.io/905553b4-5acd-4f24-b473-ebca226a76c4" ] }, "RPC_WEIGHTS": { diff --git a/packages/web3-constants/evm/token-list.json b/packages/web3-constants/evm/token-list.json index 7e41e3f00a5b..fb16a3faf1e4 100644 --- a/packages/web3-constants/evm/token-list.json +++ b/packages/web3-constants/evm/token-list.json @@ -21,6 +21,6 @@ "Conflux": ["https://tokens.r2d2.to/latest/1030/tokens.json"], "Harmony": ["https://tokens.r2d2.to/latest/1666600000/tokens.json"], "Harmony_Test": ["https://tokens.r2d2.to/latest/1666700000/tokens.json"], - "Moonbeam": ["https://token-list.sushi.com/"] + "Moonbeam": ["https://token-list.sushi.com/", "https://tokens.r2d2.to/latest/1284/tokens.json"] } } diff --git a/packages/web3-constants/evm/token.json b/packages/web3-constants/evm/token.json index 41e85e88e733..cc06519bbd35 100644 --- a/packages/web3-constants/evm/token.json +++ b/packages/web3-constants/evm/token.json @@ -1269,7 +1269,7 @@ "Conflux": "0x0000000000000000000000000000000000000000", "Harmony": "0x0000000000000000000000000000000000000000", "Harmony_Test": "0x0000000000000000000000000000000000000000", - "Moonbeam": "0x0000000000000000000000000000000000000802" + "Moonbeam": "0x0000000000000000000000000000000000000000" }, "WETH_ADDRESS": { "Mainnet": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", From 8b9dfc7137791403e85a84c1d8789c1814855b80 Mon Sep 17 00:00:00 2001 From: codingsh Date: Tue, 14 Jun 2022 16:17:13 +0000 Subject: [PATCH 24/24] chore(spell): fixed cspell --- cspell.json | 2 +- packages/web3-providers/src/zerion/format.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cspell.json b/cspell.json index 608f477b9557..0cb61d9e0d00 100644 --- a/cspell.json +++ b/cspell.json @@ -87,8 +87,8 @@ "gapcheck", "gasnow", "geckoview", + "glmr", "gltf", - "gmlr", "goodghosting", "gundb", "hashmasks", diff --git a/packages/web3-providers/src/zerion/format.ts b/packages/web3-providers/src/zerion/format.ts index bdd193b22fd8..f5a0c2061b2a 100644 --- a/packages/web3-providers/src/zerion/format.ts +++ b/packages/web3-providers/src/zerion/format.ts @@ -65,7 +65,7 @@ export function formatAssets( const balance = leftShift(quantity, asset.decimals).toNumber() const value = (asset as ZerionAsset).price?.value ?? (asset as ZerionCovalentAsset).value ?? 0 const isNativeToken = (symbol: string) => - ['ETH', 'BNB', 'MATIC', 'ARETH', 'AETH', 'ONE', 'GMLR'].includes(symbol) + ['ETH', 'BNB', 'MATIC', 'ARETH', 'AETH', 'ONE', 'GLMR'].includes(symbol) const address = isNativeToken(asset.symbol) ? getTokenConstants().NATIVE_TOKEN_ADDRESS ?? '' : asset.asset_code return {