diff --git a/package.json b/package.json index 42fd81cae1..ffeca4b8b6 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "ng-inline-svg-2": "^15.0.1", "ngx-cookie-service": "^16.0.0", "querystring-es3": "^0.2.1", - "rubic-sdk": "5.49.8", + "rubic-sdk": "5.49.9", "rxjs": "7.8.1", "ts-cacheable": "^1.0.5", "viem": "^1.21.1", diff --git a/src/app/core/services/backend/tokens-api/constants/fetch-blockchains.ts b/src/app/core/services/backend/tokens-api/constants/fetch-blockchains.ts index 7d1eeecd5e..5ffd52f08e 100644 --- a/src/app/core/services/backend/tokens-api/constants/fetch-blockchains.ts +++ b/src/app/core/services/backend/tokens-api/constants/fetch-blockchains.ts @@ -58,7 +58,8 @@ export const blockchainsToFetch: BlockchainName[] = [ BLOCKCHAIN_NAME.FLARE, BLOCKCHAIN_NAME.TON, BLOCKCHAIN_NAME.SCROLL, - BLOCKCHAIN_NAME.GRAVITY + BLOCKCHAIN_NAME.GRAVITY, + BLOCKCHAIN_NAME.SONIC ]; export const blockchainsWithOnePage: BlockchainName[] = [ diff --git a/src/app/core/services/backend/tokens-api/models/default-tokens.ts b/src/app/core/services/backend/tokens-api/models/default-tokens.ts index e144fcf246..8e6e0b7e0d 100644 --- a/src/app/core/services/backend/tokens-api/models/default-tokens.ts +++ b/src/app/core/services/backend/tokens-api/models/default-tokens.ts @@ -1057,5 +1057,8 @@ export const defaultTokens: Record = { ], [BLOCKCHAIN_NAME.GRAVITY]: [ { ...nativeTokensList[BLOCKCHAIN_NAME.GRAVITY], ...defaultTokenParams } as Token + ], + [BLOCKCHAIN_NAME.SONIC]: [ + { ...nativeTokensList[BLOCKCHAIN_NAME.SONIC], ...defaultTokenParams } as Token ] }; diff --git a/src/app/core/services/gas-service/gas.service.ts b/src/app/core/services/gas-service/gas.service.ts index 425790c9b7..d310fef29d 100644 --- a/src/app/core/services/gas-service/gas.service.ts +++ b/src/app/core/services/gas-service/gas.service.ts @@ -40,7 +40,8 @@ const supportedBlockchains = [ BLOCKCHAIN_NAME.ROOTSTOCK, BLOCKCHAIN_NAME.SEI, BLOCKCHAIN_NAME.BITLAYER, - BLOCKCHAIN_NAME.GRAVITY + BLOCKCHAIN_NAME.GRAVITY, + BLOCKCHAIN_NAME.SONIC ] as const; type SupportedBlockchain = (typeof supportedBlockchains)[number]; @@ -85,7 +86,8 @@ export class GasService { [BLOCKCHAIN_NAME.ROOTSTOCK]: this.fetchRootstockGas.bind(this), [BLOCKCHAIN_NAME.SEI]: this.fetchSeiGas.bind(this), [BLOCKCHAIN_NAME.BITLAYER]: this.fetchBitlayerGas.bind(this), - [BLOCKCHAIN_NAME.GRAVITY]: this.fetchGravityGas.bind(this) + [BLOCKCHAIN_NAME.GRAVITY]: this.fetchGravityGas.bind(this), + [BLOCKCHAIN_NAME.SONIC]: this.fetchSonicGas.bind(this) }; private static isSupportedBlockchain( @@ -646,4 +648,18 @@ export class GasService { }) ); } + + @Cacheable({ + maxAge: GasService.requestInterval + }) + private fetchSonicGas(): Observable { + const blockchainAdapter = Injector.web3PublicService.getWeb3Public(BLOCKCHAIN_NAME.SONIC); + return from(blockchainAdapter.getGasPrice()).pipe( + map((gasPriceInWei: string) => { + return { + gasPrice: new BigNumber(gasPriceInWei).dividedBy(10 ** 18).toFixed() + }; + }) + ); + } } diff --git a/src/app/core/services/wallets/wallet-connector-service/constants/default-blockchain-data.ts b/src/app/core/services/wallets/wallet-connector-service/constants/default-blockchain-data.ts index c100cd622a..924da2e5b2 100644 --- a/src/app/core/services/wallets/wallet-connector-service/constants/default-blockchain-data.ts +++ b/src/app/core/services/wallets/wallet-connector-service/constants/default-blockchain-data.ts @@ -222,5 +222,9 @@ export const defaultBlockchainData: Partial = { [BLOCKCHAIN_NAME.SEI]: 'sei', [BLOCKCHAIN_NAME.CORE]: 'core', [BLOCKCHAIN_NAME.BAHAMUT]: 'bahamut', - [BLOCKCHAIN_NAME.GRAVITY]: 'gravity' + [BLOCKCHAIN_NAME.GRAVITY]: 'gravity', + [BLOCKCHAIN_NAME.SONIC]: 'sonic' }; diff --git a/src/app/features/trade/services/on-chain/constants/on-chain-blacklist.ts b/src/app/features/trade/services/on-chain/constants/on-chain-blacklist.ts index 3fd51b64a4..af060009da 100644 --- a/src/app/features/trade/services/on-chain/constants/on-chain-blacklist.ts +++ b/src/app/features/trade/services/on-chain/constants/on-chain-blacklist.ts @@ -82,7 +82,8 @@ const onChainBlacklist: Record = { [BLOCKCHAIN_NAME.BAHAMUT]: [], [BLOCKCHAIN_NAME.BITLAYER]: [], [BLOCKCHAIN_NAME.GRAVITY]: [], - [BLOCKCHAIN_NAME.UNICHAIN_SEPOLIA_TESTNET]: [] + [BLOCKCHAIN_NAME.UNICHAIN_SEPOLIA_TESTNET]: [], + [BLOCKCHAIN_NAME.SONIC]: [] }; export const onChainBlacklistProviders: OnChainTradeType[] = [ diff --git a/src/app/shared/constants/blockchain/blockchain-color.ts b/src/app/shared/constants/blockchain/blockchain-color.ts index 159a562502..b69db04aca 100644 --- a/src/app/shared/constants/blockchain/blockchain-color.ts +++ b/src/app/shared/constants/blockchain/blockchain-color.ts @@ -146,5 +146,6 @@ export const blockchainColor: Record = { [BLOCKCHAIN_NAME.BAHAMUT]: '#FFFFFF', [BLOCKCHAIN_NAME.BITLAYER]: '#E36E1B', [BLOCKCHAIN_NAME.GRAVITY]: '#FFFFFF', - [BLOCKCHAIN_NAME.UNICHAIN_SEPOLIA_TESTNET]: '#FFFFFF' + [BLOCKCHAIN_NAME.UNICHAIN_SEPOLIA_TESTNET]: '#FFFFFF', + [BLOCKCHAIN_NAME.SONIC]: '#131315' }; diff --git a/src/app/shared/constants/blockchain/blockchain-icon.ts b/src/app/shared/constants/blockchain/blockchain-icon.ts index 4db338581b..30cef4e0a7 100644 --- a/src/app/shared/constants/blockchain/blockchain-icon.ts +++ b/src/app/shared/constants/blockchain/blockchain-icon.ts @@ -148,5 +148,6 @@ export const blockchainIcon: Record = { [BLOCKCHAIN_NAME.BAHAMUT]: `${basePath}bahamut.svg`, [BLOCKCHAIN_NAME.BITLAYER]: `${basePath}bitlayer.svg`, [BLOCKCHAIN_NAME.GRAVITY]: `${basePath}gravity.svg`, - [BLOCKCHAIN_NAME.UNICHAIN_SEPOLIA_TESTNET]: `${basePath}unichain-testnet.svg` + [BLOCKCHAIN_NAME.UNICHAIN_SEPOLIA_TESTNET]: `${basePath}unichain-testnet.svg`, + [BLOCKCHAIN_NAME.SONIC]: `${basePath}sonic.svg` }; diff --git a/src/app/shared/constants/blockchain/blockchain-label.ts b/src/app/shared/constants/blockchain/blockchain-label.ts index 22bf0464b7..e81b848438 100644 --- a/src/app/shared/constants/blockchain/blockchain-label.ts +++ b/src/app/shared/constants/blockchain/blockchain-label.ts @@ -146,5 +146,6 @@ export const blockchainLabel: Record = { [BLOCKCHAIN_NAME.BAHAMUT]: 'Bahamut', [BLOCKCHAIN_NAME.BITLAYER]: 'Bitlayer', [BLOCKCHAIN_NAME.GRAVITY]: 'Gravity', - [BLOCKCHAIN_NAME.UNICHAIN_SEPOLIA_TESTNET]: 'Unichain' + [BLOCKCHAIN_NAME.UNICHAIN_SEPOLIA_TESTNET]: 'Unichain', + [BLOCKCHAIN_NAME.SONIC]: 'Sonic' }; diff --git a/src/app/shared/constants/blockchain/blockchain-scanner.ts b/src/app/shared/constants/blockchain/blockchain-scanner.ts index bda820f62e..a0d1bff681 100644 --- a/src/app/shared/constants/blockchain/blockchain-scanner.ts +++ b/src/app/shared/constants/blockchain/blockchain-scanner.ts @@ -1178,5 +1178,13 @@ export const blockchainScanner: Record = { [ADDRESS_TYPE.TOKEN]: 'token/', [ADDRESS_TYPE.TRANSACTION]: 'tx/', [ADDRESS_TYPE.BLOCK]: 'block/' + }, + [BLOCKCHAIN_NAME.SONIC]: { + baseUrl: 'https://sonicscan.org/', + nativeCoinUrl: '', + [ADDRESS_TYPE.WALLET]: 'address/', + [ADDRESS_TYPE.TOKEN]: 'token/', + [ADDRESS_TYPE.TRANSACTION]: 'tx/', + [ADDRESS_TYPE.BLOCK]: 'block/' } }; diff --git a/src/app/shared/constants/blockchain/rpc-list.ts b/src/app/shared/constants/blockchain/rpc-list.ts index c818cb8dc5..2e78eb31a5 100644 --- a/src/app/shared/constants/blockchain/rpc-list.ts +++ b/src/app/shared/constants/blockchain/rpc-list.ts @@ -351,5 +351,6 @@ export const rpcList: Record & 'https://sepolia.unichain.org', 'https://1301.rpc.thirdweb.com/' ], - [BLOCKCHAIN_NAME.BITCOIN]: [''] + [BLOCKCHAIN_NAME.BITCOIN]: [''], + [BLOCKCHAIN_NAME.SONIC]: ['https://rpc.soniclabs.com', 'https://sonic.drpc.org'] }; diff --git a/src/app/shared/models/blockchain/should-calculate-gas.ts b/src/app/shared/models/blockchain/should-calculate-gas.ts index 16babac731..1c492eed7e 100644 --- a/src/app/shared/models/blockchain/should-calculate-gas.ts +++ b/src/app/shared/models/blockchain/should-calculate-gas.ts @@ -28,5 +28,6 @@ export const shouldCalculateGas: Record = { [BLOCKCHAIN_NAME.ROOTSTOCK]: true, [BLOCKCHAIN_NAME.SEI]: true, [BLOCKCHAIN_NAME.BITLAYER]: true, - [BLOCKCHAIN_NAME.GRAVITY]: true + [BLOCKCHAIN_NAME.GRAVITY]: true, + [BLOCKCHAIN_NAME.SONIC]: true }; diff --git a/src/assets/images/icons/coins/sonic.svg b/src/assets/images/icons/coins/sonic.svg new file mode 100644 index 0000000000..b19f198163 --- /dev/null +++ b/src/assets/images/icons/coins/sonic.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 5e974beb73..9cd62bfa15 100644 --- a/yarn.lock +++ b/yarn.lock @@ -17503,10 +17503,10 @@ rpc-websockets@^9.0.2: bufferutil "^4.0.1" utf-8-validate "^5.0.2" -rubic-sdk@5.49.8: - version "5.49.8" - resolved "https://registry.yarnpkg.com/rubic-sdk/-/rubic-sdk-5.49.8.tgz#9c4f467026216d27caeca712b8cbdb5b00a2c6c2" - integrity sha512-dN9ZrUnL9NT2zOSz3GDQmPmxkANQ3q3SXxTRWs3/5Uq3F11N7REBkXR/hAYe/fGqztw+UbvnmxFGKHPQk2NJ/Q== +rubic-sdk@5.49.9: + version "5.49.9" + resolved "https://registry.yarnpkg.com/rubic-sdk/-/rubic-sdk-5.49.9.tgz#8d6f271dc164e416cd449f53b8b8424d1ba7efc3" + integrity sha512-d0ZfMXCHJuvnsLivnrwj6ixiFuxSxrmSTBPda1YsLPBYG/PAVx8go9E/TFy9L+8SOcoLPlH0LwDHVKdO1T1U1Q== dependencies: "@1inch/limit-order-protocol-utils" "3.0.1" "@arbitrum/sdk" "^3.1.3"