From 35b76f974bb02cb149438736fc14fd8856e3ed05 Mon Sep 17 00:00:00 2001 From: ArunBala-Bitgo Date: Wed, 10 Sep 2025 15:23:51 +0530 Subject: [PATCH] feat: add statics and configuration for flow TICKET: WIN-7115 TICKET: WIN-7115 --- modules/sdk-core/src/bitgo/environments.ts | 6 ++++ modules/statics/src/allCoinsAndTokens.ts | 36 +++++++++++++++++++ modules/statics/src/base.ts | 2 ++ modules/statics/src/networks.ts | 20 +++++++++++ .../unit/fixtures/expectedColdFeatures.ts | 2 ++ 5 files changed, 66 insertions(+) diff --git a/modules/sdk-core/src/bitgo/environments.ts b/modules/sdk-core/src/bitgo/environments.ts index 70594888a8..4cc54fa26d 100644 --- a/modules/sdk-core/src/bitgo/environments.ts +++ b/modules/sdk-core/src/bitgo/environments.ts @@ -258,6 +258,9 @@ const mainnetBase: EnvironmentTemplate = { baseeth: { baseUrl: 'https://api.etherscan.io/v2', }, + flow: { + baseUrl: 'https://evm.flowscan.io/api', + }, }, icpNodeUrl: 'https://ic0.app', worldExplorerBaseUrl: 'https://worldscan.org/', @@ -383,6 +386,9 @@ const testnetBase: EnvironmentTemplate = { tbaseeth: { baseUrl: 'https://api.etherscan.io/v2', }, + flow: { + baseUrl: 'https://evm-testnet.flowscan.io/api', + }, }, stxNodeUrl: 'https://api.testnet.hiro.so', vetNodeUrl: 'https://rpc-testnet.vechain.energy', diff --git a/modules/statics/src/allCoinsAndTokens.ts b/modules/statics/src/allCoinsAndTokens.ts index 5844e30124..112dce9dcd 100644 --- a/modules/statics/src/allCoinsAndTokens.ts +++ b/modules/statics/src/allCoinsAndTokens.ts @@ -1961,6 +1961,42 @@ export const allCoinsAndTokens = [ POLYX_FEATURES, KeyCurve.Ed25519 ), + account( + 'cf601b71-5ed5-4524-b545-d6d19051781f', + 'flow', + 'Flow', + Networks.main.flow, + 18, + UnderlyingAsset.FLOW, + BaseUnit.ETH, + [ + ...EVM_FEATURES, + CoinFeature.SHARED_EVM_SIGNING, + CoinFeature.SHARED_EVM_SDK, + CoinFeature.EVM_COMPATIBLE_IMS, + CoinFeature.EVM_COMPATIBLE_UI, + CoinFeature.EVM_NON_BITGO_RECOVERY, + CoinFeature.EVM_UNSIGNED_SWEEP_RECOVERY, + ] + ), + account( + '29a233d0-6d60-4e1e-8f76-16712fee3bf5', + 'tflow', + 'Testnet Flow', + Networks.test.flow, + 18, + UnderlyingAsset.FLOW, + BaseUnit.ETH, + [ + ...EVM_FEATURES, + CoinFeature.SHARED_EVM_SIGNING, + CoinFeature.SHARED_EVM_SDK, + CoinFeature.EVM_COMPATIBLE_IMS, + CoinFeature.EVM_COMPATIBLE_UI, + CoinFeature.EVM_NON_BITGO_RECOVERY, + CoinFeature.EVM_UNSIGNED_SWEEP_RECOVERY, + ] + ), gasTankAccount( '98071460-1488-4edd-857f-0899bc5eee4f', 'vet', diff --git a/modules/statics/src/base.ts b/modules/statics/src/base.ts index bffbaaeb87..c996363d13 100644 --- a/modules/statics/src/base.ts +++ b/modules/statics/src/base.ts @@ -54,6 +54,7 @@ export enum CoinFamily { EOS = 'eos', FETCHAI = 'fetchai', FIAT = 'fiat', + FLOW = 'flow', FLR = 'flr', FLRP = 'flrp', HASH = 'hash', // Provenance @@ -525,6 +526,7 @@ export enum UnderlyingAsset { EUROC = 'euroc', EURR = 'eurr', FETCHAI = 'fetchai', + FLOW = 'flow', FLR = 'flr', FLRP = 'flrp', GTC = 'gtc', diff --git a/modules/statics/src/networks.ts b/modules/statics/src/networks.ts index 60ef6aad6c..df67c6036c 100644 --- a/modules/statics/src/networks.ts +++ b/modules/statics/src/networks.ts @@ -1909,6 +1909,24 @@ class IotaTestnet extends Testnet implements AccountNetwork { explorerUrl = 'https://explorer.iota.org/?network=testnet'; } +class Flow extends Mainnet implements EthereumNetwork { + name = 'Flow'; + family = CoinFamily.FLOW; + explorerUrl = 'https://evm.flowscan.io/tx/'; + accountExplorerUrl = 'https://evm.flowscan.io/address/'; + chainId = 747; + nativeCoinOperationHashPrefix = '747'; +} + +class FlowTestnet extends Testnet implements EthereumNetwork { + name = 'FlowTestnet'; + family = CoinFamily.FLOW; + explorerUrl = 'https://evm.flowscan.io/tx/'; + accountExplorerUrl = 'https://evm-testnet.flowscan.io/address/'; + chainId = 545; + nativeCoinOperationHashPrefix = '545'; +} + export const Networks = { main: { ada: Object.freeze(new Ada()), @@ -1945,6 +1963,7 @@ export const Networks = { ethereumW: Object.freeze(new EthereumW()), fiat: Object.freeze(new Fiat()), fetchai: Object.freeze(new FetchAi()), + flow: Object.freeze(new Flow()), flr: Object.freeze(new Flare()), flrP: Object.freeze(new FlareP()), hash: Object.freeze(new Hash()), @@ -2036,6 +2055,7 @@ export const Networks = { eos: Object.freeze(new EosTestnet()), fiat: Object.freeze(new FiatTestnet()), fetchai: Object.freeze(new FetchAiTestnet()), + flow: Object.freeze(new FlowTestnet()), flr: Object.freeze(new FlareTestnet()), flrP: Object.freeze(new FlarePTestnet()), mon: Object.freeze(new MonadTestnet()), diff --git a/modules/statics/test/unit/fixtures/expectedColdFeatures.ts b/modules/statics/test/unit/fixtures/expectedColdFeatures.ts index ad3dc3c90b..dcb31bd5b6 100644 --- a/modules/statics/test/unit/fixtures/expectedColdFeatures.ts +++ b/modules/statics/test/unit/fixtures/expectedColdFeatures.ts @@ -70,6 +70,7 @@ export const expectedColdFeatures = { 'cronos', 'dot', 'fetchai', + 'flow', 'flr', 'hash', 'icp', @@ -122,6 +123,7 @@ export const expectedColdFeatures = { 'tcronos', 'tdot', 'tfetchai', + 'tflow', 'tflr', 'tog', 'tmon',