Skip to content

Commit e92a0cc

Browse files
Merge pull request #8150 from BitGo/coin-onboard/codex
feat: add Codex EVM chain support
2 parents ba9875b + 6efd0da commit e92a0cc

File tree

6 files changed

+75
-0
lines changed

6 files changed

+75
-0
lines changed

modules/sdk-core/src/bitgo/environments.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ const mainnetBase: EnvironmentTemplate = {
221221
chiliz: {
222222
baseUrl: 'https://api.chiliscan.com',
223223
},
224+
codex: {
225+
baseUrl: 'https://explorer.codex.xyz/api',
226+
},
224227
phrs: {
225228
baseUrl: 'https://testnet.dplabs-internal.com', // TODO: WIN-5787 add mainnet url when its available
226229
},
@@ -409,6 +412,9 @@ const testnetBase: EnvironmentTemplate = {
409412
chiliz: {
410413
baseUrl: 'https://api.testnet.chiliscan.com',
411414
},
415+
codex: {
416+
baseUrl: 'https://explorer.codex-stg.xyz/api',
417+
},
412418
phrs: {
413419
baseUrl: 'https://testnet.dplabs-internal.com', // Wrong value, Not available yet
414420
},

modules/statics/src/allCoinsAndTokens.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2931,6 +2931,42 @@ export const allCoinsAndTokens = [
29312931
CoinFeature.SUPPORTS_ERC20,
29322932
]
29332933
),
2934+
account(
2935+
'e10b89f6-3d14-4d85-a05a-da53d6e60489',
2936+
'codex',
2937+
'Codex',
2938+
Networks.main.codex,
2939+
18,
2940+
UnderlyingAsset.CODEX,
2941+
BaseUnit.ETH,
2942+
[
2943+
...EVM_FEATURES,
2944+
CoinFeature.SHARED_EVM_SIGNING,
2945+
CoinFeature.SHARED_EVM_SDK,
2946+
CoinFeature.EVM_COMPATIBLE_IMS,
2947+
CoinFeature.EVM_COMPATIBLE_UI,
2948+
CoinFeature.EVM_COMPATIBLE_WP,
2949+
CoinFeature.SUPPORTS_ERC20,
2950+
]
2951+
),
2952+
account(
2953+
'3fe052be-5dc0-42b1-a5a8-63406296d06f',
2954+
'tcodex',
2955+
'Testnet Codex',
2956+
Networks.test.codex,
2957+
18,
2958+
UnderlyingAsset.CODEX,
2959+
BaseUnit.ETH,
2960+
[
2961+
...EVM_FEATURES,
2962+
CoinFeature.SHARED_EVM_SIGNING,
2963+
CoinFeature.SHARED_EVM_SDK,
2964+
CoinFeature.EVM_COMPATIBLE_IMS,
2965+
CoinFeature.EVM_COMPATIBLE_UI,
2966+
CoinFeature.EVM_COMPATIBLE_WP,
2967+
CoinFeature.SUPPORTS_ERC20,
2968+
]
2969+
),
29342970
erc20Token(
29352971
'16c438c1-714a-4ad7-bdb1-fb8d2575c466',
29362972
'tbaseeth:usdc',

modules/statics/src/base.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export enum CoinFamily {
4242
CANTON = 'canton',
4343
CELO = 'celo',
4444
CHILIZ = 'chiliz', // Chiliz Chain
45+
CODEX = 'codex',
4546
COREDAO = 'coredao',
4647
COREUM = 'coreum',
4748
CRONOS = 'cronos',
@@ -570,6 +571,7 @@ export enum UnderlyingAsset {
570571
DOT = 'dot',
571572
CELO = 'celo', // Celo main coin
572573
CHILIZ = 'chiliz', // Chiliz Chain native coin
574+
CODEX = 'codex',
573575
COREDAO = 'coredao',
574576
COREUM = 'coreum',
575577
CRONOS = 'cronos',

modules/statics/src/coins/ofcCoins.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,15 @@ export const ofcCoins = [
145145
UnderlyingAsset.CHILIZ,
146146
CoinKind.CRYPTO
147147
),
148+
ofc('de86d783-852b-4d92-b991-20e7f028cc54', 'ofccodex', 'Codex', 18, UnderlyingAsset.CODEX, CoinKind.CRYPTO),
149+
tofc(
150+
'dd58bac9-b4be-48cd-9113-55ab924d0c7c',
151+
'ofctcodex',
152+
'Codex Testnet',
153+
18,
154+
UnderlyingAsset.CODEX,
155+
CoinKind.CRYPTO
156+
),
148157
ofc('9e2da785-8349-4153-8276-941319575833', 'ofcxtz', 'Tezos', 6, UnderlyingAsset.XTZ, CoinKind.CRYPTO),
149158
ofc(
150159
'283b93b5-741b-4c85-a201-097267d65097',

modules/statics/src/networks.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,24 @@ class ChilizTestnet extends Testnet implements EthereumNetwork {
635635
tokenOperationHashPrefix = '88882-ERC20';
636636
}
637637

638+
class Codex extends Mainnet implements EthereumNetwork {
639+
name = 'Codex';
640+
family = CoinFamily.CODEX;
641+
explorerUrl = 'https://explorer.codex.xyz/tx/';
642+
accountExplorerUrl = 'https://explorer.codex.xyz/address/';
643+
chainId = 81224;
644+
nativeCoinOperationHashPrefix = '81224';
645+
}
646+
647+
class CodexTestnet extends Testnet implements EthereumNetwork {
648+
name = 'Testnet Codex';
649+
family = CoinFamily.CODEX;
650+
explorerUrl = 'https://explorer.codex-stg.xyz/tx/';
651+
accountExplorerUrl = 'https://explorer.codex-stg.xyz/address/';
652+
chainId = 812242;
653+
nativeCoinOperationHashPrefix = '812242';
654+
}
655+
638656
// TODO update explorerUrl STLX-1657
639657
class Casper extends Mainnet implements AccountNetwork {
640658
name = 'Casper';
@@ -2418,6 +2436,7 @@ export const Networks = {
24182436
casper: Object.freeze(new Casper()),
24192437
celo: Object.freeze(new Celo()),
24202438
chiliz: Object.freeze(new Chiliz()),
2439+
codex: Object.freeze(new Codex()),
24212440
coredao: Object.freeze(new Coredao()),
24222441
coreum: Object.freeze(new Coreum()),
24232442
cronos: Object.freeze(new Cronos()),
@@ -2533,6 +2552,7 @@ export const Networks = {
25332552
casper: Object.freeze(new CasperTestnet()),
25342553
celo: Object.freeze(new CeloTestnet()),
25352554
chiliz: Object.freeze(new ChilizTestnet()),
2555+
codex: Object.freeze(new CodexTestnet()),
25362556
coredao: Object.freeze(new CoredaoTestnet()),
25372557
cronos: Object.freeze(new CronosTestnet()),
25382558
dash: Object.freeze(new DashTestnet()),

modules/statics/test/unit/fixtures/expectedColdFeatures.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export const expectedColdFeatures = {
8484
'bsc',
8585
'canton',
8686
'chiliz',
87+
'codex',
8788
'coredao',
8889
'coreum',
8990
'cronos',
@@ -151,6 +152,7 @@ export const expectedColdFeatures = {
151152
'tbsc',
152153
'tcanton',
153154
'tchiliz',
155+
'tcodex',
154156
'tcoredao',
155157
'tcoreum',
156158
'tcronos',

0 commit comments

Comments
 (0)